xref: /netbsd/bin/ksh/edit.h (revision 6550d01e)
1 /*	$NetBSD: edit.h,v 1.3 1999/11/02 22:06:45 jdolecek Exp $	*/
2 
3 /* NAME:
4  *      edit.h - globals for edit modes
5  *
6  * DESCRIPTION:
7  *      This header defines various global edit objects.
8  *
9  * SEE ALSO:
10  *
11  *
12  * RCSid:
13  *      $NetBSD: edit.h,v 1.3 1999/11/02 22:06:45 jdolecek Exp $
14  *
15  */
16 
17 /* some useful #defines */
18 #ifdef EXTERN
19 # define I__(i) = i
20 #else
21 # define I__(i)
22 # define EXTERN extern
23 # define EXTERN_DEFINED
24 #endif
25 
26 #define	BEL		0x07
27 
28 /* tty driver characters we are interested in */
29 typedef struct {
30 	int erase;
31 	int kill;
32 	int werase;
33 	int intr;
34 	int quit;
35 	int eof;
36 } X_chars;
37 
38 EXTERN X_chars edchars;
39 
40 /* x_fc_glob() flags */
41 #define XCF_COMMAND	BIT(0)	/* Do command completion */
42 #define XCF_FILE	BIT(1)	/* Do file completion */
43 #define XCF_FULLPATH	BIT(2)	/* command completion: store full path */
44 #define XCF_COMMAND_FILE (XCF_COMMAND|XCF_FILE)
45 
46 /* edit.c */
47 int 	x_getc		ARGS((void));
48 void 	x_flush		ARGS((void));
49 void 	x_putc		ARGS((int c));
50 void 	x_puts		ARGS((const char *s));
51 bool_t 	x_mode		ARGS((bool_t onoff));
52 int 	promptlen	ARGS((const char *cp, const char **spp));
53 int	x_do_comment	ARGS((char *buf, int bsize, int *lenp));
54 void	x_print_expansions ARGS((int nwords, char *const *words, int is_command));
55 int	x_cf_glob ARGS((int flags, const char *buf, int buflen, int pos, int *startp,
56 			  int *endp, char ***wordsp, int *is_commandp));
57 int	x_longest_prefix ARGS((int nwords, char *const *words));
58 int	x_basename ARGS((const char *s, const char *se));
59 void	x_free_words ARGS((int nwords, char **words));
60 int	x_escape ARGS((const char *, size_t, int (*)(const char *s, size_t len)));
61 /* emacs.c */
62 int 	x_emacs		ARGS((char *buf, size_t len));
63 void 	x_init_emacs	ARGS((void));
64 void	x_emacs_keys	ARGS((X_chars *ec));
65 /* vi.c */
66 int 	x_vi		ARGS((char *buf, size_t len));
67 
68 
69 #ifdef DEBUG
70 # define D__(x) x
71 #else
72 # define D__(x)
73 #endif
74 
75 /* This lot goes at the END */
76 /* be sure not to interfere with anyone else's idea about EXTERN */
77 #ifdef EXTERN_DEFINED
78 # undef EXTERN_DEFINED
79 # undef EXTERN
80 #endif
81 #undef I__
82 /*
83  * Local Variables:
84  * version-control:t
85  * comment-column:40
86  * End:
87  */
88