From: Peter Verthez Date: Sat, 5 Jan 2002 13:59:50 +0000 (+0000) Subject: Add a variable to the GEDCOM_MAKE_* macros. X-Git-Url: https://git.dlugolecki.net.pl/?a=commitdiff_plain;h=ae1c2ced07055d32e40c55ff9aeefcc037b2235a;p=gedcom-parse.git Add a variable to the GEDCOM_MAKE_* macros. Move the GEDCOM_MAKE_DATE macro to date.h. --- diff --git a/gedcom/date.h b/gedcom/date.h index 430fe7b..ad7a234 100644 --- a/gedcom/date.h +++ b/gedcom/date.h @@ -47,4 +47,7 @@ struct date_value make_date_value(Date_value_type t, struct date d1, struct date d2, char* p); void copy_date(struct date *to, struct date from); +#define GEDCOM_MAKE_DATE(VAR, DATE) \ + GEDCOM_MAKE(VAR, DATE, GV_DATE_VALUE, date_val) + #endif /* __DATE_H */ diff --git a/gedcom/interface.h b/gedcom/interface.h index 19498fa..24a9e64 100644 --- a/gedcom/interface.h +++ b/gedcom/interface.h @@ -37,24 +37,22 @@ Gedcom_ctxt start_element(Gedcom_elt elt, Gedcom_ctxt parent, void end_element(Gedcom_elt elt, Gedcom_ctxt parent, Gedcom_ctxt self, Gedcom_val parsed_value); -extern Gedcom_val_struct val; +extern Gedcom_val_struct val1; +extern Gedcom_val_struct val2; -#define GEDCOM_MAKE(VALUE, TYPE, MEMBER) \ - (val.type = TYPE, val.value.MEMBER = VALUE, &val) +#define GEDCOM_MAKE(VAR, VALUE, TYPE, MEMBER) \ + (VAR.type = TYPE, VAR.value.MEMBER = VALUE, &VAR) -#define GEDCOM_MAKE_NULL() \ - GEDCOM_MAKE(NULL, GV_NULL, string_val) +#define GEDCOM_MAKE_NULL(VAR) \ + GEDCOM_MAKE(VAR, NULL, GV_NULL, string_val) -#define GEDCOM_MAKE_STRING(STRING) \ - GEDCOM_MAKE(STRING, GV_CHAR_PTR, string_val) +#define GEDCOM_MAKE_STRING(VAR, STRING) \ + GEDCOM_MAKE(VAR, STRING, GV_CHAR_PTR, string_val) -#define GEDCOM_MAKE_NULL_OR_STRING(STRING) \ +#define GEDCOM_MAKE_NULL_OR_STRING(VAR, STRING) \ (STRING == NULL ? \ - GEDCOM_MAKE_NULL() : \ - GEDCOM_MAKE_STRING(STRING)) \ - -#define GEDCOM_MAKE_DATE(DATE) \ - GEDCOM_MAKE(DATE, GV_DATE_VALUE, date_val) + GEDCOM_MAKE_NULL(VAR) : \ + GEDCOM_MAKE_STRING(VAR, STRING)) #endif /* __INTERFACE_H */