1 /*
2  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3  * Copyright (C) 1999,2000 Hiroyuki Yamamoto
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 __ERTF_H__
21 #define __ERTF_H__
22 
23 #include <glib.h>
24 #include <stdio.h>
25 
26 #include "codeconv.h"
27 
28 typedef enum
29 {
30 	ERTF_NORMAL,
31 	ERTF_NOFILL,
32 	ERTF_UNKNOWN,
33 	ERTF_ERR,
34 	ERTF_EOF
35 } ERTFState;
36 
37 typedef struct _ERTFParser	ERTFParser;
38 
39 struct _ERTFParser
40 {
41 	FILE *fp;
42 	CodeConverter *conv;
43 
44 	GHashTable *symbol_table;
45 
46 	GString *str;
47 	GString *buf;
48 
49 	gchar *bufp;
50 
51 	ERTFState state;
52 
53 	gboolean newline;
54 	gboolean empty_line;
55 	gboolean space;
56 	gboolean pre;
57 };
58 
59 ERTFParser *ertf_parser_new	(FILE		*fp,
60 				 CodeConverter	*conv);
61 void ertf_parser_destroy	(ERTFParser	*parser);
62 gchar *ertf_parse		(ERTFParser	*parser);
63 
64 #endif /* __ERTF_H__ */
65 
66 
67 
68