summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1997-09-23 07:12:47 +0000
committerJason Downs <downsj@cvs.openbsd.org>1997-09-23 07:12:47 +0000
commit105a204fd2ed1b7514e2bf44df67cdd55e998b30 (patch)
treeda85a758856c4b928172f618d562e4bf57b88f7d /usr.bin
parentec4ea0144d35ecdd92b9eec095340b0023f8c401 (diff)
Make building with ocurses/termcap and curses/termlib conditional on
USE_OCURSES being defined, and define it for now. This switches nvi back to use BSD curses.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/vi/build/Makefile6
-rw-r--r--usr.bin/vi/build/config.h18
-rw-r--r--usr.bin/vi/cl/cl_bsd.c4
-rw-r--r--usr.bin/vi/cl/cl_funcs.c4
-rw-r--r--usr.bin/vi/cl/cl_main.c6
-rw-r--r--usr.bin/vi/cl/cl_read.c6
-rw-r--r--usr.bin/vi/cl/cl_screen.c6
-rw-r--r--usr.bin/vi/cl/cl_term.c21
-rw-r--r--usr.bin/vi/include/cl_extern.h4
9 files changed, 66 insertions, 9 deletions
diff --git a/usr.bin/vi/build/Makefile b/usr.bin/vi/build/Makefile
index add72d8ebcd..677f8b77c7e 100644
--- a/usr.bin/vi/build/Makefile
+++ b/usr.bin/vi/build/Makefile
@@ -1,9 +1,9 @@
-# $OpenBSD: Makefile,v 1.8 1997/07/27 23:29:12 downsj Exp $
+# $OpenBSD: Makefile,v 1.9 1997/09/23 07:12:42 downsj Exp $
# @(#)Makefile.in 8.75 (Berkeley) 10/23/96
-CFLAGS+=-I${.CURDIR} -I${.CURDIR}/../include
+CFLAGS+=-I${.CURDIR} -I${.CURDIR}/../include -DUSE_OCURSES
-LDADD+= -lcurses -ltermlib
+LDADD+= -locurses -ltermcap
DPADD+= ${LIBCURSES} ${LIBTERMLIB}
PROG= vi
diff --git a/usr.bin/vi/build/config.h b/usr.bin/vi/build/config.h
index fd1cab38693..51fbe30c783 100644
--- a/usr.bin/vi/build/config.h
+++ b/usr.bin/vi/build/config.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.h,v 1.5 1997/07/27 22:27:54 downsj Exp $ */
+/* $OpenBSD: config.h,v 1.6 1997/09/23 07:12:42 downsj Exp $ */
/* config.h. Generated automatically by configure. */
/* config.h.in. Generated automatically from configure.in by autoheader. */
@@ -52,31 +52,45 @@
/* #undef HAVE_BROKEN_VDISABLE */
/* Define if you have a BSD version of curses. */
-/* #undef HAVE_BSD_CURSES */
+#ifdef USE_OCURSES
+#define HAVE_BSD_CURSES 1
+#endif
/* Define if you have the curses(3) addnstr function. */
#define HAVE_CURSES_ADDNSTR 1
/* Define if you have the curses(3) beep function. */
+#ifndef USE_OCURSES
#define HAVE_CURSES_BEEP 1
+#endif
/* Define if you have the curses(3) flash function. */
+#ifndef USE_OCURSES
#define HAVE_CURSES_FLASH 1
+#endif
/* Define if you have the curses(3) idlok function. */
#define HAVE_CURSES_IDLOK 1
/* Define if you have the curses(3) keypad function. */
+#ifndef USE_OCURSES
#define HAVE_CURSES_KEYPAD 1
+#endif
/* Define if you have the curses(3) newterm function. */
+#ifndef USE_OCURSES
#define HAVE_CURSES_NEWTERM 1
+#endif
/* Define if you have the curses(3) setupterm function. */
+#ifndef USE_OCURSES
#define HAVE_CURSES_SETUPTERM 1
+#endif
/* Define if you have the curses(3) tigetstr/tigetnum functions. */
+#ifndef USE_OCURSES
#define HAVE_CURSES_TIGETSTR 1
+#endif
/* Define if you have the chsize(2) system call. */
/* #undef HAVE_FTRUNCATE_CHSIZE */
diff --git a/usr.bin/vi/cl/cl_bsd.c b/usr.bin/vi/cl/cl_bsd.c
index 4a06a54af2f..b1d454556ee 100644
--- a/usr.bin/vi/cl/cl_bsd.c
+++ b/usr.bin/vi/cl/cl_bsd.c
@@ -17,7 +17,11 @@ static const char sccsid[] = "@(#)cl_bsd.c 8.29 (Berkeley) 7/1/96";
#include <bitstring.h>
#include <ctype.h>
+#ifdef USE_OCURSES
+#include <ocurses.h>
+#else
#include <curses.h>
+#endif
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/vi/cl/cl_funcs.c b/usr.bin/vi/cl/cl_funcs.c
index 40315ee85e8..1f27417a624 100644
--- a/usr.bin/vi/cl/cl_funcs.c
+++ b/usr.bin/vi/cl/cl_funcs.c
@@ -19,7 +19,11 @@ static const char sccsid[] = "@(#)cl_funcs.c 10.50 (Berkeley) 9/24/96";
#include <bitstring.h>
#include <ctype.h>
+#ifdef USE_OCURSES
+#include <ocurses.h>
+#else
#include <curses.h>
+#endif
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/vi/cl/cl_main.c b/usr.bin/vi/cl/cl_main.c
index 2889f709cbb..a5f0668b7c8 100644
--- a/usr.bin/vi/cl/cl_main.c
+++ b/usr.bin/vi/cl/cl_main.c
@@ -17,9 +17,13 @@ static const char sccsid[] = "@(#)cl_main.c 10.36 (Berkeley) 10/14/96";
#include <sys/queue.h>
#include <bitstring.h>
-#include <curses.h>
#include <errno.h>
#include <fcntl.h>
+#ifdef USE_OCURSES
+#include <ocurses.h>
+#else
+#include <curses.h>
+#endif
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/vi/cl/cl_read.c b/usr.bin/vi/cl/cl_read.c
index 8a95a77b243..cdae2a09951 100644
--- a/usr.bin/vi/cl/cl_read.c
+++ b/usr.bin/vi/cl/cl_read.c
@@ -21,9 +21,13 @@ static const char sccsid[] = "@(#)cl_read.c 10.15 (Berkeley) 9/24/96";
#include <sys/time.h>
#include <bitstring.h>
-#include <curses.h>
#include <errno.h>
#include <fcntl.h>
+#ifdef USE_OCURSES
+#include <ocurses.h>
+#else
+#include <curses.h>
+#endif
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/vi/cl/cl_screen.c b/usr.bin/vi/cl/cl_screen.c
index 2ce58e80cc7..4788be6d042 100644
--- a/usr.bin/vi/cl/cl_screen.c
+++ b/usr.bin/vi/cl/cl_screen.c
@@ -17,8 +17,12 @@ static const char sccsid[] = "@(#)cl_screen.c 10.49 (Berkeley) 9/24/96";
#include <sys/queue.h>
#include <bitstring.h>
-#include <curses.h>
#include <errno.h>
+#ifdef USE_OCURSES
+#include <ocurses.h>
+#else
+#include <curses.h>
+#endif
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/usr.bin/vi/cl/cl_term.c b/usr.bin/vi/cl/cl_term.c
index e4007403870..6edaffb0bf4 100644
--- a/usr.bin/vi/cl/cl_term.c
+++ b/usr.bin/vi/cl/cl_term.c
@@ -19,9 +19,13 @@ static const char sccsid[] = "@(#)cl_term.c 10.22 (Berkeley) 9/15/96";
#include <sys/stat.h>
#include <bitstring.h>
-#include <curses.h>
#include <errno.h>
#include <limits.h>
+#ifdef USE_OCURSES
+#include <ocurses.h>
+#else
+#include <curses.h>
+#endif
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
@@ -445,6 +449,20 @@ noterm: if (row == 0)
return (0);
}
+#ifdef USE_OCURSES
+/*
+ * cl_putchar --
+ * Function version of putchar, for tputs.
+ *
+ * PUBLIC: int cl_putchar __P((int));
+ */
+void
+cl_putchar(ch)
+ int ch;
+{
+ (void)putchar(ch);
+}
+#else
/*
* cl_putchar --
* Function version of putchar, for tputs.
@@ -457,3 +475,4 @@ cl_putchar(ch)
{
return (putchar(ch));
}
+#endif
diff --git a/usr.bin/vi/include/cl_extern.h b/usr.bin/vi/include/cl_extern.h
index bafeb944e96..1da69e6b3cd 100644
--- a/usr.bin/vi/include/cl_extern.h
+++ b/usr.bin/vi/include/cl_extern.h
@@ -53,4 +53,8 @@ int cl_fmap __P((SCR *, seq_t, CHAR_T *, size_t, CHAR_T *, size_t));
int cl_optchange __P((SCR *, int, char *, u_long *));
int cl_omesg __P((SCR *, CL_PRIVATE *, int));
int cl_ssize __P((SCR *, int, size_t *, size_t *, int *));
+#ifdef USE_OCURSES
+void cl_putchar __P((int));
+#else
int cl_putchar __P((int));
+#endif