summaryrefslogtreecommitdiffstats
path: root/contrib/nvi/include
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/nvi/include')
-rw-r--r--contrib/nvi/include/bitstring.h143
-rw-r--r--contrib/nvi/include/cl_extern.h56
-rw-r--r--contrib/nvi/include/com_extern.h199
-rw-r--r--contrib/nvi/include/ex_def.h78
-rw-r--r--contrib/nvi/include/ex_extern.h127
-rw-r--r--contrib/nvi/include/ip_extern.h23
-rw-r--r--contrib/nvi/include/options_def.h79
-rw-r--r--contrib/nvi/include/perl_extern.h8
-rw-r--r--contrib/nvi/include/sys/queue.h259
-rw-r--r--contrib/nvi/include/tcl_extern.h1
-rw-r--r--contrib/nvi/include/tk_extern.h29
-rw-r--r--contrib/nvi/include/vi_extern.h142
12 files changed, 1144 insertions, 0 deletions
diff --git a/contrib/nvi/include/bitstring.h b/contrib/nvi/include/bitstring.h
new file mode 100644
index 0000000..88437e7
--- /dev/null
+++ b/contrib/nvi/include/bitstring.h
@@ -0,0 +1,143 @@
+/*
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * Paul Vixie.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)bitstring.h 8.1 (Berkeley) 7/19/93
+ */
+
+#ifndef _BITSTRING_H_
+#define _BITSTRING_H_
+
+typedef unsigned char bitstr_t;
+
+/* internal macros */
+ /* byte of the bitstring bit is in */
+#define _bit_byte(bit) \
+ ((bit) >> 3)
+
+ /* mask for the bit within its byte */
+#define _bit_mask(bit) \
+ (1 << ((bit)&0x7))
+
+/* external macros */
+ /* bytes in a bitstring of nbits bits */
+#define bitstr_size(nbits) \
+ ((((nbits) - 1) >> 3) + 1)
+
+ /* allocate a bitstring */
+#define bit_alloc(nbits) \
+ (bitstr_t *)calloc(1, \
+ (unsigned int)bitstr_size(nbits) * sizeof(bitstr_t))
+
+ /* allocate a bitstring on the stack */
+#define bit_decl(name, nbits) \
+ (name)[bitstr_size(nbits)]
+
+ /* is bit N of bitstring name set? */
+#define bit_test(name, bit) \
+ ((name)[_bit_byte(bit)] & _bit_mask(bit))
+
+ /* set bit N of bitstring name */
+#define bit_set(name, bit) \
+ (name)[_bit_byte(bit)] |= _bit_mask(bit)
+
+ /* clear bit N of bitstring name */
+#define bit_clear(name, bit) \
+ (name)[_bit_byte(bit)] &= ~_bit_mask(bit)
+
+ /* clear bits start ... stop in bitstring */
+#define bit_nclear(name, start, stop) { \
+ register bitstr_t *_name = name; \
+ register int _start = start, _stop = stop; \
+ register int _startbyte = _bit_byte(_start); \
+ register int _stopbyte = _bit_byte(_stop); \
+ if (_startbyte == _stopbyte) { \
+ _name[_startbyte] &= ((0xff >> (8 - (_start&0x7))) | \
+ (0xff << ((_stop&0x7) + 1))); \
+ } else { \
+ _name[_startbyte] &= 0xff >> (8 - (_start&0x7)); \
+ while (++_startbyte < _stopbyte) \
+ _name[_startbyte] = 0; \
+ _name[_stopbyte] &= 0xff << ((_stop&0x7) + 1); \
+ } \
+}
+
+ /* set bits start ... stop in bitstring */
+#define bit_nset(name, start, stop) { \
+ register bitstr_t *_name = name; \
+ register int _start = start, _stop = stop; \
+ register int _startbyte = _bit_byte(_start); \
+ register int _stopbyte = _bit_byte(_stop); \
+ if (_startbyte == _stopbyte) { \
+ _name[_startbyte] |= ((0xff << (_start&0x7)) & \
+ (0xff >> (7 - (_stop&0x7)))); \
+ } else { \
+ _name[_startbyte] |= 0xff << ((_start)&0x7); \
+ while (++_startbyte < _stopbyte) \
+ _name[_startbyte] = 0xff; \
+ _name[_stopbyte] |= 0xff >> (7 - (_stop&0x7)); \
+ } \
+}
+
+ /* find first bit clear in name */
+#define bit_ffc(name, nbits, value) { \
+ register bitstr_t *_name = name; \
+ register int _byte, _nbits = nbits; \
+ register int _stopbyte = _bit_byte(_nbits), _value = -1; \
+ for (_byte = 0; _byte <= _stopbyte; ++_byte) \
+ if (_name[_byte] != 0xff) { \
+ _value = _byte << 3; \
+ for (_stopbyte = _name[_byte]; (_stopbyte&0x1); \
+ ++_value, _stopbyte >>= 1); \
+ break; \
+ } \
+ *(value) = _value; \
+}
+
+ /* find first bit set in name */
+#define bit_ffs(name, nbits, value) { \
+ register bitstr_t *_name = name; \
+ register int _byte, _nbits = nbits; \
+ register int _stopbyte = _bit_byte(_nbits), _value = -1; \
+ for (_byte = 0; _byte <= _stopbyte; ++_byte) \
+ if (_name[_byte]) { \
+ _value = _byte << 3; \
+ for (_stopbyte = _name[_byte]; !(_stopbyte&0x1); \
+ ++_value, _stopbyte >>= 1); \
+ break; \
+ } \
+ *(value) = _value; \
+}
+
+#endif /* !_BITSTRING_H_ */
diff --git a/contrib/nvi/include/cl_extern.h b/contrib/nvi/include/cl_extern.h
new file mode 100644
index 0000000..bafeb94
--- /dev/null
+++ b/contrib/nvi/include/cl_extern.h
@@ -0,0 +1,56 @@
+#ifndef HAVE_CURSES_ADDNSTR
+int addnstr __P((char *, int));
+#endif
+#ifndef HAVE_CURSES_BEEP
+void beep __P((void));
+#endif
+#ifndef HAVE_CURSES_FLASH
+void flash __P((void));
+#endif
+#ifndef HAVE_CURSES_IDLOK
+void idlok __P((WINDOW *, int));
+#endif
+#ifndef HAVE_CURSES_KEYPAD
+int keypad __P((void *, int));
+#endif
+#ifndef HAVE_CURSES_NEWTERM
+void *newterm __P((const char *, FILE *, FILE *));
+#endif
+#ifndef HAVE_CURSES_SETUPTERM
+void setupterm __P((char *, int, int *));
+#endif
+#ifdef HAVE_CURSES_TIGETSTR
+char *tigetstr();
+#else
+char *tigetstr __P((char *));
+#endif
+#ifndef HAVE_CURSES_TIGETSTR
+int tigetnum __P((char *));
+#endif
+int cl_addstr __P((SCR *, const char *, size_t));
+int cl_attr __P((SCR *, scr_attr_t, int));
+int cl_baud __P((SCR *, u_long *));
+int cl_bell __P((SCR *));
+int cl_clrtoeol __P((SCR *));
+int cl_cursor __P((SCR *, size_t *, size_t *));
+int cl_deleteln __P((SCR *));
+int cl_ex_adjust __P((SCR *, exadj_t));
+int cl_insertln __P((SCR *));
+int cl_keyval __P((SCR *, scr_keyval_t, CHAR_T *, int *));
+int cl_move __P((SCR *, size_t, size_t));
+int cl_refresh __P((SCR *, int));
+int cl_rename __P((SCR *, char *, int));
+int cl_suspend __P((SCR *, int *));
+void cl_usage __P((void));
+int sig_init __P((GS *, SCR *));
+int cl_event __P((SCR *, EVENT *, u_int32_t, int));
+int cl_screen __P((SCR *, u_int32_t));
+int cl_quit __P((GS *));
+int cl_getcap __P((SCR *, char *, char **));
+int cl_term_init __P((SCR *));
+int cl_term_end __P((GS *));
+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 *));
+int cl_putchar __P((int));
diff --git a/contrib/nvi/include/com_extern.h b/contrib/nvi/include/com_extern.h
new file mode 100644
index 0000000..f140f9e
--- /dev/null
+++ b/contrib/nvi/include/com_extern.h
@@ -0,0 +1,199 @@
+#ifndef HAVE_BSEARCH
+void *bsearch __P((const void *, const void *, size_t,
+ size_t, int (*)(const void *, const void *)));
+#endif
+#ifndef HAVE_SETENV
+int setenv __P((const char *, const char *, int));
+#endif
+#ifndef HAVE_UNSETENV
+void unsetenv __P((const char *));
+#endif
+#ifndef HAVE_GETHOSTNAME
+int gethostname __P((char *, int));
+#endif
+#ifndef HAVE_GETOPT
+int getopt __P((int, char * const *, const char *));
+#endif
+#ifndef HAVE_MEMCHR
+void *memchr __P((const void *, int, size_t));
+#endif
+#ifndef HAVE_MEMCPY
+void *memcpy __P((void *, const void *, size_t));
+#endif
+#ifndef HAVE_MEMMOVE
+void *memmove __P((void *, const void *, size_t));
+#endif
+#ifndef HAVE_MEMSET
+void *memset __P((void *, int, size_t));
+#endif
+#ifndef HAVE_MKSTEMP
+int mkstemp __P((char *));
+#endif
+#ifndef HAVE_MMAP
+char *mmap __P((char *, size_t, int, int, int, off_t));
+#endif
+#ifndef HAVE_MMAP
+int munmap __P((char *, size_t));
+#endif
+#ifndef HAVE_SNPRINTF
+int snprintf __P((char *, size_t, const char *, ...));
+#endif
+#ifndef HAVE_STRDUP
+char *strdup __P((const char *));
+#endif
+#ifndef HAVE_STRERROR
+char *strerror __P((int));
+#endif
+#ifndef HAVE_STRPBRK
+char *strpbrk __P((const char *, const char *));
+#endif
+#ifndef HAVE_STRSEP
+char *strsep __P((char **, const char *));
+#endif
+#ifndef HAVE_STRTOL
+long strtol __P((const char *, char **, int));
+#endif
+#ifndef HAVE_STRTOUL
+unsigned long strtoul __P((const char *, char **, int));
+#endif
+#ifndef HAVE_VSNPRINTF
+int vsnprintf __P((char *, size_t, const char *, ...));
+#endif
+SCR *api_fscreen __P((int, char *));
+int api_aline __P((SCR *, recno_t, char *, size_t));
+int api_dline __P((SCR *, recno_t));
+int api_gline __P((SCR *, recno_t, char **, size_t *));
+int api_iline __P((SCR *, recno_t, char *, size_t));
+int api_lline __P((SCR *, recno_t *));
+int api_sline __P((SCR *, recno_t, char *, size_t));
+int api_getmark __P((SCR *, int, MARK *));
+int api_setmark __P((SCR *, int, MARK *));
+int api_nextmark __P((SCR *, int, char *));
+int api_getcursor __P((SCR *, MARK *));
+int api_setcursor __P((SCR *, MARK *));
+void api_emessage __P((SCR *, char *));
+void api_imessage __P((SCR *, char *));
+int api_edit __P((SCR *, char *, SCR **, int));
+int api_escreen __P((SCR *));
+int api_swscreen __P((SCR *, SCR *));
+int api_map __P((SCR *, char *, char *, size_t));
+int api_unmap __P((SCR *, char *));
+int api_opts_get __P((SCR *, char *, char **, int *));
+int api_opts_set __P((SCR *, char *, char *, u_long, int));
+int api_run_str __P((SCR *, char *));
+int cut __P((SCR *, CHAR_T *, MARK *, MARK *, int));
+int cut_line __P((SCR *, recno_t, size_t, size_t, CB *));
+void cut_close __P((GS *));
+TEXT *text_init __P((SCR *, const char *, size_t, size_t));
+void text_lfree __P((TEXTH *));
+void text_free __P((TEXT *));
+int del __P((SCR *, MARK *, MARK *, int));
+FREF *file_add __P((SCR *, CHAR_T *));
+int file_init __P((SCR *, FREF *, char *, int));
+int file_end __P((SCR *, EXF *, int));
+int file_write __P((SCR *, MARK *, MARK *, char *, int));
+int file_m1 __P((SCR *, int, int));
+int file_m2 __P((SCR *, int));
+int file_m3 __P((SCR *, int));
+int file_aw __P((SCR *, int));
+void set_alt_name __P((SCR *, char *));
+lockr_t file_lock __P((SCR *, char *, int *, int, int));
+int v_key_init __P((SCR *));
+void v_key_ilookup __P((SCR *));
+size_t v_key_len __P((SCR *, ARG_CHAR_T));
+CHAR_T *v_key_name __P((SCR *, ARG_CHAR_T));
+int v_key_val __P((SCR *, ARG_CHAR_T));
+int v_event_push __P((SCR *, EVENT *, CHAR_T *, size_t, u_int));
+int v_event_get __P((SCR *, EVENT *, int, u_int32_t));
+void v_event_err __P((SCR *, EVENT *));
+int v_event_flush __P((SCR *, u_int));
+int db_eget __P((SCR *, recno_t, char **, size_t *, int *));
+int db_get __P((SCR *, recno_t, u_int32_t, char **, size_t *));
+int db_delete __P((SCR *, recno_t));
+int db_append __P((SCR *, int, recno_t, char *, size_t));
+int db_insert __P((SCR *, recno_t, char *, size_t));
+int db_set __P((SCR *, recno_t, char *, size_t));
+int db_exist __P((SCR *, recno_t));
+int db_last __P((SCR *, recno_t *));
+void db_err __P((SCR *, recno_t));
+int log_init __P((SCR *, EXF *));
+int log_end __P((SCR *, EXF *));
+int log_cursor __P((SCR *));
+int log_line __P((SCR *, recno_t, u_int));
+int log_mark __P((SCR *, LMARK *));
+int log_backward __P((SCR *, MARK *));
+int log_setline __P((SCR *));
+int log_forward __P((SCR *, MARK *));
+int editor __P((GS *, int, char *[]));
+void v_end __P((GS *));
+int mark_init __P((SCR *, EXF *));
+int mark_end __P((SCR *, EXF *));
+int mark_get __P((SCR *, ARG_CHAR_T, MARK *, mtype_t));
+int mark_set __P((SCR *, ARG_CHAR_T, MARK *, int));
+int mark_insdel __P((SCR *, lnop_t, recno_t));
+void msgq __P((SCR *, mtype_t, const char *, ...));
+void msgq_str __P((SCR *, mtype_t, char *, char *));
+void mod_rpt __P((SCR *));
+void msgq_status __P((SCR *, recno_t, u_int));
+int msg_open __P((SCR *, char *));
+void msg_close __P((GS *));
+const char *msg_cmsg __P((SCR *, cmsg_t, size_t *));
+const char *msg_cat __P((SCR *, const char *, size_t *));
+char *msg_print __P((SCR *, const char *, int *));
+int opts_init __P((SCR *, int *));
+int opts_set __P((SCR *, ARGS *[], char *));
+int o_set __P((SCR *, int, u_int, char *, u_long));
+int opts_empty __P((SCR *, int, int));
+void opts_dump __P((SCR *, enum optdisp));
+int opts_save __P((SCR *, FILE *));
+OPTLIST const *opts_search __P((char *));
+void opts_nomatch __P((SCR *, char *));
+int opts_copy __P((SCR *, SCR *));
+void opts_free __P((SCR *));
+int f_altwerase __P((SCR *, OPTION *, char *, u_long *));
+int f_columns __P((SCR *, OPTION *, char *, u_long *));
+int f_lines __P((SCR *, OPTION *, char *, u_long *));
+int f_lisp __P((SCR *, OPTION *, char *, u_long *));
+int f_msgcat __P((SCR *, OPTION *, char *, u_long *));
+int f_paragraph __P((SCR *, OPTION *, char *, u_long *));
+int f_print __P((SCR *, OPTION *, char *, u_long *));
+int f_readonly __P((SCR *, OPTION *, char *, u_long *));
+int f_recompile __P((SCR *, OPTION *, char *, u_long *));
+int f_reformat __P((SCR *, OPTION *, char *, u_long *));
+int f_section __P((SCR *, OPTION *, char *, u_long *));
+int f_ttywerase __P((SCR *, OPTION *, char *, u_long *));
+int f_w300 __P((SCR *, OPTION *, char *, u_long *));
+int f_w1200 __P((SCR *, OPTION *, char *, u_long *));
+int f_w9600 __P((SCR *, OPTION *, char *, u_long *));
+int f_window __P((SCR *, OPTION *, char *, u_long *));
+int put __P((SCR *, CB *, CHAR_T *, MARK *, MARK *, int));
+int rcv_tmp __P((SCR *, EXF *, char *));
+int rcv_init __P((SCR *));
+int rcv_sync __P((SCR *, u_int));
+int rcv_list __P((SCR *));
+int rcv_read __P((SCR *, FREF *));
+int screen_init __P((GS *, SCR *, SCR **));
+int screen_end __P((SCR *));
+SCR *screen_next __P((SCR *));
+int f_search __P((SCR *,
+ MARK *, MARK *, char *, size_t, char **, u_int));
+int b_search __P((SCR *,
+ MARK *, MARK *, char *, size_t, char **, u_int));
+void search_busy __P((SCR *, busy_t));
+int seq_set __P((SCR *, CHAR_T *,
+ size_t, CHAR_T *, size_t, CHAR_T *, size_t, seq_t, int));
+int seq_delete __P((SCR *, CHAR_T *, size_t, seq_t));
+int seq_mdel __P((SEQ *));
+SEQ *seq_find
+ __P((SCR *, SEQ **, EVENT *, CHAR_T *, size_t, seq_t, int *));
+void seq_close __P((GS *));
+int seq_dump __P((SCR *, seq_t, int));
+int seq_save __P((SCR *, FILE *, char *, seq_t));
+int e_memcmp __P((CHAR_T *, EVENT *, size_t));
+void *binc __P((SCR *, void *, size_t *, size_t));
+int nonblank __P((SCR *, recno_t, size_t *));
+char *tail __P((char *));
+CHAR_T *v_strdup __P((SCR *, const CHAR_T *, size_t));
+enum nresult nget_uslong __P((u_long *, const char *, char **, int));
+enum nresult nget_slong __P((long *, const char *, char **, int));
+void TRACE __P((SCR *, const char *, ...));
diff --git a/contrib/nvi/include/ex_def.h b/contrib/nvi/include/ex_def.h
new file mode 100644
index 0000000..2e69b48
--- /dev/null
+++ b/contrib/nvi/include/ex_def.h
@@ -0,0 +1,78 @@
+#define C_SCROLL 0
+#define C_BANG 1
+#define C_HASH 2
+#define C_SUBAGAIN 3
+#define C_STAR 4
+#define C_SHIFTL 5
+#define C_EQUAL 6
+#define C_SHIFTR 7
+#define C_AT 8
+#define C_APPEND 9
+#define C_ABBR 10
+#define C_ARGS 11
+#define C_BG 12
+#define C_CHANGE 13
+#define C_CD 14
+#define C_CHDIR 15
+#define C_COPY 16
+#define C_CSCOPE 17
+#define C_DELETE 18
+#define C_DISPLAY 19
+#define C_EDIT 20
+#define C_EX 21
+#define C_EXUSAGE 22
+#define C_FILE 23
+#define C_FG 24
+#define C_GLOBAL 25
+#define C_HELP 26
+#define C_INSERT 27
+#define C_JOIN 28
+#define C_K 29
+#define C_LIST 30
+#define C_MOVE 31
+#define C_MARK 32
+#define C_MAP 33
+#define C_MKEXRC 34
+#define C_NEXT 35
+#define C_NUMBER 36
+#define C_OPEN 37
+#define C_PRINT 38
+#define C_PERLCMD 39
+#define C_PERLDOCMD 40
+#define C_PRESERVE 41
+#define C_PREVIOUS 42
+#define C_PUT 43
+#define C_QUIT 44
+#define C_READ 45
+#define C_RECOVER 46
+#define C_RESIZE 47
+#define C_REWIND 48
+#define C_SUBSTITUTE 49
+#define C_SCRIPT 50
+#define C_SET 51
+#define C_SHELL 52
+#define C_SOURCE 53
+#define C_STOP 54
+#define C_SUSPEND 55
+#define C_T 56
+#define C_TAG 57
+#define C_TAGNEXT 58
+#define C_TAGPOP 59
+#define C_TAGPREV 60
+#define C_TAGTOP 61
+#define C_TCLCMD 62
+#define C_UNDO 63
+#define C_UNABBREVIATE 64
+#define C_UNMAP 65
+#define C_V 66
+#define C_VERSION 67
+#define C_VISUAL_EX 68
+#define C_VISUAL_VI 69
+#define C_VIUSAGE 70
+#define C_WRITE 71
+#define C_WN 72
+#define C_WQ 73
+#define C_XIT 74
+#define C_YANK 75
+#define C_Z 76
+#define C_SUBTILDE 77
diff --git a/contrib/nvi/include/ex_extern.h b/contrib/nvi/include/ex_extern.h
new file mode 100644
index 0000000..ed01701
--- /dev/null
+++ b/contrib/nvi/include/ex_extern.h
@@ -0,0 +1,127 @@
+int ex __P((SCR **));
+int ex_cmd __P((SCR *));
+int ex_range __P((SCR *, EXCMD *, int *));
+int ex_is_abbrev __P((char *, size_t));
+int ex_is_unmap __P((char *, size_t));
+void ex_badaddr
+ __P((SCR *, EXCMDLIST const *, enum badaddr, enum nresult));
+int ex_abbr __P((SCR *, EXCMD *));
+int ex_unabbr __P((SCR *, EXCMD *));
+int ex_append __P((SCR *, EXCMD *));
+int ex_change __P((SCR *, EXCMD *));
+int ex_insert __P((SCR *, EXCMD *));
+int ex_next __P((SCR *, EXCMD *));
+int ex_prev __P((SCR *, EXCMD *));
+int ex_rew __P((SCR *, EXCMD *));
+int ex_args __P((SCR *, EXCMD *));
+char **ex_buildargv __P((SCR *, EXCMD *, char *));
+int argv_init __P((SCR *, EXCMD *));
+int argv_exp0 __P((SCR *, EXCMD *, char *, size_t));
+int argv_exp1 __P((SCR *, EXCMD *, char *, size_t, int));
+int argv_exp2 __P((SCR *, EXCMD *, char *, size_t));
+int argv_exp3 __P((SCR *, EXCMD *, char *, size_t));
+int argv_free __P((SCR *));
+int ex_at __P((SCR *, EXCMD *));
+int ex_bang __P((SCR *, EXCMD *));
+int ex_cd __P((SCR *, EXCMD *));
+int ex_cscope __P((SCR *, EXCMD *));
+int cscope_display __P((SCR *));
+int cscope_search __P((SCR *, TAGQ *, TAG *));
+int ex_delete __P((SCR *, EXCMD *));
+int ex_display __P((SCR *, EXCMD *));
+int ex_edit __P((SCR *, EXCMD *));
+int ex_equal __P((SCR *, EXCMD *));
+int ex_file __P((SCR *, EXCMD *));
+int ex_filter __P((SCR *,
+ EXCMD *, MARK *, MARK *, MARK *, char *, enum filtertype));
+int ex_global __P((SCR *, EXCMD *));
+int ex_v __P((SCR *, EXCMD *));
+int ex_g_insdel __P((SCR *, lnop_t, recno_t));
+int ex_screen_copy __P((SCR *, SCR *));
+int ex_screen_end __P((SCR *));
+int ex_optchange __P((SCR *, int, char *, u_long *));
+int ex_exrc __P((SCR *));
+int ex_run_str __P((SCR *, char *, char *, size_t, int, int));
+int ex_join __P((SCR *, EXCMD *));
+int ex_map __P((SCR *, EXCMD *));
+int ex_unmap __P((SCR *, EXCMD *));
+int ex_mark __P((SCR *, EXCMD *));
+int ex_mkexrc __P((SCR *, EXCMD *));
+int ex_copy __P((SCR *, EXCMD *));
+int ex_move __P((SCR *, EXCMD *));
+int ex_open __P((SCR *, EXCMD *));
+int ex_perl __P((SCR*, EXCMD *));
+int ex_preserve __P((SCR *, EXCMD *));
+int ex_recover __P((SCR *, EXCMD *));
+int ex_list __P((SCR *, EXCMD *));
+int ex_number __P((SCR *, EXCMD *));
+int ex_pr __P((SCR *, EXCMD *));
+int ex_print __P((SCR *, EXCMD *, MARK *, MARK *, u_int32_t));
+int ex_ldisplay __P((SCR *, const char *, size_t, size_t, u_int));
+int ex_scprint __P((SCR *, MARK *, MARK *));
+int ex_printf __P((SCR *, const char *, ...));
+int ex_puts __P((SCR *, const char *));
+int ex_fflush __P((SCR *sp));
+int ex_put __P((SCR *, EXCMD *));
+int ex_quit __P((SCR *, EXCMD *));
+int ex_read __P((SCR *, EXCMD *));
+int ex_readfp __P((SCR *, char *, FILE *, MARK *, recno_t *, int));
+int ex_bg __P((SCR *, EXCMD *));
+int ex_fg __P((SCR *, EXCMD *));
+int ex_resize __P((SCR *, EXCMD *));
+int ex_sdisplay __P((SCR *));
+int ex_script __P((SCR *, EXCMD *));
+int sscr_exec __P((SCR *, recno_t));
+int sscr_input __P((SCR *));
+int sscr_end __P((SCR *));
+int ex_set __P((SCR *, EXCMD *));
+int ex_shell __P((SCR *, EXCMD *));
+int ex_exec_proc __P((SCR *, EXCMD *, char *, const char *, int));
+int proc_wait __P((SCR *, long, const char *, int, int));
+int ex_shiftl __P((SCR *, EXCMD *));
+int ex_shiftr __P((SCR *, EXCMD *));
+int ex_source __P((SCR *, EXCMD *));
+int ex_stop __P((SCR *, EXCMD *));
+int ex_s __P((SCR *, EXCMD *));
+int ex_subagain __P((SCR *, EXCMD *));
+int ex_subtilde __P((SCR *, EXCMD *));
+int re_compile __P((SCR *,
+ char *, size_t, char **, size_t *, regex_t *, u_int));
+void re_error __P((SCR *, int, regex_t *));
+int ex_tag_first __P((SCR *, char *));
+int ex_tag_push __P((SCR *, EXCMD *));
+int ex_tag_next __P((SCR *, EXCMD *));
+int ex_tag_prev __P((SCR *, EXCMD *));
+int ex_tag_nswitch __P((SCR *, TAG *, int));
+int ex_tag_Nswitch __P((SCR *, TAG *, int));
+int ex_tag_pop __P((SCR *, EXCMD *));
+int ex_tag_top __P((SCR *, EXCMD *));
+int ex_tag_display __P((SCR *));
+int ex_tag_copy __P((SCR *, SCR *));
+int tagq_free __P((SCR *, TAGQ *));
+void tag_msg __P((SCR *, tagmsg_t, char *));
+int ex_tagf_alloc __P((SCR *, char *));
+int ex_tag_free __P((SCR *));
+int ex_tcl __P((SCR*, EXCMD *));
+int ex_txt __P((SCR *, TEXTH *, ARG_CHAR_T, u_int32_t));
+int ex_undo __P((SCR *, EXCMD *));
+int ex_help __P((SCR *, EXCMD *));
+int ex_usage __P((SCR *, EXCMD *));
+int ex_viusage __P((SCR *, EXCMD *));
+void ex_cinit __P((EXCMD *,
+ int, int, recno_t, recno_t, int, ARGS **));
+void ex_cadd __P((EXCMD *, ARGS *, char *, size_t));
+int ex_getline __P((SCR *, FILE *, size_t *));
+int ex_ncheck __P((SCR *, int));
+int ex_init __P((SCR *));
+void ex_emsg __P((SCR *, char *, exm_t));
+int ex_version __P((SCR *, EXCMD *));
+int ex_visual __P((SCR *, EXCMD *));
+int ex_wn __P((SCR *, EXCMD *));
+int ex_wq __P((SCR *, EXCMD *));
+int ex_write __P((SCR *, EXCMD *));
+int ex_xit __P((SCR *, EXCMD *));
+int ex_writefp __P((SCR *,
+ char *, FILE *, MARK *, MARK *, u_long *, u_long *, int));
+int ex_yank __P((SCR *, EXCMD *));
+int ex_z __P((SCR *, EXCMD *));
diff --git a/contrib/nvi/include/ip_extern.h b/contrib/nvi/include/ip_extern.h
new file mode 100644
index 0000000..b805343
--- /dev/null
+++ b/contrib/nvi/include/ip_extern.h
@@ -0,0 +1,23 @@
+int ip_addstr __P((SCR *, const char *, size_t));
+int ip_attr __P((SCR *, scr_attr_t, int));
+int ip_baud __P((SCR *, u_long *));
+int ip_bell __P((SCR *));
+void ip_busy __P((SCR *, const char *, busy_t));
+int ip_clrtoeol __P((SCR *));
+int ip_cursor __P((SCR *, size_t *, size_t *));
+int ip_deleteln __P((SCR *));
+int ip_ex_adjust __P((SCR *, exadj_t));
+int ip_insertln __P((SCR *));
+int ip_keyval __P((SCR *, scr_keyval_t, CHAR_T *, int *));
+int ip_move __P((SCR *, size_t, size_t));
+int ip_refresh __P((SCR *, int));
+int ip_rename __P((SCR *));
+int ip_suspend __P((SCR *, int *));
+void ip_usage __P((void));
+int ip_event __P((SCR *, EVENT *, u_int32_t, int));
+int ip_screen __P((SCR *, u_int32_t));
+int ip_quit __P((GS *));
+int ip_term_init __P((SCR *));
+int ip_term_end __P((GS *));
+int ip_fmap __P((SCR *, seq_t, CHAR_T *, size_t, CHAR_T *, size_t));
+int ip_optchange __P((SCR *, int, char *, u_long *));
diff --git a/contrib/nvi/include/options_def.h b/contrib/nvi/include/options_def.h
new file mode 100644
index 0000000..089fa7f
--- /dev/null
+++ b/contrib/nvi/include/options_def.h
@@ -0,0 +1,79 @@
+#define O_ALTWERASE 0
+#define O_AUTOINDENT 1
+#define O_AUTOPRINT 2
+#define O_AUTOWRITE 3
+#define O_BACKUP 4
+#define O_BEAUTIFY 5
+#define O_CDPATH 6
+#define O_CEDIT 7
+#define O_COLUMNS 8
+#define O_COMMENT 9
+#define O_DIRECTORY 10
+#define O_EDCOMPATIBLE 11
+#define O_ESCAPETIME 12
+#define O_ERRORBELLS 13
+#define O_EXRC 14
+#define O_EXTENDED 15
+#define O_FILEC 16
+#define O_FLASH 17
+#define O_HARDTABS 18
+#define O_ICLOWER 19
+#define O_IGNORECASE 20
+#define O_KEYTIME 21
+#define O_LEFTRIGHT 22
+#define O_LINES 23
+#define O_LISP 24
+#define O_LIST 25
+#define O_LOCKFILES 26
+#define O_MAGIC 27
+#define O_MATCHTIME 28
+#define O_MESG 29
+#define O_MODELINE 30
+#define O_MSGCAT 31
+#define O_NOPRINT 32
+#define O_NUMBER 33
+#define O_OCTAL 34
+#define O_OPEN 35
+#define O_OPTIMIZE 36
+#define O_PARAGRAPHS 37
+#define O_PATH 38
+#define O_PRINT 39
+#define O_PROMPT 40
+#define O_READONLY 41
+#define O_RECDIR 42
+#define O_REDRAW 43
+#define O_REMAP 44
+#define O_REPORT 45
+#define O_RULER 46
+#define O_SCROLL 47
+#define O_SEARCHINCR 48
+#define O_SECTIONS 49
+#define O_SECURE 50
+#define O_SHELL 51
+#define O_SHELLMETA 52
+#define O_SHIFTWIDTH 53
+#define O_SHOWMATCH 54
+#define O_SHOWMODE 55
+#define O_SIDESCROLL 56
+#define O_SLOWOPEN 57
+#define O_SOURCEANY 58
+#define O_TABSTOP 59
+#define O_TAGLENGTH 60
+#define O_TAGS 61
+#define O_TERM 62
+#define O_TERSE 63
+#define O_TILDEOP 64
+#define O_TIMEOUT 65
+#define O_TTYWERASE 66
+#define O_VERBOSE 67
+#define O_W1200 68
+#define O_W300 69
+#define O_W9600 70
+#define O_WARN 71
+#define O_WINDOW 72
+#define O_WINDOWNAME 73
+#define O_WRAPLEN 74
+#define O_WRAPMARGIN 75
+#define O_WRAPSCAN 76
+#define O_WRITEANY 77
+#define O_OPTIONCOUNT 78
diff --git a/contrib/nvi/include/perl_extern.h b/contrib/nvi/include/perl_extern.h
new file mode 100644
index 0000000..5d6dd0d
--- /dev/null
+++ b/contrib/nvi/include/perl_extern.h
@@ -0,0 +1,8 @@
+int perl_end __P((GS *));
+int perl_init __P((SCR *));
+int perl_screen_end __P((SCR*));
+int perl_ex_perl __P((SCR*, CHAR_T *, size_t, recno_t, recno_t));
+int perl_ex_perldo __P((SCR*, CHAR_T *, size_t, recno_t, recno_t));
+#ifdef USE_SFIO
+Sfdisc_t* sfdcnewnvi __P((SCR*));
+#endif
diff --git a/contrib/nvi/include/sys/queue.h b/contrib/nvi/include/sys/queue.h
new file mode 100644
index 0000000..cbd7586
--- /dev/null
+++ b/contrib/nvi/include/sys/queue.h
@@ -0,0 +1,259 @@
+/*
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)queue.h 8.5 (Berkeley) 8/20/94
+ */
+
+#ifndef _SYS_QUEUE_H_
+#define _SYS_QUEUE_H_
+
+/*
+ * This file defines three types of data structures: lists, tail queues,
+ * and circular queues.
+ *
+ * A list is headed by a single forward pointer (or an array of forward
+ * pointers for a hash table header). The elements are doubly linked
+ * so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before
+ * or after an existing element or at the head of the list. A list
+ * may only be traversed in the forward direction.
+ *
+ * A tail queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or
+ * after an existing element, at the head of the list, or at the end of
+ * the list. A tail queue may only be traversed in the forward direction.
+ *
+ * A circle queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or after
+ * an existing element, at the head of the list, or at the end of the list.
+ * A circle queue may be traversed in either direction, but has a more
+ * complex end of list detection.
+ *
+ * For details on the use of these macros, see the queue(3) manual page.
+ */
+
+/*
+ * List definitions.
+ */
+#define LIST_HEAD(name, type) \
+struct name { \
+ struct type *lh_first; /* first element */ \
+}
+
+#define LIST_ENTRY(type) \
+struct { \
+ struct type *le_next; /* next element */ \
+ struct type **le_prev; /* address of previous next element */ \
+}
+
+/*
+ * List functions.
+ */
+#define LIST_INIT(head) { \
+ (head)->lh_first = NULL; \
+}
+
+#define LIST_INSERT_AFTER(listelm, elm, field) { \
+ if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
+ (listelm)->field.le_next->field.le_prev = \
+ &(elm)->field.le_next; \
+ (listelm)->field.le_next = (elm); \
+ (elm)->field.le_prev = &(listelm)->field.le_next; \
+}
+
+#define LIST_INSERT_BEFORE(listelm, elm, field) { \
+ (elm)->field.le_prev = (listelm)->field.le_prev; \
+ (elm)->field.le_next = (listelm); \
+ *(listelm)->field.le_prev = (elm); \
+ (listelm)->field.le_prev = &(elm)->field.le_next; \
+}
+
+#define LIST_INSERT_HEAD(head, elm, field) { \
+ if (((elm)->field.le_next = (head)->lh_first) != NULL) \
+ (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
+ (head)->lh_first = (elm); \
+ (elm)->field.le_prev = &(head)->lh_first; \
+}
+
+#define LIST_REMOVE(elm, field) { \
+ if ((elm)->field.le_next != NULL) \
+ (elm)->field.le_next->field.le_prev = \
+ (elm)->field.le_prev; \
+ *(elm)->field.le_prev = (elm)->field.le_next; \
+}
+
+/*
+ * Tail queue definitions.
+ */
+#define TAILQ_HEAD(name, type) \
+struct name { \
+ struct type *tqh_first; /* first element */ \
+ struct type **tqh_last; /* addr of last next element */ \
+}
+
+#define TAILQ_ENTRY(type) \
+struct { \
+ struct type *tqe_next; /* next element */ \
+ struct type **tqe_prev; /* address of previous next element */ \
+}
+
+/*
+ * Tail queue functions.
+ */
+#define TAILQ_INIT(head) { \
+ (head)->tqh_first = NULL; \
+ (head)->tqh_last = &(head)->tqh_first; \
+}
+
+#define TAILQ_INSERT_HEAD(head, elm, field) { \
+ if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
+ (head)->tqh_first->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (head)->tqh_first = (elm); \
+ (elm)->field.tqe_prev = &(head)->tqh_first; \
+}
+
+#define TAILQ_INSERT_TAIL(head, elm, field) { \
+ (elm)->field.tqe_next = NULL; \
+ (elm)->field.tqe_prev = (head)->tqh_last; \
+ *(head)->tqh_last = (elm); \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+}
+
+#define TAILQ_INSERT_AFTER(head, listelm, elm, field) { \
+ if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
+ (elm)->field.tqe_next->field.tqe_prev = \
+ &(elm)->field.tqe_next; \
+ else \
+ (head)->tqh_last = &(elm)->field.tqe_next; \
+ (listelm)->field.tqe_next = (elm); \
+ (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
+}
+
+#define TAILQ_INSERT_BEFORE(listelm, elm, field) { \
+ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
+ (elm)->field.tqe_next = (listelm); \
+ *(listelm)->field.tqe_prev = (elm); \
+ (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
+}
+
+#define TAILQ_REMOVE(head, elm, field) { \
+ if (((elm)->field.tqe_next) != NULL) \
+ (elm)->field.tqe_next->field.tqe_prev = \
+ (elm)->field.tqe_prev; \
+ else \
+ (head)->tqh_last = (elm)->field.tqe_prev; \
+ *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
+}
+
+/*
+ * Circular queue definitions.
+ */
+#define CIRCLEQ_HEAD(name, type) \
+struct name { \
+ struct type *cqh_first; /* first element */ \
+ struct type *cqh_last; /* last element */ \
+}
+
+#define CIRCLEQ_ENTRY(type) \
+struct { \
+ struct type *cqe_next; /* next element */ \
+ struct type *cqe_prev; /* previous element */ \
+}
+
+/*
+ * Circular queue functions.
+ */
+#define CIRCLEQ_INIT(head) { \
+ (head)->cqh_first = (void *)(head); \
+ (head)->cqh_last = (void *)(head); \
+}
+
+#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) { \
+ (elm)->field.cqe_next = (listelm)->field.cqe_next; \
+ (elm)->field.cqe_prev = (listelm); \
+ if ((listelm)->field.cqe_next == (void *)(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (listelm)->field.cqe_next->field.cqe_prev = (elm); \
+ (listelm)->field.cqe_next = (elm); \
+}
+
+#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) { \
+ (elm)->field.cqe_next = (listelm); \
+ (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
+ if ((listelm)->field.cqe_prev == (void *)(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (listelm)->field.cqe_prev->field.cqe_next = (elm); \
+ (listelm)->field.cqe_prev = (elm); \
+}
+
+#define CIRCLEQ_INSERT_HEAD(head, elm, field) { \
+ (elm)->field.cqe_next = (head)->cqh_first; \
+ (elm)->field.cqe_prev = (void *)(head); \
+ if ((head)->cqh_last == (void *)(head)) \
+ (head)->cqh_last = (elm); \
+ else \
+ (head)->cqh_first->field.cqe_prev = (elm); \
+ (head)->cqh_first = (elm); \
+}
+
+#define CIRCLEQ_INSERT_TAIL(head, elm, field) { \
+ (elm)->field.cqe_next = (void *)(head); \
+ (elm)->field.cqe_prev = (head)->cqh_last; \
+ if ((head)->cqh_first == (void *)(head)) \
+ (head)->cqh_first = (elm); \
+ else \
+ (head)->cqh_last->field.cqe_next = (elm); \
+ (head)->cqh_last = (elm); \
+}
+
+#define CIRCLEQ_REMOVE(head, elm, field) { \
+ if ((elm)->field.cqe_next == (void *)(head)) \
+ (head)->cqh_last = (elm)->field.cqe_prev; \
+ else \
+ (elm)->field.cqe_next->field.cqe_prev = \
+ (elm)->field.cqe_prev; \
+ if ((elm)->field.cqe_prev == (void *)(head)) \
+ (head)->cqh_first = (elm)->field.cqe_next; \
+ else \
+ (elm)->field.cqe_prev->field.cqe_next = \
+ (elm)->field.cqe_next; \
+}
+#endif /* !_SYS_QUEUE_H_ */
diff --git a/contrib/nvi/include/tcl_extern.h b/contrib/nvi/include/tcl_extern.h
new file mode 100644
index 0000000..ac68ae4
--- /dev/null
+++ b/contrib/nvi/include/tcl_extern.h
@@ -0,0 +1 @@
+int tcl_init __P((GS *));
diff --git a/contrib/nvi/include/tk_extern.h b/contrib/nvi/include/tk_extern.h
new file mode 100644
index 0000000..20a4de4
--- /dev/null
+++ b/contrib/nvi/include/tk_extern.h
@@ -0,0 +1,29 @@
+int tk_addstr __P((SCR *, const char *, size_t));
+int tk_attr __P((SCR *, scr_attr_t, int));
+int tk_baud __P((SCR *, u_long *));
+int tk_bell __P((SCR *));
+int tk_clrtoeol __P((SCR *));
+int tk_cursor __P((SCR *, size_t *, size_t *));
+int tk_deleteln __P((SCR *));
+int tk_ex_adjust __P((SCR *, exadj_t));
+int tk_insertln __P((SCR *));
+int tk_keyval __P((SCR *, scr_keyval_t, CHAR_T *, int *));
+int tk_move __P((SCR *, size_t, size_t));
+int tk_refresh __P((SCR *, int));
+int tk_rename __P((SCR *));
+int tk_suspend __P((SCR *, int *));
+void tk_usage __P((void));
+int tk_event __P((SCR *, EVENT *, u_int32_t, int));
+int tk_key __P((ClientData, Tcl_Interp *, int, char *[]));
+int tk_screen __P((SCR *, u_int32_t));
+int tk_quit __P((GS *));
+int tk_term_init __P((SCR *));
+int tk_term_end __P((GS *));
+int tk_fmap __P((SCR *, seq_t, CHAR_T *, size_t, CHAR_T *, size_t));
+int tk_optchange __P((SCR *, int, char *, u_long *));
+int tk_ssize __P((SCR *, int, size_t *, size_t *, int *));
+int tk_op __P((ClientData, Tcl_Interp *, int, char *[]));
+int tk_opt_init __P((ClientData, Tcl_Interp *, int, char *[]));
+int tk_opt_set __P((ClientData, Tcl_Interp *, int, char *[]));
+int tk_version __P((ClientData, Tcl_Interp *, int, char *[]));
+void tk_msg __P((SCR *, mtype_t, char *, size_t));
diff --git a/contrib/nvi/include/vi_extern.h b/contrib/nvi/include/vi_extern.h
new file mode 100644
index 0000000..b3c335e
--- /dev/null
+++ b/contrib/nvi/include/vi_extern.h
@@ -0,0 +1,142 @@
+int cs_init __P((SCR *, VCS *));
+int cs_next __P((SCR *, VCS *));
+int cs_fspace __P((SCR *, VCS *));
+int cs_fblank __P((SCR *, VCS *));
+int cs_prev __P((SCR *, VCS *));
+int cs_bblank __P((SCR *, VCS *));
+int v_at __P((SCR *, VICMD *));
+int v_chrepeat __P((SCR *, VICMD *));
+int v_chrrepeat __P((SCR *, VICMD *));
+int v_cht __P((SCR *, VICMD *));
+int v_chf __P((SCR *, VICMD *));
+int v_chT __P((SCR *, VICMD *));
+int v_chF __P((SCR *, VICMD *));
+int v_delete __P((SCR *, VICMD *));
+int v_again __P((SCR *, VICMD *));
+int v_exmode __P((SCR *, VICMD *));
+int v_join __P((SCR *, VICMD *));
+int v_shiftl __P((SCR *, VICMD *));
+int v_shiftr __P((SCR *, VICMD *));
+int v_suspend __P((SCR *, VICMD *));
+int v_switch __P((SCR *, VICMD *));
+int v_tagpush __P((SCR *, VICMD *));
+int v_tagpop __P((SCR *, VICMD *));
+int v_filter __P((SCR *, VICMD *));
+int v_event_exec __P((SCR *, VICMD *));
+int v_ex __P((SCR *, VICMD *));
+int v_ecl_exec __P((SCR *));
+int v_increment __P((SCR *, VICMD *));
+int v_screen_copy __P((SCR *, SCR *));
+int v_screen_end __P((SCR *));
+int v_optchange __P((SCR *, int, char *, u_long *));
+int v_iA __P((SCR *, VICMD *));
+int v_ia __P((SCR *, VICMD *));
+int v_iI __P((SCR *, VICMD *));
+int v_ii __P((SCR *, VICMD *));
+int v_iO __P((SCR *, VICMD *));
+int v_io __P((SCR *, VICMD *));
+int v_change __P((SCR *, VICMD *));
+int v_Replace __P((SCR *, VICMD *));
+int v_subst __P((SCR *, VICMD *));
+int v_left __P((SCR *, VICMD *));
+int v_cfirst __P((SCR *, VICMD *));
+int v_first __P((SCR *, VICMD *));
+int v_ncol __P((SCR *, VICMD *));
+int v_zero __P((SCR *, VICMD *));
+int v_mark __P((SCR *, VICMD *));
+int v_bmark __P((SCR *, VICMD *));
+int v_fmark __P((SCR *, VICMD *));
+int v_match __P((SCR *, VICMD *));
+int v_paragraphf __P((SCR *, VICMD *));
+int v_paragraphb __P((SCR *, VICMD *));
+int v_buildps __P((SCR *, char *, char *));
+int v_Put __P((SCR *, VICMD *));
+int v_put __P((SCR *, VICMD *));
+int v_redraw __P((SCR *, VICMD *));
+int v_replace __P((SCR *, VICMD *));
+int v_right __P((SCR *, VICMD *));
+int v_dollar __P((SCR *, VICMD *));
+int v_screen __P((SCR *, VICMD *));
+int v_lgoto __P((SCR *, VICMD *));
+int v_home __P((SCR *, VICMD *));
+int v_middle __P((SCR *, VICMD *));
+int v_bottom __P((SCR *, VICMD *));
+int v_up __P((SCR *, VICMD *));
+int v_cr __P((SCR *, VICMD *));
+int v_down __P((SCR *, VICMD *));
+int v_hpageup __P((SCR *, VICMD *));
+int v_hpagedown __P((SCR *, VICMD *));
+int v_pagedown __P((SCR *, VICMD *));
+int v_pageup __P((SCR *, VICMD *));
+int v_lineup __P((SCR *, VICMD *));
+int v_linedown __P((SCR *, VICMD *));
+int v_searchb __P((SCR *, VICMD *));
+int v_searchf __P((SCR *, VICMD *));
+int v_searchN __P((SCR *, VICMD *));
+int v_searchn __P((SCR *, VICMD *));
+int v_searchw __P((SCR *, VICMD *));
+int v_correct __P((SCR *, VICMD *, int));
+int v_sectionf __P((SCR *, VICMD *));
+int v_sectionb __P((SCR *, VICMD *));
+int v_sentencef __P((SCR *, VICMD *));
+int v_sentenceb __P((SCR *, VICMD *));
+int v_status __P((SCR *, VICMD *));
+int v_tcmd __P((SCR *, VICMD *, ARG_CHAR_T, u_int));
+int v_txt __P((SCR *, VICMD *, MARK *,
+ const char *, size_t, ARG_CHAR_T, recno_t, u_long, u_int32_t));
+int v_txt_auto __P((SCR *, recno_t, TEXT *, size_t, TEXT *));
+int v_ulcase __P((SCR *, VICMD *));
+int v_mulcase __P((SCR *, VICMD *));
+int v_Undo __P((SCR *, VICMD *));
+int v_undo __P((SCR *, VICMD *));
+void v_eof __P((SCR *, MARK *));
+void v_eol __P((SCR *, MARK *));
+void v_nomove __P((SCR *));
+void v_sof __P((SCR *, MARK *));
+void v_sol __P((SCR *));
+int v_isempty __P((char *, size_t));
+void v_emsg __P((SCR *, char *, vim_t));
+int v_wordW __P((SCR *, VICMD *));
+int v_wordw __P((SCR *, VICMD *));
+int v_wordE __P((SCR *, VICMD *));
+int v_worde __P((SCR *, VICMD *));
+int v_wordB __P((SCR *, VICMD *));
+int v_wordb __P((SCR *, VICMD *));
+int v_xchar __P((SCR *, VICMD *));
+int v_Xchar __P((SCR *, VICMD *));
+int v_yank __P((SCR *, VICMD *));
+int v_z __P((SCR *, VICMD *));
+int vs_crel __P((SCR *, long));
+int v_zexit __P((SCR *, VICMD *));
+int vi __P((SCR **));
+int vs_line __P((SCR *, SMAP *, size_t *, size_t *));
+int vs_number __P((SCR *));
+void vs_busy __P((SCR *, const char *, busy_t));
+void vs_home __P((SCR *));
+void vs_update __P((SCR *, const char *, const char *));
+void vs_msg __P((SCR *, mtype_t, char *, size_t));
+int vs_ex_resolve __P((SCR *, int *));
+int vs_resolve __P((SCR *, SCR *, int));
+int vs_repaint __P((SCR *, EVENT *));
+int vs_refresh __P((SCR *, int));
+int vs_column __P((SCR *, size_t *));
+size_t vs_screens __P((SCR *, recno_t, size_t *));
+size_t vs_columns __P((SCR *, char *, recno_t, size_t *, size_t *));
+size_t vs_rcm __P((SCR *, recno_t, int));
+size_t vs_colpos __P((SCR *, recno_t, size_t));
+int vs_change __P((SCR *, recno_t, lnop_t));
+int vs_sm_fill __P((SCR *, recno_t, pos_t));
+int vs_sm_scroll __P((SCR *, MARK *, recno_t, scroll_t));
+int vs_sm_1up __P((SCR *));
+int vs_sm_1down __P((SCR *));
+int vs_sm_next __P((SCR *, SMAP *, SMAP *));
+int vs_sm_prev __P((SCR *, SMAP *, SMAP *));
+int vs_sm_cursor __P((SCR *, SMAP **));
+int vs_sm_position __P((SCR *, MARK *, u_long, pos_t));
+recno_t vs_sm_nlines __P((SCR *, SMAP *, recno_t, size_t));
+int vs_split __P((SCR *, SCR *, int));
+int vs_discard __P((SCR *, SCR **));
+int vs_fg __P((SCR *, SCR **, CHAR_T *, int));
+int vs_bg __P((SCR *));
+int vs_swap __P((SCR *, SCR **, char *));
+int vs_resize __P((SCR *, long, adj_t));
OpenPOWER on IntegriCloud