Skip to content

Commit

Permalink
bibtex-x: ver 4.01, Allow 8-bit/Unicode file names
Browse files Browse the repository at this point in the history
git-svn-id: svn://tug.org/texlive/trunk/Build/source@67639 c570f23f-e606-0410-a88d-b1316a301751
  • Loading branch information
t-tk committed Jul 15, 2023
1 parent 2aeda7f commit acdff07
Show file tree
Hide file tree
Showing 21 changed files with 186 additions and 91 deletions.
16 changes: 16 additions & 0 deletions texk/bibtex-x/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
2023-07-15 TANAKA Takuji <ttk@t-lab.opal.ne.jp>

* configure.ac, version.h:
Bump version to 4.01 (15 jul 2023).
* bibtex.{c,h}, bibtex-{1,2,3}.c, utils.c, gblvars.h:
Define "max_print_line" by function setup_bound_variable().
* bibtex-{1,4}.c:
Support characters defined by Unicode 15.0
and fix the degrade at 2023-07-08.
* bibtex-{2,3}.c, utils.c, sysdep.h:
Allow 8-bit/Unicode file names (both on Unix/Linux and Windows).
* tests/bibtexu-char.test: Enable test rc=16 again.
* tests/bibtex{8,u}.test, tests/bibtex8u-mem.test,
caseu.bbl, iscjku.bbl, testcaseu.bib, testiscjku.bib:
Update tests.

2023-07-09 Karl Berry <karl@freefriends.org>

* tests/bibtexu-char.test (is.knj.str$): test fails (rc=16).
Expand Down
11 changes: 7 additions & 4 deletions texk/bibtex-x/bibtex-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ BEGIN
END
out_buf_length = out_buf_ptr;
unbreakable_tail = FALSE;
while ((out_buf_length > MAX_PRINT_LINE) && ! unbreakable_tail)
while ((out_buf_length > Max_Print_Line) && ! unbreakable_tail)

/***************************************************************************
* WEB section number: 323
Expand All @@ -292,7 +292,7 @@ BEGIN
***************************************************************************/
BEGIN
end_ptr = out_buf_length;
out_buf_ptr = MAX_PRINT_LINE;
out_buf_ptr = Max_Print_Line;
break_pt_found = FALSE;
while ((lex_class[out_buf[out_buf_ptr]] != WHITE_SPACE)
&& (out_buf_ptr >= MIN_PRINT_LINE))
Expand All @@ -313,7 +313,7 @@ BEGIN
* point, so we don't break the line (yet).
***************************************************************************/
BEGIN
out_buf_ptr = MAX_PRINT_LINE + 1;
out_buf_ptr = Max_Print_Line + 1;
while (out_buf_ptr < end_ptr)
BEGIN
#ifdef UTF_8
Expand All @@ -330,7 +330,7 @@ BEGIN
case UBLOCK_LATIN_EXTENDED_C:
case UBLOCK_LATIN_EXTENDED_D:
case UBLOCK_LATIN_EXTENDED_E:
#if defined(UBLOCK_LATIN_EXTENDED_G)
#if defined(U_ICU_VERSION_MAJOR_NUM) && (U_ICU_VERSION_MAJOR_NUM > 69)
case UBLOCK_LATIN_EXTENDED_F:
case UBLOCK_LATIN_EXTENDED_G:
#endif
Expand All @@ -342,6 +342,9 @@ BEGIN
case UBLOCK_CYRILLIC_EXTENDED_A:
case UBLOCK_CYRILLIC_EXTENDED_B:
case UBLOCK_CYRILLIC_EXTENDED_C:
#if defined(U_ICU_VERSION_MAJOR_NUM) && (U_ICU_VERSION_MAJOR_NUM > 71)
case UBLOCK_CYRILLIC_EXTENDED_D:
#endif
case UBLOCK_HANGUL_SYLLABLES:
goto Loop1_Exit; /* break line */
break;
Expand Down
32 changes: 21 additions & 11 deletions texk/bibtex-x/bibtex-2.c
Original file line number Diff line number Diff line change
Expand Up @@ -2203,10 +2203,10 @@ BEGIN
if (MIN_PRINT_LINE < 3)
bad = 1;

if (MAX_PRINT_LINE <= MIN_PRINT_LINE)
if (Max_Print_Line <= MIN_PRINT_LINE)
bad = 10 * bad + 2;

if (MAX_PRINT_LINE >= Buf_Size)
if (Max_Print_Line >= Buf_Size)
bad = 10 * bad + 3;

if (Hash_Prime < 128)
Expand Down Expand Up @@ -2393,9 +2393,10 @@ BEGIN
/*
** Full 8Bit Support Note [ASIERRA95]:
** BibTeX just must recognize characters greater than 127.
** for (i=128; i<=255; i++)
** xchr [i] = (unsigned char) i;
*/
for (i=128; i<=255; i++)
xchr [i] = (unsigned char) i;

#endif /* SUPPORT_8BIT */

/*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 25 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
Expand Down Expand Up @@ -2458,13 +2459,10 @@ BEGIN
END

#ifdef SUPPORT_8BIT
/*
** if (!Flag_7bit)
** for (i=128; i<=LAST_ASCII_CHAR; i++)
** BEGIN
** xord[xchr[i]] = i;
** END
*/
for (i=128; i<=LAST_ASCII_CHAR; i++)
BEGIN
xord[xchr[i]] = i;
END
#endif /* SUPPORT_8BIT */

/*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 28 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
Expand Down Expand Up @@ -3779,10 +3777,22 @@ BEGIN

if (f != NULL)
BEGIN
#if defined(WIN32) && defined(KPATHSEA)
#define MAX_STR 780
unsigned char tmpstr[MAX_STR];
int j=0;
for (i=str_start[s]; i<=(str_start[s+1] - 1) && j<MAX_STR-1; i++, j++)
BEGIN
tmpstr[j] = xchr[str_pool[i]];
END
tmpstr[j] = '\0';
FPUTS (tmpstr, f);
#else
for (i=str_start[s]; i<=(str_start[s+1] - 1); i++)
BEGIN
FPUTC (xchr[str_pool[i]], f);
END
#endif
END
END
/*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 51 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
Expand Down
7 changes: 1 addition & 6 deletions texk/bibtex-x/bibtex-3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1069,12 +1069,7 @@ END
void sam_wrong_file_name_print (void)
BEGIN
FPRINTF (TERM_OUT, "I couldn't open file name `");
name_ptr = 0;
while (name_ptr < name_length)
BEGIN
FPUTC (name_of_file[name_ptr], TERM_OUT);
INCR (name_ptr);
END
FPUTS (name_of_file, TERM_OUT);
FPRINTF (TERM_OUT, "'\n");
END
/*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 99 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/
Expand Down
9 changes: 6 additions & 3 deletions texk/bibtex-x/bibtex-4.c
Original file line number Diff line number Diff line change
Expand Up @@ -2818,8 +2818,11 @@ BEGIN
case UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D:
case UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E:
case UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_F:
#if defined(UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_G)
#if defined(U_ICU_VERSION_MAJOR_NUM) && (U_ICU_VERSION_MAJOR_NUM > 65)
case UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_G:
#endif
#if defined(U_ICU_VERSION_MAJOR_NUM) && (U_ICU_VERSION_MAJOR_NUM > 71)
case UBLOCK_CJK_UNIFIED_IDEOGRAPHS_EXTENSION_H:
#endif
string_width |= 0x001;
break;
Expand All @@ -2828,10 +2831,10 @@ BEGIN
case UBLOCK_KATAKANA:
case UBLOCK_KATAKANA_PHONETIC_EXTENSIONS:
case UBLOCK_KANA_EXTENDED_A:
#if defined(UBLOCK_KANA_EXTENDED_B)
#if defined(U_ICU_VERSION_MAJOR_NUM) && (U_ICU_VERSION_MAJOR_NUM > 69)
case UBLOCK_KANA_EXTENDED_B:
#endif
#if defined(UBLOCK_SMALL_KANA_EXTENSION)
#if defined(U_ICU_VERSION_MAJOR_NUM) && (U_ICU_VERSION_MAJOR_NUM > 63)
case UBLOCK_SMALL_KANA_EXTENSION:
#endif
string_width |= 0x002;
Expand Down
18 changes: 0 additions & 18 deletions texk/bibtex-x/bibtex.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,9 +229,6 @@ int main (int argc, char **argv)
BEGIN
extern Integer8_T history;
int exit_status;
#ifdef KPATHSEA
char *mpl;
#endif

/*-
**------------------------------------------------------------------------
Expand Down Expand Up @@ -261,24 +258,9 @@ BEGIN
goto Close_Up_Shop_Label;
END

number_of_command_line_args = argc;
command_line_arg_strings = (char **) argv;

history = SPOTLESS;
parse_cmd_line (argc, argv);

#ifdef KPATHSEA
kpse_set_program_name(argv[0], PROGNAME);
mpl = kpse_var_value("max_print_line");
if (mpl)
BEGIN
max_print_line = atoi(mpl);
free(mpl);
END
else
max_print_line = 79; /* default */
#endif

set_array_sizes ();
report_search_paths ();

Expand Down
4 changes: 0 additions & 4 deletions texk/bibtex-x/bibtex.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,11 +268,7 @@
* cites when used with the standard styles.
***************************************************************************/
#define MIN_PRINT_LINE 3
#ifdef KPATHSEA
#define MAX_PRINT_LINE max_print_line
#else
#define MAX_PRINT_LINE 79
#endif
#define AUX_STACK_SIZE 20
#define MAX_BIB_FILES 20

Expand Down
22 changes: 11 additions & 11 deletions texk/bibtex-x/configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71 for extended BibTeX (TeX Live) 4.00.
# Generated by GNU Autoconf 2.71 for extended BibTeX (TeX Live) 4.01.
#
# Report bugs to <tex-k@tug.org>.
#
Expand Down Expand Up @@ -629,8 +629,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='extended BibTeX (TeX Live)'
PACKAGE_TARNAME='extended-bibtex--tex-live-'
PACKAGE_VERSION='4.00'
PACKAGE_STRING='extended BibTeX (TeX Live) 4.00'
PACKAGE_VERSION='4.01'
PACKAGE_STRING='extended BibTeX (TeX Live) 4.01'
PACKAGE_BUGREPORT='tex-k@tug.org'
PACKAGE_URL=''

Expand Down Expand Up @@ -1400,7 +1400,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures extended BibTeX (TeX Live) 4.00 to adapt to many kinds of systems.
\`configure' configures extended BibTeX (TeX Live) 4.01 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1472,7 +1472,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of extended BibTeX (TeX Live) 4.00:";;
short | recursive ) echo "Configuration of extended BibTeX (TeX Live) 4.01:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1599,7 +1599,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
extended BibTeX (TeX Live) configure 4.00
extended BibTeX (TeX Live) configure 4.01
generated by GNU Autoconf 2.71

Copyright (C) 2021 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2280,7 +2280,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by extended BibTeX (TeX Live) $as_me 4.00, which was
It was created by extended BibTeX (TeX Live) $as_me 4.01, which was
generated by GNU Autoconf 2.71. Invocation command line was

$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -8937,7 +8937,7 @@ fi

# Define the identity of the package.
PACKAGE='extended-bibtex--tex-live-'
VERSION='4.00'
VERSION='4.01'


# Some tools Automake needs.
Expand Down Expand Up @@ -19329,7 +19329,7 @@ Usage: $0 [OPTIONS]
Report bugs to <bug-libtool@gnu.org>."

lt_cl_version="\
extended BibTeX (TeX Live) config.lt 4.00
extended BibTeX (TeX Live) config.lt 4.01
configured by $0, generated by GNU Autoconf 2.71.

Copyright (C) 2011 Free Software Foundation, Inc.
Expand Down Expand Up @@ -21537,7 +21537,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by extended BibTeX (TeX Live) $as_me 4.00, which was
This file was extended by extended BibTeX (TeX Live) $as_me 4.01, which was
generated by GNU Autoconf 2.71. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -21605,7 +21605,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
extended BibTeX (TeX Live) config.status 4.00
extended BibTeX (TeX Live) config.status 4.01
configured by $0, generated by GNU Autoconf 2.71,
with options \\"\$ac_cs_config\\"

Expand Down
2 changes: 1 addition & 1 deletion texk/bibtex-x/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dnl This file is free software; the copyright holder
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl
AC_INIT([extended BibTeX (TeX Live)], [4.00], [tex-k@tug.org])
AC_INIT([extended BibTeX (TeX Live)], [4.01], [tex-k@tug.org])
AC_PREREQ([2.65])
AC_CONFIG_SRCDIR([bibtex-1.c])
AC_CONFIG_AUX_DIR([../../build-aux])
Expand Down
6 changes: 1 addition & 5 deletions texk/bibtex-x/gblvars.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,6 @@ __EXTERN__ Boolean_T bst_seen;
__EXTERN__ StrNumber_T bst_str;
__EXTERN__ BufPointer_T buf_ptr1;
__EXTERN__ BufPointer_T buf_ptr2;
#ifdef KPATHSEA
__EXTERN__ Integer_T max_print_line;
#endif

__EXTERN__ Boolean_T citation_seen;
__EXTERN__ Boolean_T cite_found;
Expand All @@ -189,7 +186,6 @@ __EXTERN__ LongJumpBuf_T Close_Up_Shop_Flag;
__EXTERN__ StrNumber_T cmd_str_ptr;
__EXTERN__ BufPointer_T comma1;
__EXTERN__ BufPointer_T comma2;
__EXTERN__ Char_T **command_line_arg_strings;
__EXTERN__ Integer_T command_num;
__EXTERN__ HashLoc_T control_seq_loc;
__EXTERN__ Integer8_T conversion_type;
Expand Down Expand Up @@ -264,7 +260,6 @@ __EXTERN__ BibNumber_T num_preamble_strings;
__EXTERN__ FieldLoc_T num_pre_defined_fields;
__EXTERN__ BufPointer_T num_text_chars;
__EXTERN__ BufPointer_T num_tokens;
__EXTERN__ Integer8_T number_of_command_line_args;

__EXTERN__ CiteNumber_T old_num_cites;
__EXTERN__ BufPointer_T out_buf_length;
Expand Down Expand Up @@ -467,6 +462,7 @@ __EXTERN__ Integer_T Max_Bib_Files;
__EXTERN__ Integer_T Max_Cites;
__EXTERN__ Integer_T Max_Fields;
__EXTERN__ Integer_T Max_Glob_Strs;
__EXTERN__ Integer_T Max_Print_Line;
__EXTERN__ Integer_T Max_Strings;
__EXTERN__ Integer_T Min_Crossrefs;
__EXTERN__ Integer_T Pool_Size;
Expand Down
6 changes: 6 additions & 0 deletions texk/bibtex-x/sysdep.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,13 @@
** Some macros to satisfy ANSI C's strict (for C anyway) type checking.
**============================================================================
*/
#if defined(WIN32) && defined(KPATHSEA)
#define FPRINTF (void) win32_fprintf
#define FPUTS (void) win32_fputs
#else
#define FPRINTF (void) fprintf
#define FPUTS (void) fputs
#endif
#define FPUTC (void) fputc
#define PRINTF (void) printf
#define PUTC (void) putc
Expand Down
Loading

0 comments on commit acdff07

Please sign in to comment.