summaryrefslogtreecommitdiff
path: root/source/fitz/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/fitz/string.c')
-rw-r--r--source/fitz/string.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/fitz/string.c b/source/fitz/string.c
index 025b612c..95b216fe 100644
--- a/source/fitz/string.c
+++ b/source/fitz/string.c
@@ -1,5 +1,25 @@
#include "mupdf/fitz.h"
+static inline int
+fz_tolower(int c)
+{
+ if (c >= 'A' && c <= 'Z')
+ return c + 32;
+ return c;
+}
+
+int
+fz_strcasecmp(const char *a, const char *b)
+{
+ while (fz_tolower(*a) == fz_tolower(*b))
+ {
+ if (*a++ == 0)
+ return 0;
+ b++;
+ }
+ return fz_tolower(*a) - fz_tolower(*b);
+}
+
char *
fz_strsep(char **stringp, const char *delim)
{