Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 154 lines (143 sloc) 6.02 kb
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
1 /* ex.h */
2 /* Copyright 1995 by Steve Kirkendall */
3
4 /* This is a list of all possible print flag combinations */
5 typedef enum
6 {
7 PF_NONE, /* don't print */
8 PF_PRINT, /* print the line */
9 PF_NUMBER, /* print line number, then print line */
10 PF_LIST, /* list the line (making control characters visible) */
11 PF_NUMLIST /* print line number, then list line */
12 } PFLAG;
13
14 typedef enum
15 {
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
16 EX_ABBR, EX_ALIAS, EX_ALL, EX_APPEND, EX_ARGS, EX_AT,
17 EX_BANG, EX_BBROWSE, EX_BREAK, EX_BROWSE, EX_BUFFER,
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
18 EX_CALC, EX_CC, EX_CD, EX_CHANGE, EX_CLOSE, EX_COLOR, EX_COMMENT,
19 EX_COPY,
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
20 EX_DELETE, EX_DIGRAPH, EX_DISPLAY, EX_DO, EX_DOALIAS,
21 EX_ECHO, EX_EDIT, EX_ELSE, EX_EQUAL, EX_ERRLIST, EX_ERROR, EX_EVAL,
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
22 EX_FILE,
23 EX_GOTO, EX_GLOBAL, EX_GUI,
24 EX_HELP,
25 EX_IF, EX_INSERT,
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
26 EX_LAST, EX_LET, EX_LIST, EX_LOCAL, EX_LPR,
27 EX_MAKE, EX_MAP, EX_MARK, EX_MESSAGE, EX_MKEXRC, EX_MOVE,
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
28 EX_NEXT, EX_NORMAL, EX_NUMBER,
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
29 EX_ONLY, EX_OPEN,
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
30 EX_POP, EX_PRESERVE, EX_PREVIOUS, EX_PRINT, EX_PUT,
31 EX_QALL, EX_QUIT,
32 EX_READ, EX_REDO, EX_REWIND,
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
33 EX_SALL, EX_SAFER, EX_SBBROWSE, EX_SBROWSE, EX_SET, EX_SHELL,
34 EX_SHIFTL, EX_SHIFTR, EX_SLAST, EX_SNEW, EX_SNEXT, EX_SOURCE,
35 EX_SPLIT, EX_SPREVIOUS, EX_SREWIND, EX_STAG, EX_STACK, EX_STOP,
36 EX_SUBAGAIN, EX_SUBRECENT, EX_SUBSTITUTE, EX_SUSPEND,
37 EX_TAG, EX_THEN, EX_TRY,
38 EX_UNABBR, EX_UNALIAS, EX_UNBREAK, EX_UNDO, EX_UNMAP,
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
39 EX_VERSION, EX_VGLOBAL, EX_VISUAL,
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
40 EX_WARNING, EX_WHILE, EX_WINDOW, EX_WNEXT, EX_WQUIT, EX_WRITE,
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
41 EX_XIT,
42 EX_YANK,
43 EX_Z
44 } EXCMD;
45
46 /* This structure is used to store a parsed ex command */
47 typedef struct
48 {
49 WINDOW window; /* window where line was entered */
50 MARKBUF defaddr; /* default address (includes buffer spec) */
51 long from, to; /* range line numbers */
52 long fromoffset; /* exact offset of an addressed point */
53 MARK fromaddr; /* start of the "from" line */
54 MARK toaddr; /* end of "to" line (start of following line) */
55 BOOLEAN anyaddr; /* True if any addresses given, False if none */
56 char *cmdname; /* name of command (for diagnostics) */
57 EXCMD command; /* code for command name, e.g. EX_PRINT */
58 int cmdidx; /* index into internal array of cmd attributes */
59 int multi; /* number of times cmd name was stuttered */
60 BOOLEAN bang; /* True if '!' appended to command name */
61 MARK destaddr; /* end of destination line */
62 regexp *re; /* regular expression */
63 CHAR *lhs; /* single-word argument or "+lineno" string */
64 CHAR *rhs; /* multi-word argument, or command line */
65 char **file; /* array of file names */
66 int nfiles; /* size of "file" array */
67 CHAR cutbuf; /* cut buffer name */
68 long count; /* count argument, or plus value */
69 PFLAG pflag; /* print flag, causes output of some lines */
70 long delta; /* print offset */
71 BOOLEAN global; /* executed as part of :global command? */
72 BOOLEAN undo; /* save an "undo" version before first change? */
73 MARK newcurs; /* where cursor should be left (NULL to not move) */
74 } EXINFO;
75
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
76
3a9bb55 @mbert Import Elvis 2.1_3 (written by Steve Kirkendall)
authored
77 /* defined in exconfig.c */
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
78 extern BOOLEAN exthenflag;
79 extern CHAR *exdotest;
80
3a9bb55 @mbert Import Elvis 2.1_3 (written by Steve Kirkendall)
authored
81 /* defined in exmake.c */
82 extern BOOLEAN makeflag;
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
83
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
84 BEGIN_EXTERNC
85 extern BOOLEAN exparseaddress P_((CHAR **refp, EXINFO *xinf));
86 extern RESULT experform P_((WINDOW win, MARK from, MARK to));
3a9bb55 @mbert Import Elvis 2.1_3 (written by Steve Kirkendall)
authored
87 extern RESULT exstring P_((WINDOW win, CHAR *str, char *name));
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
88 extern CHAR *exname P_((CHAR *name));
89 extern RESULT exenter P_((WINDOW win));
90 extern long exprintlines P_((WINDOW win, MARK line, long qty, PFLAG pflag));
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
91 extern CHAR *excomplete P_((WINDOW win, MARK from, MARK to));
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
92 extern void exfree P_((EXINFO *xinf));
93 extern BOOLEAN exaddfilearg P_((char ***file, int *nfiles, char *filename, BOOLEAN wild));
94
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
95 extern char *exisalias P_((char *name, BOOLEAN inuse));
96
97 extern RESULT ex_alias P_((EXINFO *xinf));
98 extern RESULT ex_doalias P_((EXINFO *xinf));
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
99 extern RESULT ex_all P_((EXINFO *xinf));
100 extern RESULT ex_append P_((EXINFO *xinf));
101 extern RESULT ex_args P_((EXINFO *xinf));
102 extern RESULT ex_at P_((EXINFO *xinf));
103 extern RESULT ex_bang P_((EXINFO *xinf));
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
104 extern RESULT ex_browse P_((EXINFO *xinf));
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
105 extern RESULT ex_buffer P_((EXINFO *xinf));
106 extern RESULT ex_cd P_((EXINFO *xinf));
107 extern RESULT ex_color P_((EXINFO *xinf));
108 extern RESULT ex_comment P_((EXINFO *xinf));
109 extern RESULT ex_delete P_((EXINFO *xinf));
110 extern RESULT ex_digraph P_((EXINFO *xinf));
111 extern RESULT ex_display P_((EXINFO *xinf));
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
112 extern RESULT ex_do P_((EXINFO *xinf));
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
113 extern RESULT ex_edit P_((EXINFO *xinf));
114 extern RESULT ex_errlist P_((EXINFO *xinf));
115 extern RESULT ex_file P_((EXINFO *xinf));
116 extern RESULT ex_global P_((EXINFO *xinf));
117 extern RESULT ex_gui P_((EXINFO *xinf));
118 extern RESULT ex_help P_((EXINFO *xinf));
119 extern RESULT ex_if P_((EXINFO *xinf));
120 extern RESULT ex_join P_((EXINFO *xinf));
121 extern RESULT ex_lpr P_((EXINFO *xinf));
122 extern RESULT ex_make P_((EXINFO *xinf));
123 extern RESULT ex_map P_((EXINFO *xinf));
124 extern RESULT ex_mark P_((EXINFO *xinf));
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
125 extern RESULT ex_message P_((EXINFO *xinf));
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
126 extern RESULT ex_mkexrc P_((EXINFO *xinf));
127 extern RESULT ex_move P_((EXINFO *xinf));
128 extern RESULT ex_next P_((EXINFO *xinf));
129 extern RESULT ex_pop P_((EXINFO *xinf));
130 extern RESULT ex_print P_((EXINFO *xinf));
131 extern RESULT ex_put P_((EXINFO *xinf));
132 extern RESULT ex_qall P_((EXINFO *xinf));
133 extern RESULT ex_read P_((EXINFO *xinf));
134 extern RESULT ex_sall P_((EXINFO *xinf));
135 extern RESULT ex_set P_((EXINFO *xinf));
136 extern RESULT ex_shift P_((EXINFO *xinf));
137 extern RESULT ex_source P_((EXINFO *xinf));
138 extern RESULT ex_stack P_((EXINFO *xinf));
139 extern RESULT ex_substitute P_((EXINFO *xinf));
140 extern RESULT ex_suspend P_((EXINFO *xinf));
141 extern RESULT ex_tag P_((EXINFO *xinf));
142 extern RESULT ex_then P_((EXINFO *xinf));
143 extern RESULT ex_undo P_((EXINFO *xinf));
144 extern RESULT ex_version P_((EXINFO *xinf));
145 extern RESULT ex_split P_((EXINFO *xinf));
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
146 extern RESULT ex_while P_((EXINFO *xinf));
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
147 extern RESULT ex_window P_((EXINFO *xinf));
148 extern RESULT ex_write P_((EXINFO *xinf));
149 extern RESULT ex_xit P_((EXINFO *xinf));
150 extern RESULT ex_z P_((EXINFO *xinf));
151
152 extern void colorsave P_((BUFFER custom));
153 END_EXTERNC
Something went wrong with that request. Please try again.