4 Part of the swftools package.
6 Copyright (c) 2001 Matthias Kramm <kramm@quiss.org>
8 This file is distributed under the GPL, see file COPYING for details */
15 /* dynamically growing mem section */
16 typedef struct _mem_t {
22 typedef struct _ringbuffer_t
28 /* non-nul terminated string */
29 typedef struct _string_t {
34 /* key/value pairs of strings */
35 typedef struct _map_t {
39 /* (void*)s referenced by strings */
40 typedef struct _dictionary_t {
44 /* array of strings */
45 typedef struct _stringarray_t
50 void mem_init(mem_t*mem);
51 int mem_put(mem_t*m, void*data, int length);
52 int mem_putstring(mem_t*m, string_t str);
53 void mem_clear(mem_t*mem);
54 void mem_destroy(mem_t*mem);
56 void ringbuffer_init(ringbuffer_t*r);
57 void ringbuffer_put(ringbuffer_t*r, void*buf, int size);
58 int ringbuffer_read(ringbuffer_t*r, void*buf, int size);
59 void ringbuffer_clear(ringbuffer_t*r);
61 void string_set(string_t*str, char*text);
62 void string_set2(string_t*str, char*text, int len);
63 void string_dup(string_t*str, const char*text);
64 void string_dup2(string_t*str, const char*text, int len);
65 int string_equals(string_t*str, const char*text);
67 void stringarray_init(stringarray_t*sa);
68 void stringarray_put(stringarray_t*sa, string_t str);
69 char* stringarray_at(stringarray_t*sa, int pos);
70 string_t stringarray_at2(stringarray_t*sa, int pos);
71 int stringarray_find(stringarray_t*sa, string_t*str);
72 void stringarray_clear(stringarray_t*sa);
73 void stringarray_destroy(stringarray_t*sa);
75 void map_init(map_t*map);
76 void map_put(map_t*map, string_t t1, string_t t2);
77 char* map_lookup(map_t*map, const char*name);
78 void map_dump(map_t*map, FILE*fi, const char*prefix);
79 void map_clear(map_t*map);
80 void map_destroy(map_t*map);
82 void dictionary_init(dictionary_t*dict);
83 void dictionary_put(dictionary_t*dict, string_t t1, void* t2);
84 void dictionary_put2(dictionary_t*dict, const char* t1, void* t2);
85 void* dictionary_lookup(dictionary_t*dict, const char*name);
86 void dictionary_dump(dictionary_t*dict, FILE*fi, const char*prefix);
87 void dictionary_del(dictionary_t*dict, const char* name);
88 void dictionary_clear(dictionary_t*dict);
89 void dictionary_destroy(dictionary_t*dict);
91 char* strndup(const char*str, int size);
93 void* qmalloc_internal(int len);
94 void* qrealloc_internal(void*old, int len);
95 void qfree_internal(void*old);
97 #define qmalloc(len) qmalloc_internal(len)
98 #define qrealloc(old, len) qmalloc_internal(old, len)
99 #define qfree(old) qmalloc_internal(old)