home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume24 / jlook / part01 next >
Encoding:
Internet Message Format  |  1991-03-13  |  60.4 KB

  1. Subject:  v24i046:  Journal lookup-program with database, Part01/05
  2. Newsgroups: comp.sources.unix
  3. Approved: rsalz@uunet.UU.NET
  4. X-Checksum-Snefru: 5fe74f07 625780c5 c3b0f34e 95b7c93b
  5.  
  6. Submitted-by: Dave Davey <daved@physiol.su.oz.au>
  7. Posting-number: Volume 24, Issue 46
  8. Archive-name: jlook/part01
  9.  
  10. [  The database is one of the most interesting parts of this submission. --r$ ]  
  11.  
  12. jlook is a tool to assist with Journal name handling in bibliographic
  13. applications.  It supplements refer and other utilities.  Using a library
  14. of official full titles and abbreviations used by Chemical Abstracts,
  15. Index Medicus and the World List of Scientific Periodicals, jlook can
  16. interconvert these forms, or generate one of them from reasonable
  17. abbreviations.  The library may contain recognised variants of titles, or
  18. local preferred abbreviations.
  19.  
  20. Used with journal names as command arguments, jlook returns the full title
  21. (or abbreviation selected by a switch).
  22.  
  23. Used as a filter, jlook converts input lines starting with %J to the
  24. corresponding full title or selected abbreviation.  Titles which cannot
  25. be recognised are passed through unchanged, but diagnostic output
  26. may be obtained.
  27.  
  28. jlook uses a simple index file to speed searches.  The program starts
  29. marginally faster if the index file exists and is up-to-date, but will
  30. generate the index itself otherwise.
  31.  
  32. The available library gives fair coverage of the biomedical literature
  33. (about 2000 journals). It compiles and runs on (at least) Version 7 and
  34. BSD 4.3 systems.
  35.  
  36. #!/bin/sh
  37. # shar:    Shell Archiver  (v1.22)
  38. # This is part 1 of a multipart archive                                    
  39. # do not concatenate these parts, unpack them in order with /bin/sh        
  40. #
  41. #    Run the following text with /bin/sh to create:
  42. #      README
  43. #      jlook.1l
  44. #      jlook.c
  45. #      jindex.c
  46. #      jsubs.c
  47. #      jlook.h
  48. #      Makefile
  49. #      tst_alt
  50. #      tst_chem_good
  51. #      tst_full_good
  52. #      tst_input
  53. #      jlist
  54. #
  55. if test -r s2_seq_.tmp
  56. then echo "Must unpack archives in sequence!"
  57.      next=`cat s2_seq_.tmp`; echo "Please unpack part $next next"
  58.      exit 1; fi
  59. echo "x - extracting README (Text)"
  60. sed 's/^X//' << 'SHAR_EOF' > README &&
  61. Xjlook README
  62. X$Header: /src/local/cmd/jlook/README,v 1.1 90/02/04 12:45:45 daved Rel $
  63. X
  64. Xjlook is a tool to assist with Journal name handling in bibliographic
  65. Xapplications.  It supplements refer and other utilities.  Using a library
  66. Xof official full titles and abbreviations used by Chemical Abstracts,
  67. XIndex Medicus and the World List of Scientific Periodicals, jlook can
  68. Xinterconvert these forms, or generate one of them from reasonable
  69. Xabbreviations.  The library may contain recognised variants of titles, or
  70. Xlocal preferred abbreviations.
  71. X
  72. XUsed with journal names as command arguments, jlook returns the full title
  73. X(or abbreviation selected by a switch).
  74. X
  75. XUsed as a filter, jlook converts input lines starting with %J to the
  76. Xcorresponding full title or selected abbreviation.  Titles which cannot
  77. Xbe recognised are passed through unchanged, but diagnostic output
  78. Xmay be obtained.
  79. X
  80. Xjlook uses a simple index file to speed searches.  The program starts
  81. Xmarginally faster if the index file exists and is up-to-date, but will
  82. Xgenerate the index itself otherwise.
  83. X
  84. XThe available library gives fair coverage of the biomedical literature
  85. X(about 2000 journals). It compiles and runs on (at least) Version 7 and
  86. XBSD 4.3 systems.
  87. X
  88. XThe distribution includes:
  89. X    README        this one!
  90. X    Makefile    
  91. X    jlook.h
  92. X    jlook.c
  93. X    jindex.c
  94. X    jsubs.c
  95. X    jlook.1l    manual troff source
  96. X    jlist        the journal library file
  97. X    tst_chem_good    a test file
  98. X    tst_full_good    "   "   "
  99. X    tst_input    "   "   "
  100. X    tst_alt        "   "   "
  101. X
  102. XCompilation:
  103. X    edit Makefile to reflect whether your system supports re_comp and
  104. X        re_exec regular expression functions, or recmp and regex.
  105. X    make all
  106. X
  107. XCheck integrity:
  108. X    make check
  109. X        should do some checks without errors except that there
  110. X        may be a complaint about no index file
  111. X
  112. XInstallation:
  113. X    edit Makefile if you do not wish jlook to go in /usr/bin or the
  114. X        library and index program to go in /usr/lib/refer
  115. X    make library
  116. X        to install the journal library file and create its index
  117. X    make install
  118. X        to install the binaries.
  119. X
  120. XManual:
  121. X    put jlook.1l in the right place (sorry, the makefile does not do it)
  122. SHAR_EOF
  123. chmod 0440 README || echo "restore of README fails"
  124. set `wc -c README`;Sum=$1
  125. if test "$Sum" != "2078"
  126. then echo original size 2078, current size $Sum;fi
  127. echo "x - extracting jlook.1l (Text)"
  128. sed 's/^X//' << 'SHAR_EOF' > jlook.1l &&
  129. X.TH jlook 1 LOCAL
  130. X.de iD
  131. X$Header: /src/local/cmd/jlook/jlook.1l,v 1.1 90/02/03 17:21:35 daved Exp $
  132. Xphysiol.su.oz.au
  133. X..
  134. X.SH NAME
  135. Xjlook - lookup/replace journal titles or abbreviations from a standard list
  136. X.SH SYNOPSIS
  137. X.B jlook
  138. X[\ \-a\ additional_library\ ]
  139. X[\ \-C\ ]
  140. X[\ \-d\ ]
  141. X[\ \-e\ ]
  142. X[ \-E\ ]
  143. X[\ \-l\ library\ ]
  144. X[\ \-m\fR[\fImacro\fR]\ ]
  145. X[\ \-n\ ]
  146. X[\ \-p\ ]
  147. X[\ \-s\fR[\fImax_chars\fR]\ ]
  148. X[\ \-t\ ]
  149. X[\ \-u\fIX\fP\ ]
  150. X[\ \-x\fR[\fItag_string\fR]\ ]
  151. X["title"\ [\ "title2"\ ...\ ]]
  152. X[\ -f\ file(s)\ ]
  153. X.br
  154. X.B jindex
  155. X[ \-l library ]
  156. X.SH DESCRIPTION
  157. X.I Jlook
  158. Xif given a Journal title or sensible abbreviation looks for an entry
  159. Xin the journal library and prints the result on standard output.
  160. XNormally
  161. Xthe full title is output, but one of a number of standard abbreviations
  162. Xdescribed below can be selected, or the
  163. X.B \-A
  164. Xswitch (described in more detail below)
  165. Xcan be used to obtain all the forms for the item.
  166. XNormally the
  167. Xinput must match the contents of the library in a moderately complete
  168. Xmanner.
  169. XThe
  170. X.B \-t
  171. Xswitch removes the restriction of completeness, and can be helpful in
  172. Xtrying to discover the complete title of a journal, e.g. if you know
  173. Xthe first few words but not the rest.
  174. X.P
  175. XUsed as a filter or given input files
  176. Xfollowing the
  177. X.B \-f
  178. Xswitch, any lines beginning with "%J " (see pubindex, refer or indexbib) are
  179. Xtaken to contain journal titles and are looked up in the same way.
  180. XThe line contents are replaced by the standard form in the library, if
  181. Xfound.
  182. XAny journal line that is not so replaced, and
  183. Xall other lines, are passed through unchanged.
  184. XA different leading string
  185. Xcan be selected with the
  186. X.B \-m
  187. Xswitch.
  188. XThis switch causes the leading string to be changed from "%J " to
  189. X".ds [J " and thus enables
  190. X.I jlook
  191. Xto be used as a filter for refer(1) output.
  192. XOther strings can be used by
  193. Xplacing them immediately after the -m switch (e.g. -m"#j " would cause
  194. Xlines beginning with "#j " to be processed).
  195. X.P
  196. XNormally, full titles are output, but an abbreviation can be selected with
  197. Xthe
  198. X.B \-u\fIX\fP
  199. Xswitch, where
  200. X.I X
  201. Xmust be a single upper case letter code for the abbreviations supported
  202. Xby the library.  As distributed,
  203. X.I X
  204. Xcan be one of:
  205. X.TP
  206. X.B C
  207. Xfor
  208. X.I "Chemical Abstracts"
  209. X.TP
  210. X.B I
  211. Xfor
  212. X.I "Index Medicus"
  213. Xor
  214. X.TP
  215. X.B W
  216. Xfor
  217. X.I "World List of Scientific Periodicals",
  218. X.PP
  219. XThe selected abbreviation can be modified:
  220. Xfull-stops in the abbreviations can be eliminated with the
  221. X.B \-p
  222. Xswitch; and unpaddable blanks will be substituted
  223. Xfor spaces within the title if the
  224. X.B \-s\fI[max_chars]\fP
  225. Xswitch is used.
  226. XIn the latter case, a maximum of
  227. X.I max_chars
  228. Xcharacters will be output without interpreting a space as a space (default 10).
  229. XAll forms of output can be converted to upper-case only though use of the
  230. X.B \-C
  231. Xswitch.
  232. X.P
  233. XJournal abbreviations (or names) which cannot be found in the library can
  234. Xbe identified with the 
  235. X.B \-e
  236. Xswitch, which causes problem "%J" lines to be written to standard error, or
  237. Xthe
  238. X.B \-x
  239. Xswitch which causes them to be added to the output stream as lines labelled
  240. Xwith "%X " (or ".\\"X " if the -m switch has been used) or with the string
  241. Ximmediately following the -x.
  242. XIf the
  243. X.B \-E
  244. Xswitch is used instead of -e, a message "no errors found" will also be generated
  245. Xif appropriate.
  246. XIf only the errors are desired, the
  247. X.B \-n
  248. Xswitch will suppress normal output.
  249. X.P
  250. XThe
  251. X.B \-l \fIlib_file\fP
  252. Xswitch enables a journal library file named by the argument
  253. Xwhich follows it
  254. X.I (lib_file)
  255. Xto be used instead of /usr/lib/refer/jlist.
  256. XThe file will be sought first in the working directory, then in
  257. X/usr/lib/refer.
  258. XIn order to use an alternative library file efficiently,
  259. Xthe library index should first be created with
  260. Xthe command "/usr/lib/refer/jindex -l library_file".
  261. X.P
  262. XThe
  263. X.B \-a
  264. Xswitch provides for
  265. Xan additional library given by the next argument also to be searched
  266. Xfor items not found in the standard library.
  267. X.P
  268. XThe
  269. X.B \-d
  270. Xswitch is for debugging purposes.
  271. XMore than one -d switch causes even more
  272. Xverbose output.
  273. X.P
  274. XSearching of the library is linear but a simple index of entry points for
  275. Xeach letter of the alphabet speeds the process slightly.
  276. XBecause of the
  277. Xsubstantial variation in abbreviation formats,  a more sophisticated
  278. Xindex is difficult to formulate.
  279. XThe index must be rebuilt if the
  280. Xlibrary is modified.
  281. XAn out of date index will cause
  282. X.I jlook
  283. Xto construct one internally which slows its startup.
  284. X.P
  285. XThe lookup process is much faster if the input journal names
  286. Xare already in the form of a standard
  287. Xabbreviation.
  288. XThus it is worth putting files in a regularly used database
  289. Xthrough
  290. X.I jlook
  291. Xonce to
  292. Xstandardise them.
  293. XThis can be done with something like:
  294. X.ti 3c
  295. Xjlook -uC -f file > NEW  && cp NEW file && rm -f NEW
  296. X.SH LIBRARY FILES
  297. XThe default library file begins with comments on its format.
  298. XIt is
  299. Xpossible to create files with support for different abbreviation systems.
  300. XEach system must have a key letter in the "Keys: " line at the start
  301. Xof the file.
  302. XSuch letters can be chosen from the upper case alphabet with the exception
  303. Xof the reserved letters E,F,V, and U.
  304. XThe description which follows applies to the distributed
  305. Xlibrary (Keys CIW).
  306. X.P
  307. XThe entries in the library file
  308. Xconsist of a series of lines for each journal, separated by a
  309. Xblank line.
  310. X(For any one journal argument,
  311. Xthe complete entry can be displayed using the
  312. X.B \-A
  313. Xswitch.)
  314. XThe lines are tagged with the following leading letters,
  315. Xseparated from the entry by white space:
  316. X.in 2c
  317. X.nf
  318. XF    The full title of the Journal
  319. XC    The Chemical Abstracts abbreviation
  320. XI    The Index Medicus abbreviation
  321. XW    The World List abbreviation
  322. XV    A variant to be accepted (e.g. local abbreviation)
  323. XU    Undefined input
  324. XE    Exceptional entry - apparently out of alphabetic order
  325. XS    Sort string
  326. X*    A regular expression for back matching
  327. X.fi
  328. X.in
  329. XThe F,C,I and W lines must appear once and only 
  330. Xonce per entry, but can be combined where appropriate.
  331. XE lines
  332. Xreplace F lines where an accepted abbreviation does not start
  333. Xwith the same letter as the full title (e.g. anglicized abbreviations of
  334. Xforeign titles).
  335. XAn E entry must appear
  336. Xalphabetically under the first letter of that abbreviation.
  337. XIt must
  338. Xalso appear under the first letter of the full title.
  339. XE and F lines
  340. Xare mutually exclusive.
  341. XThere can be any number of V lines.
  342. XFor particularly troublesome entries, for example where an abbreviation
  343. Xdoes not correspond to the leading portion of the full word (e.g.
  344. XZbl. for Zentralblatt), a regular expression may be included in the
  345. Xentry, labelled with an '*'.
  346. XSuch expressions will be used in an attempt
  347. Xto match against the input if all else fails.
  348. XU lines replace F lines
  349. Xwhere a particular form is regarded as a known error, the most
  350. Xcommon instance being where a journal name is equivocal unless
  351. Xa city of publication is included.
  352. XAn S line is treated only as a comment by
  353. X.I jlook,
  354. Xbut may be present to assist automatic sorting of the libary;
  355. Xits contents will be used for the sort instead of the full title.
  356. X.P
  357. XThe library must be kept in alphabetic
  358. Xorder as far as the first letter of the full title of each entry.
  359. XEntries starting with numbers are grouped together with names starting
  360. Xwith 'Z'.
  361. X.SH FILES
  362. X/usr/bin/jlook
  363. X.br
  364. X/usr/lib/refer/jlist - the default library
  365. X.br
  366. X/usr/lib/refer/jlist.index - default offset index to speed searches
  367. X.br
  368. X/usr/lib/refer/jindex - a program to build the index
  369. X.SH DIAGNOSTICS
  370. X"Index predates ...."
  371. Xmeans the index is out of date; this is a warning only and,
  372. Xin the case of the default library,
  373. Xshould be drawn to the attention of the system supervisor.
  374. X.br
  375. XIf an entry is not found, the program exits with a (non-zero) error status.
  376. XIn addition, if the
  377. X.B \-x
  378. Xswitch is used, the offending journal
  379. Xlines will be copied into the output, labelled in accord
  380. Xwith the -m and -x switches, in order
  381. Xthat they can be identified.
  382. X.SH SEE ALSO
  383. Xreflist.1l
  384. X.SH BUGS
  385. XThe program depends upon the database.
  386. X.P
  387. XThe distributed database contains diacritical marks
  388. Xof the form \\*\(aa, \\*\(ga \\*: and \\*;,
  389. Xwhich
  390. Xrequire troff definitions such as those provided in the ms(7) and mm(7)
  391. Xmacro
  392. Xpackages or some further substitution or elimination if troff is not being
  393. Xused.
  394. X.P
  395. XExpansion of abbreviated journal titles is not foolproof.
  396. XAbbreviated forms
  397. Xshould be indicated by the use of full stops.
  398. XNon-trivial words should have
  399. Xthe first letter capitalized.
  400. XFor example: "J. Physiol." is a "good"
  401. Xabbreviation for "Journal of Physiology" whereas "J physiol" is not.
  402. X.P
  403. XAn additional library used with the
  404. X.B \-a
  405. Xswitch must have the same Keys as the primary library.
  406. X.P
  407. XThe
  408. X.I "World List"
  409. Xentries are inconsistent.  A major feature of the original
  410. X.I List
  411. Xwas the use of lower case for the first letter of adjectives in
  412. Xtitles (except for the first word of a title), a feature that appears
  413. Xto appeal to some editors who insist on its use.
  414. XUnfortunately, the
  415. X.I List
  416. Xwas not reprinted in full after 1969, and only supplements were issued
  417. Xuntil 1980, after which the
  418. X.I List
  419. Xwas disbanded.  
  420. XThe supplements list all titles in
  421. X.I "upper case only".
  422. XThese have been converted to mixed case following the original rules.
  423. X(Upper case output can be obtained with the
  424. X.B \-C
  425. Xswitch.)
  426. X.SH AUTHOR
  427. X.nf
  428. XD.F. Davey,
  429. XDepartment of Physiology,
  430. XUniversity of Sydney.
  431. X.sp
  432. Xdaved@physiol.su.oz
  433. SHAR_EOF
  434. chmod 0440 jlook.1l || echo "restore of jlook.1l fails"
  435. set `wc -c jlook.1l`;Sum=$1
  436. if test "$Sum" != "9207"
  437. then echo original size 9207, current size $Sum;fi
  438. echo "x - extracting jlook.c (Text)"
  439. sed 's/^X//' << 'SHAR_EOF' > jlook.c &&
  440. X/* jlook.c
  441. X *
  442. X *    Copyright D.F. Davey, University of Sydney
  443. X *
  444. X *    Permission is granted for the distribution of this software
  445. X *    for non-profit purposes and provided this notice remains intact
  446. X *
  447. X *    daved@physiol.su.oz.au
  448. X *
  449. X *    The debugging switch can be used in two ways. Multiple -d's are
  450. X *    additive.  -dN where N is an integer selects particular debugging
  451. X *    diagnostics:
  452. X *    10    re comparisons with variants
  453. X *    11    library file seeks
  454. X */
  455. X
  456. X#ifndef lint
  457. Xstatic char rcsid[] =
  458. X"$Header: /src/local/cmd/jlook/jlook.c,v 1.3 90/12/22 19:18:40 daved Exp $";
  459. Xstatic char node[] = "physiol.su.oz.au";
  460. X#endif /* lint */
  461. X
  462. X#include <stdio.h>
  463. X#include "jlook.h"
  464. X#include <sys/types.h>
  465. X#include <sys/stat.h>
  466. X#include <ctype.h>
  467. X#ifdef REGEXP
  468. X#include <regexp.h>
  469. X#endif /* REGEXP */
  470. X
  471. XFILE    * infp,
  472. X    * outfp,    /* stdout or /dev/null */
  473. X    * altfp;    /* additional jlist file */
  474. Xchar    * xstr,
  475. X    * leadin,    /* initially %J, reset if refer macros input */
  476. X    * altfname;
  477. Xint    errflg,
  478. X    not_found,
  479. X    nodots,
  480. X    caps,
  481. X    maxwid,        /* maximum length title with unpaddable blanks */
  482. X    eflag,
  483. X    mflag,
  484. X    tflag,
  485. X    xflag,
  486. X    Eflag,
  487. X    Allflag,
  488. X    fflag,
  489. X    altfile,
  490. X    badcount;
  491. Xlong    altstart;
  492. X
  493. X#ifdef COMPAT
  494. XWarnCompat(c)
  495. X    char c;
  496. X{
  497. X    fprintf
  498. X    (    stderr,
  499. X        "%s: Warning: switch -%c is obsolete. Use -u%c instead.\n",
  500. X        progname,
  501. X        c,
  502. X        toupper(c)
  503. X    );
  504. X}
  505. X#endif /* COMPAT */
  506. X
  507. X
  508. Xmain(argc,argv)
  509. X    int argc; char **argv;
  510. X{
  511. X    register int    i;
  512. X    struct stat    sbuf;
  513. X    long        mtime,
  514. X            time();
  515. X    char        *listfile,
  516. X            *standard(),
  517. X            *format();
  518. X
  519. X    leadin = "%J ";
  520. X    listfile = LISTFILE;
  521. X    if((progname = strrchr(argv[0],'/')) != NULL)
  522. X        progname++;
  523. X    else progname = argv[0];
  524. X
  525. X    output = full;
  526. X    outfp = stdout;
  527. X
  528. X    while(--argc)
  529. X    {
  530. X        if(**++argv == '-')
  531. X          switch(*++*argv)
  532. X          {
  533. X            case 'A':
  534. X                Allflag++;
  535. X                break;
  536. X            case 'a':
  537. X                altfile++;
  538. X                argc--;
  539. X                altfname = *++argv;
  540. X                if((altfp = fopen(altfname,"r"))== NULL)
  541. X                    fatal("cannot open: %s\n",*argv);
  542. X                break;
  543. X#ifdef COMPAT
  544. X            case 'c':
  545. X                useab = 'C';
  546. X                WarnCompat(**argv);
  547. X                break;
  548. X#endif /* COMPAT */
  549. X            case 'C':
  550. X                caps++;
  551. X                break;
  552. X            case 'd':
  553. X                if(*++*argv)
  554. X                    debug = atoi(*argv);
  555. X                else
  556. X                    debug++;
  557. X                break;
  558. X            case 'E':
  559. X                Eflag++;
  560. X            case 'e':
  561. X                eflag++;
  562. X                break;
  563. X            case 'f':
  564. X                fflag++;
  565. X                break;
  566. X#ifdef COMPAT
  567. X            case 'i':
  568. X                useab = 'I';
  569. X                WarnCompat(**argv);
  570. X                break;
  571. X#endif /* COMPAT */
  572. X            case 'l':
  573. X                listfile = *++argv;
  574. X                argc--;
  575. X                break;
  576. X            case 'm':    /* macros (from refer) */
  577. X                mflag++;
  578. X                if(*++*argv != '\0')
  579. X                    leadin = *argv;
  580. X                else
  581. X                    leadin = ".ds [J ";
  582. X                break;
  583. X            case 'n':
  584. X                if((outfp = fopen("/dev/null","w")) == NULL)
  585. X                    fatal("cannot open","/dev/null");
  586. X                break;
  587. X            case 'p':
  588. X                nodots++;
  589. X                break;
  590. X            case 's':
  591. X                if(*++*argv)
  592. X                    maxwid = atoi(*argv);
  593. X                else
  594. X                    maxwid = 10;
  595. X                break;
  596. X            case 't':
  597. X                tflag++;
  598. X                break;
  599. X            case 'u':
  600. X                if((useab = *++*argv) == '\0')
  601. X                    fatal("no key following -u\n");
  602. X                if(islower(useab))
  603. X                    useab=toupper(useab);
  604. X                break;
  605. X#ifdef COMPAT
  606. X            case 'w':
  607. X                useab = 'W';
  608. X                WarnCompat(**argv);
  609. X                break;
  610. X#endif /* COMPAT */
  611. X            case 'X':
  612. X                xflag++;
  613. X            case 'x':
  614. X                xflag++;
  615. X                if(*++*argv != '\0')
  616. X                    xstr = *argv;
  617. X                break;
  618. X            default:
  619. X                fatal("unrecognized switch: %s\n", *argv);
  620. X          }
  621. X        else
  622. X            break;
  623. X    }
  624. X    if(!xstr)
  625. X    {
  626. X        if(mflag)
  627. X            xstr = ".\\\"X ";
  628. X        else
  629. X            xstr = "%X ";
  630. X    }
  631. X
  632. X    listopen(listfile);    /* sets lfp - may prepend path */
  633. X    if(stat(listfile,&sbuf))
  634. X        fatal("cannot stat: %s",listfile);
  635. X    mtime = sbuf.st_mtime;
  636. X    while(time((long *)0) - mtime < 10)
  637. X    {
  638. X        /* don't fail if a large library caught being rewritten */
  639. X        sleep(10);
  640. X        if(stat(listfile,&sbuf))
  641. X            fatal("cannot stat: %s\n",listfile);
  642. X        mtime = sbuf.st_mtime;
  643. X    }
  644. X    (void) strcpy(indfile,listfile);
  645. X    (void) strcat(indfile,".index");
  646. X    if(debug)
  647. X        fprintf(stderr,"list file = %s\nindex file = %s\n",
  648. X            listfile,indfile);
  649. X    
  650. X    /*
  651. X    ** now get the index if it exists and is up-to-date and is readable
  652. X    */
  653. X    if(stat(indfile,&sbuf))
  654. X    {
  655. X        warn("no index for %s, making internal index\n", listfile);
  656. X        l_index();
  657. X    }
  658. X    else if(sbuf.st_mtime < mtime)
  659. X    {
  660. X        warn("index predates %s, making internal index\n", listfile);
  661. X        l_index();
  662. X    }
  663. X    else if((indfp = fopen(indfile,"r")) ==  NULL)
  664. X    {
  665. X        warn("cannot open %s, making internal index\n", indfile);
  666. X        l_index();
  667. X    }
  668. X    else readindex();
  669. X
  670. X    /*
  671. X    ** if an alternate file was specified, make sure the keys match
  672. X    */
  673. X    if(altfile)
  674. X    {
  675. X        get_keys(altfp,1);
  676. X        altstart = ftell(altfp);
  677. X    }
  678. X    if(strchr(keys,useab) == NULL)
  679. X        fatal("abbreviation key %c not in library\n", useab);
  680. X
  681. X    /*
  682. X    ** now do the work - either names in args, or files
  683. X    */
  684. X    if(argc && !fflag)
  685. X    {
  686. X        char * item;
  687. X        while(argc--)
  688. X        {
  689. X            /* argv already points to "next" arg */
  690. X            if
  691. X            (
  692. X                !(
  693. X                    (**argv >= 'A' && **argv <= 'Z')
  694. X                    ||    /* for number proceeedings */
  695. X                    (**argv >= '1' && **argv <= '9')
  696. X                )
  697. X            )
  698. X                fatal
  699. X                (
  700. X                    "%s capital or number: %s\n",
  701. X                    "non file argument must start with",
  702. X                    *argv
  703. X                );
  704. X            not_found = 0;
  705. X            item = standard(*argv++);
  706. X            if(not_found == 0)
  707. X            {
  708. X                if(equivocal)
  709. X                    errflg = 1;
  710. X                if(caps || nodots)
  711. X                    printf("%s\n",
  712. X                        format(item,nodots,caps,0));
  713. X                else
  714. X                    printf("%s\n",item);
  715. X                if(Allflag)
  716. X                {
  717. X                    for(i = 0; i<nkeys; i++)
  718. X                        printf
  719. X                        (
  720. X                            "%c %s\n",
  721. X                            keys[i],
  722. X                            &abbrev[np[keys[i] -
  723. X                                'A']-1][0]
  724. X                        );
  725. X                    for(i = 0; i < nvariant; i++)
  726. X                        printf("V %s\n",&variant[i][0]);
  727. X                    for(i = 0; i < ngrep; i++)
  728. X                        printf("* %s\n",&grep[i][0]);
  729. X                }
  730. X            }
  731. X            else if(Eflag)
  732. X                printf("%s: no match found\n", *(argv-1));
  733. X        }
  734. X        exit(errflg);
  735. X    }
  736. X    if(argc) /* && flag */
  737. X    {
  738. X        while(argc--)
  739. X        {
  740. X            if((infp = fopen(*argv++,"r")) == NULL)
  741. X                fatal("cannot open: %s\n", *--argv);
  742. X            process();
  743. X            if(fclose(infp) == EOF)
  744. X                fatal("cannot fclose: %s\n", *argv);
  745. X        }
  746. X        uexit(errflg);
  747. X    }
  748. X    /* else do standard input */
  749. X    infp = stdin;
  750. X    process();
  751. X    uexit(errflg);
  752. X}
  753. X
  754. Xuexit(n)
  755. X    int n;
  756. X{
  757. X    if(!n && Eflag)
  758. X        warn("no errors found\n");
  759. X    exit(n);
  760. X}
  761. Xprocess()
  762. X{
  763. X    char    linebuf[BUFSIZ],
  764. X        * format(),
  765. X        * standard(),
  766. X        * fixcase();
  767. X
  768. X    while(fgets(linebuf,sizeof linebuf,infp) != NULL)
  769. X    {
  770. X        if(strlen(linebuf) >= sizeof linebuf -1)
  771. X            warn("input line too long: %s\n",linebuf);
  772. X        not_found=0;
  773. X        linebuf[strlen(linebuf)-1] = '\0';
  774. X        if(strncmp(linebuf,leadin,strlen(leadin)) == 0)
  775. X        {
  776. X            fprintf
  777. X            (
  778. X                outfp,
  779. X                "%s%s\n",
  780. X                leadin,
  781. X                (nodots || maxwid || caps) ?
  782. X                   format
  783. X                   (
  784. X                    standard(&linebuf[strlen(leadin)]),
  785. X                    nodots,
  786. X                    caps,
  787. X                    maxwid
  788. X                   )
  789. X                   : standard(&linebuf[strlen(leadin)])
  790. X            );
  791. X            if(equivocal)
  792. X                errflg = 1;
  793. X            if
  794. X            (
  795. X                (xflag && (not_found || equivocal))
  796. X                ||
  797. X                xflag > 1
  798. X            )
  799. X                fprintf
  800. X                (
  801. X                    outfp,
  802. X                    "%s%s\n",
  803. X                    xstr,
  804. X                    &linebuf[strlen(leadin)]
  805. X                );
  806. X            if((not_found || equivocal) && eflag)
  807. X                fprintf
  808. X                (
  809. X                    stderr,
  810. X                    "%%J %s\n",
  811. X                    &linebuf[strlen(leadin)]
  812. X                );
  813. X        }
  814. X        else
  815. X            fprintf(outfp,"%s\n",linebuf);
  816. X    }
  817. X}
  818. Xstatic char * standard(s)
  819. X    char *s;
  820. X{
  821. X    char        * regcmp(),
  822. X            *make_re(),
  823. X            * re,
  824. X            *re_text,
  825. X            *sre,
  826. X            *sought;
  827. X    static char    lastin[BUFSIZ];
  828. X    static int    last_status;
  829. X    int        i,
  830. X            this_letter,
  831. X            alt_done = 0,
  832. X            fixed = 0;
  833. X    FILE        *searchfile;
  834. X    long        startpoint,
  835. X            endpoint;
  836. X
  837. X    /*
  838. X    ** this little trick can vastly speed up processing of input
  839. X    ** containing sequential journal names which are identical
  840. X    ** - such as with lists of contents of a particular journal issue
  841. X    */
  842. X    if(strcmp(s,lastin) == 0)
  843. X    {
  844. X        if(last_status)
  845. X            return(s);
  846. X        return(output);
  847. X    }
  848. X    else
  849. X    {
  850. X        (void) strncpy(lastin,s,sizeof lastin);
  851. X        last_status = 0;
  852. X    }
  853. X
  854. X    if(*s >= '0' && *s <= '9')
  855. X        this_letter = 25;    /* 'Z' for numbered proceedings */
  856. X    else
  857. X    {
  858. X        if(*s < 'A' || *s > 'Z')
  859. X            goto no_no;
  860. X        this_letter = *s-'A';
  861. X    }
  862. X    searchfile = lfp;
  863. X    startpoint = letterseek[this_letter];
  864. X    if(this_letter < 25)
  865. X        endpoint = letterseek[this_letter+1];
  866. X
  867. Xdo_alt:
  868. X    sought = s;
  869. Xtrylower:
  870. X    if(fseek(searchfile,startpoint,0) < 0)
  871. X        fatal("seek failed\n");
  872. X    if(debug == 11)
  873. X        fprintf(stderr,"seek took us to %ld\n",ftell(searchfile));
  874. X    while (get_listing(searchfile))
  875. X    {
  876. X        if(debug>2 && debug < 10)
  877. X        {
  878. X            fprintf(stderr,"comparing <%s> and:\n\tF<%s>\n",sought,
  879. X            full);
  880. X            for(i = 0; i<nkeys; i++)
  881. X                fprintf
  882. X                (
  883. X                    stderr,
  884. X                    "\t%c<%s>\n",keys[i],
  885. X                    &abbrev[np[keys[i] - 'A']-1][0]
  886. X                );
  887. X        }
  888. X        /*  full title? */
  889. X        if ( strcmp(sought,full) == 0)
  890. X        {
  891. X            if(debug > 2 && debug < 10)
  892. X                fprintf(stderr,"returning %s\n",output);
  893. X            return(output);
  894. X        }
  895. X        /*  standard abbreviation or full title? */
  896. X        for(i=0; i<nabbrev; i++)
  897. X        {
  898. X            if(debug > 2 && debug < 10)
  899. X                fprintf (stderr,
  900. X                "comparing <%s> and <%s>\n",
  901. X                sought,&abbrev[i][0]);
  902. X            if ( strcmp(sought,&abbrev[i][0]) == 0)
  903. X                return(output);
  904. X        }
  905. X        /* listed variant - i.e. locally accepted */
  906. X        for(i = 0; i< nvariant; i++)
  907. X        {
  908. X            if(debug>2 && debug < 10)
  909. X                fprintf(stderr,"comparing <%s> against <%s>\n",
  910. X                    sought,&variant[i][0]);
  911. X            if(strcmp(sought,&variant[i][0]) == 0)
  912. X                return(output);
  913. X        }
  914. X        if(this_letter < 25 && position >= endpoint)
  915. X            break;
  916. X    }
  917. X
  918. X    /* getting here means the input was not in the jlist file */
  919. X    /* so can an re match get it against the full title ? */
  920. X
  921. X    /* start again in the jlist */
  922. X    if(fseek(searchfile,startpoint,0) < 0)
  923. X        fatal("seek failed\n");
  924. X    if(!alt_done)
  925. X        re = regcmp("^",re_text=make_re(sought),0);
  926. X    while (get_listing(searchfile))
  927. X    {
  928. X        if(debug>1 && debug < 10)
  929. X        {
  930. X            fprintf (stderr,
  931. X            "comparing re <%s> and: <%s>\n",
  932. X            re_text,full);
  933. X        }
  934. X        if(regex(re,full,0))
  935. X        {
  936. X            free(re);
  937. X            return(output);
  938. X        }
  939. X        if(this_letter < 25 && position >= endpoint)
  940. X            break;
  941. X    }
  942. X    /* getting here means the input was not a full title in the jlist */
  943. X    /* so can we match against an abbreviation? */
  944. X    if(debug)
  945. X        fprintf(stderr,"match against full titles failed\n");
  946. X    /* start again in the jlist */
  947. X    if(fseek(searchfile,startpoint,0) < 0)
  948. X        fatal("seek failed\n");
  949. X    while (get_listing(searchfile))
  950. X    {
  951. X        if(debug>1 && debug < 10)
  952. X        {
  953. X            fprintf (stderr,
  954. X            "comparing re <%s> and: <%s>\n",
  955. X            re_text,full);
  956. X        }
  957. X        for(i = 0; i< nabbrev; i++)
  958. X        {
  959. X            if(debug>2 && debug < 10)
  960. X                fprintf(stderr,"comparing re against <%s>\n",
  961. X                    &abbrev[i][0]);
  962. X            if(regex(re,&abbrev[i][0],0))
  963. X            {
  964. X                free(re);
  965. X                return(output);
  966. X            }
  967. X        }
  968. X        for(i = 0; i< nvariant; i++)
  969. X        {
  970. X            if(debug>2 || debug == 10)
  971. X                fprintf(stderr,"comparing <%s> against <%s>\n",
  972. X                    re, &variant[i][0]);
  973. X            if(regex(re,&variant[i][0],0))
  974. X            {
  975. X                free(re);
  976. X                return(output);
  977. X            }
  978. X        }
  979. X            /* if there is a grep string - try it */
  980. X        for(i = 0; i< ngrep; i++)
  981. X        {
  982. X            sre = regcmp("^",&grep[i][0],0);
  983. X            if(debug>2 && debug < 10)
  984. X                fprintf(stderr,"trying grep string %s\n",
  985. X                    &grep[i][0]);
  986. X            if(regex(sre,sought,0))
  987. X            {
  988. X                free(re);
  989. X                free(sre);
  990. X                return(output);
  991. X            }
  992. X            free(sre);
  993. X#if    defined(RE_EXEC) || defined(REGEXP)
  994. X            /* a nasty compatibility problem: re_comp keeps
  995. X                its own copy of the re, so we can't reuse it */
  996. X            free(re);
  997. X            re = regcmp("^",re_text,0);
  998. X#endif /* defined(RE_EXEC || defined(REGEXP) */
  999. X        }
  1000. X        if(this_letter < 25 && position >= endpoint)
  1001. X            break;
  1002. X    }
  1003. X    /*
  1004. X    ** if we have still failed by the time we get here, one possibility
  1005. X    ** is that the input is all upper case, such as produced by some
  1006. X    ** bibliographic software.  This will not match the data base.
  1007. X    ** so...
  1008. X    */
  1009. X    if(!fixed && allupper(s))
  1010. X    {
  1011. X        register char * tmp;
  1012. X        tmp = fixcase(s);
  1013. X        if(debug)
  1014. X            fprintf(stderr, "trying fixed case <%s>\n",
  1015. X                    tmp);
  1016. X        sought = tmp;
  1017. X        fixed++;
  1018. X        goto trylower;
  1019. X    }
  1020. X    fixed = 0;
  1021. X    /* failed on this search file - if we have an alternate file
  1022. X        and have not done it yet, now is the time */
  1023. X    if(altfile && alt_done++ == 0)
  1024. X    {
  1025. X        if(debug)
  1026. X            fprintf(stderr,"using alternate file %s\n",altfname);
  1027. X        startpoint = altstart;
  1028. X        endpoint = 10000000L;
  1029. X        searchfile = altfp;
  1030. X        goto do_alt;
  1031. X    }
  1032. X    free(re);
  1033. Xno_no:
  1034. X    not_found = errflg = 1;    /* errflg is never reset */
  1035. X    if(badcount++ == 10)
  1036. X        (void) nice(6);    /* this person isn't trying ? */
  1037. X    last_status = 1;    /* in case we are asked again */
  1038. X    return(s);         /* what we were given - failed! */
  1039. X}
  1040. Xchar * make_re(in)
  1041. X    char *in;
  1042. X{
  1043. X    static char    * dotstr = "[-a-z.,'`\"\\*:; ]*"; /* '`"\o and \*:
  1044. X                                for diacrits */
  1045. X    static char    * enddot = "[a-z.]*";
  1046. X    static char    * colonstr = "[-:;., ]*";
  1047. X    static char    * closestr = "[]a-z). ]*";    /* ) or ] */
  1048. X    static char    * seriesstr = "[[Series cton]*"; /* Series or Section */
  1049. X        /* diacrits:  this is a mess because we want to accept
  1050. X            a number of input styles:
  1051. X               tpr:    <diacrit> slosh 'o' letter
  1052. X               macro packages: letter slosh '*' ['`:;]
  1053. X               troff: slosh o delim letter diacrit letter ? will it?
  1054. X         */
  1055. X    static char    *diacrits = "[\"'`^\\\\o*:;]*";
  1056. X    static char    buf[RE_MAX];
  1057. X    int        enddone = 0;
  1058. X    register char    *tmp,
  1059. X            *out,
  1060. X            *start;
  1061. X
  1062. X    out = buf;
  1063. X    start = in;
  1064. X
  1065. X        /* convert to a useful re */
  1066. X    while(*in)
  1067. X        switch(*in)
  1068. X    {
  1069. X        case '.':    /* an abbreviation */
  1070. X            if(*(in +1) == '\0')
  1071. X            {
  1072. X                tmp = enddot;
  1073. X                enddone++;
  1074. X            }
  1075. X            else
  1076. X                tmp = dotstr;
  1077. X            while(*tmp)
  1078. X                *out++ = *tmp++;
  1079. X            if(*++in == ' ')
  1080. X                in++;
  1081. X            break;
  1082. X        case ' ': /* shouldn't get space after dot cause of above */
  1083. X            while(*(in+1) == ' ')
  1084. X                in++;    /* absorb multiple spaces */
  1085. X            if(*(in +1) == '\0')
  1086. X            {
  1087. X                in++;
  1088. X                break;
  1089. X            }
  1090. X            tmp=dotstr;
  1091. X            while(*tmp)
  1092. X                *out++ = *tmp++;
  1093. X            in++;
  1094. X            break;
  1095. X        case ',':    /* could be there, but maybe not */
  1096. X            *out++ = *in++;
  1097. X            *out++ = '*';
  1098. X            break;
  1099. X        case '-':    /* treat like ':' but strip any leading space
  1100. X                   and use any case of following letter (below) 
  1101. X                     */
  1102. X            if (*(out-1) == ' ')
  1103. X                out--;
  1104. X        case ';':    /* typo? */
  1105. X        case ':':    /* tricky - might be there, with or without
  1106. X                    following space, or as a '-' instead */
  1107. X            tmp = colonstr;
  1108. X            while(*tmp)
  1109. X                *out++ = *tmp++;
  1110. X            if(*in == '-')
  1111. X            {
  1112. X                in++;
  1113. X                if(isalpha(*in))
  1114. X                {
  1115. X                    *out++ = '[';
  1116. X                    if(isupper(*in))
  1117. X                        *out++ = tolower(*in);
  1118. X                    else
  1119. X                        *out++ = toupper(*in);
  1120. X                    *out++ = *in++;
  1121. X                    *out++ = ']';
  1122. X                }
  1123. X                else if(*in == ' ')
  1124. X                    in++;
  1125. X                break;
  1126. X            }
  1127. X            else if(*++in == ' ')
  1128. X                in++;
  1129. X            break;
  1130. X        case ']':
  1131. X        case ')':    /* might be there, might not, also might
  1132. X                    have a preceeding '.' missing */
  1133. X            if(*(out-1) == '.' || *(out -1) == ' ')
  1134. X                out--;
  1135. X            tmp = closestr;
  1136. X            while(*tmp)
  1137. X                *out++ = *tmp++;
  1138. X            in++;
  1139. X            break;
  1140. X        case '(':    /* might be there, might not */
  1141. X#ifndef RE_COMP
  1142. X            *out++ = '\\';
  1143. X#endif /* RE_COMP */
  1144. X            *out++ = *in++;
  1145. X            *out++ = '*';
  1146. X            break;
  1147. X        case 'A':
  1148. X        case 'B':
  1149. X        case 'C':
  1150. X            if
  1151. X            (
  1152. X                !(
  1153. X                *(in+1) == '\0'        /* trailing letter */
  1154. X                ||
  1155. X                (            /* letter dot */
  1156. X                    *(in+1) == '.'
  1157. X                    &&
  1158. X                    *(in+2) == '\0'
  1159. X                )
  1160. X                 )
  1161. X            )
  1162. X                goto regular;
  1163. X            tmp = seriesstr;
  1164. X            while(*tmp)
  1165. X                *out++ = *tmp++;
  1166. X            *out++ = *in++;
  1167. X            *out++ = '.';
  1168. X            *out++ = '*';
  1169. X            if(*in != '\0')
  1170. X                in++;    /* that letter dot case */
  1171. X            break;
  1172. X
  1173. X            /* diacrits */
  1174. X        case '\'':            /* something like "l'Acad" */
  1175. X            *out++ = '*';        /* the preceeding letter */
  1176. X            if (*(in+1) == 's')    /* quite possible the ' is */
  1177. X            {            /* an error           */
  1178. X                *out++ = *in++;
  1179. X                *out++ = '*';
  1180. X                break;
  1181. X            }
  1182. X        case '"':
  1183. X        case '^':
  1184. X        case '`':
  1185. X            if(*(in+1) != '\\' || *(in+2) != 'o')    /* tpr */
  1186. X            {
  1187. X                *out++ = *in++;
  1188. X                *out++ = '*';
  1189. X                break;
  1190. X            }
  1191. X            tmp = diacrits;
  1192. X            while(*tmp)
  1193. X                *out++ = *tmp++;
  1194. X            in += 3; /* skip current char plus \o */
  1195. X            break;
  1196. X            /* things that might need to be sloshed */
  1197. X        case '\\':
  1198. X            if(*(in+1) == '*')    /* macro type diacit */
  1199. X            {
  1200. X                in++;        /* ignore slosh */
  1201. X                in++;        /* ignore asterisk */
  1202. X                in++;        /* ignore the diacrit */
  1203. X                tmp = diacrits;
  1204. X                while(*tmp)
  1205. X                    *out++ = *tmp++;
  1206. X                break;
  1207. X            }
  1208. X            else if (*(in+1) == ' ')/* unpaddable space */
  1209. X            {
  1210. X                in++;        /* ignore slosh */
  1211. X                break;
  1212. X            }
  1213. X        case '*':
  1214. X        case '[':
  1215. X        /* case ']': */
  1216. X            *out++ = '\\';
  1217. X            *out++ = *in++;
  1218. X            break;
  1219. X        default:
  1220. X            /*
  1221. X            ** special case of 2/3 letter words which may/may
  1222. X            ** not be capitalized
  1223. X            */
  1224. X            if
  1225. X            (
  1226. X                in > start
  1227. X                &&
  1228. X                *(in-1) == ' '
  1229. X                &&
  1230. X                isupper(*in)
  1231. X                &&
  1232. X                *(in+1)
  1233. X                &&
  1234. X                (
  1235. X                    *(in+2) == ' '
  1236. X                    ||
  1237. X                    (
  1238. X                        *(in+2)
  1239. X                        &&
  1240. X                        *(in+3) == ' '
  1241. X                    )
  1242. X                )
  1243. X            )
  1244. X            {
  1245. X                *out++ = '[';
  1246. X                *out++ = tolower(*in);
  1247. X                *out++ = *in++;
  1248. X                *out++ = ']';
  1249. X                break;
  1250. X            }
  1251. Xregular:
  1252. X            *out++ = *in++;
  1253. X            break;
  1254. X    }
  1255. X    while(*(out-1) == ' ' || *(out-1) == '\t') /* clobber trailing white */
  1256. X        out--;
  1257. X    if(!enddone)    /* might have something left of end of last word */
  1258. X    {
  1259. X        tmp = enddot;
  1260. X        while(*tmp)
  1261. X            *out++ = *tmp++;
  1262. X    }
  1263. X    if(!tflag)
  1264. X        *out++ = '$';
  1265. X    if(out >= buf + RE_MAX)
  1266. X        fatal("re buffer size exceeded: %s\n",buf);
  1267. X    *out = '\0';
  1268. X    if(debug)
  1269. X        fprintf(stderr,"re: %s\n",buf);
  1270. X    return(buf);
  1271. X}
  1272. Xchar *
  1273. Xformat(s,nodots,caps,maxwid)
  1274. X    char *s;
  1275. X    int nodots,caps,maxwid;
  1276. X{
  1277. X    /*
  1278. X    **    eliminate fullstops in abbreviations
  1279. X    **    place sloshes before spaces
  1280. X    **    convert to uppercase only
  1281. X    */
  1282. X
  1283. X    register    count = 0;
  1284. X    register    char    *lp;
  1285. X    static        char    lbuf[256];
  1286. X
  1287. X    lp = lbuf;
  1288. X    while(*s)
  1289. X    {
  1290. X        if(nodots && *s == '.')
  1291. X        {
  1292. X            s++;
  1293. X            continue;
  1294. X        }
  1295. X        if(caps && islower(*s))
  1296. X            *s = toupper(*s);
  1297. X        if(maxwid && *s == ' ')
  1298. X        {
  1299. X            if(count > maxwid)
  1300. X            {
  1301. X                *lp++ = *s++;
  1302. X                count = 0;
  1303. X                continue;
  1304. X            }
  1305. X            *lp++ = '\\';
  1306. X        }
  1307. X        *lp++ = *s++;
  1308. X        count++;
  1309. X    }
  1310. X    *lp = '\0';
  1311. X    return(lbuf);
  1312. X}
  1313. X
  1314. X#if    defined(REGEXP) && defined(RE_EXEC)
  1315. X#    include "use only one of REGEXP or RE_EXEC"
  1316. X#endif    /* defined(REGEXP) && defined(RE_EXEC) */
  1317. X
  1318. X#ifdef REGEXP
  1319. X    /*  these functions are not an attempt at complete duplication of
  1320. X     *  the version 7 ones, but will do the job for the calls above
  1321. X     */
  1322. Xstatic    char    re_incore[RE_MAX];
  1323. Xint        re_errflag;
  1324. Xstatic    regexp    *regprog;
  1325. Xregex(re,str,n)
  1326. X    char * re, * str;
  1327. X    int n;
  1328. X{
  1329. X    int    retval;
  1330. X
  1331. X    if(strcmp(re,re_incore))
  1332. X    {
  1333. X        if (re_errflag++ == 0)
  1334. X            warn("regex problem: was <%s>; request <%s>\n",
  1335. X                re_incore,re);
  1336. X        return(0);    /* i.e. no match */
  1337. X    }
  1338. X
  1339. X    if(n || re == NULL)
  1340. X        fatal("internal error: regex given invalid argument\n");
  1341. X    if (debug > 2 && debug < 10)
  1342. X        fprintf(stderr,"regexec <%s> <%s>",re,str);
  1343. X    if((retval = regexec(regprog,str)) == -1)
  1344. X    {
  1345. X        warn("regexec internal error: %s\n",str);
  1346. X        return(0);
  1347. X    }
  1348. X    if (debug > 2 && debug < 10)
  1349. X        fprintf(stderr," returned %d\n",retval);
  1350. X    return(retval);
  1351. X}
  1352. Xchar *
  1353. Xregcmp(s1,s2,n)
  1354. X    char * s1,*s2;
  1355. X    int n;
  1356. X{
  1357. X    char    * bufp;
  1358. X    char    * malloc(),
  1359. X        * re_comp();
  1360. X
  1361. X#ifdef lint
  1362. X    if(0)
  1363. X        regerror("keep lint smiling\n");
  1364. X#endif /* lint */
  1365. X
  1366. X    re_errflag = 0;
  1367. X    if(n)
  1368. X        fatal("internal error: regcmp given invalid argument");
  1369. X    if((bufp = malloc((unsigned)strlen(s1)+strlen(s2)+1)) == NULL)
  1370. X        fatal("malloc failed in regcmp\n");
  1371. X    (void) strcpy(bufp,s1);
  1372. X    (void) strcat(bufp,s2);
  1373. X    (void) strcpy(re_incore,bufp);            /* keep a record */
  1374. X    if(regprog)
  1375. X        free((char *)regprog);
  1376. X    if((regprog = regcomp(bufp)) == NULL)
  1377. X    {
  1378. X        /*
  1379. X        ** if we get this error, try to recover with a string
  1380. X        ** that should always compile and never match so we must
  1381. X        ** pass the input through
  1382. X        */
  1383. X        (void) strcpy(bufp,"UN_JOURNAL_ERROR_STOPPER");
  1384. X        regprog = regcomp(bufp); /* should always compile */
  1385. X    }
  1386. X    return(bufp);
  1387. X}
  1388. X/*
  1389. X** prevent fatal errors
  1390. X*/
  1391. Xvoid
  1392. Xregerror(s)
  1393. X    char *s;
  1394. X{
  1395. X    warn("%s\n",s);
  1396. X}
  1397. X#endif /* REGEXP */
  1398. X#ifdef RE_EXEC
  1399. X    /*  these functions are not an attempt at complete duplication of
  1400. X     *  the version 7 ones, but will do the job for the calls above
  1401. X     */
  1402. Xstatic    char    re_incore[RE_MAX];
  1403. Xint        re_errflag;
  1404. Xregex(re,str,n)
  1405. X    char * re, * str;
  1406. X    int n;
  1407. X{
  1408. X    int retval;
  1409. X
  1410. X    if(strcmp(re,re_incore))
  1411. X    {
  1412. X        if (re_errflag++ == 0)
  1413. X            warn("regex problem: was <%s>; request <%s>\n",
  1414. X                re_incore,re);
  1415. X        return(0);    /* i.e. no match */
  1416. X    }
  1417. X
  1418. X    if(n || re == NULL)
  1419. X        fatal("internal error: regex given invalid argument\n");
  1420. X    if (debug > 2 && debug < 10)
  1421. X        fprintf(stderr,"re_exec <%s> <%s>",re,str);
  1422. X    if((retval = re_exec(str)) == -1)
  1423. X    {
  1424. X        warn("re_exec internal error: %s\n",str);
  1425. X        return(0);
  1426. X    }
  1427. X    if (debug > 2 && debug < 10)
  1428. X        fprintf(stderr," returned %d\n",retval);
  1429. X    return(retval);
  1430. X}
  1431. Xchar *
  1432. Xregcmp(s1,s2,n)
  1433. X    char * s1,*s2;
  1434. X    int n;
  1435. X{
  1436. X    char    * bufp;
  1437. X    char    * malloc(),
  1438. X        * re_comp(),
  1439. X        * errmes;
  1440. X
  1441. X    re_errflag = 0;
  1442. X    if(n)
  1443. X        fatal("internal error: regcmp given invalid argument");
  1444. X    if((bufp = malloc((unsigned)strlen(s1)+strlen(s2)+1)) == NULL)
  1445. X        fatal("malloc failed in regcmp\n");
  1446. X    (void) strcpy(bufp,s1);
  1447. X    (void) strcat(bufp,s2);
  1448. X    (void) strcpy(re_incore,bufp);            /* keep a record */
  1449. X    if((errmes = re_comp(bufp)) != 0)
  1450. X    {
  1451. X        warn("re_comp error: %s: %s\n", errmes, bufp);
  1452. X        /*
  1453. X        ** if we get this error, try to recover with a string
  1454. X        ** that should always compile and never match so we must
  1455. X        ** pass the input through
  1456. X        */
  1457. X        (void) strcpy(bufp,"UN_JOURNAL_ERROR_STOPPER");
  1458. X        (void) re_comp(bufp); /* should always compile */
  1459. X    }
  1460. X    return(bufp);
  1461. X}
  1462. X#endif /* RE_EXEC */
  1463. X
  1464. X/* VARARGS1 */
  1465. Xwarn(fmt,a1,a2,a3,a4,a5,a6,a7,a8,a9)
  1466. X    char    * fmt;
  1467. X    long    a1,a2,a3,a4,a5,a6,a7,a8,a9;
  1468. X{
  1469. X    fprintf(stderr,"%s: ", progname);
  1470. X    fprintf(stderr, fmt, a1,a2,a3,a4,a5,a6,a7,a8,a9);
  1471. X}
  1472. X
  1473. Xallupper(p)
  1474. X    char *p;
  1475. X{
  1476. X    for( ; *p != '\0'; p++)
  1477. X        if(*p >= 'a' && *p <= 'z')
  1478. X            return (0);
  1479. X    return(1);
  1480. X}
  1481. X
  1482. Xchar * fixcase(p)
  1483. X    char *p;
  1484. X{
  1485. X    register int    lastwasup;
  1486. X    register char    * out;
  1487. X    static   char    outline[BUFSIZ];
  1488. X
  1489. X    for(out=outline, lastwasup=0; *p != '\0'; p++, out++)
  1490. X    {
  1491. X        if (*p >= 'A' && *p <= 'Z')
  1492. X        {
  1493. X            if(lastwasup)
  1494. X                *out = *p - 'A' + 'a';
  1495. X            else
  1496. X            {
  1497. X                lastwasup = 1;
  1498. X                *out = *p;
  1499. X            }
  1500. X        }
  1501. X        else
  1502. X        {
  1503. X            lastwasup = 0;
  1504. X            *out = *p;
  1505. X        }
  1506. X    }
  1507. X    *out = '\0';
  1508. X    return(outline);
  1509. X}
  1510. SHAR_EOF
  1511. chmod 0440 jlook.c || echo "restore of jlook.c fails"
  1512. set `wc -c jlook.c`;Sum=$1
  1513. if test "$Sum" != "21161"
  1514. then echo original size 21161, current size $Sum;fi
  1515. echo "x - extracting jindex.c (Text)"
  1516. sed 's/^X//' << 'SHAR_EOF' > jindex.c &&
  1517. X/* jindex.c
  1518. X *
  1519. X *    Copyright D.F. Davey, University of Sydney
  1520. X *
  1521. X *    Permission is granted for the distribution of this software
  1522. X *    for non-profit purposes and provided this notice remains intact
  1523. X *
  1524. X *    daved@physiol.su.oz.au
  1525. X */
  1526. X
  1527. X#ifndef lint
  1528. Xstatic char rcsid[] =
  1529. X"$Header: /src/local/cmd/jlook/RCS/jindex.c,v 1.1 90/02/04 14:35:14 daved Rel $";
  1530. Xstatic char node[] = "physiol.su.oz.au";
  1531. X#endif /* lint */
  1532. X
  1533. X#include <stdio.h>
  1534. X#include "jlook.h"
  1535. X
  1536. Xmain(argc,argv)
  1537. X    int argc; char **argv;
  1538. X{
  1539. X    char * listfile = LISTFILE;
  1540. X
  1541. X    if((progname = strrchr(argv[0],'/')) != NULL)
  1542. X        progname++;
  1543. X    else progname = argv[0];
  1544. X
  1545. X    while(--argc)
  1546. X    {
  1547. X        if(**++argv == '-')
  1548. X          switch(*++*argv)
  1549. X          {
  1550. X            case 'd':
  1551. X                if(*++*argv)
  1552. X                    debug = atoi(*argv);
  1553. X                else
  1554. X                    debug++;
  1555. X                break;
  1556. X            case 'l':
  1557. X                listfile = *++argv;
  1558. X                argc--;
  1559. X                break;
  1560. X            default:
  1561. X                fatal("unrecognized switch: %s\n",*argv);
  1562. X          }
  1563. X        else
  1564. X            break;
  1565. X    }
  1566. X
  1567. X    listopen(listfile);    /* sets lfp - may prepend path */
  1568. X    (void) strcpy(indfile,listfile);
  1569. X    if((indfp = fopen(strcat(indfile,".index"),"w")) == NULL)
  1570. X        fatal("cannot open: %s\n", indfile);
  1571. X    indexing++;
  1572. X    l_index();
  1573. X    outindex();
  1574. X    if(debug)
  1575. X    {
  1576. X        if(fclose(indfp) == EOF)
  1577. X            fatal("cannot fclose: %s\n", indfile);
  1578. X        if((indfp = fopen(indfile,"r")) == NULL)
  1579. X            fatal("cannot open: %s\n", indfile);
  1580. X        readindex();
  1581. X    }
  1582. X    exit(0);
  1583. X}
  1584. X
  1585. Xoutindex()
  1586. X{
  1587. X    register int i;
  1588. X
  1589. X    fprintf(indfp,"%s\n",keys);
  1590. X    if(debug)
  1591. X        fprintf(stderr,"%s\n",keys);
  1592. X    for(i = 0; i<26; i++)
  1593. X    {
  1594. X        fprintf(indfp,"%ld\n",letterseek[i]);
  1595. X        if(debug)
  1596. X            fprintf(stderr,"writing %ld for %d (%c)\n",
  1597. X                letterseek[i],i,(char) 'A' + i);
  1598. X    }
  1599. X}
  1600. SHAR_EOF
  1601. chmod 0440 jindex.c || echo "restore of jindex.c fails"
  1602. set `wc -c jindex.c`;Sum=$1
  1603. if test "$Sum" != "1597"
  1604. then echo original size 1597, current size $Sum;fi
  1605. echo "x - extracting jsubs.c (Text)"
  1606. sed 's/^X//' << 'SHAR_EOF' > jsubs.c &&
  1607. X/* jsubs.c
  1608. X *
  1609. X *    Copyright D.F. Davey, University of Sydney
  1610. X *
  1611. X *    Permission is granted for the distribution of this software
  1612. X *    for non-profit purposes and provided this notice remains intact
  1613. X *
  1614. X *    daved@physiol.su.oz.au
  1615. X */
  1616. X
  1617. X#ifndef lint
  1618. Xstatic char jsubs_id[] =
  1619. X"$Header: /src/local/cmd/jlook/jsubs.c,v 1.2 90/06/06 17:55:10 daved Exp Locker: daved $";
  1620. X#endif /* lint */
  1621. X
  1622. X#include    <stdio.h>
  1623. X
  1624. X#ifdef VERSION_7
  1625. X#include    <param.h>
  1626. X#else /* VERSION_7 */
  1627. X#include    <sys/param.h>
  1628. X#endif /* VERSION_7 */
  1629. X
  1630. X#include    "jlook.h"
  1631. X
  1632. X#ifndef    MAXPATHLEN
  1633. X#define MAXPATHLEN 128
  1634. X#endif
  1635. X
  1636. Xget_keys(f,checkonly)
  1637. X    FILE    *f;
  1638. X    int    checkonly;
  1639. X{
  1640. X    register char c;
  1641. X    char    buf[20];
  1642. X    int    naltkeys = 0;
  1643. X
  1644. X    getlabel(buf,f);
  1645. X    if(strcmp(buf,KEYS) != 0)
  1646. X        fatal("fails to start with keys: %s (line %d)\n", buf,line_num);
  1647. X    while ((c = getc(f)) != '\n')
  1648. X    {
  1649. X        switch(c)
  1650. X        {
  1651. X            case ' ':
  1652. X            case '\t':
  1653. X                continue;
  1654. X            case ACCEPT:
  1655. X            case EXCEPTION:
  1656. X            case UNDEFINED:
  1657. X            case GREP:
  1658. X            case SORT:
  1659. X            case FULLTAG:
  1660. X                fatal("reserved key letter: %c\n", c);
  1661. X            default:
  1662. X                if(c < 'A' || c > 'Z')
  1663. X                    fatal("key not capital letter: %c\n",c);
  1664. X                if(checkonly)
  1665. X                {
  1666. X                    if(strchr(keys,c) == NULL)
  1667. X                        fatal
  1668. X                        (
  1669. X                            "%s %c %s (%s)\n",
  1670. X                            "alternate file key",
  1671. X                            c,
  1672. X                            "not in library keys",
  1673. X                            keys
  1674. X                        );
  1675. X                    naltkeys++;
  1676. X                }
  1677. X                else
  1678. X                {
  1679. X                    if(strchr(keys,c) != NULL)
  1680. X                        fatal("duplicated key: %c\n",c);
  1681. X                    keys[nkeys++] = c;
  1682. X                }
  1683. X        }
  1684. X    }
  1685. X    line_num++;
  1686. X    if(checkonly && naltkeys != nkeys)
  1687. X        fatal
  1688. X        (
  1689. X            "%s (%d) and alternate file (%d) keys\n",
  1690. X            "different number of library",
  1691. X            nkeys,
  1692. X            naltkeys
  1693. X        );
  1694. X    if(debug == 1)
  1695. X    {
  1696. X        if(checkonly)
  1697. X            fprintf(stderr,"check only: ");
  1698. X        fprintf(stderr,"Keys: %s\n",keys);
  1699. X    }
  1700. X}
  1701. X    
  1702. Xget_listing(f)
  1703. X    FILE *f;
  1704. X{
  1705. X    register char * tag, *first;
  1706. X    int    nfirst;
  1707. X    char    buf[20];
  1708. X    nfirst = 0;
  1709. X    first = '\0';
  1710. X    out_of_order = ngrep =  nvariant = nabbrev = equivocal = 0;
  1711. X    full[0] = '\0';
  1712. X
  1713. X    tag = keys;
  1714. X    while(*tag)
  1715. X        np[*tag++ - 'A'] = 0;
  1716. X    for(;;)
  1717. X    {
  1718. X        tag = buf;
  1719. X        getlabel(tag,f);
  1720. X
  1721. X        if(debug >= 2 && debug < 10)
  1722. X            fprintf(stderr,"reading label <%s> in list file\n",buf);
  1723. X
  1724. X        switch(*tag)
  1725. X        {
  1726. X            case '\0':
  1727. X                if(debug > 3 && debug < 10)
  1728. X                    fprintf(stderr,"getlabel return(0)\n");
  1729. X                return(0);
  1730. X            case '\n':
  1731. X                if(debug > 2 && debug < 10)
  1732. X                    fprintf(stderr,"nvariant = %d\n",
  1733. X                            nvariant);
  1734. X                if(debug > 3 && debug < 10)
  1735. X                    fprintf(stderr,"getlabel return(1)\n");
  1736. X                if(useab)
  1737. X                    output = &abbrev[np[useab-'A']-1][0];
  1738. X                position = ftell(f);
  1739. X                return(1);
  1740. X            case FULLTAG:
  1741. X                if(full[0])
  1742. X                    fatal
  1743. X                    (
  1744. X                        "F duplicated: %s at line %d\n",
  1745. X                        full,
  1746. X                        line_num
  1747. X                    );
  1748. X                getline(first = full,f);
  1749. X                break;
  1750. X            case ACCEPT:
  1751. X                getline(&variant[nvariant++][0],f);
  1752. X                break;
  1753. X            case GREP:
  1754. X                getline(&grep[ngrep++][0],f);
  1755. X                break;
  1756. X            case EXCEPTION:
  1757. X                getline(first = full,f);
  1758. X                out_of_order++;
  1759. X                break;
  1760. X            case UNDEFINED:
  1761. X                getline(first = full,f);
  1762. X                equivocal++;
  1763. X                break;
  1764. X            default:
  1765. X                if(strchr(keys,*tag) == NULL)
  1766. X                    fatal
  1767. X                    (
  1768. X                        "bad tag: %s at line %d\n",
  1769. X                        buf,
  1770. X                        line_num
  1771. X                    );
  1772. X                if(indexing && np[*tag-'A'])
  1773. X                    fatal
  1774. X                    (
  1775. X                        "%c duplicate: %s at line %d\n",
  1776. X                        *tag,
  1777. X                        full,
  1778. X                        line_num
  1779. X                    );
  1780. X                np[*tag-'A'] = nabbrev + 1;
  1781. X                first = &abbrev[nfirst=nabbrev++][0];
  1782. X                getline(first,f);
  1783. X                break;
  1784. X        }
  1785. X        if(*(tag+1) && !first)
  1786. X            fatal("inappropriate tag list: %s\n", buf);
  1787. X        while(*++tag)
  1788. X        {
  1789. X            if(debug > 1 && debug < 10)
  1790. X                fprintf(stderr,"for %s, additional tag %c\n",
  1791. X                        first,*tag);
  1792. X            if(strchr(keys,*tag) == NULL)
  1793. X                fatal("inappropriate tag list: %s\n",buf);
  1794. X            if(indexing && np[*tag-'A'])
  1795. X                fatal("%c entry duplicated: %s\n",*tag,buf);
  1796. X            if(nabbrev)
  1797. X                np[*tag - 'A'] = nfirst+1;
  1798. X            else
  1799. X            {
  1800. X                np[*tag - 'A'] = nabbrev + 1;
  1801. X                (void)strcpy(&abbrev[nfirst=nabbrev++][0],full);
  1802. X            }
  1803. X        }
  1804. X        if(nabbrev >= NABBR)
  1805. X            fatal
  1806. X            (
  1807. X                "too many abbreviation fields: %s at line %d\n",
  1808. X                full,
  1809. X                line_num
  1810. X            );
  1811. X        if(nvariant >= NVARIANT)
  1812. X            fatal
  1813. X            (
  1814. X                "too many V fields: %s at line %d\n",
  1815. X                full,
  1816. X                line_num
  1817. X            );
  1818. X    }
  1819. X}
  1820. Xgetline(s,locfp)
  1821. X    char *s;
  1822. X    FILE *locfp;
  1823. X{
  1824. X    register char    *p;
  1825. X    char        *start;
  1826. X    start = p = s;
  1827. Xcont:
  1828. X    while((*p = getc(locfp)) == ' ' || *p == '\t')
  1829. X        ;    /* ignore leading white space */
  1830. X    p++;
  1831. X    while((*p = getc(locfp)) != '\n')
  1832. X        p++;
  1833. X    line_num++;
  1834. X    if(*(p-1) == '\\')
  1835. X    {
  1836. X        *(p-1) = ' ';
  1837. X        if(*(p-2) == ' ')
  1838. X            p--;
  1839. X        goto cont;
  1840. X    }
  1841. X    if(p - start > JMAX)
  1842. X        fatal("name too long: %s at line %d\n", full, line_num);
  1843. X    *p = '\0';
  1844. X}
  1845. Xgetlabel(s,locfp)
  1846. X    char *s;
  1847. X    FILE *locfp;
  1848. X{
  1849. X    register    char c,
  1850. X            lastc;
  1851. X    register int    count = 0;
  1852. X
  1853. X    while((c = getc(locfp)) != EOF)
  1854. X    {
  1855. X        if(count++ == 0 && (c == '#' || c == SORT))
  1856. X        {
  1857. Xmore:
  1858. X            while((c = getc(locfp)) != '\n')
  1859. X                lastc = c;
  1860. X            count = 0;
  1861. X            line_num++;
  1862. X            if(lastc == '\\')
  1863. X                goto more;
  1864. X            continue;
  1865. X        }
  1866. X        if(c == ' ' || c == '\t')
  1867. X            break;
  1868. X        *s++ = c;
  1869. X        if(c == '\n')
  1870. X        {
  1871. X            line_num++;
  1872. X            break; /* but return it as tag for end of item */
  1873. X        }
  1874. X    }
  1875. X    *s = '\0';
  1876. X}
  1877. X
  1878. X/* VARARGS1 */
  1879. Xfatal(fmt,a1,a2,a3,a4,a5,a6,a7,a8,a9)
  1880. X    char    * fmt;
  1881. X    long    a1,a2,a3,a4,a5,a6,a7,a8,a9;
  1882. X{
  1883. X    fprintf(stderr,"%s: ", progname);
  1884. X    fprintf(stderr, fmt, a1,a2,a3,a4,a5,a6,a7,a8,a9);
  1885. X    exit(1);
  1886. X}
  1887. Xl_index()
  1888. X{
  1889. X    int    letter = 0,
  1890. X        i;
  1891. X    char    which = 'A';
  1892. X    long    lastposition;
  1893. X    long    ftell();
  1894. X
  1895. X    get_keys(lfp,0);
  1896. X    lastposition = letterseek[0] = ftell(lfp);
  1897. X    if(debug && debug < 10)
  1898. X        fprintf(stderr,"offset for %c = %ld\n",
  1899. X            which, lastposition);
  1900. X
  1901. X    while (get_listing(lfp))
  1902. X    {
  1903. X        if(full[0] == 0)
  1904. X        {
  1905. X            char * have = 0;
  1906. X            for(i=0; i<nkeys; i++)
  1907. X                if(np[keys[i]-'A'])
  1908. X                {
  1909. X                    have = &abbrev[np[keys[i]-'A']-1][0];
  1910. X                    break;
  1911. X                }
  1912. X            if(!have)
  1913. X            {
  1914. X                if(nvariant)
  1915. X                    have = &variant[0][0];
  1916. X                else if(ngrep)
  1917. X                    have = &grep[0][0];
  1918. X                fatal
  1919. X                (
  1920. X                    "no full title: %s at line %d\n",
  1921. X                    have,
  1922. X                    line_num
  1923. X                );
  1924. X                exit(1);
  1925. X            }
  1926. X        }
  1927. X        for(i=0; i<nkeys; i++)
  1928. X            if(!np[keys[i] - 'A'])
  1929. X            {
  1930. X                fatal
  1931. X                (
  1932. X                    "no %c abbreviation: %s at line %d\n",
  1933. X                    keys[i],
  1934. X                    full,
  1935. X                    line_num
  1936. X                );
  1937. X                exit(1);
  1938. X            }
  1939. X        if(debug > 1 && debug < 10)
  1940. X        {
  1941. X            fprintf (stderr, "got:\n");
  1942. X            for(i=0; i<nkeys; i++)
  1943. X                fprintf(stderr,"\t%c<%s>\n",keys[i],
  1944. X                    &abbrev[np[keys[i]-'A']-1][0]);
  1945. X
  1946. X        }
  1947. X        if(out_of_order)
  1948. X        {
  1949. X            if(debug>1 && debug < 10)
  1950. X                fprintf(stderr,"out_of_order entry: %s\n",full);
  1951. X        }
  1952. X        else if(full[0] < (char) which)
  1953. X        {
  1954. X            if(full[0] < 'A')
  1955. X                fprintf
  1956. X                (
  1957. X                    stderr,
  1958. X                    "%s %c (\\0%o)\n",
  1959. X                    "illegal start to journal title:",
  1960. X                    full[0],
  1961. X                    full[0]
  1962. X                );
  1963. X            if(debug && debug < 10)
  1964. X            fprintf
  1965. X            (
  1966. X                stderr,
  1967. X                "expecting entry to start with %c not %c\n",
  1968. X                which,
  1969. X                full[0]
  1970. X            );
  1971. X            fatal("out of order: %s\n",full);
  1972. X            exit(1);
  1973. X        }
  1974. X        else while(full[0] >= (char) which + 1)
  1975. X        {
  1976. X            letterseek[++letter] = lastposition;
  1977. X            which++;
  1978. X            if(debug && debug < 10)
  1979. X                fprintf(stderr,"offset for %c = %ld\n",
  1980. X                    which, position);
  1981. X        }
  1982. X        lastposition = position;
  1983. X    }
  1984. X}
  1985. Xreadindex()
  1986. X{
  1987. X    register int i = 0;
  1988. X
  1989. X    if(fgets(keys, sizeof keys, indfp) == NULL)
  1990. X    {
  1991. X        fatal("cannot read Keys line\n");
  1992. X        exit(1);
  1993. X    }
  1994. X    if(debug)
  1995. X        fprintf(stderr,"Keys: %s\n",keys);
  1996. X    for(i=0; i<strlen(keys); i++)
  1997. X    {
  1998. X        if(keys[i] == '\n')
  1999. X        {
  2000. X            keys[i] = '\0';
  2001. X            break;
  2002. X        }
  2003. X        if(keys[i] < 'A' || keys [i] > 'Z')
  2004. X        {
  2005. X            fatal("illegal key in index: %c\n", keys[i]);
  2006. X            exit(1);
  2007. X        }
  2008. X    }
  2009. X    nkeys = strlen(keys);
  2010. X
  2011. X    for(i = 0; i<26; i++)
  2012. X    {
  2013. X        if(fscanf(indfp,"%ld\n",&letterseek[i]) != 1)
  2014. X        {
  2015. X            fatal("index file format error\n");
  2016. X            exit(1);
  2017. X        }
  2018. X        if(debug>1 && debug < 10)
  2019. X            fprintf(stderr,"read %ld for %d (%c)\n",
  2020. X                letterseek[i],i,(char) 'A' + i);
  2021. X    }
  2022. X}
  2023. Xlistopen(name)
  2024. X    char *name;
  2025. X{
  2026. X    static char    pathname[MAXPATHLEN];
  2027. X
  2028. X    if((lfp = fopen(name,"r")) == NULL)
  2029. X    {
  2030. X        (void) strcpy(pathname,LISTDIR);
  2031. X        if((lfp = fopen(strcat(pathname,name),"r")) == NULL)
  2032. X        {
  2033. X            fatal("cannot open: %s\n",name);
  2034. X            exit(1);
  2035. X        }
  2036. X        name = pathname;
  2037. X    }
  2038. X}
  2039. SHAR_EOF
  2040. chmod 0640 jsubs.c || echo "restore of jsubs.c fails"
  2041. set `wc -c jsubs.c`;Sum=$1
  2042. if test "$Sum" != "7825"
  2043. then echo original size 7825, current size $Sum;fi
  2044. echo "x - extracting jlook.h (Text)"
  2045. sed 's/^X//' << 'SHAR_EOF' > jlook.h &&
  2046. X/* jlook.h
  2047. X *
  2048. X *    Copyright D.F. Davey, University of Sydney
  2049. X *
  2050. X *    Permission is granted for the distribution of this software
  2051. X *    for non-profit purposes and provided this notice remains intact
  2052. X *
  2053. X *    daved@physiol.su.oz.au
  2054. X */
  2055. X
  2056. X#ifndef lint
  2057. Xstatic char header_id[] =
  2058. X"$Header: /src/local/cmd/jlook/jlook.h,v 1.1 90/02/03 17:33:00 daved Rel $";
  2059. X#endif /* lint */
  2060. X
  2061. X#ifdef    RINDEX
  2062. X#    define    strrchr rindex
  2063. X#    include <strings.h>
  2064. X#else    RINDEX
  2065. X#    include <string.h>
  2066. X#endif    RINDEX
  2067. X
  2068. X
  2069. X#define LISTFILE    "/usr/lib/refer/jlist"
  2070. X#define LISTDIR        "/usr/lib/refer/"    /* addition place to look */
  2071. X#define EXCEPTION    'E'
  2072. X#define UNDEFINED    'U'    /* cases where title sans city is eqivocal */
  2073. X#define GREP        '*'
  2074. X#define CHEMTAG        'C'
  2075. X#define INDMEDTAG    'I'
  2076. X#define WORLDTAG    'W'
  2077. X#define FULLTAG        'F'
  2078. X#define ACCEPT        'V'
  2079. X#define    SORT        'S'
  2080. X#define    JMAX        160
  2081. X#define RE_MAX        512    /* jsubs tests this is not exceeded */
  2082. X#define NVARIANT    20    /* hope we don't need more */
  2083. X#define NABBR        5    /* should only ever get 3 */
  2084. X#define NGREP        5    /* probably really only need one */
  2085. X#define KEYS        "Keys:"
  2086. X
  2087. Xint    debug,
  2088. X    equivocal,        /* set for case UNDEFINED */
  2089. X    out_of_order;        /* set for case EXCEPTION */
  2090. XFILE    *fopen(),
  2091. X    *lfp,
  2092. X    *indfp;            /* index file */
  2093. Xchar    *progname,
  2094. X    indfile[128];        /* index file (listfile.index) */
  2095. X
  2096. X    /* global storage for items read from the Jlist file */
  2097. Xchar    full[JMAX],
  2098. X    grep[NGREP][JMAX],
  2099. X    abbrev[NABBR][JMAX],
  2100. X    keys[NABBR],
  2101. X    variant[NVARIANT][JMAX],
  2102. X    useab;            /* selected output abbreviation key */
  2103. Xint    np[26];         /* index to abbrev for key letter */
  2104. Xint    nkeys;
  2105. Xint    nabbrev;
  2106. Xint    ngrep;
  2107. Xint    nvariant;
  2108. Xint    indexing;    /* flag set if jindex is running */
  2109. Xlong    line_num;    /* for debugging */
  2110. Xchar    * output;
  2111. X
  2112. X    /* global storage for index */
  2113. Xlong    letterseek[26];
  2114. Xlong    position;    /* where we are in jlist after reading an item */
  2115. SHAR_EOF
  2116. chmod 0440 jlook.h || echo "restore of jlook.h fails"
  2117. set `wc -c jlook.h`;Sum=$1
  2118. if test "$Sum" != "1795"
  2119. then echo original size 1795, current size $Sum;fi
  2120. echo "x - extracting Makefile (Text)"
  2121. sed 's/^X//' << 'SHAR_EOF' > Makefile &&
  2122. X# jlook Makefile
  2123. X#
  2124. X# $Header: /src/local/cmd/jlook/Makefile,v 1.1 90/02/04 14:34:10 daved Rel $
  2125. X
  2126. XBINDIR=/usr/local
  2127. XLIBDIR=/usr/lib/refer
  2128. X
  2129. X# CFLAGS
  2130. X# ======
  2131. X# if regcomp and regexp are available (such as on 4.3Tahoe), use
  2132. X# CFLAGS=-DREGEXP
  2133. X# for 4.3BSD or any system with re_comp and re_exec rather than recmp and regex
  2134. X# CFLAGS=-DRE_EXEC
  2135. X# 
  2136. X# for 4.2BSD and earlier BSD systems that use rindex() rather than strrchr()
  2137. X#     include -DRINDEX
  2138. X# 
  2139. X# for Version 7 systems having params.h in /usr/include and not in
  2140. X#    /usr/include/sys, include -DVERSION_7
  2141. X
  2142. X# to support earlier versions with hard-wired support for Chem. Abstracts,
  2143. X#     Index Medicus and World List switches (-c, -i, -w) instead of
  2144. X#    -u switch include -DCOMPAT
  2145. X
  2146. XCFLAGS=-DREGEXP -O
  2147. X
  2148. Xall: jlook jindex
  2149. X
  2150. Xinstall: $(BINDIR)/jlook $(LIBDIR)/jindex
  2151. X
  2152. Xlibrary: $(LIBDIR)/jindex $(LIBDIR)/jlist
  2153. X
  2154. Xcheck: jlook tst_input tst_full_good tst_chem_good
  2155. X    ./jlook -E -l ./jlist -f tst_input> tst_output
  2156. X    cmp tst_output tst_full_good
  2157. X    ./jlook -E -l ./jlist -f -uC tst_input> tst_output
  2158. X    cmp tst_chem_good tst_output
  2159. X    ./jlook -E -l ./tst_alt -f -uX tst_input > tst_output
  2160. X    cmp tst_chem_good tst_output
  2161. X    rm -f tst_output
  2162. X
  2163. X$(BINDIR)/jlook: jlook
  2164. X    cp jlook $(BINDIR)
  2165. X    chmod 711 $(BINDIR)/jlook
  2166. X
  2167. X$(LIBDIR)/jindex: jindex
  2168. X    cp jindex $(LIBDIR)
  2169. X    chmod 711 $(LIBDIR)/jindex
  2170. X
  2171. X$(LIBDIR)/jlist: jlist
  2172. X    cp jlist $(LIBDIR)
  2173. X    chmod 444 $(LIBDIR)/jlist
  2174. X    $(LIBDIR)/jindex
  2175. X    chmod 444 $(LIBDIR)/jlist.index
  2176. X
  2177. Xjindex: jindex.o jsubs.o
  2178. X    $(CC) -o jindex jindex.o jsubs.o
  2179. X
  2180. Xjlook: jlook.o jsubs.o
  2181. X    $(CC) -o jlook jlook.o jsubs.o
  2182. X
  2183. Xjsubs.o: jsubs.c jlook.h
  2184. X    $(CC) $(CFLAGS) -c jsubs.c
  2185. X
  2186. Xjlook.o: jlook.c jlook.h
  2187. X    $(CC) $(CFLAGS) -c jlook.c
  2188. X
  2189. Xjlook.lint: jlook.c jlook.h jsubs.c
  2190. X    lint $(CFLAGS) jlook.c jsubs.c > jlook.lint
  2191. X
  2192. Xjindex.lint: jindex.c jlook.h jsubs.c
  2193. X    lint $(CFLAGS) jindex.c jsubs.c > jindex.lint
  2194. X
  2195. Xclean:
  2196. X    rm -f a.out *.o *.lint ERRORS MADE INSTALL *.index
  2197. X
  2198. Xclobber: clean
  2199. X    rm -f jlook jindex
  2200. X
  2201. SHAR_EOF
  2202. chmod 0400 Makefile || echo "restore of Makefile fails"
  2203. set `wc -c Makefile`;Sum=$1
  2204. if test "$Sum" != "1915"
  2205. then echo original size 1915, current size $Sum;fi
  2206. echo "x - extracting tst_alt (Text)"
  2207. sed 's/^X//' << 'SHAR_EOF' > tst_alt &&
  2208. X# This file tests the use of abbreviation keys other that XYZ
  2209. XKeys: XYZ
  2210. XE Nippon Acta Something
  2211. XXYZ Nippon Acta
  2212. XV Acta Something
  2213. X
  2214. XF American Journal of Physiology
  2215. XXYZ Amer. J. Physiol.
  2216. XV AJP
  2217. XV Amer J Physiol
  2218. X* Ajp
  2219. X* AJp
  2220. X
  2221. XF    Journal of Anatomy
  2222. XXYZ    J. Anat.
  2223. X
  2224. XF Journal of Physiology
  2225. XX J. Physiol. (London)
  2226. XY J. Physiol. (Lond.)
  2227. XZ J. Physiol.
  2228. XV J Physiol
  2229. X
  2230. XF Medical Research Reviews
  2231. XXYZ Med. Res. Rev.
  2232. X
  2233. XUXYZ Medicina (WHICH ONE?)
  2234. XV Medicina
  2235. X
  2236. XUXYZ Medicina (Buenos Aires)
  2237. XV Medicina
  2238. X
  2239. XF    Pflu\*:gers Archiv European Journal of Physiology
  2240. XXYZ    Pflu\*:gers Arch.
  2241. XV    Pflugers Archiv
  2242. XV    Pflugers Arch.
  2243. XV    Pflugers Archiv European Journal of Physiology
  2244. X
  2245. XF Physiological Reviews
  2246. XXYZ Physiol. Rev.
  2247. X
  2248. X# out of order entry
  2249. XE Journal of Physiology
  2250. XX J. Physiol. (London)
  2251. XY J. Physiol. (Lond.)
  2252. XZ J. Physiol.
  2253. XV Physiol. J.
  2254. X
  2255. XFXYZ Tekniques
  2256. XV Tekniques
  2257. X
  2258. XF Zoologiska Bidrag fran Uppsala
  2259. XX Zool. Bidr. Uppsala
  2260. XY Zool. Bidr. Ups.
  2261. XZ Zool. Bidrag Uppsala
  2262. XV Zoologiska Bidrag fran Uppsala
  2263. X
  2264. XF    Zentralblatt fu\*:r Veterina\*:rmedizin Reihe A
  2265. XX    Zentralbl. Veterina\*:rmed. Reihe A
  2266. XY    Zentralbl. Veterina\*:rmed. [A]
  2267. XZ    Zbl. Vet.-Med. Rheihe A
  2268. XV    Zentralblatt fur Veterinarmedizin Rheihe A
  2269. XV    Zentralblatt fur Veterinar Medizin Rheihe A
  2270. XV    Zentralblatt fur Veterinarmedizin Reihe A
  2271. XV    Zentralblatt fur Veterinar Medizin Reihe A
  2272. XV    Zentralblatt fur Vet Med A
  2273. X*    Z[entralb f\\"ur.]*Vet[erina. ]*[Mm]*ed[izin. Rhe]* A\.*$
  2274. X
  2275. XF    Zentralblatt fu\*:r Veterina\*:rmedizin Reihe C
  2276. XX    Zentralbl. Veterina\*:rmed. Reihe C
  2277. XY    Zentralbl. Veterina\*:rmed. [C]
  2278. XZ    Zbl. Vet.-Med. Rheihe C
  2279. XV    Zentralblatt fur Veterinarmedizin Rheihe C
  2280. XV    Zentralblatt fur Veterinar Medizin Rheihe C
  2281. XV    Zentralblatt fur Veterinarmedizin Reihe C
  2282. XV    Zentralblatt fur Veterinar Medizin Reihe C
  2283. XV    Zentralblatt fur Vet Med C
  2284. X*    Z[entralb f\\"ur.]*Vet[erina. ]*[Mm]*ed[izin. Rhe]* C\.*$
  2285. X
  2286. SHAR_EOF
  2287. chmod 0440 tst_alt || echo "restore of tst_alt fails"
  2288. set `wc -c tst_alt`;Sum=$1
  2289. if test "$Sum" != "1795"
  2290. then echo original size 1795, current size $Sum;fi
  2291. echo "x - extracting tst_chem_good (Text)"
  2292. sed 's/^X//' << 'SHAR_EOF' > tst_chem_good &&
  2293. X# some shoddy input
  2294. X%J J. Physiol. (London)
  2295. X%J J. Anat.
  2296. X%J Pflu\*:gers Arch.
  2297. X%J Zentralbl. Veterina\*:rmed. Reihe A
  2298. SHAR_EOF
  2299. chmod 0440 tst_chem_good || echo "restore of tst_chem_good fails"
  2300. set `wc -c tst_chem_good`;Sum=$1
  2301. if test "$Sum" != "116"
  2302. then echo original size 116, current size $Sum;fi
  2303. echo "x - extracting tst_full_good (Text)"
  2304. sed 's/^X//' << 'SHAR_EOF' > tst_full_good &&
  2305. X# some shoddy input
  2306. X%J Journal of Physiology
  2307. X%J Journal of Anatomy
  2308. X%J Pflu\*:gers Archiv European Journal of Physiology
  2309. X%J Zentralblatt fu\*:r Veterina\*:rmedizin Reihe A
  2310. SHAR_EOF
  2311. chmod 0440 tst_full_good || echo "restore of tst_full_good fails"
  2312. set `wc -c tst_full_good`;Sum=$1
  2313. if test "$Sum" != "171"
  2314. then echo original size 171, current size $Sum;fi
  2315. echo "x - extracting tst_input (Text)"
  2316. sed 's/^X//' << 'SHAR_EOF' > tst_input &&
  2317. X# some shoddy input
  2318. X%J J.Physio.
  2319. X%J J. Anatom.
  2320. X%J Pflugers Arch. Eu. J. Phys.
  2321. X%J Zbl. Vet. Med. A
  2322. SHAR_EOF
  2323. chmod 0440 tst_input || echo "restore of tst_input fails"
  2324. set `wc -c tst_input`;Sum=$1
  2325. if test "$Sum" != "98"
  2326. then echo original size 98, current size $Sum;fi
  2327. echo "x - extracting jlist (Text)"
  2328. sed 's/^X//' << 'SHAR_EOF' > jlist &&
  2329. X# jlook library file
  2330. X# $Header: /src/local/cmd/jlook/jlist,v 1.18 90/11/07 11:11:44 daved Exp $
  2331. X#
  2332. X# $Log:    jlist,v $
  2333. X# Revision 1.18  90/11/07  11:11:44  daved
  2334. X# various Scimate variants
  2335. X# 
  2336. X# Revision 1.17  90/08/10  18:37:09  daved
  2337. X# Several new journals, minor corrections, new variants
  2338. X# 
  2339. X# Revision 1.16  90/07/27  08:54:55  daved
  2340. X# new journals:  Edinburgh Med. J.;  J. Psychol. Neurol.; Zentralb. Neuroch.
  2341. X# 
  2342. X# Revision 1.15  90/07/23  18:23:02  daved
  2343. X# Added Diabetes Research
  2344. X# 
  2345. X# Revision 1.14  90/06/09  07:48:11  daved
  2346. X# serveral new surgical journals
  2347. X# 
  2348. X# Revision 1.13  90/06/06  17:10:02  daved
  2349. X# Added more current contents variants
  2350. X# 
  2351. X# Revision 1.12  90/06/06  16:26:36  daved
  2352. X# numerous additions
  2353. X# 
  2354. X# Revision 1.10  90/04/06  22:13:40  daved
  2355. X# About 10 new journals added
  2356. X# 
  2357. X# Revision 1.9  90/04/06  21:52:09  daved
  2358. X# Numerous variants for Current Contents
  2359. X# 
  2360. X# Revision 1.8  90/03/21  17:59:09  daved
  2361. X# New Journal of Biomechanical Engineering variant
  2362. X# 
  2363. X# Revision 1.7  90/03/17  17:34:51  daved
  2364. X# New variants for "Fol. Pharm. Jap." and "IMA Journal..."
  2365. X# 
  2366. X# Revision 1.6  90/03/14  15:31:32  daved
  2367. X# Added "Scientist"; removed all "Et" variants after fixing jlook
  2368. X# 
  2369. X# Revision 1.5  90/02/27  12:27:54  daved
  2370. X# New "Applied Radiation and Isotopes Variant"
  2371. X# 
  2372. X# Revision 1.4  90/02/15  12:33:43  daved
  2373. X# More Et variants; Cancer Cells variant
  2374. X# 
  2375. X# Revision 1.3  90/02/08  18:45:08  daved
  2376. X# Added some misspelled "Ophthalmology"s
  2377. X# 
  2378. X# Revision 1.2  90/02/07  12:08:34  daved
  2379. X# CC variant 'Et' for Acta Histochem Cytochem
  2380. X# 
  2381. X#
  2382. X#    File format
  2383. X#    ===========
  2384. X#    The nature of each line is determined by its leading letter(s):
  2385. X#    # any comment
  2386. X#    F the Full title for output purposes
  2387. X#    E Exceptional full title when out of alphabetic order
  2388. X#    U Undefined because of lack of city
  2389. X#    V any Variant of title desired for an exact match
  2390. X#    * a regular expression which may be a match for odd forms of input
  2391. X#    S a sort string if different to F (treated as comment by jlook)
  2392. X#    any other upper case letter in the Keys: line, e.g.
  2393. X#        C - Chemical Abstracts abbreviation
  2394. X#        I - Index Medicus abbreviation
  2395. X#        W - World List abbreviation
  2396. X#    The first non-comment line must be Keys: XXXX where XXXX is list
  2397. X#        of key letters used to define supported abbreviations
  2398. X#        e.g. CIW in the distributed system.  Key letters may not
  2399. X#        be any of the predefined keys (FEUV).
  2400. X#
  2401. X#    Elements F and defined key letters may be combined if identical,
  2402. X#    thus a journal whose full title, and chem abstracts "abbreviation"
  2403. X#    are identical could have an FC line.
  2404. X#
  2405. X#    Elements F,E and U are mutually exclusive.
  2406. X#    Elements V and * can only be used alone.
  2407. X#
  2408. X#    Note that the key letter(s) are separated from the title text
  2409. X#    by one tab character (and nothing but).  Non-comment lines may
  2410. X#    be continued if the line terminates with a '\'.
  2411. X#
  2412. X# The order of journal entries within the file is important only in first letter
  2413. X# of full title fields (starting F). All such entries within
  2414. X# one letter of alphabet must be together for the index file to work.
  2415. X# Potentially equivocal matches should have the preferential match first in the
  2416. X# file, which should be assured with an appropriate S field if sort on the F
  2417. X# fields will not achieve this. Blank lines can only occur to separate journals.
  2418. X# Titles starting with numbers should be given E entries at the end of the
  2419. X# file - i.e. these are treated as if they started with 'Z'
  2420. X#
  2421. X# *** As soon as this file is written after editing, run jindex to rebuild
  2422. X# the index and check for errors.
  2423. X#
  2424. X# Next line defines the abbreviations supported in this file:
  2425. XKeys: CIW
  2426. X# IW guessed
  2427. XF    ACP, Applied Cardiopulmonary Pathophysiology
  2428. XCIW    ACP, Appl. Cardiopulm. Pathophysiol.
  2429. XV    Acp-Applied Cardiopulmonary Pathophysiology
  2430. X
  2431. X#
  2432. XF    AIChE Journal
  2433. XCIW    AIChE J.
  2434. X
  2435. XFC    AIDS (London)
  2436. XIW    Aids
  2437. X
  2438. X# formerly AIDS Research
  2439. XF    AIDS Research and Human Retroviruses
  2440. XCI    AIDS Res. Hum. Retroviruses
  2441. XW    Aids Res. Hum. Retroviruses
  2442. XV    Aids Research and Human Retroviruses
  2443. X
  2444. XF    AJR American Journal of Roentgenology
  2445. XCI    AJR Am. J. Roentgenol.
  2446. XW    AJR Amer. J. Roentgenol.
  2447. XV    AJR
  2448. X
  2449. X# formed by union of Acta Pathologica, Microbiologica, et Immunologica
  2450. X# Scandinavica, Parts A, B and C
  2451. XF    APMIS. Acta Pathologica, Microbiologica et Immunologica Scandinavica
  2452. XCIW    APMIS
  2453. XV    Apmis
  2454. X
  2455. X# CW guessed
  2456. XF    APMIS. Supplementum
  2457. XCIW    APMIS Suppl.
  2458. XV    Acta Pathologica, Microbiologica, et Immunologica \
  2459. X        Scandinavica. Supplementum
  2460. X
  2461. XF    AT&T Bell Laboratories Technical Journal
  2462. XCIW    AT&T Bell Laboratories Technical J.
  2463. X
  2464. X# formerly ATLA Abstracts, Alternatives to Laboratory Animals
  2465. X# W is guess, based on former title W abbrev, which excluded 2nd segment
  2466. XF    ATLA, Alternatives to Laboratory Animals
  2467. XCI    ATLA, Altern. Lab. Anim.
  2468. XW    ATLA
  2469. XV    Atla-Alternatives to Laboratory Animals
  2470. X
  2471. XF    Abhandlungen der Mathematisch-Physischen Klasse der Sa\*:chsischen\
  2472. X        Akademie der Wissenschaften
  2473. XCI    Abh. Math.-Phys. Kl. Sa\*:chs. Akad. Wiss.
  2474. XW    Abh. Math.-Phys. Kl. Sa\*:chsischen Akad. Wiss.
  2475. XV    Abhandlungen der Mathematisch-Physischen Klasse der Sachsischen\
  2476. X        Akademie der Wissenschaften
  2477. X
  2478. XF    Abhandlungen der Sa\*:chsischen Akademie der Wissenschaften zu\
  2479. X        Leipzig Mathematisch-Naturwissenschaftliche Klasse
  2480. XCI    Abh. Sa\*:chs. Akad. Wiss. Leipzig Math. Naturwiss. Kl.
  2481. XW    Abh. Sa\*:chsischen Akad. Wiss. Leipzig Math. Naturwiss. Kl.
  2482. XV    Abhandlungen der Sachsischen Akademie der Wissenschaften zu\
  2483. X        Leipzig Mathematisch-Naturwissenschaftliche Klasse
  2484. X
  2485. XF    Accounts of Chemical Research
  2486. XCI    Acc. Chem. Res.
  2487. XW    Acc. chem. Res.
  2488. X
  2489. XF    Acta Anaesthesiologica Scandinavica
  2490. XCI    Acta Anaesthesiol. Scand.
  2491. XW    Acta anaesth. scand.
  2492. XV    Acta anaesthesiologica scandinavica
  2493. X
  2494. XF    Acta Anaesthesiologica Scandinavica, Supplementum
  2495. XC    Acta Anaesthesiol. Scand., Suppl.
  2496. XI    Acta Anaesthesiol. Scand. [Suppl.]
  2497. XW    Acta anaesthesiol. scand., suppl.
  2498. XV    Acta Anaesthesiologica Scandinavica. Supplementum
  2499. XV    Acta anaesthesiologica scandinavica, supplementum
  2500. X
  2501. XF    Acta Anatomica
  2502. XC    Acta Anat.
  2503. XI    Acta Anat. (Basel)
  2504. XW    Acta anat. (Basel)
  2505. XV    Acta Anatomica Basel
  2506. XV    Acta anatomica
  2507. X
  2508. X#    out of order entry to allow for anglicised form
  2509. XE    Kaibogaku Zasshi Acta Anatomica Nipponica
  2510. XS    Acta Anatomica Nipponica
  2511. XCI    Acta Anat. Nippon.
  2512. XW    Acta anat. Nipponica
  2513. X
  2514. XF    Acta Biochimica Polonica
  2515. XCI    Acta Biochim. Pol.
  2516. XW    Acta biochim. Polonica
  2517. X
  2518. XF    Acta Biochimica et Biophysica Academiae Scientiarum Hungaricae
  2519. XCI    Acta Biochim. Biophys. Acad. Sci. Hung.
  2520. XW    Acta biochim. biophys. Acad. sci. Hung.
  2521. XV    Acta Biochemica et Biophysica Academiae Scientiarum Hungaricae
  2522. X
  2523. X# formerly Acta Biochim. Biophys. Acad. Sci. Hung.
  2524. X# changed v21/1986
  2525. X# W guessed
  2526. XF    Acta Biochimica et Biophysica Hungarica
  2527. XCIW    Acta Biochim. Biophys. Hung.
  2528. X
  2529. XF    Acta Biologica Academia Scientiarum Hungaricae
  2530. XCI    Acta Biol. Acad. Sci. Hung.
  2531. XW    Acta Biologica Acad. sci. hung.
  2532. SHAR_EOF
  2533. echo "End of part 1"
  2534. echo "File jlist is continued in part 2"
  2535. echo "2" > s2_seq_.tmp
  2536. exit 0
  2537.  
  2538. exit 0 # Just in case...
  2539.