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@6
|
15 #ifdef __cplusplus
|
nuclear@6
|
16 extern "C" {
|
nuclear@6
|
17 #endif
|
nuclear@6
|
18
|
nuclear@5
|
19 struct resman *resman_create(void);
|
nuclear@5
|
20 void resman_free(struct resman *rman);
|
nuclear@5
|
21
|
nuclear@0
|
22 int resman_init(struct resman *rman);
|
nuclear@0
|
23 void resman_destroy(struct resman *rman);
|
nuclear@0
|
24
|
nuclear@5
|
25 void resman_set_load_func(struct resman *rman, resman_load_func func, void *cls);
|
nuclear@5
|
26 void resman_set_create_func(struct resman *rman, resman_create_func func, void *cls);
|
nuclear@5
|
27 void resman_set_update_func(struct resman *rman, resman_update_func func, void *cls);
|
nuclear@5
|
28 void resman_set_destroy_func(struct resman *rman, resman_destroy_func func, void *cls);
|
nuclear@0
|
29
|
nuclear@5
|
30 int resman_lookup(struct resman *rman, const char *fname, void *data);
|
nuclear@1
|
31 void resman_wait(struct resman *rman, int id);
|
nuclear@1
|
32
|
nuclear@1
|
33 int resman_poll(struct resman *rman);
|
nuclear@1
|
34
|
nuclear@1
|
35 void resman_set_res_data(struct resman *rman, int res_id, void *data);
|
nuclear@1
|
36 void *resman_get_res_data(struct resman *rman, int res_id);
|
nuclear@1
|
37
|
nuclear@6
|
38 #ifdef __cplusplus
|
nuclear@6
|
39 }
|
nuclear@6
|
40 #endif
|
nuclear@6
|
41
|
nuclear@0
|
42
|
nuclear@0
|
43 #endif /* RESOURCE_MANAGER_H_ */
|