File: strip_html.h

package info (click to toggle)
libhtml-strip-perl 2.12-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 172 kB
  • sloc: ansic: 266; perl: 88; makefile: 3
file content (43 lines) | stat: -rw-r--r-- 930 bytes parent folder | download
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 );