Keep parsed values in date if parse was OK, but no valid date.
[gedcom-parse.git] / gedcom / encoding.h
index 1a9e79c65c3da9ec2a7cad810e0fce93c0784706..77459c3167aea0464e5489e62f7e19f8e290dfed 100644 (file)
@@ -1,11 +1,22 @@
-/*  This program is free software; you can redistribute it and/or modify  *
- *  it under the terms of the GNU General Public License as published by  *
- *  the Free Software Foundation; either version 2 of the License, or     *
- *  (at your option) any later version.                                   *
+/* Header file for encoding.c.
+   Copyright (C) 2001 The Genes Development Team
+   This file is part of the Gedcom parser library.
+   Contributed by Peter Verthez <Peter.Verthez@advalvas.be>, 2001.
 
- (C) 2001 by The Genes Development Team
- Original author: Peter Verthez (Peter.Verthez@advalvas.be)
-*/
+   The Gedcom parser library is free software; you can redistribute it
+   and/or modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The Gedcom parser library is distributed in the hope that it will be
+   useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the Gedcom parser library; if not, write to the
+   Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+   02111-1307 USA.  */
 
 /* $Id$ */
 /* $Name$ */
 #ifndef __ENCODING_H
 #define __ENCODING_H
 
-typedef enum _ENC {
-  ONE_BYTE = 0,
-  TWO_BYTE_HILO = 1,
-  TWO_BYTE_LOHI = 2
-} ENCODING;
+#include "gedcom.h"
+#include "utf8tools.h"
 
-/* All Unicode characters between U+0000 and U+FFFF can be encoded in
-   UTF-8 with 3 or less bytes */
-#define UTF_FACTOR 3
+void init_encodings();
+char* get_encoding(const char* gedcom_n, Encoding enc);
+void update_gconv_search_path();
 
-int open_conv_to_internal(char* fromcode);
+int open_conv_to_internal(const char* fromcode);
 void close_conv_to_internal();
-char* to_internal(char* str, size_t len,
-                 char* output_buffer, size_t out_len);
-void init_encodings();
-void set_encoding_width(ENCODING enc);
+char* to_internal(const char* str, size_t len, struct conv_buffer *output_buf);
 
 #endif /* __ENCODING_H */