--- gbib-0.1.2.orig/intl/po2tbl.sed +++ gbib-0.1.2/intl/po2tbl.sed @@ -0,0 +1,60 @@ +1 { + i\ +/* Automatically generated by po2tbl.sed from @PACKAGE NAME@.pot. */\ +\ +#if HAVE_CONFIG_H\ +# include \ +#endif\ +\ +#include "libgettext.h"\ +\ +const struct _msg_ent _msg_tbl[] = { + h + s/.*/0/ + x +} +/^msgid/ { + s/msgid[ ]*\(".*"\)/ {\1/ + tb + :b + N + s/\(.*\)"\(\n\)"\(.*"\)/\1\2\3/ + ta + s/\(.*\)\n.*/\1/ + bc + :a + s/\(.*\)\(\n.*\)/\1\\\2/ + P + s/.*\n\(.*\)/\1/ + tb + :c + x + td + :d + s/9\(_*\)$/_\1/ + td + s/^\(_*\)$/0\1/ + s/8\(_*\)$/9\1/ + s/7\(_*\)$/8\1/ + s/6\(_*\)$/7\1/ + s/5\(_*\)$/6\1/ + s/4\(_*\)$/5\1/ + s/3\(_*\)$/4\1/ + s/2\(_*\)$/3\1/ + s/1\(_*\)$/2\1/ + s/0\(_*\)$/1\1/ + s/_/0/g + x + G + s/\(.*\)\n\([0-9]*\)/\1, \2},/ + s/\(.*\)"$/\1/ + p +} +$ { + i\ +};\ + + g + s/0*\(.*\)/int _msg_tbl_length = \1;/p +} +d --- gbib-0.1.2.orig/po/Makefile.in.in +++ gbib-0.1.2/po/Makefile.in.in @@ -17,11 +17,11 @@ VPATH = @srcdir@ prefix = @prefix@ -exec_prefix = @exec_prefix@ -datadir = $(prefix)/@DATADIRNAME@ -localedir = $(datadir)/locale -gnulocaledir = $(prefix)/share/locale -gettextsrcdir = $(prefix)/share/gettext/po +exec_prefix = @prefix@/usr +datadir = $(prefix)/usr/@DATADIRNAME@ +localedir = $(datadir)/usr/locale +gnulocaledir = $(prefix)/usr/share/locale +gettextsrcdir = $(prefix)/usr/share/gettext/po subdir = po INSTALL = @INSTALL@ --- gbib-0.1.2.orig/po/gbib.pot +++ gbib-0.1.2/po/gbib.pot @@ -7,7 +7,8 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" -"POT-Creation-Date: 2003-04-01 00:22-0600\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2004-04-30 13:58+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -31,355 +32,355 @@ msgid "\" in the entry type <" msgstr "" -#: bibrc.C:129 +#: bibrc.C:130 msgid "I couldn't found the file " msgstr "" -#: lyxconnect.C:42 +#: lyxconnect.C:44 msgid "Pipes already opened, close them first\n" msgstr "" -#: lyxconnect.C:51 +#: lyxconnect.C:53 msgid "Opened " msgstr "" -#: lyxconnect.C:54 +#: lyxconnect.C:56 msgid "Couldn't open the pipes" msgstr "" -#: lyxconnect.C:115 +#: lyxconnect.C:117 msgid "Pipe is not opened\n" msgstr "" -#: recent.C:112 +#: recent.C:114 msgid "_File/" msgstr "" -#: recent.C:117 gui.C:309 +#: recent.C:119 gui.C:312 msgid "_File" msgstr "" -#: bibfiles.C:100 +#: bibfiles.C:104 msgid "More } than {, possible error " msgstr "" -#: bibfiles.C:107 +#: bibfiles.C:111 msgid "More ) than (, possible error " msgstr "" -#: command_dlg.C:129 +#: command_dlg.C:131 msgid "Commands" msgstr "" -#: command_dlg.C:153 +#: command_dlg.C:155 #, c-format msgid "Add a new %s command" msgstr "" #. delete button -#: command_dlg.C:158 +#: command_dlg.C:160 msgid "Delete" msgstr "" -#: command_dlg.C:164 +#: command_dlg.C:166 msgid "Delete the selected command" msgstr "" -#: entrydialog.C:44 +#: entrydialog.C:46 msgid "Please type a key for this entry" msgstr "" -#: entrydialog.C:50 +#: entrydialog.C:52 msgid "The key is already used by another entry" msgstr "" -#: entrydialog.C:252 +#: entrydialog.C:254 msgid " Key: " msgstr "" -#: entrydialog.C:275 +#: entrydialog.C:277 msgid "Required fields" msgstr "" -#: entrydialog.C:278 +#: entrydialog.C:280 msgid "Optional fields" msgstr "" -#: entrydialog.C:281 +#: entrydialog.C:283 msgid "Extra fields" msgstr "" -#: gui.C:130 +#: gui.C:133 msgid "_New" msgstr "" -#: gui.C:130 +#: gui.C:133 msgid "Create new database" msgstr "" -#: gui.C:148 +#: gui.C:151 msgid "_Merge BibTeX entries..." msgstr "" -#: gui.C:149 +#: gui.C:152 msgid "Add BibTeX entries to current database" msgstr "" -#: gui.C:168 +#: gui.C:171 msgid "_Insert entry" msgstr "" -#: gui.C:169 +#: gui.C:172 msgid "Insert a new entry" msgstr "" -#: gui.C:176 +#: gui.C:179 msgid "_Edit entry" msgstr "" -#: gui.C:177 +#: gui.C:180 msgid "Edit the selected entry" msgstr "" -#: gui.C:184 +#: gui.C:187 msgid "_Delete entry" msgstr "" -#: gui.C:185 +#: gui.C:188 msgid "Delete the selected entry" msgstr "" -#: gui.C:193 +#: gui.C:196 msgid "Edit _commands" msgstr "" -#: gui.C:194 +#: gui.C:197 msgid "Edit BibTeX commands" msgstr "" -#: gui.C:203 +#: gui.C:206 msgid "_Search" msgstr "" -#: gui.C:204 gui.C:341 +#: gui.C:207 gui.C:344 msgid "Simple search forward" msgstr "" -#: gui.C:211 +#: gui.C:214 msgid "Search _next" msgstr "" -#: gui.C:212 +#: gui.C:215 msgid "Search forward again" msgstr "" -#: gui.C:220 +#: gui.C:223 msgid "Sort by _key" msgstr "" -#: gui.C:221 +#: gui.C:224 msgid "Sort entries by key" msgstr "" -#: gui.C:227 +#: gui.C:230 msgid "Sort by _author" msgstr "" -#: gui.C:228 +#: gui.C:231 msgid "Sort entries by author" msgstr "" -#: gui.C:234 +#: gui.C:237 msgid "Sort by _title" msgstr "" -#: gui.C:235 +#: gui.C:238 msgid "Sort entries by title" msgstr "" -#: gui.C:241 +#: gui.C:244 msgid "Sort by _year" msgstr "" -#: gui.C:242 +#: gui.C:245 msgid "Sort entries by year" msgstr "" -#: gui.C:248 +#: gui.C:251 msgid "Sort by _cardtype" msgstr "" -#: gui.C:249 +#: gui.C:252 msgid "Sort entries by type" msgstr "" -#: gui.C:258 +#: gui.C:261 msgid "Use {braces}" msgstr "" -#: gui.C:260 +#: gui.C:263 msgid "Use \"quotes\"" msgstr "" -#: gui.C:292 +#: gui.C:295 msgid "Field delimiter" msgstr "" -#: gui.C:294 +#: gui.C:297 msgid "Styles" msgstr "" -#: gui.C:296 +#: gui.C:299 msgid "View" msgstr "" -#: gui.C:310 +#: gui.C:313 msgid "_Edit" msgstr "" -#: gui.C:311 +#: gui.C:314 msgid "_Options" msgstr "" -#: gui.C:312 +#: gui.C:315 msgid "_Help" msgstr "" -#: gui.C:318 +#: gui.C:321 msgid "New" msgstr "" -#: gui.C:318 +#: gui.C:321 msgid "Create a new database" msgstr "" -#: gui.C:321 +#: gui.C:324 msgid "Open" msgstr "" -#: gui.C:321 +#: gui.C:324 msgid "Open a database file" msgstr "" -#: gui.C:324 +#: gui.C:327 msgid "Merge" msgstr "" -#: gui.C:325 +#: gui.C:328 msgid "Merge/Import from a BibTeX file" msgstr "" -#: gui.C:329 +#: gui.C:332 msgid "Save" msgstr "" -#: gui.C:329 +#: gui.C:332 msgid "Save the database" msgstr "" -#: gui.C:334 +#: gui.C:337 msgid "Cites" msgstr "" -#: gui.C:335 +#: gui.C:338 msgid "Establish communication with a running LyX." msgstr "" -#: gui.C:341 +#: gui.C:344 msgid "Search" msgstr "" -#: gui.C:382 gui.C:398 +#: gui.C:386 gui.C:396 gui.C:413 gui.C:422 #, c-format msgid "Cannot read from %s: %s" msgstr "" -#: gui.C:433 gui.C:444 gui.C:572 +#: gui.C:457 gui.C:468 gui.C:596 #, c-format msgid "Cannot write to %s: %s" msgstr "" -#: gui.C:469 +#: gui.C:493 msgid "Search failed." msgstr "" -#: gui.C:484 +#: gui.C:508 msgid "Search string" msgstr "" -#: gui.C:532 +#: gui.C:556 msgid "New BibTeX Database" msgstr "" -#: gui.C:541 +#: gui.C:565 msgid "Open BibTeX Database" msgstr "" -#: gui.C:549 +#: gui.C:573 msgid "Merge with BibTeX Database" msgstr "" -#: gui.C:561 +#: gui.C:585 msgid "Name BibTeX Database as ..." msgstr "" -#: gui.C:585 +#: gui.C:609 msgid "Save BibTeX Database as ..." msgstr "" -#: gui.C:642 +#: gui.C:666 msgid "gBib - Gnome BibTeX Editor" msgstr "" -#: gui.C:646 +#: gui.C:670 msgid "A user-friendly BibTeX database editor" msgstr "" -#: gui.C:873 +#: gui.C:902 msgid "Set off lyx" msgstr "" -#: gui.C:873 +#: gui.C:902 msgid "FILE" msgstr "" -#: gui.C:875 +#: gui.C:904 msgid "Whether display warnings" msgstr "" -#: gui.C:895 +#: gui.C:924 msgid "Gnome BibTeX Editor" msgstr "" -#: gui.C:961 +#: gui.C:990 msgid "Key Conflict" msgstr "" -#: gui.C:962 +#: gui.C:991 msgid "AutoRename" msgstr "" -#: gui.C:963 +#: gui.C:992 msgid "Ignore Duplicate" msgstr "" -#: gui.C:964 +#: gui.C:993 msgid "Replace Existing" msgstr "" -#. dialog = gtk_vbox_new(FALSE, 0); -#: lyxsup.C:104 +#. dialog = gtk_vbox_new(FALSE, 0); +#: lyxsup.C:105 msgid "LyX BibTeX support" msgstr "" -#: lyxsup.C:122 +#: lyxsup.C:123 msgid "Insert cite" msgstr "" -#: lyxsup.C:130 +#: lyxsup.C:131 msgid "Insert bibtex" msgstr "" -#: lyxsup.C:138 +#: lyxsup.C:139 msgid "Insert database" msgstr "" --- gbib-0.1.2.orig/po/POTFILES +++ gbib-0.1.2/po/POTFILES @@ -0,0 +1,11 @@ + ../bibentry.C \ + ../bibrc.C \ + ../entrydef.C \ + ../entrylist.C \ + ../lyxconnect.C \ + ../recent.C \ + ../bibfiles.C \ + ../command_dlg.C \ + ../entrydialog.C \ + ../gui.C \ + ../lyxsup.C \ No newline at end of file --- gbib-0.1.2.orig/Makefile +++ gbib-0.1.2/Makefile @@ -2,9 +2,9 @@ # this file is used as template to generate # the Makefile by the configure script -DESTDIR = /usr/local -PREFIX = /usr/local -LIBDIR = /usr/local/share/gbibtex +DESTDIR = /usr +PREFIX = /usr +LIBDIR = /usr/share/gbib PROGINST = /usr/bin/install -c PACKAGE = gbib VERSION = 0.1.2 @@ -13,9 +13,9 @@ CXXFLAGS = -g -DLIBDIR=\"$(LIBDIR)\" -DPACKAGE=\"$(PACKAGE)\" -DPREFIX=\"$(PREFIX)\" -fwritable-strings -traditional -Wcast-qual -Wwrite-strings LIBS = -rdynamic -L/usr/lib -L/usr/X11R6/lib -lgnomeui -lart_lgpl -lgdk_imlib -lSM -lICE -lgtk -lgdk -lgmodule -ldl -lXi -lXext -lX11 -lgnome -lgnomesupport -lesd -laudiofile -lm -ldb-3 -lglib LDFLAGS = -CPPFLAGS = -funsigned-char -I. -I./intl -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/include/gtk-1.2 -I/usr/X11R6/include -I/usr/include/gnome-1.0 -DNEED_GNOMESUPPORT_H -I/usr/lib/gnome-libs/include +CPPFLAGS = -funsigned-char -I. -I./intl -I/usr/include/glib-1.2 -I/usr/lib/glib/include -I/usr/include/gtk-1.2 -I/usr/include/gnome-1.0 -DNEED_GNOMESUPPORT_H -I/usr/lib/gnome-libs/include -ROOTDIR = +ROOTDIR = $(prefix) SHELL = /bin/sh .SUFFIXES: --- gbib-0.1.2.orig/Makefile.in +++ gbib-0.1.2/Makefile.in @@ -3,7 +3,7 @@ DESTDIR = @prefix@ PREFIX = @prefix@ -LIBDIR = @prefix@/share/gbibtex +LIBDIR = @prefix@/share/gbib PROGINST = @INSTALL@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ @@ -14,7 +14,7 @@ LDFLAGS = CPPFLAGS = -funsigned-char -I. -I./intl @GNOMEFLAGS@ -ROOTDIR = +ROOTDIR = $(prefix) SHELL = /bin/sh .SUFFIXES: --- gbib-0.1.2.orig/bibentry.C +++ gbib-0.1.2/bibentry.C @@ -7,13 +7,13 @@ * the Free Software Foundation; either version 2, or (at your option) * any later version. */ -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include "gbib.h" @@ -38,18 +38,18 @@ if (def) { special = false; - req_field = new string[def->nreq]; - opt_field = new string[def->nopt]; + req_field = new std::string[def->nreq]; + opt_field = new std::string[def->nopt]; } else { key = n; - string::iterator it = key.begin(); + std::string::iterator it = key.begin(); while (it != key.end()) { *it = toupper(*it); it++; } if (flag_allow_warnings) - cerr << _("Warning ") << key << ": " << _("Undefined entry type ") << key << "\n"; - req_field = new string[1]; + std::cerr << _("Warning ") << key << ": " << _("Undefined entry type ") << key << "\n"; + req_field = new std::string[1]; opt_field = 0; special = true; } @@ -65,10 +65,10 @@ special = bib.special; if (def) { - req_field = new string[def->nreq]; - opt_field = new string[def->nopt]; + req_field = new std::string[def->nreq]; + opt_field = new std::string[def->nopt]; } else if (special) { - req_field = new string[1]; + req_field = new std::string[1]; opt_field = 0; } nextra = 0; @@ -90,8 +90,8 @@ special = bib.special; if (def) { - req_field = new string[def->nreq]; - opt_field = new string[def->nopt]; + req_field = new std::string[def->nreq]; + opt_field = new std::string[def->nopt]; } nextra = 0; @@ -126,10 +126,10 @@ else { def = getBibEntryDef(et); if (def) { - req_field = new string[def->nreq]; - opt_field = new string[def->nopt]; + req_field = new std::string[def->nreq]; + opt_field = new std::string[def->nopt]; } else { - req_field = new string[1]; + req_field = new std::string[1]; opt_field = 0; } nextra = 0; @@ -231,7 +231,7 @@ return; } -// cerr << "sField " << key << ":" << i << ": " << field << "\n"; +// std::cerr << "sField " << key << ":" << i << ": " << field << "\n"; if (i < def->nreq) { req_field[i] = field; } else @@ -262,11 +262,11 @@ if (i>=0) { setField(i, field); -// cerr << key << ":Field " << fieldname << "|" << field << "\n"; +// std::cerr << key << ":Field " << fieldname << "|" << field << "\n"; } else { if (flag_allow_warnings) - cerr << _("Warning ") << key << _(": Ignored field \"") << fieldname + std::cerr << _("Warning ") << key << _(": Ignored field \"") << fieldname << _("\" in the entry type <") << getEntryType() << ">.\n"; // does exist already this name? @@ -282,7 +282,7 @@ void BibEntry::setFields(BibEntry &entry) { for (int i=0; i(s.c_str())); } --- gbib-0.1.2.orig/bibfiles.C +++ gbib-0.1.2/bibfiles.C @@ -9,12 +9,16 @@ */ // File operations -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include "gbib.h" +using namespace std; + bool use_braces = true; int ispseudoalpha(char c); @@ -207,7 +211,24 @@ // Read fields do { // Eat any non-alpha, all field names start with alpha - do c = getc(inf); while (!isalpha(c) && c!=rd && !feof(inf)); + do + { + c = getc(inf); + if ((c == '{') || (c == '"') || (c == '(')) + { + cerr << __FILE__ << ':' << __LINE__ + << " Expecting fieldname here, got " << c << endl + << " (fieldnames start with one of a-z or A-z and not '" + << c << "')!" << endl + << "in entry " << name << endl; + delete entry; + stringstream errMsg; + errMsg << "fieldname expected, got '" << c << "' in entry '" + << name << "'" << ends; + throw runtime_error(errMsg.str()); + } + } + while (!isalpha(c) && c!=rd && !feof(inf)); for (i=0; ispseudoalpha(c) && !feof(inf); i++) { @@ -318,6 +339,7 @@ return -1; if (inf) { + try { while ((bib=read_entry(inf))) { if (bib->isSpecial()) { new_command(bib->getKey(), bib->getField(0)); @@ -325,7 +347,16 @@ new_entry(*bib); delete bib; } + } + catch(runtime_error e) { fclose(inf); + cerr << __FILE__ << ':' << __LINE__ << " Caught exception" << endl + << " " << e.what() << endl + << "while reading from file '" << name << "'." << endl + << "Closing file '" << name << "' and rethrowing exception." + << endl; + throw e; + } } string aux = name; --- gbib-0.1.2.orig/bibrc.C +++ gbib-0.1.2/bibrc.C @@ -8,9 +8,10 @@ */ // File operations -#include -#include -#include +#include +#include +#include +#include #include #include "gbib.h" @@ -112,8 +113,8 @@ int main (int argc, char *argv[]) { - string deffile = "gbib.rc"; - string libdir = LIBDIR; + std::string deffile = "gbib.rc"; + std::string libdir = LIBDIR; libdir += "/"; libdir += deffile; @@ -126,7 +127,7 @@ readBibrc(const_cast(libdir.c_str())); } else { - cerr << _("I couldn't found the file ") << deffile << "\n"; + std::cerr << _("I couldn't found the file ") << deffile << "\n"; exit(1); } --- gbib-0.1.2.orig/command_dlg.C +++ gbib-0.1.2/command_dlg.C @@ -7,10 +7,12 @@ * any later version. */ -#include +#include #include #include "gbib.h" +using namespace std; + extern vector_string commandTab; extern GtkWidget *app; --- gbib-0.1.2.orig/configure +++ gbib-0.1.2/configure @@ -3406,16 +3406,16 @@ { echo "configure: error: required header file missing" 1>&2; exit 1; } fi -ac_safe=`echo "map.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for map.h""... $ac_c" 1>&6 -echo "configure:3412: checking for map.h" >&5 +ac_safe=`echo "map" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for map""... $ac_c" 1>&6 +echo "configure:3412: checking for map" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +#include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:3422: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } @@ -3440,16 +3440,16 @@ { echo "configure: error: required header file missing" 1>&2; exit 1; } fi -ac_safe=`echo "slist" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for slist""... $ac_c" 1>&6 -echo "configure:3446: checking for slist" >&5 +ac_safe=`echo "ext/slist" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for ext/slist""... $ac_c" 1>&6 +echo "configure:3446: checking for ext/slist" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +#include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:3456: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } @@ -3474,16 +3474,16 @@ { echo "configure: error: required header file missing" 1>&2; exit 1; } fi -ac_safe=`echo "std/bastring.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for std/bastring.h""... $ac_c" 1>&6 -echo "configure:3480: checking for std/bastring.h" >&5 +ac_safe=`echo "string" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for string""... $ac_c" 1>&6 +echo "configure:3480: checking for string" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < +#include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:3490: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } @@ -3542,42 +3542,6 @@ { echo "configure: error: required header file missing" 1>&2; exit 1; } fi -ac_safe=`echo "vector.h" | sed 'y%./+-%__p_%'` -echo $ac_n "checking for vector.h""... $ac_c" 1>&6 -echo "configure:3548: checking for vector.h" >&5 -if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - cat > conftest.$ac_ext < -EOF -ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3558: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` -if test -z "$ac_err"; then - rm -rf conftest* - eval "ac_cv_header_$ac_safe=yes" -else - echo "$ac_err" >&5 - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_header_$ac_safe=no" -fi -rm -f conftest* -fi -if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then - echo "$ac_t""yes" 1>&6 - : -else - echo "$ac_t""no" 1>&6 -{ echo "configure: error: required header file missing" 1>&2; exit 1; } -fi - - - # Extract the first word of "gnome-config", so it can be a program name with args. set dummy gnome-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --- gbib-0.1.2.orig/configure.in +++ gbib-0.1.2/configure.in @@ -32,8 +32,9 @@ AC_HEADER_CHECK(sys/types.h,,AC_MSG_ERROR(required header file missing)) AC_HEADER_CHECK(algorithm,,AC_MSG_ERROR(required header file missing)) AC_HEADER_CHECK(map.h,,AC_MSG_ERROR(required header file missing)) -AC_HEADER_CHECK(slist,,AC_MSG_ERROR(required header file missing)) -AC_HEADER_CHECK(std/bastring.h,,AC_MSG_ERROR(required header file missing)) +AC_HEADER_CHECK(slist,, + AC_HEADER_CHECK(ext/slist,,AC_MSG_ERROR(required header file missing))) +dnl AC_HEADER_CHECK(std/bastring.h,,AC_MSG_ERROR(required header file missing)) AC_HEADER_CHECK(vector,,AC_MSG_ERROR(required header file missing)) AC_HEADER_CHECK(vector.h,,AC_MSG_ERROR(required header file missing)) --- gbib-0.1.2.orig/entrydef.C +++ gbib-0.1.2/entrydef.C @@ -8,16 +8,21 @@ * any later version. */ -#include -#include -#include -#include +#include +#include +#include +#if (__GNUC__ < 3) +#include +#endif /* __GNUC__ < 3 */ #include -#include -#include +#include +#include #include "gbib.h" #include + +using namespace std; + int nstyles = 0; char *bibstyle; --- gbib-0.1.2.orig/entrydialog.C +++ gbib-0.1.2/entrydialog.C @@ -7,10 +7,12 @@ * any later version. */ -#include +#include #include #include "gbib.h" +using namespace std; + typedef vector EntryList; struct BibentryDlgData { --- gbib-0.1.2.orig/entrylist.C +++ gbib-0.1.2/entrylist.C @@ -6,14 +6,16 @@ * the Free Software Foundation; either version 2, or (at your option) * any later version. */ -#include -#include +#include +#include #include -#include -#include -#include +#include +#include +#include #include "gbib.h" +using namespace std; + extern ResponseType ask_about_conflict(BibEntry *old, BibEntry *nova); // with a vengeance: will skip braces on haystack --- gbib-0.1.2.orig/gbib.h +++ gbib-0.1.2/gbib.h @@ -11,9 +11,14 @@ #ifndef _GBIB_H #define _GBIB_H -#include +#include #include +#if (__GNUC__ >= 3) +#include +#else +#define __gnu_cxx std #include +#endif #include // it's very important that config.h is called before gnome.h, @@ -23,19 +28,18 @@ #include -typedef basic_string string; -typedef pair pair_string; -typedef vector vector_string; -typedef slist slist_pair_string; -typedef pair pair_strings; -typedef vector vector_pair_strings; +typedef std::pair pair_string; +typedef std::vector vector_string; +typedef __gnu_cxx::slist slist_pair_string; +typedef std::pair pair_strings; +typedef std::vector vector_pair_strings; // entrydef.C class BibEntryDef { public: int nreq, nopt; - string name; + std::string name; int *required; int *optional; @@ -112,9 +116,9 @@ void allowExtraField() { allow_extra = true; } protected: - string key; - string *req_field; - string *opt_field; + std::string key; + std::string *req_field; + std::string *opt_field; BibEntryDef *def; int nextra; slist_pair_string extra_field; @@ -145,7 +149,7 @@ void update_entry(bool is_new=false); typedef BibEntry* ApBibEntry; -typedef vector EntryTab; +typedef std::vector EntryTab; typedef enum { Ask, @@ -178,15 +182,15 @@ int search_string(char *, int first=0); void sort(int ascending, char *s = "key"); - string dbname; + std::string dbname; int selected_entry; int size() { return entryTab.size(); } // Command handling - void new_command(string, string); + void new_command(std::string, std::string); pair_strings getCommand(int); void delCommand(int); - void setCommand(int, string); + void setCommand(int, std::string); int commandSize() { return commands.size(); } --- gbib-0.1.2.orig/gui.C +++ gbib-0.1.2/gui.C @@ -8,12 +8,13 @@ * any later version. */ +#include #include "gbib.h" -#include -#include +#include #include #include +#include #include "recent.h" @@ -37,6 +38,8 @@ GTK_JUSTIFY_CENTER, GTK_JUSTIFY_CENTER}; +using namespace std; + GtkWidget *app; GtkWidget *statusbar; @@ -372,6 +375,7 @@ gtk_clist_clear(GTK_CLIST(elist)); etable.clear(); etable.resetUI(); + try { if (etable.readBibfile(s)==0) { chopDirName(fs_dialog.openDir,s); fs_dialog.filename = s; @@ -384,6 +388,16 @@ resetFileName(); return -1; } + } + catch(...) { + cerr << __FILE__ << ':' << __LINE__ << " Caught exception" << endl + << "while reading from file '" << s << "'." << endl + << endl; + sprintf(msg,_("Cannot read from %s: %s"),s,"read error message on console"); + gnome_app_flash(GNOME_APP(app),msg); + resetFileName(); + return -1; + } } @@ -391,6 +405,7 @@ { char msg[1024]; etable.resetUI(); + try { if (etable.readBibfile(s)==0) { chopDirName(fs_dialog.openDir,s); update_elist(); @@ -399,6 +414,15 @@ gnome_app_flash(GNOME_APP(app),msg); resetFileName(); } + } + catch (...) { + cerr << __FILE__ << ':' << __LINE__ << " Caught exception" << endl + << "while reading from file '" << s << "'." << endl + << endl; + sprintf(msg,_("Cannot read from %s: %s"),s,"read error message on console"); + gnome_app_flash(GNOME_APP(app),msg); + resetFileName(); + } } void file_selected_cb(GtkWidget *widget, void *data) @@ -742,6 +766,11 @@ } gtk_clist_thaw (GTK_CLIST(elist)); } + + // DAS: resort list + if ((CurrentSortColumn>=0) && (CurrentSortColumn0) { etable.selected_entry = -1; gtk_clist_select_row (GTK_CLIST(elist), tmp, 0); - gtk_clist_moveto (GTK_CLIST(elist), tmp, 0, 0.0, 0.0); + //gtk_clist_moveto (GTK_CLIST(elist), tmp, 0, 0.0, 0.0); etable.selected_entry = tmp; } --- gbib-0.1.2.orig/lyxconnect.C +++ gbib-0.1.2/lyxconnect.C @@ -7,12 +7,13 @@ * any later version. */ -#include +#include +#include #include #include #include #include -#include +#include //#include @@ -26,9 +27,10 @@ pipename = getenv("HOME"); pipename += "/.lyxpipe"; clientname = "gbib"; -// cerr << "Pipename " << pipename << "\n"; +// std::cerr << "Pipename " << pipename << "\n"; } +using namespace std; LyXConnect::~LyXConnect() { @@ -39,7 +41,7 @@ void LyXConnect::connect() { if (pipein!=-1) { - cerr << _("Pipes already opened, close them first\n"); + std::cerr << _("Pipes already opened, close them first\n"); return; } char buf[100]; @@ -48,7 +50,7 @@ pipein = open(spipein.c_str(), O_RDWR); pipeout = open(spipeout.c_str(), O_RDONLY|O_NONBLOCK); - cerr << _("Opened ") << pipein << " " << pipeout << "\n"; + std::cerr << _("Opened ") << pipein << " " << pipeout << "\n"; if (pipein<0 || pipeout<0) { perror(_("Couldn't open the pipes")); @@ -108,10 +110,10 @@ do { n = read(pipeout, &s[0], 200); - cerr << _("Lyx says ") << n << ": " << s << "|\n"; + std::cerr << _("Lyx says ") << n << ": " << s << "|\n"; } while (n > 0 && n < 100); */ } else - cerr << _("Pipe is not opened\n"); + std::cerr << _("Pipe is not opened\n"); } --- gbib-0.1.2.orig/lyxconnect.h +++ gbib-0.1.2/lyxconnect.h @@ -22,8 +22,8 @@ private: bool lyx_listen; int pipein, pipeout; - string pipename; - string clientname; + std::string pipename; + std::string clientname; }; #endif --- gbib-0.1.2.orig/lyxsup.C +++ gbib-0.1.2/lyxsup.C @@ -16,6 +16,7 @@ #include "gbib.h" #include "lyxconnect.h" +using namespace std; extern int bib_style; --- gbib-0.1.2.orig/recent.C +++ gbib-0.1.2/recent.C @@ -18,6 +18,8 @@ #include "gbib.h" #include "recent.h" +using namespace std; + #ifndef DATA_ITEMS_TO_REMOVE #define DATA_ITEMS_TO_REMOVE "items_to_remove" #endif --- gbib-0.1.2.orig/config.h +++ gbib-0.1.2/config.h @@ -70,7 +70,7 @@ #define HAVE___ARGZ_STRINGIFY 1 /* Define if you have the dcgettext function. */ -#define HAVE_DCGETTEXT 1 +/* #undef HAVE_DCGETTEXT */ /* Define if you have the getcwd function. */ #define HAVE_GETCWD 1 --- gbib-0.1.2.orig/config.log +++ gbib-0.1.2/config.log @@ -0,0 +1,6 @@ +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +configure:553: checking for c++ +configure:585: checking whether the C++ compiler (c++ ) works +configure:601: c++ -o conftest conftest.C 1>&5 --- gbib-0.1.2.orig/debian/changelog +++ gbib-0.1.2/debian/changelog @@ -0,0 +1,62 @@ +gbib (0.1.2-3) unstable; urgency=low + + * Generate error message in case a BibTeX file contains non-valid + entries. This tackles part of the problem in Bug#246341 but a + better error handling would be desirable... + + -- Philipp Frauenfelder Fri, 30 Apr 2004 14:02:55 +0200 + +gbib (0.1.2-2) unstable; urgency=low + + * Bumped standards version to 3.6.1 + * Incorporated patch from Dave Symonds to retaind sort order when adding + new entries. Closes: #217947 + + -- Philipp Frauenfelder Wed, 29 Oct 2003 12:42:46 +0100 + +gbib (0.1.2-1) unstable; urgency=low + + * New upstream release. Closes: #179788 + Made the upstream source compile with gcc 3.2 + * added debian/watch + + -- Philipp Frauenfelder Wed, 2 Apr 2003 19:27:57 +0200 + +gbib (0.1.1c-2) unstable; urgency=low + + * Made it compile flawlessly with gcc 3.2 + * All entries in the BiBTeX file are surrounded by curly braces. + Closes: #179653, #179653 + + -- Philipp Frauenfelder Sat, 29 Mar 2003 07:16:39 +0100 + +gbib (0.1.1c-1) unstable; urgency=low + + * New upstream release. Closes: #144774 + + -- Philipp Frauenfelder Tue, 30 Apr 2002 22:17:52 +0200 + +gbib (0.1.1b-2) unstable; urgency=low + + * Changed section of gbib from x11 to tex. Closes: #128613 + + -- Philipp Frauenfelder Mon, 14 Jan 2002 08:48:57 +0100 + +gbib (0.1.1b-1) unstable; urgency=low + + * New upstream release + + -- Philipp Frauenfelder Tue, 8 Jan 2002 10:57:34 +0100 + +gbib (0.1.1-2) unstable; urgency=low + + * Applied patch from James Troup to fix build problems on hppa with + gcc-3. Closes: #121451 + + -- Philipp Frauenfelder Thu, 29 Nov 2001 09:50:10 +0100 + +gbib (0.1.1-1) unstable; urgency=low + + * Initial Release. Closes: #94481 + + -- Philipp Frauenfelder Thu, 19 Apr 2001 07:12:36 +0000 --- gbib-0.1.2.orig/debian/menu +++ gbib-0.1.2/debian/menu @@ -0,0 +1,2 @@ +?package(gbib):needs=X11 section=Apps/Tools \ + title="gBib" command="/usr/bin/gbib" icon=/usr/share/gbib/gbib32.xpm --- gbib-0.1.2.orig/debian/dirs +++ gbib-0.1.2/debian/dirs @@ -0,0 +1,3 @@ +usr/bin +usr/share/gbib + --- gbib-0.1.2.orig/debian/rules +++ gbib-0.1.2/debian/rules @@ -0,0 +1,88 @@ +#!/usr/bin/make -f +# Sample debian/rules that uses debhelper. +# GNU copyright 1997 to 1999 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +# This is the debhelper compatability version to use. +export DH_COMPAT=3 + +configure: configure-stamp +configure-stamp: + dh_testdir + # Add here commands to configure the package. + ./configure --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info + + touch configure-stamp + +build: configure-stamp build-stamp +build-stamp: + dh_testdir + + # Add here commands to compile the package. + $(MAKE) + #/usr/bin/docbook-to-man debian/gbib.sgml > gbib.1 + + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp configure-stamp + + # Add here commands to clean up after the build process. + -$(MAKE) distclean + + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + # Add here commands to install the package into debian/gbib. + $(MAKE) install prefix=$(CURDIR)/debian/gbib + chmod 0644 $(CURDIR)/debian/gbib/usr/share/gbib/gbib.rc \ + $(CURDIR)/debian/gbib/usr/share/gbib/gbib48.xpm \ + $(CURDIR)/debian/gbib/usr/share/gbib/lyx.xpm + install -m 0644 gbib32.xpm $(CURDIR)/debian/gbib/usr/share/gbib + + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot +# dh_installdebconf + dh_installdocs +# dh_installexamples + dh_installmenu +# dh_installlogrotate +# dh_installemacsen +# dh_installpam +# dh_installmime +# dh_installinit +# dh_installcron + dh_installman debian/gbib.1 +# dh_installinfo +# dh_undocumented + dh_installchangelogs CHANGES + dh_link + dh_strip + dh_compress + dh_fixperms +# dh_makeshlibs + dh_installdeb +# dh_perl + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch +.PHONY: build clean binary-indep binary-arch binary install configure --- gbib-0.1.2.orig/debian/gbib.1 +++ gbib-0.1.2/debian/gbib.1 @@ -0,0 +1,69 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH GBIB 1 "April 19, 2001" Debian +.\" Please adjust this date whenever revising the manpage. +.\" +.\" Some roff macros, for reference: +.\" .nh disable hyphenation +.\" .hy enable hyphenation +.\" .ad l left justify +.\" .ad b justify to both left and right margins +.\" .nf disable filling +.\" .fi enable filling +.\" .br insert line break +.\" .sp insert n+1 empty lines +.\" for manpage-specific macros, see man(7) +.SH NAME +gbib \- editor and browser for BibTeX databases +.SH SYNOPSIS +.B gbib +.RI [ options ] +.SH DESCRIPTION +This manual page documents briefly the +.B gbib +commands. +.PP +This manual page was written for the Debian GNU/Linux distribution +because the original program does not have a manual page. +It has virtually no documentation but is self explanatory +.\"PP +.\" TeX users may be more comfortable with the \fB\fP and +.\" \fI\fP escape sequences to invode bold face and italics, +.\" respectively. +.PP +.B gbib +is a user-friendly editor and browser for BibTeX databases. You can +use it also to insert citations inside a LyX document. +.SH OPTIONS +These programs follow the usual GNU command line syntax, with long +options starting with two dashes (`-'). +.B gbib +supports the usual +.B Gnome +command line options. Additionally, the following options are supported: +.TP +.B \-\-no\-lyx=FILE +Set off lyx +.TP +.B \-\-warnings=[01] +Whether display warnings +.TP +.B \-\-help +Show summary of options. +.TP +.B \-\-version +Show version of program. +.SH WORKING WITH LyX +To insert citations in a LyX document, verify that LyX +is running before clicking on the lyx button. +The LyX server must be enabled, just add in your +lyxrc this line: +.SP +.NF + \\serverpipe "/YOUR_HOME_DIR/.lyxpipe" +.FI +.SH AUTHOR +This manual page was written by Philipp Frauenfelder , +for the Debian GNU/Linux system (but may be used by others). --- gbib-0.1.2.orig/debian/docs +++ gbib-0.1.2/debian/docs @@ -0,0 +1,3 @@ +AUTHORS +README +TODO --- gbib-0.1.2.orig/debian/copyright +++ gbib-0.1.2/debian/copyright @@ -0,0 +1,28 @@ +This package was debianized by Philipp Frauenfelder on +Thu, 19 Apr 2001 07:12:36 +0000. + +It was downloaded from http://gbib.seul.org/ + +Upstream Authors: + Alejandro Aguilar Sierra + Felipe Bergo + +Copyright: + + This package is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 dated June, 1991. + + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this package; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. + +On Debian GNU/Linux systems, the complete text of the GNU General +Public License can be found in `/usr/share/common-licenses/GPL'. + --- gbib-0.1.2.orig/debian/control +++ gbib-0.1.2/debian/control @@ -0,0 +1,14 @@ +Source: gbib +Section: tex +Priority: optional +Maintainer: Philipp Frauenfelder +Build-Depends: debhelper (>> 3.0.0), libgnome-dev +Standards-Version: 3.6.1 + +Package: gbib +Architecture: any +Depends: ${shlibs:Depends} +Suggests: lyx +Description: user-friendly editor and browser for BibTeX databases + You can use it also to insert citations inside a LyX document. + gBib is able to import and export BiBTeX databases. --- gbib-0.1.2.orig/debian/watch +++ gbib-0.1.2/debian/watch @@ -0,0 +1,2 @@ +version=2 +ftp://ftp.seul.org/pub/gbib/src/gbib-(.*)\.tar\.gz debian uupdate --- gbib-0.1.2.orig/gbib32.xpm +++ gbib-0.1.2/gbib32.xpm @@ -0,0 +1,52 @@ +/* XPM */ +static char *gbib32[] = { +/* width height num_colors chars_per_pixel */ +" 32 32 13 1", +/* colors */ +". c #000000", +"# c #191919", +"a c #333333", +"b c #00007f", +"c c #4c4c4c", +"d c #666667", +"e c #7f7f7f", +"f c #999999", +"g c #b2b2b2", +"h c #cccccc", +"i c #e5e5e5", +"j c #ffffff", +"k c none", +/* pixels */ +"kkkkkkkkkkkkkkkbkkkkkkkkkkkkkkkk", +"kkkkkkkkkkkk.#bb#.kkkkkkkkkkkkkk", +"kkkkkkkkkkk.#bbbb#.kkkkkkkkkkkkk", +"kkkkkkkkk.#bbbbbbb#.kkkkkkkkkkkk", +"kkkkkkkk.#bbbbbbbbb#.kkkkkkkkkkk", +"kkkkkk.#bbbbbbbbbbbb#.kkkkkkkkkk", +"kkkk.##bbbbbbbbbbbbbb#.kkkkkkkkk", +"kk.#bbbbbbbdf##bbbbbbb#.kkkkkkkk", +"k#bbbbbbbbbdga.bbbbbbbb#.kkkkkkk", +"kbbbbbbbbcf##aed#bbbbbbb#.kkkkkk", +"kbbbbbbbbbc#agge.#bc#bbbb#.kkkkk", +"k#bbbbbbbdd.fhed.bhf##bbbb#.kkkk", +"k#bbebbbbbc#fge##bega#bbbbb#.kkk", +"k#ddbebbbbeaagfa#afha.bbbbbb#.kk", +"k#fhcbdbbba#bcgfefge##bbbbbbb..k", +"k#eeeehdbbbbbbaddda##bbbbbbb#.kk", +"k#bfgfhhebbbbbbb###bbbbbbbdg..kk", +"k.#egegcgdbbbbbbbbbbbbbbbeig..kk", +"kk.#geheffebbbbbbbbbbbbbgjig..kk", +"kkk.#cfcidgdbbbbbbbbbbdhiiig#.kk", +"kkkk..cffddgebbbbbbbbgijjijgbb.k", +"kkkkk.bdieegfebbbbbbgjiiiiidb#.k", +"kkkkkk.b#cfgefebbbdjjiiiiidb#.kk", +"kkkkkkk.bbdfedfebfiiiiijgbb.kkkk", +"kkkkkkkk.bbfecbdhjiiiiigb#.kkkkk", +"kkkkkkkkk.bbhc#biiiiiidb#.kkkkkk", +"kkkkkkkkkk#bcbbbiiijidb#.kkkkkkk", +"kkkkkkkkkkk#bbbbijifb#.kkkkkkkkk", +"kkkkkkkkkkk.bbbbiifb.kkkkkkkkkkk", +"kkkkkkkkkkkk.bbbibb.kkkkkkkkkkkk", +"kkkkkkkkkkkkk.#bb#.kkkkkkkkkkkkk", +"kkkkkkkkkkkkkk.##.kkkkkkkkkkkkkk" +}; --- gbib-0.1.2.orig/watch +++ gbib-0.1.2/watch @@ -0,0 +1,2 @@ +version=2 +ftp://ftp.seul.org/pub/gbib/src/gbib-(.*)\.tar\.gz debian uupdate