From 6ad0455831e59c9ae7d91b8e9a7b73192d3037f5 Mon Sep 17 00:00:00 2001 From: Takuji Tanaka Date: Sat, 4 Sep 2021 01:52:20 +0000 Subject: upmendex: v0.59, support output order of symbols and numbers separately git-svn-id: svn://tug.org/texlive/trunk@60418 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/upmendex/fwrite.c | 53 ++++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 22 deletions(-) (limited to 'Build/source/texk/upmendex/fwrite.c') diff --git a/Build/source/texk/upmendex/fwrite.c b/Build/source/texk/upmendex/fwrite.c index a5efc14f5d4..911bbef4add 100644 --- a/Build/source/texk/upmendex/fwrite.c +++ b/Build/source/texk/upmendex/fwrite.c @@ -175,6 +175,23 @@ void indwrite(char *filename, struct index *ind, int pagenum) perr=U_ZERO_ERROR; unormalizer_NFD=unorm2_getInstance(NULL, "nfc", UNORM2_DECOMPOSE, &perr); + if (strlen(symhead)==0) { + if (lethead_flag>0) { + strcpy(symhead, symhead_positive); + } + else if (lethead_flag<0) { + strcpy(symhead, symhead_negative); + } + } + { + if (lethead_flag>0) { + strcpy(numhead, numhead_positive); + } + else if (lethead_flag<0) { + strcpy(numhead, numhead_negative); + } + } + for (i=line_length=0;i0) { - fprintf(fp,"%s%s%s",lethead_prefix,symhead_positive,lethead_suffix); - } - else if (lethead_flag<0) { - fprintf(fp,"%s%s%s",lethead_prefix,symhead_negative,lethead_suffix); - } + if (lethead_flag!=0 && symbol_flag==2 && chset==CH_NUMERIC) { + fprintf(fp,"%s%s%s",lethead_prefix,numhead,lethead_suffix); + } + if (lethead_flag!=0 && (symbol_flag==1 || (symbol_flag==2 && chset!=CH_NUMERIC))) { + fprintf(fp,"%s%s%s",lethead_prefix,symhead,lethead_suffix); } widechar_to_multibyte(obuff,BUFFERLEN,ind[i].idx[0]); SPRINTF(lbuff,"%s%s",item_0,obuff); @@ -398,18 +410,15 @@ void indwrite(char *filename, struct index *ind, int pagenum) } } else { - if (CH_LATIN<=chset_prev&&chset_prev<=CH_THAI){ - fputs(group_skip,fp); - if (lethead_flag!=0 && symbol_flag) { - if (strlen(symbol)) { - fprintf(fp,"%s%s%s",lethead_prefix,symbol,lethead_suffix); - } - else if (lethead_flag>0) { - fprintf(fp,"%s%s%s",lethead_prefix,symhead_positive,lethead_suffix); - } - else if (lethead_flag<0) { - fprintf(fp,"%s%s%s",lethead_prefix,symhead_negative,lethead_suffix); - } + if (chset_prev!=chset) { + if ((CH_LATIN<=chset_prev&&chset_prev<=CH_THAI) || symbol_flag==2) + fputs(group_skip,fp); + if (lethead_flag!=0 && symbol_flag==2 && chset==CH_NUMERIC) { + fprintf(fp,"%s%s%s",lethead_prefix,numhead,lethead_suffix); + } + if (lethead_flag!=0 && (symbol_flag==1 && (CH_LATIN<=chset_prev&&chset_prev<=CH_THAI) || + symbol_flag==2 && chset!=CH_NUMERIC) ) { + fprintf(fp,"%s%s%s",lethead_prefix,symhead,lethead_suffix); } } } -- cgit v1.2.3