Set empty block->entries to NULL in passwd_store_delete_block().
[claws.git] / src / html.h
1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  * 
18  */
19
20 #ifndef __HTML_H__
21 #define __HTML_H__
22
23 #include <glib.h>
24 #include <stdio.h>
25
26 #include "codeconv.h"
27
28 typedef enum
29 {
30         SC_HTML_NORMAL,
31         SC_HTML_PAR,
32         SC_HTML_BR,
33         SC_HTML_HR,
34         SC_HTML_HREF,
35         SC_HTML_IMG,
36         SC_HTML_FONT,
37         SC_HTML_PRE,
38         SC_HTML_UNKNOWN,
39         SC_HTML_CONV_FAILED,
40         SC_HTML_ERR,
41         SC_HTML_EOF,
42         SC_HTML_HREF_BEG
43 } SC_HTMLState;
44
45 typedef struct _SC_HTMLParser   SC_HTMLParser;
46 typedef struct _SC_HTMLAttr             SC_HTMLAttr;
47 typedef struct _SC_HTMLTag              SC_HTMLTag;
48
49 struct _SC_HTMLParser
50 {
51         FILE *fp;
52         CodeConverter *conv;
53
54         GHashTable *symbol_table;
55         GHashTable *alt_symbol_table;
56
57         GString *str;
58         GString *buf;
59
60         gchar *bufp;
61
62         SC_HTMLState state;
63
64         gchar *href;
65
66         gboolean newline;
67         gboolean empty_line;
68         gboolean space;
69         gboolean pre;
70 };
71
72 struct _SC_HTMLAttr
73 {
74         gchar *name;
75         gchar *value;
76 };
77
78 struct _SC_HTMLTag
79 {
80         gchar *name;
81         GList *attr;
82 };
83
84 SC_HTMLParser *sc_html_parser_new       (FILE           *fp,
85                                  CodeConverter  *conv);
86 void sc_html_parser_destroy     (SC_HTMLParser  *parser);
87 gchar *sc_html_parse            (SC_HTMLParser  *parser);
88
89 #endif /* __HTML_H__ */