refdb-cvs Mailing List for RefDB (Page 56)
Status: Beta
Brought to you by:
mhoenicka
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(88) |
Feb
(50) |
Mar
(36) |
Apr
(9) |
May
(30) |
Jun
(30) |
Jul
(22) |
Aug
(16) |
Sep
(42) |
Oct
(18) |
Nov
(29) |
Dec
(23) |
2005 |
Jan
(18) |
Feb
(28) |
Mar
(21) |
Apr
(35) |
May
(62) |
Jun
(22) |
Jul
(5) |
Aug
(40) |
Sep
(98) |
Oct
(81) |
Nov
(51) |
Dec
(62) |
2006 |
Jan
(46) |
Feb
(36) |
Mar
(8) |
Apr
(16) |
May
(14) |
Jun
(16) |
Jul
(47) |
Aug
(60) |
Sep
(34) |
Oct
(16) |
Nov
(46) |
Dec
(11) |
2007 |
Jan
(16) |
Feb
(13) |
Mar
(58) |
Apr
(32) |
May
(4) |
Jun
(8) |
Jul
(31) |
Aug
(46) |
Sep
(22) |
Oct
(30) |
Nov
(58) |
Dec
(15) |
2008 |
Jan
(8) |
Feb
(8) |
Mar
(2) |
Apr
(6) |
May
(3) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
(6) |
Nov
(3) |
Dec
(5) |
2009 |
Jan
(1) |
Feb
(20) |
Mar
(8) |
Apr
(5) |
May
(8) |
Jun
(3) |
Jul
(6) |
Aug
(4) |
Sep
(7) |
Oct
(8) |
Nov
(2) |
Dec
(1) |
2010 |
Jan
(1) |
Feb
(4) |
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2011 |
Jan
(5) |
Feb
(5) |
Mar
(13) |
Apr
(3) |
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2012 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(5) |
Nov
|
Dec
(3) |
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(13) |
2014 |
Jan
(2) |
Feb
(2) |
Mar
(2) |
Apr
(4) |
May
(1) |
Jun
(1) |
Jul
|
Aug
(6) |
Sep
(3) |
Oct
|
Nov
(2) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2022 |
Jan
(9) |
Feb
(16) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Markus H. <mho...@us...> - 2005-04-17 00:05:13
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20080 Modified Files: Tag: Release_0_9_5_stable Makefile.am refdbd.h.in Log Message: make db_path available for executables Index: Makefile.am =================================================================== RCS file: /cvsroot/refdb/refdb/src/Makefile.am,v retrieving revision 1.21.2.1 retrieving revision 1.21.2.2 diff -u -U2 -r1.21.2.1 -r1.21.2.2 --- Makefile.am 25 Oct 2004 21:15:34 -0000 1.21.2.1 +++ Makefile.am 17 Apr 2005 00:04:50 -0000 1.21.2.2 @@ -41,3 +41,4 @@ sed 's%<citestylexversion>%$(CITESTYLEXVERSION)%g' | \ sed 's%<citationlistxversion>%$(CITATIONLISTXVERSION)%g' | \ + sed 's%<db_dir>%$(db_dir)%' | \ sed 's%<main_db>%$(main_db)%' > refdbd.h Index: refdbd.h.in =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbd.h.in,v retrieving revision 1.7.2.6 retrieving revision 1.7.2.7 diff -u -U2 -r1.7.2.6 -r1.7.2.7 --- refdbd.h.in 15 Apr 2005 22:45:09 -0000 1.7.2.6 +++ refdbd.h.in 17 Apr 2005 00:05:04 -0000 1.7.2.7 @@ -59,4 +59,5 @@ #define FIFO_NAME "/tmp/refdbd_fifo" /* base name of a fifo */ #define MAIN_DB "<main_db>" /* name of the main database */ +#define DB_DIR "<db_dir>" /* directory which holds database and version file */ #define MIN_MAIN_DB_VERSION 1 /* minimum version tag of the main database */ #define DB_VERSION 1 /* version tag of reference databases created with this version */ |
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31575 Modified Files: Tag: Release_0_9_5_stable backend-bibtex.c backend-bibtex.h backend-db31.c backend-db31.h backend-dbib.c backend-dbib.h backend-dbiba.c backend-html.c backend-html.h backend-ris.c backend-ris.h backend-risx.c backend-risx.h backend-scrn.c backend-scrn.h backend-teix.c backend-teix.h backend.h backendn-html.c backendn-html.h backendn-notex.c backendn-notex.h backendn-scrn.c backendn-scrn.h client-commands.c connect.c connect.h dbfncs.c nmed2ris.c noteshandler.c readris.c refdb-client.c refdb-client.h refdb.h refdba.c refdba.h refdbc.c refdbc.h refdbd.c refdbd.h.in refdbda.c refdbdbib.c refdbdnote.c refdbdref.c refdbib.c refdbib.h risdb.c risdb.h risxhandler.c writenote.c writenote.h writeris.c writeris.h xmlhandler.c xmlhandler.h xmlout.c Log Message: refactored client-server protocol Index: backend-bibtex.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-bibtex.c,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -u -U2 -r1.16 -r1.16.2.1 --- backend-bibtex.c 29 Jan 2004 01:42:06 -0000 1.16 +++ backend-bibtex.c 15 Apr 2005 22:45:05 -0000 1.16.2.1 @@ -26,4 +26,5 @@ #include "refdb.h" +#include "connect.h" #include "linklist.h" #include "backend.h" @@ -49,4 +50,6 @@ extern dbi_result dbi_style_res; +extern char cs_term[]; + /* forward declarations of local functions */ static char* bibtexify_author(char** ptr_bibauthor, char* author); @@ -57,6 +60,5 @@ query - char prepare_render_bibtex returns a ptr to the result string - if successful, NULL if not + int prepare_render_bibtex returns 0 if successful, >0 if not struct renderinfo* ptr_rendinfo ptr to a structure with the info @@ -64,8 +66,8 @@ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -char* prepare_render_bibtex(struct renderinfo* ptr_rendinfo) { +int prepare_render_bibtex(struct renderinfo* ptr_rendinfo) { /* we just make sure that we start with a clean string */ (*(ptr_rendinfo->ptr_ref))[0] = '\0'; - return *(ptr_rendinfo->ptr_ref); + return 0; } @@ -73,6 +75,5 @@ finish_render_bibtex(): writes a footer for the bibtex output of a query - char* finish_render_bibtex returns ptr to the buffer if successful, - NULL if failed + int finish_render_bibtex returns 0 if successful, >0 if failed struct renderinfo* ptr_rendinfo ptr to a structure with the info @@ -80,15 +81,15 @@ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -char* finish_render_bibtex(struct renderinfo* ptr_rendinfo) { +int finish_render_bibtex(struct renderinfo* ptr_rendinfo) { char* new_ref; if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; - } - else { - *(ptr_rendinfo->ptr_ref) = new_ref; - return new_ref; + LOG_PRINT(LOG_WARNING, get_status_msg(801)); + return 801; } + + *(ptr_rendinfo->ptr_ref) = new_ref; + + return 0; } @@ -96,6 +97,5 @@ render_bibtex() renders a RIS dataset for bibtex output - char* render_bibtex returns ptr to the buffer if successful, - NULL if failed + int render_bibtex returns 0 if successful, >0 if failed struct renderinfo* ptr_rendinfo ptr to a structure with the info @@ -103,5 +103,5 @@ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -char* render_bibtex(struct renderinfo* ptr_rendinfo) { +int render_bibtex(struct renderinfo* ptr_rendinfo) { int nperiodical_type; int sql_command_len; @@ -132,5 +132,6 @@ if ((type = get_refdb_type(ptr_rendinfo->dbires)) == NULL) { - return NULL; + LOG_PRINT(LOG_WARNING, get_status_msg(234)); + return 234; } @@ -145,6 +146,6 @@ sql_command = (char*)malloc(sql_command_len); if (!sql_command) { - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + LOG_PRINT(LOG_WARNING, get_status_msg(801)); + return 801; } @@ -152,7 +153,7 @@ quoted_journal = mstrdup((ptr_rendinfo->ptr_biblio_info)->format_string); if (!dbi_driver_quote_string(driver, "ed_journal)) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); free(sql_command); - return NULL; + return 801; } @@ -167,7 +168,7 @@ /* need another connection to the database refdb */ if ((bibconns.conn_refdb = connect_to_db(ptr_rendinfo->ptr_clrequest, MAIN_DB, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, connerr.text); + LOG_PRINT(LOG_WARNING, get_status_msg(202)); free(sql_command); - return NULL; + return 202; } } @@ -180,9 +181,9 @@ if (!dbirescit) { - LOG_PRINT(LOG_WARNING, "CITSTYLE select failed"); + LOG_PRINT(LOG_WARNING, get_status_msg(234)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 234; } @@ -190,17 +191,17 @@ n_id = my_dbi_result_get_idval_idx(dbirescit, 1); if (!load_style(type, n_id, bibconns.conn_refdb)) { - LOG_PRINT(LOG_WARNING, "could not load style information"); + LOG_PRINT(LOG_WARNING, get_status_msg(234)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 234; } } else { - LOG_PRINT(LOG_WARNING, "could not load style information"); + LOG_PRINT(LOG_WARNING, get_status_msg(234)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 234; } @@ -300,5 +301,5 @@ dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 234; } @@ -328,5 +329,6 @@ dbi_conn_close(bibconns.conn_refdb); } - return NULL; + LOG_PRINT(LOG_WARNING, get_status_msg(234)); + return 234; } @@ -349,6 +351,6 @@ dbi_conn_close(bibconns.conn_refdb); } - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + LOG_PRINT(LOG_WARNING, get_status_msg(801)); + return 801; } else { @@ -367,5 +369,5 @@ dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } @@ -377,6 +379,6 @@ dbi_conn_close(bibconns.conn_refdb); } - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + LOG_PRINT(LOG_WARNING, get_status_msg(801)); + return 801; } else { @@ -390,6 +392,6 @@ dbi_conn_close(bibconns.conn_refdb); } - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + LOG_PRINT(LOG_WARNING, get_status_msg(801)); + return 801; } else { @@ -402,9 +404,9 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "},\n", ptr_rendinfo->ptr_ref_len, 5)) == NULL) { unload_style(); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } else { @@ -415,9 +417,9 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), ",\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { unload_style(); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } else { @@ -433,9 +435,9 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), " TITLE = {", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { unload_style(); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } else { @@ -444,9 +446,9 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* title */ unload_style(); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } else { @@ -455,9 +457,9 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "},\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { unload_style(); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } else { @@ -476,9 +478,9 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), " BOOKTITLE = {", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { unload_style(); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } else { @@ -487,9 +489,9 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* book title */ unload_style(); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } else { @@ -498,9 +500,9 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "},\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { unload_style(); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } else { @@ -515,9 +517,9 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), " SERIES = {", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { unload_style(); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } else { @@ -526,9 +528,9 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* series title */ unload_style(); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } else { @@ -537,9 +539,9 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "},\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { unload_style(); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } else { @@ -556,9 +558,9 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), " JOURNAL = {", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { unload_style(); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } else { @@ -572,5 +574,5 @@ dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } } @@ -584,6 +586,6 @@ if ((item = get_periodical(bibconns.conn, date_buffer, NULL, nperiodical_type, &errcode, my_dbi_result_get_idval(ptr_rendinfo->dbires, "refdb_id"))) != NULL) { if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), " JOURNAL = {", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + LOG_PRINT(LOG_WARNING, get_status_msg(801)); + return 801; } else { @@ -591,6 +593,6 @@ } if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + LOG_PRINT(LOG_WARNING, get_status_msg(801)); + return 801; } else { @@ -602,9 +604,9 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "},\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { unload_style(); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } else { @@ -618,9 +620,9 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), " VOLUME = {", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { unload_style(); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } else { @@ -629,9 +631,9 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* volume */ unload_style(); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } else { @@ -640,9 +642,9 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "},\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { unload_style(); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } else { @@ -658,9 +660,9 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), " NUMBER = {", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { unload_style(); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } else { @@ -669,9 +671,9 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* issue */ unload_style(); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } else { @@ -680,9 +682,9 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "},\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { unload_style(); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); if (!n_multiple_db) { dbi_conn_close(bibconns.conn_refdb); } - return NULL; + return 801; } else { @@ -703,6 +705,6 @@ if (item != NULL) { if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), " PAGES = {", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + LOG_PRINT(LOG_WARNING, get_status_msg(801)); + return 801; } else { @@ -710,6 +712,6 @@ } if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* start page */ - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + LOG_PRINT(LOG_WARNING, get_status_msg(801)); + return 801; } else { @@ -720,6 +722,6 @@ if (item != NULL) { if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "-", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + LOG_PRINT(LOG_WARNING, get_status_msg(801)); + return 801; } else { @@ -727,6 +729,6 @@ } if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* end page */ - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + LOG_PRINT(LOG_WARNING, get_status_msg(801)); + return 801; } else { @@ -735,6 +737,6 @@ } if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "},\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + LOG_PRINT(LOG_WARNING, get_status_msg(801)); + return 801; } else { @@ -745,6 +747,6 @@ /* eliminate the trailing comma and finish with an empty line */ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "\n}\n", ptr_rendinfo->ptr_ref_len, 2)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + LOG_PRINT(LOG_WARNING, get_status_msg(801)); + return 801; } else { @@ -753,5 +755,5 @@ /* printf("%s\n", ref); */ - return *(ptr_rendinfo->ptr_ref); + return 0; } @@ -777,6 +779,8 @@ int result; int not_done = 1; + int cs_status; size_t n_bufsize; size_t nsql_command_len = 4096; /* should be enough */ + size_t buffer_len = 4096; char *sql_command = NULL; char *id_list = NULL; @@ -789,4 +793,5 @@ char *the_db; char *drivername; + char *buffer; char prev_db[DBNAME_LENGTH] = ""; dbi_conn conn; @@ -814,6 +819,6 @@ if (id_list == NULL || insert_lilimem(&sentinel, (void**)&id_list, NULL)) { delete_all_lilimem(&sentinel); - iwrite(ptr_clrequest->fd, outomem_n.text, outomem_n.length); - LOG_PRINT(LOG_CRIT, outomem.text); + send_status(ptr_clrequest->fd, 801, TERM_NO); + LOG_PRINT(LOG_CRIT, get_status_msg(801)); return 1; } @@ -822,21 +827,32 @@ if (sql_command == NULL || insert_lilimem(&sentinel, (void**)&sql_command, NULL)) { delete_all_lilimem(&sentinel); - iwrite(ptr_clrequest->fd, outomem_n.text, outomem_n.length); - LOG_PRINT(LOG_CRIT, outomem.text); + send_status(ptr_clrequest->fd, 801, TERM_NO); + LOG_PRINT(LOG_CRIT, get_status_msg(801)); return 1; } - /* send acknowledgement to client */ - numbyte = tiwrite(ptr_clrequest->fd, positive.text, TERM_YES); - if (numbyte == -1) { - LOG_PRINT(LOG_INFO, "could not write to client"); + /* fill in variable elements of structure */ + buffer = (char*)malloc(buffer_len); + if (buffer == NULL || insert_lilimem(&sentinel, (void**)&(buffer), NULL)) { delete_all_lilimem(&sentinel); + send_status(ptr_clrequest->fd, 801, TERM_NO); + LOG_PRINT(LOG_CRIT, get_status_msg(801)); return 1; } + buffer[0] = '\0'; + rendinfo.ptr_ref_len = &buffer_len; + rendinfo.ptr_ref = &buffer; + + /* send acknowledgement to client */ + send_status(ptr_clrequest->fd, 0, TERM_NO); + + /* status is always 0 */ + cs_status = read_status(ptr_clrequest->fd); + /* read whitespace-separated id list from client*/ numbyte = tread(ptr_clrequest->fd, id_list, n_bufsize); if (numbyte == -1) { - LOG_PRINT(LOG_INFO, "could not read from client"); + LOG_PRINT(LOG_INFO, get_status_msg(109)); delete_all_lilimem(&sentinel); return 1; @@ -848,6 +864,6 @@ /* connect to database server*/ if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) == NULL) { - iwrite(ptr_clrequest->fd, connerr_n.text, connerr_n.length); - LOG_PRINT(LOG_ERR, "could not connect to database server"); + send_status(ptr_clrequest->fd, 204, TERM_NO); + LOG_PRINT(LOG_ERR, get_status_msg(204)); delete_all_lilimem(&sentinel); return 1; @@ -858,9 +874,15 @@ if (drivername == NULL || insert_lilimem(&sentinel, (void**)&drivername, NULL)) { delete_all_lilimem(&sentinel); - iwrite(ptr_clrequest->fd, outomem_n.text, outomem_n.length); - LOG_PRINT(LOG_CRIT, outomem.text); + send_status(ptr_clrequest->fd, 801, TERM_NO); + LOG_PRINT(LOG_ERR, get_status_msg(801)); return 1; } + /* create a "header" if necessary */ + /* prepare_render resets sql_command */ + + + prepare_render_bibtex(&rendinfo); + while (not_done) { /* search for the start of a token */ @@ -868,5 +890,5 @@ token++; } - + if (token == eof_string){ break; @@ -912,8 +934,8 @@ if (strcmp(prev_db, the_db)) { if (dbi_conn_select_db(conn, the_db)) { - iwrite(ptr_clrequest->fd, connerr_n.text, connerr_n.length); + send_status(ptr_clrequest->fd, 204, TERM_NO); + LOG_PRINT(LOG_ERR, get_status_msg(204)); dbi_conn_close(conn); delete_all_lilimem(&sentinel); - LOG_PRINT(LOG_WARNING, "could not connect to database"); return 1; } @@ -925,6 +947,6 @@ dbi_conn_close(conn); if ((conn = connect_to_db(ptr_clrequest, the_db, 0)) == NULL) { - iwrite(ptr_clrequest->fd, connerr_n.text, connerr_n.length); - LOG_PRINT(LOG_ERR, "could not connect to database server"); + send_status(ptr_clrequest->fd, 204, TERM_NO); + LOG_PRINT(LOG_ERR, get_status_msg(204)); delete_all_lilimem(&sentinel); return 1; @@ -938,5 +960,6 @@ rendinfo.dbires = dbi_conn_query(conn, sql_command); if (!rendinfo.dbires) { - tiwrite(ptr_clrequest->fd, "select failed\n", TERM_NO); + send_status(ptr_clrequest->fd, 234, TERM_NO); + LOG_PRINT(LOG_ERR, get_status_msg(234)); dbi_conn_close(conn); delete_all_lilimem(&sentinel); @@ -944,71 +967,63 @@ } - /* create a "header" if necessary */ - /* prepare_render resets sql_command */ - - /* fill in variable elements of structure */ - rendinfo.ptr_ref = &sql_command; - rendinfo.ptr_ref_len = &nsql_command_len; - - prepare_render_bibtex(&rendinfo); - /* fetch all articles we're interested in */ while (dbi_result_next_row(rendinfo.dbires)) { + int cs_status; + /* fill in variable elements of structure */ - rendinfo.ptr_ref = &sql_command; - rendinfo.ptr_ref_len = &nsql_command_len; + /* todo: what's this? why -1?*/ rendinfo.nref_counter = -1; rendinfo.database = the_db; rendinfo.dbname = dbstring; - /* recycle sql_command */ - if ((new_sql_command = render_bibtex(&rendinfo)) == NULL) { - iwrite(ptr_clrequest->fd, outomem_n.text, outomem_n.length); - dbi_result_free(rendinfo.dbires); - dbi_conn_close(conn); - delete_all_lilimem(&sentinel); - ptr_addresult->failure++; - return 1; - } - else { - sql_command = new_sql_command; + if ((cs_status = render_bibtex(&rendinfo)) != 0) { + if (cs_status == 801) { + send_status(ptr_clrequest->fd, cs_status, TERM_NO); + LOG_PRINT(LOG_ERR, get_status_msg(cs_status)); + dbi_result_free(rendinfo.dbires); + dbi_conn_close(conn); + delete_all_lilimem(&sentinel); + return 1; + } + else { + ptr_addresult->failure++; + } } + ptr_addresult->success++; - iwrite(ptr_clrequest->fd, sql_command, strlen(sql_command)); - sql_command[0] = '\0'; - } + + /* send ok status, then the terminated result string */ + send_status(ptr_clrequest->fd, 404, TERM_NO); + iwrite(ptr_clrequest->fd, buffer, strlen(buffer)); + iwrite(ptr_clrequest->fd, cs_term, TERM_LEN); + + /* reset buffer string */ + buffer[0] = '\0'; + + /* read client response */ + cs_status = read_status(ptr_clrequest->fd); + + if (cs_status) { + break; + } + } /* end while */ + + } /* end while have more tokens */ /* create a "footer" if necessary */ /* fill in variable elements of structure */ - rendinfo.ptr_ref = &sql_command; - rendinfo.ptr_ref_len = &nsql_command_len; - - if ((new_sql_command = finish_render_bibtex(&rendinfo)) == NULL) { - dbi_result_free(rendinfo.dbires); - dbi_conn_close(conn); - delete_all_lilimem(&sentinel); - return 1; - } - else { - sql_command = new_sql_command; - } - iwrite(ptr_clrequest->fd, sql_command, strlen(sql_command)); -/* dbi_result_free(dbires); */ + if ((cs_status = finish_render_bibtex(&rendinfo)) != 0) { + send_status(ptr_clrequest->fd, cs_status, TERM_NO); + LOG_PRINT(LOG_ERR, get_status_msg(cs_status)); + dbi_result_free(rendinfo.dbires); + dbi_conn_close(conn); + delete_all_lilimem(&sentinel); + return 1; } - dbi_conn_close(conn); + send_status(ptr_clrequest->fd, 402, TERM_NO); + tiwrite(ptr_clrequest->fd, buffer, TERM_YES); - tiwrite(ptr_clrequest->fd, "", TERM_YES); /* finish sending data */ - - /* wait for receipt from client, reuse sql_command */ - result = tread(ptr_clrequest->fd, sql_command, nsql_command_len); - - if (result == -1) { - LOG_PRINT(LOG_WARNING, "could not read ack from client"); - } - - if (strncmp(sql_command, positive.text, positive.length) != 0) { - LOG_PRINT(LOG_WARNING, "could not read ack from client"); - } + dbi_conn_close(conn); delete_all_lilimem(&sentinel); Index: backend-bibtex.h =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-bibtex.h,v retrieving revision 1.6 retrieving revision 1.6.2.1 diff -u -U2 -r1.6 -r1.6.2.1 --- backend-bibtex.h 13 Dec 2002 20:34:10 -0000 1.6 +++ backend-bibtex.h 15 Apr 2005 22:45:05 -0000 1.6.2.1 @@ -20,7 +20,7 @@ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -char* prepare_render_bibtex(struct renderinfo* ptr_rendinfo); -char* finish_render_bibtex(struct renderinfo* ptr_rendinfo); -char* render_bibtex(struct renderinfo* ptr_rendinfo); +int prepare_render_bibtex(struct renderinfo* ptr_rendinfo); +int finish_render_bibtex(struct renderinfo* ptr_rendinfo); +int render_bibtex(struct renderinfo* ptr_rendinfo); int gettexbib(struct CLIENT_REQUEST* ptr_clrequest, struct bibinfo* ptr_biblio_info, struct ADDRESULT* ptr_addresult); Index: backend-db31.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-db31.c,v retrieving revision 1.16 retrieving revision 1.16.2.1 diff -u -U2 -r1.16 -r1.16.2.1 --- backend-db31.c 5 Oct 2003 10:36:16 -0000 1.16 +++ backend-db31.c 15 Apr 2005 22:45:05 -0000 1.16.2.1 @@ -52,6 +52,5 @@ query - char* prepare_render_db31 returns a ptr to the result string or - NULL if failed + int prepare_render_db31 returns 0 if successful,>0 if failed struct renderinfo* ptr_rendinfo ptr to a structure with the info @@ -59,5 +58,5 @@ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -char* prepare_render_db31(struct renderinfo* ptr_rendinfo) { +int prepare_render_db31(struct renderinfo* ptr_rendinfo) { /* ToDo: control with format_string whether or not to include the document type declaration. For the time being the declaration does go in but is commented out */ @@ -70,8 +69,9 @@ else { /* we have a problem */ - return NULL; + LOG_PRINT(LOG_WARNING, get_status_msg(302)); + return 302; } - return *(ptr_rendinfo->ptr_ref); + return 0; } @@ -79,6 +79,5 @@ finish_render_db31(): writes a footer for the docbook output of a query - char* finish_render_ris returns ptr to the buffer if successful, - NULL if failed + int finish_render_ris returns 0 if successful, >0 if failed struct renderinfo* ptr_rendinfo ptr to a structure with the info @@ -86,14 +85,15 @@ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -char* finish_render_db31(struct renderinfo* ptr_rendinfo) { +int finish_render_db31(struct renderinfo* ptr_rendinfo) { char* new_ref; if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "</bibliography>\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { - return NULL; - } - else { - *(ptr_rendinfo->ptr_ref) = new_ref; - return new_ref; + LOG_PRINT(LOG_WARNING, get_status_msg(801)); + return 801; } + + *(ptr_rendinfo->ptr_ref) = new_ref; + + return 0; } @@ -101,5 +101,5 @@ render_db31() renders a RIS dataset for DocBook V.3.1 export - char* render_db31 returns ptr to ref if successful, NULL if not + int render_db31 returns 0 if successful, >0 if not struct renderinfo* ptr_rendinfo ptr to a structure with the info @@ -107,5 +107,5 @@ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -char* render_db31(struct renderinfo* ptr_rendinfo) { +int render_db31(struct renderinfo* ptr_rendinfo) { char have_author = 0; char id[32] = ""; /* reference ID */ @@ -136,6 +136,6 @@ if ((chunk_buf = (char*)malloc(chunk_buf_len)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + LOG_PRINT(LOG_WARNING, get_status_msg(801)); + return 801; } @@ -143,6 +143,7 @@ if ((type = get_refdb_type(ptr_rendinfo->dbires)) == NULL) { + LOG_PRINT(LOG_WARNING, get_status_msg(234)); free(chunk_buf); - return NULL; + return 234; } @@ -165,7 +166,7 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "</abbrev>\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); free(chunk_buf); - return NULL; + return 801; } else { @@ -177,7 +178,7 @@ if (chunk && *chunk) { if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), chunk, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); - free(chunk_buf); - return NULL; + LOG_PRINT(LOG_WARNING, get_status_msg(801)); + free(chunk_buf); + return 801; } else { @@ -190,7 +191,7 @@ if (chunk && *chunk) { if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), chunk, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); free(chunk_buf); - return NULL; + return 801; } else { @@ -203,7 +204,7 @@ if (chunk && *chunk) { if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), chunk, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); free(chunk_buf); - return NULL; + return 801; } else { @@ -221,7 +222,7 @@ if (chunk && *chunk) { if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), chunk, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); free(chunk_buf); - return NULL; + return 801; } else { @@ -240,7 +241,7 @@ if (chunk && *chunk) { if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), chunk, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); free(chunk_buf); - return NULL; + return 801; } else { @@ -252,7 +253,7 @@ /* finish bibliography entry */ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "</biblioentry>\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); free(chunk_buf); - return NULL; + return 801; } else { @@ -262,5 +263,5 @@ free(chunk_buf); - return *(ptr_rendinfo->ptr_ref); + return 0; } @@ -300,5 +301,5 @@ if ((author_buf = (char*)malloc(author_buf_len)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -306,5 +307,5 @@ /* start analytic information */ if ((new_ref = mstrcat(*ptr_chunk_buf, "<biblioset relation=\"analytic\">\n", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); free(author_buf); return NULL; @@ -324,5 +325,5 @@ n_have_data++; if ((new_ref = mstrcat(*ptr_chunk_buf, author_result, ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); free(author_buf); return NULL; @@ -357,5 +358,5 @@ free((char*)item); free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -367,5 +368,5 @@ free((char*)item); free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -377,5 +378,5 @@ free((char*)item); free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -389,5 +390,5 @@ /* finish analytic information */ if ((new_ref = mstrcat(*ptr_chunk_buf, "</biblioset>\n", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -444,5 +445,5 @@ if ((author_buf = (char*)malloc(author_buf_len)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -452,5 +453,5 @@ /* start monographic information */ if ((new_ref = mstrcat(*ptr_chunk_buf, "<biblioset relation=\"monogr\">\n", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); free(author_buf); return NULL; @@ -476,5 +477,5 @@ n_have_data++; if ((new_ref = mstrcat(*ptr_chunk_buf, author_result, ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); free(author_buf); return NULL; @@ -496,5 +497,5 @@ n_have_data++; if ((new_ref = mstrcat(*ptr_chunk_buf, author_result, ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); free(author_buf); return NULL; @@ -530,5 +531,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, "<biblioset relation=\"", ptr_chunk_buf_len, 0)) == NULL) { free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -539,5 +540,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, journaltype[i], ptr_chunk_buf_len, 0)) == NULL) { free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -548,5 +549,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, "\">\n", ptr_chunk_buf_len, 0)) == NULL) { free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -557,5 +558,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, "<title>", ptr_chunk_buf_len, 0)) == NULL) { free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -566,5 +567,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, entitize_buf, ptr_chunk_buf_len, 0)) == NULL) { free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -575,5 +576,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, "</title>\n</biblioset>\n", ptr_chunk_buf_len, 0)) == NULL) { free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -615,5 +616,5 @@ free((char*)item); free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -625,5 +626,5 @@ free((char*)item); free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -635,5 +636,5 @@ free((char*)item); free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -651,5 +652,5 @@ if ((item = get_refdb_issn(ptr_rendinfo->dbires)) != NULL) { if ((new_ref = mstrcat(*ptr_chunk_buf, "<isbn>", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -659,5 +660,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, (char*)item, ptr_chunk_buf_len, 0)) == NULL) { /* isbn/issn */ - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -667,5 +668,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, "</isbn>\n", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -682,5 +683,5 @@ if ((item = get_refdb_publisher(ptr_rendinfo->dbires)) != NULL) { if ((new_ref = mstrcat(*ptr_chunk_buf, "<publisher><publishername>", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -690,5 +691,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, (char*)item, ptr_chunk_buf_len, 0)) == NULL) { /* publisher */ - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -698,5 +699,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, "</publishername>", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -710,5 +711,5 @@ if ((item = get_refdb_city(ptr_rendinfo->dbires)) != NULL) { if ((new_ref = mstrcat(*ptr_chunk_buf, "<address>", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -718,5 +719,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, (char*)item, ptr_chunk_buf_len, 0)) == NULL) { /* city */ - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -726,5 +727,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, "</address>", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -736,5 +737,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, "</publisher>\n", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -759,5 +760,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, "<volumenum>", ptr_chunk_buf_len, 0)) == NULL) { free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -768,5 +769,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, entitize_buf, ptr_chunk_buf_len, 0)) == NULL) { /* volume */ free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -777,5 +778,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, "</volumenum>\n", ptr_chunk_buf_len, 0)) == NULL) { free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -789,5 +790,5 @@ if ((item = get_refdb_issue(ptr_rendinfo->dbires)) != NULL) { if ((entitize_buf = mstrdup((char*)item)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -800,5 +801,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, "<issuenum>", ptr_chunk_buf_len, 0)) == NULL) { free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -809,5 +810,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, entitize_buf, ptr_chunk_buf_len, 0)) == NULL) { /* issue */ free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -818,5 +819,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, "</issuenum>\n", ptr_chunk_buf_len, 0)) == NULL) { free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -830,5 +831,5 @@ if ((item = get_refdb_startpage(ptr_rendinfo->dbires)) != NULL) { if ((entitize_buf = mstrdup((char*)item)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -841,5 +842,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, "<pagenums>", ptr_chunk_buf_len, 0)) == NULL) { free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -850,5 +851,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, entitize_buf, ptr_chunk_buf_len, 0)) == NULL) { /* start page */ free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -861,5 +862,5 @@ if ((item = get_refdb_endpage(ptr_rendinfo->dbires)) != NULL) { if ((entitize_buf = mstrdup((char*)item)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -872,5 +873,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, "-", ptr_chunk_buf_len, 0)) == NULL) { free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -881,5 +882,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, entitize_buf, ptr_chunk_buf_len, 0)) == NULL) { /* end page */ free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -891,5 +892,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, "</pagenums>\n", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -902,5 +903,5 @@ if ((item = get_refdb_pubyear(ptr_rendinfo->dbires, periodical)) != NULL) { if ((new_ref = mstrcat(*ptr_chunk_buf, "<pubdate>", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -910,5 +911,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, periodical, ptr_chunk_buf_len, 0)) == NULL) { /* year */ - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -918,5 +919,5 @@ if ((new_ref = mstrcat(*ptr_chunk_buf, "</pubdate>\n", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -929,5 +930,5 @@ /* finish monographic information */ if ((new_ref = mstrcat(*ptr_chunk_buf, "</biblioset>\n", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -974,5 +975,5 @@ if ((author_buf = (char*)malloc(author_buf_len)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -980,5 +981,5 @@ /* start series info */ if ((new_ref = mstrcat(*ptr_chunk_buf, "<biblioset relation=\"series\">\n", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); free(author_buf); return NULL; @@ -998,5 +999,5 @@ n_have_data++; if ((new_ref = mstrcat(*ptr_chunk_buf, author_result, ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); free(author_buf); return NULL; @@ -1028,5 +1029,5 @@ free((char*)item); free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -1038,5 +1039,5 @@ free((char*)item); free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -1048,5 +1049,5 @@ free((char*)item); free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -1061,5 +1062,5 @@ /* finish series information */ if ((new_ref = mstrcat(*ptr_chunk_buf, "</biblioset>\n", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -1100,5 +1101,5 @@ /* start bibliomisc element */ if ((new_ref = mstrcat(*ptr_chunk_buf, "<bibliomisc role=\"annotation\">", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -1126,5 +1127,5 @@ free((char*)item); free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -1136,5 +1137,5 @@ /* finish notes */ if ((new_ref = mstrcat(*ptr_chunk_buf, "</bibliomisc>\n", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -1175,5 +1176,5 @@ /* start abstract */ if ((new_ref = mstrcat(*ptr_chunk_buf, "<abstract>\n", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -1201,5 +1202,5 @@ free((char*)item); free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -1211,5 +1212,5 @@ free((char*)item); free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -1221,5 +1222,5 @@ free((char*)item); free(entitize_buf); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -1233,5 +1234,5 @@ /* finish abstract information */ if ((new_ref = mstrcat(*ptr_chunk_buf, "</abstract>\n", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -1450,5 +1451,5 @@ if (dbauthor == NULL) { clean_request(dbires); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -1462,5 +1463,5 @@ clean_request(dbires); free(dbauthor); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -1473,5 +1474,5 @@ clean_request(dbires); free(dbauthor); - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } @@ -1486,5 +1487,5 @@ if (!nis_first) { if ((new_ref = mstrcat(*ptr_chunk_buf, "\n</authorgroup>\n", ptr_chunk_buf_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); + LOG_PRINT(LOG_WARNING, get_status_msg(801)); return NULL; } Index: backend-db31.h =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-db31.h,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -u -U2 -r1.4 -r1.4.2.1 --- backend-db31.h 13 Dec 2002 20:34:12 -0000 1.4 +++ backend-db31.h 15 Apr 2005 22:45:05 -0000 1.4.2.1 @@ -20,7 +20,7 @@ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -char* prepare_render_db31(struct renderinfo* ptr_rendinfo); -char* finish_render_db31(struct renderinfo* ptr_rendinfo); -char* render_db31(struct renderinfo* ptr_rendinfo); +int prepare_render_db31(struct renderinfo* ptr_rendinfo); +int finish_render_db31(struct renderinfo* ptr_rendinfo); +int render_db31(struct renderinfo* ptr_rendinfo); Index: backend-dbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-dbib.c,v retrieving revision 1.28.2.3 retrieving revision 1.28.2.4 diff -u -U2 -r1.28.2.3 -r1.28.2.4 --- backend-dbib.c 21 Aug 2004 15:42:05 -0000 1.28.2.3 +++ backend-dbib.c 15 Apr 2005 22:45:05 -0000 1.28.2.4 @@ -36,4 +36,5 @@ #include "strfncs.h" #include "dbfncs.h" +#include "connect.h" extern int n_log_level; @@ -50,5 +51,5 @@ query - int prepare_render_dbib returns 0 if ok, 1 if error + int prepare_render_dbib returns 0 if ok, >0 if error [...2730 lines suppressed...] } - ref_buffer[0] = '\0'; + + *ptr_ref = new_ref; } - } /* while */ - } /* if */ + ref_buffer[0] = '\0'; + } + } /* end while */ + dbi_result_free(dbires_pos); unload_style(); @@ -2549,5 +2086,5 @@ free(ref_buffer); - return *ptr_ref; + return error; } Index: backend-dbib.h =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-dbib.h,v retrieving revision 1.9 retrieving revision 1.9.2.1 diff -u -U2 -r1.9 -r1.9.2.1 --- backend-dbib.h 9 Sep 2003 22:33:37 -0000 1.9 +++ backend-dbib.h 15 Apr 2005 22:45:05 -0000 1.9.2.1 @@ -27,10 +27,10 @@ int prepare_render_dbib(char* ref, struct bibinfo* ptr_biblio_info, dbi_result dbires, int n_ref_format); -char* finish_render_dbib(char** ptr_ref, size_t* ptr_ref_len, struct BIBCONNS* ptr_bibconns, struct bibinfo* ptr_biblio_info, char* table_name, struct CLIENT_REQUEST* ptr_clrequest); -char* render_dbib(char** ptr_ref, size_t* ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, const char* database, struct bibinfo* ptr_biblio_info, char* username, char* pdfroot, int nref_counter); -char* format_entry(char** ptr_ref, size_t* ptr_ref_len, char* pubtype, struct BIBCONNS* ptr_bibconns, dbi_result dbiresref, dbi_result dbires, const char* database, const char* username, int nref_counter, char* current_mset, struct bibinfo* ptr_biblio_info); +int finish_render_dbib(char** ptr_ref, size_t* ptr_ref_len, struct BIBCONNS* ptr_bibconns, struct bibinfo* ptr_biblio_info, char* table_name, struct CLIENT_REQUEST* ptr_clrequest); +int render_dbib(char** ptr_ref, size_t* ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, const char* database, struct bibinfo* ptr_biblio_info, char* username, char* pdfroot, int nref_counter); +int format_entry(char** ptr_ref, size_t* ptr_ref_len, char* pubtype, struct BIBCONNS* ptr_bibconns, dbi_result dbiresref, dbi_result dbires, const char* database, const char* username, int nref_counter, char* current_mset, struct bibinfo* ptr_biblio_info); char* format_refnumber(char** ptr_ref, size_t* ptr_ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, dbi_result dbiresref, int nref_counter, int n_intext); -char* format_authorlist(char** ptr_ref, size_t* ptr_ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, dbi_result dbiresref, int type, const char* database, int n_intext, struct bibinfo* ptr_biblio_info); +int format_authorlist(char** ptr_ref, size_t* ptr_ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, dbi_result dbiresref, int type, const char* database, int n_intext, struct bibinfo* ptr_biblio_info); char* format_pubdate(char** ptr_ref, size_t* ptr_ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, dbi_result dbiresref, dbi_result dbirescit, int type, int n_intext, const char* year_unique_suffix); char* format_title(char** ptr_ref, size_t* ptr_ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, dbi_result dbires_ref, int type, int n_intext); Index: backend-dbiba.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-dbiba.c,v retrieving revision 1.26.2.8 retrieving revision 1.26.2.9 diff -u -U2 -r1.26.2.8 -r1.26.2.9 --- backend-dbiba.c 23 Aug 2004 22:15:19 -0000 1.26.2.8 +++ backend-dbiba.c 15 Apr 2005 22:45:05 -0000 1.26.2.9 @@ -44,5 +44,5 @@ /* forward declarations of local functions */ static char* arabic_to_roman(char* roman, const char* arabic); -static char* format_authorname(char** ptr_ref, size_t* ptr_ref_len, struct AUTHOR_INFO* ptr_ainfo, const char* authorsep, const char* nameorder, const char* initialstyle, const char* author_upper, const char* author_preceeding, const char* author_following, int nis_intext, int type); +static int format_authorname(char** ptr_ref, size_t* ptr_ref_len, struct AUTHOR_INFO* ptr_ainfo, const char* authorsep, const char* nameorder, const char* initialstyle, const char* author_upper, const char* author_preceeding, const char* author_following, int nis_intext, int type); static char* format_day(char* ref, size_t* ptr_ref_len, const char* day, const char* dayformat, const char* pad); static char* format_firstmiddlename(char** ptr_ref, size_t* ptr_ref_len, struct AUTHOR_INFO* ptr_ainfo, const char* author_upper, const char* initialstyle, int nis_intext, int type); @@ -159,5 +159,5 @@ bibliography entry as a DocBook bibliomixed text - char* format_authorlist returns ptr to the buffer if successful, NULL if failed + int format_authorlist returns 0 if successful, >0 if failed char** ptr_ref ptr to a ptr to a buffer created with malloc which will receive @@ -191,5 +191,5 @@ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -char* format_authorlist(char** ptr_ref, size_t* ptr_ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, dbi_result dbires_ref, int type, const char* database, int n_intext, struct bibinfo* ptr_biblio_info) { +int format_authorlist(char** ptr_ref, size_t* ptr_ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, dbi_result dbires_ref, int type, const char* database, int n_intext, struct bibinfo* ptr_biblio_info) { int num_authors; int nauthor_count = 0; @@ -197,4 +197,5 @@ int nauthor_display; int nhave_content = 0; + int n_status; unsigned long long n_id; /* const char* authors; */ @@ -358,6 +359,5 @@ n_id = my_dbi_result_get_idval(dbires, "refdb_id"); if (!n_id) { - LOG_PRINT(LOG_WARNING, "format_authorlist: cannot retrieve ID"); - return NULL; + return 244; } sprintf(id, ULLSPEC, (unsigned long long)n_id); @@ -416,5 +416,5 @@ if (item && !*item && !dbi_conn_error_flag(ptr_bibconns->conn_refdb)) { free(item); - return *ptr_ref; /* ASAME is empty string -> suppress authorlist */ + return 0; /* ASAME is empty string -> suppress authorlist */ } else if (item) { @@ -422,15 +422,13 @@ if (item1 && *item1 && !dbi_conn_error_flag(ptr_bibconns->conn_refdb)) { /* preceeding */ if (sgml_entitize(&item1, NULL) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); free(item); free(item1); - return NULL; + return 801; } if ((new_ref = mstrcat(*ptr_ref, item1, ptr_ref_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); free(item1); free(item); - return NULL; + return 801; } else { @@ -445,15 +443,13 @@ if (item1 && *item1 && !dbi_conn_error_flag(ptr_bibconns->conn_refdb)) { /* textpreceeding */ if (sgml_entitize(&item1, NULL) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); free(item1); free(item); - return NULL; + return 801; } if ((new_ref = mstrcat(*ptr_ref, item1, ptr_ref_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); free(item1); free(item); - return NULL; + return 801; } else { @@ -468,12 +464,10 @@ if (sgml_entitize(&item, NULL) == NULL) { free(item); - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return 801; } if ((new_ref = mstrcat(*ptr_ref, item, ptr_ref_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); free(item); - return NULL; + return 801; } else { @@ -488,13 +482,11 @@ if (item && *item && !dbi_conn_error_flag(ptr_bibconns->conn_refdb)) { /* following */ if (sgml_entitize(&item, NULL) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); free(item); - return NULL; + return 801; } if ((new_ref = mstrcat(*ptr_ref, item, ptr_ref_len, 0)) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); free(item); - return NULL; + return 801; } else { @@ -505,5 +497,5 @@ free(item); } - return *ptr_ref; + return 0; } /* else: ASAME undefined, process authorlist as usual */ @@ -514,6 +506,5 @@ if (sgml_entitize(&alist_preceeding, NULL) == NULL) { free(alist_preceeding); - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return 801; } @@ -546,6 +537,5 @@ free(alist_preceeding); clean_request(dbires_author); - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return 801; } @@ -570,5 +560,5 @@ free(alist_preceeding); } - return *ptr_ref; + return 0; } } @@ -599,6 +589,5 @@ } clean_request(dbires_author); - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return 801; } else { @@ -621,6 +610,5 @@ } clean_request(dbires_author); - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return 801; } @@ -631,6 +619,5 @@ } clean_request(dbires_author); - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return 801; } else { @@ -653,5 +640,5 @@ author_upper = dbi_result_get_string_idx(dbires_ref, n_namefirstupper_index); - if ((new_ref = format_authorname(ptr_ref, ptr_ref_len, &ainfo, authorsep, nameorder, initialstyle, author_upper, author_preceeding, author_following, n_intext, type)) == NULL) { + if ((n_status = format_authorname(ptr_ref, ptr_ref_len, &ainfo, authorsep, nameorder, initialstyle, author_upper, author_preceeding, author_following, n_intext, type)) != 0) { clean_request(dbires_author); free(author_anonymous); @@ -659,9 +646,7 @@ free(author_following); } - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return n_status; } - *ptr_ref = new_ref; free(author_anonymous); } @@ -709,6 +694,5 @@ free(author_following); } - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return 801; } else { @@ -722,6 +706,5 @@ free(author_following); } - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return 801; } @@ -732,6 +715,5 @@ free(author_following); } - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return 801; } else { @@ -745,6 +727,5 @@ } free(item); - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return 801; } else { @@ -766,6 +747,5 @@ free(author_following); } - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return 801; } else { @@ -779,6 +759,5 @@ free(author_following); } - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return 801; } @@ -789,6 +768,5 @@ free(author_following); } - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return 801; } else { @@ -801,6 +779,5 @@ free(author_following); } - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return 801; } else { @@ -816,14 +793,13 @@ } - if ((new_ref = format_authorname(ptr_ref, ptr_ref_len, &ainfo, authorsep, nameorder, initialstyle, author_upper, author_preceeding, author_following, n_intext, type)) == NULL) { + if ((n_status = format_authorname(ptr_ref, ptr_ref_len, &ainfo, authorsep, nameorder, initialstyle, author_upper, author_preceeding, author_following, n_intext, type)) != 0) { clean_request(dbires_author); if (author_following) { free(author_following); } - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return n_status; } - *ptr_ref = new_ref; +/* *ptr_ref = new_ref; */ } /* end while have authors */ } /* end if have author_anonymous */ @@ -836,12 +812,10 @@ if (sgml_entitize(&author_following, NULL) == NULL) { free(author_following); - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return 801; } if ((new_ref = mstrcat(*ptr_ref, author_following, ptr_ref_len, 0)) == NULL) { free(author_following); - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return 801; } else { @@ -857,12 +831,10 @@ if (sgml_entitize(&item, NULL) == NULL) { free(item); - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return 801; } if ((new_ref = mstrcat(*ptr_ref, item, ptr_ref_len, 0)) == NULL) { free(item); - LOG_PRINT(LOG_WARNING, outomem.text); - return NULL; + return 801; } else { @@ -878,5 +850,5 @@ (*ptr_ref)[0] = '\0'; /* return empty string if no real content */ } - return *ptr_ref; + return 0; } ... [truncated message content] |
From: Markus H. <mho...@us...> - 2005-04-15 22:35:49
|
Update of /cvsroot/refdb/refdb/etc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28487/etc Modified Files: Tag: Release_0_9_5_stable refdbdrc Log Message: added comment to dbpath Index: refdbdrc =================================================================== RCS file: /cvsroot/refdb/refdb/etc/refdbdrc,v retrieving revision 1.10.2.1 retrieving revision 1.10.2.2 diff -u -U2 -r1.10.2.1 -r1.10.2.2 --- refdbdrc 27 Nov 2004 23:12:43 -0000 1.10.2.1 +++ refdbdrc 15 Apr 2005 22:35:22 -0000 1.10.2.2 @@ -31,5 +31,5 @@ # The directory where embedded database servers keep their files -# This variable is ignored by external database servers +# and where the database version file is created dbpath <db_path> |
From: Markus H. <mho...@us...> - 2005-04-15 22:34:44
|
Update of /cvsroot/refdb/refdb/etc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28228/etc Modified Files: Tag: Release_0_9_5_stable Makefile.am Log Message: fix db_path substitution Index: Makefile.am =================================================================== RCS file: /cvsroot/refdb/refdb/etc/Makefile.am,v retrieving revision 1.13 retrieving revision 1.13.2.1 diff -u -U2 -r1.13 -r1.13.2.1 --- Makefile.am 6 Jan 2004 20:30:53 -0000 1.13 +++ Makefile.am 15 Apr 2005 22:34:36 -0000 1.13.2.1 @@ -16,5 +16,5 @@ sed 's%<pkgdatadir>%$(pkgdatadir)%' | \ sed 's%<dbs_port>%$(dbs_port)%' | \ - sed 's%<db_path>%$(DESTDIR)$(pkgdatadir)/db%' | \ + sed 's%<db_path>%$(db_dir)%' | \ sed 's%<db_server>%$(db_server)%' > $@ |
From: Markus H. <mho...@us...> - 2005-04-15 22:33:36
|
Update of /cvsroot/refdb/refdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27404 Modified Files: Tag: Release_0_9_5_stable configure.in Log Message: made db_dir a config option Index: configure.in =================================================================== RCS file: /cvsroot/refdb/refdb/configure.in,v retrieving revision 1.49.2.12 retrieving revision 1.49.2.13 diff -u -U2 -r1.49.2.12 -r1.49.2.13 --- configure.in 29 Mar 2005 20:48:57 -0000 1.49.2.12 +++ configure.in 15 Apr 2005 22:33:20 -0000 1.49.2.13 @@ -98,7 +98,15 @@ ]) +dnl which directory will hold the databases? This does not only pertain +dnl to SQLite, as the directory also holds the version file +AC_ARG_WITH(db_dir, + [ --with-db-dir=PATH Directory for database files], + [db_dir=$withval], + [db_dir="\$(pkgdatadir)/db"], +]) + dnl maintainers may need the trang jar AC_ARG_WITH(trang_jar, - [ --with-trang-jar=PATH specify the full path to trang], + [ --with-trang-jar=PATH specify the full path to trang], [trang_cmd="java -jar "$withval], [trang_cmd="cp"]) @@ -281,4 +289,5 @@ AC_SUBST(main_db) AC_SUBST(dbs_port) +AC_SUBST(db_dir) AC_SUBST(ULLSPEC) AC_SUBST(psarg) |
From: Markus H. <mho...@us...> - 2005-04-15 22:32:29
|
Update of /cvsroot/refdb/refdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26732 Modified Files: Tag: Release_0_9_5_stable AUTHORS Log Message: added Debian packages to Davids credits Index: AUTHORS =================================================================== RCS file: /cvsroot/refdb/refdb/AUTHORS,v retrieving revision 1.4.2.2 retrieving revision 1.4.2.3 diff -u -U2 -r1.4.2.2 -r1.4.2.3 --- AUTHORS 13 Dec 2004 20:24:06 -0000 1.4.2.2 +++ AUTHORS 15 Apr 2005 22:32:19 -0000 1.4.2.3 @@ -13,5 +13,6 @@ ________________________________________________________ -Perl man (creator of the semi-automatic style generator) +Perl man and Debianator (creator of the semi-automatic + style generator, Debian packages) David Nebauer <davidnebauer at swtch.com.au> |
From: Markus H. <mho...@us...> - 2005-04-13 10:55:11
|
Update of /cvsroot/refdb/refdb/dtd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9824 Modified Files: Tag: Release_0_9_5_stable xnote.dtd Log Message: added default namespace Index: xnote.dtd =================================================================== RCS file: /cvsroot/refdb/refdb/dtd/xnote.dtd,v retrieving revision 1.3 retrieving revision 1.3.2.1 diff -u -U2 -r1.3 -r1.3.2.1 --- xnote.dtd 27 Dec 2003 22:40:38 -0000 1.3 +++ xnote.dtd 13 Apr 2005 10:54:47 -0000 1.3.2.1 @@ -8,4 +8,6 @@ <!-- the top-level element, containing one or more extended notes --> <!ELEMENT xnoteset (xnote)+> +<!ATTLIST xnoteset + xmlns CDATA #FIXED 'http://refdb.sourceforge.net/namespaces/xnote'> <!-- this element describes one extended note --> |
From: Markus H. <mho...@us...> - 2005-04-07 18:45:40
|
Update of /cvsroot/refdb/homepage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12175 Modified Files: index.html download.html Log Message: added Debian packages Index: index.html =================================================================== RCS file: /cvsroot/refdb/homepage/index.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -U2 -r1.1.1.1 -r1.2 --- index.html 13 Dec 2004 21:19:31 -0000 1.1.1.1 +++ index.html 7 Apr 2005 18:45:25 -0000 1.2 @@ -126,4 +126,8 @@ <h2>News</h2> <div class="news"> + <h3>April 6, 2005</h3> + <p>Debian packages of the latest prerelease and of the current CVS version are now available. Please see the instructions on the <a href="download.html#debian">download</a> page. See also this <a href="http://sourceforge.net/mailarchive/forum.php?thread_id=6992053&forum_id=1798">thread</a> for additional information.</p> + </div> + <div class="news"> <h3>December 13, 2004</h3> <p>Version 0.9.5 has seen many bug fixes and improvements in the bibliography support. Most notably, the driver files now support the latest DocBook and TEI stylesheets. Bibliography styles now allow to specify indenting and font sizes. The configuration of the XML toolchain is now simpler as it supports XML catalogs. <a href="status.html#news20041213" class="more">more...</a></p> Index: download.html =================================================================== RCS file: /cvsroot/refdb/homepage/download.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -U2 -r1.3 -r1.4 --- download.html 29 Mar 2005 19:44:13 -0000 1.3 +++ download.html 7 Apr 2005 18:45:25 -0000 1.4 @@ -2,5 +2,5 @@ <html xmlns="http://www.w3.org/1999/xhtml"> - <!-- $Id --> + <!-- $Id$ --> <head> @@ -124,4 +124,7 @@ </tr> <tr> + <td class="localnav"><a href="#debian">Debian packages</a></td> + </tr> + <tr> <td class="localnav"><a href="#prereleases">Prereleases</a></td> </tr> @@ -157,9 +160,30 @@ <p>There is a selection of binary releases, but they may lag behind the source release until the package maintainers find some time to update the packages. Currently there are binary releases for Windows/Cygwin, Linux (RPM), Solaris (RPM), all available at the <a href="http://www.sourceforge.net/projects/refdb/">Sourceforge RefDB project page</a>.</p> + <h2 id="debian">Debian packages</h2> + <p>A repository for RefDB deb packages is now available at <a href="http://refdb.sourceforge.net">refdb.sourceforge.net</a>. There are actually two repositories:</p> + + <h3>Release</h3> + + <p>This repository holds the latest pre-release. Add either of the following lines to <code>/etc/apt/sources.list</code> (depending on whether you run testing or unstable):</p> + <pre> +deb http://refdb.sourceforge.net/debian/release/ testing main +deb http://refdb.sourceforge.net/debian/release/ unstable main + </pre> + + <h3>CVS</h3> + + <p>This repository holds a recent CVS snapshot. Add either of the following lines to <code>/etc/apt/sources.list</code> (depending on whether you run testing or unstable):</p> + + <pre> +deb http://refdb.sourceforge.net/debian/cvs/ testing main +deb http://refdb.sourceforge.net/debian/cvs/ unstable main + </pre> + + <p>Released versions are not yet available as Debian packages.</p> + <h2 id="prereleases">Prereleases</h2> <p>If you don't want to fiddle with CVS (see the next section) but would like to help testing, consider using the latest prerelease. These archives can be installed just like regular releases, but they may not be as well-tested as these. However, you'll get bugfixes and new features that are otherwise only in the CVS version. The latest prerelease, if any, is always right <a href="pre/refdb-latest.tar.gz">here</a>. There is also a new and shiny <a href="http://www.debian.org">Debian</a> package of <a href="pre/refdb_0.9.6-pre1-1_i386.deb">refdb-0.9.6-pre1</a>. Please be aware that this package is still <em>experimental</em>.</p> <h2 id="cvseasy">CVS made easy</h2> - <p>(Thanks to David Nebauer <davidnebauer AT swtch DOT com DOT au> who contributed the scripts)</p> <p>Like many other open source projects, RefDB source code is controlled using <a href="http://www.cyclic.com/cvs/info.html">CVS</a>. There is a <a href="refdb-cvs-20050201.zip">set of scripts</a> that can checkout a RefDB source tree, build, and install it on your system. This is the most convenient way to keep a CVS version of RefDB up to date. Simply unpack the scripts into a directory in your path, e.g. <code>~/bin</code>, and alter some variables at the start of the script. Then run:</p> <pre class="source">refdb-cvs</pre> |
From: Markus H. <mho...@us...> - 2005-04-07 18:44:57
|
Update of /cvsroot/refdb/homepage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11602 Modified Files: Makefile Log Message: added files Index: Makefile =================================================================== RCS file: /cvsroot/refdb/homepage/Makefile,v retrieving revision 1.2 retrieving revision 1.3 diff -u -U2 -r1.2 -r1.3 --- Makefile 24 Dec 2004 15:31:28 -0000 1.2 +++ Makefile 7 Apr 2005 18:44:48 -0000 1.3 @@ -2,5 +2,5 @@ # These files are to be installed -objects = doc.html download.html examples.html features.html index.html status.html sysreq.html refdbn.css refdbprint.css bookback1.jpg books.jpg docbook-ay.pdf docbook-n.pdf logo.jpg tei-ay.pdf tei-n.pdf refdbinput.png refdbinput-small.png refdboutput.png refdboutput-small.png +objects = doc.html download.html examples.html features.html index.html status.html sysreq.html getref.html refdb.css refdbn.css refdbprint.css bookback1.jpg books.jpg docbook-ay.pdf docbook-n.pdf logo.jpg tei-ay.pdf tei-n.pdf refdbinput.png refdbinput-small.png refdboutput.png refdboutput-small.png install: |
From: Markus H. <mho...@us...> - 2005-03-29 20:49:12
|
Update of /cvsroot/refdb/refdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1001 Modified Files: Tag: Release_0_9_5_stable configure.in Log Message: renamed en2ris.pl marc2ris.pl med2ris.pl dos2unix tex2mail Index: configure.in =================================================================== RCS file: /cvsroot/refdb/refdb/configure.in,v retrieving revision 1.49.2.11 retrieving revision 1.49.2.12 diff -u -U2 -r1.49.2.11 -r1.49.2.12 --- configure.in 10 Feb 2005 20:18:29 -0000 1.49.2.11 +++ configure.in 29 Mar 2005 20:48:57 -0000 1.49.2.12 @@ -10,5 +10,5 @@ dnl Use automake -AM_INIT_AUTOMAKE(refdb, 0.9.6-pre1) +AM_INIT_AUTOMAKE(refdb, 0.9.6-pre2) dnl see where the libdbi lib is @@ -133,5 +133,5 @@ client_subdirs="declarations dsssl dtd styles xsl" client_bins="refdbib\$(EXEEXT) refdbc\$(EXEEXT) refdba\$(EXEEXT) refdbxp\$(EXEEXT) nmed2ris\$(EXEEXT) eenc\$(EXEEXT)" -client_scripts="refdbjade runbib tex2mail db2ris refdbxml marc2ris.pl med2ris.pl en2ris.pl refdbnd dos2unix" +client_scripts="refdbjade runbib refdb_tex2mail db2ris refdbxml marc2ris med2ris en2ris refdbnd refdb_dos2unix" client_etc_objects="bib2risrc.example bib2riscgirc.example db2risrc.example nmed2risrc.example nmed2riscgirc.example refdbarc.example refdbcrc.example refdbcgirc.example refdbibrc.example med2risrc.example med2riscgirc.example marc2risrc.example refdbxmlrc.example" client_etc_distobjects="bib2risrc bib2riscgirc db2risrc nmed2risrc nmed2riscgirc refdbarc refdbcrc refdbcgirc refdbibrc med2risrc med2riscgirc marc2risrc refdbxmlrc" @@ -139,5 +139,5 @@ client_subdirs="declarations dsssl dtd etc examples scripts src styles doc xsl" client_bins="refdbib refdbc refdba refdbxp nmed2ris eenc" -client_scripts="refdbjade runbib tex2mail db2ris refdb-bug refdbxml marc2ris.pl med2ris.pl en2ris.pl refdbnd dos2unix" +client_scripts="refdbjade runbib refdb_tex2mail db2ris refdb-bug refdbxml marc2ris med2ris en2ris refdbnd refdb_dos2unix" client_etc_objects="bib2risrc.example bib2riscgirc.example db2risrc.example nmed2risrc.example nmed2riscgirc.example refdbarc.example refdbcrc.example refdbcgirc.example refdbibrc.example med2risrc.example med2riscgirc.example marc2risrc.example refdbxmlrc.example" client_etc_distobjects="bib2risrc bib2riscgirc db2risrc nmed2risrc nmed2riscgirc refdbarc refdbcrc refdbcgirc refdbibrc med2risrc med2riscgirc marc2risrc refdbxmlrc" |
From: Markus H. <mho...@us...> - 2005-03-29 20:49:10
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1001/scripts Modified Files: Tag: Release_0_9_5_stable Makefile.am Log Message: renamed en2ris.pl marc2ris.pl med2ris.pl dos2unix tex2mail Index: Makefile.am =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/Makefile.am,v retrieving revision 1.23.2.4 retrieving revision 1.23.2.5 diff -u -U2 -r1.23.2.4 -r1.23.2.5 --- Makefile.am 29 Mar 2005 20:12:45 -0000 1.23.2.4 +++ Makefile.am 29 Mar 2005 20:49:01 -0000 1.23.2.5 @@ -1,9 +1,9 @@ ## Process this file with automake to produce Makefile.in -EXTRA_SCRIPTS = refdbjade runbib tex2mail db2ris refdb-bug refdbxml marc2ris.pl med2ris.pl en2ris.pl refdbnd dos2unix refdbctl +EXTRA_SCRIPTS = refdbjade runbib refdb_tex2mail db2ris refdb-bug refdbxml marc2ris med2ris en2ris refdbnd refdb_dos2unix refdbctl bin_SCRIPTS = @server_scripts@ @client_scripts@ -EXTRA_DIST=refdb.in refdbjade.in runbib.in tex2mail db2ris.in refdb-bug.in refdbxml.in refdb refdbctl.in empty.mysql.dump empty.pgsql.dump.in refdb-upgrade.sql marc2ris.pl.in med2ris.pl.in en2ris.pl.in refdbnd.in vargen.pl libgen.pl dos2unix.in migrate_mysql_0.9.5 refdb.dump.mysql.in refdb.dump.mysql41.in refdb.dump.pgsql.in refdb.dump.sqlite.in +EXTRA_DIST=refdb.in refdbjade.in runbib.in refdb_tex2mail db2ris.in refdb-bug.in refdbxml.in refdb refdbctl.in empty.mysql.dump empty.pgsql.dump.in refdb-upgrade.sql marc2ris.in med2ris.in en2ris.in refdbnd.in vargen.pl libgen.pl refdb_dos2unix.in migrate_mysql_0.9.5 refdb.dump.mysql.in refdb.dump.mysql41.in refdb.dump.pgsql.in refdb.dump.sqlite.in -MOSTLYCLEANFILES=refdb refdbjade runbib db2ris refdbxml refdbctl refdb-bug refdbnd marc2ris.pl med2ris.pl en2ris.pl dos2unix refdb.dump.mysql refdb.dump.mysql41 refdb.dump.pgsql refdb.dump.sqlite +MOSTLYCLEANFILES=refdb refdbjade runbib db2ris refdbxml refdbctl refdb-bug refdbnd marc2ris med2ris en2ris refdb_dos2unix refdb.dump.mysql refdb.dump.mysql41 refdb.dump.pgsql refdb.dump.sqlite sqlscripts=refdb.dump.mysql refdb.dump.pgsql refdb.dump.sqlite empty.mysql.dump empty.pgsql.dump.in refdb-upgrade.sql refdb.dump.mysql41 @@ -12,9 +12,8 @@ all: refdb refdb.dump.mysql41 refdb.dump.mysql refdb.dump.pgsql refdb.dump.sqlite +refdb: refdb.in sed 's%<prefix>%$(prefix)%' < $(srcdir)/refdb.in > refdb chmod a+x refdb -refdb: refdb.in - refdbjade: refdbjade.in sed 's%<myjade>%$(myjade)%' < $(srcdir)/refdbjade.in | \ @@ -65,21 +64,21 @@ chmod a+x refdbnd -dos2unix: dos2unix.in - sed 's%<myshell>%$(myshell)%' < $(srcdir)/dos2unix.in > dos2unix - chmod a+x dos2unix - -marc2ris.pl: marc2ris.pl.in - sed 's%<sysconfdir>%$(sysconfdir)/@PACKAGE@%' < $(srcdir)/marc2ris.pl.in | \ - sed 's%<refdblib>%$(pkgdatadir)%' > marc2ris.pl - chmod a+x marc2ris.pl - -med2ris.pl: med2ris.pl.in - sed 's%<sysconfdir>%$(sysconfdir)/@PACKAGE@%' < $(srcdir)/med2ris.pl.in | \ - sed 's%<refdblib>%$(pkgdatadir)%' > med2ris.pl - chmod a+x med2ris.pl - -en2ris.pl: en2ris.pl.in - sed 's%<sysconfdir>%$(sysconfdir)/@PACKAGE@%' < $(srcdir)/en2ris.pl.in > en2ris.pl - chmod a+x en2ris.pl +refdb_dos2unix: refdb_dos2unix.in + sed 's%<myshell>%$(myshell)%' < $(srcdir)/refdb_dos2unix.in > refdb_dos2unix + chmod a+x refdb_dos2unix + +marc2ris: marc2ris.in + sed 's%<sysconfdir>%$(sysconfdir)/@PACKAGE@%' < $(srcdir)/marc2ris.in | \ + sed 's%<refdblib>%$(pkgdatadir)%' > marc2ris + chmod a+x marc2ris + +med2ris: med2ris.in + sed 's%<sysconfdir>%$(sysconfdir)/@PACKAGE@%' < $(srcdir)/med2ris.in | \ + sed 's%<refdblib>%$(pkgdatadir)%' > med2ris + chmod a+x med2ris + +en2ris: en2ris.in + sed 's%<sysconfdir>%$(sysconfdir)/@PACKAGE@%' < $(srcdir)/en2ris.in > en2ris + chmod a+x en2ris refdb.dump.mysql: refdb.dump.mysql.in |
From: Markus H. <mho...@us...> - 2005-03-29 20:37:20
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25814 Added Files: Tag: Release_0_9_5_stable refdb_tex2mail Log Message: replaces tex2mail --- NEW FILE --- #!/usr/bin/perl # # Features: # % at the end of a line followed by \n\n is recognized as end of # paragraph :-( # # Change log is at bottom. # # Options: # linelength=75 # Cut at this line # maxdef=400 # definition loops: croak if many substitutions # debug=0 # by_par=0 # Expect each paragraph to be terminated # # by *exactly* 2 "\n", and do not print # # an extra "\n" between paragraphs # TeX # Assume it is not LaTeX # ragged # leave right ragged # noindent # assume \noindent everywhere [...2126 lines suppressed...] __END__ # History: Jul 98: \choose added, fixed RE for \noindent, \eqalign and \cr. # \proclaim and better \noindent added. # Sep 98: last was used inside an if block, was leaking out. # Jan 00: \sb \sp # Feb 00: remove extraneous second EOF needed at end. # remove an empty line at end of output # New option -by_par to support per-paragraph processing # New option -TeX which support a different \pmatrix # New option -ragged to not insert whitespace to align right margin. # New option -noindent to not insert whitespace at beginning. # Ignore \\ and \cr if followed by \end{whatever}. # Ignore \noindent if not important. # Ignore whitespace paragraphs. #Sep 01: <ma...@mh...> added -ris command line switch # to generate output compatible with the RIS spec. This allows to # use it as a post-filter for bib2ris (a BibTeX to RIS converter) # in order to remove TeX constructs and commands |
From: Markus H. <mho...@us...> - 2005-03-29 20:36:19
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25415 Removed Files: Tag: Release_0_9_5_stable tex2mail Log Message: replaced by refdb_tex2mail --- tex2mail DELETED --- |
From: Markus H. <mho...@us...> - 2005-03-29 20:35:15
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24982 Added Files: Tag: Release_0_9_5_stable refdb_dos2unix.in Log Message: replaces dos2unix.in --- NEW FILE --- #!<myshell> # dos2unix - converts files with DOS-style line endings to Unix-style # this implementation is just a semi-intelligent wrapper # for tr # Markus Hoenicka <ma...@mh...> 010930 # $Id: refdb_dos2unix.in,v 1.1.2.1 2005/03/29 20:35:06 mhoenicka Exp $ # OPTIONS: -h (invoke help) # relies on these external programs: tr ### start user-customizable section ### end user-customizable section # read the command line options while getopts ":h" opt; do case $opt in h ) echo "converts files with DOS line ending (\\r\\n) to UNIX (\\n)" echo 'usage: dos2unix [-h] file1 [file2...]' echo "Options: -h print this help and exit" exit 0 ;; \? ) echo 'usage: dos2unix [-h] file1 [file2...]' exit 1;; esac done # correct the index so the filename argument is always $1 shift $(($OPTIND - 1)) for filename in $*; do tr -d '\r' < $filename > $filename.$$ mv $filename.$$ $filename done exit 0 |
From: Markus H. <mho...@us...> - 2005-03-29 20:34:37
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24479 Removed Files: Tag: Release_0_9_5_stable dos2unix.in Log Message: replaced by refdb_dos2unix.in --- dos2unix.in DELETED --- |
From: Markus H. <mho...@us...> - 2005-03-29 20:32:26
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22876 Added Files: Tag: Release_0_9_5_stable med2ris.in Log Message: replaces med2ris.pl.in --- NEW FILE --- #!/usr/bin/perl ## med2ris.pl: converts Pubmed/Medline datasets to RIS format ## auto-detects tagged and XML data formats ## ## usage: perl med2ris.pl < infile.med > outfile.ris ## ## Dependencies: perl 5.0.0 or later ## XML::Parser ## RefDB::Pubmed ## RefDB::CGI ## RefDB::Pref ## RefDB::Log ## ## ma...@mh... 2002-12-02 ## $Id: med2ris.in,v 1.1.2.1 2005/03/29 20:32:16 mhoenicka Exp $ ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## define a lightweight class to hold the element info for XML data package Elinfo; sub new { my $class = shift; my $self = {}; ## the name of the element $self->{ELNAME} = undef; ## the character data contained in the element, if any $self->{ELVALUE} = undef; ## a list of attribute key/value pairs, if any $self->{ATTLIST} = []; bless $self, $class; return $self; } ## here the code proper starts package main; ## the interface module for expat, required to read Pubmed XML data use XML::Parser; ## the common RefDB modules use RefDB::CGI; use RefDB::Log; use RefDB::Prefs; ## the RefDB module for tagged Pubmed data use RefDB::Pubmed; ## use this module to read command line options use Getopt::Std; ## this one is for syslog (who'd have guessed) use Sys::Syslog; ## character encoding conversion use Text::Iconv; ## this is for the config file stuff my $prefs; ## whether or not we run as cgi my $is_cgi = 0; ## the html fragments for the cgi output will go here my $refdblib = "<refdblib>"; my $cgi_head; my $cgi_foot; ## read config file settings my $confdir = "<sysconfdir>"; my $read_prefs = 1; my $next; ## look for -q and -y options foreach $arg (@ARGV) { # my $next; if ($next) { $confdir = $arg; $next = 0; } elsif ($arg eq "-y") { $next = 1; } elsif ($arg eq "-q") { $read_prefs = 0; } } ## read config files if ($read_prefs) { if (RefDB::CGI::is_cgi()) { $prefs = RefDB::Prefs::->new("$confdir/med2riscgirc", undef); $is_cgi = 1; } else { my $home = $ENV{'HOME'}; $prefs = RefDB::Prefs::->new("$confdir/med2risrc", "$home/med2risrc"); } } #### variables to hold config options. Will be initialized by whatever #### was in the config files ## name of the output file, if any. If undef, send data to stdout my $outfile = $prefs->{"outfile"}; ## if f, overwrite; if t, append my $append = (defined($prefs->{"outappend"})) ? $prefs->{"outappend"} : "f"; ## type is either xml or tag my $type = $prefs->{"type"}; ## leave undef if no default type specified ## whether or not to print info about unknown/unused tags my $unmapped = (defined($prefs->{"unmapped"})) ? $prefs->{"unmapped"} : "f"; ## location of shared data ($refdblib was initialized previously) my $refdblib = (defined($prefs->{"refdblib"})) ? $prefs->{"refdblib"} : $refdblib; ## character encodings my $from_enc = (defined($prefs->{"from_enc"})) ? $prefs->{"from_enc"} : "ISO-8859-1"; my $to_enc = (defined($prefs->{"to_enc"})) ? $prefs->{"to_enc"} : "ISO-8859-1"; ## logging options my $logfile = (defined($prefs->{"logfile"})) ? $prefs->{"logfile"} : "/var/log/med2ris.log"; my $loglevel = (defined($prefs->{"loglevel"})) ? $prefs->{"loglevel"} : 6; my $logdest = (defined($prefs->{"logdest"})) ? $prefs->{"logdest"} : 2; ## 0 = stderr, 1 = syslog, 2 = file ## this hash will receive the command line options my %opts; ## the switches are: ## -e dest: log destination ## -f enc: input data character encoding ## -h: prints help ## -i: print additional info about unused/unknown tags ## -l level: log level ## -L file: log file ## -o/-O file: specifies output file for writing/appending ## -q: ignore config file ## -t enc: output data character encoding ## -T type: override automatic type detection ## -y path: set confdir getopts('e:f:hil:L:o:O:qt:T:y:', \%opts); ## loop over all command line options while (($key, $value) = each %opts) { if ($key eq "e") { $logdest = $value; } elsif ($key eq "f") { $from_enc = $value; } elsif ($key eq "h") { print "med2ris.pl converts tagged or XML Pubmed datasets into RIS datasets\n"; print "Usage: [perl] med2ris.pl [-e dest] [-f enc] [-h] [-i] [-l level] [-L logfile] [(-o|-O) outfile] [-q] [-t enc] [-T type] [-y path] {filename...}\n [perl] med2ris.pl [-h] [(-o|-O) outfile]\nThe first invocation reads Pubmed datasets from the specified input files. The second invocation accepts Pubmed datasets at stdin. Output is sent to stdout unless one of the -o/-O options is used\nOptions: -e dest log destination (stderr|syslog|file)\n -f enc set input data character encoding\n -h print this help and exit\n -i print additional tag info\n -l loglevel set log level (0-7)\n -L logfile path of custom log file\n -o outfile send output to outfile (overwrite)\n -O outfile send output to outfile (append)\n -q ignore config file\n -t enc set output data character encoding\n -T type override automatic type detection (xml|tag)\n -y path set custom config file path\n"; exit(0); } elsif ($key eq "i") { $unmapped = "t"; } elsif ($key eq "l") { $loglevel = $value; } elsif ($key eq "L") { $logfile = $value; } elsif ($key eq "o") { $outfile = $value; } elsif ($key eq "O") { $outfile = $value; $append = t; } elsif ($key eq "q") { ## do nothing, -q was used before getopts } elsif ($key eq "t") { $to_enc = $value; } elsif ($key eq "T") { $type = ($value eq "tag") ? "tag" : "xml"; } elsif ($key eq "y") { ## do nothing, -y was used before getopts } } ## post-process a few variables $logdest = RefDB::Log::num_logdest($logdest); $loglevel = RefDB::Log::num_loglevel($loglevel); if (defined($type)) { $type = ($type eq "tag") ? $type : "xml"; } ## else: leave undefined ## if we're supposed to write to an output file, try to open it if (length($outfile) > 0 && $is_cgi == 0) { ## try to open the output file if ($append eq "t") { open OUT, ">>$outfile" or die "cannot open output file for appending: $outfile\n"; } else { open OUT, ">$outfile" or die "cannot open output file for overwriting: $outfile\n"; } ## make all print commands send output to this handle select OUT; } ## set up logging my $log = RefDB::Log::->new($logdest, $loglevel, $logfile, "med2ris.pl"); ## we may have to deal with both tagged and XML data unless the type was ## specified on the command line. Load the parsers appropriately my $parser; my $pm; my $converter; if (!defined($type) || $type ne "tag") { ## initialize XML parser $parser = new XML::Parser(); $parser->setHandlers(Start => \&Start_handler, End => \&End_handler, Char => \&Char_handler, Default => \&Default_handler ); $converter = Text::Iconv->new($from_enc, $to_enc); } if (!defined($type) || $type ne "xml") { ## initialize tagged Pubmed parser $pm = new RefDB::Pubmed; $pm->set_encodings($from_enc, $to_enc); $pm->set_print_unmapped($unmapped); } ## @ARGV has the remaining arguments if the user specified input ## files. Use stdin if there's no input file argument if (@ARGV == 0) { push @ARGV, "-"; } ## we'll push/pop XML elements on/off this list as they arrive my @elstack; ## these hashes will receive the current values of pubdate, author, ## chemical, meshheading XML elements my %currpubdate; my %currauthor; my %currchemical; my %currmesh; ## this string will receive all RIS field except the TY field so the ## output can be dumped in the correct order my $alloutstring; ## this string will receive the TY field my $tystring; ## this hash helps to convert month names to numbers my %monthnames = ( "Jan" => "01", "Feb" => "02", "Mar" => "03", "Apr" => "04", "May" => "05", "Jun" => "06", "Jul" => "07", "Aug" => "08", "Sep" => "09", "Oct" => "10", "Nov" => "11", "Dec" => "12"); ## CGI and regular usage require different data handling if ($is_cgi) { ## load html templates $cgi_head = RefDB::CGI::load_html("$refdblib/templates/refdbadd_head.html"); $cgi_foot = RefDB::CGI::load_html("$refdblib/templates/refdbadd_foot.html"); ## read CGI data into a string and split into name/value pairs read (STDIN, my $input_buffer, $ENV{'CONTENT_LENGTH'}); my @namevals = split /&/, $input_buffer; ## print content type and head template print "Content-type: text/html\n\n"; print $cgi_head; ## loop over all name/value pairs foreach $item (@namevals) { ## split name and value my ($name, $value) = split /=/, $item; ## some black magic to decode the POST data string $value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; ## addref is the only data field of interest if ($name eq "addref") { if ($pm->string($value)) { ## apparently tagged data $log->log_print("debug", "converting tagged data (cgi)"); while ((my $set = $pm->next_pubmed_set())) { $set->parse_pmset(); $set->convert_pmset(); $set->dump_pmset_as_ris(); } } else { ## apparently XML data $log->log_print("debug", "converting XML data (cgi)"); $parser->parse($value); } } } ## print footer template print $cgi_foot; } else { ## not CGI ## loop over all filename arguments foreach $arg (@ARGV) { ## try to determine data type unless type was specified if (!defined($type)) { if (defined($pm->in($arg))) { ## apparently tagged data $log->log_print("debug", "converting tagged data in $arg"); while ((my $set = $pm->next_pubmed_set())) { $set->parse_pmset(); $set->convert_pmset(); $set->dump_pmset_as_ris(); } } else { ## apparently XML data $log->log_print("debug", "converting XML data in $arg"); $parser->parsefile($arg); } } elsif ($type eq "xml") { ## the parser calls our handlers whenever it encounters a start tag, ## character data, or an end tag. All data processing is done in ## these handlers $log->log_print("debug", "converting XML data in $arg"); $parser->parsefile($arg); } else { ## tagged data $log->log_print("debug", "converting tagged data in $arg"); $pm->in($arg); while ((my $set = $pm->next_pubmed_set())) { $set->parse_pmset(); $set->convert_pmset(); $set->dump_pmset_as_ris(); } } } ## end foreach } ## done processing all input $log->close(); ###################################################################### ## XML parser handlers ## ###################################################################### ##******************************************************************** ## Start_handler(): this handler is called once for each start tag and ## once for each empty element ## Arguments: pointer to "global" parser data (unused) ## element name ## list of attribute name/value pairs ## Return value is ignored ##******************************************************************** sub Start_handler { my($p, $el, @keyvals) = @_; my $numvals = @keyvals; ## create a new Elinfo object for the current element my $elinf = new Elinfo; ## fill in element name and attributes, if any $elinf->{ELNAME} = $el; @{$elinf->{KEYVALS}} = @keyvals; # push the new object on our stack push @elstack, $elinf; } ## end of Start_handler ##******************************************************************** ## End_handler(): this handler is called once for each end tag and ## once for each empty element ## Arguments: pointer to "global" parser data (unused) ## element name (unused) ## Return value is ignored ##******************************************************************** sub End_handler { my($p, $el) = @_; ## pop the current element off the stack my $currel = pop @elstack; my $elname = $currel->{ELNAME}; my $elvalue = $currel->{ELVALUE}; ## currently we ignore the attributes as they don't contain information ## relevant for the conversion to RIS #while (my $key = shift(@{$currel->{KEYVALS}})) { #my $val = shift(@{$currel->{KEYVALS}}); #} ## check available element data and append an appropriate string ## to our pool strings if ($elname eq "ISSN" && length($elvalue) > 0) { $alloutstring .= "SN - $elvalue\n"; } elsif ($elname eq "Volume" && length($elvalue) > 0) { $alloutstring .= "VL - $elvalue\n"; } elsif ($elname eq "Issue" && length($elvalue) > 0) { $alloutstring .= "IS - $elvalue\n"; } elsif ($elname eq "PubDate") { my $year = $currpubdate{"Year"}; ## the month is supplied as a three letter abbreviated name my $month = $monthnames{$currpubdate{"Month"}}; ## expand day to two digits my $day = $currpubdate{"Day"}; if (length($currpubdate{"Day"}) == 1) { $alloutstring .= "PY - $year/$month/0$day/\n"; } elsif (length($currpubdate{"Day"}) == 2) { $alloutstring .= "PY - $year/$month/$day/\n"; } else { $alloutstring .= "PY - $year/$month//\n"; } ## reset pool %currpubdate = (); } elsif ($elname eq "ArticleTitle" && length($elvalue) > 0) { $alloutstring .= "TI - $elvalue\n"; } elsif ($elname eq "MedlinePgn" && length($elvalue) > 0) { my $startpage = $elvalue; my $endpage = $elvalue; ## try to split the string into start and end page ## everything before a dash or the whole string if no dash ## is present goes into $startpage ## everything after a dash or the whole string if no dash ## is present goes into $endpage $startpage =~ s/-.*//; $endpage =~ s/.*-//; if (length($startpage) > 0) { $alloutstring .= "SP - $startpage\n"; } ## print endpage only if it differs from startpage if (length($endpage) > 0 && $startpage ne $endpage) { $alloutstring .= "EP - $endpage\n"; } } elsif ($elname eq "AbstractText" && length($elvalue) > 0) { $alloutstring .= "N2 - $elvalue\n"; } elsif ($elname eq "Affiliation" && length($elvalue) > 0) { $alloutstring .= "AD - $elvalue\n"; } elsif ($elname eq "Author") { my $firstname = $currauthor{"FirstName"}; my $forename = $currauthor{"ForeName"}; my $middlename = $currauthor{"MiddleName"}; my $lastname = $currauthor{"LastName"}; my $initials = $currauthor{"Initials"}; my $suffix = $currauthor{"Suffix"}; my $collectivename = $currauthor{"CollectiveName"}; my $rawname; if (defined ($collectivename)) { $rawname = $collectivename; } elsif (defined ($forename)) { ## append a period if the last char is an initial $forename =~ s%([A-Z])$%$1.%g; ## replace space following initial with period $forename =~ s%([A-Z]) +%$1.%g; $rawname = $lastname . "," . $forename . "," . $suffix; } elsif (length($middlename) > 0) { $rawname = $lastname . "," . $firstname . " " . $middlename . "," . $suffix; } else { $rawname = $lastname . "," . $firstname . "," . $suffix; } ## remove spaces after separators $rawname =~ s%([,.]+) *%$1%g; ## remove trailing separators after spaces $rawname =~ s% *[,;:/]*$%%; ## remove periods after a non-abbreviated name $rawname =~ s%(\w{2,})\.%$1%g; ## output the result $alloutstring .= "AU - $rawname\n"; ## reset the pool %currauthor = (); } elsif ($elname eq "PublicationType") { ## ToDo: this should be improved. We currently map everything ## to a journal article because RIS doesn't really give us ## much of a choice. The real type is encoded as a keyword $tystring = "\nTY - JOUR\n"; $alloutstring .= "KW - $elvalue\n"; } elsif ($elname eq "MedlineTA" && length($elvalue) > 0) { $alloutstring .= "JO - $elvalue\n"; } elsif ($elname eq "Chemical") { my $regnum = $currchemical{"RegistryNumber"}; my $chemname = $currchemical{"NameOfSubstance"}; if (length($regnum) > 0) { if (length($chemname) > 0) { $alloutstring .= "KW - $regnum ($chemname)\n"; } else { $alloutstring .= "KW - $regnum\n"; } } elsif (length($chemname) > 0) { $alloutstring .= "KW - $chemname\n"; } ## reset the pool %currchemical = (); } elsif ($elname eq "MeshHeading") { my $descr = $currmesh{"DescriptorName"}; my $qual = $currmesh{"QualifierName"}; ## the parser does funny things with entities like & so ## we have to fix the $qual string lest we get things like ## tyrosine [analogs][&][ derivatives] $qual =~ s/\]\[&\]\[/ &/g; ## we can safely assume that we'll never see a qualifier without ## descriptor if (length($qual) > 0) { ## now we split the qualifier string into single qualifiers my @tokens = split m%\[%, $qual; foreach $item (@tokens) { ## the first item will be whitespace, ignore $item =~ s/^\s//; if (length($item)> 0) { $alloutstring .= "KW - $descr [$item\n"; } } } elsif (length($descr) > 0) { $alloutstring .= "KW - $descr\n"; } ## reset the pool %currmesh = (); } elsif ($elname eq "PubmedArticle") { ## the article is done so dump all available information print $tystring,$alloutstring,"ER - \n"; ## reset our pool strings $alloutstring = ""; $tystring = ""; } } ## end of End_handler ##******************************************************************** ## Char_handler(): this handler is called at least once for character ## data within an element ## Arguments: pointer to "global" parser data (unused) ## character data ## Return value is ignored ##******************************************************************** sub Char_handler { my($p, $string) = @_; ## remove trailing whitespace $string =~ s/\s*$//g; ## character encoding changes here $string = $converter->convert($string); ## set the value of the current top element of the stack. As the parser ## may legally provide the character data of one element in more than ## one call to this handler we have to append the current $string to ## whatever is already there my $currel = $elstack[-1]; $currel->{ELVALUE} = $currel->{ELVALUE} . $string; my $elname = $currel->{ELNAME}; ## some RIS fields are composed of several elements. We pool the ## data here and dump them as soon as the enclosing element ends if ($elname eq "Year" || $elname eq "Month" || $elname eq "Day") { $currpubdate{$elname} = $currel->{ELVALUE}; } elsif ($elname eq "MedlineDate") { ## apparently common in older citations, contains plain text date $currpubdate{"Year"} = $currel->{ELVALUE}; ## make no attempt to extract anything but a 4-digit year $currpubdate{"Year"} =~ s/.*(\d{4,}).*/$1/; $currpubdate{"Month"} = ""; $currpubdate{"Day"} = ""; } elsif ($elname eq "FirstName" || $elname eq "ForeName" || $elname eq "MiddleName" || $elname eq "LastName" || $elname eq "Suffix" || $elname eq "CollectiveName" || $elname eq "Initials") { $currauthor{$elname} .= $currel->{ELVALUE}; } elsif ($elname eq "RegistryNumber" || $elname eq "NameOfSubstance") { $currchemical{$elname} .= $currel->{ELVALUE}; } elsif ($elname eq "DescriptorName") { $currmesh{$elname} .= $currel->{ELVALUE}; } elsif ($elname eq "QualifierName") { ## using a list for the qualifiers would be more appropriate ## but the parser returns character entities as a separate ## char chunk. We have to concatenate the stuff to a string ## and fix the charent oddities later $currmesh{$elname} = $currmesh{$elname} . "[" . $string . "]"; } } ## end of Char_handler ##******************************************************************** ## Default_handler(): this handler is called for everything else ## Arguments: pointer to "global" parser data (unused) ## string ## Return value is ignored ##******************************************************************** sub Default_handler { my($p, $string) = @_; ## these data are currently not used } ## end of Default_handler |
From: Markus H. <mho...@us...> - 2005-03-29 20:31:43
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22351 Removed Files: Tag: Release_0_9_5_stable med2ris.pl.in Log Message: replaced by med2ris.in --- med2ris.pl.in DELETED --- |
From: Markus H. <mho...@us...> - 2005-03-29 20:30:52
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21602 Added Files: Tag: Release_0_9_5_stable marc2ris.in Log Message: replaces marc2ris.pl.in --- NEW FILE --- #!/usr/bin/perl ## marc2ris.pl: converts MARC21 and UNIMARC datasets to RIS format ## See comments below for compliance with other MARC dialects ## ## usage: perl marc2ris.pl < infile.marc > outfile.ris ## ## Dependencies: perl 5.6.0 or later ## MARC::Record ## MARC::Charset ## ## ma...@mh... 2002-11-16 ## $Id: marc2ris.in,v 1.1.2.1 2005/03/29 20:30:39 mhoenicka Exp $ ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## [...1000 lines suppressed...] ##******************************************************************** ## charconv(): converts to a different charset based on a global var ## Arguments: string ## Returns: string ##******************************************************************** sub charconv { if ($utf) { ## return unaltered if already utf-8 return @_; } elsif ($uniout eq "t") { ## convert to utf-8 return $charset->to_utf8("@_"); } else { ## return unaltered if no utf-8 requested return @_; } } |
From: Markus H. <mho...@us...> - 2005-03-29 20:29:55
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21342 Removed Files: Tag: Release_0_9_5_stable marc2ris.pl.in Log Message: replaced by marc2ris.in --- marc2ris.pl.in DELETED --- |
From: Markus H. <mho...@us...> - 2005-03-29 20:23:11
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17253 Added Files: Tag: Release_0_9_5_stable en2ris.in Log Message: replaces en2ris.pl.in --- NEW FILE --- #!/usr/bin/perl ## en2ris.pl: converts EndNote "RIS" datasets to RIS format ## ## usage: perl en2ris.pl < endnote.ris > outfile.ris ## ## Dependencies: perl 5.0.0 or later ## RefDB::CGI ## RefDB::Pref ## RefDB::Log ## Text::Iconv ## ## ma...@mh... 2003-04-27 ## $Id: en2ris.in,v 1.1.2.1 2005/03/29 20:23:01 mhoenicka Exp $ ## This program is free software; you can redistribute it and/or modify ## it under the terms of the GNU General Public License as published by ## the Free Software Foundation; either version 2 of the License, or ## (at your option) any later version. ## ## This program is distributed in the hope that it will be useful, ## but WITHOUT ANY WARRANTY; without even the implied warranty of ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ## GNU General Public License for more details. ## You should have received a copy of the GNU General Public License ## along with this program; if not, write to the Free Software ## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## change character encoding on the fly use Text::Iconv; ## the common RefDB modules use RefDB::Log; use RefDB::Prefs; ## use this module to read command line options use Getopt::Std; ## this one is for syslog (who'd have guessed) use Sys::Syslog; ## this is for the config file stuff my $prefs; ## read config file settings my $confdir = "<sysconfdir>"; my $read_prefs = 1; my $next; ## look for -q and -y options foreach $arg (@ARGV) { # my $next; if ($next) { $confdir = $arg; $next = 0; } elsif ($arg eq "-y") { $next = 1; } elsif ($arg eq "-q") { $read_prefs = 0; } } ## read config files if ($read_prefs) { my $home = $ENV{'HOME'}; $prefs = RefDB::Prefs::->new("$confdir/en2risrc", "$home/en2risrc"); } #### variables to hold config options. Will be initialized by whatever #### was in the config files ## name of the output file, if any. If undef, send data to stdout my $outfile = $prefs->{"outfile"}; ## if f, overwrite; if t, append my $append = (defined($prefs->{"outappend"})) ? $prefs->{"outappend"} : "f"; ## encodings to use for input and output. empty string uses the locale my $from_enc = (defined($prefs->{"from_enc"})) ? $prefs->{"from_enc"} : "ISO-8859-1"; my $to_enc = (defined($prefs->{"to_enc"})) ? $prefs->{"to_enc"} : "ISO-8859-1"; ## logging options my $logfile = (defined($prefs->{"logfile"})) ? $prefs->{"logfile"} : "/var/log/en2ris.log"; my $loglevel = (defined($prefs->{"loglevel"})) ? $prefs->{"loglevel"} : 6; my $logdest = (defined($prefs->{"logdest"})) ? $prefs->{"logdest"} : 2; ## 0 = stderr, 1 = syslog, 2 = file ## this hash will receive the command line options my %opts; ## the switches are: ## -e dest: log destination ## -f enc: input encoding ## -h: prints help ## -l level: log level ## -L file: log file ## -o/-O file: specifies output file for writing/appending ## -q: ignore config file ## -t enc: output encoding ## -y path: set confdir getopts('e:f:hl:L:o:O:qt:y:', \%opts); ## loop over all command line options while (($key, $value) = each %opts) { if ($key eq "e") { $logdest = $value; } elsif ($key eq "f") { $from_enc = $value; } elsif ($key eq "h") { print "en2ris.pl turns EndNote \"RIS\" output into RIS\n"; print "Usage: [perl] en2ris.pl [-e dest] [-f enc] [-h] [-l level] [-L logfile] [(-o|-O) outfile] [-q] [-t enc] [-y path]\n Reads EndNote \"RIS\" data from stdin. Output is sent to stdout unless one of the -o/-O options is used\nOptions: -e dest log destination (stderr|syslog|file)\n -f enc input encoding\n -h print this help and exit\n -l loglevel set log level (0-7)\n -L logfile path of custom log file\n -o outfile send output to outfile (overwrite)\n -O outfile send output to outfile (append)\n -q ignore config file\n -t enc output encoding\n -y path set custom config file path\n"; exit(0); } elsif ($key eq "l") { $loglevel = $value; } elsif ($key eq "L") { $logfile = $value; } elsif ($key eq "o") { $outfile = $value; } elsif ($key eq "O") { $outfile = $value; $append = t; } elsif ($key eq "q") { ## do nothing, -q was used before getopts } elsif ($key eq "t") { $to_enc = $value; } elsif ($key eq "y") { ## do nothing, -y was used before getopts } } ## post-process a few variables $logdest = RefDB::Log::num_logdest($logdest); $loglevel = RefDB::Log::num_loglevel($loglevel); ## if we're supposed to write to an output file, try to open it if (length($outfile) > 0 && $is_cgi == 0) { ## try to open the output file if ($append eq "t") { open OUT, ">>$outfile" or die "cannot open output file for appending: $outfile\n"; } else { open OUT, ">$outfile" or die "cannot open output file for overwriting: $outfile\n"; } ## make all print commands send output to this handle select OUT; } ## set up logging my $log = RefDB::Log::->new($logdest, $loglevel, $logfile, "en2ris.pl"); ## here the code proper starts my $last_tag = "TY - "; my $PY = ""; my $Y2 = ""; ## initialize character encoding conversion my $converter = Text::Iconv->new($from_enc, $to_enc); ## counter for datasets my $set_count = 0; ## this hash helps to convert month names to numbers my %monthnames = ( "January" => "01", "February" => "02", "March" => "03", "April" => "04", "May" => "05", "June" => "06", "July" => "07", "August" => "08", "September" => "09", "October" => "10", "November" => "11", "December" => "12"); ## this hash helps to convert month abbreviations to numbers my %monthabbrevs = ( "Jan" => "01", "Feb" => "02", "Mar" => "03", "Apr" => "04", "May" => "05", "Jun" => "06", "Jul" => "07", "Aug" => "08", "Sep" => "09", "Oct" => "10", "Nov" => "11", "Dec" => "12"); ## read data from stdin while (<>) { # remove an odd character that EndNote exports once in a while for no # good reason s/[\035]//; if ($_ =~ /^(.. - )/) { $last_tag = $1; } elsif ($last_tag eq "KW - ") { print $last_tag . $_; $_ = ""; } if ($_ =~ /^SP - /) { $_ =~ s/^SP - (.*)-.*/SP - $1/; $log->log_print("debug", "fixed SP"); } elsif ($_ =~ /^EP - /) { if ($_ =~ /^EP - .*-.*/) { $_ =~ s/^EP - .*-(.*)/EP - $1/; } else { $_ = ""; } $log->log_print("debug", "fixed EP"); } elsif ($_ =~ /^PY - /) { chomp $_; $PY = substr($_, 6); $_ = ""; $log->log_print("debug", "found PY"); } elsif ($_ =~ /^Y2 - /) { chomp $_; $Y2 = substr($_, 6); $_ = ""; $log->log_print("debug", "found Y2"); } elsif ($_ =~ /^ER - /) { # dump pubyear string, reset variables for new round my $datestring = fix_dates($PY, $Y2); print $converter->convert("PY - $datestring\n"); $PY = ""; $Y2 = ""; $set_count++; } elsif ($_ =~ /^ID - /) { # informational message about the current dataset $log->log_print("info", substr($_, 6)); } print $converter->convert("$_"); } $log->log_print("info", "converted $set_count datasets"); ## done processing all input $log->close(); ## the end ## this function assumes that the publication year is in the PY field, ## whereas month, date, and otherinfo are in the Y2 field. Two formats ## of the Y2 field are recognized: /month/day/otherinfo, where month ## may either be numeric or a month name/abbrev; or a date like "March 10" sub fix_dates { my ($PY, $Y2) = @_; my $month; my $day; my $otherinfo; # strip leading slashes $Y2 =~ s!^\/*!!; # see whether we have a monthname while ( ($key, $value) = each %monthnames) { if ($Y2 =~ s!^$key/!!) { $month = $value; $otherinfo = $Y2; last; } } # see whether we have a monthabbrev if (!length($month)) { while ( ($key, $value) = each %monthabbrevs) { if ($Y2 =~ s!^$key/!!) { $month = $value; $otherinfo = $Y2; last; } } } # if we still don't have a month, use string as numeric if (!length($month)) { $month = $Y2; $month =~ s!^([^/]*)/.*!$1!; if ($month =~ s/^(\d{1,2}).*/$1/) { if (length($month) == 1) { $month = "0" . $month; } $Y2 =~ s!^[^/]*/(.*)!$1!; } else { $month = undef; } $otherinfo = $Y2; } # separate day and otherinfo, if any if (length($otherinfo)) { $otherinfo =~ s!^[\s/]*!!; $day = $otherinfo; # use first one or two digits as day if ($day =~ s/^(\d{1,2}).*/$1/) { $otherinfo =~ s/^\d{1,2}\s*(.*)/$1/; # day requires exactly two digits if (length($day) == 1) { $day = "0" . $day; } } else { $day = undef; } } if (length($otherinfo)) { $otherinfo =~ s!^[\s/]*!!; if (!defined($month)) { # last attempt to find month and date; assume no slashes while ( ($key, $value) = each %monthnames) { if ($otherinfo =~ s!^$key!!) { $month = $value; last; } } # see whether we have a monthabbrev if (!length($month)) { while ( ($key, $value) = each %monthabbrevs) { if ($otherinfo =~ s!^$key!!) { $month = $value; last; } } } # maybe there's also a day if (length($otherinfo)) { $otherinfo =~ s!^[\s]*!!; $day = $otherinfo; # use first one or two digits as day if ($day =~ s/^(\d{1,2}).*/$1/) { $otherinfo =~ s/^\d{1,2}\s*(.*)/$1/; # day requires exactly two digits if (length($day) == 1) { $day = "0" . $day; } } else { $day = undef; } } } } if (!length($PY)) { $log->log_print("warning", "found no PY"); $PY = "0000"; } # assemble return string return $PY . "/" . $month . "/" . $day . "/" . $otherinfo; } |
From: Markus H. <mho...@us...> - 2005-03-29 20:22:31
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17070 Removed Files: Tag: Release_0_9_5_stable en2ris.pl.in Log Message: replaced by en2ris.in --- en2ris.pl.in DELETED --- |
From: Markus H. <mho...@us...> - 2005-03-29 20:15:33
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14343 Modified Files: Tag: Release_0_9_5_stable refdb.in Log Message: added restart and force-reload commands Index: refdb.in =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/Attic/refdb.in,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -U2 -r1.1.2.1 -r1.1.2.2 --- refdb.in 29 Mar 2005 20:12:06 -0000 1.1.2.1 +++ refdb.in 29 Mar 2005 20:15:24 -0000 1.1.2.2 @@ -71,4 +71,18 @@ $REFDBCTL stop fi;; + restart) + if [ $BSDSTYLE = "YES" ]; then + $REFDBCTL restart > /dev/null && echo -n ' refdb' + else + echo -ne "Restarting bibliography tool application server: $NAME.\n" + $REFDBCTL restart + fi;; + force-reload) + if [ $BSDSTYLE = "YES" ]; then + $REFDBCTL reload > /dev/null && echo -n ' refdb' + else + echo -ne "Reloading bibliography tool application server: $NAME.\n" + $REFDBCTL reload + fi;; *) echo "Usage: $(basename $0) {start|stop}" >&2 |
From: Markus H. <mho...@us...> - 2005-03-29 20:12:54
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12719 Modified Files: Tag: Release_0_9_5_stable Makefile.am Log Message: replaced refdb by refdb.in Index: Makefile.am =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/Makefile.am,v retrieving revision 1.23.2.3 retrieving revision 1.23.2.4 diff -u -U2 -r1.23.2.3 -r1.23.2.4 --- Makefile.am 10 Feb 2005 20:27:19 -0000 1.23.2.3 +++ Makefile.am 29 Mar 2005 20:12:45 -0000 1.23.2.4 @@ -3,7 +3,7 @@ bin_SCRIPTS = @server_scripts@ @client_scripts@ -EXTRA_DIST=refdbjade.in runbib.in tex2mail db2ris.in refdb-bug.in refdbxml.in refdb refdbctl.in empty.mysql.dump empty.pgsql.dump.in refdb-upgrade.sql marc2ris.pl.in med2ris.pl.in en2ris.pl.in refdbnd.in vargen.pl libgen.pl dos2unix.in migrate_mysql_0.9.5 refdb.dump.mysql.in refdb.dump.mysql41.in refdb.dump.pgsql.in refdb.dump.sqlite.in +EXTRA_DIST=refdb.in refdbjade.in runbib.in tex2mail db2ris.in refdb-bug.in refdbxml.in refdb refdbctl.in empty.mysql.dump empty.pgsql.dump.in refdb-upgrade.sql marc2ris.pl.in med2ris.pl.in en2ris.pl.in refdbnd.in vargen.pl libgen.pl dos2unix.in migrate_mysql_0.9.5 refdb.dump.mysql.in refdb.dump.mysql41.in refdb.dump.pgsql.in refdb.dump.sqlite.in -MOSTLYCLEANFILES=refdbjade runbib db2ris refdbxml refdbctl refdb-bug refdbnd marc2ris.pl med2ris.pl en2ris.pl dos2unix refdb.dump.mysql refdb.dump.mysql41 refdb.dump.pgsql refdb.dump.sqlite +MOSTLYCLEANFILES=refdb refdbjade runbib db2ris refdbxml refdbctl refdb-bug refdbnd marc2ris.pl med2ris.pl en2ris.pl dos2unix refdb.dump.mysql refdb.dump.mysql41 refdb.dump.pgsql refdb.dump.sqlite sqlscripts=refdb.dump.mysql refdb.dump.pgsql refdb.dump.sqlite empty.mysql.dump empty.pgsql.dump.in refdb-upgrade.sql refdb.dump.mysql41 @@ -11,5 +11,9 @@ utctimestamp=$(shell date -u "+%Y-%m-%d %H:%M:%S") -all: refdb.dump.mysql41 refdb.dump.mysql refdb.dump.pgsql refdb.dump.sqlite +all: refdb refdb.dump.mysql41 refdb.dump.mysql refdb.dump.pgsql refdb.dump.sqlite + sed 's%<prefix>%$(prefix)%' < $(srcdir)/refdb.in > refdb + chmod a+x refdb + +refdb: refdb.in refdbjade: refdbjade.in |
From: Markus H. <mho...@us...> - 2005-03-29 20:12:25
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12300 Added Files: Tag: Release_0_9_5_stable refdb.in Log Message: replaces refdb --- NEW FILE --- #!/bin/sh # # refdb: Start the refdb bibliography tool application server # (for use as init.d or rc.d script) # # ma...@mh... 2001-7-22 # $Id: refdb.in,v 1.1.2.1 2005/03/29 20:12:06 mhoenicka Exp $ # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # ***********IMPORTANT************* # This file is configured for SysV-style systems (most Linux distributions and # a few commercial Unices). If you want to use the script on a BSD-style # system (Slackware, {Free|Net|Open}BSD and a few commercial Unices), these # two changes are necessary: # 1. Set the value of BSDSTYLE to "YES" a few lines below # 2. Rename the file to refdb.sh # ********************************* # the name of the application NAME=refdb # set some default path PATH=/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin # the full path to the binary that is to be started as a daemon DAEMON=<prefix>/bin/refdbd # the full path to the script that actually starts and stops the application REFDBCTL=<prefix>/bin/refdbctl # set to 'YES' if the OS uses a BSD-style daemon startup system (this is # true for BSD-UNIX and Unices derived thereof, as well as for the # Slackware Linux distribution). This setting does not perform any black # magic, but it makes the screen messages at startup match the OS style BSDSTYLE=NO # don't get interrupted trap "" 1 # see whether all ingredients are available test -f $DAEMON || exit 1 test -f $REFDBCTL || exit 1 # now run the specified command case "$1" in start) if [ $BSDSTYLE = "YES" ]; then $REFDBCTL start > /dev/null && echo -n ' refdb' else echo -ne "Starting bibliography tool application server: $NAME.\n" $REFDBCTL start fi;; stop) if [ $BSDSTYLE = "YES" ]; then $REFDBCTL stop > /dev/null && echo -n ' refdb' else echo -ne "Stopping bibliography tool application server: $NAME.\n" $REFDBCTL stop fi;; *) echo "Usage: $(basename $0) {start|stop}" >&2 exit 1;; esac exit 0 |
From: Markus H. <mho...@us...> - 2005-03-29 20:11:41
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11954 Removed Files: Tag: Release_0_9_5_stable refdb Log Message: replaced by refdb.in --- refdb DELETED --- |