Get rid of private/public; keep protected (Ingo Schwarze)

This commit is contained in:
christos 2016-04-11 18:56:31 +00:00
parent 6182b56b9d
commit 469d44f8e7
20 changed files with 257 additions and 264 deletions

View File

@ -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
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)chared.c 8.1 (Berkeley) 6/4/93";
#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 /* 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 "common.h"
private void ch__clearmacro (EditLine *);
static void ch__clearmacro (EditLine *);
/* value to leave unused in line buffer */
#define EL_LEAVE 2
@ -489,7 +489,7 @@ ch_reset(EditLine *el, int mclear)
ch__clearmacro(el);
}
private void
static void
ch__clearmacro(EditLine *el)
{
c_macro_t *ma = &el->el_chared.c_macro;
@ -614,7 +614,7 @@ ch_end(EditLine *el)
/* el_insertstr():
* Insert string at cursorI
*/
public int
int
el_winsertstr(EditLine *el, const wchar_t *s)
{
size_t len;
@ -636,7 +636,7 @@ el_winsertstr(EditLine *el, const wchar_t *s)
/* el_deletestr():
* Delete num characters before the cursor
*/
public void
void
el_deletestr(EditLine *el, int n)
{
if (n <= 0)
@ -654,7 +654,7 @@ el_deletestr(EditLine *el, int n)
/* el_cursor():
* Move the cursor to the left or the right of the current position
*/
public int
int
el_cursor(EditLine *el, int n)
{
if (n == 0)

View File

@ -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.
@ -31,7 +31,7 @@
*/
#include "config.h"
#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 */
#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)
private 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_cbuff_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)
{
void *p;
@ -66,7 +66,7 @@ ct_conv_cbuff_resize(ct_buffer_t *conv, size_t csize)
return 0;
}
private int
static int
ct_conv_wbuff_resize(ct_buffer_t *conv, size_t wsize)
{
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)
{
char *dst;
@ -118,7 +118,7 @@ ct_encode_string(const wchar_t *s, ct_buffer_t *conv)
return conv->cbuff;
}
public wchar_t *
wchar_t *
ct_decode_string(const char *s, ct_buffer_t *conv)
{
size_t len;

View File

@ -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.
@ -60,10 +60,10 @@ typedef struct ct_buffer_t {
} ct_buffer_t;
/* 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. */
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.
* The pointer returned must be free()d when done. */

View File

@ -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
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)el.c 8.2 (Berkeley) 1/3/94";
#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 /* 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():
* Initialize editline and set default parameters.
*/
public EditLine *
EditLine *
el_init(const char *prog, FILE *fin, FILE *fout, FILE *ferr)
{
return el_init_fd(prog, fin, fout, ferr, fileno(fin), fileno(fout),
fileno(ferr));
}
public EditLine *
EditLine *
el_init_fd(const char *prog, FILE *fin, FILE *fout, FILE *ferr,
int fdin, int fdout, int fderr)
{
@ -123,7 +123,7 @@ el_init_fd(const char *prog, FILE *fin, FILE *fout, FILE *ferr,
/* el_end():
* Clean up.
*/
public void
void
el_end(EditLine *el)
{
@ -155,7 +155,7 @@ el_end(EditLine *el)
/* el_reset():
* Reset the tty and the parser
*/
public void
void
el_reset(EditLine *el)
{
@ -167,7 +167,7 @@ el_reset(EditLine *el)
/* el_set():
* set the editline parameters
*/
public int
int
el_wset(EditLine *el, int op, ...)
{
va_list ap;
@ -380,7 +380,7 @@ el_wset(EditLine *el, int op, ...)
/* el_get():
* retrieve the editline parameters
*/
public int
int
el_wget(EditLine *el, int op, ...)
{
va_list ap;
@ -493,7 +493,7 @@ el_wget(EditLine *el, int op, ...)
/* el_line():
* Return editing info
*/
public const LineInfoW *
const LineInfoW *
el_wline(EditLine *el)
{
@ -504,7 +504,7 @@ el_wline(EditLine *el)
/* el_source():
* Source a file
*/
public int
int
el_source(EditLine *el, const char *fname)
{
FILE *fp;
@ -576,7 +576,7 @@ el_source(EditLine *el, const char *fname)
/* el_resize():
* Called from program when terminal is resized
*/
public void
void
el_resize(EditLine *el)
{
int lins, cols;
@ -597,7 +597,7 @@ el_resize(EditLine *el)
/* el_beep():
* Called from the program to beep
*/
public void
void
el_beep(EditLine *el)
{

View File

@ -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.
@ -27,7 +27,7 @@
*/
#include "config.h"
#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 */
#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"
public int
int
el_getc(EditLine *el, char *cp)
{
int num_read;
@ -58,7 +58,7 @@ el_getc(EditLine *el, char *cp)
}
public void
void
el_push(EditLine *el, const char *str)
{
/* 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)
{
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[])
{
int ret;
@ -102,7 +102,7 @@ el_parse(EditLine *el, int argc, const char *argv[])
}
public int
int
el_set(EditLine *el, int op, ...)
{
va_list ap;
@ -272,7 +272,7 @@ out:
}
public int
int
el_get(EditLine *el, int op, ...)
{
va_list ap;

View File

@ -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
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)history.c 8.1 (Berkeley) 6/4/93";
#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 /* not lint && not SCCSID */
@ -133,19 +133,20 @@ typedef struct {
} HistEventPrivate;
private int history_setsize(TYPE(History) *, TYPE(HistEvent) *, int);
private int history_getsize(TYPE(History) *, TYPE(HistEvent) *);
private int history_setunique(TYPE(History) *, TYPE(HistEvent) *, int);
private int history_getunique(TYPE(History) *, TYPE(HistEvent) *);
private int history_set_fun(TYPE(History) *, TYPE(History) *);
private int history_load(TYPE(History) *, const char *);
private int history_save(TYPE(History) *, const char *);
private int history_save_fp(TYPE(History) *, FILE *);
private int history_prev_event(TYPE(History) *, TYPE(HistEvent) *, int);
private int history_next_event(TYPE(History) *, TYPE(HistEvent) *, int);
private int history_next_string(TYPE(History) *, TYPE(HistEvent) *, const Char *);
private int history_prev_string(TYPE(History) *, TYPE(HistEvent) *, const Char *);
static int history_setsize(TYPE(History) *, TYPE(HistEvent) *, int);
static int history_getsize(TYPE(History) *, TYPE(HistEvent) *);
static int history_setunique(TYPE(History) *, TYPE(HistEvent) *, int);
static int history_getunique(TYPE(History) *, TYPE(HistEvent) *);
static int history_set_fun(TYPE(History) *, TYPE(History) *);
static int history_load(TYPE(History) *, const char *);
static int history_save(TYPE(History) *, const char *);
static int history_save_fp(TYPE(History) *, FILE *);
static int history_prev_event(TYPE(History) *, TYPE(HistEvent) *, int);
static int history_next_event(TYPE(History) *, TYPE(HistEvent) *, int);
static int history_next_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 */
} history_t;
private int history_def_next(void *, TYPE(HistEvent) *);
private int history_def_first(void *, TYPE(HistEvent) *);
private int history_def_prev(void *, TYPE(HistEvent) *);
private int history_def_last(void *, TYPE(HistEvent) *);
private int history_def_curr(void *, TYPE(HistEvent) *);
private int history_def_set(void *, TYPE(HistEvent) *, const int);
private void history_def_clear(void *, TYPE(HistEvent) *);
private int history_def_enter(void *, TYPE(HistEvent) *, const Char *);
private int history_def_add(void *, TYPE(HistEvent) *, const Char *);
private int history_def_del(void *, TYPE(HistEvent) *, const int);
static int history_def_next(void *, TYPE(HistEvent) *);
static int history_def_first(void *, TYPE(HistEvent) *);
static int history_def_prev(void *, TYPE(HistEvent) *);
static int history_def_last(void *, TYPE(HistEvent) *);
static int history_def_curr(void *, TYPE(HistEvent) *);
static int history_def_set(void *, TYPE(HistEvent) *, const int);
static void history_def_clear(void *, TYPE(HistEvent) *);
static int history_def_enter(void *, TYPE(HistEvent) *, const Char *);
static int history_def_add(void *, TYPE(HistEvent) *, const Char *);
static int history_def_del(void *, TYPE(HistEvent) *, const int);
private int history_def_init(void **, TYPE(HistEvent) *, int);
private int history_def_insert(history_t *, TYPE(HistEvent) *, const Char *);
private void history_def_delete(history_t *, TYPE(HistEvent) *, hentry_t *);
static int history_def_init(void **, TYPE(HistEvent) *, int);
static int history_def_insert(history_t *, TYPE(HistEvent) *, const Char *);
static void history_def_delete(history_t *, TYPE(HistEvent) *, hentry_t *);
private int history_deldata_nth(history_t *, TYPE(HistEvent) *, int, void **);
private int history_set_nth(void *, TYPE(HistEvent) *, int);
static int history_deldata_nth(history_t *, TYPE(HistEvent) *, int, void **);
static int history_set_nth(void *, TYPE(HistEvent) *, int);
#define history_def_setsize(p, num)(void) (((history_t *)p)->max = (num))
#define history_def_getsize(p) (((history_t *)p)->cur)
@ -243,7 +244,7 @@ static const Char *const he_errlist[] = {
/* history_def_first():
* Default function to return the first event in the history.
*/
private int
static int
history_def_first(void *p, TYPE(HistEvent) *ev)
{
history_t *h = (history_t *) p;
@ -263,7 +264,7 @@ history_def_first(void *p, TYPE(HistEvent) *ev)
/* history_def_last():
* Default function to return the last event in the history.
*/
private int
static int
history_def_last(void *p, TYPE(HistEvent) *ev)
{
history_t *h = (history_t *) p;
@ -283,7 +284,7 @@ history_def_last(void *p, TYPE(HistEvent) *ev)
/* history_def_next():
* Default function to return the next event in the history.
*/
private int
static int
history_def_next(void *p, TYPE(HistEvent) *ev)
{
history_t *h = (history_t *) p;
@ -308,7 +309,7 @@ history_def_next(void *p, TYPE(HistEvent) *ev)
/* history_def_prev():
* Default function to return the previous event in the history.
*/
private int
static int
history_def_prev(void *p, TYPE(HistEvent) *ev)
{
history_t *h = (history_t *) p;
@ -334,7 +335,7 @@ history_def_prev(void *p, TYPE(HistEvent) *ev)
/* history_def_curr():
* Default function to return the current event in the history.
*/
private int
static int
history_def_curr(void *p, TYPE(HistEvent) *ev)
{
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
* given one.
*/
private int
static int
history_def_set(void *p, TYPE(HistEvent) *ev, const int n)
{
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
* n-th one.
*/
private int
static int
history_set_nth(void *p, TYPE(HistEvent) *ev, int n)
{
history_t *h = (history_t *) p;
@ -406,7 +407,7 @@ history_set_nth(void *p, TYPE(HistEvent) *ev, int n)
/* history_def_add():
* Append string to element
*/
private int
static int
history_def_add(void *p, TYPE(HistEvent) *ev, const Char *str)
{
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,
int num, void **data)
{
@ -454,7 +455,7 @@ history_deldata_nth(history_t *h, TYPE(HistEvent) *ev,
* Delete element hp of the h list
*/
/* ARGSUSED */
private int
static int
history_def_del(void *p, TYPE(HistEvent) *ev __attribute__((__unused__)),
const int num)
{
@ -472,7 +473,7 @@ history_def_del(void *p, TYPE(HistEvent) *ev __attribute__((__unused__)),
* Delete element hp of the h list
*/
/* ARGSUSED */
private void
static void
history_def_delete(history_t *h,
TYPE(HistEvent) *ev __attribute__((__unused__)), hentry_t *hp)
{
@ -495,7 +496,7 @@ history_def_delete(history_t *h,
/* history_def_insert():
* 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)
{
hentry_t *c;
@ -527,7 +528,7 @@ oomem:
/* history_def_enter():
* 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_t *h = (history_t *) p;
@ -554,7 +555,7 @@ history_def_enter(void *p, TYPE(HistEvent) *ev, const Char *str)
* Default history initialization function
*/
/* ARGSUSED */
private int
static int
history_def_init(void **p, TYPE(HistEvent) *ev __attribute__((__unused__)), int n)
{
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():
* Default history cleanup function
*/
private void
static void
history_def_clear(void *p, TYPE(HistEvent) *ev)
{
history_t *h = (history_t *) p;
@ -599,7 +600,7 @@ history_def_clear(void *p, TYPE(HistEvent) *ev)
/* history_init():
* Initialization function.
*/
public TYPE(History) *
TYPE(History) *
FUN(history,init)(void)
{
TYPE(HistEvent) ev;
@ -630,7 +631,7 @@ FUN(history,init)(void)
/* history_end():
* clean up history;
*/
public void
void
FUN(history,end)(TYPE(History) *h)
{
TYPE(HistEvent) ev;
@ -646,7 +647,7 @@ FUN(history,end)(TYPE(History) *h)
/* history_setsize():
* Set history number of events
*/
private int
static int
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():
* Get number of events currently in history
*/
private int
static int
history_getsize(TYPE(History) *h, TYPE(HistEvent) *ev)
{
if (h->h_next != history_def_next) {
@ -685,7 +686,7 @@ history_getsize(TYPE(History) *h, TYPE(HistEvent) *ev)
/* history_setunique():
* 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)
{
@ -701,7 +702,7 @@ history_setunique(TYPE(History) *h, TYPE(HistEvent) *ev, int uni)
/* history_getunique():
* Get if adjacent equal events should not be entered in history.
*/
private int
static int
history_getunique(TYPE(History) *h, TYPE(HistEvent) *ev)
{
if (h->h_next != history_def_next) {
@ -716,7 +717,7 @@ history_getunique(TYPE(History) *h, TYPE(HistEvent) *ev)
/* history_set_fun():
* Set history functions
*/
private int
static int
history_set_fun(TYPE(History) *h, TYPE(History) *nh)
{
TYPE(HistEvent) ev;
@ -763,7 +764,7 @@ history_set_fun(TYPE(History) *h, TYPE(History) *nh)
/* history_load():
* TYPE(History) load function
*/
private int
static int
history_load(TYPE(History) *h, const char *fname)
{
FILE *fp;
@ -823,7 +824,7 @@ done:
/* history_save_fp():
* TYPE(History) save function
*/
private int
static int
history_save_fp(TYPE(History) *h, FILE *fp)
{
TYPE(HistEvent) ev;
@ -870,7 +871,7 @@ done:
/* history_save():
* History save function
*/
private int
static int
history_save(TYPE(History) *h, const char *fname)
{
FILE *fp;
@ -889,7 +890,7 @@ history_save(TYPE(History) *h, const char *fname)
/* history_prev_event():
* Find the previous event, with number given
*/
private int
static int
history_prev_event(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
{
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)
{
int retval;
@ -923,7 +924,7 @@ history_next_evdata(TYPE(History) *h, TYPE(HistEvent) *ev, int num, void **d)
/* history_next_event():
* Find the next event, with number given
*/
private int
static int
history_next_event(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
{
int retval;
@ -940,7 +941,7 @@ history_next_event(TYPE(History) *h, TYPE(HistEvent) *ev, int num)
/* history_prev_string():
* Find the previous event beginning with string
*/
private int
static int
history_prev_string(TYPE(History) *h, TYPE(HistEvent) *ev, const Char *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():
* Find the next event beginning with string
*/
private int
static int
history_next_string(TYPE(History) *h, TYPE(HistEvent) *ev, const Char *str)
{
size_t len = Strlen(str);

View File

@ -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
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)key.c 8.1 (Berkeley) 6/4/93";
#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 /* not lint && not SCCSID */
@ -81,18 +81,18 @@ struct keymacro_node_t {
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 *);
private int node__try(EditLine *, keymacro_node_t *,
static int node__try(EditLine *, keymacro_node_t *,
const wchar_t *, keymacro_value_t *, int);
private keymacro_node_t *node__get(wint_t);
private void node__free(keymacro_node_t *);
private void node__put(EditLine *, keymacro_node_t *);
private int node__delete(EditLine *, keymacro_node_t **,
static keymacro_node_t *node__get(wint_t);
static void node__free(keymacro_node_t *);
static void node__put(EditLine *, keymacro_node_t *);
static int node__delete(EditLine *, keymacro_node_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);
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
@ -276,7 +276,7 @@ keymacro_print(EditLine *el, const wchar_t *key)
* recursively traverses node in tree until match or mismatch is
* found. May read in more characters.
*/
private int
static int
node_trav(EditLine *el, keymacro_node_t *ptr, wchar_t *ch,
keymacro_value_t *val)
{
@ -314,7 +314,7 @@ node_trav(EditLine *el, keymacro_node_t *ptr, wchar_t *ch,
/* node__try():
* 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,
keymacro_value_t *val, int ntype)
{
@ -377,7 +377,7 @@ node__try(EditLine *el, keymacro_node_t *ptr, const wchar_t *str,
/* node__delete():
* Delete node that matches str
*/
private int
static int
node__delete(EditLine *el, keymacro_node_t **inptr, const wchar_t *str)
{
keymacro_node_t *ptr;
@ -425,7 +425,7 @@ node__delete(EditLine *el, keymacro_node_t **inptr, const wchar_t *str)
/* node__put():
* Puts a tree of nodes onto free list using free(3).
*/
private void
static void
node__put(EditLine *el, keymacro_node_t *ptr)
{
if (ptr == NULL)
@ -457,7 +457,7 @@ node__put(EditLine *el, keymacro_node_t *ptr)
/* node__get():
* Returns pointer to a keymacro_node_t for ch.
*/
private keymacro_node_t *
static keymacro_node_t *
node__get(wint_t ch)
{
keymacro_node_t *ptr;
@ -473,7 +473,7 @@ node__get(wint_t ch)
return ptr;
}
private void
static void
node__free(keymacro_node_t *k)
{
if (k == NULL)
@ -487,7 +487,7 @@ node__free(keymacro_node_t *k)
* look for the str starting at node ptr.
* Print if last node
*/
private int
static int
node_lookup(EditLine *el, const wchar_t *str, keymacro_node_t *ptr,
size_t cnt)
{
@ -540,7 +540,7 @@ node_lookup(EditLine *el, const wchar_t *str, keymacro_node_t *ptr,
/* node_enum():
* 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)
{
ssize_t used;

View File

@ -1,5 +1,5 @@
#!/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
# The Regents of the University of California. All rights reserved.
@ -94,7 +94,7 @@ _EOF
printf("/* Automatically generated file, do not edit */\n");
printf("#include \"config.h\"\n#include \"el.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_";
high = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
for (i = 1; i <= length(low); i++)
@ -178,7 +178,7 @@ _EOF
printf("#include \"common.h\"\n");
printf("#include \"emacs.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;
needn = 1;
len = 0;

View File

@ -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
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)map.c 8.1 (Berkeley) 6/4/93";
#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 /* 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 "parse.h"
private 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);
private void map_print_all_keys(EditLine *);
private void map_init_nls(EditLine *);
private void map_init_meta(EditLine *);
static void map_print_key(EditLine *, el_action_t *, const wchar_t *);
static void map_print_some_keys(EditLine *, el_action_t *, wint_t, wint_t);
static void map_print_all_keys(EditLine *);
static void map_init_nls(EditLine *);
static void map_init_meta(EditLine *);
/* 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, /* ^@ */
/* 1 */ ED_MOVE_TO_BEG, /* ^A */
/* 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
* in the extended keymap.
*/
private const el_action_t el_map_vi_insert[] = {
static const el_action_t el_map_vi_insert[] = {
#ifdef KSHVI
/* 0 */ ED_UNASSIGNED, /* ^@ */
/* 1 */ ED_INSERT, /* ^A */
@ -629,7 +629,7 @@ private const el_action_t el_map_vi_insert[] = {
/* 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, /* ^@ */
/* 1 */ ED_MOVE_TO_BEG, /* ^A */
/* 2 */ ED_UNASSIGNED, /* ^B */
@ -962,7 +962,7 @@ map_end(EditLine *el)
/* map_init_nls():
* Find all the printable keys and bind them to self insert
*/
private void
static void
map_init_nls(EditLine *el)
{
int i;
@ -978,7 +978,7 @@ map_init_nls(EditLine *el)
/* map_init_meta():
* Bind all the meta keys to the appropriate ESC-<key> sequence
*/
private void
static void
map_init_meta(EditLine *el)
{
wchar_t buf[3];
@ -1123,7 +1123,7 @@ map_get_editor(EditLine *el, const wchar_t **editor)
/* map_print_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)
{
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():
* 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)
{
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():
* Print the function description for all keys.
*/
private void
static void
map_print_all_keys(EditLine *el)
{
int prev, i;

View File

@ -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
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/4/93";
#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 /* 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 "parse.h"
private const struct {
static const struct {
const wchar_t *name;
int (*func)(EditLine *, int, const wchar_t **);
} cmds[] = {
@ -96,7 +96,7 @@ parse_line(EditLine *el, const wchar_t *line)
/* el_parse():
* Command dispatcher
*/
public int
int
el_wparse(EditLine *el, int argc, const wchar_t *argv[])
{
const wchar_t *ptr;

View File

@ -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
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)prompt.c 8.1 (Berkeley) 6/4/93";
#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 /* 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 "el.h"
private wchar_t *prompt_default(EditLine *);
private wchar_t *prompt_default_r(EditLine *);
static wchar_t *prompt_default(EditLine *);
static wchar_t *prompt_default_r(EditLine *);
/* prompt_default():
* Just a default prompt, in case the user did not provide one
*/
private wchar_t *
static wchar_t *
/*ARGSUSED*/
prompt_default(EditLine *el __attribute__((__unused__)))
{
@ -66,7 +66,7 @@ prompt_default(EditLine *el __attribute__((__unused__)))
/* prompt_default_r():
* Just a default rprompt, in case the user did not provide one
*/
private wchar_t *
static wchar_t *
/*ARGSUSED*/
prompt_default_r(EditLine *el __attribute__((__unused__)))
{

View File

@ -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
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/4/93";
#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 /* 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! */
private int read__fixio(int, int);
private int read_char(EditLine *, wchar_t *);
private int read_getcmd(EditLine *, el_action_t *, wchar_t *);
private void read_pop(c_macro_t *);
static int read__fixio(int, int);
static int read_char(EditLine *, wchar_t *);
static int read_getcmd(EditLine *, el_action_t *, wchar_t *);
static void read_pop(c_macro_t *);
/* read_init():
* Initialize the read stuff
@ -103,7 +103,7 @@ el_read_getfn(EditLine *el)
#endif
#ifdef DEBUG_EDIT
private void
static void
read_debug(EditLine *el)
{
@ -125,7 +125,7 @@ read_debug(EditLine *el)
* Try to recover from a read error
*/
/* ARGSUSED */
private int
static int
read__fixio(int fd __attribute__((__unused__)), int e)
{
@ -186,7 +186,7 @@ read__fixio(int fd __attribute__((__unused__)), int e)
/* el_push():
* Push a macro
*/
public void
void
el_wpush(EditLine *el, const wchar_t *str)
{
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.
* 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)
{
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 a character from the tty.
*/
private int
static int
read_char(EditLine *el, wchar_t *cp)
{
ssize_t num_read;
@ -350,7 +350,7 @@ read_char(EditLine *el, wchar_t *cp)
/* read_pop():
* Pop a macro from the stack
*/
private void
static void
read_pop(c_macro_t *ma)
{
int i;
@ -365,7 +365,7 @@ read_pop(c_macro_t *ma)
/* el_wgetc():
* Read a wide character
*/
public int
int
el_wgetc(EditLine *el, wchar_t *cp)
{
int num_read;
@ -439,7 +439,7 @@ read_finish(EditLine *el)
sig_clr(el);
}
public const wchar_t *
const wchar_t *
el_wgets(EditLine *el, int *nread)
{
int retval;

View File

@ -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
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)refresh.c 8.1 (Berkeley) 6/4/93";
#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 /* 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"
private void re_nextline(EditLine *);
private void re_addc(EditLine *, wint_t);
private void re_update_line(EditLine *, wchar_t *, wchar_t *, int);
private void re_insert (EditLine *, wchar_t *, int, int, wchar_t *, int);
private void re_delete(EditLine *, wchar_t *, int, int, int);
private void re_fastputc(EditLine *, wint_t);
private void re_clear_eol(EditLine *, int, int, int);
private 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_nextline(EditLine *);
static void re_addc(EditLine *, wint_t);
static void re_update_line(EditLine *, wchar_t *, wchar_t *, int);
static void re_insert (EditLine *, wchar_t *, int, int, wchar_t *, int);
static void re_delete(EditLine *, wchar_t *, int, int, int);
static void re_fastputc(EditLine *, wint_t);
static void re_clear_eol(EditLine *, int, int, int);
static void re__strncopy(wchar_t *, wchar_t *, size_t);
static void re__copy_and_pad(wchar_t *, const wchar_t *, size_t);
#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 ELRE_ASSERT(a, b, c) do \
if (/*CONSTCOND*/ a) { \
@ -74,7 +74,7 @@ private void re_printstr(EditLine *, const char *, wchar_t *, wchar_t *);
/* re_printstr():
* Print a string on the debugging pty
*/
private void
static void
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():
* Move to the next line or scroll
*/
private void
static void
re_nextline(EditLine *el)
{
el->el_refresh.r_cursor.h = 0; /* reset it. */
@ -123,7 +123,7 @@ re_nextline(EditLine *el)
/* re_addc():
* Draw c, expanding tabs, control chars etc.
*/
private void
static void
re_addc(EditLine *el, wint_t 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)
* at dat, maximum length of d is dlen
*/
private void
static void
/*ARGSUSED*/
re_insert(EditLine *el __attribute__((__unused__)),
wchar_t *d, int dat, int dlen, wchar_t *s, int num)
@ -408,7 +408,7 @@ re_insert(EditLine *el __attribute__((__unused__)),
/* re_delete():
* delete num characters d at dat, maximum length of d is dlen
*/
private void
static void
/*ARGSUSED*/
re_delete(EditLine *el __attribute__((__unused__)),
wchar_t *d, int dat, int dlen, int num)
@ -442,7 +442,7 @@ re_delete(EditLine *el __attribute__((__unused__)),
/* re__strncopy():
* Like strncpy without padding.
*/
private void
static void
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
* number of characters between the new and old line.
*/
private void
static void
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
private void
static void
re_update_line(EditLine *el, wchar_t *old, wchar_t *new, int i)
{
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():
* Copy string and pad with spaces
*/
private void
static void
re__copy_and_pad(wchar_t *dst, const wchar_t *src, size_t width)
{
size_t i;
@ -1055,7 +1055,7 @@ re_refresh_cursor(EditLine *el)
/* re_fastputc():
* Add a character fast.
*/
private void
static void
re_fastputc(EditLine *el, wint_t c)
{
int w = wcwidth(c);

View File

@ -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
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)search.c 8.1 (Berkeley) 6/4/93";
#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 /* not lint && not SCCSID */
@ -98,7 +98,7 @@ search_end(EditLine *el)
/* regerror():
* Handle regular expression errors
*/
public void
void
/*ARGSUSED*/
regerror(const char *msg)
{

View File

@ -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
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)sig.c 8.1 (Berkeley) 6/4/93";
#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 /* 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 "common.h"
private EditLine *sel = NULL;
static EditLine *sel = NULL;
private const int sighdl[] = {
static const int sighdl[] = {
#define _DO(a) (a),
ALLSIGS
#undef _DO
- 1
};
private void sig_handler(int);
static void sig_handler(int);
/* sig_handler():
* This is the handler called for all signals
* XXX: we cannot pass any data so we just store the old editline
* state in a private variable
*/
private void
static void
sig_handler(int signo)
{
int i, save_errno;

View File

@ -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
@ -58,14 +58,6 @@
# endif
#endif
#ifndef public
# define public /* Externally visible functions/variables */
#endif
#ifndef private
# define private static /* Always hidden internals */
#endif
#ifndef protected
# define protected /* Redefined from elsewhere to "static" */
/* When we want to hide everything */

View File

@ -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
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)term.c 8.2 (Berkeley) 4/30/95";
#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 /* 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 Val(a) el->el_terminal.t_val[a]
private const struct termcapstr {
static const struct termcapstr {
const char *name;
const char *long_name;
} tstr[] = {
@ -174,7 +174,7 @@ private const struct termcapstr {
{ NULL, NULL }
};
private const struct termcapval {
static const struct termcapval {
const char *name;
const char *long_name;
} tval[] = {
@ -199,27 +199,27 @@ private const struct termcapval {
};
/* do two or more of the attributes use me */
private void terminal_setflags(EditLine *);
private int terminal_rebuffer_display(EditLine *);
private void terminal_free_display(EditLine *);
private int terminal_alloc_display(EditLine *);
private void terminal_alloc(EditLine *, const struct termcapstr *,
static void terminal_setflags(EditLine *);
static int terminal_rebuffer_display(EditLine *);
static void terminal_free_display(EditLine *);
static int terminal_alloc_display(EditLine *);
static void terminal_alloc(EditLine *, const struct termcapstr *,
const char *);
private void terminal_init_arrow(EditLine *);
private void terminal_reset_arrow(EditLine *);
private int terminal_putc(int);
private void terminal_tputs(EditLine *, const char *, int);
static void terminal_init_arrow(EditLine *);
static void terminal_reset_arrow(EditLine *);
static int terminal_putc(int);
static void terminal_tputs(EditLine *, const char *, int);
#ifdef _REENTRANT
private pthread_mutex_t terminal_mutex = PTHREAD_MUTEX_INITIALIZER;
static pthread_mutex_t terminal_mutex = PTHREAD_MUTEX_INITIALIZER;
#endif
private FILE *terminal_outfile = NULL;
static FILE *terminal_outfile = NULL;
/* terminal_setflags():
* Set the terminal capability flags
*/
private void
static void
terminal_setflags(EditLine *el)
{
EL_FLAGS = 0;
@ -337,7 +337,7 @@ terminal_end(EditLine *el)
/* terminal_alloc():
* Maintain a string pool for termcap strings
*/
private void
static void
terminal_alloc(EditLine *el, const struct termcapstr *t, const char *cap)
{
char termbuf[TC_BUFSIZE];
@ -403,7 +403,7 @@ terminal_alloc(EditLine *el, const struct termcapstr *t, const char *cap)
/* terminal_rebuffer_display():
* Rebuffer the display after the screen changed size
*/
private int
static int
terminal_rebuffer_display(EditLine *el)
{
coord_t *c = &el->el_terminal.t_size;
@ -422,7 +422,7 @@ terminal_rebuffer_display(EditLine *el)
/* terminal_alloc_display():
* Allocate a new display.
*/
private int
static int
terminal_alloc_display(EditLine *el)
{
int i;
@ -468,7 +468,7 @@ done:
/* terminal_free_display():
* Free the display buffers
*/
private void
static void
terminal_free_display(EditLine *el)
{
wchar_t **b;
@ -1007,7 +1007,7 @@ terminal_change_size(EditLine *el, int lins, int cols)
/* terminal_init_arrow():
* Initialize the arrow key bindings from termcap
*/
private void
static void
terminal_init_arrow(EditLine *el)
{
funckey_t *arrow = el->el_terminal.t_fkey;
@ -1052,7 +1052,7 @@ terminal_init_arrow(EditLine *el)
/* terminal_reset_arrow():
* Reset arrow key bindings
*/
private void
static void
terminal_reset_arrow(EditLine *el)
{
funckey_t *arrow = el->el_terminal.t_fkey;
@ -1222,7 +1222,7 @@ terminal_bind_arrow(EditLine *el)
/* terminal_putc():
* Add a character
*/
private int
static int
terminal_putc(int c)
{
if (terminal_outfile == NULL)
@ -1230,7 +1230,7 @@ terminal_putc(int c)
return fputc(c, terminal_outfile);
}
private void
static void
terminal_tputs(EditLine *el, const char *cap, int affcnt)
{
#ifdef _REENTRANT

View File

@ -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
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)tokenizer.c 8.1 (Berkeley) 6/4/93";
#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 /* 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)():
* Finish a word in the tokenizer.
*/
private void
static void
FUN(tok,finish)(TYPE(Tokenizer) *tok)
{
@ -117,7 +117,7 @@ FUN(tok,finish)(TYPE(Tokenizer) *tok)
/* FUN(tok,init)():
* Initialize the tokenizer
*/
public TYPE(Tokenizer) *
TYPE(Tokenizer) *
FUN(tok,init)(const Char *ifs)
{
TYPE(Tokenizer) *tok = tok_malloc(sizeof(*tok));
@ -158,7 +158,7 @@ FUN(tok,init)(const Char *ifs)
/* FUN(tok,reset)():
* Reset the tokenizer
*/
public void
void
FUN(tok,reset)(TYPE(Tokenizer) *tok)
{
@ -173,7 +173,7 @@ FUN(tok,reset)(TYPE(Tokenizer) *tok)
/* FUN(tok,end)():
* Clean up
*/
public void
void
FUN(tok,end)(TYPE(Tokenizer) *tok)
{
@ -202,7 +202,7 @@ FUN(tok,end)(TYPE(Tokenizer) *tok)
* cursorc if !NULL, argv element containing cursor
* cursorv if !NULL, offset in argv[cursorc] of cursor
*/
public int
int
FUN(tok,line)(TYPE(Tokenizer) *tok, const TYPE(LineInfo) *line,
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
* and splitting into words, ignoring cursor state.
*/
public int
int
FUN(tok,str)(TYPE(Tokenizer) *tok, const Char *line, int *argc,
const Char ***argv)
{

View File

@ -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
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)tty.c 8.1 (Berkeley) 6/4/93";
#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 /* not lint && not SCCSID */
@ -66,7 +66,7 @@ typedef struct ttymap_t {
} ttymap_t;
private const ttyperm_t ttyperm = {
static const ttyperm_t ttyperm = {
{
{"iflag:", ICRNL, (INLCR | IGNCR)},
{"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,
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
{C_ERASE, VERASE,
{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}}
};
private const ttymodes_t ttymodes[] = {
static const ttymodes_t ttymodes[] = {
#ifdef IGNBRK
{"ignbrk", IGNBRK, MD_INP},
#endif /* IGNBRK */
@ -455,21 +455,21 @@ private const ttymodes_t ttymodes[] = {
#define tty__geteightbit(td) (((td)->c_cflag & CSIZE) == CS8)
#define tty__cooked_mode(td) ((td)->c_lflag & ICANON)
private int tty_getty(EditLine *, struct termios *);
private int tty_setty(EditLine *, int, const struct termios *);
private int tty__getcharindex(int);
private void tty__getchar(struct termios *, unsigned char *);
private void tty__setchar(struct termios *, unsigned char *);
private speed_t tty__getspeed(struct termios *);
private int tty_setup(EditLine *);
private void tty_setup_flags(EditLine *, struct termios *, int);
static int tty_getty(EditLine *, struct termios *);
static int tty_setty(EditLine *, int, const struct termios *);
static int tty__getcharindex(int);
static void tty__getchar(struct termios *, unsigned char *);
static void tty__setchar(struct termios *, unsigned char *);
static speed_t tty__getspeed(struct termios *);
static int tty_setup(EditLine *);
static void tty_setup_flags(EditLine *, struct termios *, int);
#define t_qu t_ts
/* tty_getty():
* Wrapper for tcgetattr to handle EINTR
*/
private int
static int
tty_getty(EditLine *el, struct termios *t)
{
int rv;
@ -481,7 +481,7 @@ tty_getty(EditLine *el, struct termios *t)
/* tty_setty():
* Wrapper for tcsetattr to handle EINTR
*/
private int
static int
tty_setty(EditLine *el, int action, const struct termios *t)
{
int rv;
@ -493,7 +493,7 @@ tty_setty(EditLine *el, int action, const struct termios *t)
/* tty_setup():
* Get the tty parameters and initialize the editing state
*/
private int
static int
tty_setup(EditLine *el)
{
int rst = 1;
@ -605,7 +605,7 @@ tty_end(EditLine *el)
/* tty__getspeed():
* Get the tty speed
*/
private speed_t
static speed_t
tty__getspeed(struct termios *td)
{
speed_t spd;
@ -618,7 +618,7 @@ tty__getspeed(struct termios *td)
/* tty__getspeed():
* Return the index of the asked char in the c_cc array
*/
private int
static int
tty__getcharindex(int i)
{
switch (i) {
@ -726,7 +726,7 @@ tty__getcharindex(int i)
/* tty__getchar():
* Get the tty characters
*/
private void
static void
tty__getchar(struct termios *td, unsigned char *s)
{
@ -808,7 +808,7 @@ tty__getchar(struct termios *td, unsigned char *s)
/* tty__setchar():
* Set the tty characters
*/
private void
static void
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) {
switch (kind) {
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)
{
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)
{
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) {
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]))
@ -1309,7 +1309,7 @@ tty_stty(EditLine *el, int argc __attribute__((__unused__)),
/* tty_printchar():
* DEbugging routine to print the tty characters
*/
private void
static void
tty_printchar(EditLine *el, unsigned char *s)
{
ttyperm_t *m;
@ -1330,7 +1330,7 @@ tty_printchar(EditLine *el, unsigned char *s)
#endif /* notyet */
private void
static void
tty_setup_flags(EditLine *el, struct termios *tios, int mode)
{
int kind;

View File

@ -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
@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)vi.c 8.1 (Berkeley) 6/4/93";
#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 /* 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 "vi.h"
private el_action_t cv_action(EditLine *, wint_t);
private el_action_t cv_paste(EditLine *, wint_t);
static el_action_t cv_action(EditLine *, wint_t);
static el_action_t cv_paste(EditLine *, wint_t);
/* cv_action():
* Handle vi actions.
*/
private el_action_t
static el_action_t
cv_action(EditLine *el, wint_t c)
{
@ -94,7 +94,7 @@ cv_action(EditLine *el, wint_t c)
/* cv_paste():
* Paste previous deletion before or after the cursor
*/
private el_action_t
static el_action_t
cv_paste(EditLine *el, wint_t c)
{
c_kill_t *k = &el->el_chared.c_kill;