Fix bug #3574: Template addressing
[claws.git] / src / html.h
blob98e2f3ae4719b204ed8c418e32da9b3293fc33c8
1 /*
2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2012 Hiroyuki Yamamoto and the Claws Mail team
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.
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.
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/>.
20 #ifndef __HTML_H__
21 #define __HTML_H__
23 #include <glib.h>
24 #include <stdio.h>
26 #include "codeconv.h"
28 typedef enum
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;
45 typedef struct _SC_HTMLParser SC_HTMLParser;
46 typedef struct _SC_HTMLAttr SC_HTMLAttr;
47 typedef struct _SC_HTMLTag SC_HTMLTag;
49 struct _SC_HTMLParser
51 FILE *fp;
52 CodeConverter *conv;
54 GHashTable *symbol_table;
55 GHashTable *alt_symbol_table;
57 GString *str;
58 GString *buf;
60 gchar *bufp;
62 SC_HTMLState state;
64 gchar *href;
66 gboolean newline;
67 gboolean empty_line;
68 gboolean space;
69 gboolean pre;
71 gint indent;
74 struct _SC_HTMLAttr
76 gchar *name;
77 gchar *value;
80 struct _SC_HTMLTag
82 gchar *name;
83 GList *attr;
86 SC_HTMLParser *sc_html_parser_new (FILE *fp,
87 CodeConverter *conv);
88 void sc_html_parser_destroy (SC_HTMLParser *parser);
89 gchar *sc_html_parse (SC_HTMLParser *parser);
91 #endif /* __HTML_H__ */