[BACK]Return to edit.h CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / bin / ksh

File: [cvs.NetBSD.org] / src / bin / ksh / edit.h (download)

Revision 1.5, Sat Jul 1 23:12:08 2017 UTC (6 years, 9 months ago) by joerg
Branch: MAIN
CVS Tags: phil-wifi-base, phil-wifi-20200421, phil-wifi-20200411, phil-wifi-20200406, phil-wifi-20191119, phil-wifi-20190609, pgoyette-compat-merge-20190127, pgoyette-compat-base, pgoyette-compat-20190127, pgoyette-compat-20190118, pgoyette-compat-1226, pgoyette-compat-1126, pgoyette-compat-1020, pgoyette-compat-0930, pgoyette-compat-0906, pgoyette-compat-0728, pgoyette-compat-0625, pgoyette-compat-0521, pgoyette-compat-0502, pgoyette-compat-0422, pgoyette-compat-0415, pgoyette-compat-0407, pgoyette-compat-0330, pgoyette-compat-0322, pgoyette-compat-0315, pgoyette-compat, perseant-stdc-iso10646-base, perseant-stdc-iso10646, netbsd-9-base, netbsd-9-3-RELEASE, netbsd-9-2-RELEASE, netbsd-9-1-RELEASE, netbsd-9-0-RELEASE, netbsd-9-0-RC2, netbsd-9-0-RC1, netbsd-9, netbsd-10-base, netbsd-10-0-RELEASE, netbsd-10-0-RC6, netbsd-10-0-RC5, netbsd-10-0-RC4, netbsd-10-0-RC3, netbsd-10-0-RC2, netbsd-10-0-RC1, netbsd-10, is-mlppp-base, is-mlppp, cjep_sun2x-base1, cjep_sun2x-base, cjep_sun2x, cjep_staticlib_x-base1, cjep_staticlib_x-base, cjep_staticlib_x, HEAD
Branch point for: phil-wifi
Changes since 1.4: +3 -3 lines

Kill enough K&R cruft to build with clang again.

/*	$NetBSD: edit.h,v 1.5 2017/07/01 23:12:08 joerg Exp $	*/

/* NAME:
 *      edit.h - globals for edit modes
 *
 * DESCRIPTION:
 *      This header defines various global edit objects.
 *
 * SEE ALSO:
 *      
 *
 * RCSid:
 *      $NetBSD: edit.h,v 1.5 2017/07/01 23:12:08 joerg Exp $
 *
 */

#include <stdbool.h>

/* some useful #defines */
#ifdef EXTERN
# define I__(i) = i
#else
# define I__(i)
# define EXTERN extern
# define EXTERN_DEFINED
#endif

#define	BEL		0x07

/* tty driver characters we are interested in */
typedef struct {
	int erase;
	int kill;
	int werase;
	int intr;
	int quit;
	int eof;
} X_chars;

EXTERN X_chars edchars;

/* x_fc_glob() flags */
#define XCF_COMMAND	BIT(0)	/* Do command completion */
#define XCF_FILE	BIT(1)	/* Do file completion */
#define XCF_FULLPATH	BIT(2)	/* command completion: store full path */
#define XCF_COMMAND_FILE (XCF_COMMAND|XCF_FILE)

/* edit.c */
int 	x_getc		ARGS((void));
void 	x_flush		ARGS((void));
void 	x_putc		ARGS((int c));
void 	x_puts		ARGS((const char *s));
bool 	x_mode(bool onoff);
int 	promptlen	ARGS((const char *cp, const char **spp));
int	x_do_comment	ARGS((char *buf, int bsize, int *lenp));
void	x_print_expansions ARGS((int nwords, char *const *words, int is_command));
int	x_cf_glob ARGS((int flags, const char *buf, int buflen, int pos, int *startp,
			  int *endp, char ***wordsp, int *is_commandp));
int	x_longest_prefix ARGS((int nwords, char *const *words));
int	x_basename ARGS((const char *s, const char *se));
void	x_free_words ARGS((int nwords, char **words));
int	x_escape ARGS((const char *, size_t, int (*)(const char *s, size_t len)));
/* emacs.c */
int 	x_emacs		ARGS((char *buf, size_t len));
void 	x_init_emacs	ARGS((void));
void	x_emacs_keys	ARGS((X_chars *ec));
/* vi.c */
int 	x_vi		ARGS((char *buf, size_t len));


#ifdef DEBUG
# define D__(x) x
#else
# define D__(x)
#endif

/* This lot goes at the END */
/* be sure not to interfere with anyone else's idea about EXTERN */
#ifdef EXTERN_DEFINED
# undef EXTERN_DEFINED
# undef EXTERN
#endif
#undef I__
/*
 * Local Variables:
 * version-control:t
 * comment-column:40
 * End:
 */