summaryrefslogtreecommitdiffstats
path: root/src/resources/resource.h
blob: 5bec5e805aadccab6ec181ae6e86b9c918eec201 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#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