- if (sym != NULL) {
- // public/global name
- if (pub_sym_cnt >= pub_sym_alloc) {
- pub_sym_alloc *= 2;
- pub_syms = realloc(pub_syms, pub_sym_alloc * sizeof(pub_syms[0]));
- my_assert_not(pub_syms, NULL);
+ if (sym != NULL)
+ {
+ if (header_mode) {
+ int is_str = 0;
+
+ fprintf(fout, "extern ");
+ if (is_ro)
+ fprintf(fout, "const ");
+
+ switch (type) {
+ case DXT_BYTE:
+ for (i = w; i < wordc; i++)
+ if (words[i][0] == '\'')
+ is_str = 1;
+ if (is_str)
+ fprintf(fout, "char %s[];\n", sym);
+ else
+ fprintf(fout, "uint8_t %s;\n", sym);
+ break;
+
+ case DXT_WORD:
+ fprintf(fout, "uint16_t %s;\n", sym);
+ break;
+
+ case DXT_DWORD:
+ fprintf(fout, "uint32_t %s;\n", sym);
+ break;
+
+ default:
+ fprintf(fout, "_UNKNOWN %s;\n", sym);
+ break;
+ }
+
+ continue;