diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2013-03-15 12:37:47 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2013-03-15 12:37:47 +0000 |
commit | 2cf631087f765cd6bae85e8255d0d1ae1be17bc8 (patch) | |
tree | 9f49b594107f7f9a03f54d2e1d374ac255b6240e /Build | |
parent | 675a4f704d457552f13ae48a61e181b518ef8673 (diff) |
bibtexu: Reduce diffs with bibtex8
git-svn-id: svn://tug.org/texlive/trunk@29400 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/bibtexu/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/bibtexu/bibtex-1.c | 15 | ||||
-rw-r--r-- | Build/source/texk/bibtexu/bibtex-2.c | 172 | ||||
-rw-r--r-- | Build/source/texk/bibtexu/bibtex-3.c | 7 | ||||
-rw-r--r-- | Build/source/texk/bibtexu/bibtex-4.c | 325 | ||||
-rw-r--r-- | Build/source/texk/bibtexu/bibtex.c | 2 | ||||
-rw-r--r-- | Build/source/texk/bibtexu/bibtex.h | 2 | ||||
-rw-r--r-- | Build/source/texk/bibtexu/gblprocs.h | 42 | ||||
-rw-r--r-- | Build/source/texk/bibtexu/gblvars.h | 8 | ||||
-rw-r--r-- | Build/source/texk/bibtexu/utils.c | 21 | ||||
-rw-r--r-- | Build/source/texk/bibtexu/utils.h | 3 |
11 files changed, 120 insertions, 483 deletions
diff --git a/Build/source/texk/bibtexu/ChangeLog b/Build/source/texk/bibtexu/ChangeLog index 6743c618e75..26fe393c02d 100644 --- a/Build/source/texk/bibtexu/ChangeLog +++ b/Build/source/texk/bibtexu/ChangeLog @@ -1,3 +1,9 @@ +2013-03-15 Peter Breitenlohner <peb@mppmu.mpg.de> + + Reduce diffs with bibtex8. + * bibtex-[1-4].c, bibtex.[ch], gblprocs.h, gblvars.h, + utils.[ch]: Drop unused code and adjust white space. + 2013-02-08 Peter Breitenlohner <peb@mppmu.mpg.de> * Makefile.am (btdocdir): Change texmf => texmf-dist. diff --git a/Build/source/texk/bibtexu/bibtex-1.c b/Build/source/texk/bibtexu/bibtex-1.c index d37e83f5df0..3c4fde5119c 100644 --- a/Build/source/texk/bibtexu/bibtex-1.c +++ b/Build/source/texk/bibtexu/bibtex-1.c @@ -147,13 +147,8 @@ #include "utils.h" #include "version.h" -/* -Include the ICU heads. 23/sep/2009 -*/ -#include "unicode/ustdio.h" -#include "unicode/uchar.h" -#include "unicode/ucnv.h" -#include "unicode/ucol.h" + + /*************************************************************************** * WEB section number: 61 * ~~~~~~~~~~~~~~~~~~~ @@ -2078,16 +2073,10 @@ BEGIN bib_line_num = 0; buf_ptr2 = last; while ( ! feof (CUR_BIB_FILE)) - -/* while ( ! u_feof (CUR_BIB_FILE)) -*/ BEGIN get_bib_command_or_entry_and_pr (); END a_close (CUR_BIB_FILE); - -/* u_file_close (CUR_BIB_FILE); -*/ INCR (bib_ptr); END reading_completed = TRUE; diff --git a/Build/source/texk/bibtexu/bibtex-2.c b/Build/source/texk/bibtexu/bibtex-2.c index 4663016cde4..a4a92582b25 100644 --- a/Build/source/texk/bibtexu/bibtex-2.c +++ b/Build/source/texk/bibtexu/bibtex-2.c @@ -501,10 +501,8 @@ End_While_Label: DO_NOTHING; END else BEGIN - INCR (wiz_ptr); push_lit_stk (wiz_functions[wiz_ptr], STK_FN); - END INCR (wiz_ptr); END @@ -627,7 +625,6 @@ End_While_Label: DO_NOTHING; APPEND_CHAR (GLOBAL_STRS(str_glb_ptr, glob_chr_ptr)); INCR (glob_chr_ptr); END - push_lit_stk (make_string (), STK_STR); END END @@ -725,7 +722,6 @@ BEGIN BEGIN cur_token = first_start; last_token = first_end; - if (cur_token == last_token) BEGIN to_be_written = FALSE; @@ -904,7 +900,6 @@ BEGIN * Here we output all the characters in the token, verbatim. ***************************************************************************/ BEGIN - name_bf_ptr = name_tok[cur_token]; name_bf_xptr = name_tok[cur_token + 1]; if (ex_buf_length + (name_bf_xptr - name_bf_ptr) @@ -937,42 +932,36 @@ BEGIN /* For output the first character which is encodage UTF-8, we sould discuter different length of character. 23/sep/2009 */ - if((lex_class[NAME_BUF[name_bf_ptr]] != WHITE_SPACE) && (NAME_BUF[name_bf_ptr] != LEFT_BRACE)) - BEGIN - if(NAME_BUF[name_bf_ptr] <= 0x7F) - BEGIN - APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr]); - END - else if((NAME_BUF[name_bf_ptr] >= 0xC2) && (NAME_BUF[name_bf_ptr] <= 0xDF)) - BEGIN - APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr]); - APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr+1]); - END - else if((NAME_BUF[name_bf_ptr] >= 0xE0) && (NAME_BUF[name_bf_ptr] <= 0xEF)) - BEGIN - APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr]); - APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr+1]); - APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr+2]); - END - else if((NAME_BUF[name_bf_ptr] >= 0xF0) && (NAME_BUF[name_bf_ptr] <= 0xF4)) - BEGIN - APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr]); - APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr+1]); - APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr+2]); - APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr+3]); - END - else - BEGIN - printf("this isn't a right UTF-8 char!"); - END - - goto Loop_Exit_Label; - END - - - - - + if((lex_class[NAME_BUF[name_bf_ptr]] != WHITE_SPACE) && (NAME_BUF[name_bf_ptr] != LEFT_BRACE)) + BEGIN + if(NAME_BUF[name_bf_ptr] <= 0x7F) + BEGIN + APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr]); + END + else if((NAME_BUF[name_bf_ptr] >= 0xC2) && (NAME_BUF[name_bf_ptr] <= 0xDF)) + BEGIN + APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr]); + APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr+1]); + END + else if((NAME_BUF[name_bf_ptr] >= 0xE0) && (NAME_BUF[name_bf_ptr] <= 0xEF)) + BEGIN + APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr]); + APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr+1]); + APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr+2]); + END + else if((NAME_BUF[name_bf_ptr] >= 0xF0) && (NAME_BUF[name_bf_ptr] <= 0xF4)) + BEGIN + APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr]); + APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr+1]); + APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr+2]); + APPEND_EX_BUF_CHAR_AND_CHECK (NAME_BUF[name_bf_ptr+3]); + END + else + BEGIN + printf("this isn't a right UTF-8 char!"); + END + goto Loop_Exit_Label; + END else if ((NAME_BUF[name_bf_ptr] == LEFT_BRACE) && ((name_bf_ptr + 1) < name_bf_xptr)) BEGIN @@ -1294,7 +1283,6 @@ BEGIN while ( ! scan1 (AT_SIGN)) BEGIN if ( ! input_ln (CUR_BIB_FILE)) - BEGIN goto Exit_Label; END @@ -2855,6 +2843,7 @@ END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 47 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ + /*************************************************************************** * WEB section number: 198 * ~~~~~~~~~~~~~~~~~~~ @@ -2950,88 +2939,6 @@ END * when handling nonletters. ***************************************************************************/ /* -This is original code of "less_than". Now it's less_than_uni. -Actually, it desn't be used in the program. We just resever the original -code. We use the code "less_than" after the code "less_than_uni". This new -"less_than" is for the UTF-8. Of couse, it's also avaible for ASCII. -23/sep/2009 -*/ - -Boolean_T less_than_uni (CiteNumber_T arg1, CiteNumber_T arg2) -BEGIN - Boolean_T less_than; - Integer_T char_ptr; - StrEntLoc_T ptr1, - ptr2; - ASCIICode_T char1, - char2; - - ptr1 = (arg1 * num_ent_strs) + sort_key_num; - ptr2 = (arg2 * num_ent_strs) + sort_key_num; - char_ptr = 0; - LOOP - BEGIN - char1 = ENTRY_STRS(ptr1, char_ptr); - char2 = ENTRY_STRS(ptr2, char_ptr); - - printf("%c ",char1);printf("%c",char2); - - if (char1 == END_OF_STRING) - BEGIN - if (char2 == END_OF_STRING) - BEGIN - if (arg1 < arg2) - BEGIN - COMPARE_RETURN (TRUE); - END - else if (arg1 > arg2) - BEGIN - COMPARE_RETURN (FALSE); - END - else - BEGIN - CONFUSION ("Duplicate sort key"); - END - END - else - BEGIN - COMPARE_RETURN (TRUE); - END - END - else if (char2 == END_OF_STRING) - BEGIN - COMPARE_RETURN (FALSE); - END - -#ifdef SUPPORT_8BIT - else if char_less_than(char1, char2) - BEGIN - COMPARE_RETURN (TRUE); - END - else if char_greater_than(char1, char2) - BEGIN - COMPARE_RETURN (FALSE); - END -#else /* NOT SUPPORT_8BIT */ - else if (char1 < char2) - BEGIN - COMPARE_RETURN (TRUE); - END - else if (char1 > char2) - BEGIN - COMPARE_RETURN (FALSE); - END -#endif /* SUPPORT_8BIT */ - - INCR (char_ptr); - END -Exit_Label: - printf("%d\n",less_than); - return (less_than); -END -/*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 301 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ - -/* We use ICU libs to processing UTF-8. First, we have to transform UTF-8 to Unicode/UChar with the fonction icu_UCHars. Then we use the UCollator in the ICU libs to conparer the Unicode. There is an option "location", @@ -3073,9 +2980,11 @@ BEGIN u_less = !ucol_greaterOrEqual(ucol1, uch1, uchlen1, uch2, uchlen2); ucol_close(ucol1); - return u_less; END +/*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 301 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ + + /*************************************************************************** @@ -3091,7 +3000,7 @@ Because the bibtex use "lower_case" a lot of time, but for processing the charca not many. We reserver the original code "lower_case" for other cases. 23/sep/2009 */ -void lower_case (BufType_T buf, BufPointer_T bf_ptr, +void lower_case (BufType_T buf, BufPointer_T bf_ptr, BufPointer_T len) BEGIN BufPointer_T i; @@ -3100,20 +3009,21 @@ BEGIN BEGIN for (i = bf_ptr; i <= (bf_ptr + len - 1); i++) BEGIN + #ifdef SUPPORT_8BIT - if (IsUpper (buf[i])) + if (IsUpper (buf[i])) BEGIN - buf[i] = ToLower (buf[i]); + buf[i] = ToLower (buf[i]); END #else /* NOT SUPPORT_8BIT */ - if ((buf[i] >= 'A') && (buf[i] <= 'Z')) + if ((buf[i] >= 'A') && (buf[i] <= 'Z')) BEGIN - buf[i] = buf[i] + CASE_DIFFERENCE; + buf[i] = buf[i] + CASE_DIFFERENCE; END #endif /* SUPPORT_8BIT */ + END END -return; END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 62 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ diff --git a/Build/source/texk/bibtexu/bibtex-3.c b/Build/source/texk/bibtexu/bibtex-3.c index 6d89553e062..1bd25901dcf 100644 --- a/Build/source/texk/bibtexu/bibtex-3.c +++ b/Build/source/texk/bibtexu/bibtex-3.c @@ -1938,7 +1938,7 @@ BEGIN } #endif /* TRACE */ - lower_case (buffer, buf_ptr1, TOKEN_LEN);//printf(" 192 "); + lower_case (buffer, buf_ptr1, TOKEN_LEN); fn_loc = str_lookup (buffer, buf_ptr1, TOKEN_LEN, BST_FN_ILK, DONT_INSERT); if ( ! hash_found) @@ -3391,12 +3391,10 @@ BEGIN if (pop_typ1 != STK_STR) BEGIN print_wrong_stk_lit (pop_lit1, pop_typ1, STK_STR); - push_lit_stk (s_null, STK_STR); END else if (LENGTH (pop_lit1) == 0) BEGIN - push_lit_stk (s_null, STK_STR); END else @@ -3450,8 +3448,7 @@ Loop_Exit_Label: pool_ptr = str_start[pop_lit1 + 1]; STR_ROOM (1); END - APPEND_CHAR (PERIOD);; - + APPEND_CHAR (PERIOD); push_lit_stk (make_string (), STK_STR); break; END diff --git a/Build/source/texk/bibtexu/bibtex-4.c b/Build/source/texk/bibtexu/bibtex-4.c index 6257b5b7a3a..0a5d987531b 100644 --- a/Build/source/texk/bibtexu/bibtex-4.c +++ b/Build/source/texk/bibtexu/bibtex-4.c @@ -170,7 +170,6 @@ Include the ICU heads. 23/sep/2009 ***************************************************************************/ void x_change_case (void) BEGIN - pop_lit_stk (&pop_lit1, &pop_typ1); pop_lit_stk (&pop_lit2, &pop_typ2); if (pop_typ1 != STK_STR) @@ -193,8 +192,7 @@ BEGIN * definitions, to be used in |case| statements, are in order of probable * frequency. ***************************************************************************/ - - BEGIN + BEGIN switch (str_pool[str_start[pop_lit1]]) BEGIN case 't': @@ -220,7 +218,6 @@ BEGIN BST_EX_WARN (" is an illegal case-conversion string"); END END - /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 366 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ ex_buf_length = 0; @@ -232,7 +229,6 @@ BEGIN * Here's where we actually go through the string and do the case * conversion. ***************************************************************************/ - BEGIN brace_level = 0; ex_buf_ptr = 0; @@ -278,7 +274,6 @@ BEGIN * will do reasonably well if there is other stuff, too, between braces, * but it doesn't try to do anything special with |colon|s. ***************************************************************************/ - BEGIN INCR (ex_buf_ptr); while ((ex_buf_ptr < ex_buf_length) && (brace_level > 0)) @@ -302,7 +297,6 @@ BEGIN * the consecutive alphabetic characters following the |backslash|; it * might be empty (although ones in this section aren't). ***************************************************************************/ - BEGIN switch (conversion_type) BEGIN @@ -315,9 +309,7 @@ BEGIN case N_OE_UPPER: case N_AE_UPPER: case N_AA_UPPER: - ex_buf_ptr=ex_buf_xptr+lower_case_uni(ex_buf, ex_buf_xptr,ex_buf_ptr - ex_buf_xptr); - break; default: DO_NOTHING; @@ -332,10 +324,8 @@ BEGIN case N_OE: case N_AE: case N_AA: - ex_buf_ptr=ex_buf_xptr+upper_case_uni (ex_buf, ex_buf_xptr, ex_buf_ptr - ex_buf_xptr); - break; case N_I: case N_J: @@ -347,12 +337,9 @@ BEGIN * After converting the control sequence, we need to remove the preceding * |backslash| and any following |white_space|. ***************************************************************************/ - BEGIN - ex_buf_ptr=ex_buf_xptr+ upper_case_uni (ex_buf, ex_buf_xptr, ex_buf_ptr - ex_buf_xptr); - while (ex_buf_xptr < ex_buf_ptr) BEGIN ex_buf[ex_buf_xptr - 1] = ex_buf[ex_buf_xptr]; @@ -374,7 +361,6 @@ BEGIN ex_buf_length = tmp_ptr - (ex_buf_ptr - ex_buf_xptr); ex_buf_ptr = ex_buf_xptr; END - /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 374 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ break; @@ -391,7 +377,6 @@ BEGIN break; END END - /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 372 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ ex_buf_xptr = ex_buf_ptr; @@ -415,18 +400,15 @@ BEGIN * There are no control sequences in what we're about to convert, * so a straight conversion suffices. ***************************************************************************/ - switch (conversion_type) BEGIN case TITLE_LOWERS: case ALL_LOWERS: - ex_buf_ptr = ex_buf_xptr + lower_case_uni(ex_buf, ex_buf_xptr, ex_buf_ptr - ex_buf_xptr);//printf(" 375 "); - + ex_buf_ptr = ex_buf_xptr + lower_case_uni(ex_buf, ex_buf_xptr, ex_buf_ptr - ex_buf_xptr); break; case ALL_UPPERS: - ex_buf_ptr=ex_buf_xptr+ upper_case_uni (ex_buf, ex_buf_xptr, ex_buf_ptr - ex_buf_xptr); - - break; + ex_buf_ptr=ex_buf_xptr+ upper_case_uni (ex_buf, ex_buf_xptr, ex_buf_ptr - ex_buf_xptr); + break; case BAD_CONVERSION: DO_NOTHING; break; @@ -434,12 +416,10 @@ BEGIN case_conversion_confusion (); break; END - /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 375 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ END DECR (ex_buf_ptr); - END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 371 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ @@ -458,7 +438,6 @@ OK_Pascal_I_Give_Up_Label: prev_colon = FALSE; * This code does any needed conversion for an ordinary character; it * won't touch nonletters. ***************************************************************************/ - BEGIN switch (conversion_type) BEGIN @@ -521,7 +500,7 @@ for the precessing after lower case. Here there may be some potential bug. END break; case ALL_LOWERS: - BEGIN + BEGIN /* Here the same for processing the length of string after change case. 23/sep/2009 */ @@ -537,7 +516,7 @@ Here the same for processing the length of string after change case. 23/sep/2009 break; END case ALL_UPPERS: - BEGIN + BEGIN /* Here the same for processing the length of string after change case. 23/sep/2009 */ @@ -549,10 +528,8 @@ Here the same for processing the length of string after change case. 23/sep/2009 END ulen=(i-ex_buf_ptr+1); ex_buf_ptr=ex_buf_ptr-1+upper_case_uni (ex_buf, ex_buf_ptr, ulen); - - break; - END + END case BAD_CONVERSION: DO_NOTHING; break; @@ -560,19 +537,16 @@ Here the same for processing the length of string after change case. 23/sep/2009 case_conversion_confusion (); break; END - END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 376 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ INCR (ex_buf_ptr); END check_brace_level (pop_lit2); - END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 370 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ - add_pool_buf_and_push (); - + add_pool_buf_and_push (); END END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 364 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ @@ -595,7 +569,6 @@ BEGIN if (pop_typ1 != STK_STR) BEGIN print_wrong_stk_lit (pop_lit1, pop_typ1, STK_STR); - push_lit_stk (0, STK_INT); END else if (LENGTH (pop_lit1) != 1) @@ -603,12 +576,10 @@ BEGIN PRINT ("\""); PRINT_POOL_STR (pop_lit1); BST_EX_WARN ("\" isn't a single character"); - push_lit_stk (0, STK_INT); END else BEGIN - push_lit_stk (str_pool[str_start[pop_lit1]], STK_INT); END END @@ -631,16 +602,6 @@ BEGIN END else BEGIN -/* if ((ex_buf[0]== 0xC3) && (ex_buf[1] != 0xA9)) && (ex_buf[1] != 0xA9)){ - printf(" AFTER 378,here is 0XC3"); - int iiii=0; - - while (iiii < ex_buf_length) - { - printf("%c",ex_buf[iiii]);INCR (iiii); - } - } -*/ push_lit_stk (CUR_CITE_STR, STK_STR); END END @@ -665,13 +626,11 @@ BEGIN if (pop_typ1 != STK_STR) BEGIN print_wrong_stk_lit (pop_lit1, pop_typ1, STK_STR); - push_lit_stk (s_null, STK_STR); END else if (pop_typ2 != STK_STR) BEGIN print_wrong_stk_lit (pop_lit2, pop_typ2, STK_STR); - push_lit_stk (s_null, STK_STR); END else @@ -697,7 +656,6 @@ BEGIN END else if (LENGTH (pop_lit2) == 0) BEGIN - push_lit_stk (pop_lit1, STK_STR); END else @@ -711,7 +669,7 @@ BEGIN APPEND_CHAR (str_pool[sp_ptr]); INCR (sp_ptr); END - push_lit_stk (make_string (), STK_STR); + push_lit_stk (make_string (), STK_STR); END END else @@ -756,7 +714,6 @@ BEGIN INCR (sp_ptr); END pool_ptr = pool_ptr + sp_length; - push_lit_stk (make_string (), STK_STR); END END @@ -774,7 +731,6 @@ BEGIN END else if (LENGTH (pop_lit2) == 0) BEGIN - push_lit_stk (pop_lit1, STK_STR); END else @@ -794,7 +750,7 @@ BEGIN APPEND_CHAR (str_pool[sp_ptr]); INCR (sp_ptr); END - push_lit_stk (make_string (), STK_STR); + push_lit_stk (make_string (), STK_STR); END END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 353 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ @@ -820,14 +776,9 @@ END void x_duplicate (void) BEGIN pop_lit_stk (&pop_lit1, &pop_typ1); - - if (pop_typ1 != STK_STR) BEGIN - - push_lit_stk (pop_lit1, pop_typ1); - push_lit_stk (pop_lit1, pop_typ1); END else @@ -835,7 +786,7 @@ BEGIN REPUSH_STRING; if (pop_lit1 < cmd_str_ptr) BEGIN - push_lit_stk (pop_lit1, pop_typ1); + push_lit_stk (pop_lit1, pop_typ1); END else BEGIN @@ -847,7 +798,6 @@ BEGIN APPEND_CHAR (str_pool[sp_ptr]); INCR (sp_ptr); END - push_lit_stk (make_string (), STK_STR); END END @@ -886,30 +836,25 @@ BEGIN BEGIN if (lex_class[str_pool[sp_ptr]] != WHITE_SPACE) BEGIN - push_lit_stk (0, STK_INT); goto Exit_Label; END INCR (sp_ptr); END - push_lit_stk (1, STK_INT); END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 381 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ break; case STK_FIELD_MISSING: - push_lit_stk (1, STK_INT); break; case STK_EMPTY: - push_lit_stk (0, STK_INT); break; default: print_stk_lit (pop_lit1, pop_typ1); BST_EX_WARN (", not a string or missing field,"); - push_lit_stk (0, STK_INT); break; END @@ -942,7 +887,6 @@ BEGIN PRINT_NEWLINE; BST_EX_WARN ("---they aren't the same literal types"); END - push_lit_stk (0, STK_INT); END else if ((pop_typ1 != STK_INT) && (pop_typ1 != STK_STR)) @@ -952,30 +896,25 @@ BEGIN print_stk_lit (pop_lit1, pop_typ1); BST_EX_WARN (", not an integer or a string,"); END - push_lit_stk (0, STK_INT); END else if (pop_typ1 == STK_INT) BEGIN if (pop_lit2 == pop_lit1) BEGIN - push_lit_stk (1, STK_INT); END else BEGIN - push_lit_stk (0, STK_INT); END END else if (str_eq_str (pop_lit2, pop_lit1)) BEGIN - push_lit_stk (1, STK_INT); END else BEGIN - push_lit_stk (0, STK_INT); END END @@ -1001,24 +940,19 @@ BEGIN pop_lit_stk (&pop_lit1, &pop_typ1); pop_lit_stk (&pop_lit2, &pop_typ2); pop_lit_stk (&pop_lit3, &pop_typ3); - - if (pop_typ1 != STK_STR) BEGIN print_wrong_stk_lit (pop_lit1, pop_typ1, STK_STR); - push_lit_stk (s_null, STK_STR); END else if (pop_typ2 != STK_INT) BEGIN print_wrong_stk_lit (pop_lit2, pop_typ2, STK_INT); - push_lit_stk (s_null, STK_STR); END else if (pop_typ3 != STK_STR) BEGIN print_wrong_stk_lit (pop_lit3, pop_typ3, STK_STR); - push_lit_stk (s_null, STK_STR); END else @@ -1375,10 +1309,7 @@ Loop1_Exit_Label: DO_NOTHING; ex_buf_length = 0; add_buf_pool (pop_lit1); figure_out_the_formatted_name (); - - add_pool_buf_and_push (); - END END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 382 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ @@ -1458,14 +1389,10 @@ BEGIN while (sp_ptr < sp_xptr1) BEGIN ENTRY_STRS(str_ent_ptr, ent_chr_ptr) = str_pool[sp_ptr]; - - - INCR (ent_chr_ptr); INCR (sp_ptr); END ENTRY_STRS(str_ent_ptr, ent_chr_ptr) = END_OF_STRING; - END END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 357 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ @@ -1562,23 +1489,19 @@ BEGIN if (pop_typ1 != STK_INT) BEGIN print_wrong_stk_lit (pop_lit1, pop_typ1, STK_INT); - push_lit_stk (0, STK_INT); END else if (pop_typ2 != STK_INT) BEGIN print_wrong_stk_lit (pop_lit2, pop_typ2, STK_INT); - push_lit_stk (0, STK_INT); END else if (pop_lit2 > pop_lit1) BEGIN - push_lit_stk (1, STK_INT); END else BEGIN - push_lit_stk (0, STK_INT); END END @@ -1602,13 +1525,11 @@ BEGIN if (pop_typ1 != STK_INT) BEGIN print_wrong_stk_lit (pop_lit1, pop_typ1, STK_INT); - push_lit_stk (s_null, STK_STR); END else if ((pop_lit1 < 0) || (pop_lit1 > 127)) BEGIN BST_EX_WARN2 ("%ld isn't valid ASCII", (long) pop_lit1); - push_lit_stk (s_null, STK_STR); END else @@ -1637,15 +1558,12 @@ BEGIN if (pop_typ1 != STK_INT) BEGIN print_wrong_stk_lit (pop_lit1, pop_typ1, STK_INT); - push_lit_stk (s_null, STK_STR); END else BEGIN int_to_ASCII (pop_lit1, ex_buf, 0, &ex_buf_length); - add_pool_buf_and_push (); - END END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 423 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ @@ -1668,23 +1586,19 @@ BEGIN if (pop_typ1 != STK_INT) BEGIN print_wrong_stk_lit (pop_lit1, pop_typ1, STK_INT); - push_lit_stk (0, STK_INT); END else if (pop_typ2 != STK_INT) BEGIN print_wrong_stk_lit (pop_lit2, pop_typ2, STK_INT); - push_lit_stk (0, STK_INT); END else if (pop_lit2 < pop_lit1) BEGIN - push_lit_stk (1, STK_INT); END else BEGIN - push_lit_stk (0, STK_INT); END END @@ -1708,18 +1622,15 @@ BEGIN if (pop_typ1 != STK_INT) BEGIN print_wrong_stk_lit (pop_lit1, pop_typ1, STK_INT); - push_lit_stk (0, STK_INT); END else if (pop_typ2 != STK_INT) BEGIN print_wrong_stk_lit (pop_lit2, pop_typ2, STK_INT); - push_lit_stk (0, STK_INT); END else BEGIN - push_lit_stk (pop_lit2 - pop_lit1, STK_INT); END END @@ -1751,17 +1662,14 @@ BEGIN print_stk_lit (pop_lit1, pop_typ1); BST_EX_WARN (", not a string or missing field,"); END - push_lit_stk (0, STK_INT); END else if (pop_typ1 == STK_FIELD_MISSING) BEGIN - push_lit_stk (1, STK_INT); END else BEGIN - push_lit_stk (0, STK_INT); END END @@ -1786,7 +1694,6 @@ BEGIN if (pop_typ1 != STK_STR) BEGIN print_wrong_stk_lit (pop_lit1, pop_typ1, STK_STR); - push_lit_stk (0, STK_INT); END else @@ -1812,7 +1719,6 @@ BEGIN END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 427 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ - push_lit_stk (num_names, STK_INT); END END @@ -1834,18 +1740,15 @@ BEGIN if (pop_typ1 != STK_INT) BEGIN print_wrong_stk_lit (pop_lit1, pop_typ1, STK_INT); - push_lit_stk (0, STK_INT); END else if (pop_typ2 != STK_INT) BEGIN print_wrong_stk_lit (pop_lit2, pop_typ2, STK_INT); - push_lit_stk (0, STK_INT); END else BEGIN - push_lit_stk (pop_lit2 + pop_lit1, STK_INT); END END @@ -1870,9 +1773,7 @@ BEGIN add_buf_pool (s_preamble[preamble_ptr]); INCR (preamble_ptr); END - add_pool_buf_and_push (); - END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 429 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ @@ -1892,12 +1793,10 @@ END ***************************************************************************/ void x_purify (void) BEGIN - pop_lit_stk (&pop_lit1, &pop_typ1); if (pop_typ1 != STK_STR) BEGIN print_wrong_stk_lit (pop_lit1, pop_typ1, STK_STR); - push_lit_stk (s_null, STK_STR); END else @@ -1905,7 +1804,6 @@ BEGIN ex_buf_length = 0; add_buf_pool (pop_lit1); - /*************************************************************************** * WEB section number: 431 * ~~~~~~~~~~~~~~~~~~~ @@ -1936,9 +1834,9 @@ When we processe the character UTF-8, the length has been changed. This focntion quick_sort. 23/sep/2009 */ - BEGIN - if(ex_buf[ex_buf_ptr] <= 0x7F) - BEGIN + BEGIN + if(ex_buf[ex_buf_ptr] <= 0x7F) + BEGIN ex_buf[ex_buf_xptr] = ex_buf[ex_buf_ptr]; INCR (ex_buf_xptr); @@ -1993,7 +1891,7 @@ quick_sort. 23 * |sep_char|s). ***************************************************************************/ BEGIN - INCR (ex_buf_ptr); + INCR (ex_buf_ptr); while ((ex_buf_ptr < ex_buf_length) && (brace_level > 0)) BEGIN INCR (ex_buf_ptr); @@ -2017,7 +1915,6 @@ quick_sort. 23 * characters. ***************************************************************************/ BEGIN - ex_buf[ex_buf_xptr] = ex_buf[ex_buf_yptr]; INCR (ex_buf_xptr); switch (ilk_info[control_seq_loc]) @@ -2036,7 +1933,6 @@ quick_sort. 23 DO_NOTHING; break; END - END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 433 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ @@ -2067,7 +1963,6 @@ quick_sort. 23 END END DECR (ex_buf_ptr); - END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 432 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ @@ -2085,13 +1980,10 @@ quick_sort. 23 INCR (ex_buf_ptr); END ex_buf_length = ex_buf_xptr; - END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 431 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ - add_pool_buf_and_push (); - END END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 430 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ @@ -2138,43 +2030,33 @@ back to UTF-8. 23/sep/2009 void x_substring (void) BEGIN - pop_lit_stk (&pop_lit1, &pop_typ1); pop_lit_stk (&pop_lit2, &pop_typ2); pop_lit_stk (&pop_lit3, &pop_typ3); - - if (pop_typ1 != STK_INT) BEGIN print_wrong_stk_lit (pop_lit1, pop_typ1, STK_INT); - push_lit_stk (s_null, STK_STR); END else if (pop_typ2 != STK_INT) BEGIN print_wrong_stk_lit (pop_lit2, pop_typ2, STK_INT); - push_lit_stk (s_null, STK_STR); END else if (pop_typ3 != STK_STR) BEGIN print_wrong_stk_lit (pop_lit3, pop_typ3, STK_STR); - push_lit_stk (s_null, STK_STR); END else BEGIN + Integer_T str_length = LENGTH (pop_lit3); + UChar uchs[BUF_SIZE+1]; + int32_t utcap = BUF_SIZE+1; + int32_t ulen = icu_toUChars(str_pool,str_start[pop_lit3],str_length,uchs, utcap); - Integer_T str_length = LENGTH (pop_lit3); - - - UChar uchs[BUF_SIZE+1]; - int32_t utcap = BUF_SIZE+1; - - int32_t ulen = icu_toUChars(str_pool,str_start[pop_lit3],str_length,uchs, utcap); - sp_length = ulen; - + sp_length = ulen; if (pop_lit1 >= (Integer_T) sp_length) BEGIN if ((pop_lit2 == 1) || (pop_lit2 == -1)) @@ -2188,7 +2070,6 @@ BEGIN || (pop_lit2 > (Integer_T) sp_length) || (pop_lit2 < -(Integer_T) sp_length)) BEGIN - push_lit_stk (s_null, STK_STR); goto Exit_Label; END @@ -2215,17 +2096,11 @@ BEGIN END sp_ptr = str_start[pop_lit3] + (pop_lit2 - 1); sp_end = sp_ptr + pop_lit1; - - - frUchCap = BUF_SIZE + 1; - lenfrUch = icu_fromUChars(frUch1, frUchCap, &uchs[pop_lit2-1], pop_lit1); - - - ptrfrUch = icu_fromUChars(frUch2, frUchCap, uchs, pop_lit2-1); - sp_ptr = str_start[pop_lit3] + ptrfrUch; - sp_end = sp_ptr + lenfrUch; - - + frUchCap = BUF_SIZE + 1; + lenfrUch = icu_fromUChars(frUch1, frUchCap, &uchs[pop_lit2-1], pop_lit1); + ptrfrUch = icu_fromUChars(frUch2, frUchCap, uchs, pop_lit2-1); + sp_ptr = str_start[pop_lit3] + ptrfrUch; + sp_end = sp_ptr + lenfrUch; if (pop_lit2 == 1) BEGIN if (pop_lit3 >= cmd_str_ptr) @@ -2252,29 +2127,20 @@ BEGIN END sp_end = str_start[pop_lit3 + 1] - (pop_lit2 - 1); sp_ptr = sp_end - pop_lit1; - - - frUchCap = BUF_SIZE + 1; - lenfrUch = icu_fromUChars(frUch1, frUchCap, &uchs[ulen - (pop_lit2-1) - pop_lit1], pop_lit1); - - - ptrfrUch = icu_fromUChars(frUch2, frUchCap, &uchs[ulen - pop_lit2], pop_lit2-1); - sp_ptr = str_start[pop_lit3] + ptrfrUch; - - sp_end = str_start[pop_lit3 + 1] - ptrfrUch; - sp_ptr = sp_end - lenfrUch; - - + frUchCap = BUF_SIZE + 1; + lenfrUch = icu_fromUChars(frUch1, frUchCap, &uchs[ulen - (pop_lit2-1) - pop_lit1], pop_lit1); + ptrfrUch = icu_fromUChars(frUch2, frUchCap, &uchs[ulen - pop_lit2], pop_lit2-1); + sp_ptr = str_start[pop_lit3] + ptrfrUch; + sp_end = str_start[pop_lit3 + 1] - ptrfrUch; + sp_ptr = sp_end - lenfrUch; END - STR_ROOM (sp_end - sp_ptr); while (sp_ptr < sp_end) BEGIN APPEND_CHAR (str_pool[sp_ptr]); INCR (sp_ptr); END - - push_lit_stk (make_string(), STK_STR); + push_lit_stk (make_string (), STK_STR); END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 438 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ @@ -2283,101 +2149,6 @@ Exit_Label: DO_NOTHING; END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 437 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ -/* -Here is the original code of "x_substring". We just reserver ot but ont to use -it. 23/sep/2009 -*/ -void x_substring_uni (void) -BEGIN - - pop_lit_stk (&pop_lit1, &pop_typ1); - pop_lit_stk (&pop_lit2, &pop_typ2); - pop_lit_stk (&pop_lit3, &pop_typ3); - if (pop_typ1 != STK_INT) - BEGIN - print_wrong_stk_lit (pop_lit1, pop_typ1, STK_INT); - push_lit_stk (s_null, STK_STR); - END - else if (pop_typ2 != STK_INT) - BEGIN - print_wrong_stk_lit (pop_lit2, pop_typ2, STK_INT); - push_lit_stk (s_null, STK_STR); - END - else if (pop_typ3 != STK_STR) - BEGIN - print_wrong_stk_lit (pop_lit3, pop_typ3, STK_STR); - push_lit_stk (s_null, STK_STR); - END - else - BEGIN - sp_length = LENGTH (pop_lit3); - if (pop_lit1 >= (Integer_T) sp_length) - BEGIN - if ((pop_lit2 == 1) || (pop_lit2 == -1)) - BEGIN - REPUSH_STRING; - goto Exit_Label; - END - END - - if ((pop_lit1 <= 0) || (pop_lit2 == 0) - || (pop_lit2 > (Integer_T) sp_length) - || (pop_lit2 < -(Integer_T) sp_length)) - BEGIN - push_lit_stk (s_null, STK_STR); - goto Exit_Label; - END - else - -/*************************************************************************** - * WEB section number: 438 - * ~~~~~~~~~~~~~~~~~~~ - * This module finds the substring as described in the last section, - * and slides it into place in the string pool, if necessary. - ***************************************************************************/ - BEGIN - if (pop_lit2 > 0) - BEGIN - if (pop_lit1 > (sp_length - (pop_lit2 - 1))) - BEGIN - pop_lit1 = sp_length - (pop_lit2 - 1); - END - sp_ptr = str_start[pop_lit3] + (pop_lit2 - 1); - sp_end = sp_ptr + pop_lit1; - if (pop_lit2 == 1) - BEGIN - if (pop_lit3 >= cmd_str_ptr) - BEGIN - str_start[pop_lit3 + 1] = sp_end; - UNFLUSH_STRING; - INCR (lit_stk_ptr); - goto Exit_Label; - END - END - END - else - BEGIN - pop_lit2 = -pop_lit2; - if (pop_lit1 > (Integer_T) (sp_length - (pop_lit2 - 1))) - BEGIN - pop_lit1 = sp_length - (pop_lit2 - 1); - END - sp_end = str_start[pop_lit3 + 1] - (pop_lit2 - 1); - sp_ptr = sp_end - pop_lit1; - END - - while (sp_ptr < sp_end) - BEGIN - APPEND_CHAR (str_pool[sp_ptr]); - INCR (sp_ptr); - END - push_lit_stk (make_string (), STK_STR); - END -/*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 438 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ - - END -Exit_Label: DO_NOTHING; -END /*************************************************************************** @@ -2392,20 +2163,17 @@ BEGIN pop_lit_stk (&pop_lit2, &pop_typ2); if ((pop_typ1 != STK_STR) || (pop_lit1 < cmd_str_ptr)) BEGIN - push_lit_stk (pop_lit1, pop_typ1); if ((pop_typ2 == STK_STR) && (pop_lit2 >= cmd_str_ptr)) BEGIN UNFLUSH_STRING; END - push_lit_stk (pop_lit2, pop_typ2); + push_lit_stk (pop_lit2, pop_typ2); END else if ((pop_typ2 != STK_STR) || (pop_lit2 < cmd_str_ptr)) BEGIN UNFLUSH_STRING; - push_lit_stk (pop_lit1, STK_STR); - push_lit_stk (pop_lit2, pop_typ2); END else @@ -2426,11 +2194,8 @@ BEGIN APPEND_CHAR (str_pool[sp_ptr]); INCR (sp_ptr); END - push_lit_stk (make_string (), STK_STR); - add_pool_buf_and_push (); - END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 440 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ @@ -2453,14 +2218,9 @@ END void x_text_length (void) BEGIN pop_lit_stk (&pop_lit1, &pop_typ1); - - - - if (pop_typ1 != STK_STR) BEGIN print_wrong_stk_lit (pop_lit1, pop_typ1, STK_STR); - push_lit_stk (s_null, STK_STR); END else @@ -2481,7 +2241,6 @@ BEGIN sp_brace_level = 0; while (sp_ptr < sp_end) BEGIN - INCR (sp_ptr); if (str_pool[sp_ptr - 1] == LEFT_BRACE) BEGIN @@ -2534,7 +2293,6 @@ The length of character of UTF-8 is different. 23/sep/2009 printf("this isn't a right UTF-8 char!\n"); END INCR (num_text_chars); - END END END @@ -2578,11 +2336,10 @@ The same for the length of character. 23/sep/2009 END INCR (num_text_chars); END - END END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 442 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ - + push_lit_stk (num_text_chars, STK_INT); END END @@ -2609,27 +2366,20 @@ END ***************************************************************************/ void x_text_prefix (void) BEGIN - pop_lit_stk (&pop_lit1, &pop_typ1); pop_lit_stk (&pop_lit2, &pop_typ2); - - - if (pop_typ1 != STK_INT) BEGIN print_wrong_stk_lit (pop_lit1, pop_typ1, STK_INT); - push_lit_stk (s_null, STK_STR); END else if (pop_typ2 != STK_STR) BEGIN print_wrong_stk_lit (pop_lit2, pop_typ2, STK_STR); - push_lit_stk (s_null, STK_STR); END else if (pop_lit1 <= 0) BEGIN - push_lit_stk (s_null, STK_STR); goto Exit_Label; END @@ -2645,7 +2395,6 @@ BEGIN sp_ptr = str_start[pop_lit2]; sp_end = str_start[pop_lit2 + 1]; - /*************************************************************************** * WEB section number: 445 * ~~~~~~~~~~~~~~~~~~~ @@ -2778,7 +2527,6 @@ The same for the length of character UTF-8. 23/sep/2009 APPEND_CHAR (RIGHT_BRACE); DECR (sp_brace_level); END - push_lit_stk (make_string (), STK_STR); END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 444 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ @@ -2805,12 +2553,10 @@ BEGIN else if ((type_list[cite_ptr] == UNDEFINED) || (type_list[cite_ptr] == EMPTY)) BEGIN - push_lit_stk (s_null, STK_STR); END else BEGIN - push_lit_stk (hash_text[type_list[cite_ptr]], STK_STR); END END @@ -2863,7 +2609,6 @@ BEGIN if (pop_typ1 != STK_STR) BEGIN print_wrong_stk_lit (pop_lit1, pop_typ1, STK_STR); - push_lit_stk (0, STK_INT); END else @@ -3008,7 +2753,7 @@ BEGIN check_brace_level (pop_lit1); END /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 451 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ - + push_lit_stk (string_width, STK_INT); END END diff --git a/Build/source/texk/bibtexu/bibtex.c b/Build/source/texk/bibtexu/bibtex.c index d24eab1cb09..2b09ecb93c9 100644 --- a/Build/source/texk/bibtexu/bibtex.c +++ b/Build/source/texk/bibtexu/bibtex.c @@ -206,7 +206,6 @@ BEGIN return (FALSE); END END - /*^^^^^^^^^^^^^^^^^^^^^^^^^^ END OF SECTION 47 ^^^^^^^^^^^^^^^^^^^^^^^^^^^*/ @@ -236,7 +235,6 @@ END ***************************************************************************/ int main (int argc, char **argv) BEGIN - extern Integer8_T history; int exit_status; diff --git a/Build/source/texk/bibtexu/bibtex.h b/Build/source/texk/bibtexu/bibtex.h index adc513ad6dd..9c9b1854d10 100644 --- a/Build/source/texk/bibtexu/bibtex.h +++ b/Build/source/texk/bibtexu/bibtex.h @@ -463,7 +463,7 @@ * of |pool_ptr| is too high; this test is supposed to be made before * |append_char| is used. ***************************************************************************/ -#define APPEND_CHAR(X) { str_pool[pool_ptr] = (X);\ +#define APPEND_CHAR(X) {str_pool[pool_ptr] = (X);\ INCR(pool_ptr);} #define STR_ROOM(X) {while((pool_ptr+(X))>Pool_Size)\ pool_overflow();} diff --git a/Build/source/texk/bibtexu/gblprocs.h b/Build/source/texk/bibtexu/gblprocs.h index f2fc4a22c93..8844b936273 100644 --- a/Build/source/texk/bibtexu/gblprocs.h +++ b/Build/source/texk/bibtexu/gblprocs.h @@ -96,18 +96,24 @@ #include "unicode/ustdio.h" #include "unicode/ucnv.h" #include "unicode/ucol.h" -int32_t icu_toUChars(BufType_T buf, BufPointer_T bf_ptr,BufPointer_T len,UChar * target, int32_t tarcap); -int32_t icu_strToLower(UChar * tarlow, int32_t tlcap, UChar * target, int32_t tarlen); -int32_t icu_fromUChars(unsigned char * dest, int32_t destcap, const UChar * src, int32_t srclen); -void x_substring_uni (void); +int32_t icu_toUChars (BufType_T buf, + BufPointer_T bf_ptr, + BufPointer_T len, + UChar * target, + int32_t tarcap); +int32_t icu_strToLower (UChar * tarlow, + int32_t tlcap, + UChar * target, + int32_t tarlen); +int32_t icu_fromUChars (unsigned char * dest, + int32_t destcap, + const UChar * src, + int32_t srclen); void a_close (const AlphaFile_T file_pointer); -//void u_file_close (const UFILE * u_file_pointer); Boolean_T a_open_in (AlphaFile_T *file_pointer, Integer_T search_path); -//Boolean_T u_file_open_in (UFILE *u_file_pointer, Integer_T search_path); Boolean_T a_open_out (AlphaFile_T *file_pointer); -//Boolean_T u_file_open_out (UFILE *u_file_pointer); void add_buf_pool (StrNumber_T pstr); void add_database_cite (CiteNumber_T *newcite); void add_extension (StrNumber_T ext); @@ -183,7 +189,6 @@ void eat_bst_print (void); Boolean_T eat_bst_white_space (void); Boolean_T enough_text_chars (BufPointer_T enoughchars); Boolean_T eoln (const AlphaFile_T file_pointer); -//Boolean_T u_eoln (const UFILE * u_file_pointer); void execute_fn (HashLoc_T exfnloc); void figure_out_the_formatted_name (void); @@ -201,8 +206,6 @@ void illegl_literal_confusion (void); void init_command_execution (void); void initialize (void); Boolean_T input_ln (AlphaFile_T f); -//Boolean_T input_u_ln (UFILE *u_f); - void int_to_ASCII (Integer_T inte, BufType_T int_buf, BufPointer_T int_begin, @@ -211,12 +214,12 @@ void int_to_ASCII (Integer_T inte, void last_check_for_aux_errors (void); Boolean_T less_than (CiteNumber_T arg1, CiteNumber_T arg2); -Boolean_T less_than_uni (CiteNumber_T arg1, CiteNumber_T arg2); - -void lower_case (BufType_T buf, +void lower_case (BufType_T buf, + BufPointer_T bf_ptr, + BufPointer_T len); +BufPointer_T lower_case_uni (BufType_T buf, BufPointer_T bf_ptr, BufPointer_T len); -BufPointer_T lower_case_uni (BufType_T buf, BufPointer_T bf_ptr,BufPointer_T len); void macro_warn_print (void); StrNumber_T make_string (void); @@ -318,10 +321,13 @@ void unknwn_literal_confusion (void); void upper_case (BufType_T buf, BufPointer_T bf_ptr, BufPointer_T len); - -BufPointer_T upper_case_uni (BufType_T buf, BufPointer_T bf_ptr, - BufPointer_T len); -int32_t icu_strToUpper(UChar * tarup, int32_t tucap, UChar * target, int32_t tarlen); +BufPointer_T upper_case_uni (BufType_T buf, + BufPointer_T bf_ptr, + BufPointer_T len); +int32_t icu_strToUpper (UChar * tarup, + int32_t tucap, + UChar * target, + int32_t tarlen); void von_name_ends_and_last_name_sta (void); Boolean_T von_token_found (void); diff --git a/Build/source/texk/bibtexu/gblvars.h b/Build/source/texk/bibtexu/gblvars.h index 353460a1ff5..af57b80726f 100644 --- a/Build/source/texk/bibtexu/gblvars.h +++ b/Build/source/texk/bibtexu/gblvars.h @@ -422,10 +422,10 @@ __EXTERN__ HashPtr2_T *wiz_functions; ** Variables used to record the results of the command line parsing. **---------------------------------------------------------------------------- */ -__EXTERN__ Boolean_T Flag_language; -__EXTERN__ char *Str_language; -__EXTERN__ Boolean_T Flag_location; -__EXTERN__ char *Str_location; +__EXTERN__ Boolean_T Flag_language; +__EXTERN__ char *Str_language; +__EXTERN__ Boolean_T Flag_location; +__EXTERN__ char *Str_location; __EXTERN__ Boolean_T Flag_7bit; __EXTERN__ Boolean_T Flag_8bit; diff --git a/Build/source/texk/bibtexu/utils.c b/Build/source/texk/bibtexu/utils.c index 675d3c38546..bed9119390f 100644 --- a/Build/source/texk/bibtexu/utils.c +++ b/Build/source/texk/bibtexu/utils.c @@ -532,15 +532,7 @@ void close_file (const AlphaFile_T file_pointer) fclose (file_pointer); } /* close_file() */ -/* -*/ -/*void close_u_file (const UFILE * u_file_pointer) -{ - if (u_file_pointer != NULL) - u_fclose (u_file_pointer); -} -*/ /*- **============================================================================ @@ -896,6 +888,7 @@ not_ok: } /* open_ip_file() */ + /*- **============================================================================ ** open_op_file() @@ -944,7 +937,6 @@ FILE *open_op_file (void) - /*- **============================================================================ ** parse_cmd_line() @@ -998,10 +990,10 @@ void parse_cmd_line (int argc, char **argv) /* For the input of the option language and location. 23/sep/2009 */ - Flag_language = FALSE; - Str_language = NULL; - Flag_location = FALSE; - Str_location = NULL; + Flag_language = FALSE; + Str_language = NULL; + Flag_location = FALSE; + Str_location = NULL; while (1) { int option_index = 0; @@ -1011,10 +1003,7 @@ For the input of the option language and location. 23/sep/2009 if (c == EOF) break; - switch (c) { - - case '?': /**************** -?, --help ***************/ usage (NULL); break; diff --git a/Build/source/texk/bibtexu/utils.h b/Build/source/texk/bibtexu/utils.h index c36e8170c13..0f6ab6d6978 100644 --- a/Build/source/texk/bibtexu/utils.h +++ b/Build/source/texk/bibtexu/utils.h @@ -108,7 +108,6 @@ ** Declaration of public functions defined in utils.c */ void close_file (const AlphaFile_T file_pointer); -//void close_u_file (const UFILE * u_file_pointer); void CDECL debug_msg (const int status, const char *printf_fmt, ...); #ifndef KPATHSEA int find_file (const char *envvar, @@ -116,9 +115,7 @@ int find_file (const char *envvar, const char *filename, char *full_file_spec); #endif FILE *open_ip_file (Integer_T search_path); -//UFILE *open_ip_u_file (Integer_T search_path); FILE *open_op_file (void); -//UFILE *open_op_u_file (void); void *mymalloc (const unsigned long bytes_required, const char *var_name); void *myrealloc (void *old_ptr, const unsigned long bytes_required, |