-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathedit.h
69 lines (65 loc) · 2.02 KB
/
edit.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
* edit.h -- definitions for edit
* $Id$
*/
#define ENDDATA (-1)
#define ERR (-2)
#define FALSE 0
#define TRUE 1
#define OK 1
#define MAXLINES 2000
#define MAXSTR BUFSIZ
#define MAXPAT MAXSTR
#define BLINES 16 /* # of lines for B command */
#define CURLINE '.' /* current line == . */
#define SEMICOL ';'
#define COMMA ','
#define LASTLINE '$' /* metachar for last line */
#define DITTO (-4) /* encode of & char in subs */
#define ESCAPE '\\' /* escape for special characters */
#define SCAN '/' /* delimiter to scan forwards */
#define BACKSCAN '?' /* delimiter to scan up */
#define SHELLESCAPE '!'
struct buftype {
char txt[MAXSTR]; /* MAKE THIS: char *txt; */
int mark;
};
int addstr(char c, char *outset, int *j, int maxset);
int amatch(char *line, int offset, char *patt, int j);
int append(int line, int glob);
void blkmove(int n1, int n2, int n3);
int ckglob(char *l, int *i);
int deflt(int def1, int def2);
int docmd(char *lin, int *i, int glob);
void dodash(char dlm, char *src, int *i, char *dest, int *j, int maxset);
int doglob(char *s, int *i, int *cursave);
int dolist(int n1, int n2);
int doprint(int n1, int n2);
int doread(int n1, char *fn);
int dowrite(int n1, int n2, char *fn);
int edit(char *filename);
void edsetbuf(void);
int error(char *s1, char *s2);
char esc(char *a, int *i);
char *fgets_nonl(char *s, int n, FILE *f);
char *gettxt(int n, char *s);
int getlist(char *line, int *i);
int getmark(int l);
int getnum(char *line, int *i, int *num);
int getone(char *line, int *i, int *num);
int getrhs(char *line, int *i, char *sub, int *gflag);
int initbuf(void);
int lndelete(int n1, int n2);
int makepat(char *arg, int start, char delim, char *patt);
int match(char *line, char *patt);
int move(int line3);
int nextln(int n);
int omatch(char *line, int *i, char *patt, int j);
int optpat(char *l, int *i);
int patscan(char way, int *n);
int patsize(char *patt, int n);
int prevln(int n);
void putmark(int l, int m);
int puttxt(char *line);
void stclose(char *patt, int *j, int lastj);
int subst(char *sub, int gflag, int glob);