nuclear@0: #ifndef RESOURCE_MANAGER_H_ nuclear@0: #define RESOURCE_MANAGER_H_ nuclear@0: nuclear@0: struct resman; nuclear@0: nuclear@0: int resman_init(struct resman *rman); nuclear@0: void resman_destroy(struct resman *rman); nuclear@0: nuclear@0: /* The load callback will be called to load a data file. It may be called in the nuclear@0: * context of a different loading thread. nuclear@0: */ nuclear@1: /*void resman_set_load_func(struct resman *rman, resman_load_func_t func, void *cls);*/ nuclear@0: nuclear@0: /* The "done" callback will be called in the context of the main thread, whenever a nuclear@0: * file was sucessfully loaded, or an error occured. nuclear@0: * It's first argument (status) is set to whatever the load function returned, and its nuclear@1: * closure pointer is the closure ... nuclear@0: */ nuclear@1: /*void resman_set_done_func(struct resman *rman, resman_done_func_t func);*/ nuclear@1: nuclear@1: nuclear@1: int resman_lookup(struct resman *rman, const char *fname, void *cls); nuclear@1: void resman_wait(struct resman *rman, int id); nuclear@1: nuclear@1: int resman_poll(struct resman *rman); nuclear@1: nuclear@1: void resman_set_res_data(struct resman *rman, int res_id, void *data); nuclear@1: void *resman_get_res_data(struct resman *rman, int res_id); nuclear@1: nuclear@0: nuclear@0: #endif /* RESOURCE_MANAGER_H_ */