xref: /openbsd/bin/ksh/edit.h (revision a6445c1d)
1 /*	$OpenBSD: edit.h,v 1.9 2011/05/30 17:14:35 martynas 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  *      $From: edit.h,v 1.2 1994/05/19 18:32:40 michael Exp michael $
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_cf_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(void);
48 void	x_flush(void);
49 void	x_putc(int);
50 void	x_puts(const char *);
51 bool	x_mode(bool);
52 int	promptlen(const char *, const char **);
53 int	x_do_comment(char *, int, int *);
54 void	x_print_expansions(int, char *const *, int);
55 int	x_cf_glob(int, const char *, int, int, int *, int *, char ***, int *);
56 int	x_longest_prefix(int , char *const *);
57 int	x_basename(const char *, const char *);
58 void	x_free_words(int, char **);
59 int	x_escape(const char *, size_t, int (*)(const char *, size_t));
60 /* emacs.c */
61 int	x_emacs(char *, size_t);
62 void	x_init_emacs(void);
63 void	x_emacs_keys(X_chars *);
64 /* vi.c */
65 int	x_vi(char *, size_t);
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