libresman
view src/resman.h @ 6:410c19c735b2
- removed the glew dependency
- initial thread pool implementation
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Mon, 03 Feb 2014 05:22:09 +0200 |
parents | bd9b4ff19c93 |
children | 4d18498a0078 |
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 #ifdef __cplusplus
16 extern "C" {
17 #endif
19 struct resman *resman_create(void);
20 void resman_free(struct resman *rman);
22 int resman_init(struct resman *rman);
23 void resman_destroy(struct resman *rman);
25 void resman_set_load_func(struct resman *rman, resman_load_func func, void *cls);
26 void resman_set_create_func(struct resman *rman, resman_create_func func, void *cls);
27 void resman_set_update_func(struct resman *rman, resman_update_func func, void *cls);
28 void resman_set_destroy_func(struct resman *rman, resman_destroy_func func, void *cls);
30 int resman_lookup(struct resman *rman, const char *fname, void *data);
31 void resman_wait(struct resman *rman, int id);
33 int resman_poll(struct resman *rman);
35 void resman_set_res_data(struct resman *rman, int res_id, void *data);
36 void *resman_get_res_data(struct resman *rman, int res_id);
38 #ifdef __cplusplus
39 }
40 #endif
43 #endif /* RESOURCE_MANAGER_H_ */