-void dictionary_init(dictionary_t*dict);
-void dictionary_put(dictionary_t*dict, string_t t1, void* t2);
-void dictionary_put2(dictionary_t*dict, const char* t1, void* t2);
-void* dictionary_lookup(dictionary_t*dict, const char*name);
-void dictionary_dump(dictionary_t*dict, FILE*fi, const char*prefix);
-void dictionary_del(dictionary_t*dict, const char* name);
-void dictionary_clear(dictionary_t*dict);
-void dictionary_destroy(dictionary_t*dict);
-
-char* strdup_n(const char*str, int size);
-
-void* qmalloc_internal(int len);
-void* qrealloc_internal(void*old, int len);
-void qfree_internal(void*old);
-
-#define qmalloc(len) qmalloc_internal(len)
-#define qrealloc(old, len) qmalloc_internal(old, len)
-#define qfree(old) qmalloc_internal(old)
+void heap_init(heap_t*h,int n,int elem_size, int(*compare)(const void *, const void *));
+void heap_clear(heap_t*h);
+void heap_put(heap_t*h, void*e);
+int heap_size(heap_t*h);
+void* heap_max(heap_t*h);
+void* heap_chopmax(heap_t*h);
+void heap_dump(heap_t*h, FILE*fi);
+void** heap_flatten(heap_t*h);
+
+array_t* array_new();
+array_t* array_new2(type_t*type);
+void array_free(array_t*array);
+void*array_getkey(array_t*array, int nr);
+void*array_getvalue(array_t*array, int nr);
+int array_append(array_t*array, const void*name, void*data);
+#define array_contains(a,b) (array_find((a),(b))>=0)
+int array_find(array_t*array, const void*name);
+int array_find2(array_t*array, const void*name, void*data);
+int array_update(array_t*array, const void*name, void*data);
+int array_append_if_new(array_t*array, const void*name, void*data);
+#define array_length(a) ((a)->num)
+
+#define DECLARE(x) struct _##x;typedef struct _##x x##_t;
+#define DECLARE_LIST(x) \
+struct _##x##_list { \
+ struct _##x* x; \
+ struct _##x##_list*next; \
+}; \
+typedef struct _##x##_list x##_list_t;
+int list_length_(void*_list);
+void*list_clone_(void*_list);
+void list_append_(void*_list, void*entry);
+void list_prepend_(void*_list, void*entry);
+void list_free_(void*_list);
+void list_concat_(void*l1, void*l2);
+#define list_new() ((void*)0)
+#define list_append(list, e) {sizeof((list)->next);list_append_(&(list),(e));}
+#define list_concat(l1, l2) {sizeof((l1)->next);sizeof((l2)->next);list_concat_(&(l1),&(l2));}
+#define list_prepend(list, e) {sizeof((list)->next);list_prepend_(&(list),(e));}
+#define list_free(list) {sizeof((list)->next);list_free_(&(list));}
+#define list_clone(list) (sizeof((list)->next),list_clone_(&(list)))
+#define list_length(list) (sizeof((list)->next),list_length_(list))