summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2016-05-03 11:36:18 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2016-05-03 11:36:18 +0000
commit2a199f6e62406a31625e8dc85346926d169ae681 (patch)
treeb56c5018307ba2c957b7c5d57be1424dfe086b7a /lib
parent8a9c2f057528fd59d2e4af4583d08c98221f0197 (diff)
Combine help.h and help.c into a simplified help.h
and include it only in the one file needing it, map.c. Also delete makelist -bc. OK martijn@, also proofread by Christian Heckendorf <mbie at ulmus dot me>
Diffstat (limited to 'lib')
-rw-r--r--lib/libedit/Makefile15
-rw-r--r--lib/libedit/editline.c1
-rw-r--r--lib/libedit/makelist22
-rw-r--r--lib/libedit/map.c4
4 files changed, 11 insertions, 31 deletions
diff --git a/lib/libedit/Makefile b/lib/libedit/Makefile
index e2cbbee1607..3a3c9a596fe 100644
--- a/lib/libedit/Makefile
+++ b/lib/libedit/Makefile
@@ -1,10 +1,10 @@
-# $OpenBSD: Makefile,v 1.22 2016/05/03 11:19:30 schwarze Exp $
+# $OpenBSD: Makefile,v 1.23 2016/05/03 11:36:17 schwarze Exp $
# $NetBSD: Makefile,v 1.41 2010/02/03 15:34:43 roy Exp $
# @(#)Makefile 8.1 (Berkeley) 6/4/93
LIB= edit
-OSRCS= chared.c common.c el.c eln.c emacs.c fcns.c filecomplete.c help.c \
+OSRCS= chared.c common.c el.c eln.c emacs.c fcns.c filecomplete.c \
hist.c keymacro.c map.c chartype.c \
parse.c prompt.c read.c refresh.c search.c sig.c terminal.c tty.c vi.c
@@ -23,7 +23,8 @@ INCS= histedit.h
INCSDIR=/usr/include
CLEANFILES+=common.h.tmp emacs.h.tmp fcns.c.tmp fcns.h.tmp
-CLEANFILES+=help.c.tmp help.h.tmp vi.h.tmp tc1.o tc1 .depend
+CLEANFILES+=help.h.tmp vi.h.tmp tc1.o tc1 .depend
+
CFLAGS+=-Wall
CPPFLAGS+=-I. -I${LIBEDITDIR}
CPPFLAGS+=-I. -I${.CURDIR}
@@ -33,12 +34,12 @@ CPPFLAGS+=-I. -I${.CURDIR}
AHDR=vi.h emacs.h common.h
ASRC=${LIBEDITDIR}/vi.c ${LIBEDITDIR}/emacs.c ${LIBEDITDIR}/common.c
-CLEANFILES+= ${AHDR} fcns.h help.h fcns.c help.c
+CLEANFILES+= ${AHDR} fcns.h help.h fcns.c
#SUBDIR+= readline
HOST_SH= sh
-.depend: ${AHDR} fcns.h help.h fcns.c help.c
+.depend: ${AHDR} fcns.h help.h fcns.c
vi.h: vi.c makelist
${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/vi.c \
@@ -63,10 +64,6 @@ fcns.c: ${AHDR} fcns.h help.h makelist
${HOST_SH} ${LIBEDITDIR}/makelist -fc ${AHDR} > ${.TARGET}.tmp && \
mv ${.TARGET}.tmp ${.TARGET}
-help.c: ${ASRC} makelist
- ${HOST_SH} ${LIBEDITDIR}/makelist -bc ${ASRC} > ${.TARGET}.tmp && \
- mv ${.TARGET}.tmp ${.TARGET}
-
help.h: ${ASRC} makelist
${HOST_SH} ${LIBEDITDIR}/makelist -bh ${ASRC} > ${.TARGET}.tmp && \
mv ${.TARGET}.tmp ${.TARGET}
diff --git a/lib/libedit/editline.c b/lib/libedit/editline.c
index bc377d51c02..ba4f660c688 100644
--- a/lib/libedit/editline.c
+++ b/lib/libedit/editline.c
@@ -7,7 +7,6 @@
#include "emacs.c"
#include "fcns.c"
#include "filecomplete.c"
-#include "help.c"
#include "hist.c"
#include "keymacro.c"
#include "map.c"
diff --git a/lib/libedit/makelist b/lib/libedit/makelist
index 18794df6460..6fcaf26e6cb 100644
--- a/lib/libedit/makelist
+++ b/lib/libedit/makelist
@@ -36,7 +36,7 @@
# makelist.sh: Automatically generate header files...
AWK=awk
-USAGE="Usage: $0 -h|-fc|-fh|-bc|-bh <filenames>"
+USAGE="Usage: $0 -h|-fc|-fh|-bh <filenames>"
if [ "x$1" = "x" ]
then
@@ -76,14 +76,12 @@ case $FLAG in
}'
;;
-# generate help.c from various .c files
+# generate help.h from various .c files
#
--bc)
+-bh)
cat $FILES | $AWK '
BEGIN {
printf("/* Automatically generated file, do not edit */\n");
- printf("#include \"config.h\"\n#include \"el.h\"\n");
- printf("#include \"help.h\"\n");
printf("static const struct el_bindings_t el_func_help[] = {\n");
low = "abcdefghijklmnopqrstuvwxyz_";
high = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_";
@@ -119,23 +117,9 @@ case $FLAG in
}
END {
printf("};\n");
- printf("\nprotected const el_bindings_t* help__get()");
- printf("{ return el_func_help; }\n");
}'
;;
-# generate help.h from various .c files
-#
--bh)
- $AWK '
- BEGIN {
- printf("/* Automatically generated file, do not edit */\n");
- printf("#ifndef _h_help_c\n#define _h_help_c\n");
- printf("protected const el_bindings_t *help__get(void);\n");
- printf("#endif /* _h_help_c */\n");
- }' /dev/null
- ;;
-
# generate fcns.h from various .h files
#
-fh)
diff --git a/lib/libedit/map.c b/lib/libedit/map.c
index ebfa9dad55e..24687f46222 100644
--- a/lib/libedit/map.c
+++ b/lib/libedit/map.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: map.c,v 1.25 2016/04/18 20:13:07 schwarze Exp $ */
+/* $OpenBSD: map.c,v 1.26 2016/05/03 11:36:17 schwarze Exp $ */
/* $NetBSD: map.c,v 1.25 2009/12/30 22:37:40 christos Exp $ */
/*-
@@ -915,7 +915,7 @@ map_init(EditLine *el)
sizeof(el_bindings_t));
if (el->el_map.help == NULL)
return -1;
- (void) memcpy(el->el_map.help, help__get(),
+ (void) memcpy(el->el_map.help, el_func_help,
sizeof(el_bindings_t) * EL_NUM_FCNS);
el->el_map.func = reallocarray(NULL, EL_NUM_FCNS,
sizeof(el_func_t));