- for(t=0;t<d->hashsize;t++) {
- dictentry_t*l = d->slots[t];
- while(l) {
- slotinfo_t*s2 = (slotinfo_t*)l->data;
- fprintf(fi, "%s", prefix);
- char*id2 = mkid2(id, s2->name);
- fprintf(fi, "dict_put(&%s.members, &%s, &%s);\n", id, id2,id2);
- l = l->next;
- }
- }
+ DICT_ITERATE_DATA(d1,slotinfo_t*,s1) {
+ fprintf(fi, "%s", prefix);
+ char*id2 = mkid2(id, s1->name);
+ fprintf(fi, "dict_put(&%s.members, &%s, &%s);\n", id, id2, id2);
+ }
+ DICT_ITERATE_DATA(d2,slotinfo_t*,s2) {
+ fprintf(fi, "%s", prefix);
+ char*id2 = mkid2(id, s2->name);
+ fprintf(fi, "dict_put(&%s.static_members, &%s, &%s);\n", id, id2, id2);
+ }
+ }
+}
+
+void write_constant(FILE*fi, constant_t*value, char*id, char*prefix)
+{
+ if(NS_TYPE(value->type)) {
+ fprintf(fi, "%s", prefix);
+ fprintf(fi, "static namespace_t %s_constant_ns = {0x%02x, \"%s\"};\n", id, value->ns->access, value->ns->name);
+ } else if(value->type == CONSTANT_STRING) {
+ fprintf(fi, "%s", prefix);
+ fprintf(fi, "static string_t %s_constant_s = {\"%s\", %d};\n", id, value->s->str, value->s->len);