Index: trunk/src_3rd/load_cache/load_cache.h =================================================================== --- trunk/src_3rd/load_cache/load_cache.h (revision 761) +++ trunk/src_3rd/load_cache/load_cache.h (revision 762) @@ -52,19 +52,23 @@ ldch_uid_t next_low_uid; }; - +/* The host application may keep multiple, independent cache contexts */ void ldch_init(ldch_ctx_t *ctx); void ldch_uninit(ldch_ctx_t *ctx); +/* Parsers need to be registered in the context so they can be referenced by name.*/ ldch_low_parser_t *ldch_reg_low_parser(ldch_ctx_t *ctx, const char *name); ldch_high_parser_t *ldch_reg_high_parser(ldch_ctx_t *ctx, const char *name); - ldch_low_parser_t *ldch_lookup_low_parser(ldch_ctx_t *ctx, const char *name); ldch_high_parser_t *ldch_lookup_high_parser(ldch_ctx_t *ctx, const char *name); +/* Load a file from disk or from memory; in any case if the modification timestamp + on disk is higher than the cached timestamp, reload the file */ ldch_data_t *ldch_load_(ldch_ctx_t *ctx, const char *filename, ldch_low_parser_t *low, ldch_high_parser_t *high, void *low_call_ctx, void *high_call_ctx); ldch_data_t *ldch_load(ldch_ctx_t *ctx, const char *filename, const char *low, const char *high, void *low_call_ctx, void *high_call_ctx); +/* Remove a single file from a context, freeing all memory taken by the parsed + data. Will be re-loaded upon next request */ void ldch_unload(ldch_ctx_t *ctx, ldch_file_t *file);