From 4ce9b5a1023be2e931d4205ed17f44f135c920d1 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Wed, 11 May 2016 12:42:12 +0200 Subject: Add common page range parsing function for tools. --- include/mupdf/fitz/string.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'include') diff --git a/include/mupdf/fitz/string.h b/include/mupdf/fitz/string.h index 8daa28fc..2af6ba93 100644 --- a/include/mupdf/fitz/string.h +++ b/include/mupdf/fitz/string.h @@ -136,4 +136,11 @@ float fz_strtof_no_exp(const char *string, char **tailptr); */ int fz_grisu(float f, char *s, int *exp); +/* + Check and parse string into page ranges: + ( ','? ([0-9]+|'N') ( '-' ([0-9]+|N) )? )+ +*/ +int fz_is_page_range(fz_context *ctx, const char *s); +const char *fz_parse_page_range(fz_context *ctx, const char *s, int *a, int *b, int n); + #endif -- cgit v1.2.3