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
13size_t fz_strnlen(const char *s, size_t maxlen);
14
15char *fz_strsep(char **stringp, const char *delim);
16
17size_t fz_strlcpy(char *dst, const char *src, size_t n);
18
19size_t fz_strlcat(char *dst, const char *src, size_t n);
20
21void *fz_memmem(const void *haystack, size_t haystacklen, const void *needle, size_t needlelen);
22
23void fz_dirname(char *dir, const char *path, size_t dirsize);
24
25char *fz_urldecode(char *url);
26
27void fz_format_output_path(fz_context *ctx, char *path, size_t size, const char *fmt, int page);
28
29char *fz_cleanname(char *name);
30
31int fz_strcasecmp(const char *a, const char *b);
32int 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*/
37enum { FZ_UTFMAX = 4 };
38
39int fz_chartorune(int *rune, const char *str);
40
41int fz_runetochar(char *str, int rune);
42
43int fz_runelen(int rune);
44
45int fz_utflen(const char *s);
46
47float fz_strtof(const char *s, char **es);
48
49int fz_grisu(float f, char *s, int *exp);
50
51int fz_is_page_range(fz_context *ctx, const char *s);
52const char *fz_parse_page_range(fz_context *ctx, const char *s, int *a, int *b, int n);
53
54#endif
55