… | |
… | |
639 | static const struct { |
639 | static const struct { |
640 | const char *name; |
640 | const char *name; |
641 | IV iv; |
641 | IV iv; |
642 | } *civ, const_iv[] = { |
642 | } *civ, const_iv[] = { |
643 | # define const_iv(name) { # name, (IV)name } |
643 | # define const_iv(name) { # name, (IV)name } |
|
|
644 | const_iv (NUM_RESOURCES), |
644 | const_iv (DEFAULT_RSTYLE), |
645 | const_iv (DEFAULT_RSTYLE), |
645 | const_iv (OVERLAY_RSTYLE), |
646 | const_iv (OVERLAY_RSTYLE), |
646 | const_iv (RS_Bold), |
647 | const_iv (RS_Bold), |
647 | const_iv (RS_Italic), |
648 | const_iv (RS_Italic), |
648 | const_iv (RS_Blink), |
649 | const_iv (RS_Blink), |
… | |
… | |
1430 | # undef reserve |
1431 | # undef reserve |
1431 | }; |
1432 | }; |
1432 | |
1433 | |
1433 | rs = rslist + sizeof (rslist) / sizeof (rslist [0]); |
1434 | rs = rslist + sizeof (rslist) / sizeof (rslist [0]); |
1434 | |
1435 | |
|
|
1436 | if (*name) |
1435 | do { |
1437 | { |
|
|
1438 | do { |
1436 | if (rs-- == rslist) |
1439 | if (rs-- == rslist) |
1437 | croak ("no such resource '%s', requested", name); |
1440 | croak ("no such resource '%s', requested", name); |
1438 | } while (strcmp (name, rs->name)); |
1441 | } while (strcmp (name, rs->name)); |
1439 | |
1442 | |
1440 | index += rs->value; |
1443 | index += rs->value; |
|
|
1444 | } |
|
|
1445 | else |
|
|
1446 | { |
|
|
1447 | --rs; |
|
|
1448 | name = ""; |
|
|
1449 | } |
1441 | |
1450 | |
1442 | if (!IN_RANGE_EXC (index, 0, NUM_RESOURCES)) |
1451 | if (!IN_RANGE_EXC (index, 0, NUM_RESOURCES)) |
1443 | croak ("requested out-of-bound resource %s+%d,", name, index - rs->value); |
1452 | croak ("requested out-of-bound resource %s+%d,", name, index - rs->value); |
1444 | |
1453 | |
1445 | if (GIMME_V != G_VOID) |
1454 | if (GIMME_V != G_VOID) |