summaryrefslogtreecommitdiff
path: root/Build/source/texk/makeindexk/scanid.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/makeindexk/scanid.c')
-rw-r--r--Build/source/texk/makeindexk/scanid.c120
1 files changed, 21 insertions, 99 deletions
diff --git a/Build/source/texk/makeindexk/scanid.c b/Build/source/texk/makeindexk/scanid.c
index a55f71a03d9..3d84a199314 100644
--- a/Build/source/texk/makeindexk/scanid.c
+++ b/Build/source/texk/makeindexk/scanid.c
@@ -39,31 +39,28 @@ static int first_entry = TRUE;
static int comp_len;
static char key[ARGUMENT_MAX];
static char no[NUMBER_MAX];
-#ifndef WIN32
-extern char *strchr ARGS((const char* s,int c));
-#endif
NODE_PTR head;
NODE_PTR tail;
-static void flush_to_eol ARGS((void));
-static int make_key ARGS((void));
-static void make_string ARGS((char **ppstr,int n));
-static int scan_alpha_lower ARGS((char *no,int *npg,short *count));
-static int scan_alpha_upper ARGS((char *no,int *npg,short *count));
-static int scan_arabic ARGS((char *no,int *npg,short *count));
-static int scan_arg1 ARGS((void));
-static int scan_arg2 ARGS((void));
-static int scan_field ARGS((int *n,char field[],int len_field,
- int ck_level, int ck_encap,int ck_actual));
-static int scan_key ARGS((struct KFIELD *data));
-static int scan_no ARGS((char *no,int *npg,short *count,short *type));
-static int scan_roman_lower ARGS((char *no,int *npg,short *count));
-static int scan_roman_upper ARGS((char *no,int *npg,short *count));
-static void search_quote ARGS((char **sort_key,char **actual_key));
+static void flush_to_eol (void);
+static int make_key (void);
+static void make_string (char **ppstr,int n);
+static int scan_alpha_lower (char *no,int *npg,short *count);
+static int scan_alpha_upper (char *no,int *npg,short *count);
+static int scan_arabic (char *no,int *npg,short *count);
+static int scan_arg1 (void);
+static int scan_arg2 (void);
+static int scan_field (int *n,char field[],int len_field,
+ int ck_level, int ck_encap,int ck_actual);
+static int scan_key (struct KFIELD *data);
+static int scan_no (char *no,int *npg,short *count,short *type);
+static int scan_roman_lower (char *no,int *npg,short *count);
+static int scan_roman_upper (char *no,int *npg,short *count);
+static void search_quote (char **sort_key,char **actual_key);
void
-scan_idx(VOID_ARG)
+scan_idx(void)
{
char keyword[ARRAY_MAX];
int c;
@@ -161,7 +158,7 @@ IDX_ERROR1(
}
static void
-flush_to_eol(VOID_ARG)
+flush_to_eol(void)
{ /* flush to end-of-line, or end-of-file, whichever is first */
int a;
@@ -170,7 +167,7 @@ flush_to_eol(VOID_ARG)
}
static int
-make_key(VOID_ARG)
+make_key(void)
{
NODE_PTR ptr;
int i;
@@ -232,13 +229,7 @@ make_key(VOID_ARG)
}
static void
-#if STDC
make_string(char **ppstr, int n)
-#else
-make_string(ppstr,n) /* allocate n-byte string if *ppstr */
-char **ppstr; /* points to an empty string */
-int n;
-#endif
{
if (*ppstr) /* Do NOT leaking here, <werner@suse.de> */
free(*ppstr);
@@ -255,12 +246,7 @@ int n;
}
static int
-#if STDC
scan_key(FIELD_PTR data)
-#else
-scan_key(data)
-FIELD_PTR data;
-#endif
{
int i = 0; /* current level */
int n = 0; /* index to the key[] array */
@@ -339,18 +325,8 @@ FIELD_PTR data;
}
static int
-#if STDC
scan_field(int *n, char field[], int len_field, int ck_level, int ck_encap,
int ck_actual)
-#else
-scan_field(n, field, len_field, ck_level, ck_encap, ck_actual)
-int *n;
-char field[];
-int len_field; /* length of field[], EXCLUDING space for final NUL */
-int ck_level;
-int ck_encap;
-int ck_actual;
-#endif
{
int i = 0;
int nbsh; /* backslash count */
@@ -422,12 +398,7 @@ int ck_actual;
}
int
-#if STDC
group_type(char *str)
-#else
-group_type(str)
-char *str;
-#endif
{
int i = 0;
@@ -444,15 +415,7 @@ char *str;
}
static int
-#if STDC
scan_no(char no[], int npg[], short *count, short *type)
-#else
-scan_no(no, npg, count, type)
-char no[];
-int npg[];
-short *count;
-short *type;
-#endif
{
int i = 1;
@@ -488,14 +451,7 @@ short *type;
static int
-#if STDC
scan_arabic(char no[], int npg[], short *count)
-#else
-scan_arabic(no, npg, count)
-char no[];
-int npg[];
-short *count;
-#endif
{
short i = 0;
char str[ARABIC_MAX+1]; /* space for trailing NUL */
@@ -526,14 +482,7 @@ IDX_ERROR2("Illegal Arabic digit: position %d in %s.\n", i + 1, no);
static int
-#if STDC
scan_roman_lower(char no[], int npg[], short *count)
-#else
-scan_roman_lower(no, npg, count)
-char no[];
-int npg[];
-short *count;
-#endif
{
short i = 0;
int inp = 0;
@@ -576,14 +525,7 @@ IDX_ERROR2("Illegal Roman number: position %d in %s.\n", i + 1, no);
static int
-#if STDC
scan_roman_upper(char no[], int npg[], short *count)
-#else
-scan_roman_upper(no, npg, count)
-char no[];
-int npg[];
-short *count;
-#endif
{
short i = 0;
int inp = 0;
@@ -626,14 +568,7 @@ IDX_ERROR2("Illegal Roman number: position %d in %s.\n", i + 1, no);
static int
-#if STDC
scan_alpha_lower(char no[], int npg[], short *count)
-#else
-scan_alpha_lower(no, npg, count)
-char no[];
-int npg[];
-short *count;
-#endif
{
short i;
@@ -648,14 +583,7 @@ short *count;
static int
-#if STDC
scan_alpha_upper(char no[], int npg[], short *count)
-#else
-scan_alpha_upper(no, npg, count)
-char no[];
-int npg[];
-short *count;
-#endif
{
short i;
@@ -670,7 +598,7 @@ short *count;
static int
-scan_arg1(VOID_ARG)
+scan_arg1(void)
{
int i = 0;
int n = 0; /* delimiter count */
@@ -743,7 +671,7 @@ scan_arg1(VOID_ARG)
static int
-scan_arg2(VOID_ARG)
+scan_arg2(void)
{
int i = 0;
int a;
@@ -785,16 +713,10 @@ IDX_ERROR("Illegal space within numerals in second argument.\n");
static void
-#if STDC
search_quote(char **sort_key, char **actual_key)
-#else
-search_quote(sort_key, actual_key)
-char **sort_key;
-char **actual_key;
-#endif
{
char *ptr; /* pointer to sort_key */
- char *sort; /* contains sorting text */
+ const char *sort; /* contains sorting text */
int char_found = FALSE;
strcpy(*actual_key, *sort_key);