Back to index

tetex-bin  3.0
scanst.h
Go to the documentation of this file.
00001 /*
00002  *
00003  *  This file is part of
00004  *     MakeIndex - A formatter and format independent index processor
00005  *
00006  *  Copyright (C) 1989 by Chen & Harrison International Systems, Inc.
00007  *  Copyright (C) 1988 by Olivetti Research Center
00008  *  Copyright (C) 1987 by Regents of the University of California
00009  *
00010  *  Author:
00011  *     Pehong Chen
00012  *     Chen & Harrison International Systems, Inc.
00013  *     Palo Alto, California
00014  *     USA
00015  *     (phc@renoir.berkeley.edu or chen@orc.olivetti.com)
00016  *
00017  *  Contributors:
00018  *     Please refer to the CONTRIB file that comes with this release
00019  *     for a list of people who have contributed to this and/or previous
00020  *     release(s) of MakeIndex.
00021  *
00022  *  All rights reserved by the copyright holders.  See the copyright
00023  *  notice distributed with this software for a complete description of
00024  *  the conditions under which it is made available.
00025  *
00026  */
00027 
00028 #define COMMENT   '%'
00029 #define STR_DELIM '"'
00030 #define CHR_DELIM '\''
00031 
00032 #define KEYWORD "keyword"
00033 #define AOPEN   "arg_open"
00034 #define ACLOSE  "arg_close"
00035 #define ROPEN   "range_open"
00036 #define RCLOSE  "range_close"
00037 #define LEVEL   "level"
00038 #define QUOTE   "quote"
00039 #define ACTUAL  "actual"
00040 #define ENCAP   "encap"
00041 #define ESCAPE  "escape"
00042 
00043 #define IDX_KEYWORD "\\indexentry"
00044 #define IDX_AOPEN   '{'
00045 #define IDX_ACLOSE  '}'
00046 #define IDX_ROPEN   '('
00047 #define IDX_RCLOSE  ')'
00048 #define IDX_LEVEL   '!'
00049 #define IDX_QUOTE   '"'
00050 #define IDX_ACTUAL  '@'
00051 #define IDX_ENCAP   '|'
00052 #define IDX_ESCAPE  '\\'
00053 
00054 #define COMPOSITOR         "page_compositor"
00055 #define COMPOSITOR_DEF     "-"
00056 #define PRECEDENCE         "page_precedence"
00057 #define PRECEDENCE_DEF     "rnaRA"
00058 #define ROMAN_LOWER        'r'
00059 #define ROMAN_UPPER        'R'
00060 #define ARABIC             'n'
00061 #define ALPHA_LOWER        'a'
00062 #define ALPHA_UPPER        'A'
00063 #define ROMAN_LOWER_OFFSET 10000
00064 #define ROMAN_UPPER_OFFSET 10000
00065 #define ARABIC_OFFSET      10000
00066 #define ALPHA_LOWER_OFFSET 26
00067 #define ALPHA_UPPER_OFFSET 26
00068 
00069 #define PREAMBLE      "preamble"
00070 #define PREAMBLE_DEF  "\\begin{theindex}\n"
00071 #define PREAMBLE_LEN  1
00072 #define POSTAMBLE     "postamble"
00073 #define POSTAMBLE_DEF "\n\n\\end{theindex}\n"
00074 #define POSTAMBLE_LEN 3
00075 
00076 #define SETPAGEOPEN  "setpage_prefix"
00077 #define SETPAGECLOSE "setpage_suffix"
00078 
00079 #define SETPAGEOPEN_DEF "\n  \\setcounter{page}{"
00080 
00081 #define SETPAGECLOSE_DEF "}\n"
00082 #define SETPAGE_LEN      2
00083 
00084 #define GROUP_SKIP        "group_skip"
00085 #define GROUPSKIP_DEF "\n\n  \\indexspace\n"
00086 #define GROUPSKIP_LEN 3
00087 
00088 #define HEADINGS_FLAG    "headings_flag"
00089 #define HEADINGSFLAG_DEF 0
00090 #define HEADING_PRE      "heading_prefix"
00091 #define HEADINGPRE_DEF   ""
00092 #define HEADINGPRE_LEN   0
00093 #define HEADING_SUF      "heading_suffix"
00094 #define HEADINGSUF_DEF   ""
00095 #define HEADINGSUF_LEN   0
00096 #define SYMHEAD_POS      "symhead_positive"
00097 #define SYMHEADPOS_DEF   "Symbols"
00098 #define SYMHEAD_NEG      "symhead_negative"
00099 #define SYMHEADNEG_DEF   "symbols"
00100 #define NUMHEAD_POS      "numhead_positive"
00101 #define NUMHEADPOS_DEF   "Numbers"
00102 #define NUMHEAD_NEG      "numhead_negative"
00103 #define NUMHEADNEG_DEF   "numbers"
00104 
00105 #define ITEM_0  "item_0"
00106 #define ITEM_1  "item_1"
00107 #define ITEM_2  "item_2"
00108 #define ITEM_01 "item_01"
00109 #define ITEM_x1 "item_x1"
00110 #define ITEM_12 "item_12"
00111 #define ITEM_x2 "item_x2"
00112 
00113 #define ITEM0_DEF "\n  \\item "
00114 #define ITEM1_DEF "\n    \\subitem "
00115 #define ITEM2_DEF "\n      \\subsubitem "
00116 
00117 #define ITEM_LEN 1
00118 
00119 #define DELIM_0    "delim_0"
00120 #define DELIM_1    "delim_1"
00121 #define DELIM_2    "delim_2"
00122 #define DELIM_N    "delim_n"
00123 #define DELIM_R    "delim_r"
00124 #define DELIM_T    "delim_t"
00125 #define DELIM_DEF  ", "
00126 #define DELIMR_DEF "--"
00127 #define DELIMT_DEF ""
00128 
00129 #define SUFFIX_2P  "suffix_2p"
00130 #define SUFFIX_3P  "suffix_3p"
00131 #define SUFFIX_MP  "suffix_mp"
00132 
00133 #define ENCAP_0    "encap_prefix"
00134 #define ENCAP_1    "encap_infix"
00135 #define ENCAP_2    "encap_suffix"
00136 #define ENCAP0_DEF "\\"
00137 #define ENCAP1_DEF "{"
00138 #define ENCAP2_DEF "}"
00139 
00140 #define LINEMAX       "line_max"
00141 #define INDENT_SPACE  "indent_space"
00142 #define INDENT_LENGTH "indent_length"
00143 
00144 #define INDENTSPC_DEF "\t\t"
00145 
00146 #define INDENTLEN_DEF 16
00147 
00148 #define STY_ERROR(F, D) { \
00149     if (idx_dot) { \
00150        fprintf(ilg_fp, "\n"); \
00151        idx_dot = FALSE; \
00152     } \
00153     fprintf(ilg_fp, "** Input style error (file = %s, line = %d):\n   -- ", \
00154            sty_fn, sty_lc); \
00155     fprintf(ilg_fp, F, D); \
00156     sty_ec++; \
00157     put_dot = FALSE; \
00158 }
00159 
00160 #define STY_ERROR2(F, D1, D2) { \
00161      if (idx_dot) { \
00162        fprintf(ilg_fp, "\n"); \
00163        idx_dot = FALSE; \
00164     } \
00165     fprintf(ilg_fp, "** Input style error (file = %s, line = %d):\n   -- ", \
00166            sty_fn, sty_lc); \
00167     fprintf(ilg_fp, F, D1, D2); \
00168     sty_ec++; \
00169     put_dot = FALSE; \
00170 }
00171 
00172 #define STY_DOT { \
00173     idx_dot = TRUE; \
00174     if (verbose) \
00175        fprintf(stderr, DOT); \
00176     fprintf(ilg_fp, DOT); \
00177 }
00178 
00179 #define STY_SKIPLINE { \
00180     int a; \
00181     while ( ((a = GET_CHAR(sty_fp)) != LFD) && (a != EOF) ); \
00182     sty_lc++; \
00183 }
00184 
00185 #define SCAN_NO(N) { \
00186     fscanf(sty_fp, "%d", N); \
00187 }
00188 
00189 #define MULTIPLE(C) { \
00190     STY_SKIPLINE; \
00191 STY_ERROR2( \
00192 "Multiple instances of type `%c' in page precedence specification `%s'.\n", \
00193 C, page_prec); \
00194     return (FALSE); \
00195 }