xref: /netbsd-src/bin/ksh/edit.h (revision 4d7e773266e3c3f48566c86c0ad52d51c6454fd1)
1 /*	$NetBSD: edit.h,v 1.2 1997/01/12 19:11:45 tls 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.2 1997/01/12 19:11:45 tls 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 /* emacs.c */
61 int 	x_emacs		ARGS((char *buf, size_t len));
62 void 	x_init_emacs	ARGS((void));
63 void	x_emacs_keys	ARGS((X_chars *ec));
64 /* vi.c */
65 int 	x_vi		ARGS((char *buf, size_t len));
66 
67 
68 #ifdef DEBUG
69 # define D__(x) x
70 #else
71 # define D__(x)
72 #endif
73 
74 /* This lot goes at the END */
75 /* be sure not to interfere with anyone else's idea about EXTERN */
76 #ifdef EXTERN_DEFINED
77 # undef EXTERN_DEFINED
78 # undef EXTERN
79 #endif
80 #undef I__
81 /*
82  * Local Variables:
83  * version-control:t
84  * comment-column:40
85  * End:
86  */
87