Moved to gedcom subdirectory.
[gedcom-parse.git] / gedcom / encoding.h
1 /*  This program is free software; you can redistribute it and/or modify  *
2  *  it under the terms of the GNU General Public License as published by  *
3  *  the Free Software Foundation; either version 2 of the License, or     *
4  *  (at your option) any later version.                                   *
5
6  (C) 2001 by The Genes Development Team
7  Original author: Peter Verthez (Peter.Verthez@advalvas.be)
8 */
9
10 /* $Id$ */
11 /* $Name$ */
12
13 /* Basic file encoding */
14 #ifndef __ENCODING_H
15 #define __ENCODING_H
16
17 typedef enum _ENC {
18   ONE_BYTE = 0,
19   TWO_BYTE_HILO = 1,
20   TWO_BYTE_LOHI = 2
21 } ENCODING;
22
23 /* All Unicode characters between U+0000 and U+FFFF can be encoded in
24    UTF-8 with 3 or less bytes */
25 #define UTF_FACTOR 3
26
27 int open_conv_to_internal(char* fromcode);
28 void close_conv_to_internal();
29 char* to_internal(char* str, size_t len,
30                   char* output_buffer, size_t out_len);
31 void init_encodings();
32 void set_encoding_width(ENCODING enc);
33
34 #endif /* __ENCODING_H */