summaryrefslogtreecommitdiff
path: root/Build/source/texk/upmendex/fwrite.c
diff options
context:
space:
mode:
authorTakuji Tanaka <ttk@t-lab.opal.ne.jp>2021-09-04 01:52:20 +0000
committerTakuji Tanaka <ttk@t-lab.opal.ne.jp>2021-09-04 01:52:20 +0000
commit6ad0455831e59c9ae7d91b8e9a7b73192d3037f5 (patch)
tree82262e478e20ba5952dd44b55b895bfe218349d1 /Build/source/texk/upmendex/fwrite.c
parent51ceff662ff70282ed3f3e3ab0844910ed632418 (diff)
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
Diffstat (limited to 'Build/source/texk/upmendex/fwrite.c')
-rw-r--r--Build/source/texk/upmendex/fwrite.c53
1 files changed, 31 insertions, 22 deletions
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;i<lines;i++) {
index_normalize(ind[i].dic[0], initial, &chset);
if (i==0) {
@@ -280,16 +297,11 @@ void indwrite(char *filename, struct index *ind, int pagenum)
}
}
else {
- 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 (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);
}
}
}