libresman
view src/resman.h @ 5:bd9b4ff19c93
more stuff
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 01 Feb 2014 08:02:08 +0200 |
parents | 469ce01809bc |
children | 410c19c735b2 |
line source
1 #ifndef RESOURCE_MANAGER_H_
2 #define RESOURCE_MANAGER_H_
4 /* load callback: everything or just file read/parse stage
5 * create callback: second-stage callback for first creation
6 * update callback: second-stage callback for reload
7 */
8 typedef int (*resman_load_func)(const char *fname, void *data, void *closure);
9 typedef int (*resman_create_func)(void *data, void *closure);
10 typedef int (*resman_update_func)(void *data, void *closure);
11 typedef void (*resman_destroy_func)(void *data, void *closure);
13 struct resman;
15 struct resman *resman_create(void);
16 void resman_free(struct resman *rman);
18 int resman_init(struct resman *rman);
19 void resman_destroy(struct resman *rman);
21 void resman_set_load_func(struct resman *rman, resman_load_func func, void *cls);
22 void resman_set_create_func(struct resman *rman, resman_create_func func, void *cls);
23 void resman_set_update_func(struct resman *rman, resman_update_func func, void *cls);
24 void resman_set_destroy_func(struct resman *rman, resman_destroy_func func, void *cls);
26 int resman_lookup(struct resman *rman, const char *fname, void *data);
27 void resman_wait(struct resman *rman, int id);
29 int resman_poll(struct resman *rman);
31 void resman_set_res_data(struct resman *rman, int res_id, void *data);
32 void *resman_get_res_data(struct resman *rman, int res_id);
35 #endif /* RESOURCE_MANAGER_H_ */