/* $Name$ */
#include <string.h>
-#include <iconv.h>
#include <stdio.h>
#include <limits.h>
#include <stdlib.h>
#define GCONV_SEARCH_PATH "GCONV_PATH"
#define MAXBUF 255
-/*
-static iconv_t cd_to_internal = (iconv_t) -1;
-*/
-static ENCODING the_enc = ONE_BYTE;
+static Encoding the_enc = ONE_BYTE;
static hash_t *encodings = NULL;
const char* charwidth_string[] = { "1", "2_HILO", "2_LOHI" };
MEMORY_ERROR;
}
-char* get_encoding(const char* gedcom_n, ENCODING enc)
+char* get_encoding(const char* gedcom_n, Encoding enc)
{
char *key;
hnode_t *node;
+
+ if (encodings == NULL) return NULL;
key = (char*)malloc(strlen(gedcom_n) + strlen(charwidth_string[enc]) + 3);
if (buffer[strlen(buffer) - 1] != '\n') {
gedcom_error(_("Line too long in encoding configuration file '%s'"),
ENCODING_CONF_FILE);
+ line_no = 0;
return;
}
else if ((buffer[0] != '#') && (strcmp(buffer, "\n") != 0)) {
else {
gedcom_error(_("Missing data in encoding configuration file '%s'"),
ENCODING_CONF_FILE);
+ line_no = 0;
return;
}
}
}
+ line_no = 0;
if (fclose(in) != 0) {
gedcom_warning(_("Error closing file '%s': %s"),
ENCODING_CONF_FILE, strerror(errno));
}
}
-void set_encoding_width(ENCODING enc)
+void set_encoding_width(Encoding enc)
{
the_enc = enc;
}