libresman

diff src/resman.h @ 10:4d18498a0078

moved the resource manager a bit further
author John Tsiombikas <nuclear@member.fsf.org>
date Wed, 05 Feb 2014 02:01:49 +0200
parents 410c19c735b2
children bebc065a941f
line diff
     1.1 --- a/src/resman.h	Tue Feb 04 05:42:31 2014 +0200
     1.2 +++ b/src/resman.h	Wed Feb 05 02:01:49 2014 +0200
     1.3 @@ -2,12 +2,11 @@
     1.4  #define RESOURCE_MANAGER_H_
     1.5  
     1.6  /* load callback: everything or just file read/parse stage
     1.7 - * create callback: second-stage callback for first creation
     1.8 - * update callback: second-stage callback for reload
     1.9 + * done callback: second-stage callback, called in the context of the
    1.10 + *                user thread, after the load callback returns
    1.11   */
    1.12  typedef int (*resman_load_func)(const char *fname, void *data, void *closure);
    1.13 -typedef int (*resman_create_func)(void *data, void *closure);
    1.14 -typedef int (*resman_update_func)(void *data, void *closure);
    1.15 +typedef int (*resman_done_func)(int result, void *data, void *closure);
    1.16  typedef void (*resman_destroy_func)(void *data, void *closure);
    1.17  
    1.18  struct resman;
    1.19 @@ -23,8 +22,7 @@
    1.20  void resman_destroy(struct resman *rman);
    1.21  
    1.22  void resman_set_load_func(struct resman *rman, resman_load_func func, void *cls);
    1.23 -void resman_set_create_func(struct resman *rman, resman_create_func func, void *cls);
    1.24 -void resman_set_update_func(struct resman *rman, resman_update_func func, void *cls);
    1.25 +void resman_set_done_func(struct resman *rman, resman_done_func func, void *cls);
    1.26  void resman_set_destroy_func(struct resman *rman, resman_destroy_func func, void *cls);
    1.27  
    1.28  int resman_lookup(struct resman *rman, const char *fname, void *data);
    1.29 @@ -35,6 +33,8 @@
    1.30  void resman_set_res_data(struct resman *rman, int res_id, void *data);
    1.31  void *resman_get_res_data(struct resman *rman, int res_id);
    1.32  
    1.33 +int resman_get_res_error(struct resman *rman, int res_id);
    1.34 +
    1.35  #ifdef __cplusplus
    1.36  }
    1.37  #endif