Update to use nvi-1.79 sources

This commit is contained in:
Peter Wemm 1996-11-01 08:16:24 +00:00
parent 92a76e5c36
commit 4f85133da7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=19310
4 changed files with 558 additions and 2 deletions

View File

@ -1,3 +1,135 @@
SUBDIR= common
#
# $Id$
#
# This has most of the glue needed to compile tknvi and the perl hooks,
# but not all.
#
.include <bsd.subdir.mk>
SRCDIR= ${.CURDIR}/../../contrib/nvi
TCLINTERP= yes #fine, in base tree, little cost
#TKNVI= tknvi #not ready, needs X11, tk
#PERLINTERP= no #not ready, needs perl5.002+
#if using ncurses:
CFLAGS+= -DSYSV_CURSES
VI= nvi
EX= nex
VIEW= nview
PROG= nvi
LINKS= ${BINDIR}/${VI} ${BINDIR}/${EX} ${BINDIR}/${VI} ${BINDIR}/${VIEW}
LINKS+= ${BINDIR}/${VI} ${BINDIR}/vi ${BINDIR}/${EX} ${BINDIR}/ex
LINKS+= ${BINDIR}/${VI} ${BINDIR}/view
MAN1= ${SRCDIR}/docs/USD.doc/vi.man/vi.1
MLINKS+=vi.1 ex.1 vi.1 view.1
MLINKS+=vi.1 nex.1 vi.1 nview.1 vi.1 nvi.1
CATALOGS= dutch english french german ru_SU.KOI8-R spanish swedish
.PATH: ${SRCDIR}/common
.PATH: ${SRCDIR}/ex
.PATH: ${SRCDIR}/cl
.PATH: ${SRCDIR}/vi
CFLAGS+=-I${.CURDIR} -I${SRCDIR} -I${SRCDIR}/include
DPADD+= ${LIBCURSES} ${LIBTERMCAP}
LDADD+= -lcurses -ltermcap
.if defined(TKNVI)
.PATH: ${SRCDIR}/tk
#DPADD+= ?
#LDADD+= -ltk
.endif
.if defined(TCLINTERP)
.PATH: ${SRCDIR}/tcl_api
DPADD+= ${LIBTCL} ${LIBM}
LDADD+= -ltcl -lm
.endif
.if defined(PERLINTERP)
.PATH: ${SRCDIR}/perl_api
#DPADD+= ?
#LDADD+= ?
.endif
CLEANFILES+=${EX}
# Vi curses sources
SRCS+= cl_bsd.c cl_funcs.c cl_main.c cl_read.c cl_screen.c cl_term.c
# Vi Tk sources
.if defined(TKNVI)
SRCS+= tk_funcs.c tk_main.c tk_read.c tk_screen.c tk_term.c tk_util.c
.endif
# Vi Tcl/Perl interpreter sources
.if defined(TCLINTERP) || defined(PERLINTERP)
SRCS+= api.c
.endif
.if defined(TCLINTERP)
SRCS+= tcl.c
.endif
.if defined(PERLINTERP)
# perl.c is generated
SRCS+= perl.c perlsfio.c
.endif
# General sources.
SRCS+= cut.c delete.c exf.c key.c line.c log.c main.c mark.c msg.c options.c \
options_f.c put.c screen.c search.c seq.c recover.c util.c
# Ex source.
SRCS+= ex.c ex_abbrev.c ex_append.c ex_args.c ex_argv.c ex_at.c ex_bang.c \
ex_cd.c ex_cmd.c ex_cscope.c ex_delete.c ex_display.c \
ex_edit.c ex_equal.c ex_file.c ex_filter.c ex_global.c \
ex_init.c ex_join.c ex_map.c ex_mark.c ex_mkexrc.c ex_move.c \
ex_open.c ex_perl.c ex_preserve.c ex_print.c ex_put.c ex_quit.c \
ex_read.c ex_screen.c ex_script.c ex_set.c ex_shell.c \
ex_shift.c ex_source.c ex_stop.c ex_subst.c ex_tag.c ex_tcl.c \
ex_txt.c ex_undo.c ex_usage.c ex_util.c ex_version.c ex_visual.c \
ex_write.c ex_yank.c ex_z.c
# Vi source.
SRCS+= getc.c v_at.c v_ch.c v_cmd.c v_delete.c v_ex.c v_increment.c v_init.c \
v_itxt.c v_left.c v_mark.c v_match.c v_paragraph.c v_put.c v_redraw.c \
v_replace.c v_right.c v_screen.c v_scroll.c v_search.c v_section.c \
v_sentence.c v_status.c v_txt.c v_ulcase.c v_undo.c \
v_util.c v_word.c v_xchar.c v_yank.c v_z.c v_zexit.c vi.c
# Vi screen source.
SRCS+= vs_line.c vs_msg.c vs_refresh.c vs_relative.c vs_smap.c vs_split.c
# Generate perl.c
.if defined(PERLINTERP)
perl.c: perl.xs typemap
echo "#define _PATH_PERLSCRIPTS \"/usr/share/vi/perl\"" > $@
$(PERL) $(PERLLIB)/ExtUtils/xsubpp -typemap \
$(PERLLIB)/ExtUtils/typemap $(SRCDIR)/perl_api/perl.xs >> $@
($(PERL) -ne 'print "sub $$1 {\$$curscr->$$1(\@_)}\n" \
if /newXS\("VI::([^":]*)"/;' $@ ; echo "1;") > VI.pm
CLEANFILES+= VI.pm perl.c
.endif
afterinstall:
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
${CATALOGS:S;^;${SRCDIR}/catalog/;} \
${DESTDIR}/usr/share/vi/catalog
.if defined(PERLINTERP)
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
${SRCDIR}/perl_scripts/*.pl VI.pm \
${DESTDIR}/usr/share/vi/perl
.endif
.if defined(TCLINTERP)
${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
${SRCDIR}/tcl_scripts/*.tcl \
${DESTDIR}/usr/share/vi/tcl
.endif
.include <bsd.prog.mk>

194
usr.bin/vi/config.h Normal file
View File

@ -0,0 +1,194 @@
/* config.h. Generated automatically by configure. */
/* config.h.in. Generated automatically from configure.in by autoheader. */
/* Define to empty if the keyword does not work. */
/* #undef const */
/* Define if you have a working `mmap' system call. */
#define HAVE_MMAP 1
/* Define if your struct stat has st_blksize. */
#define HAVE_ST_BLKSIZE 1
/* Define if you have <vfork.h>. */
/* #undef HAVE_VFORK_H */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef mode_t */
/* Define to `long' if <sys/types.h> doesn't define. */
/* #undef off_t */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef pid_t */
/* Define to `unsigned' if <sys/types.h> doesn't define. */
/* #undef size_t */
/* Define if you have the ANSI C header files. */
#define STDC_HEADERS 1
/* Define if your <sys/time.h> declares struct tm. */
/* #undef TM_IN_SYS_TIME */
/* Define vfork as fork if vfork does not work. */
/* #undef vfork */
/* Define if your processor stores words with the most significant
byte first (like Motorola and SPARC, unlike Intel and VAX). */
/* #undef WORDS_BIGENDIAN */
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef ssize_t */
/* Define if you want a debugging version. */
/* #undef DEBUG */
/* Define if you have a System V-style (broken) gettimeofday. */
/* #undef HAVE_BROKEN_GETTIMEOFDAY */
/* Define if you have a Ultrix-style (broken) vdisable. */
/* #undef HAVE_BROKEN_VDISABLE */
/* Define if you have a BSD version of curses. */
#ifndef SYSV_CURSES
#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. */
#ifdef SYSV_CURSES
#define HAVE_CURSES_BEEP 1
#endif
/* Define if you have the curses(3) flash function. */
#ifdef SYSV_CURSES
#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. */
#ifdef SYSV_CURSES
#define HAVE_CURSES_KEYPAD 1
#endif
/* Define if you have the curses(3) newterm function. */
#ifdef SYSV_CURSES
#define HAVE_CURSES_NEWTERM 1
#endif
/* Define if you have the curses(3) setupterm function. */
#ifdef SYSV_CURSES
#define HAVE_CURSES_SETUPTERM 1
#endif
/* Define if you have the curses(3) tigetstr/tigetnum functions. */
#ifdef SYSV_CURSES
#define HAVE_CURSES_TIGETSTR 1
#endif
/* Define if you have the chsize(2) system call. */
/* #undef HAVE_FTRUNCATE_CHSIZE */
/* Define if you have the ftruncate(2) system call. */
#define HAVE_FTRUNCATE_FTRUNCATE 1
/* Define if you have fcntl(2) style locking. */
/* #undef HAVE_LOCK_FCNTL */
/* Define if you have flock(2) style locking. */
#define HAVE_LOCK_FLOCK 1
/* Define if you want to compile in the Perl interpreter. */
/* #undef HAVE_PERL_INTERP */
/* Define if your Perl is at least 5.003_01. */
/* #undef HAVE_PERL_5_003_01 */
/* Define if you have the Berkeley style revoke(2) system call. */
#define HAVE_REVOKE 1
/* Define if you have <sys/mman.h> */
#define HAVE_SYS_MMAN_H 1
/* Define if you have <sys/select.h> */
#define HAVE_SYS_SELECT_H 1
/* Define if you have the System V style pty calls. */
/* #undef HAVE_SYS5_PTY */
/* Define if you want to compile in the Tcl interpreter. */
#define HAVE_TCL_INTERP 1
/* Define if your sprintf returns a pointer, not a length. */
/* #undef SPRINTF_RET_CHARPNT */
/* Define if you have the bsearch function. */
#define HAVE_BSEARCH 1
/* Define if you have the gethostname function. */
#define HAVE_GETHOSTNAME 1
/* Define if you have the getopt function. */
#define HAVE_GETOPT 1
/* Define if you have the getpagesize function. */
#define HAVE_GETPAGESIZE 1
/* Define if you have the memchr function. */
#define HAVE_MEMCHR 1
/* Define if you have the memcpy function. */
#define HAVE_MEMCPY 1
/* Define if you have the memmove function. */
#define HAVE_MEMMOVE 1
/* Define if you have the memset function. */
#define HAVE_MEMSET 1
/* Define if you have the mkstemp function. */
#define HAVE_MKSTEMP 1
/* Define if you have the mmap function. */
#define HAVE_MMAP 1
/* Define if you have the select function. */
#define HAVE_SELECT 1
/* Define if you have the setenv function. */
#define HAVE_SETENV 1
/* Define if you have the snprintf function. */
#define HAVE_SNPRINTF 1
/* Define if you have the strdup function. */
#define HAVE_STRDUP 1
/* Define if you have the strerror function. */
#define HAVE_STRERROR 1
/* Define if you have the strpbrk function. */
#define HAVE_STRPBRK 1
/* Define if you have the strsep function. */
#define HAVE_STRSEP 1
/* Define if you have the strtol function. */
#define HAVE_STRTOL 1
/* Define if you have the strtoul function. */
#define HAVE_STRTOUL 1
/* Define if you have the unsetenv function. */
#define HAVE_UNSETENV 1
/* Define if you have the valloc function. */
#define HAVE_VALLOC 1
/* Define if you have the vsnprintf function. */
#define HAVE_VSNPRINTF 1

45
usr.bin/vi/pathnames.h Normal file
View File

@ -0,0 +1,45 @@
/* @(#)pathnames.h.in 8.4 (Berkeley) 6/26/96 */
#ifndef _PATH_BSHELL
#define _PATH_BSHELL "/bin/sh"
#endif
#ifndef _PATH_EXRC
#define _PATH_EXRC ".exrc"
#endif
#ifndef _PATH_MSGCAT
#define _PATH_MSGCAT "./"
#endif
#ifndef _PATH_NEXRC
#define _PATH_NEXRC ".nexrc"
#endif
#ifndef _PATH_PRESERVE
#define _PATH_PRESERVE "/var/tmp/vi.recover"
#endif
#ifndef _PATH_SYSV_PTY
#define _PATH_SYSV_PTY "/dev/ptmx"
#endif
#ifndef _PATH_SENDMAIL
#define _PATH_SENDMAIL "/usr/sbin/sendmail"
#endif
#ifndef _PATH_SYSEXRC
#define _PATH_SYSEXRC "/etc/vi.exrc"
#endif
#ifndef _PATH_TAGS
#define _PATH_TAGS "tags"
#endif
#ifndef _PATH_TMP
#define _PATH_TMP "/tmp"
#endif
#ifndef _PATH_TTY
#define _PATH_TTY "/dev/tty"
#endif

185
usr.bin/vi/port.h Normal file
View File

@ -0,0 +1,185 @@
/* @(#)port.h.in 8.13 (Berkeley) 6/12/96 */
/*
* Declare the basic types, if they aren't already declared. Named and
* some system's db.h files protect them with __BIT_TYPES_DEFINED__.
*/
#ifndef __BIT_TYPES_DEFINED__
#define __BIT_TYPES_DEFINED__
#endif
/*
* XXX
* Handle function prototypes. This steps on name space that vi doesn't
* control, but all of the other solutions are worse.
*/
#undef __P
#if defined(__STDC__) || defined(__cplusplus)
#define __P(protos) protos /* ANSI C prototypes */
#else
#define __P(protos) () /* K&R C preprocessor */
#endif
/*
* XXX
* Some versions of System V changed the number of arguments to gettimeofday
* without changing the name.
*/
#ifdef HAVE_BROKEN_GETTIMEOFDAY
#define gettimeofday(tv, tz) gettimeofday(tv)
#endif
/*
* XXX
* If we don't have mmap, we fake it with read and write, but we'll
* still need the header information.
*/
#ifndef HAVE_SYS_MMAN_H
#define MAP_SHARED 1 /* share changes */
#define MAP_PRIVATE 2 /* changes are private */
#define PROT_READ 0x1 /* pages can be read */
#define PROT_WRITE 0x2 /* pages can be written */
#define PROT_EXEC 0x4 /* pages can be executed */
#endif
/*
* XXX
* POSIX 1003.1 names for file descriptors.
*/
#ifndef STDERR_FILENO
#define STDIN_FILENO 0 /* ANSI C #defines */
#define STDOUT_FILENO 1
#define STDERR_FILENO 2
#endif
/*
* XXX
* POSIX 1003.1 names for seek settings.
*/
#ifndef SEEK_END
#define SEEK_SET 0 /* POSIX 1003.1 seek values */
#define SEEK_CUR 1
#define SEEK_END 2
#endif
/*
* Hack _POSIX_VDISABLE to \377 since Ultrix doesn't honor _POSIX_VDISABLE
* (treats it as ^@). The symptom is that the ^@ keystroke immediately
* drops core.
*/
#ifdef HAVE_BROKEN_VDISABLE
#undef _POSIX_VDISABLE
#define _POSIX_VDISABLE ((unsigned char)'\377')
#endif
/*
* XXX
* POSIX 1003.1 tty disabling character.
*/
#ifndef _POSIX_VDISABLE
#define _POSIX_VDISABLE 0 /* Some systems used 0. */
#endif
/*
* XXX
* 4.4BSD extension to only set the software termios bits.
*/
#ifndef TCSASOFT /* 4.4BSD extension. */
#define TCSASOFT 0
#endif
/*
* XXX
* POSIX 1003.1 maximum path length.
*/
#ifndef MAXPATHLEN
#ifdef PATH_MAX
#define MAXPATHLEN PATH_MAX
#else
#define MAXPATHLEN 1024
#endif
#endif
/*
* XXX
* MIN, MAX, historically in <sys/param.h>
*/
#ifndef MAX
#define MAX(_a,_b) ((_a)<(_b)?(_b):(_a))
#endif
#ifndef MIN
#define MIN(_a,_b) ((_a)<(_b)?(_a):(_b))
#endif
/*
* XXX
* "DB" isn't always portable, and we want the private information.
*/
#define DB L__DB
#undef pgno_t /* IRIX has its own version. */
#define pgno_t L__db_pgno_t
/*
* XXX
* 4.4BSD extension to provide lock values in the open(2) call.
*/
#ifndef O_EXLOCK
#define O_EXLOCK 0
#endif
#ifndef O_SHLOCK
#define O_SHLOCK 0
#endif
/*
* XXX
* POSIX 1003.1 bad file format errno.
*/
#ifndef EFTYPE
#define EFTYPE EINVAL
#endif
/*
* XXX
* POSIX 1003.2 RE length limit.
*/
#ifndef _POSIX2_RE_DUP_MAX
#define _POSIX2_RE_DUP_MAX 255
#endif
/*
* XXX
* 4.4BSD extension to determine if a program dropped core from the exit
* status.
*/
#ifndef WCOREDUMP
#define WCOREDUMP(a) 0
#endif
/*
* XXX
* Endian-ness of the machine.
*/
#if !defined(LITTLE_ENDIAN)
#define LITTLE_ENDIAN 1234
#endif
#if !defined(BIG_ENDIAN)
#define BIG_ENDIAN 4321
#endif
#if !defined(BYTE_ORDER)
#if WORDS_BIGENDIAN == 1
#define BYTE_ORDER BIG_ENDIAN
#else
#define BYTE_ORDER LITTLE_ENDIAN
#endif
#endif