once.h (4450B)
1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ 22 /* 23 * Copyright 2005 Sun Microsystems, Inc. 24 * All rights reserved. 25 * Use is subject to license terms. 26 */ 27 28 /* Copyright (c) 1988 AT&T */ 29 /* All Rights Reserved */ 30 31 /* from OpenSolaris "once.h 6.9 05/06/08 SMI" */ 32 33 /* 34 * Portions Copyright (c) 2005 Gunnar Ritter, Freiburg i. Br., Germany 35 * 36 * Sccsid @(#)once.h 1.4 (gritter) 11/26/05 37 */ 38 39 #include "ldefs.c" 40 41 /* once.c */ 42 /* because of external definitions, this code should occur only once */ 43 int ctable[2*NCH] = { 44 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 45 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 46 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 47 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 48 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 49 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 50 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 51 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 52 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 53 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 54 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 55 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 56 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 57 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 58 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 59 150, 151, 152, 153, 154, 155, 156, 157, 158, 159, 60 160, 161, 162, 163, 164, 165, 166, 167, 168, 169, 61 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 62 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 63 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 64 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 65 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 66 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 67 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 68 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 69 250, 251, 252, 253, 254, 255 70 }; 71 72 int ZCH = NCH; 73 FILE *fout = NULL, *errorf; 74 int sect = DEFSECTION; 75 int prev = '\n'; /* previous input character */ 76 int pres = '\n'; /* present input character */ 77 int peek = '\n'; /* next input character */ 78 CHR *pushptr = pushc; 79 CHR *slptr = slist; 80 81 #ifndef CNAME 82 #define CNAME "./ncform" 83 #endif 84 #ifndef RATNAME 85 #define RATNAME "./nrform" 86 #endif 87 char *cname = CNAME; 88 char *ratname = RATNAME; 89 90 int ccount = 1; 91 int casecount = 1; 92 int aptr = 1; 93 int nstates = NSTATES, maxpos = MAXPOS; 94 int treesize = TREESIZE, ntrans = NTRANS; 95 int yytop; 96 int outsize = NOUTPUT; 97 int sptr = 1; 98 int optim = TRUE; 99 int report = 2; 100 int debug; /* 1 = on */ 101 int charc; 102 char *v_stmp = "n"; 103 int no_input; 104 int copy_line; 105 int n_error = 0; 106 int fatal = 1; 107 int sargc; 108 char **sargv; 109 CHR buf[BUF_SIZ]; 110 int ratfor; /* 1 = ratfor, 0 = C */ 111 int yyline; /* line number of file */ 112 int eof; 113 int lgatflg; 114 int divflg; 115 int funcflag; 116 int pflag; 117 int chset; /* 1 = char set modified */ 118 FILE *fin, *fother; 119 int fptr; 120 int *name; 121 intptr_t *left; 122 intptr_t *right; 123 int *parent; 124 Boolean *nullstr; 125 int tptr; 126 CHR pushc[TOKENSIZE]; 127 CHR slist[STARTSIZE]; 128 CHR **def, **subs, *dchar; 129 /* XCU4: %x exclusive start */ 130 int *exclusive; 131 CHR **sname, *schar; 132 CHR *ccl; 133 CHR *ccptr; 134 CHR *dp, *sp; 135 int dptr; 136 CHR *bptr; /* store input position */ 137 CHR *tmpstat; 138 int count; 139 int **foll; 140 int *nxtpos; 141 int *positions; 142 int *gotof; 143 int *nexts; 144 CHR *nchar; 145 int **state; 146 int *sfall; /* fallback state num */ 147 Boolean *cpackflg; /* true if state has been character packed */ 148 int *atable; 149 int nptr; 150 Boolean symbol[MAXNCG]; 151 CHR cindex[MAXNCG]; 152 int xstate; 153 int stnum; 154 CHR match[MAXNCG]; 155 BYTE extra[NACTIONS]; 156 CHR *pchar, *pcptr; 157 int pchlen = TOKENSIZE; 158 long rcount; 159 int *verify, *advance, *stoff; 160 int scon; 161 CHR *psave; 162 163 Boolean handleeuc = FALSE; 164 Boolean widecio = FALSE; 165 166 int isArray = 1; /* XCU4: for %array %pointer */