-xbt_mallocator_t lib_mallocator = NULL;
-
-/*####[ Private prototypes ]#################################################*/
-static void *lib_mallocator_new_f(void);
-static void lib_mallocator_free_f(void *dict);
-static void lib_mallocator_reset_f(void *dict);
-
-static void xbt_lib_set_ext(xbt_lib_t lib,const char *key,
- int key_len, int level, void *data);
-
-static unsigned int xbt_lib_hash_ext(const char *str,
- int str_len);
-static unsigned int xbt_lib_hash(const char *str);
-static void xbt_lib_rehash(xbt_lib_t lib);
-
-
-static xbt_lib_cursor_t xbt_lib_cursor_new(const xbt_lib_t lib);
-static void xbt_lib_cursor_rewind(xbt_lib_cursor_t cursor);
-static void xbt_lib_cursor_free(xbt_lib_cursor_t * cursor);
-
-/*####[ Code ]###############################################################*/
-
-void xbt_lib_preinit(void)
-{
- if (lib_mallocator != NULL) {
- xbt_mallocator_free(lib_mallocator);
- }
-
- lib_mallocator = xbt_mallocator_new(256,
- lib_mallocator_new_f,
- lib_mallocator_free_f,
- lib_mallocator_reset_f);
-}
-
-void xbt_lib_postexit(void)
-{
- if (lib_mallocator != NULL) {
- xbt_mallocator_free(lib_mallocator);
- lib_mallocator = NULL;
- }
-}
-
-static xbt_libelm_t xbt_libelm_new(const char *key,
- int key_len,
- unsigned int hash_code,
- void *content,int level, int level_numbers)
-{
- xbt_libelm_t element = xbt_malloc0(sizeof (s_xbt_libelm_t) + sizeof(void *)*(level_numbers-1));
-
- element->key = xbt_new(char, key_len + 1);
- memcpy((void *) element->key, (void *) key, key_len);
- element->key[key_len] = '\0';
-
- element->key_len = key_len;
- element->hash_code = hash_code;
-
- (&(element->content))[level] = content;
- element->next = NULL;
-
- return element;
-}