Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libedit Get rid of private/public; keep protected (Ingo ...



details:   https://anonhg.NetBSD.org/src/rev/594ee95ad085
branches:  trunk
changeset: 814842:594ee95ad085
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Apr 11 18:56:31 2016 +0000

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

diffstat:

 lib/libedit/chared.c    |   14 ++--
 lib/libedit/chartype.c  |   16 +++---
 lib/libedit/chartype.h  |    6 +-
 lib/libedit/el.c        |   24 ++++----
 lib/libedit/eln.c       |   16 +++---
 lib/libedit/history.c   |  121 ++++++++++++++++++++++++-----------------------
 lib/libedit/keymacro.c  |   36 +++++++-------
 lib/libedit/makelist    |    6 +-
 lib/libedit/map.c       |   30 +++++-----
 lib/libedit/parse.c     |    8 +-
 lib/libedit/prompt.c    |   12 ++--
 lib/libedit/read.c      |   28 +++++-----
 lib/libedit/refresh.c   |   44 ++++++++--------
 lib/libedit/search.c    |    6 +-
 lib/libedit/sig.c       |   12 ++--
 lib/libedit/sys.h       |   10 +---
 lib/libedit/terminal.c  |   48 +++++++++---------
 lib/libedit/tokenizer.c |   18 +++---
 lib/libedit/tty.c       |   54 ++++++++++----------
 lib/libedit/vi.c        |   12 ++--
 20 files changed, 257 insertions(+), 264 deletions(-)

diffs (truncated from 1816 to 300 lines):

diff -r eaaa5865fdd8 -r 594ee95ad085 lib/libedit/chared.c
--- a/lib/libedit/chared.c      Mon Apr 11 17:00:36 2016 +0000
+++ b/lib/libedit/chared.c      Mon Apr 11 18:56:31 2016 +0000
@@ -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 @@
 #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__clearmacro(el);
 }
 
-private void
+static void
 ch__clearmacro(EditLine *el)
 {
        c_macro_t *ma = &el->el_chared.c_macro;
@@ -614,7 +614,7 @@
 /* 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_deletestr():
  *     Delete num characters before the cursor
  */
-public void
+void
 el_deletestr(EditLine *el, int n)
 {
        if (n <= 0)
@@ -654,7 +654,7 @@
 /* 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)
diff -r eaaa5865fdd8 -r 594ee95ad085 lib/libedit/chartype.c
--- a/lib/libedit/chartype.c    Mon Apr 11 17:00:36 2016 +0000
+++ b/lib/libedit/chartype.c    Mon Apr 11 18:56:31 2016 +0000
@@ -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 @@
 
 #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 @@
        return 0;
 }
 
-private int
+static int
 ct_conv_wbuff_resize(ct_buffer_t *conv, size_t wsize)
 {
        void *p;
@@ -88,7 +88,7 @@
 }
 
 
-public char *
+char *
 ct_encode_string(const wchar_t *s, ct_buffer_t *conv)
 {
        char *dst;
@@ -118,7 +118,7 @@
        return conv->cbuff;
 }
 
-public wchar_t *
+wchar_t *
 ct_decode_string(const char *s, ct_buffer_t *conv)
 {
        size_t len;
diff -r eaaa5865fdd8 -r 594ee95ad085 lib/libedit/chartype.h
--- a/lib/libedit/chartype.h    Mon Apr 11 17:00:36 2016 +0000
+++ b/lib/libedit/chartype.h    Mon Apr 11 18:56:31 2016 +0000
@@ -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 @@
 } 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 -r eaaa5865fdd8 -r 594ee95ad085 lib/libedit/el.c
--- a/lib/libedit/el.c  Mon Apr 11 17:00:36 2016 +0000
+++ b/lib/libedit/el.c  Mon Apr 11 18:56:31 2016 +0000
@@ -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 @@
 /* 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_end():
  *     Clean up.
  */
-public void
+void
 el_end(EditLine *el)
 {
 
@@ -155,7 +155,7 @@
 /* el_reset():
  *     Reset the tty and the parser
  */
-public void
+void
 el_reset(EditLine *el)
 {
 
@@ -167,7 +167,7 @@
 /* el_set():
  *     set the editline parameters
  */
-public int
+int
 el_wset(EditLine *el, int op, ...)
 {
        va_list ap;
@@ -380,7 +380,7 @@
 /* el_get():
  *     retrieve the editline parameters
  */
-public int
+int
 el_wget(EditLine *el, int op, ...)
 {
        va_list ap;
@@ -493,7 +493,7 @@
 /* el_line():
  *     Return editing info
  */
-public const LineInfoW *
+const LineInfoW *
 el_wline(EditLine *el)
 {
 
@@ -504,7 +504,7 @@
 /* el_source():
  *     Source a file
  */
-public int
+int
 el_source(EditLine *el, const char *fname)
 {
        FILE *fp;
@@ -576,7 +576,7 @@
 /* el_resize():
  *     Called from program when terminal is resized
  */
-public void
+void
 el_resize(EditLine *el)
 {
        int lins, cols;
@@ -597,7 +597,7 @@
 /* el_beep():
  *     Called from the program to beep
  */
-public void
+void
 el_beep(EditLine *el)
 {
 
diff -r eaaa5865fdd8 -r 594ee95ad085 lib/libedit/eln.c
--- a/lib/libedit/eln.c Mon Apr 11 17:00:36 2016 +0000
+++ b/lib/libedit/eln.c Mon Apr 11 18:56:31 2016 +0000
@@ -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 @@
 
 #include "el.h"
 
-public int
+int
 el_getc(EditLine *el, char *cp)
 {
        int num_read;
@@ -58,7 +58,7 @@
 }
 
 
-public void
+void
 el_push(EditLine *el, const char *str)
 {
        /* Using multibyte->wide string decoding works fine under single-byte
@@ -67,7 +67,7 @@
 }
 
 
-public const char *
+const char *
 el_gets(EditLine *el, int *nread)
 {
        const wchar_t *tmp;
@@ -85,7 +85,7 @@
 }
 
 



Home | Main Index | Thread Index | Old Index