refdb-cvs Mailing List for RefDB (Page 66)
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-06-15 22:24:46
|
Update of /cvsroot/refdb/refdb/dtd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv783/dtd Modified Files: Tag: Release_0_9_5_stable citestylex.dtd Log Message: added LASTCOMMASPCFIRSTMIDDLE to the value list of the NAMEORDER attributes Index: citestylex.dtd =================================================================== RCS file: /cvsroot/refdb/refdb/dtd/citestylex.dtd,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -u -U2 -r1.7 -r1.7.2.1 --- citestylex.dtd 9 Sep 2003 22:19:36 -0000 1.7 +++ citestylex.dtd 15 Jun 2004 22:24:28 -0000 1.7.2.1 @@ -4,5 +4,5 @@ <!-- suggested invocation: --> -<!-- <!DOCTYPE CITESTYLE PUBLIC "-//Markus Hoenicka//DTD CiteStyle V1.0//EN" "http://refdb.sourceforge.net/dtd/citestylex-1.0/citestylex.dtd"> --> +<!-- <!DOCTYPE CITESTYLE PUBLIC "-//Markus Hoenicka//DTD CiteStyle V1.1//EN" "http://refdb.sourceforge.net/dtd/citestylex-1.1/citestylex.dtd"> --> <!ELEMENT STYLESET (CITESTYLE)+> @@ -65,9 +65,9 @@ <!ELEMENT NAMEOTHER EMPTY> -<!ATTLIST NAMEFIRST NAMEORDER (FIRSTMIDDLELAST | LASTCOMMAFIRSTMIDDLE | LASTFIRSTMIDDLE | LAST) "LASTFIRSTMIDDLE" +<!ATTLIST NAMEFIRST NAMEORDER (FIRSTMIDDLELAST | LASTCOMMAFIRSTMIDDLE | LASTCOMMASPCFIRSTMIDDLE | LASTFIRSTMIDDLE | LAST) "LASTFIRSTMIDDLE" INITIALSTYLE (FIRSTSPCMIDDLE | FIRSTSPCM. | F.SPCM. | F.M. | FSPCM | FM) "F.M." UPPERCASE (NONE | LASTNAME | ALL) "NONE"> -<!ATTLIST NAMEOTHER NAMEORDER (FIRSTMIDDLELAST | LASTCOMMAFIRSTMIDDLE | LASTFIRSTMIDDLE | LAST) "LASTFIRSTMIDDLE" +<!ATTLIST NAMEOTHER NAMEORDER (FIRSTMIDDLELAST | LASTCOMMAFIRSTMIDDLE | LASTCOMMASPCFIRSTMIDDLE | LASTFIRSTMIDDLE | LAST) "LASTFIRSTMIDDLE" INITIALSTYLE (FIRSTSPCMIDDLE | FIRSTSPCM. | F.SPCM. | F.M. | FSPCM | FM) "F.M." UPPERCASE (NONE | LASTNAME | ALL) "NONE"> |
From: Markus H. <mho...@us...> - 2004-06-15 00:55:17
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23792 Modified Files: Tag: Release_0_9_5_stable backend-dbiba.c Log Message: changed dbires to dbires_ref Index: backend-dbiba.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-dbiba.c,v retrieving revision 1.26.2.1 retrieving revision 1.26.2.2 diff -u -U2 -r1.26.2.1 -r1.26.2.2 --- backend-dbiba.c 5 May 2004 19:33:20 -0000 1.26.2.1 +++ backend-dbiba.c 15 Jun 2004 00:55:07 -0000 1.26.2.2 @@ -1544,5 +1544,5 @@ if (real_item_title && *real_item_title && !dbi_conn_error_flag(ptr_bibconns->conn_source)) { /* reference has title data */ nhave_content = 1; - item = my_dbi_result_get_string_copy_idx(dbires, n_preceeding_index); + item = my_dbi_result_get_string_copy_idx(dbires_ref, n_preceeding_index); if (item && *item && !dbi_conn_error_flag(ptr_bibconns->conn_refdb)) { /* preceeding */ if (sgml_entitize(&item, NULL) == NULL) { |
From: Markus H. <mho...@us...> - 2004-06-15 00:53:43
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22057 Modified Files: backend-dbiba.c Log Message: changed dbires to dbires_ref Index: backend-dbiba.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-dbiba.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -U2 -r1.27 -r1.28 --- backend-dbiba.c 17 May 2004 23:20:01 -0000 1.27 +++ backend-dbiba.c 15 Jun 2004 00:53:34 -0000 1.28 @@ -1544,5 +1544,5 @@ if (real_item_title && *real_item_title && !dbi_conn_error_flag(ptr_bibconns->conn_source)) { /* reference has title data */ nhave_content = 1; - item = my_dbi_result_get_string_copy_idx(dbires, n_preceeding_index); + item = my_dbi_result_get_string_copy_idx(dbires_ref, n_preceeding_index); if (item && *item && !dbi_conn_error_flag(ptr_bibconns->conn_refdb)) { /* preceeding */ if (sgml_entitize(&item, NULL) == NULL) { |
From: Markus H. <mho...@us...> - 2004-06-15 00:12:20
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18563 Modified Files: refdbd.h.in Log Message: updated createdb() prototype Index: refdbd.h.in =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbd.h.in,v retrieving revision 1.7 retrieving revision 1.8 diff -u -U2 -r1.7 -r1.8 --- refdbd.h.in 16 Feb 2004 21:25:24 -0000 1.7 +++ refdbd.h.in 15 Jun 2004 00:12:10 -0000 1.8 @@ -103,5 +103,5 @@ void getstyle(struct CLIENT_REQUEST* ptr_clrequest); int whichdb(struct CLIENT_REQUEST* ptr_clrequest); -int createdb(struct CLIENT_REQUEST* ptr_clrequest, const char* dbname, const char* db_encoding); +int createdb(struct CLIENT_REQUEST* ptr_clrequest, const char* dbname, const char* db_encoding, int db_format); int deletedb(struct CLIENT_REQUEST* ptr_clrequest, const char* dbname); void child_confserv(struct CLIENT_REQUEST* ptr_clrequest); |
From: Markus H. <mho...@us...> - 2004-06-03 21:41:10
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14979 Modified Files: Tag: Release_0_9_5_stable refdbdref.c Log Message: fixed delete_ref_by_id() Index: refdbdref.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdref.c,v retrieving revision 1.65 retrieving revision 1.65.2.1 diff -u -U2 -r1.65 -r1.65.2.1 --- refdbdref.c 15 Feb 2004 23:41:27 -0000 1.65 +++ refdbdref.c 3 Jun 2004 21:41:02 -0000 1.65.2.1 @@ -1196,5 +1196,5 @@ dbi_result_free(dbires); - sprintf(sql_command, "SELECT user_id, xuser_id FROM t_xuser WHERE refdb_id="ULLSPEC, (unsigned long long)idval); + sprintf(sql_command, "SELECT t_user.user_id, t_user.user_name, t_xuser.xuser_id FROM t_user, t_xuser WHERE t_user.user_id=t_xuser.user_id AND t_xuser.refdb_id="ULLSPEC, (unsigned long long)idval); LOG_PRINT(LOG_DEBUG, sql_command); dbires_user = dbi_conn_query(conn, sql_command); @@ -1210,13 +1210,34 @@ } - if (dbi_result_get_numrows(dbires_user) > 1) { - /* dataset is used by at least one other user, refuse to delete it */ - sprintf(sql_command, "ID "ULLSPEC" is still in use\n", (unsigned long long)idval); - tiwrite(ptr_clrequest->fd, sql_command, TERM_NO); - my_dbi_conn_unlock(conn); - my_dbi_conn_rollback(conn); - dbi_result_free(dbires_user); - ptr_delresult->skipped++; - return 1; + if (dbi_result_get_numrows(dbires_user) >= 1) { + int used_by_other = 1; + + if (dbi_result_get_numrows(dbires_user) == 1) { + if (dbi_result_next_row(dbires_user) == 0) { + if (ptr_clrequest->n_cgi) { + iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); + } + tiwrite(ptr_clrequest->fd, "deleteref failed\n", TERM_NO); + my_dbi_conn_unlock(conn); + my_dbi_conn_rollback(conn); + LOG_PRINT(LOG_WARNING, "query error"); + return 0; + } + + if (!strcmp(ptr_clrequest->username, my_dbi_result_get_string(dbires_user, "user_name"))) { + used_by_other--; + } + } + + if (used_by_other) { + /* dataset is used by at least one other user, refuse to delete it */ + sprintf(sql_command, "ID "ULLSPEC" is still in use\n", (unsigned long long)idval); + tiwrite(ptr_clrequest->fd, sql_command, TERM_NO); + my_dbi_conn_unlock(conn); + my_dbi_conn_rollback(conn); + dbi_result_free(dbires_user); + ptr_delresult->skipped++; + return 1; + } } |
From: Markus H. <mho...@us...> - 2004-06-03 21:30:02
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8528 Modified Files: Tag: Release_0_9_5_stable refdbda.c Log Message: fixed LOCK issue for MySQL4.0.2 and later Index: refdbda.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbda.c,v retrieving revision 1.41 retrieving revision 1.41.2.1 diff -u -U2 -r1.41 -r1.41.2.1 --- refdbda.c 4 Feb 2004 21:07:21 -0000 1.41 +++ refdbda.c 3 Jun 2004 21:29:52 -0000 1.41.2.1 @@ -1199,8 +1199,10 @@ } - /* MySQL 4.02 introduced a new privilege "LOCK TABLES". As older + /* MySQL 4.0.2 introduced a new privilege "LOCK TABLES". As older versions will barf at it, add it only if we use a newer version */ - if (ver.major >= 4 && ver.minor >= 2) { + if ((ver.major == 4 && ver.minor == 0 && ver.minuscule >=2) + || (ver.major == 4 && ver.minor > 0) + || ver.major > 4) { strcpy(lockstring, ",LOCK TABLES "); } @@ -1313,14 +1315,14 @@ a new user with the given password. If the user already exists, the password will be changed to the one given */ - sprintf(sql_command, "GRANT SELECT, INSERT, UPDATE, DELETE ON %s.* TO %s IDENTIFIED BY \'%s\'", MAIN_DB, userathost, newuser_passwd); + sprintf(sql_command, "GRANT SELECT, INSERT, UPDATE, DELETE%s ON %s.* TO %s IDENTIFIED BY \'%s\'", lockstring, MAIN_DB, userathost, newuser_passwd); } else if (create_new) { /* avoid possible security risk: we provide a default password to avoid creating users with no passwords */ - sprintf(sql_command, "GRANT SELECT, INSERT, UPDATE, DELETE ON %s.* TO %s IDENTIFIED BY \'refdb\'", MAIN_DB, userathost); + sprintf(sql_command, "GRANT SELECT, INSERT, UPDATE, DELETE%s ON %s.* TO %s IDENTIFIED BY \'refdb\'", lockstring, MAIN_DB, userathost); } else { /* the user already exists and we don't touch the password */ - sprintf(sql_command, "GRANT SELECT, INSERT, UPDATE, DELETE ON %s.* TO %s", MAIN_DB, userathost); + sprintf(sql_command, "GRANT SELECT, INSERT, UPDATE, DELETE%s ON %s.* TO %s", lockstring, MAIN_DB, userathost); } LOG_PRINT(LOG_DEBUG, sql_command); |
From: Markus H. <mho...@us...> - 2004-05-17 23:54:44
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4491 Modified Files: xmlhandler.c Log Message: moved elstack functions to elstack.c and elstack.h Index: xmlhandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/xmlhandler.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -U2 -r1.22 -r1.23 --- xmlhandler.c 28 Apr 2004 03:03:16 -0000 1.22 +++ xmlhandler.c 17 May 2004 23:54:34 -0000 1.23 @@ -36,4 +36,5 @@ #include "refdb.h" #include "refdbd.h" /* depends on backend.h */ +#include "elstack.h" #include "xmlhandler.h" #include "strfncs.h" @@ -54,5 +55,4 @@ /* forward declarations of local functions */ static char* concat_elnames(struct elstack* ptr_current_element, char* exclude_name, char* concat); -static char* get_ancestor_attr(struct elstack* ptr_current_element, char* ancestor_name, char* ancestor_attribute); @@ -326,5 +326,5 @@ /* first authorlist */ else if (strcmp((ptr_asdata->ptr_first)->elname, "AUTHORLIST") == 0) { - ptr_attr = get_ancestor_attr(ptr_asdata->ptr_first, "AUTHORLIST", "ROLE"); + ptr_attr = elstack_get_ancestor_attr(ptr_asdata->ptr_first, "AUTHORLIST", "ROLE"); if (strcmp(ptr_attr, "PRIMARY") == 0) { strcpy(concat, "AUTHORLIST"); @@ -357,5 +357,5 @@ /* second pubdate */ else if (strcmp((ptr_asdata->ptr_first)->elname, "PUBDATE") == 0) { - ptr_attr = get_ancestor_attr(ptr_asdata->ptr_first, "PUBDATE", "ROLE"); + ptr_attr = elstack_get_ancestor_attr(ptr_asdata->ptr_first, "PUBDATE", "ROLE"); if (strcmp(ptr_attr, "PRIMARY") == 0) { strcpy(concat, "PUBDATE"); @@ -385,5 +385,5 @@ /* third title */ else if (strcmp((ptr_asdata->ptr_first)->elname, "TITLE") == 0) { - ptr_attr = get_ancestor_attr(ptr_asdata->ptr_first, "TITLE", "ROLE"); + ptr_attr = elstack_get_ancestor_attr(ptr_asdata->ptr_first, "TITLE", "ROLE"); if (strcmp(ptr_attr, "PRIMARY") == 0) { strcpy(concat, "TITLE"); @@ -414,5 +414,5 @@ } else if (strcmp((ptr_asdata->ptr_first)->elname, "USERDEF") == 0) { - ptr_attr = get_ancestor_attr(ptr_asdata->ptr_first, "USERDEF", "ROLE"); + ptr_attr = elstack_get_ancestor_attr(ptr_asdata->ptr_first, "USERDEF", "ROLE"); if (strcmp(ptr_attr, "1") == 0) { strcpy(concat, "USERDEF1"); @@ -446,5 +446,5 @@ } else if (strcmp((ptr_asdata->ptr_first)->elname, "MISC") == 0) { - ptr_attr = get_ancestor_attr(ptr_asdata->ptr_first, "MISC", "ROLE"); + ptr_attr = elstack_get_ancestor_attr(ptr_asdata->ptr_first, "MISC", "ROLE"); if (strcmp(ptr_attr, "1") == 0) { strcpy(concat, "MISC1"); @@ -472,5 +472,5 @@ } else if (strcmp((ptr_asdata->ptr_first)->elname, "LINK") == 0) { - ptr_attr = get_ancestor_attr(ptr_asdata->ptr_first, "LINK", "ROLE"); + ptr_attr = elstack_get_ancestor_attr(ptr_asdata->ptr_first, "LINK", "ROLE"); if (strcmp(ptr_attr, "1") == 0) { strcpy(concat, "LINK1"); @@ -547,11 +547,11 @@ strcpy(table_name, "REFSTYLE"); - if (is_descendant_of(ptr_asdata->ptr_first, "PUBTYPE")) { - strcpy(pubtype, get_ancestor_attr(ptr_asdata->ptr_first, "PUBTYPE", "TYPE")); + if (elstack_is_descendant_of(ptr_asdata->ptr_first, "PUBTYPE")) { + strcpy(pubtype, elstack_get_ancestor_attr(ptr_asdata->ptr_first, "PUBTYPE", "TYPE")); } - else if (is_descendant_of(ptr_asdata->ptr_first, "INTEXTDEF")) { + else if (elstack_is_descendant_of(ptr_asdata->ptr_first, "INTEXTDEF")) { strcpy(pubtype, "INTEXT"); } - else if (is_descendant_of(ptr_asdata->ptr_first, "AUTHORONLY")) { + else if (elstack_is_descendant_of(ptr_asdata->ptr_first, "AUTHORONLY")) { strcpy(pubtype, "AUTHORONLY"); } @@ -572,13 +572,13 @@ /* elements with character data at various locations */ else if (strcmp((ptr_asdata->ptr_first)->elname, "RANGESEPARATOR") == 0) { - if (is_descendant_of(ptr_asdata->ptr_first, "PUBTYPE")) { + if (elstack_is_descendant_of(ptr_asdata->ptr_first, "PUBTYPE")) { strcpy(table_name, "REFSTYLE"); strcpy(column_name, concat_elnames(ptr_asdata->ptr_first, "PUBTYPE", concat)); - strcpy(pubtype, get_ancestor_attr(ptr_asdata->ptr_first, "PUBTYPE", "TYPE")); + strcpy(pubtype, elstack_get_ancestor_attr(ptr_asdata->ptr_first, "PUBTYPE", "TYPE")); n_chardata = 1; n_attrdata = 1; current_id = *(ptr_asdata->ptr_citstyle_id); } - else if (is_descendant_of(ptr_asdata->ptr_first, "INTEXTDEF")) { + else if (elstack_is_descendant_of(ptr_asdata->ptr_first, "INTEXTDEF")) { strcpy(table_name, "REFSTYLE"); strcpy(column_name, concat_elnames(ptr_asdata->ptr_first, "INTEXTDEF", concat)); @@ -588,5 +588,5 @@ current_id = *(ptr_asdata->ptr_citstyle_id); } - else if (is_descendant_of(ptr_asdata->ptr_first, "AUTHORONLY")) { + else if (elstack_is_descendant_of(ptr_asdata->ptr_first, "AUTHORONLY")) { strcpy(table_name, "REFSTYLE"); strcpy(column_name, concat_elnames(ptr_asdata->ptr_first, "AUTHORONLY", concat)); @@ -596,5 +596,5 @@ current_id = *(ptr_asdata->ptr_citstyle_id); } - else if (is_descendant_of(ptr_asdata->ptr_first, "YEARONLY")) { + else if (elstack_is_descendant_of(ptr_asdata->ptr_first, "YEARONLY")) { strcpy(table_name, "REFSTYLE"); strcpy(column_name, concat_elnames(ptr_asdata->ptr_first, "YEARONLY", concat)); @@ -633,15 +633,15 @@ } else { - if (is_descendant_of(ptr_asdata->ptr_first, "PUBTYPE")) { + if (elstack_is_descendant_of(ptr_asdata->ptr_first, "PUBTYPE")) { strcpy(table_name, "REFSTYLE"); strcpy(column_name, concat_elnames(ptr_asdata->ptr_first, "PUBTYPE", concat)); - strcpy(pubtype, get_ancestor_attr(ptr_asdata->ptr_first, "PUBTYPE", "TYPE")); + strcpy(pubtype, elstack_get_ancestor_attr(ptr_asdata->ptr_first, "PUBTYPE", "TYPE")); } - else if (is_descendant_of(ptr_asdata->ptr_first, "INTEXTDEF")) { + else if (elstack_is_descendant_of(ptr_asdata->ptr_first, "INTEXTDEF")) { strcpy(table_name, "REFSTYLE"); strcpy(column_name, concat_elnames(ptr_asdata->ptr_first, "INTEXTDEF", concat)); strcpy(pubtype, "INTEXT"); } - else if (is_descendant_of(ptr_asdata->ptr_first, "AUTHORONLY")) { + else if (elstack_is_descendant_of(ptr_asdata->ptr_first, "AUTHORONLY")) { strcpy(table_name, "REFSTYLE"); strcpy(column_name, concat_elnames(ptr_asdata->ptr_first, "AUTHORONLY", concat)); @@ -670,13 +670,13 @@ strcmp((ptr_asdata->ptr_first)->elname, "TWOSEPS") == 0) { strcpy(table_name, "REFSTYLE"); - if (is_descendant_of(ptr_asdata->ptr_first, "PUBTYPE")) { + if (elstack_is_descendant_of(ptr_asdata->ptr_first, "PUBTYPE")) { strcpy(column_name, concat_elnames(ptr_asdata->ptr_first, "PUBTYPE", concat)); - strcpy(pubtype, get_ancestor_attr(ptr_asdata->ptr_first, "PUBTYPE", "TYPE")); + strcpy(pubtype, elstack_get_ancestor_attr(ptr_asdata->ptr_first, "PUBTYPE", "TYPE")); } - else if (is_descendant_of(ptr_asdata->ptr_first, "INTEXTDEF")) { + else if (elstack_is_descendant_of(ptr_asdata->ptr_first, "INTEXTDEF")) { strcpy(column_name, concat_elnames(ptr_asdata->ptr_first, "INTEXTDEF", concat)); strcpy(pubtype, "INTEXT"); } - else if (is_descendant_of(ptr_asdata->ptr_first, "AUTHORONLY")) { + else if (elstack_is_descendant_of(ptr_asdata->ptr_first, "AUTHORONLY")) { strcpy(column_name, concat_elnames(ptr_asdata->ptr_first, "AUTHORONLY", concat)); strcpy(pubtype, "AUTHORONLY"); @@ -695,13 +695,13 @@ strcmp((ptr_asdata->ptr_first)->elname, "SECONDSEP") == 0) { strcpy(table_name, "REFSTYLE"); - if (is_descendant_of(ptr_asdata->ptr_first, "PUBTYPE")) { + if (elstack_is_descendant_of(ptr_asdata->ptr_first, "PUBTYPE")) { strcpy(column_name, concat_elnames(ptr_asdata->ptr_first, "PUBTYPE", concat)); - strcpy(pubtype, get_ancestor_attr(ptr_asdata->ptr_first, "PUBTYPE", "TYPE")); + strcpy(pubtype, elstack_get_ancestor_attr(ptr_asdata->ptr_first, "PUBTYPE", "TYPE")); } - else if (is_descendant_of(ptr_asdata->ptr_first, "INTEXTDEF")) { + else if (elstack_is_descendant_of(ptr_asdata->ptr_first, "INTEXTDEF")) { strcpy(column_name, concat_elnames(ptr_asdata->ptr_first, "INTEXTDEF", concat)); strcpy(pubtype, "INTEXT"); } - else if (is_descendant_of(ptr_asdata->ptr_first, "AUTHORONLY")) { + else if (elstack_is_descendant_of(ptr_asdata->ptr_first, "AUTHORONLY")) { strcpy(column_name, concat_elnames(ptr_asdata->ptr_first, "AUTHORONLY", concat)); strcpy(pubtype, "AUTHORONLY"); @@ -739,13 +739,13 @@ strcmp((ptr_asdata->ptr_first)->elname, "VOLUME") == 0) { strcpy(table_name, "REFSTYLE"); - if (is_descendant_of(ptr_asdata->ptr_first, "PUBTYPE")) { + if (elstack_is_descendant_of(ptr_asdata->ptr_first, "PUBTYPE")) { strcpy(column_name, concat_elnames(ptr_asdata->ptr_first, "PUBTYPE", concat)); - strcpy(pubtype, get_ancestor_attr(ptr_asdata->ptr_first, "PUBTYPE", "TYPE")); + strcpy(pubtype, elstack_get_ancestor_attr(ptr_asdata->ptr_first, "PUBTYPE", "TYPE")); } - else if (is_descendant_of(ptr_asdata->ptr_first, "INTEXTDEF")) { + else if (elstack_is_descendant_of(ptr_asdata->ptr_first, "INTEXTDEF")) { strcpy(column_name, concat_elnames(ptr_asdata->ptr_first, "INTEXTDEF", concat)); strcpy(pubtype, "INTEXT"); } - else if (is_descendant_of(ptr_asdata->ptr_first, "AUTHORONLY")) { + else if (elstack_is_descendant_of(ptr_asdata->ptr_first, "AUTHORONLY")) { strcpy(column_name, concat_elnames(ptr_asdata->ptr_first, "AUTHORONLY", concat)); strcpy(pubtype, "AUTHORONLY"); @@ -940,95 +940,4 @@ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - get_ancestor_attr(): returns the value of an attribute of an - ancestor of the current element - - static char* get_ancestor_attr returns the value of the requested attribute - or NULL if no such attribute is found - - struct elstack* ptr_current_element ptr to the current element on - the element stack - - char* ancestor_name name of the requested ancestor element - - char* ancestor_attribute name of the requested ancestor attribute - - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -static char* get_ancestor_attr(struct elstack* ptr_current_element, char* ancestor_name, char* ancestor_attribute) { - struct elstack* ptr_el; - struct attrlist* ptr_attr; - - ptr_el = ptr_current_element; - - while (ptr_el != NULL) { - if (strcmp(ptr_el->elname, ancestor_name) == 0) { - ptr_attr = ptr_el->ptr_attr_first; - - while (ptr_attr != NULL) { - if (strcmp(ptr_attr->attribute_name, ancestor_attribute) == 0) { - return ptr_attr->attribute_value; - } - ptr_attr = ptr_attr->ptr_next; - } - } - ptr_el = ptr_el->ptr_next; - } - return NULL; -} - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - get_attr(): returns the value of an attribute of the current element - - char* get_attr returns the value of the requested attribute - or NULL if no such attribute is found - - struct elstack* ptr_current_element ptr to the current element on - the element stack - - char* attribute name of the requested attribute - - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -char* get_attr(struct elstack* ptr_current_element, char* attribute) { - struct attrlist* ptr_attr; - - ptr_attr = ptr_current_element->ptr_attr_first; - - while (ptr_attr != NULL) { - if (strcmp(ptr_attr->attribute_name, attribute) == 0) { - return ptr_attr->attribute_value; - } - ptr_attr = ptr_attr->ptr_next; - } - - return NULL; -} - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - is_descendant_of(): tests whether the current element is the - descendant of a given element - - int is_descendant_of returns 1 if the current element is the - descendant of the given element, 0 if not - - struct elstack* ptr_current_element ptr to the current element on - the element stack - - char* ancestor_name name of the requested ancestor element - - ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -int is_descendant_of(struct elstack* ptr_current_element, char* ancestor_name) { - struct elstack* ptr_el; - - ptr_el = ptr_current_element; - - while (ptr_el != NULL) { - if (strcmp(ptr_el->elname, ancestor_name) == 0) { - return 1; - } - ptr_el = ptr_el->ptr_next; - } - return 0; -} - -/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ concat_elnames(): concatenates the names of all ancestors of the current element up to a given element which is not @@ -1074,5 +983,5 @@ /* we use short versions of these element names in order not to exceed the column name limit of PostgreSQL */ - ptr_attr = get_ancestor_attr(ptr_el, "AUTHORLIST", "ROLE"); + ptr_attr = elstack_get_ancestor_attr(ptr_el, "AUTHORLIST", "ROLE"); if (strcmp(ptr_attr, "PRIMARY") == 0) { strcpy(concat, "Q"); /* AUTHORLIST */ @@ -1089,5 +998,5 @@ } else if (strcmp(ptr_el->elname, "PUBDATE") == 0) { - ptr_attr = get_ancestor_attr(ptr_el, "PUBDATE", "ROLE"); + ptr_attr = elstack_get_ancestor_attr(ptr_el, "PUBDATE", "ROLE"); if (strcmp(ptr_attr, "PRIMARY") == 0) { strcpy(concat, "PUBDATE"); @@ -1101,5 +1010,5 @@ } else if (strcmp(ptr_el->elname, "TITLE") == 0) { - ptr_attr = get_ancestor_attr(ptr_el, "TITLE", "ROLE"); + ptr_attr = elstack_get_ancestor_attr(ptr_el, "TITLE", "ROLE"); if (strcmp(ptr_attr, "PRIMARY") == 0) { strcpy(concat, "TITLE"); @@ -1116,5 +1025,5 @@ } else if (strcmp(ptr_el->elname, "USERDEF") == 0) { - ptr_attr = get_ancestor_attr(ptr_el, "USERDEF", "ROLE"); + ptr_attr = elstack_get_ancestor_attr(ptr_el, "USERDEF", "ROLE"); if (strcmp(ptr_attr, "1") == 0) { strcpy(concat, "USERDEF1"); @@ -1134,5 +1043,5 @@ } else if (strcmp(ptr_el->elname, "MISC") == 0) { - ptr_attr = get_ancestor_attr(ptr_el, "MISC", "ROLE"); + ptr_attr = elstack_get_ancestor_attr(ptr_el, "MISC", "ROLE"); if (strcmp(ptr_attr, "1") == 0) { strcpy(concat, "MISC1"); @@ -1146,5 +1055,5 @@ } else if (strcmp(ptr_el->elname, "LINK") == 0) { - ptr_attr = get_ancestor_attr(ptr_el, "LINK", "ROLE"); + ptr_attr = elstack_get_ancestor_attr(ptr_el, "LINK", "ROLE"); if (strcmp(ptr_attr, "1") == 0) { strcpy(concat, "LINK1"); |
From: Markus H. <mho...@us...> - 2004-05-17 23:54:11
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4423 Modified Files: xmlhandler.h Log Message: moved elstack functions to elstack.c and elstack.h Index: xmlhandler.h =================================================================== RCS file: /cvsroot/refdb/refdb/src/xmlhandler.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -U2 -r1.6 -r1.7 --- xmlhandler.h 9 Nov 2003 00:56:30 -0000 1.6 +++ xmlhandler.h 17 May 2004 23:54:01 -0000 1.7 @@ -20,33 +20,4 @@ ++++++++++++++++++++++++*/ -#define ELNAME_LENGTH 64 /* max length of an XML element name */ -#define ELVALUE_LENGTH 256 /* max/initial length of an XML element value */ -#define EL_LENGTH 512 /* ELNAME plus ELVALUE plus a little slack */ - -/* the current implementation can do without resizable name/value variables which saves a few malloc()/realloc() calls in favour of speed */ -struct attrlist { - char attribute_name[ELNAME_LENGTH]; - char attribute_value[ELVALUE_LENGTH]; - struct attrlist *ptr_next; -}; - -/* element names are ok with fixed size. element values may be treated - as resizable */ -struct elstack { - char elname[ELNAME_LENGTH]; - char *ptr_elvalue; - size_t n_elvalue_len; - struct attrlist *ptr_attr_first; - struct elstack *ptr_next; -}; - -/* this struct defines a simple stack for elements without a length limit for the value and with just one attribute of variable length. */ -struct simple_elstack { - char elname[ELNAME_LENGTH]; - char* elvalue; - char* attrvalue; - struct simple_elstack *ptr_snext; -}; - struct getbib_data { char* ptr_default_db; @@ -86,8 +57,4 @@ void delete_list(struct elstack* ptr_current_element); -char* get_attr(struct elstack* ptr_current_element, char* attribute); - -int is_descendant_of(struct elstack* ptr_current_element, char* ancestor_name); - void id_start_handler(void *ptr_data, const char *el, const char **ptr_attr); |
From: Markus H. <mho...@us...> - 2004-05-17 23:52:26
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4146 Modified Files: strfncs.c Log Message: fixed ampersand quoting Index: strfncs.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/strfncs.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -U2 -r1.15 -r1.16 --- strfncs.c 29 Apr 2004 00:08:08 -0000 1.15 +++ strfncs.c 17 May 2004 23:52:14 -0000 1.16 @@ -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-17 23:50:10
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3548 Modified Files: risxhandler.c Log Message: use elstack function prefix Index: risxhandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/risxhandler.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -U2 -r1.28 -r1.29 --- risxhandler.c 16 Feb 2004 21:38:06 -0000 1.28 +++ risxhandler.c 17 May 2004 23:50:00 -0000 1.29 @@ -41,4 +41,5 @@ #include "refdbd.h" /* depends on backend.h */ #include "risdb.h" +#include "elstack.h" #include "xmlhandler.h" #include "risxhandler.h" @@ -711,9 +712,9 @@ result = 0; - if (is_descendant_of(ptr_ardata->ptr_first, "part")) { + if (elstack_is_descendant_of(ptr_ardata->ptr_first, "part")) { result = set_risdata_field(ptr_ardata->ptr_risdata, "title", (ptr_ardata->ptr_first)->ptr_elvalue, ptr_ardata->driver); } - else if (is_descendant_of(ptr_ardata->ptr_first, "publication")) { - title_type = get_attr(ptr_ardata->ptr_first, "type"); + else if (elstack_is_descendant_of(ptr_ardata->ptr_first, "publication")) { + title_type = elstack_get_attr(ptr_ardata->ptr_first, "type"); if (title_type && !strcmp(title_type, "full")) { if (((ptr_ardata->perinfo).full = strdup((ptr_ardata->ptr_first)->ptr_elvalue)) == NULL || dbi_driver_quote_string(ptr_ardata->driver, &((ptr_ardata->perinfo).full)) == -1) { @@ -742,5 +743,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 +756,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 +769,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 +779,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 */ @@ -816,5 +824,5 @@ /* role attribute, function checks for NULL value */ - set_authorinfo_role(ptr_ardata->ptr_ainfo, get_attr(ptr_ardata->ptr_first, "role")); + set_authorinfo_role(ptr_ardata->ptr_ainfo, elstack_get_attr(ptr_ardata->ptr_first, "role")); /* first check whether role is given explicitly */ @@ -834,5 +842,5 @@ /* now guess author type by occurrence */ - else if (is_descendant_of(ptr_ardata->ptr_first, "part")) { + else if (elstack_is_descendant_of(ptr_ardata->ptr_first, "part")) { result = insert_author(ptr_ardata->ptr_ainfo, 1 /*primary author*/, ptr_ardata->authorpos, ptr_ardata->n_refdb_id, ptr_ardata->conn, ptr_ardata->driver, ptr_ardata->drivername); if (!ptr_ardata->authorpos) { @@ -841,5 +849,5 @@ } } - else if (is_descendant_of(ptr_ardata->ptr_first, "publication")) { + else if (elstack_is_descendant_of(ptr_ardata->ptr_first, "publication")) { if (!strcmp(ptr_ardata->type, "ADVS") || !strcmp(ptr_ardata->type, "ART") @@ -968,5 +976,5 @@ if (*(ptr_ardata->year) || *(ptr_ardata->month) || *(ptr_ardata->day) || *(ptr_ardata->otherinfo)) { - pubtype = get_attr(ptr_ardata->ptr_first, "type"); + pubtype = elstack_get_attr(ptr_ardata->ptr_first, "type"); if (pubtype && !strcmp(pubtype, "secondary")) { ndate_type = 1; @@ -999,5 +1007,5 @@ /* ------------------------------------------------------------ */ else if (!strcmp(el, "date")) { - if (is_descendant_of(ptr_ardata->ptr_first, "reprint")) { + if (elstack_is_descendant_of(ptr_ardata->ptr_first, "reprint")) { sprintf(ptr_ardata->date_buffer, "%s-%s-%s", ptr_ardata->year, ptr_ardata->month, ptr_ardata->day); } @@ -1209,5 +1217,5 @@ char tofield[6] = "user1"; - type = get_attr(ptr_ardata->ptr_first, "type"); + type = elstack_get_attr(ptr_ardata->ptr_first, "type"); if (type) { @@ -1249,5 +1257,5 @@ char tofield[6] = "misc1"; - type = get_attr(ptr_ardata->ptr_first, "type"); + type = elstack_get_attr(ptr_ardata->ptr_first, "type"); if (type) { @@ -1283,5 +1291,5 @@ char tofield[9] = "linkpdf"; - type = get_attr(ptr_ardata->ptr_first, "type"); + type = elstack_get_attr(ptr_ardata->ptr_first, "type"); if (type) { @@ -1350,5 +1358,5 @@ /* check whether we have a full string or one that relies on pdfroot */ - type = get_attr(ptr_ardata->ptr_first, "type"); + type = elstack_get_attr(ptr_ardata->ptr_first, "type"); if (type && !strcmp(type, "useroot")) { @@ -1407,5 +1415,5 @@ /* find out reprint type */ - rptype = get_attr(ptr_ardata->ptr_first, "status"); + rptype = elstack_get_attr(ptr_ardata->ptr_first, "status"); if (!rptype || !strcmp(rptype, "NOTINFILE")) { n_rptype = 1; /* not in file */ |
From: Markus H. <mho...@us...> - 2004-05-17 23:47:05
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3085 Modified Files: risxhandler.h Log Message: added n_dbtype Index: risxhandler.h =================================================================== RCS file: /cvsroot/refdb/refdb/src/risxhandler.h,v retrieving revision 1.10 retrieving revision 1.11 diff -u -U2 -r1.10 -r1.11 --- risxhandler.h 15 Feb 2004 23:38:30 -0000 1.10 +++ risxhandler.h 17 May 2004 23:46:54 -0000 1.11 @@ -50,4 +50,5 @@ int replace_ref; /* if != 0, existing reference is to be replaced */ int create_new; /* if 1, dataset is a new one */ + int n_dbtype; /* type of database */ size_t msgpool_len; unsigned long long n_refdb_id; /* database id of dataset */ |
From: Markus H. <mho...@us...> - 2004-05-17 23:44:07
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2517 Modified Files: risdb.c Log Message: ignore empty tag lines; fix PY vs Y2 bug in citation keys Index: risdb.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/risdb.c,v retrieving revision 1.44 retrieving revision 1.45 diff -u -U2 -r1.44 -r1.45 --- risdb.c 29 Apr 2004 22:41:57 -0000 1.44 +++ risdb.c 17 May 2004 23:43:57 -0000 1.45 @@ -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-17 23:41:20
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1817 Modified Files: refdbdref.c Log Message: addref(): added support for mods data Index: refdbdref.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdref.c,v retrieving revision 1.65 retrieving revision 1.66 diff -u -U2 -r1.65 -r1.66 --- refdbdref.c 15 Feb 2004 23:41:27 -0000 1.65 +++ refdbdref.c 17 May 2004 23:41:08 -0000 1.66 @@ -43,6 +43,10 @@ #include "xmlhandler.h" #include "risxhandler.h" +#include "mods_objects.h" +#include "mods_handler.h" #include "authorinfo.h" #include "risdata.h" +#include "mods_processdata.h" + /* some globals */ @@ -128,4 +132,5 @@ int numbyte; int error; + int n_dbtype; time_t the_time; @@ -146,9 +151,26 @@ } + /* get the database type */ + n_dbtype = my_dbi_conn_get_dbtype(conn); + + if (!n_dbtype) { + iwrite(ptr_clrequest->fd, connerr.text, connerr.length); + LOG_PRINT(LOG_ERR, connerr.text); + dbi_conn_close(conn); + free(return_msg); + return 0; + } + driver = dbi_conn_get_driver(conn); db_encoding = dbi_conn_get_encoding(conn); - dbires = dbi_conn_query(conn, "SELECT COUNT(*), MAX(refdb_id) FROM t_refdb WHERE refdb_type!='DUMMY'"); + if (n_dbtype == RISX) { + dbires = dbi_conn_query(conn, "SELECT COUNT(*), MAX(refdb_id) FROM t_refdb WHERE refdb_type!='DUMMY'"); + } + else { + dbires = dbi_conn_query(conn, "SELECT COUNT(*), MAX(mods_id) FROM t_mods"); + } + if (!dbires) { tiwrite(ptr_clrequest->fd, "cannot get row count\n", TERM_NO); @@ -273,5 +295,5 @@ int n_keep_id if 1, any existing reference ID will be saved in U5 - const char* reftype ptr to string with reference type (ris|risx) + const char* reftype ptr to string with reference type (ris|risx|mods) Lilid* ptr_sentinel ptr to linked list that will receive all @@ -289,4 +311,6 @@ unsigned long long ullresult; /* result value of processing a RIS set */ int success = 1; /* be optimistic */ + int n_is_xml = 0; /* 1 for risx and mods, 0 for ris */ + int n_dbtype; char *the_user; /* name (either set_owner or username) */ char *return_msg; /* string to hold a return message for the client */ @@ -295,6 +319,8 @@ char old_db[DBNAME_LENGTH+1]; struct addrisx_data ardata; + struct addmods_data amdata; struct lilimem sentinel; struct DELRESULT delresult; + iconv_t* ptr_conv_descriptor; /* this is a pointer to a pointer */ sentinel.ptr_mem = NULL; @@ -309,4 +335,10 @@ ardata.msgpool = NULL; ardata.ptr_ainfo = NULL; + amdata.msgpool = NULL; + + /* ris is the only non-xml type */ + if (strcmp(reftype, "ris")) { + n_is_xml = 1; + } /* if set_owner is set, use it, otherwise use username as owner */ @@ -340,12 +372,34 @@ } + /* get the database type */ + n_dbtype = my_dbi_conn_get_dbtype(conn); + + if (!n_dbtype) { + if (ptr_clrequest->n_cgi) { + iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); + } + iwrite(ptr_clrequest->fd, connerr.text, connerr.length); + delete_all_lilimem(&sentinel); + LOG_PRINT(LOG_ERR, connerr.text); + return 0; + } + /* get the database encoding */ db_encoding = dbi_conn_get_encoding(conn); /* if we need to convert, create a conversion descriptor for iconv() */ - if (db_encoding && strcmp(db_encoding, !strcmp(reftype, "risx") ? "UTF-8" : input_encoding)) { - ardata.conv_descriptor = iconv_open(!strcmp(db_encoding, "US-ASCII") ? "ASCII" : db_encoding, !strcmp(reftype, "risx") ? "UTF-8" : input_encoding); - if (ardata.conv_descriptor == (iconv_t)(-1)) { - ardata.conv_descriptor = NULL; + if (!strcmp(reftype, "mods")) { + ptr_conv_descriptor = &(amdata.conv_descriptor); + amdata.n_dbtype = n_dbtype; + } + else { + ptr_conv_descriptor = &(ardata.conv_descriptor); + ardata.n_dbtype = n_dbtype; + } + + if (db_encoding && strcmp(db_encoding, n_is_xml ? "UTF-8" : input_encoding)) { + *ptr_conv_descriptor = iconv_open(!strcmp(db_encoding, "US-ASCII") ? "ASCII" : db_encoding, n_is_xml ? "UTF-8" : input_encoding); + if (*ptr_conv_descriptor == (iconv_t)(-1)) { + *ptr_conv_descriptor = NULL; LOG_PRINT(LOG_WARNING, "cannot set conversion descriptor (input/database):"); LOG_PRINT(LOG_DEBUG, input_encoding); @@ -354,9 +408,9 @@ else { LOG_PRINT(LOG_DEBUG, "input encoding is:"); - LOG_PRINT(LOG_DEBUG, input_encoding); + LOG_PRINT(LOG_DEBUG, n_is_xml ? "UTF-8" : input_encoding); } } else { - ardata.conv_descriptor = NULL; + *ptr_conv_descriptor = NULL; LOG_PRINT(LOG_DEBUG, "no character encoding conversion required"); } @@ -378,6 +432,6 @@ dbi_conn_close(conn); delete_all_lilimem(&sentinel); - if (ardata.conv_descriptor) { - iconv_close(ardata.conv_descriptor); + if (*ptr_conv_descriptor) { + iconv_close(*ptr_conv_descriptor); } LOG_PRINT(LOG_ERR, connerr.text); @@ -495,4 +549,100 @@ } /* end while */ } + else if (!strcmp(reftype, "mods")) { + + while (1) { /* leave with break */ + /* create the parser instance */ + p = XML_ParserCreate(NULL); + if (!p) { + LOG_PRINT(LOG_WARNING, outomem.text); + iwrite(ptr_clrequest->fd, outomem_n.text, outomem_n.length); + success = 0; + goto Finish; + } + + /* initialize "global" handler data */ + amdata.msgpool_len = 512; + amdata.msgpool = (char*)malloc(amdata.msgpool_len); + if (!amdata.msgpool || insert_lilimem(&sentinel, (void**)&(amdata.msgpool), NULL)) { + LOG_PRINT(LOG_WARNING, outomem.text); + iwrite(ptr_clrequest->fd, outomem_n.text, outomem_n.length); + success = 0; + goto Finish; + } + + *(amdata.msgpool) = '\0'; + *(amdata.mods_xmlid) = '\0'; + *(amdata.type) = '\0'; + *(amdata.mods_version) = '\0'; + amdata.ptr_clrequest = ptr_clrequest; + amdata.ptr_id_sentinel = ptr_sentinel; + amdata.ptr_first = NULL; + init_lilimodsobject_entry(&(amdata.modsobj_sentinel)); + amdata.nmem_error = 0; + amdata.ndb_error = 0; + amdata.n_skip = 0; + amdata.depth = 0; + amdata.depth_adjust = 0; + amdata.set_count = 0; + amdata.added_count = 0; + amdata.skipped_count = 0; + amdata.updated_count = 0; + amdata.failed_count = 0; + amdata.position = 0; + amdata.replace_ref = replace_ref; + amdata.create_new = 1; + amdata.n_user_id = 0; + amdata.conn = conn; + amdata.conn_refdb = conn_refdb; + amdata.driver = dbi_conn_get_driver(conn); + amdata.drivername = dbi_driver_get_name(amdata.driver); + + /* register our handlers. these handlers will be called whenever expat finds a start- or endtag or character data */ + XML_SetElementHandler(p, mods_start_handler, mods_end_handler); + XML_SetCharacterDataHandler(p, mods_char_handler); + + /* make pointer to "global data" available for handlers */ + XML_SetUserData(p, (void*)&amdata); + + numbyte = tiwrite(ptr_clrequest->fd, positive.text, TERM_YES); + if (numbyte == -1) { + LOG_PRINT(LOG_INFO, "timeout while writing"); + success = 0; + goto Finish; + } + + ullresult = read_xml(ptr_clrequest->fd, p, ptr_addresult); + XML_ParserFree(p); + + /* do something intelligent in the case of a parse or mem error */ + if (!ullresult || amdata.ndb_error || amdata.nmem_error) { + /* free allocated objects */ + delete_all_lilimodsobject(&(amdata.modsobj_sentinel)); + goto Finish; + } + + if (amdata.msgpool && *(amdata.msgpool)) { + /* send messages to client */ + numbyte = tiwrite(ptr_clrequest->fd, amdata.msgpool, TERM_NO); + if (numbyte == -1) { + LOG_PRINT(LOG_INFO, "timeout while writing"); + success = 0; + goto Finish; + } + } + + ptr_addresult->success += amdata.added_count; + ptr_addresult->failure += amdata.failed_count; + ptr_addresult->updated += amdata.updated_count; + ptr_addresult->skipped += amdata.skipped_count; + if (!ullresult) { /* error */ + success = 0; + goto Finish; + } + else if (ullresult == -1) { /* we're done */ + break; + } + } /* end while */ + } else { /* ris */ numbyte = tiwrite(ptr_clrequest->fd, positive.text, TERM_YES); @@ -517,8 +667,10 @@ dbi_conn_close(conn); delete_all_lilimem(&sentinel); - free_authorinfo(ardata.ptr_ainfo); + if (ardata.ptr_ainfo) { + free_authorinfo(ardata.ptr_ainfo); + } - if (ardata.conv_descriptor) { - iconv_close(ardata.conv_descriptor); + if (*ptr_conv_descriptor) { + iconv_close(*ptr_conv_descriptor); } |
From: Markus H. <mho...@us...> - 2004-05-17 23:37:51
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1128 Modified Files: refdbdbib.c Log Message: minor quoting and free() fixes Index: refdbdbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdbib.c,v retrieving revision 1.36 retrieving revision 1.37 diff -u -U2 -r1.36 -r1.37 --- refdbdbib.c 15 Feb 2004 23:00:02 -0000 1.36 +++ refdbdbib.c 17 May 2004 23:37:42 -0000 1.37 @@ -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-17 23:35:23
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv611 Modified Files: refdbda.c Log Message: added support for mods database type Index: refdbda.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbda.c,v retrieving revision 1.41 retrieving revision 1.42 diff -u -U2 -r1.41 -r1.42 --- refdbda.c 4 Feb 2004 21:07:21 -0000 1.41 +++ refdbda.c 17 May 2004 23:35:10 -0000 1.42 @@ -533,4 +533,5 @@ char* html_foot; const char* dbname; + int n_dbtype; dbi_conn conn; dbi_result dbires; @@ -610,9 +611,19 @@ dbname = dbi_result_get_string_idx(dbires, 1); if (dbname) { - if (is_reference_database(ptr_clrequest, NULL, dbname)) { + n_dbtype = is_reference_database(ptr_clrequest, NULL, dbname); + if (n_dbtype) { if (ptr_clrequest->n_cgi) { tiwrite(ptr_clrequest->fd, "<tr><td class=\"result\"><input type=\"radio\" name=\"selectdb\" value=\"", TERM_NO); } + tiwrite(ptr_clrequest->fd, dbname, TERM_NO); + + if (n_dbtype == 1) { + tiwrite(ptr_clrequest->fd, " (risx)", TERM_NO); + } + else { + tiwrite(ptr_clrequest->fd, " (mods)", TERM_NO); + } + if (ptr_clrequest->n_cgi) { tiwrite(ptr_clrequest->fd, "\">", TERM_NO); @@ -641,6 +652,7 @@ reference database - int is_reference_database returns 1 if the database is a RefDB database, - 0 if not + int is_reference_database returns 1 if the database is a risx database, + 2 if the database is a mods database, + 0 if it is no RefDB database struct CLIENT_REQUEST* ptr_clrequest ptr to structure with client info @@ -690,5 +702,10 @@ if (!strcmp(app, "refdb")) { - retval = 1; + if (!strcmp(type, "risx")) { + retval = 1; + } + else if (!strcmp(type, "mods")) { + retval = 2; + } } @@ -840,6 +857,8 @@ const char* db_encoding name of the character encoding to use + int db_format format of new database (RISX|MODS) + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -int createdb(struct CLIENT_REQUEST* ptr_clrequest, const char* dbname, const char* db_encoding) { +int createdb(struct CLIENT_REQUEST* ptr_clrequest, const char* dbname, const char* db_encoding, int db_format) { dbi_conn conn; dbi_result dbires; @@ -912,10 +931,21 @@ } /* if (!strcmp(drivername, "mysql")) { */ - if (create_tables_mysql(conn, ptr_clrequest)) { - /* function provides message to client */ - dbi_conn_close(conn); - free(sql_command); - LOG_PRINT(LOG_ERR, "create tables failed"); - return 0; + if (db_format == MODS) { + if (create_modstables_mysql(conn, ptr_clrequest)) { + /* function provides message to client */ + dbi_conn_close(conn); + free(sql_command); + LOG_PRINT(LOG_ERR, "create MySQL mods tables failed"); + return 0; + } + } + else { + if (create_tables_mysql(conn, ptr_clrequest)) { + /* function provides message to client */ + dbi_conn_close(conn); + free(sql_command); + LOG_PRINT(LOG_ERR, "create MySQL risx tables failed"); + return 0; + } } } @@ -932,19 +962,41 @@ if (!strcmp(drivername, "pgsql")) { - if (create_tables_pgsql(conn, ptr_clrequest)) { - /* function provides message to client */ - dbi_conn_close(conn); - LOG_PRINT(LOG_ERR, "create tables failed"); - free(sql_command); - return 0; + if (db_format == MODS) { + if (create_modstables_pgsql(conn, ptr_clrequest)) { + /* function provides message to client */ + dbi_conn_close(conn); + LOG_PRINT(LOG_ERR, "create PostgreSQL mods tables failed"); + free(sql_command); + return 0; + } + } + else { + if (create_tables_pgsql(conn, ptr_clrequest)) { + /* function provides message to client */ + dbi_conn_close(conn); + LOG_PRINT(LOG_ERR, "create PostgreSQL risx tables failed"); + free(sql_command); + return 0; + } } } else if (!strcmp(drivername, "sqlite")) { - if (create_tables_sqlite(conn, ptr_clrequest)) { - /* function provides message to client */ - dbi_conn_close(conn); - LOG_PRINT(LOG_ERR, "create tables failed"); - free(sql_command); - return 0; + if (db_format == MODS) { + if (create_modstables_sqlite(conn, ptr_clrequest)) { + /* function provides message to client */ + dbi_conn_close(conn); + LOG_PRINT(LOG_ERR, "create SQLite mods tables failed"); + free(sql_command); + return 0; + } + } + else { + if (create_tables_sqlite(conn, ptr_clrequest)) { + /* function provides message to client */ + dbi_conn_close(conn); + LOG_PRINT(LOG_ERR, "create SQLite risx tables failed"); + free(sql_command); + return 0; + } } } @@ -955,5 +1007,5 @@ time(&the_time); strftime(date_buffer, 24, "%Y-%m-%d %H:%M:%S", gmtime(&the_time)); - sprintf(sql_command, "INSERT INTO t_meta (meta_app,meta_type,meta_version,meta_create_date,meta_modify_date) VALUES (\'%s\', \'risx\', \'%s\', \'%s\', \'%s\')", PACKAGE, VERSION, date_buffer, date_buffer); + sprintf(sql_command, "INSERT INTO t_meta (meta_app,meta_type,meta_version,meta_create_date,meta_modify_date) VALUES (\'%s\', \'%s\', \'%s\', \'%s\', \'%s\')", PACKAGE, (db_format == RISX) ? "risx" : "mods", VERSION, date_buffer, date_buffer); LOG_PRINT(LOG_DEBUG, sql_command); |
From: Markus H. <mho...@us...> - 2004-05-17 23:32:51
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32471 Modified Files: refdbd.c Log Message: added support for mods format Index: refdbd.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbd.c,v retrieving revision 1.74 retrieving revision 1.75 diff -u -U2 -r1.74 -r1.75 --- refdbd.c 16 Feb 2004 21:36:11 -0000 1.74 +++ refdbd.c 17 May 2004 23:32:40 -0000 1.75 @@ -1063,4 +1063,7 @@ ref_format = XNOTE; } + else if (strcmp(optarg, "mods") == 0) { + ref_format = MODS; + } else { /* default is screen */ ref_format = REFSCREEN; @@ -1221,5 +1224,5 @@ /* loop over all filename arguments */ for (; optind < ptr_child_clrequest->inargc; optind++) { - n_success += createdb(ptr_child_clrequest, ptr_child_clrequest->inargv[optind], db_encoding); + n_success += createdb(ptr_child_clrequest, ptr_child_clrequest->inargv[optind], db_encoding, ref_format); } |
From: Markus H. <mho...@us...> - 2004-05-17 23:30:43
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31968 Modified Files: refdba.c Log Message: added db_type and db_encoding config variables;added type attribute to createdb() command Index: refdba.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdba.c,v retrieving revision 1.45 retrieving revision 1.46 diff -u -U2 -r1.45 -r1.46 --- refdba.c 1 May 2004 14:56:03 -0000 1.45 +++ refdba.c 17 May 2004 23:30:23 -0000 1.46 @@ -96,5 +96,5 @@ /*+ this array will hold the user preferences +*/ -Prefs prefs[12] = { +Prefs prefs[14] = { {"serverip", ""}, {"port", ""}, @@ -108,4 +108,6 @@ {"loglevel", ""}, {"refdblib", ""}, + {"db_type", ""}, + {"db_encoding", ""}, {"", ""} }; @@ -123,4 +125,6 @@ char log_level[PREFS_BUF_LEN] = "6"; /*+ default level up to which messages are logged (0 through 7). -1 means no logging +*/ char refdblib[PREFS_BUF_LEN] = ""; /* path to shareable files */ +char dbtype[PREFS_BUF_LEN] = "risx"; /* default database type */ +char dbencoding[PREFS_BUF_LEN] = ""; /* default database character encoding */ char confdir[_POSIX_PATH_MAX+1] = ""; /* path to the config files */ int main_argc = 0; /* save argc for commands in batch mode */ @@ -232,4 +236,6 @@ prefs[9].varvalue = log_level; prefs[10].varvalue = refdblib; + prefs[11].varvalue = dbtype; + prefs[12].varvalue = dbencoding; /* a slimy hack to detect options before we run getopt */ @@ -492,6 +498,23 @@ char outbuffer[COMMAND_INBUF_LEN] = ""; /* holds the command for the server */ char inbuffer[COMMAND_INBUF_LEN] = ""; - struct simplelistvals slvals; char scrambled_passwd[PASSWD_LENGTH*3+1] = ""; + char my_dbtype[PREFS_BUF_LEN] = ""; + char my_dbencoding[PREFS_BUF_LEN] = ""; + char *fileargs; + char *newarg; + char **inargv; /* tokens of the argument */ + int inargc = 0; /* number of tokens of the argument */ + int inargcmax; /* maximum number of tokens */ + int n_just_help = 0; + int result; + int n_opt = 0; + int n_cmdlinerror = 0; + int i; + struct simplelistvals slvals; + struct lilimem sentinel; + + sentinel.ptr_mem = NULL; + sentinel.ptr_next = NULL; + sentinel.varname[0] = '\0'; slvals.outbuffer = outbuffer; @@ -504,10 +527,111 @@ slvals.outpipe = NULL; - if (strncmp(arg, "-h", 2) == 0) { - printf("Creates new databases\nSyntax: createdb [-E encoding] [-h] {name} [name1...]\nOptions: -E set character encoding\n -h prints this mini-help\nAll other arguments are interpreted as database names\n"); - return 0; + strcpy(my_dbtype, dbtype); + strcpy(my_dbencoding, dbencoding); + + inargc = 0; + inargcmax = 10; + inargv = (char**)malloc((size_t)inargcmax*sizeof(char*)); + if (inargv == NULL) { + return 1; + } + + if (insert_lilimem(&sentinel, (void**)&inargv, "inargv")) { + return 1; + } + + /* the following is a temporary hack to allow cmdln_tokenize to work */ + newarg = (char*)malloc((size_t)(strlen(arg)+9)); + if (newarg == NULL) { + delete_all_lilimem(&sentinel); + return 1; + } + + if (insert_lilimem(&sentinel, (void**)&newarg, "newarg")) { + delete_all_lilimem(&sentinel); + return 1; + } + + strcpy(newarg, "createdb "); + strcat(newarg, arg); + + result = cmdln_tokenize(&inargc, &inargv, inargcmax, newarg); + + + if (result == 1 || result == 2) { /* memory error */ + delete_all_lilimem(&sentinel); + return 1; + } + + /* get options */ + optind = 0; + + while ((n_opt = getopt(inargc, inargv, "c:C:e:E:hi:l:L:o:O:p:qrt:T:u:vVw:")) != -1) { + switch(n_opt) { + case 'E': + strncpy(my_dbencoding, optarg, PREFS_BUF_LEN); + my_dbencoding[PREFS_BUF_LEN-1] = '\0'; + break; + case 'h': + printf("Creates new databases\nSyntax: createdb [-E encoding] [-h] [-t type] {name} [name1...]\nOptions: -E set character encoding\n -h prints this mini-help\n -t database type (risx|mods)\nAll other arguments are interpreted as database names\n"); + n_just_help++; + break; + case 't': + strncpy(my_dbtype, optarg, PREFS_BUF_LEN); + my_dbtype[PREFS_BUF_LEN-1] = '\0'; + break; + case 'c': /* fall through, has been taken care of in main() */ + case 'C': + case 'e': + case 'i': + case 'l': + case 'L': + case 'o': + case 'O': + case 'p': + case 'q': + case 'r': + case 'T': + case 'u': + case 'v': + case 'V': + case 'w': + break; + case ':': + fprintf(stderr, "missing option\n"); + n_cmdlinerror = 1; + break; + case '?': + fprintf(stderr, "unknown option\n"); + n_cmdlinerror = 1; + break; + } + } + + + /* get arguments */ +/* for (i = optind; i < inargc; i++) { */ +/* printf("argument %s\n", inargv[i]); */ +/* } */ + + if (n_cmdlinerror || n_just_help) { + delete_all_lilimem(&sentinel); + return (n_just_help) ? 0:1; + } + + fileargs = build_batchcommand(inargc, inargv, optind, "", ""); + + if (fileargs == NULL) { + delete_all_lilimem(&sentinel); + return 1; + } + + if (insert_lilimem(&sentinel, (void**)&fileargs, "fileargs")) { + delete_all_lilimem(&sentinel); + return 1; } if (connect_to_server(&slvals.n_sockfd, server_ip, port_address) != 0) { + delete_all_lilimem(&sentinel); return 1; } @@ -517,20 +641,31 @@ if (init_dialog(slvals.n_sockfd, scrambled_passwd, inbuffer)) { close(slvals.n_sockfd); + delete_all_lilimem(&sentinel); return 1; } - /* arg will contain the encoding (-E <encoding>) if specified */ - strcat(slvals.outbuffer, arg); + if (*my_dbencoding) { + strcat(slvals.outbuffer, " -E "); + strcat(slvals.outbuffer, my_dbencoding); + } + + strcat(slvals.outbuffer, " -t "); + strcat(slvals.outbuffer, my_dbtype); + strcat(slvals.outbuffer, " -u "); strcat(slvals.outbuffer, username); - if (strlen(passwd) > 0) { + if (*passwd) { strcat(slvals.outbuffer, " -w "); strcat(slvals.outbuffer, scrambled_passwd); } + strcat(slvals.outbuffer, fileargs); + getsimplelist(&slvals, 0); close(slvals.n_sockfd); + delete_all_lilimem(&sentinel); + return 0; } |
From: Markus H. <mho...@us...> - 2004-05-17 23:27:33
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31549 Modified Files: refdb-client.c Log Message: fixed batchstring code to avoid segfault Index: refdb-client.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdb-client.c,v retrieving revision 1.31 retrieving revision 1.32 diff -u -U2 -r1.31 -r1.32 --- refdb-client.c 15 Feb 2004 22:58:50 -0000 1.31 +++ refdb-client.c 17 May 2004 23:27:21 -0000 1.32 @@ -492,7 +492,7 @@ } - if (argv[optind] && argv[optind][0]) { + if (optind <= argc && argv[optind] && argv[optind][0]) { int i = optind; - while (argv[i] && argv[i][0]) { + while (i < argc && argv[i] && argv[i][0]) { if ((new_batchstring = mstrcat(batchstring, " ", &stringsize, 0)) == NULL) { free(batchstring); |
From: Markus H. <mho...@us...> - 2004-05-17 23:25:55
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31234 Modified Files: noteshandler.c Log Message: added elstack.h; use new elstack function prefix Index: noteshandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/noteshandler.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -U2 -r1.18 -r1.19 --- noteshandler.c 16 Feb 2004 21:38:05 -0000 1.18 +++ noteshandler.c 17 May 2004 23:25:45 -0000 1.19 @@ -37,4 +37,5 @@ #include "refdbd.h" #include "strfncs.h" +#include "elstack.h" #include "xmlhandler.h" #include "noteshandler.h" @@ -492,5 +493,5 @@ } else { - if (is_descendant_of(ptr_andata->ptr_first, "content")) { + if (elstack_is_descendant_of(ptr_andata->ptr_first, "content")) { char* new_notepool; char attribute_buf[EL_LENGTH]; @@ -720,6 +721,6 @@ char* target; - type = get_attr(ptr_andata->ptr_first, "type"); - target = get_attr(ptr_andata->ptr_first, "target"); + type = elstack_get_attr(ptr_andata->ptr_first, "type"); + target = elstack_get_attr(ptr_andata->ptr_first, "target"); result = insert_link(type, target, ptr_andata->conn, ptr_andata->driver, ptr_andata->n_note_id); @@ -1020,5 +1021,5 @@ } else { - if (is_descendant_of(ptr_andata->ptr_first, "content")) { + if (elstack_is_descendant_of(ptr_andata->ptr_first, "content")) { char* new_notepool; new_notepool = mstrcat(ptr_andata->notepool, (ptr_andata->ptr_first)->ptr_elvalue, &(ptr_andata->notepool_len), 0); |
From: Markus H. <mho...@us...> - 2004-05-17 23:23:43
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30769 Modified Files: dbfncs.h dbfncs.c Log Message: added function my_dbi_conn_get_dbtype() Index: dbfncs.h =================================================================== RCS file: /cvsroot/refdb/refdb/src/dbfncs.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -U2 -r1.6 -r1.7 --- dbfncs.h 25 Oct 2003 23:50:51 -0000 1.6 +++ dbfncs.h 17 May 2004 23:23:34 -0000 1.7 @@ -58,4 +58,5 @@ unsigned long long my_dbi_result_get_idval_idx(dbi_result dbires, unsigned long long idx); int my_dbi_conn_get_versioninfo(dbi_conn conn, struct VERSIONINFO* ptr_ver); +int my_dbi_conn_get_dbtype(dbi_conn conn); Index: dbfncs.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/dbfncs.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -U2 -r1.15 -r1.16 --- dbfncs.c 29 Jan 2004 01:42:11 -0000 1.15 +++ dbfncs.c 17 May 2004 23:23:34 -0000 1.16 @@ -1745,4 +1745,41 @@ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + my_dbi_conn_get_dbtype(): retrieves the type of a database + + int my_dbi_conn_get_dbtype returns 0 on error + RISX if risx database + MODS if mods database + + dbi_conn conn connection to a database engine + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ +int my_dbi_conn_get_dbtype(dbi_conn conn) { + char sql_command[] = "SELECT meta_type FROM t_meta"; + const char* type = NULL; + int n_retval = 0; + dbi_result dbires; + + dbires = dbi_conn_query(conn, sql_command); + LOG_PRINT(LOG_DEBUG, sql_command); + if (dbires) { + if (dbi_result_next_row(dbires)) { + type = dbi_result_get_string_idx(dbires, 1); /* 1-base index */ + } + dbi_result_free(dbires); + } + + if (type && *type) { + if (!strcmp(type, "risx")) { + n_retval = RISX; + } + else if (!strcmp(type, "mods")) { + n_retval = MODS; + } + } + + return n_retval; +} + +/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ set_cap_versioninfo(): sets version-specific info in dbcaps structure |
From: Markus H. <mho...@us...> - 2004-05-17 23:21:37
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30019 Modified Files: backend.h Log Message: added definition MODS Index: backend.h =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend.h,v retrieving revision 1.23 retrieving revision 1.24 diff -u -U2 -r1.23 -r1.24 --- backend.h 1 May 2004 23:40:13 -0000 1.23 +++ backend.h 17 May 2004 23:21:27 -0000 1.24 @@ -85,4 +85,5 @@ #define REFXHTML 11 #define XNOTE 12 +#define MODS 13 /* note types */ |
From: Markus H. <mho...@us...> - 2004-05-17 23:20:11
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29500 Modified Files: backend-dbiba.c Log Message: removed extraneous sgml_entitize() call Index: backend-dbiba.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-dbiba.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -U2 -r1.26 -r1.27 --- backend-dbiba.c 29 Apr 2004 00:09:27 -0000 1.26 +++ backend-dbiba.c 17 May 2004 23:20:01 -0000 1.27 @@ -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-17 23:15:56
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28672 Modified Files: Makefile.am Log Message: added new source files to refdbd_SOURCES Index: Makefile.am =================================================================== RCS file: /cvsroot/refdb/refdb/src/Makefile.am,v retrieving revision 1.21 retrieving revision 1.22 diff -u -U2 -r1.21 -r1.22 --- Makefile.am 25 Jan 2004 19:34:27 -0000 1.21 +++ Makefile.am 17 May 2004 23:15:46 -0000 1.22 @@ -18,5 +18,5 @@ refdbc_SOURCES = refdbc.c pref.c strfncs.c readln.c page.c refdb-client.c client-commands.c readris.c connect.c tokenize.c getopt.c linklist.c enigma.c cgi.c atoll.c refdb.h refdbc.h pref.h strfncs.h readln.h page.h refdb-client.h client-commands.h readris.h connect.h tokenize.h getopt.h linklist.h enigma.h cgi.h -refdbd_SOURCES = refdbd.c refdbdref.c refdbda.c refdbdbib.c pref.c strfncs.c tokenize.c connect.c risdb.c writeris.c getopt.c readris.c backend.c backend-scrn.c backend-ris.c backend-risx.c backend-db31.c backend-teix.c backend-bibtex.c backend-html.c backend-dbib.c backend-dbiba.c linklist.c xmlhandler.c enigma.c cgi.c atoll.c dbfncs.c xmlout.c risxhandler.c authorinfo.c risdata.c noteshandler.c refdbdnote.c writenote.c backendn-scrn.c backendn-notex.c backendn-html.c xmlhelper.c refdb.h refdbd.h pref.h strfncs.h tokenize.h connect.h risdb.h writeris.h getopt.h readris.h backend.h backend-scrn.h backend-ris.h backend-risx.h backend-db31.h backend-teix.h backend-bibtex.h backend-html.h backend-dbib.h linklist.h xmlhandler.h enigma.h cgi.h dbfncs.h xmlout.h risxhandler.h authorinfo.h risdata.h noteshandler.h writenote.h backendn-scrn.h backendn-notex.h xmlhelper.h backendn-html.h +refdbd_SOURCES = refdbd.c refdbdref.c refdbda.c refdbdbib.c pref.c strfncs.c tokenize.c connect.c risdb.c writeris.c getopt.c readris.c backend.c backend-scrn.c backend-ris.c backend-risx.c backend-db31.c backend-teix.c backend-bibtex.c backend-html.c backend-dbib.c backend-dbiba.c linklist.c xmlhandler.c enigma.c cgi.c atoll.c dbfncs.c xmlout.c risxhandler.c authorinfo.c risdata.c noteshandler.c refdbdnote.c writenote.c backendn-scrn.c backendn-notex.c backendn-html.c xmlhelper.c elstack.c mods_starthandler.c mods_endhandler.c mods_objects.c mods_processdata.c mods_dbfncs.c mods_helper.c refdb.h refdbd.h pref.h strfncs.h tokenize.h connect.h risdb.h writeris.h getopt.h readris.h backend.h backend-scrn.h backend-ris.h backend-risx.h backend-db31.h backend-teix.h backend-bibtex.h backend-html.h backend-dbib.h linklist.h xmlhandler.h enigma.h cgi.h dbfncs.h xmlout.h risxhandler.h authorinfo.h risdata.h noteshandler.h writenote.h backendn-scrn.h backendn-notex.h xmlhelper.h backendn-html.h elstack.h mods_handler.h mods_objects.h mods_processdata.h mods_dbfncs.h mods_helper.h refdbxp_SOURCES = refdbxp.c getopt.c strfncs.c getopt.h strfncs.h |
From: Markus H. <mho...@us...> - 2004-05-17 23:13:02
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27611 Added Files: elstack.c elstack.h mods_dbfncs.c mods_dbfncs.h mods_endhandler.c mods_handler.h mods_helper.c mods_helper.h mods_objects.c mods_objects.h mods_processdata.c mods_processdata.h mods_starthandler.c Log Message: initial version --- NEW FILE --- /* elstack.c: implements a linked list for use in expat handlers */ /* ma...@mh... 2004-01-10 */ /* $Id: elstack.c,v 1.1 2004/05/17 23:12:51 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 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ #include <stdio.h> #include "elstack.h" /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ elstack_get_attr(): returns the value of an attribute of the current element char* elstack_get_attr returns the value of the requested attribute or NULL if no such attribute is found struct elstack* ptr_current_element ptr to the current element on the element stack char* attribute name of the requested attribute ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ char* elstack_get_attr(struct elstack* ptr_current_element, char* attribute) { struct attrlist* ptr_attr; ptr_attr = ptr_current_element->ptr_attr_first; while (ptr_attr != NULL) { if (strcmp(ptr_attr->attribute_name, attribute) == 0) { return ptr_attr->attribute_value; } ptr_attr = ptr_attr->ptr_next; } return NULL; } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ elstack_get_ancestor_attr(): returns the value of an attribute of an ancestor of the current element char* elstack_get_ancestor_attr returns the value of the requested attribute or NULL if no such attribute is found struct elstack* ptr_current_element ptr to the current element on the element stack char* ancestor_name name of the requested ancestor element char* ancestor_attribute name of the requested ancestor attribute ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ char* elstack_get_ancestor_attr(struct elstack* ptr_current_element, char* ancestor_name, char* ancestor_attribute) { struct elstack* ptr_el; struct attrlist* ptr_attr; ptr_el = ptr_current_element; while (ptr_el != NULL) { if (strcmp(ptr_el->elname, ancestor_name) == 0) { ptr_attr = ptr_el->ptr_attr_first; while (ptr_attr != NULL) { if (strcmp(ptr_attr->attribute_name, ancestor_attribute) == 0) { return ptr_attr->attribute_value; } ptr_attr = ptr_attr->ptr_next; } } ptr_el = ptr_el->ptr_next; } return NULL; } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ elstack_get_parent(): returns the parent of the current element struct elstack* elstack_get_parent returns the parent of the current element or NULL if no such element is found struct elstack* ptr_current_element ptr to the current element on the element stack ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ struct elstack* elstack_get_parent(struct elstack* ptr_current_element) { return ptr_current_element->ptr_next; } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ elstack_is_descendant_of(): tests whether the current element is the descendant of a given element int elstack_is_descendant_of returns 1 if the current element is the descendant of the given element, 0 if not struct elstack* ptr_current_element ptr to the current element on the element stack char* ancestor_name name of the requested ancestor element ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ int elstack_is_descendant_of(struct elstack* ptr_current_element, char* ancestor_name) { struct elstack* ptr_el; ptr_el = ptr_current_element; while (ptr_el != NULL) { if (strcmp(ptr_el->elname, ancestor_name) == 0) { return 1; } ptr_el = ptr_el->ptr_next; } return 0; } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ modstack_get_attr(): returns the value of an attribute of the current element char* modstack_get_attr returns the value of the requested attribute or NULL if no such attribute is found struct modstack* ptr_current_element ptr to the current element on the element stack char* attribute name of the requested attribute ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ char* modstack_get_attr(struct modstack* ptr_current_element, char* attribute) { struct attrlist* ptr_attr; ptr_attr = ptr_current_element->ptr_attr_first; while (ptr_attr != NULL) { if (strcmp(ptr_attr->attribute_name, attribute) == 0) { return ptr_attr->attribute_value; } ptr_attr = ptr_attr->ptr_next; } return NULL; } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ modstack_get_parent(): returns the parent of the current element struct modstack* modstack_get_parent returns the parent of the current element or NULL if no such element is found struct modstack* ptr_current_element ptr to the current element on the element stack ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ struct modstack* modstack_get_parent(struct modstack* ptr_current_element) { return ptr_current_element->ptr_next; } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ modstack_is_descendant_of(): tests whether the current element is the descendant of a given element int modstack_is_descendant_of returns 1 if the current element is the descendant of the given element, 0 if not struct modstack* ptr_current_element ptr to the current element on the element stack char* ancestor_name name of the requested ancestor element ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ int modstack_is_descendant_of(struct modstack* ptr_current_element, char* ancestor_name) { struct modstack* ptr_el; ptr_el = ptr_current_element; while (ptr_el != NULL) { if (strcmp(ptr_el->elname, ancestor_name) == 0) { return 1; } ptr_el = ptr_el->ptr_next; } return 0; } struct modstack* new_modstack(const char* elname) { struct modstack* ptr_mods_new; ptr_mods_new = (struct modstack*)malloc(sizeof(struct modstack)); if (ptr_mods_new == NULL) { return NULL; } strncpy(ptr_mods_new->elname, elname, 63); ptr_mods_new->elname[63] = '\0'; /* terminate just in case */ ptr_mods_new->n_elvalue_len = ELVALUE_LENGTH; ptr_mods_new->ptr_elvalue = (char*)malloc(ELVALUE_LENGTH); if (ptr_mods_new->ptr_elvalue == NULL) { free(ptr_mods_new); return NULL; } *(ptr_mods_new->ptr_elvalue) = '\0'; ptr_mods_new->ptr_attr_first = NULL; ptr_mods_new->ptr_next = NULL; ptr_mods_new->ptr_modsobject = NULL; ptr_mods_new->ptr_modsdate = NULL; ptr_mods_new->position = 0; return ptr_mods_new; } --- NEW FILE --- /* elstack.h: header for elstack.c */ /* ma...@mh... 2004-01-10 */ /* $Id: elstack.h,v 1.1 2004/05/17 23:12:51 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 ELNAME_LENGTH 64 /* max length of an XML element name */ #define ELVALUE_LENGTH 256 /* max/initial length of an XML element value */ #define EL_LENGTH 512 /* ELNAME plus ELVALUE plus a little slack */ /* the current implementation can do without resizable name/value variables which saves a few malloc()/realloc() calls in favour of speed */ struct attrlist { char attribute_name[ELNAME_LENGTH]; char attribute_value[ELVALUE_LENGTH]; struct attrlist *ptr_next; }; /* element names are ok with fixed size. element values may be treated as resizable */ struct elstack { char elname[ELNAME_LENGTH]; char *ptr_elvalue; size_t n_elvalue_len; struct attrlist *ptr_attr_first; struct elstack *ptr_next; }; /* this struct defines a simple stack for elements without a length limit for the value and with just one attribute of variable length. */ struct simple_elstack { char elname[ELNAME_LENGTH]; char* elvalue; char* attrvalue; struct simple_elstack *ptr_snext; }; /* element names are ok with fixed size. element values are resizable */ struct modstack { char elname[ELNAME_LENGTH]; /* the element name */ char *ptr_elvalue; /* the element value */ size_t n_elvalue_len; /* length of element value */ unsigned int position; /* position counter used by some elements */ struct attrlist *ptr_attr_first; /* ptr to an attribute linked list */ struct modsObject* ptr_modsobject; /* ptr to a mods object, if any */ struct modsDate* ptr_modsdate; /* ptr to a mods date object, if any */ struct modstack *ptr_next; /* ptr to next entry in linked list */ }; char* elstack_get_attr(struct elstack* ptr_current_element, char* attribute); int elstack_is_descendant_of(struct elstack* ptr_current_element, char* ancestor_name); char* elstack_get_ancestor_attr(struct elstack* ptr_current_element, char* ancestor_name, char* ancestor_attribute); struct elstack* elstack_get_parent(struct elstack* ptr_current_element); int modstack_is_descendant_of(struct modstack* ptr_current_element, char* ancestor_name); struct modstack* modstack_get_parent(struct modstack* ptr_current_element); struct modstack* new_modstack(const char* elname); char* modstack_get_attr(struct modstack* ptr_current_element, char* attribute); --- NEW FILE --- /*++++++++++++++++++++ mods_dbfncs.c: refdb database-specific support functions for mods tables ma...@mh... 2004-03-21 $Id: mods_dbfncs.c,v 1.1 2004/05/17 23:12:51 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 [...2015 lines suppressed...] int my_dbi_conn_modsunlock(dbi_conn conn) { dbi_result dbires; const char *drivername; drivername = dbi_driver_get_name(dbi_conn_get_driver(conn)); if (!strcmp(drivername, "mysql")) { dbires = dbi_conn_query(conn, "UNLOCK TABLES"); LOG_PRINT(LOG_DEBUG, "UNLOCK TABLES"); if (!dbires) { return 1; } dbi_result_free(dbires); } /* else: pgsql unlocks when a transaction is finished, */ /* sqlite does not support lock/unlock */ return 0; } --- NEW FILE --- /* mods_dbfncs.h header file for mods_dbfncs.c */ /* ma...@mh... 2004-03-21 */ /* $Id: mods_dbfncs.h,v 1.1 2004/05/17 23:12:51 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 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ int create_modstables_mysql(dbi_conn conn, struct CLIENT_REQUEST* ptr_clrequest); int create_modstables_pgsql(dbi_conn conn, struct CLIENT_REQUEST* ptr_clrequest); int create_modstables_sqlite(dbi_conn conn, struct CLIENT_REQUEST* ptr_clrequest); int my_dbi_conn_modslock(dbi_conn conn); int my_dbi_conn_modslock_note(dbi_conn conn); int my_dbi_conn_modsunlock(dbi_conn conn); --- NEW FILE --- /* mods_endhandler.c: expat handler for start tags of mods records */ /* ma...@mh... 2003-12-07 */ /* $Id: mods_endhandler.c,v 1.1 2004/05/17 23:12:51 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 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ /* Overview */ /* This set of functions parses a XML file containing MODS datasets. We use expat as a non-validating XML parser. We register three handlers for start tags, character data, and end tags. The elements are pushed on a stack in the start tags handler. Each structure defining an element contains a start element of another stack for the attributes of this element. These stacks are used in the character data handler and the end tag handler to retrieve parent and ancestor elements and attributes of the current element where necessary. The attribute stack of the current element is freed in the end tag handler and the current element is popped off the stack as well. */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <expat.h> /* header of the XML parser */ #include <syslog.h> /* priority levels of log messages */ #include <iconv.h> #include <dbi/dbi.h> #include "backend.h" #include "linklist.h" #include "refdb.h" #include "refdbd.h" /* depends on backend.h */ #include "risdb.h" #include "strfncs.h" #include "connect.h" #include "dbfncs.h" #include "authorinfo.h" #include "elstack.h" #include "mods_objects.h" #include "mods_handler.h" extern int n_log_level; extern struct BSTRING connerr; extern struct BSTRING outomem; extern struct BSTRING outomem_n; /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ mods_end_handler(): handler for end tags void mods_end_handler has no return value void* ptr_data this is a ptr to "non-global" global data that all handlers share - will be cast to type struct addmods_data* const char *el ptr to a string containing the element name ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ void mods_end_handler(void *ptr_data, const char *el) { char* new_msgpool; struct modstack* ptr_el_remove; struct modstack* ptr_parent; struct attrlist* ptr_attr_remove; struct addmods_data* ptr_amdata; dbi_result dbires; ptr_amdata = (struct addmods_data*)ptr_data; /* printf("end handler found el:%s<<ndb_error:%d<< nmem_error:%d<<\n", el, ptr_amdata->ndb_error, ptr_amdata->nmem_error); */ if (ptr_amdata->n_skip) { if (!strcmp(el, "entry")) { (ptr_amdata->n_skip)--; (ptr_amdata->skipped_count)++; /* close transaction of skipped dataset, if any */ my_dbi_conn_rollback(ptr_amdata->conn); } return; } if (ptr_amdata->depth) { (ptr_amdata->depth)--; } if (!ptr_amdata->ndb_error && !ptr_amdata->nmem_error && !ptr_amdata->n_skip) { /* do a character conversion if required. expat dumps all character data as UTF-8 regardless of the input encoding */ size_t inlength; size_t outlength; char* my_elvalue = NULL; /* this ptr will be modified by iconv() */ char* my_elvalue_start = NULL; /* records initial state of my_elvalue */ const char* my_instring = NULL; /* this ptr will be modified by iconv() */ if (ptr_amdata->conv_descriptor && *((ptr_amdata->ptr_first)->ptr_elvalue)) { inlength = strlen((ptr_amdata->ptr_first)->ptr_elvalue) + 1; /* with the encodings supported by our database engines, the converted string can't be longer than the input string */ outlength = inlength; if ((my_elvalue = (char*)malloc(outlength)) == NULL) { if ((new_msgpool = mstrcat(ptr_amdata->msgpool, outomem_n.text, &(ptr_amdata->msgpool_len), 0)) == NULL) { return; } else { ptr_amdata->msgpool = new_msgpool; } (ptr_amdata->nmem_error)++; return; } /* keep start of the converted string */ my_elvalue_start = my_elvalue; /* variable will be modified by iconv, so don't use original */ my_instring = (const char*)((ptr_amdata->ptr_first)->ptr_elvalue); /* now actually do the conversion */ if (iconv(ptr_amdata->conv_descriptor, &my_instring, &inlength, &my_elvalue, &outlength) == (size_t)(-1)) { if (errno == EILSEQ) { new_msgpool = mstrcat(ptr_amdata->msgpool, "iconv: invalid input character sequence\n", &(ptr_amdata->msgpool_len), 0); LOG_PRINT(LOG_WARNING, "iconv: invalid input character sequence"); } else if (errno == E2BIG) { new_msgpool = mstrcat(ptr_amdata->msgpool, "iconv: output buffer too small\n", &(ptr_amdata->msgpool_len), 0); LOG_PRINT(LOG_WARNING, "iconv: output buffer too small"); } else if (errno == EINVAL) { new_msgpool = mstrcat(ptr_amdata->msgpool, "iconv: incomplete input character\n", &(ptr_amdata->msgpool_len), 0); LOG_PRINT(LOG_WARNING, "iconv: incomplete input character"); } if (new_msgpool == NULL) { return; } else { ptr_amdata->msgpool = new_msgpool; } (ptr_amdata->ndb_error)++; return; } /* else: conversion went ok. We free the original string and replace it with the converted copy */ if ((ptr_amdata->ptr_first)->ptr_elvalue) { free((ptr_amdata->ptr_first)->ptr_elvalue); } (ptr_amdata->ptr_first)->ptr_elvalue = my_elvalue_start; (ptr_amdata->ptr_first)->n_elvalue_len = outlength; } /* else: no conversion required */ ptr_parent = modstack_get_parent(ptr_amdata->ptr_first); if (!strcmp(el, "modsCollection")) { /* ToDo: finish the set ? */ } else if (!strcmp(el, "mods")) { /* transfer objects into database, then free */ if (mods_process_data(ptr_amdata)) { /* ToDo: error */ } /* reset stuff */ ptr_amdata->position = 0; } else if (modstack_is_descendant_of(ptr_amdata->ptr_first, "extension")) { /* ToDo: save as string */ } /*********************************************************************/ else if (!strcmp(ptr_parent->elname, "mods")) { /* top-level elements */ if (!strcmp(el, "titleInfo")) { /* ToDo: can also be child of subject */ } else if (!strcmp(el, "name")) { /* ToDo: can also be child of subject */ } else if (!strcmp(el, "typeOfResource")) { struct modsObject* ptr_typeofresource; ptr_typeofresource = (struct modsObject*)((ptr_amdata->ptr_first)->ptr_modsobject); if (append_lilinameval(&(ptr_typeofresource->content_sentinel), "typeOfResource", (ptr_amdata->ptr_first)->ptr_elvalue, NULL, NULL, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "genre")) { struct modsObject* ptr_genre; ptr_genre = (struct modsObject*)((ptr_amdata->ptr_first)->ptr_modsobject); if (append_lilinameval(&(ptr_genre->content_sentinel), "genre", (ptr_amdata->ptr_first)->ptr_elvalue, NULL, NULL, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "originInfo")) { /* todo: this element allows more than one originInfo struct to be filled */ } else if (!strcmp(el, "language")) { } else if (!strcmp(el, "physicalDescription")) { } else if (!strcmp(el, "abstract")) { } else if (!strcmp(el, "tableOfContents")) { } else if (!strcmp(el, "targetAudience")) { } else if (!strcmp(el, "note")) { } else if (!strcmp(el, "subject")) { } else if (!strcmp(el, "classification")) { } else if (!strcmp(el, "relatedItem")) { } else if (!strcmp(el, "identifier")) { } else if (!strcmp(el, "location")) { } else if (!strcmp(el, "accessCondition")) { } else if (!strcmp(el, "extension")) { } else if (!strcmp(el, "recordInfo")) { } } /* end if is child of mods */ /*********************************************************************/ /* lower-level elements */ /* titleInfo children */ else if (!strcmp(el, "title")) { /* child of titleInfo */ struct modsObject* ptr_titleinfo; ptr_titleinfo = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); if (append_lilinameval(&(ptr_titleinfo->content_sentinel), "title", (ptr_amdata->ptr_first)->ptr_elvalue, NULL, NULL, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "subTitle")) { /* child of titleInfo */ struct modsObject* ptr_titleinfo; ptr_titleinfo = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); if (append_lilinameval(&(ptr_titleinfo->content_sentinel), "subTitle", (ptr_amdata->ptr_first)->ptr_elvalue, NULL, NULL, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "partNumber")) { /* child of titleInfo */ struct modsObject* ptr_titleinfo; ptr_titleinfo = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); if (append_lilinameval(&(ptr_titleinfo->content_sentinel), "partNumber", (ptr_amdata->ptr_first)->ptr_elvalue, NULL, NULL, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "partName")) { /* child of titleInfo */ struct modsObject* ptr_titleinfo; ptr_titleinfo = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); if (append_lilinameval(&(ptr_titleinfo->content_sentinel), "partName", (ptr_amdata->ptr_first)->ptr_elvalue, NULL, NULL, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "nonSort")) { /* child of titleInfo */ struct modsObject* ptr_titleinfo; ptr_titleinfo = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); if (append_lilinameval(&(ptr_titleinfo->content_sentinel), "nonSort", (ptr_amdata->ptr_first)->ptr_elvalue, NULL, NULL, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "namePart")) { /* child of name */ struct modsObject* ptr_name; char* att; ptr_name = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); att = modstack_get_attr(ptr_amdata->ptr_first, "type"); /* fn checks if att==NULL */ if (append_lilinameval(&(ptr_name->content_sentinel), "namePart", (ptr_amdata->ptr_first)->ptr_elvalue, "type", att, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "roleTerm")) { /* child of name:role. role is treated as transparent */ struct modsObject* ptr_name; char* att; char* att1; ptr_name = (struct modsObject*)((modstack_get_parent(modstack_get_parent(ptr_amdata->ptr_first)))->ptr_modsobject); att = modstack_get_attr(ptr_amdata->ptr_first, "type"); att1 = modstack_get_attr(ptr_amdata->ptr_first, "authority"); /* fn checks if att==NULL */ if (append_lilinameval(&(ptr_name->content_sentinel), "roleTerm", (ptr_amdata->ptr_first)->ptr_elvalue, "type", att, "authority", att1, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "displayform")) { /* child of name */ struct modsObject* ptr_name; ptr_name = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); if (append_lilinameval(&(ptr_name->content_sentinel), "displayForm", (ptr_amdata->ptr_first)->ptr_elvalue, NULL, NULL, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "affiliation")) { /* child of name */ struct modsObject* ptr_name; ptr_name = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); if (append_lilinameval(&(ptr_name->content_sentinel), "affiliation", (ptr_amdata->ptr_first)->ptr_elvalue, NULL, NULL, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "description")) { /* child of name */ struct modsObject* ptr_name; ptr_name = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); if (append_lilinameval(&(ptr_name->content_sentinel), "description", (ptr_amdata->ptr_first)->ptr_elvalue, NULL, NULL, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "placeTerm")) { /* child of originInfo:place. place is treated as transparent */ struct modsObject* ptr_origininfo; char* att; char* att1; ptr_origininfo = (struct modsObject*)((modstack_get_parent(modstack_get_parent(ptr_amdata->ptr_first)))->ptr_modsobject); att = modstack_get_attr(ptr_amdata->ptr_first, "type"); att1 = modstack_get_attr(ptr_amdata->ptr_first, "authority"); /* fn checks if att==NULL */ if (append_lilinameval(&(ptr_origininfo->content_sentinel), "roleTerm", (ptr_amdata->ptr_first)->ptr_elvalue, "type", att, "authority", att1, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "publisher") || !strcmp(el, "edition") || !strcmp(el, "issuance") || !strcmp(el, "frequency")) { /* child of originInfo */ struct modsObject* ptr_origininfo; ptr_origininfo = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); if (append_lilinameval(&(ptr_origininfo->content_sentinel), (char*)el, (ptr_amdata->ptr_first)->ptr_elvalue, NULL, NULL, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "languageTerm")) { /* child of language */ struct modsObject* ptr_language; char* att; char* att1; ptr_language = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); att = modstack_get_attr(ptr_amdata->ptr_first, "type"); att1 = modstack_get_attr(ptr_amdata->ptr_first, "authority"); /* fn checks if att==NULL */ if (append_lilinameval(&(ptr_language->content_sentinel), "languageTerm", (ptr_amdata->ptr_first)->ptr_elvalue, "type", att, "authority", att1, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "form")) { /* child of physicalDescription */ struct modsObject* ptr_physicaldescription; ptr_physicaldescription = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); if (append_lilinameval(&(ptr_physicaldescription->content_sentinel), "form", (ptr_amdata->ptr_first)->ptr_elvalue, "authority", modstack_get_attr(ptr_amdata->ptr_first, "authority"), NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "extent")) { /* child of physicalDescription or of part*/ struct modsObject* ptr_physicaldescription; ptr_physicaldescription = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); if (append_lilinameval(&(ptr_physicaldescription->content_sentinel), "extent", (ptr_amdata->ptr_first)->ptr_elvalue, "unit", modstack_get_attr(ptr_amdata->ptr_first, "unit"), NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "reformattingQuality") || !strcmp(el, "internetMediaType") || !strcmp(el, "digitalOrigin")) { /* child of physicalDescription */ struct modsObject* ptr_physicaldescription; ptr_physicaldescription = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); if (append_lilinameval(&(ptr_physicaldescription->content_sentinel), (char*)el, (char*)((ptr_amdata->ptr_first)->ptr_elvalue), NULL, NULL, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "titleInfo")) { /* child of subject */ } else if (!strcmp(el, "name")) { /* child of subject */ } else if (!strcmp(el, "topic") || !strcmp(el, "geographic")) { /* child of subject */ struct modsObject* ptr_subject; ptr_subject = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); if (append_lilinameval(&(ptr_subject->content_sentinel), (char*)el, (char*)((ptr_amdata->ptr_first)->ptr_elvalue), NULL, NULL, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "temporal")) { /* child of subject */ struct modsObject* ptr_subject; char* att; char* att1; char* att2; ptr_subject = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); att = modstack_get_attr(ptr_amdata->ptr_first, "encoding"); att1 = modstack_get_attr(ptr_amdata->ptr_first, "point"); att2 = modstack_get_attr(ptr_amdata->ptr_first, "keyDate"); if (append_lilinameval(&(ptr_subject->content_sentinel), (char*)el, (char*)((ptr_amdata->ptr_first)->ptr_elvalue), "encoding", att, "point", att1, "keyDate", att2, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "hierarchicalGeographic")) { /* this element is transparent, nothing to do */ } else if (!strcmp(el, "cartographics")) { /* this element is transparent, nothing to do */ } else if (!strcmp(el, "caption") || !strcmp(el, "title") || !strcmp(el, "number")) { /* child of detail */ struct modsObject* ptr_detail; ptr_detail = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); if (append_lilinameval(&(ptr_detail->content_sentinel), (char*)el, (char*)((ptr_amdata->ptr_first)->ptr_elvalue), NULL, NULL, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "extent")) { /* child of part */ struct modsObject* ptr_part; char* att; ptr_part = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); att = modstack_get_attr(ptr_amdata->ptr_first, "unit"); if (append_lilinameval(&(ptr_part->content_sentinel), (char*)el, (char*)((ptr_amdata->ptr_first)->ptr_elvalue), "unit", att, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "recordContentSource")) { /* child of recordInfo */ struct modsObject* ptr_recordcontentsource; ptr_recordcontentsource = (struct modsObject*)((ptr_amdata->ptr_first)->ptr_modsobject); if (append_lilinameval(&(ptr_recordcontentsource->content_sentinel), (char*)el, (char*)((ptr_amdata->ptr_first)->ptr_elvalue), NULL, NULL, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "recordIdentifier")) { /* child of recordInfo */ struct modsObject* ptr_recordinfo; char* att; ptr_recordinfo = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); att = modstack_get_attr(ptr_amdata->ptr_first, "source"); if (append_lilinameval(&(ptr_recordinfo->content_sentinel), (char*)el, (char*)((ptr_amdata->ptr_first)->ptr_elvalue), "source", att, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "languageOfCataloging")) { /* child of recordInfo */ struct modsObject* ptr_recordinfo; char* att; char* att1; ptr_recordinfo = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); att = modstack_get_attr(ptr_amdata->ptr_first, "authority"); att1 = modstack_get_attr(ptr_amdata->ptr_first, "type"); if (append_lilinameval(&(ptr_recordinfo->content_sentinel), (char*)el, (char*)((ptr_amdata->ptr_first)->ptr_elvalue), "authority", att, "type", att1, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "recordOrigin")) { /* child of recordInfo */ struct modsObject* ptr_recordinfo; ptr_recordinfo = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); if (append_lilinameval(&(ptr_recordinfo->content_sentinel), (char*)el, (char*)((ptr_amdata->ptr_first)->ptr_elvalue), NULL, NULL, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "text")) { } else if (!strcmp(el, "continent") || !strcmp(el, "country") || !strcmp(el, "province") || !strcmp(el, "region") || !strcmp(el, "state") || !strcmp(el, "territory") || !strcmp(el, "county") || !strcmp(el, "city") || !strcmp(el, "island") || !strcmp(el, "area") || !strcmp(el, "coordinates") || !strcmp(el, "scale") || !strcmp(el, "projection")) { /* children of hierarchicalGeographic or of cartographics. Both are transparent elements so we can pass the stuff through to the subject structure */ struct modsObject* ptr_subject; ptr_subject = (struct modsObject*)(modstack_get_parent((modstack_get_parent(ptr_amdata->ptr_first)))->ptr_modsobject); if (append_lilinameval(&(ptr_subject->content_sentinel), (char*)el, (char*)((ptr_amdata->ptr_first)->ptr_elvalue), NULL, NULL, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "dateIssued") || !strcmp(el, "dateCreated") || !strcmp(el, "dateCaptured") || !strcmp(el, "dateOther") || !strcmp(el, "temporal") || !strcmp(el, "recordCreationDate") || !strcmp(el, "recordChangeDate") || !strcmp(el, "date")) { struct modsDate* ptr_date; ptr_date = (struct modsDate*)((ptr_amdata->ptr_first)->ptr_modsdate); ptr_date->value = strdup((ptr_amdata->ptr_first)->ptr_elvalue); if (!(ptr_date->value)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "url")) { /* child of location */ struct modsObject* ptr_location; char* att; char* att1; ptr_location = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); att = modstack_get_attr(ptr_amdata->ptr_first, "dateLastAccessed"); att1 = modstack_get_attr(ptr_amdata->ptr_first, "displayLabel"); if (append_lilinameval(&(ptr_location->content_sentinel), (char*)el, (char*)((ptr_amdata->ptr_first)->ptr_elvalue), "dateLastAccessed", att, "displayLabel", att1, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else if (!strcmp(el, "physicalLocation")) { /* child of location */ struct modsObject* ptr_physloc; ptr_physloc = (struct modsObject*)((modstack_get_parent(ptr_amdata->ptr_first))->ptr_modsobject); if (append_lilinameval(&(ptr_physloc->content_sentinel), (char*)el, (char*)((ptr_amdata->ptr_first)->ptr_elvalue), NULL, NULL, NULL, NULL, NULL, NULL, 0)) { (ptr_amdata->nmem_error)++; return; } } else { /* unknown element */ } } /* end if no error */ /* remove attributes of the current element from the list */ if (ptr_amdata->depth && ptr_amdata->ptr_first) { struct attrlist* ptr_attr_remove; ptr_attr_remove = (ptr_amdata->ptr_first)->ptr_attr_first; while (ptr_attr_remove) { (ptr_amdata->ptr_first)->ptr_attr_first = ((ptr_amdata->ptr_first)->ptr_attr_first)->ptr_next; free(ptr_attr_remove); ptr_attr_remove = (ptr_amdata->ptr_first)->ptr_attr_first; } /* free element value string */ if ((ptr_amdata->ptr_first)->ptr_elvalue) { free((ptr_amdata->ptr_first)->ptr_elvalue); } /* remove current element from element stack */ ptr_el_remove = ptr_amdata->ptr_first; ptr_amdata->ptr_first = (ptr_amdata->ptr_first)->ptr_next; if (ptr_el_remove) { free(ptr_el_remove); } } } --- NEW FILE --- /*+++++++++++++++++++++++ modshandler.h header file for mods_starthandler.c and mods_endhandler.c ma...@mh... 2003-12-07 $Id: mods_handler.h,v 1.1 2004/05/17 23:12:51 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 ++++++++++++++++++++++++*/ struct addmods_data { char year[5]; char month[3]; char day[3]; char date_buffer[12]; char otherinfo[256]; char first_author[256]; char ck_year[5]; char mods_xmlid[256]; char mods_version[16]; char type[7]; char* msgpool; const char* drivername; int nmem_error; /* if != 0, out of memory error occurred */ int ndb_error; /* if != 0, database error occurred */ int n_skip; /* if != 0, skip current entry element */ int depth; /* the current depth of the element stack */ int depth_adjust; /* 0 if entry, 1 if ris */ int n_dbtype; /* thpe of database */ unsigned long long set_count; /* number of entry elements */ unsigned long long added_count; /* number of added entry elements */ unsigned long long skipped_count; /* number of skipped entries */ unsigned long long updated_count; /* number of updated entry elements */ unsigned long long failed_count; /* number of failed entry elements */ unsigned int position; /* position counter used by names */ int replace_ref; /* if != 0, existing reference is to be replaced */ int create_new; /* if 1, dataset is a new one */ size_t msgpool_len; unsigned long long n_mods_id; /* database id of dataset */ unsigned long long n_user_id; /* database id of current user */ struct modstack* ptr_first; /* start of the element stack */ struct PERIODICAL_INFO perinfo; /* periodical name synonyms */ struct CLIENT_REQUEST* ptr_clrequest; Lilid* ptr_id_sentinel; /* linked list for added IDs */ Lilimodsobj modsobj_sentinel; /* linked list for mods objects */ dbi_conn conn; dbi_conn conn_refdb; dbi_driver driver; iconv_t conv_descriptor; /* conversion descriptor for iconv */ }; void mods_start_handler(void *ptr_data, const char *el, const char **ptr_attr); void mods_end_handler(void *ptr_data, const char *el); void mods_char_handler(void *ptr_data, const char *string, int len); --- NEW FILE --- /* mods_helper.c: support functions for dealing with mods records */ /* ma...@mh... 2004-05-10 */ /* $Id: mods_helper.c,v 1.1 2004/05/17 23:12:51 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 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <syslog.h> /* priority levels of log messages */ #include <iconv.h> #include <dbi/dbi.h> #include "backend.h" #include "linklist.h" #include "refdb.h" #include "refdbd.h" /* depends on backend.h */ #include "risdb.h" #include "strfncs.h" #include "connect.h" #include "dbfncs.h" #include "authorinfo.h" #include "elstack.h" #include "mods_objects.h" #include "mods_handler.h" extern int n_log_level; extern struct BSTRING connerr; extern struct BSTRING outomem; extern struct BSTRING outomem_n; char* normalize_mods_name(Lilinameval* ptr_content) { char* normalized_name; char* new_normalized_name; int result; int n_run_once = 0; size_t normalized_name_len = 256; Lilinameval* ptr_curr_content; if (!ptr_content) { return NULL; } if ((normalized_name = (char*)malloc(normalized_name_len)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); return NULL; } *normalized_name = '\0'; ptr_curr_content = get_lilinameval_by_att(ptr_content, "namePart", "family"); if ((new_normalized_name = mstrcat(normalized_name, ptr_curr_content->value, &normalized_name_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); free(normalized_name); return NULL; } else { normalized_name = new_normalized_name; } ptr_curr_content = ptr_content; while ((ptr_curr_content = get_next_lilinameval(ptr_curr_content)) != NULL) { char *value_q; if (ptr_curr_content->value && !strcmp(ptr_curr_content->name, "namePart") && strcmp(ptr_curr_content->attvalue, "family")) { if (!n_run_once) { n_run_once++; if ((new_normalized_name = mstrcat(normalized_name, ",", &normalized_name_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); free(normalized_name); return NULL; } else { normalized_name = new_normalized_name; } } else if (normalized_name[strlen(normalized_name)-1] != '.') { if ((new_normalized_name = mstrcat(normalized_name, " ", &normalized_name_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); free(normalized_name); return NULL; } else { normalized_name = new_normalized_name; } } if ((new_normalized_name = mstrcat(normalized_name, ptr_curr_content->value, &normalized_name_len, 0)) == NULL) { LOG_PRINT(LOG_WARNING, outomem.text); free(normalized_name); return NULL; } else { normalized_name = new_normalized_name; } } /* end if have value */ } /* end while */ return normalized_name; } --- NEW FILE --- /* mods_helper.h: header file for mods_helper.c */ /* ma...@mh... 2004-05-10 */ /* $Id: mods_helper.h,v 1.1 2004/05/17 23:12:51 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 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ char* normalize_mods_name(Lilinameval* ptr_content); --- NEW FILE --- /* modsobjects.c: functions for handling objects related to MODS */ /* ma...@mh... 2003-12-08 */ /* $Id: mods_objects.c,v 1.1 2004/05/17 23:12:51 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 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ #include <stdio.h> #include <string.h> #include "mods_objects.h" /********************************************************************/ /* modsObject */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ new_modsobject(): creates a new mods object struct modsObject* new_modsobject returns ptr to the new object or NULL in the case of an error ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ struct modsObject* new_modsobject () { struct modsObject* ptr_new; ptr_new = (struct modsObject*)malloc(sizeof(struct modsObject)); if (!ptr_new) { return NULL; } /* initialize */ init_lilinameval_entry(&(ptr_new->content_sentinel)); init_lilimodsobject_entry(&(ptr_new->modsobj_sentinel)); init_lilimodsdate_entry(&(ptr_new->modsdate_sentinel)); ptr_new->objectName[0] = '\0'; ptr_new->id[0] = '\0'; ptr_new->parent[0] = '\0'; ptr_new->version[0] = '\0'; ptr_new->type[0] = '\0'; ptr_new->authority[0] = '\0'; ptr_new->displayLabel[0] = '\0'; ptr_new->role[0] = '\0'; ptr_new->arcrole[0] = '\0'; ptr_new->show[0] = '\0'; ptr_new->actuate[0] = '\0'; ptr_new->lang[0] = '\0'; ptr_new->xml_lang[0] = '\0'; ptr_new->script[0] = '\0'; ptr_new->edition[0] = '\0'; ptr_new->dateLastAccessed[0] = '\0'; ptr_new->source[0] = '\0'; ptr_new->collection = 0; ptr_new->manuscript = 0; ptr_new->invalid = 0; ptr_new->parent_id = 0; ptr_new->position = 0; return ptr_new; } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ free_modsobject(): frees the memory associated with a mods object int free_modsobject returns 0 if ok, 1 if NULL pointer was passed struct modsObject* ptr_curr ptr to the object to be freed ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ int free_modsobject(struct modsObject* ptr_curr) { if (!ptr_curr) { return 1; } delete_all_lilinameval(&(ptr_curr->content_sentinel)); delete_all_lilimodsobject(&(ptr_curr->modsobj_sentinel)); delete_all_lilimodsdate(&(ptr_curr->modsdate_sentinel)); return 0; } /********************************************************************/ /* modsDate */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ new_modsdate(): creates a new mods date object struct modsDate* new_modsdate returns pointer to the new object or NULL in the case of an error ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ struct modsDate* new_modsdate () { struct modsDate* ptr_new; ptr_new = (struct modsDate*)malloc(sizeof(struct modsDate)); if (!ptr_new) { return NULL; } /* initialize */ ptr_new->value = NULL; ptr_new->objectName[0] = '\0'; ptr_new->parent[0] = '\0'; ptr_new->encoding[0] = '\0'; ptr_new->qualifier[0] = '\0'; ptr_new->point[0] = '\0'; ptr_new->keydate = 0; return ptr_new; } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ free_modsDate(): frees the memory associated with a mods date object int free_modsdate returns 0 if ok, 1 if NULL pointer was passed struct modsDate* ptr_curr ptr to the object to be freed ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ int free_modsdate(struct modsDate* ptr_curr) { if (!ptr_curr) { return 1; } if (ptr_curr->value) { free(ptr_curr->value); } return 0; } /********************************************************************/ /* the name/value linked list */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ init_lilinameval_entry(): initializes an entry int init_lilinameval_entry returns 0 Lilinameval* ptr_curr ptr to the new entry ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ int init_lilinameval_entry(Lilinameval* ptr_curr) { ptr_curr->n_is_att = 0; *(ptr_curr->name) = '\0'; ptr_curr->value = NULL; *(ptr_curr->attname) = '\0'; ptr_curr->attvalue = NULL; *(ptr_curr->attname1) = '\0'; ptr_curr->attvalue1 = NULL; *(ptr_curr->attname2) = '\0'; ptr_curr->attvalue2 = NULL; ptr_curr->ptr_next = NULL; ptr_curr->ptr_last = ptr_curr; return 0; } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ append_lilinameval(): adds an entry int append_lilinameval returns 0 if ok, 1 if an error occurred Lilinameval* ptr_sentinel ptr to the linked list sentinel char* name buffer containing the element/attribute name char* value buffer containing the element/attribute value char* attname buffer containing the attribute name char* attvalue buffer containing the attribute value char* attname1 buffer containing the attribute name char* attvalue1 buffer containing the attribute value char* attname2 buffer containing the attribute name char* attvalue2 buffer containing the attribute value int n_is_att 1 if the added value is an attribute, 0 if an element ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ int append_lilinameval(Lilinameval *ptr_sentinel, char* name, char* value, char* attname, char* attvalue, char* attname1, char* attvalue1, char* attname2, char* attvalue2, int n_is_att) { Lilinameval* ptr_new; if (!name) { return 1; } /* get memory for new list member */ ptr_new = (Lilinameval*)malloc(sizeof(Lilinameval)); if (!ptr_new) { return 1; } /* set values */ strncpy(ptr_new->name, name, 64); (ptr_new->name)[63] = '\0'; ptr_new->n_is_att = n_is_att; if (value) { ptr_new->value = strdup(value); if (!ptr_new->value) { free(ptr_new); return 1; } } else { ptr_new->value = NULL; } if (attname && *attname && attvalue) { strncpy(ptr_new->attname, attname, MODS_ELNAME_LEN); ptr_new->attname[MODS_ELNAME_LEN-1] = '\0'; ptr_new->attvalue = strdup(attvalue); if (!ptr_new->attvalue) { free(ptr_new->value); free(ptr_new); return 1; } } else { *(ptr_new->attname) = '\0'; ptr_new->attvalue = NULL; } if (attname1 && *attname1 && attvalue1) { strncpy(ptr_new->attname1, attname1, MODS_ELNAME_LEN); ptr_new->attname1[MODS_ELNAME_LEN-1] = '\0'; ptr_new->attvalue1 = strdup(attvalue1); if (!ptr_new->attvalue1) { free(ptr_new->attvalue); free(ptr_new->value); free(ptr_new); return 1; } } else { *(ptr_new->attname1) = '\0'; ptr_new->attvalue1 = NULL; } if (attname2 && *attname2 && attvalue2) { strncpy(ptr_new->attname2, attname2, MODS_ELNAME_LEN); ptr_new->attname2[MODS_ELNAME_LEN-1] = '\0'; ptr_new->attvalue2 = strdup(attvalue2); if (!ptr_new->attvalue2) { free(ptr_new->attvalue); free(ptr_new->attvalue1); free(ptr_new->value); free(ptr_new); return 1; } } else { *(ptr_new->attname2) = '\0'; ptr_new->attvalue2 = NULL; } /* append to the end of the list */ ptr_new->ptr_next = NULL; ptr_sentinel->ptr_last->ptr_next = ptr_new; ptr_sentinel->ptr_last = ptr_new; return 0; } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ get_lilinameval(): retrieves an entry by name Lilinameval* get_lilinameval returns ptr to the entry or NULL if no such entry exists Lilinameval* ptr_sentinel ptr to the sentinel char* name name of the entry to retrieve int n_is_att 1 if attribute is wanted, 0 if element ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ Lilinameval* get_lilinameval(Lilinameval* ptr_sentinel, char* name, int n_is_att) { Lilinameval *ptr_curr; ptr_curr = ptr_sentinel->ptr_next; while (ptr_curr && (strcmp(ptr_curr->name, name) || ptr_curr->n_is_att != n_is_att)) { ptr_curr = ptr_curr->ptr_next; } return ptr_curr; } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ get_lilinameval_by_att(): retrieves an element entry by name and attribute value Lilinameval* get_lilinameval_by_att returns ptr to the entry or NULL if no such entry exists Lilinameval* ptr_sentinel ptr to the sentinel char* name name of the entry to retrieve char* attvalue value of the first attribute ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ Lilinameval* get_lilinameval_by_att(Lilinameval* ptr_sentinel, char* name, char* attvalue) { Lilinameval *ptr_curr; ptr_curr = ptr_sentinel->ptr_next; while (ptr_curr && (strcmp(ptr_curr->name, name) || ptr_curr->n_is_att || strcmp(ptr_curr->attvalue, attvalue))) { ptr_curr = ptr_curr->ptr_next; } return ptr_curr; } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ get_next_lilinameval(): retrieves the next entry in the list Lilinameval* get_next_lilinameval returns ptr to the next entry or NULL if no such entry exists Lilinameval* ptr_curr ptr to the current element ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ Lilinameval* get_next_lilinameval(Lilinameval* ptr_curr) { return ptr_curr->ptr_next; } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ delete_all_lilinameval(): delete all entries in the list int delete_all_lilinameval returns 0 Lilinameval* ptr_sentinel ptr to the sentinel ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ int delete_all_lilinameval(Lilinameval *ptr_sentinel) { Lilinameval *ptr_curr; Lilinameval *ptr_next; /* skip sentinel */ ptr_curr = ptr_sentinel->ptr_next; while (ptr_curr) { if (ptr_curr->value) { free(ptr_curr->value); } if (ptr_curr->attvalue) { free(ptr_curr->attvalue); } if (ptr_curr->attvalue1) { free(ptr_curr->attvalue1); } if (ptr_curr->attvalue2) { free(ptr_curr->attvalue2); } ptr_next = ptr_curr->ptr_next; free(ptr_curr); ptr_curr = ptr_next; } /* end while */ return 0; } /********************************************************************/ /* the mods objects linked list */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ init_lilimodsobject_entry(): initializes an entry int init_lilimodsobject_entry returns 0 Lilimodsobj* ptr_curr ptr to the new entry ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ int init_lilimodsobject_entry(Lilimodsobj* ptr_curr) { ptr_curr->ptr_object = NULL; ptr_curr->ptr_next = NULL; ptr_curr->ptr_last = ptr_curr; return 0; } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ append_lilimodsobject(): adds an entry int append_lilimodsobject returns 0 if ok, 1 if an error occurred Lilimodsobject* ptr_sentinel ptr to the linked list sentinel struct modsObject* ptr_object ptr to mods object that is to be added to the list ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ int append_lilimodsobject(Lilimodsobj* ptr_sentinel, struct modsObject* ptr_object) { Lilimodsobj* ptr_new; if (!ptr_object || !ptr_sentinel) { return 1; } /* get memory for new list member */ ptr_new = (Lilimodsobj*)malloc(sizeof(Lilimodsobj)); if (!ptr_new) { return 1; } /* set values */ ptr_new->ptr_object = ptr_object; printf("added object to Lilimodsobj\n"); /* insert into list */ ptr_new->ptr_next = NULL; ptr_sentinel->ptr_last->ptr_next = ptr_new; ptr_sentinel->ptr_last = ptr_new; return 0; } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ get_next_lilimodsobject(): retrieves the next entry in the list Lilimodsobj* get_next_lilimodsobject returns ptr to the next entry or NULL if no such entry exists Lilimodsobj* ptr_curr ptr to the current element ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ Lilimodsobj* get_next_lilimodsobject(Lilimodsobj* ptr_sentinel) { return ptr_sentinel->ptr_next; } /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ delete_all_lilimodsobject(): delete all entries in the list int delete_all_lilimodsobject returns 0 Lilimodsobj* ptr_sentinel ptr to the sentinel ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ int delete_all_lilimodsobject(Lilimodsobj* ptr_sentinel) { Lilimodsobj* ptr_curr; Lilimodsobj* ptr_next; /* skip sentinel */ ptr_curr = ptr_sentinel->ptr_next; while (ptr_curr) { free_modsobject(ptr_curr->ptr_object); ptr_next = ptr_curr->ptr_next; free(ptr_curr); ptr_curr = ptr_next; } return 0; } /********************************************************************/ /* the mods date linked list */ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ init_lilimodsdate_entry(): initializes an entry int init_lilimodsdate_entry returns 0 Lilimodsdate* ptr_curr ptr to the new entry ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ int init_lilimodsdate_entry(Lilimodsdate* ptr_curr) { ptr_curr->ptr_date = NULL; ptr_curr->ptr_next = NULL; ptr_curr->ptr_last = ptr_curr; return ... [truncated message content] |
From: Markus H. <mho...@us...> - 2004-05-07 21:32:14
|
Update of /cvsroot/refdb/refdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6442 Modified Files: Tag: Release_0_9_5_stable configure.in Log Message: bumped up version number Index: configure.in =================================================================== RCS file: /cvsroot/refdb/refdb/configure.in,v retrieving revision 1.49 retrieving revision 1.49.2.1 diff -u -U2 -r1.49 -r1.49.2.1 --- configure.in 1 May 2004 23:41:31 -0000 1.49 +++ configure.in 7 May 2004 21:32:05 -0000 1.49.2.1 @@ -6,5 +6,5 @@ dnl Use automake -AM_INIT_AUTOMAKE(refdb, 0.9.5-pre1) +AM_INIT_AUTOMAKE(refdb, 0.9.5-pre2) dnl Find out host type |