hs-bibutils 4.15 → 4.16
raw patch · 94 files changed
+4150/−1917 lines, 94 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- bibutils/adsout.c +25/−38
- bibutils/adsout.h +3/−3
- bibutils/adsout_journals.c +467/−89
- bibutils/bibcore.c +213/−80
- bibutils/bibl.c +34/−21
- bibutils/bibl.h +5/−3
- bibutils/biblatexin.c +542/−142
- bibutils/biblatexin.h +3/−3
- bibutils/bibtexin.c +265/−143
- bibutils/bibtexin.h +3/−3
- bibutils/bibtexout.c +45/−35
- bibutils/bibtexout.h +3/−1
- bibutils/bibtextypes.c +72/−72
- bibutils/bibutils.c +2/−2
- bibutils/bibutils.h +4/−2
- bibutils/bltypes.c +448/−295
- bibutils/charsets.c +2/−3
- bibutils/charsets.h +2/−2
- bibutils/copacin.c +76/−41
- bibutils/copacin.h +3/−3
- bibutils/copactypes.c +2/−3
- bibutils/doi.c +6/−5
- bibutils/doi.h +3/−2
- bibutils/ebiin.c +2/−18
- bibutils/ebiin.h +2/−3
- bibutils/endin.c +68/−51
- bibutils/endin.h +3/−3
- bibutils/endout.c +30/−28
- bibutils/endout.h +3/−1
- bibutils/endtypes.c +15/−16
- bibutils/endxmlin.c +5/−2
- bibutils/endxmlin.h +2/−2
- bibutils/entities.c +7/−6
- bibutils/entities.h +3/−3
- bibutils/fields.c +12/−5
- bibutils/fields.h +3/−3
- bibutils/gb18030.h +2/−2
- bibutils/intlist.c +250/−0
- bibutils/intlist.h +40/−0
- bibutils/is_ws.c +2/−2
- bibutils/is_ws.h +2/−2
- bibutils/isiin.c +32/−20
- bibutils/isiin.h +3/−3
- bibutils/isiout.c +34/−14
- bibutils/isiout.h +3/−1
- bibutils/isitypes.c +2/−3
- bibutils/latex.c +24/−14
- bibutils/latex.h +2/−2
- bibutils/list.c +59/−8
- bibutils/list.h +7/−4
- bibutils/marc.c +8/−0
- bibutils/marc.h +2/−2
- bibutils/medin.c +2/−18
- bibutils/medin.h +2/−3
- bibutils/modsin.c +84/−110
- bibutils/modsin.h +2/−3
- bibutils/modsout.c +54/−32
- bibutils/modsout.h +2/−2
- bibutils/modstypes.c +8/−0
- bibutils/modstypes.h +2/−2
- bibutils/name.c +377/−272
- bibutils/name.h +8/−7
- bibutils/newstr.c +8/−8
- bibutils/newstr.h +3/−4
- bibutils/newstr_conv.c +23/−10
- bibutils/newstr_conv.h +3/−4
- bibutils/reftypes.c +17/−3
- bibutils/reftypes.h +31/−20
- bibutils/risin.c +48/−45
- bibutils/risin.h +3/−3
- bibutils/risout.c +71/−44
- bibutils/risout.h +3/−1
- bibutils/ristypes.c +106/−29
- bibutils/serialno.c +6/−6
- bibutils/serialno.h +3/−3
- bibutils/strsearch.c +4/−4
- bibutils/strsearch.h +2/−3
- bibutils/title.c +20/−10
- bibutils/title.h +3/−3
- bibutils/unicode.c +333/−0
- bibutils/unicode.h +12/−0
- bibutils/utf8.c +14/−2
- bibutils/utf8.h +3/−3
- bibutils/vplist.c +2/−2
- bibutils/vplist.h +2/−3
- bibutils/wordin.c +2/−19
- bibutils/wordin.h +2/−3
- bibutils/wordout.c +2/−2
- bibutils/wordout.h +2/−2
- bibutils/xml.c +2/−2
- bibutils/xml.h +2/−2
- bibutils/xml_encoding.c +2/−2
- bibutils/xml_encoding.h +2/−2
- hs-bibutils.cabal +18/−15
bibutils/adsout.c view
@@ -1,10 +1,10 @@ /* * adsout.c *- * Copyright (c) Richard Mathar 2007-2012- * Copyright (c) Chris Putnam 2007-2012+ * Copyright (c) Richard Mathar 2007-2013+ * Copyright (c) Chris Putnam 2007-2013 *- * Program and source code released under the GPL+ * Program and source code released under the GPL version 2 * */ #include <stdio.h>@@ -16,6 +16,7 @@ #include "newstr.h" #include "strsearch.h" #include "fields.h"+#include "name.h" #include "adsout.h" void@@ -192,38 +193,24 @@ } static void-output_person( FILE *fp, char *p )-{- int nseps = 0, nch;- while ( *p ) {- nch = 0;- if ( nseps==1 ) fprintf( fp, "," );- if ( nseps ) fprintf( fp, " " );- while ( *p && *p!='|' ) {- fprintf( fp, "%c", *p++ );- nch++;- }- if ( *p=='|' ) p++;- if ( nseps!=0 && nch==1 ) fprintf( fp, "." );- nseps++;- }-}--static void output_people( FILE *fp, fields *f, char *tag1, char *tag2, char *tag3, char *adstag, int level ) {+ newstr oneperson; vplist a; int i;+ newstr_init( &oneperson ); vplist_init( &a ); fields_findv_eachof( f, level, FIELDS_CHRP, &a, tag1, tag2, tag3, NULL ); extern void fields_findv_eachof( fields *f, int level, int mode, vplist *a, ... ); for ( i=0; i<a.n; ++i ) { if ( i==0 ) fprintf( fp, "%s ", adstag ); else fprintf( fp, "; " );- output_person( fp, (char *) vplist_get( &a, i) );+ name_build_withcomma( &oneperson, (char *) vplist_get( &a, i) );+ fprintf( fp, "%s", oneperson.data ); } if ( a.n ) fprintf( fp, "\n" ); vplist_free( &a );+ newstr_free( &oneperson ); } static void@@ -243,7 +230,7 @@ static char *monNames[]= { "jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep", "oct", "nov", "dec" }; int i;- if ( isdigit( m[0] ) ) return atoi( m );+ if ( isdigit( (unsigned char)m[0] ) ) return atoi( m ); else { for ( i=0; i<12; i++ ) { if ( !strncasecmp( m, monNames[i], 3 ) ) return i+1;@@ -280,7 +267,11 @@ { char buf[6]; n = n % 10000; /* truncate to 0->9999, will fit in buf[6] */+#ifdef WIN32+ sprintf( buf, "%I64d", n );+#else sprintf( buf, "%lld", n );+#endif 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 );@@ -303,26 +294,16 @@ } static int-min( int a, int b )-{- if ( a < b ) return a;- else return b;-}--static int get_journalabbr( fields *f ) { char *jrnl;- int ljrnl, ltmp, len, n, j;+ int n, j; n = fields_find( f, "TITLE", LEVEL_HOST ); if ( n!=-1 ) { jrnl = fields_value( f, n, FIELDS_CHRP );- ljrnl = strlen( jrnl ); for ( j=0; j<njournals; j++ ) {- ltmp = strlen( journals[j]+6 );- len = min( ljrnl, ltmp );- if ( !strncasecmp( jrnl, journals[j]+6, len ) )+ if ( !strcasecmp( jrnl, journals[j]+6 ) ) return j; } }@@ -333,7 +314,7 @@ output_Rtag( FILE *fp, fields *f, char *adstag, int type ) { char out[20], ch;- int n;+ int n, i; long long page; strcpy( out, "..................." );@@ -345,7 +326,13 @@ /** JJJJ */ n = get_journalabbr( f );- if ( n!=-1 ) strncpy( out+4, journals[n], 5 );+ if ( n!=-1 ) {+ i = 0;+ while ( i<5 && journals[n][i]!=' ' && journals[n][i]!='\t' ) {+ out[4+i] = journals[n][i];+ i++;+ }+ } /** VVVV */ n = fields_find( f, "VOLUME", LEVEL_ANY );@@ -364,7 +351,7 @@ } /** A */- ch = toupper( get_firstinitial( f ) );+ ch = toupper( (unsigned char) get_firstinitial( f ) ); if ( ch!='\0' ) out[18] = ch; fprintf( fp, "%s %s\n", adstag, out );
bibutils/adsout.h view
@@ -1,10 +1,10 @@ /* * adsout.h *- * Copyright (c) Richard Mathar 2007-2012- * Copyright (c) Chris Putnam 2007-2012+ * Copyright (c) Richard Mathar 2007-2013+ * Copyright (c) Chris Putnam 2007-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef ADSOUT_H
bibutils/adsout_journals.c view
@@ -6,15 +6,17 @@ * */ static const char *journals[] = {+"TDR.. 3D Research", "AASHS AAS Hist. Ser.",+"AASPB AAS Photo Bulletin", "AAN.. AAVSO Alert Notice", "AAVSC AAVSO Circular", "AAVSN AAVSO Newsletter",-"AbaOB Abastumanskaia Astrofizicheskaia Observatoriia Biulleten",+"AAVSB AAVSO Solar Bulletin",+"AbaOB Abastumanskaia Astrofizicheskaia Observatoriia Byulleten", "AbbOO Abbadia Observatory Observations", "AADDR Abhandlungen Akad. Wiss. DDR", "AAGot Abhandlungen Akad. Wiss. Göttingen",-"AbhHS Abhandlungen aus der Hamburger Sternwarte", "ABWG. Abh. Braunschweigische Wissenschaftliche Ges.", "AbhP. Abh. der Preuß. Akademie der Wissenschaften Jahrg", "AbhKP Abh. Konigl. Preuss. Akad. Wissenschaften Jahre 1906,92, Berlin,1907",@@ -22,9 +24,9 @@ "AbApA Abstract and Applied Analysis", "ASFAS Academia Scientiarum Fennica Annales Series Physica", "AOIJ. Academic Open Internet Journal",-"CRASB Academie des Science Paris Comptes Rendus Serie B Sciences Physiques", "CR2.. Academie des Sciences Comptes Rendus Serie Mecanique Physique Chimie Sciences de la Terre et de l Univers", "CRAS. Academie des Sciences Paris Comptes Rendus",+"CRASB Academie des Sciences Paris Comptes Rendus Serie B Sciences Physiques", "CRASG Academie des Sciences Paris Comptes Rendus Serie Generale La Vie des Sciences", "CRASP Academie des Sciences Paris Comptes Rendus Serie Physique Astrophysique", "CRASM Academie des Sciences Paris Comptes Rendus Serie Sciences Mathematiques",@@ -63,6 +65,7 @@ "AcCrA Acta Crystallographica Section A", "AcCrB Acta Crystallographica Section B", "AcCrC Acta Crystallographica Section C",+"AcCrD Acta Crystallographica Section D", "AcElc Acta Electrochimica", "AcEle Acta Electronica", "AcElS Acta Electronica Sinica",@@ -77,7 +80,8 @@ "AcMat Acta Materialia", "AcMa. Acta Mathematica", "AcMaH Acta Mathematica Hungarica",-"AcMaS Acta Math. Sinica",+"AcMaS Acta Mathematica Sinica",+"AcMSw Acta Mathematica Sweden", "AcMec Acta Mechanica", "AcMSn Acta Mechanica Sinica", "AcMSS Acta Mechanica Solida Sinica",@@ -90,6 +94,7 @@ "AcO.. Acta Oecologica", "AcOpS Acta Optica Sinica", "AcOrS Acta Orthopaedica Scandinavica",+"AcPSi Acta Photonica Sinica", "AcPhy Acta Physica", "APASH Acta Physica Academiae Scientiarum Hungaricae", "AcPhA Acta Physica Austriaca",@@ -97,17 +102,21 @@ "AcPhC Acta Physica et Chemica", "AcPhH Acta Physica Hungarica", "APHHI Acta Physica Hungarica Heavy Ion Physics",+"APHQE Acta Physica Hungarica Quantum Electronics",+"AcPP. Acta Physica Polonica", "AcPPA Acta Physica Polonica A", "AcPPB Acta Physica Polonica B", "AcPSn Acta Physica Sinica", "AcPSl Acta Physica Slovaca", "AcPhS Acta Physiologica Scandinavica",+"AcPol Acta Polytechnica", "AcPSc Acta Polytechnica Scandinavica Applied Physics Series", "AcPSP Acta Polytechnica Scandinavica Physics", "AcSSn Acta Seismologica Sinica", "ASSF. Acta Societatis Scientarum Fennicae", "ASSFA Acta Societatis Scientarum Fennicae Series A", "AcTec Acta Technica",+"AcUni Acta Universitaria", "AcMPh Acta Universitatis Caroliae. Mathematica et Physica", "AcMPS Acta Universitatis Caroliae. Mathematica et Physica Supplement", "APEC. Active and Passive Electronic Components",@@ -128,6 +137,7 @@ "AdAeS Advances in Aeronautical Sciences", "AdApM Advances in Applied Mathematics", "AdAst Advances in Astronomy",+"AASP. Advances in Astronomy and Space Physics", "AdAtS Advances in Atmospheric Sciences", "AdAMP Advances in Atomic and Molecular Physics", "AAMOP Advances in Atomic Molecular and Optical Physics",@@ -135,11 +145,12 @@ "AdBio Advances in Biophysics", "AdCP. Advances in Cardiovascular Physics", "AdChP Advances in Chemical Physics",+"AdCIS Advances in Colloid and Interface Science", "AdCoM Advances in Computational Mathematics", "AdCMP Advances in Condensed Matter Physics", "AdEPS Advances in Earth and Planetary Sciences", "AdEOA Advances in Earth Oriented Applications and Space Technology",-"AdEEP Advances in Electronics and Electron Physics",+"AEEP. Advances in Electronics and Electron Physics", "AEEPS Advances in Electronics and Electron Physics Supplement", "AdExG Advances in Exploration Geophysics", "AdGDP Advances in Geophysical Data Processing",@@ -149,6 +160,10 @@ "AdG.. Advances in Geosciences", "AdHEP Advances in High Energy Physics", "ADIEP Advances in Imaging and Electron Physics",+"AdMRe Advances in Magnetic Resonance",+"AdMPC Advances in Materials Physics and Chemistry",+"AdMS. Advances in Materials Science",+"AdMSE Advances in Materials Science and Engineering", "AdMaP Advances in Mathematical Physics", "AdMat Advances in Mathematics", "AdMPS Advances in Mechanics and Physics of Surfaces",@@ -166,11 +181,14 @@ "AdSR. Advances in Science and Research", "AdSSP Advances in Solid State Physics", "AdSpR Advances in Space Research",-"AAnSc Advances in the Astronautical Sciences",+"AdAnS Advances in the Astronautical Sciences",+"AdTAM Advances in Theoretical and Applied Mechanics", "AdTMP Advances in Theoretical and Mathematical Physics",+"AdThP Advances in Theoretical Physics", "AdWR. Advances in Water Resources", "AAMS. Adv. Appl. Mech. Suppl.", "ATTM. AEG Telefunken Technische Mitteilungen",+"AeoRe Aeolian Research", "Aekv. Aerodinamika kanalov i ventiliatorov", "AeRaG Aerodinamika Razrezhennykh Gazov", "AerTe Aerojet Technology",@@ -181,7 +199,7 @@ "AerST Aerosol Science Technology", "AeAm. Aerospace America", "AeCh. Aerospace China",-"AeCM. Aerospace Composites Materials",+"AeCM. Aerospace Composites and Materials", "AeDy. Aerospace Dynamics", "AeEn. Aerospace Engineering", "AeMat Aerospace Materials",@@ -198,6 +216,7 @@ "AIChE AIChE Journal", "EDAM. AI EDAM", "AIHAJ AIHA Journal",+"AIPA. AIP Advances", "AirSp Air and Space", "AirE. Aircraft Engineering", "AirCo Air et Cosmos",@@ -241,6 +260,7 @@ "AkZh. Akusticheskii Zhurnal", "AkTek Akustika i Ul trazvukovaia Tekhnika", "AAIzN Alma Ata Izdatel Nauka",+"ALMAN ALMA Newsletter", "AlFr. Alta Frequenza", "AFRE. Alta Frequenza Rivista di Elettronica", "Ambio Ambio",@@ -262,7 +282,9 @@ "AmSci American Scientist", "ASME. American Society of Mechanical Engineers", "AnCoi Anais do Observatorio Astronomico da Universidade de Coimbra",+"AnFis Anales de Fisica", "AICSP Analog Integrated Circuits and Signal Processing",+"AnMP. Analysis and Mathematical Physics", "AnBio Analytical Biochemistry", "AnaCh Analytical Chemistry", "AnaIn Analytical Instrumentation",@@ -281,12 +303,16 @@ "AnMet Annalen Meteorologie", "AnLei Annalen van de Sterrewacht te Leiden", "AnAp. Annales d'Astrophysique",+"AnCPh Annales de Chimie et de Physique", "AnG.. Annales de Geophysique", "AFLB. Annales de la Fondation Louis de Broglie", "ASSB. Annales de la Societe Scietifique de Bruxelles", "AnIHP Annales de L'Institut Henri Poincare Section Physique Theorique", "AnTou Annales de l'Observatoire Astron. et Meteo. de Toulouse",+"AnAIK Annales de l'Observatoire astronomique de l'Université imériale de Kharkow", "AOTok Annales de l'Observatoire astronomique de Tokyo",+"AnZoC Annales de l'Observatoire astronomique de Zô-sè (Chine)",+"AnAPM Annales de l'Observatoire d'astronomie physique de Paris, Section d'astrophysique, à Meudon", "AnBes Annales de l'Observatoire de Besancon", "AnBor Annales de l'Observatoire de Bordeaux", "AnNic Annales de l'Observatoire de Nice",@@ -309,6 +335,8 @@ "AnGeB Annales Geophysicae Series B Terrestrial and Planetary Physics", "AnHP. Annales Henri Poincaré", "AnTec Annales Tectonicae",+"AUGGM Annales UMCS, Geographia, Geologia, Mineralogia et Petrographia",+"AUSPh Annales UMCS, Sectio AAA: PHYSICA", "AnApS Annals of Applied Statistics", "AGp.. Annals of Geophysics", "AnGla Annals of Glaciology",@@ -328,19 +356,24 @@ "AnDea Annals of the Dearborn Observatory", "AnDud Annals of the Dudley Observatory", "AnISM Annals of the Institute of Statistical Mathematics",+"AIQSY Annals of the IQSY", "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",+"AnLuS Annals of the Observatory of Lund Supplement", "AnOLL Annals of the Private Observatory of Lucien Libert", "AnEdi Annals of the Royal Observatory, Edinburgh",+"AnSPC Annals of the Solar Physics Observatory Cambridge England", "AnTok Annals of the Tokyo Astronomical Observatory",+"AnUCP Annals of the University of Craiova Physics AUC", "AnRev Ann Rev", "AnBSJ Annual Bulletin of the Societe Jersiaise",-"YalAR Annual report of the Astronomer of the Winchester Observatory of Yale College",+"YalAR Annual Report of the Astronomer of the Winchester Observatory of Yale College", "ARKod Annual Report of the Kodaikanal Observatory", "MMAAR Annual Report of the Maria Mitchell Association",+"ARAOJ Annual Report of the National Astronomical Observatory of Japan", "AnRSI Annual Report of the Smithsonian Institution", "WinAR Annual Report of the Windsor Observatory, New South Wales", "ARAC. Annual Review of Analytical Chemistry",@@ -348,6 +381,7 @@ "AREPS Annual Review of Earth and Planetary Sciences", "AnRE. Annual Review of Energy", "AnRFM Annual Review of Fluid Mechanics",+"ARIST Annual Review of Information Science and Technology", "ARMS. Annual Review of Marine Science", "AnRMS Annual Review of Materials Science", "ARNPS Annual Review of Nuclear and Particle Science",@@ -363,6 +397,7 @@ "ApAN. Apatity Akademiia Nauk SSSR", "ApKF. Apatity Kol skii Filial AN SSSR", "Apei. Apeiron",+"ApMat Aplikace Matematiky, Applied Mathematics", "AppAn Applicable Analysis", "ApMa. Applications of Mathematics", "ApAc. Applied Acoustics",@@ -373,14 +408,17 @@ "ApEnM Applied Environmental Microbiology", "ApGeo Applied Geophysics", "ApMF. Applied Mathematical Finance",-"ApMat Applied Mathematics",+"AMat. Applied Mathematics",+"ApMM. Applied Mathematics and Mechanics", "ApMaC Applied Mathematics Computation", "ApMaL Applied Mathematics Letters", "ApMaM Applied Mathematics Mechanics English Edition", "ApMaO Applied Mathematics Optimization",+"AMM.. Applied Mechanics and Materials", "ApMRv Applied Mechanics Reviews", "ApMic Applied Microbiology", "ApMT. Applied Microgravity Technology",+"ApNan Applied Nanoscience", "ApNM. Applied Numerical Mathematics", "ApOpt Applied Optics", "ApPhy Applied Physics",@@ -390,30 +428,40 @@ "ApPhC Applied Physics Communications", "APExp Applied Physics Express", "ApPhL Applied Physics Letters",+"ApPhR Applied Physics Research", "ApScR Applied Scientific Research",+"ApSRA Applied Scientific Research Section A",+"ApSRB Applied Scientific Research Section B", "ApSpe Applied Spectroscopy", "ApSRv Applied Spectroscopy Reviews", "ApSup Applied Superconductivity", "ApSS. Applied Surface Science",+"ApWS. Applied Water Science", "APS.. APS Meeting Abstracts", "ACMFE Aquatic Conservation: Marine and Freshwater Ecosystems", "AJSE. Arabian Journal of Science Engineering", "Arch. Archaeoastronomy", "ArchS Archaeoastronomy Supplement", "Archa Archaeometry",+"ASBTV Archenhold-Sternwarte Berlin-Treptow, Vortrage Schr.", "ArApM Archive Applied Mechanics", "AHES. Archive for History of Exact Sciences", "ArRMA Archive for Rational Mechanics and Analysis", "ArElU Archiv Elektronik und Uebertragungstechnik",+"AAM.. Archive of Applied Mechanics",+"ArApM Archive of Applied Mechanics", "ArBB. Archive of Biochemistry and Biophysics", "ArAco Archives Acoustics", "ArS.. Archives des Sciences",+"ArSPN Archives des Sciences Physiques et Naturelles", "AMGBA Archives for Meteorology Geophysics and Bioclimatology Series A Meteorology and Atmopsheric Physics", "AMGBB Archives for Meteorology Geophysics and Bioclimatology Series B Theoretical and Applied Climatology", "AIPBB Archives Internationales de Physiologie de Biochimie et de Biophysique",-"ArMAM Archives Mechanics Archiwum Mechaniki Stosowanej",+"ArNSc Archives Neerlandaises des Sciences Exactes et Naturelles",+"ArMaN Archiv for Mathematik og Naturvidenskab", "AMGBK Archiv Meteorologie Geophysik und Bioklimatologie Serie B Klimatologie und Umweltmeteorologie Strahlungsforschung", "AMGBS Archiv Meteorologie Geophysik und Bioklimatologie Serie Meteorologie und Geophysik",+"ArMeS Archiv of Mechanics, Archiwum Mechaniki Stosowanej", "ArCom Archivum Combustionis", "ArAku Archiwum Akustyki", "ArAuT Archiwum Automatyki i Telemechaniki",@@ -427,12 +475,22 @@ "ArM.. Arkiv for Matematik", "ArMAF Arkiv for Matematik, Astronomi och Fysik", "ArmOL Armagh Observatory Leaflet",+"ArJPh Armenian Journal of Physics", "ArtSa Artificial Satellites",+"astro ArXiv Astrophysics e-prints", "cs... ArXiv Computer Science e-prints", "arXiv ArXiv e-prints",-"gr.qc ArXiv General Relativity and Quantum Cosmology e-prints",+"gr.qc ArXiv General Relativity and Quantum Cosmology eprints",+"hepex ArXiv High Energy Physics - Experiment e-prints",+"hepla ArXiv High Energy Physics - Lattice e-prints",+"hepph ArXiv High Energy Physics - Phenomenology e-prints",+"hepth ArXiv High Energy Physics - Theory e-prints",+"mathp ArXiv Mathematical Physics e-prints", "math. ArXiv Mathematics e-prints", "nlin. ArXiv Nonlinear Sciences e-prints",+"nucle ArXiv Nuclear Experiment e-prints",+"nuclt ArXiv Nuclear Theory e-prints",+"physicArXiv Physics e-prints", "ASHRA ASHRAE Journal", "AsJPh Asian Journal of Physics", "Aslib Aslib Proceedings: new information perspectives",@@ -440,7 +498,7 @@ "ATJDS ASME Transactions Journal of Dynamic Systems and Measurement Control B", "ATJEl ASME Transactions Journal of Electronic Packaging", "ATJEG ASME Transactions Journal of Engineering Gas Turbines and Power",-"ATJEn ASME Transactions Journal of Engineering Power",+"ATJEP ASME Transactions Journal of Engineering Power", "ATJFE ASME Transactions Journal of Fluids Engineering", "ATJHT ASME Transactions Journal of Heat Transfer", "ATJLT ASME Transactions Journal of Lubrication Technology",@@ -467,6 +525,8 @@ "Asnau Astronautik", "AUBas Astron. Inst. Univ. Basel", "Anews ASTRON Newsletter",+"AsUAI Astronomia. La rivista dell' Unione Astrofili Italiani",+"Astnm Astronomia UAI", "USNOM Astronomical and Meteorological Observations made at the U.S. Naval Observatory", "ACiCh Astronomical Circular", "ACMan Astronomical Contributions from the University of Manchester",@@ -478,35 +538,37 @@ "ANote Astronomical Notes University of Gothenburg Sweden Section of Astronomy", "USNOA Astronomical Observations made at the U.S. Naval Observatory", "UCLAP Astronomical Papers University of California Los Angeles",-"AReg. Astronomical register",+"AReg. Astronomical Register", "ASSA. Astronomical Society of South Africa, Cape Centre", "AVest Astronomicheskii Vestnik", "AVISS Astronomicheskii Vestnik Issledovaniia Solnechnoi Sistemy", "AZh.. Astronomicheskii Zhurnal", "ATsir Astronomicheskij Tsirkulyar", "KazOB Astronomicheskoj Observatorii Kazan Byulleten",+"AsSch Astronomie in der Schule", "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 Eidgenössischen Sternwarte Zurich", "MiBre Astronomische Mitteilungen der Koeniglichen Universitaets-Sternwarte zu Breslau", "MiGoe Astronomische Mitteilungen der Universitaets-Sternwarte zu Goettingen", "AN... Astronomische Nachrichten", "ANS.. Astronomische Nachrichten Supplement",+"MitSZ Astronomischen Mitteilungen Eidgen. Sternwarte Zurich", "AJB.. Astronomischer Jahresbericht", "MiARI Astronomisches Rechen-Institut Heidelberg Mitteilungen Serie A", "MiARB Astronomisches Rechen-Institut Heidelberg Mitteilungen Serie B", "ATi.. Astronomisk Tidsskrift", "Ast.. Astronomy", "Astro Astronomy",-"AstAp Astronomy and Astro-Physics",+"AstAp Astronomy and Astro-Physics (formerly The Sidereal Messenger)", "ADIL. Astronomy Data Image Library", "AEdRv Astronomy Education Review", "AExpr Astronomy Express", "AstL. Astronomy Letters",-"AstNw Astronomy Now",+"AsNow Astronomy Now", "AstQ. Astronomy Quarterly", "ARep. Astronomy Reports", "AASPP Astrononomy and Astrophysics Series",@@ -517,13 +579,16 @@ "ApNr. Astrophysica Norvegica", "Ap... Astrophysics", "ASPRv Astrophysics and Space Physics Reviews",+"ApSSP Astrophysics and Space Science Proceedings", "ASTRA Astrophysics and Space Sciences Transactions", "ApSSS Astrophysics and Space Science Supplement",-"astro.ArXiv Astrophysics e-prints", "MKAtl Astrophysics monographs University of Chicago Press", "ArBei Astrophysics Reports Publications of the Beijing Astronomical Observatory",+"ApT.. Astrophysics Today", "AstPo Astropolitics", "AsAna Asymptotic Analysis",+"BLabR AT&",+"AJSEd Atlas Journal of Science Education", "AtlVS Atlas Poiskovykh Kart Peremennykh Zvezd", "Atmos Atmosphere", "AtO.. Atmosphere Ocean",@@ -537,12 +602,15 @@ "AtSc. Atmospheric Science", "AtScL Atmospheric Science Letters", "AtmTe Atmospheric Technology",+"atnfp ATNF Proposal",+"Atom. Atom", "AD... Atomic Data", "ADNDT Atomic Data and Nuclear Data Tables", "AtERv Atomic Energy Review", "AMOP. Atomic Molecular and Optical Physics", "AtPhy Atomic Physics", "AtST. Atomisation Spray Technology",+"AtKe. Atomkernenergie", "AtEn. Atomnaia Energiia", "AVET. Atomno Vodorodnaia Energetika i Tekhnologiia", "ATR.. ATR Australian Telecommunication Research",@@ -551,7 +619,8 @@ "AAST. Atti Accad. Sco. Torino I", "ATTTJ AT T Technical Journal", "AurPh Auroral physics",-"AuJAR Aust. J. Agric. Res.",+"AuJAR Australian Journal of Agricultural Research",+"AuJA. Australian Journal of Astronomy", "AuJCE Australian Journal of Chemical Education", "AJCh. Australian Journal of Chemistry", "AuJES Australian Journal of Earth Sciences",@@ -573,6 +642,7 @@ "Avtme Avtometriia", "BBUSS Babes Bolyai Universitas Studia Series Mathematica", "BBUSM Babes Bolyai Universitas Studia Series Physica",+"BaPhL Balkan Physics Letters", "BaltA Baltic Astronomy", "BamKV Bamberg Kleine Veroeffentlichungen der Remeis-Sternwarte", "BAVRu BAV Rundbrief",@@ -587,7 +657,6 @@ "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",@@ -631,9 +700,11 @@ "BioSc BioScience", "BiotL Biotechnology Letters", "BOTor Biuletyn Obserwatoium Astronomicznego Uniwersytetu M. Kopernika w Toruniu",+"BITad Biulletini of the Astronomical Institute Akademiia Nauk Tadzhikskoi", "BIAst Bjull. Inst. Astrofizikii", "BlazD BLAZAR Data", "BAAA. Boletin de la Asociacion Argentina de Astronomia La Plata Argentina",+"BAOM. Boletin de la Astronomico Observatorio de Madrid", "BIMAF Boletin del Instituto de Matematica Astronomica y Fisica Universidad Nacional de Cordoba Argentina", "BITon Boletin del Instituto de Tonantzintla", "BOTT. Boletin de los Observatorios Tonantzintla y Tacubaya",@@ -641,6 +712,7 @@ "BlDok Bolgarska Akademiia Nauk Doklady", "BSVit Bolletino della Societa dei Variabilisti Italiani", "BoSAI Bollettino della Societa Astronomica Italiana",+"BGSA. Bollettino Geod. Scienzi Affini", "BonD. Bonner Durchmusterung", "BoLMe Boundary-Layer Meteorology", "Brain Brain",@@ -673,11 +745,13 @@ "BuAsR Bulletin Astronomique, Revue Generale des Travaux Astronomiques", "BuAsI Bulletin Astronomique, Serie I", "BuChr Bulletin Chronometrique (Besancon)",+"BCSAB Bulletin Cl. Science Academy Royal de Belgique", "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",+"BSAL. Bulletin de la Societe Astronomique de Liege", "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",@@ -685,11 +759,13 @@ "BOBeo Bulletin de l'Observatoire Astronomique de Belgrade", "BuLyo Bulletin de l'Observatoire de Lyon", "BBSAG Bulletin der Bedeckungsveraenderlichen-Beobachter der Schweizerischen Astronomischen Gesellschaft",+"BIEBe Bulletin d'Information d'Etoiles Be", "BIM.. Bulletin d'Information des Marees Terrestres", "BIBGI Bulletin d'Information du Bureau Gravimetrique International", "BICDS Bulletin d'Information du Centre de Donnees Stellaires", "BCFHT Bulletin d'information du telescope Canada-France-Hawaii", "BGeod Bulletin Geodesique",+"BGNS. Bulletin Geodesique, Nouvelle Series", "BuBIH Bulletin Horaire du Bureau International de l'Heure", "BOPul Bulletin (Izvestiya) de l'Observatoire Central a Poulkovo", "BuMat Bulletin Mathematique",@@ -699,6 +775,8 @@ "BPAS. Bulletin of Pure and Applied Science (Physics)", "BAAPG Bulletin of the American Association of Petroleum Geologists", "BAVSO Bulletin of the American Association of Variable Stars Observers",+"BAAS. Bulletin of the American Astronomical Society",+"BAMaS Bulletin of the American Mathematical Society", "BAMS. Bulletin of the American Meteorological Society", "BAPS. Bulletin of the American Physical Society", "BAICz Bulletin of the Astronomical Institutes of Czechoslovakia",@@ -709,12 +787,17 @@ "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",+"BuGSA Bulletin of the Geological Society of America",+"BIMIA Bulletin of the Institute of Mathematics and Its Applications", "BuIPS Bulletin of the Israel Physical Society", "BKobO Bulletin of the Kobe Marine Observatory Kobe Japan",+"BLPI. Bulletin of the Lebedev Physics Institute", "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",+"BuONC Bulletin of the Special Astrophysical Observatory, Northern Caucasus",+"BSAO. Bulletin of the Special Astrophysics Observatory", "BTasO Bulletin of the Tashkent Observatory", "BTok. Bulletin of the Tokyo Astronomical Observatory", "BToIT Bulletin of the Tokyo Institute of Technology",@@ -724,14 +807,18 @@ "BVol. Bulletin of Volcanology", "BCNRS Bulletin Signaletique - Centre National de la Recherche Scientifique", "BSAO. Bull. Special Astrophys. Obs.",+"BIHCD Bureau Internationale Heure, Paris, Circulaire", "BDus. Byulleten' Instituta Astrofiziki Dushanbe Akademiya Nauk Tadzhikskoj SSR", "BITA. Byulleten' Instituta Teoreticheskoj Astronomii (Leningrad)", "BStaO Byulleten' Stalinabadskoj Astronomicheskoj Observatorii Akademiya Nauk Tadzhikskoj SSR", "ByuRe Byurakan Astrophysical Observatory Armenia USSR Reprints", "ByuPr Byurakanskaya Astrofizicheskaya Observatoriya Preprint",+"CahPh Cahiers de Physique", "CAS.. Cambridge Astrophysics Series", "CCA.. Cambridge Contemporary Astrophysics", "CamRe Cambridge Observatories Reprints",+"CMPNC Cambridge Monographs on Particle Physics, Nuclear Physics and Cosmology",+"CMPPh Cambridge Monographs on Plasma Physics", "CSLPT Cambridge Studies in Low Temperature Physics", "CTMPC Cambridge Topics in Mineral Physics and Chemistry", "BCNRC Canada National Research Council Division Mechanical Engineering National Aeronautical Establishment Quarterly Bulletin",@@ -747,8 +834,10 @@ "CJECE Canadian Journal of Electrical Computer Engineering", "CJMat Canadian Journal of Mathematics", "CaJPh Canadian Journal of Physics",+"CaJPS Canadian Journal of Physics Supplement", "CaJRS Canadian Journal of Remote Sensing", "CJRA. Canadian Journal of Research Section A",+"CJSMT Canadian Journal of Science Mathematics and Technology Education", "CaJSS Canadian Journal of Soil Science", "CaRes Cancer Research", "CPhD. Cape Photographic Durchmusterung",@@ -772,10 +861,13 @@ "CfAPr Center for Astrophysics Cambridge Mass Preprint Series", "CBET. Central Bureau Electronic Telegrams", "CEAB. Central European Astrophysical Bulletin",+"CEJE. Central European Journal of Engineering",+"CEJG. Central European Journal of Geosciences", "CEJPh Central European Journal of Physics", "CPH.. Centre de Physique des Houches", "CCpFS Ceskoslovensky Casopis pro Fyziku Sekce", "CFDAA CFD Advances Applications",+"CKH.. Chagyo Kenkyu Hokoku (Tea Research Journal)", "ChNew Chandra News", "Chaos Chaos", "CSF.. Chaos Solitons and Fractals",@@ -797,6 +889,7 @@ "CPCar Chemistry and Physics of Carbon", "CPLip Chemistry and Physics of Lipids", "ChUDA Chile Universidad Departamento de Astronomia Publicaciones",+"ChOE. China Ocean Engineering", "ChRST China Rept Sci Technol JPRS CST", "ChA.. Chinese Astronomy", "ChIEJ Chinese Institute of Engineers Journal",@@ -809,6 +902,7 @@ "ChJL. Chinese Journal of Lasers", "ChJLB Chinese Journal of Lasers B", "CJLTP Chinese Journal of Low Temperature Physics",+"ChJME Chinese Journal of Mechanical Engineering", "ChJNP Chinese Journal of Nuclear Physics", "ChJOL Chinese Journal of Oceanology and Limnology", "ChJPh Chinese Journal of Physics",@@ -829,6 +923,7 @@ "CITM. Chubu Institute Technology Memoirs", "CIDA. CIDA", "CTE.. Ciencias de la Tierra y del Espacio",+"CiInf Circ. Inf.", "CiSSV Circolare Interna della Sezione Stelle Variabili dell'Unione Astrofili Italiani", "CSSP. Circuits Systems and Signal Processing", "CirW. Circuit World",@@ -840,6 +935,7 @@ "CQGrS Classical and Quantum Gravity Supplement", "CRMMP Classical Reviews in Mathematics and Mathematical Physics", "CTPhy Classical Theoretical Physics",+"CCM.. Clays and Clay Minerals", "ClDy. Climate Dynamics", "CliPa Climate of the Past", "CliPD Climate of the Past Discussions",@@ -856,11 +952,15 @@ "CoFl. Combustion and Flame", "CST.. Combustion Science and Technology", "CTM.. Combustion Theory Modelling",+"CNSMP Comet News Service, McDonnell Planetarium", "CPMCM Commentationes Physico-Mathematicae et Chemico-Medicae", "ComMP Comments in Modern Physics", "ComAp Comments on Astrophysics", "CoASP Comments on Astrophysics and Space Physics", "CoAMP Comments on Atomic and Molecular Physics",+"CoCMP Comments on Condensed Matter Physics",+"CoNPP Comments on Nuclear and Particle Physics",+"CoPPC Comments on Plasma Physics and Controlled Fusion", "ComSp Commercial Space", "CoKon Commmunications of the Konkoly Observatory Hungary", "CAPJ. Communication Astronomy with the Public Journal",@@ -907,14 +1007,16 @@ "CRABS Comptes Rendus de l'Academie Bulgare des Sciences", "CRASE Comptes Rendus de l'Académie des Sciences - Series IIA - Earth and Planetary Science", "CRGeo Comptes Rendus Geoscience",+"CRMat Comptes Rendus Mathematique", "CRMec Comptes Rendus Mecanique", "CRPhy Comptes Rendus Physique", "CAMP. Computational and Applied Mathematical Physics",+"ComMS Computational Materials Science", "CMMPh Computational Mathematics and Mathematical Physics", "CompM Computational Mechanics", "COA.. Computational Optimization and Applications", "CSMA. Computational Structural Mechanics and Applications",-"Comp. Computer",+"Compr Computer", "CAD.. Computer-Aided Design", "CGIP. Computer Graphics Image Processing", "CMAME Computer Methods in Applied Mechanics and Engineering",@@ -935,7 +1037,8 @@ "ComSE Computing Systems in Engineering", "COMTR COMSAT Technical Review", "CoCoi Comunicacoes do Observatonio Astronomico da Universidade de Coimbra",-"cond.mArXiv Condensed Matter e-prints",+"CoMRA Concepts in Magnetic Resonances A",+"CoMRB Concepts in Magnetic Resonances B", "CMPhy Condensed Matter Physics", "CGDAM Conformal Geometry and Dynamics of the American Mathematical Society", "CDT.. Connaissance des Temps",@@ -965,10 +1068,9 @@ "CoMcD Contributions from the McDonald Observatory University of Texas Fort Davis", "CMWCI Contributions from the Mount Wilson Observatory / Carnegie Institution of Washington", "CoPri Contributions from the Princeton University Observatory",-"CoAth Contributions from the Research and Computing Center Academy of Sciences of Athens Series I Astronomy", "CoRut Contributions from the Rutherford Observatory of Columbia University New York", "CoWas Contributions from the Washburn Observatory of the University of Wisconsin",-"CoWro Contributions from the Wroclaw Astronomical Observatory",+"CoAth Contributions from the Wroclaw Astronomical Observatory", "CoLic Contributions of Lick Observatory", "CLic2 Contributions of Lick Observatory, Series II", "CoPer Contributions of Perkins Observatory",@@ -982,6 +1084,7 @@ "CoWat Contributions of the University of Waterloo Observatory", "CoVVO Contributions of the Van Vleck Observatory", "ConAP Contributions to Atmospheric Physics/Beitraege zur Physik Atmosphaere",+"CoGG. Contributions to Geophysics and Geodesy", "CoMP. Contributions to Mineralogy and Petrology", "CoPP. Contributions to Plasma Physics", "CoUCL Contributions Universite Catholique de Louvain",@@ -991,19 +1094,23 @@ "CopRe Copenhagen University Observatory Reprints", "CorRe Coral Reefs", "CorD. Cordoba Durchmusterung",+"CAGHS Correspondance Astronomique, Geographique, Hydrographique et statistique",+"CosEl Cosmic Electrodynamics", "CosRe Cosmic Research",-"CosSe Cosmic Search Summer",+"CosSe Cosmic Search", "CTP.. Course of Theoretical Physics", "CRB.. C.R. Acad. Sci. Ser. B1", "CraRe Cracow Observatory Reprints", "CRSSM Critical Reviews in Solid State &", "Cryo. Cryogenics", "CryRp Crystallography Reports",+"CSSE. Cultural Studies of Science Education", "CuCo. Culture and Cosmos", "CAP.. Current Applied Physics", "CCPCE Current Contents Physical Chemical and Earth Sciences", "CEyeR Current Eye Research", "CNan. Current Nanoscience",+"COSSM Current Opinion in Solid State and Materials Science", "CSci. Current Science", "CySys Cybernetics and Systems", "CzJPh Czechoslovak Journal of Physics",@@ -1027,12 +1134,13 @@ "DSSN. Delta Scuti Star Newsletter", "Sterb Der Sternenbote Monatsschrift fuer Oesterreichs Amateur-astronomen", "DGKBA Deutsche Geodaetische Kommission Bayer. Akad. Wiss.",+"DGKBB Deutsche Geodaetische Kommission Bayer. Akad. Wiss. B", "DGKGN Deutsche Geodaetische Kommission Gravity Network West Germany DSGN Data Adjustment", "DeHyZ Deutsche Hydrographische Zeitschrift", "DPhyG Deutsche Physikalische Gesellschaft", "DSEG. Developments in Solid Earth Geophysics", "DFVLR DFVLR",-"DRM.. Diamond And Related Materials",+"DRM.. Diamond and Related Materials", "Stern Die Sterne", "Welt. Die Weltall", "DnU.. Differentsial nye Uravneniia",@@ -1053,12 +1161,15 @@ "DLRNa DLR Nachrichten", "DOCi. Documentation des Observateurs Circulaire", "DOIAP Documentation des Observateurs Institut d'Astrophysique de Paris",+"DoANT Doklady Akademiia Nauk TadzhSSR", "DokAN Doklady Akad Nauk Minerologia USSR",+"DoBan Doklady Bolgarskoi Akademiia Nauk", "DokES Doklady Earth Sciences", "DokPC Doklady Physical Chemistry", "DAOAR Dominion Astrophysical Observatory Annual Report", "DorPo Dornier Post", "DSO.. Double Star Observer",+"DSSC. Double Star Section Circulars", "DudOR Dudley Observatory Reports", "PODE. Dun Echt Observatory Publications", "DunOP Dunsink Observatory Publications",@@ -1087,8 +1198,8 @@ "EERSA East Europe Rept Sci Affairs JPRS", "EBCi. Eclipsing Binaries Circulars", "EcGH. Eclogae geologae Helvetii",-"EGHel Eclogae Geologicae Helvetiae", "Ecogr Ecography",+"EcGou Ecole de Goutelas", "Earth eEarth", "EartD eEarth Discussions", "ETATF Eesti NSV Teaduste Akadeemia Toimetised Fuusika Matemaatika",@@ -1102,6 +1213,7 @@ "EJSEd Electronic Journal of Science Education", "EJSta Electronic Journal of Statistics", "EJTP. Electronic Journal of Theoretical Physics",+"EML.. Electronic Materials Letters", "ElPro Electronic Progress", "JElCo Electronics Communications of Japan", "ElL.. Electronics Letters",@@ -1109,6 +1221,7 @@ "EOSD. Electro Optical Systems Design", "ElLC. Electrotechnical Laboratory Circulars", "ElLR. Electrotechnical Laboratory Researches",+"ElW.. Electrowaerme International", "ElBah Elektrische Bahnen", "Elem. Elektromekhanika", "Elek. Elektronika",@@ -1117,18 +1230,21 @@ "ETRE. Elektrosviaz Telecommunications Radio Engineering Telecommunications", "EVest Elektrotehniski Vestnik", "OED.. El Observador de Estrellas Dobles",+"ElUn. El Universo", "EMCT. EMC Technology", "EBBT. Emerging Biochemical and Biophysical Techniques", "EAA.. Encyclopedia of Astronomy and Astrophysics", "Endvr Endeavour", "Energ Energetika", "EnAt. Energia es Atomtechnika",+"EnUK. Energy", "EnC.. Energy Conversion", "ECM.. Energy Conversion Management", "EnS.. Energy Sources", "EnTR. Energy Technology Review", "EnUK. Energy UK", "EngAn Engineering Analysis",+"EnSci Engineering and Science", "EngCo Engineering Computations", "EnFM. Engineering Fracture Mechanics", "EnOp. Engineering Optimization",@@ -1149,6 +1265,7 @@ "ETWQ. Environmental Toxicology and Water Quality", "Env.. Environmentrics", "EOSTr EOS Transactions",+"EL... EPL (Europhysics Letters)", "EPRIJ EPRI Journal", "AnErg Ergaenzungshefte zu den Astronomischen Nachrichten", "ErNW. Ergebnisse der exakten Naturwissenschaften",@@ -1156,12 +1273,14 @@ "Ergo. Ergonomics", "ESABu ESA Bulletin", "ESAHR ESA History Study Reports",+"EIUEN ESA IUE Newsletter", "ESAJ. ESA Journal", "ESASM ESA Scientific &", "ESAST ESA Scientific Technical Review", "ESATM ESA Training Manual", "EssPh Essays in Physics", "ECSS. Estuarine Coastal and Shelf Science",+"EUCAS EUCASS Proceedings Series", "EurSS Eurasian Soil Science", "EJASP EURASIP Journal on Applied Signal Processing", "EBioJ European Biophysics Journal",@@ -1180,6 +1299,8 @@ "EPJCS European Physical Journal C Supplement", "EPJD. European Physical Journal D", "EPJE. European Physical Journal E",+"EPJH. European Physical Journal H",+"EPJP. European Physical Journal Plus", "EPJST European Physical Journal Special Topics", "EuRv. European Review", "ESN.. European Science Notes",@@ -1203,6 +1324,7 @@ "ExG.. Exploration Geophysics", "Extr. Extraction", "PMtv. Facultad de Humanidades y Ciencias Universidad de la Republica Montevideo",+"FaDi. Faraday Discussions", "FaTr. Faraday Transactions", "FFEMS Fatigue and Fracture of Engineering Materials and Structures", "FerNo Fermilab Note",@@ -1226,6 +1348,7 @@ "FizMS Fizika Mnogochastichnykh Sistem", "FizNT Fizika Nizkikh Temperatur", "FizPl Fizika Plazmy",+"FizSz Fizika Sz.", "FizTT Fizika Tverdogo Tela", "FizZS Fizika Zhidkogo Sostoianiia", "FizAt Fiziki Atmosfery",@@ -1246,13 +1369,18 @@ "FoGeo Fotointerpretacja w Geografii", "FoPh. Foundations of Physics", "FoPhL Foundations of Physics Letters",+"Fract Fractals", "Freq. Frequenz",-"FrPhy Frontiers in Physics",+"FrES. Frontiers of Earth Science",+"FrMS. Frontiers of Materials Science",+"FrME. Frontiers of Mechanical Engineering",+"FrPhy Frontiers of Physics", "FrPhC Frontiers of Physics in China", "IzFru Frunze Izdatel Ilim", "FSTJ. Fujitsu Scientific Technical Journal", "FST.. Fullerene Science and Technology", "FAAp. Functional Analysis and Its Applications",+"FML.. Functional Materials Letters", "FACM. Functiones et Approximatio Commentarii Mathematici", "FInfo Fundamenta Informaticae", "FANP. Fundamental and Applied Nuclear Physics Series",@@ -1261,18 +1389,20 @@ "FTP.. Fundamental Theories of Physics", "Futur Future Spring", "GCNew Galactic Center Newsletter",+"galxp GALEX Proposal", "GalEl Galilean Electrodynamics", "GEB.. Games and Economic Behavior", "GGMit Gauss-Gesellschaft e.V. Göttingen, Mitteilungen", "GVPOO Gauthier-Villars Paris Observatory Observations", "GazA. Gazette Astronomique",+"GazAM Gazette Astronomique Memoires", "GazT. Gazodinamika i Teploobmen", "GCNR. GCN Report", "GECJR GEC Journal Research", "Gelio Geliotekhnika", "Gemin GEMINI Newsletter Royal Greenwich Observatory", "GHA.. General History of Astronomy",-"GPB.. General Physiology AND Biophysics",+"GPB.. General Physiology and Biophysics", "GReGr General Relativity and Gravitation", "Gen.. Genetica", "GeoIn Geocarto International",@@ -1282,8 +1412,10 @@ "GeocI Geochemistry International", "GeCoA Geochimica et Cosmochimica Acta", "GeCAS Geochimica et Cosmochimica Acta Supplement",+"GeCar Geodesy and Cartography", "GeAer Geodeziia i Aerofotos", "GeKar Geodeziia i Kartografiia",+"GKA.. Geodeziia i Kartografiia Aehrofotosemka, L'vov", "GeKaA Geodeziia Kartografiia i Aerofotos", "GeoK. Geodezja i Kartografia", "GeoAc Geodinamica Acta",@@ -1293,14 +1425,19 @@ "GeoZh Geofizicheskii Zhurnal", "GeoAA Geografiska Annaler, Series A: Physical Geography", "GeoAB Geografiska Annaler, Series B: Human Geography",+"GeIss Geoinformation Issues", "Geokh Geokhimiia",+"GCarp Geologica Carpathica", "GeolJ Geological Journal", "GeoM. Geological Magazine", "GeoSJ Geological Society Journal", "GSAMB Geological Society of America Bulletin", "GSAMm Geological Society of America Memoir", "GSASP Geological Society of America Special Papers",+"GSLSP Geological Society of London Special Publications",+"Geolo Geologija", "GeoRu Geologische Rundschau",+"Geolg Geologos", "Geo.. Geology", "GeoOD Geology of Ore Deposits", "GeoIs Geomagnitnye Issledovaniia",@@ -1333,6 +1470,7 @@ "TrGRC Geothermal Resources Council Transactions", "Geoth Geothermics", "Geot. Geotimes",+"Gerb. Gerbertvs, International Academic Publication on History of Medieval Science", "GBzG. Gerlands Beitraege zur Geophysik", "GUL.. Geschichte und Lichtwechsel der Veraenderlichen Sterne (Potsdam)", "GATAN Gesellschaft Aerosolforschung Tagung ueber Aerosole Naturwissenschaft Medizin und Technik Messtechnik und technische Anwendung",@@ -1344,6 +1482,7 @@ "GiGi. Gidroprivod i Gidropnevmoavtomatika", "GiSan Gigiena i Sanitariia", "GTPZ. Gigiena Truda i Professional nye Zabolevaniia",+"GAst. Giornale di Astronomia", "GlMaJ Glasgow Mathematical Journal", "GPC.. Global and Planetary Change", "GBioC Global Biogeochemical Cycles",@@ -1354,11 +1493,14 @@ "GrCoS Gravitation and Cosmology Supplement", "GrTOn Gravitatsiia i Teoriia Otnositel nosti", "GCN.. GRB Coordinates Network",+"GGMM. Greenhouse Gas Measurement &", "GriO. Griffith Observer", "GrAeH Grumman Aerospace Horizons", "Grund Grundwasser", "GICi. Gruppo Italiano RV Tauri Circolare", "HalRe Hale Observatories Reprints",+"HadJ. Hadronic Journal",+"HadJS Hadronic Journal Supplement", "BSD.. Hamburger Sternwarte Bergedorf", "HamS. Hamburger Sternwarte Sonderdrucke", "LS... Hamburger Sternw. Warner &",@@ -1388,15 +1530,12 @@ "HMR.. Helgoland Marine Research", "AcHCh Helvetica Chimica Acta", "AcHPh Helvetica Physica Acta",+"AcHPS Helvetica Physica Acta Supplementum", "HelOB Helwan Institute of Astronomy and Geophysics Bulletins", "HemD. Hemel en Dampkring", "HECh. High Energy Chemistry", "HEDP. High Energy Density Physics", "HEPNP High Energy Physics and Nuclear Physics",-"hep.exArXiv High Energy Physics - Experiment e-prints",-"hep.laArXiv High Energy Physics - Lattice e-prints",-"hep.phArXiv High Energy Physics - Phenomenology e-prints",-"hep.thArXiv High Energy Physics - Theory e-prints", "HiA.. Highlights of Astronomy", "HPP.. High Performance Polymers", "HPR.. High Pressure Research",@@ -1406,6 +1545,7 @@ "HARSB Histoire de l'Academie Royale des Sciences et des Belles-Lettres de Berlin", "HSPBS Historical Studies in the Physical and Biological Sciences", "HGeo. History of Geophysics",+"HGSS. History of Geo- and Space Sciences", "HisSc History of Science", "HUFEB Hokkaido University Faculty Engineering Bulletin", "HUFEM Hokkaido University Faculty Engineering Memoirs",@@ -1432,8 +1572,10 @@ "IAUDS IAU Commission on Double Stars", "IAUIn IAU Commission on Instruments", "IAUGA IAU General Assembly",+"IAUIB IAU Information Bulletin", "IAUSS IAU Special Session",-"IBMJ. IBM Journal Research Development",+"WFINw IAU Working Group on Wide-Field Imaging, Newsletter",+"IBMJ. IBM Journal of Research and Development", "ICAOB ICAO Bulletin", "Icar. Icarus", "IAESM IEEE Aerospace Electronic Systems Magazine",@@ -1442,6 +1584,7 @@ "IASSP IEEE ASSP Magazine", "ICiSM IEEE Circuits Systems Magazine", "IComM IEEE Communications Magazine",+"ICSEn IEEE Computational Science and Engineering", "ICGA. IEEE Computer Graphics Applications", "ICSM. IEEE Computer Systems Magazine", "IDTC. IEEE Design Test Computers",@@ -1452,11 +1595,13 @@ "IJOE. IEEE Journal of Oceanic Engineering", "IJQE. IEEE Journal of Quantum Electronics", "IJRA. IEEE Journal of Robotics Automation",+"ISTSP IEEE Journal of Selected Topics in Signal Processing", "IJSSC IEEE Journal of Solid-State Circuits", "IJSAC IEEE Journal on Selected Areas in Communications", "ILCSM IEEE LCS Magazine", "ILTS. IEEE LTS", "IMGWL IEEE Microwave and Guided Wave Letters",+"IMMag IEEE Microwave Magazine", "IEEEN IEEE Network", "IPTL. IEEE Photonics Technology Letters", "IEEEP IEEE Proceedings",@@ -1526,7 +1671,6 @@ "IPCSV IEE Proceedings: Communications Speech and Vision", "IPCTA IEE Proceedings D: Control Theory Applications", "IPCDT IEE Proceedings E: Computers and Digital Techniques",-"IPCRP IEE Proceedings F: Communications and Radar Processing", "IPCRS IEE Proceedings F: Communications Radar and Signal Processing", "IPRSP IEE Proceedings F: Radar and Signal Processing", "IPMAP IEE Proceedings H: Microwaves Antennas and Propagation",@@ -1536,12 +1680,14 @@ "IPSSE IEE Proceedings: Solid-State Electron Devices", "IEERv IEE Reviews", "IEIEE IEICE Electronics Express",+"ESSFR IEICE ESS Fundamentals Review", "IEITC IEICE Transactions on Communications", "IEITE IEICE Transactions on Electronics", "IEITF IEICE Transactions on Fundamentals of Electronics Communications and Computer Sciences", "IEITI IEICE Transactions on Information and Systems", "ITN.. IERS Technical Note", "IESJ. IES Journal",+"IHWN. IHW Newsletter", "JApMa IMA Journal of Applied Mathematics", "IJNA. IMA Journal of Numerical Analysis", "IVMA. IMA Volumes in Mathematics and its Applications",@@ -1555,7 +1701,6 @@ "IMEPI IME Proceedings. Part I: Journal of Systems and Control Engineering", "IMEPK IME Proceedings. Part K: Journal of Multibody Dynamics", "ICSE. Impact of Computing in Science and Engineering",-"IASAP Indian Academy of Science Aryabhata Proj", "InEPS Indian Academy of Sciences Proceedings: Earth and Planetary Sciences", "InMS. Indian Academy of Sciences Proceedings Mathematical Sciences", "InASP Indian Academy of Sciences Proceedings Section",@@ -1564,7 +1709,6 @@ "IIApN Indian Institute of Astrophysics Newsletter", "InISJ Indian Institute of Science Journal", "InISA Indian Institute of Science Journal of Aeronomical Society of India",-"InSST Indian Institute of Science Space Science Technology Applications: An Overview", "ITJSE Indian Institute of Technology Journal on Section Engineering Technology", "InJAE Indian Journal of Aerospace Engineering Division", "InJBB Indian Journal of Biochemistry and Biophysics",@@ -1575,14 +1719,15 @@ "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",-"InJPS Indian Journal of Physics Section B B", "IJPAM Indian Journal of Pure and Applied Mathematics", "IJPAP Indian Journal of Pure and Applied Physics", "IJRSP Indian Journal of Radio and Space Physics",+"InJHS Indian Journal of the History of Science", "InJTP Indian Journal of Theoretical Physics", "INSAP Indian National Science Academy Proceedings Supplement", "IDAQP Infinite Dimensional Analysis, Quantum Probability and Related Topics", "IBSH. Informational Bulletin of the Southern Hemisphere",+"IBUAA Informational Bulletin of the Ukrainian Astronomical Association", "InCo. Information and Computation", "IBVS. Information Bulletin on Variable Stars", "InfCo Information Control",@@ -1602,6 +1747,7 @@ "JIECE Institute of Electronics Communication Engineers of Japan Transactions Section E English", "IPASA Institute of Physics Academia Sinica Annual Report", "ISASS Institute of Space and Astronautical Science Report",+"ITABO Institute of Theoretical Astrophysics, Blindern-Oslo", "OslR. Institute of Theoretical Astrophysics Blindern Oslo Reports", "IEAEE Institution Engineers Australia Electrical Engineering Transactions", "IEEP. Institution of Electrical Engineers Proceedings",@@ -1610,11 +1756,10 @@ "IAFET Instituto de Astronomia y Fisica del Espacio Buenos Aires", "MerRe Instituto Venezolano de Astronomia Merida Venezuela", "IRMBP Institut Royal Meteorologique de Belgique Publications Serie",-"ITAB. Institut Teoreticheskoi Astronomii Biulleten",+"ITAB. Institut Teoreticheskoi Astronomii Byulleten", "TrITA Institut Teoreticheskoi Astronomii Trudy", "IET.. Instruments and Experimental Techniques", "InLoP Instytut Lotnictwa Prace",-"InMP. Instytut Maszyn Przeplywowych", "InMPP Instytut Maszyn Przeplywowych Prace", "IntaC Inta Conie", "ITSF. Integral Transforms and Special Functions",@@ -1626,11 +1771,13 @@ "IFB.. Interfaces and Free Boundaries", "IPAUC INTERKOSMOS Prague Astronomicky Ustav Ceskoslovenske Akademie Ved", "IANT. International Advances in Nondestructive Testing",+"IntAg International Agrophysics", "IAPPP International Amateur-Professional Photoelectric Photometry Communications",+"IAM.. International Applied Mechanics", "IAUC. International Astronomical Union Circular", "ICQ.. International Comet Quarterly", "ICHMT International Communications in Heat and Mass Transfer",-"IrPh. International Conference Infrared Physics Zurich Switzerland",+"IrPH. International Conference Infrared Physics Zurich Switzerland", "ICML. International Conference on Machine Learning", "IER.. Internationale Elektronische Rundschau", "InGeo International Geophysics Series",@@ -1640,11 +1787,15 @@ "IJNMF International Journal for Numerical Methods in Fluids", "IJRPC International Journal for Radiation Physics and Chemistry", "IJACS International Journal of Adaptive Control and Signal Processing",-"IJAA. International Journal of Adhesion Adhesives",+"IJAdA International Journal of Adhesion Adhesives",+"IJASS International Journal of Aeronautical and Space Sciences", "IJAEM International Journal of Analytical and Experimental Modal Analysis", "IJAEO International Journal of Applied Earth Observation and Geoinformation",-"IJApE International Journal of Applied Electromagnetics and Mechanics",+"IJApE International Journal of Electromagnetics and Mechanics",+"IJAIS International Journal of Applied Information Systems",+"IJAM. International Journal of Applied Mechanics", "IJAsB International Journal of Astrobiology",+"IJAA. International Journal of Astronomy and Astrophysics", "IJAP. International Journal of Aviation Psychology", "IJBC. International Journal of Bifurcation and Chaos", "IJBB. International Journal of Bioclimatology Biometeorology",@@ -1652,11 +1803,14 @@ "IJCli International Journal of Climatology", "IJCES International Journal of Computational Engineering Science", "IJCFD International Journal of Computational Fluid Dynamics",+"IJCMS International Journal of Computational Materials Science and Engineering", "IJCA. International Journal of Computer Applications",-"IJCMS International Journal of Computer Mathematics Section B",+"IJCAT International Journal of Computer Applications and Technology",+"IJCMB International Journal of Computer Mathematics Section B", "IJCV. International Journal of Computer Vision", "IJC.. International Journal of Control", "IJDM. International Journal of Damage Mechanics",+"IJDE. International Journal of Digital Earth", "IJDF. International Journal of Dynamics of Fluids", "IJEaS International Journal of Earth Sciences", "IJE.. International Journal of Electronics",@@ -1679,6 +1833,7 @@ "IJHM. International Journal of Hybrid Microelectronics Fall", "IJHE. International Journal of Hydrogen Energy", "IJHy. International Journal of Hyperthermia",+"IJIDF International Journal of Image and Data Fusion", "IJIG. International Journal of Image and Graphics", "IJIST International Journal of Imaging Systems Technology", "IJIE. International Journal of Impact Engineering",@@ -1696,6 +1851,7 @@ "IJMPA International Journal of Modern Physics A", "IJMPB International Journal of Modern Physics B", "IJMPC International Journal of Modern Physics C",+"IJMPS International Journal of Modern Physics Conference Series", "IJMPD International Journal of Modern Physics D", "IJMPE International Journal of Modern Physics E", "IJMF. International Journal of Multiphase Flow",@@ -1720,6 +1876,7 @@ "IJRS. International Journal of Remote Sensing", "IJRR. International Journal of Robotics Research", "IJSC. International Journal of Satellite Communications",+"IJSME International Journal of Science and Mathematics Education", "IJSEd International Journal of Science Education", "IJSE. International Journal of Solar Energy", "IJSS. International Journal of Solids and Structures",@@ -1731,6 +1888,7 @@ "IJTJE International Journal of Turbo Jet Engines", "IMRv. International Materials Reviews", "IMeRv International Metals Reviews",+"IREdu International Review of Education", "IRH.. International Review of Hydrobiology", "IRNP. International Review of Nuclear Physics", "IRPC. International Reviews in Physical Chemistry",@@ -1738,13 +1896,16 @@ "IUGG. International Union of Geodesy and Geophysics General Assembly", "IPNPR Interplanetary Network Progress Report", "IMPA. Interscience Monographs in Physics and Astronomy",+"ITPA. Interscience Tracts on Physics and Astronomy", "InMat Inventiones Mathematicae", "InvPr Inverse Problems", "IGeo. Investigations in Geophysics", "InFiZ Inzhenerno Fizicheskii Zhurnal", "IonIs Ionosfernye Issledovaniia", "Iono. Ionosphere",+"Ippa. Ipparchos", "IrJST Iranian Journal of Science Technology",+"IRETE IRE Transactions on Education", "IrAJ. Irish Astronomical Journal", "IrAJS Irish Astronomical Journal Supplement", "ISAP. ISA Proceedings",@@ -1754,8 +1915,11 @@ "IPBS. Isotopes in the Physical and Biomedical Sciences", "IsJT. Israel Journal of Technology", "IsSRT Israel Space Research and Technology Information Bulletin",+"ISRAA ISRN Astronomy and Astrophysics", "ISCJS ISRO Satellite Centre Journal of Spacecraft Technology",-"IssZK Issledovanie Zemli iz Kosmosa",+"ISSIR ISSI Scientific Reports Series",+"ISSIR ISSI Scientific Reports Series",+"IssZK Issledovanie Zemli Fiz Kosmosa", "IGAFS Issledovaniia Geomagnetizmu Aeronomii i Fizike Solntsa", "IsMTD Issledovaniia Mekhanike i Teploobmenu Dvukhfaznykh Sred", "IssUP Issledovaniia Uprugosti i Plastichnosti",@@ -1777,12 +1941,16 @@ "ITUTJ ITU Telecommunication Journal", "IUEEN IUE ESA Newsletter", "IUENN IUE NASA Newsletter",+"IzTad Izvestiia Akademiia Nauk TadzhSSR", "IzSF. Izvestiia Akademii Nauk Seriya Fizicheskaya", "IzGla Izvestiia Glavnoi rossiiskoi astronomicheskoi observatorii",+"IzVGA Izvestiia vuzov. Geodeziia Aehrofotosemka",+"IzVF. Izvestiia Vysshaia Uchebn. Zaved., Fizika",+"IzVUZ Izvestiia Vysshaia Uchebn. Zaved., Radiofizika", "IzAsh Izvestiya Akademii Nauk Turkmenskoj SSR Ashkhabad", "IzArm Izvestiya Akademiya Nauk Armyanskoi", "IzAlm Izvestiya Astrofizicheskogo Instituta Alma-Ata",-"IzKaz Izvestiya Astronomicheskoj Engel'gardt obskoj Observatorii Kazan",+"IzEhn Izvestiya Astronomicheskoj Engel'gardt obskoj Observatorii Kazan", "IzAOP Izvestiya Atmospheric and Oceanic Physics", "IzKie Izvestiya Glavnoj Astronomicheskoj Observatorii Kiev", "IzPul Izvestiya Glavnoj Astronomicheskoj Observatorii v Pulkove",@@ -1801,6 +1969,7 @@ "JJAPR Japanese Journal of Applied Physics Regular Papers Short Notes and Review Papers", "JJAPS Japanese Journal of Applied Physics Supplement", "JaJAG Japanese Journal of Astronomy and Geophysics",+"JMMPS Japanese Magazine of Mineralogical and Petrological Sciences", "JaIMJ Japan Institute of Metals Journal", "JSASS Japan Society of Aeronautical Space Sciences", "JSAST Japan Society of Aeronautical Space Sciences Transactions",@@ -1811,6 +1980,7 @@ "JSPS. Japan Society of Promotion Science", "JSMAJ JASMA Japan Society of Microgravity Application Journal", "JMeOp Jemna Mechanika Optika",+"JenRu Jenaer Rundschau", "JenRv Jena Review", "JBAn. Jodrell Bank Annals", "JBASP Jodrell Bank Ann Ser Pt",@@ -1826,16 +1996,19 @@ "JMecT Journal de Mecanique Theorique et Appliquee", "JMTAS Journal de Mecanique Theorique et Appliquee Supplement", "JPhys Journal de Physique",+"JPhyC Journal de Physique Colloque", "JPR.. Journal de Physique et le Radium", "JPhy1 Journal de Physique I", "JPhy2 Journal de Physique II", "JPhy3 Journal de Physique III", "JPhy4 Journal de Physique IV", "JPhyL Journal de Physique Lettres",+"JPhTA Journal de Physique Theorique et Apliquee", "JReAt Journal de Recherches Atmospheriques", "JAF.. Journal des Astronomes Francais", "JO... Journal des Observateurs", "JOp.. Journal d'Optique",+"JTP.. Journal for Technology of Plasticity", "JHA.. Journal for the History of Astronomy", "JHAS. Journal for the History of Astronomy Supplement", "JRAM. Journal fur die reine und angewandte Mathematik",@@ -1843,6 +2016,7 @@ "JNIRE Journal NIRE", "JAE.. Journal of Acoustic Emission", "JAMDS Journal of Advanced Mechanical Design, Systems, and Manufacturing",+"JAMES Journal of Advances in Modeling Earth Systems", "JAerS Journal of Aerosol Science", "JAerE Journal of Aerospace Engineering", "JAerP Journal of Aerospace Power",@@ -1858,6 +2032,8 @@ "JApCr Journal of Applied Crystallography", "JApEl Journal of Applied Electrochemistry", "JAG.. Journal of Applied Geophysics",+"JApMM Journal of Applied Mathematics and Mechanics",+"JAM.. Journal of Applied Mechanics", "JAMTP Journal of Applied Mechanics and Technical Physics", "JApMw Journal of Applied Metalworking", "JApMe Journal of Applied Meteorology",@@ -1874,6 +2050,7 @@ "JAESc Journal of Asian Earth Sciences", "JAD.. Journal of Astronomical Data", "JAHH. Journal of Astronomical History and Heritage",+"JAI.. Journal of Astronomical Instrumentation", "JAsPh Journal of Astronomy and Physics (Turkey)", "JASS. Journal of Astronomy and Space Sciences", "JApA. Journal of Astrophysics and Astronomy",@@ -1897,7 +2074,7 @@ "JBNMR Journal of Biomolecular NMR", "JBBC. Journal of Biophysical and Biochemical Cytology", "JBiop Journal of Biophysics",-"JBiBi Journal of Biophysique et de Biomecanique",+"JBiBi Journal of Biophysique et Biomecanique", "JBMN. Journal of Biophysique et Medecine Nucleaire", "JBMR. Journal of Bone and Mineral Research", "JBR.. Journal of Breath Research",@@ -1910,18 +2087,21 @@ "JCli. Journal of Climate", "JCAM. Journal of Climate and Applied Meteorology", "JClim Journal of Climatology",-"JClM. Journal of Clinical Microbiology",+"JCS.. Journal of Clinical Microbiology", "JClP. Journal of Clinical Pharmacology", "JCS.. Journal of Cluster Science", "JCScT Journal of College Science Teaching", "JCIS. Journal of Colloid and Interface Science",+"JCoSc Journal of Colloid Science", "JCTA. Journal of Combinatorial Theory, Series A", "JCTB. Journal of Combinatorial Theory, Series B", "JCom. Journal of Communications",+"CoNet Journal of Communications and Networks", "JComp Journal of Complexity", "JCoMa Journal of Composite Materials", "JCTR. Journal of Composites and Technology Research", "JCA.. Journal of Computational Acoustics",+"JTCN. Journal of Computational and Theoretical Nanoscience", "JCoAM Journal of Computational and Applied Mathematics", "JCoB. Journal of Computational Biology", "JCoCh Journal of Computational Chemistry",@@ -1929,9 +2109,11 @@ "JCoN. Journal of Computational Neuroscience", "JCoPh Journal of Computational Physics", "JCST. Journal of Computational Science and Technology",-"JCAMD Journal of Computer-Aided Materials Design",+"JCMD. Journal of Computer-Aided Materials Design",+"JCAMD Journal of Computer-Aided Molecular Design", "JCoSS Journal of Computer and System Sciences", "JCHyd Journal of Contaminant Hydrology",+"JConP Journal of Contemporary Physics (Armenian Academy of Sciences)", "JCos. Journal of Cosmology", "JCAP. Journal of Cosmology and Astro-Particle Physics", "JCrGr Journal of Crystal Growth",@@ -1947,15 +2129,19 @@ "JESS. Journal of Earth System Science", "JElas Journal of Elasticity", "JEEEA Journal of Electrical and Electronics Engineering Australia",+"JEE.. Journal of Electrical Engineering", "JElec Journal of Electroceramics",+"JEAA. Journal of Electromagnetic Analysis and Application", "JEWA. Journal of Electromagnetic Waves and Applications", "JECS. Journal of Electronic Circuits and Systems", "JEI.. Journal of Electronic Imaging", "JEMat Journal of Electronic Materials", "JEPub Journal of Electronic Publishing",+"JECTC Journal of Electronics Cooling and Thermal Control", "JElM. Journal of Electronics Manufacturing", "JEMT. Journal of Electron Microscopy Technique", "JESRP Journal of Electron Spectroscopy and Related Phenomena",+"JESEd Journal of Elementary Science Education", "JEner Journal of Energy", "JEAS. Journal of Engineering and Applied Sciences", "JEnMa Journal of Engineering and Mathematics",@@ -1981,6 +2167,7 @@ "JGeod Journal of Geodesy", "JGeo. Journal of Geodynamics", "JGS.. Journal of Geographical Systems",+"JGIS. Journal of Geographic Information System", "JG... Journal of Geology", "JGG.. Journal of Geomagnetism and Geoelectricity", "JGGS. Journal of Geomagnetism and Geoelectricity Supplement",@@ -2000,6 +2187,7 @@ "JGlac Journal of Glaciology", "JGO.. Journal of Global Optimization", "JGrPh Journal of Gravitational Physics",+"JGHyd Journal of Groundwater Hydrology", "JGuC. Journal of Guidance Control", "JGCD. Journal of Guidance Control Dynamics", "JHeu. Journal of Heuristics",@@ -2012,15 +2200,34 @@ "JHyMe Journal of Hydrometeorology", "JHyn. Journal of Hydronautics", "JIST. Journal of Imaging Science and Technology",-"JInfo Journal of Infometrics",+"JIPM. Journal of Information Processing and Management",+"JInfo Journal of Informetrics", "JIMW. Journal of Infrared and Millimeter Waves", "JInst Journal of Instrumentation", "JIntS Journal of Integer Sequences", "JIEq. Journal of Integral Equations", "JIRS. Journal of Intelligent and Robotic Systems", "JIMSS Journal of Intelligent Material Systems and Structures",+"JIEx. Journal of Ion Exchange",+"JJAEE Journal of Japan Association for Earthquake Engineering", "JJAHS Journal of Japanese Association of Hydrological Sciences", "JJSEE Journal of Japanese Society for Engineering Education",+"JSCSE Journal of Japan Society of Civil Engineers, Ser. A1 (Structural Engineering &",+"JSCAM Journal of Japan Society of Civil Engineers, Ser. A2 (Applied Mechanics (AM))",+"JSCHE Journal of Japan Society of Civil Engineers, Ser. B1 (Hydraulic Engineering)",+"JSCGE Journal of Japan Society of Civil Engineers, Ser. C (Geosphere Engineering)",+"JSCAI Journal of Japan Society of Civil Engineers, Ser. D1 (Architecture of Infrastructure and Environment)",+"JSCHS Journal of Japan Society of Civil Engineers, Ser. D2 (Historical Studies in Civil Engineering)",+"JSCIP Journal of Japan Society of Civil Engineers, Ser. D3 (Infrastructure Planning and Management)",+"JSCPE Journal of Japan Society of Civil Engineers, Ser. E1 (Pavement Engineering)",+"JSCMC Journal of Japan Society of Civil Engineers, Ser. E2 (Materials and Concrete Structures)",+"JSCTE Journal of Japan Society of Civil Engineers, Ser. F1 (Tunnel Engineering)",+"JSCUS Journal of Japan Society of Civil Engineers, Ser. F2 (Underground Space Research)",+"JSCCE Journal of Japan Society of Civil Engineers, Ser. F3 (Civil Engineering Informatics)",+"JSCCM Journal of Japan Society of Civil Engineers, Ser. F4 (Construction and Management)",+"JSCPP Journal of Japan Society of Civil Engineers, Ser. F5 (Professional Practices in Civil Engineering)",+"JSCSP Journal of Japan Society of Civil Engineers, Ser. F6 (Safety Problem)",+"JSCER Journal of Japan Society of Civil Engineers, Ser. G (Environmental Research)", "JKTR. Journal of Knot Theory and its Ramifications", "JKAS. Journal of Korean Astronomical Society", "JKASS Journal of Korean Astronomical Society Supplement",@@ -2034,10 +2241,9 @@ "JLum. Journal of Luminescence", "JMSB. Journal of Macromolecular Science, Part B: Physics", "JMSC. Journal of Macromolecular Science, Part C: Reviews in Macromolecular Chemistry and Physics",-"JMmSP Journal of Macromolecular Science Physics",-"JMmSR Journal of Macromolecular Science Reviews in Macromolecular Chemistry and Physics", "JMagR Journal of Magnetic Resonance", "JMMM. Journal of Magnetism and Magnetic Materials",+"JMR.. Journal of Marine Research", "JMSA. Journal of Marine Science and Application", "JMS.. Journal of Marine Systems", "JMarA Journal of Maritime Archaeology",@@ -2052,6 +2258,7 @@ "JMSMM Journal of Materials Science: Materials in Medicine", "JMSP. Journal of Materials Synthesis and Processing", "JMAA. Journal of Mathematical Analysis and Applications",+"JMCS. Journal of Mathematical and Computational Science", "JMPS. Journal of Mathematical and Physical Sciences", "JMaCh Journal of Mathematical Chemistry", "JMFM. Journal of Mathematical Fluid Mechanics",@@ -2060,6 +2267,7 @@ "JMPsy Journal of Mathematical Psychology", "JMaSc Journal of Mathematical Sciences", "JMSo. Journal of Mathematical Sociology",+"JMaMe Journal of Mathematics and Mechanics", "JMaPh Journal of Mathematics and Physics", "JMecE Journal of Mechanical and Engineering Science", "JMBM. Journal of Mechanical Behavior and Materials",@@ -2070,6 +2278,7 @@ "JMemS Journal of Microelectromechanical Systems", "JMiMi Journal of Micromechanics and Microengineering", "JMic. Journal of Microscopy",+"JMPeS Journal of Mineralogical and Petrological Sciences", "JMOp. Journal of Modern Optics", "JMPh. Journal of Modern Physics", "JMBio Journal of Molecular Biology",@@ -2133,13 +2342,15 @@ "JPhsg Journal of Physiology", "JPFR. Journal of Plasma and Fusion Research", "JPlPh Journal of Plasma Physics",+"JPoSc Journal of Polymer Science", "JPoSA Journal of Polymer Science A Polymer Chemistry", "JPoSB Journal of Polymer Science B Polymer Physics",+"JPoSL Journal of Polymer Science: Polymer Letters Edition", "JPMat Journal of Porous Materials", "JPES. Journal of Power and Energy Systems", "JPS.. Journal of Power Sources", "JPAS. Journal of Practical Applications in Space",-"JPP.. Journal of Propulsion Power",+"JPP.. Journal of Propulsion and Power", "JPT.. Journal of Propulsion Technology", "JPrCh Journal of Protein Chemistry", "JPApS Journal of Pure Applied Sciences",@@ -2152,8 +2363,12 @@ "JRSp. Journal of Raman Spectroscopy", "JRPC. Journal of Reinforced Plastics and Composites", "JRes. Journal of Research",+"JRPhy Journal of Research in Physics", "JRScT Journal of Research in Science Teaching",+"JRIST Journal of Research Institute of Science and Technology, College of Science and Technology, Nihon University", "JRNBS Journal of Research of the National Bureau of Standards",+"JRNBA Journal of Research of the National Bureau of Standards A Physica and Chemsitry",+"JRNBB Journal of Research of the National Bureau of Standards B Mathematical Sciences", "JRTEd Journal of Research on Technology in Education", "JResB Journal of Research Section B Mathematical Sciences B", "JRheo Journal of Rheology",@@ -2181,11 +2396,11 @@ "JSpRo Journal of Spacecraft and Rockets", "JSpT. Journal of Spacecraft Technology", "JSpEn Journal of Space Engineering",+"JSWSC Journal of Space Weather and Space Climate", "JSCS. Journal of Statistical Computation and Simulation", "JSMTE Journal of Statistical Mechanics: Theory and Experiment", "JSP.. Journal of Statistical Physics", "JStA. Journal of Strain Analysis and Engineering Design",-"JSAED Journal of Strain Analysis for Engineering Design", "JSG.. Journal of Structural Geology", "JSM.. Journal of Structural Mechanics", "JSup. Journal of Superconductivity",@@ -2200,27 +2415,32 @@ "JAMS. Journal of the American Mathematical Society", "JASIS Journal of the American Society for Information Science and Technology", "JASCE Journal of the American Society of Civil Engineers",+"JAWRA Journal of the American Water Resources Association", "JALPO Journal of the Association of Lunar and Planetary Observers, the Strolling Astronomer", "JAnSc Journal of the Astronautical Sciences", "JASEg Journal of the Astronomical Society of Egypt",+"JASSA Journal of the Astronomical Society of Southern Africa", "JASV. 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",+"JGSJ. Journal of the Geodetic Society of Japan", "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",+"JIPNT Journal of the Institute of Positioning, Navigation and Timing of Japan", "JIETE Journal of the Institution of Electronics and Telecommunication Engineers",+"JJSMS Journal of the Japan Society for Marine Surveys and Technology", "JLMS. Journal of the London Mathematical Society", "JORS. Journal of the Operational Research Society", "JOSA. Journal of the Optical Society of America (1917-1983)", "JOSAA Journal of the Optical Society of America A", "JOSAB Journal of the Optical Society of America B Optical Physics",+"JTAM. Journal of Theoretical and Applied Mechanics", "JTBio Journal of Theoretical Biology", "JPSJ. Journal of the Physical Society of Japan", "JPSJS Journal of the Physical Society of Japan Supplement",@@ -2238,12 +2458,15 @@ "JRCSE Journal of the Royal College of Surgeons of Edinburgh", "JRSSD Journal of the Royal Statistical Society: Series D (The Statistician)", "JSRP. Journal of the Society for Radiological Protection",+"JSPST Journal of The Society of Photographic Science and Technology of Japan", "JSARA Journal of the Southeastern Association for Research in Astronomy",-"JVSJ. Journal of the Vacuum Society of Japan",+"JSD.. Journal of the Structural Division, American Society of Civil Engineers",+"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", "JVST. Journal of Vacuum Science Technology",+"JVSTA Journal of Vacuum Science Technology A: Vacuum Surfaces and Films", "JVSTB Journal of Vacuum Science Technology B: Microelectronics and Nanometer Structures", "JVC.. Journal of Vibration and Control", "JVE.. Journal of Vibration Engineering",@@ -2260,6 +2483,7 @@ "JSMET JSME Transactions", "KKR.. Kagaku Kogaku Ronbunshu", "MmKMO Kakioka Magnetic Observatory Memoirs",+"KEIJ. Kansei Engineering International Journal", "GroR. Kapteyn Astronomical Laboratory Groningen Reports", "KIzKU Kazan Izdatel Kazanskogo Universiteta", "MeeRe Kenneth Mees Observatory Reprints",@@ -2284,6 +2508,7 @@ "KFNTS Kinematika i Fizika Nebesnykh Tel Supplement", "KiCat Kinetics and Catalysis", "KIzS. Kishinev Izdatel Shtiintsa",+"KPNON Kitt Peak National Observatory Newsletter", "KVeBB Kleine Veroeffentlichungen der Universitaetssternwarte zu Berlin Babelsberg", "KlBer Kleinheubacher Berichte", "KodOB Kodaikanal Observatory Bulletins",@@ -2314,6 +2539,7 @@ "LHBl. La Houille Blanche", "Meteo La Meteorologie", "LDD.. Land Degradation &",+"LanB. Landolt Börnstein", "Langm Langmuir", "LaJ.. Lapidary Journal", "Rech. La Recherche",@@ -2363,7 +2589,9 @@ "LeLen Leningrad Lenizdat", "LGUPM Leningradskii Gosudarstvennyi Universitet Problemy Matematicheskoi Fiziki", "VeLen Leningradskii Universitet Vestnik Matematika Mekhanika Astronomiia",+"LeRad Le Radium", "Leo.. Leonardo",+"LFTR. LEST Foundation, Technical Report", "LHMT. Letters Heat Mass Transfer", "LAES. Letters in Applied and Engineering Sciences", "LMaPh Letters in Mathematical Physics",@@ -2380,10 +2608,12 @@ "LOEle L'Onde Electrique", "LowOB Lowell Observatory Bulletin", "LTP.. Low Temperature Physics",+"LPIBu LPI Bulletin", "LPICo LPI Contributions", "LubEn Lubrication Engineering", "LR... Luft und Raumfahrt", "LuRaQ Luft und Raumfahrt Quarter",+"LPSC. Lunar and Planetary Science Conference Proceedings", "LCEC. Luxembourg Commission European Communities", "LIVS. Lvov Izdatel Vishcha Shkola", "LvoTs L'vovskij Ordena Lenina Gosudarstvennyj Universitet Tsirkulyar",@@ -2396,6 +2626,7 @@ "MagFE Magnetic Fusion Energy", "MRMed Magnetic Resonance in Medicine", "MRMPB Magnetic Resonance Materials in Physics Biology and Medicine",+"MRRev Magnetic Resonance Review", "MHD.. Magnetohydrodynamics", "MagGi Magnitnaia Gidrodinamika", "MagIs Magnitosfernye Issledovaniia",@@ -2404,10 +2635,11 @@ "Lapa. Majalah LAPAN", "MWGBI Mannheim West Germany Bibliographisches Institut AG", "MaTeJ ManTech Journal",+"MGeo. Manuscr. Geod.", "ManGe Manuscripta Geodaetica", "MarRv Marconi Review", "MarGe Marine Geodesy",-"MarGR Marine Geophysical Researches",+"MarGR Marine Geophysical Research", "MarPG Marine Petroleum Geology", "Mars. Mars", "Mashi Mashinostroenie",@@ -2423,14 +2655,19 @@ "Mate. Materials", "MMP.. Materials and Manufacturing Processes", "MCP.. Materials Chemistry and Physics",+"MaHT. Materials at High Temperatures", "MatEv Materials Evaluation", "MatL. Materials Letters", "MaRBu Materials Research Bulletin", "MRSSP Materials Research Society Symposia Proceedings", "MSEng Materials Science and Engineering",+"MSEnA Materials Science and Engineering A",+"MSEnB Materials Science and Engineering B",+"MSEnC Materials Science and Engineering C", "MSEnR Materials Science and Engineering R Reports", "MSTec Materials Science and Technology", "MSF.. Materials Science Forum",+"MatSP Materials Science Poland", "MatST Materials Science Technology", "MatTr Materials Transactions JIM", "MatTe Materiaux et Techniques",@@ -2444,22 +2681,29 @@ "M3AS. Mathematical Models and Methods in Applied Sciences", "MPAG. Mathematical Physics, Analysis and Geometry", "MPAM. Mathematical Physics and Applied Mathematics",-"math.pArXiv Mathematical Physics e-prints",+"MaPEJ Mathematical Physics Electronic Journal", "MaPhS Mathematical Physics Studies", "MaPr. Mathematical Proceedings", "MPCPS Mathematical Proceedings of the Cambridge Philosophical Society",+"MatPr Mathematical Programming", "MatRv Mathematical Reviews", "MMS.. Mathematics and Mechanics of Solids",+"MEdRJ Mathematics Education Research Journal", "MaCom Mathematics of Computation", "Mat.. Mathematika",+"MatAn Mathematische Annalen",+"MatNa Mathematische Nachrichten",+"MatZe Mathematische Zeitschrift", "MitAe Max Planck Institut Aeronomie Mitteilungen",+"MPARp Max Planck Institut fur Astrophysik Report", "Meas. Measurements", "MeScT Measurement Science and Technology",+"MeScR Measurement Science Review", "Mecc. Meccanica", "MecEn Mechanical Engineering", "MSSP. Mechanical Systems and Signal Processing", "MPDS. Mechanics and Physics of Discrete Systems",-"MCMS. Mechanics of Composite Materials &",+"MCMS. Mechanics of Composite Materials", "MSM.. Mechanics of Structures and Machines", "MTDM. Mechanics of Time-Dependent Materials", "MeReC Mechanics Research Communications",@@ -2491,8 +2735,8 @@ "MSAIS Memorie della Societa Astronomica Italiana Supplementi", "MmSSI Memorie della Societa Degli Spettroscopisti Italiani", "MmSS. Memorie della Societa Degli Spettroscopisti Italiani, serie 2",+"MmSGI Memorie della Societa Geologica Italiana", "MmNap Memorie del R. Osservatorio di Capodimonte in Napoli",-"ska..mSKA memos", "MeCom Mendeleev Communications", "Mercu Mercury", "MeAut Meres es Automatika",@@ -2501,7 +2745,6 @@ "MTObM Metallovedenie i Termicheskaia Obrabotka Metallov", "MMTA. Metallurgical and Materials Transactions A", "MMTB. Metallurgical and Materials Transactions B",-"MT... Metallurgical Transactions", "MTA.. Metallurgical Transactions A", "MTB.. Metallurgical Transactions B", "MTPMM Metallurgical Transactions Physical Metallurgy Materials Science",@@ -2525,6 +2768,7 @@ "MAP.. Meteorology and Atmospheric Physics", "MetAP Meteorology Atmospheric Physics", "MetHy Meteorology Hydrology JPRS",+"MeRR. Meteor. rasprostr. radiovoln, Kazan", "MVMP. Methoden und Verfahren der Mathematischen Physik", "MCME. Methods: A Companion to Methods in Enzymology", "MApAn Methods and Applications of Analysis",@@ -2554,6 +2798,7 @@ "MiElC Military Electronics Countermeasures", "MiLa. Mind and Language", "MinDe Mineralium Deposita",+"Miner Mineralogia", "MinM. Mineralogical Magazine", "MinPe Mineralogy and Petrology", "MinPh Mineral Physics",@@ -2583,10 +2828,13 @@ "MiTue Mitteilungen des Astronomischen Instituts der Universitaet Tuebingen", "MiMue Mitteilungen des Astronomischen Instituts des Universitaet Munster", "MiPot Mitteilungen des Astrophysikalischen Observatoriums Potsdam",+"MiGIR Mitteilungen Geod. Institut Rheinischen Friedrich-Wilhelms-Universitaets. Bonn", "MSMSE Modelling Simul. Mater. Sci. Eng.", "MAG.. Modern Approaches in Geophysics", "ModGe Modern Geology",+"ModIn Modern Instrumentation", "MIMPE Modern Instrumentation and Measurements in Physics and Engineering",+"ModPh Modern Physics", "MPLA. Modern Physics Letters A", "MPLB. Modern Physics Letters B", "MJPS. Moldavian Journal of the Physical Sciences",@@ -2598,6 +2846,8 @@ "MoPhR Molecular Physics Reports", "MoSim Molecular Simulation", "MCBEH Monatliche Correspondenz zur Beforderung der Erd- und Himmels-kunde",+"WisBB Monatsber. Deutsch. Akad Wissenschaftliche Berlin",+"MEEP. Monographs on Environment, Earth and Planets", "MNSSJ Monthly notes of the Astronomical Society of South Africa", "MNSSA Monthly Notes of the Astronomical Society of South Africa", "MNRAS Monthly Notices of the Royal Astronomical Society",@@ -2664,10 +2914,12 @@ "MtWAR Mount Wilson and Palomar Observatory Annual Report", "MtWRe Mount Wilson and Palomar Observatory Reprints", "MWOAR Mount Wilson Observatory Annual Report",+"MPERp MPE Report", "MRSBu MRS Bulletin", "MUSS. Muenchen Universitaets Schriften Serie", "MROVG Munich R Oldenbourg Verlag GmbH", "NISZ. Nabliudeniia Iskusstvennykh Sputnikov Zemli",+"NINT. Nablyud. Iskusstvennykh Nebesnykh Tel", "NAZ.. Nachrichtenblatt der Astronomischen Zentralstelle Heidelberg", "NVS.. Nachrichtenblatt der Vereinigung der Sternfreunde", "NacEl Nachrichten Elektronik",@@ -2675,6 +2927,7 @@ "NacZe Nachrichtentechnische Zeitschrift", "NOGB. Nachr. Olbers-Ges. Bremen", "NUFEM Nagoya University Faculty Engineering Memoirs",+"NURIA Nagoya University Research Institute of Atmospherics Proceedings", "NUSEM Nagoya University School Engineering Memoirs", "NaAIJ Nanjing Aeronautical Institute Journal", "NUAAJ Nanjing University Aeronautics and Astronautics Journal",@@ -2689,24 +2942,32 @@ "NASSP NASA Special Publication", "STIA. NASA STI/Recon Technical Report A", "STIN. NASA STI/Recon Technical Report N",+"NASTM NASA Technical Memo", "NBSSP National Bureau of Standards Special Publication", "NBSTN National Bureau of Standards Technical Note", "NaGe. National Geographic", "NISTJ National Institute of Standards and Technology Journal of Research", "PolRe National Institute Polar Research Memoirs", "BAth. National Observatory of Athens Greece Bulletin of the Astronomical Institute",+"NRAON National Radio Astronomy Observatory Newsletter", "NRAOR National Radio Astronomy Observatory Reprints",+"NRAOW National Radio Astronomy Observatory Workshop", "NUDTJ National University Defense Technology Journal", "NHESS Natural Hazards and Earth System Sciences", "NatH. Natural History",+"NatSc Natural Science", "Natur Nature",+"NatBi Nature Biotechnology", "NatCh Nature Chemistry",+"NatCC Nature Climate Change",+"NatCo Nature Communications", "NatGe Nature Geoscience", "NatMa Nature Materials", "NatNa Nature Nanotechnology", "NaPho Nature Photonics", "NPhS. Nature Physical Science", "NatPh Nature Physics",+"NatSR Nature Scientific Reports", "NW... Naturwissenschaften", "NInfo Nauchnye Informatsii", "NRRv. Naval Research Reviews",@@ -2723,7 +2984,7 @@ "NeuL. Neuroscience Letters", "NPNDS Neutron Physics and Nuclear Data in Science and Technology", "NewA. New Astronomy",-"NewAR New Astronomy Review",+"NewAR New Astronomy Reviews", "NJCh. New Journal of Chemistry", "NJPh. New Journal of Physics", "NewSc New Scientist",@@ -2732,10 +2993,11 @@ "NTN.. New Technology News", "NZJGG New Zealand Journal Geology and Geophysics", "NZJS. New Zealand Journal of Science",+"NKG.. Nihon Kessho Gakkaishi", "NOHIC Nizamiah JAPAL Rangapur Observatories Hyderabad India Contributions", "NizRe Nizamiah Observatory Reprints", "NCE.. Noise Control Engineering Journal",-"NDTE. Nondestructive Testing and Evaluation",+"NTE.. Nondestructive Testing and Evaluation", "NDTI. Nondestructive Testing and Evaluation International", "NTCo. Nondestructive Testing Communications", "NPPSB Nonequilibrium Problems in the Physical Sciences and Biology",@@ -2744,21 +3006,25 @@ "NlOpt Nonlinear Optics", "NPGeo Nonlinear Processes in Geophysics", "NSAP. Nonlinear, Statistical and Applied Physics",+"NTA.. Nonlinear Theory and Its Applications, IEICE", "NATi. Nordisk Astronomisk Tidsskrift",-"SApMM North Holland Series Applied Mathematics Mechanics",+"SApMM North Holland Series Applied Mathematical Mechanics", "NHCWP North Hollywood Calif Western Periodicals Co", "NPUJ. Northwestern Polytechnical University Journal", "NoDef Not Defined",+"NoPar Notes et Informations", "NROpt Nouvelle Revue d'Optique", "NROA. Nouvelle Revue d'Optique Appliquee", "UGC.. Nova Acta Regiae Soc. Sci. Upsaliensis Ser. V",+"NTvA. Novaya tekhn. v astron.", "NoIGG Novosibirsk Institut Geologii i Geofiziki SO AN SSSR", "NovIG Novosibirsk Institut Gidrodinamiki SO AN SSSR Dinamika Sploshnoi Sredy", "NoIzN Novosibirsk Izdatel Nauka",+"NSSDC NSSDC Publication", "NTTRv NTT Review", "NDS.. Nuclear Data Sheets",+"NDT.. Nuclear Data Tables", "NuEnD Nuclear Engineering and Design",-"nucl.eArXiv Nuclear Experiment e-prints", "NucFu Nuclear Fusion", "NucFS Nuclear Fusion Special Supplement", "NuGeo Nuclear Geophysics",@@ -2773,7 +3039,6 @@ "NSE.. Nuclear Science Engineering", "NucTe Nuclear Technology", "NucTF Nuclear Technology Fusion",-"nucl.tArXiv Nuclear Theory e-prints", "NAR.. Nucleic Acids Research", "NuAlg Numerical Algorithms", "NFAO. Numerical Functional Analysis and Optimization",@@ -2788,12 +3053,12 @@ "NCimL Nuovo Cimento Lettere", "NCimR Nuovo Cimento Rivista Serie", "NCimS Nuovo Cimento Serie",+"OCSC. OAA Compututer Section Circular", "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", "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",@@ -2812,6 +3077,7 @@ "ObVyS Obzory Vysokotemperaturnoi Sverkhprovodimosti", "ONRAS Occasional Notes of the Royal Astronomical Society", "ORROE Occasional Reports of the Royal Observatory Edinburgh",+"OccN. Occultation Newsletter, International Occultation Timing Association (IOTA)", "OcDyn Ocean Dynamics", "OcEng Ocean Engineering", "OcMod Ocean Modelling",@@ -2833,6 +3099,12 @@ "OCzAS Ondrejov Czechoslovakia Czechoslovak Academy Sciences CAS Astronomical Institute Publications", "ONERA ONERA TP", "OEJV. Open European Journal on Variable Stars",+"OJA.. Open Journal of Acoustics",+"OJAS. Open Journal of Applied Sciences",+"OJBp. Open Journal of Biophysics",+"OJFD. Open Journal of Fluid Dynamics",+"OJGeo Open Journal of Geology",+"OJMic Open Journal of Microphysics", "OLear Open Learning", "OSID. Open Systems and Information Dynamics", "AcOpt Optica Acta",@@ -2847,6 +3119,7 @@ "OSAJI Optical Society of America Journal Optics and Image Science", "OptPN Optics &", "OptLE Optics and Lasers in Engineering",+"OPJ.. Optics and Photonics Journal", "OptSp Optics and Spectroscopy", "OptCo Optics Communications", "OExpr Optics Express",@@ -2865,6 +3138,7 @@ "OrGeo Organic Geochemistry", "OrLi. Origins of Life", "OLEB. Origins of Life and Evolution of the Biosphere",+"Ori.. Orione", "Orion Orion: Zeitschrift für Amateur-Astronomie", "IGS.. Orlando FL Academic Press Inc International Geophysics Series", "OrNav Ortung und Navigation",@@ -2880,6 +3154,7 @@ "TriP. Osservatorio Astronomico di Trieste Pubblicazioni", "TreP. Osservatorio Privato Specola Ariel Treviso Italia Pubblicazione", "MmArc Osservazioni e memorie dell'Osservatorio astrofisico di Arcetri",+"MmArS Osservazioni e memorie dell'Osservatorio astrofisico di Arcetri - Appendici", "OsCar Osteoarthritis and Cartilage", "OtObI Otbor i Obrabotka Informatsii", "OtPI. Otbor i Peredacha Informatsii",@@ -2893,9 +3168,11 @@ "PMetR Papers in Meteorological Research", "PPh.. Papers in Physics", "PMG.. Papers Meteorology Geophysics",+"PGC.. Papers on Global Change IGBP", "ParC. Parallel Computing", "Paras Parasitology", "ParAc Particle Accelerators",+"PPhI. Particle Physics Insights", "PaReL Pattern Recognition Letters", "PerMS Perceptual Motor Skills", "PZ... Peremennye Zvezdy",@@ -2905,6 +3182,7 @@ "PPME. Periodica Polytechnica Mechanical Engineering", "PPTE. Periodica Polytechnica Transportation Engineering", "PerCo Perkins Observatory Contributions",+"PMO.. Perth Meridien Observations", "PTMJ. Phase Transitions: A Multinational Journal", "PhDT. Ph.D. Thesis", "PhiJR Philips Journal Research",@@ -2914,6 +3192,7 @@ "PMagL Philosophical Magazine Letters", "PMagA Philosophical Magazine, Part A", "PMagB Philosophical Magazine, Part B",+"PFP.. Philosophy and Foundations of Physics", "Phoen Phoenix Mitteilungsblatt fuer Veraenderlichenbeobachter", "PcPb. Photochemistry and Photobiology", "Pg... Photogrammetria",@@ -2921,9 +3200,11 @@ "PgERS Photogrammetric Engineering and Remote Sensing", "PhInt Photo Interpretation", "PhNan Photonics and Nanostructures",+"PhSen Photonic Sensors", "PhoSp Photonics Spectra", "PsynR Photosynthesis Research", "Psyn. Photosynthetica",+"PhyOJ Physcs Online Journal", "Phy.. Physica", "PhyA. Physica A Statistical Mechanics and its Applications", "PhyBC Physica B+C",@@ -2950,6 +3231,7 @@ "PhRvI Physical Review Series I", "PhRvS Physical Review Special Topics Accelerators and Beams", "PRSTP Physical Review Special Topics Physics Education",+"PhRvX Physical Review X", "PSD.. Physical Sciences Data", "PSCEC Physical Sciences Series of the Commission of European Communities", "PhyNr Physica Norvegica",@@ -2963,6 +3245,7 @@ "PhySS Physica Status Solids", "PhyL. Physic Letters", "PhChH PhysicoChemical Hydrodynamics",+"Physi Physics", "PCS.. Physics and Chemistry in Space", "PhChE Physics and Chemistry of Earth", "PCL.. Physics and Chemistry of Liquids",@@ -2982,12 +3265,12 @@ "PhB.. Physics Bulletin", "DokPh Physics - Doklady", "PhyEd Physics Education",-"physicArXiv Physics e-prints", "PhyEs Physics Essays", "PCHEI Physics in Collision: High-Energy ee/ep/pp Interactions", "PMB.. Physics in Medicine and Biology", "PhP.. Physics in Perspective", "PhTec Physics in Technology",+"PhyIn Physics International", "PhLF. Physics Laser Fusion", "PhL.. Physics Letters", "PhLA. Physics Letters A",@@ -3011,12 +3294,14 @@ "PEPI. Physics of the Earth and Planetary Interiors", "PhSS. Physics of the Solid State", "PTF.. Physics of Thin Films",+"PWP.. Physics of Wave Phenomena", "PhR.. Physics Reports", "PRI.. Physics Research International", "PhT.. Physics Today", "PhyU. Physics Uspekhi", "PhyW. Physics World", "PCTM. Physikalisch-Chemische Trenn- und Messmethoden",+"PhyBl Physikalische Blötter", "PhyG. Physikalische Gesellschaft", "PhyGZ Physikalische Gesellschaft Zürich", "PhyZ. Physikalische Zeitschrift",@@ -3030,6 +3315,7 @@ "PZhTF Pis ma Zhurnal Tekhnischeskoi Fiziki", "PlAst Planetary Astronomy", "PlR.. Planetary Report",+"PlSci Planetary Science", "PSRD. Planetary Science Research Discoveries", "PCPhy Plant and Cell Physiology", "PFR.. Plasma and Fusion Research",@@ -3053,13 +3339,17 @@ "PMCPB PMC Physics B", "PMCPC PMC Physics C", "PMTF. PMTF Zhurnal Prikladnoi Mekhaniki i Tekhnicheskoi Fiziki",+"nraop National Radio Astronomy Observatory Press Release", "PnGid Pnevmatika i Gidravlika",+"noaop NOAO Proposal",+"PolSc Polar Science", "PolSi Poliarnye Siianiia", "PSSNN Poliarnye Siianiia i Svechenie Nochnogo Neba", "PASAM Polish Academy of Science Arch Mech", "PASAS Polish Academy of Science Artificial Satellites", "PASIG Polish Academy of Sciences Institute of Geophysics Publications", "PASTA Polish Academy of Sciences Theory Aggregation Coagulation",+"PJMPE Polish Journal of Medical Physics And Engineering", "PCZNN Politechnika Czestochowska Zeszyty Naukowe Nauki Techniczne Mechanika", "PGZNM Politechnika Gdanska Zeszyty Naukowe Mechanika", "PSZNM Politechnika Slaska Zeszyty Naukowe Mechanika",@@ -3116,25 +3406,32 @@ "PAPhS Proceedings of the American Philosophical Society", "PASAu Proceedings of the Astronomical Society of Australia", "PCAS. Proceedings of the California Academy of Sciences",+"PCPS. Proceedings of the Cambridge Philosophical Society", "PEMS. Proceedings of the Edinburgh Mathematical Society",+"PIASE Proceedings of the Indian Academy of Science, Earth and Planetary Sciences", "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",+"PILOM Proceedings of the International Latitude Observatory at Mizusawa", "PIRE. Proceedings of the IRE",-"PNAS. Proceedings of the National Academy of Science",+"PNAS. Proceedings of the National Academy of Sciences",+"PNAS. Proceedings of the National Academy of Sciences USA",+"PNAS. Proceedings of the National Academy of Sciences of the USA", "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", "PPSB. Proceedings of the Physical Society B", "PPSL. Proceedings of the Physical Society of London",+"PRIAN Proceedings of the Research Institute of Atmospherics, Nagoya University", "PRIAA Proceedings of the Royal Irish Academy Section A", "PRNAS Proceedings of the Royal Netherlands Academy of Arts and Sciences",-"PSEBM Proceedings of The Society for Experimental Biology and Medicine",+"PSEBM Proceedings of the Society for Experimental Biology and Medicine", "PrVP. Proceedings of Vibration Problems", "PELIS Program: electronic library &", "PrAeS Progress in Aerospace Sciences", "PrAA. Progress in Astronautics and Aeronautics",+"PrA.. Progress in Astronomy", "PABei Progress in Astronomy", "PBB.. Progress in Biochemistry and Biophysics", "PBBC. Progress in Biophysics and Biophysical Chemistry",@@ -3155,11 +3452,16 @@ "PQE.. Progress in Quantum Electronics", "PrSS. Progress In Surface Science", "PTCP. Progress in Theoretical Chemistry and Physics",+"PTEP. Progress of Theoretical and Experimental Physics", "PThPh Progress of Theoretical Physics", "PThPS Progress of Theoretical Physics Supplement", "ProTe Promyshlennaia Teplotekhnika", "PrEx. Propellants and Explosives", "PrExP Propellants and Explosives Pyrotechnics",+"PMMin Proper Motion Survey, University of Minnesota",+"rxte pRXTE Proposal",+"sptz pSpitzer Proposal",+"suba pSubaru Proposal", "PUFir Pubblicazioni della R. Universita degli studi di Firenze", "PSAIL Pubblicazioni della Stazione Astronomica Internazionale di Latitudine", "POMil Pubblicazioni dell'Osservatorio Astronomico di Milano-Merate",@@ -3181,6 +3483,7 @@ "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",+"PDHO. Publications of Debrecen Heliophysical Observatory", "POBol Publications of dell'Osservatorio Astronomie de Bologna", "PLawO Publications of Laws Observatory, University of Missouri", "PLicO Publications of Lick Observatory",@@ -3194,13 +3497,14 @@ "PUAms Publications of the Astronomical Institute of the University of Amsterdam", "PBrn. Publications of the Astronomical Institute of the University of Borneo", "POHel Publications of the Astronomical Observatory Helsinki",+"PAOS. Publications of the Astronomical Observatory of Sarajevo", "POMin Publications of the Astronomical Observatory University of Minnesota", "PASA. Publications of the Astronomical Society of Australia", "PASJ. Publications of the Astronomical Society of Japan", "PASP. Publications of the Astronomical Society of the Pacific", "PASPS Publications of the Astronomical Society of the Pacific Supplement", "PASRB Publications of the Astronomical Society Rudjer Boskovic",-"PADEU Publications of the Astronomy Deparment of the Eotvos Lorand University",+"PADEU Publications of the Astronomy Department of the Eotvos Lorand University", "PAIB. Publications of the Astronomy Institute of Bonn", "PAB.. Publications of The Astrophysics Branch Ottawa", "PBeiO Publications of the Beijing Astronomical Observatory",@@ -3215,6 +3519,7 @@ "PFAO. Publications of the Flower Astronomical Observatory", "PGLO. Publications of the Goethe Link Observatory", "PGooO Publications of the Goodsell Observatory, Carleton College",+"ILOMP Publications of the International Latitude Observatory at Mizusawa", "PIstO Publications of the Istanbul University Observatory", "PGro. Publications of the Kapteyn Astronomical Laboratory Groningen", "PKirO Publications of the Kirkwood Observatory of Indiana University",@@ -3222,6 +3527,7 @@ "PMcCO Publications of the Leander McCormick Observatory", "PManO Publications of the Manila Observatory", "PMunO Publications of the Munich Observatory",+"PNAOC Publications of the National Astronomical Observatories of China", "PNAOJ Publications of the National Astronomical Observatory of Japan", "POLyo Publications of the Observatoire de Lyon", "PGenA Publications of the Observatoire Geneve Series A",@@ -3234,10 +3540,13 @@ "PPMtO Publications of the Purple Mountain Observatory", "PRCO. Publications of the Riverview College Observatory", "PROE. Publications of the Royal Observatory of Edinburgh",+"PSAO. Publications of the Shaanxi Astronomical Observatory",+"PShaO Publications of the Shaanxi Astronomy Observatory", "PSprO Publications of the Sproul Observatory", "PSSAI Publications of the Sternberg State Astronomical Institute", "PTarO Publications of the Tartu Astrofizica Observatory", "PTasO Publications of the Tashkent Astronomical Observatory",+"PUPFA Publications of the University of Pennsylvania Flower Astronomical Observatory", "PUSNO Publications of the U.S. Naval Observatory Second Series", "PVVO. Publications of the Van Vleck Observatory", "PVasO Publications of the Vassar College Observatory",@@ -3258,12 +3567,15 @@ "PApPh Pure and Applied Physics", "PApOp Pure Applied Optics", "QUnJ. Qinghua University Journal",+"xmm.. XMM-Newton Press Release",+"xmm.. XMM-Newton Proposal", "QREI. Quality Reliability Engineering International", "QuFin Quantitative Finance", "QuSOp Quantum and Semiclassical Optics", "QuEle Quantum Electronics",+"QuIP. Quantum Information Processing", "QuOpt Quantum Optics",-"quant.ArXiv Quantum Physics e-prints",+"QBSA. Quarterly Bulletin on Solar Activity", "QJMAM Quarterly Journal of Mechanics and Applied Mathematics", "QJRAS Quarterly Journal of the Royal Astronomical Society", "QJRMS Quarterly Journal of the Royal Meteorological Society",@@ -3281,17 +3593,17 @@ "RaPC. Radiation Physics and Chemistry", "RaRe. Radiation Research", "RaEE. Radio and Electronic Engineer",-"Radel Radioelectronika",+"Radel Radioehlektronika", "REEP. Radio Engineering and Electronic Physics", "RaF.. Radiofizika", "RaSol Radioizluchenie Solntsa", "RPRA. Radio Physics and Radio Astronomy",-"RaRLJ Radio Research Laboratories Journal",-"RaRLR Radio Research Laboratories Review",+"RaRLJ Radio Research Laboratory, Journal",+"RaRLR Radio Research Laboratory, Review", "RaSc. Radio Science", "RaScB Radio Science Bulletin", "RaScS Radio Science Supplement",-"RaT.. Radiotekhnika",+"RaT.. Radioteknika", "RaEl. Radiotekhnika i Elektronika", "RERE. Radiotekhnika i Elektronika Radio Engineering Electronic Physics", "RatK. Radiotekhnika Kharkov",@@ -3323,6 +3635,7 @@ "RISRJ Report Ionosphere Space Research Japan", "HarOR Report of the Committee of the Overseers of Harvard College appointed to visit the Observatory", "RNAOJ Report of the National Astronomical Observatory of Japan",+"RSPUT Report Series of the Department of Physics and Science, University of Turku", "YalRY Reports for the year presented by the Board of Managers of the Observatory of Yale University to the President and Fellows", "ROLun Reports of the Lund Observatory", "RpMP. Reports on Mathematical Physics",@@ -3343,10 +3656,12 @@ "RLPhy Research Letters in Physics", "RMA.. Research Measurement Approach", "RNOST Research News &",+"RPFSU Research Papers Faculty of Materials Science and Technology Slovak University of Technology", "RRP.. Research Reports in Physics", "RTP.. Research Trends in Physics", "RNAO. Resultados del Observatorio Nacional Argentino", "ROCor Resultados del Observatorio Nacional Argentino en Cordoba",+"ResPh Results in Physics", "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",@@ -3364,12 +3679,14 @@ "RvMPS Reviews of Modern Physics Supplement", "RvOp. Reviews of Optics", "RvPP. Reviews of Plasma Physics",+"RvRRL Reviews of the Radio Research Laboratory", "RvA.. Revista Astronomica Organo de la Asociacion Argengina Amigos de la Astronomia Buenos Aires", "RBrFi Revista Brasileira de Fisica", "RvCF. Revista Colombiana de Fisica", "IORP. Revista do observatorio : publicacao mensal do Imperial Observatorio do Rio de Janeiro", "RMxAA Revista Mexicana de Astronomia y Astrofisica", "RMxF. Revista Mexicana de Fisica",+"RMxFE Revista Mexicana de Fisica E", "RMxFS Revista Mexicana de Fisica Supplement", "RvMad Revista Real Acad. Ciencias Exact. Fis. Nat. Madrid", "RTrTe Revista Transporturilor si Telecomunicatiilor",@@ -3392,7 +3709,7 @@ "AcRhe Rheologica Acta", "RA... Ricerche Astronomiche", "RIzZi Riga Izdatel Zinatne",-"Rise. Rise hvezd Popularne vedecky astronomicky casopis Praha",+"Rise. Rise Hvezd", "RRA.. River Research and Applications", "RIG.. Rivista Italiana di Geofisica", "RIGSA Rivista Italiana di Geofisica e Scienze Affini",@@ -3403,12 +3720,13 @@ "Roczn Rocznik Astronomiczny Observatorjum Krakowskiego Krakow", "RoAJ. Romanian Astronomical Journal", "RoJPh Romanian Journal of Physics",+"RoRPh Romanian Reports in Physics", "RoIE. Rossiiskaia Akademiia Nauk Izvestiia Energetika", "RoIMZ Rossiiskaia Akademiia Nauk Izvestiia Mekhanika Zhidkosti i Gaza", "RoISF Rossiiskaia Akademiia Nauk Izvestiia Seriia Fizicheskaia", "RoDok Rossijskaya Akademiya Nauk Doklady", "RoIMT Rossijskaya Akademiya Nauk Izvestiya Mekhanika Tverdogo Tela",-"IzRos Rossijskaya Akademiya Nauk Izvestiya Seriya Fizicheskaya",+"RoIzF Rossijskaya Akademiya Nauk Izvestiya Seriya Fizicheskaya", "RWPWZ Rostock Wilhelm Pieck Universitaet Wissenschaftliche Zeitschrift Mathematisch Naturwissenschaftliche Reihe", "PVSS. Royal Astronomical Society of New Zealand Publications of Variable Star Section", "VSSCi Royal Astronomical Society of New Zealand Variable Star Section Circulars",@@ -3419,7 +3737,9 @@ "ROAn. Royal Observatory Annals", "CapMi Royal Observatory Cape Mimeogram", "CoRSE Royal Society Edinburgh Communications Physical Sciences",+"RSCT. Royal Society of Canada Transactions", "RSEPS Royal Society of Edinburgh Proceedings Section",+"RSET. Royal Society of Edinburgh Transactions", "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",@@ -3428,8 +3748,14 @@ "RSPS. Royal Society of London Proceedings Series I", "RoIn. Rozprawy Inzynierskie", "RoIET Rozprawy Inzynierskie Engineering Transactions",+"asc.. Space Telescope ASC Instrument Science Report",+"nicm. Space Telescope NICMOS Instrument Science Report",+"stis. Space Telescope STIS Instrument Science Report",+"wfc.. Space Telescope WFC Instrument Science Report",+"wfpc. Space Telescope WFPC2 Instrument Science Report", "Ruimt Ruimtevaart", "RuCRv Russian Chemical Reviews",+"RuGG. Russian Geology and Geophysics", "RJET. Russian Journal of Engineering Thermophysics", "RJMP. Russian Journal of Mathematical Physics", "RJPC. Russian Journal Physical Chemistry",@@ -3438,6 +3764,7 @@ "RuMaS Russian Mathematical Surveys", "RuMet Russian Metallurgy", "RuPhJ Russian Physics Journal",+"RALR. Rutherford Appleton Laboratory Report", "Sadha Sadhana", "STVF. Samoletostroenie Tekhnika Vozdushnogo Flota", "SAMPJ SAMPE Journal",@@ -3445,11 +3772,14 @@ "UISTS San Diego CA Univelt Inc Science Technology Series", "MaMeA Sankt Peterburgskii Universitet Vestnik Seriia Matematika Mekhanika Astronomiia", "SAOSR SAO Special Report",+"asd.. Astrophysics Software Database",+"ascl. Astrophysics Source Code Library", "SatCo Satellite Communications", "SBARM SBARMO Bulletin", "SbMat Sbornik: Mathematics", "SJMet Scandinavian Journal of Metallurgy", "SUVSR Scandinavian Union of Amateur Astronomers Variable Star Section",+"ScReE Scholarly Research Exchange", "SNG.. Schweizerische Naturforschende Gesellschaft", "Sci.. Science", "SCSA. Science and Culture Series: Astrophysics",@@ -3459,6 +3789,7 @@ "SCSMP Science China Series Mathematics Physics Astronomy Technological Sciences", "SciDi Science Dimension", "SciEd Science Education",+"ScEdR Science Education Research", "SFCh. Science Foundation in China", "ScChA Science in China A: Mathematics", "ScChB Science in China B: Chemistry",@@ -3474,6 +3805,7 @@ "Scis. Sciences", "SciB. Scientia (Bologna)", "SciSn Scientia Sinica",+"SSPMA Scientia Sinica Physica, Mechanica &", "SSSMP Scientia Sinica Series Mathematical Physical Technical Sciences", "SciAm Scientific American", "SMS.. Scientific Modeling and Simulation SMNS",@@ -3521,9 +3853,11 @@ "SIAMR SIAM Review", "SiMaJ Siberian Mathematical Journal", "SiFTZ Sibirskii Fiziko Tekhnicheskii Zhurnal",+"JCMSI SICE Journal of Control, Measurement, and System Integration", "SidM. Sidereal Messenger", "SIDPQ SID Proceedings Quarter", "SiFoE Siemens Forschungs und Entwicklungsberichte",+"SIGMA SIGMA", "Sig.. Signal", "SigPr Signal Processing", "Simul Simulation",@@ -3534,6 +3868,7 @@ "SRT.. Skin Research and Technology", "SkyN. Sky News", "SlaOb Slaboproudy Obzor",+"SJCE. Slovak Journal of Civil Engineering", "SBE.. Small Business Economics", "SMaS. Smart Material Structures", "Smith Smithsonian",@@ -3547,7 +3882,7 @@ "SEEJ. Society of Environmental Engineers Journal", "SIAM. Society of Industrial and Applied Mathematics", "SIBAN Sofia Izdatel Bolgarskoi Akademii Nauk",-"asd..sAstrophysics Software Database",+"SMat. Soft Matter", "SSSAJ Soil Science Society of America Journal", "SoCe. Solar Cells", "SoEn. Solar Energy",@@ -3569,6 +3904,7 @@ "BSolD Solnechnye Dann. Bull. Akad. Nauk SSSR", "SoKie Sonderdrucke der Sternwarte Kiel", "SoMue Sonderdrucke Universitaet Muenster Astronomisches Institut",+"Sonne Sonne", "SoShe Soobshchenie Shemakhinskoj Astrofizicheskoj Observatorii", "SoByu Soobshcheniya Byurakanskoj Observatorii Akademiya Nauk Armyanskoj SSR Erevan", "SoSht Soobshcheniya Gosudarstvennogo Astronomicheskogo Instituta",@@ -3581,13 +3917,15 @@ "SAJPh South African Journal of Physics", "SAJSc South African Journal of Science", "SouSt Southern Stars",-"IBSAE Sovetskaia Antarkticheskaia Ekspeditsiia Informatsionnyi Biulleten",+"IBSAE Sovetskaia Antarkticheskaia Ekspeditsiia Informatsionnyi Byulleten", "SovAe Soviet Aeronomii",+"SvApM Soviet Applied Mechanics", "SvA.. Soviet Astronomy", "SvAL. Soviet Astronomy Letters", "JETP. Soviet Journal of Experimental and Theoretical Physics", "JETPL Soviet Journal of Experimental and Theoretical Physics Letters", "SvJNP Soviet Journal of Nuclear Physics",+"SvJOT Soviet Journal of Optical Technology", "SvJPP Soviet Journal of Plasma Physics", "SvJQE Soviet Journal of Quantum Electronics", "SvPAC Soviet Physics Acoustics",@@ -3616,8 +3954,9 @@ "SpMME Space Medicine Medical Engineering", "SpPol Space Policy", "SpPow Space Power",-"SPRMD Space Power Resources and Manufacturing Development",+"SPRMD Space Power - Resources, Manufacturing and Development", "SpRBu Space Research Bulgaria",+"SpReT Space Research Today", "SSI.. Space Science Instrumentation", "SSRv. Space Science Reviews", "SpT.. Space Technology",@@ -3629,6 +3968,7 @@ "SpWdU Space World U", "SpWdW Space World W", "SpWdY Space World Y",+"Spark Spark, the AAS Education Newsletter", "VatAR Specola Astronomica Vaticana Annual Reports", "AtlSV Specola Astronomica Vaticana Atlas Stellarum Variabilium", "VatCo Specola Astronomica Vaticana Comunicazione",@@ -3643,6 +3983,7 @@ "SScT. Speculations in Science and Technology", "Spika Spika", "SpEng Sports Engineering",+"SSSSc Springer Series in Surface Sciences", "STMP. Springer Tracts in Modern Physics", "SSCP. Springer Verlag Springer Series on Chemical Physics", "SSEp. Springer Verlag Springer Series on Electrophysics",@@ -3677,10 +4018,12 @@ "Strai Strain", "SGC.. Stratigraphy and Geological Correlation", "Stroj Strojarstvo",+"StAst Strolling Astronomer", "StrOp Structural Optimization", "SASn. Studia Astronomica Sinica", "StBio Studia Biophysica", "StGG. Studia Geophysica et Geodaetica",+"StuMa Studia Mathematica", "SSTor Studia Societatis Scientiarum Torunensis Sectio F Astronomia", "StAM. Studies in Applied Mathematics", "SCMP. Studies in Condensed Matter Physics",@@ -3690,6 +4033,7 @@ "StHCG Studies in High Energy Physics Cosmology and Gravitation", "StMaP Studies in Mathematical Physics", "StPTC Studies in Physical and Theoretical Chemistry",+"SScEd Studies in Science Education", "StHPM Studies in the History and Philosophy of Modern Physics", "StHMP Studies in the History of Mathematics and the Physical Sciences", "Sttur Studies in turbulence",@@ -3702,12 +4046,12 @@ "Sunwo Sunworld", "SuScT Superconductor Science Technology", "SuMi. Superlattices and Microstructures",+"JPhSu Supplement au Journal de Physique", "AnMuS Supplementband zu den Annalen der Munchener Sternwarte", "SAnAp Supplements aux Annales d'Astrophysique", "SuCT. Surface and Coatings Technology", "SurIA Surface and Interface Analysis", "SRL.. Surface Review and Letters",-"SuRvL Surface Reviews and Letters", "SurSc Surface Science", "SurSL Surface Science Letter", "SurSR Surface Science Reports",@@ -3761,6 +4105,8 @@ "TepVT Teplofizika Vysokikh Temperatur", "TFizG Teploobmen i Fizicheskaia Gazodinamika", "TNEK. Teplovye Napriazheniia Elementakh Konstruktsii",+"TeMAE Terrestrial Magnetism and Atmospheric Electricity (Journal of Geophysical Research)",+"TeMag Terrestrial Magnetism (Journal of Geophysical Research)", "Tesla TESLA Electronics", "TTPhy Teubner Texte zur Physik", "TexMi Textures and Microstructures",@@ -3769,7 +4115,10 @@ "Astr. The Astronomer", "ATel. The Astronomer's Telegram", "AJ... The Astronomical Journal",+"AJS.. The Astronomical Journal Supplement",+"AstRv The Astronomical Review", "ApJ.. The Astrophysical Journal",+"ApJL. The Astrophysical Journal Letters", "ApJS. The Astrophysical Journal Supplement Series", "BJHS. The British Journal for the History of Science", "BJPS. The British Journal for the Philosophy of Science",@@ -3781,6 +4130,7 @@ "JAS.. The Journal of Agricultural Science", "JChTh The Journal of Chemical Thermodynamics", "JFin. The Journal of Finance",+"MatMo The Mathematical Monthly", "Msngr The Messenger", "Neuro The Neuroscientist", "INGN. The Newsletter of the Isaac Newton Group of Telescopes",@@ -3793,7 +4143,7 @@ "OCPJ. The Open Chemical Physics Journal", "OCMPJ The Open Condensed Matter Physics Journal", "OGC.. The Open Geology Journal",-"OHC.. The Open Hydrology Journal",+"OHJ.. The Open Hydrology Journal", "OMEJ. The Open Mechanical Engineering Journal", "OMJ.. The Open Mechanics Journal", "OMnJ. The Open Mineralogy Journal",@@ -3816,6 +4166,7 @@ "AcTC. Theoretica Chimica Acta", "ThApC Theoretical and Applied Climatology", "ThAFM Theoretical and Applied Fracture Mechanics",+"TAM.. Theoretical and Applied Mechanics", "ThCFD Theoretical and Computational Fluid Dynamics", "TMP.. Theoretical and Mathematical Physics", "ThAst Theoretical Astrophysics",@@ -3823,7 +4174,8 @@ "PhTea The Physics Teacher", "PlJ.. The Plant Journal", "QJMat The Quarterly Journal of Mathematics",-"RamJ. The Ramanujan Journal",+"QJPAM The Quarterly Journal of Pure and Applied Mathematics",+"RamJ. The Ramaujan Journal", "RvES. The Review of Economic Studies", "ThEng Thermal Engineering", "TSE.. Thermal Science and Engineering",@@ -3847,8 +4199,8 @@ "TUASB Tokyo University Institute of Space and Aeronautical Science Bulletin", "TUASR Tokyo University Institute of Space and Aeronautical Science Report", "TIOA. Tomsk Institut Optiki Atmosfery CO AN SSSR",-"TApA. Top. Astrophys. Astron. Space Sci.", "TApPh Topics in Applied Physics",+"TAASS Topics in Astrophysics, Astrononmy, and Space Science", "ToCat Topics in Catalysis", "TCPh. Topics in Current Physics", "TPhCh Topics in Physical Chemistry",@@ -3862,12 +4214,17 @@ "TOYal Transactions of the Astronomical Observatory of Yale University", "TCaPS Transactions of the Cambridge Philosophical Society", "TIMC. Transactions of the Institute of Measurement and Control",+"TISCI Transactions of the Institute of Systems, Control and Information Engineers", "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",+"TATJ. Transactions of the Japanese Society for Artificial Intelligence, Aerospace Technology Japan",+"TJSIE Transactions of The Japanese Society of Irrigation, Drainage and Rural Engineering",+"TRACE Transactions of the Japan Society of Refrigerating and Air Conditioning Engineers", "TLHSQ Transactions of the Literary and Historical Society of Quebec", "TrOS. Transactions of the Optical Society",+"TSICE Transactions of the Society of Instrument and Control Engineers", "TPM.. Transport in Porous Media", "TTSP. Transport Theory and Statistical Physics", "TvOC. Transvaal Observatory Circular",@@ -3895,23 +4252,27 @@ "TrTsI TsIAM Trudy", "TsHUJ Tsing Hua University Journal", "TITas Tsirkulyar Astronomicheskogo Instituta Akademiya Nauk Uzbekskoj SSR",+"TsLvo Tsirkulyar Astronomicheskoj Observatorii Lvov", "TsShe Tsirkulyar Shemakhinskoj Astrofizicheskoj Observatorii", "TsSta Tsirkulyar Stalinabadskoj Astronomicheskoj Observatorii", "TsTas Tsirkulyar Tashkentskoj Astronomicheskoj Observatorii",+"TsVse Tsirkulyar Vses. astron.-geod. o-va", "TsPul Tsirkulyary Glavnoj Astronomicheskoj Observatorii i Pulkove", "TUAID Tuebingen Universitaet Astronomisches Institut Diplomarbeit", "TJJPT Tuijin Jishu Journal of Propulsion Technology", "TurTe Turbulentnye techeniia", "TJPh. Turkish Journal of Physics",+"UkJPO Ukrainian Journal of Physical Optics", "UkFiZ Ukrainskii Fizicheskii Zhurnal", "UkMaZ Ukrainskii Matematicheskii Zhurnal",-"UkMJ. Ukranian Mathematical Journal", "Ultmi Ultramicroscopy", "UltIm Ultrasonic Imaging", "Ultra Ultrasonics",+"Umsch Umschau", "USOC. Unified System Orbit Computation USOC", "UMIB. Unione Matematica Italiana Bollettino", "UNPSA United Nations Programme on Space Applications",+"UniCl Universe Classroom", "UNAer Universita di Napoli Aeritalia S", "UCAFR Universitas Comeniana Acta Facultatis Rerum Naturalium Physica", "UMt1K Universite de Montpellier",@@ -3931,8 +4292,9 @@ "UppAn Uppsala Astronomical Observatory Annals", "UppOR Uppsala Astronomical Observatory Reports", "USM.. Upravliaiushchie Sistemy i Mashiny",-"Urani Urania",-"UrMad Urania Madrid",+"UrBar Urania (Bracelona)",+"Urani Urania (Krakow)",+"UrMad Urania (Madrid)", "UGSJR U S Geological Survey Journal Research", "USNOC U.S. Naval Observatory Circulars", "USNOR U.S. Naval Observatory Reports",@@ -3964,6 +4326,7 @@ "VDIZF VDI Zeitschriften Fortschritt Berichte Reihe Stroemungstechnik", "VSD.. Vehicle System Dynamics", "VKAWA Verhandelingen der Koninklijke Akademie van Wetenschappen te Amsterdam",+"Verme Vermessungstechnik", "VeWFS Veroeffentlichung der Wilhelm Foerster Sterwarte", "ViHei Veroeffentlichungen der Badischen Landes-Sternwarte zu Heidelberg", "VeHei Veroeffentlichungen der Badischen Sternwarte zu Heidelberg",@@ -3984,14 +4347,18 @@ "VeABD Veroeffentlichungen des Astronomischen Rechen-Instituts zu Berlin-Dahlem", "VeBon Veroeffentlichungen des Astronomisches Institute der Universitaet Bonn", "VeFra Veroeffentlichungen des Astronomisches Institute der Universitaet Frankfurt",+"VeBKI Veroeffentlichungen des Bayerische Kommission Int. Erdmessung", "VeKAB Veroeffentlichungen des Koeniglichen Astronomischen Rechen-Instituts zu Berlin", "VeZPE Veroffentlichungen des Zentralinstituts Physik der Erde", "VMKAN Verslagen en Mededeelingen der Kon. Academie van Wetenschappen, Afd. Natuurkunde", "VeLdn Verslag van den staat der Sterrewacht te Leiden", "Vert. Vertica", "Vertf Vertiflite",+"Vesmi Vesmir", "VKha. Vestnik Khar'kovskogo Universiteta",+"VeKha Vestnik Khar'kov Universitet", "VKie. Vestnik Kievskogo Universiteta Seriya Astronomii",+"VeLGU Vestnik LGU", "VeMos Vestnik Moskovskogo Universiteta Seriya 3 Fizika Astronomiya", "VISBD Vibration Inst Shock Vibration Digest", "VIAEA Vienna International Atomic Energy Agency",@@ -4002,10 +4369,12 @@ "VilOB Vilnius Astronomijos Observatorijos Biuletenis", "IzVil Vilnius Izdatel Mokslas", "VJS.. Virginia Journal of Science",+"VisKi Visnik Kiiv. Univ., Fiz.-Mat. Nauki, Astron", "ViGeo Vissha Geodeziia", "VA... Vistas in Astronomy", "VTJ.. Vitro Technical Journal", "yCat. VizieR Online Data Catalog",+"yCatp VizieR Online Data Catalog", "VADVS VKI Advanced Design of Ventilation Systems", "VICFD VKI An Introduction to Computational Fluid Dynamics", "VIMT. VKI An Introduction to Modeling Turbulence",@@ -4062,17 +4431,23 @@ "WtFor Weather and Forecasting", "WeiEn Weight Engineering", "WeldJ Welding Journal",+"Werk. Werkgroepnieuws", "JIMO. WGN, Journal of the International Meteor Organization", "WilOO Williamstown Observatory Observations", "WiEn. Wind Energy", "WiEng Wind Engineering", "WisBT Wissenschaftliche Berichte AEG Telefunken", "WisZe Wissenschaftliche Zeitschrift",+"WSAAA Workshop Series of the Asociacion Argentina de Astronomia", "WCRp. World Climate Report",+"WJCMP World Journal of Condensed Matter Physics",+"WJM.. World Journal of Mechanics",+"WJNSE World Journal of Nano Science and Engineering",+"WJNST World Journal of Nuclear Science and Technology", "WroRe Wroclaw Astronomical Observatory Reprints", "Wuli. Wuli", "YaFiz Yadernaya Fizika",-"YalOY Yale University Observatory Reports for the year",+"YalOY Yale University Observatory Reports for the Year", "YUFEM Yamaguchi University Faculty of Engineering Memoirs", "YUTR. Yamaguchi University Technology Reports", "YamC. Yamamoto Circular",@@ -4095,7 +4470,9 @@ "ZGmS. Zeitschrift fur Geomorphologie Supplement", "ZGeo. Zeitschrift fur Geophysik", "ZGlGl Zeitschrift fur Gletscherkunde und Glazialgeologie",-"ZKri. Zeitschrift fur Kristallographie",+"ZK... Zeitschrift fur Kristallographie",+"ZKMP. Zeitschrift fur Kristallographie Mineralogie und Petrographie",+"ZKS.. Zeitschrift fur Kristallographie Supplements", "ZMP.. Zeitschrift für Mathematik und Physik", "ZMetl Zeitschrift fur Metallkunde", "ZeMet Zeitschrift fur Meteorologie",@@ -4112,6 +4489,7 @@ "ZNatA Zeitschrift Naturforschung Teil A", "ZNatB Zeitschrift Naturforschung Teil B", "ZePAN Zeitschrift Physik Atomic Nuclei",+"ZVer. Zeitschrift Vermessungswes.", "ZWer. Zeitschrift Werkstofftechnik", "ZemVs Zemlia i Vselennaia", "Zenit Zenit",
bibutils/bibcore.c view
@@ -1,9 +1,9 @@ /* * bibcore.c *- * Copyright (c) Chris Putnam 2005-2012+ * Copyright (c) Chris Putnam 2005-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #include <stdio.h>@@ -84,6 +84,8 @@ fprintf( fp, "\tlatexout=%d\n", p->latexout ); fprintf( fp, "\txmlout=%d\n", p->xmlout ); fprintf( fp, "-------------------params end for %s\n", f );++ fflush( fp ); } static void@@ -277,50 +279,112 @@ bibl_verbose2( bin->ref[i], "", i+1 ); } +/* extract_tag_value+ *+ * Extract the tag and the value for ALWAYS/DEFAULT+ * entries like: "NGENRE|Masters thesis"+ *+ * tag = "NGENRE"+ * value = "Masters thesis"+ */ static void+extract_tag_value( newstr *tag, newstr *value, char *p )+{+ newstr_empty( tag );+ while ( p && *p && *p!='|' ) {+ newstr_addchar( tag, *p );+ p++;+ }+ if ( p && *p=='|' ) p++;+ newstr_empty( value );+ while ( p && *p ) {+ newstr_addchar( value, *p );+ p++;+ }+}++/* process_defaultadd()+ *+ * Add tag/value pairs that have "DEFAULT" processing+ * unless a tag/value pair with the same tag has already+ * been adding during reference processing.+ */+static void+process_defaultadd( fields *f, int reftype, param *r )+{+ int i, n, process, level;+ newstr tag, value;+ char *p;++ newstrs_init( &tag, &value, NULL );++ for ( i=0; i<r->all[reftype].ntags; ++i ) {+ process = ((r->all[reftype]).tags[i]).processingtype;+ if ( process!=DEFAULT ) continue;+ level = ((r->all[reftype]).tags[i]).level;+ p = ((r->all[reftype]).tags[i]).newstr;+ extract_tag_value( &tag, &value, p );+ n = fields_find( f, tag.data, level );+ if ( n==-1 )+ fields_add( f, tag.data, value.data, level );+ }++ newstrs_free( &tag, &value, NULL );+}++/* process_alwaysadd()+ *+ * Add tag/value pair to reference from the ALWAYS + * processing type without exception (the difference from+ * DEFAULT processing).+ */+static void process_alwaysadd( fields *f, 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( f, tag, data, level );- }+ int i, process, level;+ newstr tag, value;+ char *p;++ newstrs_init( &tag, &value, NULL );++ 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;+ extract_tag_value( &tag, &value, p );+ fields_add( f, tag.data, value.data, level );+ }++ newstrs_free( &tag, &value, NULL ); } static int read_ref( FILE *fp, bibl *bin, char *filename, param *p ) {+ int nrefs = 0, bufpos = 0, ok, ret=BIBL_OK, fcharset;/* = CHARSET_UNKNOWN;*/ newstr reference, line;- fields *ref; char buf[256]="";- int nrefs = 0, bufpos = 0, fcharset;/* = CHARSET_UNKNOWN;*/+ fields *ref; 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 ( !ref ) {+ ret = BIBL_ERR_MEMERR;+ bibl_free( bin );+ goto out0;+ } if ( p->processf( ref, reference.data, filename, nrefs+1 )){- bibl_addref( bin, ref );+ ok = bibl_addref( bin, ref );+ if ( !ok ) {+ ret = BIBL_ERR_MEMERR;+ bibl_free( bin );+ fields_free( ref );+ free( ref );+ goto out0;+ } } else { fields_free( ref ); free( ref );@@ -337,50 +401,67 @@ } } if ( p->charsetin==CHARSET_UNICODE ) p->utf8in = 1;+out0: newstr_free( &line ); newstr_free( &reference );- return BIBL_OK;+ return ret; } -static void-bibl_fixcharsets( bibl *b, param *p )+/* Don't manipulate latex for URL's and the like */+static int+bibl_notexify( char *tag ) {- fields *ref;+ char *protected[] = { "DOI", "URL", "REFNUM" };+ int i, nprotected = sizeof( protected ) / sizeof( protected[0] );+ for ( i=0; i<nprotected; ++i )+ if ( !strcasecmp( tag, protected[i] ) ) return 1;+ return 0;+}++static int+bibl_fixcharsetfields( fields *ref, param *p )+{+ newstr *data; char *tag;- long i, j;- int swap = 0, n;- int latexout = p->latexout;- int latexin = p->latexin;- for ( i=0; i<b->nrefs; ++i ) {- ref = b->ref[i];- n = fields_num( ref );- for ( j=0; j<n; ++j ) {- if ( latexin || latexout ) {- tag = fields_tag( ref, j, FIELDS_CHRP_NOUSE );- /* don't texify/detexify URL's and the like */- if ( !strcasecmp( tag, "DOI" ) ||- !strcasecmp( tag, "URL" ) ||- !strcasecmp( tag, "REFNUM" ) ) {- latexin = 0;- latexout = 0;- swap = 1;- }- }- newstr_convert( fields_value( ref, j, FIELDS_STRP_NOUSE ),- p->charsetin, latexin, p->utf8in, - p->xmlin,- p->charsetout, latexout, p->utf8out, - p->xmlout );- if ( swap ) {- swap = 0;- latexin = p->latexin;- latexout = p->latexout;- }+ long i, n;+ int ok;++ n = fields_num( ref );++ for ( i=0; i<n; ++i ) {++ tag = fields_tag( ref, i, FIELDS_CHRP_NOUSE );+ data = fields_value( ref, i, FIELDS_STRP_NOUSE );++ if ( bibl_notexify( tag ) ) {+ ok = newstr_convert( data,+ p->charsetin, 0, p->utf8in, p->xmlin,+ p->charsetout, 0, p->utf8out, p->xmlout );+ } else {+ ok = newstr_convert( data,+ p->charsetin, p->latexin, p->utf8in, p->xmlin,+ p->charsetout, p->latexout, p->utf8out, p->xmlout ); }++ if ( !ok ) return 0; }++ return 1; } static int+bibl_fixcharsets( bibl *b, param *p )+{+ long i;+ int ok;+ for ( i=0; i<b->nrefs; ++i ) {+ ok = bibl_fixcharsetfields( b->ref[i], p );+ if ( !ok ) return 0;+ }+ return 1;+}++static int build_refnum( fields *f, long nrefs ) { char *year, *author, *p, num[512];@@ -548,24 +629,31 @@ list_free( &citekeys ); } +static void+clean_ref( bibl *bin, param *p )+{+ if ( p->cleanf ) p->cleanf( bin, p );+}+ static int convert_ref( bibl *bin, char *fname, bibl *bout, param *p ) { fields *rin, *rout;- int reftype = 0;+ int reftype = 0, ok; long i; - 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 );- if ( p->all ) process_alwaysadd( rout, reftype, p );- p->convertf( rin, rout, reftype, p, p->all, p->nall );- if ( verbose_set( p ) ) - bibl_verbose1( rout, rin, fname, i+1 );+ if ( p->all ) {+ process_alwaysadd( rout, reftype, p );+ process_defaultadd( rout, reftype, p );+ }+ ok = p->convertf( rin, rout, reftype, p, p->all, p->nall );+ if ( ok!=BIBL_OK ) return ok; bibl_addref( bout, rout ); } uniqueify_citekeys( bout );@@ -575,6 +663,7 @@ int bibl_read( bibl *b, FILE *fp, char *filename, param *p ) {+ int ret, ok; param lp; bibl bin; @@ -585,20 +674,58 @@ bibl_setreadparams( &lp, p ); bibl_init( &bin );- read_ref( fp, &bin, filename, &lp ); - if ( debug_set( p ) ) report_params( stderr, "bibl_read", &lp );+ ret = read_ref( fp, &bin, filename, &lp );+ if ( ret!=BIBL_OK ) return ret; - 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 ( debug_set( p ) ) bibl_verbose0( &bin );- bibl_copy( b, &bin );+ if ( debug_set( p ) ) {+ fflush( stdout );+ report_params( stderr, "bibl_read", &lp );+ fprintf( stderr, "-------------------raw_input start for bibl_read\n");+ bibl_verbose0( &bin );+ fprintf( stderr, "-------------------raw_input end for bibl_read\n" );+ fflush( stderr ); }++ if ( !lp.output_raw || ( lp.output_raw & BIBL_RAW_WITHCHARCONVERT ) ) {+ ok = bibl_fixcharsets( &bin, &lp );+ if ( !ok ) return BIBL_ERR_MEMERR;+ if ( debug_set( p ) ) {+ fprintf( stderr, "-------------------post_fixcharsets start for bibl_read\n");+ bibl_verbose0( &bin );+ fprintf( stderr, "-------------------post_fixcharsets end for bibl_read\n" );+ fflush( stderr );+ }+ }+ if ( !lp.output_raw ) {+ clean_ref( &bin, &lp );+ if ( debug_set( p ) ) {+ fprintf( stderr, "-------------------post_clean_ref start for bibl_read\n");+ bibl_verbose0( &bin );+ fprintf( stderr, "-------------------post_clean_ref end for bibl_read\n" );+ fflush( stderr );+ }+ ok = convert_ref( &bin, filename, b, &lp );+ if ( ok!=BIBL_OK ) return ok;+ if ( debug_set( p ) ) {+ fprintf( stderr, "-------------------post_convert_ref start for bibl_read\n");+ bibl_verbose0( &bin );+ fprintf( stderr, "-------------------post_convert_ref end for bibl_read\n" );+ fflush( stderr );+ }+ } else {+ if ( debug_set( p ) ) {+ fprintf( stderr, "-------------------here1 start for bibl_read\n");+ bibl_verbose0( &bin );+ fprintf( stderr, "-------------------here1 end for bibl_read\n" );+ fflush( stderr );+ }+ ok = bibl_copy( b, &bin );+ if ( !ok ) return BIBL_ERR_MEMERR;+ } if ( !lp.output_raw || ( lp.output_raw & BIBL_RAW_WITHMAKEREFID ) ) bibl_checkrefid( b, &lp );+ bibl_free( &bin ); return BIBL_OK;@@ -665,6 +792,7 @@ bibl_write( bibl *b, FILE *fp, param *p ) { param lp;+ int ok; if ( !b ) return BIBL_ERR_BADINPUT; if ( !p ) return BIBL_ERR_BADINPUT;@@ -672,9 +800,14 @@ if ( !fp && ( !p || !p->singlerefperfile ) ) return BIBL_ERR_BADINPUT; bibl_setwriteparams( &lp, p );- bibl_fixcharsets( b, &lp );++ ok = bibl_fixcharsets( b, &lp );+ if ( !ok ) return BIBL_ERR_MEMERR;+ if ( debug_set( p ) ) report_params( stderr, "bibl_write", &lp );- output_bibl( fp, b, &lp );++ ok = output_bibl( fp, b, &lp );+ if ( !ok ) return BIBL_ERR_MEMERR; return BIBL_OK; }
bibutils/bibl.c view
@@ -1,9 +1,9 @@ /* * bibl.c *- * Copyright (c) Chris Putnam 2005-2012+ * Copyright (c) Chris Putnam 2005-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #include <stdio.h>@@ -17,7 +17,7 @@ b->ref = NULL; } -static void+static int bibl_malloc( bibl * b ) { int alloc = 50;@@ -25,13 +25,14 @@ b->ref = ( fields ** ) malloc( sizeof( fields* ) * alloc ); if ( b->ref ) { b->maxrefs = alloc;+ return 1; } else {- fprintf( stderr, "bibl_malloc: allocation error\n" );- exit( EXIT_FAILURE );+ fprintf( stderr, "%s: allocation error\n", __FUNCTION__ );+ return 0; } } -static void+static int bibl_realloc( bibl * b ) { int alloc = b->maxrefs * 2;@@ -40,19 +41,24 @@ if ( more ) { b->ref = more; b->maxrefs = alloc;+ return 1; } else {- fprintf( stderr, "bibl_realloc: allocation error\n" );- exit( EXIT_FAILURE );+ fprintf( stderr, "%s: allocation error\n", __FUNCTION__ );+ return 0; } } -void+int bibl_addref( bibl *b, fields *ref ) {- if ( b->maxrefs==0 ) bibl_malloc( b );- else if ( b->nrefs >= b->maxrefs ) bibl_realloc( b );- b->ref[ b->nrefs ] = ref;- b->nrefs++;+ int ok = 1;+ if ( b->maxrefs==0 ) ok = bibl_malloc( b );+ else if ( b->nrefs >= b->maxrefs ) ok = bibl_realloc( b );+ if ( ok ) {+ b->ref[ b->nrefs ] = ref;+ b->nrefs++;+ }+ return ok; } void@@ -61,30 +67,37 @@ long i; for ( i=0; i<b->nrefs; ++i ) fields_free( b->ref[i] );- free( b->ref );+ if ( b->ref ) free( b->ref ); b->ref = NULL; b->nrefs = b->maxrefs = 0; } -void+/* bibl_copy()+ *+ * returns 1 on success, 0 on failure (memory error)+ */+int bibl_copy( bibl *bout, bibl *bin ) { fields *refin, *refout;+ int i, j, n, ok, level; char *tag, *value;- int level;- int i, j, n; for ( i=0; i<bin->nrefs; ++i ) { refin = bin->ref[i]; refout = fields_new(); n = fields_num( refin ); for ( j=0; j<n; ++j ) {- tag = fields_tag( refin, j, FIELDS_CHRP );+ tag = fields_tag( refin, j, FIELDS_CHRP ); value = fields_value( refin, j, FIELDS_CHRP ); level = fields_level( refin, j );- if ( tag && value )- fields_add( refout, tag, value, level );+ if ( tag && value ) {+ ok = fields_add( refout, tag, value, level );+ if ( !ok ) return 0;+ } }- bibl_addref( bout, refout );+ ok = bibl_addref( bout, refout );+ if ( !ok ) return 0; }+ return 1; }
bibutils/bibl.h view
@@ -1,8 +1,10 @@ /* * bibl.h *- * Copyright (c) Chris Putnam 2005-12+ * Copyright (c) Chris Putnam 2005-2013 *+ * Source code released under the GPL version 2+ * */ #ifndef BIBL_H #define BIBL_H@@ -19,9 +21,9 @@ } bibl; extern void bibl_init( bibl *b );-extern void bibl_addref( bibl *b, fields *ref );+extern int bibl_addref( bibl *b, fields *ref ); extern void bibl_free( bibl *b );-extern void bibl_copy( bibl *bout, bibl *bin );+extern int bibl_copy( bibl *bout, bibl *bin ); #endif
bibutils/biblatexin.c view
@@ -1,10 +1,10 @@ /* * biblatexin.c *- * Copyright (c) Chris Putnam 2008-2012- * Copyright (c) Johannes Wilm 2010-2012+ * Copyright (c) Chris Putnam 2008-2013+ * Copyright (c) Johannes Wilm 2010-2013 *- * Program and source code released under the GPL+ * Program and source code released under the GPL version 2 * */ #include <stdio.h>@@ -21,6 +21,9 @@ #include "reftypes.h" #include "biblatexin.h" +static list find = { 0, 0, 0, NULL };+static list replace = { 0, 0, 0, NULL };+ void biblatexin_initparams( param *p, const char *progname ) {@@ -99,25 +102,37 @@ static char * biblatex_item( char *p, newstr *s ) {- int nquotes = 0;+ int surrounding_quotes = 0; int nbrackets = 0;+ int nquotes = 0; while ( *p ) { if ( !nquotes && !nbrackets ) { if ( *p==',' || *p=='=' || *p=='}' || *p==')' ) goto out; } if ( *p=='\"' && *(p-1)!='\\' && nbrackets==0 ) {+ if ( s->len == 0 ) surrounding_quotes = 1;+ else {+ if ( !surrounding_quotes ) newstr_addchar( s, *p );+ if ( nquotes ) surrounding_quotes = 0;+ } nquotes = ( nquotes==0 );- newstr_addchar( s, *p ); } else if ( *p=='{' ) {+ if ( nbrackets>0 || nquotes ) newstr_addchar( s, *p ); nbrackets++;- /*if ( s->len!=0 )*/ newstr_addchar( s, *p ); } else if ( *p=='}' ) { nbrackets--;- /*if ( nbrackets>0 )*/ newstr_addchar( s, *p );+ if ( nbrackets>0 || nquotes ) newstr_addchar( s, *p ); } else {- if ( s->len!=0 || ( s->len==0 && !is_ws( *p ) ) )- newstr_addchar( s, *p );+ if ( !is_ws( *p ) ) newstr_addchar( s, *p );+ else {+ if ( s->len!=0 && *p!='\n' && *p!='\r' )+ newstr_addchar( s, *p );+ else if ( s->len!=0 && (*p=='\n' || *p=='\r')) {+ newstr_addchar( s, ' ' );+ while ( is_ws( *(p+1) ) ) p++;+ }+ } } p++; }@@ -144,11 +159,8 @@ } static void-biblatex_cleantoken( newstr *s, param *p )+biblatex_cleantoken( newstr *s ) {-- if ( p && p->latexin==0 ) return;- /* 'textcomp' annotations */ newstr_findreplace( s, "\\textit", "" ); newstr_findreplace( s, "\\textbf", "" );@@ -176,56 +188,35 @@ newstr_findreplace( s, "\\textunderscore", "_" ); } -static int-biblatex_protected( newstr *data )-{- if ( data->data[0]=='{' && data->data[data->len-1]=='}' ) return 1;- if ( data->data[0]=='\"' && data->data[data->len-1]=='\"' ) return 1;- return 0;-}- static void-biblatex_removeprotection( newstr *data )-{- newstr s;- if ( data->len<3 ) newstr_empty( data ); /* "", {} to nothing */- else {- newstr_init( &s );- newstr_segcpy( &s, &(data->data[1]), - &(data->data[data->len-1]) );- newstr_newstrcpy( data, &s );- newstr_free( &s );- }-}--static void biblatex_split( list *tokens, newstr *s ) {+ int i, n = s->len, nbrackets = 0; newstr currtok;- int nquotes = 0, nbrackets = 0;- int i, n = s->len;+ newstr_init( &currtok );+ for ( i=0; i<n; ++i ) {- if ( s->data[i]=='\"' ) {- if ( nquotes ) nquotes = 0;- else nquotes = 1;- newstr_addchar( &currtok, '\"' );- } else if ( s->data[i]=='{' ) {+ if ( s->data[i]=='{' ) { nbrackets++; newstr_addchar( &currtok, '{' ); } else if ( s->data[i]=='}' ) { nbrackets--; newstr_addchar( &currtok, '}' );- } else if ( s->data[i]=='#' && !nquotes && !nbrackets ) {+ } else if ( s->data[i]=='#' && !nbrackets ) { if ( currtok.len ) list_add( tokens, currtok.data ); newstr_empty( &currtok );- } else if ( !is_ws( s->data[i] ) || nquotes || nbrackets ) {+ } else if ( !is_ws( s->data[i] ) || nbrackets ) { newstr_addchar( &currtok, s->data[i] );+ } else if ( is_ws( s->data[i] ) ) {+ if ( currtok.len ) list_add( tokens, currtok.data );+ newstr_empty( &currtok ); } } if ( currtok.len ) list_add( tokens, currtok.data ); for ( i=0; i<tokens->n; ++i ) {- newstr_trimendingws( &(tokens->str[i]) );+ newstr_trimstartingws( list_get( tokens, i ) );+ newstr_trimendingws( list_get( tokens, i ) ); } newstr_free( &currtok ); }@@ -306,11 +297,55 @@ newstrs_free( &tag, &data, NULL ); } +static void+biblatex_addstring( char *p )+{+ newstr s1, s2;+ newstrs_init( &s1, &s2, NULL );+ p = skip_ws( p );+ if ( *p=='(' || *p=='{' ) p++;+ p = process_biblatexline( p, &s1, &s2 );+ newstr_findreplace( &s2, "\\ ", " " );+ biblatex_cleantoken( &s2 );+ if ( s1.data ) {+ list_add( &find, s1.data );+ if ( s2.data ) list_add( &replace, s2.data );+ else list_add( &replace, "" );+ }+ newstrs_free( &s1, &s2, NULL );+}++static int+biblatex_usestrings( newstr *s )+{+ int i;+ for ( i=0; i<find.n; ++i ) {+ if ( !strcasecmp( s->data, (find.str[i]).data ) ) {+ newstr_findreplace( s, (find.str[i]).data, + (replace.str[i]).data );+ return 1;+ }+ }+ return 0;+}++static void+process_string( char *p )+{+ while ( *p && *p!='{' && *p!='(' ) p++;+ biblatex_addstring( p );+}+ int biblatexin_processf( fields *bibin, char *data, char *filename, long nref ) {- process_cite( bibin, data, filename, nref );- return 1;+ if ( !strncasecmp( data, "@STRING", 7 ) ) {+ process_string( data );+ return 0;+ } else {+ process_cite( bibin, data, filename, nref );+ return 1;+ } } static void@@ -332,25 +367,45 @@ newstr_free( &s ); } +static int+is_name_tag( newstr *tag )+{+ if ( tag->len ) {+ if ( !strcasecmp( tag->data, "author" ) ) return 1;+ if ( !strcasecmp( tag->data, "editor" ) ) return 1;+ if ( !strcasecmp( tag->data, "director" ) ) return 1;+ if ( !strcasecmp( tag->data, "producer" ) ) return 1;+ if ( !strcasecmp( tag->data, "execproducer" ) ) return 1;+ if ( !strcasecmp( tag->data, "writer" ) ) return 1;+ if ( !strcasecmp( tag->data, "redactor" ) ) return 1;+ if ( !strcasecmp( tag->data, "annotator" ) ) return 1;+ if ( !strcasecmp( tag->data, "commentator" ) ) return 1;+ if ( !strcasecmp( tag->data, "translator" ) ) return 1;+ }+ return 0;+}+ static void-biblatex_cleandata( newstr *s, fields *info, param *p )+biblatex_cleandata( newstr *tag, newstr *s, fields *info, param *p ) { list tokens;+ newstr *tok; int i; if ( !s->len ) return; list_init( &tokens ); biblatex_split( &tokens, s ); for ( i=0; i<tokens.n; ++i ) {+ biblatex_usestrings( &(tokens.str[i]) ); if (!strncasecmp(tokens.str[i].data,"\\href{", 6)) { biblatex_addtitleurl( info, &(tokens.str[i]) ); }- biblatex_cleantoken( &(tokens.str[i]), p );+ if ( p && p->latexin && !is_name_tag( tag ) ) biblatex_cleantoken( &(tokens.str[i]) ); } newstr_empty( s ); for ( i=0; i<tokens.n; ++i ) {- if ( biblatex_protected( &(tokens.str[i]) ) )- biblatex_removeprotection( &(tokens.str[i]));- newstr_strcat( s, tokens.str[i].data ); + tok = list_get( &tokens, i );+ if ( i>0 ) newstr_addchar( s, ' ' );+ newstr_newstrcat( s, tok ); } list_free( &tokens ); }@@ -435,7 +490,7 @@ for ( i=0; i<n; ++i ) { t = fields_tag( bibin, i, FIELDS_STRP_NOUSE ); d = fields_value( bibin, i, FIELDS_STRP_NOUSE );- biblatex_cleandata( d, bibin, p );+ biblatex_cleandata( t, d, bibin, p ); if ( !strsearch( t->data, "AUTHORS" ) ) { newstr_findreplace( d, "\n", " " ); newstr_findreplace( d, "\r", " " );@@ -464,120 +519,232 @@ * split names in author list separated by and's (use '|' character) * and add names */-static void+static int process_names( fields *info, char *tag, newstr *data, int level, list *asis, list *corps ) { newstr_findreplace( data, " and ", "|" );- name_add( info, tag, data->data, level, asis, corps );+ return name_add( info, tag, data->data, level, asis, corps ); } -static void-process_pages( fields *info, newstr *s, int level )+/* is_utf8_emdash()+ *+ * Internally pages="A---B" will convert --- to a UTF8+ * emdash = 0xE2 (-30) 0x80 (-128) 0x94 (-108)+ */+static int+is_utf8_emdash( char *p ) {- char *p, *q;- newstr sp, ep;+ static char emdash[3] = { -30, -128, -108 };+ if ( strncmp( p, emdash, 3 ) ) return 0;+ return 1;+}+/* is_utf8_endash()+ *+ * Internally pages="A--B" will convert -- to a UTF8+ * endash = 0xE2 (-30) 0x80 (-128) 0x93 (-109)+ */+static int+is_utf8_endash( char *p )+{+ static char endash[3] = { -30, -128, -109 };+ if ( strncmp( p, endash, 3 ) ) return 0;+ return 1;+} - newstr_init( &sp );- newstr_init( &ep );+static int+process_pages( fields *info, newstr *s, int level )+{+ newstr page;+ char *p;+ int ok; newstr_findreplace( s, " ", "" );+ if ( s->len==0 ) return 1; - p = q = s->data;- while ( isdigit( *q ) ) q++;- newstr_segcpy( &sp, p, q );- if ( sp.len>0 )- fields_add( info, "PAGESTART", sp.data, level );+ newstr_init( &page );+ p = skip_ws( s->data );+ while ( *p && !is_ws(*p) && *p!='-' && *p!='\r' && *p!='\n' && *p!=-30 )+ newstr_addchar( &page, *p++ );+ if ( page.len>0 ) {+ ok = fields_add( info, "PAGESTART", page.data, level );+ if ( !ok ) return 0;+ } - p = q;- while ( *p && !isdigit(*p) ) p++;- q = p;- while ( isdigit( *q ) ) q++;- newstr_segcpy( &ep, p, q );- if ( ep.len>0 )- fields_add( info, "PAGEEND", ep.data, level );+ while ( *p && (is_ws(*p) || *p=='-' ) ) p++;+ if ( *p && is_utf8_emdash( p ) ) p+=3;+ if ( *p && is_utf8_endash( p ) ) p+=3; - newstr_free(&sp);- newstr_free(&ep);+ newstr_empty( &page );+ while ( *p && !is_ws(*p) && *p!='-' && *p!='\r' && *p!='\n' )+ newstr_addchar( &page, *p++ );+ if ( page.len>0 ) {+ ok = fields_add( info, "PAGEEND", page.data, level );+ if ( !ok ) return 0;+ }++ newstr_free( &page );+ return 1; } -static void+static int process_urlcore( fields *info, char *p, int level, char *default_tag ) { if ( !strncasecmp( p, "\\urllink", 8 ) )- fields_add( info, "URL", p+8, level );+ return fields_add( info, "URL", p+8, level ); else if ( !strncasecmp( p, "\\url", 4 ) )- fields_add( info, "URL", p+4, level );+ return fields_add( info, "URL", p+4, level ); else if ( !strncasecmp( p, "arXiv:", 6 ) )- fields_add( info, "ARXIV", p+6, level ); + return fields_add( info, "ARXIV", p+6, level ); else if ( !strncasecmp( p, "http://arxiv.org/abs/", 21 ) )- fields_add( info, "ARXIV", p+21, level );+ return 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 );+ return fields_add( info, "URL", p, level );+ else return fields_add( info, default_tag, p, level ); } -static void+static int process_url( fields *info, char *p, int level ) {- process_urlcore( info, p, level, "URL" );+ return process_urlcore( info, p, level, "URL" ); } -static void+/* process_howpublished()+ *+ * howpublished={},+ *+ * Normally indicates the manner in which something was+ * published in lieu of a formal publisher, so typically+ * 'howpublished' and 'publisher' will never be in the+ * same reference.+ *+ * Occasionally, people put Diploma thesis information+ * into this field, so check for that first.+ */+static int 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 );+ return fields_replace_or_add( info, "NGENRE", "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" );+ return fields_replace_or_add( info, "NGENRE", "Habilitation thesis", level );+ else+ return fields_add( info, "PUBLISHER", p, level ); } -static void-process_genre( fields *info, char *p, int level )+static int+process_thesistype( 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 );+ /* type in the @thesis is used to distinguish Ph.D. and Master's thesis */+ if ( !strncasecmp( p, "phdthesis", 9 ) ) {+ return fields_replace_or_add( info, "NGENRE", "Ph.D. thesis", level );+ } else if ( !strncasecmp( p, "mastersthesis", 13 ) || !strncasecmp( p, "masterthesis", 12 ) ) {+ return fields_replace_or_add( info, "NGENRE", "Masters thesis", level );+ } else if ( !strncasecmp( p, "mathesis", 8 ) ) {+ return fields_replace_or_add( info, "NGENRE", "Masters thesis", level );+ } else if ( !strncasecmp( p, "diploma", 7 ) ) {+ return fields_replace_or_add( info, "NGENRE", "Diploma thesis", level );+ } else if ( !strncasecmp( p, "habilitation", 12 ) ) {+ return fields_replace_or_add( info, "NGENRE", "Habilitation thesis", level );+ }+ return 1;+}++/* biblatex drops school field if institution is present */+static int+process_school( fields *bibin, fields *info, char *tag, char *value, int level )+{+ if ( fields_find( bibin, "institution", LEVEL_ANY ) != -1 )+ return 1; else- fields_add( info, "GENRE", p, level );+ return fields_add( info, tag, value, level ); } -static void++/*+ * biblatex has multiple editor fields "editor", "editora", "editorb", "editorc",+ * each of which can be modified from a type of "EDITOR" via "editortype",+ * "editoratype", "editorbtype", "editorctype".+ *+ * Defined types:+ * "editor"+ * "collaborator"+ * "compiler"+ * "redactor"+ *+ * "reviser" ?+ * "founder" ?+ * "continuator" ?+ *+ * bibtex-chicago+ *+ * "director"+ * "producer"+ * "conductor"+ * "none" (for performer)+ */+static int+process_editor( fields *bibin, fields *info, newstr *tag, newstr *value, int level, list *asis, list *corps )+{+ char *editor_fields[] = { "editor", "editora", "editorb", "editorc" };+ char *editor_types[] = { "editortype", "editoratype", "editorbtype", "editorctype" };+ int i, n = 0, ntype, neditors = sizeof( editor_fields ) / sizeof( editor_fields[0] );+ char *type, *outtag = "EDITOR";+ for ( i=1; i<neditors; ++i )+ if ( !strcasecmp( tag->data, editor_fields[i] ) ) n = i;+ ntype = fields_find( bibin, editor_types[n], LEVEL_ANY );+ if ( ntype!=-1 ) {+ type = fields_value( bibin, ntype, FIELDS_CHRP_NOUSE );+ if ( !strcasecmp( type, "collaborator" ) ) outtag = "COLLABORATOR";+ else if ( !strcasecmp( type, "compiler" ) ) outtag = "COMPILER";+ else if ( !strcasecmp( type, "redactor" ) ) outtag = "REDACTOR";+ else if ( !strcasecmp( type, "director" ) ) outtag = "DIRECTOR";+ else if ( !strcasecmp( type, "producer" ) ) outtag = "PRODUCER";+ else if ( !strcasecmp( type, "none" ) ) outtag = "PERFORMER";+ }+ return process_names( info, outtag, value, level, asis, corps );+}++static int process_eprint( fields *bibin, fields *info, int level ) {- int neprint, netype;+ int neprint, netype, ok; 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; 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 );+ if ( !strncasecmp( etype, "arxiv", 5 ) ) {+ ok = fields_add( info, "ARXIV", eprint, level );+ if ( !ok ) return 0;+ } else if ( !strncasecmp( etype, "jstor", 5 ) ) {+ ok = fields_add( info, "JSTOR", eprint, level );+ if ( !ok ) return 0;+ } else if ( !strncasecmp( etype, "pubmed", 6 ) ) {+ ok = fields_add( info, "PMID", eprint, level );+ if ( !ok ) return 0;+ } else if ( !strncasecmp( etype, "medline", 7 ) ) {+ ok = fields_add( info, "MEDLINE", eprint, level );+ if ( !ok ) return 0;+ } else {+ ok = fields_add( info, "EPRINT", eprint, level );+ if ( !ok ) return 0;+ ok = fields_add( info, "EPRINTTYPE", etype, level );+ if ( !ok ) return 0; } fields_setused( bibin, neprint ); fields_setused( bibin, netype ); } else if ( eprint ) {- fields_add( info, "EPRINT", eprint, level );+ ok = fields_add( info, "EPRINT", eprint, level );+ if ( !ok ) return 0; fields_setused( bibin, neprint ); } else if ( etype ) {- fields_add( info, "EPRINTTYPE", etype, level );+ ok = fields_add( info, "EPRINTTYPE", etype, level );+ if ( !ok ) return 0; fields_setused( bibin, netype ); }+ return 1; } int@@ -605,9 +772,9 @@ int i, n; n = fields_num( f ); for ( i=0; i<n; ++i )- fprintf(stderr, "'%s' %d = '%s'\n",- (char*)fields_tag( f, i, FIELDS_CHRP_NOUSE ),+ fprintf(stderr, "%d '%s' = '%s'\n", fields_level( f, i ),+ (char*)fields_tag( f, i, FIELDS_CHRP_NOUSE ), (char*)fields_value( f, i, FIELDS_CHRP_NOUSE ) ); } @@ -620,53 +787,286 @@ } } -void+/* get_title_elements()+ *+ * find all of the biblatex title elements for the current level+ * internal "TITLE" -> "title", "booktitle", "maintitle"+ * internal "SUBTITLE" -> "subtitle", "booksubtitle", "mainsubtitle"+ * internal "TITLEADDON" -> "titleaddon", "booktitleaddon", "maintitleaddon"+ *+ * place in ttl, subttl, and ttladdon strings+ *+ * return 1 if an element is found, 0 if not+ */+static int+get_title_elements( fields *bibin, int currlevel, int reftype, variants *all, int nall,+ newstr *ttl, newstr *subttl, newstr *ttladdon )+{+ int nfields, process, level, i, n;+ newstr *t, *d;+ char *newtag;++ newstrs_empty( ttl, subttl, ttladdon, NULL );++ nfields = fields_num( bibin );++ for ( i=0; i<nfields; ++i ) {++ /* ...skip already used titles */+ if ( fields_used( bibin, i ) ) continue;++ /* ...skip empty elements */+ t = fields_tag ( bibin, i, FIELDS_STRP_NOUSE );+ d = fields_value( bibin, i, FIELDS_STRP_NOUSE );+ if ( d->len == 0 ) continue;++ n = translate_oldtag( t->data, reftype, all, nall, &process, &level, &newtag );+ if ( n==-1 ) continue;+ if ( process != TITLE ) continue;+ if ( level != currlevel ) continue;++ fields_setused( bibin, i );++ if ( !strcasecmp( newtag, "TITLE" ) ) {+ if ( ttl->len ) newstr_addchar( ttl, ' ' );+ newstr_newstrcat( ttl, d );+ } else if ( !strcasecmp( newtag, "SUBTITLE" ) ) {+ if ( subttl->len ) newstr_addchar( subttl, ' ' );+ newstr_newstrcat( subttl, d );+ } else if ( !strcasecmp( newtag, "TITLEADDON" ) ) {+ if ( ttladdon->len ) newstr_addchar( ttladdon, ' ' );+ newstr_newstrcat( ttladdon, d );+ }+ }++ return ( ttl->len>0 || subttl->len > 0 || ttladdon->len > 0 );+}++/* attach_addon()+ *+ * Add titleaddon to the title.+ */+static void+attach_addon( newstr *title, newstr *addon )+{+ if ( title->len ) {+ if ( title->data[title->len-1]!='.' )+ newstr_addchar( title, '.' );+ newstr_addchar( title, ' ' );+ }+ newstr_newstrcat( title, addon );+}++static int+process_combined_title( fields *info, newstr *ttl, newstr *subttl, newstr *ttladdon, int currlevel )+{+ newstr combined;+ int ok, ret = 1;+ newstr_init( &combined );+ newstr_newstrcpy( &combined, ttl );+ if ( subttl->len ) {+ if ( combined.len && combined.data[combined.len-1]!=':' && combined.data[combined.len-1]!='?' )+ newstr_addchar( &combined, ':' );+ newstr_addchar( &combined, ' ' );+ newstr_newstrcat( &combined, subttl );+ }+ if ( ttladdon->len ) attach_addon( &combined, ttladdon );+ ok = fields_add( info, "TITLE", combined.data, currlevel );+ if ( !ok ) ret = 0;+ newstr_free( &combined );+ return ret;+}++static int+process_separated_title( fields *info, newstr *ttl, newstr *subttl, newstr *ttladdon, int currlevel )+{+ int ok;+ if ( ttladdon->len ) {+ if ( subttl->len ) attach_addon( subttl, ttladdon );+ else attach_addon( ttl, ttladdon );+ }+ if ( ttl->len ) {+ ok = fields_add( info, "TITLE", ttl->data, currlevel );+ if ( !ok ) return 0;+ }+ if ( subttl->len ) {+ ok = fields_add( info, "SUBTITLE", subttl->data, currlevel );+ if ( !ok ) return 0;+ }+ return 1;+}++static int+process_title_all( fields *bibin, fields *info, int reftype, param *p,+ variants *all, int nall )+{+ int currlevel, ok, found, ret=1;+ newstr ttl, subttl, ttladdon;+ newstrs_init( &ttl, &subttl, &ttladdon, NULL );+ for ( currlevel = 0; currlevel<LEVEL_SERIES+2; currlevel++ ) {+ found = get_title_elements( bibin, currlevel, reftype, all, nall,+ &ttl, &subttl, &ttladdon );+ if ( !found ) continue;+ if ( p->nosplittitle )+ ok = process_combined_title( info, &ttl, &subttl, &ttladdon, currlevel );+ else+ ok = process_separated_title( info, &ttl, &subttl, &ttladdon, currlevel );+ if ( !ok ) { ret = 0; goto out; }+ }+out:+ newstrs_free( &ttl, &subttl, &ttladdon, NULL );+ return ret;+}+++static int+biblatex_names( fields *info, char *tag, newstr *data, int level, list *asis, list *corps )+{+ int begin, end, ok, n, etal, i, ret = 1;+ list tokens;++ list_init( &tokens );++ biblatex_split( &tokens, data );+ for ( i=0; i<tokens.n; ++i )+ biblatex_cleantoken( list_get( &tokens, i ) );++ etal = name_findetal( &tokens );++ begin = 0;+ n = tokens.n - etal;+ while ( begin < n ) {++ end = begin + 1;++ while ( end < n && strcasecmp( list_getc( &tokens, end ), "and" ) )+ end++;++ if ( end - begin == 1 ) {+ ok = name_addsingleelement( info, tag, list_getc( &tokens, begin ), level, 0 );+ if ( !ok ) { ret = 0; goto out; }+ } else {+ ok = name_addmultielement( info, tag, &tokens, begin, end, level );+ if ( !ok ) { ret = 0; goto out; }+ }++ begin = end + 1;++ /* Handle repeated 'and' errors */+ while ( begin < n && !strcasecmp( list_getc( &tokens, begin ), "and" ) )+ begin++;++ }++ if ( etal ) {+ ret = name_addsingleelement( info, tag, "et al.", level, 0 );+ }++out:+ list_free( &tokens );+ return ret;+}++int biblatexin_convertf( fields *bibin, fields *info, int reftype, param *p, variants *all, int nall ) {+ int process, level, i, n, nfields, ok; newstr *t, *d;- int process, level, i, n, nfields; char *newtag; nfields = fields_num( bibin ); for ( i=0; i<nfields; ++i ) { /* skip ones already "used" such as successful crossref */- if ( bibin->used[i] ) continue;+ if ( fields_used( bibin, i ) ) continue; - /* skip ones with no data */- d = &( bibin->data[i] );- if ( d->len == 0 ) continue;+ /* skip ones with no data or no tags (e.g. don't match ALWAYS/DEFAULT entries) */+ t = fields_tag ( bibin, i, FIELDS_STRP_NOUSE );+ d = fields_value( bibin, i, FIELDS_STRP_NOUSE );+ if ( t->len == 0 || d->len == 0 ) continue; - t = &( bibin->tag[i] );- n = process_findoldtag( t->data, reftype, all, nall );+ n = translate_oldtag( t->data, reftype, all, nall, &process, &level, &newtag ); if ( n==-1 ) { biblatexin_notag( p, t->data ); continue; } - process = ((all[reftype]).tags[n]).processingtype;- if ( process == ALWAYS ) continue; /* added before */+ switch ( process ) { - level = ((all[reftype]).tags[n]).level;- newtag = ((all[reftype]).tags[n]).newstr;+ case SIMPLE:+ ok = fields_add( info, newtag, d->data, level );+ fields_setused( bibin, i );+ break; - if ( process==SIMPLE || process==TITLE )- fields_add( info, newtag, d->data, level );- else if ( process==PERSON )- process_names( info, newtag, d, level, &(p->asis), - &(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 );+ case PERSON:+ ok = biblatex_names( info, newtag, d, level, &(p->asis), &(p->corps) );+ fields_setused( bibin, i );+ break;++ case BLT_EDITOR:+ ok = process_editor( bibin, info, t, d, level, &(p->asis), &(p->corps) );+ fields_setused( bibin, i );+ break;++ case PAGES:+ ok = process_pages( info, d, level);+ fields_setused( bibin, i );+ break;++ case HOWPUBLISHED:+ ok = process_howpublished( info, d->data, level );+ fields_setused( bibin, i );+ break;++ case BIBTEX_URL:+ ok = process_url( info, d->data, level );+ fields_setused( bibin, i );+ break;++ case BIBTEX_GENRE:+ ok = fields_add( info, "NGENRE", d->data, level );+ fields_setused( bibin, i );+ break;++ case BIBTEX_EPRINT:+ ok = process_eprint( bibin, info, level );+ fields_setused( bibin, i );+ break;++ case BLT_THESIS_TYPE:+ ok = process_thesistype( info, d->data, level );+ fields_setused( bibin, i );+ break;++ case BLT_SCHOOL:+ ok = process_school( bibin, info, newtag, d->data, level );+ fields_setused( bibin, i );+ break;++ case BLT_SKIP:+ ok = 1;+ fields_setused( bibin, i );+ break;++ case TITLE:+ ok = 1; /* delay title processing until later */+ break;++ default:+ ok = 1;+ break;++ }+ if ( !ok ) return BIBL_ERR_MEMERR;+ }++ ok = process_title_all( bibin, info, reftype, p, all, nall );+ if ( !ok ) return BIBL_ERR_MEMERR;+ if ( p->verbose ) report( info );++ return BIBL_OK; }
bibutils/biblatexin.h view
@@ -1,9 +1,9 @@ /* * biblatexin.h *- * Copyright (c) Chris Putnam 2008-2012+ * Copyright (c) Chris Putnam 2008-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef BIBLATEXIN_H@@ -16,7 +16,7 @@ #include "bibutils.h" #include "reftypes.h" -extern void biblatexin_convertf( fields *bibin, fields *info, int reftype, param *p, variants *all, int nall );+extern int biblatexin_convertf( fields *bibin, fields *info, int reftype, param *p, variants *all, int nall ); extern int biblatexin_processf( fields *bibin, char *data, char *filename, long nref ); extern void biblatexin_cleanf( bibl *bin, param *p ); extern int biblatexin_readf( FILE *fp, char *buf, int bufsize, int *bufpos, newstr *line, newstr *reference, int *fcharset );
bibutils/bibtexin.c view
@@ -1,9 +1,9 @@ /* * bibtexin.c *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Program and source code released under the GPL+ * Program and source code released under the GPL version 2 * */ #include <stdio.h>@@ -21,8 +21,8 @@ #include "reftypes.h" #include "bibtexin.h" -list find = { 0, 0, 0, NULL };-list replace = { 0, 0, 0, NULL };+static list find = { 0, 0, 0, NULL };+static list replace = { 0, 0, 0, NULL }; void bibtexin_initparams( param *p, const char *progname )@@ -110,27 +110,28 @@ static char * bibtex_item( char *p, newstr *s ) {- int nquotes = 0;+ int surrounding_quotes = 0; int nbrackets = 0;+ int nquotes = 0; while ( *p ) { if ( !nquotes && !nbrackets ) { if ( *p==',' || *p=='=' || *p=='}' || *p==')' ) goto out; } if ( *p=='\"' && *(p-1)!='\\' && nbrackets==0 ) {+ if ( s->len == 0 ) surrounding_quotes = 1;+ else {+ if ( !surrounding_quotes ) newstr_addchar( s, *p );+ if ( nquotes ) surrounding_quotes = 0;+ } nquotes = ( nquotes==0 );- newstr_addchar( s, *p ); } else if ( *p=='{' ) {+ if ( nbrackets>0 || nquotes ) newstr_addchar( s, *p ); nbrackets++;- /*if ( s->len!=0 )*/ newstr_addchar( s, *p ); } else if ( *p=='}' ) { nbrackets--;- /*if ( nbrackets>0 )*/ newstr_addchar( s, *p );+ if ( nbrackets>0 || nquotes ) newstr_addchar( s, *p ); } else {- /*- if ( s->len!=0 || ( s->len==0 && !is_ws( *p ) ) )- newstr_addchar( s, *p );- */ if ( !is_ws( *p ) ) newstr_addchar( s, *p ); else { if ( s->len!=0 && *p!='\n' && *p!='\r' )@@ -166,11 +167,32 @@ } static void-bibtex_cleantoken( newstr *s, param *p )+bibtex_process_tilde( newstr *s ) {+ char *p, *q;+ int n = 0; - if ( p && p->latexin==0 ) return;+ p = q = s->data;+ while ( *p ) {+ if ( *p=='~' ) {+ *q = ' ';+ } else if ( *p=='\\' && *(p+1)=='~' ) {+ n++;+ p++;+ *q = '~';+ } else {+ *q = *p;+ }+ p++;+ q++;+ }+ *q = '\0';+ s->len -= n;+} +static void+bibtex_cleantoken( newstr *s )+{ /* 'textcomp' annotations */ newstr_findreplace( s, "\\textit", "" ); newstr_findreplace( s, "\\textbf", "" );@@ -197,6 +219,9 @@ /* 'textcomp' annotations that we don't want to substitute on output*/ newstr_findreplace( s, "\\textdollar", "$" ); newstr_findreplace( s, "\\textunderscore", "_" );++ bibtex_process_tilde( s );+ } static void@@ -208,7 +233,7 @@ if ( *p=='(' || *p=='{' ) p++; p = process_bibtexline( p, &s1, &s2 ); newstr_findreplace( &s2, "\\ ", " " );- bibtex_cleantoken( &s2, NULL );+ bibtex_cleantoken( &s2 ); if ( s1.data ) { list_add( &find, s1.data ); if ( s2.data ) list_add( &replace, s2.data );@@ -226,47 +251,34 @@ } static void-bibtex_removeprotection( newstr *data )-{- newstr s;- if ( data->len<3 ) newstr_empty( data ); /* "", {} to nothing */- else {- newstr_init( &s );- newstr_segcpy( &s, &(data->data[1]), - &(data->data[data->len-1]) );- newstr_newstrcpy( data, &s );- newstr_free( &s );- }-}--static void bibtex_split( list *tokens, newstr *s ) {+ int i, n = s->len, nbrackets = 0; newstr currtok;- int nquotes = 0, nbrackets = 0;- int i, n = s->len;+ newstr_init( &currtok );+ for ( i=0; i<n; ++i ) {- if ( s->data[i]=='\"' ) {- if ( nquotes ) nquotes = 0;- else nquotes = 1;- newstr_addchar( &currtok, '\"' );- } else if ( s->data[i]=='{' ) {+ if ( s->data[i]=='{' ) { nbrackets++; newstr_addchar( &currtok, '{' ); } else if ( s->data[i]=='}' ) { nbrackets--; newstr_addchar( &currtok, '}' );- } else if ( s->data[i]=='#' && !nquotes && !nbrackets ) {+ } else if ( s->data[i]=='#' && !nbrackets ) { if ( currtok.len ) list_add( tokens, currtok.data ); newstr_empty( &currtok );- } else if ( !is_ws( s->data[i] ) || nquotes || nbrackets ) {+ } else if ( !is_ws( s->data[i] ) || nbrackets ) { newstr_addchar( &currtok, s->data[i] );+ } else if ( is_ws( s->data[i] ) ) {+ if ( currtok.len ) list_add( tokens, currtok.data );+ newstr_empty( &currtok ); } } if ( currtok.len ) list_add( tokens, currtok.data ); for ( i=0; i<tokens->n; ++i ) {- newstr_trimendingws( &(tokens->str[i]) );+ newstr_trimstartingws( list_get( tokens, i ) );+ newstr_trimendingws( list_get( tokens, i ) ); } newstr_free( &currtok ); }@@ -274,11 +286,12 @@ static int bibtex_usestrings( newstr *s ) {+ char *p; int i; for ( i=0; i<find.n; ++i ) {- if ( !strcasecmp( s->data, (find.str[i]).data ) ) {- newstr_findreplace( s, (find.str[i]).data, - (replace.str[i]).data );+ p = list_getc( &find, i );+ if ( !strcasecmp( s->data, p ) ) {+ newstr_findreplace( s, p, list_getc( &replace, i ) ); return 1; } }@@ -403,29 +416,50 @@ newstr_free( &s ); } +static int+is_url_tag( newstr *tag )+{+ if ( tag->len ) {+ if ( !strcasecmp( tag->data, "url" ) ) return 1;+ }+ return 0;+}++static int+is_name_tag( newstr *tag )+{+ if ( tag->len ) {+ if ( !strcasecmp( tag->data, "author" ) ) return 1;+ if ( !strcasecmp( tag->data, "editor" ) ) return 1;+ }+ return 0;+}+ static void-bibtex_cleandata( newstr *s, fields *info, param *p )+bibtex_cleandata( newstr *tag, newstr *s, fields *info, param *p ) { list tokens;+ newstr *tok; int i; if ( !s->len ) return; list_init( &tokens ); bibtex_split( &tokens, s ); for ( i=0; i<tokens.n; ++i ) {- if ( !bibtex_protected( &(tokens.str[i] ) ) ) {- bibtex_usestrings( &(tokens.str[i]) );+ tok = list_get( &tokens, i );+ if ( !bibtex_protected( tok ) ) {+ bibtex_usestrings( tok ); } else {- if (!strncasecmp(tokens.str[i].data,"\\href{", 6)) {- bibtex_addtitleurl( info, &(tokens.str[i]) );+ if (!strncasecmp(tok->data,"\\href{", 6)) {+ bibtex_addtitleurl( info, tok ); }- bibtex_cleantoken( &(tokens.str[i]), p ); }+ if ( p->latexin && !is_name_tag( tag ) && !is_url_tag( tag ) ) bibtex_cleantoken( tok ); } newstr_empty( s ); for ( i=0; i<tokens.n; ++i ) {- if ( bibtex_protected( &(tokens.str[i]) ) )- bibtex_removeprotection( &(tokens.str[i]));- newstr_strcat( s, tokens.str[i].data ); + tok = list_get( &tokens, i );+ if ( i>0 ) newstr_addchar( s, ' ' );+ newstr_newstrcat( s, tok ); } list_free( &tokens ); }@@ -499,17 +533,7 @@ for ( i=0; i<n; ++i ) { t = fields_tag( bibin, i, FIELDS_STRP_NOUSE ); d = fields_value( bibin, i, FIELDS_STRP_NOUSE );- bibtex_cleandata( d, bibin, p );- if ( !strsearch( t->data, "AUTHORS" ) ) {- newstr_findreplace( d, "\n", " " );- newstr_findreplace( d, "\r", " " );- }- else if ( !strsearch( t->data, "ABSTRACT" ) ||- !strsearch( t->data, "SUMMARY" ) || - !strsearch( t->data, "NOTE" ) ) {- newstr_findreplace( d, "\n", "" );- newstr_findreplace( d, "\r", "" );- }+ bibtex_cleandata( t, d, bibin, p ); } } @@ -523,67 +547,140 @@ } /*- * process_names( info, newtag, field, level);+ * bibtex_names( info, newtag, field, level); * * split names in author list separated by and's (use '|' character) * and add names */-static void-process_names( fields *info, char *tag, newstr *data, int level, list *asis,+static int+bibtex_names( fields *info, char *tag, newstr *data, int level, list *asis, list *corps ) {- newstr_findreplace( data, " and ", "|" );- newstr_findreplace( data, "|and ", "|" );- name_add( info, tag, data->data, level, asis, corps );+ int begin, end, ok, n, etal, i, ret = 1;+ list tokens;++ list_init( &tokens );++ bibtex_split( &tokens, data );+ for ( i=0; i<tokens.n; ++i )+ bibtex_cleantoken( list_get( &tokens, i ) );++ etal = name_findetal( &tokens );++ begin = 0;+ n = tokens.n - etal;+ while ( begin < n ) {++ end = begin + 1;++ while ( end < n && strcasecmp( list_getc( &tokens, end ), "and" ) )+ end++;++ if ( end - begin == 1 ) {+ ok = name_addsingleelement( info, tag, list_getc( &tokens, begin ), level, 0 );+ if ( !ok ) { ret = 0; goto out; }+ } else {+ ok = name_addmultielement( info, tag, &tokens, begin, end, level );+ if ( !ok ) { ret = 0; goto out; }+ }++ begin = end + 1;++ /* Handle repeated 'and' errors like: authors="G. F. Author and and B. K. Author" */+ while ( begin < n && !strcasecmp( list_getc( &tokens, begin ), "and" ) )+ begin++;+ }++ if ( etal ) {+ ret = name_addsingleelement( info, tag, "et al.", level, 0 );+ }++out:+ list_free( &tokens );+ return ret; } -static void+/* is_utf8_emdash()+ *+ * Internally pages="A---B" will convert --- to a UTF8+ * emdash = 0xE2 (-30) 0x80 (-128) 0x94 (-108)+ */+static int+is_utf8_emdash( char *p )+{+ static char emdash[3] = { -30, -128, -108 };+ if ( strncmp( p, emdash, 3 ) ) return 0;+ return 1;+}+/* is_utf8_endash()+ *+ * Internally pages="A--B" will convert -- to a UTF8+ * endash = 0xE2 (-30) 0x80 (-128) 0x93 (-109)+ */+static int+is_utf8_endash( char *p )+{+ static char endash[3] = { -30, -128, -109 };+ if ( strncmp( p, endash, 3 ) ) return 0;+ return 1;+}++static int process_pages( fields *info, newstr *s, int level ) {- char *p, *q;- newstr sp, ep;+ newstr page;+ char *p;+ int ok; - newstrs_init( &sp, &ep, NULL ); newstr_findreplace( s, " ", "" );+ if ( s->len==0 ) return 1; - p = q = s->data;- while ( isdigit( *q ) ) q++;- newstr_segcpy( &sp, p, q );- if ( sp.len>0 )- fields_add( info, "PAGESTART", sp.data, level );+ newstr_init( &page );+ p = skip_ws( s->data );+ while ( *p && !is_ws(*p) && *p!='-' && *p!='\r' && *p!='\n' && *p!=-30 )+ newstr_addchar( &page, *p++ );+ if ( page.len>0 ) {+ ok = fields_add( info, "PAGESTART", page.data, level );+ if ( !ok ) return 0;+ } - p = q;- while ( *p && !isdigit(*p) ) p++;- q = p;- while ( isdigit( *q ) ) q++;- newstr_segcpy( &ep, p, q );- if ( ep.len>0 )- fields_add( info, "PAGEEND", ep.data, level );+ while ( *p && (is_ws(*p) || *p=='-' ) ) p++;+ if ( *p && is_utf8_emdash( p ) ) p+=3;+ if ( *p && is_utf8_endash( p ) ) p+=3; - newstrs_free( &sp, &ep, NULL );+ newstr_empty( &page );+ while ( *p && !is_ws(*p) && *p!='-' && *p!='\r' && *p!='\n' )+ newstr_addchar( &page, *p++ );+ if ( page.len>0 ) {+ ok = fields_add( info, "PAGEEND", page.data, level );+ if ( !ok ) return 0;+ }++ newstr_free( &page );+ return 1; } -static void+static int process_urlcore( fields *info, newstr *d, int level, char *default_tag ) { char *p = d->data; if ( !strncasecmp( p, "\\urllink", 8 ) )- fields_add( info, "URL", p+8, level );+ return fields_add( info, "URL", p+8, level ); else if ( !strncasecmp( p, "\\url", 4 ) )- fields_add( info, "URL", p+4, level );+ return fields_add( info, "URL", p+4, level ); else if ( !strncasecmp( p, "arXiv:", 6 ) )- fields_add( info, "ARXIV", p+6, level ); + return fields_add( info, "ARXIV", p+6, level ); else if ( !strncasecmp( p, "http://arxiv.org/abs/", 21 ) )- fields_add( info, "ARXIV", p+21, level );+ return 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 );+ return fields_add( info, "URL", p, level );+ else return fields_add( info, default_tag, p, level ); } -static void+static int process_url( fields *info, newstr *d, int level ) {- process_urlcore( info, d, level, "URL" );+ return process_urlcore( info, d, level, "URL" ); } /* Split keywords="" with semicolons.@@ -591,13 +688,14 @@ * entries like: * keywords="Microscopy, Confocal" */-static void+static int process_keywords( fields *info, newstr *d, int level ) { newstr keyword; char *p;+ int ok; - if ( !d || d->len==0 ) return;+ if ( !d || d->len==0 ) return 1; p = d->data; newstr_init( &keyword );@@ -607,41 +705,60 @@ while ( *p && *p!=';' ) newstr_addchar( &keyword, *p++ ); newstr_trimendingws( &keyword ); if ( keyword.len ) {- fields_add( info, "KEYWORD", keyword.data, level );+ ok = fields_add( info, "KEYWORD", keyword.data, level );+ if ( !ok ) return 0; newstr_empty( &keyword ); } if ( *p==';' ) p++; } newstr_free( &keyword );+ return 1; } -static void+/* proces_howpublished()+ *+ * howpublished={},+ *+ * Normally indicates the manner in which something was+ * published in lieu of a formal publisher, so typically+ * 'howpublished' and 'publisher' will never be in the+ * same reference.+ *+ * Occassionally, people put Diploma thesis information+ * into the field, so check that first.+ */+static int process_howpublished( fields *info, newstr *d, int level ) { char *p = d->data;- /* Some users put Diploma thesis in howpublished */ if ( !strncasecmp( p, "Diplom", 6 ) )- fields_replace_or_add( info, "GENRE", "Diploma thesis", level );+ return fields_replace_or_add( info, "GENRE", "Diploma thesis", level ); else if ( !strncasecmp( p, "Habilitation", 13 ) )- fields_replace_or_add( info, "GENRE", "Habilitation thesis", level );+ return fields_replace_or_add( info, "GENRE", "Habilitation thesis", level );+ else if ( !strncasecmp( d->data, "http:", 5 ) )+ return process_url( info, d, level );+ else if ( !strncasecmp( d->data, "arXiv:", 6 ) )+ return process_url( info, d, level ); else - process_urlcore( info, d, level, "DESCRIPTION" );+ return fields_add( info, "PUBLISHER", p, level ); } /* * sentelink = {file://localhost/full/path/to/file.pdf,Sente,PDF} */-static void+static int process_sente( fields *info, newstr *d, int level ) {+ int ret = 1; newstr link; char *p = d->data; newstr_init( &link ); while ( *p && *p!=',' ) newstr_addchar( &link, *p++ ); newstr_trimstartingws( &link ); newstr_trimendingws( &link );- if ( link.len ) fields_add( info, "FILEATTACH", link.data, level );+ if ( link.len ) ret = fields_add( info, "FILEATTACH", link.data, level ); newstr_free( &link );+ return ret; } /*@@ -654,15 +771,15 @@ * </role> * </name> */-static void+static int process_organization( fields *bibin, fields *info, newstr *d, int level ) { int n; n = fields_find( bibin, "publisher", LEVEL_ANY ); if ( n==-1 )- fields_add( info, "PUBLISHER", d->data, level );+ return fields_add( info, "PUBLISHER", d->data, level ); else- fields_add( info, "ORGANIZER:CORP", d->data, level );+ return fields_add( info, "ORGANIZER:CORP", d->data, level ); } static int@@ -695,12 +812,12 @@ /* * file={Description:/full/path/to/file.pdf:PDF} */-static void+static int process_file( fields *info, newstr *d, int level ) { char *p = d->data; newstr link;- int i, n, n1, n2;+ int i, n, n1, n2, ret = 1; n = count_colons( p ); if ( n > 1 ) {@@ -714,14 +831,26 @@ } newstr_trimstartingws( &link ); newstr_trimendingws( &link );- if ( link.len ) fields_add( info, "FILEATTACH", link.data, level );+ if ( link.len ) ret = fields_add( info, "FILEATTACH", link.data, level ); newstr_free( &link ); } else { /* This field isn't formatted properly, so just copy directly */- fields_add( info, "FILEATTACH", p, level );+ ret = fields_add( info, "FILEATTACH", p, level ); }+ return ret; } +static int+process_note( fields *info, newstr *d, int level )+{+ if ( !strncasecmp( d->data, "http:", 5 ) ||+ !strncasecmp( d->data, "arXiv:", 6 ) ) {+ return process_url( info, d, level );+ } else {+ return fields_add( info, "NOTES", d->data, level );+ }+}+ int bibtexin_typef( fields *bibin, char *filename, int nrefs, param *p, variants *all, int nall )@@ -742,18 +871,6 @@ } static void-report( fields *f )-{- int i, n;- n = fields_num( f );- for ( i=0; i<n; ++i )- fprintf(stderr, "'%s' %d = '%s'\n",- (char*)fields_tag( f, i, FIELDS_CHRP ),- fields_level( f, i ),- (char*)fields_value( f, i, FIELDS_CHRP ) );-}--static void bibtexin_notag( param *p, char *tag ) { if ( p->verbose && strcmp( tag, "INTERNAL_TYPE" ) ) {@@ -806,25 +923,26 @@ if ( n==-1 ) return 0; else return 1; }-static void+static int bibtexin_title_process( fields *info, char *outtag, fields *bibin, newstr *t, newstr *d, int level, int nosplittitle ) { char *intag = t->data; char *indata = d->data; if ( bibtexin_titleinbook_isbooktitle( intag, bibin ) ) level=LEVEL_MAIN; title_process( info, outtag, indata, level, nosplittitle );+ return 1; }-static void+static int bibtex_simple( fields *info, char *outtag, newstr *d, int level ) {- fields_add( info, outtag, d->data, level );+ return fields_add( info, outtag, d->data, level ); } -void+int bibtexin_convertf( fields *bibin, fields *info, int reftype, param *p, variants *all, int nall ) {- int process, level, i, n, nfields;+ int process, level, i, n, nfields, ok; newstr *t, *d; char *outtag; @@ -835,6 +953,7 @@ if ( fields_nodata( bibin, i ) ) continue; t = fields_tag( bibin, i, FIELDS_STRP );+ if ( t->len == 0 ) continue; /* Don't consider with null tags */ n = process_findoldtag( t->data, reftype, all, nall ); if ( n==-1 ) { bibtexin_notag( p, t->data );@@ -850,53 +969,56 @@ switch( process ) { case SIMPLE:- bibtex_simple( info, outtag, d, level );+ ok = bibtex_simple( info, outtag, d, level ); break; case TITLE:- bibtexin_title_process( info, "TITLE", bibin, t, d, level, p->nosplittitle );+ ok = bibtexin_title_process( info, "TITLE", bibin, t, d, level, p->nosplittitle ); break; case PERSON:- process_names( info, outtag, d, level, &(p->asis), &(p->corps) );+ ok = bibtex_names( info, outtag, d, level, &(p->asis), &(p->corps) ); break; case PAGES:- process_pages( info, d, level );+ ok = process_pages( info, d, level ); break; case KEYWORD:- process_keywords( info, d, level );+ ok = process_keywords( info, d, level ); break; case HOWPUBLISHED:- process_howpublished( info, d, level );+ ok = process_howpublished( info, d, level ); break; case LINKEDFILE:- process_file( info, d, level );+ ok = process_file( info, d, level ); break; + case BIBTEX_NOTE:+ ok = process_note( info, d, level );+ break;+ case BIBTEX_SENTE:- process_sente( info, d, level );+ ok = process_sente( info, d, level ); break; case BIBTEX_URL:- process_url( info, d, level );+ ok = process_url( info, d, level ); break; case BIBTEX_ORGANIZATION:- process_organization( bibin, info, d, level );- break;-- case ALWAYS:- /* added by core bibutils code */+ ok = process_organization( bibin, info, d, level ); break; default:+ ok = 1; break; }++ if ( !ok ) return BIBL_ERR_MEMERR; }- if ( p->verbose ) report( info );+ return BIBL_OK; }
bibutils/bibtexin.h view
@@ -1,9 +1,9 @@ /* * bibtexin.h *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef BIBTEXIN_H@@ -16,7 +16,7 @@ #include "bibutils.h" #include "reftypes.h" -extern void bibtexin_convertf( fields *bibin, fields *info, int reftype, param *p, variants *all, int nall );+extern int bibtexin_convertf( fields *bibin, fields *info, int reftype, param *p, variants *all, int nall ); extern int bibtexin_processf( fields *bibin, char *data, char *filename, long nref ); extern void bibtexin_cleanf( bibl *bin, param *p ); extern int bibtexin_readf( FILE *fp, char *buf, int bufsize, int *bufpos, newstr *line, newstr *reference, int *fcharset );
bibutils/bibtexout.c view
@@ -1,9 +1,9 @@ /* * bibtexout.c *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Program and source code released under the GPL+ * Program and source code released under the GPL version 2 * */ #include <stdio.h>@@ -15,6 +15,7 @@ #include "utf8.h" #include "xml.h" #include "fields.h"+#include "name.h" #include "bibl.h" #include "doi.h" #include "bibtexout.h"@@ -70,7 +71,7 @@ p = info->data[n].data; while ( p && *p && *p!='|' ) { if ( format_opts & BIBOUT_STRICTKEY ) {- if ( isdigit(*p) || (*p>='A' && *p<='Z') ||+ if ( isdigit((unsigned char)*p) || (*p>='A' && *p<='Z') || (*p>='a' && *p<='z' ) ) fprintf( fp, "%c", *p ); }@@ -191,7 +192,7 @@ len = strlen( s ); fprintf( fp, "@" ); for ( i=0; i<len; ++i )- fprintf( fp, "%c", toupper(s[i]) );+ fprintf( fp, "%c", toupper((unsigned char)s[i]) ); fprintf( fp, "{" ); } }@@ -207,7 +208,7 @@ else { len = strlen( tag ); for ( i=0; i<len; ++i )- fprintf( fp, "%c", toupper(tag[i]) );+ fprintf( fp, "%c", toupper((unsigned char)tag[i]) ); } if ( format_opts & BIBOUT_WHITESPACE ) fprintf( fp, " = \t" ); else fprintf( fp, "=" );@@ -265,6 +266,28 @@ } static void+output_keywords( FILE *fp, fields *info, int format_opts )+{+ newstr keywords, *word;+ vplist a;+ int i;+ newstr_init( &keywords );+ vplist_init( &a );+ fields_findv_each( info, LEVEL_ANY, FIELDS_STRP, &a, "KEYWORD" );+ if ( a.n ) {+ for ( i=0; i<a.n; ++i ) {+ word = vplist_get( &a, i );+ if ( i>0 ) newstr_strcat( &keywords, "; " );+ newstr_newstrcat( &keywords, word );+ }+ output_element( fp, "keywords", keywords.data, format_opts );++ }+ newstr_free( &keywords );+ vplist_free( &a );+}++static void output_fileattach( FILE *fp, fields *info, int format_opts ) { newstr data;@@ -287,31 +310,15 @@ } static void-add_person( newstr *s, char *p )-{- int nseps = 0, nch;- while ( *p ) {- nch = 0;- if ( nseps==1 ) newstr_addchar( s, ',' );- if ( nseps ) newstr_addchar( s, ' ' );- while ( *p && *p!='|' ) {- newstr_addchar( s, *p++ );- nch++;- }- if ( *p=='|' ) p++;- if ( nseps!=0 && nch==1 ) newstr_addchar( s, '.' );- nseps++;- }-}--static void output_people( FILE *fp, fields *info, unsigned long refnum, char *tag, char *ctag, char *atag, char *bibtag, int level, int format_opts ) {- newstr allpeople;+ newstr allpeople, oneperson; int i, npeople, person, corp, asis; + newstrs_init( &allpeople, &oneperson, NULL );+ /* primary citation authors */ npeople = 0; for ( i=0; i<info->n; ++i ) {@@ -320,29 +327,30 @@ corp = ( strcasecmp( info->tag[i].data, ctag ) == 0 ); asis = ( strcasecmp( info->tag[i].data, atag ) == 0 ); if ( person || corp || asis ) {- if ( npeople==0 ) newstr_init( &allpeople );- else {+ if ( npeople>0 ) { if ( format_opts & BIBOUT_WHITESPACE ) newstr_strcat(&allpeople,"\n\t\tand "); else newstr_strcat( &allpeople, "\nand " ); } if ( corp ) { newstr_addchar( &allpeople, '{' );- newstr_strcat( &allpeople, info->data[i].data );+ newstr_strcat( &allpeople, fields_value( info, i, FIELDS_CHRP ) ); newstr_addchar( &allpeople, '}' ); } else if ( asis ) { newstr_addchar( &allpeople, '{' );- newstr_strcat( &allpeople, info->data[i].data );+ newstr_strcat( &allpeople, fields_value( info, i, FIELDS_CHRP ) ); newstr_addchar( &allpeople, '}' );- } else add_person( &allpeople, info->data[i].data ); - fields_setused( info, i );+ } else {+ name_build_withcomma( &oneperson, fields_value( info, i, FIELDS_CHRP ) );+ newstr_newstrcat( &allpeople, &oneperson );+ } npeople++; } }- if ( npeople ) {+ if ( npeople ) output_element( fp, bibtag, allpeople.data, format_opts );- newstr_free( &allpeople );- }++ newstrs_free( &allpeople, &oneperson, NULL ); } static void@@ -574,8 +582,10 @@ else if ( type==TYPE_PHDTHESIS || type==TYPE_MASTERSTHESIS ) { output_title( fp, info, refnum, "series", 1, p->format_opts ); }- else if ( type==TYPE_BOOK || type==TYPE_COLLECTION || type==TYPE_PROCEEDINGS )+ else if ( type==TYPE_BOOK || type==TYPE_COLLECTION || type==TYPE_PROCEEDINGS || type==TYPE_REPORT ) { output_title( fp, info, refnum, "series", 1, p->format_opts );+ output_title( fp, info, refnum, "series", 2, p->format_opts );+ } output_date( fp, info, refnum, p->format_opts ); output_simple( fp, info, "EDITION", "edition", p->format_opts );@@ -586,7 +596,7 @@ /* output_simple( fp, info, "ISSUE", "issue", p->format_opts ); output_simple( fp, info, "NUMBER", "number", p->format_opts );s*/ output_pages( fp, info, refnum, p->format_opts );- output_simpleall( fp, info, "KEYWORD", "keywords", p->format_opts );+ output_keywords( fp, info, p->format_opts ); output_simple( fp, info, "CONTENTS", "contents", p->format_opts ); output_simple( fp, info, "ABSTRACT", "abstract", p->format_opts ); output_simple( fp, info, "LOCATION", "location", p->format_opts );
bibutils/bibtexout.h view
@@ -1,7 +1,9 @@ /* * bibtexout.h *- * Copyright (c) Chris Putnam 2005-2012+ * Copyright (c) Chris Putnam 2005-2013+ *+ * Source code released under GPL version 2 * */ #ifndef BIBTEXOUT_H
bibutils/bibtextypes.c view
@@ -1,12 +1,11 @@ /* * bibtypes.c *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Program and source code released under the GPL+ * Program and source code released under the GPL version 2 * */- #include <stdio.h> #include "fields.h" #include "reftypes.h"@@ -34,7 +33,7 @@ { "abstract", "ABSTRACT", SIMPLE, LEVEL_MAIN }, { "contents", "CONTENTS", SIMPLE, LEVEL_MAIN }, { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN },- { "note", "NOTES", SIMPLE, LEVEL_MAIN },+ { "note", "NOTES", BIBTEX_NOTE, LEVEL_MAIN }, { "annote", "ANNOTE", SIMPLE, LEVEL_MAIN }, { "location", "LOCATION", SIMPLE, LEVEL_MAIN }, { "ftp", "", BIBTEX_URL, LEVEL_MAIN },@@ -48,12 +47,12 @@ { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN }, { "crossref", "CROSSREF", SIMPLE, LEVEL_MAIN }, { "keywords", "KEYWORD", KEYWORD, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|ARTICLE", ALWAYS, LEVEL_MAIN },- { " ", "ISSUANCE|continuing", ALWAYS, LEVEL_HOST },- { " ", "RESOURCE|text", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|journal article", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|periodical", ALWAYS, LEVEL_HOST },- { " ", "GENRE|academic journal", ALWAYS, LEVEL_HOST }+ { "", "INTERNAL_TYPE|ARTICLE", ALWAYS, LEVEL_MAIN },+ { "", "ISSUANCE|continuing", ALWAYS, LEVEL_HOST },+ { "", "RESOURCE|text", ALWAYS, LEVEL_MAIN },+ { "", "NGENRE|journal article", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|periodical", ALWAYS, LEVEL_HOST },+ { "", "NGENRE|academic journal", ALWAYS, LEVEL_HOST } }; /* Book */@@ -80,7 +79,7 @@ { "contents", "CONTENTS", SIMPLE, LEVEL_MAIN }, { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN }, { "location", "LOCATION", SIMPLE, LEVEL_MAIN },- { "note", "NOTES", SIMPLE, LEVEL_MAIN },+ { "note", "NOTES", BIBTEX_NOTE, LEVEL_MAIN }, { "annote", "ANNOTE", SIMPLE, LEVEL_MAIN }, { "type", "GENRE", SIMPLE, LEVEL_MAIN }, { "key", "BIBKEY", SIMPLE, LEVEL_MAIN },@@ -89,17 +88,17 @@ { "pdf", "FILEATTACH",SIMPLE, LEVEL_MAIN }, { "sentelink", "FILEATTACH",BIBTEX_SENTE, LEVEL_MAIN }, { "file", "FILEATTACH",LINKEDFILE, LEVEL_MAIN },- { "address" "ADDRESS", SIMPLE, LEVEL_MAIN },+ { "address", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "howpublished", "", HOWPUBLISHED, LEVEL_MAIN }, { "doi", "DOI", SIMPLE, LEVEL_MAIN }, { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN }, { "crossref", "CROSSREF", SIMPLE, LEVEL_MAIN }, { "keywords", "KEYWORD", KEYWORD, LEVEL_MAIN }, { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|BOOK", ALWAYS, LEVEL_MAIN },- { " ", "RESOURCE|text", ALWAYS, LEVEL_MAIN },- { " ", "ISSUANCE|monographic", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|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 } }; /* Technical reports */@@ -109,6 +108,7 @@ { "translator", "TRANSLATOR",PERSON, LEVEL_MAIN }, { "title", "TITLE", TITLE, LEVEL_MAIN }, { "booktitle", "TITLE", TITLE, LEVEL_MAIN },+ { "series", "TITLE", TITLE, LEVEL_HOST }, { "editor", "EDITOR", PERSON, LEVEL_MAIN }, { "publisher", "PUBLISHER", SIMPLE, LEVEL_MAIN }, { "institution", "PUBLISHER", SIMPLE, LEVEL_MAIN },@@ -123,7 +123,7 @@ { "contents", "CONTENTS", SIMPLE, LEVEL_MAIN }, { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN }, { "location", "LOCATION", SIMPLE, LEVEL_MAIN },- { "note", "NOTES", SIMPLE, LEVEL_MAIN },+ { "note", "NOTES", BIBTEX_NOTE, LEVEL_MAIN }, { "annote", "ANNOTE", SIMPLE, LEVEL_MAIN }, { "key", "BIBKEY", SIMPLE, LEVEL_MAIN }, { "doi", "DOI", SIMPLE, LEVEL_MAIN },@@ -137,9 +137,9 @@ { "crossref", "CROSSREF", SIMPLE, LEVEL_MAIN }, { "type", "GENRE", SIMPLE, LEVEL_MAIN }, { "keywords", "KEYWORD", KEYWORD, LEVEL_MAIN },- { " ", "INTERNAL_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 manual[] = {@@ -160,7 +160,7 @@ { "abstract", "ABSTRACT", SIMPLE, LEVEL_MAIN }, { "contents", "CONTENTS", SIMPLE, LEVEL_MAIN }, { "location", "LOCATION", SIMPLE, LEVEL_MAIN },- { "note", "NOTES", SIMPLE, LEVEL_MAIN },+ { "note", "NOTES", BIBTEX_NOTE, LEVEL_MAIN }, { "annote", "ANNOTE", SIMPLE, LEVEL_MAIN }, { "key", "BIBKEY", SIMPLE, LEVEL_MAIN }, { "doi", "DOI", SIMPLE, LEVEL_MAIN },@@ -174,9 +174,9 @@ { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN }, { "crossref", "CROSSREF", SIMPLE, LEVEL_MAIN }, { "keywords", "KEYWORD", KEYWORD, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|REPORT", ALWAYS, LEVEL_MAIN },- { " ", "RESOURCE|text", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|instruction", ALWAYS, LEVEL_MAIN }+ { "", "INTERNAL_TYPE|REPORT", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|text", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|instruction", ALWAYS, LEVEL_MAIN } }; /* Part of a book (e.g. chapter or section) */@@ -214,15 +214,15 @@ { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN }, { "crossref", "CROSSREF", SIMPLE, LEVEL_MAIN }, { "type", "GENRE", SIMPLE, LEVEL_MAIN },- { "note", "NOTES", SIMPLE, LEVEL_MAIN },+ { "note", "NOTES", BIBTEX_NOTE, LEVEL_MAIN }, { "annote", "ANNOTE", SIMPLE, LEVEL_MAIN }, { "key", "BIBKEY", SIMPLE, LEVEL_MAIN }, { "keywords", "KEYWORD", KEYWORD, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|INBOOK", ALWAYS, LEVEL_MAIN },- { " ", "RESOURCE|text", ALWAYS, LEVEL_MAIN },- { " ", "ISSUANCE|monographic", ALWAYS, LEVEL_HOST },- { " ", "GENRE|book chapter", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|book", ALWAYS, LEVEL_HOST }+ { "", "INTERNAL_TYPE|INBOOK", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|text", ALWAYS, LEVEL_MAIN },+ { "", "ISSUANCE|monographic", ALWAYS, LEVEL_HOST },+ { "", "NGENRE|book chapter", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|book", ALWAYS, LEVEL_HOST } }; /* References of papers in conference proceedings */@@ -258,16 +258,16 @@ { "sentelink", "FILEATTACH",BIBTEX_SENTE, LEVEL_MAIN }, { "file", "FILEATTACH",LINKEDFILE, LEVEL_MAIN }, { "type", "GENRE", SIMPLE, LEVEL_MAIN },- { "note", "NOTES", SIMPLE, LEVEL_MAIN },+ { "note", "NOTES", BIBTEX_NOTE, LEVEL_MAIN }, { "annote", "ANNOTE", SIMPLE, LEVEL_MAIN }, { "key", "BIBKEY", SIMPLE, LEVEL_MAIN }, { "howpublished", "", HOWPUBLISHED, LEVEL_MAIN }, { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN }, { "crossref", "CROSSREF", SIMPLE, LEVEL_MAIN }, { "keywords", "KEYWORD", KEYWORD, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|INPROCEEDINGS", ALWAYS, LEVEL_MAIN },- { " ", "RESOURCE|text", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|conference publication", ALWAYS, LEVEL_HOST }+ { "", "INTERNAL_TYPE|INPROCEEDINGS", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|text", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|conference publication", ALWAYS, LEVEL_HOST } }; /* Used for a section of a book with its own title */@@ -295,7 +295,7 @@ { "contents", "CONTENTS", SIMPLE, LEVEL_HOST }, { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN }, { "type", "GENRE", SIMPLE, LEVEL_MAIN },- { "note", "NOTES", SIMPLE, LEVEL_MAIN },+ { "note", "NOTES", BIBTEX_NOTE, LEVEL_MAIN }, { "annote", "ANNOTE", SIMPLE, LEVEL_MAIN }, { "key", "BIBKEY", SIMPLE, LEVEL_MAIN }, { "doi", "DOI", SIMPLE, LEVEL_MAIN },@@ -309,10 +309,10 @@ { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN }, { "crossref", "CROSSREF", SIMPLE, LEVEL_MAIN }, { "keywords", "KEYWORD", KEYWORD, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|INCOLLECTION", ALWAYS, LEVEL_MAIN },- { " ", "RESOURCE|text", ALWAYS, LEVEL_MAIN },- { " ", "ISSUANCE|monographic", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|collection", ALWAYS, LEVEL_HOST }+ { "", "INTERNAL_TYPE|INCOLLECTION", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|text", ALWAYS, LEVEL_MAIN },+ { "", "ISSUANCE|monographic", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|collection", ALWAYS, LEVEL_HOST } }; /* Proceedings */@@ -346,15 +346,15 @@ { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN }, { "howpublished", "", HOWPUBLISHED, LEVEL_MAIN }, { "location", "LOCATION", SIMPLE, LEVEL_MAIN },- { "note", "NOTES", SIMPLE, LEVEL_MAIN },+ { "note", "NOTES", BIBTEX_NOTE, LEVEL_MAIN }, { "annote", "ANNOTE", SIMPLE, LEVEL_MAIN }, { "key", "BIBKEY", SIMPLE, LEVEL_MAIN }, { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN }, { "crossref", "CROSSREF", SIMPLE, LEVEL_MAIN }, { "keywords", "KEYWORD", KEYWORD, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|PROCEEDINGS", ALWAYS, LEVEL_MAIN },- { " ", "RESOURCE|text", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|conference publication", ALWAYS, LEVEL_MAIN }+ { "", "INTERNAL_TYPE|PROCEEDINGS", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|text", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|conference publication", ALWAYS, LEVEL_MAIN } }; static lookups phds[] = {@@ -377,17 +377,17 @@ { "howpublished", "" , HOWPUBLISHED, LEVEL_MAIN }, { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN }, { "location", "LOCATION", SIMPLE, LEVEL_MAIN },- { "note", "NOTES", SIMPLE, LEVEL_MAIN },+ { "note", "NOTES", BIBTEX_NOTE, LEVEL_MAIN }, { "annote", "ANNOTE", SIMPLE, LEVEL_MAIN }, { "key", "BIBKEY", SIMPLE, LEVEL_MAIN }, { "type", "GENRE", SIMPLE, LEVEL_MAIN }, { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN }, { "crossref", "CROSSREF", SIMPLE, LEVEL_MAIN }, { "keywords", "KEYWORD", KEYWORD, 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 }+ { "", "INTERNAL_TYPE|THESIS", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|text", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|thesis", ALWAYS, LEVEL_MAIN },+ { "", "NGENRE|Ph.D. thesis", DEFAULT, LEVEL_MAIN } }; static lookups masters[] = {@@ -409,7 +409,7 @@ { "file", "FILEATTACH",LINKEDFILE, LEVEL_MAIN }, { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN }, { "location", "LOCATION", SIMPLE, LEVEL_MAIN },- { "note", "NOTES", SIMPLE, LEVEL_MAIN },+ { "note", "NOTES", BIBTEX_NOTE, LEVEL_MAIN }, { "annote", "ANNOTE", SIMPLE, LEVEL_MAIN }, { "key", "BIBKEY", SIMPLE, LEVEL_MAIN }, { "type", "GENRE", SIMPLE, LEVEL_MAIN },@@ -417,10 +417,10 @@ { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN }, { "crossref", "CROSSREF", SIMPLE, LEVEL_MAIN }, { "keywords", "KEYWORD", KEYWORD, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|THESIS", ALWAYS, LEVEL_MAIN },- { " ", "RESOURCE|text", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|thesis", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|Masters thesis", ALWAYS, LEVEL_MAIN }+ { "", "INTERNAL_TYPE|THESIS", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|text", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|thesis", ALWAYS, LEVEL_MAIN },+ { "", "NGENRE|Masters thesis", DEFAULT, LEVEL_MAIN } }; /* Unpublished */@@ -447,15 +447,15 @@ { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN }, { "howpublished", "", HOWPUBLISHED, LEVEL_MAIN }, { "location", "LOCATION", SIMPLE, LEVEL_MAIN },- { "note", "NOTES", SIMPLE, LEVEL_MAIN },+ { "note", "NOTES", BIBTEX_NOTE, LEVEL_MAIN }, { "annote", "ANNOTE", SIMPLE, LEVEL_MAIN }, { "key", "BIBKEY", SIMPLE, LEVEL_MAIN }, { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN }, { "crossref", "CROSSREF", SIMPLE, LEVEL_MAIN }, { "keywords", "KEYWORD", KEYWORD, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|BOOK", ALWAYS, LEVEL_MAIN },- { " ", "RESOURCE|text", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|unpublished", ALWAYS, LEVEL_MAIN }+ { "", "INTERNAL_TYPE|BOOK", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|text", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|unpublished", ALWAYS, LEVEL_MAIN } }; /*@@ -491,13 +491,13 @@ { "number", "NUMBER", TITLE, LEVEL_MAIN }, { "revision", "REVISION", TITLE, LEVEL_MAIN }, { "location", "LOCATION", SIMPLE, LEVEL_MAIN },- { "note", "NOTES", SIMPLE, LEVEL_MAIN },+ { "note", "NOTES", BIBTEX_NOTE, LEVEL_MAIN }, { "annote", "ANNOTE", SIMPLE, LEVEL_MAIN }, { "key", "BIBKEY", SIMPLE, LEVEL_MAIN }, { "keywords", "KEYWORD", KEYWORD, LEVEL_MAIN }, { "crossref", "CROSSREF", SIMPLE, LEVEL_MAIN },- { " ", "RESOURCE|text", ALWAYS, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|STANDARD", ALWAYS, LEVEL_MAIN }+ { "", "RESOURCE|text", ALWAYS, LEVEL_MAIN },+ { "", "INTERNAL_TYPE|STANDARD", ALWAYS, LEVEL_MAIN } }; /*@@ -527,13 +527,13 @@ { "howpublished", "", HOWPUBLISHED, LEVEL_MAIN }, { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN }, { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN },- { "note", "NOTES", SIMPLE, LEVEL_MAIN },+ { "note", "NOTES", BIBTEX_NOTE, LEVEL_MAIN }, { "annote", "ANNOTE", SIMPLE, LEVEL_MAIN }, { "organization", "ORGANIZER:CORP", BIBTEX_ORGANIZATION, LEVEL_MAIN }, { "crossref", "CROSSREF", SIMPLE, LEVEL_MAIN }, { "keywords", "KEYWORD", KEYWORD, LEVEL_MAIN },- { " ", "RESOURCE|text", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|periodical",ALWAYS, LEVEL_MAIN }+ { "", "RESOURCE|text", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|periodical", ALWAYS, LEVEL_MAIN } }; /*@@ -558,7 +558,7 @@ { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN }, { "location", "LOCATION", SIMPLE, LEVEL_MAIN }, { "nationality", "NATIONALITY", SIMPLE, LEVEL_MAIN },- { "note", "NOTES", SIMPLE, LEVEL_MAIN },+ { "note", "NOTES", BIBTEX_NOTE, LEVEL_MAIN }, { "annote", "ANNOTE", SIMPLE, LEVEL_MAIN }, { "key", "BIBKEY", SIMPLE, LEVEL_MAIN }, { "doi", "DOI", SIMPLE, LEVEL_MAIN },@@ -572,9 +572,9 @@ { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN }, { "crossref", "CROSSREF", SIMPLE, LEVEL_MAIN }, { "keywords", "KEYWORD", KEYWORD, LEVEL_MAIN },- { " ", "RESOURCE|text", ALWAYS, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|PATENT", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|patent", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|text", ALWAYS, LEVEL_MAIN },+ { "", "INTERNAL_TYPE|PATENT", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|patent", ALWAYS, LEVEL_MAIN }, }; /*@@ -605,13 +605,13 @@ { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN }, { "crossref", "CROSSREF", SIMPLE, LEVEL_MAIN }, { "location", "LOCATION", SIMPLE, LEVEL_MAIN },- { "note", "NOTES", SIMPLE, LEVEL_MAIN },+ { "note", "NOTES", BIBTEX_NOTE, LEVEL_MAIN }, { "annote", "ANNOTE", SIMPLE, LEVEL_MAIN }, { "key", "BIBKEY", SIMPLE, LEVEL_MAIN }, { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN }, { "keywords", "KEYWORD", KEYWORD, LEVEL_MAIN },- { " ", "RESOURCE|software, multimedia", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|electronic", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|software, multimedia", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|electronic", ALWAYS, LEVEL_MAIN }, }; static lookups misc[] = {@@ -639,12 +639,12 @@ { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN }, { "crossref", "CROSSREF", SIMPLE, LEVEL_MAIN }, { "location", "LOCATION", SIMPLE, LEVEL_MAIN },- { "note", "NOTES", SIMPLE, LEVEL_MAIN },+ { "note", "NOTES", BIBTEX_NOTE, LEVEL_MAIN }, { "annote", "ANNOTE", SIMPLE, LEVEL_MAIN }, { "key", "BIBKEY", SIMPLE, LEVEL_MAIN }, { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN }, { "keywords", "KEYWORD", KEYWORD, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|MISC", ALWAYS, LEVEL_MAIN },+ { "", "INTERNAL_TYPE|MISC", ALWAYS, LEVEL_MAIN }, }; #define ORIG(a) ( &(a[0]) )
bibutils/bibutils.c view
@@ -1,9 +1,9 @@ /* * bibutils.c *- * Copyright (c) Chris Putnam 2005-2012+ * Copyright (c) Chris Putnam 2005-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #include <stdio.h>
bibutils/bibutils.h view
@@ -1,8 +1,10 @@ /* * bibutils.h *- * Copyright (c) Chris Putnam 2005-2012+ * Copyright (c) Chris Putnam 2005-2013 *+ * Source code released under GPL version 2+ * */ #ifndef BIBUTILS_H #define BIBUTILS_H@@ -96,7 +98,7 @@ 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);+ int (*convertf)(fields*,fields*,int,struct param*,variants*,int); void (*headerf)(FILE*,struct param*); void (*footerf)(FILE*); void (*writef)(fields*,FILE*,struct param*,unsigned long);
bibutils/bltypes.c view
@@ -1,10 +1,10 @@ /* * bltypes.c *- * Copyright (c) Chris Putnam 2008-2012- * Copyright (c) Johannes Wilm 2010-2012+ * Copyright (c) Chris Putnam 2008-2013+ * Copyright (c) Johannes Wilm 2010-2013 *- * Program and source code released under the GPL+ * Program and source code released under the GPL version 2 * */ @@ -19,25 +19,36 @@ */ static lookups article[] = { { "author", "AUTHOR", PERSON, LEVEL_MAIN },- { "editor", "EDITOR", PERSON, LEVEL_MAIN },+ { "editor", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editora", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editorb", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editorc", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editortype", "", BLT_SKIP, LEVEL_MAIN },+ { "editoratype", "", BLT_SKIP, LEVEL_MAIN },+ { "editorbtype", "", BLT_SKIP, LEVEL_MAIN },+ { "editorctype", "", BLT_SKIP, LEVEL_MAIN },+ { "director", "DIRECTOR", PERSON, LEVEL_MAIN },+ { "producer", "PRODUCER", PERSON, LEVEL_MAIN },+ { "execproducer", "PRODUCER", PERSON, LEVEL_MAIN },+ { "writer", "AUTHOR", PERSON, LEVEL_MAIN }, { "redactor", "REDACTOR", PERSON, LEVEL_MAIN }, { "annotator", "ANNOTATOR", PERSON, LEVEL_MAIN }, { "commentator", "COMMENTATOR", PERSON, LEVEL_MAIN }, { "translator", "TRANSLATOR", PERSON, LEVEL_MAIN },- { "title", "TITLE", SIMPLE, LEVEL_MAIN },- { "subtitle", "SUBTITLE", SIMPLE, LEVEL_MAIN },- { "titleaddon", "?titleaddon?", SIMPLE, LEVEL_MAIN }, /*WRONG*/- { "journal", "TITLE", SIMPLE, LEVEL_HOST },- { "journaltitle", "TITLE", SIMPLE, LEVEL_HOST },- { "journalsubtitle", "SUBTITLE", SIMPLE, LEVEL_HOST },+ { "title", "TITLE", TITLE, LEVEL_MAIN },+ { "subtitle", "SUBTITLE", TITLE, LEVEL_MAIN },+ { "titleaddon", "TITLEADDON", TITLE, LEVEL_MAIN },+ { "journal", "TITLE", TITLE, LEVEL_HOST },+ { "journaltitle", "TITLE", TITLE, LEVEL_HOST },+ { "journalsubtitle", "SUBTITLE", TITLE, LEVEL_HOST }, { "shortjournal", "SHORTTITLE", SIMPLE, LEVEL_HOST },- { "issuetitle", "TITLE", SIMPLE, LEVEL_SERIES }, /*WRONG*/- { "issuesubtitle", "SUBTITLE", SIMPLE, LEVEL_SERIES }, /*WRONG*/+ { "issuetitle", "TITLE", TITLE, LEVEL_SERIES }, /*WRONG*/+ { "issuesubtitle", "SUBTITLE", TITLE, LEVEL_SERIES }, /*WRONG*/ { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN }, { "origlanguage", "LANGUAGE", SIMPLE, LEVEL_ORIG }, { "origyear", "YEAR", SIMPLE, LEVEL_ORIG }, { "origtitle", "TITLE", SIMPLE, LEVEL_ORIG },- { "origlocation", "LOCATION", SIMPLE, LEVEL_ORIG },+ { "origlocation", "ADDRESS", SIMPLE, LEVEL_ORIG }, { "origpublisher", "PUBLISHER", SIMPLE, LEVEL_ORIG }, { "series", "TITLE", SIMPLE, LEVEL_SERIES }, { "volume", "VOLUME", SIMPLE, LEVEL_MAIN },@@ -66,38 +77,50 @@ { "urlyear", "?urlyear?", SIMPLE, LEVEL_MAIN }, /* WRONG */ { "address", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|ARTICLE", ALWAYS, LEVEL_MAIN },- { " ", "ISSUANCE|continuing", ALWAYS, LEVEL_HOST },- { " ", "RESOURCE|text", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|journal article", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|periodical", ALWAYS, LEVEL_HOST }+ { "", "INTERNAL_TYPE|ARTICLE", ALWAYS, LEVEL_MAIN },+ { "", "ISSUANCE|continuing", ALWAYS, LEVEL_HOST },+ { "", "RESOURCE|text", ALWAYS, LEVEL_MAIN },+ { "", "NGENRE|journal article", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|periodical", ALWAYS, LEVEL_HOST } }; /* Book */ static lookups book[] = { { "author", "AUTHOR", PERSON, LEVEL_MAIN },- { "editor", "EDITOR", PERSON, LEVEL_MAIN },+ { "editor", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editora", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editorb", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editorc", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editortype", "", BLT_SKIP, LEVEL_MAIN },+ { "editoratype", "", BLT_SKIP, LEVEL_MAIN },+ { "editorbtype", "", BLT_SKIP, LEVEL_MAIN },+ { "editorctype", "", BLT_SKIP, LEVEL_MAIN },+ { "director", "DIRECTOR", PERSON, LEVEL_MAIN },+ { "producer", "PRODUCER", PERSON, LEVEL_MAIN },+ { "execproducer", "PRODUCER", PERSON, LEVEL_MAIN },+ { "writer", "AUTHOR", PERSON, LEVEL_MAIN }, { "redactor", "REDACTOR", PERSON, LEVEL_MAIN }, { "annotator", "ANNOTATOR", PERSON, LEVEL_MAIN }, { "commentator", "COMMENTATOR", PERSON, LEVEL_MAIN }, { "translator", "TRANSLATOR", PERSON, LEVEL_MAIN },- { "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", "?titleaddon?", SIMPLE, LEVEL_MAIN }, /*WRONG*/- { "maintitle", "TITLE", SIMPLE, LEVEL_HOST },- { "mainsubtitle", "SUBTITLE", SIMPLE, LEVEL_HOST },- { "maintitleaddon", "?maintitleaddon?",SIMPLE, LEVEL_HOST }, /*WRONG*/+ { "introduction", "INTROAUTHOR", PERSON, LEVEL_MAIN },+ { "foreward", "INTROAUTHOR", PERSON, LEVEL_MAIN },+ { "afterward", "AFTERAUTHOR", PERSON, LEVEL_MAIN },+ { "title", "TITLE", TITLE, LEVEL_MAIN },+ { "subtitle", "SUBTITLE", TITLE, LEVEL_MAIN },+ { "titleaddon", "TITLEADDON", TITLE, LEVEL_MAIN },+ { "maintitle", "TITLE", TITLE, LEVEL_HOST },+ { "mainsubtitle", "SUBTITLE", TITLE, LEVEL_HOST },+ { "maintitleaddon", "TITLEADDON", TITLE, LEVEL_HOST }, { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN }, { "year", "YEAR", SIMPLE, LEVEL_MAIN }, { "month", "MONTH", SIMPLE, LEVEL_MAIN },+ { "date", "DATE", SIMPLE, LEVEL_MAIN }, /*WRONG*/ { "origlanguage", "LANGUAGE", SIMPLE, LEVEL_ORIG }, { "origyear", "YEAR", SIMPLE, LEVEL_ORIG }, { "origtitle", "TITLE", SIMPLE, LEVEL_ORIG },- { "origlocation", "LOCATION", SIMPLE, LEVEL_ORIG },+ { "origlocation", "ADDRESS", SIMPLE, LEVEL_ORIG }, { "origpublisher", "PUBLISHER", SIMPLE, LEVEL_ORIG }, { "volume", "VOLUME", SIMPLE, LEVEL_HOST }, { "part", "PART", SIMPLE, LEVEL_HOST },@@ -109,7 +132,7 @@ { "annote", "NOTES", SIMPLE, LEVEL_MAIN }, { "annotation", "NOTES", SIMPLE, LEVEL_MAIN }, { "publisher", "PUBLISHER", SIMPLE, LEVEL_MAIN },- { "location", "LOCATION", SIMPLE, LEVEL_MAIN },+ { "location", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "isbn", "ISBN", SIMPLE, LEVEL_MAIN }, { "chapter", "CHAPTER", SIMPLE, LEVEL_MAIN }, { "pages", "?pages?", SIMPLE, LEVEL_MAIN }, /* WRONG */@@ -125,30 +148,42 @@ { "urlyear", "?urlyear?", SIMPLE, LEVEL_MAIN }, { "address", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|BOOK", ALWAYS, LEVEL_MAIN },- { " ", "RESOURCE|text",ALWAYS, LEVEL_MAIN },- { " ", "ISSUANCE|monographic", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|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 } }; /* Booklet */ static lookups booklet[] = { { "author", "AUTHOR", PERSON, LEVEL_MAIN },- { "editor", "EDITOR", PERSON, LEVEL_MAIN },- { "title", "TITLE", SIMPLE, LEVEL_MAIN },- { "subtitle", "SUBTITLE", SIMPLE, LEVEL_MAIN },- { "titleaddon", "?titleaddon?", SIMPLE, LEVEL_MAIN }, /*WRONG*/+ { "editor", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editora", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editorb", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editorc", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editortype", "", BLT_SKIP, LEVEL_MAIN },+ { "editoratype", "", BLT_SKIP, LEVEL_MAIN },+ { "editorbtype", "", BLT_SKIP, LEVEL_MAIN },+ { "editorctype", "", BLT_SKIP, LEVEL_MAIN },+ { "director", "DIRECTOR", PERSON, LEVEL_MAIN },+ { "producer", "PRODUCER", PERSON, LEVEL_MAIN },+ { "execproducer", "PRODUCER", PERSON, LEVEL_MAIN },+ { "writer", "AUTHOR", PERSON, LEVEL_MAIN },+ { "title", "TITLE", TITLE, LEVEL_MAIN },+ { "subtitle", "SUBTITLE", TITLE, LEVEL_MAIN },+ { "titleaddon", "TITLEADDON", TITLE, LEVEL_MAIN }, { "howpublished", "", HOWPUBLISHED, LEVEL_MAIN }, { "year", "YEAR", SIMPLE, LEVEL_MAIN }, { "month", "MONTH", SIMPLE, LEVEL_MAIN },+ { "date", "DATE", SIMPLE, LEVEL_MAIN }, /*WRONG*/ { "language", "LANGUAGE", 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 },+ { "location", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "chapter", "CHAPTER", SIMPLE, LEVEL_MAIN }, { "pages", "?pages?", SIMPLE, LEVEL_MAIN }, /* WRONG */ { "pagetotal", "?pagetotal?", SIMPLE, LEVEL_MAIN },@@ -163,46 +198,58 @@ { "urlyear", "?urlyear?", SIMPLE, LEVEL_MAIN }, { "address", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|BOOK", ALWAYS, LEVEL_MAIN },- { " ", "RESOURCE|text",ALWAYS, LEVEL_MAIN },- { " ", "ISSUANCE|monographic", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|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 } }; static lookups collection[] = {- { "editor", "EDITOR", PERSON, LEVEL_MAIN },+ { "editor", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editora", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editorb", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editorc", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editortype", "", BLT_SKIP, LEVEL_MAIN },+ { "editoratype", "", BLT_SKIP, LEVEL_MAIN },+ { "editorbtype", "", BLT_SKIP, LEVEL_MAIN },+ { "editorctype", "", BLT_SKIP, LEVEL_MAIN },+ { "director", "DIRECTOR", PERSON, LEVEL_MAIN },+ { "producer", "PRODUCER", PERSON, LEVEL_MAIN },+ { "execproducer", "PRODUCER", PERSON, LEVEL_MAIN },+ { "writer", "AUTHOR", PERSON, LEVEL_MAIN }, { "redactor", "REDACTOR", PERSON, LEVEL_MAIN }, { "annotator", "ANNOTATOR", PERSON, LEVEL_MAIN }, { "commentator", "COMMENTATOR", PERSON, LEVEL_MAIN }, { "translator", "TRANSLATOR", PERSON, LEVEL_MAIN }, { "year", "YEAR", SIMPLE, LEVEL_MAIN }, { "month", "MONTH", SIMPLE, LEVEL_MAIN },- { "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", "?titleaddon?", SIMPLE, LEVEL_MAIN }, /*WRONG*/- { "maintitle", "TITLE", SIMPLE, LEVEL_HOST },- { "mainsubtitle", "SUBTITLE", SIMPLE, LEVEL_HOST },- { "maintitleaddon", "?maintitleaddon?", SIMPLE, LEVEL_HOST }, /*WRONG*/+ { "date", "DATE", SIMPLE, LEVEL_MAIN }, /*WRONG*/+ { "introduction", "INTROAUTHOR", PERSON, LEVEL_MAIN },+ { "foreward", "INTROAUTHOR", PERSON, LEVEL_MAIN },+ { "afterward", "AFTERAUTHOR", PERSON, LEVEL_MAIN },+ { "title", "TITLE", TITLE, LEVEL_MAIN },+ { "subtitle", "SUBTITLE", TITLE, LEVEL_MAIN },+ { "titleaddon", "TITLEADDON", TITLE, LEVEL_MAIN },+ { "maintitle", "TITLE", TITLE, LEVEL_HOST },+ { "mainsubtitle", "SUBTITLE", TITLE, LEVEL_HOST },+ { "maintitleaddon", "TITLEADDON", TITLE, LEVEL_HOST }, { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN }, { "origlanguage", "LANGUAGE", SIMPLE, LEVEL_ORIG }, { "origyear", "YEAR", SIMPLE, LEVEL_ORIG }, { "origtitle", "TITLE", SIMPLE, LEVEL_ORIG },- { "origlocation", "LOCATION", SIMPLE, LEVEL_ORIG },+ { "origlocation", "ADDRESS", SIMPLE, LEVEL_ORIG }, { "origpublisher", "PUBLISHER", SIMPLE, LEVEL_ORIG }, { "volume", "VOLUME", SIMPLE, LEVEL_HOST }, { "part", "PART", SIMPLE, LEVEL_HOST }, { "edition", "EDITION", SIMPLE, LEVEL_MAIN }, { "volumes", "NUMVOLUMES", SIMPLE, LEVEL_HOST },- { "series", "?series?", SIMPLE, LEVEL_HOST }, /* WRONG */+ { "series", "?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 }, { "publisher", "PUBLISHER", SIMPLE, LEVEL_MAIN },- { "location", "LOCATION", SIMPLE, LEVEL_MAIN },+ { "location", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "isbn", "ISBN", SIMPLE, LEVEL_MAIN }, { "chapter", "CHAPTER", SIMPLE, LEVEL_MAIN }, { "pages", "?pages?", SIMPLE, LEVEL_MAIN }, /* WRONG */@@ -218,41 +265,53 @@ { "urlyear", "?urlyear?", SIMPLE, LEVEL_MAIN }, { "address", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|BOOK", ALWAYS, LEVEL_MAIN },- { " ", "RESOURCE|text",ALWAYS, LEVEL_MAIN },- { " ", "ISSUANCE|monographic", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|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 } }; /* Part of a book (e.g. chapter or section) */ static lookups inbook[] = { { "author", "AUTHOR", PERSON, LEVEL_MAIN },- { "editor", "EDITOR", PERSON, LEVEL_HOST },+ { "editor", "EDITOR", BLT_EDITOR, LEVEL_HOST },+ { "editora", "EDITOR", BLT_EDITOR, LEVEL_HOST },+ { "editorb", "EDITOR", BLT_EDITOR, LEVEL_HOST },+ { "editorc", "EDITOR", BLT_EDITOR, LEVEL_HOST },+ { "editortype", "", BLT_SKIP, LEVEL_HOST },+ { "editoratype", "", BLT_SKIP, LEVEL_HOST },+ { "editorbtype", "", BLT_SKIP, LEVEL_HOST },+ { "editorctype", "", BLT_SKIP, LEVEL_HOST },+ { "director", "DIRECTOR", PERSON, LEVEL_HOST },+ { "producer", "PRODUCER", PERSON, LEVEL_HOST },+ { "execproducer", "PRODUCER", PERSON, LEVEL_HOST },+ { "writer", "AUTHOR", PERSON, LEVEL_HOST }, { "redactor", "REDACTOR", PERSON, LEVEL_HOST }, { "annotator", "ANNOTATOR", PERSON, LEVEL_HOST }, { "commentator", "COMMENTATOR", PERSON, LEVEL_HOST }, { "translator", "TRANSLATOR", PERSON, LEVEL_HOST }, { "year", "YEAR", SIMPLE, LEVEL_MAIN }, { "month", "MONTH", SIMPLE, LEVEL_MAIN },- { "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", "?titleaddon?", SIMPLE, LEVEL_MAIN }, /*WRONG*/- { "maintitle", "TITLE", SIMPLE, LEVEL_MAIN },- { "mainsubtitle", "SUBTITLE", SIMPLE, LEVEL_MAIN },- { "maintitleaddon", "?maintitleaddon?", SIMPLE, LEVEL_MAIN }, /*WRONG*/- { "booktitle", "TITLE", SIMPLE, LEVEL_HOST },- { "booksubtitle", "SUBTITLE", SIMPLE, LEVEL_HOST },- { "booktitleaddon", "?booktitleaddon?", SIMPLE, LEVEL_HOST },+ { "date", "DATE", SIMPLE, LEVEL_MAIN }, /*WRONG*/+ { "introduction", "INTROAUTHOR", PERSON, LEVEL_HOST },+ { "foreward", "INTROAUTHOR", PERSON, LEVEL_HOST },+ { "afterward", "AFTERAUTHOR", PERSON, LEVEL_HOST },+ { "title", "TITLE", TITLE, LEVEL_MAIN },+ { "subtitle", "SUBTITLE", TITLE, LEVEL_MAIN },+ { "titleaddon", "TITLEADDON", TITLE, LEVEL_MAIN },+ { "booktitle", "TITLE", TITLE, LEVEL_HOST },+ { "booksubtitle", "SUBTITLE", TITLE, LEVEL_HOST },+ { "booktitleaddon", "TITLEADDON", TITLE, LEVEL_HOST }, { "bookauthor", "AUTHOR", PERSON, LEVEL_HOST },+ { "maintitle", "TITLE", TITLE, LEVEL_SERIES },+ { "mainsubtitle", "SUBTITLE", TITLE, LEVEL_SERIES },+ { "maintitleaddon", "TITLEADDON", TITLE, LEVEL_SERIES }, { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN }, { "origlanguage", "LANGUAGE", SIMPLE, LEVEL_ORIG }, { "origyear", "YEAR", SIMPLE, LEVEL_ORIG }, { "origtitle", "TITLE", SIMPLE, LEVEL_ORIG },- { "origlocation", "LOCATION", SIMPLE, LEVEL_ORIG },+ { "origlocation", "ADDRESS", SIMPLE, LEVEL_ORIG }, { "origpublisher", "PUBLISHER", SIMPLE, LEVEL_ORIG }, { "volume", "VOLUME", SIMPLE, LEVEL_MAIN }, { "pages", "PAGES", PAGES, LEVEL_MAIN },@@ -265,7 +324,7 @@ { "annote", "NOTES", SIMPLE, LEVEL_MAIN }, { "annotation", "NOTES", SIMPLE, LEVEL_MAIN }, { "publisher", "PUBLISHER", SIMPLE, LEVEL_MAIN },- { "location", "LOCATION", SIMPLE, LEVEL_MAIN },+ { "location", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "isbn", "ISBN", SIMPLE, LEVEL_HOST }, { "chapter", "CHAPTER", SIMPLE, LEVEL_MAIN }, { "addendum", "?addendum?", SIMPLE, LEVEL_MAIN },@@ -279,11 +338,11 @@ { "urlyear", "?urlyear?", SIMPLE, LEVEL_MAIN }, { "address", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|INBOOK", ALWAYS, LEVEL_MAIN },- { " ", "RESOURCE|text",ALWAYS, LEVEL_MAIN },- { " ", "ISSUANCE|monographic", ALWAYS, LEVEL_HOST },- { " ", "GENRE|book chapter", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|book", ALWAYS, LEVEL_HOST }+ { "", "INTERNAL_TYPE|INBOOK", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|text",ALWAYS, LEVEL_MAIN },+ { "", "ISSUANCE|monographic", ALWAYS, LEVEL_HOST },+ { "", "NGENRE|book chapter", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|book", ALWAYS, LEVEL_HOST } }; /* incollection */@@ -293,24 +352,35 @@ { "author", "AUTHOR", PERSON, LEVEL_MAIN }, { "year", "YEAR", SIMPLE, LEVEL_MAIN }, { "month", "MONTH", SIMPLE, LEVEL_MAIN },- { "title", "TITLE", SIMPLE, LEVEL_MAIN },- { "subtitle", "SUBTITLE", SIMPLE, LEVEL_MAIN },- { "titleaddon", "?titleaddon?", SIMPLE, LEVEL_MAIN }, /*WRONG*/+ { "date", "DATE", SIMPLE, LEVEL_MAIN }, /*WRONG*/+ { "title", "TITLE", TITLE, LEVEL_MAIN },+ { "subtitle", "SUBTITLE", TITLE, LEVEL_MAIN },+ { "titleaddon", "TITLEADDON", TITLE, LEVEL_MAIN }, { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN }, { "edition", "EDITION", SIMPLE, LEVEL_MAIN }, { "number", "NUMBER", SIMPLE, LEVEL_MAIN }, { "note", "NOTES", SIMPLE, LEVEL_MAIN }, { "annote", "NOTES", SIMPLE, LEVEL_MAIN }, { "annotation", "NOTES", SIMPLE, LEVEL_MAIN },-- { "introduction", "?introduction?",SIMPLE, LEVEL_HOST }, /*WRONG*/- { "foreward", "?foreward?", SIMPLE, LEVEL_HOST }, /*WRONG*/- { "afterward", "?afterward?", SIMPLE, LEVEL_HOST }, /*WRONG*/+ { "introduction", "INTROAUTHOR", PERSON, LEVEL_HOST },+ { "foreward", "INTROAUTHOR", PERSON, LEVEL_HOST },+ { "afterward", "AFTERAUTHOR", PERSON, LEVEL_HOST }, { "bookauthor", "AUTHOR", PERSON, LEVEL_HOST },- { "booktitle", "TITLE", SIMPLE, LEVEL_HOST },- { "booksubtitle", "SUBTITLE", SIMPLE, LEVEL_HOST },- { "booktitleaddon", "?booktitleaddon?",SIMPLE, LEVEL_HOST },- { "editor", "EDITOR", PERSON, LEVEL_HOST },+ { "booktitle", "TITLE", TITLE, LEVEL_HOST },+ { "booksubtitle", "SUBTITLE", TITLE, LEVEL_HOST },+ { "booktitleaddon", "TITLEADDON", TITLE, LEVEL_HOST },+ { "editor", "EDITOR", BLT_EDITOR, LEVEL_HOST },+ { "editora", "EDITOR", BLT_EDITOR, LEVEL_HOST },+ { "editorb", "EDITOR", BLT_EDITOR, LEVEL_HOST },+ { "editorc", "EDITOR", BLT_EDITOR, LEVEL_HOST },+ { "editortype", "", BLT_SKIP, LEVEL_HOST },+ { "editoratype", "", BLT_SKIP, LEVEL_HOST },+ { "editorbtype", "", BLT_SKIP, LEVEL_HOST },+ { "editorctype", "", BLT_SKIP, LEVEL_HOST },+ { "director", "DIRECTOR", PERSON, LEVEL_HOST },+ { "producer", "PRODUCER", PERSON, LEVEL_HOST },+ { "execproducer", "PRODUCER", PERSON, LEVEL_HOST },+ { "writer", "AUTHOR", PERSON, LEVEL_HOST }, { "redactor", "REDACTOR", PERSON, LEVEL_HOST }, { "annotator", "ANNOTATOR", PERSON, LEVEL_HOST }, { "commentator", "COMMENTATOR", PERSON, LEVEL_HOST },@@ -319,20 +389,20 @@ { "part", "PART", SIMPLE, LEVEL_HOST }, { "volumes", "NUMVOLUMES", SIMPLE, LEVEL_HOST }, - { "maintitle", "TITLE", SIMPLE, LEVEL_HOST+1 },- { "mainsubtitle", "SUBTITLE", SIMPLE, LEVEL_HOST+1 },- { "maintitleaddon", "?maintitleaddon?", SIMPLE, LEVEL_HOST+1 }, /*WRONG*/+ { "maintitle", "TITLE", TITLE, LEVEL_SERIES },+ { "mainsubtitle", "SUBTITLE", TITLE, LEVEL_SERIES },+ { "maintitleaddon", "TITLEADDON", TITLE, LEVEL_SERIES }, { "series", "TITLE", SIMPLE, LEVEL_HOST+2 }, /* WRONG */ { "origlanguage", "LANGUAGE", SIMPLE, LEVEL_ORIG }, { "origyear", "YEAR", SIMPLE, LEVEL_ORIG }, { "origtitle", "TITLE", SIMPLE, LEVEL_ORIG },- { "origlocation", "LOCATION", SIMPLE, LEVEL_ORIG },+ { "origlocation", "ADDRESS", SIMPLE, LEVEL_ORIG }, { "origpublisher", "PUBLISHER", SIMPLE, LEVEL_ORIG }, { "publisher", "PUBLISHER", SIMPLE, LEVEL_HOST },- { "location", "LOCATION", SIMPLE, LEVEL_HOST },+ { "location", "ADDRESS", SIMPLE, LEVEL_HOST }, { "isbn", "ISBN", SIMPLE, LEVEL_MAIN }, { "chapter", "CHAPTER", SIMPLE, LEVEL_MAIN }, { "pages", "PAGES", PAGES, LEVEL_MAIN }, /* WRONG */@@ -347,17 +417,28 @@ { "urlyear", "?urlyear?", SIMPLE, LEVEL_MAIN }, { "address", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|INCOLLECTION", ALWAYS, LEVEL_MAIN },- { " ", "RESOURCE|text",ALWAYS, LEVEL_MAIN },- { " ", "ISSUANCE|monographic", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|collection", ALWAYS, LEVEL_HOST }+ { "", "INTERNAL_TYPE|INCOLLECTION", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|text",ALWAYS, LEVEL_MAIN },+ { "", "ISSUANCE|monographic", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|collection", ALWAYS, LEVEL_HOST } }; /* inproceedings */ static lookups inproceedings[] = { { "author", "AUTHOR", PERSON, LEVEL_MAIN },- { "editor", "EDITOR", PERSON, LEVEL_HOST },+ { "editor", "EDITOR", BLT_EDITOR, LEVEL_HOST },+ { "editora", "EDITOR", BLT_EDITOR, LEVEL_HOST },+ { "editorb", "EDITOR", BLT_EDITOR, LEVEL_HOST },+ { "editorc", "EDITOR", BLT_EDITOR, LEVEL_HOST },+ { "editortype", "", BLT_SKIP, LEVEL_HOST },+ { "editoratype", "", BLT_SKIP, LEVEL_HOST },+ { "editorbtype", "", BLT_SKIP, LEVEL_HOST },+ { "editorctype", "", BLT_SKIP, LEVEL_HOST },+ { "director", "DIRECTOR", PERSON, LEVEL_HOST },+ { "producer", "PRODUCER", PERSON, LEVEL_HOST },+ { "execproducer", "PRODUCER", PERSON, LEVEL_HOST },+ { "writer", "AUTHOR", PERSON, LEVEL_HOST }, { "redactor", "REDACTOR", PERSON, LEVEL_HOST }, { "annotator", "ANNOTATOR", PERSON, LEVEL_HOST }, { "commentator", "COMMENTATOR", PERSON, LEVEL_HOST },@@ -365,19 +446,24 @@ { "eventtitle", "EVENT:CONF", SIMPLE, LEVEL_MAIN }, { "year", "YEAR", SIMPLE, LEVEL_MAIN }, { "month", "MONTH", SIMPLE, LEVEL_MAIN },- { "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", "?titleaddon?", SIMPLE, LEVEL_MAIN }, /*WRONG*/- { "booktitle", "TITLE", SIMPLE, LEVEL_HOST },- { "booksubtitle", "SUBTITLE", SIMPLE, LEVEL_HOST },- { "booktitleaddon", "?booktitleaddon?", SIMPLE, LEVEL_HOST }, /*WRONG*/- { "maintitle", "TITLE", SIMPLE, LEVEL_HOST+1 },- { "mainsubtitle", "SUBTITLE", SIMPLE, LEVEL_HOST+1 },- { "maintitleaddon", "?maintitleaddon?", SIMPLE, LEVEL_HOST+1 }, /*WRONG*/+ { "date", "DATE", SIMPLE, LEVEL_MAIN }, /*WRONG*/+ { "introduction", "INTROAUTHOR", PERSON, LEVEL_HOST },+ { "foreward", "INTROAUTHOR", PERSON, LEVEL_HOST },+ { "afterward", "AFTERAUTHOR", PERSON, LEVEL_HOST },+ { "title", "TITLE", TITLE, LEVEL_MAIN },+ { "subtitle", "SUBTITLE", TITLE, LEVEL_MAIN },+ { "titleaddon", "TITLEADDON", TITLE, LEVEL_MAIN },++ { "booktitle", "TITLE", TITLE, LEVEL_HOST },+ { "booksubtitle", "SUBTITLE", TITLE, LEVEL_HOST },+ { "booktitleaddon", "TITLEADDON", TITLE, LEVEL_HOST },++ { "maintitle", "TITLE", TITLE, LEVEL_SERIES },+ { "mainsubtitle", "SUBTITLE", TITLE, LEVEL_SERIES },+ { "maintitleaddon", "TITLEADDON", TITLE, LEVEL_SERIES },+ { "series", "TITLE", SIMPLE, LEVEL_HOST+2 },+ { "venue", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "organization", "ORGANIZER:CORP", SIMPLE, LEVEL_MAIN }, { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN },@@ -391,7 +477,7 @@ { "annote", "NOTES", SIMPLE, LEVEL_MAIN }, { "annotation", "NOTES", SIMPLE, LEVEL_MAIN }, { "publisher", "PUBLISHER", SIMPLE, LEVEL_HOST },- { "location", "LOCATION", SIMPLE, LEVEL_HOST },+ { "location", "ADDRESS", SIMPLE, LEVEL_HOST }, { "isbn", "ISBN", SIMPLE, LEVEL_MAIN }, { "chapter", "CHAPTER", SIMPLE, LEVEL_MAIN }, { "pages", "PAGES", PAGES, LEVEL_MAIN }, /* WRONG */@@ -406,39 +492,51 @@ { "urlyear", "?urlyear?", SIMPLE, LEVEL_MAIN }, { "address", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|INPROCEEDINGS", ALWAYS, LEVEL_MAIN },- { " ", "RESOURCE|text",ALWAYS, LEVEL_MAIN },- { " ", "ISSUANCE|monographic", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|conference publication", ALWAYS, LEVEL_HOST }+ { "", "INTERNAL_TYPE|INPROCEEDINGS", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|text",ALWAYS, LEVEL_MAIN },+ { "", "ISSUANCE|monographic", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|conference publication", ALWAYS, LEVEL_HOST } }; static lookups manual[] = { { "author", "AUTHOR", PERSON, LEVEL_MAIN },- { "editor", "EDITOR", PERSON, LEVEL_MAIN },+ { "editor", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editora", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editorb", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editorc", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editortype", "", BLT_SKIP, LEVEL_MAIN },+ { "editoratype", "", BLT_SKIP, LEVEL_MAIN },+ { "editorbtype", "", BLT_SKIP, LEVEL_MAIN },+ { "editorctype", "", BLT_SKIP, LEVEL_MAIN },+ { "director", "DIRECTOR", PERSON, LEVEL_MAIN },+ { "producer", "PRODUCER", PERSON, LEVEL_MAIN },+ { "execproducer", "PRODUCER", PERSON, LEVEL_MAIN },+ { "writer", "AUTHOR", PERSON, LEVEL_MAIN }, { "redactor", "REDACTOR", PERSON, LEVEL_MAIN }, { "annotator", "ANNOTATOR", PERSON, LEVEL_MAIN }, { "commentator", "COMMENTATOR", PERSON, LEVEL_MAIN }, { "translator", "TRANSLATOR", PERSON, LEVEL_MAIN }, { "year", "YEAR", SIMPLE, LEVEL_MAIN }, { "month", "MONTH", SIMPLE, LEVEL_MAIN },- { "introduction", "?????", SIMPLE, LEVEL_MAIN }, /*WRONG*/- { "foreward", "?????", SIMPLE, LEVEL_MAIN }, /*WRONG*/- { "afterward", "?????", SIMPLE, LEVEL_MAIN }, /*WRONG*/- { "title", "TITLE", SIMPLE, LEVEL_MAIN },- { "subtitle", "SUBTITLE", SIMPLE, LEVEL_MAIN },- { "titleaddon", "?????", SIMPLE, LEVEL_MAIN }, /*WRONG*/+ { "date", "DATE", SIMPLE, LEVEL_MAIN }, /*WRONG*/+ { "introduction", "INTROAUTHOR", PERSON, LEVEL_MAIN },+ { "foreward", "INTROAUTHOR", PERSON, LEVEL_MAIN },+ { "afterward", "AFTERAUTHOR", PERSON, LEVEL_MAIN },+ { "title", "TITLE", TITLE, LEVEL_MAIN },+ { "subtitle", "SUBTITLE", TITLE, LEVEL_MAIN },+ { "titleaddon", "TITLEADDON", TITLE, LEVEL_MAIN }, { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN }, { "edition", "EDITION", SIMPLE, LEVEL_MAIN },- { "version", "???????", SIMPLE, LEVEL_MAIN },+ { "version", "???????", SIMPLE, LEVEL_MAIN }, /*WRONG*/ { "type", "GENRE", BIBTEX_GENRE, LEVEL_MAIN },- { "series", "?????", SIMPLE, LEVEL_HOST }, /* WRONG */+ { "series", "TITLE", SIMPLE, LEVEL_HOST }, { "number", "NUMBER", SIMPLE, LEVEL_MAIN }, { "note", "NOTES", SIMPLE, LEVEL_MAIN }, { "annote", "NOTES", SIMPLE, LEVEL_MAIN }, { "annotation", "NOTES", SIMPLE, LEVEL_MAIN }, { "organization", "ORGANIZER:CORP", SIMPLE, LEVEL_MAIN }, { "publisher", "PUBLISHER", SIMPLE, LEVEL_MAIN },- { "location", "LOCATION", SIMPLE, LEVEL_MAIN },+ { "location", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "isbn", "ISBN", SIMPLE, LEVEL_MAIN }, { "chapter", "CHAPTER", SIMPLE, LEVEL_MAIN }, { "pages", "?????????", SIMPLE, LEVEL_MAIN }, /* WRONG */@@ -454,20 +552,32 @@ { "urlyear", "?????????", SIMPLE, LEVEL_MAIN }, { "address", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|REPORT", ALWAYS, LEVEL_MAIN },- { " ", "RESOURCE|text", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|instruction", ALWAYS, LEVEL_MAIN }+ { "", "INTERNAL_TYPE|REPORT", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|text", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|instruction", ALWAYS, LEVEL_MAIN } }; static lookups misc[] = { { "author", "AUTHOR", PERSON, LEVEL_MAIN },- { "editor", "EDITOR", PERSON, LEVEL_MAIN },- { "title", "TITLE", SIMPLE, LEVEL_MAIN },- { "subtitle", "SUBTITLE", SIMPLE, LEVEL_MAIN },- { "titleaddon", "?????", SIMPLE, LEVEL_MAIN }, /*WRONG*/+ { "editor", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editora", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editorb", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editorc", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editortype", "", BLT_SKIP, LEVEL_MAIN },+ { "editoratype", "", BLT_SKIP, LEVEL_MAIN },+ { "editorbtype", "", BLT_SKIP, LEVEL_MAIN },+ { "editorctype", "", BLT_SKIP, LEVEL_MAIN },+ { "director", "DIRECTOR", PERSON, LEVEL_MAIN },+ { "producer", "PRODUCER", PERSON, LEVEL_MAIN },+ { "execproducer", "PRODUCER", PERSON, LEVEL_MAIN },+ { "writer", "AUTHOR", PERSON, LEVEL_MAIN },+ { "title", "TITLE", TITLE, LEVEL_MAIN },+ { "subtitle", "SUBTITLE", TITLE, LEVEL_MAIN },+ { "titleaddon", "TITLEADDON", TITLE, LEVEL_MAIN }, { "day", "DAY", SIMPLE, LEVEL_MAIN }, { "month", "MONTH", SIMPLE, LEVEL_MAIN }, { "year", "YEAR", SIMPLE, LEVEL_MAIN },+ { "date", "DATE", SIMPLE, LEVEL_MAIN }, /*WRONG*/ { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN }, { "howpublished", "", HOWPUBLISHED, LEVEL_MAIN }, { "version", "???????", SIMPLE, LEVEL_MAIN },@@ -477,7 +587,7 @@ { "annotation", "NOTES", SIMPLE, LEVEL_MAIN }, { "organization", "ORGANIZER:CORP",SIMPLE, LEVEL_MAIN }, { "publisher", "PUBLISHER", SIMPLE, LEVEL_MAIN },- { "location", "LOCATION", SIMPLE, LEVEL_MAIN },+ { "location", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "addendum", "?????????", SIMPLE, LEVEL_MAIN }, { "address", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "doi", "DOI", SIMPLE, LEVEL_MAIN },@@ -489,15 +599,26 @@ { "urlmonth", "?????????", SIMPLE, LEVEL_MAIN }, { "urlyear", "?????????", SIMPLE, LEVEL_MAIN }, { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|MISC", ALWAYS, LEVEL_MAIN },+ { "", "INTERNAL_TYPE|MISC", ALWAYS, LEVEL_MAIN }, }; static lookups online[] = { { "author", "AUTHOR", PERSON, LEVEL_MAIN },- { "editor", "EDITOR", PERSON, LEVEL_MAIN },- { "title", "TITLE", SIMPLE, LEVEL_MAIN },- { "subtitle", "SUBTITLE", SIMPLE, LEVEL_MAIN },- { "titleaddon", "?????", SIMPLE, LEVEL_MAIN }, /*WRONG*/+ { "editor", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editora", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editorb", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editorc", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editortype", "", BLT_SKIP, LEVEL_MAIN },+ { "editoratype", "", BLT_SKIP, LEVEL_MAIN },+ { "editorbtype", "", BLT_SKIP, LEVEL_MAIN },+ { "editorctype", "", BLT_SKIP, LEVEL_MAIN },+ { "director", "DIRECTOR", PERSON, LEVEL_MAIN },+ { "producer", "PRODUCER", PERSON, LEVEL_MAIN },+ { "execproducer", "PRODUCER", PERSON, LEVEL_MAIN },+ { "writer", "AUTHOR", PERSON, LEVEL_MAIN },+ { "title", "TITLE", TITLE, LEVEL_MAIN },+ { "subtitle", "SUBTITLE", TITLE, LEVEL_MAIN },+ { "titleaddon", "TITLEADDON", TITLE, LEVEL_MAIN }, { "date", "DATE", SIMPLE, LEVEL_MAIN }, { "day", "DAY", SIMPLE, LEVEL_MAIN }, { "month", "MONTH", SIMPLE, LEVEL_MAIN },@@ -510,7 +631,7 @@ { "annotation", "NOTES", SIMPLE, LEVEL_MAIN }, { "organization", "ORGANIZER:CORP", SIMPLE, LEVEL_MAIN }, { "publisher", "PUBLISHER", SIMPLE, LEVEL_MAIN },- { "location", "LOCATION", SIMPLE, LEVEL_MAIN },+ { "location", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "addendum", "?????????", SIMPLE, LEVEL_MAIN }, { "doi", "DOI", SIMPLE, LEVEL_MAIN }, { "eprint", "", BIBTEX_EPRINT, LEVEL_MAIN },@@ -522,16 +643,16 @@ { "urlyear", "?????????", SIMPLE, LEVEL_MAIN }, { "address", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN },- { " ", "RESOURCE|software, multimedia", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|web page", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|software, multimedia", ALWAYS, LEVEL_MAIN },+ { "", "NGENRE|web page", ALWAYS, LEVEL_MAIN }, }; static lookups patent[] = { { "author", "AUTHOR", PERSON, LEVEL_MAIN }, { "holder", "ASSIGNEE", PERSON, LEVEL_MAIN },- { "title", "TITLE", SIMPLE, LEVEL_MAIN },- { "subtitle", "SUBTITLE", SIMPLE, LEVEL_MAIN },- { "titleaddon", "?????", SIMPLE, LEVEL_MAIN }, /*WRONG*/+ { "title", "TITLE", TITLE, LEVEL_MAIN },+ { "subtitle", "SUBTITLE", TITLE, LEVEL_MAIN },+ { "titleaddon", "TITLEADDON", TITLE, LEVEL_MAIN }, { "date", "DATE", SIMPLE, LEVEL_MAIN }, { "day", "DAY", SIMPLE, LEVEL_MAIN }, { "month", "MONTH", SIMPLE, LEVEL_MAIN },@@ -542,7 +663,7 @@ { "annote", "NOTES", SIMPLE, LEVEL_MAIN }, { "annotation", "NOTES", SIMPLE, LEVEL_MAIN }, { "organization", "ORGANIZER:CORP", SIMPLE, LEVEL_MAIN },- { "location", "LOCATION", SIMPLE, LEVEL_MAIN },+ { "location", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "number", "NUMBER", SIMPLE, LEVEL_MAIN }, { "addendum", "?????????", SIMPLE, LEVEL_MAIN }, { "url", "", BIBTEX_URL, LEVEL_MAIN },@@ -552,21 +673,33 @@ { "urlyear", "?????????", SIMPLE, LEVEL_MAIN }, { "address", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN },- { " ", "RESOURCE|text", ALWAYS, LEVEL_MAIN },- { " ", "INTERNAL_TYPE|PATENT", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|patent", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|text", ALWAYS, LEVEL_MAIN },+ { "", "INTERNAL_TYPE|PATENT", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|patent", ALWAYS, LEVEL_MAIN }, }; /* * An entire issue of a periodical */ static lookups periodical[] = {- { "editor", "EDITOR", PERSON, LEVEL_MAIN },- { "title", "TITLE", SIMPLE, LEVEL_MAIN },- { "subtitle", "SUBTITLE", SIMPLE, LEVEL_MAIN },- { "titleaddon", "?????", SIMPLE, LEVEL_MAIN }, /*WRONG*/- { "issuetitle", "TITLE", SIMPLE, LEVEL_SERIES }, /*WRONG*/- { "issuesubtitle", "SUBTITLE", SIMPLE, LEVEL_SERIES }, /*WRONG*/+ { "editor", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editora", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editorb", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editorc", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editortype", "", BLT_SKIP, LEVEL_MAIN },+ { "editoratype", "", BLT_SKIP, LEVEL_MAIN },+ { "editorbtype", "", BLT_SKIP, LEVEL_MAIN },+ { "editorctype", "", BLT_SKIP, LEVEL_MAIN },+ { "director", "DIRECTOR", PERSON, LEVEL_MAIN },+ { "producer", "PRODUCER", PERSON, LEVEL_MAIN },+ { "execproducer", "PRODUCER", PERSON, LEVEL_MAIN },+ { "writer", "AUTHOR", PERSON, LEVEL_MAIN },+ { "title", "TITLE", TITLE, LEVEL_MAIN },+ { "subtitle", "SUBTITLE", TITLE, LEVEL_MAIN },+ { "titleaddon", "TITLEADDON", TITLE, LEVEL_MAIN },+ { "issuetitle", "TITLE", TITLE, LEVEL_HOST },+ { "issuesubtitle", "SUBTITLE", TITLE, LEVEL_HOST },+ { "issuetitleaddon", "TITLEADDON", TITLE, LEVEL_HOST }, { "series", "TITLE", SIMPLE, LEVEL_SERIES }, { "volume", "VOLUME", SIMPLE, LEVEL_MAIN }, { "number", "NUMBER", SIMPLE, LEVEL_MAIN },@@ -591,13 +724,24 @@ { "urlyear", "?????", SIMPLE, LEVEL_MAIN }, /* WRONG */ { "address", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "refnum", "REFNUM", SIMPLE, LEVEL_MAIN },- { " ", "ISSUANCE|continuing", ALWAYS, LEVEL_MAIN },- { " ", "RESOURCE|text", ALWAYS, LEVEL_MAIN },- { " ", "GENRE|periodical", ALWAYS, LEVEL_MAIN }+ { "", "ISSUANCE|continuing", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|text", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|periodical", ALWAYS, LEVEL_MAIN } }; static lookups proceedings[] = {- { "editor", "EDITOR", PERSON, LEVEL_MAIN },+ { "editor", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editora", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editorb", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editorc", "EDITOR", BLT_EDITOR, LEVEL_MAIN },+ { "editortype", "", BLT_SKIP, LEVEL_MAIN },+ { "editoratype", "", BLT_SKIP, LEVEL_MAIN },+ { "editorbtype", "", BLT_SKIP, LEVEL_MAIN },+ { "editorctype", "", BLT_SKIP, LEVEL_MAIN },+ { "director", "DIRECTOR", PERSON, LEVEL_MAIN },+ { "producer", "PRODUCER", PERSON, LEVEL_MAIN },+ { "execproducer", "PRODUCER", PERSON, LEVEL_MAIN },+ { "writer", "AUTHOR", PERSON, LEVEL_MAIN }, { "redactor", "REDACTOR", PERSON, LEVEL_MAIN }, { "annotator", "ANNOTATOR", PERSON, LEVEL_MAIN }, { "commentator", "COMMENTATOR", PERSON, LEVEL_MAIN },@@ -605,15 +749,16 @@ { "eventtitle", "EVENT:CONF", SIMPLE, LEVEL_MAIN }, { "year", "YEAR", SIMPLE, LEVEL_MAIN }, { "month", "MONTH", SIMPLE, LEVEL_MAIN },- { "introduction", "?????", SIMPLE, LEVEL_MAIN }, /*WRONG*/- { "foreward", "?????", SIMPLE, LEVEL_MAIN }, /*WRONG*/- { "afterward", "?????", SIMPLE, LEVEL_MAIN }, /*WRONG*/- { "title", "TITLE", SIMPLE, LEVEL_MAIN },- { "subtitle", "SUBTITLE", SIMPLE, LEVEL_MAIN },- { "titleaddon", "?????", SIMPLE, LEVEL_MAIN }, /*WRONG*/- { "maintitle", "TITLE", SIMPLE, LEVEL_HOST },- { "mainsubtitle", "SUBTITLE", SIMPLE, LEVEL_HOST },- { "maintitleaddon", "?????", SIMPLE, LEVEL_HOST }, /*WRONG*/+ { "date", "DATE", SIMPLE, LEVEL_MAIN }, /*WRONG*/+ { "introduction", "INTROAUTHOR", PERSON, LEVEL_MAIN },+ { "foreward", "INTROAUTHOR", PERSON, LEVEL_MAIN },+ { "afterward", "AFTERAUTHOR", PERSON, LEVEL_MAIN },+ { "title", "TITLE", TITLE, LEVEL_MAIN },+ { "subtitle", "SUBTITLE", TITLE, LEVEL_MAIN },+ { "titleaddon", "TITLEADDON", TITLE, LEVEL_MAIN },+ { "maintitle", "TITLE", TITLE, LEVEL_HOST },+ { "mainsubtitle", "SUBTITLE", TITLE, LEVEL_HOST },+ { "maintitleaddon", "TITLEADDON", TITLE, LEVEL_HOST }, { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN }, { "origlanguage", "LANGUAGE", SIMPLE, LEVEL_ORIG }, { "volume", "VOLUME", SIMPLE, LEVEL_HOST },@@ -627,7 +772,7 @@ { "annotation", "NOTES", SIMPLE, LEVEL_MAIN }, { "organization", "ORGANIZER:CORP",SIMPLE, LEVEL_MAIN }, { "publisher", "PUBLISHER", SIMPLE, LEVEL_MAIN },- { "location", "LOCATION", SIMPLE, LEVEL_MAIN },+ { "location", "ADDRESS", SIMPLE, LEVEL_MAIN }, { "isbn", "ISBN", SIMPLE, LEVEL_MAIN }, { "chapter", "CHAPTER", SIMPLE, LEVEL_MAIN }, { "pages", "?????????", SIMPLE, LEVEL_MAIN }, /* WRONG */@@ -643,84 +788,57 @@ { "urlyear", "?????????", 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|conference publication", ALWAYS, LEVEL_MAIN }+ { "", "INTERNAL_TYPE|BOOK", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|text", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|conference publication", ALWAYS, LEVEL_MAIN } }; /* Technical reports */ static lookups report[] = {- { "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 },- { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN },- { "number", "NUMBER", SIMPLE, LEVEL_MAIN },- { "note", "NOTES", SIMPLE, LEVEL_MAIN },- { "annote", "NOTES", SIMPLE, LEVEL_MAIN },- { "annotation", "NOTES", SIMPLE, LEVEL_MAIN },- { "version", "?????????", SIMPLE, LEVEL_MAIN },- { "location", "LOCATION", SIMPLE, LEVEL_MAIN },- { "isrn", "ISRN", SIMPLE, LEVEL_MAIN },- { "chapter", "CHAPTER", SIMPLE, LEVEL_MAIN },- { "pages", "?????????", SIMPLE, LEVEL_MAIN }, /* WRONG */- { "pagetotal", "?????????", SIMPLE, LEVEL_MAIN },- { "addendum", "?????????", SIMPLE, LEVEL_MAIN },- { "doi", "DOI", 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 },- { " ", "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", BIBTEX_GENRE, LEVEL_MAIN },- { "institution","DEGREEGRANTOR:ASIS",SIMPLE, LEVEL_MAIN },- { "school", "DEGREEGRANTOR:ASIS",SIMPLE, 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 },+ { "author", "AUTHOR", PERSON, LEVEL_MAIN },+ { "title", "TITLE", TITLE, LEVEL_MAIN },+ { "subtitle", "SUBTITLE", TITLE, LEVEL_MAIN },+ { "titleaddon", "TITLEADDON", TITLE, LEVEL_MAIN },+ { "type", "GENRE", BIBTEX_GENRE, LEVEL_MAIN },+ { "institution", "SPONSOR:ASIS", SIMPLE, LEVEL_MAIN },+ { "year", "YEAR", SIMPLE, LEVEL_MAIN },+ { "month", "MONTH", SIMPLE, LEVEL_MAIN },+ { "date", "DATE", SIMPLE, LEVEL_MAIN }, /*WRONG*/+ { "language", "LANGUAGE", SIMPLE, LEVEL_MAIN },+ { "number", "REPORTNUMBER", SIMPLE, LEVEL_MAIN },+ { "note", "NOTES", SIMPLE, LEVEL_MAIN },+ { "annote", "NOTES", SIMPLE, LEVEL_MAIN },+ { "annotation", "NOTES", SIMPLE, LEVEL_MAIN },+ { "version", "?????????", SIMPLE, LEVEL_MAIN },+ { "location", "ADDRESS", SIMPLE, LEVEL_MAIN },+ { "isrn", "ISRN", SIMPLE, LEVEL_MAIN },+ { "chapter", "CHAPTER", SIMPLE, LEVEL_MAIN },+ { "pages", "?????????", SIMPLE, LEVEL_MAIN }, /* WRONG */+ { "pagetotal", "?????????", SIMPLE, LEVEL_MAIN },+ { "addendum", "?????????", SIMPLE, LEVEL_MAIN },+ { "doi", "DOI", 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 },+ { "", "INTERNAL_TYPE|REPORT", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|text", ALWAYS, LEVEL_MAIN },+ { "", "GENRE|report", 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*/+ { "title", "TITLE", TITLE, LEVEL_MAIN },+ { "subtitle", "SUBTITLE", TITLE, LEVEL_MAIN },+ { "titleaddon", "TITLEADDON", TITLE, LEVEL_MAIN }, { "howpublished", "", HOWPUBLISHED, LEVEL_MAIN }, { "year", "YEAR", SIMPLE, LEVEL_MAIN }, { "month", "MONTH", SIMPLE, LEVEL_MAIN },@@ -737,69 +855,104 @@ { "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 }+ { "", "INTERNAL_TYPE|BOOK", ALWAYS, LEVEL_MAIN },+ { "", "RESOURCE|text",ALWAYS, LEVEL_MAIN },+ { "", "GENRE|unpublished",ALWAYS, LEVEL_MAIN } }; +static lookups thesis[] = {+ { "author", "AUTHOR", PERSON, LEVEL_MAIN },+ { "title", "TITLE", TITLE, LEVEL_MAIN },+ { "subtitle", "SUBTITLE", TITLE, LEVEL_MAIN },+ { "titleaddon", "TITLEADDON", TITLE, LEVEL_MAIN },+ { "year", "YEAR", SIMPLE, LEVEL_MAIN },+ { "month", "MONTH", SIMPLE, LEVEL_MAIN },+ { "day", "DAY", SIMPLE, LEVEL_MAIN },+ { "date", "DATE", SIMPLE, LEVEL_MAIN }, /*WRONG*/+ { "type", "", BLT_THESIS_TYPE, LEVEL_MAIN },+ { "institution", "DEGREEGRANTOR:ASIS", SIMPLE, LEVEL_MAIN },+ { "school", "DEGREEGRANTOR:ASIS", BLT_SCHOOL, 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", "ADDRESS", 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 },+};+ static lookups phdthesis[] = {- { "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 },- { "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 }+ { "author", "AUTHOR", PERSON, LEVEL_MAIN },+ { "title", "TITLE", TITLE, LEVEL_MAIN },+ { "subtitle", "SUBTITLE", TITLE, LEVEL_MAIN },+ { "titleaddon", "TITLEADDON", TITLE, LEVEL_MAIN },+ { "year", "YEAR", SIMPLE, LEVEL_MAIN },+ { "month", "MONTH", SIMPLE, LEVEL_MAIN },+ { "day", "DAY", SIMPLE, LEVEL_MAIN },+ { "date", "DATE", SIMPLE, LEVEL_MAIN }, /*WRONG*/+ { "type", "", BLT_THESIS_TYPE, LEVEL_MAIN },+ { "institution", "DEGREEGRANTOR:ASIS", SIMPLE, LEVEL_MAIN },+ { "school", "DEGREEGRANTOR:ASIS", BLT_SCHOOL, 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", "ADDRESS", 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 },+ { "", "NGENRE|Ph.D. thesis", DEFAULT, LEVEL_MAIN }, }; static lookups mastersthesis[] = {- { "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 },- { "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 },+ { "author", "AUTHOR", PERSON, LEVEL_MAIN },+ { "title", "TITLE", TITLE, LEVEL_MAIN },+ { "subtitle", "SUBTITLE", TITLE, LEVEL_MAIN },+ { "titleaddon", "TITLEADDON", TITLE, LEVEL_MAIN },+ { "year", "YEAR", SIMPLE, LEVEL_MAIN },+ { "month", "MONTH", SIMPLE, LEVEL_MAIN },+ { "day", "DAY", SIMPLE, LEVEL_MAIN },+ { "date", "DATE", SIMPLE, LEVEL_MAIN }, /*WRONG*/+ { "type", "", BLT_THESIS_TYPE, LEVEL_MAIN },+ { "institution", "DEGREEGRANTOR:ASIS", SIMPLE, LEVEL_MAIN },+ { "school", "DEGREEGRANTOR:ASIS", BLT_SCHOOL, 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", "ADDRESS", 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 },+ { "", "NGENRE|Masters thesis", DEFAULT, LEVEL_MAIN }, }; #define ORIG(a) ( &(a[0]) )
bibutils/charsets.c view
@@ -1,12 +1,11 @@ /* * charsets.h *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */- #include "charsets.h" charconvert adobeiso[] = {
bibutils/charsets.h view
@@ -1,9 +1,9 @@ /* * charsets.h *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef CHARSETS_H
bibutils/copacin.c view
@@ -1,9 +1,9 @@ /* * copacin.c *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Program and source code released under the GPL+ * Program and source code released under the GPL version 2 * */ #include <stdio.h>@@ -169,50 +169,80 @@ * * editors seem to be stuck in as authors with the tag "[Editor]" in it */-static void+static int copacin_addname( fields *info, char *tag, newstr *name, int level, list *asis, list *corps ) {- char *usetag = tag, editor[]="EDITOR", *p;- int comma = 0;- if ( strstr( name->data,"[Editor]" ) ) {- newstr_findreplace( name, "[Editor]", "" );- usetag = editor;+ char *usetag = tag, editor[]="EDITOR";+ newstr usename, *s;+ list tokens;+ int comma = 0, i;++ if ( list_find( asis, name->data ) !=-1 ||+ list_find( corps, name->data ) !=-1 ) {+ return name_add( info, tag, name->data, level, asis, corps ); }- p = skip_ws( name->data );- while ( *p && !is_ws( *p ) ) {- if ( *p==',' ) comma++;- p++;++ list_init( &tokens );+ newstr_init( &usename );++ list_tokenize( &tokens, name, ' ', 1 );+ for ( i=0; i<tokens.n; ++i ) {+ s = list_get( &tokens, i );+ if ( !strcmp( s->data, "[Editor]" ) ) {+ usetag = editor;+ newstr_strcpy( s, "" );+ } else if ( s->len && s->data[s->len-1]==',' ) {+ comma++;+ } }- if ( !comma && is_ws( *p ) ) *p = ',';- name_add( info, usetag, name->data, level, asis, corps );++ if ( comma==0 && tokens.n ) {+ s = list_get( &tokens, 0 );+ newstr_addchar( s, ',' );+ }++ for ( i=0; i<tokens.n; ++i ) {+ if ( i ) newstr_addchar( &usename, ' ' );+ newstr_newstrcat( &usename, list_get( &tokens, i ) );+ }++ return name_add( info, usetag, usename.data, level, asis, corps ); } -static void+static int copacin_addpage( fields *info, char *p, int level ) { newstr page;+ int ok; newstr_init( &page ); p = skip_ws( p ); while ( *p && !is_ws(*p) && *p!='-' && *p!='\r' && *p!='\n' ) newstr_addchar( &page, *p++ );- if ( page.len>0 ) fields_add( info, "PAGESTART", page.data, level );+ if ( page.len>0 ) {+ ok = fields_add( info, "PAGESTART", page.data, level );+ if ( !ok ) return 0;+ } newstr_empty( &page ); while ( *p && (is_ws(*p) || *p=='-' ) ) p++; while ( *p && !is_ws(*p) && *p!='-' && *p!='\r' && *p!='\n' ) newstr_addchar( &page, *p++ );- if ( page.len>0 ) fields_add( info, "PAGEEND", page.data, level );+ if ( page.len>0 ) {+ ok = fields_add( info, "PAGEEND", page.data, level );+ if ( !ok ) return 0;+ } newstr_free( &page );+ return 1; } -static void+static int copacin_adddate( fields *info, char *tag, char *newtag, char *p, int level ) { char *months[12]={ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; char month[10];- int found,i,part;+ int found,i,part,ok; newstr date; newstr_init( &date ); part = (!strncasecmp(newtag,"PART",4));@@ -220,9 +250,10 @@ while ( *p ) newstr_addchar( &date, *p++ ); if ( date.len>0 ) { if ( part ) - fields_add(info, "PARTYEAR", date.data, level);+ ok = fields_add(info, "PARTYEAR", date.data, level); else- fields_add( info, "YEAR", date.data, level );+ ok = fields_add( info, "YEAR", date.data, level );+ if ( !ok ) return 0; } } else if ( !strcasecmp( tag, "%8" ) ) { while ( *p && *p!=' ' && *p!=',' ) newstr_addchar( &date, *p++ );@@ -235,13 +266,15 @@ if (found>8) sprintf( month, "%d", found+1 ); else sprintf( month, "0%d", found+1 ); if ( part ) - fields_add( info, "PARTMONTH", month, level );- else fields_add( info, "MONTH", month, level );+ ok = fields_add( info, "PARTMONTH", month, level );+ else ok = fields_add( info, "MONTH", month, level );+ if ( !ok ) return 0; } else { if ( part )- fields_add( info, "PARTMONTH", date.data, level );+ ok = fields_add( info, "PARTMONTH", date.data, level ); else- fields_add( info, "MONTH", date.data, level );+ ok = fields_add( info, "MONTH", date.data, level );+ if ( !ok ) return 0; } } newstr_empty( &date );@@ -250,12 +283,14 @@ newstr_addchar( &date, *p++ ); if ( date.len>0 && date.len<3 ) { if ( part )- fields_add( info, "PARTDAY", date.data, level );+ ok = fields_add( info, "PARTDAY", date.data, level ); else- fields_add( info, "DAY", date.data, level );+ ok = fields_add( info, "DAY", date.data, level );+ if ( !ok ) return 0; } } newstr_free( &date );+ return 1; } static void@@ -267,10 +302,10 @@ } } -void+int copacin_convertf( fields *copacin, fields *out, int reftype, param *p, variants *all, int nall ) {- int process, level, i, n, nfields;+ int process, level, i, n, nfields, ok; newstr *tag, *data; char *newtag; @@ -279,51 +314,51 @@ tag = fields_tag( copacin, i, FIELDS_STRP ); - n = process_findoldtag( tag->data, reftype, all, nall );+ n = translate_oldtag( tag->data, reftype, all, nall, &process, &level, &newtag ); if ( n==-1 ) { copacin_report_notag( p, tag->data ); continue; }-- process = ((all[reftype]).tags[n]).processingtype; if ( process == ALWAYS ) continue; /*add these later*/ data = fields_value( copacin, i, FIELDS_STRP );- level = ((all[reftype]).tags[n]).level;- newtag = ((all[reftype]).tags[n]).newstr; switch ( process ) { case SIMPLE:- fields_add( out, newtag, data->data, level );+ ok = fields_add( out, newtag, data->data, level ); break; case TITLE:- title_process( out, newtag, data->data, level, p->nosplittitle );+ ok = title_process( out, newtag, data->data, level, p->nosplittitle ); break; case PERSON:- copacin_addname( out, newtag, data, level, &(p->asis), &(p->corps) );+ ok = copacin_addname( out, newtag, data, level, &(p->asis), &(p->corps) ); break; case DATE:- copacin_adddate(out,all[reftype]. tags[i].oldstr,newtag,data->data,level);+ ok = copacin_adddate(out,all[reftype]. tags[i].oldstr,newtag,data->data,level); break; case PAGES:- copacin_addpage( out, data->data, level );+ ok = copacin_addpage( out, data->data, level ); break; case SERIALNO:- addsn( out, data->data, level );+ ok = addsn( out, data->data, level ); break; default: fprintf(stderr,"%s: internal error -- " "illegal process value %d\n", p->progname, process );+ ok = 1; break; } + if ( !ok ) return BIBL_ERR_MEMERR;+ }-} + return BIBL_OK;+}
bibutils/copacin.h view
@@ -1,9 +1,9 @@ /* * copacin.h *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL * */ #ifndef COPACIN_H@@ -18,7 +18,7 @@ newstr *line, newstr *reference, int *fcharset ); 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 int copacin_convertf( fields *copacin, fields *info, int reftype, param *p, variants *all, int nall ); extern void copacin_initparams( param *p, const char *progname );
bibutils/copactypes.c view
@@ -1,12 +1,11 @@ /* * copactypes.c *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Program and source code released under the GPL+ * Program and source code released under the GPL version 2 * */- #include <stdio.h> #include <string.h> #include "is_ws.h"
bibutils/doi.c view
@@ -9,9 +9,10 @@ * is_doi() * Check for DOI buried in another field. *- * Copyright (c) Chris Putnam 2008-2012+ * Copyright (c) Chris Putnam 2008-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2+ * */ #include <stdio.h> #include <stdlib.h>@@ -91,9 +92,9 @@ for ( i=0; i<patlen; ++i ) { match = 0; if ( pattern[i]=='#' ) {- if ( isdigit( s[i] ) ) match = 1;- } else if ( !matchcase && isalpha( pattern[i] ) ) {- if ( tolower(pattern[i])==tolower(s[i])) match = 1;+ if ( isdigit( (unsigned char)s[i] ) ) match = 1;+ } else if ( !matchcase && isalpha( (unsigned char)pattern[i] ) ) {+ if ( tolower((unsigned char)pattern[i])==tolower((unsigned char)s[i])) match = 1; } else { if ( pattern[i] == s[i] ) match = 1; }
bibutils/doi.h view
@@ -1,9 +1,10 @@ /* * doi.h *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2+ * */ #ifndef DOI_H #define DOI_H
bibutils/ebiin.c view
@@ -1,9 +1,9 @@ /* * ebiin.c *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Program and source code released under the GPL+ * Program and source code released under the GPL version 2 * */ #include <stdio.h>@@ -506,20 +506,4 @@ ebiin_assembleref( &top, ebiin ); xml_free( &top ); return 1;-}--void-ebiin_convertf( fields *ebiin, fields *out, int reftype, int verbose, - variants *all, int nall )-{- char *tag, *value;- int i, n, level;-- n = fields_num( ebiin );- for ( i=0; i<n; ++i ) {- tag = fields_tag( ebiin, i, FIELDS_CHRP );- value = fields_value( ebiin, i, FIELDS_CHRP );- level = fields_level( ebiin, i );- fields_add( out, tag, value, level );- } }
bibutils/ebiin.h view
@@ -1,9 +1,9 @@ /* * ebiin.h *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef PUBIN_H@@ -16,7 +16,6 @@ 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 );
bibutils/endin.c view
@@ -1,9 +1,9 @@ /* * endin.c *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Program and source code released under the GPL+ * Program and source code released under the GPL version 2 * */ #include <stdio.h>@@ -61,8 +61,8 @@ const char others[]="!@#$^&*()+=?[~>"; if ( buf[0]!='%' ) return 0; if ( buf[2]!=' ' ) return 0;- if ( isalpha( buf[1] ) ) return 1;- if ( isdigit( buf[1] ) ) return 1;+ if ( isalpha( (unsigned char)buf[1] ) ) return 1;+ if ( isdigit( (unsigned char)buf[1] ) ) return 1; if ( strchr( others, buf[1] ) ) return 1; return 0; }@@ -177,8 +177,8 @@ return 1; } -static void-addtype( fields *info, char *data, int level )+static int+endin_addtype( fields *info, char *data, int level ) { lookups types[] = { { "GENERIC", "ARTICLE" },@@ -208,56 +208,66 @@ { "WEB PAGE", "WEBPAGE" }, }; int ntypes = sizeof( types ) / sizeof( lookups );- int i, found=0;+ int i, ok, found=0; for ( i=0; i<ntypes; ++i ) { if ( !strcasecmp( types[i].oldstr, data ) ) { found = 1;- fields_add( info, "INTERNAL_TYPE", types[i].newstr, level );+ ok = fields_add( info, "INTERNAL_TYPE", types[i].newstr, level );+ if ( !ok ) return 0; } } if ( !found ) { fprintf( stderr, "Did not identify reference type '%s'\n", data ); fprintf( stderr, "Defaulting to journal article type\n");- fields_add( info, "INTERNAL_TYPE", types[0].newstr, level );+ ok = fields_add( info, "INTERNAL_TYPE", types[0].newstr, level );+ if ( !ok ) return 0; }+ return 1; } -static void-addpage( fields *info, char *p, int level )+static int+endin_addpage( fields *info, char *p, int level ) { newstr page;+ int ok; newstr_init( &page ); p = skip_ws( p ); while ( *p && !is_ws(*p) && *p!='-' && *p!='\r' && *p!='\n' ) newstr_addchar( &page, *p++ );- if ( page.len>0 ) fields_add( info, "PAGESTART", page.data, level );+ if ( page.len>0 ) {+ ok = fields_add( info, "PAGESTART", page.data, level );+ if ( !ok ) return 0;+ } newstr_empty( &page ); while ( *p && (is_ws(*p) || *p=='-' ) ) p++; while ( *p && !is_ws(*p) && *p!='-' && *p!='\r' && *p!='\n' ) newstr_addchar( &page, *p++ );- if ( page.len>0 ) fields_add( info, "PAGEEND", page.data, level );+ if ( page.len>0 ) {+ ok = fields_add( info, "PAGEEND", page.data, level );+ if ( !ok ) return 0;+ } newstr_free( &page );+ return 1; } -static void-adddate( fields *info, char *tag, char *newtag, char *p, int level )+static int+endin_adddate( fields *info, char *tag, char *newtag, char *p, int level ) { char *months[12]={ "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; char month[10];- int found,i,part;+ int found,i,part, ok; newstr date; newstr_init( &date ); part = (!strncasecmp(newtag,"PART",4)); if ( !strcasecmp( tag, "%D" ) ) { while ( *p ) newstr_addchar( &date, *p++ ); if ( date.len>0 ) {- if ( part ) - fields_add(info, "PARTYEAR", date.data, level);- else- fields_add( info, "YEAR", date.data, level );+ if ( part ) ok = fields_add( info, "PARTYEAR", date.data, level );+ else ok = fields_add( info, "YEAR", date.data, level );+ if ( !ok ) return 0; } } else if ( !strcasecmp( tag, "%8" ) ) { while ( *p && *p!=' ' && *p!=',' ) newstr_addchar( &date, *p++ );@@ -269,27 +279,28 @@ if ( found!=-1 ) { if (found>8) sprintf( month, "%d", found+1 ); else sprintf( month, "0%d", found+1 );- if ( part ) - fields_add( info, "PARTMONTH", month, level );- else fields_add( info, "MONTH", month, level );+ if ( part ) ok = fields_add( info, "PARTMONTH", month, level );+ else ok = fields_add( info, "MONTH", month, level );+ if ( !ok ) return 0; } else { if ( part )- fields_add( info, "PARTMONTH", date.data, level );+ ok = fields_add( info, "PARTMONTH", date.data, level ); else- fields_add( info, "MONTH", date.data, level );+ ok = fields_add( info, "MONTH", date.data, level );+ if ( !ok ) return 0; } } newstr_empty( &date ); p = skip_ws( p ); while ( *p && *p!='\n' && *p!=',' ) newstr_addchar( &date, *p++ ); if ( date.len>0 && date.len<3 ) {- if ( part )- fields_add( info, "PARTDAY", date.data, level );- else- fields_add( info, "DAY", date.data, level );+ if ( part ) ok = fields_add( info, "PARTDAY", date.data, level );+ else ok = fields_add( info, "DAY", date.data, level );+ if ( !ok ) return 0; } } newstr_free( &date );+ return 1; } /* Endnote defaults if no %0@@ -413,29 +424,32 @@ } } -/* Wiley EndNote download has DOI's in "%1" tag */-static void-addnotes( fields *info, char *tag, char *data, int level )+/* Wiley's EndNote download has DOI's in "%1" tag */+static int+endin_addnotes( fields *info, char *tag, char *data, int level ) { int doi = is_doi( data ); if ( doi!=-1 )- fields_add( info, "DOI", &(data[doi]), level );+ return fields_add( info, "DOI", &(data[doi]), level ); else- fields_add( info, tag, data, level );+ return fields_add( info, tag, data, level ); } -void+int endin_convertf( fields *endin, fields *info, int reftype, param *p, variants *all, int nall ) {- int i, level, n, process, nfields;+ int i, level, n, process, nfields, ok; char *newtag, *t; newstr *d; nfields = fields_num( endin ); for ( i=0; i<nfields; ++i ) { /* Ensure that data exists */- d = fields_value( endin, i, FIELDS_STRP );- if ( d->len==0 || !(d->data) ) continue;+ d = fields_value( endin, i, FIELDS_STRP_NOUSE );+ if ( d->len == 0 ) {+ fields_setused( endin, i );+ continue;+ } /* * All refer format tags start with '%'. If we have one * that doesn't, assume that it comes from endx2xml@@ -447,55 +461,58 @@ continue; } - n = process_findoldtag( t, reftype, all, nall );+ n = translate_oldtag( t, reftype, all, nall, &process, &level, &newtag ); if ( n==-1 ) { endin_notag( p, t, d->data ); continue; }-- process = ((all[reftype]).tags[n]).processingtype; if ( process == ALWAYS ) continue; /* add these later */- level = ((all[reftype]).tags[n]).level;- newtag = ((all[reftype]).tags[n]).newstr; + fields_setused( endin, i );+ switch ( process ) { case SIMPLE:- fields_add( info, newtag, d->data, level );+ ok = fields_add( info, newtag, d->data, level ); break; case TYPE:- addtype( info, d->data, level );+ ok = endin_addtype( info, d->data, level ); break; case TITLE:- title_process( info, newtag, d->data, level, p->nosplittitle );+ ok = title_process( info, newtag, d->data, level, p->nosplittitle ); break; case PERSON:- name_add( info, newtag, d->data, level, &(p->asis), &(p->corps) );+ ok = name_add( info, newtag, d->data, level, &(p->asis), &(p->corps) ); break; case DATE:- adddate( info, t, newtag,d->data,level);+ ok = endin_adddate( info, t, newtag,d->data,level); break; case PAGES:- addpage( info, d->data, level );+ ok = endin_addpage( info, d->data, level ); break; case SERIALNO:- addsn( info, d->data, level );+ ok = addsn( info, d->data, level ); break; case NOTES:- addnotes( info, newtag, d->data, level );+ ok = endin_addnotes( info, newtag, d->data, level ); break; default: fprintf(stderr,"%s: internal error -- illegal process number %d\n", p->progname, process );+ ok = 1; break; } + if ( !ok ) return BIBL_ERR_MEMERR;+ }++ return BIBL_OK; }
bibutils/endin.h view
@@ -1,9 +1,9 @@ /* * endin.h *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef ENDIN_H@@ -17,7 +17,7 @@ extern int endin_readf( FILE *fp, char *buf, int bufsize, int *bufpos, newstr *line, newstr *reference, int *fcharset ); extern int endin_processf( fields *endin, char *p, char *filename, long nref ); extern int endin_typef( fields *endin, char *filename, int nrefs, param *p, variants *all, int nall );-extern void endin_convertf( fields *endin, fields *info, int reftype, param *p, variants *all, int nall );+extern int 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 );
bibutils/endout.c view
@@ -1,9 +1,9 @@ /* * endout.c *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Program and source code released under the GPL+ * Program and source code released under the GPL version 2 * */ #include <stdio.h>@@ -15,6 +15,7 @@ #include "strsearch.h" #include "fields.h" #include "doi.h"+#include "name.h" #include "endout.h" void@@ -336,40 +337,23 @@ } static void-output_person( FILE *fp, char *p )-{- int nseps = 0, nch;- while ( *p ) {- nch = 0;- if ( nseps==1 ) fprintf( fp, "," );- if ( nseps ) fprintf( fp, " " );- while ( *p && *p!='|' ) {- fprintf( fp, "%c", *p++ );- nch++;- }- if ( *p=='|' ) p++;- if ( nseps!=0 && nch==1 ) fprintf( fp, "." );- nseps++;- }-}--static void output_people( FILE *fp, fields *info, char *tag, char *entag, int level ) {+ newstr oneperson; int i, n, flvl;- char *ftag, *fval;+ char *ftag;+ newstr_init( &oneperson ); n = fields_num( info ); for ( i=0; i<n; ++i ) { flvl = fields_level( info, i ); if ( level!=LEVEL_ANY && flvl!=level ) continue; ftag = fields_tag( info, i, FIELDS_CHRP ); if ( !strcasecmp( ftag, tag ) ) {- fval = fields_value( info, i, FIELDS_CHRP );- fprintf( fp, "%s ", entag );- output_person( fp, fval );- fprintf( fp, "\n" );+ name_build_withcomma( &oneperson, fields_value( info, i, FIELDS_CHRP ) );+ fprintf( fp, "%s %s\n", entag, oneperson.data ); } }+ newstr_free( &oneperson ); } static void@@ -548,9 +532,19 @@ output_title( fp, info, "SHORTTITLE", "SHORTSUBTITLE", "%!", LEVEL_MAIN ); output_people( fp, info, "AUTHOR", "%A", LEVEL_MAIN );- output_people( fp, info, "EDITOR", "%E", LEVEL_ANY );+ output_people( fp, info, "EDITOR", "%E", LEVEL_MAIN );+ if ( type==TYPE_ARTICLE || type==TYPE_MAGARTICLE || type==TYPE_ELECTRONICARTICLE || type==TYPE_NEWSARTICLE )+ output_people( fp, info, "EDITOR", "%E", LEVEL_HOST );+ else if ( type==TYPE_INBOOK || type==TYPE_INPROCEEDINGS ) {+ output_people( fp, info, "EDITOR", "%E", LEVEL_HOST );+ } else {+ output_people( fp, info, "EDITOR", "%Y", LEVEL_HOST );+ } output_people( fp, info, "TRANSLATOR", "%H", LEVEL_ANY ); + output_people( fp, info, "AUTHOR", "%Y", LEVEL_SERIES );+ output_people( fp, info, "EDITOR", "%Y", LEVEL_SERIES );+ if ( type==TYPE_CASE ) output_easy( fp, info, "AUTHOR:CORP", "%I", LEVEL_MAIN ); else if ( type==TYPE_HEARING )@@ -568,9 +562,17 @@ output_easyall( fp, info, "TRANSLATOR:ASIS", "%H", LEVEL_ANY ); } - if ( type==TYPE_ARTICLE || type==TYPE_MAGARTICLE )+ if ( type==TYPE_ARTICLE || type==TYPE_MAGARTICLE || type==TYPE_ELECTRONICARTICLE || type==TYPE_NEWSARTICLE ) output_title( fp, info, "TITLE", "SUBTITLE", "%J", LEVEL_HOST );- else output_title( fp, info, "TITLE", "SUBTITLE", "%B", LEVEL_HOST );+ else if ( type==TYPE_INBOOK || type==TYPE_INPROCEEDINGS ) {+ output_title( fp, info, "TITLE", "SUBTITLE", "%B", LEVEL_HOST );+ } else {+ output_title( fp, info, "TITLE", "SUBTITLE", "%S", LEVEL_HOST );+ }++ if ( type!=TYPE_CASE && type!=TYPE_HEARING ) {+ output_title( fp, info, "TITLE", "SUBTITLE", "%S", LEVEL_SERIES );+ } output_year( fp, info, LEVEL_ANY ); output_monthday( fp, info, LEVEL_ANY );
bibutils/endout.h view
@@ -1,7 +1,9 @@ /* * endout.h *- * Copyright (c) Chris Putnam 2005-2012+ * Copyright (c) Chris Putnam 2005-2013+ *+ * Source code released under the GPL version 2 * */ #ifndef ENDOUT_H
bibutils/endtypes.c view
@@ -1,12 +1,11 @@ /* * endtypes.c *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Program and source code released under the GPL+ * Program and source code released under the GPL version 2 * */- #include <stdio.h> #include <string.h> #include "is_ws.h"@@ -31,8 +30,8 @@ { "%N", "NUMBER", SIMPLE, LEVEL_MAIN }, { "%P", "PAGES", PAGES, LEVEL_MAIN }, { "%&", "SECTION", SIMPLE, LEVEL_MAIN },- { "%Y", "3RD_AUTHOR", PERSON, LEVEL_MAIN },- { "%S", "3RD_TITLE", SIMPLE, LEVEL_MAIN },+ { "%Y", "AUTHOR", PERSON, LEVEL_SERIES },+ { "%S", "TITLE", TITLE, LEVEL_SERIES }, { "%7", "EDITION", SIMPLE, LEVEL_MAIN }, { "%8", "MONTH", DATE, LEVEL_MAIN }, { "%9", "GENRE", SIMPLE, LEVEL_MAIN },@@ -453,8 +452,8 @@ { "%6", "NUMVOLUMES",SIMPLE, LEVEL_HOST }, { "%N", "NUMBER", SIMPLE, LEVEL_MAIN }, { "%P", "PAGES", PAGES, LEVEL_MAIN },- { "%Y", "EDITOR", PERSON, LEVEL_HOST }, /* SERIES_EDITOR */- { "%S", "TITLE", TITLE, LEVEL_HOST+1 }, /* SERIES_TITLE */+ { "%Y", "EDITOR", PERSON, LEVEL_SERIES },+ { "%S", "TITLE", TITLE, LEVEL_SERIES }, { "%7", "EDITION", SIMPLE, LEVEL_HOST }, { "%8", "MONTH", DATE, LEVEL_MAIN }, { "%!", "SHORTTITLE",TITLE, LEVEL_MAIN },@@ -1110,13 +1109,13 @@ { "%V", "VOLUME" , SIMPLE, LEVEL_MAIN }, { "%6", "NUMVOLUMES",SIMPLE, LEVEL_HOST }, { "%N", "NUMBER", SIMPLE, LEVEL_MAIN },- { "%P", "PAGES", PAGES, LEVEL_MAIN },- { "%&", "SECTION", SIMPLE, LEVEL_MAIN },- { "%Y", "3RD_AUTHOR", PERSON, LEVEL_MAIN },- { "%S", "3RD_TITLE", SIMPLE, LEVEL_MAIN },- { "%7", "EDITION", SIMPLE, LEVEL_MAIN },- { "%8", "MONTH", DATE, LEVEL_MAIN },- { "%9", "GENRE", SIMPLE, LEVEL_MAIN },+ { "%P", "PAGES", PAGES, LEVEL_MAIN },+ { "%&", "SECTION", SIMPLE, LEVEL_MAIN },+ { "%Y", "AUTHOR", PERSON, LEVEL_SERIES },+ { "%S", "TITLE", TITLE, LEVEL_SERIES },+ { "%7", "EDITION", SIMPLE, LEVEL_MAIN },+ { "%8", "MONTH", DATE, LEVEL_MAIN },+ { "%9", "GENRE", SIMPLE, LEVEL_MAIN }, { "%?", "SUB_AUTHOR", PERSON, LEVEL_MAIN }, /* subsidiary-authors */ { "%!", "SHORTTITLE", TITLE, LEVEL_MAIN }, { "%@", "SERIALNUMBER", SERIALNO, LEVEL_MAIN },@@ -1165,8 +1164,8 @@ { "%N", "NUMBER", SIMPLE, LEVEL_MAIN }, { "%P", "PAGES", PAGES, LEVEL_MAIN }, { "%&", "SECTION", SIMPLE, LEVEL_MAIN },- { "%Y", "3RD_AUTHOR", PERSON, LEVEL_MAIN },- { "%S", "3RD_TITLE", SIMPLE, LEVEL_MAIN },+ { "%Y", "AUTHOR", PERSON, LEVEL_SERIES },+ { "%S", "TITLE", TITLE, LEVEL_SERIES }, { "%7", "EDITION", SIMPLE, LEVEL_MAIN }, { "%8", "MONTH", DATE, LEVEL_MAIN }, { "%9", "GENRE", SIMPLE, LEVEL_MAIN },
bibutils/endxmlin.c view
@@ -1,9 +1,10 @@ /* * endxmlin.c *- * Copyright (c) Chris Putnam 2006-2012+ * Copyright (c) Chris Putnam 2006-2013 *- * Program and source code released under the GPL+ * Program and source code released under the GPL version 2+ * */ #include <stdio.h> #include <stdlib.h>@@ -171,6 +172,8 @@ if ( xml_tagexact( node, a[i].attrib ) && node->down ) { newstr_empty( &title ); endxmlin_datar( node, &title );+ newstr_trimstartingws( &title );+ newstr_trimendingws( &title ); fields_add( info, a[i].internal, title.data, 0); } }
bibutils/endxmlin.h view
@@ -1,9 +1,9 @@ /* * endxmlin.h *- * Copyright (c) Chris Putnam 2006-2012+ * Copyright (c) Chris Putnam 2006-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef ENDXMLIN_H
bibutils/entities.c view
@@ -1,9 +1,10 @@ /* * entities.c *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2+ * */ #include <stdio.h> #include <string.h>@@ -316,7 +317,7 @@ { unsigned int c = 0, d; int i = *pi, j = 2;- while ( isdigit( s[i+j] ) ) {+ while ( isdigit( (unsigned char)s[i+j] ) ) { d = s[i+j] - '0'; c = 10 * c + d; j++;@@ -337,9 +338,9 @@ { unsigned int c = 0, d; int i = *pi, j = 3;- while ( isxdigit( s[i+j] ) ) {- if ( isdigit( s[i+j] ) ) d = s[i+j]-'0';- else d = toupper(s[i+j])-'A' + 10;+ while ( isxdigit( (unsigned char)s[i+j] ) ) {+ if ( isdigit( (unsigned char)s[i+j] ) ) d = s[i+j]-'0';+ else d = toupper((unsigned char)s[i+j])-'A' + 10; c = 16 * c + d; j++; }
bibutils/entities.h view
@@ -1,11 +1,11 @@ /* * entities.h *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2+ * */- #ifndef ENTITIES_H #define ENTITIES_H
bibutils/fields.c view
@@ -1,9 +1,9 @@ /* * fields.c *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #include <stdio.h>@@ -285,12 +285,19 @@ f->used[n] = 1; } -void+/* fields_replace_or_add()+ *+ * return 1 on success, 0 on memory error+ */+int fields_replace_or_add( fields *f, char *tag, char *data, int level ) { int n = fields_find( f, tag, level );- if ( n==-1 ) fields_add( f, tag, data, level );- else newstr_strcpy( &(f->data[n]), data );+ if ( n==-1 ) return fields_add( f, tag, data, level );+ else {+ newstr_strcpy( &(f->data[n]), data );+ return 1;+ } } char *fields_null_value = "\0";
bibutils/fields.h view
@@ -1,9 +1,9 @@ /* * fields.h *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef FIELDS_H@@ -40,7 +40,7 @@ extern int fields_maxlevel( fields *f ); extern void fields_clearused( fields *f ); extern void fields_setused( fields *f, int n );-extern void fields_replace_or_add( fields *f, char *tag, char *data, int level );+extern int fields_replace_or_add( fields *f, char *tag, char *data, int level ); extern inline int fields_num( fields *f ); extern inline int fields_used( fields *f, int n );
bibutils/gb18030.h view
@@ -1,9 +1,9 @@ /* * gb18030.h *- * Copyright (c) Chris Putnam 2008-2012+ * Copyright (c) Chris Putnam 2008-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef GB18030_H
+ bibutils/intlist.c view
@@ -0,0 +1,250 @@+/*+ * intlist.c+ *+ * Copyright (c) Chris Putnam 2007-2013+ *+ * Source code released under the GPL version 2+ *+ * Implements a simple managed array of ints+ *+ */+#include "intlist.h"++static void+memerr( const char *f )+{+ fprintf( stderr, "Memory error in %s\n", f );+ exit( EXIT_FAILURE );+}++static void+intlist_alloc( intlist *il )+{+ int alloc = 20, i;+ il->data = ( int * ) malloc( sizeof( int ) * alloc );+ if ( !(il->data) ) memerr( __FUNCTION__ );+ for ( i=0; i<alloc; ++i )+ il->data[i] = 0;+ il->max = alloc;+ il->n = 0;+}++static void+intlist_realloc( intlist *il )+{+ int *more;+ int alloc = il->max * 2, i;+ more = ( int * ) realloc( il->data, sizeof( int ) * alloc );+ if ( !more ) memerr( __FUNCTION__ );+ il->data = more;+ for ( i=il->max; i<alloc; ++i )+ il->data[i] = 0;+ il->max = alloc;+}++int+intlist_add( intlist *il, int value )+{+ if ( il->max==0 ) intlist_alloc( il );+ else if ( il->n >= il->max ) intlist_realloc( il );+ il->data[ il->n ] = value;+ il->n++;+ return il->n - 1;+}++int+intlist_add_unique( intlist *il, int value )+{+ if ( intlist_find( il, value )!=-1 ) return il->n - 1;+ else return intlist_add( il, value );+}++int+intlist_find( intlist *il, int value )+{+ int i;+ for ( i=0; i<il->n; ++i )+ if ( il->data[i]==value ) return i;+ return -1;+}++/* Here we know that pos is valid */+static void+intlist_remove_pos_core( intlist *il, int pos )+{+ int i;+ for ( i=pos; i<il->n-1; ++i )+ il->data[i] = il->data[i+1];+ il->n -= 1;+}++void+intlist_remove_pos( intlist *il, int pos )+{+ if ( pos < 0 || pos >= il->n ) return;+ intlist_remove_pos_core( il, pos );+}++void+intlist_remove( intlist *il, int value )+{+ int pos = intlist_find( il, value );+ if ( pos==-1 ) return;+ intlist_remove_pos_core( il, pos );+}++/* Return the index of searched-for string.+ * If cannot find string, add to list and then+ * return the index+ */+int+intlist_find_or_add( intlist *il, int value )+{+ int n = intlist_find( il, value );+ if ( n==-1 )+ n = intlist_add( il, value );+ return n;+}++/* don't actually free space, just reset counter */+void+intlist_empty( intlist *il )+{+ il->n = 0;+}++void+intlist_free( intlist *il )+{+ if ( il->data ) free( il->data );+ intlist_init( il );+}++void+intlist_init( intlist *il )+{+ il->data = NULL;+ il->max = 0;+ il->n = 0;+}++void+intlist_init_range( intlist *il, int low, int high, int step )+{+ int i;+ intlist_init( il );+ for ( i=low; i<high; i+= step )+ intlist_add( il, i );+}++intlist *+intlist_new( void )+{+ intlist *il = ( intlist * ) malloc( sizeof( intlist ) );+ if ( il ) intlist_init( il );+ return il;+}++intlist *+intlist_new_range( int low, int high, int step )+{+ intlist *il = ( intlist * ) malloc( sizeof( intlist ) );+ if ( il ) intlist_init_range( il, low, high, step );+ return il;+}++static int+intcomp( const void *v1, const void *v2 )+{+ int *i1 = ( int * ) v1;+ int *i2 = ( int * ) v2;+ if ( *i1 < *i2 ) return -1;+ else if ( *i1 > *i2 ) return 1;+ return 0;+}++void+intlist_sort( intlist *il )+{+ qsort( il->data, il->n, sizeof( int ), intcomp );+}++/* Returns random integer in the range [floor,ceil) */+static int+randomint( int floor, int ceil )+{+ int len = ceil - floor;+ return floor + rand() % len;+}++static void+swap( int *a, int *b )+{+ int tmp;+ tmp = *a;+ *a = *b;+ *b = tmp;+}++void+intlist_randomize( intlist *il )+{+ int i, j;+ if ( il->n < 2 ) return;+ for ( i=0; i<il->n; ++i ) {+ j = randomint( i, il->n );+ if ( i==j ) continue;+ swap( &(il->data[i]), &(il->data[j]) );+ }+}++void+intlist_copy( intlist *to, intlist *from )+{+ int i;+ intlist_free( to );+ to->data = ( int* ) malloc( sizeof( int ) * from->n );+ if ( !to->data ) return;+ to->n = to->max = from->n;+ for ( i=0; i<from->n; ++i ) + to->data[i] = from->data[i];+}++intlist *+intlist_dup( intlist *il )+{+ intlist *l;+ l = ( intlist* ) malloc( sizeof( intlist ) );+ if ( !l ) goto err0;+ intlist_copy( l, il );+ return l;+ free( l );+err0:+ return l;+}++void+intlist_append( intlist *to, intlist *from )+{+ int i;+ for ( i=0; i<from->n; ++i )+ intlist_add( to, from->data[i] );+}++void+intlist_append_unique( intlist *to, intlist *from )+{+ int i;+ for ( i=0; i<from->n; ++i ) {+ if ( intlist_find( to, from->data[i] )!=-1 ) continue;+ intlist_add( to, from->data[i] );+ }+}++int+intlist_get( intlist *il, int pos )+{+ if ( pos<0 || pos>=il->n ) return 0;+ else return il->data[pos];+}+
+ bibutils/intlist.h view
@@ -0,0 +1,40 @@+/*+ * intlist.h+ *+ * Copyright (c) Chris Putnam 2007-2013+ *+ * Source code released under the GPL version 2+ *+ */++#ifndef INTLIST_H+#define INTLIST_H++#include <stdio.h>+#include <stdlib.h>++typedef struct intlist {+ int n, max;+ int *data;+} intlist;++extern void intlist_init( intlist *info );+extern void intlist_init_range( intlist *info, int low, int high, int step );+extern intlist* intlist_new( void );+extern intlist* intlist_new_range( int low, int high, int step );+extern void intlist_sort( intlist *info );+extern void intlist_randomize( intlist *info );+extern int intlist_add( intlist *info, int value );+extern int intlist_add_unique( intlist *info, int value );+extern int intlist_find( intlist *info, int searchvalue );+extern int intlist_find_or_add( intlist *info, int searchvalue );+extern void intlist_empty( intlist *info );+extern void intlist_free( intlist *info );+extern void intlist_copy( intlist *to, intlist *from );+extern int intlist_get( intlist *info, int pos );+extern void intlist_remove( intlist *info, int searchvalue );+extern void intlist_remove_pos( intlist *info, int pos );+extern void intlist_append( intlist *to, intlist *from );+extern void intlist_append_unique( intlist *to, intlist *from );++#endif
bibutils/is_ws.c view
@@ -1,9 +1,9 @@ /* * is_ws.c *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #include "is_ws.h"
bibutils/is_ws.h view
@@ -1,9 +1,9 @@ /* * is_ws.h *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef IS_WS_H
bibutils/isiin.c view
@@ -1,9 +1,9 @@ /* * isiin.c *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Program and source code released under the GPL+ * Program and source code released under the GPL version 2 * */ #include <stdio.h>@@ -168,21 +168,24 @@ return 1; } -static void+static int keyword_process( fields *info, char *newtag, char *p, int level ) { newstr keyword;+ int ok; newstr_init( &keyword ); while ( *p ) { p = skip_ws( p ); while ( *p && *p!=';' ) newstr_addchar( &keyword, *p++ ); if ( keyword.len ) {- fields_add( info, newtag, keyword.data, level );+ ok = fields_add( info, newtag, keyword.data, level );+ if ( !ok ) return 0; newstr_empty( &keyword ); } if ( *p==';' ) p++; } newstr_free( &keyword );+ return 1; } int@@ -201,11 +204,11 @@ } /* pull off authors first--use AF before AU */-static void+static int isiin_addauthors( fields *isiin, fields *info, int reftype, variants *all, int nall, list *asis, list *corps ) { char *newtag, *authortype, use_af[]="AF", use_au[]="AU";- int level, i, n, has_af=0, has_au=0, nfields;+ int level, i, n, has_af=0, has_au=0, nfields, ok; newstr *t, *d; nfields = fields_num( isiin );@@ -224,8 +227,10 @@ n = process_findoldtag( authortype, reftype, all, nall ); level = ((all[reftype]).tags[n]).level; newtag = all[reftype].tags[n].newstr;- name_add( info, newtag, d->data, level, asis, corps );+ ok = name_add( info, newtag, d->data, level, asis, corps );+ if ( !ok ) return 0; }+ return 1; } static void@@ -237,14 +242,15 @@ } } -void+int isiin_convertf( fields *isiin, fields *info, int reftype, param *p, variants *all, int nall ) {- int process, level, i, n, nfields;+ int process, level, i, n, nfields, ok; newstr *t, *d; char *newtag; - isiin_addauthors( isiin, info, reftype, all, nall, &(p->asis), &(p->corps) );+ ok = isiin_addauthors( isiin, info, reftype, all, nall, &(p->asis), &(p->corps) );+ if ( !ok ) return BIBL_ERR_MEMERR; nfields = fields_num( isiin ); for ( i=0; i<nfields; ++i ) {@@ -253,45 +259,51 @@ if ( !strcasecmp( t->data, "AU" ) || !strcasecmp( t->data, "AF" ) ) continue; - n = process_findoldtag( t->data, reftype, all, nall );+ n = translate_oldtag( t->data, reftype, all, nall, &process, &level, &newtag ); if ( n==-1 ) { isiin_report_notag( p, t->data ); continue; }+ if ( process == ALWAYS ) continue; /* add in core code */ d = fields_value( isiin, i, FIELDS_STRP );- process = ((all[reftype]).tags[n]).processingtype;- level = ((all[reftype]).tags[n]).level;- newtag = all[reftype].tags[n].newstr; switch ( process ) { case SIMPLE:- fields_add( info, newtag, d->data, level );+ ok = fields_add( info, newtag, d->data, level ); break; case DATE:- fields_add( info, newtag, d->data, level );+ ok = fields_add( info, newtag, d->data, level ); break; case PERSON:- name_add( info, newtag, d->data, level, &(p->asis), &(p->corps) );+ ok = name_add( info, newtag, d->data, level, &(p->asis), &(p->corps) ); break; case TITLE:- title_process( info, newtag, d->data, level, p->nosplittitle );+ ok = title_process( info, newtag, d->data, level, p->nosplittitle ); break; case KEYWORD:- keyword_process( info, newtag, d->data, level );+ ok = keyword_process( info, newtag, d->data, level ); break; case SERIALNO:- addsn( info, d->data, level );+ ok = addsn( info, d->data, level ); break; + default:+ ok = 1;+ break;+ } /* do nothing if process==TYPE || process==ALWAYS */++ if ( !ok ) return BIBL_ERR_MEMERR; }++ return BIBL_OK; }
bibutils/isiin.h view
@@ -1,9 +1,9 @@ /* * isiin.h * - * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef ISIIN_H@@ -16,7 +16,7 @@ extern int isiin_readf( FILE *fp, char *buf, int bufsize, int *bufpos, newstr *line, newstr *reference, int *fcharset ); extern int isiin_typef( fields *isiin, char *filename, int nref, param *p, variants *all, int nall );-extern void isiin_convertf( fields *isiin, fields *info, int reftype, param *p, variants *all, int nall );+extern int 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 );
bibutils/isiout.c view
@@ -1,9 +1,10 @@ /* * isiout.c *- * Copyright (c) Chris Putnam 2008-2012+ * Copyright (c) Chris Putnam 2008-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2+ * */ #include <stdio.h> #include <stdlib.h>@@ -137,19 +138,33 @@ static void output_person( FILE *fp, char *name ) {- int n = 0, nchars = 0;+ newstr family, given, suffix; char *p = name;- while ( *p ) {- if ( *p=='|' ) { n++; nchars=0; }- else {- if ( n==1 && nchars<2 ) fprintf( fp, ", " );- if ( n==0 || (n>0 && nchars<2) ) {- fprintf( fp, "%c", *p );- }- }- nchars++;++ newstrs_init( &family, &given, &suffix, NULL );++ while ( *p && *p!='|' )+ newstr_addchar( &family, *p++ );++ while ( *p=='|' && *(p+1)!='|' ) { p++;+ if ( *p!='|' ) newstr_addchar( &given, *p++ );+ while ( *p && *p!='|' ) p++; }++ if ( *p=='|' && *(p+1)=='|' ) {+ p += 2;+ while ( *p && *p!='|' ) newstr_addchar( &suffix, *p++ );+ }++ if ( family.len ) fprintf( fp, "%s", family.data );+ if ( suffix.len ) {+ if ( family.len ) fprintf( fp, " %s", suffix.data );+ else fprintf( fp, "%s", suffix.data );+ }+ if ( given.len ) fprintf( fp, ", %s", given.data );++ newstrs_free( &family, &given, &suffix, NULL ); } static void@@ -241,10 +256,15 @@ output_title( fp, f, "TI", 0 ); if ( type==TYPE_ARTICLE ) {- output_title( fp, f, "SO", 1 );+ output_title( fp, f, "SO", 1 ); output_abbrtitle( fp, f, "JI", 1 );+ output_title( fp, f, "SE", 2 );+ } else if ( type==TYPE_INBOOK ) {+ output_title( fp, f, "BT", 1 );+ output_title( fp, f, "SE", 2 );+ } else { /* type==BOOK */+ output_title( fp, f, "SE", 1 ); }- else output_title( fp, f, "BT", 1 ); output_date( fp, f ); /* output_easy( fp, f, "PARTMONTH", "PD", -1 );
bibutils/isiout.h view
@@ -1,7 +1,9 @@ /* * isiout.h *- * Copyright (c) Chris Putnam 2007-2012+ * Copyright (c) Chris Putnam 2007-2013+ *+ * Source code released under the GPL version 2 * */ #ifndef ISIOUT_H
bibutils/isitypes.c view
@@ -1,12 +1,11 @@ /* * isitypes.c *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Program and source code released under the GPL+ * Program and source code released under the GPL version 2 * */- #include <stdio.h> #include <string.h> #include "is_ws.h"
bibutils/latex.c view
@@ -3,9 +3,9 @@ * * convert between latex special chars and unicode *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #include <stdio.h>@@ -28,7 +28,9 @@ { 125, "\\}", "{\\textbraceright}", "\\textbraceright" }, /* Right Curly Bracket */ { 95, "\\_", "", "" }, /* Underscore alone indicates subscript */ { 176, "{\\textdegree}", "\\textdegree", "^\\circ" }, /* Degree sign */- { 32, "~", "\\ ", "" }, /* "sticky" space */+/* fix sticky spaces in bibtex token cleaning--allows tokens to be parsed properly */+/* { 32, "~", "\\ ", "" }, */ /* "sticky" space */+ { 32, "\\ ", "", "" }, /* escaping the space is used to avoid extra space after periods */ { 126, "{\\textasciitilde}", "\\textasciitilde", "\\~{}" }, /* Tilde in latex */ /* This is a cheat, should use "\verb" */ /* Need same for ^ character */@@ -71,14 +73,16 @@ { 231, "{\\c{c}}","\\c{c}", "" }, /* with cedilla*/ { 263, "{\\'{c}}","\\'{c}", "\\'c" }, /* with acute */ { 265, "{\\^{c}}","\\^{c}", "\\^c" }, /* with circumflex */- { 265, "{\\.{c}}","\\.{c}", "\\.c" }, /* with dot above */+ { 267, "{\\.{c}}","\\.{c}", "\\.c" }, /* with dot above */ { 269, "{\\v{c}}","\\v{c}", "\\v c" }, /* with caron (hacek) */ /* Latin Capital D */ { 270, "{\\v{D}}","\\v{D}", "\\v D" }, /* with caron */+ { 272, "{\\DJ}", "", "" }, /* with stroke */ /* Latin Small d */- { 270, "{\\v{d}}","\\v{d}", "\\v d" }, /* with caron */+ { 271, "{\\v{d}}","\\v{d}", "\\v d" }, /* with caron */+ { 273, "{\\dj}", "", "" }, /* with stroke */ /* Latin Capital E */ { 200, "{\\`E}", "\\`{E}", "\\`E" }, /* with grave */@@ -120,9 +124,11 @@ /* Latin Capital H */ { 292, "{\\^{H}}","\\^{H}", "\\^H" }, /* with circumflex */+/* { 294, "", "", "" },*//* with stroke */ /* Latin Capital h */ { 293, "{\\^{h}}","\\^{h}", "\\^h" }, /* with circumflex */+/* { 295, "", "", "" },*//* with stroke */ /* Latin Capital I */ { 204, "{\\`I}", "\\`{I}", "\\`I" }, /* with grave */@@ -133,27 +139,29 @@ { 298, "{\\={I}}","\\={I}", "\\=I" }, /* with macron */ { 300, "{\\u{I}}","\\u{I}", "\\u I" }, /* with breve */ { 302, "{\\k{I}}","\\k{I}", "\\k I" }, /* with ogonek */- { 302, "{\\.{I}}","\\.{I}", "\\. I" }, /* with dot above */- { 302, "{\\v{I}}","\\v{I}", "\\v I" }, /* with caron */+ { 304, "{\\.{I}}","\\.{I}", "\\. I" }, /* with dot above */+ { 463, "{\\v{I}}","\\v{I}", "\\v I" }, /* with caron */ /* Latin Small i */- { 299, "{\\={\\i}}", "\\={\\i}", "\\=\\i{}"}, /* with macron */ { 236, "{\\`i}", "\\`{i}", "\\`i" }, /* with grave */ { 237, "{\\'i}", "\\'{i}", "\\'i" }, /* with acute */ { 238, "{\\^i}", "\\^{i}", "\\^i" }, /* with circumflex */ { 239, "{\\\"i}", "\\\"{i}", "\\\"i" }, /* with diuresis */- { 303, "{\\k{i}}","\\k{i}", "\\k i" }, /* with ogonek */- /* Latex \i has no dot on "i"*/ { 236, "{\\`\\i}", "\\`{\\i}", "\\`\\i" }, /* with grave */ { 237, "{\\'\\i}", "\\'{\\i}", "\\'\\i" }, /* with acute */ { 238, "{\\^\\i}", "\\^{\\i}", "\\^\\i" }, /* with circumflex */ { 239, "{\\\"\\i}", "\\\"{\\i}", "\\\"\\i" }, /* with diuresis */ { 297, "{\\~{\\i}}","\\~{\\i}", "\\~\\i{}"}, /* with tilde */- { 299, "{\\={\\i}}","\\={\\i}", "\\=\\i{}"}, /* with tilde */+ { 299, "{\\={\\i}}", "\\={\\i}", "\\=\\i{}"}, /* with macron */ { 301, "{\\u{\\i}}","\\u{\\i}", "\\u\\i{}"}, /* with breve */+ { 303, "{\\k{i}}","\\k{i}", "\\k i" }, /* with ogonek */+ /* Latex \i has no dot on "i"*/ { 305, "{\\i}", "\\i{}", "" }, /* without dot above */ { 464, "{\\v \\i{}}", "\\v \\i{}", "" }, /* with caron */ +/* { 306, "", "", "" },*/ /* Latin Capital IJ */+/* { 307, "" "", "" },*/ /* Latin Small ij */+ /* Latin Capital J */ { 308, "{\\^{J}}","\\^{J}", "\\^J" }, /* with circumflex */ @@ -173,14 +181,14 @@ { 315, "{\\c{L}}","\\c{L}", "\\c L" }, /* with cedilla */ { 317, "{\\v{L}}","\\v{l}", "\\v L" }, /* with caron */ { 319, "{L\\hspace{-0.35em}$\\cdot$}","L\\hspace{-0.35em}$\\cdot$", "" }, /* with middle dot */- { 321, "{\\L{}}", "\\L{}", "" }, /* with stroke */+ { 321, "{\\L}", "{\\L{}}", "\\L{}" }, /* with stroke */ /* Latin Small l */ { 314, "{\\'{l}}","\\'{l}", "\\'l" }, /* with acute */ { 316, "{\\c{l}}","\\c{l}", "\\c l" }, /* with cedilla */ { 318, "{\\v{l}}","\\v{l}", "\\v l" }, /* with caron */- { 318, "{l$\\cdot$}","l$\\cdot$", "" }, /* with middle dot */- { 322, "{\\l{}}", "\\l{}", "" }, /* with stroke */+ { 320, "{l$\\cdot$}","l$\\cdot$", "" }, /* with middle dot */+ { 322, "{\\l}", "{\\l{}}", "\\l{}" }, /* with stroke */ /* Latin Capital N */ { 209, "{\\~{N}}","\\~{N}", "\\~N" }, /* with tilde */@@ -249,10 +257,12 @@ /* Latin Capital T */ { 354, "{\\c{T}}", "\\c{T}", "" }, /* with cedilla */ { 356, "{\\v{T}}", "\\v{T}", "" }, /* with caron */+/* { 358, "", "", "" },*//* with stroke */ /* Latin Small t */ { 355, "{\\c{t}}", "\\c{t}", "" }, /* with cedilla */ { 357, "{\\v{t}}", "\\v{t}", "" }, /* with caron */+/* { 359, "", "", "" },*//* with stroke */ { 223, "{\\ss}", "\\ss", "" }, /* German sz ligature, "sharp s" */
bibutils/latex.h view
@@ -1,9 +1,9 @@ /* * latex.h *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef LATEX_H
bibutils/list.c view
@@ -1,11 +1,11 @@ /* * list.c *- * version: 2012-03-06+ * version: 2012-12-19 *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * * Implements a simple managed array of newstrs. *@@ -62,7 +62,7 @@ static inline int list_valid_num( list *a, int n ) {- if ( n < 0 || n > a->n ) return 0;+ if ( n < 0 || n >= a->n ) return 0; return 1; } @@ -84,18 +84,39 @@ /* * return pointer to C string 'n', list_getstr_char() is deprecated+ *+ * Ensure that a pointer is returned even if the newstr doesn't+ * point to data. Thus we can convert loops like:+ *+ * for ( i=0; i<a->n; ++i ) {+ * p = list_getc( a, i );+ * if ( p==NULL ) continue; // empty string+ * ...+ * }+ *+ * to+ *+ * i = 0;+ * while ( ( p = list_getc( a, i ) ) ) {+ * ...+ * i++;+ * }+ * */ char * list_getc( list *a, int n ) {+ static char empty[] = "";+ char *p; if ( !list_valid_num( a, n ) ) return NULL;- else return a->str[n].data;+ p = a->str[n].data;+ if ( p ) return p;+ else return empty; } char * list_getstr_char( list *a, int n ) {- if ( !list_valid_num( a, n ) ) return NULL;- else return a->str[n].data;+ return list_getc( a, n ); } static int@@ -147,6 +168,25 @@ } int+list_adds( list *a, ... )+{+ int ok, ret = 1;+ va_list ap;+ char *v;+ va_start( ap, a );+ do {+ v = va_arg( ap, char * );+ if ( v ) {+ ok = list_add( a, v );+ if ( !ok ) { ret=0; goto out; }+ }+ } while( v );+out:+ va_end( ap );+ return ret;+}++int list_add_unique( list *a, char *s ) { if ( list_find( a, s )==-1 ) return list_add( a, s );@@ -190,6 +230,16 @@ } } +void+list_remove( list *a, int n )+{+ int i;+ if ( !list_valid_num( a, n ) ) return;+ for ( i=n+1; i<a->n; ++i )+ newstr_newstrcpy( &(a->str[i-1]), &(a->str[i]) );+ a->n--;+}+ static int list_comp( const void *v1, const void *v2 ) {@@ -359,7 +409,7 @@ } void-list_tokenize( list *tokens, newstr *in, char delim )+list_tokenize( list *tokens, newstr *in, char delim, int merge_delim ) { newstr s; char *p;@@ -369,6 +419,7 @@ while ( p && *p ) { while ( *p && *p!=delim ) newstr_addchar( &s, *p++ ); if ( s.len ) list_add( tokens, s.data );+ else if ( !merge_delim ) list_add( tokens, "" ); newstr_empty( &s ); if ( *p==delim ) p++; }
bibutils/list.h view
@@ -1,11 +1,11 @@ /* * list.h *- * version: 2012-03-06+ * version: 2012-12-19 *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ @@ -41,12 +41,15 @@ extern void list_copy( list *to, list *from ); extern int list_add( list *a, char *value );+extern int list_adds( list *a, ... ); extern int list_add_unique( list *a, char *value ); extern int list_add_newstr( list *a, newstr *value ); extern int list_add_newstr_unique( list *a, newstr *value ); extern void list_append( list *a, list *toadd ); extern void list_append_unique( list *a, list *toadd ); +extern void list_remove( list *a, int n );+ extern newstr* list_get( list *a, int n ); extern newstr* list_getstr( list *a, int n ); extern char* list_getc( list *a, int n );@@ -62,7 +65,7 @@ extern int list_fill( list *a, char *filename ); extern void list_fillfp( list *a, FILE *fp );-extern void list_tokenize( list *tokens, newstr *in, char delim );+extern void list_tokenize( list *tokens, newstr *in, char delim, int merge_delim ); extern void list_newstrtok( list *t, newstr *s, char *sep );
bibutils/marc.c view
@@ -1,3 +1,11 @@+/*+ * marc.c+ *+ * Copyright (c) Chris Putnam 2004-2013+ *+ * Source code released under the GPL version 2+ *+ */ #include "marc.h" #include <string.h>
bibutils/marc.h view
@@ -1,9 +1,9 @@ /* * marc.h *- * Copyright (c) Chris Putnam 2008-2012+ * Copyright (c) Chris Putnam 2008-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef MARC_H
bibutils/medin.c view
@@ -1,9 +1,9 @@ /* * medin.c *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */ #include <stdio.h>@@ -36,7 +36,6 @@ p->processf = medin_processf; p->cleanf = NULL; p->typef = NULL;-/* p->convertf = medin_convertf;*/ p->convertf = NULL; p->all = NULL; p->nall = 0;@@ -527,19 +526,4 @@ medin_assembleref( &top, medin ); xml_free( &top ); return 1;-}--void-medin_convertf( fields *medin, fields *info, int reftype, int verbose, - variants *all, int nall )-{- char *tag, *value;- int i, n, level;- n = fields_num( medin );- for ( i=0; i<n; ++i ) {- tag = fields_tag( medin, i, FIELDS_CHRP );- value = fields_value( medin, i, FIELDS_CHRP );- level = fields_level( medin, i );- fields_add( info, tag, value, level );- } }
bibutils/medin.h view
@@ -1,9 +1,9 @@ /* * medin.h *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef MEDIN_H@@ -16,7 +16,6 @@ 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 );
bibutils/modsin.c view
@@ -1,9 +1,9 @@ /* * modsin.c *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #include <stdio.h>@@ -199,32 +199,66 @@ } } -/*- * find match in roles if newstr has the format of+/* modsin_marcrole_convert() *- * creator|cre+ * Map MARC-authority roles for people or organizations associated+ * with a reference to internal roles.+ *+ * Take input strings with roles separated by '|' characters, e.g.+ * "author" or "author|creator" or "edt" or "editor|edt". */-static int-modsin_rolesmatch( convert *roles_convert, int nroles, newstr *s )+static void+modsin_marcrole_convert( newstr *s, char *suffix, newstr *out ) {+ convert roles[] = {+ { "author", "AUTHOR" },+ { "aut", "AUTHOR" },+ { "aud", "AUTHOR" },+ { "aui", "AUTHOR" },+ { "aus", "AUTHOR" },+ { "creator", "AUTHOR" },+ { "cre", "AUTHOR" },+ { "editor", "EDITOR" },+ { "edt", "EDITOR" },+ { "degree grantor", "DEGREEGRANTOR" },+ { "dgg", "DEGREEGRANTOR" },+ { "organizer of meeting","ORGANIZER" },+ { "orm", "ORGANIZER" },+ { "patent holder", "ASSIGNEE" },+ { "pth", "ASSIGNEE" }+ };+ int nroles = sizeof( roles ) / sizeof( roles[0] );+ int i, nmismatch, n = -1; char *p, *q;- int i, nmismatch;- for ( i=0; i<nroles; ++i ) {- p = s->data;- while ( *p ) {- q = roles_convert[i].mods;- nmismatch = 0;- while ( *p && *p!='|' && nmismatch == 0) {- if ( toupper( *p ) != toupper( *q ) )- nmismatch++;- p++;- q++;++ if ( s->len == 0 ) {+ /* ...default to author on an empty string */+ n = 0;+ } else {+ /* ...find first match in '|'-separated list */+ for ( i=0; i<nroles && n==-1; ++i ) {+ p = s->data;+ while ( *p ) {+ q = roles[i].mods;+ nmismatch = 0;+ while ( *p && *p!='|' && nmismatch == 0) {+ if ( toupper( (unsigned char)*p ) != toupper( (unsigned char)*q ) )+ nmismatch++;+ p++;+ q++;+ }+ if ( !nmismatch && !(*(q++))) n = i;+ if ( *p=='|' ) p++; }- if ( !nmismatch && !(*(q++))) return i;- if ( *p=='|' ) p++; } }- return -1;++ if ( n!=-1 ) {+ newstr_strcpy( out, roles[n].internal );+ if ( suffix ) newstr_strcat( out, suffix );+ } else {+ newstr_strcpy( out, s->data );+ } } static void@@ -241,106 +275,61 @@ } static void-modsin_personr( xml *node, newstr *name, newstr *roles )+modsin_personr( xml *node, newstr *name, newstr *suffix, newstr *roles ) {+ newstr outname;+ newstr_init( &outname ); if ( xml_tagexact( node, "namePart" ) ) { if ( xml_tag_attrib( node, "namePart", "type", "family" ) ) { if ( name->len ) newstr_prepend( name, "|" ); newstr_prepend( name, node->value->data );+ } else if (xml_tag_attrib( node, "namePart", "type", "suffix")) {+ if ( suffix->len ) newstr_addchar( suffix, ' ' );+ newstr_strcat( suffix, node->value->data ); } else if (xml_tag_attrib( node, "namePart", "type", "date")){ } else { if ( name->len ) newstr_addchar( name, '|' );- if ( strchr( node->value->data, ',' ) ) - name_comma( node->value->data, name );- else name_nocomma( node->value->data, name );+ name_parse( &outname, node->value, NULL, NULL );+ newstr_newstrcat( name, &outname ); } } else if ( xml_tagexact( node, "roleTerm" ) ) { if ( roles->len ) newstr_addchar( roles, '|' ); newstr_newstrcat( roles, node->value ); }- if ( node->down ) modsin_personr( node->down, name, roles );- if ( node->next ) modsin_personr( node->next, name, roles );+ if ( node->down ) modsin_personr( node->down, name, suffix, roles );+ if ( node->next ) modsin_personr( node->next, name, suffix, roles );+ newstr_free( &outname ); } static void-modsin_asis_corp( xml *node, fields *info, int level, convert *roles_convert,- int nroles )+modsin_asis_corp( xml *node, fields *info, int level, char *suffix ) {- newstr name, roles;- int n;+ newstr name, roles, role_out; xml *dnode = node->down; if ( dnode ) {- newstrs_init( &name, &roles, NULL );+ newstrs_init( &name, &roles, &role_out, NULL ); modsin_asis_corp_r( dnode, &name, &roles );- if ( roles.len ) {- n = modsin_rolesmatch( roles_convert, nroles, &roles );- if ( n!=-1 ) {- fields_add( info, roles_convert[n].internal, - name.data, level );- } else {- fields_add( info, roles.data, name.data, level);- }- }- else fields_add( info, roles_convert[0].internal, name.data, - level );- newstrs_free( &name, &roles, NULL );+ modsin_marcrole_convert( &roles, suffix, &role_out );+ fields_add( info, role_out.data, name.data, level );+ newstrs_free( &name, &roles, &role_out, NULL ); } } static void-modsin_asis( xml *node, fields *info, int level )-{- convert roles_convert[] = {- { "author", "AUTHOR:ASIS" },- { "creator", "AUTHOR:ASIS" },- { "editor", "EDITOR:ASIS" },- { "degree grantor", "DEGREEGRANTOR:ASIS" },- { "organizer of meeting","ORGANIZER:ASIS" },- { "patent holder", "ASSIGNEE:ASIS" }- };- int nroles = sizeof( roles_convert ) / sizeof( roles_convert[0] );- modsin_asis_corp( node, info, level, roles_convert, nroles );-}--static void-modsin_corp( xml *node, fields *info, int level )-{- convert roles_convert[] = {- { "author", "AUTHOR:CORP" },- { "creator", "AUTHOR:CORP" },- { "editor", "EDITOR:CORP" },- { "degree grantor", "DEGREEGRANTOR:CORP" },- { "organizer of meeting","ORGANIZER:CORP" },- { "patent holder", "ASSIGNEE:CORP" }- };- int nroles = sizeof( roles_convert ) / sizeof( roles_convert[0] );- modsin_asis_corp( node, info, level, roles_convert, nroles );-}--static void modsin_person( xml *node, fields *info, int level ) {- newstr name, roles, role;- char *p;+ newstr name, suffix, roles, role, role_out; xml *dnode = node->down; if ( dnode ) {- newstrs_init( &name, &role, &roles, NULL );- modsin_personr( dnode, &name, &roles );- /* no defined role, default to author */- if ( !roles.len ) newstr_strcpy( &roles, "author" );- p = roles.data;- while ( p && *p ) {- while ( p && *p && *p!='|' ) newstr_addchar(&role,*p++);- if ( !strcasecmp( role.data, "author" ) ||- !strcasecmp( role.data, "creator" ) ) - fields_add( info, "AUTHOR", name.data, level );- else if ( !strcasecmp( role.data, "editor" ) )- fields_add( info, "EDITOR", name.data, level );- else fields_add( info, role.data, name.data, level );- if ( *p=='|' ) p++;- newstr_empty( &role );+ newstrs_init( &name, &suffix, &role, &roles, &role_out, NULL );+ modsin_personr( dnode, &name, &suffix, &roles );+ modsin_marcrole_convert( &roles, NULL, &role_out );+ if ( suffix.len ) {+ newstr_strcat( &name, "||" );+ newstr_newstrcat( &name, &suffix ); }- newstrs_free( &name, &role, &roles, NULL );+ fields_add( info, role_out.data, name.data, level );+ newstrs_free( &name, &suffix, &role, &roles, NULL ); } } @@ -657,9 +646,9 @@ else if ( xml_tag_attrib( node, "name", "type", "personal" ) ) modsin_person( node, info, level ); else if ( xml_tag_attrib( node, "name", "type", "corporate" ) )- modsin_corp( node, info, level );+ modsin_asis_corp( node, info, level, ":CORP" ); else if ( xml_tagexact( node, "name" ) )- modsin_asis( node, info, level );+ modsin_asis_corp( node, info, level, ":ASIS" ); else if ( xml_tagexact( node, "recordInfo" ) && node->down ) modsin_recordinfo( node->down, info, level ); else if ( xml_tagexact( node, "part" ) )@@ -693,7 +682,7 @@ else if ( xml_tagexact( node, "physicalDescription" ) ) modsin_description( node, info, level ); else if ( xml_tag_attrib( node, "relatedItem", "type", "host" ) ||- xml_tag_attrib( node, "relatedItem", "type", "series" ) ) {+ xml_tag_attrib( node, "relatedItem", "type", "series" ) ) { if ( node->down ) modsin_mods( node->down, info, level+1 ); } @@ -709,21 +698,6 @@ if ( node->down ) modsin_mods( node->down, info, 0 ); } else if ( node->down ) modsin_assembleref( node->down, info ); if ( node->next ) modsin_assembleref( node->next, info );-}--void-modsin_convertf( fields *modsin, fields *info, int reftype, int verbose, - variants *all, int nall )-{- char *tag, *value;- int i, n, level;- n = fields_num( modsin );- for ( i=0; i<n; ++i ) {- tag = fields_tag( modsin, i, FIELDS_CHRP );- value = fields_value( modsin, i, FIELDS_CHRP );- level = fields_level( modsin, i );- fields_add( info, tag, value, level );- } } int
bibutils/modsin.h view
@@ -1,9 +1,9 @@ /* * modsin.h *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef MODSIN_H@@ -15,7 +15,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,9 +1,9 @@ /* * modsout.c *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #include <stdio.h>@@ -126,14 +126,14 @@ static void output_title( fields *f, FILE *outptr, int level ) {- int ttl = fields_find( f, "TITLE", level );+ int ttl = fields_find( f, "TITLE", level ); int subttl = fields_find( f, "SUBTITLE", level ); int shrttl = fields_find( f, "SHORTTITLE", level ); output_tab1( outptr, level, "<titleInfo>\n" ); output_fill2( outptr, increment_level(level,1), "title", f, ttl, 1); output_fill2( outptr, increment_level(level,1), "subTitle", f, subttl, 1 );- if ( ttl==-1 && subttl==-1 ) + if ( ttl==-1 && subttl==-1 ) output_tab1( outptr, increment_level(level,1), "<title/>\n" ); output_tab1( outptr, level, "</titleInfo>\n" ); @@ -161,10 +161,10 @@ static void output_name( FILE *outptr, char *p, int level ) {- newstr family, part;+ newstr family, part, suffix; int n=0; - newstrs_init( &family, &part, NULL );+ newstrs_init( &family, &part, &suffix, NULL ); while ( *p && *p!='|' ) newstr_addchar( &family, *p++ ); if ( *p=='|' ) p++;@@ -184,6 +184,10 @@ } if ( *p=='|' ) { p++;+ if ( *p=='|' ) {+ p++;+ while ( *p && *p!='|' ) newstr_addchar( &suffix, *p++ );+ } newstr_empty( &part ); } }@@ -194,7 +198,13 @@ family.data, 1 ); } - newstrs_free( &part, &family, NULL );+ if ( suffix.len ) {+ if ( n==0 ) output_personalstart( outptr, level );+ output_tab4( outptr, increment_level(level,1), "namePart", "type", "suffix",+ suffix.data, 1 );+ }++ newstrs_free( &part, &family, &suffix, NULL ); } @@ -218,29 +228,40 @@ output_names( fields *f, FILE *outptr, int level ) { convert names[] = {- { "author", "AUTHOR", MARC_AUTHORITY },- { "writer", "WRITER", MARC_AUTHORITY },- { "artist", "ARTIST", MARC_AUTHORITY },- { "cartographer", "CARTOGRAPHER", MARC_AUTHORITY },- { "commentator", "COMMENTATOR", NO_AUTHORITY },- { "degree grantor","DEGREEGRANTOR", MARC_AUTHORITY },- { "director", "DIRECTOR", MARC_AUTHORITY },- { "editor", "EDITOR", MARC_AUTHORITY },- { "inventor", "INVENTOR", MARC_AUTHORITY },- { "organizer of meeting","ORGANIZER", MARC_AUTHORITY },- { "patent holder", "ASSIGNEE", MARC_AUTHORITY },- { "performer", "PERFORMER", MARC_AUTHORITY },- { "recipient", "RECIPIENT", MARC_AUTHORITY },- { "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 },- { "author", "COMMITTEE", MARC_AUTHORITY },- { "author", "COURT", MARC_AUTHORITY },- { "author", "LEGISLATIVEBODY", MARC_AUTHORITY }+ { "author", "AUTHOR", MARC_AUTHORITY },+ { "writer", "WRITER", MARC_AUTHORITY },+ { "artist", "ARTIST", MARC_AUTHORITY },+ { "cartographer", "CARTOGRAPHER", MARC_AUTHORITY },+ { "commentator", "COMMENTATOR", NO_AUTHORITY },+ { "degree grantor", "DEGREEGRANTOR", MARC_AUTHORITY },+ { "director", "DIRECTOR", MARC_AUTHORITY },+ { "editor", "EDITOR", MARC_AUTHORITY },+ { "inventor", "INVENTOR", MARC_AUTHORITY },+ { "organizer of meeting", "ORGANIZER", MARC_AUTHORITY },+ { "patent holder", "ASSIGNEE", MARC_AUTHORITY },+ { "performer", "PERFORMER", MARC_AUTHORITY },+ { "recipient", "RECIPIENT", MARC_AUTHORITY },+ { "redactor", "REDACTOR", NO_AUTHORITY },+ { "reporter", "REPORTER", NO_AUTHORITY },+ { "translator", "TRANSLATOR", MARC_AUTHORITY },+ { "event", "EVENT", NO_AUTHORITY },+ { "sponsor", "SPONSOR", MARC_AUTHORITY },+ { "author", "2ND_AUTHOR", MARC_AUTHORITY },+ { "author", "3RD_AUTHOR", MARC_AUTHORITY },+ { "author", "SUB_AUTHOR", MARC_AUTHORITY },+ { "author", "COMMITTEE", MARC_AUTHORITY },+ { "author", "COURT", MARC_AUTHORITY },+ { "author", "LEGISLATIVEBODY", MARC_AUTHORITY },+ { "annotator", "ANNOTATOR", MARC_AUTHORITY },+ { "commentator", "COMMENTATOR", MARC_AUTHORITY },+ { "author of introduction, etc.", "INTROAUTHOR", MARC_AUTHORITY },+ { "author of afterword, colophon, etc.", "AFTERAUTHOR", MARC_AUTHORITY },+ { "compiler", "COMPILER", MARC_AUTHORITY },+ { "collaborator", "COLLABORATOR", MARC_AUTHORITY },+ { "redactor", "REDACTOR", MARC_AUTHORITY },+ { "director", "DIRECTOR", MARC_AUTHORITY },+ { "producer", "PRODUCER", MARC_AUTHORITY },+ { "performer", "PERFORMER", MARC_AUTHORITY }, }; int i, n, nfields, ntypes = sizeof( names ) / sizeof( convert ); int f_asis, f_corp, f_conf;@@ -290,7 +311,7 @@ } static int-output_finddateissued( fields *f, int level, int pos[3] )+output_finddateissued( fields *f, int level, int pos[] ) { char *src_names[] = { "YEAR", "MONTH", "DAY", "DATE" }; char *alt_names[] = { "PARTYEAR", "PARTMONTH", "PARTDAY", "PARTDATE" };@@ -557,7 +578,8 @@ { "session", "SESSION", -1 }, { "articlenumber", "ARTICLENUMBER", -1 }, { "part", "PART", -1 },- { "chapter", "CHAPTER", -1 }+ { "chapter", "CHAPTER", -1 },+ { "report number", "REPORTNUMBER", -1 }, }; int i, nparts = sizeof( parts ) / sizeof( convert ), n;
bibutils/modsout.h view
@@ -1,9 +1,9 @@ /* * modsout.h *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef MODSOUT_H
bibutils/modstypes.c view
@@ -1,3 +1,11 @@+/*+ * modstypes.c+ *+ * Copyright (c) Chris Putnam 2004-2013+ *+ * Source code released under the GPL version 2+ * + */ #include <stdio.h> #include <string.h> #include "modstypes.h"
bibutils/modstypes.h view
@@ -1,9 +1,9 @@ /* * modstypes.h *- * Copyright (c) Chris Putnam 2008-2012+ * Copyright (c) Chris Putnam 2008-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef MODSTYPES_H
bibutils/name.c view
@@ -3,313 +3,436 @@ * * mangle names w/ and w/o commas *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #include <stdio.h> #include <ctype.h> #include <string.h>+#include "utf8.h"+#include "unicode.h" #include "is_ws.h" #include "newstr.h" #include "fields.h" #include "list.h"+#include "intlist.h" #include "name.h" -static void-check_case( char *start, char *end, int *upper, int *lower )+/* name_build_withcomma()+ *+ * reconstruct parsed names in format: 'family|given|given||suffix'+ * to 'family suffix, given given+ */+void+name_build_withcomma( newstr *s, char *p ) {- int u = 0, l = 0;- char *p = start;- while ( p < end ) {- if ( islower( *p ) ) l = 1;- else if ( isupper( *p ) ) u = 1;- p++;- }- *upper = u;- *lower = l;-}+ int nseps = 0, nch;+ char *suffix, *stopat; -static int-should_split( char *last_start, char *last_end, char *first_start, - char *first_end )-{- int upperlast, lowerlast, upperfirst, lowerfirst;- check_case( first_start, first_end, &upperfirst, &lowerfirst );- check_case( last_start, last_end, &upperlast, &lowerlast );- if ( ( upperlast && lowerlast ) && ( upperfirst && !lowerfirst ) )- return 1;- else return 0;+ newstr_empty( s );++ suffix = strstr( p, "||" );+ if ( suffix ) stopat = suffix;+ else stopat = strchr( p, '\0' );++ while ( p != stopat ) {+ nch = 0;+ if ( nseps==1 ) {+ if ( suffix ) {+ newstr_addchar( s, ' ' );+ newstr_strcat( s, suffix+2 );+ }+ newstr_addchar( s, ',' );+ }+ if ( nseps ) newstr_addchar( s, ' ' );+ while ( p!=stopat && *p!='|' ) {+ newstr_addchar( s, *p++ );+ nch++;+ }+ if ( p!=stopat && *p=='|' ) p++;+ if ( nseps!=0 && nch==1 ) newstr_addchar( s, '.' );+ nseps++;+ } } -/* name_addmultibytechar- * - * Add character to newstring s starting at pointer p.- *- * Handles the case for multibyte Unicode chars (with high bits- * set). Do not progress past the lastp barrier.+/* name_findetal() *- * Since we can progress more than one byte in the string,- * return the properly updated pointer p.+ * Returns number of final tokens to be skipped in processing+ * of name lists. */-static char *-name_addmultibytechar( newstr *s, char *p, char *lastp )+int+name_findetal( list *tokens ) {- if ( ! ((*p) & 128) ) {- newstr_addchar( s, *p );- p++;- } else {- while ( p!=lastp && ((*p) & 128) ) {- newstr_addchar( s, *p );- p++;+ newstr *s1, *s2;++ if ( tokens->n==0 ) return 0;++ /* ...check last entry for full 'et al.' or variant */+ s2 = list_get( tokens, tokens->n - 1 );+ if ( !strcasecmp( s2->data, "et alia" ) ||+ !strcasecmp( s2->data, "et al." ) ||+ !strcasecmp( s2->data, "et al.," ) ||+ !strcasecmp( s2->data, "et al" ) ||+ !strcasecmp( s2->data, "etalia" ) ||+ !strcasecmp( s2->data, "etal." ) ||+ !strcasecmp( s2->data, "etal" ) ) {+ return 1;+ }++ if ( tokens->n==1 ) return 0;++ /* ...check last two entries for full 'et' and 'al.' */+ s1 = list_get( tokens, tokens->n - 2 );+ if ( !strcasecmp( s1->data, "et" ) ) {+ if ( !strcasecmp( s2->data, "alia" ) ||+ !strcasecmp( s2->data, "al." ) ||+ !strcasecmp( s2->data, "al.," ) ||+ !strcasecmp( s2->data, "al" ) ) {+ return 2; } }- return p;++ return 0; } -static void-name_givennames_nosplit( char *start_first, char *end_first, newstr *outname )+#define WITHCOMMA (1)+#define JUNIOR (2)+#define SENIOR (4)+#define THIRD (8)+#define FOURTH (16)++typedef struct {+ char *s;+ unsigned short value;+} suffix_value_t;++static int+identify_suffix( char *p ) {- char *p;- p = start_first;- while ( p!=end_first ) {- if ( !is_ws( *p ) && *p!='.' ) {- p = name_addmultibytechar( outname, p, end_first );- } else {- if ( *p=='.' ) p++;- while ( p!=end_first && is_ws( *p ) ) p++;- if ( p!=end_first )- newstr_addchar( outname, '|' );- }+ suffix_value_t suffixes[] = {+ { "Jr." , JUNIOR },+ { "Jr" , JUNIOR },+ { "Jr.," , JUNIOR | WITHCOMMA },+ { "Jr," , JUNIOR | WITHCOMMA },+ { "Sr." , SENIOR },+ { "Sr" , SENIOR },+ { "Sr.," , SENIOR | WITHCOMMA },+ { "Sr," , SENIOR | WITHCOMMA },+ { "III" , THIRD },+ { "III," , THIRD | WITHCOMMA },+ { "IV" , FOURTH },+ { "IV," , FOURTH | WITHCOMMA },+ };+ int i, nsuffixes = sizeof( suffixes ) / sizeof( suffixes[0] );+ for ( i=0; i<nsuffixes; ++i ) {+ if ( !strcmp( p, suffixes[i].s ) )+ return suffixes[i].value; }+ return 0; } -static void-name_givennames_split( char *start_first, char *end_first, newstr *outname )+static int+has_suffix( list *tokens, int begin, int end, int *suffixpos ) {- int n = 0;- char *p;- p = start_first;- while ( p!=end_first ) {- if ( !is_ws( *p ) ) {- if ( *p=='.' && *(p+1)=='-' ) {- newstr_strcat( outname, ".-" );- p++; p++;- p = skip_ws( p );- p = name_addmultibytechar( outname, p, end_first );- newstr_addchar( outname, '.' );- n++;- } else if ( *p=='.' ) {- p++;- } else if ( *p=='-' ) {- newstr_strcat( outname, ".-" );- p++;- p = skip_ws( p );- p = name_addmultibytechar( outname, p, end_first );- newstr_addchar( outname, '.' );- n++;- } else {- if ( n ) newstr_addchar( outname, '|' );- p = name_addmultibytechar( outname, p, end_first );- n++;+ int i, ret;+ newstr *s;++ /* ...check last element, e.g. "H. F. Author, Sr." */+ s = list_get( tokens, end - 1 );+ ret = identify_suffix( s->data );+ if ( ret ) {+ *suffixpos = end - 1;+ return ret;+ }++ /* ...try to find one after a comma, e.g. "Author, Sr., H. F." */+ for ( i=begin; i<end-1; ++i ) {+ s = list_get( tokens, i );+ if ( s->len && s->data[ s->len - 1 ]==',' ) {+ s = list_get( tokens, i+1 );+ ret = identify_suffix( s->data );+ if ( ret ) {+ *suffixpos = i+1;+ return ret; }- } else {- while ( p!=end_first && is_ws( *p ) ) p++; } }-} -static void-name_givennames( char *first_start, char *first_end, char *last_start,- char *last_end, newstr *outname )-{- int splitfirst;- newstr_addchar( outname, '|' );- splitfirst = should_split( last_start, last_end, first_start, - first_end );- if ( !splitfirst )- name_givennames_nosplit( first_start, first_end, outname );- else - name_givennames_split( first_start, first_end, outname );+ return 0; } -static char *-string_end( char *p )+static int+add_given_split( newstr *name, newstr *s ) {- while ( *p ) p++;- return p;+ unsigned int unicode_char;+ unsigned int pos = 0;+ char utf8s[7];+ while ( pos < s->len ) {+ unicode_char = utf8_decode( s->data, &pos );+ if ( is_ws( (char) unicode_char ) ) continue;+ else if ( unicode_char==(unsigned int)'.' ) {+ if ( s->data[pos]=='-' ) {+ newstr_strcat( name, ".-" );+ pos += 1;+ unicode_char = utf8_decode( s->data, &pos );+ utf8_encode_str( unicode_char, utf8s );+ newstr_strcat( name, utf8s );+ newstr_addchar( name, '.' );+ }+ } else if ( unicode_char==(unsigned int)'-' ) {+ newstr_strcat( name, ".-" );+ unicode_char = utf8_decode( s->data, &pos );+ utf8_encode_str( unicode_char, utf8s );+ newstr_strcat( name, utf8s );+ newstr_addchar( name, '.' );+ } else if ( unicode_char==(unsigned int)',' ) { /* nothing */+ } else {+ newstr_addchar( name, '|' );+ utf8_encode_str( unicode_char, utf8s );+ newstr_strcat( name, utf8s );+ }+ }+ return 1; } --/* name_nocomma()- *- * names in the format "H. F. Author"- */-void-name_nocomma( char *start, newstr *outname )+static int+name_multielement_nocomma( intlist *given, intlist *family, list *tokens, int begin, int end, int suffixpos ) {- char *p, *last_start, *last_end, *first_start, *first_end;+ int i; - /** Last name **/- p = last_end = string_end( start );- while ( p!=start && !is_ws( *p ) ) p--;- if ( !strcasecmp( p+1, "Jr." ) || !strcasecmp( p+1, "III" ) ) {- while ( p!=start && is_ws( *p ) ) p--;- while ( p!=start && !is_ws( *p ) ) p--;- }- last_start = p = skip_ws( p );- while ( p!=last_end )- newstr_addchar( outname, *p++ );+ /* ...family name */+ if ( end-1 != suffixpos )+ intlist_add( family, end-1 );+ else+ intlist_add( family, end-2 ); - /** Given names **/- if ( start!=last_start ) {- first_start = skip_ws( start );- first_end = last_start;- while ( first_end!=first_start && !is_ws( *first_end ) )- first_end--;- name_givennames( first_start, last_start, last_start, last_end, - outname );+ /* ...given names */+ for ( i=begin; i<end-1; ++i ) {+ if ( i==suffixpos || i==suffixpos-1 ) continue;+ intlist_add( given, i ); }++ return 1; } -/*- * name_comma()- *- * names in the format "Author, H.F.", w/comma- */-void-name_comma( char *p, newstr *outname )+static int+name_multielement_comma( intlist *given, intlist *family, list *tokens, int begin, int end, int comma, int suffixpos ) {- char *start_first, *end_first, *start_last, *end_last;+ newstr *s;+ int i; - /** Last name **/- start_last = end_last = skip_ws( p );- while ( *p && ( *p!=',' ) ) {- newstr_addchar( outname, *p++ );- end_last = p;+ /* ...family names */+ for ( i=begin; i<comma; ++i ) {+ if ( i==suffixpos ) continue;+ intlist_add( family, i ); }+ s = list_get( tokens, comma );+ newstr_trimend( s, 1 ); /* remove comma */+ intlist_add( family, comma ); - /** Given names **/- if ( *p==',' ) p++;- start_first = skip_ws( p );- if ( *start_first ) {- end_first = string_end( start_first );- name_givennames( start_first, end_first, start_last, end_last, - outname );+ /* ...given names */+ for ( i=comma+1; i<end; ++i ) {+ if ( i==suffixpos ) continue;+ intlist_add( given, i ); }++ return 1; } -/* Determine if name is of type "corporate" or if it- * should be added "as-is"; both should not be mangled.- *- * First check tag for prefixes ":CORP" and ":ASIS",- * then optionally check lists, bailing if "corporate"- * type can be identified.- *- * "corporate" is the same as "as-is" plus getting - * special MODS treatment, so "corporate" type takes- * priority- */-static void-name_determine_flags( int *ctf, int *clf, int *atf, int *alf, char *tag, char *data, list *asis, list *corps )+static int+name_mutlielement_build( newstr *name, intlist *given, intlist *family, list *tokens ) {- int corp_tag_flag = 0, corp_list_flag = 0;- int asis_tag_flag = 0, asis_list_flag = 0;+ unsigned short case_given = 0, case_family = 0, should_split = 0;+ newstr *s;+ int i, m; - if ( strstr( tag, ":CORP" ) ) corp_tag_flag = 1;- else if ( list_find( corps, data ) != -1 )- corp_list_flag = 1;+ /* ...copy and analyze family name */+ for ( i=0; i<family->n; ++i ) {+ m = intlist_get( family, i );+ s = list_get( tokens, m );+ if ( i ) newstr_addchar( name, ' ' );+ newstr_newstrcat( name, s );+ case_family |= unicode_utf8_classify_newstr( s );+ } - if ( strstr( tag, ":ASIS" ) ) {- asis_tag_flag = 1;- if ( list_find( corps, data ) != -1 )- corp_list_flag = 1;- } else {- if ( list_find( corps, data ) != -1 )- corp_list_flag = 1;- else if ( list_find( asis, data ) != -1 )- asis_list_flag = 1;+ /* ...check given name case */+ for ( i=0; i<given->n; ++i ) {+ m = intlist_get( given, i );+ s = list_get( tokens, m );+ case_given |= unicode_utf8_classify_newstr( s ); } - *ctf = corp_tag_flag;- *clf = corp_list_flag;- *atf = asis_tag_flag;- *alf = asis_list_flag;+ if ( ( ( case_family & UNICODE_MIXEDCASE ) == UNICODE_MIXEDCASE ) &&+ ( ( case_given & UNICODE_MIXEDCASE ) == UNICODE_UPPER ) ) {+ should_split = 1;+ }++ for ( i=0; i<given->n; ++i ) {+ m = intlist_get( given, i );+ s = list_get( tokens, m );+ if ( !should_split ) {+ newstr_addchar( name, '|' );+ newstr_newstrcat( name, s );+ } else add_given_split( name, s );+ }+ return 1; } -/*- * return 1 on a nomangle with a newtag value- * return 0 on a name to mangle- */ static int-name_nomangle( char *tag, char *data, newstr *newtag, list *asis, list *corps )+name_construct_multi( newstr *outname, list *tokens, int begin, int end ) {- int corp_tag_flag, corp_list_flag;- int asis_tag_flag, asis_list_flag;- name_determine_flags( &corp_tag_flag, &corp_list_flag,- &asis_tag_flag, &asis_list_flag, tag, data, asis, corps );- if ( corp_tag_flag || corp_list_flag || asis_tag_flag || asis_list_flag ) {- newstr_strcpy( newtag, tag );- if ( corp_tag_flag ) { /* do nothing else */- } else if ( corp_list_flag && !asis_tag_flag ) {- newstr_strcat( newtag, ":CORP" );- } else if ( corp_list_flag && asis_tag_flag ) {- newstr_findreplace( newtag, ":ASIS", ":CORP" );- } else if ( asis_tag_flag ) { /* do nothing else */- } else if ( asis_list_flag ) {- newstr_strcat( newtag, ":ASIS" );+ int i, suffix, suffixpos=-1, comma=-1;+ intlist given, family;+ newstr *s;++ intlist_init( &family );+ intlist_init( &given );++ newstr_empty( outname );++ suffix = has_suffix( tokens, begin, end, &suffixpos );++ for ( i=begin; i<end && comma==-1; i++ ) {+ if ( i==suffixpos ) continue;+ s = list_get( tokens, i );+ if ( s->data[ s->len -1 ] == ',' ) {+ if ( suffix && i==suffixpos-1 && !(suffix&WITHCOMMA) )+ newstr_trimend( s, 1 );+ else+ comma = i; }- return 1; }- else return 0;++ if ( comma != -1 )+ name_multielement_comma( &given, &family, tokens, begin, end, comma, suffixpos );+ else+ name_multielement_nocomma( &given, &family, tokens, begin, end, suffixpos );++ name_mutlielement_build( outname, &given, &family, tokens );++ if ( suffix ) {+ if ( suffix & JUNIOR ) newstr_strcat( outname, "||Jr." );+ if ( suffix & SENIOR ) newstr_strcat( outname, "||Sr." );+ if ( suffix & THIRD ) newstr_strcat( outname, "||III" );+ if ( suffix & FOURTH ) newstr_strcat( outname, "||IV" );+ }++ intlist_free( &given );+ intlist_free( &family );++ return 1; } -static void-name_person( fields *info, char *tag, int level, newstr *inname )+int+name_addmultielement( fields *info, char *tag, list *tokens, int begin, int end, int level ) {- newstr outname;- newstr_init( &outname );- if ( strchr( inname->data, ',' ) ) - name_comma( inname->data, &outname );- else- name_nocomma( inname->data, &outname );- if ( outname.len!=0 )- fields_add( info, tag, outname.data, level );- newstr_free( &outname );+ newstr name;+ int ok;++ newstr_init( &name );++ name_construct_multi( &name, tokens, begin, end );+ ok = fields_add( info, tag, name.data, level );++ newstr_free( &name );++ return ok; } ++/* name_addsingleelement()+ *+ * Treat names that are single tokens, e.g. {Random Corporation, Inc.} in bibtex+ * as a name that should not be mangled (e.g. AUTHOR:ASIS or AUTHOR:CORP, if corp+ * is set).+ */+int+name_addsingleelement( fields *info, char *tag, char *name, int level, int corp )+{+ newstr outtag;+ int ok;+ newstr_init( &outtag );+ newstr_strcpy( &outtag, tag );+ if ( !corp ) newstr_strcat( &outtag, ":ASIS" );+ else newstr_strcat( &outtag, ":CORP" );+ ok = fields_add( info, outtag.data, name, level );+ newstr_free( &outtag );+ return ok;+}+ /*- * name_process+ * Takes a single name in a string and parses it.+ * Skipped by bibtex/biblatex that come pre-parsed. *- * returns 1 if "et al." needs to be added to the list globally+ * Returns 0 on error.+ * Returns 1 on ok.+ * Returns 2 on ok and name in asis list+ * Returns 3 on ok and name in corps list */-static int-name_process( fields *info, char *tag, int level, newstr *inname, list *asis, list *corps )+int+name_parse( newstr *outname, newstr *inname, list *asis, list *corps ) {- newstr newtag;- int add_etal = 0;+ list tokens;+ int ret = 1; - /* keep "names" like " , " from coredumping program */- if ( !inname->len ) return 0;+ newstr_empty( outname );+ if ( !inname || !inname->len ) return ret; - /* identify and process asis or corps names */- newstr_init( &newtag );- if ( name_nomangle( tag, inname->data, &newtag, asis, corps ) ) {- fields_add( info, newtag.data, inname->data, level );+ list_init( &tokens );++ if ( asis && list_find( asis, inname->data ) !=-1 ) {+ newstr_newstrcpy( outname, inname );+ ret = 2;+ goto out;+ } else if ( corps && list_find( corps, inname->data ) != -1 ) {+ newstr_newstrcpy( outname, inname );+ ret = 3;+ goto out;+ }++ newstr_findreplace( inname, ",", ", " );+ list_tokenize( &tokens, inname, ' ', 1 );++ if ( tokens.n==1 ) {+ newstr_newstrcpy( outname, inname );+ ret = 2; } else {- if ( strstr( inname->data, "et al." ) ) {- add_etal = 1;- newstr_findreplace( inname, "et al.", "" );- }- if ( inname->len ) {- name_person( info, tag, level, inname );- }+ name_construct_multi( outname, &tokens, 0, tokens.n );+ ret = 1; }- newstr_free( &newtag );- return add_etal;++out:++ list_free( &tokens );++ return ret; } +static char *+name_copy( newstr *name, char *p )+{+ char *start, *end, *q;++ newstr_empty( name );++ start = p = skip_ws( p );++ /* strip tailing whitespace and commas */+ while ( *p && *p!='|' ) p++;++ end = p;+ while ( is_ws( *end ) || *end==',' || *end=='|' || *end=='\0' )+ end--;+ if ( *p=='|' ) p++;++ for ( q=start; q<=end; q++ )+ newstr_addchar( name, *q );++ return p;+}+ /* * name_add( info, newtag, data, level ) *@@ -325,57 +448,39 @@ * on if the author name is in the format "H. F. Author" or * "Author, H. F." */-void+int name_add( fields *info, char *tag, char *q, int level, list *asis, list *corps ) {- newstr inname, newtag;- char *p, *start, *end;- int add_etal = 0;+ int ok, nametype, ret = 1;+ newstr inname, outname;+ list tokens; - if ( !q ) return;+ if ( !q ) return 0; - newstr_init( &inname );- newstr_init( &newtag );+ list_init( &tokens );+ newstrs_init( &inname, &outname, NULL ); while ( *q ) { - start = q = skip_ws( q );+ q = name_copy( &inname, q ); - /* strip tailing whitespace and commas */- while ( *q && *q!='|' ) q++;- end = q;- while ( is_ws( *end ) || *end==',' || *end=='|' || *end=='\0' )- end--;+ nametype = name_parse( &outname, &inname, asis, corps );+ if ( !nametype ) return 0; - for ( p=start; p<=end; p++ )- newstr_addchar( &inname, *p );+ if ( nametype==1 )+ ok = fields_add( info, tag, outname.data, level );+ else if ( nametype==2 )+ ok = name_addsingleelement( info, tag, outname.data, level, 0 );+ else+ ok = name_addsingleelement( info, tag, outname.data, level, 1 ); - add_etal += name_process( info, tag, level, &inname, asis, corps );-#if 0- /* keep "names" like " , " from coredumping program */- if ( inname.len ) {- if ( name_nomangle( tag, inname.data, &newtag, asis, corps ) ) {- fields_add( info, newtag.data, inname.data, level );- newstr_empty( &newtag );- } else {- if ( strstr( inname.data, "et al." ) ) {- add_etal=1;- newstr_findreplace( &inname, "et al.", "" );- }- if ( inname.len ) name_person( info, tag, level, &inname, asis, corps );- }- newstr_empty( &inname );- }-#endif+ if ( !ok ) { ret = 0; goto out; } - newstr_empty( &inname );- if ( *q=='|' ) q++; }- if ( add_etal ) {- newstr_strcpy( &newtag, tag );- newstr_strcat( &newtag, ":ASIS" );- fields_add( info, newtag.data, "et al.", level );- }- newstr_free( &inname );- newstr_free( &newtag );++out:+ newstrs_free( &inname, &outname, NULL );+ newstr_free( &outname );++ return ret; }
bibutils/name.h view
@@ -3,9 +3,9 @@ * * mangle names w/ and w/o commas *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef NAME_H@@ -15,11 +15,12 @@ #include "list.h" #include "fields.h" -extern void name_nocomma( char *start, newstr *outname );-extern void name_comma( char *p, newstr *outname );-extern void name_add( fields *info, char *tag, char *q, int level,- list *asis, list *corps );-+extern int name_add( fields *info, char *tag, char *q, int level, list *asis, list *corps );+extern void name_build_withcomma( newstr *s, char *p );+extern int name_parse( newstr *outname, newstr *inname, list *asis, list *corps );+extern int name_addsingleelement( fields *info, char *tag, char *name, int level, int corp );+extern int name_addmultielement( fields *info, char *tag, list *tokens, int begin, int end, int level );+extern int name_findetal( list *tokens ); #endif
bibutils/newstr.c view
@@ -1,11 +1,11 @@ /* * newstr.c *- * Version: 9/20/12+ * Version: 12/24/12 *- * Copyright (c) Chris Putnam 1999-2012+ * Copyright (c) Chris Putnam 1999-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * * * routines for dynamically allocated strings@@ -530,7 +530,7 @@ unsigned long i; assert( s ); for ( i=0; i<s->len; ++i )- s->data[i] = toupper( s->data[i] );+ s->data[i] = toupper( (unsigned char)s->data[i] ); } void@@ -539,7 +539,7 @@ unsigned long i; assert( s ); for ( i=0; i<s->len; ++i )- s->data[i] = tolower( s->data[i] );+ s->data[i] = tolower( (unsigned char)s->data[i] ); } /* newstr_swapstrings( s1, s2 )@@ -653,9 +653,9 @@ *uppercase = 0; if ( s->len < 1 ) return; for ( i=0; i<s->len && !( *lowercase && *uppercase ); ++i ) {- if ( isalpha( s->data[i] ) ) {- if ( isupper( s->data[i] ) ) *uppercase += 1;- else if ( islower( s->data[i] ) ) *lowercase += 1;+ if ( isalpha( (unsigned char)s->data[i] ) ) {+ if ( isupper( (unsigned char)s->data[i] ) ) *uppercase += 1;+ else if ( islower( (unsigned char)s->data[i] ) ) *lowercase += 1; } } }
bibutils/newstr.h view
@@ -1,14 +1,13 @@ /* * newstring.h *- * Version: 9/20/12+ * Version: 12/24/12 *- * Copyright (c) Chris Putnam 1999-2011+ * Copyright (c) Chris Putnam 1999-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */- #ifndef NEWSTR_H #define NEWSTR_H
bibutils/newstr_conv.c view
@@ -1,12 +1,11 @@ /* * newstr_conv.c *- * Copyright (c) Chris Putnam 1999-2012+ * Copyright (c) Chris Putnam 1999-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 *- * newstring routines for dynamically allocated strings- * conversions between character sets+ * newstring routines for converting newstrings between character sets * */ #include <stdio.h>@@ -187,7 +186,7 @@ return ch; } -static void+static int write_unicode( newstr *s, unsigned int ch, int charsetout, int latexout, int utf8out, int xmlout ) {@@ -203,25 +202,39 @@ if ( xmlout ) addxmlchar( s, c ); else newstr_addchar( s, c ); }+ return 1; } -void-newstr_convert( newstr *s, +/*+ * Returns 1 on memory error condition+ */+int+newstr_convert( newstr *s, int charsetin, int latexin, int utf8in, int xmlin, int charsetout, int latexout, int utf8out, int xmlout ) {+ unsigned int pos = 0; unsigned int ch; newstr ns;- unsigned int pos = 0;- if ( s->len==0 ) return;+ int ok;++ if ( !s || s->len==0 ) return 1;+ newstr_init( &ns );+ if ( charsetin==CHARSET_UNKNOWN ) charsetin = CHARSET_DEFAULT; if ( charsetout==CHARSET_UNKNOWN ) charsetout = CHARSET_DEFAULT;+ while ( s->data[pos] ) { ch = get_unicode( s, &pos, charsetin, latexin, utf8in, xmlin );- write_unicode( &ns, ch, charsetout, latexout, utf8out, xmlout );+ ok = write_unicode( &ns, ch, charsetout, latexout, utf8out, xmlout );+ if ( !ok ) return 0; }+ newstr_swapstrings( s, &ns );+ newstr_free( &ns );++ return 1; }
bibutils/newstr_conv.h view
@@ -1,12 +1,11 @@ /* * newstring_conv.h *- * Copyright (c) Chris Putnam 1999-2012+ * Copyright (c) Chris Putnam 1999-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */- #ifndef NEWSTR_CONV_H #define NEWSTR_CONV_H @@ -19,7 +18,7 @@ extern int get_charset( char *name ); extern void list_charsets( FILE *fp );-extern void newstr_convert( newstr *s, +extern int newstr_convert( newstr *s, int charsetin, int latexin, int utf8in, int xmlin, int charsetout, int latexout, int utf8out, int xmlout );
bibutils/reftypes.c view
@@ -1,9 +1,9 @@ /* * reftypes.c *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */ #include <stdio.h>@@ -40,4 +40,18 @@ return -1; } -+/* translate_oldtag()+ */+int+translate_oldtag( char *oldtag, int reftype, variants all[], int nall,+ int *processingtype, int *level, char **newtag )+{+ int n;+ n = process_findoldtag( oldtag, reftype, all, nall );+ if ( n!=-1 ) {+ *processingtype = ((all[reftype]).tags[n]).processingtype;+ *level = ((all[reftype]).tags[n]).level;+ *newtag = ((all[reftype]).tags[n]).newstr;+ }+ return n;+}
bibutils/reftypes.h view
@@ -1,33 +1,42 @@ /* * reftypes.h *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #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 NOTES (8)-#define DOI (9)-#define HOWPUBLISHED (10)-#define LINKEDFILE (11)-#define KEYWORD (12)-#define BIBTEX_URL (13)-#define BIBTEX_SENTE (14)-#define BIBTEX_GENRE (15)-#define BIBTEX_EPRINT (16)-#define BIBTEX_ORGANIZATION (17)+/* Reftypes handled by core code */+#define ALWAYS (0)+#define DEFAULT (1) +/* Reftypes to be handled by converters */+#define SIMPLE (2)+#define TYPE (3)+#define PERSON (4)+#define DATE (5)+#define PAGES (6)+#define SERIALNO (7)+#define TITLE (8)+#define NOTES (9)+#define DOI (10)+#define HOWPUBLISHED (11)+#define LINKEDFILE (12)+#define KEYWORD (13)+#define BIBTEX_URL (14)+#define BIBTEX_NOTE (15)+#define BIBTEX_SENTE (16)+#define BIBTEX_GENRE (17)+#define BIBTEX_EPRINT (18)+#define BIBTEX_ORGANIZATION (19)+#define BLT_THESIS_TYPE (20)+#define BLT_SCHOOL (21)+#define BLT_EDITOR (22)+#define BLT_SKIP (23)+ typedef struct { char *oldstr; char *newstr;@@ -43,6 +52,8 @@ extern int get_reftype( char *q, long refnum, char *progname, variants *all, int nall, char *tag ); extern int process_findoldtag( char *oldtag, int reftype, variants all[], int nall );+extern int translate_oldtag( char *oldtag, int reftype, variants all[], int nall, int *processingtype, int *level, char **newtag );+ #endif
bibutils/risin.c view
@@ -1,9 +1,9 @@ /* * risin.c *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */ #include <stdio.h>@@ -189,14 +189,14 @@ } /* oxfordjournals hide the DOI in the NOTES N1 field */-static void+static int risin_addnotes( fields *f, char *tag, newstr *s, int level ) { int doi = is_doi( s->data ); if ( doi!=-1 )- fields_add( f, "DOI", &(s->data[doi]), level );+ return fields_add( f, "DOI", &(s->data[doi]), level ); else- fields_add( f, tag, s->data, level );+ return fields_add( f, tag, s->data, level ); } static int@@ -218,7 +218,7 @@ return 0; } -static void+static int risin_addfile( fields *f, char *tag, newstr *s, int level ) { char *p;@@ -229,68 +229,72 @@ if ( n ) { /* skip past "file:" and store only actual path */ p = s->data + n;- fields_add( f, tag, p, level );- return;+ return fields_add( f, tag, p, level ); } /* if URL is http:, ftp:, etc. store as a URL */ n = is_uri_remote_scheme( s->data ); if ( n ) {- fields_add( f, "URL", s->data, level );- return;+ return fields_add( f, "URL", s->data, level ); } /* badly formed, RIS wants URI, but store value anyway */- fields_add( f, tag, s->data, level );+ return fields_add( f, tag, s->data, level ); } /* scopus puts DOI in the DO or DI tag, but it needs cleaning */-static void+static int risin_adddoi( fields *f, char *tag, newstr *s, int level ) { int doi = is_doi( s->data ); if ( doi!=-1 )- fields_add( f, "DOI", &(s->data[doi]), level );+ return fields_add( f, "DOI", &(s->data[doi]), level );+ else return 1; } -static void+static int risin_adddate( fields *f, char *tag, newstr *d, int level ) { char *p = d->data; newstr date;- int part = ( !strncasecmp( tag, "PART", 4 ) );+ int part = ( !strncasecmp( tag, "PART", 4 ) ), ok; newstr_init( &date ); while ( *p && *p!='/' ) newstr_addchar( &date, *p++ ); if ( *p=='/' ) p++; if ( date.len>0 ) {- if ( part ) fields_add( f, "PARTYEAR", date.data, level );- else fields_add( f, "YEAR", date.data, level );+ if ( part ) ok = fields_add( f, "PARTYEAR", date.data, level );+ else ok = fields_add( f, "YEAR", date.data, level );+ if ( !ok ) return 0; } newstr_empty( &date ); while ( *p && *p!='/' ) newstr_addchar( &date, *p++ ); if ( *p=='/' ) p++; if ( date.len>0 ) {- if ( part ) fields_add( f, "PARTMONTH", date.data, level );- else fields_add( f, "MONTH", date.data, level );+ if ( part ) ok = fields_add( f, "PARTMONTH", date.data, level );+ else ok = fields_add( f, "MONTH", date.data, level );+ if ( !ok ) return 0; } newstr_empty( &date ); while ( *p && *p!='/' ) newstr_addchar( &date, *p++ ); if ( *p=='/' ) p++; if ( date.len>0 ) {- if ( part ) fields_add( f, "PARTDAY", date.data, level );- else fields_add( f, "DAY", date.data, level );+ if ( part ) ok = fields_add( f, "PARTDAY", date.data, level );+ else ok = fields_add( f, "DAY", date.data, level );+ if ( !ok ) return 0; } newstr_empty( &date ); while ( *p ) newstr_addchar( &date, *p++ ); if ( date.len>0 ) {- if ( part ) fields_add( f, "PARTDATEOTHER", date.data,level);- else fields_add( f, "DATEOTHER", date.data, level );+ if ( part ) ok = fields_add( f, "PARTDATEOTHER", date.data,level);+ else ok = fields_add( f, "DATEOTHER", date.data, level );+ if ( !ok ) return 0; } newstr_free( &date );+ return 1; } int@@ -318,10 +322,10 @@ } } -void+int risin_convertf( fields *risin, fields *f, int reftype, param *p, variants *all, int nall ) {- int process, level, i, n, nfields;+ int process, level, i, n, nfields, ok; char *outtag, *tag, *value; newstr *t, *d; @@ -329,60 +333,55 @@ for ( i=0; i<nfields; ++i ) { t = fields_tag( risin, i, FIELDS_STRP );- n = process_findoldtag( t->data, reftype, all, nall );+ n = translate_oldtag( t->data, reftype, all, nall, &process, &level, &outtag ); if ( n==-1 ) { risin_report_notag( p, t->data ); continue; }- process = ((all[reftype]).tags[n]).processingtype;- level = ((all[reftype]).tags[n]).level;- outtag = ((all[reftype]).tags[n]).newstr;+ if ( process==ALWAYS ) continue; /* add in core code */+ d = fields_value( risin, i, FIELDS_STRP ); switch ( process ) { case SIMPLE:- fields_add( f, outtag, d->data, level );+ ok = fields_add( f, outtag, d->data, level ); break; case PERSON:- name_add( f, outtag, d->data, level, &(p->asis), - &(p->corps) );+ ok = name_add( f, outtag, d->data, level, &(p->asis), &(p->corps) ); break; case TITLE:- title_process( f, outtag, d->data, level, - p->nosplittitle );+ ok = title_process( f, outtag, d->data, level, p->nosplittitle ); break; case SERIALNO:- addsn( f, d->data, level );+ ok = addsn( f, d->data, level ); break; case DATE:- risin_adddate( f, outtag, d, level );+ ok = risin_adddate( f, outtag, d, level ); break; case NOTES:- risin_addnotes( f, outtag, d, level );+ ok = risin_addnotes( f, outtag, d, level ); break; case DOI:- risin_adddoi( f, outtag, d, level );+ ok = risin_adddoi( f, outtag, d, level ); break; case LINKEDFILE:- risin_addfile( f, outtag, d, level );- break;-- case ALWAYS:- /* Handled by core code */+ ok = risin_addfile( f, outtag, d, level ); break; default:+ ok = 1; break; }+ if ( !ok ) return BIBL_ERR_MEMERR; } /* look for thesis-type hint */@@ -395,8 +394,12 @@ !strcasecmp(value,"Masters Thesis")|| !strcasecmp(value,"Diploma Thesis")|| !strcasecmp(value,"Doctoral Thesis")||- !strcasecmp(value,"Habilitation Thesis"))- fields_add( f, "GENRE", value, 0 );+ !strcasecmp(value,"Habilitation Thesis")) {+ ok = fields_add( f, "GENRE", value, 0 );+ if ( !ok ) return BIBL_ERR_MEMERR;+ } } }++ return BIBL_OK; }
bibutils/risin.h view
@@ -1,9 +1,9 @@ /* * risin.h *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef RISIN_H@@ -17,7 +17,7 @@ extern int risin_readf( FILE *fp, char *buf, int bufsize, int *bufpos, newstr *line, newstr *reference, int *fcharset ); extern int risin_processf( fields *risin, char *p, char *filename, long nref ); 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 int risin_convertf( fields *risin, fields *info, int reftype, param *p, variants *all, int nall ); extern void risin_initparams( param *p, const char *progname );
bibutils/risout.c view
@@ -1,9 +1,9 @@ /* * risout.c *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */ #include <stdio.h>@@ -15,6 +15,7 @@ #include "strsearch.h" #include "fields.h" #include "doi.h"+#include "name.h" #include "risout.h" void@@ -68,6 +69,7 @@ TYPE_DIPLOMATHESIS, /* thesis */ TYPE_DOCTORALTHESIS, /* thesis */ TYPE_HABILITATIONTHESIS, /* thesis */+ TYPE_MAP, /* map, cartographic data */ TYPE_UNPUBLISHED, /* unpublished */ }; @@ -103,6 +105,7 @@ { "abstract or summary", TYPE_ABSTRACT }, { "patent", TYPE_PATENT }, { "unpublished", TYPE_UNPUBLISHED },+ { "map", TYPE_MAP }, }; int nmatch_genres = sizeof( match_genres ) / sizeof( match_genres[0] ); int type, i, j;@@ -146,6 +149,7 @@ { match_type match_res[] = { { "software, multimedia", TYPE_PROGRAM },+ { "cartographic", TYPE_MAP }, }; int nmatch_res = sizeof( match_res ) / sizeof( match_res[0] ); int type, i, j;@@ -233,6 +237,7 @@ { "THES", TYPE_DIPLOMATHESIS }, { "THES", TYPE_DOCTORALTHESIS }, { "THES", TYPE_HABILITATIONTHESIS },+ { "MAP", TYPE_MAP }, { "UNPB", TYPE_UNPUBLISHED } }; int ntyout = sizeof( tyout ) / sizeof( tyout[0] );@@ -257,36 +262,20 @@ } static void-output_person ( FILE *fp, char *p )-{- int nseps = 0, nch;- while ( *p ) {- nch = 0;- if ( nseps==1 ) fprintf( fp, "," );- if ( nseps ) fprintf( fp, " " );- while ( *p && *p!='|' ) {- fprintf( fp, "%c", *p++ );- nch++;- }- if ( *p=='|' ) p++;- if ( nseps!=0 && nch==1 ) fprintf( fp, "." ); - nseps++;- }-}--static void output_people( FILE *fp, fields *f, char *tag, char *ristag, int level ) {+ newstr oneperson; vplist people; int i;+ newstr_init( &oneperson ); vplist_init( &people ); fields_findv_each( f, level, FIELDS_CHRP, &people, tag ); for ( i=0; i<people.n; ++i ) {- fprintf( fp, "%s - ", ristag );- output_person( fp, ( char * ) vplist_get( &people, i ) );- fprintf( fp, "\n" );+ name_build_withcomma( &oneperson, ( char * ) vplist_get( &people, i ) );+ fprintf( fp, "%s - %s\n", ristag, oneperson.data ); } vplist_free( &people );+ newstr_free( &oneperson ); } static void@@ -299,7 +288,7 @@ char *day = fields_findv_firstof( f, LEVEL_ANY, FIELDS_CHRP, "DAY", "PARTDAY", NULL ); if ( year )- fprintf( fp, "PY - " );+ fprintf( fp, "PY - %s\n", year ); if ( year || month || day ) { fprintf( fp, "DA - " ); if ( year ) fprintf( fp, "%s", year );@@ -330,16 +319,38 @@ fprintf( fp, "\n" ); } -static void-output_title( FILE *fp, fields *f, char *ristag, int level )+static int+type_is_element( int type ) {- output_titlecore( fp, f, ristag, level, "TITLE", "SUBTITLE" );+ if ( type==TYPE_ARTICLE ) return 1;+ if ( type==TYPE_INBOOK ) return 1;+ if ( type==TYPE_MAGARTICLE ) return 1;+ if ( type==TYPE_NEWS ) return 1;+ if ( type==TYPE_ABSTRACT ) return 1;+ return 0; } +static int+type_uses_journal( int type )+{+ if ( type==TYPE_ARTICLE ) return 1;+ if ( type==TYPE_MAGARTICLE ) return 1;+ return 0;+}+ static void-output_abbrtitle( FILE *fp, fields *f, char *ristag, int level )+output_alltitles( FILE *fp, fields *f, int type ) {- output_titlecore( fp, f, ristag, level, "SHORTTITLE", "SHORTSUBTITLE" );+ output_titlecore( fp, f, "TI", 0, "TITLE", "SUBTITLE" );+ output_titlecore( fp, f, "T2", -1, "SHORTTITLE", "SHORTSUBTITLE" );+ if ( type_is_element( type ) ) {+ if ( type_uses_journal( type ) )+ output_titlecore( fp, f, "JO", 1, "TITLE", "SUBTITLE" );+ else output_titlecore( fp, f, "BT", 1, "TITLE", "SUBTITLE" );+ output_titlecore( fp, f, "T3", 2, "TITLE", "SUBTITLE" );+ } else {+ output_titlecore( fp, f, "T3", 1, "TITLE", "SUBTITLE" );+ } } static void@@ -480,12 +491,9 @@ vplist_free( &a ); } -void-risout_write( fields *f, FILE *fp, param *p, unsigned long refnum )+static void+output_allpeople( FILE *fp, fields *f, int type ) {- int type;- type = get_type( f );- output_type( fp, type, p ); output_people( fp, f, "AUTHOR", "AU", LEVEL_MAIN ); output_easyall( fp, f, "AUTHOR:CORP", "AU", LEVEL_MAIN ); output_easyall( fp, f, "AUTHOR:ASIS", "AU", LEVEL_MAIN );@@ -495,17 +503,36 @@ output_people( fp, f, "AUTHOR", "A3", LEVEL_SERIES ); output_easyall( fp, f, "AUTHOR:CORP", "A3", LEVEL_SERIES ); output_easyall( fp, f, "AUTHOR:ASIS", "A3", LEVEL_SERIES );- output_people( fp, f, "EDITOR", "ED", LEVEL_ANY );- output_easyall( fp, f, "EDITOR:CORP", "ED", LEVEL_ANY );- output_easyall( fp, f, "EDITOR:ASIS", "ED", LEVEL_ANY );- output_date( fp, f );- output_title( fp, f, "TI", 0 );- output_abbrtitle( fp, f, "T2", -1 );- if ( type==TYPE_ARTICLE || type==TYPE_MAGARTICLE ) {- output_title( fp, f, "JO", 1 );+ output_people( fp, f, "EDITOR", "ED", LEVEL_MAIN );+ output_easyall( fp, f, "EDITOR:CORP", "ED", LEVEL_MAIN );+ output_easyall( fp, f, "EDITOR:ASIS", "ED", LEVEL_MAIN );+ if ( type_is_element( type ) ) {+ output_people( fp, f, "EDITOR", "ED", LEVEL_HOST );+ output_easyall( fp, f, "EDITOR:CORP", "ED", LEVEL_HOST );+ output_easyall( fp, f, "EDITOR:ASIS", "ED", LEVEL_HOST );+ } else {+ output_people( fp, f, "EDITOR", "A3", LEVEL_HOST );+ output_easyall( fp, f, "EDITOR:CORP", "A3", LEVEL_HOST );+ output_easyall( fp, f, "EDITOR:ASIS", "A3", LEVEL_HOST ); }- else output_title( fp, f, "BT", 1 );- output_title( fp, f, "T3", 2 );+ output_people( fp, f, "EDITOR", "A3", LEVEL_SERIES );+ output_easyall( fp, f, "EDITOR:CORP", "A3", LEVEL_SERIES );+ output_easyall( fp, f, "EDITOR:ASIS", "A3", LEVEL_SERIES );+}++void+risout_write( fields *f, FILE *fp, param *p, unsigned long refnum )+{+ int type;+ type = get_type( f );+ output_type( fp, type, p );++ output_allpeople( fp, f, type );++ output_date( fp, f );++ output_alltitles( fp, f, type );+ output_pages( fp, f ); output_easy( fp, f, "VOLUME", "VL", LEVEL_ANY ); output_easy( fp, f, "ISSUE", "IS", LEVEL_ANY );
bibutils/risout.h view
@@ -1,7 +1,9 @@ /* * risout.h *- * Copyright (c) Chris Putnam 2005-2012+ * Copyright (c) Chris Putnam 2005-2013+ *+ * Source code released under the GPL version 2 * */ #ifndef RISOUT_H
bibutils/ristypes.c view
@@ -1,12 +1,11 @@ /* * ristypes.c *- * Copyright (c) Chris Putnam 2003-2012+ * Copyright (c) Chris Putnam 2003-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */- #include <stdio.h> #include <stdlib.h> #include <string.h>@@ -16,7 +15,7 @@ static lookups generic[] = { { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */ { "A2", "AUTHOR", PERSON, LEVEL_HOST }, /* 'Secondary' Author */- { "A3", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author */+ { "A3", "EDITOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author -- Series editors */ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */@@ -91,7 +90,7 @@ static lookups article[] = { { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */ { "A2", "AUTHOR", PERSON, LEVEL_HOST }, /* 'Secondary' Author */- { "A3", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author */+ { "A3", "EDITOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author -- Series editor */ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */@@ -172,7 +171,7 @@ static lookups magarticle[] = { { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */ { "A2", "AUTHOR", PERSON, LEVEL_HOST }, /* 'Secondary' Author */- { "A3", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author */+ { "A3", "EDITOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author - Series editors */ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */@@ -250,7 +249,7 @@ static lookups newsarticle[] = { { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */ { "A2", "AUTHOR", PERSON, LEVEL_HOST }, /* 'Secondary' Author */- { "A3", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author */+ { "A3", "EDITOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author - Series editor */ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */@@ -328,7 +327,7 @@ static lookups book[] = { { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */ { "A2", "AUTHOR", PERSON, LEVEL_HOST }, /* 'Secondary' Author */- { "A3", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author */+ { "A3", "EDITOR", PERSON, LEVEL_HOST }, /* 'Tertiary' Author - Series editor */ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */@@ -384,8 +383,8 @@ { "SP", "PAGESTART", SIMPLE, LEVEL_MAIN }, /* Start Page */ { "ST", "SHORTTITLE", SIMPLE, LEVEL_MAIN }, /* Short Title */ { "T1", "TITLE", TITLE, LEVEL_MAIN }, /* Deprecated? */- { "T2", "SHORTTITLE", SIMPLE, LEVEL_HOST }, /* 'Secondary' Title */- { "T3", "TITLE", SIMPLE, LEVEL_SERIES }, /* 'Tertiary' Title */+ { "T2", "SHORTTITLE", SIMPLE, LEVEL_HOST }, /* 'Secondary' Title -- here abbreviated title for series*/+ { "T3", "TITLE", SIMPLE, LEVEL_HOST }, /* 'Tertiary' Title -- series title */ { "TI", "TITLE", TITLE, LEVEL_MAIN }, /* Title */ { "TT", "TRANSTITLE", TITLE, LEVEL_MAIN }, /* Translated Title */ { "U1", "NOTES", NOTES, LEVEL_MAIN }, /* 'User' - Deprecated? */@@ -406,7 +405,7 @@ static lookups inbook[] = { { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */ { "A2", "AUTHOR", PERSON, LEVEL_HOST }, /* 'Secondary' Author */- { "A3", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author */+ { "A3", "EDITOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author - series editor */ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */@@ -462,7 +461,7 @@ { "SP", "PAGESTART", SIMPLE, LEVEL_MAIN }, /* Start Page */ { "ST", "SHORTTITLE", SIMPLE, LEVEL_MAIN }, /* Short Title */ { "T1", "TITLE", TITLE, LEVEL_MAIN }, /* Deprecated? */- { "T2", "SHORTTITLE", SIMPLE, LEVEL_HOST }, /* 'Secondary' Title */+ { "T2", "SHORTTITLE", SIMPLE, LEVEL_SERIES }, /* 'Secondary' Title -- here abbreviated title for series*/ { "T3", "TITLE", SIMPLE, LEVEL_SERIES }, /* 'Tertiary' Title */ { "TI", "TITLE", TITLE, LEVEL_MAIN }, /* Title */ { "TT", "TRANSTITLE", TITLE, LEVEL_MAIN }, /* Translated Title */@@ -484,13 +483,12 @@ static lookups conference[] = { { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */- { "A2", "AUTHOR", PERSON, LEVEL_HOST }, /* 'Secondary' Author */- { "A3", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author */+ { "A2", "AUTHOR:ASIS", SIMPLE, LEVEL_HOST }, /* 'Secondary' Author - Name of conference */+ { "A3", "EDITOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author - Series editor */ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */ { "AU", "AUTHOR", PERSON, LEVEL_MAIN }, /* Author */- { "BT", "TITLE", SIMPLE, LEVEL_HOST }, /* Book Title - Deprecated? */ { "C1", "NOTES", NOTES, LEVEL_MAIN }, /* 'Custom' - put in "notes" */ { "C2", "NOTES", NOTES, LEVEL_MAIN }, /* 'Custom' - put in "notes" */ { "C3", "NOTES", NOTES, LEVEL_MAIN }, /* 'Custom' - put in "notes" */@@ -541,8 +539,9 @@ { "SP", "PAGESTART", SIMPLE, LEVEL_MAIN }, /* Start Page */ { "ST", "SHORTTITLE", SIMPLE, LEVEL_MAIN }, /* Short Title */ { "T1", "TITLE", TITLE, LEVEL_MAIN }, /* Deprecated? */- { "T2", "SHORTTITLE", SIMPLE, LEVEL_HOST }, /* 'Secondary' Title */- { "T3", "TITLE", SIMPLE, LEVEL_SERIES }, /* 'Tertiary' Title */+ { "BT", "TITLE", SIMPLE, LEVEL_HOST }, /* Book Title */+ { "T2", "SHORTTITLE", SIMPLE, LEVEL_SERIES }, /* 'Secondary' Title - Abbreviated series TItle*/+ { "T3", "TITLE", SIMPLE, LEVEL_SERIES }, /* 'Tertiary' Title - Series Title*/ { "TI", "TITLE", TITLE, LEVEL_MAIN }, /* Title */ { "TT", "TRANSTITLE", TITLE, LEVEL_MAIN }, /* Translated Title */ { "U1", "NOTES", NOTES, LEVEL_MAIN }, /* 'User' - Deprecated? */@@ -563,7 +562,7 @@ static lookups statute[] = { { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */ { "A2", "AUTHOR", PERSON, LEVEL_HOST }, /* 'Secondary' Author */- { "A3", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author */+ { "A3", "EDITOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author - Series editor */ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */@@ -641,7 +640,7 @@ static lookups hearing[] = { { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */ { "A2", "AUTHOR", PERSON, LEVEL_HOST }, /* 'Secondary' Author */- { "A3", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author */+ { "A3", "EDITOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author - series editor */ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */@@ -718,7 +717,7 @@ static lookups cases[] = { { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */ { "A2", "AUTHOR", PERSON, LEVEL_HOST }, /* 'Secondary' Author */- { "A3", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author */+ { "A3", "EDITOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author - series editor */ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */@@ -795,7 +794,7 @@ static lookups communication[] = { { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */ { "A2", "RECIPIENT", PERSON, LEVEL_MAIN }, /* SPECIAL */- { "A3", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author */+ { "A3", "EDITOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author - Series editor */ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */@@ -872,7 +871,7 @@ static lookups thesis[] = { { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */ { "A2", "AUTHOR", PERSON, LEVEL_HOST }, /* 'Secondary' Author */- { "A3", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author */+ { "A3", "EDITOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author - Series editor */ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */@@ -950,7 +949,7 @@ static lookups report[] = { { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */ { "A2", "AUTHOR", PERSON, LEVEL_HOST }, /* 'Secondary' Author */- { "A3", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author */+ { "A3", "EDITOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author - Series editor */ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */@@ -1028,7 +1027,7 @@ static lookups abstract[] = { { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */ { "A2", "AUTHOR", PERSON, LEVEL_HOST }, /* 'Secondary' Author */- { "A3", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author */+ { "A3", "EDITOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author - Series editor */ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */@@ -1104,7 +1103,7 @@ static lookups program[] = { { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */ { "A2", "AUTHOR", PERSON, LEVEL_HOST }, /* 'Secondary' Author */- { "A3", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author */+ { "A3", "EDITOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author - Series editor */ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */@@ -1180,7 +1179,7 @@ static lookups patent[] = { { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */ { "A2", "AUTHOR", PERSON, LEVEL_HOST }, /* 'Secondary' Author */- { "A3", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author */+ { "A3", "EDITOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author - Series editor */ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */@@ -1257,7 +1256,7 @@ static lookups electric[] = { { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */ { "A2", "AUTHOR", PERSON, LEVEL_HOST }, /* 'Secondary' Author */- { "A3", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author */+ { "A3", "EDITOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author - Series editor */ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */@@ -1334,7 +1333,7 @@ static lookups pamphlet[] = { { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */ { "A2", "AUTHOR", PERSON, LEVEL_HOST }, /* 'Secondary' Author */- { "A3", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author */+ { "A3", "EDITOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author - Series editor */ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */@@ -1408,10 +1407,87 @@ { " ", "GENRE|pamphlet", ALWAYS, LEVEL_MAIN }, }; +static lookups map[] = {+ { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */+ { "A2", "AUTHOR", PERSON, LEVEL_HOST }, /* 'Secondary' Author */+ { "A3", "EDITOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author - Series editor */+ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */+ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */+ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */+ { "AU", "AUTHOR", PERSON, LEVEL_MAIN }, /* Author */+ { "BT", "TITLE", SIMPLE, LEVEL_HOST }, /* Deprecated? */+ { "C1", "NOTES", NOTES, LEVEL_MAIN }, /* 'Custom' - put in "notes" */+ { "C2", "NOTES", NOTES, LEVEL_MAIN }, /* 'Custom' - put in "notes" */+ { "C3", "NOTES", NOTES, LEVEL_MAIN }, /* 'Custom' - put in "notes" */+ { "C4", "NOTES", NOTES, LEVEL_MAIN }, /* 'Custom' - put in "notes" */+ { "C5", "NOTES", NOTES, LEVEL_MAIN }, /* 'Custom' - put in "notes" */+ { "C6", "NOTES", NOTES, LEVEL_MAIN }, /* 'Custom' - put in "notes" */+ { "C7", "NOTES", NOTES, LEVEL_MAIN }, /* 'Custom' - put in "notes" */+ { "C8", "NOTES", NOTES, LEVEL_MAIN }, /* 'Custom' - put in "notes" */+ { "CA", "CAPTION", SIMPLE, LEVEL_MAIN }, /* Caption */+ { "CN", "CALLNUMBER", SIMPLE, LEVEL_MAIN }, /* Call Number */+ { "CP", "ISSUE", SIMPLE, LEVEL_MAIN }, /* Deprecated? */+ { "CT", "ADDRESS", SIMPLE, LEVEL_MAIN }, /* Deprecated? */+ { "CY", "ADDRESS", SIMPLE, LEVEL_MAIN }, /* Place Published */+ { "DA", "YEAR", DATE, LEVEL_MAIN }, /* Date */+ { "DB", "DATABASE", SIMPLE, LEVEL_MAIN }, /* Name of Database */+ { "DI", "DOI", DOI, LEVEL_MAIN }, /* Deprecated? */+ { "DO", "DOI", DOI, LEVEL_MAIN }, /* DOI */+ { "DP", "DATABASEPROV", SIMPLE, LEVEL_MAIN }, /* Database Provider */+ { "ED", "EDITOR", PERSON, LEVEL_MAIN }, /* Deprecated? */+ { "EP", "PAGEEND", SIMPLE, LEVEL_MAIN }, /* End Page */+ { "ET", "EDITION", SIMPLE, LEVEL_MAIN }, /* Edition */+ { "ID", "REFNUM", SIMPLE, LEVEL_MAIN }, /* Deprecated? */+ { "IS", "ISSUE", SIMPLE, LEVEL_MAIN }, /* Number */+ { "JA", "TITLE", SIMPLE, LEVEL_HOST }, /* Deprecated? */+ { "J1", "TITLE", SIMPLE, LEVEL_HOST }, /* Deprecated? */+ { "J2", "TITLE", SIMPLE, LEVEL_HOST }, /* Alternate Title, abbreviated book or journal */+ { "JF", "TITLE", SIMPLE, LEVEL_HOST }, /* Deprecated? */+ { "JO", "TITLE", SIMPLE, LEVEL_HOST }, /* Deprecated? */+ { "KW", "KEYWORD", SIMPLE, LEVEL_MAIN }, /* Keywords */+ { "L1", "FILEATTACH", LINKEDFILE, LEVEL_MAIN }, /* File Attachments (local, not URL) */+ { "L4", "FIGATTACH", LINKEDFILE, LEVEL_MAIN }, /* Figure Attachment (local, not URL) */+ { "LA", "LANGUAGE", SIMPLE, LEVEL_MAIN }, /* Language */+ { "LB", "LABEL", SIMPLE, LEVEL_MAIN }, /* Label */+ { "M1", "NOTES", NOTES, LEVEL_MAIN }, /* Misc or Number? */+ { "M2", "NOTES", NOTES, LEVEL_MAIN }, /* Misc or Deprecated? */+ { "M3", "NOTES", NOTES, LEVEL_MAIN }, /* Misc or Type of Work? */+ { "N1", "NOTES", NOTES, LEVEL_MAIN }, /* Notes */+ { "N2", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Deprecated? */+ { "NV", "NUMVOLUMES", SIMPLE, LEVEL_MAIN }, /* Number of Volumes */+ { "OP", "ORIGPUB", SIMPLE, LEVEL_MAIN }, /* Original Publication */+ { "PB", "PUBLISHER", SIMPLE, LEVEL_MAIN }, /* Publisher */+ { "PY", "YEAR", DATE, LEVEL_MAIN }, /* Year */+ { "RI", "REVIEWEDITEM", SIMPLE, LEVEL_MAIN }, /* Reviewed Item */+ { "RN", "NOTES", SIMPLE, LEVEL_MAIN }, /* Resarch Notes -> Notes */+ { "RP", "REPRINTSTATUS",SIMPLE, LEVEL_MAIN }, /* Reprint Edition */+ { "SE", "SECTION", SIMPLE, LEVEL_MAIN }, /* Section */+ { "SN", "SERIALNUMBER", SERIALNO,LEVEL_MAIN }, /* ISBN/ISSN */+ { "SP", "PAGESTART", SIMPLE, LEVEL_MAIN }, /* Start Page */+ { "ST", "SHORTTITLE", SIMPLE, LEVEL_MAIN }, /* Short Title */+ { "T1", "TITLE", TITLE, LEVEL_MAIN }, /* Deprecated? */+ { "T2", "SHORTTITLE", SIMPLE, LEVEL_HOST }, /* 'Secondary' Title */+ { "T3", "TITLE", SIMPLE, LEVEL_SERIES }, /* 'Tertiary' Title */+ { "TI", "TITLE", TITLE, LEVEL_MAIN }, /* Title */+ { "TT", "TRANSTITLE", TITLE, LEVEL_MAIN }, /* Translated Title */+ { "U1", "NOTES", NOTES, LEVEL_MAIN }, /* 'User' - Deprecated? */+ { "U2", "NOTES", NOTES, LEVEL_MAIN }, /* 'User' - Deprecated? */+ { "U3", "NOTES", NOTES, LEVEL_MAIN }, /* 'User' - Deprecated? */+ { "U4", "NOTES", NOTES, LEVEL_MAIN }, /* 'User' - Deprecated? */+ { "U5", "NOTES", NOTES, LEVEL_MAIN }, /* 'User' - Deprecated? */+ { "UR", "URL", SIMPLE, LEVEL_MAIN }, /* URL */+ { "VL", "VOLUME", SIMPLE, LEVEL_MAIN }, /* Volume */+ { "VO", "VOLUME", SIMPLE, LEVEL_MAIN }, /* Deprecated? */+ { "Y1", "YEAR", DATE, LEVEL_MAIN }, /* Deprecated? */+ { "Y2", "MONTH", SIMPLE, LEVEL_MAIN }, /* Access Date */+ { " ", "RESOURCE|cartographic", ALWAYS, LEVEL_MAIN },+ { " ", "GENRE|map", ALWAYS, LEVEL_MAIN }+};+ static lookups unpublished[] = { { "A1", "AUTHOR", PERSON, LEVEL_MAIN }, /* Deprecated? */ { "A2", "AUTHOR", PERSON, LEVEL_HOST }, /* 'Secondary' Author */- { "A3", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author */+ { "A3", "EDITOR", PERSON, LEVEL_SERIES }, /* 'Tertiary' Author - Series editor */ { "A4", "AUTHOR", PERSON, LEVEL_SERIES }, /* 'Subsidiary' Author */ { "AB", "ABSTRACT", SIMPLE, LEVEL_MAIN }, /* Abstract */ { "AD", "AUTHORADDRESS",SIMPLE, LEVEL_MAIN }, /* Author Address */@@ -1510,6 +1586,7 @@ REFTYPE( "ABST", abstract ), REFTYPE( "COMP", program ), REFTYPE( "PAT", patent ),+ REFTYPE( "MAP", map ), REFTYPE( "UNPB", unpublished ), };
bibutils/serialno.c view
@@ -1,15 +1,15 @@ /* * serialno.c *- * Copyright (c) Chris Putnam 2005-2012+ * Copyright (c) Chris Putnam 2005-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #include <string.h> #include "serialno.h" -void+int addsn( fields *info, char *buf, int level ) { int ndigits=0, issn=0, isbn=0;@@ -30,7 +30,7 @@ else if ( ndigits==10 || ndigits==13 ) isbn = 1; } - if ( issn ) fields_add( info, "ISSN", buf, level );- else if ( isbn ) fields_add( info, "ISBN", buf, level );- else fields_add( info, "SERIALNUMBER", buf, level );+ if ( issn ) return fields_add( info, "ISSN", buf, level );+ else if ( isbn ) return fields_add( info, "ISBN", buf, level );+ else return fields_add( info, "SERIALNUMBER", buf, level ); }
bibutils/serialno.h view
@@ -1,9 +1,9 @@ /* * serialno.h *- * Copyright (c) Chris Putnam 2005-2012+ * Copyright (c) Chris Putnam 2005-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef SERIALNO_H@@ -11,6 +11,6 @@ #include <stdio.h> #include "fields.h" -extern void addsn( fields *info, char *buf, int level );+extern int addsn( fields *info, char *buf, int level ); #endif
bibutils/strsearch.c view
@@ -1,8 +1,8 @@ /* strsearch.c *- * Copyright (c) Chris Putnam 1995-2012+ * Copyright (c) Chris Putnam 1995-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * * strsearch() locates a case-independent substring * e.g. a case-independent version of strstr()@@ -14,8 +14,8 @@ * * strsearch returns haystack when needle is empty as per strstr() * conventions+ * */- #include <stdio.h> #include <ctype.h> #include "strsearch.h"@@ -28,7 +28,7 @@ if ( !(*needle) ) returnptr = (char *) haystack; while (*(haystack+pos) && returnptr==NULL) {- if ( toupper(*(haystack+pos)) == toupper(*(needle+pos)) )+ if ( toupper((unsigned char)*(haystack+pos)) == toupper((unsigned char)*(needle+pos)) ) pos++; else { pos = 0;
bibutils/strsearch.h view
@@ -1,12 +1,11 @@ /* * strsearch.h *- * Copyright (c) Chris Putnam 1995-2012+ * Copyright (c) Chris Putnam 1995-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */- #ifndef STRSEARCH_H #define STRSEARCH_H
bibutils/title.c view
@@ -3,9 +3,9 @@ * * process titles into title/subtitle pairs for MODS *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #include <stdio.h>@@ -16,12 +16,14 @@ #include "title.h" #include "is_ws.h" -void+int title_process( fields *info, char *tag, char *data, int level, - unsigned char nosplittitle )+ unsigned char nosplittitle ) { newstr title, subtitle; char *p, *q;+ int ok;+ newstr_init( &title ); newstr_init( &subtitle ); @@ -42,17 +44,25 @@ } if ( strncasecmp( "SHORT", tag, 5 ) ) {- if ( title.len>0 ) - fields_add( info, "TITLE", title.data, level );- if ( subtitle.len>0 ) - fields_add( info, "SUBTITLE", subtitle.data, level );+ if ( title.len>0 ) {+ ok = fields_add( info, "TITLE", title.data, level );+ if ( !ok ) return 0;+ }+ if ( subtitle.len>0 ) {+ ok = fields_add( info, "SUBTITLE", subtitle.data, level );+ if ( !ok ) return 0;+ } } else {- if ( title.len>0 )- fields_add( info, "SHORTTITLE", title.data, level );+ if ( title.len>0 ) {+ ok = fields_add( info, "SHORTTITLE", title.data, level );+ if ( !ok ) return 0;+ } /* no SHORT-SUBTITLE! */ } newstr_free( &subtitle ); newstr_free( &title );++ return 1; }
bibutils/title.h view
@@ -3,9 +3,9 @@ * * process titles into title/subtitle pairs for MODS *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Source code released under the GPL+ * Source code released under the GPL verison 2 * */ #ifndef TITLE_H@@ -14,7 +14,7 @@ #include "newstr.h" #include "fields.h" -extern void title_process( fields *info, char *tag, char *data, int level,+extern int title_process( fields *info, char *tag, char *data, int level, unsigned char nosplittitle ); #endif
+ bibutils/unicode.c view
@@ -0,0 +1,333 @@+/*+ * unicode.c+ *+ * Helper unicode functions/values to determine the+ * types of unicode characters.+ */+#include "utf8.h"+#include "unicode.h"++typedef struct {+ unsigned int value;+ unsigned short info;+} unicodeinfo_t;++static unicodeinfo_t unicodeinfo[] = {+ { 48, UNICODE_NUMBER }, /* 0 */+ { 49, UNICODE_NUMBER }, /* 1 */+ { 50, UNICODE_NUMBER }, /* 2 */+ { 51, UNICODE_NUMBER }, /* 3 */+ { 52, UNICODE_NUMBER }, /* 4 */+ { 53, UNICODE_NUMBER }, /* 5 */+ { 54, UNICODE_NUMBER }, /* 6 */+ { 55, UNICODE_NUMBER }, /* 7 */+ { 56, UNICODE_NUMBER }, /* 8 */+ { 57, UNICODE_NUMBER }, /* 9 */+ { 65, UNICODE_UPPER }, /* Latin Capital A */+ { 66, UNICODE_UPPER }, /* Latin Capital B */+ { 67, UNICODE_UPPER }, /* Latin Capital C */+ { 68, UNICODE_UPPER }, /* Latin Capital D */+ { 69, UNICODE_UPPER }, /* Latin Capital E */+ { 70, UNICODE_UPPER }, /* Latin Capital F */+ { 71, UNICODE_UPPER }, /* Latin Capital G */+ { 72, UNICODE_UPPER }, /* Latin Capital H */+ { 73, UNICODE_UPPER }, /* Latin Capital I */+ { 74, UNICODE_UPPER }, /* Latin Capital J */+ { 75, UNICODE_UPPER }, /* Latin Capital K */+ { 76, UNICODE_UPPER }, /* Latin Capital L */+ { 77, UNICODE_UPPER }, /* Latin Capital M */+ { 78, UNICODE_UPPER }, /* Latin Capital N */+ { 79, UNICODE_UPPER }, /* Latin Capital O */+ { 80, UNICODE_UPPER }, /* Latin Capital P */+ { 81, UNICODE_UPPER }, /* Latin Capital Q */+ { 82, UNICODE_UPPER }, /* Latin Capital R */+ { 83, UNICODE_UPPER }, /* Latin Capital S */+ { 84, UNICODE_UPPER }, /* Latin Capital T */+ { 85, UNICODE_UPPER }, /* Latin Capital U */+ { 86, UNICODE_UPPER }, /* Latin Capital V */+ { 87, UNICODE_UPPER }, /* Latin Capital W */+ { 88, UNICODE_UPPER }, /* Latin Capital X */+ { 89, UNICODE_UPPER }, /* Latin Capital Y */+ { 90, UNICODE_UPPER }, /* Latin Capital Z */+ { 97, UNICODE_LOWER }, /* Latin Small a */+ { 98, UNICODE_LOWER }, /* Latin Small b */+ { 99, UNICODE_LOWER }, /* Latin Small c */+ { 100, UNICODE_LOWER }, /* Latin Small d */+ { 101, UNICODE_LOWER }, /* Latin Small e */+ { 102, UNICODE_LOWER }, /* Latin Small f */+ { 103, UNICODE_LOWER }, /* Latin Small g */+ { 104, UNICODE_LOWER }, /* Latin Small h */+ { 105, UNICODE_LOWER }, /* Latin Small i */+ { 106, UNICODE_LOWER }, /* Latin Small j */+ { 107, UNICODE_LOWER }, /* Latin Small k */+ { 108, UNICODE_LOWER }, /* Latin Small l */+ { 109, UNICODE_LOWER }, /* Latin Small m */+ { 110, UNICODE_LOWER }, /* Latin Small n */+ { 111, UNICODE_LOWER }, /* Latin Small o */+ { 112, UNICODE_LOWER }, /* Latin Small p */+ { 113, UNICODE_LOWER }, /* Latin Small q */+ { 114, UNICODE_LOWER }, /* Latin Small r */+ { 115, UNICODE_LOWER }, /* Latin Small s */+ { 116, UNICODE_LOWER }, /* Latin Small t */+ { 117, UNICODE_LOWER }, /* Latin Small u */+ { 118, UNICODE_LOWER }, /* Latin Small v */+ { 119, UNICODE_LOWER }, /* Latin Small w */+ { 120, UNICODE_LOWER }, /* Latin Small x */+ { 121, UNICODE_LOWER }, /* Latin Small y */+ { 122, UNICODE_LOWER }, /* Latin Small z */+ { 192, UNICODE_UPPER }, /* Latin Capital A with grave */+ { 193, UNICODE_UPPER }, /* Latin Capital A with acute */+ { 194, UNICODE_UPPER }, /* Latin Capital A with circumflex */+ { 195, UNICODE_UPPER }, /* Latin Capital A with tilde */+ { 196, UNICODE_UPPER }, /* Latin Capital A with diuresis */+ { 197, UNICODE_UPPER }, /* Latin Capital A with ring above */+ { 198, UNICODE_UPPER }, /* Latin Capital AE */+ { 199, UNICODE_UPPER }, /* Latin Capital C with cedilla */+ { 200, UNICODE_UPPER }, /* Latin Capital E with grave */+ { 201, UNICODE_UPPER }, /* Latin Capital E with acute */+ { 202, UNICODE_UPPER }, /* Latin Capital E with circumflex */+ { 203, UNICODE_UPPER }, /* Latin Capital E with diuresis */+ { 204, UNICODE_UPPER }, /* Latin Capital I with grave */+ { 205, UNICODE_UPPER }, /* Latin Capital I with acute */+ { 206, UNICODE_UPPER }, /* Latin Capital I with circumflex */+ { 207, UNICODE_UPPER }, /* Latin Capital I with diuresis */+ { 208, UNICODE_UPPER }, /* Latin Capital ETH */+ { 209, UNICODE_UPPER }, /* Latin Capital N with tilde */+ { 210, UNICODE_UPPER }, /* Latin Capital O with grave */+ { 211, UNICODE_UPPER }, /* Latin Capital O with acute */+ { 212, UNICODE_UPPER }, /* Latin Capital O with circumflex */+ { 213, UNICODE_UPPER }, /* Latin Capital O with tilde */+ { 214, UNICODE_UPPER }, /* Latin Captial O with diaeresis */+ { 216, UNICODE_UPPER }, /* Latin Capital O with stroke */+ { 217, UNICODE_UPPER }, /* Latin Capital U with grave */+ { 218, UNICODE_UPPER }, /* Latin Capital U with acute */+ { 219, UNICODE_UPPER }, /* Latin Capital U with circumflex */+ { 220, UNICODE_UPPER }, /* Latin Capital U with diaeresis */+ { 221, UNICODE_UPPER }, /* Latin Capital Y with acute */+ { 222, UNICODE_UPPER }, /* Latin Capital THORN */+ { 223, UNICODE_LOWER }, /* German sz ligature */+ { 224, UNICODE_LOWER }, /* Latin Small a with grave */+ { 225, UNICODE_LOWER }, /* Latin Small a with acute */+ { 226, UNICODE_LOWER }, /* Latin Small a with circumflex */+ { 227, UNICODE_LOWER }, /* Latin Small a with tilde */+ { 228, UNICODE_LOWER }, /* Latin Small a with diuresis */+ { 229, UNICODE_LOWER }, /* Latin Small a with ring above */+ { 230, UNICODE_LOWER }, /* Latin Small ae */+ { 231, UNICODE_LOWER }, /* Latin Small c with cedilla */+ { 232, UNICODE_LOWER }, /* Latin Small e with grave */+ { 233, UNICODE_LOWER }, /* Latin Small e with acute */+ { 234, UNICODE_LOWER }, /* Latin Small e with circumflex */+ { 235, UNICODE_LOWER }, /* Latin Small e with diuresis */+ { 236, UNICODE_LOWER }, /* Latin Small i with grave */+ { 237, UNICODE_LOWER }, /* Latin Small i with acute */+ { 238, UNICODE_LOWER }, /* Latin Small i with circumflex */+ { 239, UNICODE_LOWER }, /* Latin Small i with diuresis */+ { 240, UNICODE_LOWER }, /* Latin Small eth */+ { 241, UNICODE_LOWER }, /* Latin Small n with tilde */+ { 242, UNICODE_LOWER }, /* Latin Small o with grave */+ { 243, UNICODE_LOWER }, /* Latin Small o with acute */+ { 244, UNICODE_LOWER }, /* Latin Small o with circumflex */+ { 245, UNICODE_LOWER }, /* Latin Small o with tilde */+ { 246, UNICODE_LOWER }, /* Latin Small o with diaeresis */+ { 248, UNICODE_LOWER }, /* Latin Small o with stroke */+ { 249, UNICODE_LOWER }, /* Latin Small u with grave */+ { 250, UNICODE_LOWER }, /* Latin Small u with acute */+ { 251, UNICODE_LOWER }, /* Latin Small u with circumflex */+ { 252, UNICODE_LOWER }, /* Latin Small u with diaeresis */+ { 253, UNICODE_LOWER }, /* Latin Small y with acute */+ { 254, UNICODE_LOWER }, /* Latin Small thorn */+ { 255, UNICODE_LOWER }, /* Latin Small y with diaeresis */+ { 256, UNICODE_UPPER }, /* Latin Capital A with macron */+ { 257, UNICODE_LOWER }, /* Latin Small a with macron */+ { 258, UNICODE_UPPER }, /* Latin Capital A with breve */+ { 259, UNICODE_LOWER }, /* Latin Small a with breve */+ { 260, UNICODE_UPPER }, /* Latin Capital A with ogonek */+ { 261, UNICODE_LOWER }, /* Latin Small a with ogonek */+ { 262, UNICODE_UPPER }, /* Latin Capital C with acute */+ { 263, UNICODE_LOWER }, /* Latin Small c with acute */+ { 264, UNICODE_UPPER }, /* Latin Capital C with circumflex */+ { 265, UNICODE_LOWER }, /* Latin Small c with circumflex */+ { 266, UNICODE_UPPER }, /* Latin Capital C with dot above */+ { 267, UNICODE_LOWER }, /* Latin Small c with dot above */+ { 268, UNICODE_UPPER }, /* Latin Capital C with caron (hacek) */+ { 269, UNICODE_LOWER }, /* Latin Small c with caron (hacek) */+ { 270, UNICODE_UPPER }, /* Latin Capital D with caron (hacek) */+ { 271, UNICODE_LOWER }, /* Latin Small d with caron (hacek) */+ { 272, UNICODE_UPPER }, /* Latin Capital D with stroke */+ { 273, UNICODE_LOWER }, /* Latin Small d with stroke */+ { 274, UNICODE_UPPER }, /* Latin Capital E with macron */+ { 275, UNICODE_LOWER }, /* Latin Small e with macron */+ { 276, UNICODE_UPPER }, /* Latin Capital E with breve */+ { 277, UNICODE_LOWER }, /* Latin Small e with breve */+ { 278, UNICODE_UPPER }, /* Latin Capital E with dot above */+ { 279, UNICODE_LOWER }, /* Latin Small e with dot above */+ { 280, UNICODE_UPPER }, /* Latin Capital E with ogonek */+ { 281, UNICODE_LOWER }, /* Latin Small e with ogonek */+ { 282, UNICODE_UPPER }, /* Latin Capital E with caron (hacek) */+ { 283, UNICODE_LOWER }, /* Latin Small e with caron */+ { 284, UNICODE_UPPER }, /* Latin Capital G with circumflex */+ { 285, UNICODE_LOWER }, /* Latin Small g with circumflex */+ { 286, UNICODE_UPPER }, /* Latin Capital G with breve */+ { 287, UNICODE_LOWER }, /* Latin Small g with breve */+ { 288, UNICODE_UPPER }, /* Latin Capital G with dot above */+ { 289, UNICODE_LOWER }, /* Latin Small g with dot above */+ { 290, UNICODE_UPPER }, /* Latin Capital G with cedilla */+ { 291, UNICODE_LOWER }, /* Latin Small g with cedilla */+ { 292, UNICODE_UPPER }, /* Latin Capital H with circumflex */+ { 293, UNICODE_LOWER }, /* Latin Small h with circumflex */+ { 294, UNICODE_UPPER }, /* Latin Capital H with stroke */+ { 295, UNICODE_LOWER }, /* Latin Small h with stroke */+ { 296, UNICODE_UPPER }, /* Latin Capital I with tilde */+ { 297, UNICODE_LOWER }, /* Latin Small i with tilde */+ { 298, UNICODE_UPPER }, /* Latin Capital I with macron */+ { 299, UNICODE_LOWER }, /* Latin Small i with macron */+ { 300, UNICODE_UPPER }, /* Latin Capital I with breve */+ { 301, UNICODE_LOWER }, /* Latin Small i with breve */+ { 302, UNICODE_UPPER }, /* Latin Capital I with ogonek */+ { 303, UNICODE_LOWER }, /* Latin Small i with ogonek */+ { 304, UNICODE_UPPER }, /* Latin Capital I with dot above */+ { 305, UNICODE_LOWER }, /* Latin Small i without dot above */+ { 306, UNICODE_UPPER }, /* Latin Capital IJ */+ { 307, UNICODE_LOWER }, /* Latin Small IJ */+ { 308, UNICODE_UPPER }, /* Latin Capital J with circumflex */+ { 309, UNICODE_LOWER }, /* Latin Small j with circumflex */+ { 310, UNICODE_UPPER }, /* Latin Capital K with cedilla */+ { 311, UNICODE_LOWER }, /* Latin Small j with cedilla */+ { 312, UNICODE_LOWER }, /* Latin Small kra */+ { 313, UNICODE_UPPER }, /* Latin Capital L with acute */+ { 314, UNICODE_LOWER }, /* Latin Small l with acute */+ { 315, UNICODE_UPPER }, /* Latin Capital L with cedilla */+ { 316, UNICODE_LOWER }, /* Latin Small l with cedilla */+ { 317, UNICODE_UPPER }, /* Latin Capital L with caron */+ { 318, UNICODE_LOWER }, /* Latin Small l with caron */+ { 319, UNICODE_UPPER }, /* Latin Capital L with middle dot */+ { 320, UNICODE_LOWER }, /* Latin Small l with middle dot */+ { 321, UNICODE_UPPER }, /* Latin Capital L with stroke */+ { 322, UNICODE_LOWER }, /* Latin Small l with stroke */+ { 323, UNICODE_UPPER }, /* Latin Capital N with acute */+ { 324, UNICODE_LOWER }, /* Latin Small n with acute */+ { 325, UNICODE_UPPER }, /* Latin Capital N with cedilla */+ { 326, UNICODE_LOWER }, /* Latin Small n with cedilla */+ { 327, UNICODE_UPPER }, /* Latin Capital N with caron */+ { 328, UNICODE_LOWER }, /* Latin Small n with caron */+ { 329, UNICODE_LOWER }, /* Latin Small n preceeded by apostrophe */+ { 330, UNICODE_UPPER }, /* Latin Capital Eng */+ { 331, UNICODE_LOWER }, /* Latin Small eng */+ { 332, UNICODE_UPPER }, /* Latin Capital O with macron */+ { 333, UNICODE_LOWER }, /* Latin Small o with macron */+ { 334, UNICODE_UPPER }, /* Latin Capital O with breve */+ { 335, UNICODE_LOWER }, /* Latin Small o with breve */+ { 336, UNICODE_UPPER }, /* Latin Capital O with double acute */+ { 337, UNICODE_LOWER }, /* Latin Small o with double acute */+ { 338, UNICODE_UPPER }, /* Latin Capital OE */+ { 339, UNICODE_LOWER }, /* Latin Small oe */+ { 340, UNICODE_UPPER }, /* Latin Capital R with acute */+ { 341, UNICODE_LOWER }, /* Latin Small r with acute */+ { 342, UNICODE_UPPER }, /* Latin Capital R with cedilla */+ { 343, UNICODE_LOWER }, /* Latin Small r with cedilla */+ { 344, UNICODE_UPPER }, /* Latin Capital R with caron */+ { 345, UNICODE_LOWER }, /* Latin Small r with caron */+ { 346, UNICODE_UPPER }, /* Latin Capital S with acute */+ { 347, UNICODE_LOWER }, /* Latin Small s with acute */+ { 348, UNICODE_UPPER }, /* Latin Capital S with circumflex */+ { 349, UNICODE_LOWER }, /* Latin Small s with circumflex */+ { 350, UNICODE_UPPER }, /* Latin Capital S with cedilla */+ { 351, UNICODE_LOWER }, /* Latin Small s with cedilla */+ { 352, UNICODE_UPPER }, /* Latin Capital S with caron */+ { 353, UNICODE_LOWER }, /* Latin Small s with caron */+ { 354, UNICODE_UPPER }, /* Latin Capital T with cedilla */+ { 355, UNICODE_LOWER }, /* Latin Small t with cedilla */+ { 356, UNICODE_UPPER }, /* Latin Capital T with caron */+ { 357, UNICODE_LOWER }, /* Latin Small t with caron */+ { 358, UNICODE_UPPER }, /* Latin Capital T with stroke */+ { 359, UNICODE_LOWER }, /* Latin Small t with stroke */+ { 360, UNICODE_UPPER }, /* Latin Capital U with tilde */+ { 361, UNICODE_LOWER }, /* Latin Small u with tilde */+ { 362, UNICODE_UPPER }, /* Latin Capital U with macron */+ { 363, UNICODE_LOWER }, /* Latin Small u with macron */+ { 364, UNICODE_UPPER }, /* Latin Capital U with breve */+ { 365, UNICODE_LOWER }, /* Latin Small u with breve */+ { 366, UNICODE_UPPER }, /* Latin Capital U with ring above */+ { 367, UNICODE_LOWER }, /* Latin Small u with ring above */+ { 368, UNICODE_UPPER }, /* Latin Capital U with double acute */+ { 369, UNICODE_LOWER }, /* Latin Small u with double acute */+ { 370, UNICODE_UPPER }, /* Latin Capital U with ogonek */+ { 371, UNICODE_LOWER }, /* Latin Small u with ogonek */+ { 372, UNICODE_UPPER }, /* Latin Capital W with circumflex */+ { 373, UNICODE_LOWER }, /* Latin Small w with circumflex */+ { 374, UNICODE_UPPER }, /* Latin Capital Y with circumflex */+ { 375, UNICODE_LOWER }, /* Latin Small y with circumflex */+ { 376, UNICODE_UPPER }, /* Latin Capital Y with diaeresis */+ { 377, UNICODE_UPPER }, /* Latin Capital Z with acute */+ { 378, UNICODE_LOWER }, /* Latin Small z with acute */+ { 379, UNICODE_UPPER }, /* Latin Capital Z with dot above */+ { 380, UNICODE_LOWER }, /* Latin Small z with dot above */+ { 381, UNICODE_UPPER }, /* Latin Capital Z with caron */+ { 382, UNICODE_LOWER }, /* Latin Small z with caron */+ { 383, UNICODE_LOWER }, /* Latin Small long S */++ { 461, UNICODE_UPPER }, /* Latin Capital A with caron (hacek) */+ { 462, UNICODE_LOWER }, /* Latin Small a with caron (hacek) */+ { 463, UNICODE_UPPER }, /* Latin Capital I with caron (hacek) */+ { 464, UNICODE_LOWER }, /* Latin Small i with caron (hacek) */+ { 465, UNICODE_UPPER }, /* Latin Capital O with caron (hacek) */+ { 466, UNICODE_LOWER }, /* Latin Small o with caron (hacek) */+ { 467, UNICODE_UPPER }, /* Latin Capital U with caron (hacek) */+ { 468, UNICODE_LOWER }, /* Latin Small u with caron (hacek) */++ { 486, UNICODE_UPPER }, /* Latin Capital G with caron */+ { 487, UNICODE_LOWER }, /* Latin Small g with caron */+ { 488, UNICODE_UPPER }, /* Latin Capital J with caron */+ { 489, UNICODE_LOWER }, /* Latin Small j with caron */+ { 490, UNICODE_UPPER }, /* Latin Capital O with caron */+ { 491, UNICODE_LOWER }, /* Latin Small o with caron */++ { 500, UNICODE_UPPER }, /* Latin Capital G with acute */+ { 501, UNICODE_LOWER }, /* Latin Small g with caron */+};++static int nunicodeinfo = sizeof( unicodeinfo ) / sizeof( unicodeinfo[0] );++static int+unicode_find( unsigned int unicode_character )+{+ int min = 0, max = nunicodeinfo, mid;+ while ( min < max ) {+ mid = ( min + max ) / 2;+ if ( unicodeinfo[mid].value < unicode_character )+ min = mid + 1;+ else+ max = mid;+ }+ if ( ( max==min ) && ( unicodeinfo[min].value == unicode_character ) )+ return min;+ else+ return -1;+}++unsigned short+unicode_utf8_classify( char *p )+{+ unsigned int unicode_character, pos = 0;+ int n;+ unicode_character = utf8_decode( p, &pos );+ n = unicode_find( unicode_character );+ if ( n==-1 ) return UNICODE_SYMBOL;+ else return unicodeinfo[n].info;+}++unsigned short+unicode_utf8_classify_newstr( newstr *s )+{+ unsigned int unicode_character, pos = 0;+ unsigned short value = 0;+ int n;+ while ( pos < s->len ) {+ unicode_character = utf8_decode( s->data, &pos );+ n = unicode_find( unicode_character );+ if ( n==-1 ) value |= UNICODE_SYMBOL;+ else value |= unicodeinfo[n].info;+ }+ return value;+}+
+ bibutils/unicode.h view
@@ -0,0 +1,12 @@++#include "newstr.h"++#define UNICODE_SYMBOL (1)+#define UNICODE_UPPER (2) /* Uppercase letter */+#define UNICODE_LOWER (4) /* Lowercase letter */+#define UNICODE_NUMBER (8) /* Numeric character */+#define UNICODE_MIXEDCASE ( UNICODE_UPPER | UNICODE_LOWER )++extern unsigned short unicode_utf8_classify( char *p );+extern unsigned short unicode_utf8_classify_newstr( newstr *s );+
bibutils/utf8.c view
@@ -1,9 +1,9 @@ /* * utf8.c *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #include <stdio.h>@@ -77,6 +77,18 @@ /* error, above 2^31 bits encodable by UTF-8 */ return 0; }+}++/* Generate UTF8 character as null-terminated string */+void+utf8_encode_str( unsigned int value, char outstr[7] )+{+ unsigned char encoded[6];+ int i, n;+ n = utf8_encode( value, encoded );+ for ( i=0; i<n; ++i )+ outstr[i] = ( char ) encoded[i];+ outstr[n] = '\0'; } unsigned int
bibutils/utf8.h view
@@ -1,18 +1,18 @@ /* * utf8.h *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */- #ifndef UTF8_H #define UTF8_H #include <stdio.h> extern int utf8_encode( unsigned int value, unsigned char out[6] );+extern void utf8_encode_str( unsigned int value, char outstr[7] ); extern unsigned int utf8_decode( char *s, unsigned int *pi ); extern void utf8_writebom( FILE *outptr );
bibutils/vplist.c view
@@ -3,9 +3,9 @@ * * Version: 9/20/2012 *- * Copyright (c) Chris Putnam 2011-2012+ * Copyright (c) Chris Putnam 2011-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * * Implements a simple managed array of pointers to void *
bibutils/vplist.h view
@@ -3,12 +3,11 @@ * * Version: 9/20/2012 *- * Copyright (c) Chris Putnam 2011-2012+ * Copyright (c) Chris Putnam 2011-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */- #ifndef VPLIST_H #define VPLIST_H
bibutils/wordin.c view
@@ -1,9 +1,9 @@ /* * wordin.c *- * Copyright (c) Chris Putnam 2010-2012+ * Copyright (c) Chris Putnam 2010-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */ #include <stdio.h>@@ -35,7 +35,6 @@ p->processf = wordin_processf; p->cleanf = NULL; p->typef = NULL;-/* p->convertf = wordin_convertf;*/ p->convertf = NULL; p->all = NULL; p->nall = 0;@@ -584,20 +583,4 @@ wordin_assembleref( &top, wordin ); xml_free( &top ); return 1;-}--void-wordin_convertf( fields *wordin, fields *info, int reftype, int verbose, - variants *all, int nall )-{- char *tag, *value;- int i, n, level;-- n = fields_num( wordin );- for ( i=0; i<n; ++i ) {- tag = fields_tag( wordin, i, FIELDS_CHRP );- value = fields_value( wordin, i, FIELDS_CHRP );- level = fields_level( wordin, i );- fields_add( info, tag, value, level );- } }
bibutils/wordin.h view
@@ -1,9 +1,9 @@ /* * wordin.h *- * Copyright (c) Chris Putnam 2009-2012+ * Copyright (c) Chris Putnam 2009-2013 *- * Program and source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef WORDIN_H@@ -16,7 +16,6 @@ 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 void wordin_initparams( param *p, const char *progname );
bibutils/wordout.c view
@@ -3,9 +3,9 @@ * * (Word 2007 format) *- * Copyright (c) Chris Putnam 2007-2012+ * Copyright (c) Chris Putnam 2007-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #include <stdio.h>
bibutils/wordout.h view
@@ -1,9 +1,9 @@ /* * wordout.h *- * Copyright (c) Chris Putnam 2008-2012+ * Copyright (c) Chris Putnam 2008-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef WORDOUT_H
bibutils/xml.c view
@@ -1,9 +1,9 @@ /* * xml.c *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #include <stdio.h>
bibutils/xml.h view
@@ -1,9 +1,9 @@ /* * xml.h *- * Copyright (c) Chris Putnam 2004-2012+ * Copyright (c) Chris Putnam 2004-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef XML_H
bibutils/xml_encoding.c view
@@ -1,9 +1,9 @@ /* * xml_getencoding.c *- * Copyright (c) Chris Putnam 2007-2010+ * Copyright (c) Chris Putnam 2007-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #include <stdio.h>
bibutils/xml_encoding.h view
@@ -1,9 +1,9 @@ /* * xml_getencoding.h *- * Copyright (c) Chris Putnam 2007-2012+ * Copyright (c) Chris Putnam 2007-2013 *- * Source code released under the GPL+ * Source code released under the GPL version 2 * */ #ifndef XML_GETENCODING_H
hs-bibutils.cabal view
@@ -1,5 +1,5 @@ name: hs-bibutils-version: 4.15+version: 4.16 homepage: http://gorgias.mine.nu/repos/hs-bibutils/ synopsis: Haskell bindings to bibutils, the bibliography@@ -43,10 +43,11 @@ bibutils/endxmlin.h bibutils/entities.c bibutils/entities.h bibutils/fields.c bibutils/fields.h bibutils/gb18030.c bibutils/gb18030.h bibutils/gb18030_enumeration.c bibutils/is_ws.c- bibutils/is_ws.h bibutils/isiin.c bibutils/isiin.h- bibutils/isiout.c bibutils/isiout.h bibutils/isitypes.c- bibutils/latex.c bibutils/latex.h bibutils/list.c bibutils/list.h- bibutils/marc.c bibutils/marc.h bibutils/medin.c bibutils/medin.h+ bibutils/intlis.h bibutils/intlis.c bibutils/is_ws.h+ bibutils/isiin.c bibutils/isiin.h bibutils/isiout.c+ bibutils/isiout.h bibutils/isitypes.c bibutils/latex.c+ bibutils/latex.h bibutils/list.c bibutils/list.h bibutils/marc.c+ bibutils/marc.h bibutils/medin.c bibutils/medin.h bibutils/modsin.c bibutils/modsin.h bibutils/modsout.c bibutils/modsout.h bibutils/modstypes.c bibutils/modstypes.h bibutils/mycvout.c bibutils/name.c bibutils/name.h@@ -56,7 +57,8 @@ bibutils/risout.h bibutils/ristypes.c bibutils/vplist.c bibutils/vplist.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/title.h bibutils/unicode. bibutils/unicode.c+ bibutils/utf8.c bibutils/utf8.h bibutils/wordin.c bibutils/wordin.h bibutils/wordout.c bibutils/wordout.h bibutils/xml.c bibutils/xml.h bibutils/xml_encoding.c bibutils/xml_encoding.h@@ -80,15 +82,16 @@ bibutils/doi.c bibutils/ebiin.c bibutils/endin.c bibutils/endout.c bibutils/endtypes.c bibutils/endxmlin.c bibutils/entities.c bibutils/fields.c bibutils/gb18030.c- bibutils/is_ws.c bibutils/isiin.c bibutils/isiout.c- bibutils/isitypes.c bibutils/latex.c bibutils/list.c- bibutils/marc.c bibutils/medin.c bibutils/modsin.c- bibutils/modsout.c bibutils/modstypes.c bibutils/name.c- bibutils/newstr.c bibutils/newstr_conv.c bibutils/reftypes.c- bibutils/risin.c bibutils/risout.c bibutils/ristypes.c- bibutils/vplist.c bibutils/serialno.c bibutils/strsearch.c- bibutils/title.c bibutils/utf8.c bibutils/wordin.c- bibutils/wordout.c bibutils/xml.c bibutils/xml_encoding.c+ bibutils/intlist.c bibutils/is_ws.c bibutils/isiin.c+ bibutils/isiout.c bibutils/isitypes.c bibutils/latex.c+ bibutils/list.c bibutils/marc.c bibutils/medin.c+ bibutils/modsin.c bibutils/modsout.c bibutils/modstypes.c+ bibutils/name.c bibutils/newstr.c bibutils/newstr_conv.c+ bibutils/reftypes.c bibutils/risin.c bibutils/risout.c+ bibutils/ristypes.c bibutils/vplist.c bibutils/serialno.c+ bibutils/strsearch.c bibutils/title.c bibutils/unicode.c+ bibutils/utf8.c bibutils/wordin.c bibutils/wordout.c+ bibutils/xml.c bibutils/xml_encoding.c if impl(ghc >= 6.10) build-depends: base >= 4, syb