Get rid of private/public; keep protected (Ingo Schwarze)
This commit is contained in:
parent
6182b56b9d
commit
469d44f8e7
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: chared.c,v 1.52 2016/04/11 00:50:13 christos Exp $ */
|
/* $NetBSD: chared.c,v 1.53 2016/04/11 18:56:31 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1992, 1993
|
* Copyright (c) 1992, 1993
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: chared.c,v 1.52 2016/04/11 00:50:13 christos Exp $");
|
__RCSID("$NetBSD: chared.c,v 1.53 2016/04/11 18:56:31 christos Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint && not SCCSID */
|
#endif /* not lint && not SCCSID */
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ __RCSID("$NetBSD: chared.c,v 1.52 2016/04/11 00:50:13 christos Exp $");
|
||||||
#include "el.h"
|
#include "el.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
private void ch__clearmacro (EditLine *);
|
static void ch__clearmacro (EditLine *);
|
||||||
|
|
||||||
/* value to leave unused in line buffer */
|
/* value to leave unused in line buffer */
|
||||||
#define EL_LEAVE 2
|
#define EL_LEAVE 2
|
||||||
|
@ -489,7 +489,7 @@ ch_reset(EditLine *el, int mclear)
|
||||||
ch__clearmacro(el);
|
ch__clearmacro(el);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void
|
static void
|
||||||
ch__clearmacro(EditLine *el)
|
ch__clearmacro(EditLine *el)
|
||||||
{
|
{
|
||||||
c_macro_t *ma = &el->el_chared.c_macro;
|
c_macro_t *ma = &el->el_chared.c_macro;
|
||||||
|
@ -614,7 +614,7 @@ ch_end(EditLine *el)
|
||||||
/* el_insertstr():
|
/* el_insertstr():
|
||||||
* Insert string at cursorI
|
* Insert string at cursorI
|
||||||
*/
|
*/
|
||||||
public int
|
int
|
||||||
el_winsertstr(EditLine *el, const wchar_t *s)
|
el_winsertstr(EditLine *el, const wchar_t *s)
|
||||||
{
|
{
|
||||||
size_t len;
|
size_t len;
|
||||||
|
@ -636,7 +636,7 @@ el_winsertstr(EditLine *el, const wchar_t *s)
|
||||||
/* el_deletestr():
|
/* el_deletestr():
|
||||||
* Delete num characters before the cursor
|
* Delete num characters before the cursor
|
||||||
*/
|
*/
|
||||||
public void
|
void
|
||||||
el_deletestr(EditLine *el, int n)
|
el_deletestr(EditLine *el, int n)
|
||||||
{
|
{
|
||||||
if (n <= 0)
|
if (n <= 0)
|
||||||
|
@ -654,7 +654,7 @@ el_deletestr(EditLine *el, int n)
|
||||||
/* el_cursor():
|
/* el_cursor():
|
||||||
* Move the cursor to the left or the right of the current position
|
* Move the cursor to the left or the right of the current position
|
||||||
*/
|
*/
|
||||||
public int
|
int
|
||||||
el_cursor(EditLine *el, int n)
|
el_cursor(EditLine *el, int n)
|
||||||
{
|
{
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: chartype.c,v 1.27 2016/04/11 16:06:52 christos Exp $ */
|
/* $NetBSD: chartype.c,v 1.28 2016/04/11 18:56:31 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2009 The NetBSD Foundation, Inc.
|
* Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||||
|
@ -31,7 +31,7 @@
|
||||||
*/
|
*/
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#if !defined(lint) && !defined(SCCSID)
|
#if !defined(lint) && !defined(SCCSID)
|
||||||
__RCSID("$NetBSD: chartype.c,v 1.27 2016/04/11 16:06:52 christos Exp $");
|
__RCSID("$NetBSD: chartype.c,v 1.28 2016/04/11 18:56:31 christos Exp $");
|
||||||
#endif /* not lint && not SCCSID */
|
#endif /* not lint && not SCCSID */
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
@ -42,10 +42,10 @@ __RCSID("$NetBSD: chartype.c,v 1.27 2016/04/11 16:06:52 christos Exp $");
|
||||||
|
|
||||||
#define CT_BUFSIZ ((size_t)1024)
|
#define CT_BUFSIZ ((size_t)1024)
|
||||||
|
|
||||||
private int ct_conv_cbuff_resize(ct_buffer_t *, size_t);
|
static int ct_conv_cbuff_resize(ct_buffer_t *, size_t);
|
||||||
private int ct_conv_wbuff_resize(ct_buffer_t *, size_t);
|
static int ct_conv_wbuff_resize(ct_buffer_t *, size_t);
|
||||||
|
|
||||||
private int
|
static int
|
||||||
ct_conv_cbuff_resize(ct_buffer_t *conv, size_t csize)
|
ct_conv_cbuff_resize(ct_buffer_t *conv, size_t csize)
|
||||||
{
|
{
|
||||||
void *p;
|
void *p;
|
||||||
|
@ -66,7 +66,7 @@ ct_conv_cbuff_resize(ct_buffer_t *conv, size_t csize)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int
|
static int
|
||||||
ct_conv_wbuff_resize(ct_buffer_t *conv, size_t wsize)
|
ct_conv_wbuff_resize(ct_buffer_t *conv, size_t wsize)
|
||||||
{
|
{
|
||||||
void *p;
|
void *p;
|
||||||
|
@ -88,7 +88,7 @@ ct_conv_wbuff_resize(ct_buffer_t *conv, size_t wsize)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public char *
|
char *
|
||||||
ct_encode_string(const wchar_t *s, ct_buffer_t *conv)
|
ct_encode_string(const wchar_t *s, ct_buffer_t *conv)
|
||||||
{
|
{
|
||||||
char *dst;
|
char *dst;
|
||||||
|
@ -118,7 +118,7 @@ ct_encode_string(const wchar_t *s, ct_buffer_t *conv)
|
||||||
return conv->cbuff;
|
return conv->cbuff;
|
||||||
}
|
}
|
||||||
|
|
||||||
public wchar_t *
|
wchar_t *
|
||||||
ct_decode_string(const char *s, ct_buffer_t *conv)
|
ct_decode_string(const char *s, ct_buffer_t *conv)
|
||||||
{
|
{
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: chartype.h,v 1.30 2016/04/11 16:06:52 christos Exp $ */
|
/* $NetBSD: chartype.h,v 1.31 2016/04/11 18:56:31 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2009 The NetBSD Foundation, Inc.
|
* Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||||
|
@ -60,10 +60,10 @@ typedef struct ct_buffer_t {
|
||||||
} ct_buffer_t;
|
} ct_buffer_t;
|
||||||
|
|
||||||
/* Encode a wide-character string and return the UTF-8 encoded result. */
|
/* Encode a wide-character string and return the UTF-8 encoded result. */
|
||||||
public char *ct_encode_string(const wchar_t *, ct_buffer_t *);
|
char *ct_encode_string(const wchar_t *, ct_buffer_t *);
|
||||||
|
|
||||||
/* Decode a (multi)?byte string and return the wide-character string result. */
|
/* Decode a (multi)?byte string and return the wide-character string result. */
|
||||||
public wchar_t *ct_decode_string(const char *, ct_buffer_t *);
|
wchar_t *ct_decode_string(const char *, ct_buffer_t *);
|
||||||
|
|
||||||
/* Decode a (multi)?byte argv string array.
|
/* Decode a (multi)?byte argv string array.
|
||||||
* The pointer returned must be free()d when done. */
|
* The pointer returned must be free()d when done. */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: el.c,v 1.87 2016/04/11 00:50:13 christos Exp $ */
|
/* $NetBSD: el.c,v 1.88 2016/04/11 18:56:31 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1992, 1993
|
* Copyright (c) 1992, 1993
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94";
|
static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: el.c,v 1.87 2016/04/11 00:50:13 christos Exp $");
|
__RCSID("$NetBSD: el.c,v 1.88 2016/04/11 18:56:31 christos Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint && not SCCSID */
|
#endif /* not lint && not SCCSID */
|
||||||
|
|
||||||
|
@ -59,14 +59,14 @@ __RCSID("$NetBSD: el.c,v 1.87 2016/04/11 00:50:13 christos Exp $");
|
||||||
/* el_init():
|
/* el_init():
|
||||||
* Initialize editline and set default parameters.
|
* Initialize editline and set default parameters.
|
||||||
*/
|
*/
|
||||||
public EditLine *
|
EditLine *
|
||||||
el_init(const char *prog, FILE *fin, FILE *fout, FILE *ferr)
|
el_init(const char *prog, FILE *fin, FILE *fout, FILE *ferr)
|
||||||
{
|
{
|
||||||
return el_init_fd(prog, fin, fout, ferr, fileno(fin), fileno(fout),
|
return el_init_fd(prog, fin, fout, ferr, fileno(fin), fileno(fout),
|
||||||
fileno(ferr));
|
fileno(ferr));
|
||||||
}
|
}
|
||||||
|
|
||||||
public EditLine *
|
EditLine *
|
||||||
el_init_fd(const char *prog, FILE *fin, FILE *fout, FILE *ferr,
|
el_init_fd(const char *prog, FILE *fin, FILE *fout, FILE *ferr,
|
||||||
int fdin, int fdout, int fderr)
|
int fdin, int fdout, int fderr)
|
||||||
{
|
{
|
||||||
|
@ -123,7 +123,7 @@ el_init_fd(const char *prog, FILE *fin, FILE *fout, FILE *ferr,
|
||||||
/* el_end():
|
/* el_end():
|
||||||
* Clean up.
|
* Clean up.
|
||||||
*/
|
*/
|
||||||
public void
|
void
|
||||||
el_end(EditLine *el)
|
el_end(EditLine *el)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ el_end(EditLine *el)
|
||||||
/* el_reset():
|
/* el_reset():
|
||||||
* Reset the tty and the parser
|
* Reset the tty and the parser
|
||||||
*/
|
*/
|
||||||
public void
|
void
|
||||||
el_reset(EditLine *el)
|
el_reset(EditLine *el)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -167,7 +167,7 @@ el_reset(EditLine *el)
|
||||||
/* el_set():
|
/* el_set():
|
||||||
* set the editline parameters
|
* set the editline parameters
|
||||||
*/
|
*/
|
||||||
public int
|
int
|
||||||
el_wset(EditLine *el, int op, ...)
|
el_wset(EditLine *el, int op, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
@ -380,7 +380,7 @@ el_wset(EditLine *el, int op, ...)
|
||||||
/* el_get():
|
/* el_get():
|
||||||
* retrieve the editline parameters
|
* retrieve the editline parameters
|
||||||
*/
|
*/
|
||||||
public int
|
int
|
||||||
el_wget(EditLine *el, int op, ...)
|
el_wget(EditLine *el, int op, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
@ -493,7 +493,7 @@ el_wget(EditLine *el, int op, ...)
|
||||||
/* el_line():
|
/* el_line():
|
||||||
* Return editing info
|
* Return editing info
|
||||||
*/
|
*/
|
||||||
public const LineInfoW *
|
const LineInfoW *
|
||||||
el_wline(EditLine *el)
|
el_wline(EditLine *el)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -504,7 +504,7 @@ el_wline(EditLine *el)
|
||||||
/* el_source():
|
/* el_source():
|
||||||
* Source a file
|
* Source a file
|
||||||
*/
|
*/
|
||||||
public int
|
int
|
||||||
el_source(EditLine *el, const char *fname)
|
el_source(EditLine *el, const char *fname)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
@ -576,7 +576,7 @@ el_source(EditLine *el, const char *fname)
|
||||||
/* el_resize():
|
/* el_resize():
|
||||||
* Called from program when terminal is resized
|
* Called from program when terminal is resized
|
||||||
*/
|
*/
|
||||||
public void
|
void
|
||||||
el_resize(EditLine *el)
|
el_resize(EditLine *el)
|
||||||
{
|
{
|
||||||
int lins, cols;
|
int lins, cols;
|
||||||
|
@ -597,7 +597,7 @@ el_resize(EditLine *el)
|
||||||
/* el_beep():
|
/* el_beep():
|
||||||
* Called from the program to beep
|
* Called from the program to beep
|
||||||
*/
|
*/
|
||||||
public void
|
void
|
||||||
el_beep(EditLine *el)
|
el_beep(EditLine *el)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: eln.c,v 1.32 2016/04/11 00:50:13 christos Exp $ */
|
/* $NetBSD: eln.c,v 1.33 2016/04/11 18:56:31 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 2009 The NetBSD Foundation, Inc.
|
* Copyright (c) 2009 The NetBSD Foundation, Inc.
|
||||||
|
@ -27,7 +27,7 @@
|
||||||
*/
|
*/
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#if !defined(lint) && !defined(SCCSID)
|
#if !defined(lint) && !defined(SCCSID)
|
||||||
__RCSID("$NetBSD: eln.c,v 1.32 2016/04/11 00:50:13 christos Exp $");
|
__RCSID("$NetBSD: eln.c,v 1.33 2016/04/11 18:56:31 christos Exp $");
|
||||||
#endif /* not lint && not SCCSID */
|
#endif /* not lint && not SCCSID */
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
@ -37,7 +37,7 @@ __RCSID("$NetBSD: eln.c,v 1.32 2016/04/11 00:50:13 christos Exp $");
|
||||||
|
|
||||||
#include "el.h"
|
#include "el.h"
|
||||||
|
|
||||||
public int
|
int
|
||||||
el_getc(EditLine *el, char *cp)
|
el_getc(EditLine *el, char *cp)
|
||||||
{
|
{
|
||||||
int num_read;
|
int num_read;
|
||||||
|
@ -58,7 +58,7 @@ el_getc(EditLine *el, char *cp)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void
|
void
|
||||||
el_push(EditLine *el, const char *str)
|
el_push(EditLine *el, const char *str)
|
||||||
{
|
{
|
||||||
/* Using multibyte->wide string decoding works fine under single-byte
|
/* Using multibyte->wide string decoding works fine under single-byte
|
||||||
|
@ -67,7 +67,7 @@ el_push(EditLine *el, const char *str)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public const char *
|
const char *
|
||||||
el_gets(EditLine *el, int *nread)
|
el_gets(EditLine *el, int *nread)
|
||||||
{
|
{
|
||||||
const wchar_t *tmp;
|
const wchar_t *tmp;
|
||||||
|
@ -85,7 +85,7 @@ el_gets(EditLine *el, int *nread)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int
|
int
|
||||||
el_parse(EditLine *el, int argc, const char *argv[])
|
el_parse(EditLine *el, int argc, const char *argv[])
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -102,7 +102,7 @@ el_parse(EditLine *el, int argc, const char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int
|
int
|
||||||
el_set(EditLine *el, int op, ...)
|
el_set(EditLine *el, int op, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
@ -272,7 +272,7 @@ out:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public int
|
int
|
||||||
el_get(EditLine *el, int op, ...)
|
el_get(EditLine *el, int op, ...)
|
||||||
{
|
{
|
||||||
va_list ap;
|
va_list ap;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: history.c,v 1.56 2016/04/11 16:06:52 christos Exp $ */
|
/* $NetBSD: history.c,v 1.57 2016/04/11 18:56:31 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1992, 1993
|
* Copyright (c) 1992, 1993
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)history.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)history.c 8.1 (Berkeley) 6/4/93";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: history.c,v 1.56 2016/04/11 16:06:52 christos Exp $");
|
__RCSID("$NetBSD: history.c,v 1.57 2016/04/11 18:56:31 christos Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint && not SCCSID */
|
#endif /* not lint && not SCCSID */
|
||||||
|
|
||||||
|
@ -133,19 +133,20 @@ typedef struct {
|
||||||
} HistEventPrivate;
|
} HistEventPrivate;
|
||||||
|
|
||||||
|
|
||||||
|
static int history_setsize(TYPE(History) *, TYPE(HistEvent) *, int);
|
||||||
private int history_setsize(TYPE(History) *, TYPE(HistEvent) *, int);
|
static int history_getsize(TYPE(History) *, TYPE(HistEvent) *);
|
||||||
private int history_getsize(TYPE(History) *, TYPE(HistEvent) *);
|
static int history_setunique(TYPE(History) *, TYPE(HistEvent) *, int);
|
||||||
private int history_setunique(TYPE(History) *, TYPE(HistEvent) *, int);
|
static int history_getunique(TYPE(History) *, TYPE(HistEvent) *);
|
||||||
private int history_getunique(TYPE(History) *, TYPE(HistEvent) *);
|
static int history_set_fun(TYPE(History) *, TYPE(History) *);
|
||||||
private int history_set_fun(TYPE(History) *, TYPE(History) *);
|
static int history_load(TYPE(History) *, const char *);
|
||||||
private int history_load(TYPE(History) *, const char *);
|
static int history_save(TYPE(History) *, const char *);
|
||||||
private int history_save(TYPE(History) *, const char *);
|
static int history_save_fp(TYPE(History) *, FILE *);
|
||||||
private int history_save_fp(TYPE(History) *, FILE *);
|
static int history_prev_event(TYPE(History) *, TYPE(HistEvent) *, int);
|
||||||
private int history_prev_event(TYPE(History) *, TYPE(HistEvent) *, int);
|
static int history_next_event(TYPE(History) *, TYPE(HistEvent) *, int);
|
||||||
private int history_next_event(TYPE(History) *, TYPE(HistEvent) *, int);
|
static int history_next_string(TYPE(History) *, TYPE(HistEvent) *,
|
||||||
private int history_next_string(TYPE(History) *, TYPE(HistEvent) *, const Char *);
|
const Char *);
|
||||||
private int history_prev_string(TYPE(History) *, TYPE(HistEvent) *, const Char *);
|
static int history_prev_string(TYPE(History) *, TYPE(HistEvent) *,
|
||||||
|
const Char *);
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************/
|
/***********************************************************************/
|
||||||
|
@ -170,23 +171,23 @@ typedef struct history_t {
|
||||||
#define H_UNIQUE 1 /* Store only unique elements */
|
#define H_UNIQUE 1 /* Store only unique elements */
|
||||||
} history_t;
|
} history_t;
|
||||||
|
|
||||||
private int history_def_next(void *, TYPE(HistEvent) *);
|
static int history_def_next(void *, TYPE(HistEvent) *);
|
||||||
private int history_def_first(void *, TYPE(HistEvent) *);
|
static int history_def_first(void *, TYPE(HistEvent) *);
|
||||||
private int history_def_prev(void *, TYPE(HistEvent) *);
|
static int history_def_prev(void *, TYPE(HistEvent) *);
|
||||||
private int history_def_last(void *, TYPE(HistEvent) *);
|
static int history_def_last(void *, TYPE(HistEvent) *);
|
||||||
private int history_def_curr(void *, TYPE(HistEvent) *);
|
static int history_def_curr(void *, TYPE(HistEvent) *);
|
||||||
private int history_def_set(void *, TYPE(HistEvent) *, const int);
|
static int history_def_set(void *, TYPE(HistEvent) *, const int);
|
||||||
private void history_def_clear(void *, TYPE(HistEvent) *);
|
static void history_def_clear(void *, TYPE(HistEvent) *);
|
||||||
private int history_def_enter(void *, TYPE(HistEvent) *, const Char *);
|
static int history_def_enter(void *, TYPE(HistEvent) *, const Char *);
|
||||||
private int history_def_add(void *, TYPE(HistEvent) *, const Char *);
|
static int history_def_add(void *, TYPE(HistEvent) *, const Char *);
|
||||||
private int history_def_del(void *, TYPE(HistEvent) *, const int);
|
static int history_def_del(void *, TYPE(HistEvent) *, const int);
|
||||||
|
|
||||||
private int history_def_init(void **, TYPE(HistEvent) *, int);
|
static int history_def_init(void **, TYPE(HistEvent) *, int);
|
||||||
private int history_def_insert(history_t *, TYPE(HistEvent) *, const Char *);
|
static int history_def_insert(history_t *, TYPE(HistEvent) *, const Char *);
|
||||||
private void history_def_delete(history_t *, TYPE(HistEvent) *, hentry_t *);
|
static void history_def_delete(history_t *, TYPE(HistEvent) *, hentry_t *);
|
||||||
|
|
||||||
private int history_deldata_nth(history_t *, TYPE(HistEvent) *, int, void **);
|
static int history_deldata_nth(history_t *, TYPE(HistEvent) *, int, void **);
|
||||||
private int history_set_nth(void *, TYPE(HistEvent) *, int);
|
static int history_set_nth(void *, TYPE(HistEvent) *, int);
|
||||||
|
|
||||||
#define history_def_setsize(p, num)(void) (((history_t *)p)->max = (num))
|
#define history_def_setsize(p, num)(void) (((history_t *)p)->max = (num))
|
||||||
#define history_def_getsize(p) (((history_t *)p)->cur)
|
#define history_def_getsize(p) (((history_t *)p)->cur)
|
||||||
|
@ -243,7 +244,7 @@ static const Char *const he_errlist[] = {
|
||||||
/* history_def_first():
|
/* history_def_first():
|
||||||
* Default function to return the first event in the history.
|
* Default function to return the first event in the history.
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_def_first(void *p, TYPE(HistEvent) *ev)
|
history_def_first(void *p, TYPE(HistEvent) *ev)
|
||||||
{
|
{
|
||||||
history_t *h = (history_t *) p;
|
history_t *h = (history_t *) p;
|
||||||
|
@ -263,7 +264,7 @@ history_def_first(void *p, TYPE(HistEvent) *ev)
|
||||||
/* history_def_last():
|
/* history_def_last():
|
||||||
* Default function to return the last event in the history.
|
* Default function to return the last event in the history.
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_def_last(void *p, TYPE(HistEvent) *ev)
|
history_def_last(void *p, TYPE(HistEvent) *ev)
|
||||||
{
|
{
|
||||||
history_t *h = (history_t *) p;
|
history_t *h = (history_t *) p;
|
||||||
|
@ -283,7 +284,7 @@ history_def_last(void *p, TYPE(HistEvent) *ev)
|
||||||
/* history_def_next():
|
/* history_def_next():
|
||||||
* Default function to return the next event in the history.
|
* Default function to return the next event in the history.
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_def_next(void *p, TYPE(HistEvent) *ev)
|
history_def_next(void *p, TYPE(HistEvent) *ev)
|
||||||
{
|
{
|
||||||
history_t *h = (history_t *) p;
|
history_t *h = (history_t *) p;
|
||||||
|
@ -308,7 +309,7 @@ history_def_next(void *p, TYPE(HistEvent) *ev)
|
||||||
/* history_def_prev():
|
/* history_def_prev():
|
||||||
* Default function to return the previous event in the history.
|
* Default function to return the previous event in the history.
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_def_prev(void *p, TYPE(HistEvent) *ev)
|
history_def_prev(void *p, TYPE(HistEvent) *ev)
|
||||||
{
|
{
|
||||||
history_t *h = (history_t *) p;
|
history_t *h = (history_t *) p;
|
||||||
|
@ -334,7 +335,7 @@ history_def_prev(void *p, TYPE(HistEvent) *ev)
|
||||||
/* history_def_curr():
|
/* history_def_curr():
|
||||||
* Default function to return the current event in the history.
|
* Default function to return the current event in the history.
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_def_curr(void *p, TYPE(HistEvent) *ev)
|
history_def_curr(void *p, TYPE(HistEvent) *ev)
|
||||||
{
|
{
|
||||||
history_t *h = (history_t *) p;
|
history_t *h = (history_t *) p;
|
||||||
|
@ -355,7 +356,7 @@ history_def_curr(void *p, TYPE(HistEvent) *ev)
|
||||||
* Default function to set the current event in the history to the
|
* Default function to set the current event in the history to the
|
||||||
* given one.
|
* given one.
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_def_set(void *p, TYPE(HistEvent) *ev, const int n)
|
history_def_set(void *p, TYPE(HistEvent) *ev, const int n)
|
||||||
{
|
{
|
||||||
history_t *h = (history_t *) p;
|
history_t *h = (history_t *) p;
|
||||||
|
@ -382,7 +383,7 @@ history_def_set(void *p, TYPE(HistEvent) *ev, const int n)
|
||||||
* Default function to set the current event in the history to the
|
* Default function to set the current event in the history to the
|
||||||
* n-th one.
|
* n-th one.
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_set_nth(void *p, TYPE(HistEvent) *ev, int n)
|
history_set_nth(void *p, TYPE(HistEvent) *ev, int n)
|
||||||
{
|
{
|
||||||
history_t *h = (history_t *) p;
|
history_t *h = (history_t *) p;
|
||||||
|
@ -406,7 +407,7 @@ history_set_nth(void *p, TYPE(HistEvent) *ev, int n)
|
||||||
/* history_def_add():
|
/* history_def_add():
|
||||||
* Append string to element
|
* Append string to element
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_def_add(void *p, TYPE(HistEvent) *ev, const Char *str)
|
history_def_add(void *p, TYPE(HistEvent) *ev, const Char *str)
|
||||||
{
|
{
|
||||||
history_t *h = (history_t *) p;
|
history_t *h = (history_t *) p;
|
||||||
|
@ -432,7 +433,7 @@ history_def_add(void *p, TYPE(HistEvent) *ev, const Char *str)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private int
|
static int
|
||||||
history_deldata_nth(history_t *h, TYPE(HistEvent) *ev,
|
history_deldata_nth(history_t *h, TYPE(HistEvent) *ev,
|
||||||
int num, void **data)
|
int num, void **data)
|
||||||
{
|
{
|
||||||
|
@ -454,7 +455,7 @@ history_deldata_nth(history_t *h, TYPE(HistEvent) *ev,
|
||||||
* Delete element hp of the h list
|
* Delete element hp of the h list
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
private int
|
static int
|
||||||
history_def_del(void *p, TYPE(HistEvent) *ev __attribute__((__unused__)),
|
history_def_del(void *p, TYPE(HistEvent) *ev __attribute__((__unused__)),
|
||||||
const int num)
|
const int num)
|
||||||
{
|
{
|
||||||
|
@ -472,7 +473,7 @@ history_def_del(void *p, TYPE(HistEvent) *ev __attribute__((__unused__)),
|
||||||
* Delete element hp of the h list
|
* Delete element hp of the h list
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
private void
|
static void
|
||||||
history_def_delete(history_t *h,
|
history_def_delete(history_t *h,
|
||||||
TYPE(HistEvent) *ev __attribute__((__unused__)), hentry_t *hp)
|
TYPE(HistEvent) *ev __attribute__((__unused__)), hentry_t *hp)
|
||||||
{
|
{
|
||||||
|
@ -495,7 +496,7 @@ history_def_delete(history_t *h,
|
||||||
/* history_def_insert():
|
/* history_def_insert():
|
||||||
* Insert element with string str in the h list
|
* Insert element with string str in the h list
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_def_insert(history_t *h, TYPE(HistEvent) *ev, const Char *str)
|
history_def_insert(history_t *h, TYPE(HistEvent) *ev, const Char *str)
|
||||||
{
|
{
|
||||||
hentry_t *c;
|
hentry_t *c;
|
||||||
|
@ -527,7 +528,7 @@ oomem:
|
||||||
/* history_def_enter():
|
/* history_def_enter():
|
||||||
* Default function to enter an item in the history
|
* Default function to enter an item in the history
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_def_enter(void *p, TYPE(HistEvent) *ev, const Char *str)
|
history_def_enter(void *p, TYPE(HistEvent) *ev, const Char *str)
|
||||||
{
|
{
|
||||||
history_t *h = (history_t *) p;
|
history_t *h = (history_t *) p;
|
||||||
|
@ -554,7 +555,7 @@ history_def_enter(void *p, TYPE(HistEvent) *ev, const Char *str)
|
||||||
* Default history initialization function
|
* Default history initialization function
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
private int
|
static int
|
||||||
history_def_init(void **p, TYPE(HistEvent) *ev __attribute__((__unused__)), int n)
|
history_def_init(void **p, TYPE(HistEvent) *ev __attribute__((__unused__)), int n)
|
||||||
{
|
{
|
||||||
history_t *h = (history_t *) h_malloc(sizeof(*h));
|
history_t *h = (history_t *) h_malloc(sizeof(*h));
|
||||||
|
@ -579,7 +580,7 @@ history_def_init(void **p, TYPE(HistEvent) *ev __attribute__((__unused__)), int
|
||||||
/* history_def_clear():
|
/* history_def_clear():
|
||||||
* Default history cleanup function
|
* Default history cleanup function
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
history_def_clear(void *p, TYPE(HistEvent) *ev)
|
history_def_clear(void *p, TYPE(HistEvent) *ev)
|
||||||
{
|
{
|
||||||
history_t *h = (history_t *) p;
|
history_t *h = (history_t *) p;
|
||||||
|
@ -599,7 +600,7 @@ history_def_clear(void *p, TYPE(HistEvent) *ev)
|
||||||
/* history_init():
|
/* history_init():
|
||||||
* Initialization function.
|
* Initialization function.
|
||||||
*/
|
*/
|
||||||
public TYPE(History) *
|
TYPE(History) *
|
||||||
FUN(history,init)(void)
|
FUN(history,init)(void)
|
||||||
{
|
{
|
||||||
TYPE(HistEvent) ev;
|
TYPE(HistEvent) ev;
|
||||||
|
@ -630,7 +631,7 @@ FUN(history,init)(void)
|
||||||
/* history_end():
|
/* history_end():
|
||||||
* clean up history;
|
* clean up history;
|
||||||
*/
|
*/
|
||||||
public void
|
void
|
||||||
FUN(history,end)(TYPE(History) *h)
|
FUN(history,end)(TYPE(History) *h)
|
||||||
{
|
{
|
||||||
TYPE(HistEvent) ev;
|
TYPE(HistEvent) ev;
|
||||||
|
@ -646,7 +647,7 @@ FUN(history,end)(TYPE(History) *h)
|
||||||
/* history_setsize():
|
/* history_setsize():
|
||||||
* Set history number of events
|
* Set history number of events
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_setsize(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
|
history_setsize(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -666,7 +667,7 @@ history_setsize(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
|
||||||
/* history_getsize():
|
/* history_getsize():
|
||||||
* Get number of events currently in history
|
* Get number of events currently in history
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_getsize(TYPE(History) *h, TYPE(HistEvent) *ev)
|
history_getsize(TYPE(History) *h, TYPE(HistEvent) *ev)
|
||||||
{
|
{
|
||||||
if (h->h_next != history_def_next) {
|
if (h->h_next != history_def_next) {
|
||||||
|
@ -685,7 +686,7 @@ history_getsize(TYPE(History) *h, TYPE(HistEvent) *ev)
|
||||||
/* history_setunique():
|
/* history_setunique():
|
||||||
* Set if adjacent equal events should not be entered in history.
|
* Set if adjacent equal events should not be entered in history.
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_setunique(TYPE(History) *h, TYPE(HistEvent) *ev, int uni)
|
history_setunique(TYPE(History) *h, TYPE(HistEvent) *ev, int uni)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -701,7 +702,7 @@ history_setunique(TYPE(History) *h, TYPE(HistEvent) *ev, int uni)
|
||||||
/* history_getunique():
|
/* history_getunique():
|
||||||
* Get if adjacent equal events should not be entered in history.
|
* Get if adjacent equal events should not be entered in history.
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_getunique(TYPE(History) *h, TYPE(HistEvent) *ev)
|
history_getunique(TYPE(History) *h, TYPE(HistEvent) *ev)
|
||||||
{
|
{
|
||||||
if (h->h_next != history_def_next) {
|
if (h->h_next != history_def_next) {
|
||||||
|
@ -716,7 +717,7 @@ history_getunique(TYPE(History) *h, TYPE(HistEvent) *ev)
|
||||||
/* history_set_fun():
|
/* history_set_fun():
|
||||||
* Set history functions
|
* Set history functions
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_set_fun(TYPE(History) *h, TYPE(History) *nh)
|
history_set_fun(TYPE(History) *h, TYPE(History) *nh)
|
||||||
{
|
{
|
||||||
TYPE(HistEvent) ev;
|
TYPE(HistEvent) ev;
|
||||||
|
@ -763,7 +764,7 @@ history_set_fun(TYPE(History) *h, TYPE(History) *nh)
|
||||||
/* history_load():
|
/* history_load():
|
||||||
* TYPE(History) load function
|
* TYPE(History) load function
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_load(TYPE(History) *h, const char *fname)
|
history_load(TYPE(History) *h, const char *fname)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
@ -823,7 +824,7 @@ done:
|
||||||
/* history_save_fp():
|
/* history_save_fp():
|
||||||
* TYPE(History) save function
|
* TYPE(History) save function
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_save_fp(TYPE(History) *h, FILE *fp)
|
history_save_fp(TYPE(History) *h, FILE *fp)
|
||||||
{
|
{
|
||||||
TYPE(HistEvent) ev;
|
TYPE(HistEvent) ev;
|
||||||
|
@ -870,7 +871,7 @@ done:
|
||||||
/* history_save():
|
/* history_save():
|
||||||
* History save function
|
* History save function
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_save(TYPE(History) *h, const char *fname)
|
history_save(TYPE(History) *h, const char *fname)
|
||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
@ -889,7 +890,7 @@ history_save(TYPE(History) *h, const char *fname)
|
||||||
/* history_prev_event():
|
/* history_prev_event():
|
||||||
* Find the previous event, with number given
|
* Find the previous event, with number given
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_prev_event(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
|
history_prev_event(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
|
@ -903,7 +904,7 @@ history_prev_event(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private int
|
static int
|
||||||
history_next_evdata(TYPE(History) *h, TYPE(HistEvent) *ev, int num, void **d)
|
history_next_evdata(TYPE(History) *h, TYPE(HistEvent) *ev, int num, void **d)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
|
@ -923,7 +924,7 @@ history_next_evdata(TYPE(History) *h, TYPE(HistEvent) *ev, int num, void **d)
|
||||||
/* history_next_event():
|
/* history_next_event():
|
||||||
* Find the next event, with number given
|
* Find the next event, with number given
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_next_event(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
|
history_next_event(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
|
@ -940,7 +941,7 @@ history_next_event(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
|
||||||
/* history_prev_string():
|
/* history_prev_string():
|
||||||
* Find the previous event beginning with string
|
* Find the previous event beginning with string
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_prev_string(TYPE(History) *h, TYPE(HistEvent) *ev, const Char *str)
|
history_prev_string(TYPE(History) *h, TYPE(HistEvent) *ev, const Char *str)
|
||||||
{
|
{
|
||||||
size_t len = Strlen(str);
|
size_t len = Strlen(str);
|
||||||
|
@ -958,7 +959,7 @@ history_prev_string(TYPE(History) *h, TYPE(HistEvent) *ev, const Char *str)
|
||||||
/* history_next_string():
|
/* history_next_string():
|
||||||
* Find the next event beginning with string
|
* Find the next event beginning with string
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
history_next_string(TYPE(History) *h, TYPE(HistEvent) *ev, const Char *str)
|
history_next_string(TYPE(History) *h, TYPE(HistEvent) *ev, const Char *str)
|
||||||
{
|
{
|
||||||
size_t len = Strlen(str);
|
size_t len = Strlen(str);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: keymacro.c,v 1.18 2016/04/11 00:50:13 christos Exp $ */
|
/* $NetBSD: keymacro.c,v 1.19 2016/04/11 18:56:31 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1992, 1993
|
* Copyright (c) 1992, 1993
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)key.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)key.c 8.1 (Berkeley) 6/4/93";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: keymacro.c,v 1.18 2016/04/11 00:50:13 christos Exp $");
|
__RCSID("$NetBSD: keymacro.c,v 1.19 2016/04/11 18:56:31 christos Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint && not SCCSID */
|
#endif /* not lint && not SCCSID */
|
||||||
|
|
||||||
|
@ -81,18 +81,18 @@ struct keymacro_node_t {
|
||||||
struct keymacro_node_t *sibling;/* ptr to another key with same prefix*/
|
struct keymacro_node_t *sibling;/* ptr to another key with same prefix*/
|
||||||
};
|
};
|
||||||
|
|
||||||
private int node_trav(EditLine *, keymacro_node_t *, wchar_t *,
|
static int node_trav(EditLine *, keymacro_node_t *, wchar_t *,
|
||||||
keymacro_value_t *);
|
keymacro_value_t *);
|
||||||
private int node__try(EditLine *, keymacro_node_t *,
|
static int node__try(EditLine *, keymacro_node_t *,
|
||||||
const wchar_t *, keymacro_value_t *, int);
|
const wchar_t *, keymacro_value_t *, int);
|
||||||
private keymacro_node_t *node__get(wint_t);
|
static keymacro_node_t *node__get(wint_t);
|
||||||
private void node__free(keymacro_node_t *);
|
static void node__free(keymacro_node_t *);
|
||||||
private void node__put(EditLine *, keymacro_node_t *);
|
static void node__put(EditLine *, keymacro_node_t *);
|
||||||
private int node__delete(EditLine *, keymacro_node_t **,
|
static int node__delete(EditLine *, keymacro_node_t **,
|
||||||
const wchar_t *);
|
const wchar_t *);
|
||||||
private int node_lookup(EditLine *, const wchar_t *,
|
static int node_lookup(EditLine *, const wchar_t *,
|
||||||
keymacro_node_t *, size_t);
|
keymacro_node_t *, size_t);
|
||||||
private int node_enum(EditLine *, keymacro_node_t *, size_t);
|
static int node_enum(EditLine *, keymacro_node_t *, size_t);
|
||||||
|
|
||||||
#define KEY_BUFSIZ EL_BUFSIZ
|
#define KEY_BUFSIZ EL_BUFSIZ
|
||||||
|
|
||||||
|
@ -276,7 +276,7 @@ keymacro_print(EditLine *el, const wchar_t *key)
|
||||||
* recursively traverses node in tree until match or mismatch is
|
* recursively traverses node in tree until match or mismatch is
|
||||||
* found. May read in more characters.
|
* found. May read in more characters.
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
node_trav(EditLine *el, keymacro_node_t *ptr, wchar_t *ch,
|
node_trav(EditLine *el, keymacro_node_t *ptr, wchar_t *ch,
|
||||||
keymacro_value_t *val)
|
keymacro_value_t *val)
|
||||||
{
|
{
|
||||||
|
@ -314,7 +314,7 @@ node_trav(EditLine *el, keymacro_node_t *ptr, wchar_t *ch,
|
||||||
/* node__try():
|
/* node__try():
|
||||||
* Find a node that matches *str or allocate a new one
|
* Find a node that matches *str or allocate a new one
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
node__try(EditLine *el, keymacro_node_t *ptr, const wchar_t *str,
|
node__try(EditLine *el, keymacro_node_t *ptr, const wchar_t *str,
|
||||||
keymacro_value_t *val, int ntype)
|
keymacro_value_t *val, int ntype)
|
||||||
{
|
{
|
||||||
|
@ -377,7 +377,7 @@ node__try(EditLine *el, keymacro_node_t *ptr, const wchar_t *str,
|
||||||
/* node__delete():
|
/* node__delete():
|
||||||
* Delete node that matches str
|
* Delete node that matches str
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
node__delete(EditLine *el, keymacro_node_t **inptr, const wchar_t *str)
|
node__delete(EditLine *el, keymacro_node_t **inptr, const wchar_t *str)
|
||||||
{
|
{
|
||||||
keymacro_node_t *ptr;
|
keymacro_node_t *ptr;
|
||||||
|
@ -425,7 +425,7 @@ node__delete(EditLine *el, keymacro_node_t **inptr, const wchar_t *str)
|
||||||
/* node__put():
|
/* node__put():
|
||||||
* Puts a tree of nodes onto free list using free(3).
|
* Puts a tree of nodes onto free list using free(3).
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
node__put(EditLine *el, keymacro_node_t *ptr)
|
node__put(EditLine *el, keymacro_node_t *ptr)
|
||||||
{
|
{
|
||||||
if (ptr == NULL)
|
if (ptr == NULL)
|
||||||
|
@ -457,7 +457,7 @@ node__put(EditLine *el, keymacro_node_t *ptr)
|
||||||
/* node__get():
|
/* node__get():
|
||||||
* Returns pointer to a keymacro_node_t for ch.
|
* Returns pointer to a keymacro_node_t for ch.
|
||||||
*/
|
*/
|
||||||
private keymacro_node_t *
|
static keymacro_node_t *
|
||||||
node__get(wint_t ch)
|
node__get(wint_t ch)
|
||||||
{
|
{
|
||||||
keymacro_node_t *ptr;
|
keymacro_node_t *ptr;
|
||||||
|
@ -473,7 +473,7 @@ node__get(wint_t ch)
|
||||||
return ptr;
|
return ptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void
|
static void
|
||||||
node__free(keymacro_node_t *k)
|
node__free(keymacro_node_t *k)
|
||||||
{
|
{
|
||||||
if (k == NULL)
|
if (k == NULL)
|
||||||
|
@ -487,7 +487,7 @@ node__free(keymacro_node_t *k)
|
||||||
* look for the str starting at node ptr.
|
* look for the str starting at node ptr.
|
||||||
* Print if last node
|
* Print if last node
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
node_lookup(EditLine *el, const wchar_t *str, keymacro_node_t *ptr,
|
node_lookup(EditLine *el, const wchar_t *str, keymacro_node_t *ptr,
|
||||||
size_t cnt)
|
size_t cnt)
|
||||||
{
|
{
|
||||||
|
@ -540,7 +540,7 @@ node_lookup(EditLine *el, const wchar_t *str, keymacro_node_t *ptr,
|
||||||
/* node_enum():
|
/* node_enum():
|
||||||
* Traverse the node printing the characters it is bound in buffer
|
* Traverse the node printing the characters it is bound in buffer
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
node_enum(EditLine *el, keymacro_node_t *ptr, size_t cnt)
|
node_enum(EditLine *el, keymacro_node_t *ptr, size_t cnt)
|
||||||
{
|
{
|
||||||
ssize_t used;
|
ssize_t used;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
#!/bin/sh -
|
#!/bin/sh -
|
||||||
# $NetBSD: makelist,v 1.26 2016/04/11 00:22:48 christos Exp $
|
# $NetBSD: makelist,v 1.27 2016/04/11 18:56:31 christos Exp $
|
||||||
#
|
#
|
||||||
# Copyright (c) 1992, 1993
|
# Copyright (c) 1992, 1993
|
||||||
# The Regents of the University of California. All rights reserved.
|
# The Regents of the University of California. All rights reserved.
|
||||||
|
@ -94,7 +94,7 @@ _EOF
|
||||||
printf("/* Automatically generated file, do not edit */\n");
|
printf("/* Automatically generated file, do not edit */\n");
|
||||||
printf("#include \"config.h\"\n#include \"el.h\"\n");
|
printf("#include \"config.h\"\n#include \"el.h\"\n");
|
||||||
printf("#include \"help.h\"\n");
|
printf("#include \"help.h\"\n");
|
||||||
printf("private const struct el_bindings_t el_func_help[] = {\n");
|
printf("static const struct el_bindings_t el_func_help[] = {\n");
|
||||||
low = "abcdefghijklmnopqrstuvwxyz_";
|
low = "abcdefghijklmnopqrstuvwxyz_";
|
||||||
high = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
|
high = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
|
||||||
for (i = 1; i <= length(low); i++)
|
for (i = 1; i <= length(low); i++)
|
||||||
|
@ -178,7 +178,7 @@ _EOF
|
||||||
printf("#include \"common.h\"\n");
|
printf("#include \"common.h\"\n");
|
||||||
printf("#include \"emacs.h\"\n");
|
printf("#include \"emacs.h\"\n");
|
||||||
printf("#include \"vi.h\"\n");
|
printf("#include \"vi.h\"\n");
|
||||||
printf("private const el_func_t el_func[] = {");
|
printf("static const el_func_t el_func[] = {");
|
||||||
maxlen = 80;
|
maxlen = 80;
|
||||||
needn = 1;
|
needn = 1;
|
||||||
len = 0;
|
len = 0;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: map.c,v 1.46 2016/04/11 00:50:13 christos Exp $ */
|
/* $NetBSD: map.c,v 1.47 2016/04/11 18:56:31 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1992, 1993
|
* Copyright (c) 1992, 1993
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/4/93";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: map.c,v 1.46 2016/04/11 00:50:13 christos Exp $");
|
__RCSID("$NetBSD: map.c,v 1.47 2016/04/11 18:56:31 christos Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint && not SCCSID */
|
#endif /* not lint && not SCCSID */
|
||||||
|
|
||||||
|
@ -52,16 +52,16 @@ __RCSID("$NetBSD: map.c,v 1.46 2016/04/11 00:50:13 christos Exp $");
|
||||||
#include "help.h"
|
#include "help.h"
|
||||||
#include "parse.h"
|
#include "parse.h"
|
||||||
|
|
||||||
private void map_print_key(EditLine *, el_action_t *, const wchar_t *);
|
static void map_print_key(EditLine *, el_action_t *, const wchar_t *);
|
||||||
private void map_print_some_keys(EditLine *, el_action_t *, wint_t, wint_t);
|
static void map_print_some_keys(EditLine *, el_action_t *, wint_t, wint_t);
|
||||||
private void map_print_all_keys(EditLine *);
|
static void map_print_all_keys(EditLine *);
|
||||||
private void map_init_nls(EditLine *);
|
static void map_init_nls(EditLine *);
|
||||||
private void map_init_meta(EditLine *);
|
static void map_init_meta(EditLine *);
|
||||||
|
|
||||||
/* keymap tables ; should be N_KEYS*sizeof(KEYCMD) bytes long */
|
/* keymap tables ; should be N_KEYS*sizeof(KEYCMD) bytes long */
|
||||||
|
|
||||||
|
|
||||||
private const el_action_t el_map_emacs[] = {
|
static const el_action_t el_map_emacs[] = {
|
||||||
/* 0 */ EM_SET_MARK, /* ^@ */
|
/* 0 */ EM_SET_MARK, /* ^@ */
|
||||||
/* 1 */ ED_MOVE_TO_BEG, /* ^A */
|
/* 1 */ ED_MOVE_TO_BEG, /* ^A */
|
||||||
/* 2 */ ED_PREV_CHAR, /* ^B */
|
/* 2 */ ED_PREV_CHAR, /* ^B */
|
||||||
|
@ -328,7 +328,7 @@ private const el_action_t el_map_emacs[] = {
|
||||||
* insert mode characters are in the normal keymap, and command mode
|
* insert mode characters are in the normal keymap, and command mode
|
||||||
* in the extended keymap.
|
* in the extended keymap.
|
||||||
*/
|
*/
|
||||||
private const el_action_t el_map_vi_insert[] = {
|
static const el_action_t el_map_vi_insert[] = {
|
||||||
#ifdef KSHVI
|
#ifdef KSHVI
|
||||||
/* 0 */ ED_UNASSIGNED, /* ^@ */
|
/* 0 */ ED_UNASSIGNED, /* ^@ */
|
||||||
/* 1 */ ED_INSERT, /* ^A */
|
/* 1 */ ED_INSERT, /* ^A */
|
||||||
|
@ -629,7 +629,7 @@ private const el_action_t el_map_vi_insert[] = {
|
||||||
/* 255 */ ED_INSERT /* M-^? */
|
/* 255 */ ED_INSERT /* M-^? */
|
||||||
};
|
};
|
||||||
|
|
||||||
private const el_action_t el_map_vi_command[] = {
|
static const el_action_t el_map_vi_command[] = {
|
||||||
/* 0 */ ED_UNASSIGNED, /* ^@ */
|
/* 0 */ ED_UNASSIGNED, /* ^@ */
|
||||||
/* 1 */ ED_MOVE_TO_BEG, /* ^A */
|
/* 1 */ ED_MOVE_TO_BEG, /* ^A */
|
||||||
/* 2 */ ED_UNASSIGNED, /* ^B */
|
/* 2 */ ED_UNASSIGNED, /* ^B */
|
||||||
|
@ -962,7 +962,7 @@ map_end(EditLine *el)
|
||||||
/* map_init_nls():
|
/* map_init_nls():
|
||||||
* Find all the printable keys and bind them to self insert
|
* Find all the printable keys and bind them to self insert
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
map_init_nls(EditLine *el)
|
map_init_nls(EditLine *el)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -978,7 +978,7 @@ map_init_nls(EditLine *el)
|
||||||
/* map_init_meta():
|
/* map_init_meta():
|
||||||
* Bind all the meta keys to the appropriate ESC-<key> sequence
|
* Bind all the meta keys to the appropriate ESC-<key> sequence
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
map_init_meta(EditLine *el)
|
map_init_meta(EditLine *el)
|
||||||
{
|
{
|
||||||
wchar_t buf[3];
|
wchar_t buf[3];
|
||||||
|
@ -1123,7 +1123,7 @@ map_get_editor(EditLine *el, const wchar_t **editor)
|
||||||
/* map_print_key():
|
/* map_print_key():
|
||||||
* Print the function description for 1 key
|
* Print the function description for 1 key
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
map_print_key(EditLine *el, el_action_t *map, const wchar_t *in)
|
map_print_key(EditLine *el, el_action_t *map, const wchar_t *in)
|
||||||
{
|
{
|
||||||
char outbuf[EL_BUFSIZ];
|
char outbuf[EL_BUFSIZ];
|
||||||
|
@ -1146,7 +1146,7 @@ map_print_key(EditLine *el, el_action_t *map, const wchar_t *in)
|
||||||
/* map_print_some_keys():
|
/* map_print_some_keys():
|
||||||
* Print keys from first to last
|
* Print keys from first to last
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
map_print_some_keys(EditLine *el, el_action_t *map, wint_t first, wint_t last)
|
map_print_some_keys(EditLine *el, el_action_t *map, wint_t first, wint_t last)
|
||||||
{
|
{
|
||||||
el_bindings_t *bp, *ep;
|
el_bindings_t *bp, *ep;
|
||||||
|
@ -1210,7 +1210,7 @@ map_print_some_keys(EditLine *el, el_action_t *map, wint_t first, wint_t last)
|
||||||
/* map_print_all_keys():
|
/* map_print_all_keys():
|
||||||
* Print the function description for all keys.
|
* Print the function description for all keys.
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
map_print_all_keys(EditLine *el)
|
map_print_all_keys(EditLine *el)
|
||||||
{
|
{
|
||||||
int prev, i;
|
int prev, i;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: parse.c,v 1.37 2016/04/11 00:50:13 christos Exp $ */
|
/* $NetBSD: parse.c,v 1.38 2016/04/11 18:56:31 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1992, 1993
|
* Copyright (c) 1992, 1993
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: parse.c,v 1.37 2016/04/11 00:50:13 christos Exp $");
|
__RCSID("$NetBSD: parse.c,v 1.38 2016/04/11 18:56:31 christos Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint && not SCCSID */
|
#endif /* not lint && not SCCSID */
|
||||||
|
|
||||||
|
@ -60,7 +60,7 @@ __RCSID("$NetBSD: parse.c,v 1.37 2016/04/11 00:50:13 christos Exp $");
|
||||||
#include "el.h"
|
#include "el.h"
|
||||||
#include "parse.h"
|
#include "parse.h"
|
||||||
|
|
||||||
private const struct {
|
static const struct {
|
||||||
const wchar_t *name;
|
const wchar_t *name;
|
||||||
int (*func)(EditLine *, int, const wchar_t **);
|
int (*func)(EditLine *, int, const wchar_t **);
|
||||||
} cmds[] = {
|
} cmds[] = {
|
||||||
|
@ -96,7 +96,7 @@ parse_line(EditLine *el, const wchar_t *line)
|
||||||
/* el_parse():
|
/* el_parse():
|
||||||
* Command dispatcher
|
* Command dispatcher
|
||||||
*/
|
*/
|
||||||
public int
|
int
|
||||||
el_wparse(EditLine *el, int argc, const wchar_t *argv[])
|
el_wparse(EditLine *el, int argc, const wchar_t *argv[])
|
||||||
{
|
{
|
||||||
const wchar_t *ptr;
|
const wchar_t *ptr;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: prompt.c,v 1.24 2016/04/11 00:50:13 christos Exp $ */
|
/* $NetBSD: prompt.c,v 1.25 2016/04/11 18:56:31 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1992, 1993
|
* Copyright (c) 1992, 1993
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)prompt.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)prompt.c 8.1 (Berkeley) 6/4/93";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: prompt.c,v 1.24 2016/04/11 00:50:13 christos Exp $");
|
__RCSID("$NetBSD: prompt.c,v 1.25 2016/04/11 18:56:31 christos Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint && not SCCSID */
|
#endif /* not lint && not SCCSID */
|
||||||
|
|
||||||
|
@ -47,13 +47,13 @@ __RCSID("$NetBSD: prompt.c,v 1.24 2016/04/11 00:50:13 christos Exp $");
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include "el.h"
|
#include "el.h"
|
||||||
|
|
||||||
private wchar_t *prompt_default(EditLine *);
|
static wchar_t *prompt_default(EditLine *);
|
||||||
private wchar_t *prompt_default_r(EditLine *);
|
static wchar_t *prompt_default_r(EditLine *);
|
||||||
|
|
||||||
/* prompt_default():
|
/* prompt_default():
|
||||||
* Just a default prompt, in case the user did not provide one
|
* Just a default prompt, in case the user did not provide one
|
||||||
*/
|
*/
|
||||||
private wchar_t *
|
static wchar_t *
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
prompt_default(EditLine *el __attribute__((__unused__)))
|
prompt_default(EditLine *el __attribute__((__unused__)))
|
||||||
{
|
{
|
||||||
|
@ -66,7 +66,7 @@ prompt_default(EditLine *el __attribute__((__unused__)))
|
||||||
/* prompt_default_r():
|
/* prompt_default_r():
|
||||||
* Just a default rprompt, in case the user did not provide one
|
* Just a default rprompt, in case the user did not provide one
|
||||||
*/
|
*/
|
||||||
private wchar_t *
|
static wchar_t *
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
prompt_default_r(EditLine *el __attribute__((__unused__)))
|
prompt_default_r(EditLine *el __attribute__((__unused__)))
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: read.c,v 1.90 2016/04/11 00:50:13 christos Exp $ */
|
/* $NetBSD: read.c,v 1.91 2016/04/11 18:56:31 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1992, 1993
|
* Copyright (c) 1992, 1993
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/4/93";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: read.c,v 1.90 2016/04/11 00:50:13 christos Exp $");
|
__RCSID("$NetBSD: read.c,v 1.91 2016/04/11 18:56:31 christos Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint && not SCCSID */
|
#endif /* not lint && not SCCSID */
|
||||||
|
|
||||||
|
@ -57,10 +57,10 @@ __RCSID("$NetBSD: read.c,v 1.90 2016/04/11 00:50:13 christos Exp $");
|
||||||
|
|
||||||
#define OKCMD -1 /* must be -1! */
|
#define OKCMD -1 /* must be -1! */
|
||||||
|
|
||||||
private int read__fixio(int, int);
|
static int read__fixio(int, int);
|
||||||
private int read_char(EditLine *, wchar_t *);
|
static int read_char(EditLine *, wchar_t *);
|
||||||
private int read_getcmd(EditLine *, el_action_t *, wchar_t *);
|
static int read_getcmd(EditLine *, el_action_t *, wchar_t *);
|
||||||
private void read_pop(c_macro_t *);
|
static void read_pop(c_macro_t *);
|
||||||
|
|
||||||
/* read_init():
|
/* read_init():
|
||||||
* Initialize the read stuff
|
* Initialize the read stuff
|
||||||
|
@ -103,7 +103,7 @@ el_read_getfn(EditLine *el)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DEBUG_EDIT
|
#ifdef DEBUG_EDIT
|
||||||
private void
|
static void
|
||||||
read_debug(EditLine *el)
|
read_debug(EditLine *el)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -125,7 +125,7 @@ read_debug(EditLine *el)
|
||||||
* Try to recover from a read error
|
* Try to recover from a read error
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
private int
|
static int
|
||||||
read__fixio(int fd __attribute__((__unused__)), int e)
|
read__fixio(int fd __attribute__((__unused__)), int e)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -186,7 +186,7 @@ read__fixio(int fd __attribute__((__unused__)), int e)
|
||||||
/* el_push():
|
/* el_push():
|
||||||
* Push a macro
|
* Push a macro
|
||||||
*/
|
*/
|
||||||
public void
|
void
|
||||||
el_wpush(EditLine *el, const wchar_t *str)
|
el_wpush(EditLine *el, const wchar_t *str)
|
||||||
{
|
{
|
||||||
c_macro_t *ma = &el->el_chared.c_macro;
|
c_macro_t *ma = &el->el_chared.c_macro;
|
||||||
|
@ -206,7 +206,7 @@ el_wpush(EditLine *el, const wchar_t *str)
|
||||||
* Get next command from the input stream, return OKCMD on success.
|
* Get next command from the input stream, return OKCMD on success.
|
||||||
* Character values > 255 are not looked up in the map, but inserted.
|
* Character values > 255 are not looked up in the map, but inserted.
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
read_getcmd(EditLine *el, el_action_t *cmdnum, wchar_t *ch)
|
read_getcmd(EditLine *el, el_action_t *cmdnum, wchar_t *ch)
|
||||||
{
|
{
|
||||||
static const wchar_t meta = (wchar_t)0x80;
|
static const wchar_t meta = (wchar_t)0x80;
|
||||||
|
@ -266,7 +266,7 @@ read_getcmd(EditLine *el, el_action_t *cmdnum, wchar_t *ch)
|
||||||
/* read_char():
|
/* read_char():
|
||||||
* Read a character from the tty.
|
* Read a character from the tty.
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
read_char(EditLine *el, wchar_t *cp)
|
read_char(EditLine *el, wchar_t *cp)
|
||||||
{
|
{
|
||||||
ssize_t num_read;
|
ssize_t num_read;
|
||||||
|
@ -350,7 +350,7 @@ read_char(EditLine *el, wchar_t *cp)
|
||||||
/* read_pop():
|
/* read_pop():
|
||||||
* Pop a macro from the stack
|
* Pop a macro from the stack
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
read_pop(c_macro_t *ma)
|
read_pop(c_macro_t *ma)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -365,7 +365,7 @@ read_pop(c_macro_t *ma)
|
||||||
/* el_wgetc():
|
/* el_wgetc():
|
||||||
* Read a wide character
|
* Read a wide character
|
||||||
*/
|
*/
|
||||||
public int
|
int
|
||||||
el_wgetc(EditLine *el, wchar_t *cp)
|
el_wgetc(EditLine *el, wchar_t *cp)
|
||||||
{
|
{
|
||||||
int num_read;
|
int num_read;
|
||||||
|
@ -439,7 +439,7 @@ read_finish(EditLine *el)
|
||||||
sig_clr(el);
|
sig_clr(el);
|
||||||
}
|
}
|
||||||
|
|
||||||
public const wchar_t *
|
const wchar_t *
|
||||||
el_wgets(EditLine *el, int *nread)
|
el_wgets(EditLine *el, int *nread)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: refresh.c,v 1.48 2016/04/11 00:50:13 christos Exp $ */
|
/* $NetBSD: refresh.c,v 1.49 2016/04/11 18:56:31 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1992, 1993
|
* Copyright (c) 1992, 1993
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)refresh.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)refresh.c 8.1 (Berkeley) 6/4/93";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: refresh.c,v 1.48 2016/04/11 00:50:13 christos Exp $");
|
__RCSID("$NetBSD: refresh.c,v 1.49 2016/04/11 18:56:31 christos Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint && not SCCSID */
|
#endif /* not lint && not SCCSID */
|
||||||
|
|
||||||
|
@ -50,18 +50,18 @@ __RCSID("$NetBSD: refresh.c,v 1.48 2016/04/11 00:50:13 christos Exp $");
|
||||||
|
|
||||||
#include "el.h"
|
#include "el.h"
|
||||||
|
|
||||||
private void re_nextline(EditLine *);
|
static void re_nextline(EditLine *);
|
||||||
private void re_addc(EditLine *, wint_t);
|
static void re_addc(EditLine *, wint_t);
|
||||||
private void re_update_line(EditLine *, wchar_t *, wchar_t *, int);
|
static void re_update_line(EditLine *, wchar_t *, wchar_t *, int);
|
||||||
private void re_insert (EditLine *, wchar_t *, int, int, wchar_t *, int);
|
static void re_insert (EditLine *, wchar_t *, int, int, wchar_t *, int);
|
||||||
private void re_delete(EditLine *, wchar_t *, int, int, int);
|
static void re_delete(EditLine *, wchar_t *, int, int, int);
|
||||||
private void re_fastputc(EditLine *, wint_t);
|
static void re_fastputc(EditLine *, wint_t);
|
||||||
private void re_clear_eol(EditLine *, int, int, int);
|
static void re_clear_eol(EditLine *, int, int, int);
|
||||||
private void re__strncopy(wchar_t *, wchar_t *, size_t);
|
static void re__strncopy(wchar_t *, wchar_t *, size_t);
|
||||||
private void re__copy_and_pad(wchar_t *, const wchar_t *, size_t);
|
static void re__copy_and_pad(wchar_t *, const wchar_t *, size_t);
|
||||||
|
|
||||||
#ifdef DEBUG_REFRESH
|
#ifdef DEBUG_REFRESH
|
||||||
private void re_printstr(EditLine *, const char *, wchar_t *, wchar_t *);
|
static void re_printstr(EditLine *, const char *, wchar_t *, wchar_t *);
|
||||||
#define __F el->el_errfile
|
#define __F el->el_errfile
|
||||||
#define ELRE_ASSERT(a, b, c) do \
|
#define ELRE_ASSERT(a, b, c) do \
|
||||||
if (/*CONSTCOND*/ a) { \
|
if (/*CONSTCOND*/ a) { \
|
||||||
|
@ -74,7 +74,7 @@ private void re_printstr(EditLine *, const char *, wchar_t *, wchar_t *);
|
||||||
/* re_printstr():
|
/* re_printstr():
|
||||||
* Print a string on the debugging pty
|
* Print a string on the debugging pty
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
re_printstr(EditLine *el, const char *str, wchar_t *f, wchar_t *t)
|
re_printstr(EditLine *el, const char *str, wchar_t *f, wchar_t *t)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ re_printstr(EditLine *el, const char *str, wchar_t *f, wchar_t *t)
|
||||||
/* re_nextline():
|
/* re_nextline():
|
||||||
* Move to the next line or scroll
|
* Move to the next line or scroll
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
re_nextline(EditLine *el)
|
re_nextline(EditLine *el)
|
||||||
{
|
{
|
||||||
el->el_refresh.r_cursor.h = 0; /* reset it. */
|
el->el_refresh.r_cursor.h = 0; /* reset it. */
|
||||||
|
@ -123,7 +123,7 @@ re_nextline(EditLine *el)
|
||||||
/* re_addc():
|
/* re_addc():
|
||||||
* Draw c, expanding tabs, control chars etc.
|
* Draw c, expanding tabs, control chars etc.
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
re_addc(EditLine *el, wint_t c)
|
re_addc(EditLine *el, wint_t c)
|
||||||
{
|
{
|
||||||
switch (ct_chr_class(c)) {
|
switch (ct_chr_class(c)) {
|
||||||
|
@ -357,7 +357,7 @@ re_goto_bottom(EditLine *el)
|
||||||
* insert num characters of s into d (in front of the character)
|
* insert num characters of s into d (in front of the character)
|
||||||
* at dat, maximum length of d is dlen
|
* at dat, maximum length of d is dlen
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
re_insert(EditLine *el __attribute__((__unused__)),
|
re_insert(EditLine *el __attribute__((__unused__)),
|
||||||
wchar_t *d, int dat, int dlen, wchar_t *s, int num)
|
wchar_t *d, int dat, int dlen, wchar_t *s, int num)
|
||||||
|
@ -408,7 +408,7 @@ re_insert(EditLine *el __attribute__((__unused__)),
|
||||||
/* re_delete():
|
/* re_delete():
|
||||||
* delete num characters d at dat, maximum length of d is dlen
|
* delete num characters d at dat, maximum length of d is dlen
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
re_delete(EditLine *el __attribute__((__unused__)),
|
re_delete(EditLine *el __attribute__((__unused__)),
|
||||||
wchar_t *d, int dat, int dlen, int num)
|
wchar_t *d, int dat, int dlen, int num)
|
||||||
|
@ -442,7 +442,7 @@ re_delete(EditLine *el __attribute__((__unused__)),
|
||||||
/* re__strncopy():
|
/* re__strncopy():
|
||||||
* Like strncpy without padding.
|
* Like strncpy without padding.
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
re__strncopy(wchar_t *a, wchar_t *b, size_t n)
|
re__strncopy(wchar_t *a, wchar_t *b, size_t n)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -457,7 +457,7 @@ re__strncopy(wchar_t *a, wchar_t *b, size_t n)
|
||||||
* in the first or second diff, diff is the difference between the
|
* in the first or second diff, diff is the difference between the
|
||||||
* number of characters between the new and old line.
|
* number of characters between the new and old line.
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
re_clear_eol(EditLine *el, int fx, int sx, int diff)
|
re_clear_eol(EditLine *el, int fx, int sx, int diff)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -501,7 +501,7 @@ new: eddie> Oh, my little buggy says to me, as lurgid as
|
||||||
*/
|
*/
|
||||||
#define MIN_END_KEEP 4
|
#define MIN_END_KEEP 4
|
||||||
|
|
||||||
private void
|
static void
|
||||||
re_update_line(EditLine *el, wchar_t *old, wchar_t *new, int i)
|
re_update_line(EditLine *el, wchar_t *old, wchar_t *new, int i)
|
||||||
{
|
{
|
||||||
wchar_t *o, *n, *p, c;
|
wchar_t *o, *n, *p, c;
|
||||||
|
@ -971,7 +971,7 @@ re_update_line(EditLine *el, wchar_t *old, wchar_t *new, int i)
|
||||||
/* re__copy_and_pad():
|
/* re__copy_and_pad():
|
||||||
* Copy string and pad with spaces
|
* Copy string and pad with spaces
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
re__copy_and_pad(wchar_t *dst, const wchar_t *src, size_t width)
|
re__copy_and_pad(wchar_t *dst, const wchar_t *src, size_t width)
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
|
@ -1055,7 +1055,7 @@ re_refresh_cursor(EditLine *el)
|
||||||
/* re_fastputc():
|
/* re_fastputc():
|
||||||
* Add a character fast.
|
* Add a character fast.
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
re_fastputc(EditLine *el, wint_t c)
|
re_fastputc(EditLine *el, wint_t c)
|
||||||
{
|
{
|
||||||
int w = wcwidth(c);
|
int w = wcwidth(c);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: search.c,v 1.43 2016/04/11 00:50:13 christos Exp $ */
|
/* $NetBSD: search.c,v 1.44 2016/04/11 18:56:31 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1992, 1993
|
* Copyright (c) 1992, 1993
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)search.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)search.c 8.1 (Berkeley) 6/4/93";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: search.c,v 1.43 2016/04/11 00:50:13 christos Exp $");
|
__RCSID("$NetBSD: search.c,v 1.44 2016/04/11 18:56:31 christos Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint && not SCCSID */
|
#endif /* not lint && not SCCSID */
|
||||||
|
|
||||||
|
@ -98,7 +98,7 @@ search_end(EditLine *el)
|
||||||
/* regerror():
|
/* regerror():
|
||||||
* Handle regular expression errors
|
* Handle regular expression errors
|
||||||
*/
|
*/
|
||||||
public void
|
void
|
||||||
/*ARGSUSED*/
|
/*ARGSUSED*/
|
||||||
regerror(const char *msg)
|
regerror(const char *msg)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: sig.c,v 1.24 2016/02/16 19:08:41 christos Exp $ */
|
/* $NetBSD: sig.c,v 1.25 2016/04/11 18:56:31 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1992, 1993
|
* Copyright (c) 1992, 1993
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)sig.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)sig.c 8.1 (Berkeley) 6/4/93";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: sig.c,v 1.24 2016/02/16 19:08:41 christos Exp $");
|
__RCSID("$NetBSD: sig.c,v 1.25 2016/04/11 18:56:31 christos Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint && not SCCSID */
|
#endif /* not lint && not SCCSID */
|
||||||
|
|
||||||
|
@ -52,23 +52,23 @@ __RCSID("$NetBSD: sig.c,v 1.24 2016/02/16 19:08:41 christos Exp $");
|
||||||
#include "el.h"
|
#include "el.h"
|
||||||
#include "common.h"
|
#include "common.h"
|
||||||
|
|
||||||
private EditLine *sel = NULL;
|
static EditLine *sel = NULL;
|
||||||
|
|
||||||
private const int sighdl[] = {
|
static const int sighdl[] = {
|
||||||
#define _DO(a) (a),
|
#define _DO(a) (a),
|
||||||
ALLSIGS
|
ALLSIGS
|
||||||
#undef _DO
|
#undef _DO
|
||||||
- 1
|
- 1
|
||||||
};
|
};
|
||||||
|
|
||||||
private void sig_handler(int);
|
static void sig_handler(int);
|
||||||
|
|
||||||
/* sig_handler():
|
/* sig_handler():
|
||||||
* This is the handler called for all signals
|
* This is the handler called for all signals
|
||||||
* XXX: we cannot pass any data so we just store the old editline
|
* XXX: we cannot pass any data so we just store the old editline
|
||||||
* state in a private variable
|
* state in a private variable
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
sig_handler(int signo)
|
sig_handler(int signo)
|
||||||
{
|
{
|
||||||
int i, save_errno;
|
int i, save_errno;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: sys.h,v 1.24 2016/03/23 22:27:48 christos Exp $ */
|
/* $NetBSD: sys.h,v 1.25 2016/04/11 18:56:31 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1992, 1993
|
* Copyright (c) 1992, 1993
|
||||||
|
@ -58,14 +58,6 @@
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef public
|
|
||||||
# define public /* Externally visible functions/variables */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef private
|
|
||||||
# define private static /* Always hidden internals */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef protected
|
#ifndef protected
|
||||||
# define protected /* Redefined from elsewhere to "static" */
|
# define protected /* Redefined from elsewhere to "static" */
|
||||||
/* When we want to hide everything */
|
/* When we want to hide everything */
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: terminal.c,v 1.28 2016/04/11 00:50:13 christos Exp $ */
|
/* $NetBSD: terminal.c,v 1.29 2016/04/11 18:56:31 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1992, 1993
|
* Copyright (c) 1992, 1993
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)term.c 8.2 (Berkeley) 4/30/95";
|
static char sccsid[] = "@(#)term.c 8.2 (Berkeley) 4/30/95";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: terminal.c,v 1.28 2016/04/11 00:50:13 christos Exp $");
|
__RCSID("$NetBSD: terminal.c,v 1.29 2016/04/11 18:56:31 christos Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint && not SCCSID */
|
#endif /* not lint && not SCCSID */
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ __RCSID("$NetBSD: terminal.c,v 1.28 2016/04/11 00:50:13 christos Exp $");
|
||||||
#define Str(a) el->el_terminal.t_str[a]
|
#define Str(a) el->el_terminal.t_str[a]
|
||||||
#define Val(a) el->el_terminal.t_val[a]
|
#define Val(a) el->el_terminal.t_val[a]
|
||||||
|
|
||||||
private const struct termcapstr {
|
static const struct termcapstr {
|
||||||
const char *name;
|
const char *name;
|
||||||
const char *long_name;
|
const char *long_name;
|
||||||
} tstr[] = {
|
} tstr[] = {
|
||||||
|
@ -174,7 +174,7 @@ private const struct termcapstr {
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
};
|
};
|
||||||
|
|
||||||
private const struct termcapval {
|
static const struct termcapval {
|
||||||
const char *name;
|
const char *name;
|
||||||
const char *long_name;
|
const char *long_name;
|
||||||
} tval[] = {
|
} tval[] = {
|
||||||
|
@ -199,27 +199,27 @@ private const struct termcapval {
|
||||||
};
|
};
|
||||||
/* do two or more of the attributes use me */
|
/* do two or more of the attributes use me */
|
||||||
|
|
||||||
private void terminal_setflags(EditLine *);
|
static void terminal_setflags(EditLine *);
|
||||||
private int terminal_rebuffer_display(EditLine *);
|
static int terminal_rebuffer_display(EditLine *);
|
||||||
private void terminal_free_display(EditLine *);
|
static void terminal_free_display(EditLine *);
|
||||||
private int terminal_alloc_display(EditLine *);
|
static int terminal_alloc_display(EditLine *);
|
||||||
private void terminal_alloc(EditLine *, const struct termcapstr *,
|
static void terminal_alloc(EditLine *, const struct termcapstr *,
|
||||||
const char *);
|
const char *);
|
||||||
private void terminal_init_arrow(EditLine *);
|
static void terminal_init_arrow(EditLine *);
|
||||||
private void terminal_reset_arrow(EditLine *);
|
static void terminal_reset_arrow(EditLine *);
|
||||||
private int terminal_putc(int);
|
static int terminal_putc(int);
|
||||||
private void terminal_tputs(EditLine *, const char *, int);
|
static void terminal_tputs(EditLine *, const char *, int);
|
||||||
|
|
||||||
#ifdef _REENTRANT
|
#ifdef _REENTRANT
|
||||||
private pthread_mutex_t terminal_mutex = PTHREAD_MUTEX_INITIALIZER;
|
static pthread_mutex_t terminal_mutex = PTHREAD_MUTEX_INITIALIZER;
|
||||||
#endif
|
#endif
|
||||||
private FILE *terminal_outfile = NULL;
|
static FILE *terminal_outfile = NULL;
|
||||||
|
|
||||||
|
|
||||||
/* terminal_setflags():
|
/* terminal_setflags():
|
||||||
* Set the terminal capability flags
|
* Set the terminal capability flags
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
terminal_setflags(EditLine *el)
|
terminal_setflags(EditLine *el)
|
||||||
{
|
{
|
||||||
EL_FLAGS = 0;
|
EL_FLAGS = 0;
|
||||||
|
@ -337,7 +337,7 @@ terminal_end(EditLine *el)
|
||||||
/* terminal_alloc():
|
/* terminal_alloc():
|
||||||
* Maintain a string pool for termcap strings
|
* Maintain a string pool for termcap strings
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
terminal_alloc(EditLine *el, const struct termcapstr *t, const char *cap)
|
terminal_alloc(EditLine *el, const struct termcapstr *t, const char *cap)
|
||||||
{
|
{
|
||||||
char termbuf[TC_BUFSIZE];
|
char termbuf[TC_BUFSIZE];
|
||||||
|
@ -403,7 +403,7 @@ terminal_alloc(EditLine *el, const struct termcapstr *t, const char *cap)
|
||||||
/* terminal_rebuffer_display():
|
/* terminal_rebuffer_display():
|
||||||
* Rebuffer the display after the screen changed size
|
* Rebuffer the display after the screen changed size
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
terminal_rebuffer_display(EditLine *el)
|
terminal_rebuffer_display(EditLine *el)
|
||||||
{
|
{
|
||||||
coord_t *c = &el->el_terminal.t_size;
|
coord_t *c = &el->el_terminal.t_size;
|
||||||
|
@ -422,7 +422,7 @@ terminal_rebuffer_display(EditLine *el)
|
||||||
/* terminal_alloc_display():
|
/* terminal_alloc_display():
|
||||||
* Allocate a new display.
|
* Allocate a new display.
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
terminal_alloc_display(EditLine *el)
|
terminal_alloc_display(EditLine *el)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -468,7 +468,7 @@ done:
|
||||||
/* terminal_free_display():
|
/* terminal_free_display():
|
||||||
* Free the display buffers
|
* Free the display buffers
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
terminal_free_display(EditLine *el)
|
terminal_free_display(EditLine *el)
|
||||||
{
|
{
|
||||||
wchar_t **b;
|
wchar_t **b;
|
||||||
|
@ -1007,7 +1007,7 @@ terminal_change_size(EditLine *el, int lins, int cols)
|
||||||
/* terminal_init_arrow():
|
/* terminal_init_arrow():
|
||||||
* Initialize the arrow key bindings from termcap
|
* Initialize the arrow key bindings from termcap
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
terminal_init_arrow(EditLine *el)
|
terminal_init_arrow(EditLine *el)
|
||||||
{
|
{
|
||||||
funckey_t *arrow = el->el_terminal.t_fkey;
|
funckey_t *arrow = el->el_terminal.t_fkey;
|
||||||
|
@ -1052,7 +1052,7 @@ terminal_init_arrow(EditLine *el)
|
||||||
/* terminal_reset_arrow():
|
/* terminal_reset_arrow():
|
||||||
* Reset arrow key bindings
|
* Reset arrow key bindings
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
terminal_reset_arrow(EditLine *el)
|
terminal_reset_arrow(EditLine *el)
|
||||||
{
|
{
|
||||||
funckey_t *arrow = el->el_terminal.t_fkey;
|
funckey_t *arrow = el->el_terminal.t_fkey;
|
||||||
|
@ -1222,7 +1222,7 @@ terminal_bind_arrow(EditLine *el)
|
||||||
/* terminal_putc():
|
/* terminal_putc():
|
||||||
* Add a character
|
* Add a character
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
terminal_putc(int c)
|
terminal_putc(int c)
|
||||||
{
|
{
|
||||||
if (terminal_outfile == NULL)
|
if (terminal_outfile == NULL)
|
||||||
|
@ -1230,7 +1230,7 @@ terminal_putc(int c)
|
||||||
return fputc(c, terminal_outfile);
|
return fputc(c, terminal_outfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void
|
static void
|
||||||
terminal_tputs(EditLine *el, const char *cap, int affcnt)
|
terminal_tputs(EditLine *el, const char *cap, int affcnt)
|
||||||
{
|
{
|
||||||
#ifdef _REENTRANT
|
#ifdef _REENTRANT
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: tokenizer.c,v 1.27 2016/04/11 16:06:52 christos Exp $ */
|
/* $NetBSD: tokenizer.c,v 1.28 2016/04/11 18:56:31 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1992, 1993
|
* Copyright (c) 1992, 1993
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)tokenizer.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)tokenizer.c 8.1 (Berkeley) 6/4/93";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: tokenizer.c,v 1.27 2016/04/11 16:06:52 christos Exp $");
|
__RCSID("$NetBSD: tokenizer.c,v 1.28 2016/04/11 18:56:31 christos Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint && not SCCSID */
|
#endif /* not lint && not SCCSID */
|
||||||
|
|
||||||
|
@ -94,13 +94,13 @@ struct TYPE(tokenizer) {
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
private void FUN(tok,finish)(TYPE(Tokenizer) *);
|
static void FUN(tok,finish)(TYPE(Tokenizer) *);
|
||||||
|
|
||||||
|
|
||||||
/* FUN(tok,finish)():
|
/* FUN(tok,finish)():
|
||||||
* Finish a word in the tokenizer.
|
* Finish a word in the tokenizer.
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
FUN(tok,finish)(TYPE(Tokenizer) *tok)
|
FUN(tok,finish)(TYPE(Tokenizer) *tok)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ FUN(tok,finish)(TYPE(Tokenizer) *tok)
|
||||||
/* FUN(tok,init)():
|
/* FUN(tok,init)():
|
||||||
* Initialize the tokenizer
|
* Initialize the tokenizer
|
||||||
*/
|
*/
|
||||||
public TYPE(Tokenizer) *
|
TYPE(Tokenizer) *
|
||||||
FUN(tok,init)(const Char *ifs)
|
FUN(tok,init)(const Char *ifs)
|
||||||
{
|
{
|
||||||
TYPE(Tokenizer) *tok = tok_malloc(sizeof(*tok));
|
TYPE(Tokenizer) *tok = tok_malloc(sizeof(*tok));
|
||||||
|
@ -158,7 +158,7 @@ FUN(tok,init)(const Char *ifs)
|
||||||
/* FUN(tok,reset)():
|
/* FUN(tok,reset)():
|
||||||
* Reset the tokenizer
|
* Reset the tokenizer
|
||||||
*/
|
*/
|
||||||
public void
|
void
|
||||||
FUN(tok,reset)(TYPE(Tokenizer) *tok)
|
FUN(tok,reset)(TYPE(Tokenizer) *tok)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -173,7 +173,7 @@ FUN(tok,reset)(TYPE(Tokenizer) *tok)
|
||||||
/* FUN(tok,end)():
|
/* FUN(tok,end)():
|
||||||
* Clean up
|
* Clean up
|
||||||
*/
|
*/
|
||||||
public void
|
void
|
||||||
FUN(tok,end)(TYPE(Tokenizer) *tok)
|
FUN(tok,end)(TYPE(Tokenizer) *tok)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -202,7 +202,7 @@ FUN(tok,end)(TYPE(Tokenizer) *tok)
|
||||||
* cursorc if !NULL, argv element containing cursor
|
* cursorc if !NULL, argv element containing cursor
|
||||||
* cursorv if !NULL, offset in argv[cursorc] of cursor
|
* cursorv if !NULL, offset in argv[cursorc] of cursor
|
||||||
*/
|
*/
|
||||||
public int
|
int
|
||||||
FUN(tok,line)(TYPE(Tokenizer) *tok, const TYPE(LineInfo) *line,
|
FUN(tok,line)(TYPE(Tokenizer) *tok, const TYPE(LineInfo) *line,
|
||||||
int *argc, const Char ***argv, int *cursorc, int *cursoro)
|
int *argc, const Char ***argv, int *cursorc, int *cursoro)
|
||||||
{
|
{
|
||||||
|
@ -453,7 +453,7 @@ FUN(tok,line)(TYPE(Tokenizer) *tok, const TYPE(LineInfo) *line,
|
||||||
* Simpler version of tok_line, taking a NUL terminated line
|
* Simpler version of tok_line, taking a NUL terminated line
|
||||||
* and splitting into words, ignoring cursor state.
|
* and splitting into words, ignoring cursor state.
|
||||||
*/
|
*/
|
||||||
public int
|
int
|
||||||
FUN(tok,str)(TYPE(Tokenizer) *tok, const Char *line, int *argc,
|
FUN(tok,str)(TYPE(Tokenizer) *tok, const Char *line, int *argc,
|
||||||
const Char ***argv)
|
const Char ***argv)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: tty.c,v 1.62 2016/04/11 00:50:13 christos Exp $ */
|
/* $NetBSD: tty.c,v 1.63 2016/04/11 18:56:31 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1992, 1993
|
* Copyright (c) 1992, 1993
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/4/93";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: tty.c,v 1.62 2016/04/11 00:50:13 christos Exp $");
|
__RCSID("$NetBSD: tty.c,v 1.63 2016/04/11 18:56:31 christos Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint && not SCCSID */
|
#endif /* not lint && not SCCSID */
|
||||||
|
|
||||||
|
@ -66,7 +66,7 @@ typedef struct ttymap_t {
|
||||||
} ttymap_t;
|
} ttymap_t;
|
||||||
|
|
||||||
|
|
||||||
private const ttyperm_t ttyperm = {
|
static const ttyperm_t ttyperm = {
|
||||||
{
|
{
|
||||||
{"iflag:", ICRNL, (INLCR | IGNCR)},
|
{"iflag:", ICRNL, (INLCR | IGNCR)},
|
||||||
{"oflag:", (OPOST | ONLCR), ONLRET},
|
{"oflag:", (OPOST | ONLCR), ONLRET},
|
||||||
|
@ -94,7 +94,7 @@ private const ttyperm_t ttyperm = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private const ttychar_t ttychar = {
|
static const ttychar_t ttychar = {
|
||||||
{
|
{
|
||||||
CINTR, CQUIT, CERASE, CKILL,
|
CINTR, CQUIT, CERASE, CKILL,
|
||||||
CEOF, CEOL, CEOL2, CSWTCH,
|
CEOF, CEOL, CEOL2, CSWTCH,
|
||||||
|
@ -124,7 +124,7 @@ private const ttychar_t ttychar = {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
private const ttymap_t tty_map[] = {
|
static const ttymap_t tty_map[] = {
|
||||||
#ifdef VERASE
|
#ifdef VERASE
|
||||||
{C_ERASE, VERASE,
|
{C_ERASE, VERASE,
|
||||||
{EM_DELETE_PREV_CHAR, VI_DELETE_PREV_CHAR, ED_PREV_CHAR}},
|
{EM_DELETE_PREV_CHAR, VI_DELETE_PREV_CHAR, ED_PREV_CHAR}},
|
||||||
|
@ -161,7 +161,7 @@ private const ttymap_t tty_map[] = {
|
||||||
{ED_UNASSIGNED, ED_UNASSIGNED, ED_UNASSIGNED}}
|
{ED_UNASSIGNED, ED_UNASSIGNED, ED_UNASSIGNED}}
|
||||||
};
|
};
|
||||||
|
|
||||||
private const ttymodes_t ttymodes[] = {
|
static const ttymodes_t ttymodes[] = {
|
||||||
#ifdef IGNBRK
|
#ifdef IGNBRK
|
||||||
{"ignbrk", IGNBRK, MD_INP},
|
{"ignbrk", IGNBRK, MD_INP},
|
||||||
#endif /* IGNBRK */
|
#endif /* IGNBRK */
|
||||||
|
@ -455,21 +455,21 @@ private const ttymodes_t ttymodes[] = {
|
||||||
#define tty__geteightbit(td) (((td)->c_cflag & CSIZE) == CS8)
|
#define tty__geteightbit(td) (((td)->c_cflag & CSIZE) == CS8)
|
||||||
#define tty__cooked_mode(td) ((td)->c_lflag & ICANON)
|
#define tty__cooked_mode(td) ((td)->c_lflag & ICANON)
|
||||||
|
|
||||||
private int tty_getty(EditLine *, struct termios *);
|
static int tty_getty(EditLine *, struct termios *);
|
||||||
private int tty_setty(EditLine *, int, const struct termios *);
|
static int tty_setty(EditLine *, int, const struct termios *);
|
||||||
private int tty__getcharindex(int);
|
static int tty__getcharindex(int);
|
||||||
private void tty__getchar(struct termios *, unsigned char *);
|
static void tty__getchar(struct termios *, unsigned char *);
|
||||||
private void tty__setchar(struct termios *, unsigned char *);
|
static void tty__setchar(struct termios *, unsigned char *);
|
||||||
private speed_t tty__getspeed(struct termios *);
|
static speed_t tty__getspeed(struct termios *);
|
||||||
private int tty_setup(EditLine *);
|
static int tty_setup(EditLine *);
|
||||||
private void tty_setup_flags(EditLine *, struct termios *, int);
|
static void tty_setup_flags(EditLine *, struct termios *, int);
|
||||||
|
|
||||||
#define t_qu t_ts
|
#define t_qu t_ts
|
||||||
|
|
||||||
/* tty_getty():
|
/* tty_getty():
|
||||||
* Wrapper for tcgetattr to handle EINTR
|
* Wrapper for tcgetattr to handle EINTR
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
tty_getty(EditLine *el, struct termios *t)
|
tty_getty(EditLine *el, struct termios *t)
|
||||||
{
|
{
|
||||||
int rv;
|
int rv;
|
||||||
|
@ -481,7 +481,7 @@ tty_getty(EditLine *el, struct termios *t)
|
||||||
/* tty_setty():
|
/* tty_setty():
|
||||||
* Wrapper for tcsetattr to handle EINTR
|
* Wrapper for tcsetattr to handle EINTR
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
tty_setty(EditLine *el, int action, const struct termios *t)
|
tty_setty(EditLine *el, int action, const struct termios *t)
|
||||||
{
|
{
|
||||||
int rv;
|
int rv;
|
||||||
|
@ -493,7 +493,7 @@ tty_setty(EditLine *el, int action, const struct termios *t)
|
||||||
/* tty_setup():
|
/* tty_setup():
|
||||||
* Get the tty parameters and initialize the editing state
|
* Get the tty parameters and initialize the editing state
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
tty_setup(EditLine *el)
|
tty_setup(EditLine *el)
|
||||||
{
|
{
|
||||||
int rst = 1;
|
int rst = 1;
|
||||||
|
@ -605,7 +605,7 @@ tty_end(EditLine *el)
|
||||||
/* tty__getspeed():
|
/* tty__getspeed():
|
||||||
* Get the tty speed
|
* Get the tty speed
|
||||||
*/
|
*/
|
||||||
private speed_t
|
static speed_t
|
||||||
tty__getspeed(struct termios *td)
|
tty__getspeed(struct termios *td)
|
||||||
{
|
{
|
||||||
speed_t spd;
|
speed_t spd;
|
||||||
|
@ -618,7 +618,7 @@ tty__getspeed(struct termios *td)
|
||||||
/* tty__getspeed():
|
/* tty__getspeed():
|
||||||
* Return the index of the asked char in the c_cc array
|
* Return the index of the asked char in the c_cc array
|
||||||
*/
|
*/
|
||||||
private int
|
static int
|
||||||
tty__getcharindex(int i)
|
tty__getcharindex(int i)
|
||||||
{
|
{
|
||||||
switch (i) {
|
switch (i) {
|
||||||
|
@ -726,7 +726,7 @@ tty__getcharindex(int i)
|
||||||
/* tty__getchar():
|
/* tty__getchar():
|
||||||
* Get the tty characters
|
* Get the tty characters
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
tty__getchar(struct termios *td, unsigned char *s)
|
tty__getchar(struct termios *td, unsigned char *s)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -808,7 +808,7 @@ tty__getchar(struct termios *td, unsigned char *s)
|
||||||
/* tty__setchar():
|
/* tty__setchar():
|
||||||
* Set the tty characters
|
* Set the tty characters
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
tty__setchar(struct termios *td, unsigned char *s)
|
tty__setchar(struct termios *td, unsigned char *s)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -935,7 +935,7 @@ tty_bind_char(EditLine *el, int force)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private tcflag_t *
|
static tcflag_t *
|
||||||
tty__get_flag(struct termios *t, int kind) {
|
tty__get_flag(struct termios *t, int kind) {
|
||||||
switch (kind) {
|
switch (kind) {
|
||||||
case MD_INP:
|
case MD_INP:
|
||||||
|
@ -953,7 +953,7 @@ tty__get_flag(struct termios *t, int kind) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private tcflag_t
|
static tcflag_t
|
||||||
tty_update_flag(EditLine *el, tcflag_t f, int mode, int kind)
|
tty_update_flag(EditLine *el, tcflag_t f, int mode, int kind)
|
||||||
{
|
{
|
||||||
f &= ~el->el_tty.t_t[mode][kind].t_clrmask;
|
f &= ~el->el_tty.t_t[mode][kind].t_clrmask;
|
||||||
|
@ -962,7 +962,7 @@ tty_update_flag(EditLine *el, tcflag_t f, int mode, int kind)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void
|
static void
|
||||||
tty_update_flags(EditLine *el, int kind)
|
tty_update_flags(EditLine *el, int kind)
|
||||||
{
|
{
|
||||||
tcflag_t *tt, *ed, *ex;
|
tcflag_t *tt, *ed, *ex;
|
||||||
|
@ -977,7 +977,7 @@ tty_update_flags(EditLine *el, int kind)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void
|
static void
|
||||||
tty_update_char(EditLine *el, int mode, int c) {
|
tty_update_char(EditLine *el, int mode, int c) {
|
||||||
if (!((el->el_tty.t_t[mode][MD_CHAR].t_setmask & C_SH(c)))
|
if (!((el->el_tty.t_t[mode][MD_CHAR].t_setmask & C_SH(c)))
|
||||||
&& (el->el_tty.t_c[TS_IO][c] != el->el_tty.t_c[EX_IO][c]))
|
&& (el->el_tty.t_c[TS_IO][c] != el->el_tty.t_c[EX_IO][c]))
|
||||||
|
@ -1309,7 +1309,7 @@ tty_stty(EditLine *el, int argc __attribute__((__unused__)),
|
||||||
/* tty_printchar():
|
/* tty_printchar():
|
||||||
* DEbugging routine to print the tty characters
|
* DEbugging routine to print the tty characters
|
||||||
*/
|
*/
|
||||||
private void
|
static void
|
||||||
tty_printchar(EditLine *el, unsigned char *s)
|
tty_printchar(EditLine *el, unsigned char *s)
|
||||||
{
|
{
|
||||||
ttyperm_t *m;
|
ttyperm_t *m;
|
||||||
|
@ -1330,7 +1330,7 @@ tty_printchar(EditLine *el, unsigned char *s)
|
||||||
#endif /* notyet */
|
#endif /* notyet */
|
||||||
|
|
||||||
|
|
||||||
private void
|
static void
|
||||||
tty_setup_flags(EditLine *el, struct termios *tios, int mode)
|
tty_setup_flags(EditLine *el, struct termios *tios, int mode)
|
||||||
{
|
{
|
||||||
int kind;
|
int kind;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: vi.c,v 1.59 2016/04/11 00:50:13 christos Exp $ */
|
/* $NetBSD: vi.c,v 1.60 2016/04/11 18:56:31 christos Exp $ */
|
||||||
|
|
||||||
/*-
|
/*-
|
||||||
* Copyright (c) 1992, 1993
|
* Copyright (c) 1992, 1993
|
||||||
|
@ -37,7 +37,7 @@
|
||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)vi.c 8.1 (Berkeley) 6/4/93";
|
static char sccsid[] = "@(#)vi.c 8.1 (Berkeley) 6/4/93";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: vi.c,v 1.59 2016/04/11 00:50:13 christos Exp $");
|
__RCSID("$NetBSD: vi.c,v 1.60 2016/04/11 18:56:31 christos Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint && not SCCSID */
|
#endif /* not lint && not SCCSID */
|
||||||
|
|
||||||
|
@ -56,13 +56,13 @@ __RCSID("$NetBSD: vi.c,v 1.59 2016/04/11 00:50:13 christos Exp $");
|
||||||
#include "emacs.h"
|
#include "emacs.h"
|
||||||
#include "vi.h"
|
#include "vi.h"
|
||||||
|
|
||||||
private el_action_t cv_action(EditLine *, wint_t);
|
static el_action_t cv_action(EditLine *, wint_t);
|
||||||
private el_action_t cv_paste(EditLine *, wint_t);
|
static el_action_t cv_paste(EditLine *, wint_t);
|
||||||
|
|
||||||
/* cv_action():
|
/* cv_action():
|
||||||
* Handle vi actions.
|
* Handle vi actions.
|
||||||
*/
|
*/
|
||||||
private el_action_t
|
static el_action_t
|
||||||
cv_action(EditLine *el, wint_t c)
|
cv_action(EditLine *el, wint_t c)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ cv_action(EditLine *el, wint_t c)
|
||||||
/* cv_paste():
|
/* cv_paste():
|
||||||
* Paste previous deletion before or after the cursor
|
* Paste previous deletion before or after the cursor
|
||||||
*/
|
*/
|
||||||
private el_action_t
|
static el_action_t
|
||||||
cv_paste(EditLine *el, wint_t c)
|
cv_paste(EditLine *el, wint_t c)
|
||||||
{
|
{
|
||||||
c_kill_t *k = &el->el_chared.c_kill;
|
c_kill_t *k = &el->el_chared.c_kill;
|
||||||
|
|
Loading…
Reference in New Issue