-
- swf_SetU30(tag, pool->ints->num>1?pool->ints->num:0);
- for(t=1;t<pool->ints->num;t++) {
- S32 val = (ptroff_t)array_getvalue(pool->ints, t);
- swf_SetS30(tag, val);
- }
- swf_SetU30(tag, pool->uints->num>1?pool->uints->num:0);
- for(t=1;t<pool->uints->num;t++) {
- swf_SetU30(tag, (ptroff_t)array_getvalue(pool->uints, t));
- }
- swf_SetU30(tag, pool->floats->num>1?pool->floats->num:0);
- for(t=1;t<pool->floats->num;t++) {
- array_getvalue(pool->floats, t);
- swf_SetD64(tag, 0.0); // fixme
- }
- swf_SetU30(tag, pool->strings->num>1?pool->strings->num:0);
- for(t=1;t<pool->strings->num;t++) {
- swf_SetU30String(tag, array_getkey(pool->strings, t));
- }
- swf_SetU30(tag, pool->namespaces->num>1?pool->namespaces->num:0);
- for(t=1;t<pool->namespaces->num;t++) {
- namespace_t*ns= (namespace_t*)array_getvalue(pool->namespaces, t);
- const char*name = ns->name;
- int i = pool_find_string(pool, name);
- swf_SetU8(tag, ns->access);
- swf_SetU30(tag, i);
- }
- swf_SetU30(tag, pool->namespace_sets->num>1?pool->namespace_sets->num:0);
- for(t=1;t<pool->namespace_sets->num;t++) {
- namespace_set_t*set = (namespace_set_t*)array_getvalue(pool->namespace_sets, t);
- namespace_list_t*i = set->namespaces;
- int len = list_length(i);
- swf_SetU30(tag, len);
- while(i) {
- int index = pool_find_namespace(pool, i->namespace);
- swf_SetU30(tag, index);
- i = i->next;
- }
- }
-
- swf_SetU30(tag, pool->multinames->num>1?pool->multinames->num:0);
- for(t=1;t<pool->multinames->num;t++) {
- multiname_t*m = (multiname_t*)array_getvalue(pool->multinames, t);
- swf_SetU8(tag, m->type);
-
- if(m->ns) {
- assert(m->type==0x07 || m->type==0x0d);
- int i = pool_find_namespace(pool, m->ns);
- if(i<0) fprintf(stderr, "internal error: unregistered namespace %02x %s %s\n", m->ns->access, access2str(m->ns->access), m->ns->name);
- swf_SetU30(tag, i);
- } else {
- assert(m->type!=0x07 && m->type!=0x0d);
- }
- if(m->name) {
- assert(m->type==0x09 || m->type==0x0e || m->type==0x07 || m->type==0x0d || m->type==0x0f || m->type==0x10);
- int i = pool_find_string(pool, m->name);
- if(i<0) fprintf(stderr, "internal error: unregistered name\n");
- swf_SetU30(tag, i);
- } else {
- assert(m->type!=0x09 && m->type!=0x0e && m->type!=0x07 && m->type!=0x0d && m->type!=0x0f && m->type!=0x10);
- }
- if(m->namespace_set) {
- assert(m->type==0x09 || m->type==0x0e || m->type==0x1c || m->type==0x1b);
- int i = pool_find_namespace_set(pool, m->namespace_set);
- if(i<0) fprintf(stderr, "internal error: unregistered namespace set\n");
- swf_SetU30(tag, i);
- } else {
- assert(m->type!=0x09 && m->type!=0x0e && m->type!=0x1c && m->type!=0x1b);
- }
-
- }
-