|
|
1 # include "regexp.h"
2 # include "buffer.h"
3 # include "vars.h"
4
5 /* status flags */
6 # define CB_NOIMAGE 0x0001
7 # define CB_INSERT 0x0002
8 # define CB_CHANGE 0x0004
9 # define CB_GLOBAL 0x0008
10 # define CB_EXCL 0x0010
11 # define CB_NUMBER 0x0020
12 # define CB_LIST 0x0040
13
14 /* indentor */
15 # define CB_PPCONTROL 0x0080
16 # define CB_COMMENT 0x0100
17 # define CB_JSKEYWORD 0x0200
18
19 /* substitutor */
20 # define CB_CURRENTBLK 0x0080
21 # define CB_SKIPPED 0x0100
22 # define CB_GLOBSUBST 0x0200
23 # define CB_UPPER 0x0400
24 # define CB_LOWER 0x0800
25 # define CB_TUPPER 0x1000
26 # define CB_TLOWER 0x2000
27
28 typedef struct {
29 char *cmd; /* command to do */
30 editbuf *edbuf; /* edit buffer */
31 rxbuf *regexp; /* current regular expression */
32 vars *vars; /* variables */
33 jmp_buf env; /* environment to jump back to after search */
34 bool reverse; /* reverse search */
35 bool ignorecase; /* ignore case */
36
37 short flags; /* status flags */
38 Int edit; /* number of edits on file */
39
40 Int this; /* current line number */
41 Int othis; /* current line number after last operation */
42 Int first; /* first line number of current range */
43 Int last; /* last line number of current range */
44
45 Int a_addr; /* argument address */
46 char a_buffer; /* argument buffer */
47
48 Int lineno; /* current line number in internal operations */
49 char *buffer; /* buffer for internal operations */
50 int buflen; /* size of buffer */
51
52 /* globals */
53 rxbuf *glob_rx; /* global regexp */
54 Int glob_next; /* next line affected in global */
55 Int glob_size; /* # lines affected in global */
56
57 /* indenting and shifting */
58 char *stack, *stackbot; /* token stack */
59 int *ind; /* indent stack */
60 char quote; /* ' or " */
61 short shift; /* shift amount */
62
63 /* substituting */
64 Int offset; /* offset in lines */
65 Int *moffset; /* mark offsets */
66
67 Int mark[26]; /* line numbers of marks */
68 block buf; /* default yank buffer */
69 block zbuf[26]; /* named buffers */
70
71 char fname[STRINGSZ]; /* current filename */
72
73 block undo; /* undo block */
74 Int uthis; /* current line number after undo */
75 Int umark[26]; /* marks after undo */
76
77 char search[STRINGSZ]; /* pattern to search for */
78 char replace[STRINGSZ]; /* string to replace with */
79 } cmdbuf;
80
81 # define RET_QUIT 1
82 # define RET_FLAGS 2
83
84 extern cmdbuf *cb_new P((char*));
85 extern void cb_del P((cmdbuf*));
86 extern bool cb_command P((cmdbuf*, char*));
87 extern int cb_edit P((cmdbuf*));
88
This page was automatically generated by the
LXR engine.
Visit the LXR main site for more
information.