1*48309Sbostic /*- 2*48309Sbostic * %sccs.include.proprietary.c% 3*48309Sbostic * 4*48309Sbostic * @(#)sed.h 4.4 (Berkeley) 04/18/91 5*48309Sbostic */ 618582Sralph 718582Sralph /* 818582Sralph * sed -- stream editor 918582Sralph */ 1018582Sralph 1118582Sralph #define CBRA 1 1218582Sralph #define CCHR 2 1318582Sralph #define CDOT 4 1418582Sralph #define CCL 6 1518582Sralph #define CNL 8 1618582Sralph #define CDOL 10 1718582Sralph #define CEOF 11 1818582Sralph #define CKET 12 1918582Sralph #define CNULL 13 2018582Sralph #define CLNUM 14 2118582Sralph #define CEND 16 2218582Sralph #define CDONT 17 2318582Sralph #define CBACK 18 2418582Sralph 2518582Sralph #define STAR 01 2618582Sralph 2718582Sralph #define NLINES 256 2818582Sralph #define DEPTH 20 2918582Sralph #define PTRSIZE 200 3018582Sralph #define RESIZE 10000 3118582Sralph #define ABUFSIZE 20 3218582Sralph #define LBSIZE 4000 3318582Sralph #define ESIZE 256 3418582Sralph #define LABSIZE 50 3518582Sralph #define NBRA 9 3618582Sralph 3718582Sralph FILE *fin; 3833075Sbostic struct reptr *abuf[ABUFSIZE]; 3933075Sbostic struct reptr **aptr; 4018582Sralph char *lastre; 4118582Sralph char ibuf[BUFSIZ]; 4218582Sralph char *cbp; 4318582Sralph char *ebp; 4418582Sralph char genbuf[LBSIZE]; 4518582Sralph char *loc1; 4618582Sralph char *loc2; 4718582Sralph char *locs; 4818582Sralph char seof; 4918582Sralph char *reend; 5018582Sralph char *lbend; 5118582Sralph char *hend; 5218582Sralph char *lcomend; 5333075Sbostic struct reptr *ptrend; 5418582Sralph int eflag; 5518582Sralph int dolflag; 5618582Sralph int sflag; 5718582Sralph int jflag; 5818582Sralph int numbra; 5918582Sralph int delflag; 6018582Sralph long lnum; 6118582Sralph char linebuf[LBSIZE+1]; 6218582Sralph char holdsp[LBSIZE+1]; 6318582Sralph char *spend; 6418582Sralph char *hspend; 6518582Sralph int nflag; 6618582Sralph int gflag; 6718582Sralph char *braelist[NBRA]; 6818582Sralph char *braslist[NBRA]; 6918582Sralph long tlno[NLINES]; 7018582Sralph int nlno; 7132203Sbostic char *fname[12]; 7218582Sralph FILE *fcode[12]; 7318582Sralph int nfiles; 7418582Sralph 7518582Sralph #define ACOM 01 7618582Sralph #define BCOM 020 7718582Sralph #define CCOM 02 7818582Sralph #define CDCOM 025 7918582Sralph #define CNCOM 022 8018582Sralph #define COCOM 017 8118582Sralph #define CPCOM 023 8218582Sralph #define DCOM 03 8318582Sralph #define ECOM 015 8418582Sralph #define EQCOM 013 8518582Sralph #define FCOM 016 8618582Sralph #define GCOM 027 8718582Sralph #define CGCOM 030 8818582Sralph #define HCOM 031 8918582Sralph #define CHCOM 032 9018582Sralph #define ICOM 04 9118582Sralph #define LCOM 05 9218582Sralph #define NCOM 012 9318582Sralph #define PCOM 010 9418582Sralph #define QCOM 011 9518582Sralph #define RCOM 06 9618582Sralph #define SCOM 07 9718582Sralph #define TCOM 021 9818582Sralph #define WCOM 014 9918582Sralph #define CWCOM 024 10018582Sralph #define YCOM 026 10118582Sralph #define XCOM 033 10218582Sralph 10318582Sralph char *cp; 10418582Sralph char *reend; 10518582Sralph char *lbend; 10618582Sralph 10733075Sbostic struct reptr { 10833075Sbostic char *ad1; 10933075Sbostic char *ad2; 11033075Sbostic union { 11133075Sbostic char *real_re1; 11233075Sbostic struct reptr *real_lb1; 11333075Sbostic } re_lb; 11433075Sbostic #define re1 re_lb.real_re1 11533075Sbostic #define lb1 re_lb.real_lb1 11633075Sbostic char *rhs; 11733075Sbostic FILE *fcode; 11833075Sbostic char command; 11933075Sbostic char gfl; 12033075Sbostic char pfl; 12133075Sbostic char inar; 12233075Sbostic char negfl; 12318582Sralph } ptrspace[PTRSIZE], *rep; 12418582Sralph 12518582Sralph 12618582Sralph char respace[RESIZE]; 12718582Sralph 12818582Sralph struct label { 12918582Sralph char asc[9]; 13033075Sbostic struct reptr *chain; 13133075Sbostic struct reptr *address; 13218582Sralph } ltab[LABSIZE]; 13318582Sralph 13418582Sralph struct label *lab; 13518582Sralph struct label *labend; 13618582Sralph 13718582Sralph int f; 13818582Sralph int depth; 13918582Sralph 14018582Sralph int eargc; 14118582Sralph char **eargv; 14218582Sralph 14318582Sralph extern char bittab[]; 14418582Sralph 14533075Sbostic struct reptr **cmpend[DEPTH]; 14618582Sralph int depth; 14733075Sbostic struct reptr *pending; 14818582Sralph char *badp; 14918582Sralph char bad; 15018582Sralph char *compile(); 15118582Sralph char *ycomp(); 15218582Sralph char *address(); 15318582Sralph char *text(); 15418582Sralph char *compsub(); 15518582Sralph struct label *search(); 15618582Sralph char *gline(); 15718582Sralph char *place(); 15818582Sralph char compfl; 159