3 Extension module for the rfxswf library.
4 Part of the swftools package.
6 Copyright (c) 2008 Matthias Kramm <kramm@quiss.org>
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
22 #ifndef __as3_utils_h__
23 #define __as3_utils_h__
25 #define NEW(t,y) t*y = (t*)malloc(sizeof(t));memset(y, 0, sizeof(t));
27 #define DECLARE(x) struct _##x;typedef struct _##x x##_t;
28 #define DECLARE_LIST(x) \
29 struct _##x##_list { \
31 struct _##x##_list*next; \
33 typedef struct _##x##_list x##_list_t; \
35 int list_length(void*_list);
36 void list_append(void*_list, void*entry);
38 typedef struct _dict_entry {
43 typedef struct _dict {
50 void dict_free(dict_t*dict);
51 const char*dict_getstr(dict_t*dict, int nr);
52 char*dict_getdata(dict_t*dict, int nr);
53 int dict_append(dict_t*dict, const char*name, void*data);
54 int dict_find(dict_t*dict, const char*name);
55 int dict_find2(dict_t*dict, const char*name, void*data);
56 int dict_update(dict_t*dict, const char*name, void*data);
57 int dict_append_if_new(dict_t*dict, const char*name, void*data);