texlive[60417] Build/source/texk/mendexk: mendex: v3.6, support

commits+takuji at tug.org commits+takuji at tug.org
Sat Sep 4 03:30:39 CEST 2021


Revision: 60417
          http://tug.org/svn/texlive?view=revision&revision=60417
Author:   takuji
Date:     2021-09-04 03:30:39 +0200 (Sat, 04 Sep 2021)
Log Message:
-----------
mendex: v3.6, support output order of symbols and numbers separately

Modified Paths:
--------------
    trunk/Build/source/texk/mendexk/ChangeLog
    trunk/Build/source/texk/mendexk/configure
    trunk/Build/source/texk/mendexk/configure.ac
    trunk/Build/source/texk/mendexk/exvar.h
    trunk/Build/source/texk/mendexk/fwrite.c
    trunk/Build/source/texk/mendexk/mendex.h
    trunk/Build/source/texk/mendexk/sort.c
    trunk/Build/source/texk/mendexk/styfile.c
    trunk/Build/source/texk/mendexk/var.h
    trunk/Build/source/texk/mendexk/version.h

Modified: trunk/Build/source/texk/mendexk/ChangeLog
===================================================================
--- trunk/Build/source/texk/mendexk/ChangeLog	2021-09-03 23:49:11 UTC (rev 60416)
+++ trunk/Build/source/texk/mendexk/ChangeLog	2021-09-04 01:30:39 UTC (rev 60417)
@@ -1,3 +1,11 @@
+2021-09-04  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
+
+	* configure.ac, version.h:
+	Version 3.6 [6-Jun-2021].
+	* styfile.c, sort.c, fwrite.c, mendex.h, {,ex}var.h:
+	Support output order of symbols and numbers separately
+	when "symbol_flag" is 2 in style file.
+
 2021-08-29  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* sort.c:

Modified: trunk/Build/source/texk/mendexk/configure
===================================================================
--- trunk/Build/source/texk/mendexk/configure	2021-09-03 23:49:11 UTC (rev 60416)
+++ trunk/Build/source/texk/mendexk/configure	2021-09-04 01:30:39 UTC (rev 60417)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.71 for mendex (TeX Live) 3.5.
+# Generated by GNU Autoconf 2.71 for mendex (TeX Live) 3.6.
 #
 #
 # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation,
@@ -626,8 +626,8 @@
 # Identity of this package.
 PACKAGE_NAME='mendex (TeX Live)'
 PACKAGE_TARNAME='mendex--tex-live-'
-PACKAGE_VERSION='3.5'
-PACKAGE_STRING='mendex (TeX Live) 3.5'
+PACKAGE_VERSION='3.6'
+PACKAGE_STRING='mendex (TeX Live) 3.6'
 PACKAGE_BUGREPORT=''
 PACKAGE_URL=''
 
@@ -1374,7 +1374,7 @@
   # 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 mendex (TeX Live) 3.5 to adapt to many kinds of systems.
+\`configure' configures mendex (TeX Live) 3.6 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1446,7 +1446,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of mendex (TeX Live) 3.5:";;
+     short | recursive ) echo "Configuration of mendex (TeX Live) 3.6:";;
    esac
   cat <<\_ACEOF
 
@@ -1567,7 +1567,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-mendex (TeX Live) configure 3.5
+mendex (TeX Live) configure 3.6
 generated by GNU Autoconf 2.71
 
 Copyright (C) 2021 Free Software Foundation, Inc.
@@ -2091,7 +2091,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by mendex (TeX Live) $as_me 3.5, which was
+It was created by mendex (TeX Live) $as_me 3.6, which was
 generated by GNU Autoconf 2.71.  Invocation command line was
 
   $ $0$ac_configure_args_raw
@@ -8413,7 +8413,7 @@
 
 # Define the identity of the package.
  PACKAGE='mendex--tex-live-'
- VERSION='3.5'
+ VERSION='3.6'
 
 
 # Some tools Automake needs.
@@ -14563,7 +14563,7 @@
 Report bugs to <bug-libtool at gnu.org>."
 
 lt_cl_version="\
-mendex (TeX Live) config.lt 3.5
+mendex (TeX Live) config.lt 3.6
 configured by $0, generated by GNU Autoconf 2.71.
 
 Copyright (C) 2011 Free Software Foundation, Inc.
@@ -16181,7 +16181,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by mendex (TeX Live) $as_me 3.5, which was
+This file was extended by mendex (TeX Live) $as_me 3.6, which was
 generated by GNU Autoconf 2.71.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -16249,7 +16249,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config='$ac_cs_config_escaped'
 ac_cs_version="\\
-mendex (TeX Live) config.status 3.5
+mendex (TeX Live) config.status 3.6
 configured by $0, generated by GNU Autoconf 2.71,
   with options \\"\$ac_cs_config\\"
 

Modified: trunk/Build/source/texk/mendexk/configure.ac
===================================================================
--- trunk/Build/source/texk/mendexk/configure.ac	2021-09-03 23:49:11 UTC (rev 60416)
+++ trunk/Build/source/texk/mendexk/configure.ac	2021-09-04 01:30:39 UTC (rev 60417)
@@ -8,8 +8,8 @@
 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([mendex (TeX Live)], [3.5])
-AC_PREREQ([2.63])
+AC_INIT([mendex (TeX Live)], [3.6])
+AC_PREREQ([2.71])
 AC_CONFIG_SRCDIR([main.c])
 AC_CONFIG_AUX_DIR([../../build-aux])
 AC_CONFIG_MACRO_DIR([../../m4])

Modified: trunk/Build/source/texk/mendexk/exvar.h
===================================================================
--- trunk/Build/source/texk/mendexk/exvar.h	2021-09-03 23:49:11 UTC (rev 60416)
+++ trunk/Build/source/texk/mendexk/exvar.h	2021-09-04 01:30:39 UTC (rev 60417)
@@ -26,7 +26,7 @@
 extern char indent_space[];
 extern int indent_length;
 extern int priority;
-extern char symbol[];
+extern char symhead[],numhead[];
 extern char symhead_positive[],symhead_negative[];
 extern char numhead_positive[],numhead_negative[];
 extern int symbol_flag;

Modified: trunk/Build/source/texk/mendexk/fwrite.c
===================================================================
--- trunk/Build/source/texk/mendexk/fwrite.c	2021-09-03 23:49:11 UTC (rev 60416)
+++ trunk/Build/source/texk/mendexk/fwrite.c	2021-09-04 01:30:39 UTC (rev 60417)
@@ -123,6 +123,7 @@
 	char datama[2048],lbuff[BUFFERLEN];
 	FILE *fp=NULL;
 	int conv_euc_to_euc;
+	char *init, *init_prev;
 
 	if (filename && kpse_out_name_ok(filename))
 		fp=fopen(filename,"wb");
@@ -143,36 +144,40 @@
 		fprintf(fp,"%s%d%s",setpage_prefix,pagenum,setpage_suffix);
 	}
 
+	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++) {
+		init = ind[i].dic[0];
 		if (i==0) {
-			if (!((alphabet(ind[i].dic[0][0]))||(japanese(ind[i].dic[0])))) {
-				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);
-					}
-				}
-				SPRINTF(lbuff,"%s%s",item_0,ind[i].idx[0]);
-			}
-			else if (alphabet(ind[i].dic[0][0])) {
+			if (alphabet(init)) {
 				if (lethead_flag>0) {
-					fprintf(fp,"%s%c%s",lethead_prefix,ind[i].dic[0][0],lethead_suffix);
+					fprintf(fp,"%s%c%s",lethead_prefix,init[0],lethead_suffix);
 				}
 				else if (lethead_flag<0) {
-					fprintf(fp,"%s%c%s",lethead_prefix,ind[i].dic[0][0]+32,lethead_suffix);
+					fprintf(fp,"%s%c%s",lethead_prefix,init[0]+32,lethead_suffix);
 				}
 				SPRINTF(lbuff,"%s%s",item_0,ind[i].idx[0]);
 			}
-			else if (japanese(ind[i].dic[0])) {
+			else if (japanese(init)) {
 				if (lethead_flag) {
 					fputs(lethead_prefix,fp);
 					for (j=hpoint;j<(strlen(datama)/2);j++) {
-						if ((unsigned char)ind[i].dic[0][1]<(unsigned char)datama[j*2+1]) {
+						if ((unsigned char)init[1]<(unsigned char)datama[j*2+1]) {
 							fprint_euc_char(fp,atama[(j-1)*2],atama[(j-1)*2+1]);
 							hpoint=j;
 							break;
@@ -185,11 +190,20 @@
 				}
 				SPRINTF(lbuff,"%s%s",item_0,ind[i].idx[0]);
 				for (hpoint=0;hpoint<(strlen(datama)/2);hpoint++) {
-					if ((unsigned char)ind[i].dic[0][1]<(unsigned char)datama[hpoint*2+1]) {
+					if ((unsigned char)init[1]<(unsigned char)datama[hpoint*2+1]) {
 						break;
 					}
 				}
 			}
+			else {
+				if (lethead_flag!=0 && symbol_flag==2 && numeric(init)) {
+					fprintf(fp,"%s%s%s",lethead_prefix,numhead,lethead_suffix);
+				}
+				if (lethead_flag!=0 && (symbol_flag==1 || (symbol_flag==2 && !numeric(init)))) {
+					fprintf(fp,"%s%s%s",lethead_prefix,symhead,lethead_suffix);
+				}
+				SPRINTF(lbuff,"%s%s",item_0,ind[i].idx[0]);
+			}
 			switch (ind[i].words) {
 			case 1:
 				SAPPENDF(lbuff,"%s",delim_0);
@@ -215,36 +229,21 @@
 			printpage(ind,fp,i,lbuff);
 		}
 		else {
-			if (!((alphabet(ind[i].dic[0][0]))||(japanese(ind[i].dic[0])))) {
-				if ((alphabet(ind[i-1].dic[0][0]))||(japanese(ind[i-1].dic[0]))){
+			init_prev = ind[i-1].dic[0];
+			if (alphabet(init)) {
+				if (init[0]!=init_prev[0]) {
 					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);
-						}
-					}
-				}
-			}
-			else if (alphabet(ind[i].dic[0][0])) {
-				if (ind[i].dic[0][0]!=ind[i-1].dic[0][0]) {
-					fputs(group_skip,fp);
 					if (lethead_flag>0) {
-						fprintf(fp,"%s%c%s",lethead_prefix,ind[i].dic[0][0],lethead_suffix);
+						fprintf(fp,"%s%c%s",lethead_prefix,init[0],lethead_suffix);
 					}
 					else if (lethead_flag<0) {
-						fprintf(fp,"%s%c%s",lethead_prefix,ind[i].dic[0][0]+32,lethead_suffix);
+						fprintf(fp,"%s%c%s",lethead_prefix,init[0]+32,lethead_suffix);
 					}
 				}
 			}
-			else if (japanese(ind[i].dic[0])) {
+			else if (japanese(init)) {
 				for (j=hpoint;j<(strlen(datama)/2);j++) {
-					if ((unsigned char)(ind[i].dic[0][0]<=(unsigned char)datama[j*2])&&((unsigned char)ind[i].dic[0][1]<(unsigned char)datama[j*2+1])) {
+					if (((unsigned char)init[0]<=(unsigned char)datama[j*2])&&((unsigned char)init[1]<(unsigned char)datama[j*2+1])) {
 						break;
 					}
 				}
@@ -258,6 +257,20 @@
 					}
 				}
 			}
+			else {
+				if ( alphabet(init_prev) || japanese(init_prev) ||
+				    (!numeric(init_prev)&&numeric(init)) || (numeric(init_prev)&&!numeric(init)) ) {
+					if (alphabet(init_prev) || japanese(init_prev) || symbol_flag==2)
+						fputs(group_skip,fp);
+					if (lethead_flag!=0 && symbol_flag==2 && numeric(init)) {
+						fprintf(fp,"%s%s%s",lethead_prefix,numhead,lethead_suffix);
+					}
+					if (lethead_flag!=0 && (symbol_flag==1 && (alphabet(init_prev)||japanese(init_prev)) ||
+								symbol_flag==2 && !numeric(init)) ) {
+						fprintf(fp,"%s%s%s",lethead_prefix,symhead,lethead_suffix);
+					}
+				}
+			}
 
 			switch (ind[i].words) {
 			case 1:

Modified: trunk/Build/source/texk/mendexk/mendex.h
===================================================================
--- trunk/Build/source/texk/mendexk/mendex.h	2021-09-03 23:49:11 UTC (rev 60416)
+++ trunk/Build/source/texk/mendexk/mendex.h	2021-09-04 01:30:39 UTC (rev 60417)
@@ -39,9 +39,9 @@
 /* sort.c */
 void wsort(struct index *ind, int num);
 void pagesort(struct index *ind, int num);
-int alphanumeric(char c);
-int alphabet(char c);
-int numeric(char c);
+int alphanumeric(char *c);
+int alphabet(char *c);
+int numeric(char *c);
 int japanese(char *buff);
 int chkcontinue(struct page *p, int num);
 

Modified: trunk/Build/source/texk/mendexk/sort.c
===================================================================
--- trunk/Build/source/texk/mendexk/sort.c	2021-09-03 23:49:11 UTC (rev 60416)
+++ trunk/Build/source/texk/mendexk/sort.c	2021-09-04 01:30:39 UTC (rev 60417)
@@ -112,10 +112,10 @@
 				return 1;
 
 /*   symbol pattern   */
-			if ((!numeric((*index1).dic[j][i]))&&(numeric((*index2).dic[j][i])))
+			if ((!numeric(&(*index1).dic[j][i]))&&(numeric(&(*index2).dic[j][i])))
 				return -1;
 
-			if ((!numeric((*index2).dic[j][i]))&&(numeric((*index1).dic[j][i])))
+			if ((!numeric(&(*index2).dic[j][i]))&&(numeric(&(*index1).dic[j][i])))
 				return 1;
 
 /*   simple compare   */
@@ -211,8 +211,8 @@
 static int ordering(char *buff)
 {
 	if ((unsigned char)(*buff)<0x80) {
-		if (alphabet(*buff)) return alpha; 
-		else if (numeric(*buff)) return number; 
+		if (alphabet(buff)) return alpha;
+		else if (numeric(buff)) return number;
 		else return sym;
 	}
 	else {
@@ -221,22 +221,22 @@
 	}
 }
 
-int alphanumeric(char c)
+int alphanumeric(char *c)
 {
-	if (((c>='A')&&(c<='Z'))||((c>='a')&&(c<='z'))||((c>='0')&&(c<='9')))
+	if (((*c>='A')&&(*c<='Z'))||((*c>='a')&&(*c<='z'))||((*c>='0')&&(*c<='9')))
 		return 1;
 	else return 0;
 }
 
-int alphabet(char c)
+int alphabet(char *c)
 {
-	if (((c>='A')&&(c<='Z'))||((c>='a')&&(c<='z'))) return 1;
+	if (((*c>='A')&&(*c<='Z'))||((*c>='a')&&(*c<='z'))) return 1;
 	else return 0;
 }
 
-int numeric(char c)
+int numeric(char *c)
 {
-	if ((c>='0')&&(c<='9')) return 1;
+	if ((*c>='0')&&(*c<='9')) return 1;
 	else return 0;
 }
 

Modified: trunk/Build/source/texk/mendexk/styfile.c
===================================================================
--- trunk/Build/source/texk/mendexk/styfile.c	2021-09-03 23:49:11 UTC (rev 60416)
+++ trunk/Build/source/texk/mendexk/styfile.c	2021-09-04 01:30:39 UTC (rev 60417)
@@ -116,7 +116,7 @@
 			indent_length=atoi(&buff[cc]);
 			continue;
 		}
-		if (getparam(buff,"symbol",symbol)) continue;
+		if (getparam(buff,"symbol",symhead)) continue;
 		cc=scompare(buff,"symbol_flag");
 		if (cc!= -1) {
 			symbol_flag=atoi(&buff[cc]);

Modified: trunk/Build/source/texk/mendexk/var.h
===================================================================
--- trunk/Build/source/texk/mendexk/var.h	2021-09-03 23:49:11 UTC (rev 60416)
+++ trunk/Build/source/texk/mendexk/var.h	2021-09-04 01:30:39 UTC (rev 60417)
@@ -27,7 +27,7 @@
 char indent_space[STYBUFSIZE]={"\t\t"};
 int indent_length=16;
 int priority=0;
-char symbol[STYBUFSIZE]={""};
+char symhead[STYBUFSIZE]={""},numhead[STYBUFSIZE]={""};
 char symhead_positive[STYBUFSIZE]={"Symbols"},symhead_negative[STYBUFSIZE]={"symbols"};
 char numhead_positive[STYBUFSIZE]={"Numbers"},numhead_negative[STYBUFSIZE]={"numbers"};
 int symbol_flag=1;

Modified: trunk/Build/source/texk/mendexk/version.h
===================================================================
--- trunk/Build/source/texk/mendexk/version.h	2021-09-03 23:49:11 UTC (rev 60416)
+++ trunk/Build/source/texk/mendexk/version.h	2021-09-04 01:30:39 UTC (rev 60417)
@@ -1,2 +1,2 @@
-#define VERSION  "version " PACKAGE_VERSION " [29-Aug-2021]"
+#define VERSION  "version " PACKAGE_VERSION " [4-Sep-2021]"
 #define BUG_ADDRESS "issue at texjp.org"



More information about the tex-live-commits mailing list.