1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067
|
Sun May 10 06:28:55 1998 Nelson H. F. Beebe <beebe@math.utah.edu>
* Version 2.11.4 completed.
* Files changed with this release: ChangeLog Makefile.in README
bibclean.c bibclean.h bibclean.html bibclean.man custom.h fix.c
isbn.c option.c.
* New files with this release: testbib6.bok testbib6.eok
testbib6.org.
* Makefile.in: Add testbib6.org to the BIBTEX-TESTS list to
exercise the bug fix in fix_month() described below.
Change modes of installed files to permit group write access.
Change the mode of the installed .bibcleanrc file to ensure
readability.
Save any old installed version of bibclean as bibclean.old during
"make install".
Create a hard link from the installed bibclean to bibclean-2.11.4,
and similarly, for the installed manual page. That way, if a
later version comes out and is installed, then bibclean-2.11.4
will still remain accessible. [I'm doing this for all of my
software distributions; extensive experience with GNUware, and
even commercial packages like Matlab and Maple, on ten
architectures, has shown the desirability of having multiple
versions available as a check when a suspected bug turns up.]
The "make uninstall" command will remove the
version-number-specific installed files, if you wish to back out
of an install.
Change symbolic links to hard links; they are all used in a
context where this has no side effects.
Change CP to mean "rcp -p", so as to preserve file time stamps on
installation.
* README: Update my mailing addresses.
* bibclean.c: Update my mailing addresses in the file header.
* bibclean.h: Automatically generated from the formatted output of
bibclean.man to include that file's changes.
* bibclean.hhtml: Automatically generated from bibclean.man to
include that file's changes.
* bibclean.man: Update my mailing addresses in the file header and
the AUTHOR section. Document the new exit behavior for -author
and -version. Documen the new GNU/POSIX --option support, and add
a paragraph on the handling of filenames that would be confused
with option names. Add cross references to bibcheck(1),
bibdup(1), bibjoin(1), biblabel(), and biborder(1).
* custom.h: Change type of sleep() on NeXT from int to unsigned
int.
* fix.c: Fix a rarely-encountered, but long-standing, bug in
fix_month(). Prior to this version, a value
mar # "\slash" # apr
would be incorrectly transformed
month = mar # "\slash" # " # apr # "
because in_quoted_string was incorrect for the remaineder of
the value.
If the input value was changed to
mar # "\slash " # apr
then that space inside the quoted string preserved the correctness
of in_quoted_string, and the output was correct.
* isbn.c: Add several countries to the list of recognized ISBN
prefixes. Similar updates have been added to the Emacs Lisp file,
isbn.el, available in a separate software distribution. Update my
mailing addresses in the file header.
* option.c: : Update my mailing addresses on opt_author(). Add
support for GNU/POSIX-style --options. Update bibclean version
number. Make -author and -version handling exit with a success
code after their output on stderr.
Sat May 4 07:52:26 1996 Nelson H. F. Beebe <beebe@math.utah.edu>
* Version 2.11.3 (final edits before public release)
* Build and test bibclean under 8 IBM PC DOS C and C++
compilers, and under VAX VMS 6.1. bibclean already builds and
tests successfully under about 40 C and C++ compilers on 10
different UNIX architectures.
* Update README, ibmpc/dos/README and vms/vax/README files.
* In bibclean.c, move sanity checks on HAVE_xxx pattern matching
flags to custom.h.
* In bibclean.man, update version release date to match that set
in option.c.
* In chek.c, update computation of stdlog_on_stdout to be
stricter. Fix off-by-one error in loop termination condition in
u72copy_element(). Add code in copy_element() to skip trailing
space and hyphens, to avoid generating bogus warnings about
checksum mismatches.
* In configure.in, remove -g from CFLAGS if we are compiling
with lcc because it produces bad debug symbol tables on Sun
Solaris 2.x.
* In do.c, remove unused LAST_SCREEN_LINE macro. Change open of
bibliography files to use binary mode in OS_PCDOS.
* In fix.c, change types of n and nupper in fix_title() from int
to size_t to avoid type conflict warnings from some compilers.
* In fndfil.c, remove unused NEWLINE() macro. Update remainder
of code to match fndfil.c in DVI 3.0 development tree.
* In isbn.c, add workaround for bug in Watcom 10.0 C++ compilers
in ISBN_hyphenate(). Fix serious bug in squeeze_ISBN() that had
gone undetected for a very long time: the loop exit condition
referred to in_ISBN instead of *in_ISBN.
* In keybrd.c, add #include <starlet.h> to get some needed
library function headers. Remove some old unused macros.
Update get_screen_lines() for VAX VMS 6.x.
* In Makefile.in, remove some obsolete files and targets, update
the DIST-FILES list, and add missing testbib5.org file to
BIBTEX-TESTS list. Remove DIST-FILES-BIN list, since the share
bundle option is no longer provided, and DIST-FILES now has all
files listed. Add match, romtol, and subdist targets. Add
dependency on subdist of distribution file targets. Add
test-match and test-romtol targets.
* In match.c, add month_patterns[], pages_patterns[], and
volume_patterns[]. Update messages to include input line
number. Modify process() to accept ``key = "value",'' lines
that can be easily extracted from bibliography file collections.
A test suite has been prepared in match.dat, and the test-match
and match targets added to Makefile.in to support this testing.
* In option.c, update release date in BIBCLEAN_VERSION.
* In vaxvms.c, include <lib$routines.h> and <starlet.h> for more
function prototypes. Update for VAX VMS 6.x. Add conditionals
around memxxx() functions, so as to avoid linker warnings about
duplicate symbols, and add missing return values in the memxxx()
functions. Change LIB$SPAWN to lib$spawn.
* In vmswild.c, remove unused LINSIZ macro.
Sun Apr 28 08:54:38 1996 Nelson H. F. Beebe <beebe@math.utah.edu>
* Version 2.11.3 (continued):
* Makefile.in (test-bibtex): Add test-bibtex-7 with test files
testcodn.{org,bok,eok}, to test CODEN handling.
Thu Apr 25 11:24:18 1996 Nelson H. F. Beebe <beebe@math.utah.edu>
* Version 2.11.3:
* In bibclean.c, remove declarations of unused functions that
were moved to new file chek.c in 2.11.0. Change one test (n <=
0) to (n == 0) to avoid compiler warnings about test of unsigned
values for being negative.
* Add CODEN validation support to chek.c, and completely rewrite
the ISBN and ISSN handling. The reason for the latter is that
by defining a simple list grammar for CODEN, ISBN, and ISSN
string values, the code becomes cleaner and more rigorous, and
parts of it can be shared for the checking of all three types.
Future versions of bibclean may add support for additional
key/value pairs for which the string values can also be
validated, and such support will then be very simple to supply.
New functions added: check_CODEN(), bad_CODEN(), copy_element(),
incomplete_CODEN(), is_CODEN_char(), is_ISBN_char(),
is_ISSN_char(), parse_list(), parse_element(),
parse_separator(), validate_CODEN(), validate_ISBN(),
validate_ISSN(). New typedef added: parse_data.
These improvements necessitated a change in testisxn.eok, since
the recognition of ISBN values (and also CODEN and ISSN values)
is now quite strict, so some of the erroneous ISBNs in
testisxn.org are now handled slightly differently. The same
number of error messages are issued in both 2.11.2 and 2.11.3
however.
* Add mention of the CODEN validations to bibclean.man.
* Add CODEN entry in out_value() checks[] array in do.c.
Mon Mar 4 16:23:20 1996 Nelson H. F. Beebe <beebe@math.utah.edu>
* Version 2.11.2: This version adds six new command-line
options: -[no]-align-equals, -[no]-keep-preamble-spaces,
and -[no]-keep-string-spaces.
The first pair of these was suggested by Matthew Morley
<Matthew.Morley@gmd.de> who contributed an implementation for a
much older version of bibclean (2.05); the idea has been used, but
not the contributed code.
The second and third pairs supply a need that has developed as
the TUG and BibNet bibliography collections have grown: namely,
sometimes bibliographies have rather long, and carefully spaced,
@Preamble{} and @String{} entries, and these new options allow
the internal spacing in those entries to be preserved.
* bibclean.c: Add the six new options to the file header comments.
Add function out_verbatim() to handle output without space
fiddling. Add new macros KEEP_PREAMBLE_SPACES() and
KEEP_STRING_SPACES(), and use them in get_next_non_blank() and
out_string().
* bibclean.man: Document the new -[no]-align-equals,
-[no]-keep-preamble-spaces, and -[no]-keep-string-spaces options.
* do.c: Add new macros KEEP_PREAMBLE_SPACES() and
KEEP_STRING_SPACES(), and use them in several places. Add new
global variables keep_preamble_spaces and keep_string_spaces.
Make in_preamble instead of static, since it is now needed in
bibclean.c too. Add new functions do_preamble_2() and
do_string_2() to hold old bodies of do_preamble() and do_string(),
to simplify setting of in_preamble and in_string flags. Add
support in out_equals() for -align-equals option. The code for
-keep-preamble-spaces and -keep-string-spaces turned out to be
quite hard to get right, largely because of the design flaw (for
which I alone hold responsibility) that input space is discarded
at a rather low level, rather than being collected as a legitimate
token that is carried up to the highest levels, and then
discarded, or otherwise modified.
* fix.c: Add additional checks in fix_pages() to avoid inserting
en-dashes where they don't belong.
* keybrd.c: Add MIN() macro. Add new functions beep() and
erase_characters() to shorten coding. Move search code out of
do_more() into separate function do_search(). Add support for
word-erase, line-erase, and line-reprint in do_search(). When a
search string is reused, print it again. Beep if too many
characters are entered in a search string. Add support for
forward-paragraph and backward-paragraph commands. Correct
binding of M-> to be KEYBOARD_END instead of KEYBOARD_HOME. Add
support for X Window System arrow keys, and PgUP and PgDn keys.
* option.c: Add new functions opt_align_equals(),
opt_keep_preamble_spaces(), and opt_keep_string_spaces(), plus
corresponding entries in the options[] array, and document them
in the opt_help() help_lines[] and usage() usage_lines[] arrays.
Sat Oct 7 08:59:48 1995 Nelson H. F. Beebe <beebe@math.utah.edu>
* Version 2.11: The major change for this new version is the
conversion of the source code to use the GNU autoconf system so
that on UNIX systems, the configure script can automatically
prepare a header file, config.h, that deals with the variations
in UNIX and compiler implementations. This entailed:
(a) the creation of 3 new files: Makefile.in,
config.hin, and configure.in;
(b) elimination of 12 header files: machdefs.h os.h
osatari.h ospcdos.h osprimos.h osrmx.h ostops20.h
osunix.h osvaxvms.h osvmcms.h unixlib.h xstddef.h;
(c) adjustments of #include statements, protecting most
with #if HAVE_xxx ... #endif;
(d) change of the NEW_STYLE and STDC macros to
HAVE_STDC;
(e) replacement of free() calls by macro FREE(), so as
to be able to hide some typecasting to deal with
defective C/C++ implementations.
* bibclean.c: The code in this file became too large for IBM PC
DOS compilers, so it has been split into 10 new header files:
ch.h config.h custom.h delete.h keybrd.h pattern.h
token.h toklst.h xunistd.h yesorno.h
and 5 additional source code files:
chek.c do.c fix.c keybrd.c option.c.
[The name is chek.c, rather than check.c, to avoid a conflict
with the GNU standard Makefile target, check.] The 683-line
revision history has been moved from bibclean.c into this new
ChangeLog file (see below), following GNU Project conventions;
I've not bothered to revise the recording style to match that
supported by the GNU Emacs add-change-log-entry-other-window
command.
This file splitting reduced bibclean.c from 8K lines to 2K
lines, and the file do.c, at 2.9K lines, is now the largest
source code file. Here is a current source code line count:
% wc -l *.c | sort +0nr -1
11626 total
2885 do.c
2094 bibclean.c
1051 vmswild.c
880 vaxvms.c
790 isbn.c
774 chek.c
606 keybrd.c
572 fix.c
569 fndfil.c
551 option.c
395 match.c
240 strtol.c
174 romtol.c
45 strist.c
% wc -l *.h | sort +0nr -1
835 total
260 bibclean.h
178 config.h
81 custom.h
51 toklst.h
47 keybrd.h
37 ch.h
26 xctype.h
18 xstring.h
17 xstdlib.h
16 xstat.h
15 token.h
12 xtypes.h
12 xunistd.h
11 pattern.h
10 delete.h
10 match.h
9 xerrno.h
9 xlimits.h
9 xpwd.h
7 yesorno.h
Despite the increased number of source files between versions
2.10 and 2.11, the total source code has been reduced from 16.6K
lines to 12.5K lines, largely due to the use of GNU configure.
Of course, one must factor in about 1K new lines in Makefile.in,
config.hin, and configure.in, and 1.6K lines in the
automatically-generated configure script.
In summary, although this was my first use of autoconf, and the
development effort stretched over 3 otherwise very busy weeks, I
believe the payoff for other programs will be significant,
because their config.in and configure.in files will be very
similar to those for bibclean, so the conversion effort will be
much smaller.
Once config.h files are manually generated generated for other
operating systems, they too will be largely reusable for most of
my other programs in C/C++.
* do.c: In get_line(), change
if (*(p-1) == '\\')
to
if ((p > &line[0]) && (*(p-1) == '\\'))
in order to avoid possible out-of-bounds pointer reference.
* fix.c: In fix_pages(), add code
* match.c: In next_s(), change
for (++s; ; )
to
for (++s; *s; )
to eliminate compiler warnings about the final return() being
unreachable. The additional test of *s against '\0' is of
no significance for execution time.
* Makefile.in: remove vaxvms.c and vmswild.c, since they will be
handled now by a separate Makefile for VAX VMS and OpenVMS.
* README: Completely rewrite, with new installation instructions
for UNIX using the configure script, and new subsections
containing status reports of installation attempts on all major
UNIX variants.
Revision history (reverse time order):
[08-Mar-1995] 2.10.1
In get_braced_string(), handle overlooked case of \"{x}.
[04-Jun-1994]--[18-Oct-1994] 2.10
Add support for simple forward and backward searches
in help display in do_more().
Add World-Wide Web URI, URL, and URN names to the list
of field names that are forced to uppercase. Disable
code in out_s() that breaks lines at punctuation
characters, because this can introduce unwanted line
breaks in file names and WWW names.
Add code in out_c() to preserve last line in output
buffer, so that a subsequent DELETE_LINE operation
will have a complete line to delete. Previously, with
-delete-empty, if the output buffer filled up in the
middle of a line that was going to be deleted, the
initial part of the line would be (incorrectly)
output. This was a hard bug to track down, because it
happened very rarely. Extend out_flush() to force out
all buffered output.
Change bad_ISBN() to not put incorrect hyphens back
into ISBNs. ISBN hyphen positions vary, because large
publishers get short prefixes, and small publishers
get long prefixes. The ISBN is a 10-character value
of the form
countrygroupnumber-publishernumber-booknumber-checkdigit
where the first three fields are of variable width and
contain only the digits [0-9], and the last
single-character checkdigit field contains [0-9X].
Larger country groups or publishers have smaller
numbers, and correspondingly larger booknumbers.
Thus, the TeXbook ISBN, 0-201-13447-0, consists of 0
for English-language countries, 201 for
Addison-Wesley, 13447 for the book number, and 0 for
the check digit. Although it is permissible to use
spaces instead of hyphends, we prefer the latter in
order to have unbreakable text for improved
readability and editing convenience.
Add code in fix_title() to supply braces around
brace-level-zero TeX control words containing
upper-case letters, to obtain conversions like these:
"\TeX{} for the Impatient" -> "{\TeX} for the Impatient"
"\TeX\ for the Impatient" -> "{\TeX} for the Impatient"
in order to protect the control words from downcasing
in some BibTeX styles.
Change DELETE_CHAR and DELETE_LINE values to be
outside the range of possible signed or unsigned
character values, so as not to interfere with handling
of 8-bit character data.
Add new functions bcolumn(), bdelc(), bdelline(),
bflush(), blastc(), bpeekc(), and bputc() to localize
access to the output buffer, buf[], and the variables
that record line number, column number, and output
byte position. Completely rewrite out_c() to use
these new functions, substantially simplifying the
code.
Add original_file initialized to the_file in error()
and warning(), and used in out_status(), to more
accurately reflect output file positions. Previously,
the error messages themselves resulted in modification
of these values.
In new_entry(), initialize non_white_chars to zero.
Previously, if multiple input files were specified,
the first entry in files after the first was not
correctly recognized if it started on the first line.
This bug went undetected for so long because bibclean
is rarely used with multiple input files.
At most calls of out_with_parbreak_error(), put the
current character back into the input stream so that
it is output after the error message instead of before.
This is more likely to avoid splitting an input token.
The remaining fixes are for bugs and problems caught
by Alf-Christian Achilles <bibservadmin@ira.uka.de>
who maintains a very large bibliography collection on
ftp.ira.uka.de in /pub/bibliography consisting of
about 300 bibliographies, and 800 bibcleaned files,
occupying about 100MB.
In trim_value(), check for final "\<space>" control
sequence, and discard it; previously, only the space
was discarded, leaving an erroneous bare backslash.
In get_braced_string(), add missing additional
boundary check in loop to convert braced string to
quoted string.
Add DELETE_WHITESPACE support. In out_c(), this
requests discarding of all trailing whitespace in the
output buffer. In do_BibTeX_entry(), do_group(),
do_preamble(), and do_Scribe_entry(), if
prettyprinting, call out_c(DELETE_WHITESPACE) after
parsing optional space following the @ and the name.
Previously, a newline following the @ or the name
would be preserved, which is legal, but not desirable
in prettyprinted output. At end of do_one_file(),
call out_c(DELETE_WHITESPACE) to discard trailing
space at end of file.
Add -[no-]German-style option to provide for special
treatment of quote characters inside braced strings,
following the conventions of german.sty, which
overloads quote to simplify input and representation
of German umlaut accents, sharp-s (es-zet), ligature
separators, invisible hyphens, raised/lowered quotes,
French guillemets, and discretionary hyphens.
Add external file isbn.c, and call to ISBN_hyphenate()
in bad_ISBN() and check_ISBN(), so that correct
hyphenation of ISBNs is automatically supplied.
[01-Mar-1994] 2.09
Add -[no-]keep-linebreaks, -[no-]keep-parbreaks, and
-[no-]keep-spaces. This required usurping two control
characters, Ctl-N and Ctl-P, for LINEBREAK and
PARBREAK respectively; should such characters occur in
an input string value, they will be misinterpreted,
and will not be preserved in the output.
This restriction could be eliminated if value strings
had such characters converted to escape sequences
which were converted back again on output; however,
this would pose a substantial complication for column
position tracking, and carry a run-time penalty from
the extra conversions. Since control characters are
not expected to be present in value strings, loss of
two of them is not expected to be a problem.
[24-Sep-1993] 2.08
Update bibclean.c to handle characters in range
128..255 when char is a signed data type, and extend
testbib1.bib with more tests of the complete character
set. Augment Makefile with convenience targets for
each host environment. Add private input character
pushback support, because ANSI/ISO Standard C only
guarantees one character of pushback, and bibclean
needs at least 3.
[04-Jun-1993] 2.07
Update *.h files from DVI development to include support
for DEC Alpha 3000/500x OSF 1.2 (cc, c89, cxx), and HP
9000/735 HP-UX A.09.01 (cc, c89, CC, gcc, g++). Private
memset() below is not compiled on DEC Alpha to avoid
conflicts with vendor-supplied version.
[30-Nov-1992 -- 29-Jan-1993] 2.06
[1] Extend fix_author() to handle conversion of
"Smith, Jr., A. B." to "A. B. {Smith, Jr.}", and
"Smith Jr., A. B." to "A. B. {Smith Jr.}". Introduce
new auxiliary function check_junior() called by
fix_author().
[2] Extend month_pair[] table to include abbreviated month
names. Add new function month_token() and rewrite
fix_month() to use it to do a token-based parse of the
current_value[] string in order to be able to handle
conversions like these:
"January" --> jan
"Jan." --> jan
"January 24" --> jan # " 24"
"24 Jan." --> "24 " # jan
"May/June" --> may # "/" # jun
"February and May" --> feb # " and " # may
New test input files have been added, with new
expected output and error files.
[3] Add -[no-]fix-font-changes switch and new function
opt_fix_font_changes() to supply additional braces
around font changes in titles to prevent letter case
conversion by some BibTeX stylos. The real work is
done in the new function brace_font_changes() called
at the end of fix_title().
[4] Fix bug in out_value() with -delete-empty-fields
requested. The code incorrectly assumed that a string
value of 2 or fewer characters was an empty string.
That is correct if the string value is a quoted
string, but wrong if the string value is a 1- or
2-character macro. The code now correctly checks
explicitly for empty string, rather than using its
length to make the deletion decision. Thanks to
Manfred Aben <manfred@swi.psy.uva.nl> for reporting
this bug!
[5] Fix bug in get_token(); the code must test for a
non-NULL pointer before calling SKIP_SPACE(). Thanks
to Gil Webster <gil@dap.csiro.au> for reporting this
bug! [And thanks to the Internet funding agencies,
who make worldwide collaboration like this possible.]
[6] Add support for Roman numeral matching in match.c.
New file romtol.c contains romtol(), isroman(), and a
test program.
[7] Add calls to perror() at file open failures.
[8] Fix stupid error in brace_font_changes(); s[] was not
NUL-terminated before the final call to strcpy().
[9] In format(), make newmsg[] an internal static array
instead of reusing shared_string; otherwise, a warning
message from check_length() wipes out the current
string value.
[10] In main(), initialize the_file.input.filename to an
empty string, to avoid dereferencing a NULL pointer in
warning() during command-line option parsing.
[11] In do_args(), add code to display erroneous option
switches.
[12] In apply_function(), make string comparisons use
longer of the minimum match length and the option
switch length, so that all characters of the option
switch are tested. Previously, option misspellings
after the minimum match length went undetected.
[13] Add -[no-]prettyprint support, with new functions
do_string(), opt_prettyprint(), out_at(),
out_close_brace(), out_comma(), out_newline(),
out_open_brace(), out_other(), and out_token(), and
new data type token_t. Move do_comma() processing
out of do_field_value_pair() so that it can be used
by do_string().
[14] Add BYTE_VAL() macro for printing of characters with
octal formats.
[15] Change tag/key to key/field to agree with Appendix B
of LaTeX User's Guide and Reference Manual. Change
format items %t/%k to %k/%f to match key/field
terminology. The user impact of this rather large
source code and documentation change should be
minimal, and the removal of the disagreement with the
LaTeX book needs to be done now, rather than later.
bibclean.ini does not use either of the changed format
items.
[16] Change keyboard uses of key to keyboard, so key now
refers exclusively to bibliography citation keys.
[17] Change MAX_COLUMN to MAX_WIDTH and add -max-width
support, with new function opt_max_width() and new
variable max_width. Include "xlimits.h".
[18] Add BIBCLEAN_EXT and BIBCLEAN_INI to define
environment variables that can supply alternate
initialization file extension and name. Add
GETDEFAULT() macro to simplify coding.
[19] Rename put_char() to out_c(), and remove macro out_c().
[20] Add line wrapping support for lexical analysis output
in out_c().
[21] Add ``# line nnn "filename"'' output from out_token()
for lexical analysis output.
[22] Add strdup macro to redefine that name as
strdup_private to avoid problems with incorrect
<string.h> declarations of that function (for DEC
Alpha OSF/1).
[23] Add out_input_position() and token_start so that
out_token() can record both starting and ending line
numbers of a multi-line value token in lexical
analyzer output.
[24] Add check for non-zero brace level at end-of-file in
do_one_file().
[25] Add support for @Include{...}, a proposed extension
of BibTeX.
[26] Add append_value(), do_newline(),
do_optional_inline_comment(), do_optional_space(),
do_space(), get_inline_comment(),
get_optional_space(), and out_complex_value() so that
intervening space can be output when lexing, and so
that we can support in-line comments as well as
horizontal and vertical space between lexical items,
according to the proposed grammar for BibTeX. Add
do_preamble() to do rigorous parse of @Preamble{...}.
Revise do_BibTeX_value() to support recognition of
optional space between tokens of a string expression,
splitting it into two separate functions
do_BibTeX_value_1() and do_BibTeX_value_2() to handle
the two cases of prettyprinting and lexical analysis.
Add out_string() to localize test for output style.
[27] Add checks for end-of-file in quoted and braced
strings so these errors get reported. Suppress
pattern value checking for empty values; some of the
check_xxx() functions did this already, but some did
not. Now the test is localized in one place, in
out_value(), for all of them.
[16-Nov-1992 -- 24-Nov-1992] 2.05
Add Makefile steps to automatically extract help() text
from output of manual pages into new file bibclean.h, so
the built-in documentation stays up-to-date. The usage
messages still need manual adjustment if switches are
added or changed.
Add missing test of check_values in check_patterns().
Add support for optional warning messages with
patterns from initialization files. New function:
get_token(). New parsing code in do_new_pattern() to
handle optional warning message strings. Add message
argument to add_pattern().
Remove strip_comments() since comment processing is
now handled by get_token() and do_new_pattern(). This
permits unescaped comment characters inside quoted
strings.
Write bibclean.reg, an initialization file similar to
bibclean.ini, but with regular expressions.
Replace cascaded if statements for regular expression
testing with loop over patterns in check_patterns().
Move inclusion of match.h to after definition of
typedef YESorNO, and change type of match_pattern()
from int to YESorNO.
Add do_fileinit() and code in main() to call
do_fileinit() for each named input file with an
extension, replacing that extension with INITFILE_EXT
(default .ini). This adds a bibliography-specific
initialization capability to the system-wide,
user-wide, and job-wide files already supported.
Change -keep-initials and -keep-names to -fix-initials
and -fix-names, making them positive, rather than
negative, options. Also, make them independent by
moving invocations of fix_periods() outside of
fix_author(), and by checking fix_names in
fix_author() instead of at start of fix_namelist().
Add -[no-]read-init-files option to allow control over
which initialization files are read.
Add -[no-]trace-file-opening option to allow easy
tracing of file opening attempts by the program. A
similar feature in my DVI drivers has proved enormously
valuable in tracking down problems of missing files.
Rename entry_name[] to current_entry_name[], key[] to
current_key[], tag[] to current_tag[], and value[] to
current_value[] to get more distinctive names for
those global variables.
Include the value string matching code selection in the
version() message; this is needed so that users can
prepare initialization files with the correct pattern
syntax.
Make several MAX_xxx symbolic constants definable
at compile time.
Add MAX_PATTERN_NAMES constant, and increase
pattern_names[] table to that size, leaving empty slots
for expansion. Extend add_pattern() so that
unrecognized key names result in creation of new entries
in pattern_names[], making the set of key/value pairs
extensible without modification of the bibclean source
code. Add check_other() to handle checking of other
keywords.
Add unexpected() to localize issuing of unexpected value
warnings.
Repair next_s() in match.c to skip past <backslash><non-letter>
TeX control sequence; it was stopping one character
early.
Revise upper-case letter bracing code in fix_title()
to handle more cases.
Rewrite space collapsing code in fix_pages() to only
collapse space around en-dashes. The previous code
was too aggressive, so that "319 with 30 illustrations"
became "319 with30illustrations".
Add check_tag() called from do_tag_name(), and add
second argument, value, to check_patterns().
Add format() called from error() and warning() to
expand %e (@entry name), %k (key), %t (tag), %v
(value), and %% (percent) format items in messages.
This feature is needed so user-defined messages in
initialization files can get key, tag, and value into
messages. It also simplifies, and improves, calls to
warning() and error().
Add some missing (void) typecasts before str***() calls.
Change word_length() to return one more than true
length at end of string. Change tests in out_s() to
> MAX_COLUMN instead of >= MAX_COLUMN. Previously, if
a line ended exactly at column MAX_COLUMN, bibclean
could produce a spurious blank line, and would
sometimes wrap a line earlier than necessary. Add
additional punctuation wrap points in out_s(), and
remove tests for non-blank whitespace in switch()
statement.
Change type of all string index variables from int to
size_t.
In get_simple_string(), use enum type for type codes if
NEW_STYLE.
In check_year(), validate all sequences of 1 or more
digits.
Use the C preprocessor to define memmove() to be
Memmove(), so we always use our own version. Too many
C and C++ implementations were found to be lacking it,
sigh... Similarly, we provide our own version of
strtol() (in a separate file) from the DVI 3.0
development, because it too is missing from older UNIX
systems.
Complete port to IBM PC DOS with Turbo C 2.0, and
Turbo C and C++ 3.0. This required economization of
storage for arrays of size [MAX_TOKEN_SIZE] to get
global data below 64KB without having to reduce
MAX_TOKEN.
Added code in do_more() and preprocessor conditionals
in out_lines() to handle character-at-a-time input for
help paging on IBM PC DOS. Keyboard function keys
PgUp, PgDn, End, Home, Up arrow and Down arrow are
also recognized. This was easy to do because most PC
DOS C compilers provide getch() to get a keyboard
character without echo. No fiddling of terminal modes
is needed like it is on other systems.
The IBM PC DOS port exposed a problem in findfile(),
where it was assumed that an environment variable
would not be longer than the longest filename. Turbo
C sets the latter to 80 characters, but environment
variables can be set that are almost 128 characters
long. Microsoft C 5.0 also sets it to 80, but C 5.1
sets it to 144, and C 6.0 and C and C++ 7.0 set it to
260. This has been handled by defining MAXPATHLEN at
compile time, overriding the built-in defaults.
Add support for character-at-a-time input for help
paging on VAX VMS, and for getting the screen size in
get_screen_lines().
Rename do_more_init() to kbopen(), do_more_term() to
kbclose(), and use kbget() in do_more() to conceal the
heavily-O/S dependent details of the kbxxx()
functions.
Introduce STREQUAL() macro to simplify coding.
Introduce KEY_FUNCTION_ENTRY type and apply_function()
to simplify coding, and use it in do_args(),
do_preargs(), and out_value(). Argument actions are
moved into separate functions, opt_xxx(). Rename
show_author() to opt_author(), and help() to
opt_help(). Rename do_file() to do_one_file(), and
move file loop code from main() into new do_files().
Split large body of get_simple_string() into four new
functions, get_braced_string(), get_digit_string(),
get_quoted_string(), and get_identifier_string().
Add check_inodes() to determine whether stdlog and
stdout are the same file. If so, we need to ensure
that each warning message begins a new line, without
double spacing unnecessarily when they are different
files.
Add memset() implementation for SunOS 4.1.1 CC (C++)
and BSD 4.3 UNIX because it is missing from their
run-time libraries.
Replace fopen() by macro FOPEN() to work around
erroneous fopen() prototype for SunOS 4.1.1 CC (C++).
Complete port to IBM PC DOS with Microsoft C 5.1 and
6.0 compilers. Minor source changes (the CONST macro
below) needed to work around compiler errors.
[15-Nov-1992] 2.04
Minor changes to complete successful VAX VMS
installation and test.
[15-Nov-1992] 2.03
Add match_pattern() support for consistent pattern
matching in the check_xxx() functions, using new code
defined separately in match.c.
Add support for run-time redefinition of patterns via
one or more initialization file(s) found in the PATH
(system-defined) and BIBINPUTS (user-defined) search
paths. New functions: add_pattern(),
check_patterns(), do_initfile(), do_new_pattern(),
do_single_arg(), enlarge_table(), get_line(),
strdup(), strip_comments(), and trim_value(). New C
preprocessor symbols: HAVE_OLDCODE, HAVE_PATTERNS,
HAVE_RECOMP, and HAVE_REGEXP. One of these should be
defined at compile time; if none are, then
HAVE_PATTERNS is the default.
Since options can now be specified in initialization
files, they each need negations so the command line
can override values from an initialization file.
Change all YES/NO flags to new type, YESorNO, for
better type checking.
Add do_more(), do_more_init(), and do_more_term(), for
pausing during help output; a private version of
screen paging is used instead of a pager invoked by
system() for better portability across systems. Set
SCREEN_LINES to 0 at compile time to suppress this
feature.
In fix_title(), add code to brace upper-case letters
for cases like:
"X11" -> "{X11}"
"Standard C Library" -> "Standard {C} Library"
"C++ Book" -> "{C}++ Book"
leaving
"A xxx"
unchanged.
[11-Nov-1992] 2.02
Add bad_ISBN(), bad_ISSN(), check_ISBN(), and
check_ISSN() for validation of ISBN and ISSN values.
ISBN == "International Standard Book Number", and ISSN
= "International Standard Serial Number".
Add testisxn.bib and testisxn.bok to the test
collection, with steps in the Makefile to run the
test.
Add support for embedded \" in Scribe value strings
(forgotten in 2.01 revision); they are converted from
\"x to {\"x}.
[10-Nov-1992] 2.01
Add support for conversion of level-0 \"x to {\"x} and
x"y to x{"}y in value strings. Such input is illegal
for BibTeX, and causes hard-to-find errors, since
BibTeX raises an error at the line where it runs out
of string collection space, rather than at the
beginning of the collection point.
[06-Nov-1992] 2.00
Add full Scribe .bib file input compatibility with
-scribe command-line option.
Add support for multiple .bib file arguments on
command line, with new do_file() function to process
them.
Allow slash as well as hyphen for introducing
command-line options on VAX VMS and IBM PC DOS.
Add argument summary to help() (text extracted
verbatim from the manual pages).
Add new -delete-empty-fields, -keep-names,
-no-parbreaks, -remove-OPT-prefixes, and -no-warnings
command-line options and support code.
Add new out_with_error() and out_with_parbreak_error()
functions, and APPEND_CHAR() and EMPTY_STRING() macros
to shorten and clarify coding.
Add flush_inter_entry_space() function to standardize
line spacing.
Increase array sizes to MAX_TOKEN_SIZE (= MAX_TOKEN +
3) to reduce array bounds checking in inner loops.
Add additional file position tracking to enhance error
localization (structures IO_PAIR and POSITION, and
functions new_io_pair(), new_position(),
out_position(), and out_status()). Error messages are
parsable by GNU Emacs M-x next-error (C-x `) when
bibclean is run from Emacs by the command
M-x compile<RET>bibclean foo.bib >foo.new
Use arrays of constant strings for multiple string
output via new function out_lines(), instead of multiple
calls to fprintf().
Add additional checking via check_chapter(),
check_month(), check_number(), check_pages(),
check_volume(), check_year(), and match_regexp().
Supply implementation of memmove() library function
missing from g++ 2.2.2 library.
[03-Oct-1992] 1.06
Correct logic error in do_comma() that prevented correct
recognition of @name(key = "value") where the last
key/value pair did not have a trailing comma.
Add C++ support.
Add key_pair[] and entry_pair[] tables for
standardization of letter case usage, and use the new
NAME_PAIR type in fix_month().
Update author address.
Rename author() to show_author() to avoid shadowing
global names.
Fix two assignments of constant strings to char*
pointers.
Remove variable at_line_number which was defined, but
never used.
[01-Aug-1992] 1.05
Add -keep-initials switch support (thanks to Karl Berry
<karl@cs.umb.edu>). Internationalize telephone and FAX
numbers.
[02-Jan-1992] 1.04
Modify fix_title() to ignore macros. Modify
fix_author()) to ignore author lists with parentheses
(e.g. author = "P. D. Q. Bach (113 MozartStrasse,
Vienna, Austria)").
[31-Dec-1991] 1.03
Add fix_title() to supply braces around unbraced
upper-case acronyms in titles, and add private
definition of MAX().
[15-Nov-1991] 1.02
Handle @String(...) and @Preamble(...), converting
outer parentheses to braces. Insert spaces after
author and editor initials, and normalize names to
form "P. D. Q. Bach" instead of "Bach, P. D. Q.".
[10-Oct-1991] 1.01
Increase MAX_TOKEN to match enlarged BibTeX, and add
check against STD_MAX_TOKEN.
Output ISBN and ISSN in upper case.
Always surround = by blanks in key = "value".
[19-Dec-1990] 1.00 (version number unchanged)
Install Sun386i bug fix.
[08-Oct-1990] 1.00
Original version.
|