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 */
19 /* dynamically growing mem section */
20 typedef struct _mem_t {
26 typedef struct _ringbuffer_t
32 /* non-nul terminated string */
33 typedef struct _string_t {
38 /* key/value pairs of strings */
39 typedef struct _map_t {
43 /* (void*)s referenced by strings */
44 typedef struct _dictionary_t {
48 /* array of strings */
49 typedef struct _stringarray_t
54 void mem_init(mem_t*mem);
55 int mem_put(mem_t*m, void*data, int length);
56 int mem_putstring(mem_t*m, string_t str);
57 void mem_clear(mem_t*mem);
58 void mem_destroy(mem_t*mem);
60 void ringbuffer_init(ringbuffer_t*r);
61 void ringbuffer_put(ringbuffer_t*r, void*buf, int size);
62 int ringbuffer_read(ringbuffer_t*r, void*buf, int size);
63 void ringbuffer_clear(ringbuffer_t*r);
65 void string_set(string_t*str, char*text);
66 void string_set2(string_t*str, char*text, int len);
67 void string_dup(string_t*str, const char*text);
68 void string_dup2(string_t*str, const char*text, int len);
69 int string_equals(string_t*str, const char*text);
71 void stringarray_init(stringarray_t*sa);
72 void stringarray_put(stringarray_t*sa, string_t str);
73 char* stringarray_at(stringarray_t*sa, int pos);
74 string_t stringarray_at2(stringarray_t*sa, int pos);
75 int stringarray_find(stringarray_t*sa, string_t*str);
76 void stringarray_clear(stringarray_t*sa);
77 void stringarray_destroy(stringarray_t*sa);
79 void map_init(map_t*map);
80 void map_put(map_t*map, string_t t1, string_t t2);
81 char* map_lookup(map_t*map, const char*name);
82 void map_dump(map_t*map, FILE*fi, const char*prefix);
83 void map_clear(map_t*map);
84 void map_destroy(map_t*map);
86 void dictionary_init(dictionary_t*dict);
87 void dictionary_put(dictionary_t*dict, string_t t1, void* t2);
88 void dictionary_put2(dictionary_t*dict, const char* t1, void* t2);
89 void* dictionary_lookup(dictionary_t*dict, const char*name);
90 void dictionary_dump(dictionary_t*dict, FILE*fi, const char*prefix);
91 void dictionary_del(dictionary_t*dict, const char* name);
92 void dictionary_clear(dictionary_t*dict);
93 void dictionary_destroy(dictionary_t*dict);
95 char* strndup(const char*str, int size);
97 void* qmalloc_internal(int len);
98 void* qrealloc_internal(void*old, int len);
99 void qfree_internal(void*old);
101 #define qmalloc(len) qmalloc_internal(len)
102 #define qrealloc(old, len) qmalloc_internal(old, len)
103 #define qfree(old) qmalloc_internal(old)