age->days = -1;
}
-int parse_numeric_age(struct age_value *age, char *ptr)
+int parse_numeric_age(struct age_value *age, const char *ptr)
{
char *endptr;
while (ptr) {
return 0;
}
-struct age_value gedcom_parse_age(char* line_value)
+struct age_value gedcom_parse_age(const char* line_value)
{
- char *ptr = line_value;
+ const char *ptr = line_value;
init_age(&age_s);
init_age(&def_age_val);
int compat_enabled = 1;
int compatibility = 0;
int compat_at = 0;
-char* default_charset = "";
+const char* default_charset = "";
#define SUBMITTER_LINK "@__COMPAT__SUBM__@"
#define DEFAULT_SUBMITTER_NAME "Submitter"
compat_enabled = enable_compat;
}
-void set_compatibility(char* program)
+void set_compatibility(const char* program)
{
/* Reinitialize compatibility */
compat_at = 0;
/* first generate "1 CHAR <DEFAULT_CHAR>" */
ts.string = "CHAR";
ts.value = TAG_CHAR;
- self1 = start_element(ELT_HEAD_CHAR, parent, 1, ts, default_charset,
- GEDCOM_MAKE_STRING(val1, default_charset));
+ self1 = start_element(ELT_HEAD_CHAR, parent, 1, ts, (char*)default_charset,
+ GEDCOM_MAKE_STRING(val1, (char*)default_charset));
/* close "1 CHAR" */
end_element(ELT_HEAD_CHAR, parent, self1, NULL);
C_LIFELINES = 0x02
};
-void set_compatibility(char* program);
+void set_compatibility(const char* program);
int compat_mode(int flags);
void compat_generate_submitter_link(Gedcom_ctxt parent);
void compat_generate_submitter();
struct date_value def_date_val;
struct date def_date;
-char* curr_line_value;
+const char* curr_line_value;
int max_month[] = { 12, /* CAL_GREGORIAN */
12, /* CAL_JULIAN */
}
struct date_value make_date_value(Date_value_type t, struct date d1,
- struct date d2, char* p)
+ struct date d2, const char* p)
{
dv_s.type = t;
copy_date(&dv_s.date1, d1);
}
}
-struct date_value gedcom_parse_date(char* line_value)
+struct date_value gedcom_parse_date(const char* line_value)
{
init_date(&date_s);
init_date(&def_date);
extern struct date_value dv_s;
extern struct date date_s;
extern struct date def_date;
-extern char* curr_line_value;
+extern const char* curr_line_value;
int gedcom_date_parse();
int gedcom_date_lex();
/* These are defined in gedcom_date.lex */
-void init_gedcom_date_lex(char* string);
+void init_gedcom_date_lex(const char* string);
void close_gedcom_date_lex();
struct date_value make_date_value(Date_value_type t, struct date d1,
- struct date d2, char* p);
+ struct date d2, const char* p);
void copy_date(struct date *to, struct date from);
#define GEDCOM_MAKE_DATE(VAR, DATE) \
static ENCODING the_enc = ONE_BYTE;
static hash_t *encodings = NULL;
-char* charwidth_string[] = { "1", "2_HILO", "2_LOHI" };
+const char* charwidth_string[] = { "1", "2_HILO", "2_LOHI" };
hnode_t *node_alloc(void *c __attribute__((unused)))
{
free(n);
}
-void add_encoding(char *gedcom_n, char* charwidth, char *iconv_n)
+void add_encoding(const char *gedcom_n, const char* charwidth,
+ const char *iconv_n)
{
char *key, *val;
MEMORY_ERROR;
}
-char* get_encoding(char* gedcom_n, ENCODING enc)
+char* get_encoding(const char* gedcom_n, ENCODING enc)
{
char *key;
hnode_t *node;
static char conv_buf[MAXGEDCLINELEN * 2];
static size_t conv_buf_size;
-int open_conv_to_internal(char* fromcode)
+int open_conv_to_internal(const char* fromcode)
{
- char *encoding = get_encoding(fromcode, the_enc);
+ const char *encoding = get_encoding(fromcode, the_enc);
if (cd_to_internal != (iconv_t) -1)
iconv_close(cd_to_internal);
if (encoding == NULL) {
cd_to_internal = (iconv_t) -1;
}
-char* to_internal(char* str, size_t len,
+char* to_internal(const char* str, size_t len,
char* output_buffer, size_t out_len)
{
size_t res;
TWO_BYTE_LOHI = 2
} ENCODING;
-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* to_internal(const char* str, size_t len,
char* output_buffer, size_t out_len);
void init_encodings();
void set_encoding_width(ENCODING enc);
}
}
-int gedcom_debug_print(char* s, ...)
+int gedcom_debug_print(const char* s, ...)
{
int res = 0;
if (gedcom_high_level_debug) {
static YY_BUFFER_STATE hndl;
-void init_gedcom_date_lex(char* string)
+void init_gedcom_date_lex(const char* string)
{
token_nr = 0;
hndl = yy_scan_string(string);
N_("date"),
N_("cross-reference") };
-void gedcom_cast_error(char* file, int line,
+void gedcom_cast_error(const char* file, int line,
Gedcom_val_type tried_type,
Gedcom_val_type real_type)
{
}
}
-int safe_buf_vappend(char *s, va_list ap)
+int safe_buf_vappend(const char *s, va_list ap)
{
int res = 0;
int len;
return res;
}
-int safe_buf_append(char *s, ...)
+int safe_buf_append(const char *s, ...)
{
int res;
va_list ap;
return res;
}
-int gedcom_message(char* s, ...)
+int gedcom_message(const char* s, ...)
{
int res;
va_list ap;
return res;
}
-int gedcom_warning(char* s, ...)
+int gedcom_warning(const char* s, ...)
{
int res;
va_list ap;
return res;
}
-int gedcom_error(char* s, ...)
+int gedcom_error(const char* s, ...)
{
int res;
va_list ap;
update_gconv_search_path();
}
-int gedcom_parse_file(char* file_name)
+int gedcom_parse_file(const char* file_name)
{
ENCODING enc;
int result = 1;
return result;
}
-struct xref_value *gedcom_get_by_xref(char *key)
+struct xref_value *gedcom_get_by_xref(const char *key)
{
hnode_t *node = hash_lookup(xrefs, key);
if (node) {
union _Gedcom_val_union value;
} Gedcom_val_struct;
-void gedcom_cast_error(char* file, int line,
+void gedcom_cast_error(const char* file, int line,
Gedcom_val_type tried_type,
Gedcom_val_type real_type);
char *raw_value, int tag_value);
void gedcom_init();
-int gedcom_parse_file(char* file_name);
+int gedcom_parse_file(const char* file_name);
void gedcom_set_debug_level(int level, FILE* trace_output);
void gedcom_set_error_handling(Gedcom_err_mech mechanism);
void gedcom_set_compat_handling(int enable_compat);
Gedcom_elt_end_cb cb_end);
/* Separate value parsing functions */
-struct date_value gedcom_parse_date(char* line_value);
-struct age_value gedcom_parse_age(char* line_value);
-struct xref_value *gedcom_get_by_xref(char *key);
+struct date_value gedcom_parse_date(const char* line_value);
+struct age_value gedcom_parse_age(const char* line_value);
+struct xref_value *gedcom_get_by_xref(const char *key);
/* For use in gom */
-int gedcom_error(char* s, ...);
-int gedcom_warning(char* s, ...);
-int gedcom_message(char* s, ...);
-int gedcom_debug_print(char* s, ...);
+int gedcom_error(const char* s, ...);
+int gedcom_warning(const char* s, ...);
+int gedcom_message(const char* s, ...);
+int gedcom_debug_print(const char* s, ...);
__END_DECLS