summaryrefslogtreecommitdiff
path: root/Build/source/texk/makeindexk/scanid.h
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2021-02-25 19:22:25 +0000
committerKarl Berry <karl@freefriends.org>2021-02-25 19:22:25 +0000
commitad547a6b5986815fda458221149728d9d9ab1d87 (patch)
tree16296910eb3eca724371474ea9aea3994dc69614 /Build/source/texk/makeindexk/scanid.h
parent947b43de3dd21d58ccc2ffadefc4441ea1c2a813 (diff)
restore Build,TODO from r57911
git-svn-id: svn://tug.org/texlive/trunk@57915 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/makeindexk/scanid.h')
-rw-r--r--Build/source/texk/makeindexk/scanid.h146
1 files changed, 146 insertions, 0 deletions
diff --git a/Build/source/texk/makeindexk/scanid.h b/Build/source/texk/makeindexk/scanid.h
new file mode 100644
index 00000000000..781ae3f709e
--- /dev/null
+++ b/Build/source/texk/makeindexk/scanid.h
@@ -0,0 +1,146 @@
+/*
+ *
+ * This file is part of
+ * MakeIndex - A formatter and format independent index processor
+ *
+ * Copyright (C) 1998-2011 by the TeX Live project.
+ * Copyright (C) 1989 by Chen & Harrison International Systems, Inc.
+ * Copyright (C) 1988 by Olivetti Research Center
+ * Copyright (C) 1987 by Regents of the University of California
+ *
+ * Author:
+ * Pehong Chen
+ * Chen & Harrison International Systems, Inc.
+ * Palo Alto, California
+ * USA
+ *
+ * Contributors:
+ * Please refer to the CONTRIB file that comes with this release
+ * for a list of people who have contributed to this and/or previous
+ * release(s) of MakeIndex.
+ *
+ * All rights reserved by the copyright holders. See the copyright
+ * notice distributed with this software for a complete description of
+ * the conditions under which it is made available.
+ *
+ */
+
+#define IS_COMPOSITOR (strncmp(&no[i], page_comp, comp_len) == 0)
+
+#define ROMAN_I 'I'
+#define ROMAN_V 'V'
+#define ROMAN_X 'X'
+#define ROMAN_L 'L'
+#define ROMAN_C 'C'
+#define ROMAN_D 'D'
+#define ROMAN_M 'M'
+
+#define ROMAN_i 'i'
+#define ROMAN_v 'v'
+#define ROMAN_x 'x'
+#define ROMAN_l 'l'
+#define ROMAN_c 'c'
+#define ROMAN_d 'd'
+#define ROMAN_m 'm'
+
+#define VAL_I 1
+#define VAL_V 5
+#define VAL_X 10
+#define VAL_L 50
+#define VAL_C 100
+#define VAL_D 500
+#define VAL_M 1000
+
+#define ROMAN_LOWER_VAL(C) \
+ ((C == ROMAN_i) ? VAL_I : \
+ (C == ROMAN_v) ? VAL_V : \
+ (C == ROMAN_x) ? VAL_X : \
+ (C == ROMAN_l) ? VAL_L : \
+ (C == ROMAN_c) ? VAL_C : \
+ (C == ROMAN_d) ? VAL_D : \
+ (C == ROMAN_m) ? VAL_M : 0)
+
+#define ROMAN_UPPER_VAL(C) \
+ ((C == ROMAN_I) ? VAL_I : \
+ (C == ROMAN_V) ? VAL_V : \
+ (C == ROMAN_X) ? VAL_X : \
+ (C == ROMAN_L) ? VAL_L : \
+ (C == ROMAN_C) ? VAL_C : \
+ (C == ROMAN_D) ? VAL_D : \
+ (C == ROMAN_M) ? VAL_M : 0)
+
+#define IS_ROMAN_LOWER(C) \
+ ((C == ROMAN_i) || (C == ROMAN_v) || (C == ROMAN_x) || \
+ (C == ROMAN_l) || (C == ROMAN_c) || (C == ROMAN_d) || (C == ROMAN_m))
+
+#define IS_ROMAN_UPPER(C) \
+ ((C == ROMAN_I) || (C == ROMAN_V) || (C == ROMAN_X) || \
+ (C == ROMAN_L) || (C == ROMAN_C) || (C == ROMAN_D) || (C == ROMAN_M))
+
+#define ALPHA_VAL(C) \
+ ((('A' <= C) && (C <= 'Z')) ? C - 'A' : \
+ (('a' <= C) && (C <= 'z')) ? C - 'a' : 0)
+
+#define IS_ALPHA_LOWER(C) \
+ (('a' <= C) && (C <= 'z'))
+
+#define IS_ALPHA_UPPER(C) \
+ (('A' <= C) && (C <= 'Z'))
+
+#define IDX_SKIPLINE { \
+ int tmp; \
+ while ((tmp = GET_CHAR(idx_fp)) != LFD) \
+ if (tmp == EOF) \
+ break; \
+ idx_lc++; \
+ arg_count = -1; \
+}
+
+#define NULL_RTN { \
+ IDX_ERROR("Illegal null field.\n"); \
+ return (FALSE); \
+}
+
+#define IDX_ERROR(F) { \
+ if (idx_dot) { \
+ fprintf(ilg_fp, "\n"); \
+ idx_dot = FALSE; \
+ } \
+ fprintf(ilg_fp, "!! Input index error (file = %s, line = %d):\n -- ", \
+ idx_fn, idx_lc); \
+ fprintf(ilg_fp, F); \
+ idx_ec++; \
+}
+
+#define IDX_ERROR1(F, D) { \
+ if (idx_dot) { \
+ fprintf(ilg_fp, "\n"); \
+ idx_dot = FALSE; \
+ } \
+ fprintf(ilg_fp, "!! Input index error (file = %s, line = %d):\n -- ", \
+ idx_fn, idx_lc); \
+ fprintf(ilg_fp, F, D); \
+ idx_ec++; \
+}
+
+#define IDX_ERROR2(F, D1, D2) { \
+ if (idx_dot) { \
+ fprintf(ilg_fp, "\n"); \
+ idx_dot = FALSE; \
+ } \
+ fprintf(ilg_fp, "!! Input index error (file = %s, line = %d):\n -- ", \
+ idx_fn, idx_lc); \
+ fprintf(ilg_fp, F, D1, D2); \
+ idx_ec++; \
+}
+
+
+#define ENTER(V) { \
+ if (*count >= PAGEFIELD_MAX) { \
+ IDX_ERROR2("Page number %s has too many fields (max. %d).", \
+ no, PAGEFIELD_MAX); \
+ return (FALSE); \
+ } \
+ npg[*count] = (V); \
+ ++*count; \
+}