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