forked from andoma/movian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
string.h
86 lines (49 loc) · 1.87 KB
/
string.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#ifndef STRING_H__
#define STRING_H__
#include <stdlib.h>
#include <stdint.h>
uint32_t html_makecolor(const char *str);
void url_deescape(char *s);
#define URL_ESCAPE_PATH 1
#define URL_ESCAPE_PARAM 2
int url_escape(char *dest, const int size, const char *src, int how);
void html_entities_decode(char *s);
int html_entity_lookup(const char *name);
size_t html_enteties_escape(const char *src, char *dst);
void
url_split(char *proto, int proto_size,
char *authorization, int authorization_size,
char *hostname, int hostname_size,
int *port_ptr,
char *path, int path_size,
const char *url);
int dictcmp(const char *a, const char *b);
int utf8_get(const char **s);
int utf8_verify(const char *str);
int utf8_put(char *out, int c);
const char *mystrstr(const char *haystack, const char *needle);
void strvec_addp(char ***str, const char *v);
void strvec_addpn(char ***str, const char *v, size_t len);
char **strvec_split(const char *str, char ch);
void strvec_free(char **s);
void strappend(char **strp, const char *src);
int hex2bin(uint8_t *buf, size_t buflen, const char *str);
void unicode_init(void);
char *url_resolve_relative(const char *proto, const char *hostname, int port,
const char *path, const char *ref);
char *url_resolve_relative_from_base(const char *base, const char *url);
char *utf8_from_bytes(const char *str, int len, const uint16_t *table);
int hexnibble(char c);
void ucs2_to_utf8(uint8_t *dst, size_t dstlen,
const uint8_t *src, size_t srclen);
size_t utf8_to_ucs2(uint8_t *dst, const char *src);
size_t utf8_to_ascii(uint8_t *dst, const char *src);
void utf16_to_utf8(char **bufp, size_t *lenp);
typedef struct {
const char *id, *title;
const uint16_t *ptr;
} charset_t;
const charset_t *charset_get(const char *id);
const charset_t *charset_get_idx(unsigned int i);
const char *charset_get_name(const void *ptr);
#endif