aboutsummaryrefslogtreecommitdiff
path: root/el.h
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2011-03-31 01:00:31 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2011-03-31 01:00:31 +0000
commitf592be44eb2190db09b8cee428090a232d528910 (patch)
tree25f24f997413fa2046d372ed908c8b9cb7184e9b /el.h
parent4d860275f5181ade333c8ae2cc800b925ef43d89 (diff)
downloadsrc-f592be44eb2190db09b8cee428090a232d528910.tar.gz
src-f592be44eb2190db09b8cee428090a232d528910.zip
Vendor import NetBSD's libedit of "2001/09/29 17:52:10 UTC".vendor/NetBSD/libedit/2001-09-29
Obtained from: NetBSD
Notes
Notes: svn path=/vendor/NetBSD/libedit/dist/; revision=220176 svn path=/vendor/NetBSD/libedit/2001-09-29/; revision=220177; tag=vendor/NetBSD/libedit/2001-09-29
Diffstat (limited to 'el.h')
-rw-r--r--el.h95
1 files changed, 54 insertions, 41 deletions
diff --git a/el.h b/el.h
index ec3d53845b18..ac28d0c20fda 100644
--- a/el.h
+++ b/el.h
@@ -1,4 +1,4 @@
-/* $NetBSD: el.h,v 1.2 1997/01/11 06:47:53 lukem Exp $ */
+/* $NetBSD: el.h,v 1.9 2001/09/27 19:29:50 christos Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -42,53 +42,56 @@
* el.h: Internal structures.
*/
#ifndef _h_el
-#define _h_el
+#define _h_el
/*
* Local defaults
*/
-#define KSHVI
-#define VIDEFAULT
-#define ANCHOR
+#define KSHVI
+#define VIDEFAULT
+#define ANCHOR
#include <stdio.h>
#include <sys/types.h>
-#define EL_BUFSIZ 1024 /* Maximum line size */
+#define EL_BUFSIZ 1024 /* Maximum line size */
-#define HANDLE_SIGNALS 1
+#define HANDLE_SIGNALS 1<<0
+#define NO_TTY 1<<1
+#define EDIT_DISABLED 1<<2
typedef int bool_t; /* True or not */
typedef unsigned char el_action_t; /* Index to command array */
typedef struct coord_t { /* Position on the screen */
- int h, v;
+ int h;
+ int v;
} coord_t;
typedef struct el_line_t {
- char *buffer, /* Input line */
- *cursor, /* Cursor position */
- *lastchar, /* Last character */
- *limit; /* Max position */
+ char *buffer; /* Input line */
+ char *cursor; /* Cursor position */
+ char *lastchar; /* Last character */
+ const char *limit; /* Max position */
} el_line_t;
/*
* Editor state
*/
typedef struct el_state_t {
- int inputmode; /* What mode are we in? */
- int doingarg; /* Are we getting an argument? */
- int argument; /* Numeric argument */
- int metanext; /* Is the next char a meta char */
- el_action_t lastcmd; /* Previous command */
+ int inputmode; /* What mode are we in? */
+ int doingarg; /* Are we getting an argument? */
+ int argument; /* Numeric argument */
+ int metanext; /* Is the next char a meta char */
+ el_action_t lastcmd; /* Previous command */
} el_state_t;
/*
* Until we come up with something better...
*/
-#define el_malloc(a) malloc(a)
-#define el_realloc(a,b) realloc(a, b)
-#define el_free(a) free(a)
+#define el_malloc(a) malloc(a)
+#define el_realloc(a,b) realloc(a, b)
+#define el_free(a) free(a)
#include "tty.h"
#include "prompt.h"
@@ -103,29 +106,39 @@ typedef struct el_state_t {
#include "parse.h"
#include "sig.h"
#include "help.h"
+#include "read.h"
struct editline {
- char *el_prog; /* the program name */
- FILE *el_outfile; /* Stdio stuff */
- FILE *el_errfile; /* Stdio stuff */
- int el_infd; /* Input file descriptor */
- int el_flags; /* Various flags. */
- coord_t el_cursor; /* Cursor location */
- char **el_display, /* Real screen image = what is there */
- **el_vdisplay; /* Virtual screen image = what we see */
-
- el_line_t el_line; /* The current line information */
- el_state_t el_state; /* Current editor state */
- el_term_t el_term; /* Terminal dependent stuff */
- el_tty_t el_tty; /* Tty dependent stuff */
- el_refresh_t el_refresh; /* Refresh stuff */
- el_prompt_t el_prompt; /* Prompt stuff */
- el_chared_t el_chared; /* Characted editor stuff */
- el_map_t el_map; /* Key mapping stuff */
- el_key_t el_key; /* Key binding stuff */
- el_history_t el_history; /* History stuff */
- el_search_t el_search; /* Search stuff */
- el_signal_t el_signal; /* Signal handling stuff */
+ char *el_prog; /* the program name */
+ FILE *el_outfile; /* Stdio stuff */
+ FILE *el_errfile; /* Stdio stuff */
+ int el_infd; /* Input file descriptor */
+ int el_flags; /* Various flags. */
+ coord_t el_cursor; /* Cursor location */
+ char **el_display; /* Real screen image = what is there */
+ char **el_vdisplay; /* Virtual screen image = what we see */
+ el_line_t el_line; /* The current line information */
+ el_state_t el_state; /* Current editor state */
+ el_term_t el_term; /* Terminal dependent stuff */
+ el_tty_t el_tty; /* Tty dependent stuff */
+ el_refresh_t el_refresh; /* Refresh stuff */
+ el_prompt_t el_prompt; /* Prompt stuff */
+ el_prompt_t el_rprompt; /* Prompt stuff */
+ el_chared_t el_chared; /* Characted editor stuff */
+ el_map_t el_map; /* Key mapping stuff */
+ el_key_t el_key; /* Key binding stuff */
+ el_history_t el_history; /* History stuff */
+ el_search_t el_search; /* Search stuff */
+ el_signal_t el_signal; /* Signal handling stuff */
+ el_read_t el_read; /* Character reading stuff */
};
+protected int el_editmode(EditLine *, int, char **);
+
+#ifdef DEBUG
+#define EL_ABORT(a) (void) (fprintf(el->el_errfile, "%s, %d: ", \
+ __FILE__, __LINE__), fprintf a, abort())
+#else
+#define EL_ABORT(a) abort()
+#endif
#endif /* _h_el */