refdb-cvs Mailing List for RefDB (Page 54)
Status: Beta
Brought to you by:
mhoenicka
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(47) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(88) |
Feb
(50) |
Mar
(36) |
Apr
(9) |
May
(30) |
Jun
(30) |
Jul
(22) |
Aug
(16) |
Sep
(42) |
Oct
(18) |
Nov
(29) |
Dec
(23) |
2005 |
Jan
(18) |
Feb
(28) |
Mar
(21) |
Apr
(35) |
May
(62) |
Jun
(22) |
Jul
(5) |
Aug
(40) |
Sep
(98) |
Oct
(81) |
Nov
(51) |
Dec
(62) |
2006 |
Jan
(46) |
Feb
(36) |
Mar
(8) |
Apr
(16) |
May
(14) |
Jun
(16) |
Jul
(47) |
Aug
(60) |
Sep
(34) |
Oct
(16) |
Nov
(46) |
Dec
(11) |
2007 |
Jan
(16) |
Feb
(13) |
Mar
(58) |
Apr
(32) |
May
(4) |
Jun
(8) |
Jul
(31) |
Aug
(46) |
Sep
(22) |
Oct
(30) |
Nov
(58) |
Dec
(15) |
2008 |
Jan
(8) |
Feb
(8) |
Mar
(2) |
Apr
(6) |
May
(3) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
|
Oct
(6) |
Nov
(3) |
Dec
(5) |
2009 |
Jan
(1) |
Feb
(20) |
Mar
(8) |
Apr
(5) |
May
(8) |
Jun
(3) |
Jul
(6) |
Aug
(4) |
Sep
(7) |
Oct
(8) |
Nov
(2) |
Dec
(1) |
2010 |
Jan
(1) |
Feb
(4) |
Mar
|
Apr
|
May
(1) |
Jun
(1) |
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2011 |
Jan
(5) |
Feb
(5) |
Mar
(13) |
Apr
(3) |
May
|
Jun
|
Jul
(4) |
Aug
|
Sep
(2) |
Oct
|
Nov
|
Dec
|
2012 |
Jan
(1) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(5) |
Nov
|
Dec
(3) |
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(13) |
2014 |
Jan
(2) |
Feb
(2) |
Mar
(2) |
Apr
(4) |
May
(1) |
Jun
(1) |
Jul
|
Aug
(6) |
Sep
(3) |
Oct
|
Nov
(2) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
(1) |
Nov
(1) |
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
(5) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
2019 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2021 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2022 |
Jan
(9) |
Feb
(16) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Markus H. <mho...@us...> - 2005-05-08 21:34:28
|
Update of /cvsroot/refdb/homepage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25100 Modified Files: index.html Log Message: added message about addons Index: index.html =================================================================== RCS file: /cvsroot/refdb/homepage/index.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -U2 -r1.4 -r1.5 --- index.html 8 May 2005 21:24:33 -0000 1.4 +++ index.html 8 May 2005 21:34:19 -0000 1.5 @@ -129,4 +129,8 @@ <h2>News</h2> <div class="news"> + <h3>May 8, 2005</h3> + <p>There is a new page about <a href="addons.html">additional software</a> not shipped with RefDB, but nevertheless more than helpful. This page contains descriptions of RIS editing modes for Emacs and Vim, the Emacs RefDB frontend, the Makestyle bibliography style generation tool, and the Perl Client module.</p> + </div> + <div class="news"> <h3>May 2, 2005</h3> <p>A <a href="http://www.freebsd.org">FreeBSD</a> port is now available. Please see the instructions on the <a href="download.html#freebsd">download</a> page. See also this <a href="http://sourceforge.net/mailarchive/forum.php?thread_id=7160760&forum_id=1798">thread</a> for some additional information.</p> |
From: Markus H. <mho...@us...> - 2005-05-08 21:25:45
|
Update of /cvsroot/refdb/homepage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23010 Added Files: addons.html Log Message: initial version --- NEW FILE --- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <!-- $Id --> <head> <title>RefDB add-ons</title> <meta name="author" content="Markus Hoenicka" /> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> <meta name="description" content="Homepage of the RefDB project, a reference manager and bibliography tool for structured texts" /> <link rel="stylesheet" type="text/css" href="refdbn.css" title="RefDB" media="screen, projection" /> <link rel="alternate stylesheet" type="text/css" href="refdbprint.css" title="Printer friendly" media="print, embossed, screen, projection" /> </head> <body> <!-- the page header, to be displayed across the top of the page --> <div id="head"> <div id="headleft"> <a href="http://refdb.sourceforge.net/"><img src="logo.jpg" alt="logo" border="0" /></a> </div> <div id="headright"> <table> <tbody> <tr> <td class="tag"><</td> <td class="graphic"> </td> <td class="tag">/></td> </tr> <tr> <td> </td> <td class="text">bibliographies beyond word processors</td> <td> </td> </tr> </tbody> </table> </div> </div> <div id="left"> <!-- the navigation box --> <div class="leftcontent"> <table class="nav"> <thead> <tr> <td class="nav">Navigation</td> </tr> </thead> <tbody> <tr> <td class="nav"><a href="index.html">Home</a></td> </tr> <tr> <td class="nav"><a href="features.html">Features</a></td> </tr> <tr> <td class="nav"><a href="features.html">System requirements</a></td> </tr> <tr> <td class="nav"><a href="status.html">Current Status</a></td> </tr> <tr> <td class="nav"><a href="doc.html">Documentation</a></td> </tr> <tr> <td class="nav"><a href="examples.html">Examples</a></td> </tr> <tr> <td class="nav"><a href="download.html">Download</a></td> </tr> <tr> <td class="navsel">Add-ons</td> </tr> </tbody> </table> </div> <div class="leftcontent"> <table class="nav"> <thead> <tr> <td class="nav">Links</td> </tr> </thead> <tbody> <tr> <td class="nav"><a href="http://www.sourceforge.net/projects/refdb">Project page</a></td> </tr> <tr> <td class="nav"><a href="http://sourceforge.net"> <img src="http://sourceforge.net/sflogo.php?group_id=26091&type=1" width="88" height="31" border="0" alt="SourceForge Logo" /></a></td> </tr> <tr> <td class="nav"><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" border="0" /></a></td> </tr> <tr> <td class="nav"><a href="http://jigsaw.w3.org/css-validator/"><img src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!" height="31" width="88" border="0" /></a></td> </tr> </tbody> </table> </div> </div> <!-- the main text area, fills most of the page --> <div id="main"> <h1>RefDB add-ons</h1> <p>Useful software which is not packaged with RefDB but which greatly enhances your experience is available from this page. There are RIS editing modes for Emacs and for Vim (remember that you can use any run-of-the-mill XML mode or XML editor for editing risx files), a RefDB frontend for Emacs, a script to write bibliography styles from scratch, and a Client module for Perl programmers.</p> <div class="localnav"> <table class="localnav"> <thead> <tr> <td class="localnav">On this page</td> </tr> </thead> <tbody> <tr> <td class="localnav"><a href="#ris-mode">Emacs ris-mode</a></td> </tr> <tr> <td class="localnav"><a href="#refdb-mode">Emacs refdb-mode</a></td> </tr> <tr> <td class="localnav"><a href="#vim">Vim syntax, filetype and plugin files</a></td> </tr> <tr> <td class="localnav"><a href="#makestyle">Makestyle (bibliography style generator)</a></td> </tr> <tr> <td class="localnav"><a href="#perlmod">Perl client module</a></td> </tr> </tbody> </table> </div> <h2 id="ris-mode">Emacs ris-mode</h2> <p>Author: Markus Hoenicka <mho...@us...></p> <p>If your editor of choice should be <a href="http://directory.fsf.org/emacs.html">Emacs</a> or <a href="http://www.xemacs.org/">XEmacs</a>, the RIS major mode (ris.el) will make editing RIS datasets a little bit more comfortable.</p> <ul> <li>Font-locking will help you to spot syntax errors. Especially the end tag (ER - ) is prone to lack the trailing space if you're not careful. The ris-mode displays valid tags in blue, except the special type (TY - ) and end (ER - ) tags which are shown in red. The tag contents are colored according to several criteria. If the contents of a field is limited in length, the color will extend only up to that limit. Author/editor, publication date, and reprint fields are checked for a valid content.</li> <li>ris-mode provides three commands to insert datasets ("references") and individual tags as described shortly. All of these commands have in common that they always start a new line after the current line if the cursor is not at the start of a line. Thus you can run these commands from any position of the current line and still get something that makes sense as a RIS dataset.</li> <li>Run the command <code>insert-set</code> (C-c-C-s) to insert a new skeleton dataset (a "reference"). The function will prompt you to enter the publication type. You can use either the auto-completion feature of the minibuffer to enter a valid type or the history feature to select a previously entered type. The function will create a newline, a type tag with the type you selected, default sets of tags for a selected range of types, as well as an end tag.</li> <li>You can insert a new tag at the beginning of a line with the command <code>insert-tag</code> which is bound to C-c-C-t. Use either the auto-completion feature of the minibuffer to enter a valid tag or the history feature to select a previously entered tag.</li> <li>You can insert a new line below the current line with the same tag as the current line with the command <code>duplicate-tag</code>. This is bound to M-RET. This command is convenient if you add multiple keywords or authors, each of which have to go on separate tag lines.</li> <li>You can move between RIS datasets with the commands <code>backward-set</code> (C-x[) and <code>forward-set</code> (C-x]). You can narrow the buffer to the current RIS set with the command <code>narrow-to-set</code> (C-xns). To widen to the full buffer contents again you'd use C-xnw as usual.</li> </ul> <p>The mode currently does not check the length of author entries, nor does it handle continued lines in any way. It does not attempt to check whether a reference is complete (e.g. it won't notify you if there is no author)</p> <p>To install this mode on your system, follow the instructions in the manual or in the elisp code. <a href="addons/ris.el">Download ris.el (1.9)</a></p> <p class="legend"><a href="rismode.png"><img alt="Emacs ris-mode" src="rismode-small.jpg"/></a></p> <p class="legend"><strong>Fig. 1:</strong> Emacs ris-mode. Click on the image to see a <a href="rismode.png">larger version</a>. The reference shows the effects of a few common syntax errors: (1) the last author has a space after the period, (2) the secondary publication date lacks the mandatory slashes, (3) the JF tag is misspelled, and (4) the ER tag lacks the trailing space. Note also that fields with unlimited length (like AD) and fields with limited length (like KW) are colored differently.</p> <h2 id="refdb-mode">Emacs refdb-mode</h2> <p>Author: Michael Smith <xm...@us...></p> <p>This minor mode for <a href="http://directory.fsf.org/emacs.html">Emacs</a> and <a href="http://www.xemacs.org/">XEmacs</a> is a frontend for the most common RefDB commands. It works nicely alongside the major modes ris-mode, nxml-mode, and PSGML. It provides menu entries to add, update, delete, and search for references. Retrieved references in either RIS or risx format can be edited in place and subsequently be updated in the database. HTML and XHTML output can be sent to a browser of your choice (including the built-in w3 mode) automatically.</p> <p>To install this mode on your system, follow the instructions in the elisp code. <a href="addons/refdb-mode.el">Download refdb-mode.el (1.9)</a></p> <p class="legend"><a href="refdbmode.png"><img alt="Emacs refdb-mode" src="refdbmode-small.jpg"/></a></p> <p class="legend"><strong>Fig. 2:</strong> Emacs refdb-mode. Click on the image to see a <a href="refdbmode.png">larger version</a>. The menu allows easy access to the most common reference manipulation commands.</p> <h2 id="vim">Vim syntax, filetype and plugin files</h2> <p>Author: David Nebauer <dav...@sw...></p> <p>If <a href="http://www.vim.org">Vim</a> is the editor of your choice, this set of files comes in handy to edit RIS files.</p> <ul> <li>The syntax file enables Vim to highlight legal tags and mark illegal tags as errors.</li> <li>It also highlights correct field values, thus helping users to avoid invalid field values.</li> <li>It checks the syntax of author names, dates and journal abbreviation fields.</li> <li>It checks the values in reprint and pubtype fields.</li> <li>It checks the length of length-limited fields and does some other rudimentary error checking.</li> </ul> <p>What the syntax file does <b>not</b> currently do is:</p> <ul> <li>check the length of the 'otherinfo' component of a date field</li> <li>handle line continuations ('/$') -- it assumes all fields are a single line</li> </ul> <p>The plugin file supplies four convenience commands mapped to keyboard shortcuts:</p> <ul> <li>\a = insert RIS tag (select from menu)</li> <li>\p = insert publication type (select from menu)</li> <li>\d = duplicate current/previous tag</li> <li>\t = add reference template (group of blank tags; choose from three templates: journal|book|other)</li> </ul> <p>To install these files on your system, follow the instructions in the archive. <a href="addons/vimhelper-1.0.tar.gz">Download vimhelper.tar.gz (1.0)</a></p> <p class="legend"><a href="vim.png"><img alt="Vim editing RIS" src="vim-small.jpg"/></a></p> <p class="legend"><strong>Fig. 3:</strong> Vim editing RIS. Click on the image to see a <a href="vim.png">larger version</a>. The image shows how Vim spots a few of the common syntax errors: (1) the second author uses a space after the comma, (2) the publication date lacks the mandatory slashes, and (3) the end tag lacks the trailing space.</p> <h2 id="makestyle">Makestyle (bibliography style generator)</h2> <p>Author: David Nebauer <dav...@sw...></p> <p>refdb-ms is a Perl script which helps to write bibliography and citation style specifications for RefDB from scratch. If a regular XML editor does not feel right for you, try this script. It shows valid elements at the current point, just like an XML editor would do, but provides additional help about the purpose of each element.</p> <p>To install the script on your system, follow the instructions in the archive. <a href="addons/makestyle-1.0.tar.gz">Download makestyle.tar.gz (1.0)</a></p> <p class="legend"><a href="makestyle.png"><img alt="Vim editing RIS" src="makestyle-small.jpg"/></a></p> <p class="legend"><strong>Fig. 3:</strong> Creating a bibliography style with refdb-ms. Click on the image to see a <a href="makestyle.png">larger version</a>. The script walks you through the process of writing a style by providing valid entries at the current point along with an explanation of what each element is good for.</p> <h2 id="perlmod">Perl client module</h2> <p>Author: Markus Hoenicka <mho...@us...></p> <p>The Perl client module <code>RefDBClient::Client</code> allows Perl programmers to access the refdbd server from Perl scripts. The client/server dialog is implemented entirely in Perl. That is, you don't need the C clients installed on your system in order to run a Perl script using this module. The module allows an object-oriented approach to all RefDB client commands.</p> <p>Creating a Perl script that interacts with refdbd is straightforward and simple. First, you create a new instance of <code>RefDBClient::Client</code> and set the initial communication parameters:</p> <pre class="source"> use RefDBClient::Client; my $client = new RefDBClient::Client; $client->set_conninfo("127.0.0.1", "9734", "markus", "pass", "refdbtest", "/home/markus/literature", "/usr/local/share/refdb/css/refdb.css"); </pre> <p>Now you can call any client command and read the retrieved data, if any, into Perl variables:</p> <pre class="source"> my $summary = $client->refdb_listdb(""); my $data = $client->get_data(); print "$data\n"; </pre> <p>This sixliner prints the available RefDB databases to stdout.</p> <p>Please follow the instructions in the INSTALL file of the archive to install this module properly on your system. <a href="pre/RefDBClient-Client-1.11.tar.gz">Download RefDBClient-Client-1.11.tar.gz</a></p> </div> <!-- the footer, to be displayed across the page at the bottom --> <div id="foot"> <div id="footleft">$Date: 2005/05/08 21:25:29 $</div> <div id="footright">Copyright 2005 <a href="mailto:mho...@us...">Markus Hoenicka</a></div> </div> </body> </html> |
From: Markus H. <mho...@us...> - 2005-05-08 21:24:47
|
Update of /cvsroot/refdb/homepage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22667 Modified Files: doc.html download.html examples.html features.html index.html status.html sysreq.html Log Message: added addons page Index: doc.html =================================================================== RCS file: /cvsroot/refdb/homepage/doc.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -U2 -r1.4 -r1.5 --- doc.html 19 Apr 2005 20:37:26 -0000 1.4 +++ doc.html 8 May 2005 21:24:33 -0000 1.5 @@ -70,4 +70,7 @@ <td class="nav"><a href="download.html">Download</a></td> </tr> + <tr> + <td class="nav"><a href="addons.html">Add-ons</a></td> + </tr> </tbody> </table> Index: download.html =================================================================== RCS file: /cvsroot/refdb/homepage/download.html,v retrieving revision 1.6 retrieving revision 1.7 diff -u -U2 -r1.6 -r1.7 --- download.html 4 May 2005 19:51:21 -0000 1.6 +++ download.html 8 May 2005 21:24:33 -0000 1.7 @@ -70,4 +70,7 @@ <td class="navsel">Download</td> </tr> + <tr> + <td class="nav"><a href="addons.html">Add-ons</a></td> + </tr> </tbody> </table> Index: examples.html =================================================================== RCS file: /cvsroot/refdb/homepage/examples.html,v retrieving revision 1.4 retrieving revision 1.5 diff -u -U2 -r1.4 -r1.5 --- examples.html 9 Jan 2005 21:28:57 -0000 1.4 +++ examples.html 8 May 2005 21:24:33 -0000 1.5 @@ -70,4 +70,7 @@ <td class="nav"><a href="download.html">Download</a></td> </tr> + <tr> + <td class="nav"><a href="addons.html">Add-ons</a></td> + </tr> </tbody> </table> Index: features.html =================================================================== RCS file: /cvsroot/refdb/homepage/features.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -U2 -r1.3 -r1.4 --- features.html 16 Mar 2005 20:35:20 -0000 1.3 +++ features.html 8 May 2005 21:24:33 -0000 1.4 @@ -70,4 +70,7 @@ <td class="nav"><a href="download.html">Download</a></td> </tr> + <tr> + <td class="nav"><a href="addons.html">Add-ons</a></td> + </tr> </tbody> </table> Index: index.html =================================================================== RCS file: /cvsroot/refdb/homepage/index.html,v retrieving revision 1.3 retrieving revision 1.4 diff -u -U2 -r1.3 -r1.4 --- index.html 4 May 2005 20:16:18 -0000 1.3 +++ index.html 8 May 2005 21:24:33 -0000 1.4 @@ -70,4 +70,7 @@ <td class="nav"><a href="download.html">Download</a></td> </tr> + <tr> + <td class="nav"><a href="addons.html">Add-ons</a></td> + </tr> </tbody> </table> Index: status.html =================================================================== RCS file: /cvsroot/refdb/homepage/status.html,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -U2 -r1.1.1.1 -r1.2 --- status.html 13 Dec 2004 21:19:39 -0000 1.1.1.1 +++ status.html 8 May 2005 21:24:33 -0000 1.2 @@ -70,4 +70,7 @@ <td class="nav"><a href="download.html">Download</a></td> </tr> + <tr> + <td class="nav"><a href="addons.html">Add-ons</a></td> + </tr> </tbody> </table> Index: sysreq.html =================================================================== RCS file: /cvsroot/refdb/homepage/sysreq.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -U2 -r1.2 -r1.3 --- sysreq.html 16 Mar 2005 20:34:29 -0000 1.2 +++ sysreq.html 8 May 2005 21:24:33 -0000 1.3 @@ -70,4 +70,7 @@ <td class="nav"><a href="download.html">Download</a></td> </tr> + <tr> + <td class="nav"><a href="addons.html">Add-ons</a></td> + </tr> </tbody> </table> |
From: Markus H. <mho...@us...> - 2005-05-08 21:23:22
|
Update of /cvsroot/refdb/homepage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22453 Modified Files: Makefile Log Message: added addons page Index: Makefile =================================================================== RCS file: /cvsroot/refdb/homepage/Makefile,v retrieving revision 1.3 retrieving revision 1.4 diff -u -U2 -r1.3 -r1.4 --- Makefile 7 Apr 2005 18:44:48 -0000 1.3 +++ Makefile 8 May 2005 21:23:13 -0000 1.4 @@ -2,5 +2,5 @@ # These files are to be installed -objects = doc.html download.html examples.html features.html index.html status.html sysreq.html getref.html refdb.css refdbn.css refdbprint.css bookback1.jpg books.jpg docbook-ay.pdf docbook-n.pdf logo.jpg tei-ay.pdf tei-n.pdf refdbinput.png refdbinput-small.png refdboutput.png refdboutput-small.png +objects = doc.html download.html examples.html features.html index.html status.html sysreq.html addons.html getref.html refdb.css refdbn.css refdbprint.css bookback1.jpg books.jpg docbook-ay.pdf docbook-n.pdf logo.jpg tei-ay.pdf tei-n.pdf refdbinput.png refdbinput-small.png refdboutput.png refdboutput-small.png makestyle-small.jpg makestyle.png refdbmode-small.jpg refdbmode.png rismode-small.jpg rismode.png vim-small.jpg vim.png install: |
From: Markus H. <mho...@us...> - 2005-05-08 19:34:10
|
Update of /cvsroot/refdb/elisp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30919 Modified Files: ris.el Log Message: simplified regexps;added support for L1 through L4;moved UR to unlimited size Index: ris.el =================================================================== RCS file: /cvsroot/refdb/elisp/ris.el,v retrieving revision 1.8 retrieving revision 1.9 diff -u -U2 -r1.8 -r1.9 --- ris.el 8 May 2005 16:15:47 -0000 1.8 +++ ris.el 8 May 2005 19:34:02 -0000 1.9 @@ -75,21 +75,27 @@ (defvar ris-font-lock-keywords '( -;; three possible values. ON REQUEST must be followed by a date in MM/DD/YY notation +;; three possible values. ON REQUEST must be followed by a date in +;; MM/DD/YY notation ("^RP - \\(\\(IN FILE$\\)\\|\\(NOT IN FILE$\\)\\|\\(ON REQUEST ([0-1][0-9]/[0-3][0-9]/[0-9][0-9])$\\)\\)" 1 'ris-reprint-face t) -;; YYYY/MM/DD/othertext, with MM,DD, and othertext optional. The slashes must still be present. Othertext may not exceed 255 chars +;; YYYY/MM/DD/othertext, with MM,DD, and othertext optional. The +;; slashes must still be present. Othertext may not exceed 255 chars ("^\\(PY\\|Y1\\|Y2\\) - \\([0-9][0-9][0-9][0-9]/\\([0-1][0-9]\\)?/\\([0-3][0-9]\\)?/.\\{0,255\\}\\)" 2 'ris-pubyear-face t) -;; corporate authors do not use a comma. Other authors may use up to two commas, the first to separate first and middle names from the last name, the second to separate an optional suffix. First and middle names may either be abbreviated (with no space following the period), or spelled out. Currently no length checking is implemented - ("^\\(AU\\|A1\\|A2\\|A3\\|ED\\) - \\(\\([^,\n]+,\\([^,\n\\. ]\\(\\.\\|[^,\\.\n]+\\)\\)+\\(,[^,\n ][^,\n]*\\)?$\\)\\|\\([^,\n]+$\\)\\)" 2 'ris-author-face t) +;; corporate authors do not use a comma. Other authors may use up to two +;; commas, the first to separate first and middle names from the last name, +;; the second to separate an optional suffix. First and middle names may +;; either be abbreviated (with no space following the period), or spelled +;; out. Currently no length checking is implemented + ("^\\(AU\\|A[1-3]\\|ED\\) - \\(\\([^,\n]+,\\([^,\n\\. ]\\(\\.\\|[^,\\.\n]+\\)\\)+\\(,[^,\n ][^,\n]*\\)?$\\)\\|\\([^,\n]+$\\)\\)" 2 'ris-author-face t) ;; fields with a limited length of up to 255 chars - ("^\\(ID\\|KW\\|SP\\|EP\\|JF\\|JO\\|JA\\|J1\\|J2\\|VL\\|IS\\|CP\\|CY\\|PB\\|U1\\|U2\\|U3\\|U4\\|U5\\|SN\\|AV\\|M1\\|M2\\|M3\\|UR\\) - \\(.\\{1,255\\}\\)" 2 'ris-main-ltd-face t) + ("^\\(ID\\|KW\\|SP\\|EP\\|JF\\|JO\\|JA\\|J1\\|J2\\|VL\\|IS\\|CP\\|CY\\|PB\\|U[1-5]\\|SN\\|AV\\|M[1-3]\\) - \\(.\\{1,255\\}\\)" 2 'ris-main-ltd-face t) ;; fields with unlimited length - ("^\\(T1\\|TI\\|CT\\|BT\\|N1\\|AB\\|T2\\|T3\\|N2\\|AD\\) - \\(.+\\)" 2 'ris-main-face t) + ("^\\(T[1-3]\\|TI\\|CT\\|BT\\|N1\\|AB\\|N2\\|AD\\|UR\\|L[1-4]\\) - \\(.+\\)" 2 'ris-main-face t) ;; all valid tags except TY and ER - ("^\\(\\(ID\\|T1\\|TI\\|CT\\|BT\\|A1\\|AU\\|Y1\\|PY\\|N1\\|AB\\|KW\\|RP\\|SP\\|EP\\|JF\\|JO\\|JA\\|J1\\|J2\\|VL\\|T2\\|A2\\|ED\\|IS\\|CP\\|CY\\|PB\\|U1\\|U2\\|U3\\|U4\\|U5\\|T3\\|A3\\|N2\\|SN\\|AV\\|Y2\\|M1\\|M2\\|M3\\|AD\\|UR\\) - \\)\\(.+\\)" 1 'ris-tag-face t) + ("^\\(\\(ID\\|T[1-3]\\|TI\\|CT\\|BT\\|A[1-3]\\|AU\\|Y1\\|PY\\|N1\\|AB\\|KW\\|RP\\|SP\\|EP\\|JF\\|JO\\|JA\\|J1\\|J2\\|VL\\|ED\\|IS\\|CP\\|CY\\|PB\\|U[1-5]\\|N2\\|SN\\|AV\\|Y2\\|M[1-3]\\|AD\\|UR\\|L[1-4]\\) - \\)\\(.+\\)" 1 'ris-tag-face t) ;; all valid types and the end tag @@ -168,6 +174,9 @@ ("M3 - " 43) ("AD - " 44) - ("UR - " 45)) nil t))) -; (message (char-to-string (char-before))) + ("UR - " 45) + ("L1 - " 46) + ("L2 - " 47) + ("L3 - " 48) + ("L4 - " 49)) nil t))) (if (not (equal (char-before) 10)) (progn |
From: Markus H. <mho...@us...> - 2005-05-08 16:15:56
|
Update of /cvsroot/refdb/elisp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15591 Modified Files: ris.el Log Message: improved template for new set Index: ris.el =================================================================== RCS file: /cvsroot/refdb/elisp/ris.el,v retrieving revision 1.7 retrieving revision 1.8 diff -u -U2 -r1.7 -r1.8 --- ris.el 8 May 2005 14:33:42 -0000 1.7 +++ ris.el 8 May 2005 16:15:47 -0000 1.8 @@ -222,8 +222,25 @@ (newline) (let ((start-point (point-marker))) - (insert "TY - " set-type "\nER - \n") - (goto-char start-point) - (end-of-line) - (newline)) + ;; create a skeleton based on the publication type + (cond ((or (equal set-type "JOUR") + (equal set-type "JFULL") + (equal set-type "INPR") + (equal set-type "MGZN") + (equal set-type "NEWS") + (equal set-type "ABST")) + (insert "TY - " set-type "\nTI - \nAU - \nJO - \nVL - \nIS - \nSP - \nEP - \nPY - \nER - \n")) + ((or (equal set-type "BOOK") + (equal set-type "RPRT") + (equal set-type "THES")) + (insert "TY - " set-type "\nBT - \nAU - \nPY - \nPB - \nCY - \nER - \n")) + ((or (equal set-type "CHAP") + (equal set-type "CONF")) + (insert "TY - " set-type "\nTI - \nAU - \nBT - \nA2 - \nPY - \nPB - \nCY - \nER - \n")) + ((equal set-type "SER") + (insert "TY - " set-type "\nTI - \nAU - \nBT - \nA2 - \nT3 - \nA3 - \nPY - \nPB - \nCY - \nER - \n")) + (t (insert "TY - " set-type "\nER - \n") + (goto-char start-point) + (end-of-line) + (newline)))) )) |
From: Markus H. <mho...@us...> - 2005-05-08 14:33:51
|
Update of /cvsroot/refdb/elisp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26372 Modified Files: ris.el Log Message: improved author syntax check Index: ris.el =================================================================== RCS file: /cvsroot/refdb/elisp/ris.el,v retrieving revision 1.6 retrieving revision 1.7 diff -u -U2 -r1.6 -r1.7 --- ris.el 8 May 2005 01:05:21 -0000 1.6 +++ ris.el 8 May 2005 14:33:42 -0000 1.7 @@ -81,6 +81,6 @@ ("^\\(PY\\|Y1\\|Y2\\) - \\([0-9][0-9][0-9][0-9]/\\([0-1][0-9]\\)?/\\([0-3][0-9]\\)?/.\\{0,255\\}\\)" 2 'ris-pubyear-face t) -;; corporate authors do not use a comma. Other authors may use up to two commas, the first to separate first and middle names from the last name, the second to separate an optional suffix. Currently no length checking is implemented - ("^\\(AU\\|A1\\|A2\\|A3\\|ED\\) - \\(\\([^,\n]+,[^,\n]+\\(,[^,\n]+\\)?$\\)\\|\\([^,\n]+$\\)\\)" 2 'ris-author-face t) +;; corporate authors do not use a comma. Other authors may use up to two commas, the first to separate first and middle names from the last name, the second to separate an optional suffix. First and middle names may either be abbreviated (with no space following the period), or spelled out. Currently no length checking is implemented + ("^\\(AU\\|A1\\|A2\\|A3\\|ED\\) - \\(\\([^,\n]+,\\([^,\n\\. ]\\(\\.\\|[^,\\.\n]+\\)\\)+\\(,[^,\n ][^,\n]*\\)?$\\)\\|\\([^,\n]+$\\)\\)" 2 'ris-author-face t) ;; fields with a limited length of up to 255 chars |
From: Markus H. <mho...@us...> - 2005-05-08 01:06:00
|
Update of /cvsroot/refdb/elisp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14777 Modified Files: ris.el Log Message: fixed RP date format Index: ris.el =================================================================== RCS file: /cvsroot/refdb/elisp/ris.el,v retrieving revision 1.5 retrieving revision 1.6 diff -u -U2 -r1.5 -r1.6 --- ris.el 7 May 2005 21:27:22 -0000 1.5 +++ ris.el 8 May 2005 01:05:21 -0000 1.6 @@ -76,5 +76,5 @@ '( ;; three possible values. ON REQUEST must be followed by a date in MM/DD/YY notation - ("^RP - \\(\\(IN FILE$\\)\\|\\(NOT IN FILE$\\)\\|\\(ON REQUEST [0-1][0-9]/[0-3][0-9]/[0-9][0-9]\\)\\)" 1 'ris-reprint-face t) + ("^RP - \\(\\(IN FILE$\\)\\|\\(NOT IN FILE$\\)\\|\\(ON REQUEST ([0-1][0-9]/[0-3][0-9]/[0-9][0-9])$\\)\\)" 1 'ris-reprint-face t) ;; YYYY/MM/DD/othertext, with MM,DD, and othertext optional. The slashes must still be present. Othertext may not exceed 255 chars |
From: Markus H. <mho...@us...> - 2005-05-08 00:59:57
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13669 Modified Files: Tag: Release_0_9_5_stable readris.c Log Message: fix RP date output for RIS format Index: readris.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/readris.c,v retrieving revision 1.12.2.1 retrieving revision 1.12.2.2 diff -u -U2 -r1.12.2.1 -r1.12.2.2 --- readris.c 15 Apr 2005 22:45:08 -0000 1.12.2.1 +++ readris.c 8 May 2005 00:59:47 -0000 1.12.2.2 @@ -629,6 +629,8 @@ if (yeardigits == 2) { + /* this is currently only used by the weird RIS output */ + /* the required format is ON REQUEST (MM/DD/YY) */ sprintf(year, "%04d", tm_ptr->tm_year + 1900); - sprintf(datestring, "%s-%02d-%02d", year+2, tm_ptr->tm_mon + 1, tm_ptr->tm_mday); + sprintf(datestring, "%02d/%02d/%s", tm_ptr->tm_mon + 1, tm_ptr->tm_mday, year+2); } else { |
From: Markus H. <mho...@us...> - 2005-05-08 00:12:08
|
Update of /cvsroot/refdb/elisp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3975 Modified Files: refdb-mode.el Log Message: added Update command;force refdbc output to stdout;turn RefDB mode on in output buffers Index: refdb-mode.el =================================================================== RCS file: /cvsroot/refdb/elisp/refdb-mode.el,v retrieving revision 1.8 retrieving revision 1.9 diff -u -U2 -r1.8 -r1.9 --- refdb-mode.el 28 Jan 2004 03:07:57 -0000 1.8 +++ refdb-mode.el 8 May 2005 00:11:53 -0000 1.9 @@ -133,4 +133,5 @@ ;; ;; Add References +;; Update References ;; Get References ;; Select Output Type @@ -147,4 +148,8 @@ ;; RefDB database. (Runs 'refdbc -C addref' on current region.) ;; +;; Update References +;; Update references in the current region in the currently selected +;; RefDB database. (Runs 'refdbc -C updateref' on current region.) +;; ;; Get References ;; Perform queries for data in the currently selected RefDB @@ -176,4 +181,5 @@ ;; ------------------------ ;; refdb-addref-on-region +;; refdb-updateref-on-region ; -- ;; refdb-getref-by-author @@ -335,5 +341,5 @@ :group 'refdb) -(defcustom refdb-refdbc-options "" +(defcustom refdb-refdbc-options "-c stdout" "Global options for refdbc." :set-after '(refdb-database-default) @@ -342,15 +348,20 @@ (defcustom refdb-addref-options "-f stdin" - "Options included when running the 'refdbc -c addref' command." + "Options included when running the 'refdbc -C addref' command." + :type 'string + :group 'refdb) + +(defcustom refdb-updateref-options "-f stdin" + "Options included when running the 'refdbc -C updateref' command." :type 'string :group 'refdb) (defcustom refdb-deleteref-options "-f stdin" - "Options included when running the 'refdbc -c deleteref' command." + "Options included when running the 'refdbc -C deleteref' command." :type 'string :group 'refdb) (defcustom refdb-getref-options "" - "Options included when running the 'refdbc -c addref' command." + "Options included when running the 'refdbc -C getref' command." :type 'string :group 'refdb) @@ -567,4 +578,9 @@ ) +(defvar refdb-updateref-menu-item + ["Update References" (refdb-updateref-on-region) t] + "RefDB menu item for updating references." + ) + (defvar refdb-deleteref-menu-item ["Delete References" (refdb-deleteref-on-region) t] @@ -801,4 +817,48 @@ ) +(defun refdb-updateref-on-region () + "Update all references in region in current database." + (interactive) + ;; temporarily set resize-mini-windows to nil to force Emacs to show + ;; updateref output in separate buffer instead of minibuffer + (setq resize-mini-windows nil) + (if (not (eq (length refdb-database) 0)) + (if (mark) + (progn + (refdb-determine-input-type) + (message "Updating references in selected region in %s database..." refdb-database) + (shell-command-on-region + (point) (mark) + (format + "%s %s -C updateref %s -d %s -t %s" + refdb-refdbc-program + refdb-refdbc-options + refdb-updateref-options + refdb-database + refdb-input-type + ) + "*refdb-output*" nil "*refdb-messages*") + (message + "Displaying output for '%s %s -C updateref %s -d %s -t %s'...done" + refdb-refdbc-program + refdb-refdbc-options + refdb-addref-options + refdb-database + refdb-input-type + ) + (display-buffer "*refdb-output*") + ) + (error "No region marked") + ) + ;; else if no databases specified, prompt to select from available + ;; databases, then re-call command + (call-interactively 'refdb-select-database) + (refdb-updateref-on-region) + ) + (message "Updating references in selected region in %s database...done" refdb-database) + ;; set resize-mini-windows back to default value + (setq resize-mini-windows (get 'resize-mini-windows 'standard-value)) + ) + (defun refdb-deleteref-on-region () "Delete all references in region from current database." @@ -930,5 +990,5 @@ ) (refdb-output-buffer-choose-mode) - (refdb-mode) + (and (boundp 'refdb-mode) refdb-mode) (setq resize-mini-windows resize-mini-windows-default) ) @@ -1070,5 +1130,5 @@ ) (refdb-output-buffer-choose-mode) - (refdb-mode) + (and (boundp 'refdb-mode) refdb-mode) (setq resize-mini-windows resize-mini-windows-default) ) @@ -1300,4 +1360,5 @@ '( refdb-addref-menu-item + refdb-updateref-menu-item refdb-deleteref-menu-item refdb-getref-submenu-definition |
From: Markus H. <mho...@us...> - 2005-05-07 21:27:31
|
Update of /cvsroot/refdb/elisp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3815 Modified Files: ris.el Log Message: added length checks Index: ris.el =================================================================== RCS file: /cvsroot/refdb/elisp/ris.el,v retrieving revision 1.4 retrieving revision 1.5 diff -u -U2 -r1.4 -r1.5 --- ris.el 7 May 2005 20:45:55 -0000 1.4 +++ ris.el 7 May 2005 21:27:22 -0000 1.5 @@ -57,4 +57,5 @@ ; prepare font-locking (make-face 'ris-main-face) +(make-face 'ris-main-ltd-face) (make-face 'ris-tag-face) (make-face 'ris-tyer-tag-face) @@ -64,4 +65,5 @@ (set-face-foreground 'ris-main-face "maroon") +(set-face-foreground 'ris-main-ltd-face "dark orchid") (set-face-foreground 'ris-tag-face "blue") (set-face-foreground 'ris-tyer-tag-face "red") @@ -73,9 +75,23 @@ (defvar ris-font-lock-keywords '( +;; three possible values. ON REQUEST must be followed by a date in MM/DD/YY notation ("^RP - \\(\\(IN FILE$\\)\\|\\(NOT IN FILE$\\)\\|\\(ON REQUEST [0-1][0-9]/[0-3][0-9]/[0-9][0-9]\\)\\)" 1 'ris-reprint-face t) - ("^\\(PY\\|Y1\\|Y2\\) - \\([0-9][0-9][0-9][0-9]/\\([0-1][0-9]\\)?/\\([0-3][0-9]\\)?/.*\\)" 2 'ris-pubyear-face t) + +;; YYYY/MM/DD/othertext, with MM,DD, and othertext optional. The slashes must still be present. Othertext may not exceed 255 chars + ("^\\(PY\\|Y1\\|Y2\\) - \\([0-9][0-9][0-9][0-9]/\\([0-1][0-9]\\)?/\\([0-3][0-9]\\)?/.\\{0,255\\}\\)" 2 'ris-pubyear-face t) + +;; corporate authors do not use a comma. Other authors may use up to two commas, the first to separate first and middle names from the last name, the second to separate an optional suffix. Currently no length checking is implemented ("^\\(AU\\|A1\\|A2\\|A3\\|ED\\) - \\(\\([^,\n]+,[^,\n]+\\(,[^,\n]+\\)?$\\)\\|\\([^,\n]+$\\)\\)" 2 'ris-author-face t) - ("^\\(ID\\|T1\\|TI\\|CT\\|BT\\|N1\\|AB\\|KW\\|SP\\|EP\\|JF\\|JO\\|JA\\|J1\\|J2\\|VL\\|T2\\|IS\\|CP\\|CY\\|PB\\|U1\\|U2\\|U3\\|U4\\|U5\\|T3\\|N2\\|SN\\|AV\\|M1\\|M2\\|M3\\|AD\\|UR\\) - \\(.+\\)" 2 'ris-main-face t) + +;; fields with a limited length of up to 255 chars + ("^\\(ID\\|KW\\|SP\\|EP\\|JF\\|JO\\|JA\\|J1\\|J2\\|VL\\|IS\\|CP\\|CY\\|PB\\|U1\\|U2\\|U3\\|U4\\|U5\\|SN\\|AV\\|M1\\|M2\\|M3\\|UR\\) - \\(.\\{1,255\\}\\)" 2 'ris-main-ltd-face t) + +;; fields with unlimited length + ("^\\(T1\\|TI\\|CT\\|BT\\|N1\\|AB\\|T2\\|T3\\|N2\\|AD\\) - \\(.+\\)" 2 'ris-main-face t) + +;; all valid tags except TY and ER ("^\\(\\(ID\\|T1\\|TI\\|CT\\|BT\\|A1\\|AU\\|Y1\\|PY\\|N1\\|AB\\|KW\\|RP\\|SP\\|EP\\|JF\\|JO\\|JA\\|J1\\|J2\\|VL\\|T2\\|A2\\|ED\\|IS\\|CP\\|CY\\|PB\\|U1\\|U2\\|U3\\|U4\\|U5\\|T3\\|A3\\|N2\\|SN\\|AV\\|Y2\\|M1\\|M2\\|M3\\|AD\\|UR\\) - \\)\\(.+\\)" 1 'ris-tag-face t) + +;; all valid types and the end tag ("^\\(TY - \\(ABST\\|ADVS\\|ART\\|BILL\\|BOOK\\|CASE\\|CHAP\\|COMP\\|CONF\\|CTLG\\|DATA\\|ELEC\\|GEN\\|HEAR\\|ICOMM\\|INPR\\|JFULL\\|JOUR\\|MAP\\|MGZN\\|MPCT\\|MUSIC\\|NEWS\\|PAMP\\|PAT\\|PCOMM\\|RPRT\\|SER\\|SLIDE\\|SOUND\\|STAT\\|THES\\|UNBILL\\|UNPB\\|VIDEO\\)\\)$\\|^\\(ER - \\)$" 0 'ris-tyer-tag-face t)) "Keyword highlighting specification for `ris-mode'.") |
From: Markus H. <mho...@us...> - 2005-05-07 20:46:06
|
Update of /cvsroot/refdb/elisp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28315 Modified Files: ris.el Log Message: added validation for authors, pubdates, reprints Index: ris.el =================================================================== RCS file: /cvsroot/refdb/elisp/ris.el,v retrieving revision 1.3 retrieving revision 1.4 diff -u -U2 -r1.3 -r1.4 --- ris.el 31 Dec 2003 07:08:55 -0000 1.3 +++ ris.el 7 May 2005 20:45:55 -0000 1.4 @@ -2,5 +2,5 @@ ;; $Id$ -;; Copyright (C) 2001 Markus Hoenicka +;; Copyright (C) 2001-2005 Markus Hoenicka ;; Author: Markus Hoenicka <ma...@mh...> @@ -26,9 +26,11 @@ ;;; Commentary: -;; Still crude but works. This mode does not attempt to validate the RIS -;; data but provides some convenience for editing RIS datasets. +;; Still crude but works. This mode does not attempt to fully validate the +;; RIS data but it provides visual clues to avoid the most common errors +;; in addition, it provides some convenience commands for editing RIS +;; datasets. ;; ;; To install this mode, move this file somewhere into your load-path -;; (something like /usr/local/share/emacs/site-lisp), and +;; (something like /usr/local/share/emacs/site-lisp), and (optionally) ;; byte-compile-file it. ;; @@ -57,10 +59,22 @@ (make-face 'ris-tag-face) (make-face 'ris-tyer-tag-face) +(make-face 'ris-author-face) +(make-face 'ris-pubyear-face) +(make-face 'ris-reprint-face) + (set-face-foreground 'ris-main-face "maroon") (set-face-foreground 'ris-tag-face "blue") (set-face-foreground 'ris-tyer-tag-face "red") +(set-face-foreground 'ris-author-face "sea green") +(set-face-foreground 'ris-pubyear-face "IndianRed2") +(set-face-foreground 'ris-reprint-face "deep pink") +;; these regexps do the "validation" (defvar ris-font-lock-keywords - '(("^\\(ID\\|T1\\|TI\\|CT\\|BT\\|A1\\|AU\\|Y1\\|PY\\|N1\\|AB\\|KW\\|RP\\|SP\\|EP\\|JF\\|JO\\|JA\\|J1\\|J2\\|VL\\|T2\\|A2\\|ED\\|IS\\|CP\\|CY\\|PB\\|U1\\|U2\\|U3\\|U4\\|U5\\|T3\\|A3\\|N2\\|SN\\|AV\\|Y2\\|M1\\|M2\\|M3\\|AD\\|UR\\) - \\(.+\\)" 2 'ris-main-face t) + '( + ("^RP - \\(\\(IN FILE$\\)\\|\\(NOT IN FILE$\\)\\|\\(ON REQUEST [0-1][0-9]/[0-3][0-9]/[0-9][0-9]\\)\\)" 1 'ris-reprint-face t) + ("^\\(PY\\|Y1\\|Y2\\) - \\([0-9][0-9][0-9][0-9]/\\([0-1][0-9]\\)?/\\([0-3][0-9]\\)?/.*\\)" 2 'ris-pubyear-face t) + ("^\\(AU\\|A1\\|A2\\|A3\\|ED\\) - \\(\\([^,\n]+,[^,\n]+\\(,[^,\n]+\\)?$\\)\\|\\([^,\n]+$\\)\\)" 2 'ris-author-face t) + ("^\\(ID\\|T1\\|TI\\|CT\\|BT\\|N1\\|AB\\|KW\\|SP\\|EP\\|JF\\|JO\\|JA\\|J1\\|J2\\|VL\\|T2\\|IS\\|CP\\|CY\\|PB\\|U1\\|U2\\|U3\\|U4\\|U5\\|T3\\|N2\\|SN\\|AV\\|M1\\|M2\\|M3\\|AD\\|UR\\) - \\(.+\\)" 2 'ris-main-face t) ("^\\(\\(ID\\|T1\\|TI\\|CT\\|BT\\|A1\\|AU\\|Y1\\|PY\\|N1\\|AB\\|KW\\|RP\\|SP\\|EP\\|JF\\|JO\\|JA\\|J1\\|J2\\|VL\\|T2\\|A2\\|ED\\|IS\\|CP\\|CY\\|PB\\|U1\\|U2\\|U3\\|U4\\|U5\\|T3\\|A3\\|N2\\|SN\\|AV\\|Y2\\|M1\\|M2\\|M3\\|AD\\|UR\\) - \\)\\(.+\\)" 1 'ris-tag-face t) ("^\\(TY - \\(ABST\\|ADVS\\|ART\\|BILL\\|BOOK\\|CASE\\|CHAP\\|COMP\\|CONF\\|CTLG\\|DATA\\|ELEC\\|GEN\\|HEAR\\|ICOMM\\|INPR\\|JFULL\\|JOUR\\|MAP\\|MGZN\\|MPCT\\|MUSIC\\|NEWS\\|PAMP\\|PAT\\|PCOMM\\|RPRT\\|SER\\|SLIDE\\|SOUND\\|STAT\\|THES\\|UNBILL\\|UNPB\\|VIDEO\\)\\)$\\|^\\(ER - \\)$" 0 'ris-tyer-tag-face t)) @@ -139,5 +153,5 @@ ("AD - " 44) ("UR - " 45)) nil t))) - (message (char-to-string (char-before))) +; (message (char-to-string (char-before))) (if (not (equal (char-before) 10)) (progn |
From: Markus H. <mho...@us...> - 2005-05-06 23:45:28
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7866/src Modified Files: Tag: Release_0_9_5_stable xmlhandler.c Log Message: id_end_handler():fixed docbook bib bug Index: xmlhandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/xmlhandler.c,v retrieving revision 1.22.2.14 retrieving revision 1.22.2.15 diff -u -U2 -r1.22.2.14 -r1.22.2.15 --- xmlhandler.c 5 May 2005 17:21:52 -0000 1.22.2.14 +++ xmlhandler.c 6 May 2005 23:45:02 -0000 1.22.2.15 @@ -1449,5 +1449,4 @@ LOG_PRINT(LOG_DEBUG, sql_command); - dbires = dbi_conn_query(conn_source, sql_command); if (!dbires) { |
From: Markus H. <mho...@us...> - 2005-05-06 23:43:59
|
Update of /cvsroot/refdb/refdb In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7403 Modified Files: Tag: Release_0_9_5_stable configure.in Log Message: set default encoding for mysql Index: configure.in =================================================================== RCS file: /cvsroot/refdb/refdb/configure.in,v retrieving revision 1.49.2.14 retrieving revision 1.49.2.15 diff -u -U2 -r1.49.2.14 -r1.49.2.15 --- configure.in 19 Apr 2005 19:32:15 -0000 1.49.2.14 +++ configure.in 6 May 2005 23:43:20 -0000 1.49.2.15 @@ -87,7 +87,9 @@ db_server=pgsql dbs_port=5432 +dbs_encoding=UNICODE elif test $withval = "mysql" || test $withval = "MYSQL"; then db_server=mysql dbs_port=3306 +dbs_encoding=utf8 else db_server=sqlite @@ -289,4 +291,5 @@ AC_SUBST(main_db) AC_SUBST(dbs_port) +AC_SUBST(dbs_encoding) AC_SUBST(db_dir) AC_SUBST(ULLSPEC) |
From: Markus H. <mho...@us...> - 2005-05-06 23:43:35
|
Update of /cvsroot/refdb/refdb/etc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7403/etc Modified Files: Tag: Release_0_9_5_stable Makefile.am refdbdrc Log Message: set default encoding for mysql Index: Makefile.am =================================================================== RCS file: /cvsroot/refdb/refdb/etc/Makefile.am,v retrieving revision 1.13.2.1 retrieving revision 1.13.2.2 diff -u -U2 -r1.13.2.1 -r1.13.2.2 --- Makefile.am 15 Apr 2005 22:34:36 -0000 1.13.2.1 +++ Makefile.am 6 May 2005 23:43:21 -0000 1.13.2.2 @@ -16,4 +16,5 @@ sed 's%<pkgdatadir>%$(pkgdatadir)%' | \ sed 's%<dbs_port>%$(dbs_port)%' | \ + sed 's%<dbs_encoding>%$(dbs_encoding)%' | \ sed 's%<db_path>%$(db_dir)%' | \ sed 's%<db_server>%$(db_server)%' > $@ Index: refdbdrc =================================================================== RCS file: /cvsroot/refdb/refdb/etc/refdbdrc,v retrieving revision 1.10.2.2 retrieving revision 1.10.2.3 diff -u -U2 -r1.10.2.2 -r1.10.2.3 --- refdbdrc 15 Apr 2005 22:35:22 -0000 1.10.2.2 +++ refdbdrc 6 May 2005 23:43:26 -0000 1.10.2.3 @@ -27,5 +27,5 @@ # The database server we want to connect to. Currently mysql, -# pgsql, and sqlite are supported +# pgsql, sqlite, and sqlite3 are supported dbserver <db_server> @@ -89,8 +89,11 @@ # Specify the default encoding that newly created databases use. This -# feature is currently only supported by PostgreSQL. Possible values are +# feature is currently only supported by PostgreSQL and MySQL 4.x. +# Possible values for PostgreSQL are: # SQL_ASCII, EUC_JP, EUC_CN, EUC_KR, EUC_TW, UNICODE, MULE_INTERNAL, LATIN1 # through LATIN5, KOI8, WIN, ALT -db_encoding UNICODE +# The allowed values for MySQL depend on your local installation. Useful +# defaults are latin1 and utf8 +db_encoding <dbs_encoding> # Specify the default encoding of imported RIS data. |
From: Markus H. <mho...@us...> - 2005-05-05 17:30:36
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21963 Modified Files: Tag: Release_0_9_5_stable refdbdnote.c Log Message: fixed getnote() return codes; add sqlite3 support Index: refdbdnote.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdnote.c,v retrieving revision 1.25.2.4 retrieving revision 1.25.2.5 diff -u -U2 -r1.25.2.4 -r1.25.2.5 --- refdbdnote.c 3 May 2005 20:31:39 -0000 1.25.2.4 +++ refdbdnote.c 5 May 2005 17:30:22 -0000 1.25.2.5 @@ -660,5 +660,5 @@ getnote(): implements the client command getnote - int getnote returns 0 = no error, 1 = out of memory, 2 = subselect failed + int getnote returns 0 = no error, 1 = out of memory or connection error, 2 = subselect failed struct CLIENT_REQUEST* ptr_clrequest ptr to structure with client info @@ -740,5 +740,5 @@ send_status(ptr_clrequest->fd, 801, TERM_NO); LOG_PRINT(LOG_CRIT, get_status_msg(801)); - return 0; + return 1; } @@ -751,5 +751,5 @@ send_status(ptr_clrequest->fd, 801, TERM_NO); LOG_PRINT(LOG_CRIT, get_status_msg(801)); - return 0; + return 1; } sql_command[0] = '\0'; /* start with an empty string */ @@ -763,5 +763,5 @@ send_status(ptr_clrequest->fd, 801, TERM_NO); LOG_PRINT(LOG_CRIT, get_status_msg(801)); - return 0; + return 1; } sql_command1[0] = '\0'; /* start with an empty string */ @@ -775,5 +775,5 @@ send_status(ptr_clrequest->fd, 801, TERM_NO); LOG_PRINT(LOG_CRIT, get_status_msg(801)); - return 0; + return 1; } buffer[0] = '\0'; /* start with an empty string */ @@ -787,5 +787,5 @@ send_status(ptr_clrequest->fd, 801, TERM_NO); LOG_PRINT(LOG_CRIT, get_status_msg(801)); - return 0; + return 1; } buffer[0] = '\0'; /* start with an empty string */ @@ -798,5 +798,5 @@ LOG_PRINT(LOG_WARNING, get_status_msg(204)); delete_all_lilimem(&sentinel); - return 0; + return 1; } @@ -816,5 +816,5 @@ LOG_PRINT(LOG_WARNING, get_status_msg(701)); delete_all_lilimem(&sentinel); - return 0; + return 1; } else { @@ -2063,5 +2063,5 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } @@ -2083,5 +2083,5 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } else { @@ -2100,5 +2100,5 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } else { @@ -2115,5 +2115,5 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } else { @@ -2133,5 +2133,5 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } @@ -2158,5 +2158,5 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } |
From: Markus H. <mho...@us...> - 2005-05-05 17:28:57
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21416 Modified Files: Tag: Release_0_9_5_stable refdbdref.c Log Message: fixed getref() return codes;added sqlite3 support Index: refdbdref.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdref.c,v retrieving revision 1.65.2.8 retrieving revision 1.65.2.9 diff -u -U2 -r1.65.2.8 -r1.65.2.9 --- refdbdref.c 3 May 2005 20:30:08 -0000 1.65.2.8 +++ refdbdref.c 5 May 2005 17:28:37 -0000 1.65.2.9 @@ -367,5 +367,5 @@ if (!strcmp(my_dbi_conn_get_cap(conn, "multiple_db"), "f")) { - /* pgsql, sqlite need another connection to retrieve values from + /* pgsql, sqlite, sqlite3 need another connection to retrieve values from the refdb database */ @@ -1749,8 +1749,8 @@ drivername = dbi_driver_get_name(dbi_conn_get_driver(conn)); - if (!strcmp(drivername, "mysql") || !strcmp(drivername, "sqlite")) { + if (!strcmp(my_dbi_conn_get_cap(conn, "named_seq"), "f")) { n_user_id = dbi_conn_sequence_last(conn, NULL); } - else if (!strcmp(drivername, "pgsql")) { + else { n_user_id = dbi_conn_sequence_last(conn, "t_user_user_id_seq"); } @@ -1994,5 +1994,5 @@ getref(): implements the client command getref - int getref returns 0 = no error, 1 = out of memory, 2 = subselect failed + int getref returns 0 = no error, 1 = out of memory or db open error, 2 = subselect failed struct CLIENT_REQUEST* ptr_clrequest ptr to structure with client info @@ -2077,10 +2077,7 @@ inargv = (char**)malloc((size_t)inargcmax*sizeof(char*)); if (inargv == NULL || insert_lilimem(&sentinel, (void**)&inargv, NULL)) { - if (ptr_clrequest->n_cgi) { /* cgi output */ - iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); - } send_status(ptr_clrequest->fd, 801, TERM_NO); LOG_PRINT(LOG_CRIT, get_status_msg(801)); - return 0; + return 1; } @@ -2091,10 +2088,7 @@ if (sql_command == NULL || insert_lilimem(&sentinel, (void**)&sql_command, NULL)) { delete_all_lilimem(&sentinel); - if (ptr_clrequest->n_cgi) { /* cgi output */ - iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); - } send_status(ptr_clrequest->fd, 801, TERM_NO); LOG_PRINT(LOG_CRIT, get_status_msg(801)); - return 0; + return 1; } sql_command[0] = '\0'; /* start with an empty string */ @@ -2106,10 +2100,7 @@ if (sql_command1 == NULL || insert_lilimem(&sentinel, (void**)&sql_command1, NULL)) { delete_all_lilimem(&sentinel); - if (ptr_clrequest->n_cgi) { /* cgi output */ - iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); - } send_status(ptr_clrequest->fd, 801, TERM_NO); LOG_PRINT(LOG_CRIT, get_status_msg(801)); - return 0; + return 1; } sql_command1[0] = '\0'; /* start with an empty string */ @@ -2121,10 +2112,7 @@ if (buffer == NULL || insert_lilimem(&sentinel, (void**)&buffer, NULL)) { delete_all_lilimem(&sentinel); - if (ptr_clrequest->n_cgi) { /* cgi output */ - iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); - } send_status(ptr_clrequest->fd, 801, TERM_NO); LOG_PRINT(LOG_CRIT, get_status_msg(801)); - return 0; + return 1; } buffer[0] = '\0'; /* start with an empty string */ @@ -2136,10 +2124,7 @@ if (stringbuf == NULL || insert_lilimem(&sentinel, (void**)&stringbuf, NULL)) { delete_all_lilimem(&sentinel); - if (ptr_clrequest->n_cgi) { /* cgi output */ - iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); - } send_status(ptr_clrequest->fd, 801, TERM_NO); LOG_PRINT(LOG_CRIT, get_status_msg(801)); - return 0; + return 1; } buffer[0] = '\0'; /* start with an empty string */ @@ -2149,11 +2134,8 @@ /* connect to the database */ if ((conn = connect_to_db(ptr_clrequest, NULL, 0)) == NULL) { - if (ptr_clrequest->n_cgi) { /* cgi output */ - iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); - } send_status(ptr_clrequest->fd, 204, TERM_NO); LOG_PRINT(LOG_WARNING, get_status_msg(204)); delete_all_lilimem(&sentinel); - return 0; + return 1; } @@ -2170,11 +2152,8 @@ LOG_PRINT(LOG_DEBUG, db_encoding); LOG_PRINT(LOG_DEBUG, ptr_biblio_info->encoding); - if (ptr_clrequest->n_cgi) { /* cgi output */ - iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); - } send_status(ptr_clrequest->fd, 701, TERM_NO); LOG_PRINT(LOG_WARNING, get_status_msg(701)); delete_all_lilimem(&sentinel); - return 0; + return 1; } else { @@ -3825,7 +3804,4 @@ } else if (retval == 2) { - if (ptr_clrequest->n_cgi) { /* cgi output */ - iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); - } send_status(ptr_clrequest->fd, 234, TERM_NO); LOG_PRINT(LOG_WARNING, get_status_msg(234)); @@ -3837,5 +3813,5 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } @@ -3891,5 +3867,5 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } else { @@ -3909,5 +3885,5 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } else { @@ -3928,5 +3904,5 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } if (dbi_driver_quote_string(driver, "ed_token) == -1) { @@ -3941,7 +3917,4 @@ dbires = dbi_conn_query(conn, sql_command1); if (!dbires) { - if (ptr_clrequest->n_cgi) { /* cgi output */ - iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); - } send_status(ptr_clrequest->fd, 234, TERM_NO); LOG_PRINT(LOG_WARNING, get_status_msg(234)); @@ -3951,11 +3924,8 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } if ((new_sql_command = mstrcat(sql_command, " AND t_refdb.refdb_id IN (", &sql_command_len, 0)) == NULL) { - if (ptr_clrequest->n_cgi) { /* cgi output */ - iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); - } send_status(ptr_clrequest->fd, 801, TERM_NO); LOG_PRINT(LOG_CRIT, get_status_msg(801)); @@ -3966,5 +3936,5 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } else { @@ -3978,7 +3948,4 @@ if ((new_sql_command = mstrcat(sql_command, the_id, &sql_command_len, 0)) == NULL) { retval = 1; - if (ptr_clrequest->n_cgi) { /* cgi output */ - iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); - } send_status(ptr_clrequest->fd, 801, TERM_NO); LOG_PRINT(LOG_CRIT, get_status_msg(801)); @@ -3989,5 +3956,5 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } else { @@ -3996,7 +3963,4 @@ if ((new_sql_command = mstrcat(sql_command, ",", &sql_command_len, 0)) == NULL) { retval = 1; - if (ptr_clrequest->n_cgi) { /* cgi output */ - iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); - } send_status(ptr_clrequest->fd, 801, TERM_NO); LOG_PRINT(LOG_CRIT, get_status_msg(801)); @@ -4007,5 +3971,5 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } else { @@ -4014,10 +3978,7 @@ } /* end while */ } - else { /* if now rows are available */ + else { /* if no rows are available */ if ((new_sql_command = mstrcat(sql_command, "0,", &sql_command_len, 0)) == NULL) { retval = 1; - if (ptr_clrequest->n_cgi) { /* cgi output */ - iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); - } send_status(ptr_clrequest->fd, 801, TERM_NO); LOG_PRINT(LOG_CRIT, get_status_msg(801)); @@ -4028,5 +3989,5 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } else { @@ -4039,7 +4000,4 @@ /* overwrite the trailing comma */ if (retval || ((new_sql_command = mstrcat(sql_command, ")", &sql_command_len, 1)) == NULL)) { - if (ptr_clrequest->n_cgi) { /* cgi output */ - iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); - } send_status(ptr_clrequest->fd, 801, TERM_NO); LOG_PRINT(LOG_CRIT, get_status_msg(801)); @@ -4049,5 +4007,5 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } else { @@ -4059,7 +4017,4 @@ if (strncmp(ptr_biblio_info->sort_string, "PY", 2) == 0) { if (retval || ((new_sql_command = mstrcat(sql_command, " ORDER BY t_refdb.refdb_pubyear", &sql_command_len, 0)) == NULL)) { - if (ptr_clrequest->n_cgi) { /* cgi output */ - iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); - } send_status(ptr_clrequest->fd, 801, TERM_NO); LOG_PRINT(LOG_CRIT, get_status_msg(801)); @@ -4069,5 +4024,5 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } else { @@ -4077,7 +4032,4 @@ else { if (retval || ((new_sql_command = mstrcat(sql_command, " ORDER BY t_refdb.refdb_id", &sql_command_len, 0)) == NULL)) { - if (ptr_clrequest->n_cgi) { /* cgi output */ - iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); - } send_status(ptr_clrequest->fd, 801, TERM_NO); LOG_PRINT(LOG_CRIT, get_status_msg(801)); @@ -4087,5 +4039,5 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } else { @@ -4098,7 +4050,4 @@ rendinfo.dbires = dbi_conn_query(conn, sql_command); if (!rendinfo.dbires) { - if (ptr_clrequest->n_cgi) { /* cgi output */ - iwrite(ptr_clrequest->fd, cgihead_plain.text, cgihead_plain.length); - } send_status(ptr_clrequest->fd, 234, TERM_NO); LOG_PRINT(LOG_WARNING, get_status_msg(234)); @@ -4108,5 +4057,5 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } @@ -4131,5 +4080,5 @@ iconv_close(conv_descriptor); } - return 0; + return 1; } |
From: Markus H. <mho...@us...> - 2005-05-05 17:26:11
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20702 Modified Files: Tag: Release_0_9_5_stable refdbc.c Log Message: close pipe properly if server cannot open db; removed some cgi stuff Index: refdbc.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbc.c,v retrieving revision 1.72.2.6 retrieving revision 1.72.2.7 diff -u -U2 -r1.72.2.6 -r1.72.2.7 --- refdbc.c 19 Apr 2005 19:39:58 -0000 1.72.2.6 +++ refdbc.c 5 May 2005 17:25:58 -0000 1.72.2.7 @@ -1785,352 +1785,178 @@ strcpy(my_toencoding, toencoding); /* use default encoding if set */ - if (n_cgi) { -#ifdef REFDB_CGI - /* this code must handle the following actions: - 1) simple query - 2) advanced query - 3) edit reference */ - - if ((ptr_current = get_liliform((struct liliform*)arg, "scope")) != NULL) { - if (strcmp(ptr_current->value, "prl") == 0) { - n_limit_to_user = 1; - } - } + /* if (n_batchmode) { */ /* in batchmode, the command line is already tokenized */ + /* inargc = main_argc; */ + /* inargv = main_argv; */ + /* } */ + /* else { */ + /* parse the argument. first we cut the argument + into pieces with strtok, then we use getopt to interpret */ - ptr_current = (struct liliform*)arg; - while ((ptr_current = get_liliform(ptr_current, "morefields")) != NULL) { - if (strlen(format_string) >= MAX_FMT_LEN-2) { - break; /* the correct search page will never cause this, but some - malevolent person might alter the page to overflow this - buffer on purpose */ - } - strcat(format_string, ptr_current->value); - } + /* get a buffer to hold the tokens. Start with 10 tokens, + increase in steps of 10 as needed */ + inargc = 0; + inargcmax = 10; + inargv = (char**)malloc((size_t)inargcmax*sizeof(char*)); + if (inargv == NULL) { + return 1; + } - if ((ptr_current = get_nliliform((struct liliform*)arg, "editid", 6)) != NULL) { - /* we want to retrieve a reference with a given ID in RIS format */ - strcat(slvals.outbuffer, ":ID:="); - strcat(slvals.outbuffer, &((ptr_current->name)[6])); - strcpy(type_string, "cgiris"); - } - else if ((ptr_current = get_liliform((struct liliform*)arg, "advquery")) != NULL) { - /* this is a valid query string (hopefully) */ - strcat(slvals.outbuffer, "\""); - strcat(slvals.outbuffer, ptr_current->value); - strcat(slvals.outbuffer, "\""); - strcpy(type_string, "cgi"); - } - else { - /* we have to evaluate four fields in the form and connect them - appropriately */ + if (insert_lilimem(&sentinel, (void**)&inargv, NULL)) { + return 1; + } - /* the query string proper has to be enclosed in quotation marks */ - strcat(slvals.outbuffer, "\""); + /* the following is a temporary hack to allow cmdln_tokenize to work */ + newarg = (char*)malloc((size_t)(strlen(arg)+8)); + if (newarg == NULL) { + delete_all_lilimem(&sentinel); + return 1; + } - /* first field */ - ptr_current = get_liliform((struct liliform*)arg, "simpquery1field"); - if (ptr_current) { - if (add_field_contents(slvals.outbuffer, ptr_current, (struct liliform*)arg, "simpquery1field", "simpquery1")) { - goto simpdone; - } - - if (get_liliform((struct liliform*)arg, "simpquery2")) { - ptr_current = get_liliform((struct liliform*)arg, "simpquery1op"); - if (ptr_current) { - if (!strcmp(ptr_current->value, "not")) { - strcat(slvals.outbuffer, " AND NOT ("); - n_open_andnot = 1; - } - else if (!strcmp(ptr_current->value, "or")) { - strcat(slvals.outbuffer, " OR "); - } - else { /* default is author */ - strcat(slvals.outbuffer, " AND "); - } - } - else { /* use AND as default connector */ - strcat(slvals.outbuffer, " AND "); - } - } - else { - goto simpdone; - } - } - else { - goto simpqueryerror; - } + if (insert_lilimem(&sentinel, (void**)&newarg, NULL)) { + delete_all_lilimem(&sentinel); + return 1; + } - /* second field */ - ptr_current = get_liliform((struct liliform*)arg, "simpquery2field"); - if (ptr_current) { - if (add_field_contents(slvals.outbuffer, ptr_current, (struct liliform*)arg, "simpquery2field", "simpquery2")) { - goto simpqueryerror; - } - - if (n_open_andnot) { - strcat(slvals.outbuffer, ")"); - n_open_andnot = 0; - } - - if (get_liliform((struct liliform*)arg, "simpquery3")) { - ptr_current = get_liliform((struct liliform*)arg, "simpquery2op"); - if (ptr_current) { - if (!strcmp(ptr_current->value, "not")) { - strcat(slvals.outbuffer, " AND NOT ("); - n_open_andnot = 1; - } - else if (!strcmp(ptr_current->value, "or")) { - strcat(slvals.outbuffer, " OR "); - } - else { /* default is author */ - strcat(slvals.outbuffer, " AND "); - } - } - else { /* use AND as default connector */ - strcat(slvals.outbuffer, " AND "); - } - } - else { - goto simpdone; - } - } + strcpy(newarg, "getref "); + strcat(newarg, arg); - /* third field */ - ptr_current = get_liliform((struct liliform*)arg, "simpquery3field"); - if (ptr_current) { - if (add_field_contents(slvals.outbuffer, ptr_current, (struct liliform*)arg, "simpquery3field", "simpquery3")) { - goto simpqueryerror; - } - - if (n_open_andnot) { - strcat(slvals.outbuffer, ")"); - n_open_andnot = 0; - } - - if (get_liliform((struct liliform*)arg, "simpquery4")) { - ptr_current = get_liliform((struct liliform*)arg, "simpquery3op"); - if (ptr_current) { - if (!strcmp(ptr_current->value, "not")) { - strcat(slvals.outbuffer, " AND NOT ("); - n_open_andnot = 1; - } - else if (!strcmp(ptr_current->value, "or")) { - strcat(slvals.outbuffer, " OR "); - } - else { /* default is author */ - strcat(slvals.outbuffer, " AND "); - } - } - else { /* use AND as default connector */ - strcat(slvals.outbuffer, " AND "); - } - } - else { - goto simpdone; - } - } + result = cmdln_tokenize(&inargc, &inargv, inargcmax, newarg); - /* fourth field */ - ptr_current = get_liliform((struct liliform*)arg, "simpquery4field"); - if (ptr_current) { - if (add_field_contents(slvals.outbuffer, ptr_current, (struct liliform*)arg, "simpquery4field", "simpquery4")) { - goto simpqueryerror; - } - if (n_open_andnot) { - strcat(slvals.outbuffer, ")"); - n_open_andnot = 0; - } - } - else { - goto simpdone; - } - - simpqueryerror: - cgi_header(CGI_PLAIN); - fprintf(errstream, "could not make sense of the query input\n"); - return 1; - simpdone: - strcat(slvals.outbuffer, "\""); - strcpy(type_string, "cgi"); - } -#endif /* REFDB_CGI */ + if (result == 1 || result == 2) { /* memory error */ + delete_all_lilimem(&sentinel); + return 1; } - else { /* not cgi */ -/* if (n_batchmode) { */ /* in batchmode, the command line is already tokenized */ -/* inargc = main_argc; */ -/* inargv = main_argv; */ -/* } */ -/* else { */ - /* parse the argument. first we cut the argument - into pieces with strtok, then we use getopt to interpret */ + /* } */ - /* get a buffer to hold the tokens. Start with 10 tokens, - increase in steps of 10 as needed */ - inargc = 0; - inargcmax = 10; - inargv = (char**)malloc((size_t)inargcmax*sizeof(char*)); - if (inargv == NULL) { - return 1; - } + /* now we have the tokens nicely arranged in inargc */ + /* for (i = 0; i < inargc; i++) { */ + /* printf("inargv[%d]: %s\n", i, inargv[i]); */ + /* } */ - if (insert_lilimem(&sentinel, (void**)&inargv, NULL)) { - return 1; - } + /* get options */ + optind = 0; - /* the following is a temporary hack to allow cmdln_tokenize to work */ - newarg = (char*)malloc((size_t)(strlen(arg)+8)); - if (newarg == NULL) { + while ((n_opt = getopt(inargc, inargv, "ac:C:d:e:E:f:F:g:G:hi:kl:L:o:O:p:PqrR:s:S:t:T:u:U:vVw:")) != -1) { + switch(n_opt) { + case 'c': + /* printf("-c %s\n", optarg); */ + slvals.outpipe = (char*)malloc(strlen(optarg)+1); + if (slvals.outpipe == NULL) { delete_all_lilimem(&sentinel); - return 1; + return 0; } - - if (insert_lilimem(&sentinel, (void**)&newarg, NULL)) { + strcpy(slvals.outpipe, optarg); + if (insert_lilimem(&sentinel, (void**)&slvals.outpipe, NULL)) { delete_all_lilimem(&sentinel); return 1; } - strcpy(newarg, "getref "); - strcat(newarg, arg); - - result = cmdln_tokenize(&inargc, &inargv, inargcmax, newarg); - - - if (result == 1 || result == 2) { /* memory error */ - delete_all_lilimem(&sentinel); - return 1; + slvals.n_pipe = 1; + break; + case 'd': + /* printf("-d %s\n", optarg); */ + strncpy(db, optarg, _POSIX_PATH_MAX - 1); /* override preset db */ + db[_POSIX_PATH_MAX-1] = '\0'; /* terminate in case string got truncated */ + break; + case 'E': + strncpy(my_toencoding, optarg, PREFS_BUF_LEN); + my_toencoding[PREFS_BUF_LEN-1] = '\0'; + break; + case 'f': + /* printf("-f %s\n", optarg); */ + if (!strcmp(optarg, "stdin")) { + n_read_stdin = 1; } -/* } */ - - /* now we have the tokens nicely arranged in inargc */ -/* for (i = 0; i < inargc; i++) { */ -/* printf("inargv[%d]: %s\n", i, inargv[i]); */ -/* } */ - - /* get options */ - optind = 0; - - while ((n_opt = getopt(inargc, inargv, "ac:C:d:e:E:f:F:g:G:hi:kl:L:o:O:p:PqrR:s:S:t:T:u:U:vVw:")) != -1) { - switch(n_opt) { - case 'c': - /* printf("-c %s\n", optarg); */ - slvals.outpipe = (char*)malloc(strlen(optarg)+1); - if (slvals.outpipe == NULL) { - delete_all_lilimem(&sentinel); - return 0; - } - strcpy(slvals.outpipe, optarg); - if (insert_lilimem(&sentinel, (void**)&slvals.outpipe, NULL)) { + else { + infile = canonicalize_path(optarg); + if (insert_lilimem(&sentinel, (void**)&infile, NULL)) { delete_all_lilimem(&sentinel); return 1; } - - slvals.n_pipe = 1; - break; - case 'd': - /* printf("-d %s\n", optarg); */ - strncpy(db, optarg, _POSIX_PATH_MAX - 1); /* override preset db */ - db[_POSIX_PATH_MAX-1] = '\0'; /* terminate in case string got truncated */ - break; - case 'E': - strncpy(my_toencoding, optarg, PREFS_BUF_LEN); - my_toencoding[PREFS_BUF_LEN-1] = '\0'; - break; - case 'f': - /* printf("-f %s\n", optarg); */ - if (!strcmp(optarg, "stdin")) { - n_read_stdin = 1; - } - else { - infile = canonicalize_path(optarg); - if (insert_lilimem(&sentinel, (void**)&infile, NULL)) { - delete_all_lilimem(&sentinel); - return 1; - } - n_read_file = 1; - } - break; - case 'h': - printf("Displays the result of a database search.\nSyntax: getref [-c command] [-d database] [-E encoding] [-h] [-o outfile] [-O outfile][-P] [-R pdfroot] [-s format] [-S tag] [-t output-format] {search-string|-f infile}\nSearch-string: {:XY:{<|=|~|!=|!~|>}{string|regexp}} [AND|OR|AND NOT] [...]\nwhere XY specifies the field to search in\nOptions: -c command pipe the output through command\n -d database specify the database to work with\n -E encoding set the output character encoding\n -h prints this mini-help\n -o outfile save the output in outfile (overwrite)\n -O outfile append the output to outfile\n -P limit search to personal interest list\n -R use pdfroot as root for path of pdf files\n -s format specify fields for screen or style for DocBook output\n -S tag sort output by tag ID (default) or PY\n -t output-format display as format scrn, html, xhtml, db31, db31x, teix, ris, risx, or bibtex\n -f infile use the saved search line in file infile\n All other arguments are interpreted as the search string.\n"); + n_read_file = 1; + } + break; + case 'h': + printf("Displays the result of a database search.\nSyntax: getref [-c command] [-d database] [-E encoding] [-h] [-o outfile] [-O outfile][-P] [-R pdfroot] [-s format] [-S tag] [-t output-format] {search-string|-f infile}\nSearch-string: {:XY:{<|=|~|!=|!~|>}{string|regexp}} [AND|OR|AND NOT] [...]\nwhere XY specifies the field to search in\nOptions: -c command pipe the output through command\n -d database specify the database to work with\n -E encoding set the output character encoding\n -h prints this mini-help\n -o outfile save the output in outfile (overwrite)\n -O outfile append the output to outfile\n -P limit search to personal interest list\n -R use pdfroot as root for path of pdf files\n -s format specify fields for screen or style for DocBook output\n -S tag sort output by tag ID (default) or PY\n -t output-format display as format scrn, html, xhtml, db31, db31x, teix, ris, risx, or bibtex\n -f infile use the saved search line in file infile\n All other arguments are interpreted as the search string.\n"); + delete_all_lilimem(&sentinel); + return 0; + break; + case 'o': + /* printf("-o %s\n", optarg); */ + slvals.outfile = canonicalize_path(optarg); + if (insert_lilimem(&sentinel, (void**)&slvals.outfile, NULL)) { delete_all_lilimem(&sentinel); - return 0; - break; - case 'o': - /* printf("-o %s\n", optarg); */ - slvals.outfile = canonicalize_path(optarg); - if (insert_lilimem(&sentinel, (void**)&slvals.outfile, NULL)) { - delete_all_lilimem(&sentinel); - return 1; - } - slvals.n_file_open = 1; - break; - case 'O': - /* printf("-O %s\n", optarg); */ - slvals.outfile = canonicalize_path(optarg); - if (insert_lilimem(&sentinel, (void**)&slvals.outfile, NULL)) { - delete_all_lilimem(&sentinel); - return 1; - } - slvals.n_file_append = 1; - break; - case 'P': - /* printf("-p %s\n", optarg); */ - n_limit_to_user = 1; - break; - case 'R': - strcpy(pdf_root, optarg); - break; - case 's': - /* printf("-s %s\n", optarg); */ - strncpy(format_string, optarg, MAX_FMT_LEN - 1); - format_string[MAX_FMT_LEN-1] = '\0'; /* terminate in case string got truncated */ - break; - case 'S': - /* printf("-S %s\n", optarg); */ - strncpy(sort_string, optarg, MAX_FMT_LEN - 1); - sort_string[MAX_FMT_LEN-1] = '\0'; /* terminate in case string got truncated */ - break; - case 't': - /* printf("-t %s\n", optarg); */ - strncpy(type_string, optarg, 9); - type_string[9] = '\0'; /* terminate in case string got truncated */ - break; - /* now all the options that main has already taken care of */ - case 'a': - case 'C': /* fall through */ - case 'e': - case 'F': - case 'g': - case 'G': - case 'i': - case 'k': - case 'l': - case 'L': - case 'p': - case 'q': - case 'r': - case 'T': - case 'u': - 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; + return 1; } + slvals.n_file_open = 1; + break; + case 'O': + /* printf("-O %s\n", optarg); */ + slvals.outfile = canonicalize_path(optarg); + if (insert_lilimem(&sentinel, (void**)&slvals.outfile, NULL)) { + delete_all_lilimem(&sentinel); + return 1; + } + slvals.n_file_append = 1; + break; + case 'P': + /* printf("-p %s\n", optarg); */ + n_limit_to_user = 1; + break; + case 'R': + strcpy(pdf_root, optarg); + break; + case 's': + /* printf("-s %s\n", optarg); */ + strncpy(format_string, optarg, MAX_FMT_LEN - 1); + format_string[MAX_FMT_LEN-1] = '\0'; /* terminate in case string got truncated */ + break; + case 'S': + /* printf("-S %s\n", optarg); */ + strncpy(sort_string, optarg, MAX_FMT_LEN - 1); + sort_string[MAX_FMT_LEN-1] = '\0'; /* terminate in case string got truncated */ + break; + case 't': + /* printf("-t %s\n", optarg); */ + strncpy(type_string, optarg, 9); + type_string[9] = '\0'; /* terminate in case string got truncated */ + break; + /* now all the options that main has already taken care of */ + case 'a': + case 'C': /* fall through */ + case 'e': + case 'F': + case 'g': + case 'G': + case 'i': + case 'k': + case 'l': + case 'L': + case 'p': + case 'q': + case 'r': + case 'T': + case 'u': + 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]); */ -/* } */ + /* for (i = optind; i < inargc; i++) { */ + /* printf("argument %s\n", inargv[i]); */ + /* } */ if (!*db) { @@ -2159,24 +1985,8 @@ } - if (!n_cgi) { - if (n_read_file || n_read_stdin) { - if (!n_read_stdin) { - infilefp = fopen(infile, "rb"); - if (infilefp == NULL) { - send_status(slvals.n_sockfd, 112, TERM_NO); - delete_all_lilimem(&sentinel); - close(slvals.n_sockfd); - return 1; - } - } - else { - infilefp = stdin; /* stdin is already open */ - } - - read_result = fgets(slvals.outbuffer+strlen(slvals.outbuffer), COMMAND_INBUF_LEN-strlen(slvals.outbuffer), infilefp); - if (!n_read_stdin) { /* don't close stdin */ - fclose(infilefp); - } - if (read_result == NULL) { + if (n_read_file || n_read_stdin) { + if (!n_read_stdin) { + infilefp = fopen(infile, "rb"); + if (infilefp == NULL) { send_status(slvals.n_sockfd, 112, TERM_NO); delete_all_lilimem(&sentinel); @@ -2186,31 +1996,45 @@ } else { - if (optind < inargc) { - int open_quote = 0; - strcat(slvals.outbuffer, "\""); - /* printf("%d\n", optind); */ - for (i = optind; i < inargc; i++) { - strcat(slvals.outbuffer, inargv[i]); - if (open_quote) { - strcat(slvals.outbuffer, "\'"); - open_quote--; - } - /* the tokenizer returns a quoted item as a separate token - even if there is no space between e.g. a '=' and the - quoted item. To rectify this, check whether the previous - item ended with a '=' or a '~' */ - if (slvals.outbuffer[strlen(slvals.outbuffer)-1] != '=' - && slvals.outbuffer[strlen(slvals.outbuffer)-1] != '~') { - strcat(slvals.outbuffer, " "); - } - else { - /* insert a quote after the '='. This will put back the - quote only for items that actually were quoted */ - strcat(slvals.outbuffer, "\'"); - open_quote++; - } + infilefp = stdin; /* stdin is already open */ + } + + read_result = fgets(slvals.outbuffer+strlen(slvals.outbuffer), COMMAND_INBUF_LEN-strlen(slvals.outbuffer), infilefp); + if (!n_read_stdin) { /* don't close stdin */ + fclose(infilefp); + } + if (read_result == NULL) { + send_status(slvals.n_sockfd, 112, TERM_NO); + delete_all_lilimem(&sentinel); + close(slvals.n_sockfd); + return 1; + } + } + else { + if (optind < inargc) { + int open_quote = 0; + strcat(slvals.outbuffer, "\""); + /* printf("%d\n", optind); */ + for (i = optind; i < inargc; i++) { + strcat(slvals.outbuffer, inargv[i]); + if (open_quote) { + strcat(slvals.outbuffer, "\'"); + open_quote--; + } + /* the tokenizer returns a quoted item as a separate token + even if there is no space between e.g. a '=' and the + quoted item. To rectify this, check whether the previous + item ended with a '=' or a '~' */ + if (slvals.outbuffer[strlen(slvals.outbuffer)-1] != '=' + && slvals.outbuffer[strlen(slvals.outbuffer)-1] != '~') { + strcat(slvals.outbuffer, " "); + } + else { + /* insert a quote after the '='. This will put back the + quote only for items that actually were quoted */ + strcat(slvals.outbuffer, "\'"); + open_quote++; } - strcpy(&slvals.outbuffer[strlen(slvals.outbuffer)-1], "\""); /* remove trailing space */ } + strcpy(&slvals.outbuffer[strlen(slvals.outbuffer)-1], "\""); /* remove trailing space */ } } @@ -2313,4 +2137,11 @@ fprintf(errstream, get_status_msg(cs_status)); fprintf(errstream, "\n"); + if (slvals.n_file_open || slvals.n_file_append) { + close_outfile(pagerfp); + } + else { + closepager(pagerfp); + } + n_broken_pipe = 0; return 1; } @@ -2368,5 +2199,5 @@ byte_written += fwrite(slvals.inbuffer, sizeof(char), numbyte-n_curr_trailing_z, pagerfp); } -/* printf("inbuffer went to:%s<<\nn_read_done is %d<<n_done is %d<<\n", slvals.inbuffer, n_read_done, n_done); */ + /* printf("inbuffer went to:%s<<\nn_read_done is %d<<n_done is %d<<\n", slvals.inbuffer, n_read_done, n_done); */ if (!n_read_done) { n_last_trailing_z = n_curr_trailing_z; @@ -2376,5 +2207,5 @@ /* read summary */ -/* send_status(slvals.n_sockfd, 0, TERM_NO); */ + /* send_status(slvals.n_sockfd, 0, TERM_NO); */ cs_status = read_status(slvals.n_sockfd); @@ -4981,4 +4812,11 @@ fprintf(errstream, get_status_msg(cs_status)); fprintf(errstream, "\n"); + if (slvals.n_file_open || slvals.n_file_append) { + close_outfile(pagerfp); + } + else { + closepager(pagerfp); + } + n_broken_pipe = 0; return 1; } |
From: Markus H. <mho...@us...> - 2005-05-05 17:22:14
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18941 Modified Files: Tag: Release_0_9_5_stable backend.c dbfncs.c dbfncs.h refdbd.c refdbda.c refdbdbib.c noteshandler.c risdb.c risxhandler.c xmlhandler.c Log Message: added sqlite3 support Index: backend.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/backend.c,v retrieving revision 1.27 retrieving revision 1.27.2.1 diff -u -U2 -r1.27 -r1.27.2.1 --- backend.c 1 May 2004 23:40:13 -0000 1.27 +++ backend.c 5 May 2005 17:21:11 -0000 1.27.2.1 @@ -401,5 +401,5 @@ /* mysql */ strcpy(sql_command, "CREATE TEMPORARY TABLE t_noteunion \ - (note_id INT, \ + (note_id BIGINT, \ note_key VARCHAR(255), \ note_title VARCHAR(255), \ @@ -407,5 +407,5 @@ note_content_type VARCHAR(255), \ note_content_xmllang VARCHAR(255), \ - note_user_id INT, \ + note_user_id BIGINT, \ note_date DATETIME)"); } @@ -434,11 +434,17 @@ note_content TEXT)"); } - else { - /* should never happen */ - LOG_PRINT(LOG_WARNING, "unsupported driver"); - free(sql_command); - free(sql_chunk); - return NULL; + else if (!strcmp(drivername, "sqlite3")) { + /* sqlite3 */ + strcpy(sql_command, "CREATE TEMPORARY TABLE t_noteunion \ + (note_id BIGINT, \ + note_key TEXT, \ + note_title TEXT, \ + note_content_type TEXT, \ + note_content_xmllang TEXT, \ + note_user_id BIGINT, \ + note_date DATE, \ + note_content TEXT)"); } + /* else: will be caught earlier */ LOG_PRINT(LOG_DEBUG, sql_command); Index: dbfncs.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/dbfncs.c,v retrieving revision 1.15.2.7 retrieving revision 1.15.2.8 diff -u -U2 -r1.15.2.7 -r1.15.2.8 --- dbfncs.c 15 Apr 2005 22:45:08 -0000 1.15.2.7 +++ dbfncs.c 5 May 2005 17:21:25 -0000 1.15.2.8 @@ -72,4 +72,5 @@ strcpy(ptr_caps->bigint, "t"); strcpy(ptr_caps->sql_union, "f"); + strcpy(ptr_caps->named_seq, "f"); ptr_caps->has_versioninfo = 0; } @@ -87,4 +88,5 @@ strcpy(ptr_caps->bigint, "t"); strcpy(ptr_caps->sql_union, "t"); + strcpy(ptr_caps->named_seq, "t"); ptr_caps->has_versioninfo = 1; } @@ -102,4 +104,21 @@ strcpy(ptr_caps->bigint, "f"); strcpy(ptr_caps->sql_union, "t"); + strcpy(ptr_caps->named_seq, "f"); + ptr_caps->has_versioninfo = 1; + } + else if (!strcmp(ptr_clrequest->dbserver, "sqlite3")) { + strcpy(ptr_caps->multiple_db, "f"); + strcpy(ptr_caps->sql_enum, "f"); + strcpy(ptr_caps->rlike, "LIKE"); + strcpy(ptr_caps->not_rlike, "NOT LIKE"); + strcpy(ptr_caps->transaction, "t"); + strcpy(ptr_caps->localhost, "NA"); + strcpy(ptr_caps->encoding, ""); + strcpy(ptr_caps->groups, "NA"); + strcpy(ptr_caps->admin_systable, "NA"); + strcpy(ptr_caps->listall, "%"); + strcpy(ptr_caps->bigint, "t"); + strcpy(ptr_caps->sql_union, "t"); + strcpy(ptr_caps->named_seq, "f"); ptr_caps->has_versioninfo = 1; } @@ -1280,4 +1299,425 @@ /*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + create_tables_sqlite3(): creates SQLite3-specific reference data tables + + int create_tables_sqlite3 returns >0 if error, 0 if successful + + struct CLIENT_REQUEST* ptr_clrequest ptr to structure with client info + + ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/ +int create_tables_sqlite3(dbi_conn conn, struct CLIENT_REQUEST* ptr_clrequest) { + dbi_result dbires; + + /* create the metadata table */ + dbires = dbi_conn_query(conn, "CREATE TABLE t_meta (meta_app VARCHAR(20), meta_type VARCHAR(20), meta_version VARCHAR(20), meta_dbversion SMALLINT, meta_create_date DATETIME, meta_modify_date DATETIME)"); + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(211)); + return 211; + } + + dbi_result_free(dbires); + + /* create the main table */ + dbires = dbi_conn_query(conn, "CREATE TABLE t_refdb \ + (refdb_id BIGINT PRIMARY KEY, \ + refdb_citekey TEXT UNIQUE, \ + refdb_type TEXT, \ + refdb_pubyear SMALLINT, \ + refdb_secyear SMALLINT, \ + refdb_startpage TEXT, \ + refdb_endpage TEXT, \ + refdb_abstract TEXT, \ + refdb_title TEXT, \ + refdb_volume TEXT, \ + refdb_issue TEXT, \ + refdb_booktitle TEXT, \ + refdb_city TEXT, \ + refdb_publisher TEXT, \ + refdb_title_series TEXT, \ + refdb_address TEXT, \ + refdb_url TEXT, \ + refdb_issn TEXT, \ + refdb_pyother_info TEXT, \ + refdb_secother_info TEXT, \ + refdb_periodical_id BIGINT, \ + refdb_user1 TEXT, \ + refdb_user2 TEXT, \ + refdb_user3 TEXT, \ + refdb_user4 TEXT, \ + refdb_user5 TEXT, \ + refdb_misc1 TEXT, \ + refdb_misc2 TEXT, \ + refdb_misc3 TEXT, \ + refdb_linkpdf TEXT, \ + refdb_linkfull TEXT, \ + refdb_linkrel TEXT, \ + refdb_linkimg TEXT)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(212)); + return 212; + } + + dbi_result_free(dbires); + + /* create the main table indexes */ + dbires = dbi_conn_query(conn, "CREATE INDEX i_refdb_pubyear ON t_refdb (refdb_pubyear)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(212)); + return 212; + } + + dbi_result_free(dbires); + + dbires = dbi_conn_query(conn, "CREATE UNIQUE INDEX i_refdb_citekey ON t_refdb (refdb_citekey)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(212)); + return 212; + } + + dbi_result_free(dbires); + + /* create the author table */ + dbires = dbi_conn_query(conn, "CREATE TABLE t_author \ + (author_id BIGINT PRIMARY KEY, \ + author_name TEXT NOT NULL, \ + author_lastname TEXT, \ + author_firstname TEXT, \ + author_middlename TEXT, \ + author_suffix TEXT)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(213)); + return 213; + } + + dbi_result_free(dbires); + + /* create t_author table index */ + dbires = dbi_conn_query(conn, "CREATE INDEX i_author_name ON t_author (author_name)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(213)); + return 213; + } + + dbi_result_free(dbires); + + /* create the keyword table */ + dbires = dbi_conn_query(conn, "CREATE TABLE t_keyword \ + (keyword_id BIGINT PRIMARY KEY, \ + keyword_name TEXT NOT NULL)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(214)); + return 214; + } + + dbi_result_free(dbires); + + /* create t_keyword table index */ + dbires = dbi_conn_query(conn, "CREATE INDEX i_keyword_name ON t_keyword (keyword_name)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(214)); + return 214; + } + + dbi_result_free(dbires); + + /* create the periodical table */ + dbires = dbi_conn_query(conn, "CREATE TABLE t_periodical \ + (periodical_id BIGINT PRIMARY KEY, \ + periodical_name TEXT, \ + periodical_abbrev TEXT, \ + periodical_custabbrev1 TEXT, \ + periodical_custabbrev2 TEXT)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(215)); + return 215; + } + + dbi_result_free(dbires); + + /* create t_periodical table indexes */ + dbires = dbi_conn_query(conn, "CREATE INDEX i_periodical_name ON t_periodical (periodical_name)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(215)); + return 215; + } + + dbi_result_free(dbires); + + dbires = dbi_conn_query(conn, "CREATE INDEX i_periodical_abbrev ON t_periodical (periodical_abbrev)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(215)); + return 215; + } + + dbi_result_free(dbires); + + dbires = dbi_conn_query(conn, "CREATE INDEX i_periodical_custabbrev1 ON t_periodical (periodical_custabbrev1)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(215)); + return 215; + } + + dbi_result_free(dbires); + + dbires = dbi_conn_query(conn, "CREATE INDEX i_periodical_custabbrev2 ON t_periodical (periodical_custabbrev2)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(215)); + return 215; + } + + dbi_result_free(dbires); + + /* create the notes table */ + dbires = dbi_conn_query(conn, "CREATE TABLE t_note \ + (note_id BIGINT PRIMARY KEY, \ + note_key TEXT UNIQUE, \ + note_title TEXT, \ + note_content_type TEXT, \ + note_content_xmllang TEXT, \ + note_user_id BIGINT, \ + note_date DATE, \ + note_content TEXT)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(216)); + return 216; + } + + dbi_result_free(dbires); + + /* create t_note table indexes */ + dbires = dbi_conn_query(conn, "CREATE INDEX i_note_title ON t_note (note_title)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(216)); + return 216; + } + + dbi_result_free(dbires); + + dbires = dbi_conn_query(conn, "CREATE INDEX i_note_note_userid ON t_note (note_user_id)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(216)); + return 216; + } + + dbi_result_free(dbires); + + dbires = dbi_conn_query(conn, "CREATE INDEX i_note_date ON t_note (note_date)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(216)); + return 216; + } + + dbi_result_free(dbires); + + /* create the user table */ + dbires = dbi_conn_query(conn, "CREATE TABLE t_user \ + (user_id BIGINT PRIMARY KEY, \ + user_name TEXT NOT NULL)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(217)); + return 217; + } + + dbi_result_free(dbires); + + /* create t_user table index */ + dbires = dbi_conn_query(conn, "CREATE INDEX i_user_name ON t_user (user_name)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(217)); + return 217; + } + + dbi_result_free(dbires); + + /* create the author xtable */ + dbires = dbi_conn_query(conn, "CREATE TABLE t_xauthor \ + (xauthor_id BIGINT PRIMARY KEY, \ + author_id BIGINT NOT NULL, \ + refdb_id BIGINT NOT NULL, \ + xauthor_type SMALLINT DEFAULT 1, \ + xauthor_role TEXT, \ + xauthor_position INTEGER)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(218)); + return 218; + } + + dbi_result_free(dbires); + + /* create t_xauthor table indexes */ + dbires = dbi_conn_query(conn, "CREATE INDEX i_xauthor_autid ON t_xauthor (author_id)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(218)); + return 218; + } + + dbi_result_free(dbires); + + dbires = dbi_conn_query(conn, "CREATE INDEX i_xauthor_refid ON t_xauthor (refdb_id)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(218)); + return 218; + } + + dbi_result_free(dbires); + + /* create the keyword xtable */ + dbires = dbi_conn_query(conn, "CREATE TABLE t_xkeyword \ + (xkeyword_id BIGINT PRIMARY KEY, \ + xkeyword_type TEXT, \ + keyword_id BIGINT NOT NULL, \ + xref_id BIGINT NOT NULL)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(219)); + return 219; + } + + dbi_result_free(dbires); + + /* create t_xkeyword table indexes */ + dbires = dbi_conn_query(conn, "CREATE INDEX i_xkeyword_kwid ON t_xkeyword (keyword_id)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(219)); + return 219; + } + + dbi_result_free(dbires); + + dbires = dbi_conn_query(conn, "CREATE INDEX i_xkeyword_xrefid ON t_xkeyword (xref_id)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(219)); + return 219; + } + + dbi_result_free(dbires); + + /* create the user xtable */ + dbires = dbi_conn_query(conn, "CREATE TABLE t_xuser \ + (xuser_id BIGINT PRIMARY KEY, \ + user_id BIGINT NOT NULL, \ + refdb_id BIGINT NOT NULL, \ + xuser_reprint TEXT DEFAULT \'NOT IN FILE\', \ + xuser_date DATE, \ + xuser_avail TEXT, \ + xuser_notes TEXT)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(220)); + return 220; + } + + dbi_result_free(dbires); + + /* create t_xuser table indexes */ + dbires = dbi_conn_query(conn, "CREATE INDEX i_xuser_userid ON t_xuser (user_id)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(220)); + return 220; + } + + dbi_result_free(dbires); + + dbires = dbi_conn_query(conn, "CREATE INDEX i_xuser_refid ON t_xuser (refdb_id)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(220)); + return 220; + } + + dbi_result_free(dbires); + + /* create the notes xtable */ + dbires = dbi_conn_query(conn, "CREATE TABLE t_xnote \ + (xnote_id BIGINT PRIMARY KEY, \ + note_id BIGINT NOT NULL, \ + xref_id BIGINT NOT NULL, \ + xnote_type TEXT DEFAULT \'REFERENCE\')"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(221)); + return 221; + } + + dbi_result_free(dbires); + + /* create t_xnote table indexes */ + dbires = dbi_conn_query(conn, "CREATE INDEX i_xnote_noteid ON t_xnote (note_id)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(221)); + return 221; + } + + dbi_result_free(dbires); + + dbires = dbi_conn_query(conn, "CREATE INDEX i_xnote_xrefid ON t_xnote (xref_id)"); + + + if (!dbires) { + LOG_PRINT(LOG_ERR, get_status_msg(221)); + return 221; + } + + dbi_result_free(dbires); + + return 0; +} + +/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ is_user_pgsql(): checks whether a user exists @@ -1655,4 +2095,7 @@ return ptr_dbcaps->sql_union; } + else if (!strcmp(cap, "named_seq")) { + return ptr_dbcaps->named_seq; + } /* else: should never happen */ Index: dbfncs.h =================================================================== RCS file: /cvsroot/refdb/refdb/src/dbfncs.h,v retrieving revision 1.6.2.1 retrieving revision 1.6.2.2 diff -u -U2 -r1.6.2.1 -r1.6.2.2 --- dbfncs.h 12 Feb 2005 01:50:01 -0000 1.6.2.1 +++ dbfncs.h 5 May 2005 17:21:25 -0000 1.6.2.2 @@ -35,4 +35,5 @@ char bigint[2]; /* if t, db engine supports unsigned long long */ char sql_union[2]; /* if t, the db engine supports UNION in SELECT */ + char named_seq[2]; /* if t, sequence_last() needs seq name */ int has_versioninfo; /* if non-zero, struct was updated with db engine version-specific information */ @@ -44,4 +45,5 @@ int create_tables_pgsql(dbi_conn conn, struct CLIENT_REQUEST* ptr_clrequest); int create_tables_sqlite(dbi_conn conn, struct CLIENT_REQUEST* ptr_clrequest); +int create_tables_sqlite3(dbi_conn conn, struct CLIENT_REQUEST* ptr_clrequest); int is_user_pgsql(dbi_conn conn, const char* username); int is_group_pgsql(dbi_conn conn, const char* groupname); Index: refdbd.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbd.c,v retrieving revision 1.74.2.12 retrieving revision 1.74.2.13 diff -u -U2 -r1.74.2.12 -r1.74.2.13 --- refdbd.c 19 Apr 2005 19:43:36 -0000 1.74.2.12 +++ refdbd.c 5 May 2005 17:21:25 -0000 1.74.2.13 @@ -297,5 +297,5 @@ break; case 'h': - fprintf(stderr, "Usage: refdbd [-b dbs_port] [-d database] [-D dbserver] [-e dest] [-E encoding] [-h] [-i address] [-I] [-k] [-K] [-l level] [-L file] [-p port] [-P PIDfile] [-q] [-r] [-s] [-T time] [-u] [-v] [-V] [-y confdir] [-Y driverdir]\nOptions: -b set database server port\n -D select database server (mysql|pgsql|sqlite)\n -e set log destination to dest (0-2)\n -h prints this help\n -i set server IP address to address\n -I allow remote connections\n -k keep periodical names when deleting references\n -K activate automatic keyword scan\n -l set the log level to level (0<=level<=7)\n -L use file as log-file (full path)\n -p set refdbd port\n -P set path to PID file\n -q ignore init-file\n -r allow remote administration\n -s run standalone, not as daemon\n -T set timeout to time\n -U uppercase citation keys (for SGML)\n -v show version information\n -V switch to verbose mode\n -y look for configuration files in confdir\n -Y look for dbi drivers in driverdir\n"); + fprintf(stderr, "Usage: refdbd [-b dbs_port] [-d database] [-D dbserver] [-e dest] [-E encoding] [-h] [-i address] [-I] [-k] [-K] [-l level] [-L file] [-p port] [-P PIDfile] [-q] [-r] [-s] [-T time] [-u] [-v] [-V] [-y confdir] [-Y driverdir]\nOptions: -b set database server port\n -D select database server (mysql|pgsql|sqlite|sqlite3)\n -e set log destination to dest (0-2)\n -h prints this help\n -i set server IP address to address\n -I allow remote connections\n -k keep periodical names when deleting references\n -K activate automatic keyword scan\n -l set the log level to level (0<=level<=7)\n -L use file as log-file (full path)\n -p set refdbd port\n -P set path to PID file\n -q ignore init-file\n -r allow remote administration\n -s run standalone, not as daemon\n -T set timeout to time\n -U uppercase citation keys (for SGML)\n -v show version information\n -V switch to verbose mode\n -y look for configuration files in confdir\n -Y look for dbi drivers in driverdir\n"); free(ptr_clrequest); exit (0); @@ -362,5 +362,5 @@ break; case ':': - fprintf(stderr, "Usage: refdbd [-b dbs_port] [-D dbserver] [-e dest] [-h] [-i address] [-I] [-k] [-K] [-l level] [-L file] [-p port] [-P PIDfile] [-q] [-r] [-s] [-T time] [-u] [-v] [-V] [-y confdir] [-Y driverdir]\nOptions: -b set database server port\n -D select database server (mysql|pgsql|sqlite)\n -e set log destination to dest (0-2)\n -h prints this help\n -i set server IP address to address\n -I allow remote connections\n -k keep periodical names when deleting references\n -K activate automatic keyword scan\n -l set the log level to level (0<=level<=7)\n -L use file as log-file (full path)\n -p set refdbd port\n -P set path to PID file\n -q ignore init-file\n -r allow remote administration\n -s run standalone, not as daemon\n -T set timeout to time\n -U uppercase citation keys (for SGML)\n -v show version information\n -V switch to verbose mode\n -y look for configuration files in confdir\n -Y look for dbi drivers in driverdir\n"); + fprintf(stderr, "Usage: refdbd [-b dbs_port] [-D dbserver] [-e dest] [-h] [-i address] [-I] [-k] [-K] [-l level] [-L file] [-p port] [-P PIDfile] [-q] [-r] [-s] [-T time] [-u] [-v] [-V] [-y confdir] [-Y driverdir]\nOptions: -b set database server port\n -D select database server (mysql|pgsql|sqlite|sqlite3)\n -e set log destination to dest (0-2)\n -h prints this help\n -i set server IP address to address\n -I allow remote connections\n -k keep periodical names when deleting references\n -K activate automatic keyword scan\n -l set the log level to level (0<=level<=7)\n -L use file as log-file (full path)\n -p set refdbd port\n -P set path to PID file\n -q ignore init-file\n -r allow remote administration\n -s run standalone, not as daemon\n -T set timeout to time\n -U uppercase citation keys (for SGML)\n -v show version information\n -V switch to verbose mode\n -y look for configuration files in confdir\n -Y look for dbi drivers in driverdir\n"); free(ptr_clrequest); exit (1); @@ -386,5 +386,7 @@ strup(default_input_encoding); - if (!strcmp(ptr_clrequest->dbserver, "sqlite") && *ip_or_path) { + if ((!strcmp(ptr_clrequest->dbserver, "sqlite") + || !strcmp(ptr_clrequest->dbserver, "sqlite3")) + && *ip_or_path) { strcpy(ptr_clrequest->db_path, ip_or_path); } Index: refdbda.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbda.c,v retrieving revision 1.41.2.10 retrieving revision 1.41.2.11 diff -u -U2 -r1.41.2.10 -r1.41.2.11 --- refdbda.c 19 Apr 2005 19:46:11 -0000 1.41.2.10 +++ refdbda.c 5 May 2005 17:21:28 -0000 1.41.2.11 @@ -43,13 +43,5 @@ #include "dbfncs.h" -/* these externs are all defined in refdbd.c */ -extern struct BSTRING outomem; -extern struct BSTRING outomem_n; -extern struct BSTRING connerr; -extern struct BSTRING connerr_n; -extern struct BSTRING positive; -extern struct BSTRING negative; -extern struct BSTRING cgihead_html; -extern struct BSTRING cgihead_plain; +/* these are defined in refdbd.c */ extern char server_ip[]; extern char log_file[]; @@ -400,4 +392,5 @@ if (!conn) { LOG_PRINT(LOG_WARNING, "creating database connection structure failed"); + LOG_PRINT(LOG_WARNING, "check your libdbi installation"); return NULL; } @@ -424,11 +417,18 @@ } } - else if (!strcmp(ptr_clrequest->dbserver, "sqlite")) { + else if (!strcmp(ptr_clrequest->dbserver, "sqlite") + || !strcmp(ptr_clrequest->dbserver, "sqlite3")) { dbi_conn_set_option(conn, "sqlite_dbdir", ptr_clrequest->db_path); } if (dbi_conn_connect(conn) < 0) { /* -1 and -2 indicate errors */ + const char* errmsg = NULL; + LOG_PRINT(LOG_WARNING, "failed to connect to database server using database:"); LOG_PRINT(LOG_WARNING, my_db); + dbi_conn_error(conn, &errmsg); + if (errmsg) { + LOG_PRINT(LOG_WARNING, errmsg); + } dbi_conn_close(conn); return NULL; @@ -436,5 +436,5 @@ if (!nocheck && strcmp(my_db, MAIN_DB) && !is_reference_database(NULL, conn, my_db)) { - LOG_PRINT(LOG_WARNING, "failed to connect to database server using database:"); + LOG_PRINT(LOG_WARNING, "does not appear to be a RefDB reference database:"); LOG_PRINT(LOG_WARNING, my_db); dbi_conn_close(conn); @@ -602,11 +602,4 @@ /* selectdb */ - if (ptr_clrequest->n_cgi) { - send_status(ptr_clrequest->fd, 0, TERM_NO); - iwrite(ptr_clrequest->fd, cgihead_html.text, cgihead_html.length); - tiwrite(ptr_clrequest->fd, html_head, TERM_NO); - tiwrite(ptr_clrequest->fd, "<thead><tr><th class=\"result\">Current Database</th></tr></thead><tbody><tr><td class=\"result\">", TERM_NO); - free(html_head); - } if (dbi_result_next_row(dbires)) { /* this is just to prevent problems if the SQL server @@ -664,11 +657,4 @@ /* listdb */ - if (ptr_clrequest->n_cgi) { - send_status(ptr_clrequest->fd, 0, TERM_NO); - iwrite(ptr_clrequest->fd, cgihead_html.text, cgihead_html.length); - tiwrite(ptr_clrequest->fd, html_head, TERM_NO); - tiwrite(ptr_clrequest->fd, "<thead><tr><th class=\"result\">Available Databases</th></tr></thead><tbody><tr><td><input type=\"button\" value=\"Select database\" onclick=\"seldb()\"></td></tr>", TERM_NO); - free(html_head); - } while (dbi_result_next_row(dbires)) { dbname = dbi_result_get_string_idx(dbires, 1); @@ -692,8 +678,4 @@ } } - if (ptr_clrequest->n_cgi) { - tiwrite(ptr_clrequest->fd, html_foot, TERM_NO); - free(html_foot); - } } dbi_result_free(dbires); @@ -1086,5 +1068,6 @@ it */ - if (strcmp(drivername, "sqlite")) { + if (strcmp(drivername, "sqlite") + && strcmp(drivername, "sqlite3")) { const char* encoding_string; @@ -1172,4 +1155,12 @@ } } + else if (!strcmp(drivername, "sqlite3")) { + if ((error = create_tables_sqlite3(conn, ptr_clrequest)) != 0) { + /* function provides log message */ + snprintf(message, 128, "%d:%s\n", error, dbname); + retval = 2; + goto finish; + } + } /* else: should never happen */ } @@ -1269,5 +1260,6 @@ error = 0; - if (!strcmp(drivername, "sqlite")) { + if (!strcmp(drivername, "sqlite") + || !strcmp(drivername, "sqlite3")) { /* sqlite has no SQL way to drop databases. Try to remove the database file from the file system manually */ @@ -1457,5 +1449,7 @@ drivername = dbi_driver_get_name(dbi_conn_get_driver(conn)); - if (!strcmp(drivername, "sqlite")) { /* driver does not support SQL-based access control */ + if (!strcmp(drivername, "sqlite") + || !strcmp(drivername, "sqlite3")) { + /* driver does not support SQL-based access control */ send_status(ptr_clrequest->fd, 224, TERM_NO); LOG_PRINT(LOG_WARNING, "999:access control not supported"); Index: refdbdbib.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdbib.c,v retrieving revision 1.36.2.16 retrieving revision 1.36.2.17 diff -u -U2 -r1.36.2.16 -r1.36.2.17 --- refdbdbib.c 17 Apr 2005 00:09:10 -0000 1.36.2.16 +++ refdbdbib.c 5 May 2005 17:21:31 -0000 1.36.2.17 @@ -364,7 +364,7 @@ if (!strcmp(ptr_clrequest->dbserver, "mysql")) { - sprintf(sql_command, "CREATE TEMPORARY TABLE %s (id INT NOT NULL AUTO_INCREMENT, \ + sprintf(sql_command, "CREATE TEMPORARY TABLE %s (id BIGINT NOT NULL AUTO_INCREMENT, \ dbname VARCHAR(64), \ - orig_id INT, \ + orig_id BIGINT, \ entry_id BLOB, \ article_title BLOB, \ @@ -384,7 +384,7 @@ } else if (!strcmp(ptr_clrequest->dbserver, "pgsql")) { - sprintf(sql_command, "CREATE TEMPORARY TABLE %s (id SERIAL, \ + sprintf(sql_command, "CREATE TEMPORARY TABLE %s (id BIGSERIAL, \ dbname VARCHAR(64), \ - orig_id INTEGER, \ + orig_id BIGINT, \ entry_id TEXT, \ article_title TEXT, \ @@ -422,4 +422,23 @@ year_uni_suffix TEXT)", table_name); } + else if (!strcmp(ptr_clrequest->dbserver, "sqlite3")) { + sprintf(sql_command, "CREATE TEMPORARY TABLE %s (id BIGINT PRIMARY KEY, \ + dbname VARCHAR(64), \ + orig_id BIGINT, \ + entry_id TEXT, \ + article_title TEXT, \ + author_concat TEXT, \ + periodical TEXT, \ + volume TEXT, \ + issue TEXT, \ + startpage TEXT, \ + pubyear SMALLINT, \ + citation_pos INTEGER, \ + xref_pos INTEGER, \ + multi_id TEXT, \ + sorted_pos INTEGER DEFAULT 1, \ + author_abbrevlist TEXT, \ + year_uni_suffix TEXT)", table_name); + } LOG_PRINT(LOG_DEBUG, sql_command); Index: noteshandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/noteshandler.c,v retrieving revision 1.18.2.4 retrieving revision 1.18.2.5 diff -u -U2 -r1.18.2.4 -r1.18.2.5 --- noteshandler.c 15 Apr 2005 22:45:08 -0000 1.18.2.4 +++ noteshandler.c 5 May 2005 17:21:34 -0000 1.18.2.5 @@ -390,14 +390,9 @@ /* retrieve note_id of newly created dataset */ - if (!strcmp(ptr_andata->drivername, "mysql") || !strcmp(ptr_andata->drivername, "sqlite")) { + if (!strcmp(my_dbi_conn_get_cap(ptr_andata->conn, "named_seq"), "f")) { ptr_andata->n_note_id = dbi_conn_sequence_last(ptr_andata->conn, NULL); } - else if (!strcmp(ptr_andata->drivername, "pgsql")) { - ptr_andata->n_note_id = dbi_conn_sequence_last(ptr_andata->conn, "t_note_note_id_seq"); - } else { - LOG_PRINT(LOG_ERR, "driver not supported"); - (ptr_andata->ndb_error)++; - return; + ptr_andata->n_note_id = dbi_conn_sequence_last(ptr_andata->conn, "t_note_note_id_seq"); } Index: risdb.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/risdb.c,v retrieving revision 1.44.2.3 retrieving revision 1.44.2.4 diff -u -U2 -r1.44.2.3 -r1.44.2.4 --- risdb.c 17 Apr 2005 00:09:12 -0000 1.44.2.3 +++ risdb.c 5 May 2005 17:21:36 -0000 1.44.2.4 @@ -643,5 +643,5 @@ /* retrieve refdb_id of newly created dataset */ - if (!strcmp(drivername, "mysql") || !strcmp(drivername, "sqlite")) { + if (!strcmp(my_dbi_conn_get_cap(conn, "named_seq"), "f")) { n_refdb_id = dbi_conn_sequence_last(conn, NULL); } @@ -1917,15 +1917,9 @@ } - if (!strcmp(drivername, "mysql") || !strcmp(drivername, "sqlite")) { + if (!strcmp(my_dbi_conn_get_cap(conn, "named_seq"), "f")) { n_periodical_id = dbi_conn_sequence_last(conn, NULL); } - else if (!strcmp(drivername, "pgsql")) { - n_periodical_id = dbi_conn_sequence_last(conn, "t_periodical_periodical_id_seq"); - } else { - dbi_result_free(dbires); - free(sql_command); - LOG_PRINT(LOG_ERR, "driver not supported"); - return 3; + n_periodical_id = dbi_conn_sequence_last(conn, "t_periodical_periodical_id_seq"); } @@ -2104,15 +2098,9 @@ /* retrieve user_id of newly created user entry */ - if (!strcmp(drivername, "mysql") || !strcmp(drivername, "sqlite")) { + if (!strcmp(my_dbi_conn_get_cap(conn, "named_seq"), "f")) { *ptr_n_user_id = dbi_conn_sequence_last(conn, NULL); } - else if (!strcmp(drivername, "pgsql")) { - *ptr_n_user_id = dbi_conn_sequence_last(conn, "t_user_user_id_seq"); - } else { - dbi_result_free(dbires1); - dbi_result_free(dbires); - LOG_PRINT(LOG_ERR, "driver not supported"); - return 5; + *ptr_n_user_id = dbi_conn_sequence_last(conn, "t_user_user_id_seq"); } dbi_result_free(dbires1); @@ -2689,15 +2677,9 @@ dbi_result_free(dbires1); - if (!strcmp(drivername, "mysql") || !strcmp(drivername, "sqlite")) { + if (!strcmp(my_dbi_conn_get_cap(conn, "named_seq"), "f")) { n_author_id = dbi_conn_sequence_last(conn, NULL); } - else if (!strcmp(drivername, "pgsql")) { - n_author_id = dbi_conn_sequence_last(conn, "t_author_author_id_seq"); - } else { - LOG_PRINT(LOG_ERR, "driver not supported"); - free(sql_command); - free(escape_buffer); - return 4; + n_author_id = dbi_conn_sequence_last(conn, "t_author_author_id_seq"); } } @@ -2962,15 +2944,9 @@ dbi_result_free(dbires1); - if (!strcmp(drivername, "mysql") || !strcmp(drivername, "sqlite")) { + if (!strcmp(my_dbi_conn_get_cap(conn, "named_seq"), "f")) { n_keyword_id = dbi_conn_sequence_last(conn, NULL); } - else if (!strcmp(drivername, "pgsql")) { - n_keyword_id = dbi_conn_sequence_last(conn, "t_keyword_keyword_id_seq"); - } else { - LOG_PRINT(LOG_ERR, "driver not supported"); - free(escape_buffer); - free(sql_command); - return 4; + n_keyword_id = dbi_conn_sequence_last(conn, "t_keyword_keyword_id_seq"); } } Index: risxhandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/risxhandler.c,v retrieving revision 1.28.2.5 retrieving revision 1.28.2.6 diff -u -U2 -r1.28.2.5 -r1.28.2.6 --- risxhandler.c 15 Apr 2005 22:45:11 -0000 1.28.2.5 +++ risxhandler.c 5 May 2005 17:21:52 -0000 1.28.2.6 @@ -412,14 +412,9 @@ /* retrieve refdb_id of newly created dataset */ - if (!strcmp(ptr_ardata->drivername, "mysql") || !strcmp(ptr_ardata->drivername, "sqlite")) { + if (!strcmp(my_dbi_conn_get_cap(ptr_ardata->conn, "named_seq"), "f")) { ptr_ardata->n_refdb_id = dbi_conn_sequence_last(ptr_ardata->conn, NULL); } - else if (!strcmp(ptr_ardata->drivername, "pgsql")) { - ptr_ardata->n_refdb_id = dbi_conn_sequence_last(ptr_ardata->conn, "t_refdb_refdb_id_seq"); - } else { - LOG_PRINT(LOG_ERR, "driver not supported"); - (ptr_ardata->ndb_error)++; - return; + ptr_ardata->n_refdb_id = dbi_conn_sequence_last(ptr_ardata->conn, "t_refdb_refdb_id_seq"); } Index: xmlhandler.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/xmlhandler.c,v retrieving revision 1.22.2.13 retrieving revision 1.22.2.14 diff -u -U2 -r1.22.2.13 -r1.22.2.14 --- xmlhandler.c 21 Apr 2005 21:15:25 -0000 1.22.2.13 +++ xmlhandler.c 5 May 2005 17:21:52 -0000 1.22.2.14 @@ -100,14 +100,9 @@ } else { - if (!strcmp(drivername, "mysql") || !strcmp(drivername, "sqlite")) { + if (!strcmp(my_dbi_conn_get_cap(ptr_asdata->conn, "named_seq"), "f")) { *(ptr_asdata->ptr_citstyle_id) = dbi_conn_sequence_last(ptr_asdata->conn, NULL); } - else if (!strcmp(drivername, "pgsql")) { - *(ptr_asdata->ptr_citstyle_id) = dbi_conn_sequence_last(ptr_asdata->conn, "citstyle_id_seq"); - } else { - dbi_result_free(dbires); - LOG_PRINT(LOG_ERR, "driver not supported"); - return; + *(ptr_asdata->ptr_citstyle_id) = dbi_conn_sequence_last(ptr_asdata->conn, "citstyle_id_seq"); } dbi_result_free(dbires); @@ -154,14 +149,9 @@ } else { - if (!strcmp(drivername, "mysql") || !strcmp(drivername, "sqlite")) { + if (!strcmp(my_dbi_conn_get_cap(ptr_asdata->conn, "named_seq"), "f")) { *(ptr_asdata->ptr_refstyle_id) = dbi_conn_sequence_last(ptr_asdata->conn, NULL); } - else if (!strcmp(drivername, "pgsql")) { - *(ptr_asdata->ptr_refstyle_id) = dbi_conn_sequence_last(ptr_asdata->conn, "refstyle_id_seq"); - } else { - dbi_result_free(dbires); - LOG_PRINT(LOG_ERR, "driver not supported"); - return; + *(ptr_asdata->ptr_refstyle_id) = dbi_conn_sequence_last(ptr_asdata->conn, "refstyle_id_seq"); } dbi_result_free(dbires); @@ -178,14 +168,9 @@ } else { - if (!strcmp(drivername, "mysql") || !strcmp(drivername, "sqlite")) { + if (!strcmp(my_dbi_conn_get_cap(ptr_asdata->conn, "named_seq"), "f")) { *(ptr_asdata->ptr_separator_id) = dbi_conn_sequence_last(ptr_asdata->conn, NULL); } - else if (!strcmp(drivername, "pgsql")) { - *(ptr_asdata->ptr_separator_id) = dbi_conn_sequence_last(ptr_asdata->conn, "separators_id_seq"); - } else { - dbi_result_free(dbires); - LOG_PRINT(LOG_ERR, "driver not supported"); - return; + *(ptr_asdata->ptr_separator_id) = dbi_conn_sequence_last(ptr_asdata->conn, "separators_id_seq"); } dbi_result_free(dbires); |
From: Markus H. <mho...@us...> - 2005-05-05 17:08:25
|
Update of /cvsroot/refdb/refdb/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16694 Modified Files: Tag: Release_0_9_5_stable statgen.pl Log Message: rephrased 202 and 204 Index: statgen.pl =================================================================== RCS file: /cvsroot/refdb/refdb/scripts/Attic/statgen.pl,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -U2 -r1.1.2.1 -r1.1.2.2 --- statgen.pl 20 Apr 2005 19:43:32 -0000 1.1.2.1 +++ statgen.pl 5 May 2005 17:07:50 -0000 1.1.2.2 @@ -1,7 +1,8 @@ #!/usr/bin/perl # generates status message listings for C, Perl, DocBook -# usage: vargen.pl c|perl|docbook > outfile +# usage: statgen.pl c|perl|docbook > outfile +# if no argument is given, statgen.pl creates tab-separated output -## the status message hashes +## the status message array @refstat = ( @@ -28,7 +29,7 @@ ["200", "void"], ["201", "main database is missing"], - ["202", "access denied to main database"], + ["202", "could not open main database"], ["203", "main database is too old or corrupt"], - ["204", "access denied to reference database"], + ["204", "could not open reference database"], ["205", "could not connect to database server"], ["206", "main database version is not supported"], @@ -181,5 +182,5 @@ - +# check command line argument and call appropriate output sub if ($ARGV[0] eq "c") { write_c(); |
From: Markus H. <mho...@us...> - 2005-05-04 20:16:30
|
Update of /cvsroot/refdb/homepage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4753 Modified Files: index.html Log Message: added FreeBSD port news Index: index.html =================================================================== RCS file: /cvsroot/refdb/homepage/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -u -U2 -r1.2 -r1.3 --- index.html 7 Apr 2005 18:45:25 -0000 1.2 +++ index.html 4 May 2005 20:16:18 -0000 1.3 @@ -109,10 +109,10 @@ <p>RefDB is a reference database and bibliography tool for SGML, XML, and LaTeX/BibTeX documents. It allows users to share databases over a network. It is lightweight and portable to basically all platforms with a decent C compiler. And it's released under the <a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</a>.</p> <p>RefDB is currently known to build and run out of the tarball on at least these platforms:</p><ul> - <li>Linux</li> - <li>FreeBSD</li> - <li>NetBSD</li> - <li>Solaris (using gcc)</li> - <li>OSX/Darwin</li> - <li>Windows+Cygwin</li> + <li><a href="http://www.linux.org">Linux</a></li> + <li><a href="http://www.freebsd.org">FreeBSD</a></li> + <li><a href="http://www.netbsd.org">NetBSD</a></li> + <li><a href="http://www.sun.com/software/solaris/index.jsp">Solaris</a> (using gcc)</li> + <li><a href="http://www.apple.com/macosx/">OSX</a>/<a href="http://developer.apple.com/darwin/">Darwin</a></li> + <li><a href="http://www.microsoft.com/windows/default.mspx">Windows</a>+<a href="http://www.cygwin.com">Cygwin</a></li> </ul> <p>RefDB appears to be the only available tool to create HTML, PostScript, PDF, DVI, MIF, or RTF output from <a href="http://www.oasis-open.org/docbook/">DocBook</a> or <a href="http://www.tei-c.org">TEI</a> sources with <b>fully formatted</b> citations and bibliographies according to publisher's specifications (check out some <a href="examples.html">examples</a>). Additional document types can be easily added.</p> @@ -126,6 +126,10 @@ <h2>News</h2> <div class="news"> + <h3>May 2, 2005</h3> + <p>A <a href="http://www.freebsd.org">FreeBSD</a> port is now available. Please see the instructions on the <a href="download.html#freebsd">download</a> page. See also this <a href="http://sourceforge.net/mailarchive/forum.php?thread_id=7160760&forum_id=1798">thread</a> for some additional information.</p> + </div> + <div class="news"> <h3>April 6, 2005</h3> - <p>Debian packages of the latest prerelease and of the current CVS version are now available. Please see the instructions on the <a href="download.html#debian">download</a> page. See also this <a href="http://sourceforge.net/mailarchive/forum.php?thread_id=6992053&forum_id=1798">thread</a> for additional information.</p> + <p><a href="http://www.debian.org">Debian</a> packages of the latest prerelease and of the current CVS version are now available. Please see the instructions on the <a href="download.html#debian">download</a> page. See also this <a href="http://sourceforge.net/mailarchive/forum.php?thread_id=6992053&forum_id=1798">thread</a> for additional information.</p> </div> <div class="news"> |
From: Markus H. <mho...@us...> - 2005-05-04 19:51:34
|
Update of /cvsroot/refdb/homepage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30382 Modified Files: download.html Log Message: added FreeBSD port Index: download.html =================================================================== RCS file: /cvsroot/refdb/homepage/download.html,v retrieving revision 1.5 retrieving revision 1.6 diff -u -U2 -r1.5 -r1.6 --- download.html 21 Apr 2005 21:32:46 -0000 1.5 +++ download.html 4 May 2005 19:51:21 -0000 1.6 @@ -127,4 +127,7 @@ </tr> <tr> + <td class="localnav"><a href="#freebsd">FreeBSD port</a></td> + </tr> + <tr> <td class="localnav"><a href="#prereleases">Prereleases</a></td> </tr> @@ -182,4 +185,8 @@ <p>Released versions are not yet available as Debian packages.</p> + <h2 id="freebsd">FreeBSD port</h2> + <p>Although RefDB is not (yet) part of the ports collection, you can still benefit from the ease of use of the ports system and install RefDB and all its dependencies by running <code>make && make install</code>. The <a href="ports/freebsd/refdb.tar.gz">current port</a> builds RefDB-0.9.5. See <a href="http://logicsquad.net/refdb/">here</a> for additional information about this port.</p> + + <h2 id="prereleases">Prereleases</h2> <p>If you don't want to fiddle with CVS (see the next section) but would like to help testing, consider using the latest prerelease. These archives can be installed just like regular releases, but they may not be as well-tested as these. However, you'll get bugfixes and new features that are otherwise only in the CVS version. The latest prerelease, if any, is always right <a href="pre/refdb-latest.tar.gz">here</a>. Perl hackers who want to use the current prerelease need <a href="pre/RefDBClient-Client-1.11.tar.gz">this client library</a>.</p> |
From: Markus H. <mho...@us...> - 2005-05-03 20:31:48
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12088 Modified Files: Tag: Release_0_9_5_stable refdbdnote.c Log Message: fixed hang when getnote returns zero datasets Index: refdbdnote.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdnote.c,v retrieving revision 1.25.2.3 retrieving revision 1.25.2.4 diff -u -U2 -r1.25.2.3 -r1.25.2.4 --- refdbdnote.c 17 Apr 2005 00:09:10 -0000 1.25.2.3 +++ refdbdnote.c 3 May 2005 20:31:39 -0000 1.25.2.4 @@ -2161,121 +2161,128 @@ } - /* fetch all notes we're interested in */ - while (dbi_result_next_row(rendinfo.dbires) != 0) { - nref_counter++; - - /* fill in variable elements of structure */ - rendinfo.ptr_ref = &sql_command; - rendinfo.ptr_ref_len = &sql_command_len; - rendinfo.nref_counter = nref_counter; - - /* recycle sql_command */ - if ((render_res = render_note(&rendinfo)) != 0) { - if (render_res == 801) { - retval = 1; - tiwrite(ptr_clrequest->fd, "", TERM_YES); - read_status(ptr_clrequest->fd); - send_status(ptr_clrequest->fd, 801, TERM_NO); - LOG_PRINT(LOG_CRIT, get_status_msg(801)); - dbi_result_free(rendinfo.dbires); - dbi_conn_close(conn); - delete_all_lilimem(&sentinel); - if (conv_descriptor) { - iconv_close(conv_descriptor); + if (dbi_result_get_numrows(rendinfo.dbires)) { + /* fetch all notes we're interested in */ + while (dbi_result_next_row(rendinfo.dbires) != 0) { + nref_counter++; + + /* fill in variable elements of structure */ + rendinfo.ptr_ref = &sql_command; + rendinfo.ptr_ref_len = &sql_command_len; + rendinfo.nref_counter = nref_counter; + + /* recycle sql_command */ + if ((render_res = render_note(&rendinfo)) != 0) { + if (render_res == 801) { + retval = 1; + tiwrite(ptr_clrequest->fd, "", TERM_YES); + read_status(ptr_clrequest->fd); + send_status(ptr_clrequest->fd, 801, TERM_NO); + LOG_PRINT(LOG_CRIT, get_status_msg(801)); + dbi_result_free(rendinfo.dbires); + dbi_conn_close(conn); + delete_all_lilimem(&sentinel); + if (conv_descriptor) { + iconv_close(conv_descriptor); + } + return 0; + } + else { + ptr_addresult->failure++; } - return 0; - } - else { - ptr_addresult->failure++; } - } - - /* run a character encoding conversion if required */ - if (conv_descriptor && *sql_command) { - size_t inlength; - size_t outlength; - char* my_sql_command = NULL; /* this ptr will be modified by iconv() */ - char* my_sql_command_start = NULL; /* records initial state of my_elvalue */ - const char* my_instring = NULL; /* this ptr will be modified by iconv() */ - inlength = strlen(sql_command)/* + 1 */; - /* with the encodings supported by our database engines, the converted - string can't be longer than six times the input string */ - outlength = 6*inlength; - if ((my_sql_command = (char*)malloc(outlength)) == NULL) { - retval = 1; - tiwrite(ptr_clrequest->fd, "", TERM_YES); - read_status(ptr_clrequest->fd); - send_status(ptr_clrequest->fd, 801, TERM_NO); - LOG_PRINT(LOG_CRIT, get_status_msg(801)); - dbi_result_free(rendinfo.dbires); - dbi_conn_close(conn); - delete_all_lilimem(&sentinel); - if (conv_descriptor) { - iconv_close(conv_descriptor); - } - return 0; - } - - /* keep start of the converted string */ - my_sql_command_start = my_sql_command; - - /* variable will be modified by iconv, so don't use original */ - my_instring = (const char*)sql_command; - - /* now actually do the conversion */ - if (iconv(conv_descriptor, &my_instring, &inlength, &my_sql_command, &outlength) == (size_t)(-1)) { - if (errno == EILSEQ) { - sprintf(sql_command, "iconv: invalid input character sequence\n"); - LOG_PRINT(LOG_WARNING, "iconv: invalid input character sequence"); - } - else if (errno == E2BIG) { - sprintf(sql_command, "iconv: output buffer too small\n"); - LOG_PRINT(LOG_WARNING, "iconv: output buffer too small"); - } - else if (errno == EINVAL) { - sprintf(sql_command, "iconv: incomplete input character\n"); - LOG_PRINT(LOG_WARNING, "iconv: incomplete input character"); + /* run a character encoding conversion if required */ + if (conv_descriptor && *sql_command) { + size_t inlength; + size_t outlength; + char* my_sql_command = NULL; /* this ptr will be modified by iconv() */ + char* my_sql_command_start = NULL; /* records initial state of my_elvalue */ + const char* my_instring = NULL; /* this ptr will be modified by iconv() */ + inlength = strlen(sql_command)/* + 1 */; + /* with the encodings supported by our database engines, the converted + string can't be longer than six times the input string */ + outlength = 6*inlength; + + if ((my_sql_command = (char*)malloc(outlength)) == NULL) { + retval = 1; + tiwrite(ptr_clrequest->fd, "", TERM_YES); + read_status(ptr_clrequest->fd); + send_status(ptr_clrequest->fd, 801, TERM_NO); + LOG_PRINT(LOG_CRIT, get_status_msg(801)); + dbi_result_free(rendinfo.dbires); + dbi_conn_close(conn); + delete_all_lilimem(&sentinel); + if (conv_descriptor) { + iconv_close(conv_descriptor); + } + return 0; } - - tiwrite(ptr_clrequest->fd, "", TERM_YES); - read_status(ptr_clrequest->fd); - send_status(ptr_clrequest->fd, 702, TERM_NO); - dbi_result_free(rendinfo.dbires); - dbi_conn_close(conn); - delete_all_lilimem(&sentinel); - if (conv_descriptor) { - iconv_close(conv_descriptor); - } - return 0; - } - /* else: conversion went ok. We free the original string and replace - it with the converted copy */ - if (sql_command) { - free(sql_command); - } - sql_command = my_sql_command_start; - sql_command_len = outlength; - result_len = (size_t)(my_sql_command - my_sql_command_start - 1); - } - else { /* no conversion required */ - result_len = strlen(sql_command); - } - - /* send ok status, then the terminated result string */ - send_status(ptr_clrequest->fd, 404, TERM_NO); - iwrite(ptr_clrequest->fd, sql_command, result_len); - iwrite(ptr_clrequest->fd, cs_term, TERM_LEN); - ptr_addresult->success++; - - /* reset buffer string */ - sql_command[0] = '\0'; - /* read client response */ - cs_status = read_status(ptr_clrequest->fd); + /* keep start of the converted string */ + my_sql_command_start = my_sql_command; - if (cs_status) { - break; - } + /* variable will be modified by iconv, so don't use original */ + my_instring = (const char*)sql_command; + + /* now actually do the conversion */ + if (iconv(conv_descriptor, &my_instring, &inlength, &my_sql_command, &outlength) == (size_t)(-1)) { + if (errno == EILSEQ) { + sprintf(sql_command, "iconv: invalid input character sequence\n"); + LOG_PRINT(LOG_WARNING, "iconv: invalid input character sequence"); + } + else if (errno == E2BIG) { + sprintf(sql_command, "iconv: output buffer too small\n"); + LOG_PRINT(LOG_WARNING, "iconv: output buffer too small"); + } + else if (errno == EINVAL) { + sprintf(sql_command, "iconv: incomplete input character\n"); + LOG_PRINT(LOG_WARNING, "iconv: incomplete input character"); + } + + tiwrite(ptr_clrequest->fd, "", TERM_YES); + read_status(ptr_clrequest->fd); + send_status(ptr_clrequest->fd, 702, TERM_NO); + dbi_result_free(rendinfo.dbires); + dbi_conn_close(conn); + delete_all_lilimem(&sentinel); + if (conv_descriptor) { + iconv_close(conv_descriptor); + } + return 0; + } + /* else: conversion went ok. We free the original string and replace + it with the converted copy */ + if (sql_command) { + free(sql_command); + } + sql_command = my_sql_command_start; + sql_command_len = outlength; + result_len = (size_t)(my_sql_command - my_sql_command_start - 1); + } + else { /* no conversion required */ + result_len = strlen(sql_command); + } + + /* send ok status, then the terminated result string */ + send_status(ptr_clrequest->fd, 404, TERM_NO); + iwrite(ptr_clrequest->fd, sql_command, result_len); + iwrite(ptr_clrequest->fd, cs_term, TERM_LEN); + ptr_addresult->success++; + + /* reset buffer string */ + sql_command[0] = '\0'; + + /* read client response */ + cs_status = read_status(ptr_clrequest->fd); + + if (cs_status) { + break; + } + } /* end while */ + } + else { + /* no notes found, send an empty body */ + send_status(ptr_clrequest->fd, 402, TERM_NO); + iwrite(ptr_clrequest->fd, cs_term, TERM_LEN); } |
From: Markus H. <mho...@us...> - 2005-05-03 20:30:19
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11385 Modified Files: Tag: Release_0_9_5_stable refdbdref.c Log Message: fixed hang when getref returns zero datasets Index: refdbdref.c =================================================================== RCS file: /cvsroot/refdb/refdb/src/refdbdref.c,v retrieving revision 1.65.2.7 retrieving revision 1.65.2.8 diff -u -U2 -r1.65.2.7 -r1.65.2.8 --- refdbdref.c 17 Apr 2005 00:09:10 -0000 1.65.2.7 +++ refdbdref.c 3 May 2005 20:30:08 -0000 1.65.2.8 @@ -4134,115 +4134,122 @@ } - /* fetch all articles we're interested in */ - while (dbi_result_next_row(rendinfo.dbires) != 0) { - nref_counter++; - /* fill in variable elements of structure */ - rendinfo.ptr_ref = &sql_command; - rendinfo.ptr_ref_len = &sql_command_len; - rendinfo.nref_counter = nref_counter; - - /* todo: count query errors and such as failed datasets, bail out only - after irrecoverable errors */ - if ((render_res = render_ref(&rendinfo)) != 0) { - if (render_res == 801) { - retval = 1; - send_status(ptr_clrequest->fd, render_res, TERM_NO); - dbi_result_free(rendinfo.dbires); - dbi_conn_close(conn); - delete_all_lilimem(&sentinel); - if (conv_descriptor) { - iconv_close(conv_descriptor); + if (dbi_result_get_numrows(rendinfo.dbires)) { + /* fetch all articles we're interested in */ + while (dbi_result_next_row(rendinfo.dbires) != 0) { + nref_counter++; + /* fill in variable elements of structure */ + rendinfo.ptr_ref = &sql_command; + rendinfo.ptr_ref_len = &sql_command_len; + rendinfo.nref_counter = nref_counter; + + /* todo: count query errors and such as failed datasets, bail out only + after irrecoverable errors */ + if ((render_res = render_ref(&rendinfo)) != 0) { + if (render_res == 801) { + retval = 1; + send_status(ptr_clrequest->fd, render_res, TERM_NO); + dbi_result_free(rendinfo.dbires); + dbi_conn_close(conn); + delete_all_lilimem(&sentinel); + if (conv_descriptor) { + iconv_close(conv_descriptor); + } + return 0; } - return 0; - } - else { - ptr_addresult->failure++; - } - } - - /* run a character encoding conversion if required */ - if (conv_descriptor && *sql_command) { - size_t inlength; - size_t outlength; - char* my_sql_command = NULL; /* this ptr will be modified by iconv() */ - char* my_sql_command_start = NULL; /* records initial state of my_elvalue */ - const char* my_instring = NULL; /* this ptr will be modified by iconv() */ - /* strlen should be ok here as this can't be a multibyte encoding */ - inlength = strlen(sql_command)/* + 1 */; - /* with the encodings supported by our database engines, the converted - string can't be longer than six times the input string */ - /* todo: is this assumption correct? */ - outlength = 6*inlength; - - if ((my_sql_command = (char*)calloc(outlength, sizeof(char))) == NULL) { - retval = 1; - send_status(ptr_clrequest->fd, 801, TERM_NO); - LOG_PRINT(LOG_CRIT, get_status_msg(801)); - dbi_result_free(rendinfo.dbires); - dbi_conn_close(conn); - delete_all_lilimem(&sentinel); - if (conv_descriptor) { - iconv_close(conv_descriptor); + else { + ptr_addresult->failure++; } - return 0; } - /* keep start of the converted string */ - my_sql_command_start = my_sql_command; - - /* variable will be modified by iconv, so don't use original */ - my_instring = (const char*)sql_command; - - /* now actually do the conversion */ - if (iconv(conv_descriptor, &my_instring, &inlength, &my_sql_command, &outlength) == (size_t)(-1)) { - if (errno == EILSEQ) { - LOG_PRINT(LOG_WARNING, "iconv: invalid input character sequence"); - } - else if (errno == E2BIG) { - LOG_PRINT(LOG_WARNING, "iconv: output buffer too small"); - } - else if (errno == EINVAL) { - LOG_PRINT(LOG_WARNING, "iconv: incomplete input character"); - } + /* run a character encoding conversion if required */ + if (conv_descriptor && *sql_command) { + size_t inlength; + size_t outlength; + char* my_sql_command = NULL; /* this ptr will be modified by iconv() */ + char* my_sql_command_start = NULL; /* records initial state of my_elvalue */ + const char* my_instring = NULL; /* this ptr will be modified by iconv() */ + /* strlen should be ok here as this can't be a multibyte encoding */ + inlength = strlen(sql_command)/* + 1 */; + /* with the encodings supported by our database engines, the converted + string can't be longer than six times the input string */ + /* todo: is this assumption correct? */ + outlength = 6*inlength; + + if ((my_sql_command = (char*)calloc(outlength, sizeof(char))) == NULL) { + retval = 1; + send_status(ptr_clrequest->fd, 801, TERM_NO); + LOG_PRINT(LOG_CRIT, get_status_msg(801)); + dbi_result_free(rendinfo.dbires); + dbi_conn_close(conn); + delete_all_lilimem(&sentinel); + if (conv_descriptor) { + iconv_close(conv_descriptor); + } + return 0; + } + + /* keep start of the converted string */ + my_sql_command_start = my_sql_command; + + /* variable will be modified by iconv, so don't use original */ + my_instring = (const char*)sql_command; + + /* now actually do the conversion */ + if (iconv(conv_descriptor, &my_instring, &inlength, &my_sql_command, &outlength) == (size_t)(-1)) { + if (errno == EILSEQ) { + LOG_PRINT(LOG_WARNING, "iconv: invalid input character sequence"); + } + else if (errno == E2BIG) { + LOG_PRINT(LOG_WARNING, "iconv: output buffer too small"); + } + else if (errno == EINVAL) { + LOG_PRINT(LOG_WARNING, "iconv: incomplete input character"); + } - retval = 1; - send_status(ptr_clrequest->fd, 702, TERM_NO); - dbi_result_free(rendinfo.dbires); - dbi_conn_close(conn); - delete_all_lilimem(&sentinel); - if (conv_descriptor) { - iconv_close(conv_descriptor); - } - return 0; + retval = 1; + send_status(ptr_clrequest->fd, 702, TERM_NO); + dbi_result_free(rendinfo.dbires); + dbi_conn_close(conn); + delete_all_lilimem(&sentinel); + if (conv_descriptor) { + iconv_close(conv_descriptor); + } + return 0; + } + /* else: conversion went ok. We free the original string and replace + it with the converted copy */ + if (sql_command) { + free(sql_command); + } + sql_command = my_sql_command_start; + sql_command_len = outlength; + result_len = (size_t)(my_sql_command - my_sql_command_start - 1); } - /* else: conversion went ok. We free the original string and replace - it with the converted copy */ - if (sql_command) { - free(sql_command); + else { /* no conversion required */ + result_len = strlen(sql_command); } - sql_command = my_sql_command_start; - sql_command_len = outlength; - result_len = (size_t)(my_sql_command - my_sql_command_start - 1); - } - else { /* no conversion required */ - result_len = strlen(sql_command); - } - - /* send ok status, then the terminated result string */ - send_status(ptr_clrequest->fd, 404, TERM_NO); - iwrite(ptr_clrequest->fd, sql_command, result_len); - iwrite(ptr_clrequest->fd, cs_term, TERM_LEN); - ptr_addresult->success++; - - /* reset buffer string */ - sql_command[0] = '\0'; - /* read client response */ - cs_status = read_status(ptr_clrequest->fd); + /* send ok status, then the terminated result string */ + send_status(ptr_clrequest->fd, 404, TERM_NO); + iwrite(ptr_clrequest->fd, sql_command, result_len); + iwrite(ptr_clrequest->fd, cs_term, TERM_LEN); + ptr_addresult->success++; + + /* reset buffer string */ + sql_command[0] = '\0'; + + /* read client response */ + cs_status = read_status(ptr_clrequest->fd); - if (cs_status) { - break; - } - } /* end while */ + if (cs_status) { + break; + } + } /* end while */ + } + else { + /* no datasets, return an empty body */ + send_status(ptr_clrequest->fd, 402, TERM_NO); + iwrite(ptr_clrequest->fd, cs_term, TERM_LEN); + } if (conv_descriptor) { |
From: Markus H. <mho...@us...> - 2005-04-23 21:24:42
|
Update of /cvsroot/refdb/refdb/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20937 Modified Files: Tag: Release_0_9_5_stable Makefile.am Log Message: moved refdbd.h from MAINTAINERCLEANFILES to CLEANFILES Index: Makefile.am =================================================================== RCS file: /cvsroot/refdb/refdb/src/Makefile.am,v retrieving revision 1.21.2.3 retrieving revision 1.21.2.4 diff -u -U2 -r1.21.2.3 -r1.21.2.4 --- Makefile.am 19 Apr 2005 19:35:44 -0000 1.21.2.3 +++ Makefile.am 23 Apr 2005 21:24:33 -0000 1.21.2.4 @@ -5,5 +5,6 @@ BUILT_SOURCES=refdbd.h refstat.h EXTRA_DIST=refdbd.h.in refstat.h -MAINTAINERCLEANFILES=refdbd.h refstat.h +MAINTAINERCLEANFILES=refstat.h +CLEANFILES=refdbd.h RISXVERSION = $(shell grep DOCTYPE $(srcdir)/../dtd/risx.dtd | sed 's%.*V\([^/]*\).*%\1%') |