2 * Copyright (c) 1992, 1993
3 * The Regents of the University of California. All rights reserved.
5 * This code is derived from software contributed to Berkeley by
6 * Christos Zoulas of Cornell University.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in the
15 * documentation and/or other materials provided with the distribution.
16 * 3. All advertising materials mentioning features or use of this software
17 * must display the following acknowledgement:
18 * This product includes software developed by the University of
19 * California, Berkeley and its contributors.
20 * 4. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission.
24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 * @(#)chared.h 8.1 (Berkeley) 6/4/93
37 * $DragonFly: src/lib/libedit/chared.h,v 1.3 2003/11/12 20:21:29 eirikn Exp $
41 * el.chared.h: Character editor interface
51 #define EL_MAXMACRO 10
54 * This is a issue of basic "vi" look-and-feel. Defining VI_MOVE works
55 * like real vi: i.e. the transition from command<->insert modes moves
58 * On the other hand we really don't want to move the cursor, because
59 * all the editing commands don't include the character under the cursor.
60 * Probably the best fix is to make all the editing commands aware of
66 typedef struct c_macro_t {
73 * Undo information for both vi and emacs
75 typedef struct c_undo_t {
84 * Current action information for vi
86 typedef struct c_vcmd_t {
93 * Kill buffer for emacs
95 typedef struct c_kill_t {
102 * Note that we use both data structures because the user can bind
103 * commands from both editors!
105 typedef struct el_chared_t {
113 #define STReof "^D\b\b"
116 #define isglob(a) (strchr("*[]?", (a)) != NULL)
117 #define isword(a) (isprint(a))
127 #define MODE_INSERT 0
128 #define MODE_REPLACE 1
129 #define MODE_REPLACE_1 2
138 protected int cv__isword (int);
139 protected void cv_delfini (EditLine *);
140 protected char *cv__endword (char *, char *, int);
141 protected int ce__isword (int);
142 protected int c___isword (int);
143 protected void cv_undo (EditLine *, int, int, char *);
144 protected char *cv_next_word (EditLine*, char *, char *, int,
146 protected char *cv_prev_word (EditLine*, char *, char *, int,
148 protected char *c__next_word (char *, char *, int, int (*)(int));
149 protected char *c__prev_word (char *, char *, int, int (*)(int));
150 protected void c_insert (EditLine *, int);
151 protected void c_delbefore (EditLine *, int);
152 protected void c_delafter (EditLine *, int);
153 protected int c_gets (EditLine *, char *);
154 protected int c_hpos (EditLine *);
156 protected int ch_init (EditLine *);
157 protected void ch_reset (EditLine *);
158 protected void ch_end (EditLine *);
160 #endif /* _h_el_chared */