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