/* These are defined at the bottom of the file */
void push_countarray();
-void set_parenttag(char* tag);
+void set_parenttag(const char* tag);
char* get_parenttag(int offset);
void set_parentctxt(Gedcom_ctxt ctxt);
Gedcom_ctxt get_parentctxt(int offset);
}
}
-void set_parenttag(char* tag)
+void set_parenttag(const char* tag)
{
strncpy(tag_stack[count_level+1], tag, MAXSTDTAGLEN+1);
}
int gedcom_parse();
int gedcom_lex();
-void gedcom_mem_error(char *filename, int line);
+void gedcom_mem_error(const char *filename, int line);
#define MEMORY_ERROR gedcom_mem_error(__FILE__, __LINE__)
fprintf(stderr, "(%d) %s\n", type, msg);
}
-int test_loop(ENCODING enc, char* code)
+int test_loop(ENCODING enc, const char* code)
{
int tok, res;
init_encodings();
level_diff);
}
-static void error_tag_too_long(char *tag)
+static void error_tag_too_long(const char *tag)
{
gedcom_error(_("Tag '%s' too long, max %d characters allowed"),
tag, MAXGEDCTAGLEN);
}
-static void error_invalid_character(char *str, char ch)
+static void error_invalid_character(const char *str, char ch)
{
gedcom_error(_("Invalid character for encoding: '%s' (0x%02x)"), str, ch);
}
-static void error_pointer_too_long(char *ptr)
+static void error_pointer_too_long(const char *ptr)
{
gedcom_error(_("Pointer '%s' too long, max %d characters allowed"),
ptr, MAXGEDCPTRLEN);
gedcom_error(_("'@' character should be written as '@@' in values"));
}
-static void error_unexpected_character(char* str, char ch)
+static void error_unexpected_character(const char* str, char ch)
{
gedcom_error(_("Unexpected character: '%s' (0x%02x)"), str, ch);
}
(*cb)(elt, parent, self, parsed_value);
}
-char* val_type_str[] = { N_("null value"),
- N_("character string"),
- N_("date"),
- N_("cross-reference") };
+const char* val_type_str[] = { N_("null value"),
+ N_("character string"),
+ N_("date"),
+ N_("cross-reference") };
void gedcom_cast_error(const char* file, int line,
Gedcom_val_type tried_type,
return res;
}
-void gedcom_mem_error(char *filename, int line)
+void gedcom_mem_error(const char *filename, int line)
{
gedcom_error(_("Could not allocate memory at %s, %d"), filename, line);
}
struct xref_value def_xref_val = { XREF_NONE, "<error>", NULL };
static hash_t *xrefs = NULL;
-char* xref_type_str[] = { N_("nothing"),
- N_("a family"),
- N_("an individual"),
- N_("a note"),
- N_("a multimedia object"),
- N_("a source repository"),
- N_("a source"),
- N_("a submitter"),
- N_("a submission record"),
- N_("an application-specific record"),
- };
+const char* xref_type_str[] = { N_("nothing"),
+ N_("a family"),
+ N_("an individual"),
+ N_("a note"),
+ N_("a multimedia object"),
+ N_("a source repository"),
+ N_("a source"),
+ N_("a submitter"),
+ N_("a submission record"),
+ N_("an application-specific record"),
+ };
struct xref_node {
struct xref_value xref;
return NULL;
}
-struct xref_value *gedcom_parse_xref(char *raw_value,
+struct xref_value *gedcom_parse_xref(const char *raw_value,
Xref_ctxt ctxt, Xref_type xref_type)
{
struct xref_node *xr = NULL;
xr = (struct xref_node *)hnode_get(node);
}
else {
- char *key = strdup(raw_value);
+ const char *key = strdup(raw_value);
if (key) {
xr = make_xref_node();
xr->xref.type = xref_type;
void make_xref_table();
int check_xref_table();
-struct xref_value *gedcom_parse_xref(char *raw_value,
+struct xref_value *gedcom_parse_xref(const char *raw_value,
Xref_ctxt ctxt, Xref_type type);
#define GEDCOM_MAKE_XREF_PTR(VAR, XREF) \