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
00045
00046
00047
00048
00049 #ifndef _h_el_chared
00050 #define _h_el_chared
00051
00052 #include <ctype.h>
00053 #include <string.h>
00054
00055 #include "histedit.h"
00056
00057 #define EL_MAXMACRO 10
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069 #define VI_MOVE
00070
00071
00072 typedef struct CMacro_t {
00073 int fLevel;
00074 char** fMacro;
00075 char* fNLine;
00076 } CMacro_t;
00077
00078
00079
00080
00081 typedef struct CUndo_t {
00082 int fAction;
00083 size_t fISize;
00084 size_t fDSize;
00085 char* fPtr;
00086 char* fBuf;
00087 } CUndo_t;
00088
00089
00090
00091
00092 typedef struct CVCmd_t {
00093 int fAction;
00094 char* fPos;
00095 char* fIns;
00096 } CVCmd_t;
00097
00098
00099
00100
00101 typedef struct CKill_t {
00102 char* fBuf;
00103 char* fLast;
00104 char* fMark;
00105 } CKill_t;
00106
00107
00108
00109
00110
00111 typedef struct ElCharEd_t {
00112 CUndo_t fUndo;
00113 CKill_t fKill;
00114 CVCmd_t fVCmd;
00115 CMacro_t fMacro;
00116 } ElCharEd_t;
00117
00118
00119 #define STReof "^D\b\b"
00120 #define STRQQ "\"\""
00121
00122 #define isglob(a) (strchr("*[]?", (a)) != NULL)
00123 #define isword(a) (isprint(a))
00124
00125 #define NOP 0x00
00126 #define DELETE 0x01
00127 #define INSERT 0x02
00128 #define CHANGE 0x04
00129
00130 #define CHAR_FWD 0
00131 #define CHAR_BACK 1
00132
00133 #define MODE_INSERT 0
00134 #define MODE_REPLACE 1
00135 #define MODE_REPLACE_1 2
00136
00137 #include "common.h"
00138 #ifdef EL_USE_VI
00139 # include "vi.h"
00140 #endif
00141 #include "emacs.h"
00142 #include "search.h"
00143 #include "fcns.h"
00144
00145
00146 el_protected int cv__isword(int);
00147 el_protected void cv_delfini(EditLine_t*);
00148 el_protected char* cv__endword(char*, char*, int);
00149 el_protected int ce__isword(int);
00150 el_protected void cv_undo(EditLine_t *, int, size_t, char*);
00151 el_protected char* cv_next_word(EditLine_t *, char*, char*, int, int(*) (int));
00152 el_protected char* cv_prev_word(EditLine_t *, char*, char*, int, int(*) (int));
00153 el_protected char* c__next_word(char*, char*, int, int(*) (int));
00154 el_protected char* c__prev_word(char*, char*, int, int(*) (int));
00155 el_protected void c_insert(EditLine_t*, int);
00156 el_protected void c_delbefore(EditLine_t*, int);
00157 el_protected void c_delafter(EditLine_t*, int);
00158 el_protected int c_gets(EditLine_t*, char*);
00159 el_protected int c_hpos(EditLine_t*);
00160
00161 el_protected int ch_init(EditLine_t*);
00162 el_protected void ch_reset(EditLine_t*);
00163
00164 el_protected int ch_enlargebufs(EditLine_t *, size_t);
00165 el_protected void ch_end(EditLine_t*);
00166
00167 #endif