diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2016-04-11 21:17:30 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2016-04-11 21:17:30 +0000 |
commit | 0610b8b35ff1469cf26b6a876d5a4c4e149e8772 (patch) | |
tree | ff8a837a507d62a6685932d131d451985a1959a2 | |
parent | d3b1d0ec2021ad8cc5f65aa75df399fb21423a57 (diff) |
delete the "private" and "public" preprocessor macros, just use standard C;
OK martijn@
-rw-r--r-- | lib/libedit/chared.c | 10 | ||||
-rw-r--r-- | lib/libedit/chartype.c | 10 | ||||
-rw-r--r-- | lib/libedit/chartype.h | 8 | ||||
-rw-r--r-- | lib/libedit/el.c | 20 | ||||
-rw-r--r-- | lib/libedit/eln.c | 14 | ||||
-rw-r--r-- | lib/libedit/history.c | 119 | ||||
-rw-r--r-- | lib/libedit/keymacro.c | 36 | ||||
-rw-r--r-- | lib/libedit/makelist | 4 | ||||
-rw-r--r-- | lib/libedit/map.c | 28 | ||||
-rw-r--r-- | lib/libedit/parse.c | 8 | ||||
-rw-r--r-- | lib/libedit/prompt.c | 12 | ||||
-rw-r--r-- | lib/libedit/read.c | 28 | ||||
-rw-r--r-- | lib/libedit/refresh.c | 44 | ||||
-rw-r--r-- | lib/libedit/search.c | 6 | ||||
-rw-r--r-- | lib/libedit/sig.c | 12 | ||||
-rw-r--r-- | lib/libedit/sys.h | 12 | ||||
-rw-r--r-- | lib/libedit/terminal.c | 46 | ||||
-rw-r--r-- | lib/libedit/tokenizer.c | 18 | ||||
-rw-r--r-- | lib/libedit/tty.c | 52 | ||||
-rw-r--r-- | lib/libedit/vi.c | 10 |
20 files changed, 245 insertions, 252 deletions
diff --git a/lib/libedit/chared.c b/lib/libedit/chared.c index 197b11768a4..beb1dad2cf0 100644 --- a/lib/libedit/chared.c +++ b/lib/libedit/chared.c @@ -1,4 +1,4 @@ -/* $OpenBSD: chared.c,v 1.24 2016/04/11 20:43:33 schwarze Exp $ */ +/* $OpenBSD: chared.c,v 1.25 2016/04/11 21:17:29 schwarze Exp $ */ /* $NetBSD: chared.c,v 1.28 2009/12/30 22:37:40 christos Exp $ */ /*- @@ -45,7 +45,7 @@ #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 @@ -482,7 +482,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; @@ -608,7 +608,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; @@ -630,7 +630,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) diff --git a/lib/libedit/chartype.c b/lib/libedit/chartype.c index 298732d6e2e..77ba9ab2754 100644 --- a/lib/libedit/chartype.c +++ b/lib/libedit/chartype.c @@ -1,4 +1,4 @@ -/* $OpenBSD: chartype.c,v 1.14 2016/04/11 20:54:05 schwarze Exp $ */ +/* $OpenBSD: chartype.c,v 1.15 2016/04/11 21:17:29 schwarze Exp $ */ /* $NetBSD: chartype.c,v 1.6 2011/07/28 00:48:21 christos Exp $ */ /*- @@ -40,9 +40,9 @@ #define CT_BUFSIZ 1024 -private void ct_conv_buff_resize(ct_buffer_t *, size_t, size_t); +static void ct_conv_buff_resize(ct_buffer_t *, size_t, size_t); -private void +static void ct_conv_buff_resize(ct_buffer_t *conv, size_t mincsize, size_t minwsize) { void *p; @@ -70,7 +70,7 @@ ct_conv_buff_resize(ct_buffer_t *conv, size_t mincsize, size_t minwsize) } -public char * +char * ct_encode_string(const wchar_t *s, ct_buffer_t *conv) { char *dst; @@ -103,7 +103,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 = 0; diff --git a/lib/libedit/chartype.h b/lib/libedit/chartype.h index 2cc4bc719d4..50b88527e81 100644 --- a/lib/libedit/chartype.h +++ b/lib/libedit/chartype.h @@ -1,5 +1,5 @@ -/* $OpenBSD: chartype.h,v 1.18 2016/04/11 20:54:05 schwarze Exp $ */ -/* $NetBSD: chartype.h,v 1.30 2016/04/11 16:06:52 christos Exp $ */ +/* $OpenBSD: chartype.h,v 1.19 2016/04/11 21:17:29 schwarze Exp $ */ +/* $NetBSD: chartype.h,v 1.31 2016/04/11 18:56:31 christos Exp $ */ /*- * Copyright (c) 2009 The NetBSD Foundation, Inc. @@ -61,10 +61,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. */ diff --git a/lib/libedit/el.c b/lib/libedit/el.c index d56576a6bbd..846f9b54e96 100644 --- a/lib/libedit/el.c +++ b/lib/libedit/el.c @@ -1,4 +1,4 @@ -/* $OpenBSD: el.c,v 1.33 2016/04/11 20:43:33 schwarze Exp $ */ +/* $OpenBSD: el.c,v 1.34 2016/04/11 21:17:29 schwarze Exp $ */ /* $NetBSD: el.c,v 1.61 2011/01/27 23:11:40 christos Exp $ */ /*- @@ -53,7 +53,7 @@ /* el_init(): * Initialize editline and set default parameters. */ -public EditLine * +EditLine * el_init(const char *prog, FILE *fin, FILE *fout, FILE *ferr) { EditLine *el = (EditLine *) malloc(sizeof(EditLine)); @@ -109,7 +109,7 @@ el_init(const char *prog, FILE *fin, FILE *fout, FILE *ferr) /* el_end(): * Clean up. */ -public void +void el_end(EditLine *el) { @@ -140,7 +140,7 @@ el_end(EditLine *el) /* el_reset(): * Reset the tty and the parser */ -public void +void el_reset(EditLine *el) { @@ -152,7 +152,7 @@ el_reset(EditLine *el) /* el_set(): * set the editline parameters */ -public int +int el_wset(EditLine *el, int op, ...) { va_list ap; @@ -358,7 +358,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; @@ -480,7 +480,7 @@ el_wget(EditLine *el, int op, ...) /* el_line(): * Return editing info */ -public const LineInfoW * +const LineInfoW * el_wline(EditLine *el) { @@ -491,7 +491,7 @@ el_wline(EditLine *el) /* el_source(): * Source a file */ -public int +int el_source(EditLine *el, const char *fname) { FILE *fp; @@ -562,7 +562,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; @@ -583,7 +583,7 @@ el_resize(EditLine *el) /* el_beep(): * Called from the program to beep */ -public void +void el_beep(EditLine *el) { diff --git a/lib/libedit/eln.c b/lib/libedit/eln.c index 0af820a7dfb..e7538e8ee52 100644 --- a/lib/libedit/eln.c +++ b/lib/libedit/eln.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eln.c,v 1.17 2016/04/11 20:43:33 schwarze Exp $ */ +/* $OpenBSD: eln.c,v 1.18 2016/04/11 21:17:29 schwarze Exp $ */ /* $NetBSD: eln.c,v 1.9 2010/11/04 13:53:12 christos Exp $ */ /*- @@ -35,7 +35,7 @@ #include "el.h" -public int +int el_getc(EditLine *el, char *cp) { int num_read; @@ -56,7 +56,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 @@ -65,7 +65,7 @@ el_push(EditLine *el, const char *str) } -public const char * +const char * el_gets(EditLine *el, int *nread) { const wchar_t *tmp; @@ -92,7 +92,7 @@ el_gets(EditLine *el, int *nread) } -public int +int el_parse(EditLine *el, int argc, const char *argv[]) { int ret; @@ -109,7 +109,7 @@ el_parse(EditLine *el, int argc, const char *argv[]) } -public int +int el_set(EditLine *el, int op, ...) { va_list ap; @@ -259,7 +259,7 @@ out: } -public int +int el_get(EditLine *el, int op, ...) { va_list ap; diff --git a/lib/libedit/history.c b/lib/libedit/history.c index a5738cc48c7..e92600253be 100644 --- a/lib/libedit/history.c +++ b/lib/libedit/history.c @@ -1,4 +1,4 @@ -/* $OpenBSD: history.c,v 1.27 2016/04/11 20:54:05 schwarze Exp $ */ +/* $OpenBSD: history.c,v 1.28 2016/04/11 21:17:29 schwarze Exp $ */ /* $NetBSD: history.c,v 1.37 2010/01/03 18:27:10 christos Exp $ */ /*- @@ -128,19 +128,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 *); /***********************************************************************/ @@ -165,23 +166,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) @@ -238,7 +239,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; @@ -258,7 +259,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; @@ -278,7 +279,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; @@ -303,7 +304,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; @@ -329,7 +330,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; @@ -350,7 +351,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; @@ -377,7 +378,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; @@ -401,7 +402,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; @@ -427,7 +428,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) { @@ -449,7 +450,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) { @@ -467,7 +468,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) { @@ -490,7 +491,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) { @@ -520,7 +521,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; @@ -547,7 +548,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 *) malloc(sizeof(history_t)); @@ -572,7 +573,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; @@ -591,7 +592,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; @@ -622,7 +623,7 @@ FUN(history,init)(void) /* history_end(): * clean up history; */ -public void +void FUN(history,end)(TYPE(History) *h) { TYPE(HistEvent) ev; @@ -638,7 +639,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) { @@ -658,7 +659,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) { @@ -677,7 +678,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) { @@ -693,7 +694,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) { @@ -708,7 +709,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; @@ -754,7 +755,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; @@ -814,7 +815,7 @@ done: /* history_save_fp(): * TYPE(History) save function */ -private int +static int history_save_fp(TYPE(History) *h, FILE *fp) { TYPE(HistEvent) ev; @@ -860,7 +861,7 @@ done: /* history_save(): * History save function */ -private int +static int history_save(TYPE(History) *h, const char *fname) { FILE *fp; @@ -879,7 +880,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; @@ -893,7 +894,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; @@ -913,7 +914,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; @@ -930,7 +931,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); @@ -948,7 +949,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); diff --git a/lib/libedit/keymacro.c b/lib/libedit/keymacro.c index dc2137aa1a7..97de3a72a7e 100644 --- a/lib/libedit/keymacro.c +++ b/lib/libedit/keymacro.c @@ -1,5 +1,5 @@ -/* $OpenBSD: keymacro.c,v 1.12 2016/04/11 20:43:33 schwarze Exp $ */ -/* $NetBSD: keymacro.c,v 1.18 2016/04/11 00:50:13 christos Exp $ */ +/* $OpenBSD: keymacro.c,v 1.13 2016/04/11 21:17:29 schwarze Exp $ */ +/* $NetBSD: keymacro.c,v 1.19 2016/04/11 18:56:31 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -75,18 +75,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 @@ -270,7 +270,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) { @@ -308,7 +308,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) { @@ -371,7 +371,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; @@ -419,7 +419,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) @@ -451,7 +451,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; @@ -467,7 +467,7 @@ node__get(wint_t ch) return ptr; } -private void +static void node__free(keymacro_node_t *k) { if (k == NULL) @@ -481,7 +481,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) { @@ -533,7 +533,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; diff --git a/lib/libedit/makelist b/lib/libedit/makelist index b6aa9e07abd..931ce315187 100644 --- a/lib/libedit/makelist +++ b/lib/libedit/makelist @@ -93,7 +93,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++) @@ -177,7 +177,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; diff --git a/lib/libedit/map.c b/lib/libedit/map.c index b27441efc86..02843283d2d 100644 --- a/lib/libedit/map.c +++ b/lib/libedit/map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: map.c,v 1.22 2016/04/11 20:43:33 schwarze Exp $ */ +/* $OpenBSD: map.c,v 1.23 2016/04/11 21:17:29 schwarze Exp $ */ /* $NetBSD: map.c,v 1.25 2009/12/30 22:37:40 christos Exp $ */ /*- @@ -46,16 +46,16 @@ #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 */ @@ -322,7 +322,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 */ @@ -623,7 +623,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 */ @@ -957,7 +957,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; @@ -973,7 +973,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]; @@ -1118,7 +1118,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]; @@ -1141,7 +1141,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; @@ -1205,7 +1205,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; diff --git a/lib/libedit/parse.c b/lib/libedit/parse.c index 09009a035ff..3d429ba0ed7 100644 --- a/lib/libedit/parse.c +++ b/lib/libedit/parse.c @@ -1,5 +1,5 @@ -/* $OpenBSD: parse.c,v 1.19 2016/04/11 20:43:33 schwarze Exp $ */ -/* $NetBSD: parse.c,v 1.37 2016/04/11 00:50:13 christos Exp $ */ +/* $OpenBSD: parse.c,v 1.20 2016/04/11 21:17:29 schwarze Exp $ */ +/* $NetBSD: parse.c,v 1.38 2016/04/11 18:56:31 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -54,7 +54,7 @@ #include "el.h" #include "parse.h" -private const struct { +static const struct { const wchar_t *name; int (*func)(EditLine *, int, const wchar_t **); } cmds[] = { @@ -90,7 +90,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; diff --git a/lib/libedit/prompt.c b/lib/libedit/prompt.c index 58d575e5c01..360042466b9 100644 --- a/lib/libedit/prompt.c +++ b/lib/libedit/prompt.c @@ -1,5 +1,5 @@ -/* $OpenBSD: prompt.c,v 1.12 2016/04/11 20:43:33 schwarze Exp $ */ -/* $NetBSD: prompt.c,v 1.20 2011/07/29 15:16:33 christos Exp $ */ +/* $OpenBSD: prompt.c,v 1.13 2016/04/11 21:17:29 schwarze Exp $ */ +/* $NetBSD: prompt.c,v 1.25 2016/04/11 18:56:31 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -41,13 +41,13 @@ #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__))) { @@ -60,7 +60,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__))) { diff --git a/lib/libedit/read.c b/lib/libedit/read.c index c8599af8099..3d17dc1a9a3 100644 --- a/lib/libedit/read.c +++ b/lib/libedit/read.c @@ -1,5 +1,5 @@ -/* $OpenBSD: read.c,v 1.34 2016/04/11 20:43:33 schwarze Exp $ */ -/* $NetBSD: read.c,v 1.90 2016/04/11 00:50:13 christos Exp $ */ +/* $OpenBSD: read.c,v 1.35 2016/04/11 21:17:29 schwarze Exp $ */ +/* $NetBSD: read.c,v 1.91 2016/04/11 18:56:31 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -51,10 +51,10 @@ #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 @@ -97,7 +97,7 @@ el_read_getfn(EditLine *el) #endif #ifdef DEBUG_EDIT -private void +static void read_debug(EditLine *el) { @@ -119,7 +119,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) { @@ -180,7 +180,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; @@ -200,7 +200,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; @@ -260,7 +260,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; @@ -344,7 +344,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; @@ -359,7 +359,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; @@ -433,7 +433,7 @@ read_finish(EditLine *el) sig_clr(el); } -public const wchar_t * +const wchar_t * el_wgets(EditLine *el, int *nread) { int retval; diff --git a/lib/libedit/refresh.c b/lib/libedit/refresh.c index 85498d30296..fa3e1f999d9 100644 --- a/lib/libedit/refresh.c +++ b/lib/libedit/refresh.c @@ -1,5 +1,5 @@ -/* $OpenBSD: refresh.c,v 1.18 2016/04/11 20:43:33 schwarze Exp $ */ -/* $NetBSD: refresh.c,v 1.48 2016/04/11 00:50:13 christos Exp $ */ +/* $OpenBSD: refresh.c,v 1.19 2016/04/11 21:17:29 schwarze Exp $ */ +/* $NetBSD: refresh.c,v 1.49 2016/04/11 18:56:31 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -44,18 +44,18 @@ #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) { \ @@ -68,7 +68,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) { @@ -85,7 +85,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. */ @@ -117,7 +117,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)) { @@ -351,7 +351,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) @@ -402,7 +402,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) @@ -436,7 +436,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) { @@ -451,7 +451,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) { @@ -495,7 +495,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; @@ -965,7 +965,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; @@ -1049,7 +1049,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); diff --git a/lib/libedit/search.c b/lib/libedit/search.c index 1a134c3422b..e4bb6433bcb 100644 --- a/lib/libedit/search.c +++ b/lib/libedit/search.c @@ -1,5 +1,5 @@ -/* $OpenBSD: search.c,v 1.24 2016/04/11 20:43:33 schwarze Exp $ */ -/* $NetBSD: search.c,v 1.43 2016/04/11 00:50:13 christos Exp $ */ +/* $OpenBSD: search.c,v 1.25 2016/04/11 21:17:29 schwarze Exp $ */ +/* $NetBSD: search.c,v 1.44 2016/04/11 18:56:31 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -92,7 +92,7 @@ search_end(EditLine *el) /* regerror(): * Handle regular expression errors */ -public void +void /*ARGSUSED*/ regerror(const char *msg) { diff --git a/lib/libedit/sig.c b/lib/libedit/sig.c index 8dcd5b9caef..ca5a881342d 100644 --- a/lib/libedit/sig.c +++ b/lib/libedit/sig.c @@ -1,5 +1,5 @@ -/* $OpenBSD: sig.c,v 1.18 2016/03/20 23:48:27 schwarze Exp $ */ -/* $NetBSD: sig.c,v 1.24 2016/02/16 19:08:41 christos Exp $ */ +/* $OpenBSD: sig.c,v 1.19 2016/04/11 21:17:29 schwarze Exp $ */ +/* $NetBSD: sig.c,v 1.25 2016/04/11 18:56:31 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -46,23 +46,23 @@ #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; diff --git a/lib/libedit/sys.h b/lib/libedit/sys.h index 82f0b7acee0..17ba7e343f6 100644 --- a/lib/libedit/sys.h +++ b/lib/libedit/sys.h @@ -1,5 +1,5 @@ -/* $OpenBSD: sys.h,v 1.16 2016/04/09 19:31:55 schwarze Exp $ */ -/* $NetBSD: sys.h,v 1.13 2009/12/30 22:37:40 christos Exp $ */ +/* $OpenBSD: sys.h,v 1.17 2016/04/11 21:17:29 schwarze Exp $ */ +/* $NetBSD: sys.h,v 1.25 2016/04/11 18:56:31 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -59,14 +59,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 */ diff --git a/lib/libedit/terminal.c b/lib/libedit/terminal.c index 1b1da0f596c..6397d6248e0 100644 --- a/lib/libedit/terminal.c +++ b/lib/libedit/terminal.c @@ -1,4 +1,4 @@ -/* $OpenBSD: terminal.c,v 1.15 2016/04/11 20:43:33 schwarze Exp $ */ +/* $OpenBSD: terminal.c,v 1.16 2016/04/11 21:17:29 schwarze Exp $ */ /* $NetBSD: terminal.c,v 1.17 2016/02/15 15:35:03 christos Exp $ */ /*- @@ -82,7 +82,7 @@ #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[] = { @@ -166,7 +166,7 @@ private const struct termcapstr { { NULL, NULL } }; -private const struct termcapval { +static const struct termcapval { const char *name; const char *long_name; } tval[] = { @@ -191,27 +191,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; @@ -323,7 +323,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]; @@ -388,7 +388,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; @@ -407,7 +407,7 @@ terminal_rebuffer_display(EditLine *el) /* terminal_alloc_display(): * Allocate a new display. */ -private int +static int terminal_alloc_display(EditLine *el) { int i; @@ -453,7 +453,7 @@ done: /* terminal_free_display(): * Free the display buffers */ -private void +static void terminal_free_display(EditLine *el) { wchar_t **b; @@ -993,7 +993,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; @@ -1033,7 +1033,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; @@ -1203,7 +1203,7 @@ terminal_bind_arrow(EditLine *el) /* terminal_putc(): * Add a character */ -private int +static int terminal_putc(int c) { if (terminal_outfile == NULL) @@ -1211,7 +1211,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 diff --git a/lib/libedit/tokenizer.c b/lib/libedit/tokenizer.c index 2f759baae16..c787ae72652 100644 --- a/lib/libedit/tokenizer.c +++ b/lib/libedit/tokenizer.c @@ -1,5 +1,5 @@ -/* $OpenBSD: tokenizer.c,v 1.20 2016/04/11 20:54:05 schwarze Exp $ */ -/* $NetBSD: tokenizer.c,v 1.27 2016/04/11 16:06:52 christos Exp $ */ +/* $OpenBSD: tokenizer.c,v 1.21 2016/04/11 21:17:29 schwarze Exp $ */ +/* $NetBSD: tokenizer.c,v 1.28 2016/04/11 18:56:31 christos Exp $ */ /*- * Copyright (c) 1992, 1993 @@ -84,13 +84,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) { @@ -107,7 +107,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 = malloc(sizeof(TYPE(Tokenizer))); @@ -148,7 +148,7 @@ FUN(tok,init)(const Char *ifs) /* FUN(tok,reset)(): * Reset the tokenizer */ -public void +void FUN(tok,reset)(TYPE(Tokenizer) *tok) { @@ -163,7 +163,7 @@ FUN(tok,reset)(TYPE(Tokenizer) *tok) /* FUN(tok,end)(): * Clean up */ -public void +void FUN(tok,end)(TYPE(Tokenizer) *tok) { @@ -192,7 +192,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) { @@ -442,7 +442,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) { diff --git a/lib/libedit/tty.c b/lib/libedit/tty.c index c7134e3a135..e702ea2bd9d 100644 --- a/lib/libedit/tty.c +++ b/lib/libedit/tty.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty.c,v 1.25 2016/04/11 20:43:33 schwarze Exp $ */ +/* $OpenBSD: tty.c,v 1.26 2016/04/11 21:17:29 schwarze Exp $ */ /* $NetBSD: tty.c,v 1.34 2011/01/27 23:11:40 christos Exp $ */ /*- @@ -60,7 +60,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}, @@ -88,7 +88,7 @@ private const ttyperm_t ttyperm = { } }; -private const ttychar_t ttychar = { +static const ttychar_t ttychar = { { CINTR, CQUIT, CERASE, CKILL, CEOF, CEOL, CEOL2, CSWTCH, @@ -118,7 +118,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}}, @@ -155,7 +155,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 */ @@ -449,21 +449,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; @@ -475,7 +475,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; @@ -487,7 +487,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; @@ -600,7 +600,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; @@ -613,7 +613,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) { @@ -721,7 +721,7 @@ tty__getcharindex(int i) /* tty__getchar(): * Get the tty characters */ -private void +static void tty__getchar(struct termios *td, unsigned char *s) { @@ -803,7 +803,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) { @@ -930,7 +930,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: @@ -948,7 +948,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; @@ -957,7 +957,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; @@ -972,7 +972,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])) @@ -1302,7 +1302,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; @@ -1323,7 +1323,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; diff --git a/lib/libedit/vi.c b/lib/libedit/vi.c index 592d552c294..9574352505d 100644 --- a/lib/libedit/vi.c +++ b/lib/libedit/vi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vi.c,v 1.23 2016/04/11 20:43:33 schwarze Exp $ */ +/* $OpenBSD: vi.c,v 1.24 2016/04/11 21:17:29 schwarze Exp $ */ /* $NetBSD: vi.c,v 1.33 2011/02/17 16:44:48 joerg Exp $ */ /*- @@ -50,13 +50,13 @@ #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) { @@ -88,7 +88,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; |