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 /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ 23 /* All Rights Reserved */ 24 25 26 /* Copyright (c) 1981 Regents of the University of California */ 27 #ident "%Z%%M% %I% %E% SMI" /* SVr4.0 1.6 */ 28 29 #include <regexpr.h> 30 /* 31 * Regular expression definitions. 32 * The regular expressions in ex are similar to those in ed, 33 * with the addition of the word boundaries from Toronto ed 34 * and allowing character classes to have [a-b] as in the shell. 35 * The numbers for the nodes below are spaced further apart then 36 * necessary because I at one time partially put in + and | (one or 37 * more and alternation.) 38 */ 39 #define EXPSIZ (ESIZE + 2) 40 41 struct regexp { 42 unsigned char Expbuf[EXPSIZ]; 43 short Nbra; 44 }; 45 46 /* 47 * There are three regular expressions here, the previous (in re), 48 * the previous substitute (in subre) and the previous scanning (in scanre). 49 * It would be possible to get rid of "re" by making it a stack parameter 50 * to the appropriate routines. 51 */ 52 var struct regexp *re; /* Last re */ 53 var struct regexp *scanre; /* Last scanning re */ 54 var struct regexp *subre; /* Last substitute re */ 55 56 /* 57 * Since the phototypesetter v7-epsilon 58 * C compiler doesn't have structure assignment... 59 */ 60 void savere(struct regexp ** a); 61 void resre(struct regexp * a); 62 63 /* 64 * Definitions for substitute 65 */ 66 var unsigned char rhsbuf[RHSSIZE]; /* Rhs of last substitute */ 67