+ map_internal_t*m = (map_internal_t*)map->internal;
+ dict_foreach_keyvalue(&m->d, dumpmapentry, fi);
+}
+void map_clear(map_t*map)
+{
+ map_internal_t*m = (map_internal_t*)map->internal;
+ dict_free_all(&m->d, freestring);
+ rfx_free(m);
+}
+void map_destroy(map_t*map)
+{
+ map_clear(map);
+ rfx_free(map);
+}
+
+// ------------------------------- array_t --------------------------------------
+
+array_t* array_new() {
+ array_t*d = malloc(sizeof(array_t));
+ memset(d, 0, sizeof(array_t));
+ d->entry2pos = dict_new();
+ return d;
+}
+array_t* array_new2(type_t*type) {
+ array_t*d = malloc(sizeof(array_t));
+ memset(d, 0, sizeof(array_t));
+ d->entry2pos = dict_new2(type);
+ return d;
+}
+void*array_getkey(array_t*array, int nr) {
+ if(nr > array->num || nr<0) {
+ printf("error: reference to element %d in array[%d]\n", nr, array->num);
+ *(int*)0 = 0xdead;
+ return 0;
+ }
+ return array->d[nr].name;
+}
+void*array_getvalue(array_t*array, int nr) {
+ if(nr > array->num || nr<0) {
+ printf("error: reference to element %d in array[%d]\n", nr, array->num);
+ *(int*)0 = 0xdead;
+ return 0;
+ }
+ return array->d[nr].data;
+}
+int array_append(array_t*array, const void*name, void*data) {
+ while(array->size <= array->num) {
+ array->size += 64;
+ if(!array->d) {
+ array->d = malloc(sizeof(array_entry_t)*array->size);
+ } else {
+ array->d = realloc(array->d, sizeof(array_entry_t)*array->size);