rev |
line source |
nuclear@0
|
1 #ifndef RESOURCE_MANAGER_H_
|
nuclear@0
|
2 #define RESOURCE_MANAGER_H_
|
nuclear@0
|
3
|
nuclear@5
|
4 /* load callback: everything or just file read/parse stage
|
nuclear@5
|
5 * create callback: second-stage callback for first creation
|
nuclear@5
|
6 * update callback: second-stage callback for reload
|
nuclear@5
|
7 */
|
nuclear@5
|
8 typedef int (*resman_load_func)(const char *fname, void *data, void *closure);
|
nuclear@5
|
9 typedef int (*resman_create_func)(void *data, void *closure);
|
nuclear@5
|
10 typedef int (*resman_update_func)(void *data, void *closure);
|
nuclear@5
|
11 typedef void (*resman_destroy_func)(void *data, void *closure);
|
nuclear@5
|
12
|
nuclear@0
|
13 struct resman;
|
nuclear@0
|
14
|
nuclear@5
|
15 struct resman *resman_create(void);
|
nuclear@5
|
16 void resman_free(struct resman *rman);
|
nuclear@5
|
17
|
nuclear@0
|
18 int resman_init(struct resman *rman);
|
nuclear@0
|
19 void resman_destroy(struct resman *rman);
|
nuclear@0
|
20
|
nuclear@5
|
21 void resman_set_load_func(struct resman *rman, resman_load_func func, void *cls);
|
nuclear@5
|
22 void resman_set_create_func(struct resman *rman, resman_create_func func, void *cls);
|
nuclear@5
|
23 void resman_set_update_func(struct resman *rman, resman_update_func func, void *cls);
|
nuclear@5
|
24 void resman_set_destroy_func(struct resman *rman, resman_destroy_func func, void *cls);
|
nuclear@0
|
25
|
nuclear@5
|
26 int resman_lookup(struct resman *rman, const char *fname, void *data);
|
nuclear@1
|
27 void resman_wait(struct resman *rman, int id);
|
nuclear@1
|
28
|
nuclear@1
|
29 int resman_poll(struct resman *rman);
|
nuclear@1
|
30
|
nuclear@1
|
31 void resman_set_res_data(struct resman *rman, int res_id, void *data);
|
nuclear@1
|
32 void *resman_get_res_data(struct resman *rman, int res_id);
|
nuclear@1
|
33
|
nuclear@0
|
34
|
nuclear@0
|
35 #endif /* RESOURCE_MANAGER_H_ */
|