Source-Changes-HG archive

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

[src/trunk]: src/lib/libedit From Ingo Scharze:



details:   https://anonhg.NetBSD.org/src/rev/17aaec5305ec
branches:  trunk
changeset: 343607:17aaec5305ec
user:      christos <christos%NetBSD.org@localhost>
date:      Tue Feb 16 15:53:48 2016 +0000

description:
>From Ingo Scharze:
Let "el.h" include everything needed for struct editline,
and don't include that stuff multiple times.  That also improves
consistency, also avoids circular inclusions, and also makes it
easier to follow what is going on, even though not quite as nice.
But it seems like the best we can do...

diffstat:

 lib/libedit/chared.c       |   7 ++-----
 lib/libedit/chared.h       |   2 +-
 lib/libedit/chartype.c     |  10 +++-------
 lib/libedit/common.c       |   6 ++----
 lib/libedit/el.c           |   6 ++----
 lib/libedit/el.h           |   4 +++-
 lib/libedit/eln.c          |  10 ++++------
 lib/libedit/emacs.c        |   6 ++----
 lib/libedit/filecomplete.c |   6 ++----
 lib/libedit/hist.c         |   7 ++-----
 lib/libedit/hist.h         |   2 +-
 lib/libedit/keymacro.c     |   6 ++----
 lib/libedit/makelist       |  12 +++---------
 lib/libedit/map.c          |   7 ++-----
 lib/libedit/parse.c        |   9 +++------
 lib/libedit/prompt.c       |   7 ++-----
 lib/libedit/prompt.h       |   2 +-
 lib/libedit/read.c         |   7 ++-----
 lib/libedit/readline.c     |   6 ++----
 lib/libedit/refresh.c      |   6 ++----
 lib/libedit/refresh.h      |   2 +-
 lib/libedit/search.c       |   7 ++-----
 lib/libedit/search.h       |   2 +-
 lib/libedit/sig.c          |  10 +++-------
 lib/libedit/sig.h          |   2 +-
 lib/libedit/terminal.c     |   6 ++----
 lib/libedit/terminal.h     |   2 +-
 lib/libedit/tty.c          |   7 ++-----
 lib/libedit/tty.h          |   2 +-
 lib/libedit/vi.c           |   6 ++----
 30 files changed, 59 insertions(+), 115 deletions(-)

diffs (truncated from 684 to 300 lines):

diff -r 3813b008f23b -r 17aaec5305ec lib/libedit/chared.c
--- a/lib/libedit/chared.c      Tue Feb 16 14:08:25 2016 +0000
+++ b/lib/libedit/chared.c      Tue Feb 16 15:53:48 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: chared.c,v 1.43 2016/02/16 14:08:25 christos Exp $     */
+/*     $NetBSD: chared.c,v 1.44 2016/02/16 15:53:48 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.43 2016/02/16 14:08:25 christos Exp $");
+__RCSID("$NetBSD: chared.c,v 1.44 2016/02/16 15:53:48 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -45,9 +45,6 @@
  * chared.c: Character editor utilities
  */
 #include <stdlib.h>
-
-#include "histedit.h"
-#include "chartype.h"
 #include "el.h"
 
 private void ch__clearmacro (EditLine *);
diff -r 3813b008f23b -r 17aaec5305ec lib/libedit/chared.h
--- a/lib/libedit/chared.h      Tue Feb 16 14:08:25 2016 +0000
+++ b/lib/libedit/chared.h      Tue Feb 16 15:53:48 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: chared.h,v 1.24 2016/02/16 14:06:05 christos Exp $     */
+/*     $NetBSD: chared.h,v 1.25 2016/02/16 15:53:48 christos Exp $     */
 
 /*-
  * Copyright (c) 1992, 1993
diff -r 3813b008f23b -r 17aaec5305ec lib/libedit/chartype.c
--- a/lib/libedit/chartype.c    Tue Feb 16 14:08:25 2016 +0000
+++ b/lib/libedit/chartype.c    Tue Feb 16 15:53:48 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: chartype.c,v 1.16 2016/02/16 14:08:25 christos Exp $   */
+/*     $NetBSD: chartype.c,v 1.17 2016/02/16 15:53:48 christos Exp $   */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -38,15 +38,11 @@
  */
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: chartype.c,v 1.16 2016/02/16 14:08:25 christos Exp $");
+__RCSID("$NetBSD: chartype.c,v 1.17 2016/02/16 15:53:48 christos Exp $");
 #endif /* not lint && not SCCSID */
-
+#include "el.h"
 #include <stdlib.h>
 
-#include "histedit.h"
-#include "chartype.h"
-#include "el.h"
-
 #define CT_BUFSIZ ((size_t)1024)
 
 #ifdef WIDECHAR
diff -r 3813b008f23b -r 17aaec5305ec lib/libedit/common.c
--- a/lib/libedit/common.c      Tue Feb 16 14:08:25 2016 +0000
+++ b/lib/libedit/common.c      Tue Feb 16 15:53:48 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: common.c,v 1.33 2016/02/16 14:08:25 christos Exp $     */
+/*     $NetBSD: common.c,v 1.34 2016/02/16 15:53:48 christos Exp $     */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,15 +37,13 @@
 #if 0
 static char sccsid[] = "@(#)common.c   8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: common.c,v 1.33 2016/02/16 14:08:25 christos Exp $");
+__RCSID("$NetBSD: common.c,v 1.34 2016/02/16 15:53:48 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
 /*
  * common.c: Common Editor functions
  */
-#include "histedit.h"
-#include "chartype.h"
 #include "el.h"
 
 /* ed_end_of_file():
diff -r 3813b008f23b -r 17aaec5305ec lib/libedit/el.c
--- a/lib/libedit/el.c  Tue Feb 16 14:08:25 2016 +0000
+++ b/lib/libedit/el.c  Tue Feb 16 15:53:48 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: el.c,v 1.79 2016/02/16 14:08:25 christos Exp $ */
+/*     $NetBSD: el.c,v 1.80 2016/02/16 15:53:48 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.79 2016/02/16 14:08:25 christos Exp $");
+__RCSID("$NetBSD: el.c,v 1.80 2016/02/16 15:53:48 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -55,8 +55,6 @@
 #include <langinfo.h>
 #endif
 
-#include "histedit.h"
-#include "chartype.h"
 #include "el.h"
 
 /* el_init():
diff -r 3813b008f23b -r 17aaec5305ec lib/libedit/el.h
--- a/lib/libedit/el.h  Tue Feb 16 14:08:25 2016 +0000
+++ b/lib/libedit/el.h  Tue Feb 16 15:53:48 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: el.h,v 1.28 2016/02/16 14:08:25 christos Exp $ */
+/*     $NetBSD: el.h,v 1.29 2016/02/16 15:53:48 christos Exp $ */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -46,6 +46,8 @@
 #define        VIDEFAULT
 #define        ANCHOR
 
+#include "histedit.h"
+#include "chartype.h"
 #include <stdio.h>
 #include <sys/types.h>
 
diff -r 3813b008f23b -r 17aaec5305ec lib/libedit/eln.c
--- a/lib/libedit/eln.c Tue Feb 16 14:08:25 2016 +0000
+++ b/lib/libedit/eln.c Tue Feb 16 15:53:48 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: eln.c,v 1.24 2016/02/16 14:08:25 christos Exp $        */
+/*     $NetBSD: eln.c,v 1.25 2016/02/16 15:53:48 christos Exp $        */
 
 /*-
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -34,18 +34,16 @@
  */
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: eln.c,v 1.24 2016/02/16 14:08:25 christos Exp $");
+__RCSID("$NetBSD: eln.c,v 1.25 2016/02/16 15:53:48 christos Exp $");
 #endif /* not lint && not SCCSID */
 
-#include "histedit.h"
-#include "chartype.h"
-#include "el.h"
-#include "read.h"
 #include <errno.h>
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
 
+#include "el.h"
+
 public int
 el_getc(EditLine *el, char *cp)
 {
diff -r 3813b008f23b -r 17aaec5305ec lib/libedit/emacs.c
--- a/lib/libedit/emacs.c       Tue Feb 16 14:08:25 2016 +0000
+++ b/lib/libedit/emacs.c       Tue Feb 16 15:53:48 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: emacs.c,v 1.29 2016/02/16 14:08:25 christos Exp $      */
+/*     $NetBSD: emacs.c,v 1.30 2016/02/16 15:53:48 christos Exp $      */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,15 +37,13 @@
 #if 0
 static char sccsid[] = "@(#)emacs.c    8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: emacs.c,v 1.29 2016/02/16 14:08:25 christos Exp $");
+__RCSID("$NetBSD: emacs.c,v 1.30 2016/02/16 15:53:48 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
 /*
  * emacs.c: Emacs functions
  */
-#include "histedit.h"
-#include "chartype.h"
 #include "el.h"
 
 /* em_delete_or_list():
diff -r 3813b008f23b -r 17aaec5305ec lib/libedit/filecomplete.c
--- a/lib/libedit/filecomplete.c        Tue Feb 16 14:08:25 2016 +0000
+++ b/lib/libedit/filecomplete.c        Tue Feb 16 15:53:48 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: filecomplete.c,v 1.36 2016/02/16 14:08:25 christos Exp $       */
+/*     $NetBSD: filecomplete.c,v 1.37 2016/02/16 15:53:48 christos Exp $       */
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include "config.h"
 #if !defined(lint) && !defined(SCCSID)
-__RCSID("$NetBSD: filecomplete.c,v 1.36 2016/02/16 14:08:25 christos Exp $");
+__RCSID("$NetBSD: filecomplete.c,v 1.37 2016/02/16 15:53:48 christos Exp $");
 #endif /* not lint && not SCCSID */
 
 #include <sys/types.h>
@@ -47,8 +47,6 @@
 #include <errno.h>
 #include <fcntl.h>
 
-#include "histedit.h"
-#include "chartype.h"
 #include "el.h"
 #include "fcns.h"              /* for EL_NUM_FCNS */
 #include "filecomplete.h"
diff -r 3813b008f23b -r 17aaec5305ec lib/libedit/hist.c
--- a/lib/libedit/hist.c        Tue Feb 16 14:08:25 2016 +0000
+++ b/lib/libedit/hist.c        Tue Feb 16 15:53:48 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hist.c,v 1.22 2016/02/16 14:08:25 christos Exp $       */
+/*     $NetBSD: hist.c,v 1.23 2016/02/16 15:53:48 christos Exp $       */
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)hist.c     8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: hist.c,v 1.22 2016/02/16 14:08:25 christos Exp $");
+__RCSID("$NetBSD: hist.c,v 1.23 2016/02/16 15:53:48 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -45,9 +45,6 @@
  * hist.c: History access functions
  */
 #include <stdlib.h>
-
-#include "histedit.h"
-#include "chartype.h"
 #include "el.h"
 
 /* hist_init():
diff -r 3813b008f23b -r 17aaec5305ec lib/libedit/hist.h
--- a/lib/libedit/hist.h        Tue Feb 16 14:08:25 2016 +0000
+++ b/lib/libedit/hist.h        Tue Feb 16 15:53:48 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hist.h,v 1.16 2016/02/16 14:06:05 christos Exp $       */
+/*     $NetBSD: hist.h,v 1.17 2016/02/16 15:53:48 christos Exp $       */
 
 /*-
  * Copyright (c) 1992, 1993
diff -r 3813b008f23b -r 17aaec5305ec lib/libedit/keymacro.c
--- a/lib/libedit/keymacro.c    Tue Feb 16 14:08:25 2016 +0000
+++ b/lib/libedit/keymacro.c    Tue Feb 16 15:53:48 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: keymacro.c,v 1.11 2016/02/16 14:08:25 christos Exp $   */
+/*     $NetBSD: keymacro.c,v 1.12 2016/02/16 15:53:48 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.11 2016/02/16 14:08:25 christos Exp $");
+__RCSID("$NetBSD: keymacro.c,v 1.12 2016/02/16 15:53:48 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -66,8 +66,6 @@
 #include <string.h>
 #include <stdlib.h>
 
-#include "histedit.h"
-#include "chartype.h"
 #include "el.h"
 
 /*
diff -r 3813b008f23b -r 17aaec5305ec lib/libedit/makelist
--- a/lib/libedit/makelist      Tue Feb 16 14:08:25 2016 +0000
+++ b/lib/libedit/makelist      Tue Feb 16 15:53:48 2016 +0000
@@ -1,5 +1,5 @@
 #!/bin/sh -
-#      $NetBSD: makelist,v 1.21 2016/02/16 14:08:25 christos Exp $
+#      $NetBSD: makelist,v 1.22 2016/02/16 15:53:48 christos Exp $
 #
 # Copyright (c) 1992, 1993
 #      The Regents of the University of California.  All rights reserved.
@@ -93,10 +93,7 @@
     cat $FILES | $AWK '
        BEGIN {
            printf("/* Automatically generated file, do not edit */\n");
-           printf("#include \"config.h\"\n");
-           printf("#include \"histedit.h\"\n");
-           printf("#include \"chartype.h\"\n");



Home | Main Index | Thread Index | Old Index