[Refdb-cvs] CVS: refdb/src backend-dbiba.c,1.26.2.7,1.26.2.8
Status: Beta
Brought to you by:
mhoenicka
From: Markus H. <mho...@us...> - 2004-08-23 22:15:32
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28421 Modified Files: Tag: Release_0_9_5_stable backend-dbiba.c Log Message: set pubdate attributes to citestylex defaults if not specified Index: backend-dbiba.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-dbiba.c,v retrieving revision 1.26.2.7 retrieving revision 1.26.2.8 diff -u -U2 -r1.26.2.7 -r1.26.2.8 --- backend-dbiba.c 29 Jul 2004 20:52:36 -0000 1.26.2.7 +++ backend-dbiba.c 23 Aug 2004 22:15:19 -0000 1.26.2.8 @@ -935,4 +935,9 @@ const char *item_sequence; const char *item_format; + const char default_sequence[] = "Y"; /* defaults are taken from citestylex.dtd. Be aware of code duplication which is bad per se */ + const char default_yearformat[] = "FOURDIGIT"; + const char default_pad[] = "NN"; + const char default_monthformat[] = "ARABICMONTH"; + const char default_dayformat[] = "ARABICDAY"; enum refdbref_col n_date_index; enum refdbref_col n_dateother_index; @@ -1095,11 +1100,33 @@ item_format = dbi_result_get_string_idx(dbires_ref, n_format_index); - if (item_format && strcmp(item_format, "YES") == 0) { + + /* switch on formatting if the attribute is either missing or set to "YES". To disable formatting, the attribute has to be set to "NO" explicitly */ + if (!item_format || strcmp(item_format, "YES") == 0) { /* do some formatting here */ item_sequence = dbi_result_get_string_idx(dbires_ref, n_sequence_index); + if (!item_sequence) { + item_sequence = default_sequence; + } + item_yearformat = dbi_result_get_string_idx(dbires_ref, n_yearformat_index); + if (!item_yearformat) { + item_yearformat = default_yearformat; + } + item_pad = dbi_result_get_string_idx(dbires_ref, n_pad_index); + if (!item_pad) { + item_pad = default_pad; + } + item_monthformat = dbi_result_get_string_idx(dbires_ref, n_monthformat_index); + if (!item_monthformat) { + item_monthformat = default_monthformat; + } + item_dayformat = dbi_result_get_string_idx(dbires_ref, n_dayformat_index); + if (!item_dayformat) { + item_dayformat = default_dayformat; + } + item_firstsep = my_dbi_result_get_string_copy_idx(dbires_ref, n_firstsep_index); if (item_firstsep && *item_firstsep && !dbi_conn_error_flag(ptr_bibconns->conn_refdb)) { |