| 565 | } |
| 566 | |
| 567 | static const char * getnum(const char * strp, int * const nump, const int min, const int max) { |
| 568 | char c; |
| 569 | int num; |
| 570 | |
| 571 | if (strp == NULL || !is_digit(c = *strp)) |
| 572 | return NULL; |
| 573 | num = 0; |
| 574 | do { |
| 575 | num = num * 10 + (c - '0'); |
| 576 | if (num > max) |
| 577 | return NULL; /* illegal value */ |
| 578 | c = *++strp; |
| 579 | } while (is_digit(c)); |
| 580 | if (num < min) |
| 581 | return NULL; /* illegal value */ |
| 582 | *nump = num; |
| 583 | return strp; |
| 584 | } |
| 585 | |
| 586 | static const char * getrule(const char * strp, struct rule * const rulep) { |
| 587 | if (*strp == 'J') { |