| 399 | /* Return true if V is a null-string or zero-number. */ |
| 400 | |
| 401 | ATTRIBUTE_PURE |
| 402 | static bool |
| 403 | null (VALUE *v) |
| 404 | { |
| 405 | switch (v->type) |
| 406 | { |
| 407 | case integer: |
| 408 | return mpz_sgn (v->u.i) == 0; |
| 409 | case string: |
| 410 | { |
| 411 | char const *cp = v->u.s; |
| 412 | if (*cp == '\0') |
| 413 | return true; |
| 414 | |
| 415 | cp += (*cp == '-'); |
| 416 | |
| 417 | do |
| 418 | { |
| 419 | if (*cp != '0') |
| 420 | return false; |
| 421 | } |
| 422 | while (*++cp); |
| 423 | |
| 424 | return true; |
| 425 | } |
| 426 | default: |
| 427 | unreachable (); |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | /* Return true if CP takes the form of an integer. */ |
| 432 |