"[ws]*(\d{1,10})[ws]+(\d{1,5})[ws]*([nf])" at p. */
| 1590 | |
| 1591 | /* "[ws]*(\d{1,10})[ws]+(\d{1,5})[ws]*([nf])" at p. */ |
| 1592 | static bool match_xref_entry(const pdf_doc_t *d, size_t p, int64_t *off, int64_t *gen, char *kind, |
| 1593 | size_t *end) { |
| 1594 | const unsigned char *s = d->data; |
| 1595 | size_t len = d->len; |
| 1596 | while (p < len && is_ws(s[p])) { |
| 1597 | p++; |
| 1598 | } |
| 1599 | size_t a = p; |
| 1600 | while (p < len && is_digit(s[p])) { |
| 1601 | p++; |
| 1602 | } |
| 1603 | if (p == a || p - a > 10) { |
| 1604 | return false; |
| 1605 | } |
| 1606 | *off = sat_digits(s + a, p - a); |
| 1607 | size_t w = p; |
| 1608 | while (p < len && is_ws(s[p])) { |
| 1609 | p++; |
| 1610 | } |
| 1611 | if (p == w) { |
| 1612 | return false; |
| 1613 | } |
| 1614 | a = p; |
| 1615 | while (p < len && is_digit(s[p])) { |
| 1616 | p++; |
| 1617 | } |
| 1618 | if (p == a || p - a > 5) { |
| 1619 | return false; |
| 1620 | } |
| 1621 | *gen = sat_digits(s + a, p - a); |
| 1622 | while (p < len && is_ws(s[p])) { |
| 1623 | p++; |
| 1624 | } |
| 1625 | if (p >= len || (s[p] != 'n' && s[p] != 'f')) { |
| 1626 | return false; |
| 1627 | } |
| 1628 | *kind = (char)s[p]; |
| 1629 | *end = p + 1; |
| 1630 | return true; |
| 1631 | } |
| 1632 | |
| 1633 | static bool xref_table(pdf_doc_t *d, size_t p, pdf_xref_t *sec, pdf_val_t **tr) { |
| 1634 | const unsigned char *s = d->data; |
no test coverage detected