refdb-cvs Mailing List for RefDB (Page 67)
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...> - 2004-05-07 21:28:00
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5552 Modified Files: Tag: Release_0_9_5_stable risxhandler.c Log Message: fixed custabbrev vs. user typo;check for invalid title type attribute Index: risxhandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/risxhandler.c,v retrieving revision 1.28 retrieving revision 1.28.2.1 diff -u -U2 -r1.28 -r1.28.2.1 --- risxhandler.c 16 Feb 2004 21:38:06 -0000 1.28 +++ risxhandler.c 7 May 2004 21:27:51 -0000 1.28.2.1 @@ -742,5 +742,5 @@ } } - else if (title_type && !strcmp(title_type, "custabbrev1")) { + else if (title_type && !strcmp(title_type, "user1")) { if (((ptr_ardata->perinfo).custabbrev1 = strdup((ptr_ardata->ptr_first)->ptr_elvalue)) == NULL || dbi_driver_quote_string(ptr_ardata->driver, &((ptr_ardata->perinfo).custabbrev1)) == -1) { if ((new_msgpool = mstrcat(ptr_ardata->msgpool, outomem_n.text, &(ptr_ardata->msgpool_len), 0)) == NULL) { @@ -755,5 +755,5 @@ } } - else if (title_type && !strcmp(title_type, "custabbrev2")) { + else if (title_type && !strcmp(title_type, "user2")) { if (((ptr_ardata->perinfo).custabbrev2 = strdup((ptr_ardata->ptr_first)->ptr_elvalue)) == NULL || dbi_driver_quote_string(ptr_ardata->driver, &((ptr_ardata->perinfo).custabbrev2)) == -1) { if ((new_msgpool = mstrcat(ptr_ardata->msgpool, outomem_n.text, &(ptr_ardata->msgpool_len), 0)) == NULL) { @@ -768,5 +768,5 @@ } } - else { + else if (!title_type || !*title_type || !strcmp(title_type, "gen")){ if (!strcmp(ptr_ardata->type, "CHAP") || !strcmp(ptr_ardata->type, "CASE") @@ -778,4 +778,11 @@ } } + else { + /* this means we've received invalid risx data */ + if ((new_msgpool = mstrcat(ptr_ardata->msgpool, "invalid title attribute", &(ptr_ardata->msgpool_len), 0)) == NULL) { + (ptr_ardata->ndb_error)++; + return; + } + } } else { /* set */ |
From: Markus H. <mho...@us...> - 2004-05-06 21:59:25
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4047 Modified Files: Tag: Release_0_9_5_stable strfncs.c Log Message: sgml_entitize(): improved entity detection Index: strfncs.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/strfncs.c,v retrieving revision 1.15 retrieving revision 1.15.2.1 diff -u -U2 -r1.15 -r1.15.2.1 --- strfncs.c 29 Apr 2004 00:08:08 -0000 1.15 +++ strfncs.c 6 May 2004 21:59:15 -0000 1.15.2.1 @@ -752,6 +752,17 @@ while (token != NULL) { + char* next_amp; + char* next_sc; + char* next_sp; + +/* printf("token went to:%s<<\n", token); */ /* replace ampersand only if it does not start an entity */ - if (the_ents[i].character != '&' || strchr(token, (int)';') == NULL) { + /* get pointers to the next ampersand and semicolon, if any, + and see which one is closer */ + next_amp = strchr(token+1, (int)'&'); + next_sc = strchr(token+1, (int)';'); + next_sp = strchr(token+1, (int)' '); + + if (the_ents[i].character != '&' || compare_ptr(&next_sc, &next_amp) != -1 || compare_ptr(&next_sp, &next_sc) != 1) { replace_char_string(token, the_ents[i].entity); } |
From: Markus H. <mho...@us...> - 2004-05-05 19:42:15
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31753 Modified Files: Tag: Release_0_9_5_stable risdb.c Log Message: use two variables for primary and secondary year; ignore empty tag lines Index: risdb.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/risdb.c,v retrieving revision 1.44 retrieving revision 1.44.2.1 diff -u -U2 -r1.44 -r1.44.2.1 --- risdb.c 29 Apr 2004 22:41:57 -0000 1.44 +++ risdb.c 5 May 2004 19:42:07 -0000 1.44.2.1 @@ -266,5 +266,6 @@ int error = 0; int nis_dummy = 0; /* will be 1 if dataset is a dummy */ - short int year; /* the year */ + short int year = 0; /* the year */ + short int year2 = 0; /* the secondary year */ dbi_driver driver; dbi_result dbires; @@ -605,4 +606,10 @@ token[token_len] = '\0'; + /* ignore empty tag lines */ + if (!token[6]) { + token = ris_strtok(token + token_len + 1, &token_len, "\n"); + continue; + } + /* ------------------------------------------------------------ */ if (strncmp("RP - ", token, 6) == 0) { @@ -798,16 +805,22 @@ /* ------------------------------------------------------------ */ else if (strncmp("PY - ", token, 6) == 0 || strncmp("Y1 - ", token, 6) == 0 || strncmp("Y2 - ", token, 6) == 0) { + /* use separate year variables for primary and secondary year */ if (strncmp("Y2 - ", token, 6) != 0) { have_py++; year_type = 0; + + /* publication year */ + year = risdate(otherinfo_buffer, &token[6]); + + result = set_risdata_dateinfo(ptr_risdata, year_type, year, otherinfo_buffer, driver); } else { year_type = 1; - } - /* publication year */ - year = risdate(otherinfo_buffer, &token[6]); + /* publication year */ + year2 = risdate(otherinfo_buffer, &token[6]); - result = set_risdata_dateinfo(ptr_risdata, year_type, year, otherinfo_buffer, driver); + result = set_risdata_dateinfo(ptr_risdata, year_type, year2, otherinfo_buffer, driver); + } if (result == 1) { |
From: Markus H. <mho...@us...> - 2004-05-05 19:36:12
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30481 Modified Files: Tag: Release_0_9_5_stable refdbdbib.c Log Message: quote author_abbrevlist properly Index: refdbdbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdbib.c,v retrieving revision 1.36 retrieving revision 1.36.2.1 diff -u -U2 -r1.36 -r1.36.2.1 --- refdbdbib.c 15 Feb 2004 23:00:02 -0000 1.36 +++ refdbdbib.c 5 May 2004 19:36:03 -0000 1.36.2.1 @@ -1378,7 +1378,19 @@ while (dbi_result_next_row(dbires1)) { - item = my_dbi_result_get_string(dbires1, "author_abbrevlist"); + item = my_dbi_result_get_string_copy(dbires1, "author_abbrevlist"); n_pubyear = dbi_result_get_ushort(dbires1, "pubyear"); + /* quote item */ + if (dbi_driver_quote_string(dbi_conn_get_driver(ptr_bibconns->conn), (char**)&item) == -1) { + tiwrite(ptr_clrequest->fd, "", TERM_YES); + if (!assemble_return_msg(ptr_addresult, noformatupdatecolon.text, ptr_bibconns->conn)) { + LOG_PRINT(LOG_WARNING, ptr_addresult->msg); + } + free(sql_command); + free((char*)item); + return 1; + } + + /* increase buffer size if necessary */ if (strlen(item)+256 > sql_command_len) { @@ -1392,4 +1404,5 @@ dbi_result_free(dbires1); free(sql_command); + free((char*)item); return 1; } @@ -1399,6 +1412,9 @@ } - sprintf(sql_command, "SELECT DISTINCT entry_id,sorted_pos from %s WHERE author_abbrevlist='%s' AND pubyear=%d ORDER BY sorted_pos", table_name, item, n_pubyear); + sprintf(sql_command, "SELECT DISTINCT entry_id,sorted_pos from %s WHERE author_abbrevlist=%s AND pubyear=%d ORDER BY sorted_pos", table_name, item, n_pubyear); LOG_PRINT(LOG_DEBUG, sql_command); + + free((char*)item); + dbires2 = dbi_conn_query(ptr_bibconns->conn, sql_command); if (!dbires2) { |
From: Markus H. <mho...@us...> - 2004-05-05 19:33:29
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29895 Modified Files: Tag: Release_0_9_5_stable backend-dbiba.c Log Message: removed excess sgml_entitize() call Index: backend-dbiba.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-dbiba.c,v retrieving revision 1.26 retrieving revision 1.26.2.1 diff -u -U2 -r1.26 -r1.26.2.1 --- backend-dbiba.c 29 Apr 2004 00:09:27 -0000 1.26 +++ backend-dbiba.c 5 May 2004 19:33:20 -0000 1.26.2.1 @@ -2019,10 +2019,4 @@ } - if (sgml_entitize(&item_simple, NULL) == NULL) { - LOG_PRINT(LOG_WARNING, outomem.text); - free(item_simple); - return NULL; - } - if ((new_ref = mstrcat(*ptr_ref, item_simple, ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); |
From: Markus H. <mho...@us...> - 2004-05-02 00:25:34
|
Update of /cvsroot/refdb/refdb/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1809 Added Files: tex2mail.README Log Message: initial version --- NEW FILE --- tex2mail is a perl script to convert TeX files into plain text files: various mathematical symbols (sums, products, integrals, sub/superscripts, fractions, square roots,...) are replaced by "ascii art" that spreads over multiple lines if necessary. The result attemps to approach WYSIWYG and is more readable to human beings than the flat-style TeX code. Installation: Adapt the source code to your local needs by change of the first line of the tex2mail file for the correct full path name of your perl executable. Invocation: tex2mail [-linelength <bytesperline> ] [-debug <level> ] [-by_par] [-TeX] [-ragged] [-noindent] < foo.tex > foo.txt author: Ilya Zakahrevich <il...@ma...> http://www.math.ohio-state.edu/people/display/display.php?ID=376 source: ftp://ftp.math.ohio-state.edu/pub/users/ilya/tex/tex2mail |
From: Markus H. <mho...@us...> - 2004-05-02 00:09:51
|
Update of /cvsroot/refdb/refdb/xsl/refdb/docbk-refdb-xsl/docbk-xhtml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31150/xsl/refdb/docbk-refdb-xsl/docbk-xhtml Modified Files: docbk-refdb-xhtml.xsl.in Log Message: fixed output escaping thing again Index: docbk-refdb-xhtml.xsl.in =================================================================== RCS file: /cvsroot/refdb/refdb/xsl/refdb/docbk-refdb-xsl/docbk-xhtml/docbk-refdb-xhtml.xsl.in,v retrieving revision 1.7 retrieving revision 1.8 diff -u -U2 -r1.7 -r1.8 --- docbk-refdb-xhtml.xsl.in 28 Apr 2004 03:06:05 -0000 1.7 +++ docbk-refdb-xhtml.xsl.in 2 May 2004 00:09:43 -0000 1.8 @@ -472,5 +472,5 @@ <xsl:text disable-output-escaping="yes"><sup></xsl:text> </xsl:if> - <xsl:value-of select="$string" disable-output-escaping="yes"/> + <xsl:value-of select="$string"/> <xsl:if test="$style='SUPER'"> <xsl:text disable-output-escaping="yes"></sup></xsl:text> |
From: Markus H. <mho...@us...> - 2004-05-02 00:09:51
|
Update of /cvsroot/refdb/refdb/xsl/refdb/docbk-refdb-xsl/docbk-html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31150/xsl/refdb/docbk-refdb-xsl/docbk-html Modified Files: docbk-refdb-html.xsl.in Log Message: fixed output escaping thing again Index: docbk-refdb-html.xsl.in =================================================================== RCS file: /cvsroot/refdb/refdb/xsl/refdb/docbk-refdb-xsl/docbk-html/docbk-refdb-html.xsl.in,v retrieving revision 1.10 retrieving revision 1.11 diff -u -U2 -r1.10 -r1.11 --- docbk-refdb-html.xsl.in 28 Apr 2004 03:06:04 -0000 1.10 +++ docbk-refdb-html.xsl.in 2 May 2004 00:09:43 -0000 1.11 @@ -461,5 +461,5 @@ <xsl:text disable-output-escaping="yes"><sup></xsl:text> </xsl:if> - <xsl:value-of select="$string" disable-output-escaping="yes"/> + <xsl:value-of select="$string"/> <xsl:if test="$style='SUPER'"> <xsl:text disable-output-escaping="yes"></sup></xsl:text> |
From: Markus H. <mho...@us...> - 2004-05-01 23:41:58
|
Update of /cvsroot/refdb/refdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26329 Modified Files: configure.in Log Message: bumped up version number Index: configure.in =================================================================== RCS file: /cvsroot/refdb/refdb/configure.in,v retrieving revision 1.48 retrieving revision 1.49 diff -u -U2 -r1.48 -r1.49 --- configure.in 5 Mar 2004 00:08:54 -0000 1.48 +++ configure.in 1 May 2004 23:41:31 -0000 1.49 @@ -6,5 +6,5 @@ dnl Use automake -AM_INIT_AUTOMAKE(refdb, 0.9.4) +AM_INIT_AUTOMAKE(refdb, 0.9.5-pre1) dnl Find out host type |
From: Markus H. <mho...@us...> - 2004-05-01 23:40:36
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25859 Modified Files: backend.c backend.h backend-html.c backend-ris.c backend-risx.c backend-scrn.c Log Message: get_refdb_url() is now get_refdb_url_copy() Index: backend.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -U2 -r1.26 -r1.27 --- backend.c 16 Mar 2004 21:01:48 -0000 1.26 +++ backend.c 1 May 2004 23:40:13 -0000 1.27 @@ -1028,8 +1028,9 @@ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - get_refdb_url(): retrieves the refdb_url element from a query result + get_refdb_url_copy(): retrieves the refdb_url element from a query result - char* get_refdb_url returns a pointer to a string containing the - refdb_url element + char* get_refdb_url_copy returns a pointer to a string containing the + refdb_url element. The string is allocated and + must be freed by the caller dbi_result dbires database query result, pointing to the current @@ -1037,14 +1038,6 @@ ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -const char* get_refdb_url(dbi_result dbires) { - const char* result; - - result = dbi_result_get_string(dbires, "refdb_url"); - if (dbi_conn_error_flag(dbi_result_get_conn(dbires))) { - return NULL; - } - else { - return result; - } +char* get_refdb_url_copy(dbi_result dbires) { + return my_dbi_result_get_string_copy(dbires, "refdb_url"); } Index: backend.h =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend.h,v retrieving revision 1.22 retrieving revision 1.23 diff -u -U2 -r1.22 -r1.23 --- backend.h 4 Jan 2004 01:56:42 -0000 1.22 +++ backend.h 1 May 2004 23:40:13 -0000 1.23 @@ -118,5 +118,5 @@ char* get_refdb_title_series_copy(dbi_result dbires); char* get_refdb_address_copy(dbi_result dbires); -const char* get_refdb_url(dbi_result dbires); +char* get_refdb_url_copy(dbi_result dbires); const char* get_refdb_issn(dbi_result dbires); const char* get_refdb_pyother_info(dbi_result dbires); Index: backend-html.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-html.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -U2 -r1.26 -r1.27 --- backend-html.c 29 Apr 2004 22:39:48 -0000 1.26 +++ backend-html.c 1 May 2004 23:40:13 -0000 1.27 @@ -1364,5 +1364,5 @@ if (strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "UR") != NULL || strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "ALL") != NULL) { - item = get_refdb_url(ptr_rendinfo->dbires); + item = get_refdb_url_copy(ptr_rendinfo->dbires); if (item != NULL) { if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "<p class='ur'><a href=\"", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { @@ -1374,11 +1374,12 @@ } - if ((entitize_buf = strdup(item)) == NULL - || sgml_entitize(&entitize_buf, NULL) == NULL) { + if (sgml_entitize((char**)&item, NULL) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); + free((char*)item); return NULL; } - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), entitize_buf, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { + free((char*)item); LOG_PRINT(LOG_WARNING, outomem.text); return NULL; @@ -1390,5 +1391,5 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "\">", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); - free(entitize_buf); + free((char*)item); return NULL; } @@ -1397,7 +1398,7 @@ } - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), entitize_buf, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); - free(entitize_buf); + free((char*)item); return NULL; } @@ -1406,5 +1407,5 @@ } - free(entitize_buf); + free((char*)item); if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "</a></p>\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { @@ -1475,5 +1476,5 @@ } clean_request(dbires); - free_request_notes_by_ref(dbi_result_get_conn(ptr_rendinfo->dbires)); + free_request_notes_by_ref(dbi_result_get_conn(orig_dbires)); ptr_rendinfo->dbires = orig_dbires; } Index: backend-ris.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-ris.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -U2 -r1.13 -r1.14 --- backend-ris.c 16 Mar 2004 22:37:08 -0000 1.13 +++ backend-ris.c 1 May 2004 23:40:14 -0000 1.14 @@ -460,8 +460,10 @@ /*----------------------------------------------------------------*/ /* URL */ - if ((item = get_refdb_url(ptr_rendinfo->dbires)) != NULL) { + if ((item = get_refdb_url_copy(ptr_rendinfo->dbires)) != NULL) { if (print_field_ris(item, ptr_rendinfo, "\nUR - ") == NULL) { + free((char*)item); return NULL; } + free((char*)item); } Index: backend-risx.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-risx.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -U2 -r1.29 -r1.30 --- backend-risx.c 16 Mar 2004 22:38:58 -0000 1.29 +++ backend-risx.c 1 May 2004 23:40:14 -0000 1.30 @@ -844,10 +844,12 @@ /*----------------------------------------------------------------*/ /* URL */ - if ((item = get_refdb_url(ptr_rendinfo->dbires)) != NULL) { + if ((item = get_refdb_url_copy(ptr_rendinfo->dbires)) != NULL) { nhave_data = 1; if (print_element_x(item, &buffer1, &buffer1_len, "url", NULL, NULL, ptr_indent) == NULL) { + free((char*)item); free(buffer1); return NULL; } + free((char*)item); } Index: backend-scrn.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-scrn.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -U2 -r1.16 -r1.17 --- backend-scrn.c 19 Jan 2004 23:13:01 -0000 1.16 +++ backend-scrn.c 1 May 2004 23:40:14 -0000 1.17 @@ -578,10 +578,11 @@ || strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "AB") != NULL || strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "ALL") != NULL) { - item = get_refdb_abstract_copy(ptr_rendinfo->dbires); - if (print_field_scrn(item, ptr_rendinfo, "\nABSTRACT: ") == NULL) { + if ((item = get_refdb_abstract_copy(ptr_rendinfo->dbires)) != NULL) { + if (print_field_scrn(item, ptr_rendinfo, "\nABSTRACT: ") == NULL) { + free(item); + return NULL; + } free(item); - return NULL; } - free(item); } @@ -590,10 +591,11 @@ if (strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "AD") != NULL || strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "ALL") != NULL) { - item = get_refdb_address_copy(ptr_rendinfo->dbires); - if (print_field_scrn(item, ptr_rendinfo, "\nADDRESS: ") == NULL) { + if ((item = get_refdb_address_copy(ptr_rendinfo->dbires)) != NULL) { + if (print_field_scrn(item, ptr_rendinfo, "\nADDRESS: ") == NULL) { + free(item); + return NULL; + } free(item); - return NULL; } - free(item); } @@ -700,7 +702,10 @@ if (strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "UR") != NULL || strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "ALL") != NULL) { - citem = get_refdb_url(ptr_rendinfo->dbires); - if (print_field_scrn(citem, ptr_rendinfo, "\nURL: ") == NULL) { - return NULL; + if ((item = get_refdb_url_copy(ptr_rendinfo->dbires)) != NULL) { + if (print_field_scrn(item, ptr_rendinfo, "\nURL: ") == NULL) { + free(item); + return NULL; + } + free(item); } } @@ -801,10 +806,11 @@ if (strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "N1") != NULL || strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "ALL") != NULL) { - item = get_notes_copy(ptr_rendinfo->dbires, ptr_rendinfo->username); - if (print_field_scrn(item, ptr_rendinfo, "\nNOTES: ") == NULL) { + if ((item = get_notes_copy(ptr_rendinfo->dbires, ptr_rendinfo->username)) != NULL) { + if (print_field_scrn(item, ptr_rendinfo, "\nNOTES: ") == NULL) { + free(item); + return NULL; + } free(item); - return NULL; } - free(item); } |
From: Markus H. <mho...@us...> - 2004-05-01 14:56:11
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23985 Modified Files: refdba.c Log Message: addstyle(): complete dialog with server even if no input file could be opened Index: refdba.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdba.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -U2 -r1.44 -r1.45 --- refdba.c 11 Feb 2004 23:47:23 -0000 1.44 +++ refdba.c 1 May 2004 14:56:03 -0000 1.45 @@ -1581,4 +1581,5 @@ int n_chunk_count = 0; int n_xml_result; + int n_have_dataset = 0; size_t byte_written = 0; FILE *pagerfp; @@ -1817,9 +1818,10 @@ return 1; } - /* start test */ + /* ------------------------------------------------------------ */ /* PHASE 5 */ /* signal server that this file is done */ sprintf(thebytes, "%d", 0); + n_have_dataset++; numbyte = tiwrite(n_sockfd, thebytes, TERM_YES); /* printf("%s\n", thebytes); */ @@ -1865,5 +1867,55 @@ return 1; } - /* end test */ + } /* end for */ + + /* we must run this code if none of the files could be opened */ + if (!n_have_dataset) { + char thebytes[20]; + + sprintf(thebytes, "%d", 0); + numbyte = tiwrite(n_sockfd, thebytes, TERM_YES); + /* printf("%s\n", thebytes); */ + if (numbyte == -1) { + fprintf(stderr, "could not write to refdbd. Stop\n"); + if (n_file_open || n_file_append) { + close_outfile(pagerfp); + } + else { + closepager(pagerfp); + } + delete_all_lilimem(&sentinel); + close(n_sockfd); + n_broken_pipe = 0; + return 1; + } + + numbyte = tread(n_sockfd, inbuffer, COMMAND_INBUF_LEN); + /* printf("phase5 server reply:%s<<\n", inbuffer); */ + if (numbyte == -1) { + fprintf(stderr, "could not read from refdbd. Stop\n"); + if (n_file_open || n_file_append) { + close_outfile(pagerfp); + } + else { + closepager(pagerfp); + } + delete_all_lilimem(&sentinel); + close(n_sockfd); + n_broken_pipe = 0; + return 1; + } + if (strncmp(inbuffer, "POS", 3) != 0) { + fprintf(stderr, "server error: %s\n", inbuffer); + if (n_file_open || n_file_append) { + close_outfile(pagerfp); + } + else { + closepager(pagerfp); + } + delete_all_lilimem(&sentinel); + close(n_sockfd); + n_broken_pipe = 0; + return 1; + } } |
From: Markus H. <mho...@us...> - 2004-04-29 22:42:06
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13138 Modified Files: risdb.c Log Message: strip_oddchars(): do not allow xml reserved chars and colon in citation key Index: risdb.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/risdb.c,v retrieving revision 1.43 retrieving revision 1.44 diff -u -U2 -r1.43 -r1.44 --- risdb.c 16 Feb 2004 21:38:05 -0000 1.43 +++ risdb.c 29 Apr 2004 22:41:57 -0000 1.44 @@ -3178,4 +3178,8 @@ else if ((*thechar == '\'') || (*thechar == '\"') || + (*thechar == '&') || + (*thechar == '<') || + (*thechar == '>') || + (*thechar == ':') || (*thechar == ' ')) { /* remove offending character */ |
From: Markus H. <mho...@us...> - 2004-04-29 22:39:58
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12693 Modified Files: backend-html.c backendn-html.c Log Message: replace reserved characters by entities Index: backend-html.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-html.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -U2 -r1.25 -r1.26 --- backend-html.c 16 Mar 2004 21:03:27 -0000 1.25 +++ backend-html.c 29 Apr 2004 22:39:48 -0000 1.26 @@ -174,4 +174,5 @@ const char* type; char* avail; + char *entitize_buf; char date_buffer[256]; char href_buffer[20]; @@ -321,6 +322,14 @@ while ((item = get_author(dbires)) != NULL) { have_author = 1; - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { + + if ((entitize_buf = strdup(item)) == NULL + || sgml_entitize(&entitize_buf, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), entitize_buf, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { clean_request(dbires); + free(entitize_buf); LOG_PRINT(LOG_WARNING, outomem.text); return NULL; @@ -329,4 +338,7 @@ *(ptr_rendinfo->ptr_ref) = new_ref; } + + free(entitize_buf); + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "; ", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { clean_request(dbires); @@ -367,4 +379,10 @@ *(ptr_rendinfo->ptr_ref) = new_ref; } + + if (sgml_entitize((char**)&item, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* title */ LOG_PRINT(LOG_WARNING, outomem.text); @@ -412,6 +430,14 @@ while ((item = get_author(dbires)) != NULL) { have_author = 1; - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { + + if ((entitize_buf = strdup(item)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), entitize_buf, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { clean_request(dbires); + free(entitize_buf); LOG_PRINT(LOG_WARNING, outomem.text); return NULL; @@ -420,4 +446,7 @@ *(ptr_rendinfo->ptr_ref) = new_ref; } + + free(entitize_buf); + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "; ", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { clean_request(dbires); @@ -445,6 +474,13 @@ if (item != NULL) { nhave_booktitle++; + + if (sgml_entitize((char**)&item, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* book title */ LOG_PRINT(LOG_WARNING, outomem.text); + free((char*)item); return NULL; } @@ -469,4 +505,10 @@ *(ptr_rendinfo->ptr_ref) = new_ref; } + + if (sgml_entitize((char**)&item, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* book title */ LOG_PRINT(LOG_WARNING, outomem.text); @@ -513,6 +555,14 @@ while ((item = get_author(dbires)) != NULL) { have_author = 1; - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { + + if ((entitize_buf = strdup(item)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), entitize_buf, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { clean_request(dbires); + free(entitize_buf); LOG_PRINT(LOG_WARNING, outomem.text); return NULL; @@ -521,4 +571,7 @@ *(ptr_rendinfo->ptr_ref) = new_ref; } + + free(entitize_buf); + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "; ", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { clean_request(dbires); @@ -541,6 +594,12 @@ } + if (sgml_entitize((char**)&item1, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item1, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* series title */ LOG_PRINT(LOG_WARNING, outomem.text); + free((char*)item1); return NULL; } @@ -581,12 +640,21 @@ } - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { + if ((entitize_buf = strdup(item)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); return NULL; } + + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), entitize_buf, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + free(entitize_buf); + return NULL; + } else { *(ptr_rendinfo->ptr_ref) = new_ref; } + free(entitize_buf); + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "</em> ", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); @@ -610,11 +678,22 @@ *(ptr_rendinfo->ptr_ref) = new_ref; } - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* volume */ + + if ((entitize_buf = strdup(item)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); return NULL; } + + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), entitize_buf, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* volume */ + LOG_PRINT(LOG_WARNING, outomem.text); + free(entitize_buf); + return NULL; + } else { *(ptr_rendinfo->ptr_ref) = new_ref; } + + free(entitize_buf); + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "</em>", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); @@ -637,11 +716,22 @@ *(ptr_rendinfo->ptr_ref) = new_ref; } - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* issue */ + + if ((entitize_buf = strdup(item)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); return NULL; } + + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), entitize_buf, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* issue */ + LOG_PRINT(LOG_WARNING, outomem.text); + free(entitize_buf); + return NULL; + } else { *(ptr_rendinfo->ptr_ref) = new_ref; } + + free(entitize_buf); + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), ")</em>", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); @@ -678,11 +768,21 @@ } } - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* start page */ + + if ((entitize_buf = strdup(item)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); return NULL; } + + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), entitize_buf, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* start page */ + LOG_PRINT(LOG_WARNING, outomem.text); + free(entitize_buf); + return NULL; + } else { *(ptr_rendinfo->ptr_ref) = new_ref; } + + free(entitize_buf); } @@ -699,12 +799,23 @@ *(ptr_rendinfo->ptr_ref) = new_ref; } - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* end page */ + + if ((entitize_buf = strdup(item)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); return NULL; } + + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), entitize_buf, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* end page */ + LOG_PRINT(LOG_WARNING, outomem.text); + free(entitize_buf); + return NULL; + } else { *(ptr_rendinfo->ptr_ref) = new_ref; } + + free(entitize_buf); } + if (have_page) { if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "</em>", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { @@ -730,4 +841,6 @@ /* citation key */ item = get_refdb_citekey(ptr_rendinfo->dbires); + + /* citation key is preprocessed and cannot contain offending xml chars */ if (item && *item) { if (print_field_html(item, ptr_rendinfo, "<p class='citekey'>CITEKEY:") == NULL) { @@ -743,4 +856,10 @@ item = get_refdb_abstract_copy(ptr_rendinfo->dbires); if (item != NULL) { + if (sgml_entitize((char**)&item, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + free((char*)item); + return NULL; + } + if (print_field_html(item, ptr_rendinfo, "<p class='abstract'>ABSTRACT: ") == NULL) { free((char*)item); @@ -757,4 +876,10 @@ item = get_refdb_address_copy(ptr_rendinfo->dbires); if (item != NULL) { + if (sgml_entitize((char**)&item, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + free((char*)item); + return NULL; + } + if (print_field_html(item, ptr_rendinfo, "<p class='address'>ADDRESS: ") == NULL) { free((char*)item); @@ -777,4 +902,5 @@ *(ptr_rendinfo->ptr_ref) = new_ref; } + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), reprint.reprint, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); @@ -784,4 +910,5 @@ *(ptr_rendinfo->ptr_ref) = new_ref; } + if (reprint.date != NULL && *(reprint.date)) { if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), " (", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { @@ -871,6 +998,14 @@ } } - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), reprint.avail+5, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { + + if ((entitize_buf = strdup(reprint.avail+5)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), entitize_buf, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); + free(entitize_buf); return NULL; } @@ -878,6 +1013,8 @@ *(ptr_rendinfo->ptr_ref) = new_ref; } + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "\">", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); + free(entitize_buf); return NULL; } @@ -885,4 +1022,5 @@ *(ptr_rendinfo->ptr_ref) = new_ref; } + if (*(ptr_rendinfo->pdfroot)) { if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), ptr_rendinfo->pdfroot, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { @@ -894,6 +1032,8 @@ } } - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), reprint.avail+5, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { + + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), entitize_buf, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); + free(entitize_buf); return NULL; } @@ -901,4 +1041,7 @@ *(ptr_rendinfo->ptr_ref) = new_ref; } + + free(entitize_buf); + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "</a>", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); @@ -930,8 +1073,15 @@ } - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), reprint.avail, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { + if ((entitize_buf = strdup(reprint.avail)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); return NULL; } + + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), entitize_buf, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + free(entitize_buf); + return NULL; + } else { *(ptr_rendinfo->ptr_ref) = new_ref; @@ -940,4 +1090,5 @@ if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "\">", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); + free(entitize_buf); return NULL; } @@ -947,6 +1098,7 @@ } - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), reprint.avail, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), entitize_buf, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); + free(entitize_buf); return NULL; } @@ -955,4 +1107,6 @@ } + free(entitize_buf); + if (n_renderaslink) { if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "</a>", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { @@ -981,6 +1135,18 @@ || strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "ALL") != NULL) { item = get_refdb_issn(ptr_rendinfo->dbires); - if (print_field_html(item, ptr_rendinfo, "<p class='issn'>ISSN: ") == NULL) { - return NULL; + + if (item) { + if ((entitize_buf = strdup(item)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + + if (print_field_html(entitize_buf, ptr_rendinfo, "<p class='issn'>ISSN: ") == NULL) { + free(entitize_buf); + return NULL; + } + + free(entitize_buf); } } @@ -991,6 +1157,18 @@ || strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "ALL") != NULL) { item = get_refdb_publisher(ptr_rendinfo->dbires); - if (print_field_html(item, ptr_rendinfo, "<p class='publisher'>PUBLISHER: ") == NULL) { - return NULL; + + if (item) { + if ((entitize_buf = strdup(item)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + + if (print_field_html(entitize_buf, ptr_rendinfo, "<p class='publisher'>PUBLISHER: ") == NULL) { + free(entitize_buf); + return NULL; + } + + free(entitize_buf); } } @@ -1001,6 +1179,18 @@ || strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "ALL") != NULL) { item = get_refdb_city(ptr_rendinfo->dbires); - if (print_field_html(item, ptr_rendinfo, "<p class='city'>CITY: ") == NULL) { - return NULL; + + if (item) { + if ((entitize_buf = strdup(item)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + + if (print_field_html(entitize_buf, ptr_rendinfo, "<p class='city'>CITY: ") == NULL) { + free(entitize_buf); + return NULL; + } + + free(entitize_buf); } } @@ -1011,6 +1201,18 @@ || strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "ALL") != NULL) { item = get_refdb_user1(ptr_rendinfo->dbires); - if (print_field_html(item, ptr_rendinfo, "<p class='u1'>USER1: ") == NULL) { - return NULL; + + if (item) { + if ((entitize_buf = strdup(item)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + + if (print_field_html(entitize_buf, ptr_rendinfo, "<p class='u1'>USER1: ") == NULL) { + free(entitize_buf); + return NULL; + } + + free(entitize_buf); } } @@ -1019,6 +1221,18 @@ || strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "ALL") != NULL) { item = get_refdb_user2(ptr_rendinfo->dbires); - if (print_field_html(item, ptr_rendinfo, "<p class='u2'>USER2: ") == NULL) { - return NULL; + + if (item) { + if ((entitize_buf = strdup(item)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + + if (print_field_html(entitize_buf, ptr_rendinfo, "<p class='u2'>USER2: ") == NULL) { + free(entitize_buf); + return NULL; + } + + free(entitize_buf); } } @@ -1027,6 +1241,18 @@ || strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "ALL") != NULL) { item = get_refdb_user3(ptr_rendinfo->dbires); - if (print_field_html(item, ptr_rendinfo, "<p class='u3'>USER3: ") == NULL) { - return NULL; + + if (item) { + if ((entitize_buf = strdup(item)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + + if (print_field_html(entitize_buf, ptr_rendinfo, "<p class='u3'>USER3: ") == NULL) { + free(entitize_buf); + return NULL; + } + + free(entitize_buf); } } @@ -1035,6 +1261,18 @@ || strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "ALL") != NULL) { item = get_refdb_user4(ptr_rendinfo->dbires); - if (print_field_html(item, ptr_rendinfo, "<p class='u4'>USER4: ") == NULL) { - return NULL; + + if (item) { + if ((entitize_buf = strdup(item)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + + if (print_field_html(entitize_buf, ptr_rendinfo, "<p class='u4'>USER4: ") == NULL) { + free(entitize_buf); + return NULL; + } + + free(entitize_buf); } } @@ -1043,6 +1281,18 @@ || strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "ALL") != NULL) { item = get_refdb_user5(ptr_rendinfo->dbires); - if (print_field_html(item, ptr_rendinfo, "<p class='u5'>USER5: ") == NULL) { - return NULL; + + if (item) { + if ((entitize_buf = strdup(item)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + + if (print_field_html(entitize_buf, ptr_rendinfo, "<p class='u5'>USER5: ") == NULL) { + free(entitize_buf); + return NULL; + } + + free(entitize_buf); } } @@ -1053,6 +1303,18 @@ || strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "ALL") != NULL) { item = get_refdb_misc1(ptr_rendinfo->dbires); - if (print_field_html(item, ptr_rendinfo, "<p class='m1'>MISC1: ") == NULL) { - return NULL; + + if (item) { + if ((entitize_buf = strdup(item)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + + if (print_field_html(entitize_buf, ptr_rendinfo, "<p class='m1'>MISC1: ") == NULL) { + free(entitize_buf); + return NULL; + } + + free(entitize_buf); } } @@ -1061,6 +1323,18 @@ || strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "ALL") != NULL) { item = get_refdb_misc2(ptr_rendinfo->dbires); - if (print_field_html(item, ptr_rendinfo, "<p class='m2'>MISC2: ") == NULL) { - return NULL; + + if (item) { + if ((entitize_buf = strdup(item)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + + if (print_field_html(entitize_buf, ptr_rendinfo, "<p class='m2'>MISC2: ") == NULL) { + free(entitize_buf); + return NULL; + } + + free(entitize_buf); } } @@ -1069,6 +1343,18 @@ || strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "ALL") != NULL) { item = get_refdb_misc3(ptr_rendinfo->dbires); - if (print_field_html(item, ptr_rendinfo, "<p class='m3'>MISC3: ") == NULL) { - return NULL; + + if (item) { + if ((entitize_buf = strdup(item)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + + if (print_field_html(entitize_buf, ptr_rendinfo, "<p class='m3'>MISC3: ") == NULL) { + free(entitize_buf); + return NULL; + } + + free(entitize_buf); } } @@ -1087,5 +1373,12 @@ *(ptr_rendinfo->ptr_ref) = new_ref; } - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { + + if ((entitize_buf = strdup(item)) == NULL + || sgml_entitize(&entitize_buf, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), entitize_buf, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); return NULL; @@ -1094,6 +1387,8 @@ *(ptr_rendinfo->ptr_ref) = new_ref; } + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "\">", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); + free(entitize_buf); return NULL; } @@ -1101,6 +1396,8 @@ *(ptr_rendinfo->ptr_ref) = new_ref; } - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { + + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), entitize_buf, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); + free(entitize_buf); return NULL; } @@ -1108,4 +1405,7 @@ *(ptr_rendinfo->ptr_ref) = new_ref; } + + free(entitize_buf); + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "</a></p>\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); @@ -1123,5 +1423,12 @@ || strstr((ptr_rendinfo->ptr_biblio_info)->format_string, "ALL") != NULL) { item = get_notes_copy(ptr_rendinfo->dbires, ptr_rendinfo->username); + if (item != NULL) { + if (sgml_entitize((char**)&item, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + free((char*)item); + return NULL; + } + if (print_field_html(item, ptr_rendinfo, "<p class='note'>NOTES:") == NULL) { free((char*)item); Index: backendn-html.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backendn-html.c,v retrieving revision 1.5 retrieving revision 1.6 diff -u -U2 -r1.5 -r1.6 --- backendn-html.c 28 Jan 2004 00:18:15 -0000 1.5 +++ backendn-html.c 29 Apr 2004 22:39:48 -0000 1.6 @@ -107,4 +107,5 @@ char* item; char* new_ref; + char* entitize_buf; dbi_conn conn; @@ -231,4 +232,10 @@ } + if (sgml_entitize(&item, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + free(item); + return NULL; + } + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* title */ free(item); @@ -263,4 +270,10 @@ } + if (sgml_entitize(&item, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + free(item); + return NULL; + } + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)item, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* note proper */ free(item); @@ -364,6 +377,13 @@ } - if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), (char*)citem, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* note proper */ + if ((entitize_buf = strdup(citem)) != NULL + && sgml_entitize(&entitize_buf, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + return NULL; + } + + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), entitize_buf, ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* note proper */ free(item); + free(entitize_buf); LOG_PRINT(LOG_WARNING, outomem.text); return NULL; @@ -372,4 +392,7 @@ *(ptr_rendinfo->ptr_ref) = new_ref; } + + free(entitize_buf); + if ((new_ref = mstrcat(*(ptr_rendinfo->ptr_ref), "</p>\n", ptr_rendinfo->ptr_ref_len, 0)) == NULL) { /* note proper */ free(item); |
From: Markus H. <mho...@us...> - 2004-04-29 00:09:36
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23461 Modified Files: backend-dbiba.c Log Message: format_simple(): entitize contents Index: backend-dbiba.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-dbiba.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -U2 -r1.25 -r1.26 --- backend-dbiba.c 5 Oct 2003 10:36:16 -0000 1.25 +++ backend-dbiba.c 29 Apr 2004 00:09:27 -0000 1.26 @@ -1952,4 +1952,10 @@ nhave_content = 1; + if (sgml_entitize(&item_simple, NULL) == NULL) { + LOG_PRINT(LOG_WARNING, outomem.text); + free(item_simple); + return NULL; + } + /* some elements need some special care */ if (!strcmp(elname, "city")) { |
From: Markus H. <mho...@us...> - 2004-04-29 00:08:19
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23268 Modified Files: strfncs.c Log Message: sgml_entitize(): do not replace ampersand if it starts an entity Index: strfncs.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/strfncs.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -U2 -r1.14 -r1.15 --- strfncs.c 7 Feb 2004 14:56:01 -0000 1.14 +++ strfncs.c 29 Apr 2004 00:08:08 -0000 1.15 @@ -752,5 +752,8 @@ while (token != NULL) { - replace_char_string(token, the_ents[i].entity); + /* replace ampersand only if it does not start an entity */ + if (the_ents[i].character != '&' || strchr(token, (int)';') == NULL) { + replace_char_string(token, the_ents[i].entity); + } token = (token + 1 > the_end + 5) ? NULL:strchr(token+1, the_ents[i].character); } |
From: Markus H. <mho...@us...> - 2004-04-28 03:07:19
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9024 Modified Files: refdbxml.in Log Message: improved comments Index: refdbxml.in =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/refdbxml.in,v retrieving revision 1.11 retrieving revision 1.12 diff -u -U2 -r1.11 -r1.12 --- refdbxml.in 5 Mar 2004 23:25:56 -0000 1.11 +++ refdbxml.in 28 Apr 2004 03:07:10 -0000 1.12 @@ -24,16 +24,21 @@ xslt_processor="xsltproc" -# the default fo processor: passivetex, fop or xep +# the default fo processor: passivetex, fop, jfor, or xep fo_processor="passivetex" -# the path to the Java class repository. This assumes that all necessary .jar +# the path to the Java class repository. This option is DEPRECATED. Please +# set xslt_classpath and fo_classpath in your refdbxmlrc config file instead +# This assumes that all necessary .jar # files are in this directory. If this is not the case, adding a few symlinks # might be the simplest solution classpath_root="<classpath_root>" + +# CLASSPATH settings for your xslt and fo processors xslt_classpath="" fo_classpath="" # this option is required to find xep.sh which usually is not in your -# PATH. You may leave it empty if xep.sh *is* in your PATH. +# PATH. Specify the directory containing xep.sh including the trailing +# slash. Leave this option empty if xep.sh *is* in your PATH. xep_path="" @@ -45,5 +50,5 @@ outformat="html" -# associate fo processors with their output +# associate fo processors with their output format rtf_generators="jfor" pdf_generators="fop xep passivetex" |
From: Markus H. <mho...@us...> - 2004-04-28 03:06:16
|
Update of /cvsroot/refdb/refdb/xsl/refdb/docbk-refdb-xsl/docbk-xhtml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8855/docbk-xhtml Modified Files: docbk-refdb-xhtml.xsl.in Log Message: prevent entity conversion Index: docbk-refdb-xhtml.xsl.in =================================================================== RCS file: /cvsroot/refdb/refdb/xsl/refdb/docbk-refdb-xsl/docbk-xhtml/docbk-refdb-xhtml.xsl.in,v retrieving revision 1.6 retrieving revision 1.7 diff -u -U2 -r1.6 -r1.7 --- docbk-refdb-xhtml.xsl.in 19 Mar 2004 23:23:12 -0000 1.6 +++ docbk-refdb-xhtml.xsl.in 28 Apr 2004 03:06:05 -0000 1.7 @@ -472,5 +472,5 @@ <xsl:text disable-output-escaping="yes"><sup></xsl:text> </xsl:if> - <xsl:value-of select="$string"/> + <xsl:value-of select="$string" disable-output-escaping="yes"/> <xsl:if test="$style='SUPER'"> <xsl:text disable-output-escaping="yes"></sup></xsl:text> |
From: Markus H. <mho...@us...> - 2004-04-28 03:06:14
|
Update of /cvsroot/refdb/refdb/xsl/refdb/docbk-refdb-xsl/docbk-html In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8855/docbk-html Modified Files: docbk-refdb-html.xsl.in Log Message: prevent entity conversion Index: docbk-refdb-html.xsl.in =================================================================== RCS file: /cvsroot/refdb/refdb/xsl/refdb/docbk-refdb-xsl/docbk-html/docbk-refdb-html.xsl.in,v retrieving revision 1.9 retrieving revision 1.10 diff -u -U2 -r1.9 -r1.10 --- docbk-refdb-html.xsl.in 19 Mar 2004 23:23:12 -0000 1.9 +++ docbk-refdb-html.xsl.in 28 Apr 2004 03:06:04 -0000 1.10 @@ -461,5 +461,5 @@ <xsl:text disable-output-escaping="yes"><sup></xsl:text> </xsl:if> - <xsl:value-of select="$string"/> + <xsl:value-of select="$string" disable-output-escaping="yes"/> <xsl:if test="$style='SUPER'"> <xsl:text disable-output-escaping="yes"></sup></xsl:text> |
From: Markus H. <mho...@us...> - 2004-04-28 03:06:13
|
Update of /cvsroot/refdb/refdb/xsl/refdb/docbk-refdb-xsl/docbk-fo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8855/docbk-fo Modified Files: docbk-refdb-fo.xsl.in Log Message: prevent entity conversion Index: docbk-refdb-fo.xsl.in =================================================================== RCS file: /cvsroot/refdb/refdb/xsl/refdb/docbk-refdb-xsl/docbk-fo/docbk-refdb-fo.xsl.in,v retrieving revision 1.8 retrieving revision 1.9 diff -u -U2 -r1.8 -r1.9 --- docbk-refdb-fo.xsl.in 30 Mar 2004 23:55:26 -0000 1.8 +++ docbk-refdb-fo.xsl.in 28 Apr 2004 03:06:04 -0000 1.9 @@ -404,44 +404,44 @@ <xsl:when test="$style='ULINE'"> <fo:inline text-decoration="underline"> - <xsl:value-of select="$string"/> + <xsl:value-of select="$string" disable-output-escaping="yes"/> </fo:inline> </xsl:when> <xsl:when test="$style='ITULINE'"> <fo:inline text-decoration="underline" font-style="italic"> - <xsl:value-of select="$string"/> + <xsl:value-of select="$string" disable-output-escaping="yes"/> </fo:inline> </xsl:when> <xsl:when test="$style='BOLDULINE'"> <fo:inline text-decoration="underline" font-weight="bold"> - <xsl:value-of select="$string"/> + <xsl:value-of select="$string" disable-output-escaping="yes"/> </fo:inline> </xsl:when> <xsl:when test="$style='BOLDITULINE'"> <fo:inline text-decoration="underline" font-style="italic" font-weight="bold"> - <xsl:value-of select="$string"/> + <xsl:value-of select="$string" disable-output-escaping="yes"/> </fo:inline> </xsl:when> <xsl:when test="$style='BOLD'"> <fo:inline font-weight="bold"> - <xsl:value-of select="$string"/> + <xsl:value-of select="$string" disable-output-escaping="yes"/> </fo:inline> </xsl:when> <xsl:when test="$style='ITALIC'"> <fo:inline font-style="italic"> - <xsl:value-of select="$string"/> + <xsl:value-of select="$string" disable-output-escaping="yes"/> </fo:inline> </xsl:when> <xsl:when test="$style='SUB'"> <fo:inline vertical-align="sub"> - <xsl:value-of select="$string"/> + <xsl:value-of select="$string" disable-output-escaping="yes"/> </fo:inline> </xsl:when> <xsl:when test="$style='SUPER'"> <fo:inline vertical-align="super"> - <xsl:value-of select="$string"/> + <xsl:value-of select="$string" disable-output-escaping="yes"/> </fo:inline> </xsl:when> <xsl:otherwise> - <xsl:value-of select="$string"/> + <xsl:value-of select="$string" disable-output-escaping="yes"/> </xsl:otherwise> </xsl:choose> |
From: Markus H. <mho...@us...> - 2004-04-28 03:03:31
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8501 Modified Files: xmlhandler.c Log Message: quote author names properly Index: xmlhandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/xmlhandler.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -U2 -r1.21 -r1.22 --- xmlhandler.c 3 Jan 2004 20:11:44 -0000 1.21 +++ xmlhandler.c 28 Apr 2004 03:03:16 -0000 1.22 @@ -1430,4 +1430,8 @@ else { if (id_string != NULL) { + dbi_driver driver; + + driver = dbi_conn_get_driver(ptr_gbdata->conn); + /* select items and stash them into the temporary table */ /* all fields that we can get directly from t_refdb */ @@ -1472,7 +1476,4 @@ char *my_refdb_issue; char *my_refdb_startpage; - dbi_driver driver; - - driver = dbi_conn_get_driver(ptr_gbdata->conn); my_refdb_title = my_dbi_result_get_string_copy(dbires, "refdb_title"); @@ -1544,12 +1545,29 @@ else { while ((query_result = get_author(dbires1)) != NULL) { - if ((new_sql_command = mstrcat(sql_command, (char*)query_result, &sql_command_len, 0)) == NULL) { + char *author_q; + + author_q = strdup(query_result); + if (!author_q || dbi_driver_quote_string(driver, &author_q) == -1) { + LOG_PRINT(LOG_WARNING, "out of memory"); (*(ptr_gbdata->ptr_nmem_error))++; - break; } - else { - sql_command = new_sql_command; + else if (*author_q) { + /* the quoted author is enclosed in quotes (who + would have thought?) but we don't need these + here; we need only the internal quotes */ + author_q[strlen(author_q)-1] = '\0'; + + if ((new_sql_command = mstrcat(sql_command, author_q + 1, &sql_command_len, 0)) == NULL) { + (*(ptr_gbdata->ptr_nmem_error))++; + break; + } + else { + sql_command = new_sql_command; + } + + free(author_q); } } + if ((new_sql_command = mstrcat(sql_command, "\' WHERE id=", &sql_command_len, 0)) == NULL) { (*(ptr_gbdata->ptr_nmem_error))++; |
From: Markus H. <mho...@us...> - 2004-03-31 17:35:25
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22855 Modified Files: refdbc.c Log Message: added and fixed a few comments Index: refdbc.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbc.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -U2 -r1.71 -r1.72 --- refdbc.c 31 Mar 2004 17:13:38 -0000 1.71 +++ refdbc.c 31 Mar 2004 17:23:34 -0000 1.72 @@ -224,5 +224,6 @@ rl_readline_name = readline_name; - /* look for batch command. If found, don't test for CGI environment */ + /* look for batch command. If found, don't test for CGI environment + and change -h behaviour */ for (i = 0; i < argc; i++) { if (argv[i][0] == '-' && argv[i][1] == 'C') { @@ -248,7 +249,4 @@ /* switch on reading from stdin if we receive data on stdin via a redirection or a pipe. */ -/* if (!isatty(fileno(stdin)) && !n_cgi_env) { */ -/* n_read_stdin = 1; */ -/* } */ #ifdef FIONREAD if (ioctl(fileno(stdin), FIONREAD, &n_inbytes) != -1) { @@ -357,4 +355,6 @@ strncpy(the_cmd, optarg, 31); the_cmd[31] = '\0'; + + /* see whether a valid command was requested */ if (!find_command(optarg, commands)) { fprintf (stderr, "%s: No such command for refdb.\n", optarg); @@ -384,4 +384,7 @@ break; case 'h': + /* if we're running in batch mode, assume the -h option pertains + to the requested command. Otherwise display the generic program + help message */ if (!n_batchmode) { fprintf(stderr, "Usage: refdbc [-c pager] [-C command] [-d db] [-e logdest] [-F fields] [-G url] [-h] [-i address] [-l loglevel] [-L logfile] [-p port] [-q] [-R pdfroot] [-T time] [-u name] [-v] [-V] [-w password] [-y confdir]\nOptions: -c command line of pager\n -C run command in batch mode\n -d use database db\n -e log destination (0=stderr;1=syslog;2=custom file)\n -F additional fields in reference output\n -G URL of a css stylesheet for HTML output\n -h prints this help\n -i set server IP address\n -l set log level (0<=level<=7)\n -L full path of custom log file\n -p set server port\n -q ignore init-file\n -R set pdf root directory\n -T set timeout in seconds\n -u use this username\n -v show version information\n -V switch to verbose mode\n -w set password (use '*' to be asked interactively)\n -y look for configuration files in confdir\n"); @@ -389,4 +392,5 @@ } else { + /* pass through the -h option to the command argument list */ if ((new_the_command = mstrcat(the_command, " -h ", &the_command_len, 0)) == NULL) { fprintf(stderr, "out of memory\n"); @@ -1978,7 +1982,7 @@ /* now we have the tokens nicely arranged in inargc */ - for (i = 0; i < inargc; i++) { - printf("inargv[%d]: %s\n", i, inargv[i]); - } +/* for (i = 0; i < inargc; i++) { */ +/* printf("inargv[%d]: %s\n", i, inargv[i]); */ +/* } */ /* get options */ |
From: Markus H. <mho...@us...> - 2004-03-31 17:25:27
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20856 Modified Files: refdbc.c Log Message: pass help option through to command in batch mode; check for valid command name in batch mode Index: refdbc.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbc.c,v retrieving revision 1.70 retrieving revision 1.71 diff -u -U2 -r1.70 -r1.71 --- refdbc.c 17 Feb 2004 22:11:54 -0000 1.70 +++ refdbc.c 31 Mar 2004 17:13:38 -0000 1.71 @@ -212,5 +212,4 @@ int n_readinit = 1; /* if 1, read config file. If 0, skip config file */ int retval; - int n_test_cgi = 1; /* whether to test for CGI environment */ int n_inbytes = 0; /* number of bytes to be read on stdin */ FILE* errstream; @@ -228,5 +227,5 @@ for (i = 0; i < argc; i++) { if (argv[i][0] == '-' && argv[i][1] == 'C') { - n_test_cgi = 0; + n_batchmode = 1; break; } @@ -234,5 +233,5 @@ #ifdef REFDB_CGI - if (n_test_cgi) { + if (!n_batchmode) { n_cgi = is_cgi(&request_method, &content_length, delayed_cgi_errmsg); /* 1 if we are running as a cgi app */ } @@ -358,5 +357,9 @@ strncpy(the_cmd, optarg, 31); the_cmd[31] = '\0'; - n_batchmode = 1; + if (!find_command(optarg, commands)) { + fprintf (stderr, "%s: No such command for refdb.\n", optarg); + exit (1); + } +/* n_batchmode was set at startup */ break; case 'd': @@ -381,6 +384,17 @@ break; case 'h': - fprintf(stderr, "Usage: refdbc [-c pager] [-C command] [-d db] [-e logdest] [-F fields] [-G url] [-h] [-i address] [-l loglevel] [-L logfile] [-p port] [-q] [-R pdfroot] [-T time] [-u name] [-v] [-V] [-w password] [-y confdir]\nOptions: -c command line of pager\n -C run command in batch mode\n -d use database db\n -e log destination (0=stderr;1=syslog;2=custom file)\n -F additional fields in reference output\n -G URL of a css stylesheet for HTML output\n -h prints this help\n -i set server IP address\n -l set log level (0<=level<=7)\n -L full path of custom log file\n -p set server port\n -q ignore init-file\n -R set pdf root directory\n -T set timeout in seconds\n -u use this username\n -v show version information\n -V switch to verbose mode\n -w set password (use '*' to be asked interactively)\n -y look for configuration files in confdir\n"); - exit (0); + if (!n_batchmode) { + fprintf(stderr, "Usage: refdbc [-c pager] [-C command] [-d db] [-e logdest] [-F fields] [-G url] [-h] [-i address] [-l loglevel] [-L logfile] [-p port] [-q] [-R pdfroot] [-T time] [-u name] [-v] [-V] [-w password] [-y confdir]\nOptions: -c command line of pager\n -C run command in batch mode\n -d use database db\n -e log destination (0=stderr;1=syslog;2=custom file)\n -F additional fields in reference output\n -G URL of a css stylesheet for HTML output\n -h prints this help\n -i set server IP address\n -l set log level (0<=level<=7)\n -L full path of custom log file\n -p set server port\n -q ignore init-file\n -R set pdf root directory\n -T set timeout in seconds\n -u use this username\n -v show version information\n -V switch to verbose mode\n -w set password (use '*' to be asked interactively)\n -y look for configuration files in confdir\n"); + exit (0); + } + else { + if ((new_the_command = mstrcat(the_command, " -h ", &the_command_len, 0)) == NULL) { + fprintf(stderr, "out of memory\n"); + exit (1); + } + else { + the_command = new_the_command; + } + } break; case 'i': @@ -1964,7 +1978,7 @@ /* now we have the tokens nicely arranged in inargc */ - /* for (i = 0; i < inargc; i++) { */ - /* printf("inargv[%d]: %s\n", i, inargv[i]); */ - /* } */ + for (i = 0; i < inargc; i++) { + printf("inargv[%d]: %s\n", i, inargv[i]); + } /* get options */ |
From: Markus H. <mho...@us...> - 2004-03-31 00:07:09
|
Update of /cvsroot/refdb/refdb/xsl/refdb/docbk-refdb-xsl/docbk-fo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26120 Modified Files: docbk-refdb-fo.xsl.in Log Message: fixed url argument for ulink Index: docbk-refdb-fo.xsl.in =================================================================== RCS file: /cvsroot/refdb/refdb/xsl/refdb/docbk-refdb-xsl/docbk-fo/docbk-refdb-fo.xsl.in,v retrieving revision 1.7 retrieving revision 1.8 diff -u -U2 -r1.7 -r1.8 --- docbk-refdb-fo.xsl.in 29 Mar 2004 21:39:47 -0000 1.7 +++ docbk-refdb-fo.xsl.in 30 Mar 2004 23:55:26 -0000 1.8 @@ -107,5 +107,5 @@ <xsl:variable name="reftype" select="ancestor::bibliomixed/@role"/> <xsl:variable name="target" select="@url"/> - <fo:basic-link external-destination='#{$target}'> + <fo:basic-link external-destination='url({$target})'> <xsl:choose> <xsl:when test="$reftype='ABST'"> |
From: Markus H. <mho...@us...> - 2004-03-29 21:54:32
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30711 Modified Files: libgen.pl Log Message: moved ulink stuff out to individual driver files Index: libgen.pl =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/libgen.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -U2 -r1.4 -r1.5 --- libgen.pl 5 Mar 2004 00:18:12 -0000 1.4 +++ libgen.pl 29 Mar 2004 21:42:59 -0000 1.5 @@ -103,14 +103,4 @@ } - # ulink needs some special treatment - print "<!-- bibliography types for hyperlinks -->\n\n"; - - print " <xsl:template match=\"ulink\" mode=\"refdb\">\n <xsl:variable name=\"reftype\" select=\"ancestor::bibliomixed/\@role\"/>\n <xsl:variable name=\"target\" select=\"\@url\"/>\n <a href=\'#{\$target}\'>\n <xsl:choose>\n"; - foreach $type (@types) { - my $style = $db_styles{"ulink"}; - print " <xsl:when test=\"\$reftype=\'$type\'\">\n <xsl:call-template name=\"refdb-process-inline\">\n <xsl:with-param name=\"style\" select=\"\$$type$style" . "STYLE\"/>\n </xsl:call-template>\n </xsl:when>\n"; - } - print " </xsl:choose>\n </a>\n </xsl:template>\n\n"; - # in-text types for the same element print "<!-- in-text types for ulink -->\n\n"; |
From: Markus H. <mho...@us...> - 2004-03-29 21:51:17
|
Update of /cvsroot/refdb/refdb/xsl/refdb/docbk-refdb-xsl/docbk-fo In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30244/refdb/docbk-refdb-xsl/docbk-fo Modified Files: docbk-refdb-fo.xsl.in Log Message: moved ulink code from lib to fo Index: docbk-refdb-fo.xsl.in =================================================================== RCS file: /cvsroot/refdb/refdb/xsl/refdb/docbk-refdb-xsl/docbk-fo/docbk-refdb-fo.xsl.in,v retrieving revision 1.6 retrieving revision 1.7 diff -u -U2 -r1.6 -r1.7 --- docbk-refdb-fo.xsl.in 19 Mar 2004 23:23:12 -0000 1.6 +++ docbk-refdb-fo.xsl.in 29 Mar 2004 21:39:47 -0000 1.7 @@ -103,4 +103,188 @@ </xsl:template> +<!-- ulink needs special care as we want to create a hyperlink --> +<xsl:template match="ulink" mode="refdb"> + <xsl:variable name="reftype" select="ancestor::bibliomixed/@role"/> + <xsl:variable name="target" select="@url"/> + <fo:basic-link external-destination='#{$target}'> + <xsl:choose> + <xsl:when test="$reftype='ABST'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$ABSTURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='ADVS'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$ADVSURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='ART'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$ARTURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='BILL'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$BILLURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='BOOK'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$BOOKURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='CASE'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$CASEURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='CHAP'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$CHAPURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='COMP'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$COMPURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='CONF'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$CONFURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='CTLG'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$CTLGURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='DATA'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$DATAURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='ELEC'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$ELECURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='GEN'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$GENURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='HEAR'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$HEARURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='ICOMM'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$ICOMMURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='INPR'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$INPRURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='JFULL'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$JFULLURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='JOUR'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$JOURURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='MAP'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$MAPURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='MGZN'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$MGZNURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='MPCT'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$MPCTURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='MUSIC'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$MUSICURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='NEWS'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$NEWSURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='PAMP'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$PAMPURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='PAT'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$PATURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='PCOMM'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$PCOMMURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='RPRT'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$RPRTURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='SER'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$SERURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='SLIDE'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$SLIDEURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='SOUND'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$SOUNDURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='STAT'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$STATURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='THES'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$THESURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='UNBILL'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$UNBILLURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='UNPB'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$UNPBURLSTYLE"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$reftype='VIDEO'"> + <xsl:call-template name="refdb-process-inline"> + <xsl:with-param name="style" select="$VIDEOURLSTYLE"/> + </xsl:call-template> + </xsl:when> + </xsl:choose> + </fo:basic-link> +</xsl:template> <!-- overrides for xref elements --> |