ed.c File Reference

#include <sys/types.h>
#include <signal.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/wait.h>
#include <stdio.h>
#include <setjmp.h>

Include dependency graph for ed.c:

Go to the source code of this file.

Data Structures

struct  token
struct  line
struct  tbl

Defines

#define NUL   0x00
#define EOS   0x00
#define SOH   0x01
#define STX   0x02
#define ETX   0x03
#define EOT   0x04
#define ENQ   0x05
#define ACK   0x06
#define BEL   0x07
#define BS   0x08
#define HT   0x09
#define LF   0x0a
#define NL   '\n'
#define VT   0x0b
#define FF   0x0c
#define CR   0x0d
#define SO   0x0e
#define SI   0x0f
#define DLE   0x10
#define DC1   0x11
#define DC2   0x12
#define DC3   0x13
#define DC4   0x14
#define NAK   0x15
#define SYN   0x16
#define ETB   0x17
#define CAN   0x18
#define EM   0x19
#define SUB   0x1a
#define ESC   0x1b
#define FS   0x1c
#define GS   0x1d
#define RS   0x1e
#define US   0x1f
#define SP   0x20
#define DEL   0x7f
#define TRUE   1
#define FALSE   0
#define ERR   -2
#define BOL   '^'
#define EOL   '$'
#define ANY   '.'
#define LITCHAR   'L'
#define ESCAPE   '\\'
#define CCL   '['
#define CCLEND   ']'
#define NEGATE   '^'
#define NCCL   '!'
#define CLOSURE   '*'
#define OR_SYM   '|'
#define DITTO   '&'
#define OPEN   '('
#define CLOSE   ')'
#define CLS_SIZE   128
#define TOKSIZE   sizeof (TOKEN)
#define MAXSTR   132
#define max(a, b)   ((a>b)?a:b)
#define min(a, b)   ((a<b)?a:b)
#define toupper(c)   (c>='a'&&c<='z'?c-32:c)
#define FATAL   (ERR-1)
#define LINFREE   1
#define LGLOB   2
#define MAXLINE   (sizeof(int) == 2 ? 256 : 8192)
#define MAXPAT   256
#define MAXFNAME   (sizeof(int) == 2 ? 256 : 1024)
#define nextln(l)   ((l)+1 > lastln ? 0 : (l)+1)
#define prevln(l)   ((l)-1 < 0 ? lastln : (l)-1)
#define FIRST   1
#define NOTFIRST   0
#define SHELL   "/bin/sh"
#define SHELL2   "/usr/bin/sh"

Typedefs

typedef char BITMAP
typedef token TOKEN
typedef line LINE

Functions

 _PROTOTYPE (int main,(int argc, char **argv))
 _PROTOTYPE (static char *match,(char *lin, TOKEN *pat, char *boln))
 _PROTOTYPE (char *amatch,(char *lin, TOKEN *pat, char *boln))
 _PROTOTYPE (int append,(int line, int glob))
 _PROTOTYPE (BITMAP *makebitmap,(unsigned size))
 _PROTOTYPE (int setbit,(unsigned c, char *map, unsigned val))
 _PROTOTYPE (int testbit,(unsigned c, char *map))
 _PROTOTYPE (char *catsub,(char *from, char *to, char *sub, char *new, char *newend))
 _PROTOTYPE (int ckglob,(void))
 _PROTOTYPE (int deflt,(int def1, int def2))
 _PROTOTYPE (int del,(int from, int to))
 _PROTOTYPE (int docmd,(int glob))
 _PROTOTYPE (int dolst,(int line1, int line2))
 _PROTOTYPE (char *dodash,(int delim, char *src, char *map))
 _PROTOTYPE (void prntln,(char *str, int vflg, int lin))
 _PROTOTYPE (void putcntl,(int c, FILE *stream))
 _PROTOTYPE (int doread,(int lin, char *fname))
 _PROTOTYPE (int dowrite,(int from, int to, char *fname, int apflg))
 _PROTOTYPE (void intr,(int sig))
 _PROTOTYPE (int egets,(char *str, int size, FILE *stream))
 _PROTOTYPE (int esc,(char **s))
 _PROTOTYPE (int find,(TOKEN *pat, int dir))
 _PROTOTYPE (char *getfn,(void))
 _PROTOTYPE (int getnum,(int first))
 _PROTOTYPE (TOKEN *getpat,(char *arg))
 _PROTOTYPE (LINE *getptr,(int num))
 _PROTOTYPE (int getrhs,(char *sub))
 _PROTOTYPE (char *gettxt,(int num))
 _PROTOTYPE (int ins,(char *str))
 _PROTOTYPE (int System,(char *c))
 _PROTOTYPE (int join,(int first, int last))
 _PROTOTYPE (TOKEN *makepat,(char *arg, int delim))
 _PROTOTYPE (char *maksub,(char *sub, int subsz))
 _PROTOTYPE (char *matchs,(char *line, TOKEN *pat, int ret_endp))
 _PROTOTYPE (int move,(int num))
 _PROTOTYPE (int omatch,(char **linp, TOKEN *pat, char *boln))
 _PROTOTYPE (TOKEN *optpat,(void))
 _PROTOTYPE (void relink,(LINE *a, LINE *x, LINE *y, LINE *b))
 _PROTOTYPE (void clrbuf,(void))
 _PROTOTYPE (int subst,(TOKEN *pat, char *sub, int gflg, int pflag))
 _PROTOTYPE (void unmakepat,(TOKEN *head))
char * amatch (char *lin, TOKEN *pat, char *boln)
static char * match (char *lin, TOKEN *pat, char *boln)
int append (int line, int glob)
BITMAPmakebitmap (unsigned size)
int setbit (unsigned c, char *map, unsigned val)
int testbit (unsigned c, char *map)
char * catsub (char *from, char *to, char *sub, char *new, char *newend)
int ckglob ()
int deflt (int def1, int def2)
int del (int from, int to)
int docmd (int glob)
int dolst (int line1, int line2)
char * dodash (int delim, char *src, char *map)
int doglob ()
int doprnt (int from, int to)
void prntln (char *str, int vflg, int lin)
void putcntl (char c, FILE *stream)
int doread (int lin, char *fname)
int dowrite (int from, int to, char *fname, int apflg)
void intr (int sig)
int main (int argc, char **argv)
int egets (char *str, int size, FILE *stream)
int esc (char **s)
int find (TOKEN *pat, int dir)
char * getfn ()
int getlst ()
int getnum (int first)
int getone ()
TOKENgetpat (char *arg)
LINEgetptr (int num)
int getrhs (char *sub)
char * gettxt (int num)
int ins (char *str)
int join (int first, int last)
TOKENmakepat (char *arg, int delim)
char * maksub (char *sub, int subsz)
char * matchs (char *line, TOKEN *pat, int ret_endp)
int move (int num)
int transfer (int num)
int omatch (char **linp, TOKEN *pat, char *boln)
TOKENoptpat ()
int set ()
int show ()
void relink (LINE *a, LINE *x, LINE *y, LINE *b)
void clrbuf ()
void set_buf ()
int subst (TOKEN *pat, char *sub, int gflg, int pflag)
int System (char *c)
void unmakepat (TOKEN *head)

Variables

LINE line0
int curln
int lastln
int line1
int line2
int nlines
int nflg
int lflg
char * inptr
char linbuf []
char * linptr
int truncflg
int eightbit
int nonascii
int nullchar
int truncated
int fchanged
char * paropen [9]
char * parclose [9]
int between
int parnum
char * paropen [9]
char * parclose [9]
char fname [MAXFNAME]
int fchanged
int nofname
int mark []
int diag
jmp_buf env
LINE line0
int curln = 0
int lastln = 0
char * inptr
static char inlin [MAXLINE]
int nflg
int lflg
int line1
int line2
int nlines
int version = 1
int diag = 1
int eightbit = 1
int nonascii
int nullchar
int truncated
char fname [MAXFNAME]
int nofname
int fchanged
TOKENoldpat
tblt


Define Documentation

#define ACK   0x06
 

Definition at line 52 of file ed.c.

Referenced by ack_emit_init(), ack_emit_instruction(), wcrx(), and wcrxpn().

#define ANY   '.'
 

Definition at line 97 of file ed.c.

#define BEL   0x07
 

Definition at line 53 of file ed.c.

#define BOL   '^'
 

Definition at line 95 of file ed.c.

#define BS   0x08
 

Definition at line 54 of file ed.c.

#define CAN   0x18
 

Definition at line 71 of file ed.c.

Referenced by getnak(), wctx(), zdlread(), zgethdr(), and zsendfdata().

#define CCL   '['
 

Definition at line 100 of file ed.c.

Referenced by advance(), makepat(), omatch(), and unmakepat().

#define CCLEND   ']'
 

Definition at line 101 of file ed.c.

Referenced by makepat().

#define CLOSE   ')'
 

Definition at line 108 of file ed.c.

#define CLOSURE   '*'
 

Definition at line 104 of file ed.c.

Referenced by makepat(), and match().

#define CLS_SIZE   128
 

Definition at line 113 of file ed.c.

Referenced by makepat().

#define CR   0x0d
 

Definition at line 60 of file ed.c.

#define DC1   0x11
 

Definition at line 64 of file ed.c.

#define DC2   0x12
 

Definition at line 65 of file ed.c.

#define DC3   0x13
 

Definition at line 66 of file ed.c.

#define DC4   0x14
 

Definition at line 67 of file ed.c.

#define DEL   0x7f
 

Definition at line 80 of file ed.c.

#define DITTO   '&'
 

Definition at line 106 of file ed.c.

Referenced by catsub(), and maksub().

#define DLE   0x10
 

Definition at line 63 of file ed.c.

#define EM   0x19
 

Definition at line 72 of file ed.c.

#define ENQ   0x05
 

Definition at line 51 of file ed.c.

#define EOL   '$'
 

Definition at line 96 of file ed.c.

#define EOS   0x00
 

Definition at line 46 of file ed.c.

#define EOT   0x04
 

Definition at line 50 of file ed.c.

#define ERR   -2
 

Definition at line 85 of file ed.c.

#define ESC   0x1b
 

Definition at line 74 of file ed.c.

#define ESCAPE   '\\'
 

Definition at line 99 of file ed.c.

#define ETB   0x17
 

Definition at line 70 of file ed.c.

#define ETX   0x03
 

Definition at line 49 of file ed.c.

#define FALSE   0
 

Definition at line 84 of file ed.c.

#define FATAL   (ERR-1)
 

Definition at line 142 of file ed.c.

#define FF   0x0c
 

Definition at line 59 of file ed.c.

#define FIRST   1
 

Definition at line 1407 of file ed.c.

#define FS   0x1c
 

Definition at line 75 of file ed.c.

#define GS   0x1d
 

Definition at line 76 of file ed.c.

#define HT   0x09
 

Definition at line 55 of file ed.c.

#define LF   0x0a
 

Definition at line 56 of file ed.c.

#define LGLOB   2
 

Definition at line 153 of file ed.c.

Referenced by ckglob(), and doglob().

#define LINFREE   1
 

Definition at line 152 of file ed.c.

#define LITCHAR   'L'
 

Definition at line 98 of file ed.c.

Referenced by makepat(), matchs(), and omatch().

#define max a,
b   )     ((a>b)?a:b)
 

Definition at line 137 of file ed.c.

#define MAXFNAME   (sizeof(int) == 2 ? 256 : 1024)
 

Definition at line 160 of file ed.c.

#define MAXLINE   (sizeof(int) == 2 ? 256 : 8192)
 

Definition at line 156 of file ed.c.

#define MAXPAT   256
 

Definition at line 157 of file ed.c.

Referenced by docmd(), getrhs(), and optpat().

#define MAXSTR   132
 

Definition at line 133 of file ed.c.

#define min a,
b   )     ((a<b)?a:b)
 

Definition at line 138 of file ed.c.

#define NAK   0x15
 

Definition at line 68 of file ed.c.

Referenced by getnak(), wcrx(), wcrxpn(), and wctx().

#define NCCL   '!'
 

Definition at line 103 of file ed.c.

Referenced by makepat(), omatch(), and unmakepat().

#define NEGATE   '^'
 

Definition at line 102 of file ed.c.

#define nextln  )     ((l)+1 > lastln ? 0 : (l)+1)
 

Definition at line 175 of file ed.c.

Referenced by del(), docmd(), find(), and move().

#define NL   '\n'
 

Definition at line 57 of file ed.c.

#define NOTFIRST   0
 

Definition at line 1408 of file ed.c.

Referenced by getone().

#define NUL   0x00
 

Definition at line 45 of file ed.c.

#define OPEN   '('
 

Definition at line 107 of file ed.c.

#define OR_SYM   '|'
 

Definition at line 105 of file ed.c.

#define prevln  )     ((l)-1 < 0 ? lastln : (l)-1)
 

Definition at line 176 of file ed.c.

Referenced by del(), docmd(), find(), and move().

#define RS   0x1e
 

Definition at line 77 of file ed.c.

Referenced by get1rec(), and init().

#define SHELL   "/bin/sh"
 

Definition at line 2153 of file ed.c.

#define SHELL2   "/usr/bin/sh"
 

Definition at line 2154 of file ed.c.

Referenced by System().

#define SI   0x0f
 

Definition at line 62 of file ed.c.

#define SO   0x0e
 

Definition at line 61 of file ed.c.

Referenced by bottom_line(), ini_terminal(), put_line(), and starttcap().

#define SOH   0x01
 

Definition at line 47 of file ed.c.

Referenced by wcputsec().

#define SP   0x20
 

Definition at line 79 of file ed.c.

#define STX   0x02
 

Definition at line 48 of file ed.c.

Referenced by wcgetsec(), and wcputsec().

#define SUB   0x1a
 

Definition at line 73 of file ed.c.

#define SYN   0x16
 

Definition at line 69 of file ed.c.

#define TOKSIZE   sizeof (TOKEN)
 

Definition at line 127 of file ed.c.

Referenced by makepat().

#define toupper c   )     (c>='a'&&c<='z'?c-32:c)
 

Definition at line 139 of file ed.c.

#define TRUE   1
 

Definition at line 83 of file ed.c.

#define US   0x1f
 

Definition at line 78 of file ed.c.

Referenced by ini_terminal(), and starttcap().

#define VT   0x0b
 

Definition at line 58 of file ed.c.


Typedef Documentation

typedef char BITMAP
 

Definition at line 118 of file ed.c.

typedef struct line LINE
 

Definition at line 150 of file ed.c.

typedef struct token TOKEN
 


Function Documentation

_PROTOTYPE void  unmakepat,
(TOKEN *head
 

_PROTOTYPE int  subst,
(TOKEN *pat, char *sub, int gflg, int pflag
 

_PROTOTYPE void  clrbuf,
(void) 
 

_PROTOTYPE void  relink,
(LINE *a, LINE *x, LINE *y, LINE *b
 

_PROTOTYPE TOKEN optpat,
(void) 
 

_PROTOTYPE int  omatch,
(char **linp, TOKEN *pat, char *boln) 
 

_PROTOTYPE int  move,
(int num) 
 

_PROTOTYPE char *  matchs,
(char *line, TOKEN *pat, int ret_endp) 
 

_PROTOTYPE char *  maksub,
(char *sub, int subsz) 
 

_PROTOTYPE TOKEN makepat,
(char *arg, int delim
 

_PROTOTYPE int  join,
(int first, int last) 
 

_PROTOTYPE int  System,
(char *c
 

_PROTOTYPE int  ins,
(char *str
 

_PROTOTYPE char *  gettxt,
(int num) 
 

_PROTOTYPE int  getrhs,
(char *sub) 
 

_PROTOTYPE LINE getptr,
(int num) 
 

_PROTOTYPE TOKEN getpat,
(char *arg
 

_PROTOTYPE int  getnum,
(int first) 
 

_PROTOTYPE char *  getfn,
(void) 
 

_PROTOTYPE int  find,
(TOKEN *pat, int dir
 

_PROTOTYPE int  esc,
(char **s
 

_PROTOTYPE int  egets,
(char *str, int size, FILE *stream
 

_PROTOTYPE void  intr,
(int sig
 

_PROTOTYPE int  dowrite,
(int from, int to, char *fname, int apflg) 
 

_PROTOTYPE int  doread,
(int lin, char *fname) 
 

_PROTOTYPE void  putcntl,
(int c, FILE *stream
 

_PROTOTYPE void  prntln,
(char *str, int vflg, int lin) 
 

_PROTOTYPE char *  dodash,
(int delim, char *src, char *map) 
 

_PROTOTYPE int  dolst,
(int line1, int line2
 

_PROTOTYPE int  docmd,
(int glob) 
 

_PROTOTYPE int  del,
(int from, int to) 
 

_PROTOTYPE int  deflt,
(int def1, int def2) 
 

_PROTOTYPE int  ckglob,
(void) 
 

_PROTOTYPE char *  catsub,
(char *from, char *to, char *sub, char *new, char *newend
 

_PROTOTYPE int  testbit,
(unsigned c, char *map) 
 

_PROTOTYPE int  setbit,
(unsigned c, char *map, unsigned val
 

_PROTOTYPE BITMAP makebitmap,
(unsigned size) 
 

_PROTOTYPE int  append,
(int line, int glob) 
 

_PROTOTYPE char *  amatch,
(char *lin, TOKEN *pat, char *boln) 
 

_PROTOTYPE static char *  match,
(char *lin, TOKEN *pat, char *boln) 
 

_PROTOTYPE int  main,
(int argc, char **argv) 
 

char* amatch char *  lin,
TOKEN pat,
char *  boln
 

Definition at line 248 of file ed.c.

References match.

Referenced by matchs(), and subst().

int append int  line,
int  glob
 

Definition at line 361 of file ed.c.

References curln, EOF, ERR, fgets(), ins(), MAXLINE, nflg, NULL, printf, and stdin.

char* catsub char *  from,
char *  to,
char *  sub,
char *  new,
char *  newend
 

Definition at line 461 of file ed.c.

References cp, DITTO, and EOS.

Referenced by subst().

int ckglob  ) 
 

Definition at line 496 of file ed.c.

References c, deflt(), delim, ERR, getptr(), if(), inptr, lastln, LGLOB, LINE, line1, line2, matchs(), MAXLINE, num(), optpat(), ptr, strcat(), and strcpy().

void clrbuf  ) 
 

Definition at line 2088 of file ed.c.

References del(), and lastln.

Referenced by docmd().

int deflt int  def1,
int  def2
 

Definition at line 539 of file ed.c.

References ERR, line1, line2, and nlines.

Referenced by ckglob(), and docmd().

int del int  from,
int  to
 

Definition at line 555 of file ed.c.

References curln, first, free, getptr(), lastln, LINE, line0, next, nextln, prevln, relink(), and tmp.

Referenced by clrbuf(), docmd(), and test6a().

int docmd int  glob  ) 
 

Definition at line 586 of file ed.c.

References append(), c, clrbuf(), curln, deflt(), del(), dolst(), doprnt(), doread(), dowrite(), EOF, ERR, err, FALSE, fptr, getfn(), getone(), getrhs(), gflag, HT, inptr, join(), lastln, line1, line2, MAXPAT, move, nextln, NL, nlines, NULL, optpat(), pflag, prevln, printf, set(), SP, strcpy(), subst, transfer(), and TRUE.

Referenced by doglob().

char* dodash int  delim,
char *  src,
char *  map
 

Definition at line 834 of file ed.c.

References esc, first, setbit, and start.

Referenced by makepat().

int doglob  ) 
 

Definition at line 873 of file ed.c.

References curln, docmd(), getlst(), getptr(), inptr, lastln, LGLOB, LINE, and ptr.

int dolst int  line1,
int  line2
 

Definition at line 806 of file ed.c.

References doprnt(), lflg, and p.

Referenced by docmd().

int doprnt int  from,
int  to
 

Definition at line 903 of file ed.c.

References curln, getptr(), i, lastln, lflg, LINE, nflg, and prntln().

Referenced by docmd(), dolst(), and format().

int doread int  lin,
char *  fname
 

Definition at line 970 of file ed.c.

References bytes, curln, egets(), ERR, err, fopen(), fp, ins(), lines, MAXLINE, nonascii, NULL, nullchar, printf, strlen(), and truncated.

int dowrite int  from,
int  to,
char *  fname,
int  apflg
 

Definition at line 1015 of file ed.c.

References bytes, EOF, ERR, err, fopen(), fp, fputs(), getptr(), LINE, lines, NULL, printf, and strlen().

Referenced by docmd().

int egets char *  str,
int  size,
FILE stream
 

Definition at line 1171 of file ed.c.

References c, count, cp, EOF, EOS, getc, and printf.

Referenced by doread().

int esc char **  s  ) 
 

Definition at line 1224 of file ed.c.

References ESCAPE, and toupper.

int find TOKEN pat,
int  dir
 

Definition at line 1254 of file ed.c.

References curln, getptr(), i, lastln, LINE, MAXLINE, nextln, num(), prevln, and ptr.

char* getfn  ) 
 

Definition at line 1290 of file ed.c.

References cp, FALSE, HT, inptr, NL, NULL, printf, SP, strcpy(), strlen(), and TRUE.

Referenced by docmd().

int getlst  ) 
 

Definition at line 1326 of file ed.c.

References curln, getone(), inptr, line1, line2, nlines, and num().

Referenced by doglob().

int getnum int  first  ) 
 

Definition at line 1356 of file ed.c.

References c, HT, inptr, and SP.

int getone  ) 
 

Definition at line 1410 of file ed.c.

References c, ERR, FIRST, HT, i, inptr, lastln, NOTFIRST, and SP.

Referenced by docmd(), and getlst().

TOKEN* getpat char *  arg  ) 
 

Definition at line 1439 of file ed.c.

References makepat().

LINE* getptr int  num  ) 
 

Definition at line 1452 of file ed.c.

References j, lastln, LINE, line0, and ptr.

Referenced by ckglob(), del(), doglob(), doprnt(), dowrite(), find(), gettxt(), ins(), and move().

int getrhs char *  sub  ) 
 

Definition at line 1473 of file ed.c.

References ERR, HT, inptr, maksub(), MAXPAT, NL, NULL, and SP.

Referenced by docmd().

char* gettxt int  num  ) 
 

Definition at line 1496 of file ed.c.

References getptr(), LINE, MAXLINE, strcat(), and strcpy().

Referenced by join(), subst(), and transfer().

int ins char *  str  ) 
 

Definition at line 1513 of file ed.c.

References cp, EOS, ERR, getptr(), lastln, LINE, malloc(), MAXLINE, NL, NULL, relink(), strcpy(), and strlen().

Referenced by append(), doread(), main(), and transfer().

void intr int  sig  ) 
 

Definition at line 1085 of file ed.c.

References env, and printf.

int join int  first,
int  last
 

Definition at line 1552 of file ed.c.

References cp, ERR, gettxt(), lastln, MAXLINE, NL, printf, and str.

Referenced by docmd().

int main int  argc,
char **  argv
 

Definition at line 1092 of file ed.c.

References doread(), i, isatty, set_buf(), strcmp, and strcpy().

BITMAP* makebitmap unsigned  size  ) 
 

Definition at line 397 of file ed.c.

References malloc(), map, memset(), and printf.

TOKEN* makepat char *  arg,
int  delim
 

Definition at line 1604 of file ed.c.

References ANY, token::bitmap, BOL, CCL, CCLEND, CLOSE, CLOSURE, CLS_SIZE, dodash(), EOL, error, esc, ESCAPE, fprintf(), head, token::lchar, LITCHAR, malloc(), NCCL, NEGATE, next, Line::next, token::next, NULL, OPEN, stderr, tail, token::tok, TOKSIZE, and unmakepat().

Referenced by getpat().

char* maksub char *  sub,
int  subsz
 

Definition at line 1731 of file ed.c.

References cp, delim, DITTO, inptr, NL, and size.

Referenced by getrhs().

static char* match char *  lin,
TOKEN pat,
char *  boln
[static]
 

Definition at line 267 of file ed.c.

References CLOSE, CLOSURE, match, max, token::next, omatch(), OPEN, and token::tok.

char* matchs char *  line,
TOKEN pat,
int  ret_endp
 

Definition at line 1817 of file ed.c.

References amatch(), BOL, c, line2, LITCHAR, ok(), pat2, and token::tok.

Referenced by ckglob().

int move int  num  ) 
 

Definition at line 1886 of file ed.c.

References curln, ERR, getptr(), lastln, LINE, line1, line2, nextln, prevln, and relink().

int omatch char **  linp,
TOKEN pat,
char *  boln
 

Definition at line 1952 of file ed.c.

References advance(), ANY, token::bitmap, BOL, CCL, EOL, token::lchar, LITCHAR, NCCL, testbit(), and token::tok.

Referenced by match().

TOKEN* optpat  ) 
 

Definition at line 2002 of file ed.c.

References cp, delim, EOS, ESCAPE, getpat(), MAXPAT, NL, oldpat, and unmakepat().

Referenced by ckglob(), and docmd().

void prntln char *  str,
int  vflg,
int  lin
 

Definition at line 923 of file ed.c.

References DEL, NL, printf, putc, putcntl(), and stdout.

Referenced by doprnt().

void putcntl char  c,
FILE stream
 

Definition at line 955 of file ed.c.

References putc.

Referenced by prntln().

void relink LINE a,
LINE x,
LINE y,
LINE b
 

Definition at line 2081 of file ed.c.

Referenced by del(), ins(), move(), and set_buf().

int set  ) 
 

Definition at line 2040 of file ed.c.

References EOS, ERR, HT, i, NL, show(), SP, strcmp, t, tbl::t_ptr, tbl::t_str, and tbl::t_val.

Referenced by catch4(), docmd(), dump_fdset(), evalvar(), sigreturn(), test37e(), test37f(), test37g(), test37h(), test37i(), test37j(), test7d(), test7e(), test7f(), test7g(), test7h(), test7i(), and test7j().

void set_buf  ) 
 

Definition at line 2093 of file ed.c.

References curln, lastln, line0, and relink().

Referenced by main().

int setbit unsigned  c,
char *  map,
unsigned  val
 

Definition at line 421 of file ed.c.

int show  ) 
 

Definition at line 2067 of file ed.c.

References lflg, nflg, printf, and version.

int subst TOKEN pat,
char *  sub,
int  gflg,
int  pflag
 

Definition at line 2104 of file ed.c.

References amatch(), catsub(), ERR, gettxt(), line1, line2, m, MAXLINE, and txt.

int System char *  c  ) 
 

Definition at line 2156 of file ed.c.

References execl, exit(), fork, pid, SHELL, SHELL2, status, and wait.

int testbit unsigned  c,
char *  map
 

Definition at line 441 of file ed.c.

Referenced by omatch().

int transfer int  num  ) 
 

Definition at line 1915 of file ed.c.

References curln, ERR, gettxt(), ins(), line1, and line2.

Referenced by docmd().

void unmakepat TOKEN head  ) 
 

Definition at line 2178 of file ed.c.

References CCL, free, NCCL, and token::next.

Referenced by makepat(), and optpat().


Variable Documentation

int between
 

Definition at line 246 of file ed.c.

int curln = 0
 

Definition at line 1075 of file ed.c.

Referenced by append(), del(), docmd(), doglob(), doprnt(), doread(), find(), getlst(), move(), set_buf(), and transfer().

int curln
 

Definition at line 1075 of file ed.c.

Referenced by append(), del(), docmd(), doglob(), doprnt(), doread(), find(), getlst(), move(), set_buf(), and transfer().

int diag = 1
 

Definition at line 1083 of file ed.c.

int diag
 

Definition at line 1083 of file ed.c.

Referenced by parse(), and yylex().

int eightbit = 1
 

Definition at line 1169 of file ed.c.

int eightbit
 

Definition at line 1169 of file ed.c.

jmp_buf env
 

Definition at line 1072 of file ed.c.

int fchanged
 

Definition at line 581 of file ed.c.

int fchanged
 

Definition at line 581 of file ed.c.

int fchanged
 

Definition at line 581 of file ed.c.

char fname[MAXFNAME]
 

Definition at line 580 of file ed.c.

char fname
 

Definition at line 580 of file ed.c.

Referenced by chk_dir(), cmdcomp(), cnvtfile(), efun(), iwritfile(), main(), netfinger(), openredirect(), recvfile(), sendfile(), set_profile(), and tar().

char inlin[MAXLINE] [static]
 

Definition at line 1078 of file ed.c.

char* inptr
 

Definition at line 1077 of file ed.c.

Referenced by ckglob(), docmd(), doglob(), getfn(), getlst(), getnum(), getone(), getrhs(), maksub(), and sbx_aout().

char* inptr
 

Definition at line 1077 of file ed.c.

Referenced by ckglob(), docmd(), doglob(), getfn(), getlst(), getnum(), getone(), getrhs(), maksub(), and sbx_aout().

int lastln = 0
 

Definition at line 1076 of file ed.c.

Referenced by ckglob(), clrbuf(), del(), docmd(), doglob(), doprnt(), find(), getone(), getptr(), ins(), join(), move(), and set_buf().

int lastln
 

Definition at line 1076 of file ed.c.

Referenced by ckglob(), clrbuf(), del(), docmd(), doglob(), doprnt(), find(), getone(), getptr(), ins(), join(), move(), and set_buf().

int lflg
 

Definition at line 1079 of file ed.c.

Referenced by dolst(), doprnt(), and show().

int lflg
 

Definition at line 1079 of file ed.c.

Referenced by dolst(), doprnt(), and show().

char linbuf[]
 

Definition at line 221 of file rz.c.

Referenced by askerr(), dbg_diag(), and vfy_exer().

LINE line0
 

Definition at line 1074 of file ed.c.

Referenced by del(), getptr(), and set_buf().

LINE line0
 

Definition at line 1074 of file ed.c.

Referenced by del(), getptr(), and set_buf().

int line1
 

Definition at line 1080 of file ed.c.

Referenced by ckglob(), cmp_fields(), deflt(), docmd(), getlst(), move(), subst(), and transfer().

int line1
 

Definition at line 1080 of file ed.c.

Referenced by ckglob(), cmp_fields(), deflt(), docmd(), getlst(), move(), subst(), and transfer().

int line2
 

Definition at line 1080 of file ed.c.

int line2
 

Definition at line 1080 of file ed.c.

char * linptr
 

int mark['z'- 'a'+1]
 

Definition at line 1354 of file ed.c.

int nflg
 

Definition at line 1079 of file ed.c.

Referenced by append(), doprnt(), and show().

int nflg
 

Definition at line 1079 of file ed.c.

Referenced by append(), doprnt(), and show().

int nlines
 

Definition at line 1080 of file ed.c.

int nlines
 

Definition at line 23 of file vars.c.

int nofname
 

Definition at line 1288 of file ed.c.

int nofname
 

Definition at line 1288 of file ed.c.

int nonascii
 

Definition at line 1170 of file ed.c.

int nonascii
 

Definition at line 1170 of file ed.c.

Referenced by compare(), doread(), and file().

int nullchar
 

Definition at line 1170 of file ed.c.

Referenced by doread().

int nullchar
 

Definition at line 1170 of file ed.c.

Referenced by doread().

TOKEN* oldpat
 

Definition at line 1999 of file ed.c.

Referenced by optpat().

char * parclose[9]
 

Definition at line 245 of file ed.c.

char * parclose[9]
 

Definition at line 245 of file ed.c.

int parnum
 

Definition at line 246 of file ed.c.

char* paropen[9]
 

Definition at line 245 of file ed.c.

char* paropen[9]
 

Definition at line 245 of file ed.c.

struct tbl * t
 

Referenced by ack_get_C_expression(), ack_get_instruction(), ack_get_operand(), ack_get_oplist(), ack_get_statement(), andor(), arrayelm(), bas_get_C_expression(), bas_get_instruction(), bas_get_operand(), bas_get_oplist(), bas_get_statement(), block(), BZ2_decompress(), c_list(), caselist(), casepart(), Cat(), clock(), code_target(), command(), compile(), crypt(), days2time(), decode_message(), do_ed_script(), do_getty(), do_select(), do_times(), doMDTM(), dup_line(), elsepart(), equal(), eth_reg_vlan(), evaluate(), exec_one(), execute(), expand(), explode(), f_2winds(), fetchname(), gzfilebuf::fillbuf(), findidle(), fts_read(), fts_stat(), get_cmostime(), get_free_pid(), get_time(), get_token(), Getc(), getcap(), getstr(), gettrav(), getvar(), gnu_get_C_expression(), gnu_get_instruction(), gnu_get_operand(), gnu_get_oplist(), gnu_get_statement(), hypot(), icmp_rate_limit(), indx(), init_server(), inittagdef(), intuit_diff_type(), ipeth_send(), iscntl(), keyword(), linespec(), load(), logging(), lookup(), m_modify(), m_toggle(), macro(), main(), make(), matching_vector(), mkfld(), mkrec(), mmed3(), nested(), newtp(), next_screen(), openin(), out_header(), pack_names(), pack_vector(), parse_err(), parsecmd(), peektoken(), pipeline(), pm_exit(), pr_comment(), predef(), print(), r_mkfld(), readout(), readtoken(), reg_addr(), regsub(), rijndael_cbc_decrypt(), rijndael_cbc_encrypt(), rijndael_cfb1_decrypt(), rijndael_cfb1_encrypt(), rijndael_cfb8_decrypt(), rijndael_cfb8_encrypt(), rijndael_ecb_decrypt(), rijndael_ecb_encrypt(), rijndael_KeySched(), rl_reset_hw(), savestr(), score(), search_dir(), select_notified(), sendMTFValues(), september(), servxcheck(), set(), set_time(), setsignal(), setvar(), simple(), sort_actions(), split(), Split(), spool(), store(), str_offt(), Strfun(), Subst(), test39f(), tgetstr(), thenpart(), timestamp(), transpose(), tree(), zap(), and zipFlushWriteBuffer().

int truncated
 

Definition at line 1170 of file ed.c.

Referenced by command(), doread(), getline(), and res_send().

int truncated
 

Definition at line 1170 of file ed.c.

Referenced by command(), doread(), getline(), and res_send().

int truncflg
 

int version = 1
 

Definition at line 1082 of file ed.c.


Generated on Fri Apr 14 23:06:30 2006 for minix by  doxygen 1.4.6