-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstrip_html.h
43 lines (32 loc) · 930 Bytes
/
strip_html.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
#define MAX_TAGNAMELENGTH 20
#define MAX_STRIPTAGS 20
typedef struct Stripper {
int f_in_tag;
int f_closing;
int f_lastchar_slash;
char tagname[MAX_TAGNAMELENGTH];
char * p_tagname;
char f_full_tagname;
int f_outputted_space;
int f_just_seen_tag;
int f_in_quote;
char quote;
int f_in_decl;
int f_in_comment;
int f_lastchar_minus;
int f_in_striptag;
char striptag[MAX_TAGNAMELENGTH];
char o_striptags[MAX_STRIPTAGS][MAX_TAGNAMELENGTH];
int numstriptags;
int o_emit_spaces;
int o_emit_newlines;
int o_decode_entities;
int o_auto_reset;
int o_debug;
} Stripper;
void _strip_html( Stripper * stripper, char * raw, char * clean, int is_utf8_p );
static int utf8_char_width( unsigned char * string );
void _reset( Stripper * stripper );
void clear_striptags( Stripper * stripper );
void add_striptag( Stripper * stripper, char * tag );
void check_end( Stripper * stripper, char );