summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2014-02-10 13:29:18 +0000
committerRobin Watts <robin.watts@artifex.com>2014-02-10 15:04:50 +0000
commit08fecfe3c0d29764eb79960dea912c78b4c797dd (patch)
tree5f8b72e6605c1617ba81db8ea6728515c881ad6b /source
parentee420dddc55381976d5fceab32a4e361877818e5 (diff)
downloadmupdf-08fecfe3c0d29764eb79960dea912c78b4c797dd.tar.xz
Add pdf_is_number.
Useful utility missing from our arsenal.
Diffstat (limited to 'source')
-rw-r--r--source/pdf/pdf-object.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source/pdf/pdf-object.c b/source/pdf/pdf-object.c
index b8147970..f8ece944 100644
--- a/source/pdf/pdf-object.c
+++ b/source/pdf/pdf-object.c
@@ -218,6 +218,12 @@ int pdf_is_real(pdf_obj *obj)
return obj ? obj->kind == PDF_REAL : 0;
}
+int pdf_is_number(pdf_obj *obj)
+{
+ RESOLVE(obj);
+ return obj ? (obj->kind == PDF_REAL || obj->kind == PDF_INT) : 0;
+}
+
int pdf_is_string(pdf_obj *obj)
{
RESOLVE(obj);