| 1 | #ifndef MUPDF_FITZ_STRING_H |
| 2 | #define MUPDF_FITZ_STRING_H |
| 3 | |
| 4 | #include "mupdf/fitz/system.h" |
| 5 | |
| 6 | /* The Unicode character used to incoming character whose value is unknown or unrepresentable. */ |
| 7 | #define FZ_REPLACEMENT_CHARACTER 0xFFFD |
| 8 | |
| 9 | /* |
| 10 | Safe string functions |
| 11 | */ |
| 12 | |
| 13 | size_t fz_strnlen(const char *s, size_t maxlen); |
| 14 | |
| 15 | char *fz_strsep(char **stringp, const char *delim); |
| 16 | |
| 17 | size_t fz_strlcpy(char *dst, const char *src, size_t n); |
| 18 | |
| 19 | size_t fz_strlcat(char *dst, const char *src, size_t n); |
| 20 | |
| 21 | void *fz_memmem(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen); |
| 22 | |
| 23 | void fz_dirname(char *dir, const char *path, size_t dirsize); |
| 24 | |
| 25 | char *fz_urldecode(char *url); |
| 26 | |
| 27 | void fz_format_output_path(fz_context *ctx, char *path, size_t size, const char *fmt, int page); |
| 28 | |
| 29 | char *fz_cleanname(char *name); |
| 30 | |
| 31 | int fz_strcasecmp(const char *a, const char *b); |
| 32 | int fz_strncasecmp(const char *a, const char *b, int n); |
| 33 | |
| 34 | /* |
| 35 | FZ_UTFMAX: Maximum number of bytes in a decoded rune (maximum length returned by fz_chartorune). |
| 36 | */ |
| 37 | enum { FZ_UTFMAX = 4 }; |
| 38 | |
| 39 | int fz_chartorune(int *rune, const char *str); |
| 40 | |
| 41 | int fz_runetochar(char *str, int rune); |
| 42 | |
| 43 | int fz_runelen(int rune); |
| 44 | |
| 45 | int fz_utflen(const char *s); |
| 46 | |
| 47 | float fz_strtof(const char *s, char **es); |
| 48 | |
| 49 | int fz_grisu(float f, char *s, int *exp); |
| 50 | |
| 51 | int fz_is_page_range(fz_context *ctx, const char *s); |
| 52 | const char *fz_parse_page_range(fz_context *ctx, const char *s, int *a, int *b, int n); |
| 53 | |
| 54 | #endif |
| 55 | |