| 2390 | } |
| 2391 | |
| 2392 | static char rs_label_code(const char *label) { |
| 2393 | static const struct { |
| 2394 | const char *label; |
| 2395 | char code; |
| 2396 | } table[] = { |
| 2397 | {"Struct", 'S'}, {"Enum", 'E'}, {"Class", 'C'}, {"Interface", 'I'}, {"Type", 'T'}, |
| 2398 | {"Function", 'F'}, {"Variable", 'V'}, {"Method", 'M'}, {"Field", 'D'}, |
| 2399 | }; |
| 2400 | for (size_t i = 0; i < sizeof(table) / sizeof(table[0]); i++) { |
| 2401 | if (strcmp(table[i].label, label) == 0) { |
| 2402 | return table[i].code; |
| 2403 | } |
| 2404 | } |
| 2405 | return 0; |
| 2406 | } |
| 2407 | |
| 2408 | /* Write an item's node field: '!' when definition `def` does not exist, does |
| 2409 | * not own its node, or has a qualified name the blob cannot carry; else the |