10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 50Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 60Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 70Sstevel@tonic-gate * with the License. 80Sstevel@tonic-gate * 90Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 100Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 110Sstevel@tonic-gate * See the License for the specific language governing permissions 120Sstevel@tonic-gate * and limitations under the License. 130Sstevel@tonic-gate * 140Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 150Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 160Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 170Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 180Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 190Sstevel@tonic-gate * 200Sstevel@tonic-gate * CDDL HEADER END 210Sstevel@tonic-gate */ 220Sstevel@tonic-gate /* 23*640Sbasabi * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 240Sstevel@tonic-gate * Use is subject to license terms. 250Sstevel@tonic-gate */ 260Sstevel@tonic-gate 270Sstevel@tonic-gate /* Copyright (c) 1984 AT&T */ 280Sstevel@tonic-gate /* All Rights Reserved */ 290Sstevel@tonic-gate 30*640Sbasabi #ifndef _SED_H 31*640Sbasabi #define _SED_H 32*640Sbasabi 33*640Sbasabi #pragma ident "%Z%%M% %I% %E% SMI" 340Sstevel@tonic-gate 350Sstevel@tonic-gate /* 360Sstevel@tonic-gate * sed -- stream editor 370Sstevel@tonic-gate */ 380Sstevel@tonic-gate 390Sstevel@tonic-gate #include <ctype.h> 400Sstevel@tonic-gate #include <locale.h> 410Sstevel@tonic-gate 420Sstevel@tonic-gate /* 430Sstevel@tonic-gate * define some macros for rexexp.h 440Sstevel@tonic-gate */ 450Sstevel@tonic-gate 460Sstevel@tonic-gate #define INIT extern char *cp; /* cp points to RE string */\ 470Sstevel@tonic-gate register char *sp = cp; 480Sstevel@tonic-gate #define GETC() (*sp++) 490Sstevel@tonic-gate #define PEEKC() (*sp) 500Sstevel@tonic-gate #define UNGETC(c) (--sp) 510Sstevel@tonic-gate #define RETURN(c) cp = sp; return(ep); 520Sstevel@tonic-gate #define ERROR(c) regerr(c) 530Sstevel@tonic-gate 540Sstevel@tonic-gate #define CEND 16 550Sstevel@tonic-gate #define CLNUM 14 560Sstevel@tonic-gate 570Sstevel@tonic-gate #define NLINES 256 580Sstevel@tonic-gate #define DEPTH 20 590Sstevel@tonic-gate #define PTRSIZE 200 600Sstevel@tonic-gate #define RESIZE 10000 610Sstevel@tonic-gate #define ABUFSIZE 20 620Sstevel@tonic-gate #define LBSIZE 4000 630Sstevel@tonic-gate #define ESIZE 256 640Sstevel@tonic-gate #define LABSIZE 50 650Sstevel@tonic-gate 660Sstevel@tonic-gate extern union reptr *abuf[]; 670Sstevel@tonic-gate extern union reptr **aptr; 680Sstevel@tonic-gate extern char genbuf[]; 690Sstevel@tonic-gate extern char *lcomend; 700Sstevel@tonic-gate extern long long lnum; 710Sstevel@tonic-gate extern char linebuf[]; 720Sstevel@tonic-gate extern char holdsp[]; 730Sstevel@tonic-gate extern char *spend; 740Sstevel@tonic-gate extern char *hspend; 750Sstevel@tonic-gate extern int nflag; 760Sstevel@tonic-gate extern long long tlno[]; 770Sstevel@tonic-gate 780Sstevel@tonic-gate #define ACOM 01 790Sstevel@tonic-gate #define BCOM 020 800Sstevel@tonic-gate #define CCOM 02 810Sstevel@tonic-gate #define CDCOM 025 820Sstevel@tonic-gate #define CNCOM 022 830Sstevel@tonic-gate #define COCOM 017 840Sstevel@tonic-gate #define CPCOM 023 850Sstevel@tonic-gate #define DCOM 03 860Sstevel@tonic-gate #define ECOM 015 870Sstevel@tonic-gate #define EQCOM 013 880Sstevel@tonic-gate #define FCOM 016 890Sstevel@tonic-gate #define GCOM 027 900Sstevel@tonic-gate #define CGCOM 030 910Sstevel@tonic-gate #define HCOM 031 920Sstevel@tonic-gate #define CHCOM 032 930Sstevel@tonic-gate #define ICOM 04 940Sstevel@tonic-gate #define LCOM 05 950Sstevel@tonic-gate #define NCOM 012 960Sstevel@tonic-gate #define PCOM 010 970Sstevel@tonic-gate #define QCOM 011 980Sstevel@tonic-gate #define RCOM 06 990Sstevel@tonic-gate #define SCOM 07 1000Sstevel@tonic-gate #define TCOM 021 1010Sstevel@tonic-gate #define WCOM 014 1020Sstevel@tonic-gate #define CWCOM 024 1030Sstevel@tonic-gate #define YCOM 026 1040Sstevel@tonic-gate #define XCOM 033 1050Sstevel@tonic-gate 1060Sstevel@tonic-gate 1070Sstevel@tonic-gate union reptr { 1080Sstevel@tonic-gate struct reptr1 { 1090Sstevel@tonic-gate char *ad1; 1100Sstevel@tonic-gate char *ad2; 1110Sstevel@tonic-gate char *re1; 1120Sstevel@tonic-gate char *rhs; 1130Sstevel@tonic-gate FILE *fcode; 1140Sstevel@tonic-gate char command; 1150Sstevel@tonic-gate int gfl; 1160Sstevel@tonic-gate char pfl; 1170Sstevel@tonic-gate char inar; 1180Sstevel@tonic-gate char negfl; 1190Sstevel@tonic-gate } r1; 1200Sstevel@tonic-gate struct reptr2 { 1210Sstevel@tonic-gate char *ad1; 1220Sstevel@tonic-gate char *ad2; 1230Sstevel@tonic-gate union reptr *lb1; 1240Sstevel@tonic-gate char *rhs; 1250Sstevel@tonic-gate FILE *fcode; 1260Sstevel@tonic-gate char command; 1270Sstevel@tonic-gate int gfl; 1280Sstevel@tonic-gate char pfl; 1290Sstevel@tonic-gate char inar; 1300Sstevel@tonic-gate char negfl; 1310Sstevel@tonic-gate } r2; 1320Sstevel@tonic-gate }; 1330Sstevel@tonic-gate extern union reptr ptrspace[]; 1340Sstevel@tonic-gate 1350Sstevel@tonic-gate 1360Sstevel@tonic-gate 1370Sstevel@tonic-gate struct label { 1380Sstevel@tonic-gate char asc[9]; 1390Sstevel@tonic-gate union reptr *chain; 1400Sstevel@tonic-gate union reptr *address; 1410Sstevel@tonic-gate }; 1420Sstevel@tonic-gate 1430Sstevel@tonic-gate 1440Sstevel@tonic-gate 1450Sstevel@tonic-gate extern int eargc; 1460Sstevel@tonic-gate 1470Sstevel@tonic-gate extern union reptr *pending; 1480Sstevel@tonic-gate char *compile(); 1490Sstevel@tonic-gate char *ycomp(); 1500Sstevel@tonic-gate char *address(); 1510Sstevel@tonic-gate char *text(); 1520Sstevel@tonic-gate char *compsub(); 1530Sstevel@tonic-gate struct label *search(); 1540Sstevel@tonic-gate char *gline(); 1550Sstevel@tonic-gate char *place(); 156*640Sbasabi void comperr(char *); 157*640Sbasabi void execute(char *); 158*640Sbasabi 159*640Sbasabi #endif /* _SED_H */ 160