[Refdb-cvs] CVS: refdb/src backend-dbib.c,1.28.2.9,1.28.2.10 backend-dbib.h,1.9.2.3,1.9.2.4 backend-
Status: Beta
Brought to you by:
mhoenicka
From: Markus H. <mho...@us...> - 2005-09-29 22:36:09
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5765 Modified Files: Tag: Release_0_9_5_stable backend-dbib.c backend-dbib.h backend-dbiba.c backend.c backend.h refdbda.c refdbdbib.c xmlhandler.c xmlhandler.h Log Message: first shot at title-instead-of-missing-authors support in bibliographies and citations Index: backend-dbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-dbib.c,v retrieving revision 1.28.2.9 retrieving revision 1.28.2.10 diff -u -U2 -r1.28.2.9 -r1.28.2.10 --- backend-dbib.c 11 Sep 2005 19:55:11 -0000 1.28.2.9 +++ backend-dbib.c 29 Sep 2005 22:35:59 -0000 1.28.2.10 @@ -229,4 +229,5 @@ int n_status; short int n_pubyear; + short int title_as_author; unsigned long long n_sorted_pos1; unsigned long long n_citation_pos; @@ -360,5 +361,5 @@ /* select all datasets in temp table with an xref_pos == 1. This gives us a list of all citation_pos with multiple citations. Walk through this list and create a bibliomset element for each citation, containing all xrefs of that citation. Use the sorted_pos column for numeric citations */ - sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, citation_pos, xref_pos, multi_id, sorted_pos FROM %s WHERE xref_pos=1 ORDER BY citation_pos", table_name); + sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, citation_pos, xref_pos, multi_id, sorted_pos, title_as_author FROM %s WHERE xref_pos=1 ORDER BY citation_pos", table_name); LOG_PRINT(LOG_DEBUG, sql_command); @@ -387,14 +388,14 @@ /* request all xrefs of this citation and sort them according to the required format */ if (strcmp(item_intextseq, "ASIS") == 0) { - sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, citation_pos, xref_pos, multi_id, sorted_pos, year_uni_suffix FROM %s WHERE citation_pos="ULLSPEC" ORDER BY xref_pos", table_name, (unsigned long long)n_citation_pos); + sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, citation_pos, xref_pos, multi_id, sorted_pos, year_uni_suffix, title_as_author FROM %s WHERE citation_pos="ULLSPEC" ORDER BY xref_pos", table_name, (unsigned long long)n_citation_pos); } else if (strcmp(item_intextseq, "AUTHORDATE") == 0) { - sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, citation_pos, xref_pos, multi_id, sorted_pos, year_uni_suffix FROM %s WHERE citation_pos="ULLSPEC" ORDER BY author_concat, pubyear, periodical, volume, issue, startpage", table_name, (unsigned long long)n_citation_pos); + sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, citation_pos, xref_pos, multi_id, sorted_pos, year_uni_suffix, title_as_author FROM %s WHERE citation_pos="ULLSPEC" ORDER BY author_concat, pubyear, periodical, volume, issue, startpage", table_name, (unsigned long long)n_citation_pos); } else if (strcmp(item_intextseq, "DATEASC") == 0) { - sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, citation_pos, xref_pos, multi_id, sorted_pos, year_uni_suffix FROM %s WHERE citation_pos="ULLSPEC" ORDER BY pubyear, author_concat, periodical, volume, issue, startpage", table_name, (unsigned long long)n_citation_pos); + sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, citation_pos, xref_pos, multi_id, sorted_pos, year_uni_suffix, title_as_author FROM %s WHERE citation_pos="ULLSPEC" ORDER BY pubyear, author_concat, periodical, volume, issue, startpage", table_name, (unsigned long long)n_citation_pos); } else if (strcmp(item_intextseq, "DATEDESC") == 0) { - sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, citation_pos, xref_pos, multi_id, sorted_pos, year_uni_suffix FROM %s WHERE citation_pos="ULLSPEC" ORDER BY pubyear DESC, author_concat, periodical, volume, issue, startpage", table_name, (unsigned long long)n_citation_pos); + sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, citation_pos, xref_pos, multi_id, sorted_pos, year_uni_suffix, title_as_author FROM %s WHERE citation_pos="ULLSPEC" ORDER BY pubyear DESC, author_concat, periodical, volume, issue, startpage", table_name, (unsigned long long)n_citation_pos); } @@ -626,10 +627,10 @@ - + title_as_author = dbi_result_get_short(dbires2, "title_as_author"); /* if we are supposed to display consecutive sequences of numerical citations as a numerical range, we have to format the first in a possible series and then look ahead if at least two more citations are consecutive (as defined by their sorted order in the bibliography) */ if (ndo_range) { - if ((n_status = format_entry(ptr_ref, ptr_ref_len, intext_string, ptr_bibconns, dbires, dbires3, item_dbname, ptr_clrequest->username, n_sorted_pos, current_mset, ptr_biblio_info)) != 0) { + if ((n_status = format_entry(ptr_ref, ptr_ref_len, intext_string, ptr_bibconns, dbires, dbires3, item_dbname, ptr_clrequest->username, n_sorted_pos, current_mset, ptr_biblio_info, title_as_author)) != 0) { delete_all_lilimem(&sentinel); dbi_result_free(dbires); @@ -684,5 +685,5 @@ /* don't use ranges. We have to format each entry */ else { - if ((n_status = format_entry(ptr_ref, ptr_ref_len, intext_string, ptr_bibconns, dbires, dbires3, item_dbname, ptr_clrequest->username, n_sorted_pos, current_mset, ptr_biblio_info)) != 0) { + if ((n_status = format_entry(ptr_ref, ptr_ref_len, intext_string, ptr_bibconns, dbires, dbires3, item_dbname, ptr_clrequest->username, n_sorted_pos, current_mset, ptr_biblio_info, title_as_author)) != 0) { delete_all_lilimem(&sentinel); dbi_result_free(dbires); @@ -797,6 +798,9 @@ style and if the bibliography needs to be numbered + short title_as_author if yes, the reference has no authors and the style + wants the title to be printed instead + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -int render_dbib(char** ptr_ref, size_t* ptr_ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, const char* database, struct bibinfo* ptr_biblio_info, char* username, char* pdfroot, int nref_counter) { +int render_dbib(char** ptr_ref, size_t* ptr_ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, const char* database, struct bibinfo* ptr_biblio_info, char* username, char* pdfroot, int nref_counter, short title_as_author) { int error; int i; /* the tried-and-true counter */ @@ -966,5 +970,5 @@ } - if ((n_status = format_entry(ptr_ref, ptr_ref_len, format_spec[i], ptr_bibconns, dbires_cit, dbires, database, username, nref_counter, current_mset, ptr_biblio_info)) != 0) { + if ((n_status = format_entry(ptr_ref, ptr_ref_len, format_spec[i], ptr_bibconns, dbires_cit, dbires, database, username, nref_counter, current_mset, ptr_biblio_info, title_as_author)) != 0) { dbi_result_free(dbires_cit); delete_all_lilimem(&sentinel); @@ -1025,5 +1029,5 @@ } - if ((n_status = format_entry(ptr_ref, ptr_ref_len, buffer, ptr_bibconns, dbires_cit, dbires, database, username, nref_counter, current_mset, ptr_biblio_info)) != 0) { /* format bibliography entry body according to PUBTYPE */ + if ((n_status = format_entry(ptr_ref, ptr_ref_len, buffer, ptr_bibconns, dbires_cit, dbires, database, username, nref_counter, current_mset, ptr_biblio_info, title_as_author)) != 0) { /* format bibliography entry body according to PUBTYPE */ dbi_result_free(dbires_cit); delete_all_lilimem(&sentinel); @@ -1094,6 +1098,8 @@ info + short title_as_author if 1, the reference has no authors and the style + wants the title to be printed instead ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -int format_entry(char** ptr_ref, size_t* ptr_ref_len, char* pubtype, struct BIBCONNS* ptr_bibconns, dbi_result dbires_cit, dbi_result dbires, const char* database, const char* username, int nref_counter, char* current_mset, struct bibinfo* ptr_biblio_info) { +int format_entry(char** ptr_ref, size_t* ptr_ref_len, char* pubtype, struct BIBCONNS* ptr_bibconns, dbi_result dbires_cit, dbi_result dbires, const char* database, const char* username, int nref_counter, char* current_mset, struct bibinfo* ptr_biblio_info, short title_as_author) { int error = 0; size_t nref_buffer_len; @@ -1104,4 +1110,5 @@ unsigned int n_refstyle_id; unsigned int n_separator_id; + short my_title_as_author; char *new_ref; char *ref_buffer; @@ -1159,7 +1166,14 @@ } + if (title_as_author) { + my_title_as_author = (!strcmp(pubtype, "BOOK")) ? 2:1; + } + else { + my_title_as_author = 0; + } + /* only need authorlist (used for finding citations with same author/year) */ if (!dbires) { - if ((n_status = format_authorlist(ptr_ref, ptr_ref_len, ptr_bibconns, dbires, dbi_style_res, 0, database, 1, ptr_biblio_info)) != 0) { + if ((n_status = format_authorlist(ptr_ref, ptr_ref_len, ptr_bibconns, dbires, dbi_style_res, 0, database, 1, ptr_biblio_info, my_title_as_author)) != 0) { error = 1; } @@ -1267,5 +1281,5 @@ ref_buffer = new_ref_buffer; - if ((n_status = format_authorlist(&ref_buffer, &nref_buffer_len, ptr_bibconns, dbires, dbi_style_res, 0, database, n_intext, ptr_biblio_info)) != 0) { + if ((n_status = format_authorlist(&ref_buffer, &nref_buffer_len, ptr_bibconns, dbires, dbi_style_res, 0, database, n_intext, ptr_biblio_info, title_as_author)) != 0) { error = n_status; break; @@ -1299,5 +1313,5 @@ ref_buffer = new_ref_buffer; - if ((n_status = format_authorlist(&ref_buffer, &nref_buffer_len, ptr_bibconns, dbires, dbi_style_res, 1, database, n_intext, ptr_biblio_info)) != 0) { + if ((n_status = format_authorlist(&ref_buffer, &nref_buffer_len, ptr_bibconns, dbires, dbi_style_res, 1, database, n_intext, ptr_biblio_info, 0 /* never use title */)) != 0) { error = n_status; break; @@ -1330,5 +1344,5 @@ ref_buffer = new_ref_buffer; - if ((n_status = format_authorlist(&ref_buffer, &nref_buffer_len, ptr_bibconns, dbires, dbi_style_res, 2, database, n_intext, ptr_biblio_info)) != 0) { + if ((n_status = format_authorlist(&ref_buffer, &nref_buffer_len, ptr_bibconns, dbires, dbi_style_res, 2, database, n_intext, ptr_biblio_info, 0 /* never use title */)) != 0) { error = n_status; break; @@ -1426,5 +1440,6 @@ } /*---------------------------------------------------------------*/ - else if (strcmp(item_type, "TITLE") == 0) { + else if (strcmp(item_type, "TITLE") == 0 + && !title_as_author) { if (!n_intext) { if (strcmp(pubtype, "CHAP") == 0 Index: backend-dbib.h =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-dbib.h,v retrieving revision 1.9.2.3 retrieving revision 1.9.2.4 diff -u -U2 -r1.9.2.3 -r1.9.2.4 --- backend-dbib.h 7 Sep 2005 23:45:00 -0000 1.9.2.3 +++ backend-dbib.h 29 Sep 2005 22:35:59 -0000 1.9.2.4 @@ -28,9 +28,9 @@ int prepare_render_dbib(char* ref, struct bibinfo* ptr_biblio_info, dbi_result dbires, int n_ref_format); int finish_render_dbib(char** ptr_ref, size_t* ptr_ref_len, struct BIBCONNS* ptr_bibconns, struct bibinfo* ptr_biblio_info, char* table_name, struct CLIENT_REQUEST* ptr_clrequest); -int render_dbib(char** ptr_ref, size_t* ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, const char* database, struct bibinfo* ptr_biblio_info, char* username, char* pdfroot, int nref_counter); -int format_entry(char** ptr_ref, size_t* ptr_ref_len, char* pubtype, struct BIBCONNS* ptr_bibconns, dbi_result dbiresref, dbi_result dbires, const char* database, const char* username, int nref_counter, char* current_mset, struct bibinfo* ptr_biblio_info); +int render_dbib(char** ptr_ref, size_t* ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, const char* database, struct bibinfo* ptr_biblio_info, char* username, char* pdfroot, int nref_counter, short title_as_author); +int format_entry(char** ptr_ref, size_t* ptr_ref_len, char* pubtype, struct BIBCONNS* ptr_bibconns, dbi_result dbiresref, dbi_result dbires, const char* database, const char* username, int nref_counter, char* current_mset, struct bibinfo* ptr_biblio_info, short title_as_author); char* format_refnumber(char** ptr_ref, size_t* ptr_ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, dbi_result dbiresref, int nref_counter, int n_intext); -int format_authorlist(char** ptr_ref, size_t* ptr_ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, dbi_result dbiresref, int type, const char* database, int n_intext, struct bibinfo* ptr_biblio_info); +int format_authorlist(char** ptr_ref, size_t* ptr_ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, dbi_result dbiresref, int type, const char* database, int n_intext, struct bibinfo* ptr_biblio_info, short title_as_author); char* format_pubdate(char** ptr_ref, size_t* ptr_ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, dbi_result dbiresref, dbi_result dbirescit, int type, int n_intext, const char* year_unique_suffix); char* format_title(char** ptr_ref, size_t* ptr_ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, dbi_result dbires_ref, int type, int n_intext); Index: backend-dbiba.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend-dbiba.c,v retrieving revision 1.26.2.13 retrieving revision 1.26.2.14 diff -u -U2 -r1.26.2.13 -r1.26.2.14 --- backend-dbiba.c 11 Sep 2005 19:55:11 -0000 1.26.2.13 +++ backend-dbiba.c 29 Sep 2005 22:35:59 -0000 1.26.2.14 @@ -191,6 +191,10 @@ info + short title_as_author if >0 the reference has no authors and the style + expects the title to be printed instead + 1=title, 2=booktitle + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ -int format_authorlist(char** ptr_ref, size_t* ptr_ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, dbi_result dbires_ref, int type, const char* database, int n_intext, struct bibinfo* ptr_biblio_info) { +int format_authorlist(char** ptr_ref, size_t* ptr_ref_len, struct BIBCONNS* ptr_bibconns, dbi_result dbires, dbi_result dbires_ref, int type, const char* database, int n_intext, struct bibinfo* ptr_biblio_info, short title_as_author) { int num_authors; int nauthor_count = 0; @@ -199,5 +203,7 @@ int nhave_content = 0; int n_status; + int must_free_dbires = 0; unsigned long long n_id; + size_t author_anonymous_len = 256; /* const char* authors; */ const char *authorsep; @@ -532,35 +538,55 @@ } else if (num_authors == 0) { - author_anonymous = my_dbi_result_get_string_copy_idx(dbires_ref, n_authorempty_index); - if (author_anonymous && *author_anonymous && !dbi_conn_error_flag(ptr_bibconns->conn_refdb)) { - if (sgml_entitize(&author_anonymous, NULL) == NULL) { - free(author_anonymous); - free(alist_preceeding); - clean_request(dbires_author); - return 801; - } - - author_preceeding = my_dbi_result_get_string_copy_idx(dbires_ref, n_singlepreceeding_index); - if (author_preceeding && dbi_conn_error_flag(ptr_bibconns->conn_refdb)) { - free(author_preceeding); - author_preceeding = NULL; - } + char sql_command[512]; - author_following = my_dbi_result_get_string_copy_idx(dbires_ref, n_singlefollowing_index); - if (author_following && dbi_conn_error_flag(ptr_bibconns->conn_refdb)) { - free(author_following); - author_following = NULL; + if (title_as_author) { + /* use title here if style requires it */ + if (!dbires) { + /* when asking only for the authorlist, we don't have a result with the contents of t_refdb */ + sprintf(sql_command, "SELECT refdb_id, refdb_type, refdb_pubyear, refdb_startpage, refdb_endpage, refdb_abstract, refdb_title, refdb_volume, refdb_issue, refdb_booktitle, refdb_city, refdb_publisher, refdb_title_series, refdb_address, refdb_issn, refdb_periodical_id, refdb_pyother_info, refdb_secyear, refdb_secother_info, refdb_user1, refdb_user2, refdb_user3, refdb_user4, refdb_user5, refdb_misc1, refdb_misc2, refdb_misc3 FROM t_refdb WHERE refdb_id="ULLSPEC, (unsigned long long)n_id); + + LOG_PRINT(LOG_DEBUG, sql_command); + dbires = dbi_conn_query(ptr_bibconns->conn_source, sql_command); + + if (!dbires || dbi_result_next_row(dbires) == 0) { + /* todo: exit gracefully */ + LOG_PRINT(LOG_WARNING, "retrieve title instead of author failed"); + } + must_free_dbires++; } } - else { /* no authors, go home */ - if (author_anonymous) { - free(author_anonymous); + else { + author_anonymous = my_dbi_result_get_string_copy_idx(dbires_ref, n_authorempty_index); + if (author_anonymous && *author_anonymous && !dbi_conn_error_flag(ptr_bibconns->conn_refdb)) { + if (sgml_entitize(&author_anonymous, NULL) == NULL) { + free(author_anonymous); + free(alist_preceeding); + clean_request(dbires_author); + return 801; + } + + author_preceeding = my_dbi_result_get_string_copy_idx(dbires_ref, n_singlepreceeding_index); + if (author_preceeding && dbi_conn_error_flag(ptr_bibconns->conn_refdb)) { + free(author_preceeding); + author_preceeding = NULL; + } + + author_following = my_dbi_result_get_string_copy_idx(dbires_ref, n_singlefollowing_index); + if (author_following && dbi_conn_error_flag(ptr_bibconns->conn_refdb)) { + free(author_following); + author_following = NULL; + } } - clean_request(dbires_author); - if (alist_preceeding) { - free(alist_preceeding); + else { /* no authors, go home */ + if (author_anonymous) { + free(author_anonymous); + } + clean_request(dbires_author); + if (alist_preceeding) { + free(alist_preceeding); + } + return 0; } - return 0; - } + } /* end if title as author */ } else { /* num_authors == 1 */ @@ -652,4 +678,34 @@ free(author_anonymous); } + else if (title_as_author) { + /* todo: kosherize output of format_title under these conditions */ + if ((new_ref = mstrcat(*ptr_ref, "<bibliomset relation=\"author\">", ptr_ref_len, 0)) == NULL) { + return 801; + } + else { + *ptr_ref = new_ref; + } + + if ((new_ref = format_title(ptr_ref, ptr_ref_len, ptr_bibconns, dbires, dbires_ref, title_as_author-1, n_intext)) == NULL) { + free(alist_preceeding); + clean_request(dbires_author); + return 801; + } + else { + *ptr_ref = new_ref; + } + + if ((new_ref = mstrcat(*ptr_ref, "</bibliomset>", ptr_ref_len, 0)) == NULL) { + return 801; + } + else { + *ptr_ref = new_ref; + } + + nhave_content = 1; + if (must_free_dbires) { + dbi_result_free(dbires); + } + } else { while (get_author_parts(dbires_author, &ainfo) != NULL) { @@ -807,5 +863,5 @@ clean_request(dbires_author); - } /* end if have authors */ + } /* end if author query ok */ /* text following */ Index: backend.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend.c,v retrieving revision 1.27.2.10 retrieving revision 1.27.2.11 diff -u -U2 -r1.27.2.10 -r1.27.2.11 --- backend.c 22 Sep 2005 21:40:08 -0000 1.27.2.10 +++ backend.c 29 Sep 2005 22:35:59 -0000 1.27.2.11 @@ -1833,4 +1833,17 @@ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + get_num_authors(): retrieves the number of authors + + int get_num_authors returns the number of requested authors + + dbi_result dbires database query result, pointing to the current + dataset + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ +unsigned long long get_num_authors(dbi_result dbires) { + return dbi_result_get_numrows(dbires); +} + +/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ get_author(): retrieves an author @@ -2371,5 +2384,5 @@ returned by the mysql driver including a trailing \0 */ result = dbi_result_get_binary(Result, fieldname); - if (!result || dbi_conn_error_flag(dbi_result_get_conn(Result))) { + if (!result && dbi_conn_error_flag(dbi_result_get_conn(Result))) { return NULL; } Index: backend.h =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend.h,v retrieving revision 1.23.2.6 retrieving revision 1.23.2.7 diff -u -U2 -r1.23.2.6 -r1.23.2.7 --- backend.h 22 Sep 2005 21:40:08 -0000 1.23.2.6 +++ backend.h 29 Sep 2005 22:35:59 -0000 1.23.2.7 @@ -137,4 +137,5 @@ char* get_periodical(dbi_conn conn, char* periodical, const char* db, int type, int* errcode, unsigned long long id); dbi_result request_authors(dbi_conn conn, int type, const char* db, unsigned long long n_id); +unsigned long long get_num_authors(dbi_result dbires); const char* get_author(dbi_result dbires); struct AUTHOR_INFO* get_author_parts(dbi_result dbires, struct AUTHOR_INFO* ptr_ainfo); Index: refdbda.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbda.c,v retrieving revision 1.41.2.19 retrieving revision 1.41.2.20 diff -u -U2 -r1.41.2.19 -r1.41.2.20 --- refdbda.c 17 Sep 2005 21:35:37 -0000 1.41.2.19 +++ refdbda.c 29 Sep 2005 22:35:59 -0000 1.41.2.20 @@ -414,4 +414,5 @@ dbi_conn_set_option_numeric(conn, "compression", 1); dbi_conn_set_option(conn, "host", ptr_clrequest->server_ip); + dbi_conn_set_option_numeric(conn, "mysql_include_trailing_null", 1); } else if (!strcmp(ptr_clrequest->dbserver, "pgsql")) { Index: refdbdbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdbib.c,v retrieving revision 1.36.2.25 retrieving revision 1.36.2.26 diff -u -U2 -r1.36.2.25 -r1.36.2.26 --- refdbdbib.c 17 Sep 2005 21:36:53 -0000 1.36.2.25 +++ refdbdbib.c 29 Sep 2005 22:35:59 -0000 1.36.2.26 @@ -136,4 +136,5 @@ size_t result_len; short int n_pubyear; + short int title_as_author; unsigned long long nref_counter; unsigned long long n_id; @@ -383,4 +384,5 @@ "author_abbrevlist BLOB," "year_uni_suffix VARCHAR(16)," + "title_as_author SMALLINT DEFAULT 0," "PRIMARY KEY (id))", table_name); } @@ -405,4 +407,5 @@ "author_abbrevlist TEXT," "year_uni_suffix VARCHAR(16)," + "title_as_author SMALLINT DEFAULT 0," "PRIMARY KEY (id))", table_name); } @@ -426,4 +429,5 @@ "sorted_pos INTEGER DEFAULT 1," "author_abbrevlist TEXT," + "title_as_author SMALLINT DEFAULT 0," "year_uni_suffix TEXT)", table_name); } @@ -447,4 +451,5 @@ "sorted_pos INTEGER DEFAULT 1," "author_abbrevlist TEXT," + "title_as_author SMALLINT DEFAULT 0," "year_uni_suffix TEXT)", table_name); } @@ -472,9 +477,11 @@ /* make data available for handlers */ gbdata.ptr_default_db = ptr_clrequest->current_db; - gbdata.conn = bibconns.conn; /* connection to the temp table */ + gbdata.conn = bibconns.conn; /* connection to the temp table db */ + gbdata.conn_refdb = bibconns.conn_refdb; /* connection to the style db */ gbdata.ptr_citation_count = &citation_count; gbdata.ptr_xref_count = &xref_count; gbdata.ptr_table_name = table_name; gbdata.ptr_curr_multi_id = curr_multi_id; + gbdata.quoted_journal = myjournal; gbdata.ptr_cmid_len = &curr_multi_id_len; gbdata.ptr_sfirst = ptr_sfirst; @@ -593,24 +600,24 @@ sorting order of multiple in-text citations */ if (strcmp(intextsequence, "ASIS") == 0) { - sprintf(sql_command, "SELECT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos FROM %s WHERE sorted_pos>0 ORDER BY id", table_name); + sprintf(sql_command, "SELECT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos, title_as_author FROM %s WHERE sorted_pos>0 ORDER BY id", table_name); } else if (strcmp(intextsequence, "AUTHORDATE") == 0) { - sprintf(sql_command, "SELECT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos FROM %s WHERE sorted_pos>0 ORDER BY citation_pos, author_concat, pubyear, monthday, periodical, volume, issue, startpage", table_name); + sprintf(sql_command, "SELECT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos, title_as_author FROM %s WHERE sorted_pos>0 ORDER BY citation_pos, author_concat, pubyear, monthday, periodical, volume, issue, startpage", table_name); } else if (strcmp(intextsequence, "DATEASC") == 0) { - sprintf(sql_command, "SELECT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos FROM %s WHERE sorted_pos>0 ORDER BY citation_pos, pubyear, monthday, author_concat, periodical, volume, issue, startpage", table_name); + sprintf(sql_command, "SELECT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos, title_as_author FROM %s WHERE sorted_pos>0 ORDER BY citation_pos, pubyear, monthday, author_concat, periodical, volume, issue, startpage", table_name); } else if (strcmp(intextsequence, "DATEDESC") == 0) { - sprintf(sql_command, "SELECT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos FROM %s WHERE sorted_pos>0 ORDER BY citation_pos, pubyear DESC, monthday DESC, author_concat, periodical, volume, issue, startpage", table_name); + sprintf(sql_command, "SELECT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos, title_as_author FROM %s WHERE sorted_pos>0 ORDER BY citation_pos, pubyear DESC, monthday DESC, author_concat, periodical, volume, issue, startpage", table_name); } } else if (strcmp(bibsequence, "BAUTHORDATE") == 0) { - sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos, monthday FROM %s ORDER BY author_concat, pubyear, monthday, volume, issue, article_title, periodical, startpage", table_name); + sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos, monthday, title_as_author FROM %s ORDER BY author_concat, pubyear, monthday, volume, issue, article_title, periodical, startpage", table_name); } else if (strcmp(bibsequence, "BDATEASC") == 0) { - sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos, monthday FROM %s ORDER BY pubyear, monthday, author_concat, volume, issue, article_title, periodical, startpage", table_name); + sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos, monthday, title_as_author FROM %s ORDER BY pubyear, monthday, author_concat, volume, issue, article_title, periodical, startpage", table_name); } else if (strcmp(bibsequence, "BDATEDESC") == 0) { - sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos, monthday FROM %s ORDER BY pubyear DESC, monthday DESC, author_concat, volume, issue, article_title, periodical, startpage", table_name); + sprintf(sql_command, "SELECT DISTINCT dbname, orig_id, author_concat, pubyear, article_title, periodical, volume, issue, startpage, entry_id, year_uni_suffix, sorted_pos, monthday, title_as_author FROM %s ORDER BY pubyear DESC, monthday DESC, author_concat, volume, issue, article_title, periodical, startpage", table_name); } @@ -722,4 +729,5 @@ /* loop over all distinct references for the actual formatting */ while (dbi_result_next_row(dbires)) { + /* the following loop has already run if !nis_numeric */ if (nis_numeric) { @@ -819,4 +827,5 @@ the string is empty */ item = my_dbi_result_get_string_copy(dbires, "author_concat"); +/* printf("author_concat went to: %s<<\n", item); */ if ((!item && dbi_conn_error_flag(bibconns.conn)) || (item && !strcmp(item, "ERROR"))) { ptr_addresult->failure++; @@ -865,7 +874,8 @@ item = dbi_result_get_string(dbires, "dbname"); + title_as_author = dbi_result_get_short(dbires, "title_as_author"); /* todo: break instead of exit on error? */ - if ((n_status = render_dbib(&outbuffer, &outbuffer_len, &bibconns, dbires1 /* reference info */, item /* database */, ptr_biblio_info, ptr_clrequest->username, "", nref_counter)) != 0) { + if ((n_status = render_dbib(&outbuffer, &outbuffer_len, &bibconns, dbires1 /* reference info */, item /* database */, ptr_biblio_info, ptr_clrequest->username, "", nref_counter, title_as_author)) != 0) { send_status(ptr_clrequest->fd, n_status, TERM_NO); append_return_msg(ptr_addresult, n_status, id_string, bibconns.conn); @@ -1214,4 +1224,5 @@ int sql_command_len = 0; int n_status; + short title_as_author; char *id_string; char *authorlist_buffer; @@ -1294,5 +1305,7 @@ } - if ((n_status = format_entry(&authorlist_buffer, &authorlist_buffer_len, pubtype, ptr_bibconns, dbires_cit, NULL /* authorlist only */, item, ptr_clrequest->username, 0, current_mset, biblio_info)) != 0) { + title_as_author = dbi_result_get_short(dbires, "title_as_author"); + + if ((n_status = format_entry(&authorlist_buffer, &authorlist_buffer_len, pubtype, ptr_bibconns, dbires_cit, NULL /* authorlist only */, item, ptr_clrequest->username, 0, current_mset, biblio_info, title_as_author)) != 0) { append_return_msg(ptr_addresult, n_status, NULL, ptr_bibconns->conn); free(id_string); @@ -2632,10 +2645,10 @@ while (dbi_result_next_row(dbires_ref)) { item_pubtype = dbi_result_get_string_idx(dbires_ref, 1); /* 1-base index */ - LOG_PRINT(LOG_DEBUG, item_pubtype); +/* LOG_PRINT(LOG_DEBUG, item_pubtype); */ /* loop over all columns except pubtype which is a constant prefix */ for (i = 1; i < dbi_result_get_numfields(dbires_ref); i++) { item = dbi_result_get_string_idx(dbires_ref, i+1); /* 1-base index */ if (item && *item) { - LOG_PRINT(LOG_DEBUG, item); +/* LOG_PRINT(LOG_DEBUG, item); */ /* we assemble the variable name from the publication type and the column name. The variable value is the value of the column */ if (n_ref_format == REFDOCBK) { @@ -2707,10 +2720,10 @@ item_pubtype = dbi_result_get_string_idx(dbires_ref, 1); /* 1-base index */ - LOG_PRINT(LOG_DEBUG, item_pubtype); +/* LOG_PRINT(LOG_DEBUG, item_pubtype); */ /* loop over all columns except pubtype which is a constant prefix*/ for (i = 1; i < dbi_result_get_numfields(dbires_ref); i++) { item = dbi_result_get_string_idx(dbires_ref, i+1); /* 1-base index */ if (item && *item) { - LOG_PRINT(LOG_DEBUG, item); +/* LOG_PRINT(LOG_DEBUG, item); */ /* we assemble the variable name from the publication type and the column name. The variable value is the value of the column */ sprintf(outbuffer, "(define %s%s \"%s\")\n", item_pubtype, tags[i-1], item); Index: xmlhandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/xmlhandler.c,v retrieving revision 1.22.2.19 retrieving revision 1.22.2.20 diff -u -U2 -r1.22.2.19 -r1.22.2.20 --- xmlhandler.c 11 Sep 2005 19:55:12 -0000 1.22.2.19 +++ xmlhandler.c 29 Sep 2005 22:35:59 -0000 1.22.2.20 @@ -470,4 +470,5 @@ if (*((ptr_asdata->ptr_first)->elname) == 'U' + || ptr_attr == NULL /* 0 is implied default */ || strcmp(ptr_attr, "0") == 0) { strcpy(concat, "LINK0"); @@ -1349,6 +1350,12 @@ char* new_attrvalue; char* item; + char* reftype = NULL; + char* my_xaempty = NULL; + char *my_refdb_title = NULL; + char titlespec[16]; char periodical[256] = ""; const char *drivername; /* name of the libdbi driver */ + int use_qtitle = 0; + int use_ztitle = 0; unsigned long long temp_id; unsigned long long real_orig_id; @@ -1407,5 +1414,5 @@ /* retrieve corresponding ID for this citekey */ if (!strcmp(my_dbi_conn_get_cap(ptr_gbdata->conn, "multiple_db"), "t")) { - sprintf(sql_command, "SELECT refdb_id FROM %s.t_refdb WHERE refdb_citekey='%s' AND refdb_type!='DUMMY'", database, id_string); + sprintf(sql_command, "SELECT refdb_id, refdb_type FROM %s.t_refdb WHERE refdb_citekey='%s' AND refdb_type!='DUMMY'", database, id_string); dbires = dbi_conn_query(ptr_gbdata->conn, sql_command); } @@ -1416,5 +1423,5 @@ return; } - sprintf(sql_command, "SELECT refdb_id FROM t_refdb WHERE refdb_citekey='%s' AND refdb_type!='DUMMY'", id_string); + sprintf(sql_command, "SELECT refdb_id, refdb_type FROM t_refdb WHERE refdb_citekey='%s' AND refdb_type!='DUMMY'", id_string); dbires = dbi_conn_query(conn_source, sql_command); } @@ -1429,4 +1436,5 @@ if (dbi_result_next_row(dbires)) { real_orig_id = my_dbi_result_get_idval(dbires, "refdb_id"); + reftype = my_dbi_result_get_string_copy(dbires, "refdb_type"); } else { @@ -1442,5 +1450,5 @@ /* we still have to query the database as the dataset may be missing */ if (!strcmp(my_dbi_conn_get_cap(ptr_gbdata->conn, "multiple_db"), "t")) { - sprintf(sql_command, "SELECT refdb_id FROM %s.t_refdb WHERE refdb_id='%s' AND refdb_type!='DUMMY'", database, id_string); + sprintf(sql_command, "SELECT refdb_id, refdb_type FROM %s.t_refdb WHERE refdb_id='%s' AND refdb_type!='DUMMY'", database, id_string); dbires = dbi_conn_query(ptr_gbdata->conn, sql_command); } @@ -1451,5 +1459,5 @@ return; } - sprintf(sql_command, "SELECT refdb_id FROM t_refdb WHERE refdb_id='%s' AND refdb_type!='DUMMY'", id_string); + sprintf(sql_command, "SELECT refdb_id, refdb_type FROM t_refdb WHERE refdb_id='%s' AND refdb_type!='DUMMY'", id_string); dbires = dbi_conn_query(conn_source, sql_command); } @@ -1465,4 +1473,5 @@ if (dbi_result_next_row(dbires)) { real_orig_id = my_dbi_result_get_idval(dbires, "refdb_id"); + reftype = my_dbi_result_get_string_copy(dbires, "refdb_type"); } else { @@ -1487,4 +1496,5 @@ ptr_gbdata->ptr_curr_multi_id = new_id; } + free(reftype); } else { @@ -1492,4 +1502,52 @@ dbi_driver driver; + /* see whether the style requests to use titles in place of missing + authors */ + if (!strcmp(my_dbi_conn_get_cap(ptr_gbdata->conn_refdb, "multiple_db"), "t")) { + sprintf(sql_command, "SELECT QAEMPTY,XAEMPTY FROM %s.REFSTYLE, %s.CITSTYLE WHERE REFSTYLE.CITSTYLEID=CITSTYLE.ID AND REFSTYLE.PUBTYPE='%s' AND JOURNAL=%s", MAIN_DB, MAIN_DB, reftype, ptr_gbdata->quoted_journal); + } + else { + sprintf(sql_command, "SELECT QAEMPTY,XAEMPTY FROM REFSTYLE, CITSTYLE WHERE REFSTYLE.CITSTYLEID=CITSTYLE.ID AND REFSTYLE.PUBTYPE='%s' AND JOURNAL=%s", reftype, ptr_gbdata->quoted_journal); + } + + LOG_PRINT(LOG_DEBUG, sql_command); + dbires = dbi_conn_query(ptr_gbdata->conn_refdb, sql_command); + if (!dbires) { + LOG_PRINT(LOG_WARNING, "accessing style data failed"); + (*(ptr_gbdata->ptr_ndb_error))++; + } + else { + const char *string; + + if (dbi_result_next_row(dbires)) { + string = my_dbi_result_get_string(dbires, "QAEMPTY"); +/* printf("string went to %s<<\n", string); */ + if (string && !*string) { + use_qtitle = 1; + } +/* string = my_dbi_result_get_string(dbires, "ZAEMPTY"); */ +/* if (string && !strlen(string)) { */ +/* use_ztitle = 1; */ +/* printf("hi there0\n"); */ +/* } */ + else if (string) { + my_xaempty = strdup(string); + if (!my_xaempty || !dbi_conn_quote_string(ptr_gbdata->conn, &my_xaempty)) { + LOG_PRINT(LOG_WARNING, "out of memory"); + (*(ptr_gbdata->ptr_nmem_error))++; + } + } + } /* end if have rows */ + dbi_result_free(dbires); + } /* end if have result */ + + if (!strcmp(reftype, "BOOK")) { + strcpy(titlespec, "refdb_booktitle"); + } + else { + strcpy(titlespec, "refdb_title"); + } + free(reftype); + driver = dbi_conn_get_driver(ptr_gbdata->conn); @@ -1498,5 +1556,5 @@ /* create a new row with INSERT */ if (!strcmp(my_dbi_conn_get_cap(ptr_gbdata->conn, "multiple_db"), "t")) { - sprintf(sql_command, "INSERT INTO %s (article_title,volume,issue,startpage,pubyear) SELECT refdb_title,refdb_volume,refdb_issue,refdb_startpage,refdb_pubyear FROM %s.t_refdb WHERE refdb_id="ULLSPEC, ptr_gbdata->ptr_table_name, database, (unsigned long long)real_orig_id); + sprintf(sql_command, "INSERT INTO %s (article_title,volume,issue,startpage,pubyear) SELECT %s,refdb_volume,refdb_issue,refdb_startpage,refdb_pubyear FROM %s.t_refdb WHERE refdb_id="ULLSPEC, ptr_gbdata->ptr_table_name, titlespec, database, (unsigned long long)real_orig_id); LOG_PRINT(LOG_DEBUG, sql_command); dbires = dbi_conn_query(ptr_gbdata->conn, sql_command); @@ -1511,4 +1569,20 @@ /* save new temp id */ temp_id = dbi_conn_sequence_last(ptr_gbdata->conn, NULL); + + /* get refdb_title separately, as we need it further down */ + sprintf(sql_command, "SELECT %s,refdb_volume,refdb_issue,refdb_startpage,refdb_pubyear FROM t_refdb WHERE refdb_id="ULLSPEC, titlespec, (unsigned long long)real_orig_id); + LOG_PRINT(LOG_DEBUG, sql_command); + dbires = dbi_conn_query(ptr_gbdata->conn, sql_command); + if (!dbires) { + LOG_PRINT(LOG_WARNING, "source table select failed"); + (*(ptr_gbdata->ptr_ndb_error))++; + } + else { + if (dbi_result_next_row(dbires)) { + my_refdb_title = my_dbi_result_get_string_copy(dbires, titlespec); + /* the quote_string function checks for non-NULL arguments */ + dbi_conn_quote_string(ptr_gbdata->conn, &my_refdb_title); + } + } } else { @@ -1522,5 +1596,5 @@ return; } - sprintf(sql_command, "SELECT refdb_title,refdb_volume,refdb_issue,refdb_startpage,refdb_pubyear FROM t_refdb WHERE refdb_id="ULLSPEC, (unsigned long long)real_orig_id); + sprintf(sql_command, "SELECT %s,refdb_volume,refdb_issue,refdb_startpage,refdb_pubyear FROM t_refdb WHERE refdb_id="ULLSPEC, titlespec, (unsigned long long)real_orig_id); LOG_PRINT(LOG_DEBUG, sql_command); dbires = dbi_conn_query(conn_source, sql_command); @@ -1532,10 +1606,9 @@ if (dbi_result_next_row(dbires)) { /* get strings quoted properly */ - char *my_refdb_title; char *my_refdb_volume; char *my_refdb_issue; char *my_refdb_startpage; - my_refdb_title = my_dbi_result_get_string_copy(dbires, "refdb_title"); + my_refdb_title = my_dbi_result_get_string_copy(dbires, titlespec); my_refdb_volume = my_dbi_result_get_string_copy(dbires, "refdb_volume"); my_refdb_issue = my_dbi_result_get_string_copy(dbires, "refdb_issue"); @@ -1551,7 +1624,4 @@ LOG_PRINT(LOG_DEBUG, sql_command); - if (my_refdb_title) { - free(my_refdb_title); - } if (my_refdb_volume) { free(my_refdb_volume); @@ -1604,35 +1674,80 @@ } else { - while ((query_result = get_author(dbires1)) != NULL) { - char *author_q; - - author_q = strdup(query_result); - if (!author_q || dbi_conn_quote_string(ptr_gbdata->conn, &author_q) == 0) { - LOG_PRINT(LOG_WARNING, "out of memory"); - (*(ptr_gbdata->ptr_nmem_error))++; - } - else if (*author_q) { - /* the quoted author is enclosed in quotes (who - would have thought?) but we don't need these - here; we need only the internal quotes */ - author_q[strlen(author_q)-1] = '\0'; - - if ((new_sql_command = mstrcat(sql_command, author_q + 1, &sql_command_len, 0)) == NULL) { + if (!get_num_authors(dbires1)) { +/* printf("num_authors went to zero\n"); */ + /* if no authors, use AEMPTY or title here */ + if (my_xaempty) { +/* printf("use xaempty %s\n", my_xaempty); */ + /* my_xaempty is quoted, but we need only the + internal quotes */ + my_xaempty[strlen(my_xaempty)-1] = '\0'; + if ((new_sql_command = mstrcat(sql_command, my_xaempty + 1, &sql_command_len, 0)) == NULL) { (*(ptr_gbdata->ptr_nmem_error))++; - break; } else { sql_command = new_sql_command; } - - free(author_q); + } + else if (use_qtitle) { +/* printf("use qtitle %s\n", my_refdb_title); */ + use_qtitle++; /* means we really use the title */ + if (my_refdb_title) { + /* my_refdb_title is quoted, but we need only the + internal quotes */ + my_refdb_title[strlen(my_refdb_title)-1] = '\0'; + if ((new_sql_command = mstrcat(sql_command, my_refdb_title + 1, &sql_command_len, 0)) == NULL) { + (*(ptr_gbdata->ptr_nmem_error))++; + } + else { + sql_command = new_sql_command; + } + } } } - - if ((new_sql_command = mstrcat(sql_command, "\' WHERE id=", &sql_command_len, 0)) == NULL) { - (*(ptr_gbdata->ptr_nmem_error))++; + else { /* have authors */ +/* printf("have at least one author\n"); */ + while ((query_result = get_author(dbires1)) != NULL) { + char *author_q; + + author_q = strdup(query_result); + if (!author_q || dbi_conn_quote_string(ptr_gbdata->conn, &author_q) == 0) { + LOG_PRINT(LOG_WARNING, "out of memory"); + (*(ptr_gbdata->ptr_nmem_error))++; + } + else if (*author_q) { + /* the quoted author is enclosed in quotes (who + would have thought?) but we don't need these + here; we need only the internal quotes */ + author_q[strlen(author_q)-1] = '\0'; + + if ((new_sql_command = mstrcat(sql_command, author_q + 1, &sql_command_len, 0)) == NULL) { + (*(ptr_gbdata->ptr_nmem_error))++; + break; + } + else { + sql_command = new_sql_command; + } + + free(author_q); + } /* end if no mem error */ + } /* end while have author */ + } /* end if have authors */ + + if (use_qtitle == 2) { + if ((new_sql_command = mstrcat(sql_command, "\', title_as_author=1 WHERE id=", &sql_command_len, 0)) == NULL) { + (*(ptr_gbdata->ptr_nmem_error))++; + } + else { + sql_command = new_sql_command; + } } else { - sql_command = new_sql_command; + /* title_as_author has a default of 0, no need to alter it */ + if ((new_sql_command = mstrcat(sql_command, "\' WHERE id=", &sql_command_len, 0)) == NULL) { + (*(ptr_gbdata->ptr_nmem_error))++; + } + else { + sql_command = new_sql_command; + } } clean_request(dbires1); @@ -1655,4 +1770,8 @@ } + if (my_refdb_title) { + free(my_refdb_title); + } + /* journal */ sprintf(sql_command, "UPDATE %s SET periodical=\'", ptr_gbdata->ptr_table_name); Index: xmlhandler.h =================================================================== RCS file: /cvsroot/refdb/refdb/src/xmlhandler.h,v retrieving revision 1.6.2.4 retrieving revision 1.6.2.5 diff -u -U2 -r1.6.2.4 -r1.6.2.5 --- xmlhandler.h 11 Sep 2005 19:55:12 -0000 1.6.2.4 +++ xmlhandler.h 29 Sep 2005 22:35:59 -0000 1.6.2.5 @@ -51,9 +51,11 @@ struct getbib_data { char* ptr_default_db; - dbi_conn conn; + dbi_conn conn; /* connection to the reference database */ + dbi_conn conn_refdb; /* connection to the style database */ int* ptr_citation_count; /* counter for citations in id handler */ int* ptr_xref_count; /* counter for xrefs in id handler */ char* ptr_table_name; /* unique table name for temporary table */ char* ptr_curr_multi_id; /* ptr to the current multiple citation id */ + char* quoted_journal; /* name of the style to be used */ size_t* ptr_cmid_len; /* ptr to int containing allocated length of ptr_curr_multi_id */ int* ptr_nmem_error; /* if != 0, out of memory error occurred */ |