[Refdb-cvs] CVS: refdb/src risxhandler.c,1.28.2.6,1.28.2.7
Status: Beta
Brought to you by:
mhoenicka
From: Markus H. <mho...@us...> - 2005-05-29 22:32:59
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21348 Modified Files: Tag: Release_0_9_5_stable risxhandler.c Log Message: fixed handling of titles Index: risxhandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/risxhandler.c,v retrieving revision 1.28.2.6 retrieving revision 1.28.2.7 diff -u -U2 -r1.28.2.6 -r1.28.2.7 --- risxhandler.c 5 May 2005 17:21:52 -0000 1.28.2.6 +++ risxhandler.c 29 May 2005 22:32:51 -0000 1.28.2.7 @@ -724,22 +724,39 @@ if (is_descendant_of(ptr_ardata->ptr_first, "part")) { + /* e.g. article, chapter titles */ result = set_risdata_field(ptr_ardata->ptr_risdata, "title", (ptr_ardata->ptr_first)->ptr_elvalue, ptr_ardata->driver); } else if (is_descendant_of(ptr_ardata->ptr_first, "publication")) { + /* most important: journal titles and such */ + /* also here: things like book titles */ title_type = get_attr(ptr_ardata->ptr_first, "type"); if (title_type && !strcmp(title_type, "full")) { - if (((ptr_ardata->perinfo).full = strdup((ptr_ardata->ptr_first)->ptr_elvalue)) == NULL || dbi_driver_quote_string(ptr_ardata->driver, &((ptr_ardata->perinfo).full)) == -1) { - if ((new_msgpool = mstrcat(ptr_ardata->msgpool, outomem_n.text, &(ptr_ardata->msgpool_len), 0)) == NULL) { - (ptr_ardata->nmem_error)++; + /* this may be a full journal title, but also a book title */ + if (!strcmp(ptr_ardata->type, "CHAP") + || !strcmp(ptr_ardata->type, "CASE") + || !strcmp(ptr_ardata->type, "CONF") + || !strcmp(ptr_ardata->type, "BOOK")) { + result = set_risdata_field(ptr_ardata->ptr_risdata, "booktitle", (ptr_ardata->ptr_first)->ptr_elvalue, ptr_ardata->driver); + } + else if (!strcmp(ptr_ardata->type, "JOUR") + || !strcmp(ptr_ardata->type, "JFULL")) { + if (((ptr_ardata->perinfo).full = strdup((ptr_ardata->ptr_first)->ptr_elvalue)) == NULL || dbi_driver_quote_string(ptr_ardata->driver, &((ptr_ardata->perinfo).full)) == -1) { + if ((new_msgpool = mstrcat(ptr_ardata->msgpool, outomem_n.text, &(ptr_ardata->msgpool_len), 0)) == NULL) { + (ptr_ardata->nmem_error)++; + return; + } + else { + ptr_ardata->msgpool = new_msgpool; + } + (ptr_ardata->ndb_error)++; return; } - else { - ptr_ardata->msgpool = new_msgpool; - } - (ptr_ardata->ndb_error)++; - return; + } + else { + result = set_risdata_field(ptr_ardata->ptr_risdata, "title", (ptr_ardata->ptr_first)->ptr_elvalue, ptr_ardata->driver); } } else if (title_type && !strcmp(title_type, "abbrev")) { + /* abbreviated journal title */ if (((ptr_ardata->perinfo).abbrev = strdup((ptr_ardata->ptr_first)->ptr_elvalue)) == NULL || dbi_driver_quote_string(ptr_ardata->driver, &((ptr_ardata->perinfo).abbrev)) == -1) { if ((new_msgpool = mstrcat(ptr_ardata->msgpool, outomem_n.text, &(ptr_ardata->msgpool_len), 0)) == NULL) { @@ -755,4 +772,5 @@ } else if (title_type && !strcmp(title_type, "user1")) { + /* user abbrev1 of a journal title */ if (((ptr_ardata->perinfo).custabbrev1 = strdup((ptr_ardata->ptr_first)->ptr_elvalue)) == NULL || dbi_driver_quote_string(ptr_ardata->driver, &((ptr_ardata->perinfo).custabbrev1)) == -1) { if ((new_msgpool = mstrcat(ptr_ardata->msgpool, outomem_n.text, &(ptr_ardata->msgpool_len), 0)) == NULL) { @@ -768,4 +786,5 @@ } else if (title_type && !strcmp(title_type, "user2")) { + /* user abbrev1 of a journal title */ if (((ptr_ardata->perinfo).custabbrev2 = strdup((ptr_ardata->ptr_first)->ptr_elvalue)) == NULL || dbi_driver_quote_string(ptr_ardata->driver, &((ptr_ardata->perinfo).custabbrev2)) == -1) { if ((new_msgpool = mstrcat(ptr_ardata->msgpool, outomem_n.text, &(ptr_ardata->msgpool_len), 0)) == NULL) { @@ -780,15 +799,4 @@ } } - else if (!title_type || !*title_type || !strcmp(title_type, "gen")){ - if (!strcmp(ptr_ardata->type, "CHAP") - || !strcmp(ptr_ardata->type, "CASE") - || !strcmp(ptr_ardata->type, "CONF") - || !strcmp(ptr_ardata->type, "BOOK")) { - result = set_risdata_field(ptr_ardata->ptr_risdata, "booktitle", (ptr_ardata->ptr_first)->ptr_elvalue, ptr_ardata->driver); - } - else { - result = set_risdata_field(ptr_ardata->ptr_risdata, "title", (ptr_ardata->ptr_first)->ptr_elvalue, ptr_ardata->driver); - } - } else { /* this means we've received invalid risx data */ |