17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 57c478bd9Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 67c478bd9Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 77c478bd9Sstevel@tonic-gate * with the License. 87c478bd9Sstevel@tonic-gate * 97c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 107c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 117c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 127c478bd9Sstevel@tonic-gate * and limitations under the License. 137c478bd9Sstevel@tonic-gate * 147c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 157c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 167c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 177c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 187c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 197c478bd9Sstevel@tonic-gate * 207c478bd9Sstevel@tonic-gate * CDDL HEADER END 217c478bd9Sstevel@tonic-gate */ 227c478bd9Sstevel@tonic-gate /* 23*bdcaf822Sbasabi * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 247c478bd9Sstevel@tonic-gate * Use is subject to license terms. 257c478bd9Sstevel@tonic-gate */ 267c478bd9Sstevel@tonic-gate 277c478bd9Sstevel@tonic-gate /* Copyright (c) 1984 AT&T */ 287c478bd9Sstevel@tonic-gate /* All Rights Reserved */ 297c478bd9Sstevel@tonic-gate 30*bdcaf822Sbasabi #ifndef _SED_H 31*bdcaf822Sbasabi #define _SED_H 32*bdcaf822Sbasabi 33*bdcaf822Sbasabi #pragma ident "%Z%%M% %I% %E% SMI" 347c478bd9Sstevel@tonic-gate 357c478bd9Sstevel@tonic-gate /* 367c478bd9Sstevel@tonic-gate * sed -- stream editor 377c478bd9Sstevel@tonic-gate */ 387c478bd9Sstevel@tonic-gate 397c478bd9Sstevel@tonic-gate #include <ctype.h> 407c478bd9Sstevel@tonic-gate #include <locale.h> 417c478bd9Sstevel@tonic-gate 427c478bd9Sstevel@tonic-gate /* 437c478bd9Sstevel@tonic-gate * define some macros for rexexp.h 447c478bd9Sstevel@tonic-gate */ 457c478bd9Sstevel@tonic-gate 467c478bd9Sstevel@tonic-gate #define INIT extern char *cp; /* cp points to RE string */\ 477c478bd9Sstevel@tonic-gate register char *sp = cp; 487c478bd9Sstevel@tonic-gate #define GETC() (*sp++) 497c478bd9Sstevel@tonic-gate #define PEEKC() (*sp) 507c478bd9Sstevel@tonic-gate #define UNGETC(c) (--sp) 517c478bd9Sstevel@tonic-gate #define RETURN(c) cp = sp; return(ep); 527c478bd9Sstevel@tonic-gate #define ERROR(c) regerr(c) 537c478bd9Sstevel@tonic-gate 547c478bd9Sstevel@tonic-gate #define CEND 16 557c478bd9Sstevel@tonic-gate #define CLNUM 14 567c478bd9Sstevel@tonic-gate 577c478bd9Sstevel@tonic-gate #define NLINES 256 587c478bd9Sstevel@tonic-gate #define DEPTH 20 597c478bd9Sstevel@tonic-gate #define PTRSIZE 200 607c478bd9Sstevel@tonic-gate #define RESIZE 10000 617c478bd9Sstevel@tonic-gate #define ABUFSIZE 20 627c478bd9Sstevel@tonic-gate #define LBSIZE 4000 637c478bd9Sstevel@tonic-gate #define ESIZE 256 647c478bd9Sstevel@tonic-gate #define LABSIZE 50 657c478bd9Sstevel@tonic-gate 667c478bd9Sstevel@tonic-gate extern union reptr *abuf[]; 677c478bd9Sstevel@tonic-gate extern union reptr **aptr; 687c478bd9Sstevel@tonic-gate extern char genbuf[]; 697c478bd9Sstevel@tonic-gate extern char *lcomend; 707c478bd9Sstevel@tonic-gate extern long long lnum; 717c478bd9Sstevel@tonic-gate extern char linebuf[]; 727c478bd9Sstevel@tonic-gate extern char holdsp[]; 737c478bd9Sstevel@tonic-gate extern char *spend; 747c478bd9Sstevel@tonic-gate extern char *hspend; 757c478bd9Sstevel@tonic-gate extern int nflag; 767c478bd9Sstevel@tonic-gate extern long long tlno[]; 777c478bd9Sstevel@tonic-gate 787c478bd9Sstevel@tonic-gate #define ACOM 01 797c478bd9Sstevel@tonic-gate #define BCOM 020 807c478bd9Sstevel@tonic-gate #define CCOM 02 817c478bd9Sstevel@tonic-gate #define CDCOM 025 827c478bd9Sstevel@tonic-gate #define CNCOM 022 837c478bd9Sstevel@tonic-gate #define COCOM 017 847c478bd9Sstevel@tonic-gate #define CPCOM 023 857c478bd9Sstevel@tonic-gate #define DCOM 03 867c478bd9Sstevel@tonic-gate #define ECOM 015 877c478bd9Sstevel@tonic-gate #define EQCOM 013 887c478bd9Sstevel@tonic-gate #define FCOM 016 897c478bd9Sstevel@tonic-gate #define GCOM 027 907c478bd9Sstevel@tonic-gate #define CGCOM 030 917c478bd9Sstevel@tonic-gate #define HCOM 031 927c478bd9Sstevel@tonic-gate #define CHCOM 032 937c478bd9Sstevel@tonic-gate #define ICOM 04 947c478bd9Sstevel@tonic-gate #define LCOM 05 957c478bd9Sstevel@tonic-gate #define NCOM 012 967c478bd9Sstevel@tonic-gate #define PCOM 010 977c478bd9Sstevel@tonic-gate #define QCOM 011 987c478bd9Sstevel@tonic-gate #define RCOM 06 997c478bd9Sstevel@tonic-gate #define SCOM 07 1007c478bd9Sstevel@tonic-gate #define TCOM 021 1017c478bd9Sstevel@tonic-gate #define WCOM 014 1027c478bd9Sstevel@tonic-gate #define CWCOM 024 1037c478bd9Sstevel@tonic-gate #define YCOM 026 1047c478bd9Sstevel@tonic-gate #define XCOM 033 1057c478bd9Sstevel@tonic-gate 1067c478bd9Sstevel@tonic-gate 1077c478bd9Sstevel@tonic-gate union reptr { 1087c478bd9Sstevel@tonic-gate struct reptr1 { 1097c478bd9Sstevel@tonic-gate char *ad1; 1107c478bd9Sstevel@tonic-gate char *ad2; 1117c478bd9Sstevel@tonic-gate char *re1; 1127c478bd9Sstevel@tonic-gate char *rhs; 1137c478bd9Sstevel@tonic-gate FILE *fcode; 1147c478bd9Sstevel@tonic-gate char command; 1157c478bd9Sstevel@tonic-gate int gfl; 1167c478bd9Sstevel@tonic-gate char pfl; 1177c478bd9Sstevel@tonic-gate char inar; 1187c478bd9Sstevel@tonic-gate char negfl; 1197c478bd9Sstevel@tonic-gate } r1; 1207c478bd9Sstevel@tonic-gate struct reptr2 { 1217c478bd9Sstevel@tonic-gate char *ad1; 1227c478bd9Sstevel@tonic-gate char *ad2; 1237c478bd9Sstevel@tonic-gate union reptr *lb1; 1247c478bd9Sstevel@tonic-gate char *rhs; 1257c478bd9Sstevel@tonic-gate FILE *fcode; 1267c478bd9Sstevel@tonic-gate char command; 1277c478bd9Sstevel@tonic-gate int gfl; 1287c478bd9Sstevel@tonic-gate char pfl; 1297c478bd9Sstevel@tonic-gate char inar; 1307c478bd9Sstevel@tonic-gate char negfl; 1317c478bd9Sstevel@tonic-gate } r2; 1327c478bd9Sstevel@tonic-gate }; 1337c478bd9Sstevel@tonic-gate extern union reptr ptrspace[]; 1347c478bd9Sstevel@tonic-gate 1357c478bd9Sstevel@tonic-gate 1367c478bd9Sstevel@tonic-gate 1377c478bd9Sstevel@tonic-gate struct label { 1387c478bd9Sstevel@tonic-gate char asc[9]; 1397c478bd9Sstevel@tonic-gate union reptr *chain; 1407c478bd9Sstevel@tonic-gate union reptr *address; 1417c478bd9Sstevel@tonic-gate }; 1427c478bd9Sstevel@tonic-gate 1437c478bd9Sstevel@tonic-gate 1447c478bd9Sstevel@tonic-gate 1457c478bd9Sstevel@tonic-gate extern int eargc; 1467c478bd9Sstevel@tonic-gate 1477c478bd9Sstevel@tonic-gate extern union reptr *pending; 1487c478bd9Sstevel@tonic-gate char *compile(); 1497c478bd9Sstevel@tonic-gate char *ycomp(); 1507c478bd9Sstevel@tonic-gate char *address(); 1517c478bd9Sstevel@tonic-gate char *text(); 1527c478bd9Sstevel@tonic-gate char *compsub(); 1537c478bd9Sstevel@tonic-gate struct label *search(); 1547c478bd9Sstevel@tonic-gate char *gline(); 1557c478bd9Sstevel@tonic-gate char *place(); 156*bdcaf822Sbasabi void comperr(char *); 157*bdcaf822Sbasabi void execute(char *); 158*bdcaf822Sbasabi 159*bdcaf822Sbasabi #endif /* _SED_H */ 160