00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044 #ifndef _h_el_chared
00045 #define _h_el_chared
00046
00047 #include <ctype.h>
00048 #include <string.h>
00049
00050 #include "histedit.h"
00051
00052 #define EL_MAXMACRO 10
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064 #define VI_MOVE
00065
00066
00067 typedef struct c_macro_t {
00068 int level;
00069 char **macro;
00070 char *nline;
00071 } c_macro_t;
00072
00073
00074
00075
00076 typedef struct c_undo_t {
00077 int action;
00078 size_t isize;
00079 size_t dsize;
00080 char *ptr;
00081 char *buf;
00082 } c_undo_t;
00083
00084
00085
00086
00087 typedef struct c_vcmd_t {
00088 int action;
00089 char *pos;
00090 char *ins;
00091 } c_vcmd_t;
00092
00093
00094
00095
00096 typedef struct c_kill_t {
00097 char *buf;
00098 char *last;
00099 char *mark;
00100 } c_kill_t;
00101
00102
00103
00104
00105
00106 typedef struct el_chared_t {
00107 c_undo_t c_undo;
00108 c_kill_t c_kill;
00109 c_vcmd_t c_vcmd;
00110 c_macro_t c_macro;
00111 } el_chared_t;
00112
00113
00114 #define STReof "^D\b\b"
00115 #define STRQQ "\"\""
00116
00117 #define isglob(a) (strchr("*[]?", (a)) != NULL)
00118 #define isword(a) (isprint(a))
00119
00120 #define NOP 0x00
00121 #define DELETE 0x01
00122 #define INSERT 0x02
00123 #define CHANGE 0x04
00124
00125 #define CHAR_FWD 0
00126 #define CHAR_BACK 1
00127
00128 #define MODE_INSERT 0
00129 #define MODE_REPLACE 1
00130 #define MODE_REPLACE_1 2
00131
00132 #include "common.h"
00133 #include "vi.h"
00134 #include "emacs.h"
00135 #include "search.h"
00136 #include "fcns.h"
00137
00138
00139 protected int cv__isword(int);
00140 protected void cv_delfini(EditLine *);
00141 protected char *cv__endword(char *, char *, int);
00142 protected int ce__isword(int);
00143 protected void cv_undo(EditLine *, int, size_t, char *);
00144 protected char *cv_next_word(EditLine*, char *, char *, int, int (*)(int));
00145 protected char *cv_prev_word(EditLine*, char *, char *, int, int (*)(int));
00146 protected char *c__next_word(char *, char *, int, int (*)(int));
00147 protected char *c__prev_word(char *, char *, int, int (*)(int));
00148 protected void c_insert(EditLine *, int);
00149 protected void c_delbefore(EditLine *, int);
00150 protected void c_delafter(EditLine *, int);
00151 protected int c_gets(EditLine *, char *);
00152 protected int c_hpos(EditLine *);
00153
00154 protected int ch_init(EditLine *);
00155 protected void ch_reset(EditLine *);
00156 protected int ch_enlargebufs __P((EditLine *, size_t));
00157 protected void ch_end(EditLine *);
00158
00159 #endif