Part of the swftools package.
- Copyright (c) 2001,2002,2003 Matthias Kramm <kramm@quiss.org>
+ Copyright (c) 2001,2002,2003,2004 Matthias Kramm <kramm@quiss.org>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
int pos;
} mem_t;
+/* fifo buffered growing mem region */
typedef struct _ringbuffer_t
{
void*internal;
void*internal;
} stringarray_t;
+/* heap */
+typedef struct _heap
+{
+ void**elements;
+ char*data;
+ int elem_size;
+ int size;
+ int max_size;
+ int(*compare)(const void *, const void *);
+} heap_t;
+
void mem_init(mem_t*mem);
int mem_put(mem_t*m, void*data, int length);
int mem_putstring(mem_t*m, string_t str);
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);
+stringarray_t* dictionary_index(dictionary_t*dict);
+int dictionary_count(dictionary_t* dict);
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);
+void dictionary_free_all(dictionary_t* dict, void (*freeFunction)(void*));
-char* strdup_n(const char*str, int size);
+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);
-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)
+char* strdup_n(const char*str, int size);
#ifdef __cplusplus
}