packages feed

hs-bibutils 0.3 → 4.12

raw patch · 75 files changed

+2194/−1705 lines, 75 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

− bibutils.patch
@@ -1,214 +0,0 @@-diff -ur ../bibutils_4.1/Makefile_start ./Makefile_start---- ../bibutils_4.1/Makefile_start	2008-12-21 19:31:06.000000000 +0100-+++ ./Makefile_start	2008-12-26 11:26:01.000000000 +0100-@@ -1,7 +1,13 @@- POSTFIX=REPLACE_POSTFIX- CC = REPLACE_CC- RANLIB=REPLACE_RANLIB--INSTALLDIR=REPLACE_INSTALLDIR-+PREFIX=REPLACE_PREFIX-+LIBDIR=${PREFIX}/lib-+SHCC=REPLACE_SHCC-+SHLD=REPLACE_SHLD-+INSTALL = /usr/bin/ginstall -c-+SHLIB = lib/libbibutils.so-+STLIB = lib/libbibutils.a- - VERSION=4.1- DATE=12/21/08-@@ -10,7 +16,7 @@- 	xml2ads xml2bib xml2end xml2isi xml2ris xml2wordbib modsclean- - all : FORCE--	cd lib; make -k $(CC) -k $(RANLIB); cd ..-+	cd lib; make -k $(SHCC) -k $(SHLD) -k $(RANLIB); cd ..- 	cd bin; make -k $(CC) -k VERSION="$(VERSION)" -k DATE="$(DATE)"; cd ..- - clean: FORCE-@@ -30,9 +36,13 @@- - install: all FORCE- 	sed 's/VERSION/${VERSION}/g' packageconfig_start > lib/bibutils.pc--#	@for p in ${PROGRAMS}; \--#		do ( cp bin/$$p ${INSTALLDIR}/$$p ); \--#	done-+	@for p in ${PROGRAMS}; \-+		do ( cp bin/$$p ${INSTALLDIR}/$$p ); \-+	done-+-+installlib:-+	${INSTALL} ${SHLIB} ${DESTDIR}${LIBDIR}-+	${INSTALL} ${STLIB} ${DESTDIR}${LIBDIR}- - package: all FORCE- 	csh -f maketgz.csh ${VERSION} ${POSTFIX}-diff -ur ../bibutils_4.1/configure ./configure---- ../bibutils_4.1/configure	2008-12-20 00:48:40.000000000 +0100-+++ ./configure	2008-12-26 11:18:16.000000000 +0100-@@ -3,15 +3,15 @@- set INPUT_FILE = Makefile_start- set OUTPUT_FILE = Makefile- --set INSTALLDIR = /usr/local/bin-+set PREFIX = /usr/local- - if ( ${#argv} > 0 ) then--	if ( $1 == "--install-dir" ) then-+	if ( $1 == "--prefix" ) then- 		if ( ${#argv} < 2 ) then--			echo "--install-dir requires a directory"-+			echo "--prefix requires a directory"- 			exit- 		else--			set INSTALLDIR = $2-+			set PREFIX = $2- 		endif- 	else- 		echo "Unidentified argument $1"-@@ -76,81 +76,105 @@- #POSTFIX=REPLACE_POSTFIX- #CC = REPLACE_CC- #RANLIB=REPLACE_RANLIB--#INSTALLDIR=REPLACE_INSTALLDIR-+#PREFIX=REPLACE_PREFIX- - if ( $type == "Linux_x86" ) then- 	cat $INPUT_FILE | \- 	sed 's/REPLACE_CC/CC="cc -Wall"/' | \-+	sed 's/REPLACE_SHCC/CC="cc -Wall -fPIC"/' | \-+	sed 's/REPLACE_SHLD/SHLD="gcc -shared -I."/' | \- 	sed 's/REPLACE_RANLIB/RANLIB="ranlib"/' | \--	sed "s|REPLACE_INSTALLDIR|${INSTALLDIR}|" | \-+	sed "s|REPLACE_PREFIX|${PREFIX}|" | \- 	sed 's/REPLACE_POSTFIX/_i386/' > $OUTPUT_FILE- else if ( $type == "Linux_x86_64" ) then- 	cat $INPUT_FILE | \- 	sed 's/REPLACE_CC/CC="cc -Wall"/' | \-+	sed 's/REPLACE_SHCC/CC="cc -Wall -fPIC"/' | \-+	sed 's/REPLACE_SHLD/SHLD="gcc -shared -I."/' | \- 	sed 's/REPLACE_RANLIB/RANLIB="ranlib"/' | \--	sed "s|REPLACE_INSTALLDIR|${INSTALLDIR}|" | \-+	sed "s|REPLACE_PREFIX|${PREFIX}|" | \- 	sed 's/REPLACE_POSTFIX/_i386/' > $OUTPUT_FILE- else if ( $type == "Linux_Unknown" ) then- 	cat $INPUT_FILE | \- 	sed 's/REPLACE_CC/CC="cc -Wall"/' | \-+	sed 's/REPLACE_SHCC/CC="cc -Wall -fPIC"/' | \-+	sed 's/REPLACE_SHLD/SHLD="gcc -shared -I."/' | \- 	sed 's/REPLACE_RANLIB/RANLIB="ranlib"/' | \--	sed "s|REPLACE_INSTALLDIR|${INSTALLDIR}|" | \-+	sed "s|REPLACE_PREFIX|${PREFIX}|" | \- 	sed 's/REPLACE_POSTFIX//' > $OUTPUT_FILE- else if ( $type == "MacOSX_ppc" && $universal_binary == "TRUE" ) then- 	cat $INPUT_FILE | \- 	sed 's/REPLACE_CC/CC="cc -arch i386 -arch ppc -Wall"/' | \-+	sed 's/REPLACE_SHCC/CC="cc -arch i386 -arch ppc -Wall"/' | \-+	sed 's/REPLACE_SHLD/SHLD="cc -bundle -flat_namespace -undefined suppress"/' | \- 	sed 's/REPLACE_RANLIB/RANLIB="ranlib -s"/' | \--	sed "s|REPLACE_INSTALLDIR|${INSTALLDIR}|" | \-+	sed "s|REPLACE_PREFIX|${PREFIX}|" | \- 	sed 's/REPLACE_POSTFIX/_osx_universal/' > $OUTPUT_FILE- else if ( $type == "MacOSX_intel" && $universal_binary == "TRUE" ) then- 	cat $INPUT_FILE | \- 	sed 's/REPLACE_CC/CC="cc -arch i386 -arch ppc -Wall"/' | \-+	sed 's/REPLACE_SHCC/CC="cc -arch i386 -arch ppc -Wall"/' | \-+	sed 's/REPLACE_SHLD/SHLD="cc -bundle -flat_namespace -undefined suppress"/' | \- 	sed 's/REPLACE_RANLIB/RANLIB="ranlib -s"/' | \--	sed "s|REPLACE_INSTALLDIR|${INSTALLDIR}|" | \-+	sed "s|REPLACE_PREFIX|${PREFIX}|" | \- 	sed 's/REPLACE_POSTFIX/_osx_universal/' > $OUTPUT_FILE- else if ( $type == "MacOSX_ppc" || $type == "MacOSX_intel" || \- 	$type == "MacOSX_unknown" ) then- 	cat $INPUT_FILE | \- 	sed 's/REPLACE_CC/CC="cc -Wall"/' | \-+	sed 's/REPLACE_SHCC/CC="cc -arch i386 -arch ppc -Wall"/' | \-+	sed 's/REPLACE_SHLD/SHLD="cc -bundle -flat_namespace -undefined suppress"/' | \- 	sed 's/REPLACE_RANLIB/RANLIB="ranlib -s"/' | \--	sed "s|REPLACE_INSTALLDIR|${INSTALLDIR}|" | \-+	sed "s|REPLACE_PREFIX|${PREFIX}|" | \- 	sed 's/REPLACE_POSTFIX/_osx/' > $OUTPUT_FILE- else if ( $type == "SunOS5" ) then- 	cat $INPUT_FILE | \- 	sed 's|REPLACE_CC|CC="gcc"|' | \-+	sed 's/REPLACE_SHCC/CC="gcc -Wall -fPIC"/' | \-+	sed 's/REPLACE_SHLD/SHLD="gcc -shared -I."/' | \- 	sed 's/REPLACE_RANLIB/RANLIB="echo Skipping ranlib"/' | \--	sed "s|REPLACE_INSTALLDIR|${INSTALLDIR}|" | \-+	sed "s|REPLACE_PREFIX|${PREFIX}|" | \- 	sed 's/REPLACE_POSTFIX/_sunos5/' > $OUTPUT_FILE- else if ( $type == "IRIX" ) then- 	cat $INPUT_FILE | \- 	sed 's|REPLACE_CC|CC="/tsri/gnu/sgi4DIRIX6/bin/gcc"|' | \-+	sed 's/REPLACE_SHCC/CC="/tsri/gnu/sgi4DIRIX6/bin/gcc -Wall -fPIC"/' | \-+	sed 's/REPLACE_SHLD/SHLD="/tsri/gnu/sgi4DIRIX6/bin/gcc -shared -I."/' | \- 	sed 's/REPLACE_RANLIB/RANLIB="echo Skipping ranlib"/' | \--	sed "s|REPLACE_INSTALLDIR|${INSTALLDIR}|" | \-+	sed "s|REPLACE_PREFIX|${PREFIX}|" | \- 	sed 's/REPLACE_POSTFIX/_irix/' > $OUTPUT_FILE- else if ( $type == "NetBSD" ) then- 	cat $INPUT_FILE | \- 	sed 's/REPLACE_CC/CC="cc -Wall"/' | \-+	sed 's/REPLACE_SHCC/CC="cc -Wall -fPIC"/' | \-+	sed 's/REPLACE_SHLD/SHLD="gcc -shared -I."/' | \- 	sed 's/REPLACE_RANLIB/RANLIB="ranlib"/' | \--	sed "s|REPLACE_INSTALLDIR|${INSTALLDIR}|" | \-+	sed "s|REPLACE_PREFIX|${PREFIX}|" | \- 	sed 's/REPLACE_POSTFIX/_netbsd/' > $OUTPUT_FILE- else if ( $type == "FreeBSD" ) then- 	cat $INPUT_FILE | \- 	sed 's/REPLACE_CC/CC="cc -Wall"/' | \-+	sed 's/REPLACE_SHCC/CC="cc -Wall -fPIC"/' | \-+	sed 's/REPLACE_SHLD/SHLD="gcc -shared -I."/' | \- 	sed 's/REPLACE_RANLIB/RANLIB="ranlib"/' | \--	sed "s|REPLACE_INSTALLDIR|${INSTALLDIR}|" | \-+	sed "s|REPLACE_PREFIX|${PREFIX}|" | \- 	sed 's/REPLACE_POSTFIX/_freebsd/' > $OUTPUT_FILE- else if ( $type == "Cygwin" ) then- 	cat $INPUT_FILE | \- 	sed 's/REPLACE_CC/"CC=cc"/' | \-+	sed 's/REPLACE_SHCC/CC="cc -fPIC"/' | \-+	sed 's/REPLACE_SHLD/SHLD="gcc -shared -I."/' | \- 	sed 's/REPLACE_RANLIB/RANLIB="echo Skipping ranlib"/' | \--	sed "s|REPLACE_INSTALLDIR|${INSTALLDIR}|" | \-+	sed "s|REPLACE_PREFIX|${PREFIX}|" | \- 	sed 's/REPLACE_POSTFIX/_cygwin/' > $OUTPUT_FILE- else- 	# Unknown operating system- 	cat $INPUT_FILE | \- 	sed 's/REPLACE_CC/"CC=cc"/' | \-+	sed 's/REPLACE_SHCC/CC="cc -fPIC"/' | \-+	sed 's/REPLACE_SHLD/SHLD="gcc -shared -I."/' | \- 	sed 's/REPLACE_RANLIB/RANLIB="echo Skipping ranlib"/' | \--	sed "s|REPLACE_INSTALLDIR|${INSTALLDIR}|" | \-+	sed "s|REPLACE_PREFIX|${PREFIX}|" | \- 	sed 's/REPLACE_POSTFIX//' > $OUTPUT_FILE- endif- -@@ -164,13 +188,14 @@- echo "    e-mail cdputnam@ucsd.edu with the system type and output of"- echo "    the command: uname -a"- echo--echo "Set installation directory to $INSTALLDIR."--echo "    To modify install directory type: configure --install-dir DIR"-+echo "Set installation directory to $PREFIX."-+echo "    To modify install directory type: configure --prefix DIR"- echo "    where DIR is the desired directory."- echo- if ( $OUTPUT_FILE == "Makefile" ) then-   echo "To compile,                  type: make"-   echo "To install,                  type: make install"-+  echo "To install the library,      type: make installlib"-   echo "To make tgz package,         type: make package"-   echo "To make deb package,         type: make deb"-   echo-diff -ur ../bibutils_4.1/lib/Makefile ./lib/Makefile---- ../bibutils_4.1/lib/Makefile	2008-12-21 00:17:31.000000000 +0100-+++ ./lib/Makefile	2008-12-26 11:19:48.000000000 +0100-@@ -24,6 +24,7 @@- all:  libbibutils.a- - libbibutils.a: $(BIBUTILS_OBJS)-+	${SHLD} -o libbibutils.so $(BIBUTILS_OBJS)- 	ar -cr libbibutils.a $(BIBUTILS_OBJS)- 	$(RANLIB) libbibutils.a- 
bibutils/adsout.c view
@@ -1,8 +1,8 @@ /*  * adsout.c  *- * Copyright (c) Richard Mathar 2007-2009- * Copyright (c) Chris Putnam 2007-2009+ * Copyright (c) Richard Mathar 2007-2010+ * Copyright (c) Chris Putnam 2007-2010  *  * Program and source code released under the GPL  *@@ -17,6 +17,27 @@ #include "fields.h" #include "adsout.h" +void+adsout_initparams( param *p, const char *progname )+{+	p->writeformat      = BIBL_ADSABSOUT;+	p->format_opts      = 0;+	p->charsetout       = BIBL_CHARSET_DEFAULT;+	p->charsetout_src   = BIBL_SRC_DEFAULT;+	p->latexout         = 0;+	p->utf8out          = 0;+	p->utf8bom          = 0;+	p->xmlout           = 0;+	p->nosplittitle     = 0;+	p->verbose          = 0;+	p->addcount         = 0;+	p->singlerefperfile = 0;++	p->headerf = adsout_writeheader;+	p->footerf = NULL;+	p->writef  = adsout_write;+}+ enum { 	TYPE_UNKNOWN = 0, 	TYPE_GENERIC,@@ -264,11 +285,11 @@ #include "adsout_journals.c"  static void-output_4digit_value( char *pos, int n )+output_4digit_value( char *pos, long long n ) { 	char buf[6]; 	n = n % 10000; /* truncate to 0->9999, will fit in buf[6] */-	sprintf( buf, "%d", n );+	sprintf( buf, "%lld", n ); 	if ( n < 10 )        strncpy( pos+3, buf, 1 ); 	else if ( n < 100 )  strncpy( pos+2, buf, 2 ); 	else if ( n < 1000 ) strncpy( pos+1, buf, 3 );@@ -316,6 +337,7 @@ { 	char out[20], ch; 	int n;+	long long page;  	strcpy( out, "..................." ); @@ -336,10 +358,10 @@ 	n = fields_find( info, "PAGESTART", -1 ); 	if ( n==-1 ) n = fields_find( info, "ARTICLENUMBER", -1 ); 	if ( n!=-1 ) {-		n = atoi( info->data[n].data );-		output_4digit_value( out+14, n );-		if ( n>=10000 ) {-			ch = 'a' + (n/10000);+		page = atoll( info->data[n].data );+		output_4digit_value( out+14, page );+		if ( page>=10000 ) {+			ch = 'a' + (page/10000); 			out[13] = ch; 		} 	}
bibutils/adsout.h view
@@ -1,8 +1,8 @@ /*  * adsout.h  *- * Copyright (c) Richard Mathar 2007-9- * Copyright (c) Chris Putnam 2007-9+ * Copyright (c) Richard Mathar 2007-10+ * Copyright (c) Chris Putnam 2007-10  *  * Program and source code released under the GPL  *@@ -16,5 +16,7 @@ extern void adsout_write( fields *info, FILE *fp, param *p, 		unsigned long refnum ); extern void adsout_writeheader( FILE *outptr, param *p );++extern void adsout_initparams( param *p, const char *progname );  #endif
bibutils/adsout_journals.c view
@@ -13,10 +13,10 @@ "AbaOB Abastumanskaia Astrofizicheskaia Observatoriia Biulleten", "AbbOO Abbadia Observatory Observations", "AADDR Abhandlungen Akad. Wiss. DDR",-"AAGot Abhandlungen Akad. Wiss. G&ouml",+"AAGot Abhandlungen Akad. Wiss. Göttingen", "AbhHS Abhandlungen aus der Hamburger Sternwarte", "ABWG. Abh. Braunschweigische Wissenschaftliche Ges.",-"AbhP. Abh. der Preu&szlig",+"AbhP. Abh. der Preuß. Akademie der Wissenschaften Jahrg", "AbhKP Abh. Konigl. Preuss. Akad. Wissenschaften Jahre 1906,92, Berlin,1907", "AbhBr Abh. naturwiss. Verein Bremen", "AbApA Abstract and Applied Analysis",@@ -82,7 +82,6 @@ "AcMSn Acta Mechanica Sinica", "AcMSS Acta Mechanica Solida Sinica", "AcMet Acta Metallurgica",-"AcM&M Acta Metallurgica et Materialia", "AcMMS Acta Metallurgica et Materialia Supplement", "AcMeS Acta Meteorologica Sinica", "AcNum Acta Numerica",@@ -129,7 +128,6 @@ "AdAeS Advances in Aeronautical Sciences", "AdApM Advances in Applied Mathematics", "AdAst Advances in Astronomy",-"AdA&A Advances in Astronomy and Astrophysics", "AdAtS Advances in Atmospheric Sciences", "AdAMP Advances in Atomic and Molecular Physics", "AAMOP Advances in Atomic Molecular and Optical Physics",@@ -168,6 +166,7 @@ "AdSR. Advances in Science and Research", "AdSSP Advances in Solid State Physics", "AdSpR Advances in Space Research",+"AAnSc Advances in the Astronautical Sciences", "AdTMP Advances in Theoretical and Mathematical Physics", "AdWR. Advances in Water Resources", "AAMS. Adv. Appl. Mech. Suppl.",@@ -179,7 +178,6 @@ "AeJ.. Aeronautical Journal", "AeQ.. Aeronautical Quarterly", "AeSIJ Aeronautical Society India Journal",-"AS&T. Aerosol Science & Technology", "AerST Aerosol Science Technology", "AeAm. Aerospace America", "AeCh. Aerospace China",@@ -189,6 +187,7 @@ "AeMat Aerospace Materials", "AeMed Aerospace Medicine", "ARBl. Aerospace Research in Bulgaria",+"AeTJa Aerospace Technology Japan", "Aero. Aerospace UK", "AFGL. AFGL-TR-0208 Environemental Research papers", "AfrSk African Skies",@@ -201,7 +200,6 @@ "AIHAJ AIHA Journal", "AirSp Air and Space", "AirE. Aircraft Engineering",-"AE&AT Aircraft Engineering & Aerospace Technology", "AirCo Air et Cosmos", "AFMa. Air Force Magazine", "AiInt Air International",@@ -274,6 +272,7 @@ "ARIJ. An Interdisciplinary Journal of Physical and Engineering Sciences", "CSMPA Ankara Universite Faculte des Sciences Communications Serie Mathematiques Physique et Astronomie", "AASF. Ann. Acad. Sci. Fennicae",+"AnStr Annalen der Kaiserlichen Universitats-Sternwarte in Strassburg", "AnWie Annalen der K.K. Sternwarte Wien", "AnSWi Annalen der K.K. Universitaets-Sternwarte in Wien (Waehring)", "AnMun Annalen der Koeniglichen Sternwarte bei Muenchen",@@ -293,9 +292,9 @@ "AnNic Annales de l'Observatoire de Nice", "AnPar Annales de l'Observatoire de Paris", "AnPOb Annales de l'Observatoire de Paris. Observations",-"AnStr Annales de l'Observatoire de Strasbourg",+"AnOSt Annales de l'Observatoire de Strasbourg", "AnRio Annales de l'Observatoire Imperial de Rio de Janeiro",-"AnAth Annales de l'Observatoire national d'Ath&egrave",+"AnAth Annales de l'Observatoire national d'Athènes", "AnOB. Annales de l'Observatoire Royal de Belgique", "AnOBN Annales de l'Observatoire Royal de Belgique Nouvelle serie", "AnBru Annales de l'Observatoire Royal de Bruxelles",@@ -304,11 +303,13 @@ "AnPCS Annales de Physique Colloque Supplement", "AnTel Annales des Telecommunications", "AnGVP Annales du Bureau des Longitudes, Gauthier-Villars, Paris",+"AFChr Annales Francaises de Chronometrie", "AnGeo Annales Geophysicae", "AnGeA Annales Geophysicae Series A Upper Atmosphere and Space Sciences", "AnGeB Annales Geophysicae Series B Terrestrial and Planetary Physics",-"AnHP. Annales Henri Poincar&eacute",+"AnHP. Annales Henri Poincaré", "AnTec Annales Tectonicae",+"AnApS Annals of Applied Statistics", "AGp.. Annals of Geophysics", "AnGla Annals of Glaciology", "AnGAG Annals of Global Analysis Geometry",@@ -320,6 +321,7 @@ "AnREE Annals of Research on Engineering Education", "AnCGH Annals of Royal Observatory, Cape of Good Hope", "AnSci Annals of Science",+"AnSta Annals of Statistics", "AnSAO Annals of the Astrophysical Observatory of the Smithsonian Institution", "AnBos Annals of the Bosscha Observatory Lembang (Java) Indonesia", "AnCap Annals of the Cape Observatory",@@ -328,6 +330,7 @@ "AnISM Annals of the Institute of Statistical Mathematics", "AnIPS Annals of the Israel Physical Society", "AnLow Annals of the Lowell Observatory",+"NYASA Annals of the New York Academy of Sciences", "AnLL. Annals of the Observatory of Lucien Libert", "AnLun Annals of the Observatory of Lund", "AnOLL Annals of the Private Observatory of Lucien Libert",@@ -340,10 +343,12 @@ "MMAAR Annual Report of the Maria Mitchell Association", "AnRSI Annual Report of the Smithsonian Institution", "WinAR Annual Report of the Windsor Observatory, New South Wales",-"ARA&A Annual Review of Astronomy and Astrophysics",+"ARAC. Annual Review of Analytical Chemistry",+"ARCMP Annual Review of Condensed Matter Physics", "AREPS Annual Review of Earth and Planetary Sciences", "AnRE. Annual Review of Energy", "AnRFM Annual Review of Fluid Mechanics",+"ARMS. Annual Review of Marine Science", "AnRMS Annual Review of Materials Science", "ARNPS Annual Review of Nuclear and Particle Science", "ARPC. Annual Review of Physical Chemistry",@@ -379,7 +384,7 @@ "ApNM. Applied Numerical Mathematics", "ApOpt Applied Optics", "ApPhy Applied Physics",-"ApPhA Applied Physics A: Materials Science & Processing",+"ApPhA Applied Physics A: Materials Science &amp", "ApPhB Applied Physics B: Lasers and Optics", "ApPPL Applied Physics B Photophysics Laser Chemistry", "ApPhC Applied Physics Communications",@@ -462,7 +467,6 @@ "Asnau Astronautik", "AUBas Astron. Inst. Univ. Basel", "Anews ASTRON Newsletter",-"A&AT. Astronomical and Astrophysical Transactions", "USNOM Astronomical and Meteorological Observations made at the U.S. Naval Observatory", "ACiCh Astronomical Circular", "ACMan Astronomical Contributions from the University of Manchester",@@ -470,7 +474,6 @@ "adass Astronomical Data Analysis Software and Systems", "ADCBu Astronomical Data Center Bulletin", "AstHe Astronomical Herald",-"AJ... Astronomical Journal", "AstLt Astronomical Letters", "ANote Astronomical Notes University of Gothenburg Sweden Section of Astronomy", "USNOA Astronomical Observations made at the U.S. Naval Observatory",@@ -482,12 +485,12 @@ "AZh.. Astronomicheskii Zhurnal", "ATsir Astronomicheskij Tsirkulyar", "KazOB Astronomicheskoj Observatorii Kazan Byulleten",-"A&R.. Astronomie und Raumfahrt",+"AAAN. Astronomische Abhandlungen als Erganzungshefte zu den Astronomische Nachrichten", "AAHam Astronomische Abhandlungen der Hamburger Sternwarte", "ABMun Astronomische Beobachtungen angestellt auf der K. Sternwarte zu Bogenhausen bei Muenchen", "ABSBe Astronomische Beobachtungen auf der Koniglichen Sternwarte zu Berlin", "ABKie Astronomische Beobachtungen auf der Sternwarte der Koeniglichen Christian-Albrechts-Universitaet zu Kiel",-"MiZur Astronomische Mitteilungen der Eidenössischen Sternwarte Zurich",+"MiZur Astronomische Mitteilungen der Eiden�ssischen Sternwarte Zurich", "MiBre Astronomische Mitteilungen der Koeniglichen Universitaets-Sternwarte zu Breslau", "MiGoe Astronomische Mitteilungen der Universitaets-Sternwarte zu Goettingen", "AN... Astronomische Nachrichten",@@ -496,15 +499,9 @@ "MiARI Astronomisches Rechen-Institut Heidelberg Mitteilungen Serie A", "MiARB Astronomisches Rechen-Institut Heidelberg Mitteilungen Serie B", "ATi.. Astronomisk Tidsskrift",-"As&Ge Astronomiya i geodeziya", "Ast.. Astronomy", "Astro Astronomy",-"A&A.. Astronomy and Astrophysics", "AstAp Astronomy and Astro-Physics",-"A&AA. Astronomy and Astrophysics Abstracts Heidelberg",-"A&ARv Astronomy and Astrophysics Review",-"A&AS. Astronomy and Astrophysics Supplement Series",-"A&G.. Astronomy and Geophysics", "ADIL. Astronomy Data Image Library", "AEdRv Astronomy Education Review", "AExpr Astronomy Express",@@ -516,14 +513,10 @@ "APh.. Astroparticle Physics", "AstBu Astrophysical Bulletin", "ApInv Astrophysical Investigations",-"ApJ.. Astrophysical Journal",-"ApJS. Astrophysical Journal Supplement Series", "ApL.. Astrophysical Letters",-"ApL&C Astrophysical Letters Communications", "ApNr. Astrophysica Norvegica", "Ap... Astrophysics", "ASPRv Astrophysics and Space Physics Reviews",-"Ap&SS Astrophysics and Space Science", "ASTRA Astrophysics and Space Sciences Transactions", "ApSSS Astrophysics and Space Science Supplement", "astro.ArXiv Astrophysics e-prints",@@ -535,9 +528,11 @@ "Atmos Atmosphere", "AtO.. Atmosphere Ocean", "AtOpt Atmosphere Optics",-"ACP.. Atmospheric Chemistry & Physics",-"ACPD. Atmospheric Chemistry & Physics Discussions",+"ACP.. Atmospheric Chemistry &amp",+"ACPD. Atmospheric Chemistry &amp", "AtmEn Atmospheric Environment",+"AMT.. Atmospheric Measurement Techniques",+"AMTD. Atmospheric Measurement Techniques Discussions", "AtmRe Atmospheric Research", "AtSc. Atmospheric Science", "AtScL Atmospheric Science Letters",@@ -586,13 +581,15 @@ "BayAn Bayesian Analysis", "BBCEn BBC Engineering", "BRMIC Behavior Research Methods Instruments and Computers",-"BIT.. Behaviour & Information Technology",+"BIT.. Behaviour &amp", "BUAAJ Beijing University Aeronautics and Astronautics Journal", "BePl. Beitraege Plasmaphysik", "BeiGe Beitraege zur Geophysik", "BeiMP Beitraege zur Mineralogie und Petrographie", "BROGS Belgian Royal Observatory Communications Series Geophysics Series", "BLabR Bell Laboratories Record",+"BKAD. Beobachtungen der Kaiserlichen Universitaets-Sternwarte Dorpat",+"BKUJ. Beobachtungen der Kaiserlichen Universitaets-Sternwarte Jurjew", "BESBe Beobachtungs-Ergebnisse der Koniglichen Sternwarte zu Berlin", "ANZi. Beobachtungs-Zirkular der Astronomischen Nachrichten", "BBGPC Berichte der Bunsen-Gesellschaft Physical Chemistry Chemical Physics Berichte",@@ -659,7 +656,6 @@ "BTE.. British Telecommunications Engineering", "BIRM. Brussels Institute Royal Meteorologique de Belgique", "BuAkK Budapest Akademiai Kiado",-"BlAJ. Bulgarian Astronomical Journal", "BlgAJ Bulgarian Astronomical Journal", "BlGJ. Bulgarian Geophysical Journal", "BlJMH Bulgarian Journal of Meteorology and Hydrology",@@ -676,10 +672,12 @@ "BABel Bulletin Astronomique de Belgrade", "BuAsR Bulletin Astronomique, Revue Generale des Travaux Astronomiques", "BuAsI Bulletin Astronomique, Serie I",+"BuChr Bulletin Chronometrique (Besancon)", "BCrAO Bulletin Crimean Astrophysical Observatory", "BAPSS Bulletin de l'Academie Polonaise des Sciences Series des Sciences Mathematiques Astronomiques et Physiques", "BARB. Bulletin de l'Academie Royale de Belgique", "BSAF. Bulletin de la Societe Astronomique de France",+"BSAFR Bulletin de la Societe Astronomique de France et Revue Mensuelle d'Astronomie, de Meteorologie et de Physique du Globe", "BSBA. Bulletin de la Societe Belge d'Astronomie", "BSRSL Bulletin de la Societe Royale des Sciences de Liege", "AFOEV Bulletin de l'Association Francaise d'Observateurs d'Etoiles Variables",@@ -710,12 +708,14 @@ "IllOB Bulletin of the Astronomical Observatory of the University of Illinois", "BASBr Bulletin of the Astronomical Society of Brazil", "BASI. Bulletin of the Astronomical Society of India",+"BCAIC Bulletin of the Central Astronomical Institute of Czechoslovakia", "BuIPS Bulletin of the Israel Physical Society", "BKobO Bulletin of the Kobe Marine Observatory Kobe Japan", "BuLMS Bulletin of the London Mathematical Society", "BRASP Bulletin of the Russian Academy of Science, Phys.", "BSAst Bulletin of the Section of Astronomy", "BSAE. Bulletin of the Soviet Antarctic Expedition",+"BTasO Bulletin of the Tashkent Observatory", "BTok. Bulletin of the Tokyo Astronomical Observatory", "BToIT Bulletin of the Tokyo Institute of Technology", "BUBes Bulletin of the University of Besancon Observatory",@@ -783,7 +783,7 @@ "ChEdu Chemical Educator", "ChEnC Chemical Engineering Communications", "ChEnN Chemical Engineering News",-"CERDA Chemical Engineering Research & Design. Part A, Transactions of the Institution of Chemical Engineers",+"CERDA Chemical Engineering Research &amp", "ChEnS Chemical Engineering Science", "ChGeo Chemical Geology", "CP... Chemical Physics",@@ -799,7 +799,6 @@ "ChUDA Chile Universidad Departamento de Astronomia Publicaciones", "ChRST China Rept Sci Technol JPRS CST", "ChA.. Chinese Astronomy",-"ChA&A Chinese Astronomy and Astrophysics", "ChIEJ Chinese Institute of Engineers Journal", "ChJA. Chinese Journal of Aeronautics", "ChJAA Chinese Journal of Astronomy and Astrophysics",@@ -829,8 +828,6 @@ "CHOCS CHOCS", "CITM. Chubu Institute Technology Memoirs", "CIDA. CIDA",-"C&E.. Ciel et Espace",-"C&T.. Ciel et Terre", "CTE.. Ciencias de la Tierra y del Espacio", "CiSSV Circolare Interna della Sezione Stelle Variabili dell'Unione Astrofili Italiani", "CSSP. Circuits Systems and Signal Processing",@@ -870,9 +867,11 @@ "ComBr Communication Broadcasting", "CoSSC Communication in Statistics - Simulation and Computation", "CoSTM Communication in Statistics - Theory and Methods",+"Commu Communications", "CoORB Communications de l'Observatoire Royal de Belgique", "MonAP Communications du Departement d'Astrophysique de la Faculte des Sciences de Mons Mons Astrophysical Papers", "CoDDO Communications from the David Dunlap Observatory",+"CoMtW Communications from the Mount Wilson Solar Observatory to the National Academy of Sciences", "CoRad Communications from the Radcliffe Observatory Pretoria South Africa", "CoROE Communications from the Royal Observatory Edinburgh", "CoOxf Communications from the University Observatory Oxford",@@ -881,6 +880,7 @@ "CoAlg Communications in Algebra", "CANM. Communications in Applied Numerical Methods", "CoAst Communications in Asteroseismology",+"CCoPh Communications in Computational Physics", "CMaPh Communications in Mathematical Physics", "CNSNS Communications in Nonlinear Science and Numerical Simulations", "CNME. Communications in Numerical Methods in Engineering",@@ -905,15 +905,14 @@ "CRSPH Compte Rendu des Seances de la Societe de Physique et d'Histoire Naturelle de Genere", "CR... Comptes Rendus Academie des Sciences (serie non specifiee)", "CRABS Comptes Rendus de l'Academie Bulgare des Sciences",-"CRASE Comptes Rendus de l'Académie des Sciences - Series IIA - Earth and Planetary Science",+"CRASE Comptes Rendus de l'Académie des Sciences - Series IIA - Earth and Planetary Science", "CRGeo Comptes Rendus Geoscience",-"CRMec Comptes Rendus Me©canique",+"CRMec Comptes Rendus Mecanique", "CRPhy Comptes Rendus Physique", "CAMP. Computational and Applied Mathematical Physics", "CMMPh Computational Mathematics and Mathematical Physics", "CompM Computational Mechanics", "COA.. Computational Optimization and Applications",-"CS&D. Computational Science and Discovery", "CSMA. Computational Structural Mechanics and Applications", "Comp. Computer", "CAD.. Computer-Aided Design",@@ -929,7 +928,6 @@ "CoStr Computers and Structures", "CSEd. Computer Science Education", "ComPh Computers in Physics",-"CS&L. Computer Speech & Language", "CVIU. Computer Vision and Image Understanding", "CVGIP Computer Vision Graphics and Image Processing", "Compu Computing",@@ -998,7 +996,7 @@ "CTP.. Course of Theoretical Physics", "CRB.. C.R. Acad. Sci. Ser. B1", "CraRe Cracow Observatory Reprints",-"CRSSM Critical Reviews in Solid State & Materials Sciences",+"CRSSM Critical Reviews in Solid State &amp", "Cryo. Cryogenics", "CryRp Crystallography Reports", "CuCo. Culture and Cosmos",@@ -1026,7 +1024,6 @@ "DeScE Defense Science Electronics", "DSJ.. Defense Science Journal", "DSRMC Defense Systems Review Military Communications",-"BSAFR<etin de la Societe Astronomique de France et Revue Mensuelle d'Astronomie, de Meteorologie et de Physique du Globe", "DSSN. Delta Scuti Star Newsletter", "Sterb Der Sternenbote Monatsschrift fuer Oesterreichs Amateur-astronomen", "DGKBA Deutsche Geodaetische Kommission Bayer. Akad. Wiss.",@@ -1076,16 +1073,16 @@ "EESC. Earth and Environmental Science Conference Series", "EaEvS Earth and Evolution Sciences", "EExSc Earth and Extraterrestrial Sciences",-"E&PSL Earth and Planetary Science Letters",-"E&S.. Earth and Space", "EaInt Earth Interactions",-"EM&P. Earth Moon and Planets", "EOAST Earth-Oriented Applications and Space Technology",-"EP&S. Earth, Planets, and Space", "EEEV. Earthquake Engineering and Engineering Vibration", "EaSci Earthquake Science", "ESRv. Earth Science Reviews", "ESPL. Earth Surface Processes and Landforms",+"ESD.. Earth System Dynamics",+"ESDD. Earth System Dynamics Discussion",+"ESSD. Earth System Science Data",+"ESSDD Earth System Science Data Discussions", "EERST East European Rept Sci. Technol. JPRS ESA", "EERSA East Europe Rept Sci Affairs JPRS", "EBCi. Eclipsing Binaries Circulars",@@ -1096,12 +1093,14 @@ "EartD eEarth Discussions", "ETATF Eesti NSV Teaduste Akadeemia Toimetised Fuusika Matemaatika", "IzmP. Ege University Izmir Publications of the Department of Astronomy",+"EJSM. e-Journal of Soft Materials", "Elast Elastic", "ECLRv Electrical Communication Laboratories Review", "JElEn Electrical Engineering of Japan", "EMPS. Electric Machines and Power Systems", "Elecm Electromagnetics", "EJSEd Electronic Journal of Science Education",+"EJSta Electronic Journal of Statistics", "EJTP. Electronic Journal of Theoretical Physics", "ElPro Electronic Progress", "JElCo Electronics Communications of Japan",@@ -1111,13 +1110,11 @@ "ElLC. Electrotechnical Laboratory Circulars", "ElLR. Electrotechnical Laboratory Researches", "ElBah Elektrische Bahnen",-"E&E.. Elektromashinostroenie i Elektrooborudovanie", "Elem. Elektromekhanika", "Elek. Elektronika", "ElTA. Elektronnaia Tekhnika Avtomatike", "ElMod Elektronnoe Modelirovanie", "ETRE. Elektrosviaz Telecommunications Radio Engineering Telecommunications",-"E&M.. Elektrotechnik und Maschinenbau", "EVest Elektrotehniski Vestnik", "OED.. El Observador de Estrellas Dobles", "EMCT. EMC Technology",@@ -1128,7 +1125,6 @@ "EnAt. Energia es Atomtechnika", "EnC.. Energy Conversion", "ECM.. Energy Conversion Management",-"E&ESc Energy & Environmental Science", "EnS.. Energy Sources", "EnTR. Energy Technology Review", "EnUK. Energy UK",@@ -1161,12 +1157,13 @@ "ESABu ESA Bulletin", "ESAHR ESA History Study Reports", "ESAJ. ESA Journal",-"ESASM ESA Scientific & Technical Memoranda",+"ESASM ESA Scientific &amp", "ESAST ESA Scientific Technical Review", "ESATM ESA Training Manual", "EssPh Essays in Physics", "ECSS. Estuarine Coastal and Shelf Science", "EurSS Eurasian Soil Science",+"EJASP EURASIP Journal on Applied Signal Processing", "EBioJ European Biophysics Journal", "EJAM. European Journal of Applied Mathematics", "EJBio European Journal of Biochemistry",@@ -1208,11 +1205,12 @@ "PMtv. Facultad de Humanidades y Ciencias Universidad de la Republica Montevideo", "FaTr. Faraday Transactions", "FFEMS Fatigue and Fracture of Engineering Materials and Structures",-"F&M.. Feinwerktechnik und Messtechnik",+"FerNo Fermilab Note", "Fer.. Ferroelectrics", "FerLS Ferroelectrics Letters Section", "FBS.. Few-Body Systems", "FiIO. Fiber and Integrated Optics",+"Filom Filomat", "FeMik Finommechanika Mikrotechnika", "FiBr. First Break", "FizEl Fizicheskaia Elektronika",@@ -1234,7 +1232,6 @@ "FizKM Fiziko Khimicheskaia Mekhanika Materialov", "FizCh Fizyki i Chemii Seria Fizyka", "FliIn Flight International",-"F&CRe Flower and Cook Observatory Reprints", "FNL.. Fluctuation and Noise Letters", "FRFI. Flug Revue Flugwelt International", "FlDy. Fluid Dynamics",@@ -1245,14 +1242,10 @@ "FlMSR Fluid Mechanics Soviet Research", "FluQ. Fluids Quarterly", "FBP.. Food and Bioproducts Processing. Part C, Transactions of the Institution of Chemical Engineers",-"F&I.. Forschung im Ingenieurwesen",-"F&IER Forschung im Ingenieurwesen Engineering Research", "ForPh Fortschritte der Physik", "FoGeo Fotointerpretacja w Geografii", "FoPh. Foundations of Physics", "FoPhL Foundations of Physics Letters",-"FPhL. Foundations of Physics Letters",-"FrInJ Franklin Institute Journal", "Freq. Frequenz", "FrPhy Frontiers in Physics", "FrPhC Frontiers of Physics in China",@@ -1270,8 +1263,9 @@ "GCNew Galactic Center Newsletter", "GalEl Galilean Electrodynamics", "GEB.. Games and Economic Behavior",-"GGMit Gauss-Gesellschaft e.V. G&ouml",+"GGMit Gauss-Gesellschaft e.V. Göttingen, Mitteilungen", "GVPOO Gauthier-Villars Paris Observatory Observations",+"GazA. Gazette Astronomique", "GazT. Gazodinamika i Teploobmen", "GCNR. GCN Report", "GECJR GEC Journal Research",@@ -1309,7 +1303,6 @@ "GeoRu Geologische Rundschau", "Geo.. Geology", "GeoOD Geology of Ore Deposits",-"Ge&Ae Geomagnetism and Aeronomy/Geomagnetizm i Aeronomiia", "GeoIs Geomagnitnye Issledovaniia", "GML.. Geo-Marine Letters", "GeoD. Geometriae Dedicata",@@ -1330,6 +1323,8 @@ "GAM.. Geophysics and Astrophysics Monographs", "GeoOM Georgetown Observatory Monogram", "GeoRe Georgetown Observatory Reprints",+"GMD.. Geoscientific Model Development",+"GMDD. Geoscientific Model Development Discussions", "GEOCE GEOS Circular on Eclipsing Binaries", "GEOCR GEOS Circular on RR Lyr Type Variables", "GEOCA GEOS Circular on Small-Amplitude Variables",@@ -1366,7 +1361,7 @@ "HalRe Hale Observatories Reprints", "BSD.. Hamburger Sternwarte Bergedorf", "HamS. Hamburger Sternwarte Sonderdrucke",-"LS... Hamburger Sternw. Warner & Swasey Obs.",+"LS... Hamburger Sternw. Warner &amp", "HAAG. Handbook of Astronomy Astrophysics and Geophysics", "HBP.. Handbook of Biological Physics", "HGE.. Handbook of Geophysical Exploration",@@ -1389,8 +1384,8 @@ "HTJR. Heat Transfer Japanese Research", "HTSR. Heat Transfer Soviet Research", "Heavn Heavens",+"HWM.. Helgoländer Wissenschaftliche Meeresuntersuchungen", "HMR.. Helgoland Marine Research",-"HWM.. Helgol&auml", "AcHCh Helvetica Chimica Acta", "AcHPh Helvetica Physica Acta", "HelOB Helwan Institute of Astronomy and Geophysics Bulletins",@@ -1468,6 +1463,7 @@ "ISPL. IEEE Signal Processing Letters", "ISPM. IEEE Signal Processing Magazine", "IEEES IEEE Spectrum",+"ISysJ IEEE Systems Journal", "ITASS IEEE Transactions on Acoustics Speech and Signal Processing", "ITAES IEEE Transactions on Aerospace Electronic Systems", "ITAP. IEEE Transactions on Antennas and Propagation",@@ -1520,6 +1516,11 @@ "ITVT. IEEE Transactions on Vehicular Technology", "JMOA. IEE Journal of Microwaves Optics and Acoustics", "JSSED IEE Journal of Solid-State Electron Devices",+"ITEIS IEEJ Transactions on Electronics, Information and Systems",+"IJTFM IEEJ Transactions on Fundamentals and Materials",+"IJTIA IEEJ Transactions on Industry Applications",+"IJTPE IEEJ Transactions on Power and Energy",+"IJTSM IEEJ Transactions on Sensors and Micromachines", "IPEPA IEE Proceedings B: Electric Power Applications", "IPGTD IEE Proceedings C: Generation Transmission Distribution", "IPCSV IEE Proceedings: Communications Speech and Vision",@@ -1570,6 +1571,7 @@ "InJET Indian Journal of Electronics Telecommunication Engineering Division", "InJME Indian Journal of Mechanical Engineering Division", "IJMHG Indian Journal of Meteorology Hydrology and Geophysics",+"InJPh Indian Journal of Physics", "InJP. Indian Journal of Physics and Proceedings of the Indian Assocatiation for the Cultivation of Science", "InJPA Indian Journal of Physics Section A", "InJPB Indian Journal of Physics Section B",@@ -1592,7 +1594,6 @@ "InfPh Infrared Physics", "InPhT Infrared Physics and Technology", "Ingeg Ingegneria",-"IA&A. Ingenieria Aeronautica y Astronautica", "IngAr Ingenieur Archiv", "InCh. Inorganic Chemistry", "IAL1K Institut d'Astronomie de Lausanne",@@ -1611,7 +1612,6 @@ "IRMBP Institut Royal Meteorologique de Belgique Publications Serie", "ITAB. Institut Teoreticheskoi Astronomii Biulleten", "TrITA Institut Teoreticheskoi Astronomii Trudy",-"IS&T. Instrumentation Science &amp", "IET.. Instruments and Experimental Techniques", "InLoP Instytut Lotnictwa Prace", "InMP. Instytut Maszyn Przeplywowych",@@ -1625,7 +1625,6 @@ "ISRv. Interdisciplinary Science Reviews", "IFB.. Interfaces and Free Boundaries", "IPAUC INTERKOSMOS Prague Astronomicky Ustav Ceskoslovenske Akademie Ved",-"I&DS. Interlending & Document Supply", "IANT. International Advances in Nondestructive Testing", "IAPPP International Amateur-Professional Photoelectric Photometry Communications", "IAUC. International Astronomical Union Circular",@@ -1653,6 +1652,7 @@ "IJCli International Journal of Climatology", "IJCES International Journal of Computational Engineering Science", "IJCFD International Journal of Computational Fluid Dynamics",+"IJCA. International Journal of Computer Applications", "IJCMS International Journal of Computer Mathematics Section B", "IJCV. International Journal of Computer Vision", "IJC.. International Journal of Control",@@ -1671,6 +1671,7 @@ "IJGA. International Journal of Geomagnetism and Aeronomy", "IJGMM International Journal of Geometric Methods in Modern Physics", "IJGeo International Journal of Geophysics",+"IJGNP International Journal of Green Nanotechnology Physics and Chemistry", "IJHFF International Journal of Heat and Fluid Flow", "IJHMT International Journal of Heat and Mass Transfer", "IJHSC International Journal of High Speed Computing",@@ -1703,7 +1704,7 @@ "IJNS. International Journal of Neural Systems", "IJNLM International Journal of Non Linear Mechanics", "IJNOP International Journal of Nonlinear Optical Physics",-"IJNMH International Journal of Numerical Methods for Heat & Fluid Flow",+"IJNMH International Journal of Numerical Methods for Heat &amp", "IJOpt International Journal of Optics", "IJOMS International Journal of Oral and Maxillofacial Surgery", "IJPRS International Journal of Photogrammetry and Remote Sensing",@@ -1743,7 +1744,6 @@ "InFiZ Inzhenerno Fizicheskii Zhurnal", "IonIs Ionosfernye Issledovaniia", "Iono. Ionosphere",-"E&ES. IOP Conference Series: Earth and Environmental Science", "IrJST Iranian Journal of Science Technology", "IrAJ. Irish Astronomical Journal", "IrAJS Irish Astronomical Journal Supplement",@@ -1793,8 +1793,8 @@ "IzAvT Izvestiya VUZ Aviatsionnaya Tekhnika", "IzRad Izvestiya VUZ Radiofizika", "IzNic Izviestiia Nikolaevskoi glavnoi astronomicheskoi observatorii",-"JWUDF Jahns W&ouml",-"JRE.. Jahrbuch der Radioaktivit&auml",+"JWUDF Jahns Wöchentliche Unterhaltungen Für Dilettanten und Freunde der Astronomie, Georgraphie und Witterungskunde",+"JRE.. Jahrbuch der Radioaktivität und Elektronik", "JASAC Japan Astronomical Study Association Circulars", "JaJAP Japanese Journal of Applied Physics", "JJAPL Japanese Journal of Applied Physics Letters B",@@ -1816,7 +1816,7 @@ "JBASP Jodrell Bank Ann Ser Pt", "JBRe. Jodrell Bank Reprints", "JHATD Johns Hopkins APL Technical Digest",-"JOM.. JOM",+"JOM.. JOM - Journal of the Minerals, Metals and Materials Society", "RSNSW Journal and Proceedings of the Royal Society of New South Wales", "JAco. Journal d'Acoustique", "JCP.. Journal de Chimie Physique",@@ -1842,6 +1842,7 @@ "JNanU Journal Nanjing Univ", "JNIRE Journal NIRE", "JAE.. Journal of Acoustic Emission",+"JAMDS Journal of Advanced Mechanical Design, Systems, and Manufacturing", "JAerS Journal of Aerosol Science", "JAerE Journal of Aerospace Engineering", "JAerP Journal of Aerospace Power",@@ -1864,6 +1865,7 @@ "JAPE. Journal of Applied Photographic Engineering", "JAP.. Journal of Applied Physics", "JAPh. Journal of Applied Physiology",+"JARS. Journal of Applied Remote Sensing", "JASE. Journal of Applied Science and Engineering Section on Electrical Power and Information Systems", "JApSc Journal of Applied Sciences", "JApSp Journal of Applied Spectroscopy",@@ -1926,13 +1928,16 @@ "JCM.. Journal of Computational Mathematics", "JCoN. Journal of Computational Neuroscience", "JCoPh Journal of Computational Physics",+"JCST. Journal of Computational Science and Technology", "JCAMD Journal of Computer-Aided Materials Design", "JCoSS Journal of Computer and System Sciences", "JCHyd Journal of Contaminant Hydrology",+"JCos. Journal of Cosmology", "JCAP. Journal of Cosmology and Astro-Particle Physics", "JCrGr Journal of Crystal Growth", "JDR.. Journal of Dairy Research", "JDE.. Journal of Differential Equations",+"JDGeo Journal of Differential Geometry", "JoDI. Journal of Digital Information", "JDST. Journal of Dispersion Science and Technology", "JDisT Journal of Display Technology",@@ -1961,6 +1966,7 @@ "JEPT. Journal of Engineering Physics and Thermophysics", "JEngS Journal of Engineering Sciences", "JEEM. Journal of Environmental and Economics Management",+"JECE. Journal of Environmental Conservation Engineering", "JEnvS Journal of Environmental Sciences", "JExB. Journal of Experimental Botany", "JENan Journal of Experimental Nanoscience",@@ -1968,6 +1974,7 @@ "JFC.. Journal of Fluid Control", "JFM.. Journal of Fluid Mechanics", "JFS.. Journal of Fluids and Structures",+"JFST. Journal of Fluid Science and Technology", "JFlu. Journal of Fluorescence", "JFAA. Journal of Fourier Analysis and Applications", "JFuA. Journal of Functional Analysis",@@ -2000,6 +2007,7 @@ "JHEP. Journal of High Energy Physics", "JHEPC Journal of High Energy Physics Conference Proceedings", "JHSN. Journal of High Speed Networks",+"JHTS. Journal of High Temperature Society", "JHyd. Journal of Hydrology", "JHyMe Journal of Hydrometeorology", "JHyn. Journal of Hydronautics",@@ -2011,6 +2019,8 @@ "JIEq. Journal of Integral Equations", "JIRS. Journal of Intelligent and Robotic Systems", "JIMSS Journal of Intelligent Material Systems and Structures",+"JJAHS Journal of Japanese Association of Hydrological Sciences",+"JJSEE Journal of Japanese Society for Engineering Education", "JKTR. Journal of Knot Theory and its Ramifications", "JKAS. Journal of Korean Astronomical Society", "JKASS Journal of Korean Astronomical Society Supplement",@@ -2018,7 +2028,7 @@ "JLCMe Journal of Laboratory and Clinical Medicine", "JLasA Journal of Laser Applications", "JLCM. Journal of Less Common Metals",-"JLVEn Journal of Light & Visual Environment",+"JLVEn Journal of Light &amp", "JLwT. Journal of Lightwave Technology", "JLTP. Journal of Low Temperature Physics", "JLum. Journal of Luminescence",@@ -2053,15 +2063,15 @@ "JMaPh Journal of Mathematics and Physics", "JMecE Journal of Mechanical and Engineering Science", "JMBM. Journal of Mechanical Behavior and Materials",+"JMSTL Journal of Mechanical Systems for Transportation and Logistics", "JMPSo Journal of Mechanics Physics of Solids", "JMNB. Journal of Medecine Nucleaire et Biophysique",-"JME&T Journal of Medical Engineering & Technology", "JMet. Journal of Metals", "JMemS Journal of Microelectromechanical Systems",-"JMM&M Journal of Microlithography, Microfabrication, and Microsystems", "JMiMi Journal of Micromechanics and Microengineering", "JMic. Journal of Microscopy", "JMOp. Journal of Modern Optics",+"JMPh. Journal of Modern Physics", "JMBio Journal of Molecular Biology", "JMoEl Journal of Molecular Electronics", "JMolE Journal of Molecular Evolution",@@ -2070,6 +2080,7 @@ "JMA.. Journal of Multivariate Analysis", "JNUNS Journal of Nanjing University (Natural Sciences)", "JNR.. Journal of Nanoparticle Research",+"JNano Journal of Nanophotonics", "JNav. Journal of Navigation", "JNIS. Journal of Near Infrared Spectroscopy", "JNEng Journal of Neural Engineering",@@ -2122,11 +2133,11 @@ "JPhsg Journal of Physiology", "JPFR. Journal of Plasma and Fusion Research", "JPlPh Journal of Plasma Physics",-"JPoSA Journal of Polymer Science A Polymer Physics",-"JPoSB Journal of Polymer Science B Polymer Letters",+"JPoSA Journal of Polymer Science A Polymer Chemistry",+"JPoSB Journal of Polymer Science B Polymer Physics", "JPMat Journal of Porous Materials",+"JPES. Journal of Power and Energy Systems", "JPS.. Journal of Power Sources",-"JPSrc Journal of Power Sources", "JPAS. Journal of Practical Applications in Space", "JPP.. Journal of Propulsion Power", "JPT.. Journal of Propulsion Technology",@@ -2160,6 +2171,7 @@ "JSGeo Journal of Series Geophysics", "JShR. Journal of Ship Research", "JSGST Journal of Sol-Gel Science and Technology",+"JSMME Journal of Solid Mechanics and Materials Engineering", "JSSCh Journal of Solid State Chemistry France", "JSCh. Journal of Solution Chemistry", "JSV.. Journal of Sound Vibration",@@ -2168,6 +2180,7 @@ "JSAR. Journal of Space Astronomy Research", "JSpRo Journal of Spacecraft and Rockets", "JSpT. Journal of Spacecraft Technology",+"JSpEn Journal of Space Engineering", "JSCS. Journal of Statistical Computation and Simulation", "JSMTE Journal of Statistical Mechanics: Theory and Experiment", "JSP.. Journal of Statistical Physics",@@ -2177,6 +2190,7 @@ "JSM.. Journal of Structural Mechanics", "JSup. Journal of Superconductivity", "JSymC Journal of Symbolic Computation",+"JSDD. Journal of System Design and Dynamics", "JTePh Journal of Technical Physics", "JTech Journal of Technology", "JTeEv Journal of Testing Evaluation",@@ -2190,14 +2204,16 @@ "JAnSc Journal of the Astronautical Sciences", "JASEg Journal of the Astronomical Society of Egypt", "JASV. Journal of the Astronomical Society of Victoria Melbourne",-"JASWA Journal of the Astronomical Society of Victoria Melbourne",+"JASWA Journal of the Astronomical Society of Western Australia", "JAWRA Journal of the Astronomical Society of Western Australia", "JBAA. Journal of the British Astronomical Association", "JBAS. Journal of the British Astronomical Society", "JBIS. Journal of the British Interplanetary Society", "JCSS. Journal of the Chinese Silicate Society", "JElS. Journal of the Electrochemical Society",+"FrInJ Journal of The Franklin Institute", "JIISB Journal of the Indian Institute of Science Section B Physical and Chemical Series",+"JIEEJ Journal of The Institute of Electrical Engineers of Japan", "JIMIA Journal of the Institute of Mathematics and Its Applications", "JIETE Journal of the Institution of Electronics and Telecommunication Engineers", "JLMS. Journal of the London Mathematical Society",@@ -2210,6 +2226,7 @@ "JPSJS Journal of the Physical Society of Japan Supplement", "JTAC. Journal of Thermal Analysis and Calorimetry", "JThSc Journal of Thermal Science",+"JJTST Journal of Thermal Science and Technology", "JTST. Journal of Thermal Spray Technology", "JThSt Journal of Thermal Stresses", "JTh.. Journal of Thermodynamics",@@ -2222,6 +2239,7 @@ "JRSSD Journal of the Royal Statistical Society: Series D (The Statistician)", "JSRP. Journal of the Society for Radiological Protection", "JSARA Journal of the Southeastern Association for Research in Astronomy",+"JVSJ. Journal of the Vacuum Society of Japan", "JWasA Journal of the Washington Academy of Sciences", "JTF.. Journal of Time and Frequency", "JTurb Journal of Turbulence",@@ -2234,8 +2252,11 @@ "JWMSE Journal of Women and Minorities in Science and Engineering", "JXST. Journal of X-Ray Science and Technology", "RpScT JPRS Report Science Technology USSR Space",-"JSMEB JSME Bulletin",+"JSMB. JSME Bulletin", "JSMEJ JSME International Journal",+"JSMEA JSME International Journal Series A",+"JSMEB JSME International Journal Series B",+"JSMEC JSME International Journal Series C", "JSMET JSME Transactions", "KKR.. Kagaku Kogaku Ronbunshu", "MmKMO Kakioka Magnetic Observatory Memoirs",@@ -2292,7 +2313,7 @@ "AerMS L'Aerotecnica Missili e Spazio", "LHBl. La Houille Blanche", "Meteo La Meteorologie",-"LDD.. Land Degradation & Development",+"LDD.. Land Degradation &amp", "Langm Langmuir", "LaJ.. Lapidary Journal", "Rech. La Recherche",@@ -2305,11 +2326,11 @@ "LasJ. Laser Journal", "LaPhy Laser Physics", "LaPhL Laser Physics Letters",+"LaPhR Laser Physics Review", "Astrf L'Astrofilo Bolletino Trimestral del Gruppo Astrofili Villaggio Sereno Brescia", "LAstr L'Astronomie", "LTerm La Termotecnica", "LatJP Latvian Journal of Physics and Technical Sciences",-"LitJP Latvian Journal of Physics and Technical Sciences", "LatME Latviiskii Matematicheskii Ezhegodnik", "LawOB Laws Observatory Bulletin, University of Missouri", "LBLRR LBL Research Review",@@ -2352,6 +2373,7 @@ "LLabJ Lincoln Laboratory Journal", "LiCr. Liquid Crystals", "Litho Lithos",+"LitJP Lithuanian Journal of Physics and Technical Sciences", "LRR.. Living Reviews in Relativity", "LRSP. Living Reviews in Solar Physics", "LockH Lockheed Horizons",@@ -2383,7 +2405,7 @@ "MWGBI Mannheim West Germany Bibliographisches Institut AG", "MaTeJ ManTech Journal", "ManGe Manuscripta Geodaetica",-"MarRQ Marconi Review Quarter",+"MarRv Marconi Review", "MarGe Marine Geodesy", "MarGR Marine Geophysical Researches", "MarPG Marine Petroleum Geology",@@ -2398,13 +2420,13 @@ "MMTET Matematicheskoe Modelirovanie i Teoriia Elektricheskikh Tsepei", "MatVe Matematichki Vesnik", "Mater Materialpruefung",+"Mate. Materials", "MMP.. Materials and Manufacturing Processes", "MCP.. Materials Chemistry and Physics", "MatEv Materials Evaluation", "MatL. Materials Letters", "MaRBu Materials Research Bulletin", "MRSSP Materials Research Society Symposia Proceedings",-"MS&E. Materials Science and Engineering", "MSEng Materials Science and Engineering", "MSEnR Materials Science and Engineering R Reports", "MSTec Materials Science and Technology",@@ -2437,7 +2459,7 @@ "MecEn Mechanical Engineering", "MSSP. Mechanical Systems and Signal Processing", "MPDS. Mechanics and Physics of Discrete Systems",-"MCMS. Mechanics of Composite Materials & Structures",+"MCMS. Mechanics of Composite Materials &amp", "MSM.. Mechanics of Structures and Machines", "MTDM. Mechanics of Time-Dependent Materials", "MeReC Mechanics Research Communications",@@ -2466,10 +2488,11 @@ "MmBAA Memoirs of the British Astronomical Association", "MmRAS Memoirs of the Royal Astronomical Society", "MmSAI Memorie della Societa Astronomica Italiana",-"MSAIS Memorie della Societa Astronomica Italiana Supplement",+"MSAIS Memorie della Societa Astronomica Italiana Supplementi", "MmSSI Memorie della Societa Degli Spettroscopisti Italiani", "MmSS. Memorie della Societa Degli Spettroscopisti Italiani, serie 2", "MmNap Memorie del R. Osservatorio di Capodimonte in Napoli",+"ska..mSKA memos", "MeCom Mendeleev Communications", "Mercu Mercury", "MeAut Meres es Automatika",@@ -2487,8 +2510,6 @@ "Metit Meteorites", "Met.. Meteorite - The International Quarterly of Meteorites and Meteorite Science", "Metic Meteoritics",-"M&PS. Meteoritics and Planetary Science",-"M&PSA Meteoritics and Planetary Science Supplement", "Metik Meteoritika", "MetRR Meteornoe Rasprostranenie Radiovoln", "MetIs Meteornye Issledovaniia",@@ -2506,6 +2527,7 @@ "MetHy Meteorology Hydrology JPRS", "MVMP. Methoden und Verfahren der Mathematischen Physik", "MCME. Methods: A Companion to Methods in Enzymology",+"MApAn Methods and Applications of Analysis", "MComP Methods in Computational Physics", "MGG.. Methods in Geochemistry and Geophysics", "MSB.. Methods in Subnuclear Physics",@@ -2581,7 +2603,6 @@ "MNRAS Monthly Notices of the Royal Astronomical Society", "MWRv. Monthly Weather Review", "Moon. Moon",-"M&P.. Moon and Planets", "MorGI Morskie Gidrofizicheskie Issledovaniia", "MAtom Moscow Atomizdat", "MoEBA Moscow Energoatomizdat Biblioteka Automatike",@@ -2680,6 +2701,7 @@ "NatH. Natural History", "Natur Nature", "NatCh Nature Chemistry",+"NatGe Nature Geoscience", "NatMa Nature Materials", "NatNa Nature Nanotechnology", "NaPho Nature Photonics",@@ -2708,13 +2730,13 @@ "ASNYN News Letter of the Astronomical Society of New York", "ICHIN Newsletters of the Interdivisional Commission on History of the IAGA", "NTN.. New Technology News",-"NYASA New York Academy Sciences Annals", "NZJGG New Zealand Journal Geology and Geophysics", "NZJS. New Zealand Journal of Science", "NOHIC Nizamiah JAPAL Rangapur Observatories Hyderabad India Contributions", "NizRe Nizamiah Observatory Reprints", "NCE.. Noise Control Engineering Journal", "NDTE. Nondestructive Testing and Evaluation",+"NDTI. Nondestructive Testing and Evaluation International", "NTCo. Nondestructive Testing Communications", "NPPSB Nonequilibrium Problems in the Physical Sciences and Biology", "NATM. Nonlinear Analysis Theory Methods Applications",@@ -2727,7 +2749,6 @@ "NHCWP North Hollywood Calif Western Periodicals Co", "NPUJ. Northwestern Polytechnical University Journal", "NoDef Not Defined",-"NRA&A Nouvelle Revue d'Aeronautique et d'Astronautique", "NROpt Nouvelle Revue d'Optique", "NROA. Nouvelle Revue d'Optique Appliquee", "UGC.. Nova Acta Regiae Soc. Sci. Upsaliensis Ser. V",@@ -2767,16 +2788,17 @@ "NCimL Nuovo Cimento Lettere", "NCimR Nuovo Cimento Rivista Serie", "NCimS Nuovo Cimento Serie",+"OSUC. Observationes Astronomicas Insitutas in Specula Universitatis Caesareae Dorpatensis", "OVS.. Observation of Variable Stars", "Obser Observation pi", "OAORP Observations astronomiques faites a l'Observatoire royal de Paris",-"O&T.. Observations et Travaux", "USNOO Observations made at the U.S. Naval Observatory", "USNOY Observations made at the U.S. Naval Observatory during the Year", "OOVRO Observations Owens Valley Radio Observatory", "Bes1K Observatoire de Besancon", "OBN1K Observatoire de Besancon - CNES", "Gen1K Observatoire de Geneve",+"OSFOT Observatoire de la Société Astronomique de France Observations et Travaux", "LyoRe Observatoire de Lyon Reprints", "Meu1K Observatoire de Meudon", "Nic1K Observatoire de Nice",@@ -2823,6 +2845,7 @@ "OptRv Optical Review", "OpSCN Optical Sciences Center Newsletter", "OSAJI Optical Society of America Journal Optics and Image Science",+"OptPN Optics &amp", "OptLE Optics and Lasers in Engineering", "OptSp Optics and Spectroscopy", "OptCo Optics Communications",@@ -2830,7 +2853,6 @@ "OptLT Optics Laser Technology", "OptL. Optics Letters", "OptN. Optics News",-"OptPN Optics & Photonics News", "Optik Optik", "OpAt. Optika Atmosfery", "OpAtO Optika Atmosfery i Okeana",@@ -2843,7 +2865,7 @@ "OrGeo Organic Geochemistry", "OrLi. Origins of Life", "OLEB. Origins of Life and Evolution of the Biosphere",-"Orion Orion: Zeitschrift f&uuml",+"Orion Orion: Zeitschrift für Amateur-Astronomie", "IGS.. Orlando FL Academic Press Inc International Geophysics Series", "OrNav Ortung und Navigation", "BuENS Osaka Prefecture University Bulletin Series Engineering Natural Sciences",@@ -2857,6 +2879,7 @@ "RomCo Osservatorio Astronomico di Roma su Monte Mario Contributi Scientifici", "TriP. Osservatorio Astronomico di Trieste Pubblicazioni", "TreP. Osservatorio Privato Specola Ariel Treviso Italia Pubblicazione",+"MmArc Osservazioni e memorie dell'Osservatorio astrofisico di Arcetri", "OsCar Osteoarthritis and Cartilage", "OtObI Otbor i Obrabotka Informatsii", "OtPI. Otbor i Peredacha Informatsii",@@ -2864,10 +2887,11 @@ "OISTS Oxford Pergamon Press International Tables Selected Constants", "OxfOO Oxford University Observatory Observations", "OxM.. Oxidation of Metals",-"OzSE. Ozone: Science & Engineering",+"OzSE. Ozone: Science &amp", "Palb. Paleobiology", "PalOc Paleoceanography", "PMetR Papers in Meteorological Research",+"PPh.. Papers in Physics", "PMG.. Papers Meteorology Geophysics", "ParC. Parallel Computing", "Paras Parasitology",@@ -2902,6 +2926,7 @@ "Psyn. Photosynthetica", "Phy.. Physica", "PhyA. Physica A Statistical Mechanics and its Applications",+"PhyBC Physica B+C", "PhyB. Physica B Condensed Matter", "PhyC. Physica C Superconductivity", "PhyD. Physica D Nonlinear Phenomena",@@ -2987,12 +3012,13 @@ "PhSS. Physics of the Solid State", "PTF.. Physics of Thin Films", "PhR.. Physics Reports",+"PRI.. Physics Research International", "PhT.. Physics Today", "PhyU. Physics Uspekhi", "PhyW. Physics World", "PCTM. Physikalisch-Chemische Trenn- und Messmethoden", "PhyG. Physikalische Gesellschaft",-"PhyGZ Physikalische Gesellschaft Z&uuml",+"PhyGZ Physikalische Gesellschaft Zürich", "PhyZ. Physikalische Zeitschrift", "PKM.. Physik der Kondensierten Materie", "PhuZ. Physik in unserer Zeit",@@ -3002,7 +3028,6 @@ "PAZh. Pis ma Astronomicheskii Zhurnal", "PZETF Pis ma Zhurnal Eksperimental noi i Teoreticheskoi Fiziki", "PZhTF Pis ma Zhurnal Tekhnischeskoi Fiziki",-"P&SS. Planetary and Space Science", "PlAst Planetary Astronomy", "PlR.. Planetary Report", "PSRD. Planetary Science Research Discoveries",@@ -3012,11 +3037,18 @@ "PlPh. Plasma Physics", "PPCF. Plasma Physics and Controlled Fusion", "PlPhR Plasma Physics Reports",-"Pl&I. Plasmas and Ions", "PlPo. Plasmas and Polymers", "PlST. Plasma Science and Technology", "PSST. Plasma Sources Science Technology", "PRFVT Plastiques Renforces Fibres de Verre Textile",+"PLoSB PLoS Biology",+"PLoSC PLoS Clinical Trials",+"PLSCB PLoS Computational Biology",+"PLoSG PLoS Genetics",+"PLoSM PLoS Medicine",+"PLoSN PLoS Neglected Tropical Diseases",+"PLoSO PLoS ONE",+"PLoSP PLoS Pathogens", "PMCPA PMC Physics A", "PMCPB PMC Physics B", "PMCPC PMC Physics C",@@ -3059,6 +3091,7 @@ "PriMM Prikladnaia Matematika i Mekhanika", "PriMP Prikladnaia Matematika i Programmirovanie", "PriM. Prikladnaia Mekhanika",+"PPPLR Princeton Plasma Physics Laboratory Report", "Prir. Priroda", "Priv. Private Communication", "PrEM. Probabilistic Engineering Mechanics",@@ -3082,12 +3115,14 @@ "PAMS. Proceedings of the American Mathematical Society", "PAPhS Proceedings of the American Philosophical Society", "PASAu Proceedings of the Astronomical Society of Australia",+"PCAS. Proceedings of the California Academy of Sciences", "PEMS. Proceedings of the Edinburgh Mathematical Society", "PINSA Proceedings of the Indian National Science Academy Part A", "PINSB Proceedings of the Indian National Science Academy Part B", "PIGP. Proceedings of the Institute of General Physics, Adademy of the Sciences of Russia", "PIRE. Proceedings of the IRE", "PNAS. Proceedings of the National Academy of Science",+"PNSC. Proceedings of the National Science Council", "PNSBP Proceedings of the National Society of Black Physicists", "PPS.. Proceedings of the Physical Society", "PPSA. Proceedings of the Physical Society A",@@ -3097,7 +3132,7 @@ "PRNAS Proceedings of the Royal Netherlands Academy of Arts and Sciences", "PSEBM Proceedings of The Society for Experimental Biology and Medicine", "PrVP. Proceedings of Vibration Problems",-"PELIS Program: electronic library & information systems",+"PELIS Program: electronic library &amp", "PrAeS Progress in Aerospace Sciences", "PrAA. Progress in Astronautics and Aeronautics", "PABei Progress in Astronomy",@@ -3141,10 +3176,11 @@ "PCARS Publication of COMU Astrophysics Research Center", "PKAS. Publication of Korean Astronomical Society", "PPCAS Publication of the Pomona College Astronomical Society",-"PLAGL Publications de l'Institut d'Astronomie et de Geophysique Louvain",+"PIAGL Publications de l'Institut d'Astronomie et de Geophysique Georges Lemaitre", "POBeo Publications de l'Observatoire Astronomique de Beograd", "POBor Publications de l'Observatoire de l'Universite de Bordeaux", "POTou Publications de l'Observatoire de Toulouse",+"PLAGL Publications du Laboratoire d'Astronomie et de Geodesie de l'Universite de Louvain", "POBol Publications of dell'Osservatorio Astronomie de Bologna", "PLawO Publications of Laws Observatory, University of Missouri", "PLicO Publications of Lick Observatory",@@ -3176,7 +3212,6 @@ "PDAO. Publications of the Dominion Astrophysical Observatory Victoria", "PDO.. Publications of the Dominion Observatory Ottawa", "PDreO Publications of the Dresden Observatory",-"PF&CO Publications of the Flower and Cook Astronomical Observatory", "PFAO. Publications of the Flower Astronomical Observatory", "PGLO. Publications of the Goethe Link Observatory", "PGooO Publications of the Goodsell Observatory, Carleton College",@@ -3206,7 +3241,6 @@ "PUSNO Publications of the U.S. Naval Observatory Second Series", "PVVO. Publications of the Van Vleck Observatory", "PVasO Publications of the Vassar College Observatory",-"PW&SO Publications of the Warner & Swasey Observatory", "PWasO Publications of the Washburn Observatory", "PYerO Publications of the Yerkes Observatory", "PYunO Publications of the Yunnan Observatory",@@ -3214,19 +3248,20 @@ "PSCDS Publication Speciale du Centre de Donnees Stellaires", "POxf. Publications University of Oxford Department of Astrophysics", "PUS.. Public Understanding of Science",+"PKUJ. Publikationen der Kaiserlichen Universitaets-Sternwarte Jurjew", "PAIKH Publikationen des Astrophysikalischen Instituts Koenigstuhl-Heidelberg", "POPot Publikationen des Astrophysikalischen Observatoriums zu Potsdam", "PCopO Publikationer og mindre Meddeler fra Kobenhavns Observatorium", "PGAOI Pulkovo Glavnaia Astronomicheskaia Observatoriia Izvestiia",+"PApCh Pure &amp", "PApGe Pure and Applied Geophysics", "PApPh Pure and Applied Physics",-"PApCh Pure & Applied Chemistry", "PApOp Pure Applied Optics", "QUnJ. Qinghua University Journal", "QREI. Quality Reliability Engineering International",-"QuEle Quantitative Electronics", "QuFin Quantitative Finance", "QuSOp Quantum and Semiclassical Optics",+"QuEle Quantum Electronics", "QuOpt Quantum Optics", "quant.ArXiv Quantum Physics e-prints", "QJMAM Quarterly Journal of Mechanics and Applied Mathematics",@@ -3250,7 +3285,7 @@ "REEP. Radio Engineering and Electronic Physics", "RaF.. Radiofizika", "RaSol Radioizluchenie Solntsa",-"R&QE. Radiophysics and Quantum Electronics",+"RPRA. Radio Physics and Radio Astronomy", "RaRLJ Radio Research Laboratories Journal", "RaRLR Radio Research Laboratories Review", "RaSc. Radio Science",@@ -3280,6 +3315,7 @@ "RZh.. Referationyj Zhurnal", "RJEHM Regional Journal of Energy Heat and Mass Transfer", "RCD.. Regular and Chaotic Dynamics",+"RemS. Remote Sensing", "RSEMS Remote Sensing Electro Magnetic Spectrum", "RSEnv Remote Sensing of Environment", "RSQ.. Remote Sensing Quarterly",@@ -3300,16 +3336,19 @@ "ReNEv Research in Nondestructive Evaluation", "RSTEd Research in Science and Technological Education", "RScEd Research in Science Education",+"RJPh. Research Journal of Physics", "RLEMR Research Laboratory Engineering Materials Report", "RLPME Research Laboratory Precision Machinery Electronics Bulletin", "RLOpt Research Letters in Optics", "RLPhy Research Letters in Physics", "RMA.. Research Measurement Approach",-"RNOST Research News & Opportunities in Science and Theology",+"RNOST Research News &amp", "RRP.. Research Reports in Physics", "RTP.. Research Trends in Physics", "RNAO. Resultados del Observatorio Nacional Argentino", "ROCor Resultados del Observatorio Nacional Argentino en Cordoba",+"RAROC Results of Astronomical Observations made at the Royal Observatory, Cape of Good Hope",+"RMROC Results of Meridian Observations made at the Royal Observatory, Cape of Good Hope", "RDR.. Review of Derivatives Research", "RvPCJ Review of Physical Chemistry of Japan", "RvPT. Review of Physics in Technology",@@ -3381,7 +3420,6 @@ "CapMi Royal Observatory Cape Mimeogram", "CoRSE Royal Society Edinburgh Communications Physical Sciences", "RSEPS Royal Society of Edinburgh Proceedings Section",-"RSN&R Royal Society of London Notes & Records", "RSPTA Royal Society of London Philosophical Transactions Series A", "RSPTB Royal Society of London Philosophical Transactions Series B", "RSPT. Royal Society of London Philosophical Transactions Series I",@@ -3391,6 +3429,7 @@ "RoIn. Rozprawy Inzynierskie", "RoIET Rozprawy Inzynierskie Engineering Transactions", "Ruimt Ruimtevaart",+"RuCRv Russian Chemical Reviews", "RJET. Russian Journal of Engineering Thermophysics", "RJMP. Russian Journal of Mathematical Physics", "RJPC. Russian Journal Physical Chemistry",@@ -3419,7 +3458,6 @@ "STAdM Science and Technology of Advanced Materials", "SCSMP Science China Series Mathematics Physics Astronomy Technological Sciences", "SciDi Science Dimension",-"Sc&Ed Science & Education", "SciEd Science Education", "SFCh. Science Foundation in China", "ScChA Science in China A: Mathematics",@@ -3434,7 +3472,6 @@ "ScTEn Science of the Total Environment", "ScPr. Science Progress", "Scis. Sciences",-"Sc&Te Sciences et Techniques", "SciB. Scientia (Bologna)", "SciSn Scientia Sinica", "SSSMP Scientia Sinica Series Mathematical Physical Technical Sciences",@@ -3447,6 +3484,7 @@ "ScMM. Scripta Metallurgica et Materialia", "SedG. Sedimentary Geology", "Sedim Sedimentology",+"SeiKa Seikei-Kakou", "BSSA. Seismological Society America Bulletin", "SEGeo Seismology and Exploration Geophysics", "STSSP Selected Topics in Solid State Physics",@@ -3454,6 +3492,7 @@ "SeScT Semiconductor Science Technology", "SeSTS Semiconductor Science Technology Supplement", "TrKra Seminar Kraevym Zadacham Trudy",+"SCB.. Seminars in Cancer Biology", "SDia. Seminars in Dialysis", "GEOCS Semi-Regular Variables", "SenAR Sendai Astronomiaj Raportoj",@@ -3465,7 +3504,6 @@ "SeAcB Sensors and Actuators B Chemical", "SAERI Seoul Korea Atomic Energy Research Institute", "SanS. Separata Universidad de Chile Departamento de Astronomia Santiago",-"SS&T. Separation Science and Technology", "SerAJ Serbian Astronomical Journal", "AnShO Shanghai Observatory Annals", "SV... Shock and Vibration",@@ -3478,11 +3516,12 @@ "SJAM. SIAM Journal of Applied Mathematics", "SJCO. SIAM Journal of Control Optimization", "SJMA. SIAM Journal of Mathematical Analysis",-"SJNA. SIAM Journal of Numerical Analysis", "SJADS SIAM Journal on Applied Dynamical Systems",+"SJNA. SIAM Journal on Numerical Analysis", "SIAMR SIAM Review", "SiMaJ Siberian Mathematical Journal", "SiFTZ Sibirskii Fiziko Tekhnicheskii Zhurnal",+"SidM. Sidereal Messenger", "SIDPQ SID Proceedings Quarter", "SiFoE Siemens Forschungs und Entwicklungsberichte", "Sig.. Signal",@@ -3493,13 +3532,13 @@ "Situ. Situ", "SkInq Skeptical Inquirer", "SRT.. Skin Research and Technology",-"S&T.. Sky and Telescope", "SkyN. Sky News", "SlaOb Slaboproudy Obzor", "SBE.. Small Business Economics", "SMaS. Smart Material Structures", "Smith Smithsonian", "SCoA. Smithsonian Contributions to Astrophysics",+"SCoK. Smithsonian Contributions to Knowledge", "SmCES Smithsonian Contributions to the Earth Sciences", "SSS.. Social Studies of Science", "MSAIQ Societa Astronomica Italiana Memorie Quarter",@@ -3516,6 +3555,8 @@ "SoPh. Solar Physics", "SoSyR Solar System Research", "STERJ Solar Terrestrial and Environmental Research Japan",+"SolE. Solid Earth",+"SolED Solid Earth Discussions", "SMArc Solid Mechanics Archives", "SSCom Solid State Communications", "SSEle Solid State Electronics",@@ -3592,6 +3633,7 @@ "AtlSV Specola Astronomica Vaticana Atlas Stellarum Variabilium", "VatCo Specola Astronomica Vaticana Comunicazione", "VatMA Specola Astronomica Vaticana Miscellanea Astronomica",+"VatPS Specola Astronomica Vaticana Pubblicazioni Serie Seconda", "VatRS Specola Astronomica Vaticana Ricerche Spettroscopiche", "VatRA Specola Astronomica Vaticana Richerche Astronomiche", "AcSpe Spectrochimica Acta",@@ -3611,17 +3653,20 @@ "SSSyn Springer Verlag Springer Series on Synergetics", "SSWP. Springer Verlag Springer Series on Wave Phenomena", "SprRe Sproul Observatory Reprints",+"SrLJP Sri Lankan Journal of Physics", "SANUG Srpska Akademiia Nauka i Umetnosti Glas Odeljenje Tekhnichkikh Nauka",+"SRXPh SRX Physics", "StarD StarDate Magazine", "StSky Star Sky", "StMet Statistical Methodology",+"StaSc Statistical Science", "StCom Statistics and Computing", "StReL Staub Reinhaltung Luft", "SMSPS Stephan Mueller Special Publication Series",-"S&W.. Sterne und Weltraum", "Sterz Sternzeit Mitteilungen der Astrnomischen Vereinigungen Aachen", "IEWS. Stevenage Herts England Peter Peregrinus Ltd IEE Electromagnetic Waves Series", "SteRe Steward Observatory Reprints",+"TriTr STLE Tribology Transactions", "SAA.. Stochastic Analysis and Applications", "SHH.. Stochastic Hydrology and Hydraulics", "SSRp. Stochastics and Stochastics Reports",@@ -3723,6 +3768,9 @@ "Agrph The Astrograph", "Astr. The Astronomer", "ATel. The Astronomer's Telegram",+"AJ... The Astronomical Journal",+"ApJ.. The Astrophysical Journal",+"ApJS. The Astrophysical Journal Supplement Series", "BJHS. The British Journal for the History of Science", "BJPS. The British Journal for the Philosophy of Science", "BuSSA The Bulletin of the Seismological Society of America",@@ -3737,14 +3785,34 @@ "Neuro The Neuroscientist", "INGN. The Newsletter of the Isaac Newton Group of Telescopes", "Obs.. The Observatory",+"OAcJ. The Open Acoustics Journal",+"OAeEJ The Open Aerospace Engineering Journal", "OAPJ. The Open Applied Physics Journal", "OAJ.. The Open Astronomy Journal",+"OASJ. The Open Atmospheric Science Journal", "OCPJ. The Open Chemical Physics Journal", "OCMPJ The Open Condensed Matter Physics Journal",+"OGC.. The Open Geology Journal",+"OHC.. The Open Hydrology Journal",+"OMEJ. The Open Mechanical Engineering Journal",+"OMJ.. The Open Mechanics Journal",+"OMnJ. The Open Mineralogy Journal",+"OMPJ. The Open Mineral Processing Journal", "ONJ.. The Open Nanoscience Journal", "ONPPJ The Open Nuclear &amp",+"ONMJ. The Open Numerical Methods Journal",+"OOcJ. The Open Oceanagraphy Journalurnal",+"OOEJ. The Open Ocean Engineering Journal",+"OOJ.. The Open Optics Journal",+"OPalJ The Open Paleontology Journal", "OPCJ. The Open Physical Chemistry Journal", "OPPJ. The Open Plasma Physics Journal",+"ORSJ. The Open Remote Sensing Journal",+"OREJ. The Open Renewable Energy Journal",+"OSPJ. The Open Signal Processing Journal",+"OSpeJ The Open Spectroscopy Journal",+"OSuJ. The Open Superconductors Journal",+"OSSJ. The Open Surface Science Journal", "AcTC. Theoretica Chimica Acta", "ThApC Theoretical and Applied Climatology", "ThAFM Theoretical and Applied Fracture Mechanics",@@ -3756,10 +3824,9 @@ "PlJ.. The Plant Journal", "QJMat The Quarterly Journal of Mathematics", "RamJ. The Ramanujan Journal",-"RvE&S The Review of Economics and Statistics", "RvES. The Review of Economic Studies", "ThEng Thermal Engineering",-"Th&Ae Thermophysics and Aeromechanics",+"TSE.. Thermal Science and Engineering", "SJCLI The Scandinavian Journal of Clinical and Laboratory Investigation", "SciMo The Scientific Monthly", "TSF.. Thin Solid Films",@@ -3798,10 +3865,12 @@ "IAUTA Transactions of the International Astronomical Union, Series A", "IAUTB Transactions of the International Astronomical Union, Series B", "TIUCS Transactions of the International Union for Cooperation in Solar Research",+"TJSAI Transactions of the Japanese Society for Artificial Intelligence", "TLHSQ Transactions of the Literary and Historical Society of Quebec", "TrOS. Transactions of the Optical Society", "TPM.. Transport in Porous Media", "TTSP. Transport Theory and Statistical Physics",+"TvOC. Transvaal Observatory Circular", "TSSLW Travaux de la Societe des Sciences et des Letters de Wroclaw", "TOMar Travaux de l'Observatoire de Marseille", "TraGe Travaux Geophysiques",@@ -3896,6 +3965,7 @@ "VSD.. Vehicle System Dynamics", "VKAWA Verhandelingen der Koninklijke Akademie van Wetenschappen te Amsterdam", "VeWFS Veroeffentlichung der Wilhelm Foerster Sterwarte",+"ViHei Veroeffentlichungen der Badischen Landes-Sternwarte zu Heidelberg", "VeHei Veroeffentlichungen der Badischen Sternwarte zu Heidelberg", "VeGG. Veroeffentlichungen der Geod. Geophys", "VeKar Veroeffentlichungen der Grossherzoglichen Sternwarte zu Karlsruhe",@@ -3926,8 +3996,8 @@ "VISBD Vibration Inst Shock Vibration Digest", "VIAEA Vienna International Atomic Energy Agency", "VAG.. Vierteljahresschrift der Astronomischen Gesellschaft",-"VMed. Vierteljahrschrift f&uuml",-"VNG.. Vierteljahrsschrift der Naturforschenden Gesellschaft in Z&uuml",+"VMed. Vierteljahrschrift für Gerichtliche Medizin und Öffentliches Sanitätswesen",+"VNG.. Vierteljahrsschrift der Naturforschenden Gesellschaft in Zürich", "VilCo Villanova University Observatory Contributions", "VilOB Vilnius Astronomijos Observatorijos Biuletenis", "IzVil Vilnius Izdatel Mokslas",@@ -3978,7 +4048,6 @@ "VnPM. Vychislitel naia i Prikladnaia Matematika", "VnMP. Vychislitel nye Metody i Programmirovanie", "VyGeo Vyssha Geodeziia",-"W&S.. Waerme und Stoffuebertragung", "WarRe Warsaw University Reprints", "WasOA Washburn Observatory Astrophysics", "GMS.. Washington DC American Geophysical Union Geophysical Monograph Series",@@ -4019,6 +4088,7 @@ "ZAAC. Zeitschrift fur Anorganische und Allgemeine Chemie", "ZA... Zeitschrift fur Astrophysik", "ZEVGA Zeitschrift fur Eisenbahnwesen und Verkehrstechnik Glasers Annalen",+"ZEAPC Zeitschrift für Elektrochemie und Angewandte Physikalische Chemie", "ZFlu. Zeitschrift fur Flugwissenschaften", "ZFlWe Zeitschrift fur Flugwissenschaften und Weltraumforschung", "ZGm.. Zeitschrift fur Geomorphologie",@@ -4026,6 +4096,7 @@ "ZGeo. Zeitschrift fur Geophysik", "ZGlGl Zeitschrift fur Gletscherkunde und Glazialgeologie", "ZKri. Zeitschrift fur Kristallographie",+"ZMP.. Zeitschrift für Mathematik und Physik", "ZMetl Zeitschrift fur Metallkunde", "ZeMet Zeitschrift fur Meteorologie", "ZPhy. Zeitschrift fur Physik",@@ -4038,8 +4109,6 @@ "ZPhyB Zeitschrift fur Physik B Condensed Matter", "ZPhyC Zeitschrift fur Physik C Particles and Fields", "ZPhyD Zeitschrift fur Physik D Atoms Molecules Clusters",-"ZEAPC Zeitschrift f&uuml",-"ZMP.. Zeitschrift f&uuml", "ZNatA Zeitschrift Naturforschung Teil A", "ZNatB Zeitschrift Naturforschung Teil B", "ZePAN Zeitschrift Physik Atomic Nuclei",
+ bibutils/bibcore.c view
@@ -0,0 +1,587 @@+/*+ * bibcore.c+ *+ * Copyright (c) Chris Putnam 2005-2010+ *+ * Source code released under the GPL+ *+ */+#include <stdio.h>+#include <stdlib.h>+#include "bibutils.h"++/* internal includes */+#include "reftypes.h"+#include "newstr_conv.h"+#include "is_ws.h"++static void+bibl_duplicateparams( param *np, param *op )+{+	list_init( &(np->asis) );+	list_init( &(np->corps) );+	list_copy( &(np->asis), &(op->asis ) );+	list_copy( &(np->corps), &(op->corps ) );+	+	if ( !op->progname ) np->progname = NULL;+	else np->progname = strdup( op->progname );++	np->readformat = op->readformat;+	np->writeformat = op->writeformat;++	np->charsetin = op->charsetin;+	np->charsetin_src = op->charsetin_src;+	np->utf8in = op->utf8in;+	np->latexin = op->latexin;+	np->xmlin = op->xmlin;++	np->charsetout = op->charsetout;+	np->charsetout_src = op->charsetout_src;+	np->utf8out = op->utf8out;+	np->utf8bom = op->utf8bom;+	np->latexout = op->latexout;+	np->xmlout = op->xmlout;+	np->nosplittitle = op->nosplittitle;++	np->verbose = op->verbose;+	np->format_opts = op->format_opts;+	np->addcount = op->addcount;+	np->output_raw = op->output_raw;+	np->singlerefperfile = op->singlerefperfile;++	np->readf = op->readf;+	np->processf = op->processf;+	np->cleanf = op->cleanf;+	np->typef = op->typef;+	np->convertf = op->convertf;+	np->headerf = op->headerf;+	np->footerf = op->footerf;+	np->writef = op->writef;+	np->all = op->all;+	np->nall = op->nall;++}++static void+bibl_setreadparams( param *np, param *op )+{+	bibl_duplicateparams( np, op );+	np->utf8out = 1;+	np->charsetout = BIBL_CHARSET_UNICODE;+	np->charsetout_src = BIBL_SRC_DEFAULT;+	np->xmlout = 0;+	np->latexout = 0;+}++static void+bibl_setwriteparams( param *np, param *op )+{+	bibl_duplicateparams( np, op );+	np->xmlin = 0;+	np->latexin = 0;+	np->utf8in = 1;+	np->charsetin = BIBL_CHARSET_UNICODE;+	np->charsetin_src = BIBL_SRC_DEFAULT;+}++void+bibl_freeparams( param *p )+{+	list_free( &(p->asis) );+	list_free( &(p->corps) );+	if ( p->progname ) free( p->progname );+}++static void+bibl_readlist( list *pl, char *progname, char *filename )+{+	if ( !list_fill( pl, filename ) ) {+		fprintf( stderr, "%s: warning problems reading '%s' "+			"obtained %d elements\n", progname, filename,+			pl->n );+	}+}++void+bibl_readasis( param *p, char *filename )+{+	bibl_readlist( &(p->asis), p->progname, filename );+}++void+bibl_readcorps( param *p, char *filename )+{+	bibl_readlist( &(p->corps), p->progname, filename );+}++static void+bibl_addtolist( list *pl, char *entry )+{+	list_add( pl, entry );+}++void+bibl_addtoasis( param *p, char *entry )+{+	bibl_addtolist( &(p->asis), entry );+}++void+bibl_addtocorps( param *p, char *entry )+{+	bibl_addtolist( &(p->corps), entry );+}++void+bibl_reporterr( int err )+{+	fprintf( stderr, "Bibutils: " );+	switch( err ) {+		case BIBL_OK:+			fprintf( stderr, "No error." ); break;+		case BIBL_ERR_BADINPUT:+			fprintf( stderr, "Bad input." ); break;+		case BIBL_ERR_MEMERR:+			fprintf( stderr, "Memory error." ); break;+		case BIBL_ERR_CANTOPEN:+			fprintf( stderr, "Can't open." ); break;+		default:+			fprintf( stderr, "Cannot identify error code."); break;+	}+	fprintf( stderr, "\n" );+}++static int+bibl_illegalinmode( int mode )+{+	if ( mode < BIBL_FIRSTIN || mode > BIBL_LASTIN ) return 1;+	else return 0;+}++static int+bibl_illegaloutmode( int mode )+{+	if ( mode < BIBL_FIRSTOUT || mode > BIBL_LASTOUT ) return 1;+	else return 0;+}++void+bibl_verbose2( fields *info, char *filename, long nrefs )+{+	int i;+	fprintf( stderr, "======== %s %ld : converted\n", filename, nrefs );+	for ( i=0; i<info->nfields; ++i ) {+		fprintf( stderr, "'%s'='%s' level=%d\n", info->tag[i].data,+				info->data[i].data , info->level[i]);+	}+	fprintf( stderr, "\n" );+	fflush( stderr );+}++void+bibl_verbose1( fields *info, fields *orig, char *filename, long nrefs )+{+	int i;+	fprintf( stderr, "======== %s %ld : processed\n", filename, nrefs );+	for ( i=0; i<orig->nfields; ++i ) {+		fprintf( stderr, "'%s'='%s' level=%d\n", orig->tag[i].data,+				orig->data[i].data , orig->level[i]);+	}+	if ( info ) bibl_verbose2( info, filename, nrefs );+}++void+bibl_verbose0( bibl *bin )+{+	int i;+	for ( i=0; i<bin->nrefs; ++i )+		bibl_verbose2( bin->ref[i], "", i+1 );+}++static void+process_alwaysadd( fields *info, int reftype, param *r )+{+        char tag[512], data[512], *p, *q;+        int i, process, level;+        for ( i=0; i<r->all[reftype].ntags; ++i ) {+                process = ((r->all[reftype]).tags[i]).processingtype;+                if ( process!=ALWAYS ) continue;+                level   = ((r->all[reftype]).tags[i]).level;+                p = ((r->all[reftype]).tags[i]).newstr;+                q = tag;+                while ( p && *p && *p!='|' ) {+                        *q = *p;+                        q++;+                        p++;+                }+                *q = '\0';+                q = data;+                if ( p && *p=='|' ) p++;+                while ( p && *p ) {+                        *q = *p;+                        q++;+                        p++;+                }+                *q = '\0';+                fields_add( info, tag, data, level );+        }+}++static int+read_ref( FILE *fp, bibl *bin, char *filename, param *p )+{+	newstr reference, line;+	fields *ref;+	char buf[256]="";+	int nrefs = 0, bufpos = 0, fcharset;/* = CHARSET_UNKNOWN;*/+	newstr_init( &reference );+	newstr_init( &line );+	while ( p->readf( fp, buf, sizeof(buf), &bufpos, &line, &reference, &fcharset ) ) {+		if ( reference.len==0 ) continue;+		ref = fields_new();+		if ( !ref ) return BIBL_ERR_MEMERR;+		if ( p->processf( ref, reference.data, filename, nrefs+1 )){+			bibl_addref( bin, ref );+		} else {+			fields_free( ref );+			free( ref );+		}+		newstr_empty( &reference );+		if ( fcharset!=CHARSET_UNKNOWN ) {+			/* charset from file takes priority over default, but+			 * not user-specified */+			if ( p->charsetin_src!=BIBL_SRC_USER ) {+				p->charsetin_src = BIBL_SRC_FILE;+				p->charsetin = fcharset;+				if ( fcharset!=CHARSET_UNICODE ) p->utf8in = 0;+			}+		}+	}+	if ( p->charsetin==CHARSET_UNICODE ) p->utf8in = 1;+	newstr_free( &line );+	newstr_free( &reference );+	return BIBL_OK;+}++static void+bibl_fixcharsets( bibl *b, param *p )+{+	fields *ref;+	long i, j;+	int swap = 0;+	int latexout = p->latexout;+	int latexin  = p->latexin;+	for ( i=0; i<b->nrefs; ++i ) {+		ref = b->ref[i];+		for ( j=0; j<ref->nfields; ++j ) {+			if ( latexin || latexout ) {+				/* don't texify/detexify URL's and the like */+				if ( !strcasecmp( ref->tag[j].data, "DOI" ) ||+				     !strcasecmp( ref->tag[j].data, "URL" ) ||+				     !strcasecmp( ref->tag[j].data, "REFNUM" )){+					latexin  = 0;+					latexout = 0;+					swap = 1;+				}+			}+			newstr_convert( &(ref->data[j]),+				p->charsetin,  latexin,  p->utf8in,  +				p->xmlin,+				p->charsetout, latexout, p->utf8out, +				p->xmlout );+			if ( swap ) {+				swap = 0;+				latexin  = p->latexin;+				latexout = p->latexout;+			}+		}+	}+}++static int+build_refnum( fields *info, long nrefs )+{+	newstr refnum;+	char *p, num[512];+	int y, a;+	newstr_init( &refnum );+	y = fields_find( info, "YEAR", 0 );+	if ( y==-1 ) y = fields_find( info, "YEAR", -1 );+	if ( y==-1 ) y = fields_find( info, "PARTYEAR", -1 );+	a = fields_find( info, "AUTHOR", 0 );+	if ( a==-1 ) a = fields_find( info, "AUTHOR", -1 );+	if ( a==-1 ) a = fields_find( info, "AUTHOR:CORP", -1 );+	if ( a==-1 ) a = fields_find( info, "AUTHOR:ASIS", -1 );+	if ( a!=-1 && y!=-1 ) {+		p = info->data[a].data;+		while ( p && *p && *p!='|' )+			newstr_addchar( &refnum, *p++ );+		p = info->data[y].data;+		while ( p && *p && *p!=' ' && *p!='\t' )+			newstr_addchar( &refnum, *p++ );+	} else {+		sprintf( num, "%ld", nrefs );+		newstr_strcpy( &refnum, "ref" );+		newstr_strcat( &refnum, num );+	}+	fields_add( info, "REFNUM", refnum.data, 0 );+	newstr_free( &refnum );+	return fields_find( info, "REFNUM", 0 );+}++static void+bibl_checkrefid( bibl *b, param *p )+{+	fields *ref;+	long i;+	char buf[512];+	int n;+	for ( i=0; i<b->nrefs; ++i ) {+		ref = b->ref[i];+		n = fields_find( ref, "REFNUM", 0 );+		if ( n==-1 ) n = build_refnum( ref, i+1 );+		if ( p->addcount ) {+			sprintf( buf, "_%ld", i+1 );+			newstr_strcat( &(ref->data[n]), buf );+		}+	}+}++static int+generate_citekey( fields *info, int nref )+{+	newstr citekey;+	int n1, n2;+	char *p, buf[100];+	newstr_init( &citekey );+	n1 = fields_find( info, "AUTHOR", 0 );+	if ( n1==-1 ) n1 = fields_find( info, "AUTHOR", -1 );+	n2 = fields_find( info, "YEAR", 0 );+	if ( n2==-1 ) n2 = fields_find( info, "YEAR", -1 );+	if ( n2==-1 ) n2 = fields_find( info, "PARTYEAR", 0 );+	if ( n2==-1 ) n2 = fields_find( info, "PARTYEAR", -1 );+	if ( n1!=-1 && n2!=-1 ) {+		p = info->data[n1].data;+		while ( p && *p && *p!='|' ) {+			if ( !is_ws( *p ) ) newstr_addchar( &citekey, *p ); +			p++;+		}+		p = info->data[n2].data;+		while ( p && *p ) {+			if ( !is_ws( *p ) ) newstr_addchar( &citekey, *p );+			p++;+		}+		fields_add( info, "REFNUM", citekey.data, 0 );+	} else {+		sprintf( buf, "ref%d\n", nref );+		newstr_strcpy( &citekey, buf );+	}+	newstr_free( &citekey );+	return fields_find( info, "REFNUM", -1 );+}++static void+resolve_citekeys( bibl *b, list *citekeys, int *dup )+{+	char abc[]="abcdefghijklmnopqrstuvwxyz";+	newstr tmp;+	int nsame, ntmp, n, i, j;++	newstr_init( &tmp );++	for ( i=0; i<citekeys->n; ++i ) {+		if ( dup[i]==-1 ) continue;+		nsame = 0;+		for ( j=i; j<citekeys->n; ++j ) {+			if ( dup[j]!=i ) continue;+			newstr_newstrcpy( &tmp, &(citekeys->str[j]) );+			ntmp = nsame;+			while ( ntmp >= 26 ) {+				newstr_addchar( &tmp, 'a' );+					ntmp -= 26;+			}+			if ( ntmp<26 && ntmp>=0 )+			newstr_addchar( &tmp, abc[ntmp] );+			nsame++;+			dup[j] = -1;+			n = fields_find( b->ref[j], "REFNUM", -1 );+			if ( n!=-1 )+				newstr_newstrcpy(&((b->ref[j])->data[n]),&tmp);+		}+	}+	newstr_free( &tmp );+}++static void+get_citekeys( bibl *b, list *citekeys )+{+	fields *info;+	int i, n;+	for ( i=0; i<b->nrefs; ++i ) {+		info = b->ref[i];+		n = fields_find( info, "REFNUM", -1 );+		if ( n==-1 ) n = generate_citekey( info, i );+		if ( n!=-1 && info->data[n].data )+			list_add( citekeys, info->data[n].data );+		else+			list_add( citekeys, "" );+	}+}++static int +dup_citekeys( bibl *b, list *citekeys )+{+	int i, j, *dup, ndup=0;+	dup = ( int * ) malloc( sizeof( int ) * citekeys->n );+	if ( !dup ) return 0;+	for ( i=0; i<citekeys->n; ++i ) dup[i] = -1;+	for ( i=0; i<citekeys->n-1; ++i ) {+		if ( dup[i]!=-1 ) continue;+		for ( j=i+1; j<citekeys->n; ++j ) {+			if ( !strcmp( citekeys->str[i].data, +				citekeys->str[j].data ) ) {+					dup[i] = i;+					dup[j] = i;+					ndup++;+			}+		}+	}+	if ( ndup ) resolve_citekeys( b, citekeys, dup );+	free( dup );+	return ndup;+}++static void+uniqueify_citekeys( bibl *b )+{+	list citekeys;+	list_init( &citekeys );+	get_citekeys( b, &citekeys );+	dup_citekeys( b, &citekeys );+	list_free( &citekeys );+}++static int +convert_ref( bibl *bin, char *fname, bibl *bout, param *p )+{+	fields *rin, *rout;+	long i;+	int reftype;+	if ( p->cleanf ) p->cleanf( bin, p );+	for ( i=0; i<bin->nrefs; ++i ) {+		rin = bin->ref[i];+		rout = fields_new();+		if ( !rout ) return BIBL_ERR_MEMERR;+		if ( p->typef ) +			reftype = p->typef( rin, fname, i+1, p, p->all, p->nall );+		else reftype = 0;+		if ( p->all ) process_alwaysadd( rout, reftype, p );+		p->convertf( rin, rout, reftype, p, p->all, p->nall );+		if ( p->verbose ) +			bibl_verbose1( rout, rin, fname, i+1 );+		bibl_addref( bout, rout );+	}+	uniqueify_citekeys( bout );+	return BIBL_OK;+}++int+bibl_read( bibl *b, FILE *fp, char *filename, param *p )+{+	param lp;+	bibl bin;++	if ( !b ) return BIBL_ERR_BADINPUT;+	if ( !fp ) return BIBL_ERR_BADINPUT;+	if ( !p ) return BIBL_ERR_BADINPUT;+	if ( bibl_illegalinmode( p->readformat ) ) return BIBL_ERR_BADINPUT;++	bibl_setreadparams( &lp, p );+	bibl_init( &bin );+	read_ref( fp, &bin, filename, &lp );+	if ( !lp.output_raw || ( lp.output_raw & BIBL_RAW_WITHCHARCONVERT ) )+		bibl_fixcharsets( &bin, &lp );+	if ( !lp.output_raw )+		convert_ref( &bin, filename, b, &lp );+	else {+		if ( p->verbose > 1 ) bibl_verbose0( &bin );+		bibl_copy( b, &bin );+	}+	if ( !lp.output_raw || ( lp.output_raw & BIBL_RAW_WITHMAKEREFID ) )+		bibl_checkrefid( b, &lp );+	bibl_free( &bin );++	return BIBL_OK;+}++static FILE *+singlerefname( fields *reffields, long nref, int mode )+{+	char outfile[2048];+	char suffix[5] = "xml";+	FILE *fp;+	long count;+	int  found;+	if ( mode==BIBL_BIBTEXOUT ) strcpy( suffix, "bib" );+	else if ( mode==BIBL_RISOUT ) strcpy( suffix, "ris" );+	else if ( mode==BIBL_ENDNOTEOUT ) strcpy( suffix, "end" );+	else if ( mode==BIBL_ADSABSOUT ) strcpy( suffix, "ads" );+	found = fields_find( reffields, "REFNUM", 0 );+	/* find new filename based on reference */+	if ( found!=-1 ) {+		sprintf( outfile,"%s.%s",reffields->data[found].data, suffix );+	} else  sprintf( outfile,"%ld.%s",nref, suffix );+	count = 0;+	fp = fopen( outfile, "r" );+	while ( fp ) {+		fclose(fp);+		count++;+		if ( count==60000 ) return NULL;+		if ( found!=-1 )+			sprintf( outfile, "%s_%ld.%s", +				reffields->data[found].data, count, suffix  );+		else sprintf( outfile,"%ld_%ld.%s",nref, count, suffix );+		fp = fopen( outfile, "r" );+	}+	return fopen( outfile, "w" );+}++static int+output_bibl( FILE *fp, bibl *b, param *p )+{+	long i;+	if ( !p->singlerefperfile && p->headerf ) p->headerf( fp, p );+	for ( i=0; i<b->nrefs; ++i ) {+		if ( p->singlerefperfile ) { +			fp = singlerefname( b->ref[i], i, p->writeformat );+			if ( fp ) {+				if ( p->headerf ) p->headerf( fp, p );+			} else return BIBL_ERR_CANTOPEN;+		}+		p->writef( b->ref[i], fp, p, i );+		if ( p->singlerefperfile ) {+			if ( p->footerf ) p->footerf( fp );+			fclose( fp );+		}+	}+	if ( !p->singlerefperfile && p->footerf ) p->footerf( fp );+	return 1;+}++int+bibl_write( bibl *b, FILE *fp, param *p )+{+	param lp;++	if ( !b ) return BIBL_ERR_BADINPUT;+	if ( !p ) return BIBL_ERR_BADINPUT;+	if ( bibl_illegaloutmode( p->writeformat ) ) return BIBL_ERR_BADINPUT;+	if ( !fp && ( !p || !p->singlerefperfile ) ) return BIBL_ERR_BADINPUT;++	bibl_setwriteparams( &lp, p );+	bibl_fixcharsets( b, &lp );+	output_bibl( fp, b, &lp );++	return BIBL_OK;+}+
bibutils/bibl.c view
@@ -1,7 +1,7 @@ /*  * bibl.c  *- * Copyright (c) Chris Putnam 2005-2009+ * Copyright (c) Chris Putnam 2005-2010  *  * Source code released under the GPL  *
bibutils/bibl.h view
@@ -1,7 +1,7 @@ /*  * bibl.h  *- * Copyright (c) Chris Putnam 2005-9+ * Copyright (c) Chris Putnam 2005-10  *  */ #ifndef BIBL_H
bibutils/biblatexin.c view
@@ -1,7 +1,8 @@ /*  * biblatexin.c  *- * Copyright (c) Chris Putnam 2008-2009+ * Copyright (c) Chris Putnam 2008-2010+ * Copyright (c) Johannes Wilm 2010  *  * Program and source code released under the GPL  *@@ -20,6 +21,35 @@ #include "reftypes.h" #include "biblatexin.h" +void+biblatexin_initparams( param *p, const char *progname )+{+	p->readformat       = BIBL_BIBLATEXIN;+	p->charsetin        = BIBL_CHARSET_DEFAULT;+	p->charsetin_src    = BIBL_SRC_DEFAULT;+	p->latexin          = 1;+	p->xmlin            = 0;+	p->utf8in           = 0;+	p->nosplittitle     = 0;+	p->verbose          = 0;+	p->addcount         = 0;+	p->output_raw       = 0;++	p->readf    = biblatexin_readf;+	p->processf = biblatexin_processf;+	p->cleanf   = biblatexin_cleanf;+	p->typef    = biblatexin_typef;+	p->convertf = biblatexin_convertf;+	p->all      = biblatex_all;+	p->nall     = biblatex_nall;++	list_init( &(p->asis) );+	list_init( &(p->corps) );++	if ( !progname ) p->progname = NULL;+	else p->progname = strdup( progname );+}+ /*  * readf can "read too far", so we store this information in line, thus  * the next new text is in line, either from having read too far or@@ -76,7 +106,7 @@ 			if ( *p==',' || *p=='=' || *p=='}' || *p==')' ) 				goto out; 		}-		if ( *p=='\"' && *(p-1)!='\\') {+		if ( *p=='\"' && *(p-1)!='\\' && nbrackets==0 ) { 			nquotes = ( nquotes==0 ); 			newstr_addchar( s, *p ); 		} else if ( *p=='{' ) {@@ -262,7 +292,7 @@ 	newstr tag, data; 	newstrs_init( &tag, &data, NULL ); 	p = process_biblatextype( p, &data );-	if ( data.len ) fields_add( bibin, "TYPE", data.data, 0 );+	if ( data.len ) fields_add( bibin, "INTERNAL_TYPE", data.data, 0 ); 	if ( *p ) p = process_biblatexid ( p, &data ); 	if ( data.len ) fields_add( bibin, "REFNUM", data.data, 0 ); 	newstr_empty( &data );@@ -375,13 +405,13 @@ #endif			 			continue; 		}-		ntype = fields_find( bin->ref[i], "TYPE", -1 );+		ntype = fields_find( bin->ref[i], "INTERNAL_TYPE", -1 ); 		type = bin->ref[i]->data[ntype].data; 		fields_setused( bin->ref[i], n ); /*		bin->ref[i]->used[n] = 1; */ 		for ( j=0; j<bin->ref[ncross]->nfields; ++j ) { 			nt = bin->ref[ncross]->tag[j].data;-			if ( !strcasecmp( nt, "TYPE" ) ) continue;+			if ( !strcasecmp( nt, "INTERNAL_TYPE" ) ) continue; 			if ( !strcasecmp( nt, "REFNUM" ) ) continue; 			if ( !strcasecmp( nt, "TITLE" ) ) { 				if ( !strcasecmp( type, "Inproceedings" ) ||@@ -471,22 +501,92 @@ }  static void-process_url( fields *info, char *p, int level )+process_urlcore( fields *info, char *p, int level, char *default_tag ) { 	if ( !strncasecmp( p, "\\urllink", 8 ) ) 		fields_add( info, "URL", p+8, level ); 	else if ( !strncasecmp( p, "\\url", 4 ) ) 		fields_add( info, "URL", p+4, level );-	else fields_add( info, "URL", p, level );+	else if ( !strncasecmp( p, "arXiv:", 6 ) )+		fields_add( info, "ARXIV", p+6, level ); +	else if ( !strncasecmp( p, "http://arxiv.org/abs/", 21 ) )+		fields_add( info, "ARXIV", p+21, level );+	else if ( !strncasecmp( p, "http:", 5 ) )+		fields_add( info, "URL", p, level );+	else fields_add( info, default_tag, p, level ); } +static void+process_url( fields *info, char *p, int level )+{+	process_urlcore( info, p, level, "URL" );+}++static void+process_howpublished( fields *info, char *p, int level )+{+        /* Some users put Diploma thesis in "type" */+        if ( !strncasecmp( p, "Diplom", 6 ) )+                fields_replace_or_add( info, "GENRE", "Diploma thesis", level );+        else if ( !strncasecmp( p, "Habilitation", 13 ) )+                fields_replace_or_add( info, "GENRE", "Habilitation thesis", level );+        else +		process_urlcore( info, p, level, "DESCRIPTION" );+}++static void+process_genre( fields *info, char *p, int level )+{+        /* Some users put Diploma thesis in "type" */+        if ( !strncasecmp( p, "Diplom", 6 ) )+                fields_replace_or_add( info, "GENRE", "Diploma thesis", level );+        else if ( !strncasecmp( p, "Habilitation", 13 ) )+                fields_replace_or_add( info, "GENRE", "Habilitation thesis", level );+        else +		fields_add( info, "GENRE", p, level );+}++static void+process_eprint( fields *bibin, fields *info, int level )+{+	int neprint, netype;+	char *eprint = NULL, *etype = NULL;+	neprint = fields_find( bibin, "eprint", -1 );+	netype  = fields_find( bibin, "eprinttype", -1 );+	if ( neprint!=-1 ) eprint = bibin->data[neprint].data;+	if ( netype!=-1 ) etype = bibin->data[netype].data;+fprintf(stderr,"process_eprint: neprint=%d netype=%d\n", neprint,netype );+	if ( eprint && etype ) {+		if ( !strncasecmp( etype, "arxiv", 5 ) )+			fields_add( info, "ARXIV", eprint, level );+		else if ( !strncasecmp( etype, "jstor", 5 ) )+			fields_add( info, "JSTOR", eprint, level );+		else if ( !strncasecmp( etype, "pubmed", 6 ) )+			fields_add( info, "PMID", eprint, level );+		else if ( !strncasecmp( etype, "medline", 7 ) )+			fields_add( info, "MEDLINE", eprint, level );+		else {+			fields_add( info, "EPRINT", eprint, level );+			fields_add( info, "EPRINTTYPE", etype, level );+		}+		fields_setused( bibin, neprint );+		fields_setused( bibin, netype );+	} else if ( eprint ) {+		fields_add( info, "EPRINT", eprint, level );+		fields_setused( bibin, neprint );+	} else if ( etype ) {+		fields_add( info, "EPRINTTYPE", etype, level );+		fields_setused( bibin, netype );+	}+}+ int biblatexin_typef( fields *bibin, char *filename, int nrefs, param *p, 		variants *all, int nall ) { 	char *refnum = ""; 	int reftype, n, nrefnum;-	n = fields_find( bibin, "TYPE", 0 );+	n = fields_find( bibin, "INTERNAL_TYPE", 0 ); 	nrefnum = fields_find( bibin, "REFNUM", 0 ); 	if ( nrefnum!=-1 ) refnum = (bibin->data[nrefnum]).data; 	if ( n!=-1 )@@ -511,7 +611,7 @@ static void biblatexin_notag( param *p, char *tag ) {-	if ( p->verbose && strcmp( tag, "TYPE" ) ) {+	if ( p->verbose && strcmp( tag, "INTERNAL_TYPE" ) ) { 		if ( p->progname ) fprintf( stderr, "%s: ", p->progname ); 		fprintf( stderr, " Cannot find tag '%s'\n", tag ); 	}@@ -525,20 +625,27 @@ 	int process, level, i, n; 	char *newtag; 	for ( i=0; i<bibin->nfields; ++i ) {++               /* skip ones already "used" such as successful crossref */+                if ( bibin->used[i] ) continue;++		/* skip ones with no data */ 		d = &( bibin->data[i] );-		if ( d->len == 0 ) continue; /* skip ones with no data */-		/* skip ones already "used" such as successful crossref */-		if ( bibin->used[i] ) continue;+		if ( d->len == 0 ) continue;+ 		t = &( bibin->tag[i] ); 		n = process_findoldtag( t->data, reftype, all, nall ); 		if ( n==-1 ) { 			biblatexin_notag( p, t->data ); 			continue; 		}+ 		process = ((all[reftype]).tags[n]).processingtype;-		if ( process == ALWAYS ) continue; /* add these later */+		if ( process == ALWAYS ) continue; /* added before */+ 		level   = ((all[reftype]).tags[n]).level; 		newtag  = ((all[reftype]).tags[n]).newstr;+ 		if ( process==SIMPLE || process==TITLE ) 			fields_add( info, newtag, d->data, level ); 		else if ( process==PERSON )@@ -546,8 +653,14 @@ 				&(p->corps) ); 		else if ( process==PAGES ) 			process_pages( info, d, level);+		else if ( process==HOWPUBLISHED )+			process_howpublished( info, d->data, level ); 		else if ( process==BIBTEX_URL ) 			process_url( info, d->data, level );+		else if ( process==BIBTEX_GENRE )+			process_genre( info, d->data, level );+		else if ( process==BIBTEX_EPRINT )+			process_eprint( bibin, info, level ); 	} 	if ( p->verbose ) report( info ); }
bibutils/biblatexin.h view
@@ -1,7 +1,7 @@ /*  * biblatexin.h  *- * Copyright (c) Chris Putnam 2008-9+ * Copyright (c) Chris Putnam 2008-2010  *  * Program and source code released under the GPL  *@@ -23,6 +23,7 @@ extern int  biblatexin_typef( fields *bibin, char *filename, int nrefs,         param *p, variants *all, int nall ); +extern void biblatexin_initparams( param *p, const char *progname );  extern variants biblatex_all[]; extern int biblatex_nall;
bibutils/bibtexin.c view
@@ -1,7 +1,7 @@ /*  * bibtexin.c  *- * Copyright (c) Chris Putnam 2003-2009+ * Copyright (c) Chris Putnam 2003-2010  *  * Program and source code released under the GPL  *@@ -24,6 +24,35 @@ list find    = { 0, 0, 0, NULL }; list replace = { 0, 0, 0, NULL }; +void+bibtexin_initparams( param *p, const char *progname )+{+	p->readformat       = BIBL_BIBTEXIN;+	p->charsetin        = BIBL_CHARSET_DEFAULT;+	p->charsetin_src    = BIBL_SRC_DEFAULT;+	p->latexin          = 1;+	p->xmlin            = 0;+	p->utf8in           = 0;+	p->nosplittitle     = 0;+	p->verbose          = 0;+	p->addcount         = 0;+	p->output_raw       = 0;++	p->readf    = bibtexin_readf;+	p->processf = bibtexin_processf;+	p->cleanf   = bibtexin_cleanf;+	p->typef    = bibtexin_typef;+	p->convertf = bibtexin_convertf;+	p->all      = bibtex_all;+	p->nall     = bibtex_nall;++	list_init( &(p->asis) );+	list_init( &(p->corps) );++	if ( !progname ) p->progname = NULL;+	else p->progname = strdup( progname );+}+ /*  * readf can "read too far", so we store this information in line, thus  * the next new text is in line, either from having read too far or@@ -88,7 +117,7 @@ 			if ( *p==',' || *p=='=' || *p=='}' || *p==')' ) 				goto out; 		}-		if ( *p=='\"' && *(p-1)!='\\') {+		if ( *p=='\"' && *(p-1)!='\\' && nbrackets==0 ) { 			nquotes = ( nquotes==0 ); 			newstr_addchar( s, *p ); 		} else if ( *p=='{' ) {@@ -317,7 +346,7 @@ 	newstr tag, data; 	newstrs_init( &tag, &data, NULL ); 	p = process_bibtextype( p, &data );-	if ( data.len ) fields_add( bibin, "TYPE", data.data, 0 );+	if ( data.len ) fields_add( bibin, "INTERNAL_TYPE", data.data, 0 ); 	if ( *p ) p = process_bibtexid ( p, &data ); 	if ( data.len ) fields_add( bibin, "REFNUM", data.data, 0 ); 	newstr_empty( &data );@@ -439,13 +468,13 @@ 			bibtexin_nocrossref( bin, i, n, p ); 			continue; 		}-		ntype = fields_find( bin->ref[i], "TYPE", -1 );+		ntype = fields_find( bin->ref[i], "INTERNAL_TYPE", -1 ); 		type = bin->ref[i]->data[ntype].data; 		fields_setused( bin->ref[i], n ); /*		bin->ref[i]->used[n] = 1; */ 		for ( j=0; j<bin->ref[ncross]->nfields; ++j ) { 			nt = bin->ref[ncross]->tag[j].data;-			if ( !strcasecmp( nt, "TYPE" ) ) continue;+			if ( !strcasecmp( nt, "INTERNAL_TYPE" ) ) continue; 			if ( !strcasecmp( nt, "REFNUM" ) ) continue; 			if ( !strcasecmp( nt, "TITLE" ) ) { 				if ( !strcasecmp( type, "Inproceedings" ) ||@@ -533,7 +562,7 @@ }  static void-process_url( fields *info, char *p, int level )+process_urlcore( fields *info, char *p, int level, char *default_tag ) { 	if ( !strncasecmp( p, "\\urllink", 8 ) ) 		fields_add( info, "URL", p+8, level );@@ -543,9 +572,29 @@ 		fields_add( info, "ARXIV", p+6, level );  	else if ( !strncasecmp( p, "http://arxiv.org/abs/", 21 ) ) 		fields_add( info, "ARXIV", p+21, level );-	else fields_add( info, "URL", p, level );+	else if ( !strncasecmp( p, "http:", 5 ) )+		fields_add( info, "URL", p, level );+	else fields_add( info, default_tag, p, level ); } +static void+process_url( fields *info, char *p, int level )+{+	process_urlcore( info, p, level, "URL" );+}++static void+process_howpublished( fields *info, char *p, int level )+{+	/* Some users put Diploma thesis in howpublished */+	if ( !strncasecmp( p, "Diplom", 6 ) )+		fields_replace_or_add( info, "GENRE", "Diploma thesis", level );+	else if ( !strncasecmp( p, "Habilitation", 13 ) )+		fields_replace_or_add( info, "GENRE", "Habilitation thesis", level );+	else +		process_urlcore( info, p, level, "DESCRIPTION" );+}+ /*  * sentelink = {file://localhost/full/path/to/file.pdf,Sente,PDF}  */@@ -580,7 +629,7 @@ { 	char *refnum = ""; 	int reftype, n, nrefnum;-	n = fields_find( bibin, "TYPE", 0 );+	n = fields_find( bibin, "INTERNAL_TYPE", 0 ); 	nrefnum = fields_find( bibin, "REFNUM", 0 ); 	if ( nrefnum!=-1 ) refnum = (bibin->data[nrefnum]).data; 	if ( n!=-1 )@@ -605,7 +654,7 @@ static void bibtexin_notag( param *p, char *tag ) {-	if ( p->verbose && strcmp( tag, "TYPE" ) ) {+	if ( p->verbose && strcmp( tag, "INTERNAL_TYPE" ) ) { 		if ( p->progname ) fprintf( stderr, "%s: ", p->progname ); 		fprintf( stderr, "Cannot find tag '%s'\n", tag ); 	}@@ -619,20 +668,28 @@ 	int process, level, i, n; 	char *newtag; 	for ( i=0; i<bibin->nfields; ++i ) {-		d = &( bibin->data[i] );-		if ( d->len == 0 ) continue; /* skip ones with no data */+ 		/* skip ones already "used" such as successful crossref */ 		if ( bibin->used[i] ) continue;++		/* skip ones with no data */+		d = &( bibin->data[i] );+		if ( d->len == 0 ) continue;+ 		t = &( bibin->tag[i] ); 		n = process_findoldtag( t->data, reftype, all, nall ); 		if ( n==-1 ) { 			bibtexin_notag( p, t->data ); 			continue; 		}++		/* skip ones of type ALWAYS (previously added) */ 		process = ((all[reftype]).tags[n]).processingtype;-		if ( process == ALWAYS ) continue; /* add these later */+		if ( process == ALWAYS ) continue;+ 		level   = ((all[reftype]).tags[n]).level; 		newtag  = ((all[reftype]).tags[n]).newstr;+ 		if ( process==SIMPLE ) 			fields_add( info, newtag, d->data, level ); 		else if ( process==TITLE )@@ -645,6 +702,8 @@ 			process_pages( info, d, level); 		else if ( process==BIBTEX_URL ) 			process_url( info, d->data, level );+		else if ( process==HOWPUBLISHED )+			process_howpublished( info, d->data, level ); 		else if ( process==BIBTEX_SENTE ) 			process_sente( info, d->data, level ); 		else if ( process==BIBTEX_FILE )
bibutils/bibtexin.h view
@@ -1,7 +1,7 @@ /*  * bibtexin.h  *- * Copyright (c) Chris Putnam 2003-2009+ * Copyright (c) Chris Putnam 2003-2010  *  * Program and source code released under the GPL  *@@ -22,6 +22,7 @@ extern int  bibtexin_readf( FILE *fp, char *buf, int bufsize, int *bufpos, newstr *line, newstr *reference, int *fcharset ); extern int  bibtexin_typef( fields *bibin, char *filename, int nrefs,         param *p, variants *all, int nall );+extern void bibtexin_initparams( param *p, const char *progname );   extern variants bibtex_all[];
bibutils/bibtexout.c view
@@ -1,7 +1,7 @@ /*  * bibtexout.c  *- * Copyright (c) Chris Putnam 2003-2009+ * Copyright (c) Chris Putnam 2003-2010  *  * Program and source code released under the GPL  *@@ -16,9 +16,33 @@ #include "xml.h" #include "fields.h" #include "bibl.h"-#include "bibtexout.h" #include "doi.h"+#include "bibtexout.h" +void+bibtexout_initparams( param *p, const char *progname )+{+	p->writeformat      = BIBL_BIBTEXOUT;+	p->format_opts      = 0;+	p->charsetout       = BIBL_CHARSET_DEFAULT;+	p->charsetout_src   = BIBL_SRC_DEFAULT;+	p->latexout         = 1;+	p->utf8out          = 0;+	p->utf8bom          = 0;+	p->xmlout           = 0;+	p->nosplittitle     = 0;+	p->verbose          = 0;+	p->addcount         = 0;+	p->singlerefperfile = 0;++	p->headerf = bibtexout_writeheader;+	p->footerf = NULL;+	p->writef  = bibtexout_write;++	if ( !p->progname && progname )+		p->progname = strdup( progname );+}+ enum { 	TYPE_UNKNOWN = 0, 	TYPE_ARTICLE,@@ -325,8 +349,16 @@ output_title( FILE *fp, fields *info, unsigned long refnum, char *bibtag, int level, int format_opts ) { 	newstr title;-	int n1 = fields_find( info, "TITLE", level );-	int n2 = fields_find( info, "SUBTITLE", level );+	int n1 = -1, n2 = -1;+	/* Option is for short titles of journals */+	if ( ( format_opts & BIBOUT_SHORTTITLE ) && level==1 ) {+		n1 = fields_find( info, "SHORTTITLE", level );+		n2 = fields_find( info, "SHORTSUBTITLE", level );+	}+	if ( n1==-1 ) {+		n1 = fields_find( info, "TITLE", level );+		n2 = fields_find( info, "SUBTITLE", level );+	} 	if ( n1!=-1 ) { 		newstr_init( &title ); 		newstr_newstrcpy( &title, &(info->data[n1]) );@@ -419,6 +451,20 @@ }  static void+output_jstor( FILE *fp, fields *info, int format_opts )+{+	int js = fields_find( info, "JSTOR", -1 );+	if ( js!=-1 ) {+		newstr jstor;+		newstr_init( &jstor );+		jstor_to_url( info, js, "URL", &jstor );+		if ( jstor.len )+			output_element( fp, "url", jstor.data, format_opts );+		newstr_free( &jstor );+	}+}++static void output_pages( FILE *fp, fields *info, unsigned long refnum, int format_opts ) { 	newstr pages;@@ -497,7 +543,8 @@ 	fields_clearused( info ); 	type = bibtexout_type( info, "", refnum, p ); 	output_type( fp, type, p->format_opts );-	output_citekey( fp, info, refnum, p->format_opts );+	if ( !( p->format_opts & BIBOUT_DROPKEY ) )+		output_citekey( fp, info, refnum, p->format_opts ); 	output_people( fp, info, refnum, "AUTHOR", "AUTHOR:CORP", "AUTHOR:ASIS", "author", 0, 		p->format_opts ); 	output_people( fp, info, refnum, "EDITOR", "EDITOR:CORP", "EDITOR:ASIS", "editor", -1,@@ -552,6 +599,7 @@ 	output_fileattach( fp, info, p->format_opts ); 	output_arxiv( fp, info, p->format_opts ); 	output_pmid( fp, info, p->format_opts );+	output_jstor( fp, info, p->format_opts ); 	output_simple( fp, info, "LANGUAGE", "language", p->format_opts ); 	if ( p->format_opts & BIBOUT_FINALCOMMA ) fprintf( fp, "," ); 	fprintf( fp, "\n}\n\n" );@@ -563,3 +611,4 @@ { 	if ( p->utf8bom ) utf8_writebom( outptr ); }+
bibutils/bibtexout.h view
@@ -1,7 +1,7 @@ /*  * bibtexout.h  *- * Copyright (c) Chris Putnam 2005-2009+ * Copyright (c) Chris Putnam 2005-2010  *  */ #ifndef BIBTEXOUT_H@@ -12,16 +12,18 @@ #include "bibutils.h"  /* bibtexout output options */-#define BIBOUT_FINALCOMMA (2)-#define BIBOUT_SINGLEDASH (4)-#define BIBOUT_WHITESPACE (8)-#define BIBOUT_BRACKETS  (16)-#define BIBOUT_UPPERCASE (32)-#define BIBOUT_STRICTKEY (64)+#define BIBOUT_FINALCOMMA   (2)+#define BIBOUT_SINGLEDASH   (4)+#define BIBOUT_WHITESPACE   (8)+#define BIBOUT_BRACKETS    (16)+#define BIBOUT_UPPERCASE   (32)+#define BIBOUT_STRICTKEY   (64)+#define BIBOUT_SHORTTITLE (128)+#define BIBOUT_DROPKEY    (256)  extern void bibtexout_write( fields *info, FILE *fp, param *p,  		unsigned long refnum ); extern void bibtexout_writeheader( FILE *outptr, param *p );-+extern void bibtexout_initparams( param *p, const char *progname );  #endif
bibutils/bibtextypes.c view
@@ -1,7 +1,7 @@ /*  * bibtypes.c  *- * Copyright (c) Chris Putnam 2003-2009+ * Copyright (c) Chris Putnam 2003-2010  *  * Program and source code released under the GPL  *@@ -37,18 +37,18 @@ 	{ "note",         "NOTES",     SIMPLE, LEVEL_MAIN }, 	{ "annote",       "ANNOTE",    SIMPLE, LEVEL_MAIN }, 	{ "location",     "LOCATION",  SIMPLE, LEVEL_MAIN },-	{ "ftp",          "URL",       BIBTEX_URL, LEVEL_MAIN },-	{ "url",          "URL",       BIBTEX_URL, LEVEL_MAIN },+	{ "ftp",          "",      BIBTEX_URL, LEVEL_MAIN },+	{ "url",          "",      BIBTEX_URL, LEVEL_MAIN }, 	{ "pdf",          "FILEATTACH",SIMPLE, LEVEL_MAIN }, 	{ "sentelink",    "FILEATTACH",BIBTEX_SENTE, LEVEL_MAIN }, 	{ "file",         "FILEATTACH",BIBTEX_FILE,  LEVEL_MAIN },-	{ "howpublished", "URL",       BIBTEX_URL, LEVEL_MAIN },+	{ "howpublished", "",       HOWPUBLISHED, LEVEL_MAIN }, 	{ "doi",          "DOI",       SIMPLE, LEVEL_MAIN }, 	{ "key",          "BIBKEY",       SIMPLE, LEVEL_MAIN }, 	{ "refnum",       "REFNUM",    SIMPLE, LEVEL_MAIN }, 	{ "crossref",     "CROSSREF",  SIMPLE, LEVEL_MAIN }, 	{ "keywords",     "KEYWORD",   SIMPLE, LEVEL_MAIN },-	{ " ",            "TYPE|ARTICLE",           ALWAYS, LEVEL_MAIN },+	{ " ",            "INTERNAL_TYPE|ARTICLE",           ALWAYS, LEVEL_MAIN }, 	{ " ",            "ISSUANCE|continuing",    ALWAYS, LEVEL_HOST }, 	{ " ",            "RESOURCE|text",          ALWAYS, LEVEL_MAIN }, 	{ " ",            "GENRE|periodical",       ALWAYS, LEVEL_HOST },@@ -81,21 +81,21 @@ 	{ "location",     "LOCATION",  SIMPLE, LEVEL_MAIN }, 	{ "note",         "NOTES",     SIMPLE, LEVEL_MAIN }, 	{ "annote",       "ANNOTE",    SIMPLE, LEVEL_MAIN },-	{ "type",         "TYPE",      SIMPLE, LEVEL_MAIN },+	{ "type",         "GENRE",     SIMPLE, LEVEL_MAIN }, 	{ "key",          "BIBKEY",    SIMPLE, LEVEL_MAIN },-	{ "ftp",          "URL",       BIBTEX_URL, LEVEL_MAIN },-	{ "url",          "URL",       BIBTEX_URL, LEVEL_MAIN },+	{ "ftp",          "",       BIBTEX_URL, LEVEL_MAIN },+	{ "url",          "",       BIBTEX_URL, LEVEL_MAIN }, 	{ "pdf",          "FILEATTACH",SIMPLE, LEVEL_MAIN }, 	{ "sentelink",    "FILEATTACH",BIBTEX_SENTE, LEVEL_MAIN }, 	{ "file",         "FILEATTACH",BIBTEX_FILE,  LEVEL_MAIN }, 	{ "address"       "ADDRESS",   SIMPLE, LEVEL_MAIN },-	{ "howpublished", "URL",       BIBTEX_URL, LEVEL_MAIN },+	{ "howpublished", "",       HOWPUBLISHED, LEVEL_MAIN }, 	{ "doi",          "DOI",       SIMPLE, LEVEL_MAIN }, 	{ "refnum",       "REFNUM",    SIMPLE, LEVEL_MAIN }, 	{ "crossref",     "CROSSREF",  SIMPLE, LEVEL_MAIN }, 	{ "keywords",     "KEYWORD",   SIMPLE, LEVEL_MAIN }, 	{ "refnum",       "REFNUM",    SIMPLE, LEVEL_MAIN },-	{ " ",            "TYPE|BOOK",     ALWAYS, LEVEL_MAIN },+	{ " ",            "INTERNAL_TYPE|BOOK",     ALWAYS, LEVEL_MAIN }, 	{ " ",            "RESOURCE|text", ALWAYS, LEVEL_MAIN }, 	{ " ",            "ISSUANCE|monographic", ALWAYS, LEVEL_MAIN }, 	{ " ",            "GENRE|book",    ALWAYS, LEVEL_MAIN }@@ -126,17 +126,17 @@ 	{ "annote",       "ANNOTE",    SIMPLE, LEVEL_MAIN }, 	{ "key",          "BIBKEY",          SIMPLE, LEVEL_MAIN }, 	{ "doi",          "DOI",          SIMPLE, LEVEL_MAIN },-	{ "ftp",          "URL",          BIBTEX_URL, LEVEL_MAIN },-	{ "url",          "URL",          BIBTEX_URL, LEVEL_MAIN },+	{ "ftp",          "",          BIBTEX_URL, LEVEL_MAIN },+	{ "url",          "",          BIBTEX_URL, LEVEL_MAIN }, 	{ "pdf",          "FILEATTACH",SIMPLE, LEVEL_MAIN }, 	{ "sentelink",    "FILEATTACH",BIBTEX_SENTE, LEVEL_MAIN }, 	{ "file",         "FILEATTACH",BIBTEX_FILE,  LEVEL_MAIN },-	{ "howpublished", "URL",          BIBTEX_URL, LEVEL_MAIN },+	{ "howpublished", "",          HOWPUBLISHED, LEVEL_MAIN }, 	{ "refnum",    "REFNUM",          SIMPLE, LEVEL_MAIN }, 	{ "crossref",     "CROSSREF",  SIMPLE, LEVEL_MAIN },-	{ "type",      "TYPE",            SIMPLE, LEVEL_MAIN },+	{ "type",      "GENRE",            SIMPLE, LEVEL_MAIN }, 	{ "keywords",     "KEYWORD",   SIMPLE, LEVEL_MAIN },-	{ " ",         "TYPE|REPORT",     ALWAYS, LEVEL_MAIN },+	{ " ",         "INTERNAL_TYPE|REPORT",     ALWAYS, LEVEL_MAIN }, 	{ " ",         "RESOURCE|text",   ALWAYS, LEVEL_MAIN }, 	{ " ",         "GENRE|report",    ALWAYS, LEVEL_MAIN } };@@ -163,17 +163,17 @@ 	{ "annote",       "ANNOTE",    SIMPLE, LEVEL_MAIN }, 	{ "key",          "BIBKEY",          SIMPLE, LEVEL_MAIN }, 	{ "doi",       "DOI",       SIMPLE, LEVEL_MAIN },-	{ "ftp",       "URL",       BIBTEX_URL, LEVEL_MAIN },-	{ "url",       "URL",       BIBTEX_URL, LEVEL_MAIN },+	{ "ftp",       "",       BIBTEX_URL, LEVEL_MAIN },+	{ "url",       "",       BIBTEX_URL, LEVEL_MAIN }, 	{ "pdf",          "FILEATTACH",SIMPLE, LEVEL_MAIN }, 	{ "sentelink",    "FILEATTACH",BIBTEX_SENTE, LEVEL_MAIN }, 	{ "file",         "FILEATTACH",BIBTEX_FILE,  LEVEL_MAIN },-	{ "howpublished", "URL",    BIBTEX_URL, LEVEL_MAIN },+	{ "howpublished", "",    HOWPUBLISHED, LEVEL_MAIN }, 	{ "language",     "LANGUAGE",  SIMPLE, LEVEL_MAIN }, 	{ "refnum",    "REFNUM",    SIMPLE, LEVEL_MAIN }, 	{ "crossref",     "CROSSREF",  SIMPLE, LEVEL_MAIN }, 	{ "keywords",     "KEYWORD",   SIMPLE, LEVEL_MAIN },-	{ " ",         "TYPE|REPORT",       ALWAYS, LEVEL_MAIN },+	{ " ",         "INTERNAL_TYPE|REPORT",       ALWAYS, LEVEL_MAIN }, 	{ " ",         "RESOURCE|text",     ALWAYS, LEVEL_MAIN }, 	{ " ",         "GENRE|instruction", ALWAYS, LEVEL_MAIN } };@@ -204,20 +204,20 @@ 	{ "language",     "LANGUAGE",     SIMPLE, LEVEL_MAIN }, 	{ "location",     "LOCATION",     SIMPLE, LEVEL_HOST }, 	{ "doi",       "DOI",       SIMPLE, LEVEL_MAIN },-	{ "ftp",       "URL",       BIBTEX_URL, LEVEL_MAIN },-	{ "url",       "URL",       BIBTEX_URL, LEVEL_MAIN },+	{ "ftp",       "",       BIBTEX_URL, LEVEL_MAIN },+	{ "url",       "",       BIBTEX_URL, LEVEL_MAIN }, 	{ "pdf",          "FILEATTACH",SIMPLE, LEVEL_MAIN }, 	{ "sentelink",    "FILEATTACH",BIBTEX_SENTE, LEVEL_MAIN }, 	{ "file",         "FILEATTACH",BIBTEX_FILE,  LEVEL_MAIN },-	{ "howpublished", "URL",    BIBTEX_URL, LEVEL_MAIN },+	{ "howpublished", "",    HOWPUBLISHED, LEVEL_MAIN }, 	{ "refnum",    "REFNUM",    SIMPLE, LEVEL_MAIN }, 	{ "crossref",     "CROSSREF",  SIMPLE, LEVEL_MAIN },-	{ "type",      "TYPE",      SIMPLE, LEVEL_MAIN },+	{ "type",      "GENRE",      SIMPLE, LEVEL_MAIN }, 	{ "note",         "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annote",       "ANNOTE",    SIMPLE, LEVEL_MAIN }, 	{ "key",          "BIBKEY",          SIMPLE, LEVEL_MAIN }, 	{ "keywords",     "KEYWORD",   SIMPLE, LEVEL_MAIN },-	{ " ",         "TYPE|INBOOK",   ALWAYS, LEVEL_MAIN },+	{ " ",         "INTERNAL_TYPE|INBOOK",   ALWAYS, LEVEL_MAIN }, 	{ " ",         "RESOURCE|text", ALWAYS, LEVEL_MAIN }, 	{ " ",         "ISSUANCE|monographic", ALWAYS, LEVEL_HOST }, 	{ " ",         "GENRE|book",    ALWAYS, LEVEL_HOST }@@ -249,20 +249,20 @@ 	{ "paper",     "PAPER",     SIMPLE, LEVEL_MAIN }, 	{ "location",     "LOCATION",     SIMPLE, LEVEL_HOST }, 	{ "doi",       "DOI",       SIMPLE, LEVEL_MAIN },-	{ "ftp",       "URL",       BIBTEX_URL, LEVEL_MAIN },-	{ "url",       "URL",       BIBTEX_URL, LEVEL_MAIN },+	{ "ftp",       "",       BIBTEX_URL, LEVEL_MAIN },+	{ "url",       "",       BIBTEX_URL, LEVEL_MAIN }, 	{ "pdf",          "FILEATTACH",SIMPLE, LEVEL_MAIN }, 	{ "sentelink",    "FILEATTACH",BIBTEX_SENTE, LEVEL_MAIN }, 	{ "file",         "FILEATTACH",BIBTEX_FILE,  LEVEL_MAIN },-	{ "type",      "TYPE",      SIMPLE, LEVEL_MAIN },+	{ "type",      "GENRE",      SIMPLE, LEVEL_MAIN }, 	{ "note",         "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annote",       "ANNOTE",    SIMPLE, LEVEL_MAIN }, 	{ "key",          "BIBKEY",          SIMPLE, LEVEL_MAIN },-	{ "howpublished", "URL",    BIBTEX_URL, LEVEL_MAIN },+	{ "howpublished", "",    HOWPUBLISHED, LEVEL_MAIN }, 	{ "refnum",    "REFNUM",    SIMPLE, LEVEL_MAIN }, 	{ "crossref",     "CROSSREF",  SIMPLE, LEVEL_MAIN }, 	{ "keywords",     "KEYWORD",   SIMPLE, LEVEL_MAIN },-	{ " ",         "TYPE|INPROCEEDINGS",  ALWAYS, LEVEL_MAIN },+	{ " ",         "INTERNAL_TYPE|INPROCEEDINGS",  ALWAYS, LEVEL_MAIN }, 	{ " ",         "RESOURCE|text",       ALWAYS, LEVEL_MAIN }, 	{ " ",         "GENRE|conference publication",   ALWAYS, LEVEL_HOST } };@@ -291,22 +291,22 @@ 	{ "abstract",  "ABSTRACT",  SIMPLE, LEVEL_MAIN }, 	{ "contents",  "CONTENTS",  SIMPLE, LEVEL_HOST }, 	{ "language",     "LANGUAGE",     SIMPLE, LEVEL_MAIN },-	{ "type",      "TYPE",      SIMPLE, LEVEL_MAIN },+	{ "type",      "GENRE",      SIMPLE, LEVEL_MAIN }, 	{ "note",         "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annote",       "ANNOTE",    SIMPLE, LEVEL_MAIN }, 	{ "key",          "BIBKEY",          SIMPLE, LEVEL_MAIN }, 	{ "doi",       "DOI",       SIMPLE, LEVEL_MAIN },-	{ "ftp",       "URL",       BIBTEX_URL, LEVEL_MAIN },-	{ "url",       "URL",       BIBTEX_URL, LEVEL_MAIN },+	{ "ftp",       "",       BIBTEX_URL, LEVEL_MAIN },+	{ "url",       "",       BIBTEX_URL, LEVEL_MAIN }, 	{ "pdf",          "FILEATTACH",SIMPLE, LEVEL_MAIN }, 	{ "sentelink",    "FILEATTACH",BIBTEX_SENTE, LEVEL_MAIN }, 	{ "file",         "FILEATTACH",BIBTEX_FILE,  LEVEL_MAIN }, 	{ "location",     "LOCATION",     SIMPLE, LEVEL_HOST },-	{ "howpublished", "URL",    BIBTEX_URL, LEVEL_MAIN },+	{ "howpublished", "",    HOWPUBLISHED, LEVEL_MAIN }, 	{ "refnum",    "REFNUM",    SIMPLE, LEVEL_MAIN }, 	{ "crossref",     "CROSSREF",  SIMPLE, LEVEL_MAIN }, 	{ "keywords",     "KEYWORD",   SIMPLE, LEVEL_MAIN },-	{ " ",         "TYPE|INCOLLECTION",   ALWAYS, LEVEL_MAIN },+	{ " ",         "INTERNAL_TYPE|INCOLLECTION",   ALWAYS, LEVEL_MAIN }, 	{ " ",         "RESOURCE|text", ALWAYS, LEVEL_MAIN }, 	{ " ",         "ISSUANCE|monographic", ALWAYS, LEVEL_MAIN }, 	{ " ",         "GENRE|collection",    ALWAYS, LEVEL_HOST }@@ -335,13 +335,13 @@ 	{ "abstract",  "ABSTRACT",  SIMPLE, LEVEL_MAIN }, 	{ "contents",  "CONTENTS",  SIMPLE, LEVEL_MAIN }, 	{ "doi",       "DOI",       SIMPLE, LEVEL_MAIN },-	{ "ftp",       "URL",       BIBTEX_URL, LEVEL_MAIN },-	{ "url",       "URL",       BIBTEX_URL, LEVEL_MAIN },+	{ "ftp",       "",       BIBTEX_URL, LEVEL_MAIN },+	{ "url",       "",       BIBTEX_URL, LEVEL_MAIN }, 	{ "pdf",          "FILEATTACH",SIMPLE, LEVEL_MAIN }, 	{ "sentelink",    "FILEATTACH",BIBTEX_SENTE, LEVEL_MAIN }, 	{ "file",         "FILEATTACH",BIBTEX_FILE,  LEVEL_MAIN }, 	{ "language",     "LANGUAGE",     SIMPLE, LEVEL_MAIN },-	{ "howpublished", "URL",    BIBTEX_URL, LEVEL_MAIN },+	{ "howpublished", "",    HOWPUBLISHED, LEVEL_MAIN }, 	{ "location",     "LOCATION",     SIMPLE, LEVEL_MAIN }, 	{ "note",         "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annote",       "ANNOTE",    SIMPLE, LEVEL_MAIN },@@ -349,7 +349,7 @@ 	{ "refnum",    "REFNUM",    SIMPLE, LEVEL_MAIN }, 	{ "crossref",     "CROSSREF",  SIMPLE, LEVEL_MAIN }, 	{ "keywords",     "KEYWORD",   SIMPLE, LEVEL_MAIN },-	{ " ",         "TYPE|PROCEEDINGS",    ALWAYS, LEVEL_MAIN },+	{ " ",         "INTERNAL_TYPE|PROCEEDINGS",    ALWAYS, LEVEL_MAIN }, 	{ " ",         "RESOURCE|text",       ALWAYS, LEVEL_MAIN }, 	{ " ",         "GENRE|conference publication",   ALWAYS, LEVEL_MAIN } };@@ -366,22 +366,22 @@ 	{ "abstract",  "ABSTRACT",  SIMPLE, LEVEL_MAIN }, 	{ "contents",  "CONTENTS",  SIMPLE, LEVEL_MAIN }, 	{ "doi",       "DOI",       SIMPLE, LEVEL_MAIN },-	{ "ftp",       "URL",       BIBTEX_URL, LEVEL_MAIN },-	{ "url",       "URL",       BIBTEX_URL, LEVEL_MAIN },+	{ "ftp",       "",       BIBTEX_URL, LEVEL_MAIN },+	{ "url",       "",       BIBTEX_URL, LEVEL_MAIN }, 	{ "pdf",          "FILEATTACH",SIMPLE, LEVEL_MAIN }, 	{ "sentelink",    "FILEATTACH",BIBTEX_SENTE, LEVEL_MAIN }, 	{ "file",         "FILEATTACH",BIBTEX_FILE,  LEVEL_MAIN },-	{ "howpublished", "URL" ,   BIBTEX_URL, LEVEL_MAIN },+	{ "howpublished", "" ,   HOWPUBLISHED, LEVEL_MAIN }, 	{ "language",     "LANGUAGE",     SIMPLE, LEVEL_MAIN }, 	{ "location",     "LOCATION",     SIMPLE, LEVEL_MAIN }, 	{ "note",         "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annote",       "ANNOTE",    SIMPLE, LEVEL_MAIN }, 	{ "key",          "BIBKEY",          SIMPLE, LEVEL_MAIN },-	{ "type",         "TYPE",         SIMPLE, LEVEL_MAIN },+	{ "type",         "GENRE",         SIMPLE, LEVEL_MAIN }, 	{ "refnum",    "REFNUM",    SIMPLE, LEVEL_MAIN }, 	{ "crossref",     "CROSSREF",  SIMPLE, LEVEL_MAIN }, 	{ "keywords",     "KEYWORD",   SIMPLE, LEVEL_MAIN },-	{ " ",         "TYPE|THESIS",   ALWAYS, LEVEL_MAIN },+	{ " ",         "INTERNAL_TYPE|THESIS",   ALWAYS, LEVEL_MAIN }, 	{ " ",         "RESOURCE|text", ALWAYS, LEVEL_MAIN }, 	{ " ",         "GENRE|thesis",  ALWAYS, LEVEL_MAIN }, 	{ " ",         "GENRE|Ph.D. thesis",  ALWAYS, LEVEL_MAIN }@@ -399,8 +399,8 @@ 	{ "abstract",  "ABSTRACT",  SIMPLE, LEVEL_MAIN }, 	{ "contents",  "CONTENTS",  SIMPLE, LEVEL_MAIN }, 	{ "doi",       "DOI",       SIMPLE, LEVEL_MAIN },-	{ "ftp",       "URL",       BIBTEX_URL, LEVEL_MAIN },-	{ "url",       "URL",       BIBTEX_URL, LEVEL_MAIN },+	{ "ftp",       "",       BIBTEX_URL, LEVEL_MAIN },+	{ "url",       "",       BIBTEX_URL, LEVEL_MAIN }, 	{ "pdf",          "FILEATTACH",SIMPLE, LEVEL_MAIN }, 	{ "sentelink",    "FILEATTACH",BIBTEX_SENTE, LEVEL_MAIN }, 	{ "file",         "FILEATTACH",BIBTEX_FILE,  LEVEL_MAIN },@@ -409,12 +409,12 @@ 	{ "note",         "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annote",       "ANNOTE",    SIMPLE, LEVEL_MAIN }, 	{ "key",          "BIBKEY",          SIMPLE, LEVEL_MAIN },-	{ "type",         "TYPE",         SIMPLE, LEVEL_MAIN },-	{ "howpublished", "URL",    BIBTEX_URL, LEVEL_MAIN },+	{ "type",         "GENRE",         SIMPLE, LEVEL_MAIN },+	{ "howpublished", "",    HOWPUBLISHED, LEVEL_MAIN }, 	{ "refnum",    "REFNUM",    SIMPLE, LEVEL_MAIN }, 	{ "crossref",     "CROSSREF",  SIMPLE, LEVEL_MAIN }, 	{ "keywords",     "KEYWORD",   SIMPLE, LEVEL_MAIN },-	{ " ",         "TYPE|THESIS",   ALWAYS, LEVEL_MAIN },+	{ " ",         "INTERNAL_TYPE|THESIS",   ALWAYS, LEVEL_MAIN }, 	{ " ",         "RESOURCE|text", ALWAYS, LEVEL_MAIN }, 	{ " ",         "GENRE|thesis",  ALWAYS, LEVEL_MAIN }, 	{ " ",         "GENRE|Masters thesis",  ALWAYS, LEVEL_MAIN }@@ -436,13 +436,13 @@ 	{ "abstract",  "ABSTRACT",  SIMPLE, LEVEL_MAIN }, 	{ "contents",  "CONTENTS",  SIMPLE, LEVEL_MAIN }, 	{ "doi",       "DOI",       SIMPLE, LEVEL_MAIN },-	{ "ftp",       "URL",       BIBTEX_URL, LEVEL_MAIN },-	{ "url",       "URL",       BIBTEX_URL, LEVEL_MAIN },+	{ "ftp",       "",       BIBTEX_URL, LEVEL_MAIN },+	{ "url",       "",       BIBTEX_URL, LEVEL_MAIN }, 	{ "pdf",          "FILEATTACH",SIMPLE, LEVEL_MAIN }, 	{ "sentelink",    "FILEATTACH",BIBTEX_SENTE, LEVEL_MAIN }, 	{ "file",         "FILEATTACH",BIBTEX_FILE,  LEVEL_MAIN }, 	{ "language",     "LANGUAGE",     SIMPLE, LEVEL_MAIN },-	{ "howpublished", "URL",    BIBTEX_URL, LEVEL_MAIN },+	{ "howpublished", "",    HOWPUBLISHED, LEVEL_MAIN }, 	{ "location",     "LOCATION",     SIMPLE, LEVEL_MAIN }, 	{ "note",         "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annote",       "ANNOTE",    SIMPLE, LEVEL_MAIN },@@ -450,7 +450,7 @@ 	{ "refnum",    "REFNUM",    SIMPLE, LEVEL_MAIN }, 	{ "crossref",     "CROSSREF",  SIMPLE, LEVEL_MAIN }, 	{ "keywords",     "KEYWORD",   SIMPLE, LEVEL_MAIN },-	{ " ",         "TYPE|BOOK",       ALWAYS, LEVEL_MAIN },+	{ " ",         "INTERNAL_TYPE|BOOK",       ALWAYS, LEVEL_MAIN }, 	{ " ",         "RESOURCE|text",   ALWAYS, LEVEL_MAIN }, 	{ " ",         "GENRE|unpublished",      ALWAYS, LEVEL_MAIN } };@@ -475,16 +475,16 @@ 	{ "lccn",      "LCCN",      SIMPLE, LEVEL_MAIN }, 	{ "abstract",  "ABSTRACT",  SIMPLE, LEVEL_MAIN }, 	{ "contents",  "CONTENTS",  SIMPLE, LEVEL_MAIN },-	{ "ftp",       "URL",       BIBTEX_URL, LEVEL_MAIN }, 	{ "doi",       "DOI",       SIMPLE, LEVEL_MAIN },-	{ "url",       "URL",       BIBTEX_URL, LEVEL_MAIN },+	{ "ftp",       "",      BIBTEX_URL, LEVEL_MAIN },+	{ "url",       "",      BIBTEX_URL, LEVEL_MAIN }, 	{ "pdf",          "FILEATTACH",SIMPLE, LEVEL_MAIN }, 	{ "sentelink",    "FILEATTACH",BIBTEX_SENTE, LEVEL_MAIN }, 	{ "file",         "FILEATTACH",BIBTEX_FILE,  LEVEL_MAIN },-	{ "howpublished", "URL",    BIBTEX_URL, LEVEL_MAIN },+	{ "howpublished", "",    HOWPUBLISHED, LEVEL_MAIN }, 	{ "language",     "LANGUAGE",     SIMPLE, LEVEL_MAIN }, 	{ "refnum",    "REFNUM",    SIMPLE, LEVEL_MAIN },-	{ "type",      "TYPE",      SIMPLE, LEVEL_MAIN },+	{ "type",      "GENRE",      SIMPLE, LEVEL_MAIN }, 	{ "number",    "NUMBER",      TITLE,  LEVEL_MAIN }, 	{ "revision",  "REVISION",    TITLE,  LEVEL_MAIN }, 	{ "location",     "LOCATION",     SIMPLE, LEVEL_MAIN },@@ -494,7 +494,7 @@ 	{ "keywords",     "KEYWORD",   SIMPLE, LEVEL_MAIN }, 	{ "crossref",     "CROSSREF",  SIMPLE, LEVEL_MAIN }, 	{ " ",         "RESOURCE|text",   ALWAYS, LEVEL_MAIN },-	{ " ",         "TYPE|STANDARD",    ALWAYS, LEVEL_MAIN }+	{ " ",         "INTERNAL_TYPE|STANDARD",    ALWAYS, LEVEL_MAIN } };  /*@@ -515,13 +515,13 @@ 	{ "volume",       "VOLUME",      TITLE,  LEVEL_MAIN }, 	{ "number",       "NUMBER",      TITLE,  LEVEL_MAIN }, 	{ "contents",     "CONTENTS",    SIMPLE, LEVEL_MAIN },-	{ "ftp",          "URL",         BIBTEX_URL, LEVEL_MAIN }, 	{ "doi",          "DOI",         SIMPLE, LEVEL_MAIN },-	{ "url",          "URL",         BIBTEX_URL, LEVEL_MAIN },+	{ "ftp",          "",        BIBTEX_URL, LEVEL_MAIN },+	{ "url",          "",        BIBTEX_URL, LEVEL_MAIN }, 	{ "pdf",          "FILEATTACH",SIMPLE, LEVEL_MAIN }, 	{ "sentelink",    "FILEATTACH",BIBTEX_SENTE, LEVEL_MAIN }, 	{ "file",         "FILEATTACH",BIBTEX_FILE,  LEVEL_MAIN },-	{ "howpublished", "URL",         BIBTEX_URL, LEVEL_MAIN },+	{ "howpublished", "",         HOWPUBLISHED, LEVEL_MAIN }, 	{ "refnum",       "REFNUM",      SIMPLE, LEVEL_MAIN }, 	{ "language",     "LANGUAGE",    SIMPLE, LEVEL_MAIN }, 	{ "note",         "NOTES",       SIMPLE, LEVEL_MAIN },@@ -558,19 +558,19 @@ 	{ "note",      "NOTES",     SIMPLE, LEVEL_MAIN }, 	{ "annote",       "ANNOTE",    SIMPLE, LEVEL_MAIN }, 	{ "key",       "BIBKEY",       SIMPLE, LEVEL_MAIN },-	{ "ftp",       "URL",       BIBTEX_URL, LEVEL_MAIN }, 	{ "doi",       "DOI",       SIMPLE, LEVEL_MAIN },-	{ "url",       "URL",       BIBTEX_URL, LEVEL_MAIN },+	{ "ftp",       "",      BIBTEX_URL, LEVEL_MAIN },+	{ "url",       "",      BIBTEX_URL, LEVEL_MAIN }, 	{ "pdf",          "FILEATTACH",SIMPLE, LEVEL_MAIN }, 	{ "sentelink",    "FILEATTACH",BIBTEX_SENTE, LEVEL_MAIN }, 	{ "file",         "FILEATTACH",BIBTEX_FILE,  LEVEL_MAIN },-	{ "howpublished", "URL",    BIBTEX_URL, LEVEL_MAIN },-	{ "type",       "TYPE",     SIMPLE, LEVEL_MAIN },+	{ "howpublished", "",    HOWPUBLISHED, LEVEL_MAIN },+	{ "type",       "GENRE",     SIMPLE, LEVEL_MAIN }, 	{ "refnum",    "REFNUM",    SIMPLE, LEVEL_MAIN }, 	{ "crossref",     "CROSSREF",  SIMPLE, LEVEL_MAIN }, 	{ "keywords",     "KEYWORD",   SIMPLE, LEVEL_MAIN }, 	{ " ",         "RESOURCE|text",   ALWAYS, LEVEL_MAIN },-	{ " ",         "TYPE|PATENT",    ALWAYS, LEVEL_MAIN },+	{ " ",         "INTERNAL_TYPE|PATENT",    ALWAYS, LEVEL_MAIN }, 	{ " ",         "GENRE|patent",    ALWAYS, LEVEL_MAIN }, }; @@ -592,13 +592,13 @@ 	{ "abstract",  "ABSTRACT",  SIMPLE, LEVEL_MAIN }, 	{ "volume",    "VOLUME",    SIMPLE, LEVEL_MAIN }, 	{ "contents",  "CONTENTS",  SIMPLE, LEVEL_MAIN },-	{ "ftp",       "URL",       BIBTEX_URL, LEVEL_MAIN }, 	{ "doi",       "DOI",       SIMPLE, LEVEL_MAIN },-	{ "url",       "URL",       BIBTEX_URL, LEVEL_MAIN },+	{ "ftp",       "",      BIBTEX_URL, LEVEL_MAIN },+	{ "url",       "",      BIBTEX_URL, LEVEL_MAIN }, 	{ "pdf",          "FILEATTACH",SIMPLE, LEVEL_MAIN }, 	{ "sentelink",    "FILEATTACH",BIBTEX_SENTE, LEVEL_MAIN }, 	{ "file",         "FILEATTACH",BIBTEX_FILE,  LEVEL_MAIN },-	{ "howpublished", "URL",    BIBTEX_URL, LEVEL_MAIN },+	{ "howpublished", "",    HOWPUBLISHED, LEVEL_MAIN }, 	{ "refnum",    "REFNUM",    SIMPLE, LEVEL_MAIN }, 	{ "crossref",     "CROSSREF",  SIMPLE, LEVEL_MAIN }, 	{ "location",  "LOCATION",  SIMPLE, LEVEL_MAIN },@@ -626,13 +626,13 @@ 	{ "day",       "DAY",       SIMPLE, LEVEL_MAIN }, 	{ "abstract",  "ABSTRACT",  SIMPLE, LEVEL_MAIN }, 	{ "contents",  "CONTENTS",  SIMPLE, LEVEL_MAIN },-	{ "ftp",       "URL",       BIBTEX_URL, LEVEL_MAIN }, 	{ "doi",       "DOI",       SIMPLE, LEVEL_MAIN },-	{ "url",       "URL",       BIBTEX_URL, LEVEL_MAIN },+	{ "ftp",       "",      BIBTEX_URL, LEVEL_MAIN },+	{ "url",       "",      BIBTEX_URL, LEVEL_MAIN }, 	{ "pdf",          "FILEATTACH",SIMPLE, LEVEL_MAIN }, 	{ "sentelink",    "FILEATTACH",BIBTEX_SENTE, LEVEL_MAIN }, 	{ "file",         "FILEATTACH",BIBTEX_FILE,  LEVEL_MAIN },-	{ "howpublished", "URL",    BIBTEX_URL, LEVEL_MAIN },+	{ "howpublished", "",    HOWPUBLISHED, LEVEL_MAIN }, 	{ "refnum",    "REFNUM",    SIMPLE, LEVEL_MAIN }, 	{ "crossref",     "CROSSREF",  SIMPLE, LEVEL_MAIN }, 	{ "location",  "LOCATION",  SIMPLE, LEVEL_MAIN },@@ -641,7 +641,7 @@ 	{ "key",       "BIBKEY",       SIMPLE, LEVEL_MAIN }, 	{ "language",  "LANGUAGE",  SIMPLE, LEVEL_MAIN }, 	{ "keywords",  "KEYWORD",   SIMPLE, LEVEL_MAIN },-	{ " ",         "TYPE|MISC",       ALWAYS, LEVEL_MAIN },+	{ " ",         "INTERNAL_TYPE|MISC",       ALWAYS, LEVEL_MAIN }, };  #define ORIG(a) ( &(a[0]) )
bibutils/bibutils.c view
@@ -1,7 +1,7 @@ /*  * bibutils.c  *- * Copyright (c) Chris Putnam 2005-2009+ * Copyright (c) Chris Putnam 2005-2010  *  * Source code released under the GPL  *@@ -10,12 +10,13 @@ #include <stdlib.h> #include "bibutils.h" -/* internal includes */-#include "reftypes.h"-#include "bibtexin.h"+/* bibl format includes */+#include "adsout.h" #include "biblatexin.h"+#include "bibtexin.h" #include "bibtexout.h" #include "copacin.h"+#include "ebiin.h" #include "endin.h" #include "endxmlin.h" #include "endout.h"@@ -23,847 +24,39 @@ #include "isiout.h" #include "medin.h" #include "modsin.h"+#include "modsout.h" #include "risin.h"-#include "wordin.h" #include "risout.h"-#include "modsout.h"+#include "wordin.h" #include "wordout.h"-#include "adsout.h"-#include "newstr_conv.h"-#include "is_ws.h" -#include "ebiin.h"--typedef struct convert_rules {-	int  (*readf)(FILE*,char*,int,int*,newstr*,newstr*,int*);-	int  (*processf)(fields*,char*,char*,long);-	void (*cleanf)(bibl*,param*);-	int  (*typef) (fields*,char*,int,param*,variants*,int);-	void (*convertf)(fields*,fields*,int,param*,variants*,int);-	void (*headerf)(FILE*,param*);-	void (*footerf)(FILE*);-	void (*writef)(fields*,FILE*,param*,unsigned long);-	variants *all;-	int  nall;-} convert_rules;- void bibl_initparams( param *p, int readmode, int writemode, char *progname ) {-	p->readformat       = readmode;-	p->writeformat      = writemode;-	p->format_opts      = 0;-	p->charsetin        = BIBL_CHARSET_DEFAULT;-	p->charsetin_src    = BIBL_SRC_DEFAULT;-	p->charsetout       = BIBL_CHARSET_DEFAULT;-	p->charsetout_src   = BIBL_SRC_DEFAULT;-	p->latexin          = 0;-	p->latexout         = 0;-	p->utf8in           = 0;-	p->utf8out          = 0;-	p->utf8bom          = 0;-	p->xmlout           = 0;-	p->nosplittitle     = 0;-	p->verbose          = 0;-	p->addcount         = 0;-	p->singlerefperfile = 0;-	p->output_raw       = 0;	/* keep MODS tags for output filter */ -	list_init( &(p->asis) );-	list_init( &(p->corps) );--	if ( !progname ) p->progname = NULL;-	else p->progname = strdup( progname );--	if ( readmode == BIBL_BIBTEXIN || readmode == BIBL_BIBLATEXIN ) {-		p->latexin = 1;-	} else if ( readmode == BIBL_MODSIN ) {-		p->xmlin = 1;-		p->utf8in = 1;-		p->output_raw = BIBL_RAW_WITHMAKEREFID |-				BIBL_RAW_WITHCHARCONVERT;-		p->charsetin = BIBL_CHARSET_UNICODE;-	} else if ( readmode == BIBL_WORDIN ) {-		p->xmlin = 1;-		p->utf8in = 1;-		p->output_raw = BIBL_RAW_WITHMAKEREFID |-				BIBL_RAW_WITHCHARCONVERT;-		p->charsetin = BIBL_CHARSET_UNICODE;-	} else if ( readmode == BIBL_MEDLINEIN ) {-		/* default medline to UTF8 Unicode */-		p->charsetin = BIBL_CHARSET_UNICODE;-		p->utf8in = 1;-		p->xmlin = 1;-		p->output_raw = BIBL_RAW_WITHMAKEREFID |-				BIBL_RAW_WITHCHARCONVERT;-	} else if ( readmode == BIBL_EBIIN ) {-		/* default medline to UTF8 Unicode */-		p->charsetin = BIBL_CHARSET_UNICODE;-		p->utf8in = 1;-		p->xmlin = 1;-		p->output_raw = BIBL_RAW_WITHMAKEREFID |-				BIBL_RAW_WITHCHARCONVERT;-	} else if ( readmode == BIBL_ENDNOTEXMLIN ) {-		p->xmlin = 1;-		p->utf8in = 1;+	switch ( readmode ) {+	case BIBL_BIBTEXIN:     bibtexin_initparams( p, progname ); break;+	case BIBL_BIBLATEXIN:   biblatexin_initparams( p, progname ); break;+	case BIBL_COPACIN:      copacin_initparams( p, progname ); break;+	case BIBL_EBIIN:        ebiin_initparams( p, progname ); break;+	case BIBL_ENDNOTEIN:    endin_initparams( p, progname ); break;+	case BIBL_ENDNOTEXMLIN: endxmlin_initparams( p, progname ); break;+	case BIBL_MEDLINEIN:    medin_initparams( p, progname ); break;+	case BIBL_MODSIN:       modsin_initparams( p, progname ); break;+	case BIBL_RISIN:        risin_initparams( p, progname ); break;+	case BIBL_WORDIN:       wordin_initparams( p, progname ); break;+	default: /* internal error */; 	} -	if ( writemode == BIBL_BIBTEXOUT ) {-		p->latexout = 1;-	} else if ( writemode == BIBL_MODSOUT ) {-		/* default to UTF8 Unicode with BOM written */-		p->charsetout = BIBL_CHARSET_UNICODE;-		p->utf8out = 1;-		p->utf8bom = 1;-		p->xmlout = 1;-	} else if ( writemode == BIBL_WORD2007OUT ) {-		if ( !p->utf8out ) p->xmlout = 3;-		else p->xmlout = 1;-		p->charsetout = BIBL_CHARSET_UNICODE;-	} else p->xmlout = 0;--}--void-bibl_freeparams( param *p )-{-	list_free( &(p->asis) );-	list_free( &(p->corps) );-	if ( p->progname ) free( p->progname );-}--static void-bibl_readlist( list *pl, char *progname, char *filename )-{-	if ( !list_fill( pl, filename ) ) {-		fprintf( stderr, "%s: warning problems reading '%s' "-			"obtained %d elements\n", progname, filename,-			pl->n );-	}-}--void-bibl_readasis( param *p, char *filename )-{-	bibl_readlist( &(p->asis), p->progname, filename );-}--void-bibl_readcorps( param *p, char *filename )-{-	bibl_readlist( &(p->corps), p->progname, filename );-}--static void-bibl_addtolist( list *pl, char *entry )-{-	list_add( pl, entry );-}--void-bibl_addtoasis( param *p, char *entry )-{-	bibl_addtolist( &(p->asis), entry );-}--void-bibl_addtocorps( param *p, char *entry )-{-	bibl_addtolist( &(p->corps), entry );-}--static void-bibl_duplicateparams( param *np, param *op )-{-	list_init( &(np->asis) );-	list_init( &(np->corps) );-	list_copy( &(np->asis), &(op->asis ) );-	list_copy( &(np->corps), &(op->corps ) );-	-	if ( !op->progname ) np->progname = NULL;-	else np->progname = strdup( op->progname );--	np->readformat = op->readformat;-	np->writeformat = op->writeformat;--	np->charsetin = op->charsetin;-	np->charsetin_src = op->charsetin_src;-	np->utf8in = op->utf8in;-	np->latexin = op->latexin;-	np->xmlin = op->xmlin;--	np->charsetout = op->charsetout;-	np->charsetout_src = op->charsetout_src;-	np->utf8out = op->utf8out;-	np->utf8bom = op->utf8bom;-	np->latexout = op->latexout;-	np->xmlout = op->xmlout;-	np->nosplittitle = op->nosplittitle;--	np->verbose = op->verbose;-	np->format_opts = op->format_opts;-	np->addcount = op->addcount;-	np->output_raw = op->output_raw;-	np->singlerefperfile = op->singlerefperfile;-}--void-bibl_reporterr( int err )-{-	fprintf( stderr, "Bibutils: " );-	switch( err ) {-		case BIBL_OK:-			fprintf( stderr, "No error." ); break;-		case BIBL_ERR_BADINPUT:-			fprintf( stderr, "Bad input." ); break;-		case BIBL_ERR_MEMERR:-			fprintf( stderr, "Memory error." ); break;-		case BIBL_ERR_CANTOPEN:-			fprintf( stderr, "Can't open." ); break;-		default:-			fprintf( stderr, "Cannot identify error code."); break;-	}-	fprintf( stderr, "\n" );-}--static int-bibl_illegalinmode( int mode )-{-	if ( mode < BIBL_FIRSTIN || mode > BIBL_LASTIN ) return 1;-	else return 0;-}--static int-bibl_illegaloutmode( int mode )-{-	if ( mode < BIBL_FIRSTOUT || mode > BIBL_LASTOUT ) return 1;-	else return 0;-}--void-bibl_verbose2( fields *info, char *filename, long nrefs )-{-	int i;-	fprintf( stderr, "======== %s %ld : converted\n", filename, nrefs );-	for ( i=0; i<info->nfields; ++i ) {-		fprintf( stderr, "'%s'='%s' level=%d\n", info->tag[i].data,-				info->data[i].data , info->level[i]);-	}-	fprintf( stderr, "\n" );-	fflush( stderr );-}--void-bibl_verbose1( fields *info, fields *orig, char *filename, long nrefs )-{-	int i;-	fprintf( stderr, "======== %s %ld : processed\n", filename, nrefs );-	for ( i=0; i<orig->nfields; ++i ) {-		fprintf( stderr, "'%s'='%s' level=%d\n", orig->tag[i].data,-				orig->data[i].data , orig->level[i]);-	}-	if ( info ) bibl_verbose2( info, filename, nrefs );-}--void-bibl_verbose0( bibl *bin )-{-	int i;-	for ( i=0; i<bin->nrefs; ++i )-		bibl_verbose2( bin->ref[i], "", i+1 );-}--static void-process_alwaysadd( fields *info, int reftype, convert_rules *r )-{-        char tag[512], data[512], *p, *q;-        int i, process, level;-        for ( i=0; i<r->all[reftype].ntags; ++i ) {-                process = ((r->all[reftype]).tags[i]).processingtype;-                if ( process!=ALWAYS ) continue;-                level   = ((r->all[reftype]).tags[i]).level;-                p = ((r->all[reftype]).tags[i]).newstr;-                q = tag;-                while ( p && *p && *p!='|' ) {-                        *q = *p;-                        q++;-                        p++;-                }-                *q = '\0';-                q = data;-                if ( p && *p=='|' ) p++;-                while ( p && *p ) {-                        *q = *p;-                        q++;-                        p++;-                }-                *q = '\0';-                fields_add( info, tag, data, level );-        }-}--static int-read_ref( FILE *fp, bibl *bin, char *filename, convert_rules *r, param *p )-{-	newstr reference, line;-	fields *ref;-	char buf[256]="";-	int nrefs = 0, bufpos = 0, fcharset;/* = CHARSET_UNKNOWN;*/-	newstr_init( &reference );-	newstr_init( &line );-	while ( r->readf( fp, buf, sizeof(buf), &bufpos, &line, &reference, &fcharset ) ) {-		if ( reference.len==0 ) continue;-		ref = fields_new();-		if ( !ref ) return BIBL_ERR_MEMERR;-		if ( r->processf( ref, reference.data, filename, nrefs+1 )){-			bibl_addref( bin, ref );-		} else {-			fields_free( ref );-			free( ref );-		}-		newstr_empty( &reference );-		if ( fcharset!=CHARSET_UNKNOWN ) {-			/* charset from file takes priority over default, but-			 * not user-specified */-			if ( p->charsetin_src!=BIBL_SRC_USER ) {-				p->charsetin_src = BIBL_SRC_FILE;-				p->charsetin = fcharset;-				if ( fcharset!=CHARSET_UNICODE ) p->utf8in = 0;-			}-		}-	}-	if ( p->charsetin==CHARSET_UNICODE ) p->utf8in = 1;-	newstr_free( &line );-	newstr_free( &reference );-	return BIBL_OK;-}--static void-bibl_fixcharsets( bibl *b, param *p )-{-	fields *ref;-	long i, j;-	int swap = 0;-	int latexout = p->latexout;-	int latexin  = p->latexin;-	for ( i=0; i<b->nrefs; ++i ) {-		ref = b->ref[i];-		for ( j=0; j<ref->nfields; ++j ) {-			if ( latexin || latexout ) {-				/* don't texify/detexify URL's and the like */-				if ( !strcasecmp( ref->tag[j].data, "DOI" ) ||-				     !strcasecmp( ref->tag[j].data, "URL" ) ||-				     !strcasecmp( ref->tag[j].data, "REFNUM" )){-					latexin  = 0;-					latexout = 0;-					swap = 1;-				}-			}-			newstr_convert( &(ref->data[j]),-				p->charsetin,  latexin,  p->utf8in,  -				p->xmlin,-				p->charsetout, latexout, p->utf8out, -				p->xmlout );-			if ( swap ) {-				swap = 0;-				latexin  = p->latexin;-				latexout = p->latexout;-			}-		}-	}-}--static int-build_refnum( fields *info, long nrefs )-{-	newstr refnum;-	char *p, num[512];-	int y, a;-	newstr_init( &refnum );-	y = fields_find( info, "YEAR", 0 );-	if ( y==-1 ) y = fields_find( info, "YEAR", -1 );-	if ( y==-1 ) y = fields_find( info, "PARTYEAR", -1 );-	a = fields_find( info, "AUTHOR", 0 );-	if ( a==-1 ) a = fields_find( info, "AUTHOR", -1 );-	if ( a==-1 ) a = fields_find( info, "AUTHOR:CORP", -1 );-	if ( a==-1 ) a = fields_find( info, "AUTHOR:ASIS", -1 );-	if ( a!=-1 && y!=-1 ) {-		p = info->data[a].data;-		while ( p && *p && *p!='|' )-			newstr_addchar( &refnum, *p++ );-		p = info->data[y].data;-		while ( p && *p && *p!=' ' && *p!='\t' )-			newstr_addchar( &refnum, *p++ );-	} else {-		sprintf( num, "%ld", nrefs );-		newstr_strcpy( &refnum, "ref" );-		newstr_strcat( &refnum, num );-	}-	fields_add( info, "REFNUM", refnum.data, 0 );-	newstr_free( &refnum );-	return fields_find( info, "REFNUM", 0 );-}--static void-bibl_checkrefid( bibl *b, param *p )-{-	fields *ref;-	long i;-	char buf[512];-	int n;-	for ( i=0; i<b->nrefs; ++i ) {-		ref = b->ref[i];-		n = fields_find( ref, "REFNUM", 0 );-		if ( n==-1 ) n = build_refnum( ref, i+1 );-		if ( p->addcount ) {-			sprintf( buf, "_%ld", i+1 );-			newstr_strcat( &(ref->data[n]), buf );-		}-	}-}--static int-generate_citekey( fields *info, int nref )-{-	newstr citekey;-	int n1, n2;-	char *p, buf[100];-	newstr_init( &citekey );-	n1 = fields_find( info, "AUTHOR", 0 );-	if ( n1==-1 ) n1 = fields_find( info, "AUTHOR", -1 );-	n2 = fields_find( info, "YEAR", 0 );-	if ( n2==-1 ) n2 = fields_find( info, "YEAR", -1 );-	if ( n2==-1 ) n2 = fields_find( info, "PARTYEAR", 0 );-	if ( n2==-1 ) n2 = fields_find( info, "PARTYEAR", -1 );-	if ( n1!=-1 && n2!=-1 ) {-		p = info->data[n1].data;-		while ( p && *p && *p!='|' ) {-			if ( !is_ws( *p ) ) newstr_addchar( &citekey, *p ); -			p++;-		}-		p = info->data[n2].data;-		while ( p && *p ) {-			if ( !is_ws( *p ) ) newstr_addchar( &citekey, *p );-			p++;-		}-		fields_add( info, "REFNUM", citekey.data, 0 );-	} else {-		sprintf( buf, "ref%d\n", nref );-		newstr_strcpy( &citekey, buf );-	}-	newstr_free( &citekey );-	return fields_find( info, "REFNUM", -1 );-}--static void-resolve_citekeys( bibl *b, list *citekeys, int *dup )-{-	char abc[]="abcdefghijklmnopqrstuvwxyz";-	newstr tmp;-	int nsame, ntmp, n, i, j;--	newstr_init( &tmp );--	for ( i=0; i<citekeys->n; ++i ) {-		if ( dup[i]==-1 ) continue;-		nsame = 0;-		for ( j=i; j<citekeys->n; ++j ) {-			if ( dup[j]!=i ) continue;-			newstr_newstrcpy( &tmp, &(citekeys->str[j]) );-			ntmp = nsame;-			while ( ntmp >= 26 ) {-				newstr_addchar( &tmp, 'a' );-					ntmp -= 26;-			}-			if ( ntmp<26 && ntmp>=0 )-			newstr_addchar( &tmp, abc[ntmp] );-			nsame++;-			dup[j] = -1;-			n = fields_find( b->ref[j], "REFNUM", -1 );-			if ( n!=-1 )-				newstr_newstrcpy(&((b->ref[j])->data[n]),&tmp);-		}-	}-	newstr_free( &tmp );-}--static void-get_citekeys( bibl *b, list *citekeys )-{-	fields *info;-	int i, n;-	for ( i=0; i<b->nrefs; ++i ) {-		info = b->ref[i];-		n = fields_find( info, "REFNUM", -1 );-		if ( n==-1 ) n = generate_citekey( info, i );-		if ( n!=-1 && info->data[n].data )-			list_add( citekeys, info->data[n].data );-		else-			list_add( citekeys, "" );-	}-}--static int -dup_citekeys( bibl *b, list *citekeys )-{-	int i, j, *dup, ndup=0;-	dup = ( int * ) malloc( sizeof( int ) * citekeys->n );-	if ( !dup ) return 0;-	for ( i=0; i<citekeys->n; ++i ) dup[i] = -1;-	for ( i=0; i<citekeys->n-1; ++i ) {-		if ( dup[i]!=-1 ) continue;-		for ( j=i+1; j<citekeys->n; ++j ) {-			if ( !strcmp( citekeys->str[i].data, -				citekeys->str[j].data ) ) {-					dup[i] = i;-					dup[j] = i;-					ndup++;-			}-		}-	}-	if ( ndup ) resolve_citekeys( b, citekeys, dup );-	free( dup );-	return ndup;-}--static void-uniqueify_citekeys( bibl *b )-{-	list citekeys;-	list_init( &citekeys );-	get_citekeys( b, &citekeys );-	dup_citekeys( b, &citekeys );-	list_free( &citekeys );-}--static int -convert_ref( bibl *bin, char *fname, bibl *bout, convert_rules *r, param *p )-{-	fields *rin, *rout;-	long i;-	int reftype;-	if ( r->cleanf ) r->cleanf( bin, p );-	for ( i=0; i<bin->nrefs; ++i ) {-		rin = bin->ref[i];-		rout = fields_new();-		if ( !rout ) return BIBL_ERR_MEMERR;-		if ( r->typef ) -			reftype = r->typef( rin, fname, i+1, p, r->all, r->nall );-		else reftype = 0;-		r->convertf( rin, rout, reftype, p, r->all, r->nall );-		if ( r->all ) process_alwaysadd( rout, reftype, r );-		if ( p->verbose ) -			bibl_verbose1( rout, rin, fname, i+1 );-		bibl_addref( bout, rout );-	}-	uniqueify_citekeys( bout );-	return BIBL_OK;-}--static void-rules_init( convert_rules *r, int mode )-{-	switch ( mode ) {-		case BIBL_BIBTEXIN:-			r->readf    = bibtexin_readf;-			r->processf = bibtexin_processf;-			r->cleanf   = bibtexin_cleanf;-			r->typef    = bibtexin_typef;-			r->convertf = bibtexin_convertf;-			r->all      = bibtex_all;-			r->nall     = bibtex_nall;-			break;-		case BIBL_BIBTEXOUT:-			r->headerf  = bibtexout_writeheader;-			r->footerf  = NULL;-			r->writef   = bibtexout_write;-			break;-		case BIBL_BIBLATEXIN:-			r->readf    = biblatexin_readf;-			r->processf = biblatexin_processf;-			r->cleanf   = biblatexin_cleanf;-			r->typef    = biblatexin_typef;-			r->convertf = biblatexin_convertf;-			r->all      = biblatex_all;-			r->nall     = biblatex_nall;-			break;-		case BIBL_ENDNOTEIN:-			r->readf    = endin_readf;-			r->cleanf   = endin_cleanf;-			r->processf = endin_processf;-			r->typef    = endin_typef;-			r->convertf = endin_convertf;-			r->all      = end_all;-			r->nall     = end_nall;-			break;-		case BIBL_ENDNOTEXMLIN:-			r->readf    = endxmlin_readf;-			r->cleanf   = NULL;-			r->processf = endxmlin_processf;-			r->typef    = endin_typef;-			r->convertf = endin_convertf;-			r->all      = end_all;-			r->nall     = end_nall;-			break;-		case BIBL_ENDNOTEOUT:-			r->headerf = endout_writeheader;-			r->footerf = NULL;-			r->writef  = endout_write;-			break;-		case BIBL_ADSABSOUT:-			r->headerf = adsout_writeheader;-			r->footerf = NULL;-			r->writef  = adsout_write;-			break;-		case BIBL_RISIN:-			r->readf    = risin_readf;-			r->cleanf   = NULL;-			r->processf = risin_processf;-			r->typef    = risin_typef;-			r->convertf = risin_convertf;-			r->all      = ris_all;-			r->nall     = ris_nall;-			break;-		case BIBL_RISOUT:-			r->headerf = risout_writeheader;-			r->footerf = NULL;-			r->writef  = risout_write;-			break;-		case BIBL_ISIIN:-			r->readf    = isiin_readf;-			r->cleanf   = NULL;-			r->processf = isiin_processf;-			r->typef    = isiin_typef;-			r->convertf = isiin_convertf;-			r->all      = isi_all;-			r->nall     = isi_nall;-			break;-		case BIBL_ISIOUT:-			r->headerf  = isiout_writeheader;-			r->footerf  = NULL;-			r->writef   = isiout_write;-			break;-		case BIBL_COPACIN:-			r->readf    = copacin_readf;-			r->cleanf   = NULL;-			r->processf = copacin_processf;-			r->typef    = NULL;-			r->convertf = copacin_convertf;-			r->all      = copac_all;-			r->nall     = copac_nall;-			break;-		case BIBL_MEDLINEIN:-			r->readf    = medin_readf;-			r->cleanf   = NULL;-			r->processf = medin_processf;-			r->typef    = NULL;-			r->convertf = NULL;-			r->all      = NULL;-			r->nall     = 0;-			break;-		case BIBL_WORDIN:-			r->readf    = wordin_readf;-			r->cleanf   = NULL;-			r->processf = wordin_processf;-			r->typef    = NULL;-			r->convertf = NULL;-			r->all      = NULL;-			r->nall     = 0;-			break;-		case BIBL_EBIIN:-			r->readf    = ebiin_readf;-			r->cleanf   = NULL;-			r->processf = ebiin_processf;-			r->typef    = NULL;-			r->convertf = NULL;-			r->all      = NULL;-			r->nall     = 0;-			break;-		case BIBL_MODSIN:-			r->readf    = modsin_readf;-			r->cleanf   = NULL;-			r->processf = modsin_processf;-			r->typef    = NULL;-			r->convertf = NULL;-			r->all      = NULL;-			r->nall     = 0;-			break;-		case BIBL_MODSOUT:-			r->headerf = modsout_writeheader;-			r->footerf = modsout_writefooter;-			r->writef  = modsout_write;-			break;-		case BIBL_WORD2007OUT:-			r->headerf = wordout_writeheader;-			r->footerf = wordout_writefooter;-			r->writef  = wordout_write;-			break;-		default:-			break;-	}-}--static void-bibl_setreadparams( param *np, param *op )-{-	bibl_duplicateparams( np, op );-/*-	list_init( &(np->asis) );-	list_init( &(np->corps) );-	if ( !op->progname ) np->progname = NULL;-	else np->progname = strdup( op->progname );-	np->readformat = op->readformat;-	np->writeformat = op->writeformat;-	np->latexin = op->latexin;-	np->utf8in = op->utf8in;-	np->xmlin = op->xmlin;-	np->charsetin = op->charsetin;-	np->charsetin_src = op->charsetin_src;-	np->verbose = op->verbose;-	np->format_opts = op->format_opts;-	np->addcount = op->addcount;-	np->output_raw = op->output_raw;-	list_copy( &(np->asis), &(op->asis) );-	list_copy( &(np->corps), &(op->corps) );*/-	np->utf8out = 1;-	np->charsetout = BIBL_CHARSET_UNICODE;-	np->charsetout_src = BIBL_SRC_DEFAULT;-	np->xmlout = 0;-	np->latexout = 0;-}--int-bibl_read( bibl *b, FILE *fp, char *filename, param *p )-{-	convert_rules r;-	param lp;-	bibl bin;--	if ( !b ) return BIBL_ERR_BADINPUT;-	if ( !fp ) return BIBL_ERR_BADINPUT;-	if ( !p ) return BIBL_ERR_BADINPUT;-	if ( bibl_illegalinmode( p->readformat ) ) return BIBL_ERR_BADINPUT;--	bibl_setreadparams( &lp, p );-	bibl_init( &bin );-	rules_init( &r, p->readformat );-	read_ref( fp, &bin, filename, &r, &lp );-	if ( !lp.output_raw || ( lp.output_raw & BIBL_RAW_WITHCHARCONVERT ) )-		bibl_fixcharsets( &bin, &lp );-	if ( !lp.output_raw )-		convert_ref( &bin, filename, b, &r, &lp );-	else {-		if ( p->verbose > 1 ) bibl_verbose0( &bin );-		bibl_copy( b, &bin );-	}-	if ( !lp.output_raw || ( lp.output_raw & BIBL_RAW_WITHMAKEREFID ) )-		bibl_checkrefid( b, &lp );-	bibl_free( &bin );--	return BIBL_OK;-}--static FILE *-singlerefname( fields *reffields, long nref, int mode )-{-	char outfile[2048];-	char suffix[5] = "xml";-	FILE *fp;-	long count;-	int  found;-	if ( mode==BIBL_BIBTEXOUT ) strcpy( suffix, "bib" );-	else if ( mode==BIBL_RISOUT ) strcpy( suffix, "ris" );-	else if ( mode==BIBL_ENDNOTEOUT ) strcpy( suffix, "end" );-	else if ( mode==BIBL_ADSABSOUT ) strcpy( suffix, "ads" );-	found = fields_find( reffields, "REFNUM", 0 );-	/* find new filename based on reference */-	if ( found!=-1 ) {-		sprintf( outfile,"%s.%s",reffields->data[found].data, suffix );-	} else  sprintf( outfile,"%ld.%s",nref, suffix );-	count = 0;-	fp = fopen( outfile, "r" );-	while ( fp ) {-		fclose(fp);-		count++;-		if ( count==60000 ) return NULL;-		if ( found!=-1 )-			sprintf( outfile, "%s_%ld.%s", -				reffields->data[found].data, count, suffix  );-		else sprintf( outfile,"%ld_%ld.%s",nref, count, suffix );-		fp = fopen( outfile, "r" );-	}-	return fopen( outfile, "w" );-}--static int-output_bibl( FILE *fp, bibl *b, convert_rules *r, param *p )-{-	long i;-	if ( !p->singlerefperfile && r->headerf ) r->headerf( fp, p );-	for ( i=0; i<b->nrefs; ++i ) {-		if ( p->singlerefperfile ) { -			fp = singlerefname( b->ref[i], i, p->writeformat );-			if ( fp ) {-				if ( r->headerf ) r->headerf( fp, p );-			} else return BIBL_ERR_CANTOPEN;-		}-		r->writef( b->ref[i], fp, p, i );-		if ( p->singlerefperfile ) {-			if ( r->footerf ) r->footerf( fp );-			fclose( fp );-		}+	switch ( writemode ) {+	case BIBL_ADSABSOUT:   adsout_initparams( p, progname ); break;+	case BIBL_BIBTEXOUT:   bibtexout_initparams( p, progname ); break;+	case BIBL_ENDNOTEOUT:  endout_initparams( p, progname ); break;+	case BIBL_ISIOUT:      isiout_initparams( p, progname ); break;+	case BIBL_MODSOUT:     modsout_initparams( p, progname ); break;+	case BIBL_RISOUT:      risout_initparams( p, progname ); break;+	case BIBL_WORD2007OUT: wordout_initparams( p, progname ); break;+	default: /* internal error */; 	}-	if ( !p->singlerefperfile && r->footerf ) r->footerf( fp );-	return 1;-}--static void-bibl_setwriteparams( param *np, param *op )-{-	bibl_duplicateparams( np, op );-/*-	list_init( &(np->asis) );-	list_init( &(np->corps) );-	list_copy( &(np->asis), &(op->asis ) );-	list_copy( &(np->corps), &(op->corps ) );-	if ( !op->progname ) np->progname = NULL;-	else np->progname = strdup( op->progname );-	np->readformat = op->readformat;-	np->writeformat = op->writeformat;-	np->utf8out = op->utf8out;-	np->utf8bom = op->utf8bom;-	np->charsetout = op->charsetout;-	np->charsetout_src = op->charsetout_src;-	np->latexout = op->latexout;-	np->xmlout = op->xmlout;-	np->verbose = op->verbose;-	np->format_opts = op->format_opts;-	np->addcount = op->addcount;-	np->output_raw = op->output_raw;-	np->singlerefperfile = op->singlerefperfile;*/-	np->xmlin = 0;-	np->latexin = 0;-	np->utf8in = 1;-	np->charsetin = BIBL_CHARSET_UNICODE;-	np->charsetin_src = BIBL_SRC_DEFAULT;-}--int-bibl_write( bibl *b, FILE *fp, param *p )-{-	convert_rules r;-	param lp;--	if ( !b ) return BIBL_ERR_BADINPUT;-	if ( !p ) return BIBL_ERR_BADINPUT;-	if ( bibl_illegaloutmode( p->writeformat ) ) return BIBL_ERR_BADINPUT;-	if ( !fp && ( !p || !p->singlerefperfile ) ) return BIBL_ERR_BADINPUT;--	rules_init( &r, p->writeformat );-	bibl_setwriteparams( &lp, p );-	bibl_fixcharsets( b, &lp );-	output_bibl( fp, b, &r, &lp );--	return BIBL_OK; } 
bibutils/bibutils.h view
@@ -1,7 +1,7 @@ /*  * bibutils.h  *- * Copyright (c) Chris Putnam 2005-2009+ * Copyright (c) Chris Putnam 2005-2010  *  */ #ifndef BIBUTILS_H@@ -89,6 +89,19 @@ 	list corps; /* Names that shouldn't be mangled-MODS corporation type */  	char *progname;+++        int  (*readf)(FILE*,char*,int,int*,newstr*,newstr*,int*);+        int  (*processf)(fields*,char*,char*,long);+        void (*cleanf)(bibl*,struct param*);+        int  (*typef) (fields*,char*,int,struct param*,variants*,int);+        void (*convertf)(fields*,fields*,int,struct param*,variants*,int);+        void (*headerf)(FILE*,struct param*);+        void (*footerf)(FILE*);+        void (*writef)(fields*,FILE*,struct param*,unsigned long);+        variants *all;+        int  nall;+  } param; 
bibutils/bltypes.c view
@@ -1,7 +1,8 @@ /*  * bltypes.c  *- * Copyright (c) Chris Putnam 2008-2009+ * Copyright (c) Chris Putnam 2008-2010+ * Copyright (c) Johannes Wilm 2010  *  * Program and source code released under the GPL  *@@ -25,10 +26,11 @@ 	{ "translator",      "TRANSLATOR",   PERSON, LEVEL_MAIN }, 	{ "title",           "TITLE",        SIMPLE, LEVEL_MAIN }, 	{ "subtitle",        "SUBTITLE",     SIMPLE, LEVEL_MAIN },-	{ "titleaddon",      "?????",        SIMPLE, LEVEL_MAIN },   /*WRONG*/+	{ "titleaddon",      "?titleaddon?", SIMPLE, LEVEL_MAIN },   /*WRONG*/ 	{ "journal",         "TITLE",        SIMPLE, LEVEL_HOST }, 	{ "journaltitle",    "TITLE",        SIMPLE, LEVEL_HOST }, 	{ "journalsubtitle", "SUBTITLE",     SIMPLE, LEVEL_HOST },+	{ "shortjournal",    "SHORTTITLE",   SIMPLE, LEVEL_HOST }, 	{ "issuetitle",      "TITLE",        SIMPLE, LEVEL_SERIES }, /*WRONG*/ 	{ "issuesubtitle",   "SUBTITLE",     SIMPLE, LEVEL_SERIES }, /*WRONG*/ 	{ "language",        "LANGUAGE",     SIMPLE, LEVEL_MAIN },@@ -40,7 +42,7 @@ 	{ "series",          "TITLE",        SIMPLE, LEVEL_SERIES }, 	{ "volume",          "VOLUME",       SIMPLE, LEVEL_MAIN }, 	{ "number",          "NUMBER",       SIMPLE, LEVEL_MAIN },-	{ "eid",             "?????",        SIMPLE, LEVEL_MAIN },   /*WRONG*/+	{ "eid",             "EID",          SIMPLE, LEVEL_MAIN }, 	{ "issue",           "ISSUE",        SIMPLE, LEVEL_MAIN }, 	{ "date",            "DATE",         SIMPLE, LEVEL_MAIN },   /*WRONG*/ 	{ "day",             "PARTDAY",      SIMPLE, LEVEL_MAIN },@@ -52,18 +54,19 @@ 	{ "annote",          "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annotation",      "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "issn",            "ISSN",         SIMPLE, LEVEL_HOST },-	{ "addendum",        "?????",        SIMPLE, LEVEL_MAIN },+	{ "abstract",        "ABSTRACT",     SIMPLE, LEVEL_MAIN },+	{ "addendum",        "?addendum?",   SIMPLE, LEVEL_MAIN }, 	{ "doi",             "DOI",          SIMPLE, LEVEL_MAIN },-	{ "eprint",          "?????",        SIMPLE, LEVEL_MAIN }, /* WRONG */-	{ "eprinttype",      "?????",        SIMPLE, LEVEL_MAIN }, /* WRONG */-	{ "url",             "URL",          BIBTEX_URL, LEVEL_MAIN },-	{ "urldate",         "?????",        SIMPLE, LEVEL_MAIN }, /* WRONG */-	{ "urlday",          "?????",        SIMPLE, LEVEL_MAIN }, /* WRONG */-	{ "urlmonth",        "?????",        SIMPLE, LEVEL_MAIN }, /* WRONG */-	{ "urlyear",         "?????",        SIMPLE, LEVEL_MAIN }, /* WRONG */+	{ "eprint",          "",  BIBTEX_EPRINT, LEVEL_MAIN },+	{ "eprinttype",      "",BIBTEX_EPRINT, LEVEL_MAIN },+	{ "url",             "",         BIBTEX_URL, LEVEL_MAIN },+	{ "urldate",         "URLDATE",      SIMPLE, LEVEL_MAIN },+	{ "urlday",          "?urlday?",     SIMPLE, LEVEL_MAIN }, /* WRONG */+	{ "urlmonth",        "?urlmonth?",   SIMPLE, LEVEL_MAIN }, /* WRONG */+	{ "urlyear",         "?urlyear?",    SIMPLE, LEVEL_MAIN }, /* WRONG */ 	{ "address",         "ADDRESS",      SIMPLE, LEVEL_MAIN }, 	{ "refnum",          "REFNUM",       SIMPLE, LEVEL_MAIN },-	{ " ",            "TYPE|ARTICLE",           ALWAYS, LEVEL_MAIN },+	{ " ",            "INTERNAL_TYPE|ARTICLE",           ALWAYS, LEVEL_MAIN }, 	{ " ",            "ISSUANCE|continuing",    ALWAYS, LEVEL_HOST }, 	{ " ",            "RESOURCE|text",          ALWAYS, LEVEL_MAIN }, 	{ " ",            "GENRE|periodical",       ALWAYS, LEVEL_HOST }@@ -78,15 +81,15 @@ 	{ "annotator",       "ANNOTATOR",    PERSON, LEVEL_MAIN }, 	{ "commentator",     "COMMENTATOR",  PERSON, LEVEL_MAIN }, 	{ "translator",      "TRANSLATOR",   PERSON, LEVEL_MAIN },-	{ "introduction",    "?????",        SIMPLE, LEVEL_MAIN }, /*WRONG*/-	{ "foreward",        "?????",        SIMPLE, LEVEL_MAIN }, /*WRONG*/-	{ "afterward",       "?????",        SIMPLE, LEVEL_MAIN }, /*WRONG*/+	{ "introduction",    "?introduction?",SIMPLE, LEVEL_MAIN }, /*WRONG*/+	{ "foreward",        "?foreward?",   SIMPLE, LEVEL_MAIN }, /*WRONG*/+	{ "afterward",       "?afterward?",  SIMPLE, LEVEL_MAIN }, /*WRONG*/ 	{ "title",           "TITLE",        SIMPLE, LEVEL_MAIN }, 	{ "subtitle",        "SUBTITLE",     SIMPLE, LEVEL_MAIN },-	{ "titleaddon",      "?????",        SIMPLE, LEVEL_MAIN },   /*WRONG*/+	{ "titleaddon",      "?titleaddon?", SIMPLE, LEVEL_MAIN },   /*WRONG*/ 	{ "maintitle",       "TITLE",        SIMPLE, LEVEL_HOST }, 	{ "mainsubtitle",    "SUBTITLE",     SIMPLE, LEVEL_HOST },-	{ "maintitleaddon",  "?????",        SIMPLE, LEVEL_HOST },   /*WRONG*/+	{ "maintitleaddon",  "?maintitleaddon?",SIMPLE, LEVEL_HOST },   /*WRONG*/ 	{ "language",        "LANGUAGE",     SIMPLE, LEVEL_MAIN }, 	{ "year",            "YEAR",         SIMPLE, LEVEL_MAIN }, 	{ "origlanguage",    "LANGUAGE",     SIMPLE, LEVEL_ORIG },@@ -95,9 +98,9 @@ 	{ "origlocation",    "LOCATION",     SIMPLE, LEVEL_ORIG }, 	{ "origpublisher",   "PUBLISHER",    SIMPLE, LEVEL_ORIG }, 	{ "volume",          "VOLUME",       SIMPLE, LEVEL_HOST },-	{ "part",            "?????",        SIMPLE, LEVEL_HOST }, /* WRONG */+	{ "part",            "PART",         SIMPLE, LEVEL_HOST }, 	{ "edition",         "EDITION",      SIMPLE, LEVEL_MAIN },-	{ "volumes",         "?????",        SIMPLE, LEVEL_HOST }, /* WRONG */+	{ "volumes",         "NUMVOLUMES",   SIMPLE, LEVEL_HOST }, 	{ "series",          "TITLE",        SIMPLE, LEVEL_HOST }, /* WRONG */ 	{ "number",          "NUMBER",       SIMPLE, LEVEL_MAIN }, 	{ "note",            "NOTES",        SIMPLE, LEVEL_MAIN },@@ -106,21 +109,21 @@ 	{ "publisher",       "PUBLISHER",    SIMPLE, LEVEL_MAIN }, 	{ "location",        "LOCATION",     SIMPLE, LEVEL_MAIN }, 	{ "isbn",            "ISBN",         SIMPLE, LEVEL_MAIN },-	{ "chapter",         "?????????",    SIMPLE, LEVEL_MAIN }, /* WRONG */-	{ "pages",           "?????????",    SIMPLE, LEVEL_MAIN }, /* WRONG */-	{ "pagetotal",       "?????????",    SIMPLE, LEVEL_MAIN },-	{ "addendum",        "?????????",    SIMPLE, LEVEL_MAIN },+	{ "chapter",         "CHAPTER",      SIMPLE, LEVEL_MAIN },+	{ "pages",           "?pages?",    SIMPLE, LEVEL_MAIN }, /* WRONG */+	{ "pagetotal",       "?pagetotal?",    SIMPLE, LEVEL_MAIN },+	{ "addendum",        "?addendum?",    SIMPLE, LEVEL_MAIN }, 	{ "doi",             "DOI",          SIMPLE, LEVEL_MAIN },-	{ "eprint",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "eprinttype",      "?????????",    SIMPLE, LEVEL_MAIN },-	{ "url",             "URL",          SIMPLE, LEVEL_MAIN },-	{ "urldate",         "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlday",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlmonth",        "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlyear",         "?????????",    SIMPLE, LEVEL_MAIN },+	{ "eprint",          "",       BIBTEX_EPRINT, LEVEL_MAIN },+	{ "eprinttype",      "",   BIBTEX_EPRINT, LEVEL_MAIN },+	{ "url",             "",         BIBTEX_URL, LEVEL_MAIN },+	{ "urldate",         "URLDATE",      SIMPLE, LEVEL_MAIN },+	{ "urlday",          "?urlday?",    SIMPLE, LEVEL_MAIN },+	{ "urlmonth",        "?urlmonth?",    SIMPLE, LEVEL_MAIN },+	{ "urlyear",         "?urlyear?",    SIMPLE, LEVEL_MAIN }, 	{ "address",         "ADDRESS",      SIMPLE, LEVEL_MAIN }, 	{ "refnum",          "REFNUM",       SIMPLE, LEVEL_MAIN },-	{ " ",               "TYPE|BOOK",    ALWAYS, LEVEL_MAIN },+	{ " ",               "INTERNAL_TYPE|BOOK",    ALWAYS, LEVEL_MAIN }, 	{ " ",               "RESOURCE|text",ALWAYS, LEVEL_MAIN }, 	{ " ",               "ISSUANCE|monographic", ALWAYS, LEVEL_MAIN }, 	{ " ",               "GENRE|book",   ALWAYS, LEVEL_MAIN }@@ -133,30 +136,31 @@ 	{ "editor",          "EDITOR",       PERSON, LEVEL_MAIN }, 	{ "title",           "TITLE",        SIMPLE, LEVEL_MAIN }, 	{ "subtitle",        "SUBTITLE",     SIMPLE, LEVEL_MAIN },-	{ "titleaddon",      "?????",        SIMPLE, LEVEL_MAIN },   /*WRONG*/+	{ "titleaddon",      "?titleaddon?",        SIMPLE, LEVEL_MAIN },   /*WRONG*/+	{ "howpublished",    "",       HOWPUBLISHED, LEVEL_MAIN }, 	{ "year",            "YEAR",         SIMPLE, LEVEL_MAIN }, 	{ "language",        "LANGUAGE",     SIMPLE, LEVEL_MAIN },-	{ "type",            "?????????",    SIMPLE, LEVEL_MAIN },+	{ "type",            "GENRE",  BIBTEX_GENRE, LEVEL_MAIN }, 	{ "note",            "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annote",          "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annotation",      "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "publisher",       "PUBLISHER",    SIMPLE, LEVEL_MAIN }, 	{ "location",        "LOCATION",     SIMPLE, LEVEL_MAIN },-	{ "chapter",         "?????????",    SIMPLE, LEVEL_MAIN }, /* WRONG */-	{ "pages",           "?????????",    SIMPLE, LEVEL_MAIN }, /* WRONG */-	{ "pagetotal",       "?????????",    SIMPLE, LEVEL_MAIN },-	{ "addendum",        "?????????",    SIMPLE, LEVEL_MAIN },+	{ "chapter",         "CHAPTER",      SIMPLE, LEVEL_MAIN },+	{ "pages",           "?pages?",    SIMPLE, LEVEL_MAIN }, /* WRONG */+	{ "pagetotal",       "?pagetotal?",    SIMPLE, LEVEL_MAIN },+	{ "addendum",        "?addendum?",    SIMPLE, LEVEL_MAIN }, 	{ "doi",             "DOI",          SIMPLE, LEVEL_MAIN },-	{ "eprint",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "eprinttype",      "?????????",    SIMPLE, LEVEL_MAIN },-	{ "url",             "URL",          SIMPLE, LEVEL_MAIN },-	{ "urldate",         "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlday",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlmonth",        "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlyear",         "?????????",    SIMPLE, LEVEL_MAIN },+	{ "eprint",          "",       BIBTEX_EPRINT, LEVEL_MAIN },+	{ "eprinttype",      "",   BIBTEX_EPRINT, LEVEL_MAIN },+	{ "url",             "",         BIBTEX_URL, LEVEL_MAIN },+	{ "urldate",         "URLDATE",      SIMPLE, LEVEL_MAIN },+	{ "urlday",          "?urlday?",    SIMPLE, LEVEL_MAIN },+	{ "urlmonth",        "?urlmonth?",    SIMPLE, LEVEL_MAIN },+	{ "urlyear",         "?urlyear?",    SIMPLE, LEVEL_MAIN }, 	{ "address",         "ADDRESS",      SIMPLE, LEVEL_MAIN }, 	{ "refnum",          "REFNUM",       SIMPLE, LEVEL_MAIN },-	{ " ",               "TYPE|BOOK",    ALWAYS, LEVEL_MAIN },+	{ " ",               "INTERNAL_TYPE|BOOK",    ALWAYS, LEVEL_MAIN }, 	{ " ",               "RESOURCE|text",ALWAYS, LEVEL_MAIN }, 	{ " ",               "ISSUANCE|monographic", ALWAYS, LEVEL_MAIN }, 	{ " ",               "GENRE|book",   ALWAYS, LEVEL_MAIN }@@ -169,15 +173,15 @@ 	{ "commentator",     "COMMENTATOR",  PERSON, LEVEL_MAIN }, 	{ "translator",      "TRANSLATOR",   PERSON, LEVEL_MAIN }, 	{ "year",            "YEAR",         SIMPLE, LEVEL_MAIN },-	{ "introduction",    "?????",        SIMPLE, LEVEL_MAIN }, /*WRONG*/-	{ "foreward",        "?????",        SIMPLE, LEVEL_MAIN }, /*WRONG*/-	{ "afterward",       "?????",        SIMPLE, LEVEL_MAIN }, /*WRONG*/+	{ "introduction",    "?introduction?",        SIMPLE, LEVEL_MAIN }, /*WRONG*/+	{ "foreward",        "?foreward?",        SIMPLE, LEVEL_MAIN }, /*WRONG*/+	{ "afterward",       "?afterward?",        SIMPLE, LEVEL_MAIN }, /*WRONG*/ 	{ "title",           "TITLE",        SIMPLE, LEVEL_MAIN }, 	{ "subtitle",        "SUBTITLE",     SIMPLE, LEVEL_MAIN },-	{ "titleaddon",      "?????",        SIMPLE, LEVEL_MAIN },   /*WRONG*/+	{ "titleaddon",      "?titleaddon?",        SIMPLE, LEVEL_MAIN },   /*WRONG*/ 	{ "maintitle",       "TITLE",        SIMPLE, LEVEL_HOST }, 	{ "mainsubtitle",    "SUBTITLE",     SIMPLE, LEVEL_HOST },-	{ "maintitleaddon",  "?????",        SIMPLE, LEVEL_HOST },   /*WRONG*/+	{ "maintitleaddon",  "?maintitleaddon?",        SIMPLE, LEVEL_HOST },   /*WRONG*/ 	{ "language",        "LANGUAGE",     SIMPLE, LEVEL_MAIN }, 	{ "origlanguage",    "LANGUAGE",     SIMPLE, LEVEL_ORIG }, 	{ "origyear",        "YEAR",         SIMPLE, LEVEL_ORIG },@@ -185,10 +189,10 @@ 	{ "origlocation",    "LOCATION",     SIMPLE, LEVEL_ORIG }, 	{ "origpublisher",   "PUBLISHER",    SIMPLE, LEVEL_ORIG }, 	{ "volume",          "VOLUME",       SIMPLE, LEVEL_HOST },-	{ "part",            "?????",        SIMPLE, LEVEL_HOST }, /* WRONG */+	{ "part",            "PART",         SIMPLE, LEVEL_HOST }, 	{ "edition",         "EDITION",      SIMPLE, LEVEL_MAIN },-	{ "volumes",         "?????",        SIMPLE, LEVEL_HOST }, /* WRONG */-	{ "series",          "?????",        SIMPLE, LEVEL_HOST }, /* WRONG */+	{ "volumes",         "NUMVOLUMES",   SIMPLE, LEVEL_HOST },+	{ "series",          "?series?",        SIMPLE, LEVEL_HOST }, /* WRONG */ 	{ "number",          "NUMBER",       SIMPLE, LEVEL_MAIN }, 	{ "note",            "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annote",          "NOTES",        SIMPLE, LEVEL_MAIN },@@ -196,21 +200,21 @@ 	{ "publisher",       "PUBLISHER",    SIMPLE, LEVEL_MAIN }, 	{ "location",        "LOCATION",     SIMPLE, LEVEL_MAIN }, 	{ "isbn",            "ISBN",         SIMPLE, LEVEL_MAIN },-	{ "chapter",         "?????????",    SIMPLE, LEVEL_MAIN }, /* WRONG */-	{ "pages",           "?????????",    SIMPLE, LEVEL_MAIN }, /* WRONG */-	{ "pagetotal",       "?????????",    SIMPLE, LEVEL_MAIN },-	{ "addendum",        "?????????",    SIMPLE, LEVEL_MAIN },+	{ "chapter",         "CHAPTER",      SIMPLE, LEVEL_MAIN },+	{ "pages",           "?pages?",    SIMPLE, LEVEL_MAIN }, /* WRONG */+	{ "pagetotal",       "?pagetotal?",    SIMPLE, LEVEL_MAIN },+	{ "addendum",        "?addendum?",    SIMPLE, LEVEL_MAIN }, 	{ "doi",             "DOI",          SIMPLE, LEVEL_MAIN },-	{ "eprint",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "eprinttype",      "?????????",    SIMPLE, LEVEL_MAIN },-	{ "url",             "URL",          SIMPLE, LEVEL_MAIN },-	{ "urldate",         "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlday",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlmonth",        "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlyear",         "?????????",    SIMPLE, LEVEL_MAIN },+	{ "eprint",          "",       BIBTEX_EPRINT, LEVEL_MAIN },+	{ "eprinttype",      "",   BIBTEX_EPRINT, LEVEL_MAIN },+	{ "url",             "",         BIBTEX_URL, LEVEL_MAIN },+	{ "urldate",         "URLDATE",      SIMPLE, LEVEL_MAIN },+	{ "urlday",          "?urlday?",    SIMPLE, LEVEL_MAIN },+	{ "urlmonth",        "?urlmonth?",    SIMPLE, LEVEL_MAIN },+	{ "urlyear",         "?urlyear?",    SIMPLE, LEVEL_MAIN }, 	{ "address",         "ADDRESS",      SIMPLE, LEVEL_MAIN }, 	{ "refnum",          "REFNUM",       SIMPLE, LEVEL_MAIN },-	{ " ",               "TYPE|BOOK",    ALWAYS, LEVEL_MAIN },+	{ " ",               "INTERNAL_TYPE|BOOK",    ALWAYS, LEVEL_MAIN }, 	{ " ",               "RESOURCE|text",ALWAYS, LEVEL_MAIN }, 	{ " ",               "ISSUANCE|monographic", ALWAYS, LEVEL_MAIN }, 	{ " ",               "GENRE|book",   ALWAYS, LEVEL_MAIN }@@ -226,18 +230,18 @@ 	{ "commentator",     "COMMENTATOR",  PERSON, LEVEL_HOST }, 	{ "translator",      "TRANSLATOR",   PERSON, LEVEL_HOST }, 	{ "year",            "YEAR",         SIMPLE, LEVEL_MAIN },-	{ "introduction",    "?????",        SIMPLE, LEVEL_HOST }, /*WRONG*/-	{ "foreward",        "?????",        SIMPLE, LEVEL_HOST }, /*WRONG*/-	{ "afterward",       "?????",        SIMPLE, LEVEL_HOST }, /*WRONG*/+	{ "introduction",    "?introduction?",        SIMPLE, LEVEL_HOST }, /*WRONG*/+	{ "foreward",        "?foreward?",        SIMPLE, LEVEL_HOST }, /*WRONG*/+	{ "afterward",       "?afterward?",        SIMPLE, LEVEL_HOST }, /*WRONG*/ 	{ "title",           "TITLE",        SIMPLE, LEVEL_MAIN }, 	{ "subtitle",        "SUBTITLE",     SIMPLE, LEVEL_MAIN },-	{ "titleaddon",      "?????",        SIMPLE, LEVEL_MAIN },   /*WRONG*/+	{ "titleaddon",      "?titleaddon?",        SIMPLE, LEVEL_MAIN },   /*WRONG*/ 	{ "maintitle",       "TITLE",        SIMPLE, LEVEL_MAIN }, 	{ "mainsubtitle",    "SUBTITLE",     SIMPLE, LEVEL_MAIN },-	{ "maintitleaddon",  "?????",        SIMPLE, LEVEL_MAIN },   /*WRONG*/+	{ "maintitleaddon",  "?maintitleaddon?",        SIMPLE, LEVEL_MAIN },   /*WRONG*/ 	{ "booktitle",       "TITLE",        SIMPLE, LEVEL_HOST }, 	{ "booksubtitle",    "SUBTITLE",     SIMPLE, LEVEL_HOST },-	{ "booktitleaddon",  "??????",       SIMPLE, LEVEL_HOST },+	{ "booktitleaddon",  "?booktitleaddon?",       SIMPLE, LEVEL_HOST }, 	{ "bookauthor",      "AUTHOR",       PERSON, LEVEL_HOST }, 	{ "language",        "LANGUAGE",     SIMPLE, LEVEL_MAIN }, 	{ "origlanguage",    "LANGUAGE",     SIMPLE, LEVEL_ORIG },@@ -247,10 +251,10 @@ 	{ "origpublisher",   "PUBLISHER",    SIMPLE, LEVEL_ORIG }, 	{ "volume",          "VOLUME",       SIMPLE, LEVEL_MAIN }, 	{ "pages",           "PAGES",        PAGES,  LEVEL_MAIN },-	{ "part",            "?????",        SIMPLE, LEVEL_HOST }, /* WRONG */+	{ "part",            "PART",         SIMPLE, LEVEL_HOST }, 	{ "edition",         "EDITION",      SIMPLE, LEVEL_MAIN },-	{ "volumes",         "?????",        SIMPLE, LEVEL_HOST }, /* WRONG */-	{ "series",          "?????",        SIMPLE, LEVEL_HOST }, /* WRONG */+	{ "volumes",         "NUMVOLUMES",   SIMPLE, LEVEL_HOST },+	{ "series",          "?series?",     SIMPLE, LEVEL_HOST }, /* WRONG */ 	{ "number",          "NUMBER",       SIMPLE, LEVEL_MAIN }, 	{ "note",            "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annote",          "NOTES",        SIMPLE, LEVEL_MAIN },@@ -258,19 +262,19 @@ 	{ "publisher",       "PUBLISHER",    SIMPLE, LEVEL_MAIN }, 	{ "location",        "LOCATION",     SIMPLE, LEVEL_MAIN }, 	{ "isbn",            "ISBN",         SIMPLE, LEVEL_HOST },-	{ "chapter",         "?????????",    SIMPLE, LEVEL_MAIN }, /* WRONG */-	{ "addendum",        "?????????",    SIMPLE, LEVEL_MAIN },+	{ "chapter",         "CHAPTER",      SIMPLE, LEVEL_MAIN },+	{ "addendum",        "?addendum?",   SIMPLE, LEVEL_MAIN }, 	{ "doi",             "DOI",          SIMPLE, LEVEL_MAIN },-	{ "eprint",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "eprinttype",      "?????????",    SIMPLE, LEVEL_MAIN },-	{ "url",             "URL",          SIMPLE, LEVEL_MAIN },-	{ "urldate",         "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlday",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlmonth",        "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlyear",         "?????????",    SIMPLE, LEVEL_MAIN },+	{ "eprint",          "",       BIBTEX_EPRINT, LEVEL_MAIN },+	{ "eprinttype",      "",   BIBTEX_EPRINT, LEVEL_MAIN },+	{ "url",             "",         BIBTEX_URL, LEVEL_MAIN },+	{ "urldate",         "URLDATE",      SIMPLE, LEVEL_MAIN },+	{ "urlday",          "?urlday?",     SIMPLE, LEVEL_MAIN },+	{ "urlmonth",        "?urlmonth?",   SIMPLE, LEVEL_MAIN },+	{ "urlyear",         "?urlyear?",    SIMPLE, LEVEL_MAIN }, 	{ "address",         "ADDRESS",      SIMPLE, LEVEL_MAIN }, 	{ "refnum",          "REFNUM",       SIMPLE, LEVEL_MAIN },-	{ " ",               "TYPE|INBOOK",    ALWAYS, LEVEL_MAIN },+	{ " ",               "INTERNAL_TYPE|INBOOK",    ALWAYS, LEVEL_MAIN }, 	{ " ",               "RESOURCE|text",ALWAYS, LEVEL_MAIN }, 	{ " ",               "ISSUANCE|monographic", ALWAYS, LEVEL_HOST }, 	{ " ",               "GENRE|book",   ALWAYS, LEVEL_HOST }@@ -284,7 +288,7 @@ 	{ "year",            "YEAR",         SIMPLE, LEVEL_MAIN }, 	{ "title",           "TITLE",        SIMPLE, LEVEL_MAIN }, 	{ "subtitle",        "SUBTITLE",     SIMPLE, LEVEL_MAIN },-	{ "titleaddon",      "?????",        SIMPLE, LEVEL_MAIN },   /*WRONG*/+	{ "titleaddon",      "?titleaddon?", SIMPLE, LEVEL_MAIN },   /*WRONG*/ 	{ "language",        "LANGUAGE",     SIMPLE, LEVEL_MAIN }, 	{ "edition",         "EDITION",      SIMPLE, LEVEL_MAIN }, 	{ "number",          "NUMBER",       SIMPLE, LEVEL_MAIN },@@ -292,25 +296,25 @@ 	{ "annote",          "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annotation",      "NOTES",        SIMPLE, LEVEL_MAIN }, -	{ "introduction",    "?????",        SIMPLE, LEVEL_HOST }, /*WRONG*/-	{ "foreward",        "?????",        SIMPLE, LEVEL_HOST }, /*WRONG*/-	{ "afterward",       "?????",        SIMPLE, LEVEL_HOST }, /*WRONG*/+	{ "introduction",    "?introduction?",SIMPLE, LEVEL_HOST }, /*WRONG*/+	{ "foreward",        "?foreward?",   SIMPLE, LEVEL_HOST }, /*WRONG*/+	{ "afterward",       "?afterward?",  SIMPLE, LEVEL_HOST }, /*WRONG*/ 	{ "bookauthor",      "AUTHOR",       PERSON, LEVEL_HOST }, 	{ "booktitle",       "TITLE",        SIMPLE, LEVEL_HOST }, 	{ "booksubtitle",    "SUBTITLE",     SIMPLE, LEVEL_HOST },-	{ "booktitleaddon",  "??????",       SIMPLE, LEVEL_HOST },+	{ "booktitleaddon",  "?booktitleaddon?",SIMPLE, LEVEL_HOST }, 	{ "editor",          "EDITOR",       PERSON, LEVEL_HOST }, 	{ "redactor",        "REDACTOR",     PERSON, LEVEL_HOST }, 	{ "annotator",       "ANNOTATOR",    PERSON, LEVEL_HOST }, 	{ "commentator",     "COMMENTATOR",  PERSON, LEVEL_HOST }, 	{ "translator",      "TRANSLATOR",   PERSON, LEVEL_HOST }, 	{ "volume",          "VOLUME",       SIMPLE, LEVEL_HOST },-	{ "part",            "?????",        SIMPLE, LEVEL_HOST }, /* WRONG */-	{ "volumes",         "?????",        SIMPLE, LEVEL_HOST }, /* WRONG */+	{ "part",            "PART",         SIMPLE, LEVEL_HOST },+	{ "volumes",         "NUMVOLUMES",   SIMPLE, LEVEL_HOST }, 	 	{ "maintitle",       "TITLE",        SIMPLE, LEVEL_HOST+1 }, 	{ "mainsubtitle",    "SUBTITLE",     SIMPLE, LEVEL_HOST+1 },-	{ "maintitleaddon",  "?????",        SIMPLE, LEVEL_HOST+1 },   /*WRONG*/+	{ "maintitleaddon",  "?maintitleaddon?",        SIMPLE, LEVEL_HOST+1 },   /*WRONG*/  	{ "series",          "TITLE",        SIMPLE, LEVEL_HOST+2 }, /* WRONG */ @@ -323,20 +327,20 @@ 	{ "publisher",       "PUBLISHER",    SIMPLE, LEVEL_HOST }, 	{ "location",        "LOCATION",     SIMPLE, LEVEL_HOST }, 	{ "isbn",            "ISBN",         SIMPLE, LEVEL_MAIN },-	{ "chapter",         "?????????",    SIMPLE, LEVEL_MAIN }, /* WRONG */+	{ "chapter",         "CHAPTER",      SIMPLE, LEVEL_MAIN }, 	{ "pages",           "PAGES",        PAGES,  LEVEL_MAIN }, /* WRONG */-	{ "addendum",        "?????????",    SIMPLE, LEVEL_MAIN },+	{ "addendum",        "?addendum?",   SIMPLE, LEVEL_MAIN }, 	{ "doi",             "DOI",          SIMPLE, LEVEL_MAIN },-	{ "eprint",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "eprinttype",      "?????????",    SIMPLE, LEVEL_MAIN },-	{ "url",             "URL",          SIMPLE, LEVEL_MAIN },-	{ "urldate",         "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlday",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlmonth",        "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlyear",         "?????????",    SIMPLE, LEVEL_MAIN },+	{ "eprint",          "",       BIBTEX_EPRINT, LEVEL_MAIN },+	{ "eprinttype",      "",   BIBTEX_EPRINT, LEVEL_MAIN },+	{ "url",             "",         BIBTEX_URL, LEVEL_MAIN },+	{ "urldate",         "URLDATE",      SIMPLE, LEVEL_MAIN },+	{ "urlday",          "?urlday?",     SIMPLE, LEVEL_MAIN },+	{ "urlmonth",        "?urlmonth?",   SIMPLE, LEVEL_MAIN },+	{ "urlyear",         "?urlyear?",    SIMPLE, LEVEL_MAIN }, 	{ "address",         "ADDRESS",      SIMPLE, LEVEL_MAIN }, 	{ "refnum",          "REFNUM",       SIMPLE, LEVEL_MAIN },-	{ " ",               "TYPE|INCOLLECTION",    ALWAYS, LEVEL_MAIN },+	{ " ",               "INTERNAL_TYPE|INCOLLECTION",    ALWAYS, LEVEL_MAIN }, 	{ " ",               "RESOURCE|text",ALWAYS, LEVEL_MAIN }, 	{ " ",               "ISSUANCE|monographic", ALWAYS, LEVEL_MAIN }, 	{ " ",               "GENRE|collection",   ALWAYS, LEVEL_HOST }@@ -351,28 +355,29 @@ 	{ "annotator",       "ANNOTATOR",    PERSON, LEVEL_HOST }, 	{ "commentator",     "COMMENTATOR",  PERSON, LEVEL_HOST }, 	{ "translator",      "TRANSLATOR",   PERSON, LEVEL_HOST },+	{ "eventtitle",      "EVENT:CONF",   SIMPLE, LEVEL_MAIN }, 	{ "year",            "YEAR",         SIMPLE, LEVEL_MAIN },-	{ "introduction",    "?????",        SIMPLE, LEVEL_HOST }, /*WRONG*/-	{ "foreward",        "?????",        SIMPLE, LEVEL_HOST }, /*WRONG*/-	{ "afterward",       "?????",        SIMPLE, LEVEL_HOST }, /*WRONG*/+	{ "introduction",    "?introduction?",SIMPLE, LEVEL_HOST }, /*WRONG*/+	{ "foreward",        "?foreward?",   SIMPLE, LEVEL_HOST }, /*WRONG*/+	{ "afterward",       "?afterward?",  SIMPLE, LEVEL_HOST }, /*WRONG*/ 	{ "title",           "TITLE",        SIMPLE, LEVEL_MAIN }, 	{ "subtitle",        "SUBTITLE",     SIMPLE, LEVEL_MAIN },-	{ "titleaddon",      "?????",        SIMPLE, LEVEL_MAIN },   /*WRONG*/+	{ "titleaddon",      "?titleaddon?", SIMPLE, LEVEL_MAIN },   /*WRONG*/ 	{ "booktitle",       "TITLE",        SIMPLE, LEVEL_HOST }, 	{ "booksubtitle",    "SUBTITLE",     SIMPLE, LEVEL_HOST },-	{ "booktitleaddon",  "??????",       SIMPLE, LEVEL_HOST },   /*WRONG*/+	{ "booktitleaddon",  "?booktitleaddon?",       SIMPLE, LEVEL_HOST },   /*WRONG*/ 	{ "maintitle",       "TITLE",        SIMPLE, LEVEL_HOST+1 }, 	{ "mainsubtitle",    "SUBTITLE",     SIMPLE, LEVEL_HOST+1 },-	{ "maintitleaddon",  "?????",        SIMPLE, LEVEL_HOST+1 },   /*WRONG*/+	{ "maintitleaddon",  "?maintitleaddon?",        SIMPLE, LEVEL_HOST+1 },   /*WRONG*/ 	{ "series",          "TITLE",        SIMPLE, LEVEL_HOST+2 },-	{ "venue",           "??????",       SIMPLE, LEVEL_MAIN },-	{ "organization",    "???????",      SIMPLE, LEVEL_MAIN },+	{ "venue",           "ADDRESS",      SIMPLE, LEVEL_MAIN },+	{ "organization",    "ORGANIZER:CORP", SIMPLE, LEVEL_MAIN }, 	{ "language",        "LANGUAGE",     SIMPLE, LEVEL_MAIN }, 	{ "origlanguage",    "LANGUAGE",     SIMPLE, LEVEL_ORIG }, 	{ "volume",          "VOLUME",       SIMPLE, LEVEL_HOST },-	{ "part",            "?????",        SIMPLE, LEVEL_HOST }, /* WRONG */+	{ "part",            "PART",         SIMPLE, LEVEL_HOST }, 	{ "edition",         "EDITION",      SIMPLE, LEVEL_MAIN },-	{ "volumes",         "?????",        SIMPLE, LEVEL_HOST }, /* WRONG */+	{ "volumes",         "NUMVOLUMES",   SIMPLE, LEVEL_HOST }, 	{ "number",          "NUMBER",       SIMPLE, LEVEL_MAIN }, 	{ "note",            "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annote",          "NOTES",        SIMPLE, LEVEL_MAIN },@@ -380,23 +385,23 @@ 	{ "publisher",       "PUBLISHER",    SIMPLE, LEVEL_HOST }, 	{ "location",        "LOCATION",     SIMPLE, LEVEL_HOST }, 	{ "isbn",            "ISBN",         SIMPLE, LEVEL_MAIN },-	{ "chapter",         "?????????",    SIMPLE, LEVEL_MAIN }, /* WRONG */+	{ "chapter",         "CHAPTER",      SIMPLE, LEVEL_MAIN }, 	{ "pages",           "PAGES",        PAGES,  LEVEL_MAIN }, /* WRONG */-	{ "addendum",        "?????????",    SIMPLE, LEVEL_MAIN },+	{ "addendum",        "?addendnum?",  SIMPLE, LEVEL_MAIN }, 	{ "doi",             "DOI",          SIMPLE, LEVEL_MAIN },-	{ "eprint",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "eprinttype",      "?????????",    SIMPLE, LEVEL_MAIN },-	{ "url",             "URL",          SIMPLE, LEVEL_MAIN },-	{ "urldate",         "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlday",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlmonth",        "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlyear",         "?????????",    SIMPLE, LEVEL_MAIN },+	{ "eprint",          "",       BIBTEX_EPRINT, LEVEL_MAIN },+	{ "eprinttype",      "",   BIBTEX_EPRINT, LEVEL_MAIN },+	{ "url",             "",         BIBTEX_URL, LEVEL_MAIN },+	{ "urldate",         "URLDATE",      SIMPLE, LEVEL_MAIN },+	{ "urlday",          "?urlday?",     SIMPLE, LEVEL_MAIN },+	{ "urlmonth",        "?urlmonth?",   SIMPLE, LEVEL_MAIN },+	{ "urlyear",         "?urlyear?",    SIMPLE, LEVEL_MAIN }, 	{ "address",         "ADDRESS",      SIMPLE, LEVEL_MAIN }, 	{ "refnum",          "REFNUM",       SIMPLE, LEVEL_MAIN },-	{ " ",               "TYPE|INPROCEEDINGS",    ALWAYS, LEVEL_MAIN },+	{ " ",               "INTERNAL_TYPE|INPROCEEDINGS",    ALWAYS, LEVEL_MAIN }, 	{ " ",               "RESOURCE|text",ALWAYS, LEVEL_MAIN }, 	{ " ",               "ISSUANCE|monographic", ALWAYS, LEVEL_MAIN },-	{ " ",               "GENRE|collection",   ALWAYS, LEVEL_HOST }+	{ " ",               "GENRE|conference publication",   ALWAYS, LEVEL_HOST } };  static lookups manual[] = {@@ -416,31 +421,31 @@ 	{ "language",        "LANGUAGE",     SIMPLE, LEVEL_MAIN }, 	{ "edition",         "EDITION",      SIMPLE, LEVEL_MAIN }, 	{ "version",         "???????",      SIMPLE, LEVEL_MAIN },-	{ "type",            "?????",        SIMPLE, LEVEL_MAIN },+	{ "type",            "GENRE",  BIBTEX_GENRE, LEVEL_MAIN }, 	{ "series",          "?????",        SIMPLE, LEVEL_HOST }, /* WRONG */ 	{ "number",          "NUMBER",       SIMPLE, LEVEL_MAIN }, 	{ "note",            "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annote",          "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annotation",      "NOTES",        SIMPLE, LEVEL_MAIN },-	{ "organization",    "?????????",    SIMPLE, LEVEL_MAIN },+	{ "organization",    "ORGANIZER:CORP", SIMPLE, LEVEL_MAIN }, 	{ "publisher",       "PUBLISHER",    SIMPLE, LEVEL_MAIN }, 	{ "location",        "LOCATION",     SIMPLE, LEVEL_MAIN }, 	{ "isbn",            "ISBN",         SIMPLE, LEVEL_MAIN },-	{ "chapter",         "?????????",    SIMPLE, LEVEL_MAIN }, /* WRONG */+	{ "chapter",         "CHAPTER",      SIMPLE, LEVEL_MAIN }, 	{ "pages",           "?????????",    SIMPLE, LEVEL_MAIN }, /* WRONG */ 	{ "pagetotal",       "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "addendum",        "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "doi",             "DOI",          SIMPLE, LEVEL_MAIN },-	{ "eprint",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "eprinttype",      "?????????",    SIMPLE, LEVEL_MAIN },-	{ "url",             "URL",          SIMPLE, LEVEL_MAIN },-	{ "urldate",         "?????????",    SIMPLE, LEVEL_MAIN },+	{ "eprint",          "",       BIBTEX_EPRINT, LEVEL_MAIN },+	{ "eprinttype",      "",   BIBTEX_EPRINT, LEVEL_MAIN },+	{ "url",             "",         BIBTEX_URL, LEVEL_MAIN },+	{ "urldate",         "URLDATE",      SIMPLE, LEVEL_MAIN }, 	{ "urlday",          "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "urlmonth",        "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "urlyear",         "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "address",         "ADDRESS",      SIMPLE, LEVEL_MAIN }, 	{ "refnum",          "REFNUM",       SIMPLE, LEVEL_MAIN },-	{ " ",               "TYPE|REPORT",       ALWAYS, LEVEL_MAIN },+	{ " ",               "INTERNAL_TYPE|REPORT",       ALWAYS, LEVEL_MAIN }, 	{ " ",               "RESOURCE|text",     ALWAYS, LEVEL_MAIN }, 	{ " ",               "GENRE|instruction", ALWAYS, LEVEL_MAIN } };@@ -455,27 +460,27 @@ 	{ "month",           "MONTH",        SIMPLE, LEVEL_MAIN }, 	{ "year",            "YEAR",         SIMPLE, LEVEL_MAIN }, 	{ "language",        "LANGUAGE",     SIMPLE, LEVEL_MAIN },-	{ "howpublished",    "????????",     SIMPLE, LEVEL_MAIN },+	{ "howpublished",    "",       HOWPUBLISHED, LEVEL_MAIN }, 	{ "version",         "???????",      SIMPLE, LEVEL_MAIN },-	{ "type",            "TYPE",         SIMPLE, LEVEL_MAIN },+	{ "type",            "GENRE",  BIBTEX_GENRE, LEVEL_MAIN }, 	{ "note",            "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annote",          "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annotation",      "NOTES",        SIMPLE, LEVEL_MAIN },-	{ "organization",    "?????????",    SIMPLE, LEVEL_MAIN },+	{ "organization",    "ORGANIZER:CORP",SIMPLE, LEVEL_MAIN }, 	{ "publisher",       "PUBLISHER",    SIMPLE, LEVEL_MAIN }, 	{ "location",        "LOCATION",     SIMPLE, LEVEL_MAIN }, 	{ "addendum",        "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "address",         "ADDRESS",      SIMPLE, LEVEL_MAIN }, 	{ "doi",             "DOI",          SIMPLE, LEVEL_MAIN },-	{ "eprint",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "eprinttype",      "?????????",    SIMPLE, LEVEL_MAIN },-	{ "url",             "URL",          SIMPLE, LEVEL_MAIN },-	{ "urldate",         "?????????",    SIMPLE, LEVEL_MAIN },+	{ "eprint",          "",       BIBTEX_EPRINT, LEVEL_MAIN },+	{ "eprinttype",      "",   BIBTEX_EPRINT, LEVEL_MAIN },+	{ "url",             "",         BIBTEX_URL, LEVEL_MAIN },+	{ "urldate",         "URLDATE",      SIMPLE, LEVEL_MAIN }, 	{ "urlday",          "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "urlmonth",        "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "urlyear",         "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "refnum",          "REFNUM",       SIMPLE, LEVEL_MAIN },-	{ " ",               "TYPE|MISC",       ALWAYS, LEVEL_MAIN },+	{ " ",               "INTERNAL_TYPE|MISC",       ALWAYS, LEVEL_MAIN }, };  static lookups online[] = {@@ -490,19 +495,19 @@ 	{ "year",            "YEAR",         SIMPLE, LEVEL_MAIN }, 	{ "language",        "LANGUAGE",     SIMPLE, LEVEL_MAIN }, 	{ "version",         "???????",      SIMPLE, LEVEL_MAIN },-	{ "type",            "?????",        SIMPLE, LEVEL_MAIN },+	{ "type",            "GENRE",  BIBTEX_GENRE, LEVEL_MAIN }, 	{ "note",            "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annote",          "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annotation",      "NOTES",        SIMPLE, LEVEL_MAIN },-	{ "organization",    "?????????",    SIMPLE, LEVEL_MAIN },+	{ "organization",    "ORGANIZER:CORP",    SIMPLE, LEVEL_MAIN }, 	{ "publisher",       "PUBLISHER",    SIMPLE, LEVEL_MAIN }, 	{ "location",        "LOCATION",     SIMPLE, LEVEL_MAIN }, 	{ "addendum",        "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "doi",             "DOI",          SIMPLE, LEVEL_MAIN },-	{ "eprint",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "eprinttype",      "?????????",    SIMPLE, LEVEL_MAIN },-	{ "url",             "URL",          SIMPLE, LEVEL_MAIN },-	{ "urldate",         "?????????",    SIMPLE, LEVEL_MAIN },+	{ "eprint",          "",       BIBTEX_EPRINT, LEVEL_MAIN },+	{ "eprinttype",      "",   BIBTEX_EPRINT, LEVEL_MAIN },+	{ "url",             "",         BIBTEX_URL, LEVEL_MAIN },+	{ "urldate",         "URLDATE",      SIMPLE, LEVEL_MAIN }, 	{ "urlday",          "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "urlmonth",        "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "urlyear",         "?????????",    SIMPLE, LEVEL_MAIN },@@ -514,7 +519,7 @@  static lookups patent[] = { 	{ "author",          "AUTHOR",       PERSON, LEVEL_MAIN },-	{ "holder",          "HOLDER",       PERSON, LEVEL_MAIN },+	{ "holder",          "ASSIGNEE",     PERSON, LEVEL_MAIN }, 	{ "title",           "TITLE",        SIMPLE, LEVEL_MAIN }, 	{ "subtitle",        "SUBTITLE",     SIMPLE, LEVEL_MAIN }, 	{ "titleaddon",      "?????",        SIMPLE, LEVEL_MAIN },   /*WRONG*/@@ -523,23 +528,23 @@ 	{ "month",           "MONTH",        SIMPLE, LEVEL_MAIN }, 	{ "year",            "YEAR",         SIMPLE, LEVEL_MAIN }, 	{ "version",         "???????",      SIMPLE, LEVEL_MAIN },-	{ "type",            "?????",        SIMPLE, LEVEL_MAIN },+	{ "type",            "GENRE",  BIBTEX_GENRE, LEVEL_MAIN }, 	{ "note",            "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annote",          "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annotation",      "NOTES",        SIMPLE, LEVEL_MAIN },-	{ "organization",    "?????????",    SIMPLE, LEVEL_MAIN },+	{ "organization",    "ORGANIZER:CORP",    SIMPLE, LEVEL_MAIN }, 	{ "location",        "LOCATION",     SIMPLE, LEVEL_MAIN }, 	{ "number",          "NUMBER",       SIMPLE, LEVEL_MAIN }, 	{ "addendum",        "?????????",    SIMPLE, LEVEL_MAIN },-	{ "url",             "URL",          SIMPLE, LEVEL_MAIN },-	{ "urldate",         "?????????",    SIMPLE, LEVEL_MAIN },+	{ "url",             "",         BIBTEX_URL, LEVEL_MAIN },+	{ "urldate",         "URLDATE",      SIMPLE, LEVEL_MAIN }, 	{ "urlday",          "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "urlmonth",        "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "urlyear",         "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "address",         "ADDRESS",      SIMPLE, LEVEL_MAIN }, 	{ "refnum",          "REFNUM",       SIMPLE, LEVEL_MAIN }, 	{ " ",               "RESOURCE|text",   ALWAYS, LEVEL_MAIN },-	{ " ",               "TYPE|PATENT",    ALWAYS, LEVEL_MAIN },+	{ " ",               "INTERNAL_TYPE|PATENT",    ALWAYS, LEVEL_MAIN }, 	{ " ",               "GENRE|patent",    ALWAYS, LEVEL_MAIN }, }; @@ -568,10 +573,10 @@ 	{ "issn",            "ISSN",         SIMPLE, LEVEL_HOST }, 	{ "addendum",        "?????",        SIMPLE, LEVEL_MAIN }, 	{ "doi",             "DOI",          SIMPLE, LEVEL_MAIN },-	{ "eprint",          "?????",        SIMPLE, LEVEL_MAIN }, /* WRONG */-	{ "eprinttype",      "?????",        SIMPLE, LEVEL_MAIN }, /* WRONG */-	{ "url",             "URL",          BIBTEX_URL, LEVEL_MAIN },-	{ "urldate",         "?????",        SIMPLE, LEVEL_MAIN }, /* WRONG */+	{ "eprint",          "",       BIBTEX_EPRINT, LEVEL_MAIN },+	{ "eprinttype",      "",   BIBTEX_EPRINT, LEVEL_MAIN },+	{ "url",             "",         BIBTEX_URL, LEVEL_MAIN },+	{ "urldate",         "URLDATE",      SIMPLE, LEVEL_MAIN }, 	{ "urlday",          "?????",        SIMPLE, LEVEL_MAIN }, /* WRONG */ 	{ "urlmonth",        "?????",        SIMPLE, LEVEL_MAIN }, /* WRONG */ 	{ "urlyear",         "?????",        SIMPLE, LEVEL_MAIN }, /* WRONG */@@ -588,6 +593,7 @@ 	{ "annotator",       "ANNOTATOR",    PERSON, LEVEL_MAIN }, 	{ "commentator",     "COMMENTATOR",  PERSON, LEVEL_MAIN }, 	{ "translator",      "TRANSLATOR",   PERSON, LEVEL_MAIN },+	{ "eventtitle",      "EVENT:CONF",   SIMPLE, LEVEL_MAIN }, 	{ "year",            "YEAR",         SIMPLE, LEVEL_MAIN }, 	{ "introduction",    "?????",        SIMPLE, LEVEL_MAIN }, /*WRONG*/ 	{ "foreward",        "?????",        SIMPLE, LEVEL_MAIN }, /*WRONG*/@@ -601,35 +607,35 @@ 	{ "language",        "LANGUAGE",     SIMPLE, LEVEL_MAIN }, 	{ "origlanguage",    "LANGUAGE",     SIMPLE, LEVEL_ORIG }, 	{ "volume",          "VOLUME",       SIMPLE, LEVEL_HOST },-	{ "part",            "?????",        SIMPLE, LEVEL_HOST }, /* WRONG */+	{ "part",            "PART",         SIMPLE, LEVEL_HOST }, 	{ "edition",         "EDITION",      SIMPLE, LEVEL_MAIN },-	{ "volumes",         "?????",        SIMPLE, LEVEL_HOST }, /* WRONG */+	{ "volumes",         "NUMVOLUMES",   SIMPLE, LEVEL_HOST }, 	{ "series",          "?????",        SIMPLE, LEVEL_HOST }, /* WRONG */ 	{ "number",          "NUMBER",       SIMPLE, LEVEL_MAIN }, 	{ "note",            "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annote",          "NOTES",        SIMPLE, LEVEL_MAIN }, 	{ "annotation",      "NOTES",        SIMPLE, LEVEL_MAIN },-	{ "organization",    "ORGANIZATION", SIMPLE, LEVEL_MAIN },+	{ "organization",    "ORGANIZER:CORP",SIMPLE, LEVEL_MAIN }, 	{ "publisher",       "PUBLISHER",    SIMPLE, LEVEL_MAIN }, 	{ "location",        "LOCATION",     SIMPLE, LEVEL_MAIN }, 	{ "isbn",            "ISBN",         SIMPLE, LEVEL_MAIN },-	{ "chapter",         "?????????",    SIMPLE, LEVEL_MAIN }, /* WRONG */+	{ "chapter",         "CHAPTER",      SIMPLE, LEVEL_MAIN }, 	{ "pages",           "?????????",    SIMPLE, LEVEL_MAIN }, /* WRONG */ 	{ "pagetotal",       "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "addendum",        "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "doi",             "DOI",          SIMPLE, LEVEL_MAIN },-	{ "eprint",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "eprinttype",      "?????????",    SIMPLE, LEVEL_MAIN },-	{ "url",             "URL",          SIMPLE, LEVEL_MAIN },-	{ "urldate",         "?????????",    SIMPLE, LEVEL_MAIN },+	{ "eprint",          "",       BIBTEX_EPRINT, LEVEL_MAIN },+	{ "eprinttype",      "",   BIBTEX_EPRINT, LEVEL_MAIN },+	{ "url",             "",         BIBTEX_URL, LEVEL_MAIN },+	{ "urldate",         "URLDATE",      SIMPLE, LEVEL_MAIN }, 	{ "urlday",          "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "urlmonth",        "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "urlyear",         "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "address",         "ADDRESS",      SIMPLE, LEVEL_MAIN }, 	{ "refnum",          "REFNUM",       SIMPLE, LEVEL_MAIN },-	{ " ",               "TYPE|BOOK",    ALWAYS, LEVEL_MAIN },-        { " ",         "RESOURCE|text",       ALWAYS, LEVEL_MAIN },-        { " ",         "GENRE|conference publication",   ALWAYS, LEVEL_MAIN }+	{ " ",               "INTERNAL_TYPE|BOOK",    ALWAYS, LEVEL_MAIN },+        { " ",               "RESOURCE|text",       ALWAYS, LEVEL_MAIN },+        { " ",               "GENRE|conference publication",   ALWAYS, LEVEL_MAIN } };  @@ -649,139 +655,140 @@ 	{ "version",         "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "location",        "LOCATION",     SIMPLE, LEVEL_MAIN }, 	{ "isrn",            "ISRN",         SIMPLE, LEVEL_MAIN },-	{ "chapter",         "?????????",    SIMPLE, LEVEL_MAIN }, /* WRONG */+	{ "chapter",         "CHAPTER",      SIMPLE, LEVEL_MAIN }, 	{ "pages",           "?????????",    SIMPLE, LEVEL_MAIN }, /* WRONG */ 	{ "pagetotal",       "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "addendum",        "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "doi",             "DOI",          SIMPLE, LEVEL_MAIN },-	{ "eprint",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "eprinttype",      "?????????",    SIMPLE, LEVEL_MAIN },-	{ "url",             "URL",          SIMPLE, LEVEL_MAIN },-	{ "urldate",         "?????????",    SIMPLE, LEVEL_MAIN },+	{ "eprint",          "",       BIBTEX_EPRINT, LEVEL_MAIN },+	{ "eprinttype",      "",   BIBTEX_EPRINT, LEVEL_MAIN },+	{ "url",             "",         BIBTEX_URL, LEVEL_MAIN },+	{ "urldate",         "URLDATE",      SIMPLE, LEVEL_MAIN }, 	{ "urlday",          "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "urlmonth",        "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "urlyear",         "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "address",         "ADDRESS",      SIMPLE, LEVEL_MAIN }, 	{ "refnum",          "REFNUM",       SIMPLE, LEVEL_MAIN },-	{ " ",         "TYPE|REPORT",     ALWAYS, LEVEL_MAIN },-	{ " ",         "RESOURCE|text",   ALWAYS, LEVEL_MAIN },-	{ " ",         "GENRE|report",    ALWAYS, LEVEL_MAIN }+	{ " ",               "INTERNAL_TYPE|REPORT",     ALWAYS, LEVEL_MAIN },+	{ " ",               "RESOURCE|text",   ALWAYS, LEVEL_MAIN },+	{ " ",               "GENRE|report",    ALWAYS, LEVEL_MAIN } };  static lookups thesis[] = {-	{ "author",    "AUTHOR",    PERSON, LEVEL_MAIN },-	{ "title",           "TITLE",        SIMPLE, LEVEL_MAIN },-	{ "subtitle",        "SUBTITLE",     SIMPLE, LEVEL_MAIN },-	{ "titleaddon",      "?????",        SIMPLE, LEVEL_MAIN },   /*WRONG*/-	{ "year",      "YEAR",      SIMPLE, LEVEL_MAIN },-	{ "month",     "MONTH",     SIMPLE, LEVEL_MAIN },-	{ "day",       "DAY",       SIMPLE, LEVEL_MAIN },-	{ "type",      "GENRE",     SIMPLE, LEVEL_MAIN },+	{ "author",    "AUTHOR",             PERSON, LEVEL_MAIN },+	{ "title",     "TITLE",              SIMPLE, LEVEL_MAIN },+	{ "subtitle",  "SUBTITLE",           SIMPLE, LEVEL_MAIN },+	{ "titleaddon","?????",              SIMPLE, LEVEL_MAIN },   /*WRONG*/+	{ "year",      "YEAR",               SIMPLE, LEVEL_MAIN },+	{ "month",     "MONTH",              SIMPLE, LEVEL_MAIN },+	{ "day",       "DAY",                SIMPLE, LEVEL_MAIN },+	{ "type",      "GENRE",        BIBTEX_GENRE, LEVEL_MAIN }, 	{ "institution","DEGREEGRANTOR:ASIS",SIMPLE, LEVEL_MAIN }, 	{ "school",     "DEGREEGRANTOR:ASIS",SIMPLE, LEVEL_MAIN },-	{ "doi",       "DOI",       SIMPLE, LEVEL_MAIN },-	{ "url",       "URL",       BIBTEX_URL, LEVEL_MAIN },-	{ "urldate",         "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlday",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlmonth",        "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlyear",         "?????????",    SIMPLE, LEVEL_MAIN },-	{ "language",     "LANGUAGE",     SIMPLE, LEVEL_MAIN },-	{ "location",     "LOCATION",     SIMPLE, LEVEL_MAIN },-	{ "note",         "NOTES",        SIMPLE, LEVEL_MAIN },-	{ "annote",          "NOTES",        SIMPLE, LEVEL_MAIN },-	{ "annotation",      "NOTES",        SIMPLE, LEVEL_MAIN },-	{ "address",         "ADDRESS",      SIMPLE, LEVEL_MAIN },-	{ "refnum",          "REFNUM",       SIMPLE, LEVEL_MAIN },-	{ " ",         "TYPE|THESIS",   ALWAYS, LEVEL_MAIN },-	{ " ",         "RESOURCE|text", ALWAYS, LEVEL_MAIN },-	{ " ",         "GENRE|thesis",  ALWAYS, LEVEL_MAIN },+	{ "doi",        "DOI",               SIMPLE, LEVEL_MAIN },+	{ "howpublished",    "",       HOWPUBLISHED, LEVEL_MAIN },+	{ "url",        "",              BIBTEX_URL, LEVEL_MAIN },+	{ "urldate",    "URLDATE",           SIMPLE, LEVEL_MAIN },+	{ "urlday",     "?urlday?",          SIMPLE, LEVEL_MAIN },+	{ "urlmonth",   "?urlmonth?",        SIMPLE, LEVEL_MAIN },+	{ "urlyear",    "?urlyear?",         SIMPLE, LEVEL_MAIN },+	{ "language",   "LANGUAGE",          SIMPLE, LEVEL_MAIN },+	{ "location",   "LOCATION",          SIMPLE, LEVEL_MAIN },+	{ "note",       "NOTES",             SIMPLE, LEVEL_MAIN },+	{ "annote",     "NOTES",             SIMPLE, LEVEL_MAIN },+	{ "annotation", "NOTES",             SIMPLE, LEVEL_MAIN },+	{ "address",    "ADDRESS",           SIMPLE, LEVEL_MAIN },+	{ "refnum",    "REFNUM",             SIMPLE, LEVEL_MAIN },+	{ " ",         "INTERNAL_TYPE|THESIS",        ALWAYS, LEVEL_MAIN },+	{ " ",         "RESOURCE|text",      ALWAYS, LEVEL_MAIN },+	{ " ",         "GENRE|thesis",       ALWAYS, LEVEL_MAIN }, };  /* Unpublished */ static lookups unpublished[] = {-	{ "author",    "AUTHOR",    PERSON, LEVEL_MAIN },-	{ "title",           "TITLE",        SIMPLE, LEVEL_MAIN },-	{ "subtitle",        "SUBTITLE",     SIMPLE, LEVEL_MAIN },-	{ "titleaddon",      "?????",        SIMPLE, LEVEL_MAIN },   /*WRONG*/-	{ "howpublished", "??????", SIMPLE, LEVEL_MAIN },-	{ "year",      "YEAR",      SIMPLE, LEVEL_MAIN },-	{ "month",     "MONTH",     SIMPLE, LEVEL_MAIN },-	{ "day",       "DAY",       SIMPLE, LEVEL_MAIN },-	{ "date",      "DATE",      SIMPLE, LEVEL_MAIN },-	{ "url",       "URL",       BIBTEX_URL, LEVEL_MAIN },-	{ "urlday",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlmonth",        "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlyear",         "?????????",    SIMPLE, LEVEL_MAIN },+	{ "author",       "AUTHOR",       PERSON, LEVEL_MAIN },+	{ "title",        "TITLE",        SIMPLE, LEVEL_MAIN },+	{ "subtitle",     "SUBTITLE",     SIMPLE, LEVEL_MAIN },+	{ "titleaddon",   "?????",        SIMPLE, LEVEL_MAIN },   /*WRONG*/+	{ "howpublished", "",       HOWPUBLISHED, LEVEL_MAIN },+	{ "year",         "YEAR",         SIMPLE, LEVEL_MAIN },+	{ "month",        "MONTH",        SIMPLE, LEVEL_MAIN },+	{ "day",          "DAY",          SIMPLE, LEVEL_MAIN },+	{ "date",         "DATE",         SIMPLE, LEVEL_MAIN },+	{ "url",          "",         BIBTEX_URL, LEVEL_MAIN },+	{ "urlday",       "?????????",    SIMPLE, LEVEL_MAIN },+	{ "urlmonth",     "?????????",    SIMPLE, LEVEL_MAIN },+	{ "urlyear",      "?????????",    SIMPLE, LEVEL_MAIN }, 	{ "language",     "LANGUAGE",     SIMPLE, LEVEL_MAIN }, 	{ "note",         "NOTES",        SIMPLE, LEVEL_MAIN },-	{ "annote",          "NOTES",        SIMPLE, LEVEL_MAIN },-	{ "annotation",      "NOTES",        SIMPLE, LEVEL_MAIN },-	{ "addendum",        "?????????",    SIMPLE, LEVEL_MAIN },-	{ "address",         "ADDRESS",      SIMPLE, LEVEL_MAIN },-	{ "refnum",          "REFNUM",       SIMPLE, LEVEL_MAIN },-	{ " ",         "TYPE|BOOK",       ALWAYS, LEVEL_MAIN },-	{ " ",         "RESOURCE|text",   ALWAYS, LEVEL_MAIN },-	{ " ",         "GENRE|unpublished",      ALWAYS, LEVEL_MAIN }+	{ "annote",       "NOTES",        SIMPLE, LEVEL_MAIN },+	{ "annotation",   "NOTES",        SIMPLE, LEVEL_MAIN },+	{ "addendum",     "?????????",    SIMPLE, LEVEL_MAIN },+	{ "address",      "ADDRESS",      SIMPLE, LEVEL_MAIN },+	{ "refnum",       "REFNUM",       SIMPLE, LEVEL_MAIN },+	{ " ",            "INTERNAL_TYPE|BOOK",    ALWAYS, LEVEL_MAIN },+	{ " ",            "RESOURCE|text",ALWAYS, LEVEL_MAIN },+	{ " ",            "GENRE|unpublished",ALWAYS, LEVEL_MAIN } };  static lookups phdthesis[] = {-	{ "author",    "AUTHOR",    PERSON, LEVEL_MAIN },-	{ "title",           "TITLE",        SIMPLE, LEVEL_MAIN },-	{ "subtitle",        "SUBTITLE",     SIMPLE, LEVEL_MAIN },-	{ "titleaddon",      "?????",        SIMPLE, LEVEL_MAIN },   /*WRONG*/-	{ "year",      "YEAR",      SIMPLE, LEVEL_MAIN },-	{ "month",     "MONTH",     SIMPLE, LEVEL_MAIN },-	{ "day",       "DAY",       SIMPLE, LEVEL_MAIN },-	{ "type",      "GENRE",     SIMPLE, LEVEL_MAIN },+	{ "author",     "AUTHOR",    PERSON, LEVEL_MAIN },+	{ "title",      "TITLE",        SIMPLE, LEVEL_MAIN },+	{ "subtitle",   "SUBTITLE",     SIMPLE, LEVEL_MAIN },+	{ "titleaddon", "?titleadon?",  SIMPLE, LEVEL_MAIN },   /*WRONG*/+	{ "year",       "YEAR",         SIMPLE, LEVEL_MAIN },+	{ "month",      "MONTH",        SIMPLE, LEVEL_MAIN },+	{ "day",        "DAY",          SIMPLE, LEVEL_MAIN },+	{ "type",       "GENRE",  BIBTEX_GENRE, LEVEL_MAIN }, 	{ "institution","DEGREEGRANTOR:ASIS",SIMPLE, LEVEL_MAIN }, 	{ "school",     "DEGREEGRANTOR:ASIS",SIMPLE, LEVEL_MAIN },-	{ "doi",       "DOI",       SIMPLE, LEVEL_MAIN },-	{ "url",       "URL",       BIBTEX_URL, LEVEL_MAIN },-	{ "urldate",         "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlday",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlmonth",        "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlyear",         "?????????",    SIMPLE, LEVEL_MAIN },-	{ "language",     "LANGUAGE",     SIMPLE, LEVEL_MAIN },-	{ "location",     "LOCATION",     SIMPLE, LEVEL_MAIN },-	{ "note",         "NOTES",        SIMPLE, LEVEL_MAIN },-	{ "annote",          "NOTES",        SIMPLE, LEVEL_MAIN },-	{ "annotation",      "NOTES",        SIMPLE, LEVEL_MAIN },-	{ "address",         "ADDRESS",      SIMPLE, LEVEL_MAIN },-	{ "refnum",          "REFNUM",       SIMPLE, LEVEL_MAIN },-	{ " ",         "TYPE|THESIS",   ALWAYS, LEVEL_MAIN },-	{ " ",         "RESOURCE|text", ALWAYS, LEVEL_MAIN },-	{ " ",         "GENRE|thesis",  ALWAYS, LEVEL_MAIN },-	{ " ",         "GENRE|Ph.D. thesis",  ALWAYS, LEVEL_MAIN }+	{ "doi",        "DOI",         SIMPLE, LEVEL_MAIN },+	{ "howpublished",    "",       HOWPUBLISHED, LEVEL_MAIN },+	{ "url",        "",        BIBTEX_URL, LEVEL_MAIN },+	{ "urldate",    "URLDATE",      SIMPLE, LEVEL_MAIN },+	{ "urlday",     "?urlday?",     SIMPLE, LEVEL_MAIN },+	{ "urlmonth",   "?urlmonth?",   SIMPLE, LEVEL_MAIN },+	{ "urlyear",    "?urlyear?",    SIMPLE, LEVEL_MAIN },+	{ "language",   "LANGUAGE",     SIMPLE, LEVEL_MAIN },+	{ "location",   "LOCATION",     SIMPLE, LEVEL_MAIN },+	{ "note",       "NOTES",        SIMPLE, LEVEL_MAIN },+	{ "annote",     "NOTES",        SIMPLE, LEVEL_MAIN },+	{ "annotation", "NOTES",        SIMPLE, LEVEL_MAIN },+	{ "address",    "ADDRESS",      SIMPLE, LEVEL_MAIN },+	{ "refnum",     "REFNUM",       SIMPLE, LEVEL_MAIN },+	{ " ",          "INTERNAL_TYPE|THESIS",   ALWAYS, LEVEL_MAIN },+	{ " ",          "RESOURCE|text", ALWAYS, LEVEL_MAIN },+	{ " ",          "GENRE|Ph.D. thesis",  ALWAYS, LEVEL_MAIN } };  static lookups mastersthesis[] = {-	{ "author",    "AUTHOR",    PERSON, LEVEL_MAIN },-	{ "title",           "TITLE",        SIMPLE, LEVEL_MAIN },-	{ "subtitle",        "SUBTITLE",     SIMPLE, LEVEL_MAIN },-	{ "titleaddon",      "?????",        SIMPLE, LEVEL_MAIN },   /*WRONG*/-	{ "year",      "YEAR",      SIMPLE, LEVEL_MAIN },-	{ "month",     "MONTH",     SIMPLE, LEVEL_MAIN },-	{ "day",       "DAY",       SIMPLE, LEVEL_MAIN },-	{ "type",      "GENRE",     SIMPLE, LEVEL_MAIN },+	{ "author",     "AUTHOR",            PERSON, LEVEL_MAIN },+	{ "title",      "TITLE",             SIMPLE, LEVEL_MAIN },+	{ "subtitle",   "SUBTITLE",          SIMPLE, LEVEL_MAIN },+	{ "titleaddon", "?titleaddon?",      SIMPLE, LEVEL_MAIN },   /*WRONG*/+	{ "year",       "YEAR",              SIMPLE, LEVEL_MAIN },+	{ "month",      "MONTH",             SIMPLE, LEVEL_MAIN },+	{ "day",        "DAY",               SIMPLE, LEVEL_MAIN },+	{ "type",       "GENRE",       BIBTEX_GENRE, LEVEL_MAIN }, 	{ "institution","DEGREEGRANTOR:ASIS",SIMPLE, LEVEL_MAIN }, 	{ "school",     "DEGREEGRANTOR:ASIS",SIMPLE, LEVEL_MAIN },-	{ "doi",       "DOI",       SIMPLE, LEVEL_MAIN },-	{ "url",       "URL",       BIBTEX_URL, LEVEL_MAIN },-	{ "urldate",         "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlday",          "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlmonth",        "?????????",    SIMPLE, LEVEL_MAIN },-	{ "urlyear",         "?????????",    SIMPLE, LEVEL_MAIN },-	{ "language",     "LANGUAGE",     SIMPLE, LEVEL_MAIN },-	{ "location",     "LOCATION",     SIMPLE, LEVEL_MAIN },-	{ "note",         "NOTES",        SIMPLE, LEVEL_MAIN },-	{ "annote",          "NOTES",        SIMPLE, LEVEL_MAIN },-	{ "annotation",      "NOTES",        SIMPLE, LEVEL_MAIN },-	{ "address",         "ADDRESS",      SIMPLE, LEVEL_MAIN },-	{ "refnum",          "REFNUM",       SIMPLE, LEVEL_MAIN },-	{ " ",         "TYPE|THESIS",   ALWAYS, LEVEL_MAIN },-	{ " ",         "RESOURCE|text", ALWAYS, LEVEL_MAIN },-	{ " ",         "GENRE|thesis",  ALWAYS, LEVEL_MAIN },-	{ " ",         "GENRE|Masters thesis",  ALWAYS, LEVEL_MAIN },+	{ "doi",        "DOI",               SIMPLE, LEVEL_MAIN },+	{ "howpublished",    "",       HOWPUBLISHED, LEVEL_MAIN },+	{ "url",        "",              BIBTEX_URL, LEVEL_MAIN },+	{ "urldate",    "URLDATE",      SIMPLE, LEVEL_MAIN },+	{ "urlday",     "?urlday?",     SIMPLE, LEVEL_MAIN },+	{ "urlmonth",   "?urlmonth?",   SIMPLE, LEVEL_MAIN },+	{ "urlyear",    "?urlyear?",    SIMPLE, LEVEL_MAIN },+	{ "language",   "LANGUAGE",     SIMPLE, LEVEL_MAIN },+	{ "location",   "LOCATION",     SIMPLE, LEVEL_MAIN },+	{ "note",       "NOTES",        SIMPLE, LEVEL_MAIN },+	{ "annote",     "NOTES",        SIMPLE, LEVEL_MAIN },+	{ "annotation", "NOTES",        SIMPLE, LEVEL_MAIN },+	{ "address",    "ADDRESS",      SIMPLE, LEVEL_MAIN },+	{ "refnum",     "REFNUM",       SIMPLE, LEVEL_MAIN },+	{ " ",          "INTERNAL_TYPE|THESIS",   ALWAYS, LEVEL_MAIN },+	{ " ",          "RESOURCE|text", ALWAYS, LEVEL_MAIN },+	{ " ",          "GENRE|Masters thesis",  ALWAYS, LEVEL_MAIN }, };  #define ORIG(a) ( &(a[0]) )
bibutils/charsets.c view
@@ -1,7 +1,7 @@ /*  * charsets.h  *- * Copyright (c) Chris Putnam 2003-2009+ * Copyright (c) Chris Putnam 2003-2010  *  * Source code released under the GPL  *
bibutils/charsets.h view
@@ -1,7 +1,7 @@ /*  * charsets.h  *- * Copyright (c) Chris Putnam 2003-2009+ * Copyright (c) Chris Putnam 2003-2010  *  * Source code released under the GPL  *
bibutils/copacin.c view
@@ -1,7 +1,7 @@ /*  * copacin.c  *- * Copyright (c) Chris Putnam 2004-2009+ * Copyright (c) Chris Putnam 2004-2010  *  * Program and source code released under the GPL  *@@ -19,6 +19,34 @@ #include "reftypes.h" #include "serialno.h" #include "copacin.h"++void+copacin_initparams( param *p, const char *progname )+{+	p->readformat       = BIBL_COPACIN;+	p->charsetin        = BIBL_CHARSET_DEFAULT;+	p->charsetin_src    = BIBL_SRC_DEFAULT;+	p->latexin          = 0;+	p->xmlin            = 0;+	p->utf8in           = 0;+	p->nosplittitle     = 0;+	p->verbose          = 0;+	p->addcount         = 0;++	p->readf    = copacin_readf;+	p->processf = copacin_processf;+	p->cleanf   = NULL;+	p->typef    = NULL;+	p->convertf = copacin_convertf;+	p->all      = copac_all;+	p->nall     = copac_nall;++	list_init( &(p->asis) );+	list_init( &(p->corps) );++	if ( !progname ) p->progname = NULL;+	else p->progname = strdup( progname );+}  /* Endnote-Refer/Copac tag definition:     character 1 = alphabetic character
bibutils/copacin.h view
@@ -1,7 +1,7 @@ /*  * copacin.h  *- * Copyright (c) Chris Putnam 2004-2009+ * Copyright (c) Chris Putnam 2004-2010  *  * Program and source code released under the GPL  *@@ -19,6 +19,9 @@ extern int copacin_processf( fields *copacin, char *p, char *filename,  		long nref ); extern void copacin_convertf( fields *copacin, fields *info, int reftype, param *p, variants *all, int nall );++extern void copacin_initparams( param *p, const char *progname );+  extern variants copac_all[]; extern int copac_nall;
bibutils/copactypes.c view
@@ -1,7 +1,7 @@ /*  * copactypes.c  *- * Copyright (c) Chris Putnam 2004-2009+ * Copyright (c) Chris Putnam 2004-2010  *  * Program and source code released under the GPL  *
bibutils/doi.c view
@@ -9,7 +9,7 @@  * is_doi()  * Check for DOI buried in another field.  *- * Copyright (c) Chris Putnam 2008-2009+ * Copyright (c) Chris Putnam 2008-2010  *  * Source code released under the GPL  */@@ -54,6 +54,16 @@ 	construct_url( "http://dx.doi.org", &(info->data[n]), doi_url ); 	if ( url_exists( info, urltag, doi_url ) ) 		newstr_empty( doi_url );+}++void+jstor_to_url( fields *info, int n, char *urltag, newstr *jstor_url )+{+	newstr_empty( jstor_url );+	construct_url( "http://www.jstor.org/stable", &(info->data[n]),+		jstor_url );+	if ( url_exists( info, urltag, jstor_url ) )+		newstr_empty( jstor_url ); }  void
bibutils/doi.h view
@@ -1,7 +1,7 @@ /*  * doi.h  *- * Copyright (c) Chris Putnam 2004-2009+ * Copyright (c) Chris Putnam 2004-2010  *  * Source code released under the GPL  */@@ -14,6 +14,7 @@ extern void doi_to_url( fields *info, int n, char *urltag, newstr *doi_url ); extern int is_doi( char *s ); extern void pmid_to_url( fields *info, int n, char *urltag, newstr *pmid_url );-extern void arxiv_to_url( fields *info, int n, char *urltag, newstr *pmid_url );+extern void arxiv_to_url( fields *info, int n, char *urltag, newstr *arxiv_url );+extern void jstor_to_url( fields *info, int n, char *urltag, newstr *jstor_url );  #endif
bibutils/ebiin.c view
@@ -1,7 +1,7 @@ /*  * ebiin.c  *- * Copyright (c) Chris Putnam 2004-8+ * Copyright (c) Chris Putnam 2004-2010  *  * Program and source code released under the GPL  *@@ -15,6 +15,36 @@ #include "xml.h" #include "xml_encoding.h" #include "ebiin.h"++void+ebiin_initparams( param *p, const char *progname )+{+	p->readformat       = BIBL_EBIIN;+	p->charsetin        = BIBL_CHARSET_UNICODE;+	p->charsetin_src    = BIBL_SRC_DEFAULT;+	p->latexin          = 0;+	p->xmlin            = 1;+	p->utf8in           = 1;+	p->nosplittitle     = 0;+	p->verbose          = 0;+	p->addcount         = 0;+	p->output_raw       = BIBL_RAW_WITHMAKEREFID |+	                      BIBL_RAW_WITHCHARCONVERT;++	p->readf    = ebiin_readf;+	p->processf = ebiin_processf;+	p->cleanf   = NULL;+	p->typef    = NULL;+	p->convertf = NULL;+	p->all      = NULL;+	p->nall     = 0;++	list_init( &(p->asis) );+	list_init( &(p->corps) );++	if ( !progname ) p->progname = NULL;+	else p->progname = strdup( progname );+}  int ebiin_readf( FILE *fp, char *buf, int bufsize, int *bufpos, newstr *line, newstr *reference, int *fcharset )
bibutils/ebiin.h view
@@ -1,7 +1,7 @@ /*  * ebiin.h  *- * Copyright (c) Chris Putnam 2004-2009+ * Copyright (c) Chris Putnam 2004-2010  *  * Program and source code released under the GPL  *@@ -12,10 +12,14 @@ #include "newstr.h" #include "fields.h" #include "reftypes.h"+#include "bibutils.h"  extern int ebiin_readf( FILE *fp, char *buf, int bufsize, int *bufpos, newstr *line, newstr *reference, int *fcharset ); extern int ebiin_processf( fields *ebiin, char *data, char *filename, long nref ); extern void ebiin_convertf( fields *ebiin, fields *info, int reftype, int verbose, variants *all, int nall );++extern void ebiin_initparams( param *p, const char *progname );+  extern variants med_all[]; extern int med_nall;
bibutils/endin.c view
@@ -1,7 +1,7 @@ /*  * endin.c  *- * Copyright (c) Chris Putnam 2003-2009+ * Copyright (c) Chris Putnam 2003-2010  *  * Program and source code released under the GPL  *@@ -21,6 +21,35 @@ #include "reftypes.h" #include "endin.h" +void+endin_initparams( param *p, const char *progname )+{+	p->readformat       = BIBL_ENDNOTEIN;+	p->charsetin        = BIBL_CHARSET_DEFAULT;+	p->charsetin_src    = BIBL_SRC_DEFAULT;+	p->latexin          = 0;+	p->xmlin            = 0;+	p->utf8in           = 0;+	p->nosplittitle     = 0;+	p->verbose          = 0;+	p->addcount         = 0;+	p->output_raw       = 0;++	p->readf    = endin_readf;+	p->processf = endin_processf;+	p->cleanf   = endin_cleanf;+	p->typef    = endin_typef;+	p->convertf = endin_convertf;+	p->all      = end_all;+	p->nall     = end_nall;++	list_init( &(p->asis) );+	list_init( &(p->corps) );++	if ( !progname ) p->progname = NULL;+	else p->progname = strdup( progname );+}+ /* Endnote tag definition:     character 1 = '%'     character 2 = alphabetic character or digit (or other characters)@@ -183,14 +212,14 @@ 	for ( i=0; i<ntypes; ++i ) { 		if ( !strcasecmp( types[i].oldstr, data ) ) { 			found = 1;-			fields_add( info, "TYPE", types[i].newstr, level );+			fields_add( info, "INTERNAL_TYPE", types[i].newstr, level ); 		} 	} 	if ( !found ) { 		fprintf( stderr, "Did not identify reference type '%s'\n", 			data ); 		fprintf( stderr, "Defaulting to journal article type\n");-		fields_add( info, "TYPE", types[0].newstr, level );+		fields_add( info, "INTERNAL_TYPE", types[0].newstr, level ); 	} } 
bibutils/endin.h view
@@ -1,7 +1,7 @@ /*  * endin.h  *- * Copyright (c) Chris Putnam 2003-2009+ * Copyright (c) Chris Putnam 2003-2010  *  * Program and source code released under the GPL  *@@ -20,6 +20,7 @@ extern void endin_convertf( fields *endin, fields *info, int reftype, param *p, variants *all, int nall ); extern void endin_cleanf( bibl *bin, param *p ); +extern void endin_initparams( param *p, const char *progname );  extern variants end_all[]; extern int end_nall;
bibutils/endout.c view
@@ -1,7 +1,7 @@ /*  * endout.c  *- * Copyright (c) Chris Putnam 2004-2009+ * Copyright (c) Chris Putnam 2004-2010  *  * Program and source code released under the GPL  *@@ -17,6 +17,27 @@ #include "doi.h" #include "endout.h" +void+endout_initparams( param *p, const char *progname )+{+	p->writeformat      = BIBL_ENDNOTEOUT;+	p->format_opts      = 0;+	p->charsetout       = BIBL_CHARSET_DEFAULT;+	p->charsetout_src   = BIBL_SRC_DEFAULT;+	p->latexout         = 0;+	p->utf8out          = 0;+	p->utf8bom          = 0;+	p->xmlout           = 0;+	p->nosplittitle     = 0;+	p->verbose          = 0;+	p->addcount         = 0;+	p->singlerefperfile = 0;++	p->headerf = endout_writeheader;+	p->footerf = NULL;+	p->writef  = endout_write;+}+ enum { 	TYPE_UNKNOWN = 0, 	TYPE_GENERIC,                     /* Generic */@@ -406,6 +427,21 @@ }  static void+output_jstor( FILE *fp, fields *info )+{+	newstr jstor_url;+	int i;+	newstr_init( &jstor_url );+	for ( i=0; i<info->nfields; ++i ) {+		if ( strcmp( info->tag[i].data, "JSTOR" ) ) continue;+		jstor_to_url( info, i, "URL", &jstor_url );+		if ( jstor_url.len )+			fprintf( fp, "%%U %s\n", jstor_url.data );+	}+	newstr_free( &jstor_url );+}++static void output_year( FILE *fp, fields *info, int level ) { 	int year = fields_find( info, "YEAR", level );@@ -530,6 +566,7 @@ 	output_doi( fp, info ); 	output_pmid( fp, info ); 	output_arxiv( fp, info );+	output_jstor( fp, info ); 	output_pages( fp, info ); 	fprintf( fp, "\n" ); 	fflush( fp );
bibutils/endout.h view
@@ -1,7 +1,7 @@ /*  * endout.h  *- * Copyright (c) Chris Putnam 2005-2009+ * Copyright (c) Chris Putnam 2005-2010  *  */ #ifndef ENDOUT_H@@ -13,5 +13,8 @@ extern void endout_write( fields *info, FILE *fp, param *p,  		unsigned long refnum ); extern void endout_writeheader( FILE *outptr, param *p );++extern void endout_initparams( param *p, const char *progname );+  #endif
bibutils/endtypes.c view
@@ -1,7 +1,7 @@ /*  * endtypes.c  *- * Copyright (c) Chris Putnam 2003-2009+ * Copyright (c) Chris Putnam 2003-2010  *  * Program and source code released under the GPL  *@@ -15,7 +15,7 @@  /* if no specific type can be identified */ static lookups generic[] = {-	{ "%0", "TYPE",      TYPE,   LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE", TYPE,   LEVEL_MAIN }, 	{ "%A", "AUTHOR",    PERSON, LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -67,7 +67,7 @@ };  static lookups journalarticle[] = {-	{ "%0", "TYPE",         TYPE,     LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",         TYPE,     LEVEL_MAIN }, 	{ "%A", "AUTHOR",       PERSON,   LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",   PERSON,   LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE",SIMPLE, LEVEL_MAIN },@@ -116,7 +116,7 @@ };  static lookups magazinearticle[] = {-	{ "%0", "TYPE",      TYPE,    LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",      TYPE,    LEVEL_MAIN }, 	{ "%A", "AUTHOR",    PERSON,  LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -164,7 +164,7 @@ };  static lookups newspaperarticle[] = {-	{ "%0", "TYPE",      TYPE,    LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",      TYPE,    LEVEL_MAIN }, 	{ "%A", "REPORTER",  PERSON,  LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -211,7 +211,7 @@ };  static lookups book[] = {-	{ "%0", "TYPE",      TYPE,      LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",      TYPE,      LEVEL_MAIN }, 	{ "%A", "AUTHOR",    PERSON,    LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -260,7 +260,7 @@ };  static lookups booksection[] = {-	{ "%0", "TYPE",      TYPE,      LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",      TYPE,      LEVEL_MAIN }, 	{ "%A", "AUTHOR",    PERSON,    LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -310,7 +310,7 @@ };  static lookups editedbook[] = {-	{ "%0", "TYPE",      TYPE,      LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",      TYPE,      LEVEL_MAIN }, 	{ "%A", "EDITOR",    PERSON,    LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -358,7 +358,7 @@ };  static lookups manuscript[] = {-	{ "%0", "TYPE",      TYPE,    LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",      TYPE,    LEVEL_MAIN }, 	{ "%A", "AUTHOR",    PERSON,  LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -398,7 +398,7 @@ };  static lookups communication[] = {-	{ "%0", "TYPE",      TYPE,    LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",      TYPE,    LEVEL_MAIN }, 	{ "%A", "AUTHOR",    PERSON,  LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -437,7 +437,7 @@ };  static lookups proceedings[] = {-	{ "%0", "TYPE",      TYPE,    LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",      TYPE,    LEVEL_MAIN }, 	{ "%A", "AUTHOR",    PERSON,  LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -483,7 +483,7 @@ };  static lookups conferencepaper[] = {-	{ "%0", "TYPE",         TYPE,     LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",         TYPE,     LEVEL_MAIN }, 	{ "%A", "AUTHOR",       PERSON,   LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",   PERSON,   LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE",SIMPLE, LEVEL_MAIN },@@ -530,7 +530,7 @@ };  static lookups thesis[] = {-	{ "%0", "TYPE",         TYPE,   LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",         TYPE,   LEVEL_MAIN }, 	{ "%A", "AUTHOR",       PERSON, LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",   PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -541,7 +541,6 @@ 	{ "%I", "PUBLISHER",    SIMPLE, LEVEL_MAIN },  	{ "%V", "VOLUME",       SIMPLE, LEVEL_MAIN }, 	{ "%P", "NUMPAGES",     PAGES,  LEVEL_MAIN },-/*	{ "%9", "THESIS_TYPE",  SIMPLE, LEVEL_MAIN },*/ 	{ "%9", "GENRE",        SIMPLE, LEVEL_MAIN }, /* thesis type */ 	{ "%8", "MONTH",        DATE,   LEVEL_MAIN }, 	{ "%!", "SHORTTITLE",   TITLE,  LEVEL_MAIN },@@ -572,7 +571,7 @@ };  static lookups program[] = {-	{ "%0", "TYPE",      TYPE,  LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",      TYPE,  LEVEL_MAIN }, 	{ "%A", "AUTHOR",    PERSON   , LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -609,7 +608,7 @@ };  static lookups audiovisual[] = {-	{ "%0", "TYPE",      TYPE     , LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",      TYPE     , LEVEL_MAIN }, 	{ "%A", "WRITER",    PERSON   , LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -650,7 +649,7 @@ };  static lookups broadcast[] = {-	{ "%0", "TYPE",         TYPE,     LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",         TYPE,     LEVEL_MAIN }, 	{ "%A", "AUTHOR",       PERSON,   LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",   PERSON,   LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -692,7 +691,7 @@ };  static lookups electronic[] = {-	{ "%0", "TYPE",      TYPE      , LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",      TYPE      , LEVEL_MAIN }, 	{ "%A", "AUTHOR",    PERSON    , LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -733,7 +732,7 @@ };  static lookups webpage[] = {-	{ "%0", "TYPE",      TYPE      , LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",      TYPE      , LEVEL_MAIN }, 	{ "%A", "AUTHOR",    PERSON    , LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -774,7 +773,7 @@ };  static lookups artwork[] = {-	{ "%0", "TYPE",      TYPE     , LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",      TYPE     , LEVEL_MAIN }, 	{ "%A", "ARTIST",    PERSON   , LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -811,7 +810,7 @@ };  static lookups report[] = {-	{ "%0", "TYPE",      TYPE     , LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",      TYPE     , LEVEL_MAIN }, 	{ "%A", "AUTHOR",    PERSON   , LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -852,7 +851,7 @@ };  static lookups map[] = {-	{ "%0", "TYPE",      TYPE     , LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",      TYPE     , LEVEL_MAIN }, 	{ "%A", "CARTOGRAPHER",    PERSON   , LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -890,7 +889,7 @@ };  static lookups patent[] = {-	{ "%0", "TYPE",      TYPE, LEVEL_MAIN    },+	{ "%0", "INTERNAL_TYPE",      TYPE, LEVEL_MAIN    }, 	{ "%A", "AUTHOR",    PERSON, LEVEL_MAIN  }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -930,7 +929,7 @@ };  static lookups hearing[] = {-	{ "%0", "TYPE",         TYPE, LEVEL_MAIN    },+	{ "%0", "INTERNAL_TYPE",         TYPE, LEVEL_MAIN    }, 	{ "%D", "YEAR",         SIMPLE, LEVEL_MAIN  }, 	{ "%H", "TRANSLATOR",   PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -972,7 +971,7 @@ };  static lookups bill[] = {-	{ "%0", "TYPE",      TYPE, LEVEL_MAIN    },+	{ "%0", "INTERNAL_TYPE",      TYPE, LEVEL_MAIN    }, 	{ "%D", "YEAR",      SIMPLE, LEVEL_MAIN  }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -1014,7 +1013,7 @@ };  static lookups statute[] = {-	{ "%0", "TYPE",      TYPE, LEVEL_MAIN    },+	{ "%0", "INTERNAL_TYPE",      TYPE, LEVEL_MAIN    }, 	{ "%D", "YEAR",      SIMPLE, LEVEL_MAIN  }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -1054,7 +1053,7 @@ };  static lookups lawcase[] = {-	{ "%0", "TYPE",      TYPE, LEVEL_MAIN    },+	{ "%0", "INTERNAL_TYPE",      TYPE, LEVEL_MAIN    }, 	{ "%D", "YEAR",      SIMPLE, LEVEL_MAIN  }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -1095,7 +1094,7 @@ };  static lookups chart[] = {-	{ "%0", "TYPE",      TYPE,   LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",      TYPE,   LEVEL_MAIN }, 	{ "%A", "AUTHOR",    PERSON, LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -1148,7 +1147,7 @@ };  static lookups unpublished[] = {-	{ "%0", "TYPE",      TYPE,   LEVEL_MAIN },+	{ "%0", "INTERNAL_TYPE",      TYPE,   LEVEL_MAIN }, 	{ "%A", "AUTHOR",    PERSON, LEVEL_MAIN }, 	{ "%H", "TRANSLATOR",PERSON, LEVEL_MAIN }, 	{ "%Q", "TRANSLATEDTITLE", SIMPLE, LEVEL_MAIN },@@ -1197,7 +1196,7 @@ 	{ "%[", "ACCESSDATE",   SIMPLE, LEVEL_MAIN }, 	{ "%=", "LASTMODDATE",  SIMPLE, LEVEL_MAIN }, 	{ "%~", "DATABASE",     SIMPLE, LEVEL_MAIN },-        { " ",         "TYPE|BOOK",       ALWAYS, LEVEL_MAIN },+        { " ",         "INTERNAL_TYPE|BOOK",       ALWAYS, LEVEL_MAIN },         { " ",         "RESOURCE|text",   ALWAYS, LEVEL_MAIN },         { " ",         "GENRE|unpublished",      ALWAYS, LEVEL_MAIN }, };
bibutils/endxmlin.c view
@@ -1,7 +1,7 @@ /*  * endxmlin.c  *- * Copyright (c) Chris Putnam 2006-2009+ * Copyright (c) Chris Putnam 2006-2010  *  * Program and source code released under the GPL  */@@ -14,11 +14,42 @@ #include "xml.h" #include "xml_encoding.h" #include "reftypes.h"+#include "endxmlin.h"+#include "endin.h"  typedef struct { 	char *attrib; 	char *internal; } attribs;++void+endxmlin_initparams( param *p, const char *progname )+{+	p->readformat       = BIBL_ENDNOTEXMLIN;+	p->charsetin        = BIBL_CHARSET_DEFAULT;+	p->charsetin_src    = BIBL_SRC_DEFAULT;+	p->latexin          = 0;+	p->xmlin            = 1;+	p->utf8in           = 1;+	p->nosplittitle     = 0;+	p->verbose          = 0;+	p->addcount         = 0;+	p->output_raw       = 0;++	p->readf    = endxmlin_readf;+	p->processf = endxmlin_processf;+	p->cleanf   = NULL;+	p->typef    = endin_typef;+	p->convertf = endin_convertf;+	p->all      = end_all;+	p->nall     = end_nall;++	list_init( &(p->asis) );+	list_init( &(p->corps) );++	if ( !progname ) p->progname = NULL;+	else p->progname = strdup( progname );+}  static int xml_readmore( FILE *fp, char *buf, int bufsize, int *bufpos )
bibutils/endxmlin.h view
@@ -12,9 +12,12 @@ #include "newstr.h" #include "fields.h" #include "reftypes.h"+#include "bibutils.h"  extern int endxmlin_readf( FILE *fp, char *buf, int bufsize, int *bufpos, 	newstr *line, newstr *reference, int *fcharset ); extern int endxmlin_processf( fields *endin, char *p, char *filename, long nref );++extern void endxmlin_initparams( param *p, const char *progname );  #endif
bibutils/entities.c view
@@ -1,7 +1,7 @@ /*  * entities.c  *- * Copyright (c) Chris Putnam 2003-2009+ * Copyright (c) Chris Putnam 2003-2010  *  * Source code released under the GPL  */
bibutils/fields.c view
@@ -1,7 +1,7 @@ /*  * fields.c  *- * Copyright (c) Chris Putnam 2003-2009+ * Copyright (c) Chris Putnam 2003-2010  *  * Source code released under the GPL  *@@ -184,4 +184,11 @@ 		info->used[n] = 1; } +void+fields_replace_or_add( fields *info, char *tag, char *data, int level )+{+	int n = fields_find( info, tag, level );+	if ( n==-1 ) fields_add( info, tag, data, level );+	else newstr_strcpy( &(info->data[n]), data );+} 
bibutils/fields.h view
@@ -38,6 +38,7 @@ extern int  fields_maxlevel( fields *info ); extern void fields_clearused( fields *info ); extern void fields_setused( fields *info, int n );+extern void fields_replace_or_add( fields *info, char *tag, char *data, int level );   #endif
bibutils/gb18030.c view
@@ -48,7 +48,7 @@ }  static int-gb18030_match( unsigned char *s, unsigned char *bytes, unsigned char len )+gb18030_match( unsigned char *s, const unsigned char *bytes, unsigned char len ) { 	int i; 	for ( i=0; i<len; ++i )
bibutils/gb18030_enumeration.c view
@@ -5,6 +5,7 @@         unsigned char bytes[4]; } genums_t; +static const genums_t gb18030_enums[] = { 	{0x0080,4,{0x81,0x30,0x81,0x30,}}, 	{0x0081,4,{0x81,0x30,0x81,0x31,}},
bibutils/is_ws.c view
@@ -1,7 +1,7 @@ /*  * is_ws.c  *- * Copyright (c) Chris Putnam 2003-2009+ * Copyright (c) Chris Putnam 2003-2010  *  * Source code released under the GPL  *
bibutils/isiin.c view
@@ -1,7 +1,7 @@ /*  * isiin.c  *- * Copyright (c) Chris Putnam 2004-2009+ * Copyright (c) Chris Putnam 2004-2010  *  * Program and source code released under the GPL  *@@ -18,6 +18,35 @@ #include "serialno.h" #include "reftypes.h" #include "isiin.h"++void+isiin_initparams( param *p, const char *progname )+{+	p->readformat       = BIBL_ISIIN;+	p->charsetin        = BIBL_CHARSET_DEFAULT;+	p->charsetin_src    = BIBL_SRC_DEFAULT;+	p->latexin          = 0;+	p->xmlin            = 0;+	p->utf8in           = 0;+	p->nosplittitle     = 0;+	p->verbose          = 0;+	p->addcount         = 0;+	p->output_raw       = 0;++	p->readf    = isiin_readf;+	p->processf = isiin_processf;+	p->cleanf   = NULL;+	p->typef    = isiin_typef;+	p->convertf = isiin_convertf;+	p->all      = isi_all;+	p->nall     = isi_nall;++	list_init( &(p->asis) );+	list_init( &(p->corps) );++	if ( !progname ) p->progname = NULL;+	else p->progname = strdup( progname );+}  /* ISI definition of a tag is strict:  *   char 1 = uppercase alphabetic character
bibutils/isiin.h view
@@ -19,6 +19,8 @@ extern void isiin_convertf( fields *isiin, fields *info, int reftype, param *p, variants *all, int nall ); extern int isiin_processf( fields *isiin, char *p, char *filename, long nref ); +extern void isiin_initparams( param *p, const char *progname );+ extern variants isi_all[]; extern int isi_nall; 
bibutils/isiout.c view
@@ -1,7 +1,7 @@ /*  * isiout.c  *- * Copyright (c) Chris Putnam 2008-2009+ * Copyright (c) Chris Putnam 2008-2010  *  * Source code released under the GPL  */@@ -15,6 +15,27 @@ #include "fields.h" #include "bibutils.h" #include "isiout.h"++void+isiout_initparams( param *p, const char *progname )+{+	p->writeformat      = BIBL_ISIOUT;+	p->format_opts      = 0;+	p->charsetout       = BIBL_CHARSET_DEFAULT;+	p->charsetout_src   = BIBL_SRC_DEFAULT;+	p->latexout         = 0;+	p->utf8out          = 0;+	p->utf8bom          = 0;+	p->xmlout           = 0;+	p->nosplittitle     = 0;+	p->verbose          = 0;+	p->addcount         = 0;+	p->singlerefperfile = 0;++	p->headerf = isiout_writeheader;+	p->footerf = NULL;+	p->writef  = isiout_write;+}  enum {         TYPE_UNKNOWN = 0,
bibutils/isiout.h view
@@ -14,4 +14,6 @@ 		unsigned long refnum ); extern void isiout_writeheader( FILE *outptr, param *p ); +extern void isiout_initparams( param *p, const char *progname );+ #endif
bibutils/isitypes.c view
@@ -1,7 +1,7 @@ /*  * isitypes.c  *- * Copyright (c) Chris Putnam 2004-2009+ * Copyright (c) Chris Putnam 2004-2010  *  * Program and source code released under the GPL  *@@ -48,7 +48,7 @@ 	{ "UT",     "ISIREFNUM", SIMPLE, LEVEL_MAIN }, /* ISI unique article identifer */ 	{ "DI",     "DOI",       SIMPLE, LEVEL_MAIN }, -	{ " ",      "TYPE|ARTICLE",           ALWAYS, LEVEL_MAIN },+	{ " ",      "INTERNAL_TYPE|ARTICLE",           ALWAYS, LEVEL_MAIN }, 	{ " ",      "ISSUANCE|continuing",    ALWAYS, LEVEL_HOST }, 	{ " ",      "RESOURCE|text",          ALWAYS, LEVEL_MAIN }, 	{ " ",      "GENRE|periodical",       ALWAYS, LEVEL_HOST },@@ -90,7 +90,7 @@ 	 	{ "PT",     " ",         TYPE,   LEVEL_HOST }, 	{ "DI",     "DOI",       SIMPLE, LEVEL_MAIN },-	{ " ",         "TYPE|BOOK",       ALWAYS, LEVEL_MAIN },+	{ " ",         "INTERNAL_TYPE|BOOK",       ALWAYS, LEVEL_MAIN }, 	{ " ",         "ISSUANCE|monographic",    ALWAYS, LEVEL_MAIN }, 	{ " ",         "RESOURCE|text",   ALWAYS, LEVEL_MAIN }, 	{ " ",         "GENRE|book",      ALWAYS, LEVEL_MAIN }@@ -129,10 +129,10 @@ 	{ "GA",     "ISIDELIVERNUM", SIMPLE, LEVEL_MAIN}, /*ISI document delivery number */ 	{ "UT",     "ISIREFNUM", SIMPLE, LEVEL_MAIN }, /* ISI unique article identifer */ 	{ "DI",     "DOI",       SIMPLE, LEVEL_MAIN },-	{ " ",         "TYPE|INBOOK",   ALWAYS, LEVEL_MAIN },-	{ " ",         "RESOURCE|text", ALWAYS, LEVEL_MAIN },-	{ " ",         "ISSUANCE|monographic",    ALWAYS, LEVEL_HOST },-	{ " ",         "GENRE|book",    ALWAYS, LEVEL_HOST }+	{ " ",      "INTERNAL_TYPE|INBOOK",   ALWAYS, LEVEL_MAIN },+	{ " ",      "RESOURCE|text", ALWAYS, LEVEL_MAIN },+	{ " ",      "ISSUANCE|monographic",    ALWAYS, LEVEL_HOST },+	{ " ",      "GENRE|book",    ALWAYS, LEVEL_HOST } };  static lookups bookinseries[] = {@@ -171,7 +171,7 @@ 	{ "UT",     "ISIREFNUM", SIMPLE, LEVEL_MAIN }, /* ISI unique article identifer */ 	{ "DI",     "DOI",       SIMPLE, LEVEL_MAIN }, -	{ " ",      "TYPE|INCOLLECTION",      ALWAYS, LEVEL_MAIN },+	{ " ",      "INTERNAL_TYPE|INCOLLECTION",      ALWAYS, LEVEL_MAIN }, 	{ " ",      "ISSUANCE|monographic",   ALWAYS, LEVEL_HOST }, 	{ " ",      "RESOURCE|text",          ALWAYS, LEVEL_MAIN }, 	{ " ",      "GENRE|collection",       ALWAYS, LEVEL_MAIN }
bibutils/latex.c view
@@ -3,7 +3,7 @@  *  * convert between latex special chars and unicode  *- * Copyright (c) Chris Putnam 2004-2009+ * Copyright (c) Chris Putnam 2004-2010  *  * Source code released under the GPL  *
bibutils/list.c view
@@ -1,7 +1,7 @@ /*  * list.c  *- * Copyright (c) Chris Putnam 2004-2009+ * Copyright (c) Chris Putnam 2004-2010  *  * Source code released under the GPL  *
bibutils/medin.c view
@@ -1,7 +1,7 @@ /*  * medin.c  *- * Copyright (c) Chris Putnam 2004-2009+ * Copyright (c) Chris Putnam 2004-2010  *  * Program and source code released under the GPL  *@@ -15,13 +15,45 @@ #include "xml.h" #include "xml_encoding.h" #include "medin.h"+#include "bibutils.h" +void+medin_initparams( param *p, const char *progname )+{+	p->readformat       = BIBL_MEDLINEIN;+	p->charsetin        = BIBL_CHARSET_UNICODE;+	p->charsetin_src    = BIBL_SRC_DEFAULT;+	p->latexin          = 0;+	p->xmlin            = 1;+	p->utf8in           = 1;+	p->nosplittitle     = 0;+	p->verbose          = 0;+	p->addcount         = 0;+	p->output_raw       = BIBL_RAW_WITHMAKEREFID |+	                      BIBL_RAW_WITHCHARCONVERT;++	p->readf    = medin_readf;+	p->processf = medin_processf;+	p->cleanf   = NULL;+	p->typef    = NULL;+/*	p->convertf = medin_convertf;*/+	p->convertf = NULL;+	p->all      = NULL;+	p->nall     = 0;++	list_init( &(p->asis) );+	list_init( &(p->corps) );++	if ( !progname ) p->progname = NULL;+	else p->progname = strdup( progname );+}+ /*  * The only difference between MEDLINE and PUBMED in format is  * that the entire library is wrapped in <MedlineCitationSet>  * or <PubmedArticle> tags...  */-static char *wrapper[] = { "MedlineCitationSet", "PubmedArticle" };+static char *wrapper[] = { "PubmedArticle", "MedlineCitation" }; static int nwrapper = sizeof( wrapper ) / sizeof( wrapper[0] );  static char *@@ -31,7 +63,7 @@ 	int i; 	for ( i=0; i<nwrapper && startptr==NULL; ++i ) { 		startptr = xml_findstart( buf, wrapper[ i ] );-		if ( startptr ) *ntype = i;+		if ( startptr && *ntype==-1 ) *ntype = i; 	} 	return startptr; }@@ -48,7 +80,7 @@ { 	newstr tmp; 	char *startptr = NULL, *endptr;-	int haveref = 0, inref = 0, file_charset = CHARSET_UNKNOWN, m, type = 1;+	int haveref = 0, inref = 0, file_charset = CHARSET_UNKNOWN, m, type = -1; 	newstr_init( &tmp ); 	while ( !haveref && newstr_fget( fp, buf, bufsize, bufpos, line ) ) { 		if ( line->data ) {@@ -142,35 +174,36 @@ { 	newstr tmp; 	char *p, *q;+ 	newstr_init( &tmp );+ 	/* extract year */ 	p = string; 	q = skip_notws( string );-/*	p = q = string;*/-/*	while ( *q && !is_ws(*q) ) q++;*/ 	newstr_segcpy( &tmp, p, q ); 	fields_add( info, "PARTYEAR", tmp.data, level ); 	q = skip_ws( q );+ 	/* extract month */ 	if ( q ) { 		p = q; 		newstr_empty( &tmp ); 		q = skip_notws( q );-/*		while ( *q && !is_ws(*q) ) q++;*/ 		newstr_segcpy( &tmp, p, q ); 		newstr_findreplace( &tmp, "-", "/" ); 		fields_add( info, "PARTMONTH", tmp.data, level ); 		q = skip_ws( q ); 	}+ 	/* extract day */ 	if ( q ) { 		p = q; 		newstr_empty( &tmp ); 		q = skip_notws( q );-/*		while ( *q && !is_ws(*q) ) q++;*/ 		newstr_segcpy( &tmp, p, q ); 		fields_add( info, "PARTDAY", tmp.data, level ); 	}+ 	newstr_free( &tmp ); } @@ -208,13 +241,15 @@ medin_journal1( xml *node, fields *info ) { 	xml_convert c[] = {-		{ "ISSN",     NULL, NULL, "ISSN",      1 },-		{ "Volume",   NULL, NULL, "VOLUME",    1 },-		{ "Issue",    NULL, NULL, "ISSUE",     1 },-		{ "Year",     NULL, NULL, "PARTYEAR",  1 },-		{ "Month",    NULL, NULL, "PARTMONTH", 1 },-		{ "Day",      NULL, NULL, "PARTDAY",   1 },-		{ "Language", NULL, NULL, "LANGUAGE",  1 },+		{ "Title",           NULL, NULL, "TITLE",      1 },+		{ "ISOAbbreviation", NULL, NULL, "SHORTTITLE", 1 },+		{ "ISSN",            NULL, NULL, "ISSN",       1 },+		{ "Volume",          NULL, NULL, "VOLUME",     1 },+		{ "Issue",           NULL, NULL, "ISSUE",      1 },+		{ "Year",            NULL, NULL, "PARTYEAR",   1 },+		{ "Month",           NULL, NULL, "PARTMONTH",  1 },+		{ "Day",             NULL, NULL, "PARTDAY",    1 },+		{ "Language",        NULL, NULL, "LANGUAGE",   1 }, 	}; 	int nc = sizeof( c ) / sizeof( c[0] );; 	if ( xml_hasdata( node ) && !medin_doconvert( node, info, c, nc ) ) {@@ -277,6 +312,9 @@  *        ( or <FirstName>David P</FirstName> )  *        <Initials>DP</Initials>  *    </Author>+ *    <Author>+ *        <CollectiveName>Organization</CollectiveName>+ *    </Author>  * </AuthorList>  */ static void@@ -304,11 +342,18 @@ 			if ( !is_ws(*p) ) newstr_addchar( name, *p++ ); 		} 	}-	if ( node->down ) medin_author( node->down, name ); 	if ( node->next ) medin_author( node->next, name ); }  static void+medin_corpauthor( xml *node, newstr *name )+{+	if ( xml_tagexact( node, "CollectiveName" ) ) {+		newstr_strcpy( name, xml_data( node ) );+	} else if ( node->next ) medin_corpauthor( node->next, name );+}++static void medin_authorlist( xml *node, fields *info ) { 	newstr name;@@ -317,7 +362,13 @@ 	while ( node ) { 		if ( xml_tagexact( node, "Author" ) && node->down ) { 			medin_author( node->down, &name );-			if ( name.len ) fields_add(info,"AUTHOR",name.data,0);+			if ( name.len ) {+				fields_add(info,"AUTHOR",name.data,0);+			} else {+				medin_corpauthor( node->down, &name );+				if ( name.len )+					fields_add(info,"AUTHOR:CORP",name.data,0);+			} 			newstr_empty( &name ); 		} 		node = node->next;@@ -340,7 +391,7 @@ static void medin_journal2( xml *node, fields *info ) {-	if ( xml_tagwithdata( node, "MedlineTA" ) )+	if ( xml_tagwithdata( node, "MedlineTA" ) && fields_find( info, "TITLE", 1 )==-1 ) 		fields_add( info, "TITLE", xml_data( node ), 1 ); 	if ( node->down ) medin_journal2( node->down, info ); 	if ( node->next ) medin_journal2( node->next, info );@@ -413,12 +464,16 @@ 		medin_abstract( node->down, info ); 	else if ( xml_tagexact( node, "AuthorList" ) ) 		medin_authorlist( node, info );+	else if ( xml_tagexact( node, "Affiliation" ) )+		fields_add( info, "ADDRESS", xml_data( node ), 0 ); 	if ( node->next ) medin_article( node->next, info ); }  static void medin_medlinecitation( xml *node, fields *info ) {+	if ( xml_tagexact( node, "PMID" ) && node->value->data )+		fields_add( info, "PMID", node->value->data, 0 ); 	if ( node->down ) { 		if ( xml_tagexact( node, "Article" ) ) 			medin_article( node->down, info );@@ -445,10 +500,14 @@ static void medin_assembleref( xml *node, fields *info ) {-	if ( xml_tagexact( node, "PubmedArticle" ) ||-	     xml_tagexact( node, "MedlineCitationSet" ) ) {-		if ( node->down ) medin_pubmedarticle( node->down, info );-	} else if ( node->down ) medin_assembleref( node->down, info );+	if ( node->down ) {+		if ( xml_tagexact( node, "PubmedArticle" ) )+			medin_pubmedarticle( node->down, info );+		else if ( xml_tagexact( node, "MedlineCitation" ) )+			medin_medlinecitation( node->down, info );+		else medin_assembleref( node->down, info );+	}+ 	if ( node->next ) medin_assembleref( node->next, info ); 	/* assume everything is a journal article */ 	if ( info->nfields ) {
bibutils/medin.h view
@@ -12,10 +12,13 @@ #include "newstr.h" #include "fields.h" #include "reftypes.h"+#include "bibutils.h"  extern int medin_readf( FILE *fp, char *buf, int bufsize, int *bufpos, newstr *line, newstr *reference, int *fcharset ); extern int medin_processf( fields *medin, char *data, char *filename, long nref ); extern void medin_convertf( fields *medin, fields *info, int reftype, int verbose, variants *all, int nall );++extern void medin_initparams( param *p, const char *progname );  extern variants med_all[]; extern int med_nall;
bibutils/modsin.c view
@@ -1,7 +1,7 @@ /*  * modsin.c  *- * Copyright (c) Chris Putnam 2004-2009+ * Copyright (c) Chris Putnam 2004-2010  *  * Source code released under the GPL  *@@ -19,7 +19,42 @@ #include "reftypes.h" #include "modstypes.h" #include "marc.h"+#include "bibutils.h"+#include "modsin.h" +void+modsin_initparams( param *p, const char *progname )+{++	p->readformat       = BIBL_MODSIN;+	p->format_opts      = 0;+	p->charsetin        = BIBL_CHARSET_UNICODE;+	p->charsetin_src    = BIBL_SRC_DEFAULT;+	p->latexin          = 0;+	p->utf8in           = 1;+	p->xmlin            = 1;+	p->nosplittitle     = 0;+	p->verbose          = 0;+	p->addcount         = 0;+	p->singlerefperfile = 0;+	p->output_raw       = BIBL_RAW_WITHMAKEREFID |+	                      BIBL_RAW_WITHCHARCONVERT;++	p->readf    = modsin_readf;+	p->processf = modsin_processf;+	p->cleanf   = NULL;+	p->typef    = NULL;+	p->convertf = NULL;+	p->all      = NULL;+	p->nall     = 0;++	list_init( &(p->asis) );+	list_init( &(p->corps) );++	if ( !progname ) p->progname = NULL;+	else p->progname = strdup( progname );+}+ static char modsns[]="mods";  static void@@ -153,7 +188,7 @@ 		newstrs_init( &title, &subtitle, NULL ); 		modsin_titler( node->down, &title, &subtitle ); 		if ( title.len ) {-			if ( abbr ) +			if ( abbr ) 				fields_add( info, "SHORTTITLE", title.data, level ); 			else 				fields_add( info, "TITLE", title.data, level );@@ -573,6 +608,22 @@ }  static void+modsin_recordinfo( xml *node, fields *info, int level )+{+	xml *curr;++	/* extract recordIdentifier */+	curr = node;+	while ( curr ) {+		if ( xml_tagexact( curr, "recordIdentifier" ) ) {+			fields_add( info, "REFNUM", curr->value->data, level );+		}+		curr = curr->next;+	}++}++static void modsin_identifier( xml *node, fields *info, int level ) { 	convert ids[] = {@@ -589,7 +640,8 @@ 		{ "pii",           "PII"          }, 		{ "isi",           "ISIREFNUM"    }, 		{ "serial number", "SERIALNUMBER" },-		{ "accessnum",     "ACCESSNUM"    }+		{ "accessnum",     "ACCESSNUM"    },+		{ "jstor",         "JSTOR"        }, 	}; 	int i , n = sizeof( ids ) / sizeof( ids[0] ); 	if ( !node->value || !node->value->data ) return;@@ -610,6 +662,8 @@ 		modsin_corp( node, info, level ); 	else if ( xml_tagexact( node, "name" ) ) 		modsin_asis( node, info, level );+	else if ( xml_tagexact( node, "recordInfo" ) && node->down )+		modsin_recordinfo( node->down, info, level ); 	else if  ( xml_tagexact( node, "part" ) ) 		modsin_part( node, info, level ); 	else if ( xml_tagexact( node, "identifier" ) )
bibutils/modsin.h view
@@ -16,6 +16,6 @@ extern int modsin_readf( FILE *fp, char *buf, int bufsize, int *bufpos, newstr *line, newstr *reference, int *fcharset ); extern int modsin_processf( fields *medin, char *data, char *filename, long nref ); extern void modsin_convertf( fields *medin, fields *info, int reftype, int verbose, variants *all, int nall );+extern void modsin_initparams( param *p, const char *progname );  #endif-
bibutils/modsout.c view
@@ -1,7 +1,7 @@ /*  * modsout.c  *- * Copyright (c) Chris Putnam 2003-2009+ * Copyright (c) Chris Putnam 2003-2010  *  * Source code released under the GPL  *@@ -18,6 +18,27 @@ #include "modstypes.h" #include "marc.h" +void+modsout_initparams( param *p, const char *progname )+{+	p->writeformat      = BIBL_MODSOUT;+	p->format_opts      = 0;+	p->charsetout       = BIBL_CHARSET_UNICODE;+	p->charsetout_src   = BIBL_SRC_DEFAULT;+	p->latexout         = 0;+	p->utf8out          = 1;+	p->utf8bom          = 1;+	p->xmlout           = 1;+	p->nosplittitle     = 0;+	p->verbose          = 0;+	p->addcount         = 0;+	p->singlerefperfile = 0;++	p->headerf = modsout_writeheader;+	p->footerf = modsout_writefooter;+	p->writef  = modsout_write;+}+ static int increment_level( int level, int amt ) {@@ -196,6 +217,7 @@ 	  { "redactor",      "REDACTOR",           NO_AUTHORITY   }, 	  { "reporter",      "REPORTER",           NO_AUTHORITY   }, 	  { "translator",    "TRANSLATOR",         MARC_AUTHORITY },+	  { "event",         "EVENT",              NO_AUTHORITY   }, 	  { "author",        "2ND_AUTHOR",         MARC_AUTHORITY }, 	  { "author",        "3RD_AUTHOR",         MARC_AUTHORITY }, 	  { "author",        "SUB_AUTHOR",         MARC_AUTHORITY },@@ -205,16 +227,17 @@ 	}; 	int       i, n, ntypes = sizeof( names ) / sizeof( convert ); 	newstr role;-	int f_asis, f_corp;+	int f_asis, f_corp, f_conf;  	newstr_init( &role ); 	for ( n=0; n<ntypes; ++n ) { 		for ( i=0; i<info->nfields; ++i ) { 			if ( info->level[i]!=level ) continue;-			f_asis = f_corp = 0;+			f_asis = f_corp = f_conf = 0; 			newstr_strcpy( &role, info->tag[i].data ); 			if ( newstr_findreplace( &role, ":ASIS", "" )) f_asis=1; 			if ( newstr_findreplace( &role, ":CORP", "" )) f_corp=1;+			if ( newstr_findreplace( &role, ":CONF", "" )) f_conf=1; 			if ( strcasecmp( role.data, names[n].internal ) ) 				continue; 			if ( f_asis ) {@@ -225,6 +248,10 @@ 				output_tab0( outptr, level ); 				fprintf( outptr, "<name type=\"corporate\">\n" ); 				output_fill2( outptr, increment_level(level,1), "namePart", info, i, 1 );+			} else if ( f_conf ) {+				output_tab0( outptr, level );+				fprintf( outptr, "<name type=\"conference\">\n" );+				output_fill2( outptr, increment_level(level,1), "namePart", info, i, 1 ); 			} else { 				output_name(outptr, info->data[i].data, level); 			}@@ -307,10 +334,11 @@ output_origin( fields *info, FILE *outptr, int level ) { 	convert origin[] = {-		{ "issuance",	"ISSUANCE",	0 },-		{ "publisher",	"PUBLISHER",	0 },-		{ "place",	"ADDRESS",	1 },-		{ "edition",	"EDITION",	0 }+		{ "issuance",	  "ISSUANCE",	0 },+		{ "publisher",	  "PUBLISHER",	0 },+		{ "place",	  "ADDRESS",	1 },+		{ "edition",	  "EDITION",	0 },+		{ "dateCaptured", "URLDATE",    0 } 	}; 	int n, ntypes = sizeof( origin ) / sizeof ( convert ); 	int found, datefound, pos[5], date[4];@@ -358,7 +386,11 @@ output_description( fields *info, FILE *outptr, int level ) { 	int n = fields_find( info, "DESCRIPTION", level );-	output_fill2( outptr, level, "physicalDescription", info, n, 1 );+	if (n != -1) {+		output_tab1( outptr, level, "<physicalDescription>\n" );+		output_fill2( outptr, increment_level(level,1), "note", info, n, 1 );+		output_tab1( outptr, level, "</physicalDescription>\n" );+	} }  static void@@ -504,11 +536,14 @@ 		{ "number",          "NUMBER",          -1 }, 		{ "publiclawnumber", "PUBLICLAWNUMBER", -1 }, 		{ "session",         "SESSION",         -1 },-		{ "articlenumber",   "ARTICLENUMBER",   -1 }+		{ "articlenumber",   "ARTICLENUMBER",   -1 },+		{ "part",            "PART",            -1 },+		{ "chapter",         "CHAPTER",         -1 } 	};-	int i, nparts = sizeof( parts ) / sizeof( convert );+	int i, nparts = sizeof( parts ) / sizeof( convert ), n; -	if ( !find_alltags( info, parts, nparts, level ) ) return 0;+	n = fields_find( info, "NUMVOLUMES", level );+	if ( !find_alltags( info, parts, nparts, level ) && n==-1 ) return 0; 	try_output_partheader( outptr, wrote_header, level );  	for ( i=0; i<nparts; ++i ) {@@ -517,6 +552,12 @@ 				level ); 	} +	if ( n!=-1 ) {+		output_tab1( outptr, level, "<extent unit=\"volumes\">\n" );+		output_fill2( outptr, increment_level(level,1), "total", info, n, 1 );+		output_tab1( outptr, level, "</extent>\n" );+	}+ 	return 1; } @@ -568,7 +609,7 @@ static void output_type( fields *info, FILE *outptr, int level ) {-	int n = fields_find( info, "TYPE", 0 );+	int n = fields_find( info, "INTERNAL_TYPE", 0 ); 	if ( n!=-1 ) fields_setused( info, n ); 	output_typeresource( info, outptr, level ); 	output_genre( info, outptr, level );@@ -636,12 +677,16 @@ 		{ "issn",      "ISSN",      0 }, 		{ "citekey",   "REFNUM",    0 }, 		{ "doi",       "DOI",       0 },+		{ "eid",       "EID",       0 },+		{ "eprint",    "EPRINT",    0 },+		{ "eprinttype","EPRINTTYPE",0 }, 		{ "pubmed",    "PMID",      0 }, 		{ "medline",   "MEDLINE",   0 }, 		{ "pii",       "PII",       0 }, 		{ "arXiv",     "ARXIV",     0 }, 		{ "isi",       "ISIREFNUM", 0 }, 		{ "accessnum", "ACCESSNUM", 0 },+		{ "jstor",     "JSTOR",     0 }, 	}; 	int n, ntypes = sizeof( sn_types ) / sizeof( sn_types[0] ); 	int       found, i;@@ -831,3 +876,4 @@ 	fprintf(outptr,"</modsCollection>\n"); 	fflush( outptr ); }+
bibutils/modsout.h view
@@ -21,6 +21,7 @@ extern void modsout_writefooter( FILE *outptr ); extern void modsout_write( fields *info, FILE *outptr, 	param *p, unsigned long numrefs );+extern void modsout_initparams( param *p, const char *progname );  #endif 
bibutils/name.c view
@@ -3,7 +3,7 @@  *  * mangle names w/ and w/o commas  *- * Copyright (c) Chris Putnam 2004-2009+ * Copyright (c) Chris Putnam 2004-2010  *  * Source code released under the GPL  *
bibutils/newstr.c view
@@ -1,7 +1,7 @@ /*  * newstr.c  *- * Copyright (c) Chris Putnam 1999-2009+ * Copyright (c) Chris Putnam 1999-2010  *  * Source code released under the GPL  *
bibutils/newstr_conv.c view
@@ -1,7 +1,7 @@ /*  * newstr_conv.c  *- * Copyright (c) Chris Putnam 1999-2009+ * Copyright (c) Chris Putnam 1999-2010  *  * Source code released under the GPL  *
bibutils/reftypes.c view
@@ -1,7 +1,7 @@ /*  * reftypes.c  *- * Copyright (c) Chris Putnam 2003-2009+ * Copyright (c) Chris Putnam 2003-2010  *  * Program and source code released under the GPL  *
bibutils/reftypes.h view
@@ -9,20 +9,23 @@ #ifndef REFTYPES_H #define REFTYPES_H -#define SIMPLE       (0)-#define TYPE         (1)-#define PERSON       (2)-#define DATE         (3)-#define PAGES        (4)-#define SERIALNO     (5)-#define TITLE        (6)-#define ALWAYS       (7)-#define BIBTEX_URL   (8)-#define ISI_KEYWORD  (9)-#define NOTES        (10)-#define DOI          (11)-#define BIBTEX_SENTE (12)-#define BIBTEX_FILE  (13)+#define SIMPLE        (0)+#define TYPE          (1)+#define PERSON        (2)+#define DATE          (3)+#define PAGES         (4)+#define SERIALNO      (5)+#define TITLE         (6)+#define ALWAYS        (7)+#define NOTES         (8)+#define DOI           (9)+#define HOWPUBLISHED  (10)+#define BIBTEX_URL    (11)+#define BIBTEX_SENTE  (12)+#define BIBTEX_FILE   (13)+#define BIBTEX_GENRE  (14)+#define BIBTEX_EPRINT (15)+#define ISI_KEYWORD   (16)  typedef struct { 	char *oldstr;
bibutils/risin.c view
@@ -1,7 +1,7 @@ /*  * risin.c  *- * Copyright (c) Chris Putnam 2003-2009+ * Copyright (c) Chris Putnam 2003-2010  *  * Program and source code released under the GPL  *@@ -19,6 +19,35 @@ #include "reftypes.h" #include "doi.h" #include "risin.h"++void+risin_initparams( param *p, const char *progname )+{+	p->readformat       = BIBL_RISIN;+	p->charsetin        = BIBL_CHARSET_DEFAULT;+	p->charsetin_src    = BIBL_SRC_DEFAULT;+	p->latexin          = 0;+	p->xmlin            = 0;+	p->utf8in           = 0;+	p->nosplittitle     = 0;+	p->verbose          = 0;+	p->addcount         = 0;+	p->output_raw       = 0;++	p->readf    = risin_readf;+	p->processf = risin_processf;+	p->cleanf   = NULL;+	p->typef    = risin_typef;+	p->convertf = risin_convertf;+	p->all      = ris_all;+	p->nall     = ris_nall;++	list_init( &(p->asis) );+	list_init( &(p->corps) );++	if ( !progname ) p->progname = NULL;+	else p->progname = strdup( progname );+}  /* RIS definition of a tag is strict:     character 1 = uppercase alphabetic character
bibutils/risin.h view
@@ -19,6 +19,8 @@ extern int risin_typef( fields *risin, char *filename, int nref, param *p, variants *all, int nall ); extern void risin_convertf( fields *risin, fields *info, int reftype, param *p, variants *all, int nall );  +extern void risin_initparams( param *p, const char *progname );+ extern variants ris_all[]; extern int ris_nall; 
bibutils/risout.c view
@@ -1,7 +1,7 @@ /*  * risout.c  *- * Copyright (c) Chris Putnam 2003-2009+ * Copyright (c) Chris Putnam 2003-2010  *  * Program and source code released under the GPL  *@@ -17,6 +17,27 @@ #include "doi.h" #include "risout.h" +void+risout_initparams( param *p, const char *progname )+{+	p->writeformat      = BIBL_RISOUT;+	p->format_opts      = 0;+	p->charsetout       = BIBL_CHARSET_DEFAULT;+	p->charsetout_src   = BIBL_SRC_DEFAULT;+	p->latexout         = 0;+	p->utf8out          = 0;+	p->utf8bom          = 0;+	p->xmlout           = 0;+	p->nosplittitle     = 0;+	p->verbose          = 0;+	p->addcount         = 0;+	p->singlerefperfile = 0;++	p->headerf = risout_writeheader;+	p->footerf = NULL;+	p->writef  = risout_write;+}+ enum {  	TYPE_UNKNOWN, 	TYPE_STD,                /* standard/generic */@@ -365,6 +386,21 @@ }  static void+output_jstor( FILE *fp, fields *info )+{+	newstr jstor_url;+	int i;+	newstr_init( &jstor_url );+	for ( i=0; i<info->nfields; ++i ) {+		if ( strcmp( info->tag[i].data, "JSTOR" ) ) continue;+		jstor_to_url( info, i, "URL", &jstor_url );+		if ( jstor_url.len )+			fprintf( fp, "UR  - %s\n", jstor_url.data );+	}+	newstr_free( &jstor_url );+}++static void output_thesishint( FILE *fp, int type ) { 	if ( type==TYPE_MASTERSTHESIS )@@ -444,6 +480,7 @@ 	output_doi( fp, info ); 	output_pmid( fp, info ); 	output_arxiv( fp, info );+	output_jstor( fp, info ); 	output_easy( fp, info, refnum, "NOTES", "N1", -1 ); 	output_easy( fp, info, refnum, "REFNUM", "ID", -1 ); 	output_thesishint( fp, type );
bibutils/risout.h view
@@ -14,5 +14,7 @@ 		unsigned long refnum ); extern void risout_writeheader( FILE *outptr, param *p ); +extern void risout_initparams( param *p, const char *progname );+  #endif
bibutils/ristypes.c view
@@ -1,7 +1,7 @@ /*  * ristypes.c  *- * Copyright (c) Chris Putnam 2003-2009+ * Copyright (c) Chris Putnam 2003-2010  *  * Program and source code released under the GPL  *@@ -110,7 +110,7 @@ 	{ "M1", "NOTES",        NOTES,   LEVEL_MAIN }, 	{ "M2", "NOTES",        NOTES,   LEVEL_MAIN }, 	{ "M3", "NOTES",        NOTES,   LEVEL_MAIN },-	{ "  ", "TYPE|ARTICLE",           ALWAYS, LEVEL_MAIN },+	{ "  ", "INTERNAL_TYPE|ARTICLE",           ALWAYS, LEVEL_MAIN }, 	{ "  ", "ISSUANCE|continuing",    ALWAYS, LEVEL_HOST }, 	{ "  ", "RESOURCE|text",          ALWAYS, LEVEL_MAIN }, 	{ "  ", "GENRE|periodical",       ALWAYS, LEVEL_HOST },@@ -216,7 +216,7 @@ 	{ "M1", "NOTES",        NOTES,   LEVEL_MAIN }, 	{ "M2", "NOTES",        NOTES,   LEVEL_MAIN }, 	{ "M3", "NOTES",        NOTES,   LEVEL_MAIN },-	{ "  ", "TYPE|NEWSARTICLE",       ALWAYS, LEVEL_MAIN },+	{ "  ", "INTERNAL_TYPE|NEWSARTICLE",       ALWAYS, LEVEL_MAIN }, 	{ "  ", "ISSUANCE|continuing",    ALWAYS, LEVEL_HOST }, 	{ "  ", "RESOURCE|text",          ALWAYS, LEVEL_MAIN }, 	{ "  ", "GENRE|newspaper",        ALWAYS, LEVEL_HOST }@@ -365,7 +365,7 @@ 	{ "M1", "NOTES",        NOTES,   LEVEL_MAIN }, 	{ "M2", "NOTES",        NOTES,   LEVEL_MAIN }, 	{ "M3", "NOTES",        NOTES,   LEVEL_MAIN },-	{ "  ", "TYPE|CONFERENCE",       ALWAYS, LEVEL_MAIN },+	{ "  ", "INTERNAL_TYPE|CONFERENCE",       ALWAYS, LEVEL_MAIN }, 	{ "  ", "RESOURCE|text",                ALWAYS, LEVEL_MAIN }, 	{ "  ", "GENRE|conference publication", ALWAYS, LEVEL_HOST } };@@ -416,7 +416,7 @@ 	{ "M1", "NOTES",        NOTES,   LEVEL_MAIN }, 	{ "M2", "NOTES",        NOTES,   LEVEL_MAIN }, 	{ "M3", "NOTES",        NOTES,   LEVEL_MAIN },-	{ "  ", "TYPE|STATUTE",          ALWAYS, LEVEL_MAIN },+	{ "  ", "INTERNAL_TYPE|STATUTE",          ALWAYS, LEVEL_MAIN }, 	{ "  ", "RESOURCE|text",         ALWAYS, LEVEL_MAIN }, 	{ "  ", "GENRE|legislation",     ALWAYS, LEVEL_MAIN } };@@ -467,7 +467,7 @@ 	{ "M1", "NOTES",        NOTES,   LEVEL_MAIN }, 	{ "M2", "NOTES",        NOTES,   LEVEL_MAIN }, 	{ "M3", "NOTES",        NOTES,   LEVEL_MAIN },-	{ "  ", "TYPE|HEARING",          ALWAYS, LEVEL_MAIN },+	{ "  ", "INTERNAL_TYPE|HEARING",          ALWAYS, LEVEL_MAIN }, 	{ "  ", "GENRE|hearing",         ALWAYS, LEVEL_MAIN } }; @@ -517,7 +517,7 @@ 	{ "M1", "NOTES",        NOTES,   LEVEL_MAIN }, 	{ "M2", "NOTES",        NOTES,   LEVEL_MAIN }, 	{ "M3", "NOTES",        NOTES,   LEVEL_MAIN },-	{ "  ", "TYPE|CASE",          ALWAYS, LEVEL_MAIN },+	{ "  ", "INTERNAL_TYPE|CASE",          ALWAYS, LEVEL_MAIN }, 	{ "  ", "GENRE|legal case and case notes", ALWAYS, LEVEL_MAIN } }; @@ -567,7 +567,7 @@ 	{ "M1", "GENRE",        SIMPLE,  LEVEL_MAIN }, 	{ "M2", "NOTES",        NOTES,   LEVEL_MAIN }, 	{ "M3", "NOTES",        NOTES,   LEVEL_MAIN },-	{ "  ", "TYPE|ARTICLE",           ALWAYS, LEVEL_MAIN },+	{ "  ", "INTERNAL_TYPE|ARTICLE",           ALWAYS, LEVEL_MAIN }, 	{ "  ", "GENRE|communication",    ALWAYS, LEVEL_MAIN } }; @@ -617,7 +617,7 @@ 	{ "M1", "NOTES",        NOTES,   LEVEL_MAIN }, /*misc */ 	{ "M2", "NOTES",        NOTES,   LEVEL_MAIN }, /* put in "notes" */ 	{ "M3", "NOTES",        NOTES,   LEVEL_MAIN },-	{ "  ", "TYPE|THESIS",  ALWAYS,  LEVEL_MAIN },+	{ "  ", "INTERNAL_TYPE|THESIS",  ALWAYS,  LEVEL_MAIN }, 	{ "  ", "RESOURCE|text",ALWAYS,  LEVEL_MAIN }, 	{ "  ", "GENRE|thesis", ALWAYS,  LEVEL_MAIN }, };@@ -668,7 +668,7 @@ 	{ "M1", "NOTES",        NOTES,   LEVEL_MAIN }, /*misc */ 	{ "M2", "NOTES",        NOTES,   LEVEL_MAIN }, /* put in "notes" */ 	{ "M3", "NOTES",        NOTES,   LEVEL_MAIN },-	{ "  ", "TYPE|REPORT",  ALWAYS,  LEVEL_MAIN },+	{ "  ", "INTERNAL_TYPE|REPORT",  ALWAYS,  LEVEL_MAIN }, 	{ "  ", "RESOURCE|text",ALWAYS,  LEVEL_MAIN }, 	{ "  ", "GENRE|report", ALWAYS,  LEVEL_MAIN } };
+ bibutils/rules.h view
@@ -0,0 +1,49 @@+/*+ * rules.h+ *+ * Copyright (c) Chris Putnam 2005-2010+ *+ * Source code released under the GPL+ *+ */+#include <stdio.h>+#include <stdlib.h>+#include "bibutils.h"++/* internal includes */+#include "reftypes.h"+#include "bibtexin.h"+#include "biblatexin.h"+#include "bibtexout.h"+#include "copacin.h"+#include "endin.h"+#include "endxmlin.h"+#include "endout.h"+#include "isiin.h"+#include "isiout.h"+#include "medin.h"+#include "modsin.h"+#include "risin.h"+#include "wordin.h"+#include "risout.h"+#include "modsout.h"+#include "wordout.h"+#include "adsout.h"+#include "newstr_conv.h"+#include "is_ws.h"++#include "ebiin.h"++typedef struct convert_rules {+	int  (*readf)(FILE*,char*,int,int*,newstr*,newstr*,int*);+	int  (*processf)(fields*,char*,char*,long);+	void (*cleanf)(bibl*,param*);+	int  (*typef) (fields*,char*,int,param*,variants*,int);+	void (*convertf)(fields*,fields*,int,param*,variants*,int);+	void (*headerf)(FILE*,param*);+	void (*footerf)(FILE*);+	void (*writef)(fields*,FILE*,param*,unsigned long);+	variants *all;+	int  nall;+} convert_rules;+
bibutils/serialno.c view
@@ -1,7 +1,7 @@ /*  * serialno.c  *- * Copyright (c) Chris Putnam 2005-2009+ * Copyright (c) Chris Putnam 2005-2010  *  * Source code released under the GPL  *
bibutils/strsearch.c view
@@ -1,6 +1,6 @@ /* strsearch.c  *- * Copyright (c) Chris Putnam 1995-2009+ * Copyright (c) Chris Putnam 1995-2010  *  * Source code released under the GPL  *
bibutils/title.c view
@@ -3,7 +3,7 @@  *  * process titles into title/subtitle pairs for MODS  *- * Copyright (c) Chris Putnam 2004-2009+ * Copyright (c) Chris Putnam 2004-2010  *  * Source code released under the GPL  *
bibutils/utf8.c view
@@ -1,7 +1,7 @@ /*  * utf8.c  *- * Copyright (c) Chris Putnam 2004-2009+ * Copyright (c) Chris Putnam 2004-2010  *  * Source code released under the GPL  *
bibutils/utf8.h view
@@ -1,7 +1,7 @@ /*  * utf8.h  *- * Copyright (c) Chris Putnam 2004-2009+ * Copyright (c) Chris Putnam 2004-2010  *  * Source code released under the GPL  *
bibutils/wordin.c view
@@ -1,7 +1,7 @@ /*  * wordin.c  *- * Copyright (c) Chris Putnam 2009+ * Copyright (c) Chris Putnam 2010  *  * Program and source code released under the GPL  *@@ -14,7 +14,38 @@ #include "fields.h" #include "xml.h" #include "xml_encoding.h"-#include "medin.h"+#include "wordin.h"++void+wordin_initparams( param *p, const char *progname )+{+	p->readformat       = BIBL_WORDIN;+	p->charsetin        = BIBL_CHARSET_DEFAULT;+	p->charsetin_src    = BIBL_SRC_DEFAULT;+	p->latexin          = 0;+	p->xmlin            = 1;+	p->utf8in           = 1;+	p->nosplittitle     = 0;+	p->verbose          = 0;+	p->addcount         = 0;+	p->output_raw       = BIBL_RAW_WITHMAKEREFID |+	                      BIBL_RAW_WITHCHARCONVERT;++	p->readf    = wordin_readf;+	p->processf = wordin_processf;+	p->cleanf   = NULL;+	p->typef    = NULL;+/*	p->convertf = wordin_convertf;*/+	p->convertf = NULL;+	p->all      = NULL;+	p->nall     = 0;++	list_init( &(p->asis) );+	list_init( &(p->corps) );++	if ( !progname ) p->progname = NULL;+	else p->progname = strdup( progname );+}  static char * wordin_findstartwrapper( char *buf, int *ntype )
bibutils/wordin.h view
@@ -12,13 +12,13 @@ #include "newstr.h" #include "fields.h" #include "reftypes.h"+#include "bibutils.h"  extern int wordin_readf( FILE *fp, char *buf, int bufsize, int *bufpos, newstr *line, newstr *reference, int *fcharset ); extern int wordin_processf( fields *wordin, char *data, char *filename, long nref ); extern void wordin_convertf( fields *wordin, fields *info, int reftype, int verbose, variants *all, int nall );-/*-extern variants med_all[];-extern int med_nall;-*/++extern void wordin_initparams( param *p, const char *progname );+ #endif 
bibutils/wordout.c view
@@ -3,7 +3,7 @@  *   * (Word 2007 format)  *- * Copyright (c) Chris Putnam 2007-2009+ * Copyright (c) Chris Putnam 2007-2010  *  * Source code released under the GPL  *@@ -15,6 +15,28 @@ #include "fields.h" #include "utf8.h" #include "wordout.h"++void+wordout_initparams( param *p, const char *progname )+{+	p->writeformat      = BIBL_WORD2007OUT;+	p->format_opts      = 0;+	p->charsetout       = BIBL_CHARSET_UNICODE;+	p->charsetout_src   = BIBL_SRC_DEFAULT;+	p->latexout         = 0;+	p->utf8out          = 0;+	p->utf8bom          = 0;+	if ( !p->utf8out ) p->xmlout = 3;+	else p->xmlout = 1;+	p->nosplittitle     = 0;+	p->verbose          = 0;+	p->addcount         = 0;+	p->singlerefperfile = 0;++	p->headerf = wordout_writeheader;+	p->footerf = wordout_writefooter;+	p->writef  = wordout_write;+}  typedef struct convert { 	char oldtag[25];
bibutils/wordout.h view
@@ -20,6 +20,8 @@ extern void wordout_writefooter( FILE *outptr ); extern void wordout_write( fields *info, FILE *outptr, param *p, 	unsigned long numrefs );+extern void wordout_initparams( param *p, const char *progname );+  #endif 
bibutils/xml.c view
@@ -1,7 +1,7 @@ /*  * xml.c  *- * Copyright (c) Chris Putnam 2004-2009+ * Copyright (c) Chris Putnam 2004-2010  *  * Source code released under the GPL  *
bibutils/xml_encoding.c view
@@ -1,7 +1,7 @@ /*  * xml_getencoding.c  *- * Copyright (c) Chris Putnam 2007-2009+ * Copyright (c) Chris Putnam 2007-2010  *  * Source code released under the GPL  *
hs-bibutils.cabal view
@@ -1,5 +1,5 @@ name:               hs-bibutils-version:            0.3+version:            4.12 homepage:           http://code.haskell.org/hs-bibutils  synopsis:           Haskell bindings to bibutils, the bibliography@@ -18,6 +18,9 @@                     .                     The original API documentation is available here:                     <http://www.scripps.edu/~cdputnam/software/bibutils/library_specs.html>.+                    .+                    The package release number refers to the release number of+                    the included bibutils library.  category:           Text license:            GPL@@ -27,7 +30,7 @@ cabal-version:      >= 1.4 build-type:         Simple extra-source-files:-    bibutils/adsout.c bibutils/adsout.h bibutils/adsout_journals.c bibutils/bibl.c+    bibutils/adsout.c bibutils/adsout.h bibutils/adsout_journals.c bibutils/bibcore.c bibutils/bibl.c     bibutils/bibl.h bibutils/biblatexin.c bibutils/biblatexin.h bibutils/bibtexin.c     bibutils/bibtexin.h bibutils/bibtexout.c bibutils/bibtexout.h bibutils/bibtextypes.c     bibutils/bibutils.c bibutils/bibutils.h bibutils/bltypes.c bibutils/charsets.c@@ -44,7 +47,7 @@     bibutils/modsout.h bibutils/modstypes.c bibutils/modstypes.h bibutils/name.c     bibutils/name.h bibutils/newstr.c bibutils/newstr.h bibutils/newstr_conv.c     bibutils/newstr_conv.h bibutils/reftypes.c bibutils/reftypes.h bibutils/risin.c-    bibutils/risin.h bibutils/risout.c bibutils/risout.h bibutils/ristypes.c+    bibutils/risin.h bibutils/risout.c bibutils/risout.h bibutils/ristypes.c bibutils/rules.h     bibutils/serialno.c bibutils/serialno.h bibutils/strsearch.c bibutils/strsearch.h     bibutils/title.c bibutils/title.h bibutils/utf8.c bibutils/utf8.h bibutils/wordin.c     bibutils/wordin.h bibutils/wordout.c bibutils/wordout.h bibutils/xml.c@@ -61,7 +64,7 @@     includes:         bibutils.h     c-sources:         cbits/stub.c-        bibutils/adsout.c bibutils/bibl.c bibutils/biblatexin.c bibutils/bibtexin.c+        bibutils/adsout.c bibutils/bibcore.c bibutils/bibl.c bibutils/biblatexin.c bibutils/bibtexin.c         bibutils/bibtexout.c bibutils/bibtextypes.c bibutils/bibutils.c bibutils/bltypes.c         bibutils/charsets.c bibutils/copacin.c bibutils/copactypes.c bibutils/doi.c         bibutils/ebiin.c bibutils/endin.c bibutils/endout.c bibutils/endtypes.c