123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- #ifndef _h_el_chared
- #define _h_el_chared
- #include <ctype.h>
- #include <string.h>
- #include "histedit.h"
- #define EL_MAXMACRO 10
- #define VI_MOVE
- typedef struct c_macro_t {
- int level;
- char **macro;
- char *nline;
- } c_macro_t;
- typedef struct c_undo_t {
- int action;
- size_t isize;
- size_t dsize;
- char *ptr;
- char *buf;
- } c_undo_t;
- typedef struct c_vcmd_t {
- int action;
- char *pos;
- char *ins;
- } c_vcmd_t;
- typedef struct c_kill_t {
- char *buf;
- char *last;
- char *mark;
- } c_kill_t;
- typedef struct el_chared_t {
- c_undo_t c_undo;
- c_kill_t c_kill;
- c_vcmd_t c_vcmd;
- c_macro_t c_macro;
- } el_chared_t;
- #define STReof "^D\b\b"
- #define STRQQ "\"\""
- #define isglob(a) (strchr("*[]?", (a)) != NULL)
- #define isword(a) (isprint(a))
- #define NOP 0x00
- #define DELETE 0x01
- #define INSERT 0x02
- #define CHANGE 0x04
- #define CHAR_FWD 0
- #define CHAR_BACK 1
- #define MODE_INSERT 0
- #define MODE_REPLACE 1
- #define MODE_REPLACE_1 2
- #include "common.h"
- #include "vi.h"
- #include "emacs.h"
- #include "search.h"
- #include "fcns.h"
- protected int cv__isword(int);
- protected void cv_delfini(EditLine *);
- protected char *cv__endword(char *, char *, int);
- protected int ce__isword(int);
- protected void cv_undo(EditLine *, int, size_t, char *);
- protected char *cv_next_word(EditLine*, char *, char *, int, int (*)(int));
- protected char *cv_prev_word(EditLine*, char *, char *, int, int (*)(int));
- protected char *c__next_word(char *, char *, int, int (*)(int));
- protected char *c__prev_word(char *, char *, int, int (*)(int));
- protected void c_insert(EditLine *, int);
- protected void c_delbefore(EditLine *, int);
- protected void c_delafter(EditLine *, int);
- protected int c_gets(EditLine *, char *);
- protected int c_hpos(EditLine *);
- protected int ch_init(EditLine *);
- protected void ch_reset(EditLine *);
- protected int ch_enlargebufs(EditLine *, size_t);
- protected void ch_end(EditLine *);
- #endif
|