Copied from old documentation. Removed all Gedcom_val details.
[gedcom-parse.git] / gedcom / encoding_state.h
1 /* Header file for encoding.c.
2    Copyright (C) 2001 The Genes Development Team
3    This file is part of the Gedcom parser library.
4    Contributed by Peter Verthez <Peter.Verthez@advalvas.be>, 2001.
5
6    The Gedcom parser library is free software; you can redistribute it
7    and/or modify it under the terms of the GNU Lesser General Public
8    License as published by the Free Software Foundation; either
9    version 2.1 of the License, or (at your option) any later version.
10
11    The Gedcom parser library is distributed in the hope that it will be
12    useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14    Lesser General Public License for more details.
15
16    You should have received a copy of the GNU Lesser General Public
17    License along with the Gedcom parser library; if not, write to the
18    Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19    02111-1307 USA.  */
20
21 /* $Id$ */
22 /* $Name$ */
23
24 #ifndef __ENCODING_STATE_H
25 #define __ENCODING_STATE_H
26
27 #include "gedcom.h"
28
29 #define MAX_CHARSET_LEN 32
30 #define MAX_TERMINATOR_LEN 2
31
32 struct encoding_state {
33   char         charset[MAX_CHARSET_LEN + 1];
34   const char*  encoding;
35   Encoding     width;
36   Enc_bom      bom;
37   char         terminator[MAX_TERMINATOR_LEN + 1];
38 };
39
40 struct encoding_state read_encoding;
41 struct encoding_state write_encoding;
42
43 void set_read_encoding(const char* charset, const char* encoding);
44 void set_read_encoding_width(Encoding enc);
45 void set_read_encoding_bom(Enc_bom bom);
46 void set_read_encoding_terminator(char* term);
47
48 void init_write_encoding();
49 void init_write_terminator();
50
51 #endif /* __ENCODING_STATE_H */