diff options
author | 2016-05-03 11:19:30 +0000 | |
---|---|---|
committer | 2016-05-03 11:19:30 +0000 | |
commit | 933c3038f3ad18b6b624b7070a5b709435d859ab (patch) | |
tree | 0cc9e4b8367a715e7e8dbd2284bd8e00af65b2f4 | |
parent | correct some typos and remove a long-stale XXX note. (diff) | |
download | wireguard-openbsd-933c3038f3ad18b6b624b7070a5b709435d859ab.tar.xz wireguard-openbsd-933c3038f3ad18b6b624b7070a5b709435d859ab.zip |
The files editline.c, historyn.c, and tokenizern.c are completely
constant and very short and simple. Check them into CVS rather
than generating them at build time in a complicated way.
OK martijn@, also proofread by Christian Heckendorf <mbie at ulmus dot me>
-rw-r--r-- | lib/libedit/Makefile | 28 | ||||
-rw-r--r-- | lib/libedit/editline.c | 23 | ||||
-rw-r--r-- | lib/libedit/historyn.c | 3 | ||||
-rw-r--r-- | lib/libedit/makelist | 24 | ||||
-rw-r--r-- | lib/libedit/tokenizern.c | 3 |
5 files changed, 38 insertions, 43 deletions
diff --git a/lib/libedit/Makefile b/lib/libedit/Makefile index 30efbc26766..e2cbbee1607 100644 --- a/lib/libedit/Makefile +++ b/lib/libedit/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.21 2016/04/20 01:11:45 schwarze Exp $ +# $OpenBSD: Makefile,v 1.22 2016/05/03 11:19:30 schwarze Exp $ # $NetBSD: Makefile,v 1.41 2010/02/03 15:34:43 roy Exp $ # @(#)Makefile 8.1 (Berkeley) 6/4/93 @@ -11,21 +11,19 @@ OSRCS= chared.c common.c el.c eln.c emacs.c fcns.c filecomplete.c help.c \ MAN= editline.3 editrc.5 editline.7 # For speed and debugging -#SRCS= ${OSRCS} tokenizer.c history.c readline.c +#SRCS= ${OSRCS} # For protection -SRCS= editline.c tokenizer.c history.c readline.c +SRCS= editline.c -SRCS+= tokenizern.c historyn.c -CLEANFILES+=tokenizern.c.tmp tokenizern.c historyn.c.tmp historyn.c +SRCS += history.c historyn.c tokenizer.c tokenizern.c readline.c LIBEDITDIR?=${.CURDIR} INCS= histedit.h INCSDIR=/usr/include -CLEANFILES+=editline.c -CLEANFILES+=common.h.tmp editline.c.tmp emacs.h.tmp fcns.c.tmp fcns.h.tmp -CLEANFILES+=help.c.tmp help.h.tmp vi.h.tmp tc1.o tc1 +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 CFLAGS+=-Wall CPPFLAGS+=-I. -I${LIBEDITDIR} CPPFLAGS+=-I. -I${.CURDIR} @@ -40,6 +38,8 @@ CLEANFILES+= ${AHDR} fcns.h help.h fcns.c help.c #SUBDIR+= readline HOST_SH= sh +.depend: ${AHDR} fcns.h help.h fcns.c help.c + vi.h: vi.c makelist ${HOST_SH} ${LIBEDITDIR}/makelist -h ${LIBEDITDIR}/vi.c \ > ${.TARGET}.tmp && \ @@ -71,18 +71,6 @@ help.h: ${ASRC} makelist ${HOST_SH} ${LIBEDITDIR}/makelist -bh ${ASRC} > ${.TARGET}.tmp && \ mv ${.TARGET}.tmp ${.TARGET} -editline.c: ${OSRCS} makelist - ${HOST_SH} ${LIBEDITDIR}/makelist -e ${OSRCS:T} > ${.TARGET}.tmp && \ - mv ${.TARGET}.tmp ${.TARGET} - -tokenizern.c: makelist - ${HOST_SH} ${LIBEDITDIR}/makelist -n tokenizer.c > ${.TARGET}.tmp && \ - mv ${.TARGET}.tmp ${.TARGET} - -historyn.c: makelist - ${HOST_SH} ${LIBEDITDIR}/makelist -n history.c > ${.TARGET}.tmp && \ - mv ${.TARGET}.tmp ${.TARGET} - tc1.o: ${LIBEDITDIR}/TEST/tc1.c tc1: libedit.a tc1.o diff --git a/lib/libedit/editline.c b/lib/libedit/editline.c new file mode 100644 index 00000000000..bc377d51c02 --- /dev/null +++ b/lib/libedit/editline.c @@ -0,0 +1,23 @@ +#define protected static +#define SCCSID +#include "chared.c" +#include "common.c" +#include "el.c" +#include "eln.c" +#include "emacs.c" +#include "fcns.c" +#include "filecomplete.c" +#include "help.c" +#include "hist.c" +#include "keymacro.c" +#include "map.c" +#include "chartype.c" +#include "parse.c" +#include "prompt.c" +#include "read.c" +#include "refresh.c" +#include "search.c" +#include "sig.c" +#include "terminal.c" +#include "tty.c" +#include "vi.c" diff --git a/lib/libedit/historyn.c b/lib/libedit/historyn.c new file mode 100644 index 00000000000..59130dea345 --- /dev/null +++ b/lib/libedit/historyn.c @@ -0,0 +1,3 @@ +#include "config.h" +#define NARROWCHAR +#include "history.c" diff --git a/lib/libedit/makelist b/lib/libedit/makelist index 3ee7ec1f5cd..18794df6460 100644 --- a/lib/libedit/makelist +++ b/lib/libedit/makelist @@ -36,7 +36,7 @@ # makelist.sh: Automatically generate header files... AWK=awk -USAGE="Usage: $0 -n|-h|-e|-fc|-fh|-bc|-bh <filenames>" +USAGE="Usage: $0 -h|-fc|-fh|-bc|-bh <filenames>" if [ "x$1" = "x" ] then @@ -51,15 +51,6 @@ FILES="$@" case $FLAG in -# generate foo.h file from foo.c -# --n) - cat << _EOF -#define NARROWCHAR -#include "${FILES}" -_EOF - ;; - -h) set - `echo $FILES | sed -e 's/\\./_/g'` hdr="_h_`basename $1`" @@ -201,19 +192,6 @@ _EOF }' ;; -# generate editline.c from various .c files -# --e) - echo "$FILES" | tr ' ' '\012' | $AWK ' - BEGIN { - printf("/* Automatically generated file, do not edit */\n"); - printf("#define protected static\n"); - } - { - printf("#include \"%s\"\n", $1); - }' - ;; - *) echo $USAGE 1>&2 exit 1 diff --git a/lib/libedit/tokenizern.c b/lib/libedit/tokenizern.c new file mode 100644 index 00000000000..5846b60643c --- /dev/null +++ b/lib/libedit/tokenizern.c @@ -0,0 +1,3 @@ +#include "config.h" +#define NARROWCHAR +#include "tokenizer.c" |