void print_constructs(const ResourceTable &tbl) { uint16_t i(0); for (; i<tbl.resource_count; ++i) { if (tbl.type(i) != RESOURCE_CONSTRUCT) { continue; } const ConstructResource &conres( tbl.obj< ConstructResource >(i)); print_constructure(conres, tbl); } }
void print_code(const ResourceTable &tbl) { uint16_t i(0); for (; i<tbl.resource_count; ++i) { if (tbl.type(i) != RESOURCE_FUNCTION) { continue; } const FunctionHeader &f( tbl.obj< FunctionHeader >(i)); print_function_header(f, tbl); cout << "offset:" << tbl.offset(i) << "\n"; print_function_code(f, tbl.size(i), tbl); } }
static inline void print_resource_line(const ResourceTable &tbl, uint16_t i) { printf("\t% 2u ", i); switch (tbl.type(i)) { case RESOURCE_CONSTRUCT: print_construct(tbl, i); break; case RESOURCE_DATATYPE: print_datatype(tbl, i); break; case RESOURCE_FUNCTION: print_function_resource_line(tbl, i); break; case RESOURCE_HASHTAG: print_hashtag(tbl, i); break; case RESOURCE_IMPORT: print_import_line(tbl, i); break; case RESOURCE_MODSYM: print_modsym(tbl, i); break; case RESOURCE_POLYMORPH: print_polymorph_resource_line(tbl, i); break; case RESOURCE_PROTOCOL: print_protocol_resource_line(tbl, i); break; case RESOURCE_STRING: print_escaped_string(tbl, i); break; case RESOURCE_TYPESPEC: print_typespec(tbl, i); break; default: print_unsupported_resource(tbl, i); break; } }
void print_unsupported_resource(const ResourceTable &tbl, uint16_t i) { uint16_t type(tbl.type(i)); printf("unsupported:0x%x\n", type); }