23 #ifndef newgen_map_included
24 #define newgen_map_included
30 #define HASH_GET(start,image,h,k) \
31 hash_map_get((const hash_table)(h), (const void *)(k))
32 #define HASH_BOUND_P(start, image, h, k) \
33 hash_map_defined_p((const hash_table)(h), (const void *)(k))
34 #define HASH_UPDATE(start,image,h,k,v) \
35 hash_map_update((h), (const void *)(k), (const void *)(v))
36 #define HASH_EXTEND(start,image,h,k,v) \
37 hash_map_put((h), (const void *)(k), (const void *)(v))
38 #define HASH_DELETE(start,image,h,k) \
39 hash_map_del((h), (const void *)(k))
42 #define FUNCTION_MAP(type, start, image, k, v, code, fun) \
44 type NGMID(f) = (fun); \
45 hash_table NGMID(h) = (type##_hash_table(NGMID(f))); \
46 register void * NGMID(i) = NULL; \
47 gen_chunk * NGMID(k); \
48 gen_chunk * NGMID(v); \
50 hash_table_scan(NGMID(h), NGMID(i), \
51 (void**) &NGMID(k), (void**) &NGMID(v)))) \
53 type##_key_type k = (type##_key_type) (NGMID(k))->start ; \
54 type##_value_type v = (type##_value_type) (NGMID(v))->image; \
60 #define FUNCTION_FOREACH(type, key, val, k, v, fun) \
61 type NGMID(f) = fun; \
62 message_assert("check domain", \
63 NGMID(f) && type##_defined_p(NGMID(f)) && \
64 type##_domain_number(NGMID(f)) == type##_domain); \
65 hash_table NGMID(h) = type##_hash_table(NGMID(f)); \
67 type##_value_type v; \
68 gen_chunk * NGMID(k); \
69 gen_chunk * NGMID(v); \
70 for (register void * NGMID(i) = NULL; \
72 hash_table_scan(NGMID(h), NGMID(i), \
73 (void**) & NGMID(k), (void**) & NGMID(v))), \
74 k = (type##_key_type) (NGMID(i)? NGMID(k)->key: NULL), \
75 v = (type##_value_type) (NGMID(i)? NGMID(v)->val: NULL), \