#ifndef RESOURCE_H #define RESOURCE_H struct resource_table { struct resource *head; struct resource *tail; }; struct resource { char *path; int refs; struct resource *prev; struct resource *next; }; void *resource_alloc(const char *path, size_t size); struct resource *resource_get(struct resource_table *resources, const char *path); void resource_add(struct resource_table *resources, const char *path, struct resource *new_res); void resource_use(struct resource *resource); int resource_free(struct resource_table *resources, struct resource *resource); #endif