$! ------------------ CUT HERE -----------------------
$ v='f$verify(f$trnlnm("SHARE_UNPACK_VERIFY"))'
$!
$! This archive created:
$!  Name : VILE
$!  By   : Andy Harper <Andy.Harper@kcl.ac.uk>
$!  Date : 11-SEP-1998 17:49:17.49
$!  Using: VMS_SHARE 8.5-1, (C) 1993 Andy Harper, Kings College London UK
$!
$! Credit is due to these people for their original ideas:
$!    James Gray, Michael Bednarek 
$!
$! To unpack this archive:
$!+   Ensure that all parts are present, (145 at about 60 Blocks each).
$!+   Append all parts together to form one larger file.
$!    Minimum of VMS 4.4 (VAX) / OpenVMS 1.0 (Alpha) is required.
$!    Remove the headers of the first part, up to `cut here' line.
$!    Execute file as a command procedure.
$!
$! The following file(s) will be created after unpacking:
$!       1. [.VILE-8_0]ACLOCAL.M4;1
$!       2. [.VILE-8_0]ANSI.C;1
$!       3. [.VILE-8_0]API.C;1
$!       4. [.VILE-8_0]API.H;1
$!       5. [.VILE-8_0]BASIC.C;1
$!       6. [.VILE-8_0]BIND.C;1
$!       7. [.VILE-8_0]BORLAND.C;1
$!       8. [.VILE-8_0]BTREE.C;1
$!       9. [.VILE-8_0]BTREE.H;1
$!      10. [.VILE-8_0]BUFFER.C;1
$!      11. [.VILE-8_0]BUGLIST.;1
$!      12. [.VILE-8_0]C-FILT.C;1
$!      13. [.VILE-8_0]C-FILT.FLX;1
$!      14. [.VILE-8_0]CHANGES.;1
$!      15. [.VILE-8_0]CHANGES.R3;1
$!      16. [.VILE-8_0]CHANGES.R4;1
$!      17. [.VILE-8_0]CHANGES.R5;1
$!      18. [.VILE-8_0]CHANGES.R6;1
$!      19. [.VILE-8_0]CHGDFUNC.H;1
$!      20. [.VILE-8_0]CMDTBL.;1
$!      21. [.VILE-8_0]CONFIG.EMX;1
$!      22. [.VILE-8_0]CONFIG.GUESS;1
$!      23. [.VILE-8_0]CONFIG.SUB;1
$!      24. [.VILE-8_0]CONFIGURE.;1
$!      25. [.VILE-8_0]CONFIGURE.IN;1
$!      26. [.VILE-8_0]CONFIG_H.IN;1
$!      27. [.VILE-8_0]COPYING.;1
$!      28. [.VILE-8_0]CRYPT.C;1
$!      29. [.VILE-8_0]CSRCH.C;1
$!      30. [.VILE-8_0]DESCRIP.MMS;1
$!      31. [.VILE-8_0]DIRSTUFF.H;1
$!      32. [.VILE-8_0]DISPLAY.C;1
$!      33. [.VILE-8_0]DJHANDL.C;1
$!      34. [.VILE-8_0]DUMBTERM.C;1
$!      35. [.VILE-8_0]EDEF.H;1
$!      36. [.VILE-8_0]ESTRUCT.H;1
$!      37. [.VILE-8_0]EVAL.C;1
$!      38. [.VILE-8_0]EXEC.C;1
$!      39. [.VILE-8_0]EXTERNS.C;1
$!      40. [.VILE-8_0]FENCES.C;1
$!      41. [.VILE-8_0]FILE.C;1
$!      42. [.VILE-8_0]FILEC.C;1
$!      43. [.VILE-8_0]FILEIO.C;1
$!      44. [.VILE-8_0]FINDERR.C;1
$!      45. [.VILE-8_0]GLOB.C;1
$!      46. [.VILE-8_0]GLOBALS.C;1
$!      47. [.VILE-8_0]GPPCONIO.C;1
$!      48. [.VILE-8_0]HISTORY.C;1
$!      49. [.VILE-8_0]IBMPC.C;1
$!      50. [.VILE-8_0]INPUT.C;1
$!      51. [.VILE-8_0]INSERT.C;1
$!      52. [.VILE-8_0]INSTALL.;1
$!      53. [.VILE-8_0]INSTALL.SH;1
$!      54. [.VILE-8_0]ISEARCH.C;1
$!      55. [.VILE-8_0]ITBUFF.C;1
$!      56. [.VILE-8_0]LCKFILES.C;1
$!      57. [.VILE-8_0]LINE.C;1
$!      58. [.VILE-8_0]MAIN.C;1
$!      59. [.VILE-8_0]MAKEFILE.BLC;1
$!      60. [.VILE-8_0]MAKEFILE.DJG;1
$!      61. [.VILE-8_0]MAKEFILE.EMX;1
$!      62. [.VILE-8_0]MAKEFILE.ICC;1
$!      63. [.VILE-8_0]MAKEFILE.IN;1
$!      64. [.VILE-8_0]MAKEFILE.TBC;1
$!      65. [.VILE-8_0]MAKEFILE.WAT;1
$!      66. [.VILE-8_0]MAKEFILE.WNT;1
$!      67. [.VILE-8_0]MANFILT.C;1
$!      68. [.VILE-8_0]MANIFEST.;1
$!      69. [.VILE-8_0]MAP.C;1
$!      70. [.VILE-8_0]MENU.C;1
$!      71. [.VILE-8_0]MKDIRS.SH;1
$!      72. [.VILE-8_0]MKPRLENV.WNT;1
$!      73. [.VILE-8_0]MKTBLS.C;1
$!      74. [.VILE-8_0]MKTBLS.MAP;4
$!      75. [.VILE-8_0]MODES.C;1
$!      76. [.VILE-8_0]MODETBL.;1
$!      77. [.VILE-8_0]MSGS.C;1
$!      78. [.VILE-8_0]NEBIND.H;4
$!      79. [.VILE-8_0]NEEXEC.H;4
$!      80. [.VILE-8_0]NEFKEYS.H;4
$!      81. [.VILE-8_0]NEFSMS.H;4
$!      82. [.VILE-8_0]NEFUNC.H;4
$!      83. [.VILE-8_0]NEMODE.H;4
$!      84. [.VILE-8_0]NENAME.H;4
$!      85. [.VILE-8_0]NEPROTO.H;4
$!      86. [.VILE-8_0]NEVARS.H;4
$!      87. [.VILE-8_0]NPOPEN.C;1
$!      88. [.VILE-8_0]NTCONIO.C;1
$!      89. [.VILE-8_0]NTWINIO.C;1
$!      90. [.VILE-8_0]ONELINER.C;1
$!      91. [.VILE-8_0]OPERS.C;1
$!      92. [.VILE-8_0]OS2KEYS.H;1
$!      93. [.VILE-8_0]OS2PIPE.C;1
$!      94. [.VILE-8_0]OS2VIO.C;1
$!      95. [.VILE-8_0]PAS-FILT.C;1
$!      96. [.VILE-8_0]PATCHLEV.H;1
$!      97. [.VILE-8_0]PATH.C;1
$!      98. [.VILE-8_0]PERL.XS;1
$!      99. [.VILE-8_0]PROTO.H;1
$!     100. [.VILE-8_0]PSCREEN.H;1
$!     101. [.VILE-8_0]PTYPEMAP.;1
$!     102. [.VILE-8_0]RANDOM.C;1
$!     103. [.VILE-8_0]README.;1
$!     104. [.VILE-8_0]README.PC;1
$!     105. [.VILE-8_0]REGEXP.C;1
$!     106. [.VILE-8_0]REGION.C;1
$!     107. [.VILE-8_0]REVLIST.;1
$!     108. [.VILE-8_0]SEARCH.C;1
$!     109. [.VILE-8_0]SELECT.C;1
$!     110. [.VILE-8_0]SPAWN.C;1
$!     111. [.VILE-8_0]TAGS.C;1
$!     112. [.VILE-8_0]TBUFF.C;1
$!     113. [.VILE-8_0]TCAP.C;1
$!     114. [.VILE-8_0]TCAP.H;1
$!     115. [.VILE-8_0]TERMIO.C;1
$!     116. [.VILE-8_0]TRACE.C;1
$!     117. [.VILE-8_0]TRACE.H;1
$!     118. [.VILE-8_0]UNDO.C;1
$!     119. [.VILE-8_0]VERSION.C;1
$!     120. [.VILE-8_0]VILE.1;1
$!     121. [.VILE-8_0]VILE.HLP;1
$!     122. [.VILE-8_0]VILE.MAP;2
$!     123. [.VILE-8_0]VMS2UNIX.C;1
$!     124. [.VILE-8_0]VMSBUILD.COM;1
$!     125. [.VILE-8_0]VMSPIPE.C;1
$!     126. [.VILE-8_0]VMSVT.C;1
$!     127. [.VILE-8_0]W32CBRD.C;1
$!     128. [.VILE-8_0]W32MISC.C;1
$!     129. [.VILE-8_0]W32PIPE.C;1
$!     130. [.VILE-8_0]WATCH.C;1
$!     131. [.VILE-8_0]WINDOW.C;1
$!     132. [.VILE-8_0]WORD.C;1
$!     133. [.VILE-8_0]WORDMOV.C;1
$!     134. [.VILE-8_0]X11.C;1
$!     135. [.VILE-8_0]XSHELL.SH;1
$!     136. [.VILE-8_0]XVILE.MAP;2
$!     137. [.VILE-8_0.DOC]CONFIG.DOC;1
$!     138. [.VILE-8_0.DOC]MACROS.DOC;1
$!     139. [.VILE-8_0.DOC]MENUS.DOC;1
$!     140. [.VILE-8_0.DOC]MODES.DOC;1
$!     141. [.VILE-8_0.DOC]PERL.DOC;1
$!     142. [.VILE-8_0.MACROS]DIGRAPHS.RC;1
$!     143. [.VILE-8_0.MACROS]MANPAGE.RC;1
$!     144. [.VILE-8_0.MACROS]PICTMODE.RC;1
$!     145. [.VILE-8_0.MACROS]VILE-PAGER.;1
$!     146. [.VILE-8_0.PERL]GLOB2RE.PL;1
$!     147. [.VILE-8_0.PERL]HGREP.PL;1
$!     148. [.VILE-8_0.PERL]MANFILT.PL;1
$!     149. [.VILE-8_0.PERL]SEARCH.PL;1
$!     150. [.VILE-8_0.PERL]SHELL.PL;1
$!     151. [.VILE-8_0.PERL]TAILF.PL;1
$!     152. [.VILE-8_0.PERL]VISIT.PL;1
$!
$ set="set"
$ set symbol/scope=(nolocal,noglobal)
$ f="SYS$SCRATCH:."+f$getjpi("","PID")+";"
$ if f$trnlnm("SHARE_UNPACK") .nes. "" then $ -
 f=f$parse("SHARE_UNPACK_TEMP",f)
$ e="write sys$error  ""%UNPACK"", "
$ w="write sys$output ""%UNPACK"", "
$ if .not. f$trnlnm("SHARE_UNPACK_LOG") then $ w = "!"
$ if f$getsyi("CPU") .gt. 127 then $ goto start
$ ve=f$getsyi("version")
$ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto start
$ e "-E-OLDVER, Must run at least VMS 4.4"
$ v=f$verify(v)
$ exit 44
$unpack:subroutine!P1=file,P2=chksum,P3=attrib,P4=size,P5=fileno,P6=filetotal
$ if f$parse(P1) .nes. "" then $ goto dirok
$ dn=f$parse(P1,,,"DIRECTORY")
$ w "-I-CREDIR, Creating directory ''dn'"
$ create/dir 'dn'
$ if $status then $ goto dirok
$ e "-E-CREDIRFAIL, Unable to create ''dn' File skipped"
$ delete 'f'*
$ exit
$dirok:
$ x=f$search(P1)
$ if x .eqs. "" then $ goto file_absent
$ e "-W-EXISTS, File ''P1' exists. Skipped"
$ delete 'f'*
$ exit
$file_absent:
$ w "-I-UNPACK, Unpacking ", P5, " of ", P6, " - ", P1, " - ", P4, " Blocks"
$ n=P1
$ if P3 .nes. "" then $ n=f
$ if .not. f$verify() then $ define/user sys$output nl:
$ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT/NOJOURNAL 'f'/OUT='n'
PROCEDURE GetHex(s,p)LOCAL x1,x2;x1:=INDEX(t,SUBSTR(s,p,1))-1;x2:=INDEX(t,
SUBSTR(s,p+1,1))-1;RETURN 16*x1+x2;ENDPROCEDURE;PROCEDURE SkipPartsep LOCAL m;
LOOP m:=MARK(NONE);EXITIF m=END_OF(CURRENT_BUFFER);DELETE(m);EXITIF INDEX(
ERASE_LINE,"-+-+-+-+-+-+-+-+")=1;ENDLOOP;ENDPROCEDURE;
PROCEDURE ProcessLine LOCAL c,s,l,b,n,p;s := ERASE_LINE;EDIT(s,TRIM);c :=
 SUBSTR(s,1,1);s := s-c;IF c = "X" THEN SPLIT_LINE; ENDIF;MOVE_HORIZONTAL(-1);
l := LENGTH(s);p := 1;LOOP EXITIF p > l;c := SUBSTR(s,p,1);p := p+1;
CASE c FROM ' ' TO '`' ['\']: b:=GetHex(s,p); n:=GetHex(s,p+2); p:=p+4;
 COPY_TEXT( SUBSTR(CURRENT_LINE,CURRENT_OFFSET-b+1,n));['&']: b:=GetHex(s,p);
 n:=GetHex(s,p+2); p:=p+4; COPY_TEXT(ASCII(n)*b);['`']: COPY_TEXT(ASCII(GetHex(
s,p))); p:=p+2;[INRANGE,OUTRANGE]: COPY_TEXT(c);ENDCASE;ENDLOOP;ENDPROCEDURE;
PROCEDURE Decode(b)LOCAL m;POSITION(BEGINNING_OF(b));LOOP m:=MARK(NONE);
EXITIF m=END_OF(b);DELETE(m);IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+-")=
1 THEN SkipPartSep;ELSE ProcessLine;MOVE_HORIZONTAL(1);ENDIF;ENDLOOP;
ENDPROCEDURE;SET(FACILITY_NAME,"UNPACK");SET(SUCCESS,OFF);SET(INFORMATIONAL,
OFF);t:="0123456789ABCDEF";f:=GET_INFO(COMMAND_LINE,"file_name");o:=
CREATE_BUFFER(f,f);Decode(o);WRITE_FILE(o,GET_INFO(COMMAND_LINE,"output_file"))
;QUIT;
$ if p3 .eqs. "" then $ goto dl
$ open/write fdl &f
$ write fdl "RECORD"
$ write fdl P3
$ close fdl
$ w "-I-CONVRFM, Converting record format to ", P3
$ convert/fdl='f' 'f'-1 'f'
$ fa=f$getdvi(f$parse(f),"ALLDEVNAM")
$ Pa=f$getdvi(f$parse(P1),"ALLDEVNAM")
$ if fa .eqs. Pa then $ rename &f 'f$parse(P1)'
$ if fa .nes. Pa then $ copy &f 'f$parse(P1)'
$dl: delete 'f'*
$ checksum 'P1'
$ if checksum$checksum .nes. P2 then $ -
  e "-E-CHKSMFAIL, Checksum of ''P1' failed."
$ exit
$ endsubroutine
$start:
$!
$ create 'f'
Xdnl Local definitions for autoconf.
Xdnl
Xdnl $Header: /usr/build/vile/vile/RCS/aclocal.m4,v 1.55 1998/05/22 01:28:55 to
Vm Exp $
Xdnl
Xdnl --------\0808\1010\2020\400B
Xdnl --------\0808\1010\2020\400B
Xdnl CF_PREREQ_COMPARE(MAJOR1, MINOR1, TERNARY1, MAJOR2\1A072, \1A072,
Xdnl        \0808   PRINTABLE2, not FOUND, FOUND)
Xdefine(CF_PREREQ_COMPARE,
X`5Bifelse(builtin(`5Beval`5D, `5B$3 < $6`5D), 1,
Xifelse(`5B$8`5D, , ,`5B$8`5D),
Xifelse(`5B$9`5D, , ,`5B$9`5D))`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Conditionally generate script according to whether we're using the release
V
Xdnl version of autoconf, or a patched\2209(using the ternary component as
Xdnl the patch-version).
Xdefine(CF_AC_PREREQ,
X`5BCF_PREREQ_COMPARE(
XAC_PREREQ_CANON(\100ASPLIT(AC_ACVERSION)),
XAC_PREREQ_CANON(\100ASPLIT(`5B$1`5D)), `5B$1`5D, `5B$2`5D, `5B$3`5D)`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Add an include-directory to $CPPFLAGS.  Don't add /usr/\3007, since it's
Xdnl redundant.  We don't normally need to add -I/usr/local/include for gcc,
Xdnl but old versions (and some misinstalled ones) need that.
XAC_DEFUN(`5BCF_ADD_INCDIR`5D,
X`5B
Xfor cf_add_incdir in $1
Xdo
X`09while true
X`09do
X`09`09case $cf_add_incdir in
X`09`09/usr/include) # (vi
X`09`09`09;;
X`09`09*) # (vi
X`09`09`09CPPFLAGS="$\0B08 -I$cf_add_incdir"
X`09`09`09;;
X`09`09esac
X`09`09cf_top_incdir=`60echo $cf_add\1507 `7C sed -e 's:/include/.*$\0D09:'`60
V
X`09`09test "$cf_top_incdir" =\1306add\1309`26`26 break
X`09`09cf_add_incdir="$cf_top\1007"
X`09done
Xdone
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES'
Xdnl in the sharutils 4.2 distribution.
XAC_DEFUN(`5BCF_ANSI_CC_CHECK`5D,
X`5B
XAC_MSG_CHECKING(for $`7BCC-cc`7D option to accept ANSI C)
XAC_CACHE_VAL(cf_cv_ansi_cc,`5B
Xcf_cv_ansi_cc=no
Xcf_save_CFLAGS="$\0906"
X# Don't try gcc -ansi; that turns off useful extensions and
X# breaks some systems' header files.
X# AIX`09`09`09-qlanglvl=ansi
X# Ultrix and OSF/1`09-std1
X# HP-UX`09`09`09-Aa -D_HPUX_SOURCE
X# SVR4`09`09`09-Xc
X# UnixWare 1.2`09`09(cannot use -Xc, since ANSI/POSIX clashes)
Xfor cf_arg in "-DCC_HAS_PROTOS" `5C
X`09"" `5C
X`09-qlanglvl=ansi `5C
X`09-std1 `5C
X`09"-Aa -D_HPUX_SOURCE +e" `5C
X`09"-Aa -D_HPUX_SOURCE" `5C
X`09-Xc
Xdo
X`09CFLAGS="$cf_save_\1106 $cf_arg"
X`09AC_TRY_COMPILE(
X`5B
X#ifndef CC_HAS_PROTOS
X#if !defined(__STDC__) `7C`7C \0D08 != 1
Xchoke me
X#endif
X#endif
X`5D,`5B
X`09int test (int i, double x);
X`09struct s1 `7Bint (*f) (int a);`7D;
X`09struct s2 `7Bint (*f) (double a);`7D;`5D,
X`09`5Bcf_cv_ansi_cc="$cf_arg"; break`5D)
Xdone
XCFLAGS="$cf_save_\1106"
X`5D)
XAC_MSG_RESULT($cf_cv_ansi_cc)
X
Xif test "$cf_cv_ansi_cc" != "no"; then
Xif test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
X`09CFLAGS="$\0906 $cf_cv_ansi_cc"
Xelse
X`09AC_DEFINE(CC_HAS_PROTOS)
Xfi
Xfi
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl For programs that must use an ANSI compiler, obtain \1108 option\3806
Xdnl will make it recognize prototypes.  We'll do preprocessor checks in other
V
Xdnl macros, since tools such as unproto can fake prototypes, but only part of
V
Xdnl the preprocessor.
XAC_DEFUN(`5BCF_ANSI_CC_REQD`5D,
X`5BAC_REQUIRE(`5BCF_ANSI_CC_CHECK`5D)
Xif test "$cf_cv_ansi_cc" = "no"; then
X`09AC_ERROR(
X`5BYour compiler does not appear to recognize prototypes.
XYou have the following choices:
X`09a. adjust your compiler options
X`09b. get an up-to-date compiler
X`09c. use a wrapper such as unproto`5D)
Xfi
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Test if we should use ANSI-style prototype for qsort's compare-function
XAC_DEFUN(`5BCF_ANSI_QSORT`5D,
X`5B
XAC_MSG_CHECKING(`5Bfor standard qsort`5D)
XAC_CACHE_VAL(cf_cv_ansi_qsort,`5B
X`09AC_TRY_COMPILE(`5B
X#if HAVE_STDLIB_H
X#include <stdlib.h>
X#endif
X`09int compare(const void *a, co\0F0Ab)
X`09`7B return (*(int *)a - *\0C07b); `7D `5D,
X`09`5B extern long *vector;
X`09  qsort(vector, 1, 1, compare); `5D,
X`09`5Bcf_cv_ansi_qsort=yes`5D,
X`09`5Bcf_cv_ansi_qsort=no`5D)
X`5D)
XAC_MSG_RESULT($cf_cv_ansi_qsort)
Xif test $cf_cv_ansi_qsort = yes; then
X`09AC_DEFINE(ANSI_QSORT,1)
Xelse
X`09AC_DEFINE(ANSI_QSORT,0)
Xfi
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Allow user to disable a normally-on option.
XAC_DEFUN(`5BCF_ARG_DISABLE`5D,
X`5BCF_ARG_OPTION($1,`5B$2 (default: on)`5D,`5B$3`5D,`5B$4`5D,yes)`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
Xdnl values.
Xdnl
Xdnl Parameters:
Xdnl $1 = option name
Xdnl $2 = help-string
Xdnl $3 = action to perform if option is not default
Xdnl $4 = action if perform if op\1506s default
Xdnl $5 = default option value (either 'yes' or 'no')
XAC_DEFUN(`5BCF_ARG_OPTION`5D,
X`5BAC_ARG_ENABLE($1,`5B$2`5D,`5Btest "$enableval" != ifelse($5,no,yes,no) `26
V`26 \2609=\220D\2506)
X  if test "$enableval" != "$5" ; then
Xifelse($3,,`5B    :`5Ddnl
X,`5B    $3`5D) ifelse($4,,,`5B
X  else
X    $4`5D)
X  fi`5D,`5Benableval=$5 ifelse($4,,,`5B
X  $4
X`5D)dnl
X  `5D)`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Check if we're accidentally using a cache from a different machine.
Xdnl Derive the system name, as a check for reusing the autoconf cache.
Xdnl
Xdnl If we've packaged config.guess an\1109sub, run that (since it does a
Xdnl better job than uname).
XAC_DEFUN(`5BCF_CHECK_CACHE`5D,
X`5B
Xif test -f $srcdir/config.guess ; then
X`09AC_CANONICAL_HOST
X`09system_name="$host_os"
Xelse
X`09system_name="`60(uname -s -r) 2>/dev/null`60"
X`09if test -z "$system_name" ; then
X`09`09system_name="`60(hostname) 2>/dev/null`60"
X`09fi
Xfi
Xtest -n "$system_name" `26`26 AC_DEFINE_UNQUOTED(SYSTEM_NAME,\310E)
XAC_CACHE_VAL(cf_cv_system_name,`5B\1311="$\210B"`5D)
X
Xtest -z "$system_name" `26`26 \100B="$cf_cv_\240C
Xtest -n "$cf_cv_system_name" `26`26 AC_MSG_RESULT("Configuring for \3613)
X
Xif test ".$system_name" != ".$cf_cv_\190D; then
X`09AC_MSG_RESULT(Cached system name ($\0E06_name) does not agree with actual (
V$cf_cv_\300C)
X`09AC_ERROR("Please remove config.cache and try again.")
Xfi
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Check for data that is usually declared in <stdio.h> or <errno.h>
Xdnl $1 = the name to check
XAC_DEFUN(`5BCF_CHECK_ERRNO`5D,
X`5B
XAC_MSG_CHECKING(`5Bdeclaration of $1`5D)
XAC_CACHE_VAL(cf_cv_dcl_$1,`5B
X    AC_TRY_COMPILE(`5B
X#if HAVE_STDLIB_H
X#include <stdlib.h>
X#endif
X#include <stdio.h>
X#include <sys/types.h>
X#include <errno.h> `5D,
X    `5Blong x = (long) $1`5D,
X    `5Beval 'cf_cv_dcl_'$1'=yes'`5D,
X    `5Beval 'cf_cv_dcl_'$1'=no`5D')`5D)
Xeval 'cf_result=$cf_cv_dcl_'$1
XAC_MSG_RESULT($cf_result)
X
X# It's possible (for near-UNIX clones) that the data doesn't exist
XAC_CACHE_VAL(cf_cv_have_$1,`5B
Xif test $cf_result = no ; then
X    eval 'cf_result=DECL_'$1
X    CF_UPPER(cf_result,$\0B09)
X    AC_DEFINE_UNQUOTED($cf_result)
X    AC_MSG_CHECKING(`5Bexistence of $1`5D)
X        AC_TRY_LINK(`5B
X#undef $1
Xextern long $1;
X`5D,
X            `5B$1 = 2`5D,
X            `5Beval 'cf_cv_have_'$1'=yes'`5D,
X            `5Beval 'cf_cv_have_'$1'=no'`5D)
X        eval 'cf_result=$cf_cv_have_'$1
X        AC_MSG_RESULT($cf_result)
Xelse
X    eval 'cf_cv_have_'$1'=yes'
Xfi
X`5D)
Xeval 'cf_result=HAVE_'$1
XCF_UPPER(cf_result,$\0B09)
Xeval 'test $cf_cv_have_'$1' = yes `26`26 AC_DEFINE_UNQUOTED($cf_result)'
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl SVr4 curses should have term.h as well (where it puts the definitions of
Xdnl the low-level interface).  This may not be true in old/broken implementati
Vons,
Xdnl as well as in misconfigured systems (e.g., gcc \1E0Bfor Solaris 2.4
Xdnl running with Solaris 2.5.1).
XAC_DEFUN(`5BCF_CURSES_TERM_H`5D,
X`5B
XAC_MSG_CHECKING(`5Bfor term.h`5D)
XAC_CACHE_VAL(cf_cv_have_term_h,`5B
X`09AC_TRY_COMPILE(`5B
X#include <curses.h>
X#include <term.h>`5D,
X`09`5BWINDOW *x`5D,
X`09`5Bcf_cv_have_term_h=yes`5D,
X`09`5Bcf_cv_have_term_h=no`5D)
X`09`5D)
XAC_MSG_RESULT($cf_cv_have_term_h)
Xtest $cf_cv_have_term_h = yes `26`26 AC_DEFINE(HAVE_TERM_H)
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Check if we should include <curses.h> to pick up prototypes for termcap
Xdnl functions.  On terminfo systems, these are normally declared in <curses.h>
V,
Xdnl but may be in <term.h>.  We check for termcap.h as an alternate, but it
Xdnl isn't standard (usually associated with GNU termcap).
Xdnl
Xdnl The 'tgoto()' function is declared in both terminfo and termcap.
Xdnl
Xdnl See CF_TYPE_OUTCHAR for more details.
XAC_DEFUN(`5BCF_CURSES_TERMCAP`5D,
X`5B
XAC_REQUIRE(`5BCF_CURSES_TERM_H`5D)
XAC_MSG_CHECKING(if we should include curses.h or termcap.h)
XAC_CACHE_VAL(cf_cv_need_curses_h,`5B
Xcf_save_CFLAGS="$\0906"
Xcf_cv_need_curses_h=no
X
Xfor cf_t_opts in "" "NEED_TERMCAP_H"
Xdo
Xfor cf_c_opts in "" "NEED_CURSES_H"
Xdo
X
X    CFLAGS="$cf_save_\1106 $CHECK_DECL_FLAG"
X    test -n "$cf_c_opts" `26`26 CFLAGS="$\0906 -D\210B
X    test -n "$cf_t_opts" `26`26 CFLAGS="$\0906 -D\210B
X
X    AC_TRY_LINK(`5B/* $cf_c_opts $cf_t\0B06*/
X$CHECK_DECL_HDRS`5D,
X`09`5Bchar *x = (\0B06)tgoto("")`5D,
X`09`5Btest "$cf_cv_need_curses_h" = no `26`26 `7B
X`09     cf_cv_need_curses_h=maybe
X`09     cf_ok_c_opts=$cf_\0B06
X`09     cf_ok_t_opts=$cf_\0B06
X`09`7D`5D,
X`09`5Becho "Recompiling with corrected call (C:$cf_c_opts, T:$cf_t_opts)" >`26
VAC_FD_CC
X`09AC_TRY_LINK(`5B
X$CHECK_DECL_HDRS`5D,
X`09`5Bchar *x = (\0B06)tgoto("",0,0)`5D,
X`09`5Bcf_cv_need_curses_h=yes
X`09 cf_ok_c_opts=$cf_\0B06
X`09 cf_ok_t_opts=$cf_\0B06`5D)`5D)
X
X`09CFLAGS="$cf_save_\1106"
X`09test "$cf_cv_need_curses_h" = yes `26`26 break
Xdone
X`09test "$cf_cv_need_curses_h" = yes `26`26 break
Xdone
X
Xif test "$cf_cv_need_curses_h" != no ; then
X`09echo "Curses/termcap test = $cf_cv_need_curses_h (C:$cf_ok_c_opts, T\1108t_
Vopts)" >`26AC_FD_CC
X`09if test -n "$cf_ok_c_opts" ; then
X`09`09if test -n "$cf_ok_t_opts" ; then
X`09`09`09cf_cv_need_curses_h=both
X`09`09else
X`09`09`09cf_cv_need_curses_h=\0906.h
X`09`09fi
X`09elif test -n "$cf_ok_t_opts" ; then
X`09`09cf_cv_need_curses_h=termcap.h
X`09elif test "$cf_cv_have_term_h" = yes ; then
X`09`09cf_cv_need_curses_h=term.h
X`09else
X`09`09cf_cv_need_curses_h=no
X`09fi
Xfi
X`5D)
XAC_MSG_RESULT($cf_cv_need_curses_h)
X
Xcase $cf_cv_need_curses_h in
Xboth) #(vi
X`09AC_DEFINE_UNQUOTED(NEED_CURSES_H)
X`09AC_DEFINE_UNQUOTED(NEED_TERMCAP_H)
X`09;;
Xcurses.h) #(vi
X`09AC_DEFINE_UNQUOTED(NEED_CURSES_H)
X`09;;
Xtermcap.h) #(vi
X`09AC_DEFINE_UNQUOTED(NEED_TERMCAP_H)
X`09;;
Xesac
X
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl You can always use "make -n" to see the actual options, but it's hard to
Xdnl pick out/analyze warning messages when the compile-line is long.
Xdnl
Xdnl Sets:
Xdnl`09ECHO_LD - symbol to prefix "cc -o" lines
Xdnl`09RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o)
Xdnl`09SHOW_CC - symbol to put before explicit "cc -c" lines
Xdnl`09ECHO_CC - symbol to put before any "cc" line
Xdnl
XAC_DEFUN(`5BCF_DISABLE_ECHO`5D,`5B
XAC_MSG_CHECKING(if you want to see long compiling messages)
XCF_ARG_DISABLE(echo,
X`09`5B  --disable-echo          test: display "compiling" commands`5D,
X`09`5B
X    ECHO_LD='@echo linking `5B$`5D@;'
X    RULE_CC='`09@echo compiling `5B$`5D<'
X    SHOW_CC='`09@echo compiling `5B$`5D@'
X    ECHO_CC='@'
X`5D,`5B
X    ECHO_LD=''
X    RULE_CC='# compiling'
X    SHOW_CC='# compiling'
X    ECHO_CC=''
X`5D)
XAC_MSG_RESULT($enableval)
XAC_SUBST(ECHO_LD)
XAC_SUBST(RULE_CC)
XAC_SUBST(SHOW_CC)
XAC_SUBST(ECHO_CC)
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Check if 'errno' is declared in <errno.h>
XAC_DEFUN(`5BCF_ERRNO`5D,
X`5B
XCF_CHECK_ERRNO(errno)
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Look for a non-standard library, given parameters for AC_TRY_LINK.  We
Xdnl prefer a standard location, and use -L options only if we do not find the
V
Xdnl library in the standard\1809location(s).
Xdnl`09$1 = library name
Xdnl`09$2 = includes
Xdnl`09$3 = code fragment to compile/link
Xdnl`09$4 = corresponding function-name
Xdnl
Xdnl Sets the variable "$cf_libdir" as a side-effect, so we can see if we had
Xdnl to use a -L option.
XAC_DEFUN(`5BCF_FIND_LIBRARY`5D,
X`5B
X`09cf_cv_have_lib_$1=no
X`09cf_libdir=""
X`09AC_CHECK_FUNC($4,cf_cv_have_lib_$1=yes,`5B
X`09`09cf_save_LIBS="$LIBS"
X`09`09AC_MSG_CHECKING(for $4 in -l$1)
X`09`09LIBS="-l$1 $LIBS"
X`09`09AC_TRY_LINK(`5B$2`5D,`5B$3`5D,
X`09`09`09`5BAC_MSG_RESULT(yes)
X`09`09`09 cf_cv_have_lib_$1=yes
X`09`09`09`5D,
X`09`09`09`5BAC_MSG_RESULT(no)
X`09`09`09CF_LIBRARY_PATH(cf_search,$1)
X`09`09`09for cf_libdir in $cf_search
X`09`09`09do
X`09`09&0209AC_MSG_CHECKING(for -l$1 in $cf_libdir)
X`09`09&0209LIBS="-L$cf_libdir -l$1 $cf_save_LIBS"
X`09`09&0209AC_TRY_LINK(`5B$2`5D,`5B$3`5D,
X`09`09&0209`09`5BAC_MSG_RESULT(yes)
X`09`09`09 &0209 cf_cv_have_lib_$1=yes
X`09`09&0209`09 break`5D,
X`09`09&0209`09`5BAC_MSG_RESULT(no)
X`09`09&0209`09 LIBS="$cf_save_LIBS"`5D)
X`09`09`09done
X`09`09`09`5D)
X`09`09`5D)
Xif test $cf_cv_have_lib_$1 = no ; then
X`09AC_ERROR(Cannot link $1 library)
Xfi
Xcase $host_os in #(vi
Xlinux*) # Suse Linux does not follow /usr/lib convention
X`09$1="`5B$`5D$1 /lib"
X`09;;
Xesac
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Test for the common variations of stdio structures that we can use to
Xdnl test if a character is available for reading.
XAC_DEFUN(`5BCF_FP_ISREADY`5D,
X`5B
XAC_CACHE_CHECK(for file-pointer ready definition,
Xcf_cv_fp_isready,`5B
Xcf_cv_fp_isready=none
Xwhile true
Xdo
X`09read definition
X`09test -z "$definition" `26`26 break
X`09echo "test-compile $definition" 1>`26AC_FD_CC
X
X`09AC_TRY_COMPILE(`5B
X#include <stdio.h>
X#define isready_c(p) $definition
X`5D,`5Bint x = isready_c(stdin)`5D,
X`09`5Becho "$definition" >conftest.env
X`09 break`5D)
X
Xdone <<'CF_EOF'
X( (p)->_IO_read_ptr <\140Fend)
X( (p)->__cnt > 0)
X( (p)->__rptr <\0E09end)
X( (p)->_cnt > 0)
X( (p)->_gptr <\0D07egptr)
X( (p)->_r > 0)
X( (p)->_rcount > 0)
X( (p)->endr <\0C09b)
XCF_EOF
X
Xtest -f conftest.env `26`26 cf_cv_fp_isready=`60cat \260C`60
X
X`5D)
X
Xtest "$cf_cv_fp_isready" != none `26`26 AC_DEFINE_UNQUOTED(\2707_c(p),\3E11)
X
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Test for availability of useful gcc __attribute__ directives to quiet
Xdnl compiler warnings.  Though useful, not all are supported -- and contrary
Xdnl to documentation, unrecognized directives cause older compilers to barf.
XAC_DEFUN(`5BCF_GCC_ATTRIBUTES`5D,
X`5B
Xif test -n "$GCC"
Xthen
Xcat > conftest.i <<EOF
X#ifndef GCC_PRINTF
X#define GCC_PRINTF 0
X#endif
X#ifndef GCC_SCANF
X#define GCC_SCANF 0
X#endif
X#ifndef GCC_NORETURN
X#define GCC_NORETURN /* nothing */
X#endif
X#ifndef GCC_UNUSED
X#define GCC_UNUSED /* nothing */
X#endif
XEOF
Xif test -n "$GCC"
Xthen
X`09AC_CHECKING(`5Bfor gcc __attribute__ directives`5D)
X`09changequote(,)dnl
Xcat > conftest.$ac_ext <<EOF
X#line __oline__ "configure"
X#include "confdefs.h"
X#include "conftest.h"
X#include "conftest.i"
X#if`09GCC_PRINTF
X#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,\2608))
X#else
X#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
X#endif
X#if`09GCC_SCANF
X#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,\2608))
X#else
X#define GCC_SCANFLIKE(fmt,var)  /*nothing*/
X#endif
Xextern void wow(char *,...) GCC_SCANFLIKE(1,2);
Xextern void oops(char *,...) GCC_PRINTFLIKE(1,2\1406NORETURN;
Xextern void foo(void) GCC_NORETURN;
Xint main(int argc GCC_UNUSED, char *argv`5B`5D\190B) `7B return 0; `7D
XEOF
X`09changequote(`5B,`5D)dnl
X`09for cf_attribute in scanf printf unused noreturn
X`09do
X`09`09CF_UPPER(CF_ATTRIBUTE,$cf_attribute)
X`09`09cf_directive="__attribute__(($cf_\1109))"
X`09`09echo "checking for gcc $cf_directive" 1>`26AC_FD_CC
X`09`09case $cf_attribute in
X`09`09scanf`7Cprintf)
X`09`09cat >conftest.h <<EOF
X#define GCC_$CF_ATTRIBUTE 1
XEOF
X`09`09`09;;
X`09`09*)
X`09`09cat >conftest.h <<EOF
X#define GCC_$CF_ATTRIBUTE $cf_directive
XEOF
X`09`09`09;;
X`09`09esac
X`09`09if AC_TRY_EVAL(ac_compile); then
X`09`09`09test -n "$verbose" `26`26 AC_MSG_RESULT(... $cf_attribute)
X`09`09`09cat conftest.h >>confdefs.h
X#`09`09else
X#`09`09`09sed -e 's/__attr.*/`5C/*nothing*`5C//' conftest.h >>confdefs.h
X`09`09fi
X`09done
Xelse
X`09fgrep define conftest.i >>confdefs.h
Xfi
Xrm -rf conftest*
Xfi
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Check if the compiler supports useful warning options.  There's a few that
V
Xdnl we don't use, simply because they're too noisy:
Xdnl
Xdnl`09-Wconversion (useful in older \1907s of gcc, but not in gcc 2.7.x)
Xdnl`09-Wredundant-decls (system headers make this too noisy)
Xdnl`09-Wtraditional (combines too many unrelated messages, only a few useful)
V
Xdnl`09-Wwrite-strings (too noisy, but should review occasionally)
Xdnl`09-pedantic
Xdnl
XAC_DEFUN(`5BCF_GCC_WARNINGS`5D,
X`5B
Xif test -n "$GCC"
Xthen
X`09changequote(,)dnl
X`09cat > conftest.$ac_ext <<EOF
X#line __oline__ "configure"
Xint main(int argc, char *argv`5B`5D) `7B return argv`5Bargc-1`5D == 0; `7D
XEOF
X`09changequote(`5B,`5D)dnl
X`09AC_CHECKING(`5Bfor gcc warning options`5D)
X`09cf_save_CFLAGS="$\0906"
X`09EXTRA_CFLAGS="-W -Wall"
X`09cf_warn_CONST=""
X`09test "$with_ext_const" = yes `26`26 cf_warn_CONST="Wwrite-strings"
X`09for cf_opt in `5C
X`09`09Wbad-function-cast `5C
X`09`09Wcast-align `5C
X`09`09Wcast-qual `5C
X`09`09Winline `5C
X`09`09Wmissing-declarations `5C
X`09`09Wmissing-prototypes `5C
X`09`09Wnested-externs `5C
X`09`09Wpointer-arith `5C
X`09`09Wshadow `5C
X`09`09Wstrict-prototypes $cf_warn_CONST
X`09do
X`09`09CFLAGS="$cf_save_\1106 $EXTRA\0E08-$cf_opt"
X`09`09if AC_TRY_EVAL(ac_compile); then
X`09`09`09test -n "$verbose" `26`26 AC_MSG_RESULT(... -$cf_opt)
X`09`09`09EXTRA_CFLAGS="$\0F0C -$cf_opt"
X`09`09`09test "$cf_opt" = Wcast-qual `26`26 EXTRA_CFLAGS="$\0F0C -DXTSTRINGDEF
VINES"
X`09`09fi
X`09done
X`09rm -f conftest*
X`09CFLAGS="$cf_save_\1106"
Xfi
XAC_SUBST(EXTRA_CFLAGS)
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Construct a search-list for a nonstandard header-file
XAC_DEFUN(`5BCF_HEADER_PATH`5D,
X`5B$1=""
Xif test -d "$includedir"  ; then
Xtest "$includedir" != NONE       `26`26 $1="`5B$`5D$1 $\280A\0C0C/$2"
Xfi
Xif test -d "$oldincludedir"  ; then
Xtest "$oldincludedir" != NONE    `26`26 $1="`5B$`5D$1 $\280D\0F0F/$2"
Xfi
Xif test -d "$prefix"; then
Xtest "$prefix" != NONE           `26`26 $1="`5B$`5D$1 $\2806/include\1010/$2"
V
Xfi
Xtest "$prefix" != /usr/local     `26`26 $1="`5B$`5D$1\1C0B/include\1313/$2"
Xtest "$prefix" != /usr           `26`26 $1="`5B$`5D$1 /usr/include\0D0D/$2"
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Use imake to obtain compiler flags.  We could, in principle, write tests t
Vo
Xdnl get these, but if imake is properly configured there is no point in doing
V
Xdnl this.
XAC_DEFUN(`5BCF_IMAKE_CFLAGS`5D,
X`5B
XAC_PATH_PROGS(IMAKE,xmkmf imake)
Xcase $IMAKE in # (vi
X*/imake)
X`09cf_imake_opts="-DUseInstalled=YES" # (vi
X`09;;
X*)
X`09cf_imake_opts=
X`09;;
Xesac
X
X# If it's installed properly, imake (or its wrapper, xmkmf) will point to the
V
X# config directory.
Xif mkdir conftestdir; then
X`09cd conftestdir
X`09echo >./Imakefile
X`09test -f ../Imakefile `26`26 cat \140D>>\220B
X`09cat >> ./Imakefile <<'CF_EOF'
Xfindstddefs:
X`09@echo 'IMAKE_CFLAGS="$`7BALLDEFINES`7D ifelse($1,,,$1)"'
X`09@echo 'IMAKE_LOADFLAGS="$`7BEXTRA\130A`7D ifelse($2,,,$2)"'
XCF_EOF
X`09if ( $IMAKE $cf_imake_opts 1>/dev/null 2>`26AC_FD_CC `26`26 test -f Makefil
Ve)
X`09then
X`09`09CF_VERBOSE(Using $IMAKE)
X`09else
X`09`09# sometimes imake doesn't have the config path compiled in.  Find it.
X`09`09cf_config=
X`09`09for cf_libpath in $X_LIBS $LIBS ; do
X`09`09`09case $cf_libpath in # (vi
X`09`09`09-L*)
X`09`09&0209cf_libpath=`60echo .$\130A `7C sed -e 's/`5E...//'`60
X`09`09&0209cf_libpath=$\0C0A/X11/config
+-+-+-+-+-+-+-+-  END  OF PART 1 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 2 -+-+-+-+-+-+-+-+
X`09`09&0209if test -d $cf_libpath ; then
X`09`09&0209`09cf_config=$cf_libpath
X`09`09&0209`09break
X`09`09&0209fi
X`09`09&0209;;
X`09`09`09esac
X`09`09done
X`09`09if test -z "$cf_config" ; then
X`09`09`09AC_WARN(Could not find imake config-directory)
X`09`09else
X`09`09`09cf_imake_opts="$\100D -I$cf_config"
X`09`09`09if ( $IMAKE -v $cf_imake_opts 2>`26AC_FD_CC)
X`09`09`09then
X`09`09&0209CF_VERBOSE(Using $IMAKE $cf_config)
X`09`09`09else
X`09`09&0209AC_WARN(Cannot run $IMAKE)
X`09`09`09fi
X`09`09fi
X`09fi
X
X`09# GNU make sometimes prints "make`5B1`5D: Entering...", which
X`09# would confuse us.
X`09eval `60make findstddefs 2>/dev/null `7C grep -v make`60
X
X`09cd ..
X`09rm -rf conftestdir
X
X`09# We use $(ALLDEFINES) rather than $(STD_\1B09because the former
X`09# declares XTFUNCPROTO there.  However, some vendors (e.g., SGI) have
X`09# modified it to support site.cf, adding a kludge for the /usr/include
X`09# directory.  Try to filter that out, otherwise gcc won't find its
X`09# headers.
X`09if test -n "$GCC" ; then
X`09    if test -n "$IMAKE_CFLAGS" ; then
X`09`09cf_nostdinc=""
X`09`09cf_std_incl=""
X`09`09cf_cpp_opts=""
X`09`09for cf_opt in $IMAKE_CFLAGS
X`09`09do
X`09`09    case "$cf_opt" in
X`09`09    -nostdinc) #(vi
X`09`09`09cf_nostdinc="$cf_opt"
X`09`09`09;;
X`09`09    -I/usr/include) #(vi
X`09`09`09cf_std_incl="$cf_opt"
X`09`09`09;;
X`09`09    *) #(vi
X`09`09`09cf_cpp_opts="$\0E0B $cf_opt"
X`09`09`09;;
X`09`09    esac
X`09`09done
X`09`09if test -z "$cf_nostdinc" ; then
X`09`09    IMAKE_CFLAGS="$cf_cpp_opts $cf_std_incl"
X`09`09elif test -z "$cf_std_incl" ; then
X`09`09    IMAKE_CFLAGS="$cf_cpp_opts $cf_nostdinc"
X`09`09else
X`09`09    CF_VERBOSE(suppressed `5C"$cf_nostdinc`5C" an\1508std_incl`5C")
X`09`09    IMAKE_CFLAGS="$cf_cpp_opts"
X`09`09fi
X`09    fi
X`09fi
Xfi
XAC_SUBST(IMAKE_CFLAGS)
XAC_SUBST(IMAKE_LOADFLAGS)
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Note: must follow AC_FUNC_SETPGRP, but cannot use AC_REQUIRE, since that
Xdnl messes up the messages...
XAC_DEFUN(`5BCF_KILLPG`5D,
X`5B
XAC_MSG_CHECKING(`5Bif killpg is needed`5D)
XAC_CACHE_VAL(cf_cv_need_killpg,`5B
XAC_TRY_RUN(`5B
X#include <sys/types.h>
X#include <signal.h>
XRETSIGTYPE
Xhandler(s)
X    int s;
X`7B
X    exit(0);
X`7D
X
Xmain()
X`7B
X#ifdef SETPGRP_VOID
X    (void) setpgrp();
X#else
X    (void) setpgrp(0,0);
X#endif
X    (void) signal(SIGINT, handler);
X    (void) kill(-getpid(), SIGINT);
X    exit(1);
X`7D`5D,
X`09`5Bcf_cv_need_killpg=no`5D,
X`09`5Bcf_cv_need_killpg=yes`5D,
X`09`5Bcf_cv_need_killpg=unknown`5D
X)`5D)
XAC_MSG_RESULT($cf_cv_need_killpg)
Xtest $cf_cv_need_killpg = yes `26`26 AC_DEFINE(HAVE_KILLPG)
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Construct a search-list for a nonstandard library-file
XAC_DEFUN(`5BCF_LIBRARY_PATH`5D,
X`5B$1=""
Xif test -d "$libdir"  ; then
Xtest "$libdir" != NONE           `26`26 $1="`5B$`5D$1 $\2806\0808/$2"
Xfi
Xif test -d "$exec_prefix"; then
Xtest "$exec_prefix" != NONE      `26`26 $1="`5B$`5D$1 $\280B/lib\1111/$2"
Xfi
Xif test -d "$prefix"; then
Xtest "$prefix" != NONE           `26`26 `5C
Xtest "$prefix" != "$exec_\1208`26`26 $1="`5B$`5D$1 $\2806/lib\0C0C/$2"
Xfi
Xtest "$prefix" != /usr/local     `26`26 $1="`5B$`5D$1\1C0B/lib\0F0F/$2"
Xtest "$prefix" != /usr           `26`26 $1="`5B$`5D$1 /usr/lib\0909/$2"
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl
XAC_DEFUN(`5BCF_MISSING_CHECK`5D,
X`5B
XAC_MSG_CHECKING(`5Bfor missing "$1" extern`5D)
XAC_CACHE_VAL(`5Bcf_cv_func_$1`5D,`5B
Xcf_save_CFLAGS="$\0906"
XCFLAGS="$\0906 $CHECK_DECL_FLAG"
XAC_TRY_LINK(`5B
X$CHECK_DECL_HDRS
X
X#undef $1
Xstruct zowie `7B int a; double b; \200D*c; char d; `7D;
Xextern struct zowie *$1();
X`5D,
X`5B
X#if HAVE_LIBXT`09`09/* needed for SunOS 4.0.3 or 4.1 */
XXtToolkitInitialize();
X#endif
X`5D,
X`5Beval 'cf_cv_func_'$1'=yes'`5D,
X`5Beval 'cf_cv_func_'$1'=no'`5D)
XCFLAGS="$cf_save_\1106"
X`5D)
Xeval 'cf_result=$cf_cv_func_'$1
XAC_MSG_RESULT($cf_result)
Xtest $cf_result = yes `26`26 AC_DEFINE_UNQUOTED(MISSING_EXTERN_$2)
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl
XAC_DEFUN(`5BCF_MISSING_EXTERN`5D,
X`5Bfor ac_func in $1
Xdo
XCF_UPPER(ac_tr_func,$ac_func)
XCF_MISSING_CHECK($`7Bac_func`7D, $`7Bac_tr\0F06)dnl
Xdone
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Look for the SVr4 curses clone 'n\0F06' in the standard places, adjusting
V
Xdnl the CPPFLAGS variable.
Xdnl
Xdnl The header files may be installed as either curses.h, or n\0E08
Xdnl (obsolete).  If not installed for overwrite, the curses.h file would be
Xdnl in an ncurses subdirectory (e.g., /usr/include/\2907), but someone may
Xdnl have installed overwriting the vendor's curses.  Only very old versions
Xdnl (pre-1.9.2d, the first autoconf'd version) of ncurses don't define
Xdnl either __NCURSES_H or \0D08VERSION in the header.
Xdnl
Xdnl If the installer has set $CFLAGS or $CPP\0D06so that the ncurses header
Xdnl is already in the include-path, don't even bother with this, since we cann
Vot
Xdnl easily determine which file it is.  In this case, it has to be <curses.h>.
V
Xdnl
XAC_DEFUN(`5BCF_NCURSES_CPPFLAGS`5D,
X`5B
XAC_MSG_CHECKING(for ncurses header file)
XAC_CACHE_VAL(cf_cv_ncurses_header,`5B
X`09AC_TRY_COMPILE(`5B#include <curses.h>`5D,`5B
X#ifdef NCURSES_VERSION
Xprintf("%s`5Cn", NCURSES_VERSION);
X#else
X#ifdef __NCURSES_H
Xprintf("old`5Cn");
X#else
Xmake an error
X#endif
X#endif
X`09`5D,
X`09`5Bcf_cv_ncurses_header=predefined`5D,`5B
X`09CF_HEADER_PATH(cf_search,ncurses)
X`09test -n "$verbose" `26`26 echo
X`09for cf_incdir in $cf_search
X`09do
X`09`09for cf_header in `5C
X`09`09`09curses.h `5C
X`09`09`09ncurses.h
X`09`09do
Xchangequote(,)dnl
X`09`09`09if egrep "NCURSES_`5BVH`5D" $cf_incdir/$cf_header 1>`26AC_FD_CC 2>`26
V1; then
Xchangequote(`5B,`5D)dnl
X`09`09&0209cf_cv_ncurses_header=$cf_incdir/$cf_\1606
X`09`09&0209test -n "$verbose" `26`26 echo $ac_n "`09... found $ac_c" 1>`26AC_F
VD_MSG
X`09`09&0209break
X`09`09`09fi
X`09`09`09test -n "$verbose" `26`26 echo "`09... tested $cf_incdir/$cf_header"
V 1>`26AC_FD_MSG
X`09`09done
X`09`09test -n "$cf_cv_ncurses_header" `26`26 break
X`09done
X`09test -z "$cf_cv_ncurses_header" `26`26 AC_ERROR(not found)
X`09`5D)`5D)
XAC_MSG_RESULT($cf_cv_ncurses_header)
XAC_DEFINE(NCURSES)
X
Xchangequote(,)dnl
Xcf_incdir=`60echo $cf_cv_ncurses_header `7C sed -e 's:/`5B`5E/`5D*$::'`60
Xchangequote(`5B,`5D)dnl
X
Xcase $cf_cv_ncurses_header in # (vi
X*/ncurses.h)
X`09AC_DEFINE(HAVE_NCURSES_H)
X`09;;
Xesac
X
Xcase $cf_cv_ncurses_header in # (vi
Xpredefined) # (vi
X`09cf_cv_ncurses_header=\0E06.h
X`09;;
X*)
X`09CF_ADD_INCDIR($cf_incdir)
X`09;;
Xesac
XCF_NCURSES_VERSION
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Look for the ncurses library.  This is a little complicated on Linux,
Xdnl because it may be linked with the gpm (general purpose mouse) library.
Xdnl Some distributions have gpm linked with (bsd) curses, which makes it
Xdnl unusable with ncurses.  However, we don't want to link\2E06gpm unless
Xdnl ncurses has a dependency, since gpm is normally set up as a shared library
V,
Xdnl and the linker will record a dependency.
XAC_DEFUN(`5BCF_NCURSES_LIBS`5D,
X`5BAC_REQUIRE(`5BCF_NCURSES_CPPFLAGS`5D)
X
X`09# This works, except for the special case where we find gpm, but
X`09# ncurses is in a nonstandard location via $LIBS, and we really want
X`09# to link gpm.
Xcf_ncurses_LIBS=""
Xcf_ncurses_SAVE="$LIBS"
XAC_CHECK_LIB(gpm,Gpm_Open,
X`09`5BAC_CHECK_LIB(gpm,initscr,
X`09`09`5BLIBS="$cf_ncurses_SAVE"`5D,
X`09`09`5Bcf_ncurses_LIBS="-lgpm"`5D)`5D)
X
Xcase $host_os in #(vi
Xfreebsd*)
X`09# This is only necessary if you are linking against an obsolete
X`09# version of ncurses (but it should do no harm, since it's static).
X`09AC_CHECK_LIB(mytinfo,tgoto,`5Bcf_ncurses_LIBS="-l\2207 $\1C0F"`5D)
X`09;;
Xesac
X
XLIBS="$cf_ncurses_LIBS $LIBS"
XCF_FIND_LIBRARY(ncurses,
X`09`5B#include <$`7Bcf_cv_ncurses_header-\0E06.h`7D>`5D,
X`09`5Binitscr()`5D,
X`09initscr)
X
Xif test -n "$cf_ncurses_LIBS" ; then
X`09AC_MSG_CHECKING(if we can link ncurses without $cf_\1407_LIBS)
X`09cf_ncurses_SAVE="$LIBS"
X`09for p in $cf_ncurses_LIBS ; do
X`09`09q=`60echo $LIBS `7C sed -e 's/'$p' //'\0F0B$//'`60
X`09`09if test "$q" != "$LIBS" ; then
X`09`09`09LIBS="$q"
X`09`09fi
X`09done
X`09AC_TRY_LINK(`5B#include <$`7Bcf_cv_ncurses_header-\0E06.h`7D>`5D,
X`09`09`5Binitscr(); mousemask(0,0); tgoto((char *)0, 0, 0);`5D,
X`09`09`5BAC_MSG_RESULT(yes)`5D,
X`09`09`5BAC_MSG_RESULT(no)
X`09`09 LIBS="$cf_ncurses_SAVE"`5D)
Xfi
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Check for the version of ncurses, to aid in reporting bugs, etc.
XAC_DEFUN(`5BCF_NCURSES_VERSION`5D,
X`5BAC_MSG_CHECKING(for ncurses version)
XAC_CACHE_VAL(cf_cv_ncurses_version,`5B
X`09cf_cv_ncurses_version=no
X`09cf_tempfile=out$$
X`09AC_TRY_RUN(`5B
X#include <$`7Bcf_cv_ncurses_header-\0E06.h`7D>
Xint main()
X`7B
X`09FILE *fp = fopen("$cf_tempfile", "w");
X#ifdef NCURSES_VERSION
X# ifdef NCURSES_VERSION_PATCH
X`09fprintf(fp, "%s.%d`5Cn", NCURSES_VERSION\1111_PATCH);
X# else
X`09fprintf(fp, "%s`5Cn", NCURSES_VERSION);
X# endif
X#else
X# ifdef __NCURSES_H
X`09fprintf(fp, "old`5Cn");
X# else
X`09make an error
X# endif
X#endif
X`09exit(0);
X`7D`5D,`5B
X`09cf_cv_ncurses_version=`60cat $cf_tempfile`60
X`09rm -f $cf_tempfile`5D,,`5B
X
X`09# This will not work if the preprocessor splits the line after the
X`09# Autoconf token.  The 'unproto' program does that.
X`09cat > conftest.$ac_ext <<EOF
X#include <$`7Bcf_cv_ncurses_header-\0E06.h`7D>
X#undef Autoconf
X#ifdef NCURSES_VERSION
XAutoconf NCURSES_VERSION
X#else
X#ifdef __NCURSES_H
XAutoconf "old"
X#endif
X;
X#endif
XEOF
X`09cf_try="$ac_cpp conftest.$ac_ext 2>`26AC_FD_CC `7C grep '`5EAutoconf ' >
V\3209out"
X`09AC_TRY_EVAL(cf_try)
X`09if test -f conftest.out ; then
Xchangequote(,)dnl
X`09`09cf_out=`60cat conftest.out `7C sed -e 's@`5EAutoconf @@'\1408`5B`5E"`5D*
V"\110A".*@@'`60
Xchangequote(`5B,`5D)dnl
X`09`09test -n "$cf_out" `26`26 cf_cv_ncurses_version=\2309
X`09`09rm -f conftest.out
X`09fi
X`5D)`5D)
XAC_MSG_RESULT($cf_cv_ncurses_version)
X`5D)
Xdnl --------\0808\1010\2020\400B
Xdnl Within AC_OUTPUT, check if the given file differs from the target, and
Xdnl update it if so.  Otherwise, remove the generated file.
Xdnl
Xdnl Parameters:
Xdnl $1 = input, which configure has done substitutions upon
Xdnl $2 = target file
Xdnl
XAC_DEFUN(`5BCF_OUTPUT_IF_CHANGED`5D,`5B
Xif ( cmp -s $1 $2 2>/dev/null )
Xthen
X`09echo "$2 is unchanged"
X`09rm -f $1
Xelse
X`09echo "creating $2"
X`09rm -f $2
X`09mv $1 $2
Xfi
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX.
XAC_DEFUN(`5BCF_PROG_EXT`5D,
X`5B
XAC_REQUIRE(`5BCF_CHECK_CACHE`5D)
XPROG_EXT=
Xcase $cf_cv_system_name in
Xos2*)
X    # We make sure -Zexe is not used -- it would interfere with @PROG_EXT@
X    CFLAGS="$\0906 -Zmt -D__ST_MT_ERRNO__"
X    LDFLAGS=`60echo "$\1007 -Zmt -Zcrtdll" `7C sed "s/-Zexe//g"`60
X    PROG_EXT=".exe"
X    ;;
Xesac
XAC_SUBST(PROG_EXT)
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl CF_RESTARTABLE_PIPEREAD is a modified version of AC\310DSYSCALLS
Xdnl from acspecific.m4, which uses a read on a pipe (surprise!) rather than a
V
Xdnl wait() as the test code.  apparently there is a POSIX change, which OSF/1
V
Xdnl at least has adapted to, which says reads (or writes) on pipes for which n
Vo
Xdnl data has been transferred are interruptable _regardless_ of the SA_RESTART
V
Xdnl bit.  yuck.
XAC_DEFUN(`5BCF_RESTARTABLE_PIPEREAD`5D,
X`5B
XAC_MSG_CHECKING(for restartable reads on pipes)
XAC_CACHE_VAL(cf_cv_can_restart_read,`5B
XAC_TRY_RUN(
X`5B/* Exit 0 (true) if wait returns something other than -1,
X   i.e. the pid of the child, which means that wait was restarted
X   after getting the signal.  */
X#include <sys/types.h>
X#include <signal.h>
X#ifdef SA_RESTART
Xsigwrapper(sig, disp)
Xint sig;
Xvoid (*disp)();
X`7B
X    struct sigaction act, oact;
X
X    act.sa_handler = disp;
X    sigemptyset(`26act.sa_mask);
X    act.sa_flags = SA_RESTART;
X
X    (void)sigaction(sig, `26act, `26oact);
X
X`7D
X#else
X# define sigwrapper signal
X#endif
Xucatch (isig) `7B `7D
Xmain () `7B
X  int i, status;
X  int fd`5B2`5D;
X  char buff`5B2`5D;
X  pipe(fd);
X  i = fork();
X  if (i == 0) `7B
X      sleep (2);
X      kill (getppid (), SIGINT);
X      sleep (2);
X      write(fd`5B1`5D,"done",4);
X      close(fd`5B1`5D);
X      exit (0);
X  `7D
X  sigwrapper (SIGINT, ucatch);
X  status = read(fd`5B0`5D, buff, sizeof(buff));
X  wait (`26i);
X  exit (status == -1);
X`7D
X`5D,
X`5Bcf_cv_can_restart_read=yes`5D,
X`5Bcf_cv_can_restart_read=no`5D,
X`5Bcf_cv_can_restart_read=unknown`5D)`5D)
XAC_MSG_RESULT($cf_cv_can_restart_read)
Xtest $cf_cv_can_restart_read = yes `26`26 AC_DEFINE(HAVE_RESTARTABLE_PIPEREAD)
V
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Check for definitions `26 structures needed for window size-changing
Xdnl FIXME: check that this works with "snake" (HP-UX 10.x)
XAC_DEFUN(`5BCF_SIZECHANGE`5D,
X`5B
XAC_MSG_CHECKING(`5Bdeclaration of size-change`5D)
XAC_CACHE_VAL(cf_cv_sizechange,`5B
X    cf_cv_sizechange=unknown
X    cf_save_CFLAGS="$\0906"
X
Xfor cf_opts in "" "NEED_PTEM_H"
Xdo
X
X    CFLAGS="$cf_save_\1106"
X    test -n "$cf_opts" `26`26 CFLAGS="$\0906 -D\1F09
X    AC_TRY_COMPILE(`5B#include <sys/types.h>
X#if HAVE_TERMIOS_H
X#include <termios.h>
X#else
X#if HAVE_TERMIO_H
X#include <termio.h>
X#endif
X#endif
X#if NEED_PTEM_H
X/* This is a workaround for SCO:  they neglected to define struct winsize in
X * termios.h -- it's only in\1A07.h and ptem.h
X */
X#include        <sys/stream.h>
X#include        <sys/ptem.h>
X#endif
X#if !defined(sun) `7C`7C\110AHAVE_TERMIOS_H)
X#include <sys/ioctl.h>
X#endif
X`5D,`5B
X#ifdef TIOCGSIZE
X`09struct ttysize win;`09/* FIXME: what system is this? */
X`09int y = win.ts_lines;
X`09int x = win.ts_cols;
X#else
X#ifdef TIOCGWINSZ
X`09struct winsize win;
X`09int y = win.ws_row;
X`09int x = win.ws_col;
X#else
X`09no TIOCGSIZE or\0D06WINSZ
X#endif /* TIOCGWINSZ */
X#endif /* TIOCGSIZE */
X`09`5D,
X`09`5Bcf_cv_sizechange=yes`5D,
X`09`5Bcf_cv_sizechange=no`5D)
X
X`09CFLAGS="$cf_save_\1106"
X`09if test "$cf_cv_sizechange" = yes ; then
X`09`09echo "size-change succeeded ($cf_opts)" >`26AC_FD_CC
X`09`09test -n "$cf_opts" `26`26 AC_DEFINE_UNQUOTED(\2008)
X`09`09break
X`09fi
Xdone
X`09`5D)
XAC_MSG_RESULT($cf_cv_sizechange)
Xtest $cf_cv_sizechange != no `26`26 AC_DEFINE(HAVE_SIZECHANGE)
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Check for declaration of sys_nerr and sys_errlist in one of stdio.h and
Xdnl errno.h.  Declaration of sys_errlist on BSD4.4 interferes with our
Xdnl declaration.  Reported by Keith Bostic.
XAC_DEFUN(`5BCF_SYS_ERRLIST`5D,
X`5B
Xfor cf_name in sys_nerr sys_errlist
Xdo
X    CF_CHECK_ERRNO($cf_name)
Xdone
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Check for return and param type of 3rd -- OutChar() -- \2206of tputs().
Xdnl
Xdnl For this check, and for CF_CURSES_TERMCAP, the $CHECK_DECL_HDRS variable
Xdnl must point to a header file containing this (or equivalent):
Xdnl
Xdnl`09#ifdef NEED_CURSES_H
Xdnl`09# if HAVE_NCURSES_H
Xdnl`09#  include <ncurses.h>
Xdnl`09# else
Xdnl`09#  include <curses.h>
Xdnl`09# endif
Xdnl`09#endif
Xdnl`09#if HAVE_TERM_H
Xdnl`09# include <term.h>
Xdnl`09#endif
Xdnl`09#if NEED_TERMCAP_H
Xdnl`09# include <termcap.h>
Xdnl`09#endif
Xdnl
XAC_DEFUN(`5BCF_TYPE_OUTCHAR`5D,
X`5B
XAC_REQUIRE(`5BCF_CURSES_TERMCAP`5D)
X
XAC_MSG_CHECKING(`5Bdeclaration of tputs 3rd param`5D)
XAC_CACHE_VAL(cf_cv_type_outchar,`5B
X
Xcf_cv_type_outchar="int OutChar(int)"
Xcf_cv_found=no
Xcf_save_CFLAGS="$\0906"
XCFLAGS="$\0906 $CHECK_DECL_FLAG"
X
Xfor P in int void; do
Xfor Q in int void; do
Xfor R in int char; do
Xfor S in "" const; do
X
X`09AC_TRY_COMPILE(`5B$CHECK_DECL_HDRS`5D,
X`09`5Bextern $Q OutChar($R);
X`09extern $P tputs ($S char *string, int nlines, $Q (*_f)($R));
X`09tputs("", 1, OutChar)`5D,
X`09`5Bcf_cv_type_outchar="$Q OutChar($R)"
X`09 cf_cv_found=yes
X`09 break`5D)
Xdone
X`09test $cf_cv_found = yes `26`26 break
Xdone
X`09test $cf_cv_found = yes `26`26 break
Xdone
X`09test $cf_cv_found = yes `26`26 break
Xdone
X`09`5D)
XAC_MSG_RESULT($cf_cv_type_outchar)
Xcase $cf_cv_type_outchar in
Xint*)
X`09AC_DEFINE(OUTC_RETURN)
X`09;;
Xesac
Xcase $cf_cv_type_outchar in
X*char*)
X`09AC_DEFINE(OUTC_ARGS,char c)
X`09;;
Xesac
X
XCFLAGS="$cf_save_\1106"
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Make an uppercase version of a variable
Xdnl $1=uppercase($2)
XAC_DEFUN(`5BCF_UPPER`5D,
X`5B
Xchangequote(,)dnl
X$1=`60echo $2 `7C tr '`5Ba-z`5D' '`5BA-Z`5D'`60
Xchangequote(`5B,`5D)dnl
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Use AC_VERBOSE w/o the warnings
XAC_DEFUN(`5BCF_VERBOSE`5D,
X`5Btest -n "$verbose" `26`26 echo "`09$1" 1>`26AC_FD_MSG
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Check for Xaw (Athena) libraries
Xdnl
XAC_DEFUN(`5BCF_X_ATHENA`5D,
X`5BAC_REQUIRE(`5BCF_X_TOOLKIT`5D)
Xcf_x_athena=$`7B\0E0B-Xaw`7D
X
XAC_ARG_WITH(Xaw3d,
X`09`5B  --with-Xaw3d            link with Xaw 3d library`5D,
X`09`5Bcf_x_athena=Xaw3d`5D)
X
XAC_ARG_WITH(neXtaw,
X`09`5B  --with-neXtaw           link with neXT Athena library`5D,
X`09`5Bcf_x_athena=neXtaw`5D)
X
XAC_CHECK_HEADERS(X11/$cf_x_athena/SimpleMenu.h)
X
XAC_CHECK_LIB(Xmu, XmuClientWindow,,`5B
XAC_CHECK_LIB(Xmu_s, XmuClientWindow)`5D)
X
XAC_CHECK_LIB(Xext,XextCreateExtension,
X`09`5BLIBS="-lXext $LIBS"`5D)
X
XAC_CHECK_LIB($cf_x_athena, XawSimpleMenuAddGlobalActions,
X`09`5BLIBS="-l$cf_x_athena $LIBS"`5D,`5B
XAC_CHECK_LIB($`7Bcf_x_athena`7D_s, XawSimpleMenuAddGlobalActions,
X`09`5BLIBS="-l$`7Bcf_x_athena`7D_s $LIBS"`5D,
X`09AC_ERROR(
X`5BUnable to successfully link Athena library (-l$cf_x_athena) with test progr
Vam`5D),
X`09`5B$X_PRE_LIBS $\0606X_EXTRA_LIBS`5D)`5D)
XCF_UPPER(CF_X_ATHENA_LIBS,HAVE_LIB_$cf_x_athena)
XAC_DEFINE_UNQUOTED($CF_X_ATHENA_LIBS)
X`5D)dnl
Xdnl --------\0808\1010\2020\400B
Xdnl Check for X Toolkit libraries
Xdnl
XAC_DEFUN(`5BCF_X_TOOLKIT`5D,
X`5B
XAC_REQUIRE(`5BCF_CHECK_CACHE`5D)
X# We need to check for -lsocket and -lnsl here in order to work around an
X# autoconf bug. \0F09-2.12 is not checking for these prior to\1C0D
X# the X11R6 -lSM and -lICE libraries.  The resultant failures cascade...
X# `09(tested on Solaris 2.5 w/ X11R6)
XSYSTEM_NAME=`60echo "$cf_cv_system_name"`7Ctr ' ' -`60
Xcf_have_X_LIBS=no
Xcase $SYSTEM_NAME in
Xchangequote(,)dnl
Xirix`5B56`5D*) ;;
Xchangequote(`5B,`5D)dnl
Xclix*)
X`09# FIXME: modify the library lookup in autoconf to
X`09# allow _s.a suffix ahead of .a
X`09AC_CHECK_LIB(c_s,open,
X`09`09`5BLIBS="-lc_s $LIBS"
X`09AC_CHECK_LIB(bsd,gethostname,
X`09`09`5BLIBS="-lbsd $LIBS"
X`09AC_CHECK_LIB(nsl_s,gethostname,
X`09`09`5BLIBS="-lnsl_s $LIBS"
X`09AC_CHECK_LIB(X11_s,XOpenDisplay,
X`09`09`5BLIBS="-lX11_s $LIBS"
X`09AC_CHECK_LIB(Xt_s,XtAppInitialize,
X`09`09`5BLIBS="-lXt_s $LIBS"
X`09`09 cf_have_X_LIBS=Xt
X`09`09`5D) `5D) \0606`5D)
X`09;;
X*)
X`09AC_CHECK_LIB(socket,\0706)
X`09AC_CHECK_LIB(nsl,gethostname)
X`09;;
Xesac
X
Xif test $cf_have_X_LIBS = no ; then
X`09AC_PATH_XTRA
X`09LDFLAGS="$\0A07 $X_LIBS"
X`09CFLAGS="$\0906 $X_\1306"
X`09AC_CHECK_LIB(X11,XOpenDisplay,
X`09`09`5BLIBS="-lX11 $LIBS"`5D,,
X`09`09`5B$X_PRE_LIBS $\0606X_EXTRA_LIBS`5D)
X`09AC_CHECK_LIB(Xt, XtAppInitialize,
X`09`09`5BAC_DEFINE(HAVE_LIBXT)
X`09`09 cf_have_X_LIBS=Xt
X`09`09 LIBS="-lXt $X_PRE_LIBS $LIBS"`5D,,
X`09`09`5B$X_PRE_LIBS $\0606X_EXTRA_LIBS`5D)
Xelse
X`09LDFLAGS="$\0A07 $X_LIBS"
X`09CFLAGS="$\0906 $X_\1306"
Xfi
X
Xif test $cf_have_X_LIBS = no ; then
X`09AC_WARN(
X`5BUnable to successfully link X Toolkit library (-lXt) with
Xtest program.  You will have to check and add the proper libraries by hand
Xto makefile.`5D)
Xfi
X`5D)dnl
$ call unpack [.VILE-8_0]ACLOCAL.M4;1 -
 1198673424 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 79 1 152
$!
$ create 'f'
X/*
X * The routines in this file provide support for ANSI style terminals
X * over a serial line. The\1108I/O services are provided by routines in
X * "termio.c". It compiles into nothing if not an ANSI device.
X *
X *
X * $Header: /usr/build/vile/vile/RCS/ansi.c,v 1.33 1998/05/30 17:37:58 tom Exp
V $
X */
X
X
X#define termdef 1`09`09`09/* don't d\1C06"term" external */
X
X#include`09"estruct.h"
X#include`09"edef.h"
X
X#if`09DISP_ANSI
X
X#define SCROLL_REG 1
X
X
X#if`09SYS_MSDOS
X#define NROW    25
X#define NCOL    80
X#define MAXNROW`0960
X#define MAXNCOL`09132
X#undef SCROLL_REG`09`09`09/* ANSI.SYS can't do scrolling */
X#define SCROLL_REG 0
X#endif
X
X#if`09defined(linux)
X#define NROW`0925`09`09`09/* Screen size.&0309*/
X#define NCOL`0980`09`09`09/* Edit if you want to.&0209*/
X#endif
X
X#ifndef NROW
X#define NROW`0924`09`09`09/* Screen size.&0309*/
X#define NCOL`0980`09`09`09/* Edit if you want to.&0209*/
X#endif
X#ifndef MAXNROW
X#define MAXNROW`09NROW
X#define MAXNCOL`09NCOL
X#endif
X
X#define NPAUSE`09100`09`09`09/* # times thru update to pause */
X#define MARGIN`098`09`09`09/* size of minimim margin and`09*/
X#define SCRSIZ`0964`09`09`09/* scroll size for extended lines */
X
Xstatic`09void`09ansimove   (int row, int col);
Xstatic`09void`09ansieeol   (void);
Xstatic`09void`09ansieeop   (void);
Xstatic`09void`09ansibeep   (void);
Xstatic`09void`09ansiopen   (void);
Xstatic`09void`09ansirev    (UINT state);
Xstatic`09void`09ansiclose  (void);
Xstatic`09void`09ansikopen  (void);
Xstatic`09void`09ansikclose (void);
Xstatic`09int`09ansicres   (const char *flag);
Xstatic`09void`09ansiscroll (int from, int to\0806n);
X
X#if`09OPT_COLOR
Xstatic`09void`09ansifcol (int color);
Xstatic`09void`09ansibcol (int color);
X
Xstatic`09int`09cfcolor = -1;`09`09/* current forground color */
Xstatic`09int`09cbcolor = -1;`09`09/* current background color */
X
X#endif
X
X/*
X * Standard terminal interface dispatch table. Most of the fields point into
X * "termio" code.
X */
XTERM`09term`09= `7B
X`09MAXNROW,`09/* max */
X`09NROW,`09`09/* current */
X`09MAXNCOL,`09/* max */
X`09NCOL,`09`09/* current */
X`09MARGIN,
X`09SCRSIZ,
X`09NPAUSE,
X`09ansiopen,
X`09ansiclose,
X`09ansikopen,
X`09ansikclose,
X`09ttgetc,
X`09ttputc,
X`09tttypahead,
X`09ttflush,
X`09ansimove,
X`09ansieeol,
X`09ansieeop,
X`09ansibeep,
X`09ansirev,
X`09ansicres,
X#if`09OPT_COLOR
X`09ansifcol,
X`09ansibcol,
X#else
X`09null_t_setfor,
X`09null_t_setback,
X#endif
X`09null_t_setpal,`09`09`09/* no palette */
X`09ansiscroll,
X`09null_t_pflush,
X`09null_t_icursor,
X`09null_t_title,
X`09null_t_watchfd,
X`09null_t_unwatchfd,
X`7D;
X
Xstatic`09void`09ansiparm (int n);
X#if SCROLL_REG
Xstatic`09void`09ansiscrollregion (int top, int bot);
X#endif
X
Xstatic void
Xcsi (void)
X`7B
X`09ttputc(ESC);
X`09ttputc('`5B');
X`7D
X
X#if`09OPT_COLOR
Xstatic void
Xansifcol(int color)`09/* set the current output\2106 */
X`7B
X`09if (color == cfcolor)
X`09`09return;
X`09csi();
X`09ansiparm(color+30);
X`09ttputc('m');
X`09cfcolor = color;
X`7D
X
Xstatic void
Xansibcol(int color)`09/* set the current background\2506 */
X`7B
X`09if (color == cbcolor)
X`09`09return;
X`09csi();
X`09ansiparm(color+40);
X`09ttputc('m');
X`09cbcolor = color;
X`7D
X#endif
X
Xstatic void
Xansimove(int row, int col)
X`7B
X`09csi();
X`09ansiparm(row+1);
X`09ttputc(';');
X`09ansiparm(col+1);
X`09ttputc('H');
X`7D
X
Xstatic void
Xansieeol(void)
X`7B
X`09csi();
X`09ttputc('K');
X`7D
X
Xstatic void
Xansieeop(void)
X`7B
X#if`09OPT_COLOR
X`09ansifcol(gfcolor);
X`09ansibcol(gbcolor);
X#endif
X`09csi();
X`09ttputc('2');
X`09ttputc('J');
X`7D
X
X#if OPT_COLOR
Xstatic void
Xforce_colors(int fc, int bc)
X`7B
X`09cfcolor =
X`09cbcolor = -1;
X`09ansifcol(fc);
X`09ansibcol(bc);
X`7D
X#endif
X
X#if BROKEN_REVERSE_VIDEO
X/* there was something wrong with this "fix".  the "else" of
X`09`09the ifdef just uses "ESC `5B 7 m" to set reverse
X`09`09video, and it works under DOS for me....  but then, i
X`09`09use an "after-market" ansi driver -- nnansi593.zip, from
X`09`09oak.oakland.edu, or any simtel mirror. */
Xstatic void
Xansirev(`09/* change reverse video state */
XUINT state)`09/* TRUE = reverse, FALSE = normal */
X`7B
X#if`09!OPT_COLOR
X`09static UINT revstate = SORTOFTRUE;
X`09if (state == revstate)
X`09`09return;
X`09revstate = state;
X#endif
X
X`09csi();
X#if OPT_COLOR `26`26 SYS_MSDOS
X`09ttputc('1');`09/* bold-on */
X#else
X`09if (state) ttputc('7');`09/* reverse-video on */
X#endif
X`09ttputc('m');
X
X#if`09OPT_COLOR
X#if`09SYS_MSDOS
X`09/*
X`09 * Setting reverse-video with ANSI.SYS seems to reset the colors to
X`09 * monochrome.  Using the colors directly to simulate reverse video
X`09 * works better. Bold-face makes the foreground colors "look" right.
X`09 */
X`09if (state)
X`09`09force_colors(cbcolor, cfcolor);
X`09else
X`09`09force_colors(cfcolor, cbcolor);
X#else`09/* normal ANSI-reverse */
X`09if (state == FALSE) `7B
X`09`09force_colors(cfcolor, cbcolor);
X`09`7D
X#endif`09/* MSDOS vs ANSI-reverse */
X#endif`09/* OPT_COLOR */
X`7D
X
X#else
X
Xstatic void
Xansirev(`09/* change reverse video state */
XUINT state)`09/* TRUE = reverse, FALSE = normal */
X`7B
X`09static UINT revstate = SORTOFTRUE;
X`09if (state == revstate)
X`09`09return;
X`09revstate = state;
X
X`09csi();
X`09if (state) ttputc('7');`09/* reverse-video on */
X`09ttputc('m');
X#if OPT_COLOR
X`09force_colors(cfcolor, cbcolor);
X#endif
X`7D
X
X#endif
X
Xstatic int
Xansicres(const char *flag)`09/* change screen resolution */
X`7B
X`09return(FALSE);
X`7D
X
Xstatic void
Xansibeep(void)
X`7B
X`09ttputc(BEL);
X`09ttflush();
X`7D
X
X
X/* if your ansi terminal can scroll regions, like the vt100, then define
X`09SCROLL_REG.  If not, you can use delete/insert line code, which
X`09is prettier but slower if you do it a line at a time instead of
X`09all at once.
X*/
X
X/* move howmany lines starting at from to to */
Xstatic void
Xansiscroll(int from, int to\0806n)
X`7B
X`09int i;
X`09if (to == from) return;
X#if SCROLL_REG
X`09if (to < from) `7B
X`09`09ansiscrollregion(to, from + n - 1);
X`09`09ansimove(from + n - 1,0);
X`09`09for (i = from - to; i > 0; i--)
X`09`09`09ttputc('`5Cn');
X`09`7D else `7B /* from < to */
X`09`09ansiscrollregion(from, to + n - 1);
X`09`09ansimove(from,0);
X`09`09for (i = to - from; i > 0; i--) `7B
X`09`09`09ttputc(ESC);
X`09`09`09ttputc('M');
X`09`09`7D
X`09`7D
X`09ansiscrollregion(0, term.t_mrow-1);
X
X#else /* use insert and delete line */
X#if OPT_PRETTIER_SCROLL
X`09if (absol(from-to) > 1) `7B
X`09`09ansiscroll(from, (from<to) ? to-1:to+1, n);
X`09`09if (from < to)
X`09`09`09from = to-1;
X`09`09else
X`09`09`09from = to+1;
X`09`7D
X#endif
X`09if (to < from) `7B
X`09`09ansimove(to,0);
X`09`09csi();
X`09`09ansiparm(from - to);
X`09`09ttputc('M'); /* delete */
X`09`09ansimove(to+n,0);
X`09`09csi();
X`09`09ansiparm(from - to);
X`09`09ttputc('L'); /* insert */
X`09`7D else `7B
X`09`09ansimove(from+n,0);
X`09`09csi();
X`09`09ansiparm(to - from);
X`09`09ttputc('M'); /* delete */
X`09`09ansimove(from,0);
X`09`09csi();
X`09`09ansiparm(to - from);
X`09`09ttputc('L'); /* insert */
X`09`7D
X#endif
X`7D
X
X#if SCROLL_REG
Xstatic void
Xansiscrollregion(int top, int bot)
X`7B
X`09csi();
X`09ansiparm(top + 1);
X`09ttputc(';');
X`09if (bot != term.t_nrow-1) ansiparm(bot + 1);
X`09ttputc('r');
X`7D
X#endif
X
X
Xstatic void
Xansiparm(register int n)
X`7B
X`09register int q,r;
X
X#if optimize_works /* i don't think it does, although it should, to be ANSI */
V
X`09if (n == 1) return;
X#endif
X
X`09q = n/10;
X`09if (q != 0) `7B
X`09`09r = q/10;
X`09`09if (r != 0) `7B
X`09`09`09ttputc((r%10)+'0');
X`09`09`7D
X`09`09ttputc((q%10) + '0');
X`09`7D
X`09ttputc((n%10) + '0');
X`7D
X
Xstatic void
Xansiopen(void)
X`7B
X`09static int already_open = FALSE;
X`09if (!already_open) `7B
X`09`09already_open = TRUE;
X`09`09strcpy(sres, "NORMAL");
X`09`09revexist = TRUE;
X`09`09ttopen();
X`09`7D
X`7D
X
Xstatic void
Xansiclose(void)
X`7B
X`09TTmove(term.t_nrow-1, 0);`09/* cf: dumbterm.c */
X`09ansieeol();
X#if`09OPT_COLOR
X`09ansifcol(C_WHITE);
X`09ansibcol(C_BLACK);
X#endif
X`7D
X
Xstatic void
Xansikopen(void)`09`09/* open the keyboard (a noop here) */
X`7B
X`7D
X
Xstatic void
Xansikclose(void)`09/* close the keyboard (a noop here) */
X`7B
X`7D
X
X#endif`09/* DISP_ANSI */
$ call unpack [.VILE-8_0]ANSI.C;1 -
 1683361369 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 16 2 152
$!
$ create 'f'
X/*
X * api.c -- (roughly) nvi's api to perl and tcl
X *
X * Status of this file:  Some\1406e functions in\250A are unused.
X * Early on, I was trying for compatibility with nvi's perl interface.
X * Now that I'm not, I've gotten lazy and have occassionally been skipping
X * this layer.
X *
+-+-+-+-+-+-+-+-  END  OF PART 2 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 3 -+-+-+-+-+-+-+-+
X * Some of the code in this file is still used and is, in fact, very
X * important.  There's other code which may simply be removed.
X *
X * OTOH, if someone ever does a TCL interface (it probably won't
X * be me -- I really like Perl and would probably lack motivation to
X * do a proper job of it), some of the as now unused stuff might come
X * in handy.
X *`09`09&0209- kev 4/7/1998
X */
X
X#include "estruct.h"
X#include "edef.h"
X
X#if OPT_PERL
X
X#include "api.h"
X
Xextern REGION *haveregion;
X
XWINDOW *curwp_visible;
X
Xstatic void propagate_dot(void);
X
X/* Maybe this should go in line.c ? */
Xstatic int
Xlinsert_chars(char *s, int len)
X`7B
X#if 0
X    int nlcount = 0;
X    while (len-- > 0) `7B
X`09if (*s == '`5Cn') `7B
X`09    lnewline();
X`09    nlcount++;
X`09`7D
X`09else
X`09    linsert(1, *s);
X`09s++;
X    `7D
X    return nlcount;
X#else
X    /* I wrote the code this way both for efficiency reasons and
X       so that the MARK denoting the end of the range wouldn't
X       be moved to one of the newly inserted lines.
X    */
X    int nlcount = 0;
X    int nlatend = 0;
X    int nlsuppress = 0;
X    int mdnewline = b_val(curbp, MDNEWLINE);
X
X    if (len <= 0)
X`09return 0;
X
X    if (DOT.l == buf_head(curbp)) `7B
X`09if (!mdnewline) `7B
X`09    DOT.l = lback(DOT.l);
X`09    DOT.o = llength(DOT.l);
X`09`7D
X`09if (s`5Blen-1`5D == '`5Cn') `7B
X`09    if (len > 1)
X`09`09nlsuppress = TRUE;
X`09    if (!mdnewline) `7B
X`09`09make_local_b_val(curbp, MDNEWLINE);
X`09`09set_b_val(curbp, MDNEWLINE, TRUE);
X`09    `7D
X`09`7D
X`09else `7B
X`09    if (mdnewline) `7B
X`09`09make_local_b_val(curbp, MDNEWLINE);
X`09`09set_b_val(curbp, MDNEWLINE, FALSE);
X`09    `7D
X`09`7D
X    `7D
X
X    if (s`5Blen-1`5D == '`5Cn') `7B
X`09if (!mdnewline
X`09    `26`26 lforw(DOT.l) == buf_head(curbp)
X`09    `26`26 DOT.o == llength(DOT.l))
X`09`7B
X`09    nlsuppress = TRUE;
X`09    make_local_b_val(curbp, MDNEWLINE);
X`09    set_b_val(curbp, MDNEWLINE, TRUE);
X`09`7D
X`09if (!nlsuppress) `7B
X
X`09    /* We implicitly get a newline by inserting anything at
X`09       the head of a buffer (which includes the empty\2107
X`09       case).  So if we actually insert a newline, we'll end
X`09       up getting two of them.  (Which is something we don't
X`09       want unless MDNEWLINE is TRUE.) */
X
X`09    lnewline();
X`09    nlcount++;
X`09    DOT.l = lback(DOT.l);`09`09/* back up DOT to the newly */
X`09    DOT.o = llength(DOT.l);`09`09/* inserted line */
X`09`7D
X`09nlatend = 1;
X`09len--;
X    `7D
X
X    while (len > 0) `7B
X`09if (*s == '`5Cn') `7B
X`09    lnewline();
X`09    nlcount++;
X`09    s++;
X`09    len--;
X`09`7D
X`09else `7B
X`09    int i;
X`09    /* Find next newline so we can do block insert; We
X`09       start at 1, because we know the first character
X`09       can't be a newline. */
X`09    for (i = 1; i < len `26`26 s`5Bi`5D != '`5Cn'; i++)
X`09`09;
X`09    linsert(i, *s);
X`09    if (i > 1) `7B
X`09`09memcpy(DOT.l->l_text + DOT.o - i + 1, s\0706i - 1);
X`09    `7D
X`09    len -= i;
X`09    s += i;
X`09`7D
X    `7D
X
X    if (nlatend) `7B
X`09/* Advance DOT to where it's supposed to be */
X`09DOT.l = lforw(DOT.l);
X`09DOT.o = 0;
X    `7D
X
X    return nlcount;
X#endif
X`7D
X
X/* Another candidate for line.c */
Xstatic int
Xlreplace(char *s, int len)
X`7B
X    LINE *lp = DOT.l;
X    int i;
X    char *t;
X    WINDOW *wp;
X
X    copy_for_undo(lp);
X
X    DOT.o = 0;
X
X    if (len > lp->l_size) `7B
X`09int nlen;
X`09char *ntext;
X
X#define roundlenup(n) ((n+NBLOCK-1) `26 `7E(\0E09)
X
X`09nlen = roundlenup(len);
X`09ntext = castalloc(char, nlen);
X`09if (ntext == 0)
X`09    return FALSE;
X`09if (lp->l_text)
X`09    ltextfree(lp, curbp);
X`09lp->l_text = ntext;
X`09lp->l_size = nlen;
X    `7D
X
X    lp->l_used = len;
X
X    /* FIXME: Handle embedded newlines */
X    for (i=len-1, t=lp->l_text; i >=0; i--)
X`09t`5Bi`5D = s`5Bi`5D;
X
X    /* We'd normally need a call to chg_buff here, but I don't want
X       to pay the price.
X
X       BUT...
X
X       We do call chg_buff before returning to vile.  See
X       api_command_cleanup below.
X     */
X
X    for_each_window(wp) `7B
X`09if (wp->w_dot.l == lp `26`26 \150Ao > len)
X`09    wp->w_dot.o = len;
X`09if (wp->w_lastdot.l == lp `26`26 \190Eo > len)
X`09    wp->w_lastdot.o = len;
X    `7D
X    do_mark_iterate(mp,
X`09`09    if (mp->l == lp `26`26 mp->o > len)
X`09`09`09mp->o = len;
X    );
X
X    return TRUE;
X`7D
X
Xvoid
Xapi_setup_fake_win(VileBuf *vbp, int do_delete)
X`7B
X    if (curwp_visible == 0)
X`09curwp_visible = curwp;
X
X    if (vbp->fwp) `7B
X`09curwp = vbp->fwp;
X    `7D
X    else `7B
X`09(void) push_fake_win(vbp->bp);
X`09vbp->fwp = curwp;
X`09vbp->changed = 0;
X    `7D
X
X    /* Should we call make_current() for this? */
X    curbp = curwp->w_bufp;
X
X    if (vbp->ndel > 0 `26`26 do_delete) `7B
X`09int status;
X`09/* Do lazy delete; FALSE means don't put text in kill buffer */
X`09status = ldelete(vbp->ndel, FALSE);
X`09vbp->ndel = 0;
X`09if ( status == FALSE
X`09  `7C`7C (lforw(DOT.l) == buf_head(curbp) `26`26 DOT.o >= llength\2E07))`20
V`7B
X`09    make_local_b_val(curbp, MDNEWLINE);
X`09    set_b_val(curbp, MDNEWLINE, FALSE);
X`09`7D
X    `7D
X`7D
X
X/* I considered three possible solutions for preventing stale
X   regions from being used.  Here they are:
X
X    1) Validate the region in question.  I.e, make sure that
X       the region start and end lines are still in the buffer.
X       Set the region to reasonable defaults if not.
X
X       The problem with this approach is that we need something
X       else to hold the end marker of the region while we're
X       working on it.  One possible solution is to use the
X       per-buffer w_lastdot field.  But I'm not entirely sure
X       this is safe.
X
X    2) Make the region and attributed \160Bput it on
X       the attribute list.  The marks representing the
X       ends of the region will certainly be updated correctly
X       if this is done.  The downside is that we'd have to
X       beef up the code which deals with attributes to allow
X       external pointers to the attributes.  It wouldn't
X       do for one of the attribute lists to be freed up with
X       one of our VileBuf structures still pointer to\2F08the
X       structures.
X
X    3) Make line.c and undo.c aware of the VileBuf regions.
X       This solution has no serious downside aside from
X       further bulking up the files in question.
X
X    I chose option 3 since I was able to bury the work
X    inside do_mark_iterate (see estruct.h).  The following
X    function (api_mark_iterator) is the helper\2B09
X    found in do_mark_iterate.
X*/
X
XMARK *
Xapi_mark_iterator(BUFFER *bp, int *iterp)
X`7B
X    MARK *mp = NULL;
X    VileBuf  *vbp = bp2vbp(bp);
X
X    if (vbp != NULL) `7B
X`09switch (*iterp) `7B
X`09    case 0:
X`09`09mp = `26vbp->region.r_orig;
X`09`09break;
X`09    case 1:
X`09`09mp = `26vbp->region.r_end;
X`09`09break;
X`09    default:
X`09`09break;
X`09`7D
X`09(*iterp)++;
X    `7D
X
X    return mp;
X`7D
X
X/*
X * This is a variant of gotoline in basic.c.  It differs in that
X * it attempts to use the line number information to more efficiently
X * find the line in question.  It will also position DOT at the beginning
X * of the line.
X *
X */
Xint
Xapi_gotoline(VileBuf *vbp, int lno)
X`7B
X#if !SMALLER
X    int count;
X    LINE *lp;
X    BUFFER *bp = vbp->bp;
X
X    if (!b_is_counted(bp))
X`09bsizes(bp);
X
X    count = lno - DOT.l->l_number;
X    lp = DOT.l;
X
X    while (count < 0 `26`26 lp != buf_head(bp)) `7B
X`09lp = lback(lp);
X`09count++;
X    `7D
X    while (count > 0) `7B
X`09lp = lforw(lp);
X`09count--;
X`09if (lp == buf_head(bp))
X`09    break;
X    `7D
X
X    DOT.o = 0;
X
X    if (lp != buf_head(bp) `26`26 lno == lp->l_number) `7B
X`09DOT.l = lp;
X`09return TRUE;
X    `7D
X    else `7B
X`09DOT.l = buf_head(bp);
X`09return FALSE;
X    `7D
X
X#else
X    return gotoline(TRUE, lno);
X#endif
X`7D
X
Xint
Xapi_aline(VileBuf *vbp, int lno, char *line\1507en)
X`7B
X    api_setup_fake_win(vbp, TRUE);
X
X    if (lno >= 0 `26`26 lno < line_count(vbp->bp)) `7B
X`09api_gotoline(vbp, lno+1);
X`09linsert_chars(line, len);
X`09lnewline();
X    `7D
X    else `7B`09/* append to the end */
X`09gotoline(FALSE, 0);
X`09gotoeol(FALSE, 0);
X`09lnewline();
X`09linsert_chars(line, len);
X    `7D
X
X    return TRUE;
X`7D
X
Xint
Xapi_dotinsert(VileBuf *vbp, char *text, int len) `7B
X
X    /* Set up the fake window; but we'll do any pending deletes
X       ourselves. */
X    api_setup_fake_win(vbp, FALSE);
X
X    /* FIXME: Check to see if the buffer needs to be modified at all.
X       We'll save our undo space better this way.\2C08also be able
X       to better preserve the user's marks. */
X
X    linsert_chars(text, len);
X    if (vbp->ndel) `7B
X`09int status;
X`09status = ldelete(vbp->ndel, FALSE);
X`09vbp->ndel = 0;
X`09if (status == FALSE
X`09 `7C`7C (lforw(DOT.l) == buf_head(curbp) `26`26 DOT.o >= llength\2E07)) `7B
V
X`09    make_local_b_val(curbp, MDNEWLINE);
X`09    set_b_val(curbp, MDNEWLINE, FALSE);
X`09`7D
X    `7D
X    return TRUE;
X`7D
X
Xint
Xapi_dline(VileBuf *vbp, int lno)
X`7B
X    int status = TRUE;
X
X    api_setup_fake_win(vbp, TRUE);
X
X    if (lno > 0 `26`26 lno <= line_count(vbp->bp)) `7B
X`09api_gotoline(vbp, lno);
X`09gotobol(TRUE,TRUE);
X`09status = ldelete(llength(DOT.l) + 1, FALSE);
X    `7D
X    else
X`09status = FALSE;
X
X    return status;
X`7D
X
Xint
Xapi_gline(VileBuf *vbp, int lno, char **line\1707*lenp)
X`7B
X    int status = TRUE;
X
X    api_setup_fake_win(vbp, TRUE);
X
X    if (lno > 0 `26`26 lno <= line_count(vbp->bp)) `7B
X`09api_gotoline(vbp, lno);
X`09*linep = DOT.l->l_text;
X`09*lenp = llength(DOT.l);
X`09if (*lenp == 0) `7B
X`09    *linep = "";`09/* Make sure we pass back a zero length,
X`09        \0808\100Bnull terminated value when the length
X`09`09&0209   is zero.  Otherwise perl gets confused.
X`09`09&0209   (It thinks it should calculate the length
X`09`09&0209   when given a zero length.)
X`09`09&0209 */
X`09`7D
X    `7D
X    else
X`09status = FALSE;
X
X    return status;
X`7D
X
X#if 0`09`09/* Not used. */
Xint
Xapi_dotgline(VileBuf *vbp, char **linep, int *len\0B08neednewline)
X`7B
X
X    api_setup_fake_win(vbp, TRUE);
X    if (!vbp->dot_inited) `7B
X`09DOT = vbp->region.r_orig;`09/* set DOT to beginning of \2A06 */
X`09vbp->dot_inited = 1;
X    `7D
X
X    /* FIXME: Handle rectangular regions. */
X
X    if (   is_header_line(DOT, curbp)
X        `7C`7C (   DOT.l == vbp->region.r_end.l
X`09    `26`26 (   vbp->regionshape == FULLLINE
X`09        `7C`7C (   vbp->regionshape == EXACT
X`09`09    `26`26 DOT.o >= vbp->region.r_end.o))))
X    `7B
X`09return FALSE;
X    `7D
X
X    *linep = DOT.l->l_text + DOT.o;
X    *lenp = llength(DOT.l) - DOT.o;
X
X    if (vbp->regionshape == EXACT `26`26 DOT.l == \260B.r_end.l) `7B
X`09*lenp -= llength(DOT.l) - vbp->region.r_end.o;
X    `7D
X
X    if (*lenp < 0)
X`09*lenp = 0;`09/* Make sure return length is non-negative */
X
X    if (*lenp == 0) `7B
X`09*linep = "";`09/* Make sure we pass back a zero length,
X`09`09`09       null terminated value when the length
X`09`09`09       is zero.  Otherwise perl gets confused.
X`09`09`09       (It thinks it should calculate the length
X`09`09`09       when given a zero length.)
X`09`09`09     */
X    `7D
X
X    if (vbp->inplace_edit) `7B
X`09if (vbp->regionshape == EXACT `26`26 DOT.l == \260B.r_end.l) `7B
X`09    vbp->ndel = *lenp;
X`09    *neednewline = 0;
X`09`7D
X`09else `7B
X`09    vbp->ndel = *lenp + 1;
X`09    *neednewline = 1;
X`09`7D
X    `7D
X    else `7B
X`09if (vbp->regionshape == EXACT `26`26 DOT.l == \260B.r_end.l) `7B
X`09    DOT.o += *lenp;
X`09    *neednewline = 0;
X`09`7D
X`09else `7B
X`09    DOT.l = lforw(DOT.l);
X`09    DOT.o = 0;
X`09    *neednewline = 1;
X`09`7D
X    `7D
X    return TRUE;
X`7D
X#endif`09/* Not used */
X
Xint
Xapi_sline(VileBuf *vbp, int lno, char *line\1507en)
X`7B
X    int status = TRUE;
X
X    api_setup_fake_win(vbp, TRUE);
X
X    if (lno > 0 `26`26 lno <= line_count(vbp->bp)) `7B
X`09api_gotoline(vbp, lno);
X`09if (   DOT.l->l_text != line
X`09    `26`26 (   llength(DOT.l) != len
X`09        `7C`7C memcmp(line, DOT.l->l_text, len) != 0)) `7B
X`09    lreplace(line, len);
X`09    vbp->changed = 1;
X`09`7D
X    `7D
X    else
X`09status = FALSE;
X
X    return status;
X`7D
X
Xint
Xapi_iline(VileBuf *vbp, int lno, char *line\1507en)
X`7B
X    return api_aline(vbp, lno-1, line, len);
X`7D
X
Xint
Xapi_lline(VileBuf *vbp, int *lnop)
X`7B
X    *lnop = line_count(vbp->bp);
X    return TRUE;
X`7D
X
XVileBuf *
Xapi_fscreen(int id, char *name)
X`7B
X    BUFFER *bp;
X
X    bp = find_b_file(name);
X
X    if (bp)
X`09return api_bp2vbp(bp);
X    else
X`09return 0;
X`7D
X
Xint
Xapi_delregion(VileBuf *vbp)
X`7B
X
X    api_setup_fake_win(vbp, TRUE);
X
X    haveregion = NULL;
X    DOT = vbp->region.r_orig;
X    MK  = vbp->region.r_end;
X    regionshape = vbp->\130B;
X
X    if (vbp->regionshape == FULLLINE) `7B
X`09MK.l = lback(MK.l);
X    `7D
X
X    return killregion();
X`7D
X
Xint
Xapi_motion(VileBuf *vbp, char *mstr)
X`7B
X    const CMDFUNC *cfp;
X    char *mp;
X    int   c, f, n, s;
X    int status;
X    int saved_clexec,\0E07disinp\0E0Bcmd\1C08isnamedcmd;
X
X    if (mstr == NULL)
X`09return FALSE;
X
X    status  = TRUE;
X
X    saved_clexec     = \0D06;
X    saved_discmd     = \0D06;
X    saved_disinp     = \0D06;
X    saved_isnamedcmd = \0D0A;
X
X    clexec     = FALSE;`09`09/* Not executing a command line */
X    discmd     = FALSE;`09`09/* Don't display commands / arg counts */
X    disinp     = FALSE;`09`09/* Don't display input */
X    isnamedcmd = FALSE;`09`09/* Not a named command */
X
X
X    api_setup_fake_win(vbp, TRUE);
X
X    mp = mstr + strlen(mstr);
X
X    mapungetc(abortc `7C NOREMAP);
X    /* Should we allow remapping?  Seems to me like it introduces too
X       many variables. */
X    while (mp-- > mstr) `7B
X`09mapungetc(*mp `7C NOREMAP);
X    `7D
X
X    while (mapped_ungotc_avail()) `7B
X
X`09/* Get the character */
X`09c = kbd_seq();
X
X`09if (ABORTED(c)) `7B
X`09    if (mapped_ungotc_avail()) `7B
X`09`09/* Not our abortc */
X`09`09while (mapped_ungotc_avail())
X`09`09    (void) kbd_seq();
X`09`09status = FALSE;
X`09`09break;
X`09    `7D
X`09    else
X`09`09break;&0209`09/* okay, it's ours */
X`09`7D
X
X`09f = FALSE;
X`09n = 1;
X
X`09do_repeats(`26c,`26f,`26n);
X
X`09/* and execute the command */
X`09cfp = kcod2fnc(c);
X`09if ( (cfp != NULL) `26`26 ((cfp->c_flags `26 MOTION) != 0))
X`09    s = execute(cfp, f, n);
X`09else `7B
X`09    while (mapped_ungotc_avail())
X`09`09(void) kbd_seq();
X`09    status = FALSE;
X`09    break;
X`09`7D
X    `7D
X
X    clexec     = saved_\1306;
X    discmd     = saved_\1306;
X    disinp     = saved_\1306;
X    isnamedcmd = saved_\130A;
X
X    return status;
X`7D
X
Xint
Xapi_edit(VileBuf *vbp, char *fname, \1B09*retvbpp)
X`7B
X    BUFFER *bp;
X    if (fname == NULL) `7B
X`09char bufname`5BNBUFN`5D;
X`09static int unnamed_cnt = 0;
X`09sprintf(bufname, "`5Bunnamed-%d`5D", ++\1007_cnt);
X`09bp = bfind(bufname, 0);
X`09bp->b_active = TRUE;
X    `7D
X    else `7B
X`09bp = getfile2bp(fname, FALSE\0707);
X`09if (bp == 0) `7B
X`09    *retvbpp = 0;
X`09    return 1;
X`09`7D
X    `7D
X
X    *retvbpp = api_bp2vbp(bp);
X    api_setup_fake_win(*retvbpp, TRUE);
X    return !swbuffer_lfl(bp, FALSE);
X`7D
X
Xint
Xapi_swscreen(VileBuf *oldsp, \1009newsp)
X`7B
X    /*
X     * Calling api_command_cleanup nukes various state, like DOT
X     * Now if DOT got propogated, all is (likely) well.  But if it didn't,
X     * then DOT will likely be in the wrong place if the executing perl
X     * script expects to access a buffer on either side of a switchscreen
X     * call.
X     *
X     * I see two different solutions for this.  1) Maintain a copy of
X     * dot in the VileBuf structure. 2) Don't destroy the fake windows by
X     * popping them off.  Which means that we either teach the rest
X     * of vile about fake windows (scary) or we temporarily unlink the
X     * fake windows from the buffer list.
X     *
X     * I'm in favor of temporarily unlinking the fake windows from
X     * the buffer list.  The only problem with this is that the unlinked
X     * window's version of DOT is not iterated over in do_mark_\1907.
X     * (Probably won't be a problem that often, but we need to account
X     * for it.)
X     *
X     * So... I guess we could maintain a separate structure which
X     * has the unlinked window pointers.  And then api_mark_iterate
X     * could walk these.  (Yuck.)
X     *
X     * Anyhow, there's a lot of issues here requiring careful
X     * consideration.  Which is why I haven't already done it.
X     *`09`09- kev 4/3/1998
X     *
X     * Okay, I put in the stuff for detaching and reat\1008fake
X     * windows, but the above noted caveats still apply.
X     *`09`09- kev 4/18/1998
X     *
X     * I decided that the fake window stuff was too much of a hack
X     * So I blew it away.  The rest of vile has limited knowledge
X     * of fake windows now where it needs it.  This knowledge is
X     * buried in the macro "for_each_visible_window".
X     *`09`09- kev 4/20/1998
X     */
X
X    curwp =\0806_visible ?\100F:\2806;
X    curbp = curwp->w_bufp;
X
X    if (oldsp)
X`09swbuffer(vbp2bp(oldsp));
X    swbuffer(vbp2bp(newsp));
X
X    curwp_visible =\1006;
X
X    return TRUE;
X`7D
X
X/* Causes the screen(s) to be updated */
Xvoid
Xapi_update(void)
X`7B
X    propagate_dot();
X
X    curwp =\0806_visible ?\100F:\2806;
X    curbp = curwp->w_bufp;
X
X    update(TRUE);
X
X    curwp_visible =\1006;
X`7D
X
X/*
X * The following are not in the nvi API. But I needed them in order to
X * do an efficient implementation for vile.
X */
X
X
X
X/* Propagate DOT for the fake windows that need it;
X   Also do any outstanding (deferred) deletes. */
Xstatic void
Xpropagate_dot(void)
X`7B
X    WINDOW *wp;
X
X    for_each_window(wp) `7B
X`09if (!is_fake_window(wp)) `7B
X`09    /* We happen to know that the fake windows will always
X`09       be first in the buffer list.  So we exit the loop
X`09       when we hit one that isn't fake. */
X`09    break;
X`09`7D
X
X`09/* Do outstanding delete (if any) */
X`09api_setup_fake_win(bp2vbp(wp->w_bufp), TRUE);
X
X`09if (bp2vbp(wp->w_bufp)->dot_changed) `7B
X`09    if (curwp_visible `26`26 \110D->w_bufp == wp\0E08) `7B
X`09`09curwp_visible->w_dot = wp\0C07;
X`09`09curwp_visible->w_flag `7C= WFHARD;
X`09    `7D
X`09    else `7B
X`09`09int found = 0;
X`09`09WINDOW *pwp;
X`09`09for_each_window(pwp) `7B
X`09`09    if (wp->w_bufp == p\0F0A
X`09`09        `26`26 !is_fake_window(pwp))
X`09`09    `7B
X`09`09`09found = 1;
X`09`09`09pwp->w_dot = \0C09;
X`09`09`09pwp->w_flag `7C= WFHARD;
X`09`09`09break;&0209/* out of inner for_each_window */
X`09`09    `7D
X`09`09`7D
X`09`09if (!found) `7B
X`09`09    /* No window to propagate DOT in, so just use the
X`09`09       buffer's traits */
X`09`09    wp->w_bufp->b_dot =\1407dot;
X`09`09`7D
X`09    `7D
X`09`7D
X    `7D
X`7D
X
Xvoid
Xapi_command_cleanup(void)
X`7B
X    BUFFER *bp;
X
X    if (curwp_visible == 0)
X`09curwp_visible = curwp;
X
X    /* Propgate dot to the visible windows and do any deferred deletes */
X    propagate_dot();
X
X    /* Pop the fake windows */
X
X    while ((bp = pop_fake_win(curwp_visible)) != NULL) `7B
X`09if (bp2vbp(bp) != NULL)
X`09    bp2vbp(bp)->fwp = 0;
X`09    bp2vbp(bp)->dot_inited = 0;`09`09/* for next time */
X`09    bp2vbp(bp)->dot_changed = 0;`09`09/* ditto */
X`09    if (bp2vbp(bp)->changed) `7B
X`09`09chg_buff(bp, WFHARD);
X`09`09bp2vbp(bp)->changed = 0;
X`09    `7D
X    `7D
X
X    curwp_visible = 0;
X
X    if (curbp != curwp->w_bufp)
X`09make_current(curwp->w_bufp);
X
X    MK = DOT;`09`09`09/* make sure MK is in same buffer as DOT */
X`7D
X
Xvoid
Xapi_free_private(void *vsp)
X`7B
X    VileBuf *vbp = (\1009) vsp;
X
X    if (vbp) `7B
X`09vbp->bp->b_api_private = 0;
X#if OPT_PERL
X`09perl_free_handle(vbp->perl_\1106);
X#endif
X`09free(vbp);
X    `7D
X`7D
X
X/* Given a buffer pointer, returns a \1307 to a VileBuf structure,
X * creating it if necessary.
X */
XVileBuf *
Xapi_bp2vbp(BUFFER *bp)
X`7B
X    VileBuf *vbp;
X
X    vbp = bp2vbp(bp);
X    if (vbp == 0) `7B
X`09vbp = typecalloc(VileBuf);
X`09if (vbp != 0) `7B
X`09    bp->b_api_private = vbp;
X`09    vbp->bp = bp;
X`09    vbp->regionshape = FULLLINE;
X`09    vbp->region.r_orig.l =
X`09    vbp->region.r_end.l  = buf_head(bp);
X`09    vbp->region.r_orig.o =
X`09    vbp->region.r_end.o  = 0;
X`09    vbp->dot_inited = 0;
X`09    vbp->dot_changed = 0;
X`09    vbp->ndel = 0;
X`09`7D
X    `7D
X    return vbp;
X`7D
X
X#endif
$ call unpack [.VILE-8_0]API.C;1 -
 693411867 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 41 3 152
$!
$ create 'f'
X/*
X * $Header: /usr/build/vile/vile/RCS/api.h,v 1.10 1998/04/28 10:14:06 tom Exp
V $
X */
X
X/*
X * The VileBuf structure is used by an extension language (such
X * as Perl) interface to provide an\180EBUFFER.  In this
X * structure, we have a pointer to a BUFFER as well as other fields.
X *
X * In particular, the fwp (fake window pointer) is needed because
X * most of vile's editing operations will not work right unless there
X * is also an associated window.  We don't necessarily want to change
X * the user visible windows, so we create a fak\1D08 (and then
X * later destroy it) for the express purpose of fooling the rest of
X * vile into thinking that it's working on a real window.  Care
X * must be taken not to enter any display code, however, since these
X * fake windows use negative numbers to denote the top line of the
X * screen.
X */
X
Xtypedef struct `7B
X`09BUFFER    * bp;
X`09WINDOW    * fwp;`09`09/* fake window pointer */
X`09REGION      region;`09`09/* Region to traverse */
X`09REGIONSHAPE regionshape;
X`09int         inplace_edit;`09/* Delete after get? */
X`09int         dot_inited;`09`09/* Has dot been initialized
X`09        \0808\1010   for api_dotgline? */
X`09int         changed;`09`09/* Were any\1607s done? */
X`09int         dot_changed;`09/* DOT explicitly \1B07 --
X`09`09&0209`09   implies that DOT should
X`09`09&0209`09   be propogated */
X`09int`09    ndel;`09`09/* number of characters to delete upon
X`09`09&0209`09   setup; related to the inplace_edit
X`09`09&0209`09   stuff */
X#if OPT_PERL
X`09void      * perl_handle;`09/\1006 visible \1806 to this
X`09`09&0209`09   data structure */
X#endif
X`7D VileBuf;
X
Xextern`09int`09api_aline(VileBuf *, int, char\0D07);
Xextern`09int`09api_edit(VileBuf *sp, char *fname, \1A09*retspp);
Xextern`09int`09api_dline(VileBuf *, int);
Xextern`09int`09api_gline(VileBuf *, int, char *\0E06 *);
Xextern`09int`09api_sline(VileBuf *, int, char\0D07);
Xextern`09int`09api_iline(VileBuf *, int, char\0D07);
Xextern`09int`09api_lline(VileBuf *, int *);
Xextern`09int`09api_swscreen(VileBuf *, \0B09);
Xextern`09VileBuf *api_fscreen(int, char *);
Xextern`09VileBuf *api_bp2vbp(BUFFER *bp);
Xextern`09void`09api_command_cleanup(void);
Xextern`09int`09api_dotinsert(VileBuf *sp, char *text, int len);
Xextern`09int`09api_dotgline(VileBuf *, char **, int *, int *);
Xextern`09int`09api_gotoline(VileBuf *sp, int lno);
Xextern`09void`09api_setup_fake_win(VileBuf *sp, int do_delete);
Xextern`09int`09api_delregion(VileBuf *vbp);
Xextern`09int`09api_motion(VileBuf *vbp, char *mstr);
Xextern`09void`09api_update(void);
X
Xextern`09WINDOW *curwp_visible;
X
X#define vbp2bp(sp) (((VileBuf *)(sp))->bp)
X#define bp2vbp(bp) ((VileBuf *) (bp)->b_api_private)
$ call unpack [.VILE-8_0]API.H;1 -
 201407917 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 6 4 152
$!
$ create 'f'
X/*
X * The routines in this file move the cursor around on the screen. They
X * compute a new value for the cursor, then adjust ".". The display code
X * always updates the cursor location, so only moves between lines, or
X * functions that adjust the top line in the window and invalidate the
X * framing, are hard.
X *
X * $Header: /usr/build/vile/vile/RCS/basic.c,v 1.98 1998/05/12 23:31:06 tom Ex
Vp $
X *
X */
X
X#include`09"estruct.h"
X#include`09"edef.h"
X
X#define`09RegexpLen(exp) ((exp->mlen) ? (int)\130C: 1)
X
Xstatic`09int`09getnmmarkname ( int *cp );
Xstatic`09void`09skipblanksb (void);
Xstatic`09void`09skipblanksf (void);
X
X/* utility routine for 'forwpage()' and 'back\1108*/
Xstatic int
Xfull_pages(int f, int n)
X`7B
X`09if (f == FALSE) `7B
X`09`09n = curwp->w_ntrows - 2;`09/* Default scroll.`09*/
X`09`09if (n <= 0)&0209`09/* Don't blow up if the */
X`09`09`09n = 1;&0309/* window is tiny.`09*/
X`09`7D
X#if`09OPT_CVMVAS
X`09else if (n > 0)`09`09&0209/* Convert from pages`09*/
X`09`09n *= curwp->w_ntrows;&0209/* to lines.&0209*/
X#endif
X`09return n;
X`7D
X
X/* utility routine for 'forwhpage()' and 'back\1209*/
Xstatic int
Xhalf_pages(int f, int n)
X`7B
X`09if (f == FALSE) `7B
X`09`09n = curwp->w_ntrows / 2;`09/* Default scroll.`09*/
X`09`09if (n <= 0)&0209`09/* Forget the overlap`09*/
X`09`09`09n = 1;&0309/* if tiny window.`09*/
X`09`7D
X#if`09OPT_CVMVAS
X`09else if (n > 0)`09`09&0209/* Convert from pages`09*/
X`09`09n *= curwp->w_ntrows/2;&0209/* to lines.&0209*/
X#endif
X`09return n;
X`7D
X
X/*
X * Implements the vi "0" command.
X *
X * Move the cursor to the beginning of\1F08rent line.
X */
X/* ARGSUSED */
Xint
Xgotobol(int f GCC_UNUSED, int n\120B)
X`7B
X`09DOT.o  = w_left_margin(curwp);
X`09return mvleftwind(TRUE, -w_val(curwp,WVAL_SIDEWAYS));
X`7D
X
X/*
X * Move the cursor backwards by "n" characters. If "n" is less than zero call
V
X * "forwchar" to actually do the move. Otherwise compute the new cursor
X * location. Error if you try and move out of the buffer. Set the flag if the
V
X * line pointer for dot changes.
X */
Xint
Xbackchar(int f, int n)
X`7B
X`09register LINE`09*lp;
X
X`09if (f == FALSE) n = 1;
X`09if (n < 0)
X`09`09return (forwchar(f, -n));
X`09while (n--) `7B
X`09`09if (DOT.o == w_left_margin(curwp)) `7B
X`09`09`09if ((lp=lback(DOT.l)) == buf_head(curbp))
X`09`09&0209return (FALSE);
X`09`09`09DOT.l  = lp;
X`09`09`09DOT.o  = llength(lp);
X`09`09`09curwp->w_flag `7C= WFMOVE;
X`09`09`7D else
X`09`09`09DOT.o--;
X`09`7D
X`09return (TRUE);
X`7D
X
X/*
X * Implements the vi "h" command.
X *
X * Move the cursor backwards by "n" characters. Stop at beginning of line.
X */
Xint
Xbackchar_to_bol(int f, int n)
X`7B
X
X`09if (f == FALSE) n = 1;
X`09if (n < 0)
X`09`09return forwchar_to_eol(f, -n);
X`09while (n--) `7B
X`09`09if (DOT.o == w_left_margin(curwp))
X`09`09`09return doingopcmd;
X`09`09else
X`09`09`09DOT.o--;
X`09`7D
X`09return TRUE;
X`7D
X
X/*
X * Implements the vi "$" command.
X *
X * Move the cursor to the end of\1908rent line.  Trivial.
X */
Xint
Xgotoeol(int f, int n)
X`7B
X`09if (f == TRUE) `7B
X`09`09if (n > 0)
X`09`09`09--n;
X`09`09else if (n < 0)
X`09`09`09++n;
X`09`09if (forwline(f,n) != TRUE)
X`09`09`09return FALSE;
X`09`7D
X`09DOT.o  = llength(DOT.l);
X`09curgoal = HUGE;
X`09return (TRUE);
X`7D
X
X/*
X * Move the cursor forwards by "n" characters. If "n" is less than zero call
X * "backchar" to actually do the move. Otherwise compute the new cursor
X * location, and move ".". Error if you try\1F0Aoff the end of the
X * buffer. Set the flag if the line pointer for dot changes.
X */
Xint
Xforwchar(int f, int n)
X`7B
X`09if (f == FALSE) n = 1;
X`09if (n < 0)
X`09`09return (backchar(f, -n));
X`09while (n--) `7B
X`09`09/* if an explicit arg was given, allow us to land
X`09`09`09on the newline, else skip it */
X`09`09if (is_at_end_of_line(DOT) `7C`7C
X`09`09&0209(f == FALSE `26`26 !insertmode &0226
X`09`09&0209llength(DOT.l) `26`26 DOT.o == \1B0F- 1)
X`09`09&0209&0409) `7B
X`09`09`09if (is_header_line(DOT, curbp) `7C`7C
X`09`09&0209`09is_last_line(DOT,curbp))
X`09`09&0209return (FALSE);
X`09`09`09DOT.l  = lforw(DOT.l);
X`09`09`09DOT.o  = w_left_margin(curwp);
X`09`09`09curwp->w_flag `7C= WFMOVE;
X`09`09`7D else
X`09`09`09DOT.o++;
X`09`7D
X`09return (TRUE);
X`7D
X
X
X/*
X * Implements the vi "l" command.
X *
X * Move the cursor forwards by "n" characters. Don't go past end-of-line
X *
X * If the flag 'doingopcmd' is set, implements a vi "l"-like motion for
X * internal use.  The end-of-line test is off-by-one from the true "l" command
V
X * to allow for substitutions at the end of a line.
X */
Xint
Xforwchar_to_eol(int f, int n)
X`7B
X`09int nwas = n;
X`09int lim;
X`09if (f == FALSE) n = 1;
X`09if (n < 0) return backchar_to_bol(f, -n);
X`09if (n == 0) return TRUE;
X
+-+-+-+-+-+-+-+-  END  OF PART 3 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 4 -+-+-+-+-+-+-+-+
X`09/* normally, we're confined to the text on the line itself.  if
X`09  we're doing an opcmd, then \1B06allowed to move to the newline
X`09  as well, to take care of the internal cases:  's', 'x', and '`7E'. */
X`09if (doingopcmd `7C`7C insertmode)
X`09`09lim = llength(DOT.l);
X`09else
X`09`09lim = llength(DOT.l) - 1;
X`09do `7B
X`09`09if (DOT.o >= lim)
X`09`09`09return n != nwas; /* \1507ok if we moved at all */
X`09`09else
X`09`09`09DOT.o++;
X`09`7D while (--n);
X`09return TRUE;
X`7D
X
X/*
X * Implements the vi "G" command.
X *
X * Move to a particular line (the argument).  Count from bottom of file if
X * argument is negative.
X */
Xint
Xgotoline(int f, int n)
X`7B
X`09register int status;`09/*\0B07 return */
X
X`09MARK odot;
X
X`09if (f == FALSE) `7B
X`09`09return(gotoeob(f,n));
X`09`7D
X
X`09if (n == 0)`09`09/* if a bogus argument...then leave */
X`09`09return(FALSE);
X
X`09odot = DOT;
X
X`09DOT.o  = w_left_margin(curwp);
X`09if (n < 0) `7B
X`09`09DOT.l  = lback(buf_head(curbp));
X`09`09status = backline(f, -n - 1 );
X`09`7D else `7B
X`09`09DOT.l  = lforw(buf_head(curbp));
X`09`09status = forwline(f, n-1);
X`09`7D
X`09if (status != TRUE) `7B
X`09`09DOT = odot;
X`09`09return status;
X`09`7D
X`09(void)firstnonwhite(FALSE,1);
X`09curwp->w_flag `7C= WFMOVE;
X`09return TRUE;
X`7D
X/*
X * Goto the beginning of\1106uffer. Massive adjustment of dot. This is
X * considered to be hard motion; it really isn't if the original value of dot
V
X * is the same a\0C06new value of dot.
X */
X/* ARGSUSED */
Xint
Xgotobob(int f GCC_UNUSED, int n\120B)
X`7B
X`09DOT.l  = lforw(buf_head(curbp));
X`09DOT.o  = w_left_margin(curwp);
X`09curwp->w_flag `7C= WFMOVE;
X`09return (TRUE);
X`7D
X
X/*
X * Move to the end of the buffer. Dot is always put at \2C0Ffile.
X */
X/* ARGSUSED */
Xint
Xgotoeob(int f GCC_UNUSED, int n\120B)
X`7B
X`09DOT.l  = lback(buf_head(curbp));
X`09curwp->w_flag `7C= WFMOVE;
X`09return firstnonwhite(FALSE,1);
X`7D
X
X/*
X * Implements the vi "H" command.
X *
X * Move to first (or nth) line in window
X */
Xint
Xgotobos(int f, int n)
X`7B
X`09int`09nn = curwp->w_ntrows;
X`09if (!f `7C`7C n <= 0)
X`09`09n = 1;
X
X`09DOT.l = curwp->w_line.l;
X`09while (--n) `7B
X`09`09if (is_last_line(DOT,curbp))
X`09`09`09break;
X`09`09nn -= line_height(curwp, DOT.l);
X`09`09DOT.l = lforw(DOT.l);
X`09`7D
X
X`09if (nn <= 0)`09`09/* we went past the end of window */
X`09`09curwp->w_flag `7C= WFMOVE;
X`09return firstnonwhite(FALSE,1);
X`7D
X
X/*
X * Implements the vi "M" command.
X *
X * Move to the middle of lines displayed in window
X */
X/* ARGSUSED */
Xint
Xgotomos(int f GCC_UNUSED, int n)
X`7B
X`09register LINEPTR lp, head;
X`09int`09half = (curwp->w_ntrows+1) / 2;
X
X`09head = buf_head(curbp);
X`09for (n = 0, lp = curwp->w_line.l; lp != head; lp = lforw(lp)) `7B
X`09`09if (n < half)
X`09`09`09DOT.l = lp;
X`09`09if ((n += line_height(curwp, lp)) >= curwp->w_ntrows)
X`09`09`09break;
X`09`7D
X`09if (n < curwp->w_ntrows) `7B`09/* then we hit eof before eos */
X`09`09half = (n+1) / 2;`09/* go back up */
X`09`09for (n = 0, lp = curwp->w_line.l; lp != head; lp = lforw(lp)) `7B
X`09`09`09DOT.l = lp;
X`09`09`09if ((n += line_height(curwp, lp)) >= half)
X`09`09&0209break;
X`09`09`7D
X`09`7D
X
X`09return firstnonwhite(FALSE,1);
X`7D
X
X/*
X * Implements the vi "L" command.
X *
X * Move to the last (or nth last) line in window
X */
Xint
Xgotoeos(int f, int n)
X`7B
X`09int nn;
X`09if (f == FALSE `7C`7C n <= 0)
X`09`09n = 1;
X
X`09/* first get to the end */
X`09DOT.l = curwp->w_line.l;
X`09nn = curwp->w_ntrows;
X`09while ((nn -= line_height(curwp,DOT.l)) > 0) `7B
X`09`09if (is_last_line(DOT,curbp))
X`09`09`09break;
X`09`09DOT.l = lforw(DOT.l);
X`09`7D
X#ifdef WMDLINEWRAP
X`09/* adjust if we pointed to a line-fragment */
X`09if (w_val(curwp,WMDLINEWRAP)
X`09 `26`26 nn < 0
X`09 `26`26 DOT.l != curwp->w_line.l)
X`09`09DOT.l = lback(DOT.l);
X#endif
X`09/* and then go back up */
X`09/* (we're either at eos or eof) */
X`09while (--n) `7B
X`09`09if (sameline(DOT, curwp->w_line))
X`09`09`09break;
X`09`09DOT.l = lback(DOT.l);
X`09`7D
X`09return firstnonwhite(FALSE,1);
X`7D
X
X/*
X * Implements the vi "j" command.
X *
X * Move forward by full lines. If the number of lines to move is less than
X * zero, call the backward line function to actually do it. The last command
X * controls how the goal column is set.
X */
Xint
Xforwline(int f, int n)
X`7B
X`09register LINE`09*dlp;
X
X`09if (f == FALSE) n = 1;
X`09if (n < 0) return (backline(f, -n));
X`09if (n == 0) return TRUE;
X
X`09/* if the last command was not a line move,
X`09   reset the goal column */
X`09if (curgoal < 0)
X`09`09curgoal = getccol(FALSE);
X
X`09/* and move the point down */
X`09dlp = DOT.l;
X`09do `7B
X`09`09register LINE *nlp = lforw(dlp);
X`09`09if (nlp == buf_head(curbp)) `7B
X`09`09`09return FALSE;
X`09`09`7D
X`09`09dlp = nlp;
X`09`7D while (--n);
X
X`09/* resetting the current position */
X`09DOT.l  = dlp;
X`09DOT.o  = getgoal(dlp);
X`09curwp->w_flag `7C= WFMOVE;
X`09return TRUE;
X`7D
X/*
X * Implements the vi "`5E" command.
X *
X * Move to the first nonwhite character on the current line.  No errors are
X * returned.
X */
X/* ARGSUSED */
Xint
Xfirstnonwhite(int f GCC_UNUSED, int n\120B)
X`7B
X`09DOT.o  = firstchar(DOT.l);
X`09if (DOT.o < w_left_margin(curwp)) `7B
X`09`09if (llength(DOT.l) <= w_left_margin(curwp))
X`09`09`09DOT.o = w_left_margin(curwp);
X`09`09else
X`09`09`09DOT.o = llength(DOT.l) - 1;
X`09`7D
X`09return TRUE;
X`7D
X
X/* ARGSUSED */
X#if !SMALLER
Xint
Xlastnonwhite(int f GCC_UNUSED, int n\120B)
X`7B
X`09DOT.o  = lastchar(DOT.l);
X`09if (DOT.o < w_left_margin(curwp))
X`09`09DOT.o = w_left_margin(curwp);
X`09return TRUE;
X`7D
X#endif
X
X/* return the offset of the first non-white character o\2F06line,
X`09or -1 if there are no non-white characters on the line */
Xint
Xfirstchar(LINE *lp)
X`7B
X`09int off = w_left_margin(curwp);
X`09while ( off < llength(lp) `26`26 isBlank(lgetc(lp, off)) )
X`09`09off++;
X`09if (off == llength(lp))
X`09`09return -1;
X`09return off;
X`7D
X
X/* return the offset of the next non-white character o\2E06line,
X`09or -1 if there are no more non-white characters on the line */
Xint
Xnextchar(LINE *lp, int off)
X`7B
X`09while (off < llength(lp)) `7B
X`09`09if (!isSpace(lgetc(lp,off)))
X`09`09`09return off;
X`09`09off++;
X`09`7D
X`09return -1;
X`7D
X
X/* return the offset of the last non-white character o\2E06line
X`09or -1 if there are no non-white characters on the line */
Xint
Xlastchar(LINE *lp)
X`7B
X`09int off = llength(lp)-1;
X`09while ( off >= 0 `26`26 isSpace(lgetc(lp, off)) )
X`09`09off--;
X`09return off;
X`7D
X
X/*
X * Implements the vi "`5EM" command.
X *
X * Like 'forwline()', but goes to the first non-white character position.
X */
Xint
Xforwbline(int f, int n)
X`7B
X`09int s;
X
X`09if (f == FALSE) n = 1;
X`09if ((s = forwline(f,n)) != TRUE)
X`09`09return (s);
X`09return firstnonwhite(FALSE,1);
X`7D
X
X/*
X * Implements the vi "-" command.
X *
X * Like 'backline()', but goes to the first non-white character position.
X */
Xint
Xbackbline(int f, int n)
X`7B
X`09int s;
X
X`09if (f == FALSE) n = 1;
X`09if ((s = backline(f,n)) != TRUE)
X`09`09return (s);
X`09return firstnonwhite(FALSE,1);
X`7D
X
X/*
X * Implements the vi "k" command.
X *
X * This function is like "forwline", but goes backwards.
X */
Xint
Xbackline(int f, int n)
X`7B
X`09register LINE`09*dlp;
X
X`09if (f == FALSE) n = 1;
X`09if (n < 0)
X`09`09return (forwline(f, -n));
X
X`09/* if we are on the first line as we start....fail the command */
X`09if (is_first_line(DOT, curbp))
X`09`09return(FALSE);
X
X`09/* if the last command was not note a line move,
X`09   reset the goal column */
X`09if (curgoal < 0)
X`09`09curgoal = getccol(FALSE);
X
X`09/* and move the point up */
X`09dlp = DOT.l;
X`09while (n-- `26`26 lback(dlp) != buf_head(curbp))
X`09`09dlp = lback(dlp);
X
X`09/* reseting the current position */
X`09DOT.l  = dlp;
X`09DOT.o  = getgoal(dlp);
X`09curwp->w_flag `7C= WFMOVE;
X`09return (TRUE);
X`7D
X
X/*
X * Go to the beginning of the current paragraph.
X */
Xint
Xgotobop(int f, int n)
X`7B
X`09MARK odot;
X`09int was_on_empty;
X`09int fc;
X
X`09if (!f) n = 1;
X
X`09was_on_empty = is_empty_line(DOT);
X`09odot = DOT;
X
X`09fc = firstchar(DOT.l);
X`09if (doingopcmd `26`26
X`09`09((fc >= 0 `26`26 DOT.o <= fc) `7C`7C fc < 0) &0226
X`09`09!is_first_line(DOT,curbp)) `7B
X`09`09backchar(TRUE,DOT.o+1);
X`09`09pre_op_dot = DOT;
X`09`7D
X`09while (n) `7B
X`09`09if (findpat(TRUE, 1, b_val_rexp(curbp,VAL_PARAGRAPHS)->reg,
X`09`09&0209&0309REVERSE) != TRUE) `7B
X`09`09`09(void)gotobob(f,n);
X`09`09`7D else if (is_empty_line(DOT)) `7B
X`09`09`09/* special case -- if we found an empty line,
X`09`09&0209and it's adjacent to where we started,
X`09`09&0209skip all adjacent empty lines, and try again */
X`09`09`09if ( (was_on_empty `26`26 lforw(DOT.l) == odot.l) `7C`7C
X`09`09&0209(n > 0 `26`26 llength(lforw(DOT.l)) == 0) ) `7B
X`09`09&0209/* then we haven't really found what we
X`09`09&0209`09wanted.  keep going */
X`09`09&0209skipblanksb();
X`09`09&0209continue;
X`09`09`09`7D
X`09`09`7D
X`09`09n--;
X`09`7D
X`09if (doingopcmd) `7B
X`09`09fc = firstchar(DOT.l);
X`09`09if (!sameline(DOT,odot) `26`26
X`09`09`09(pre_op_dot.o > lastchar\180Cl)) `26`26
X`09`09`09((fc >= 0 `26`26 DOT.o <= fc) `7C`7C fc < 0)) `7B
X`09`09`09regionshape = FULLLINE;
X`09`09`7D
X`09`7D
X`09return TRUE;
X`7D
X
X/*
X * Go to the end of the current paragraph.
X */
Xint
Xgotoeop(int f, int n)
X`7B
X`09MARK odot;
X`09int was_at_bol;
X`09int was_on_empty;
X`09int fc;
X
X`09if (!f) n = 1;
X
X`09fc = firstchar(DOT.l);
X`09was_on_empty = is_empty_line(DOT);
X`09was_at_bol = ((fc >= 0 `26`26 DOT.o <= fc) `7C`7C fc < 0);
X`09odot = DOT;
X
X`09while (n) `7B
X`09`09if (findpat(TRUE, 1, b_val_rexp(curbp,VAL_PARAGRAPHS)->reg,
X`09`09&0209&0209FORWARD) != TRUE) `7B
X`09`09`09DOT = curbp->b_line;
X`09`09`7D else if (is_empty_line(DOT)) `7B
X`09`09`09/* special case -- if we found an empty line. */
X`09`09`09/* either as the very next line, or at the end of
X`09`09&0209our search */
X`09`09`09if ( (was_on_empty `26`26 lback(DOT.l) == odot.l) `7C`7C
X`09`09&0209(n > 0 `26`26 llength(lback(DOT.l)) == 0) ) `7B
X`09`09&0209/* then we haven't really found what we
X`09`09&0209`09wanted.  keep going */
X`09`09&0209skipblanksf();
X`09`09&0209continue;
X`09`09`09`7D
X`09`09`7D
X`09`09n--;
X`09`7D
X`09if (doingopcmd) `7B
X`09`09/* if we're now at the beginning of a line and we can back up,
X`09`09  do so to avoid eating the newline and leading whitespace */
X`09`09fc = firstchar(DOT.l);
X`09`09if (((fc >= 0 `26`26 DOT.o <= fc) `7C`7C fc < 0) &0226
X`09`09`09!is_first_line(DOT,curbp) `26`26
X`09`09`09!sameline(DOT,odot) ) `7B
X`09`09`09backchar(TRUE,DOT.o+1);
X`09`09`7D
X`09`09/* if we started at th\0F07 of line, e\1707whole line */
X`09`09if (!sameline(DOT,odot) `26`26 was_at_bol)
X`09`09`09regionshape = FULLLINE;
X`09`7D
X`09return TRUE;
X`7D
X
Xstatic void
Xskipblanksf(void)
X`7B
X`09while (lforw(DOT.l) != buf_head(curbp) `26`26 is_empty_line(DOT))
X`09`09DOT.l = lforw(DOT.l);
X`7D
X
Xstatic void
Xskipblanksb(void)
X`7B
X`09while (lback(DOT.l) != buf_head(curbp) `26`26 is_empty_line(DOT))
X`09`09DOT.l = lback(DOT.l);
X`7D
X
X#if OPT_STUTTER_SEC_CMD
Xgetstutter(void)
X`7B
X`09int thiskey;
X`09if (!clexec) `7B
X`09`09thiskey = lastkey;
X`09`09kbd_seq();
X`09`09if (thiskey != lastkey) `7B
X`09`09`09return FALSE;
X`09`09`7D
X`09`7D
X`09return TRUE;
X`7D
X#endif
X
X/*
X * Go to the beginning of the current section (or paragraph if no \1C07
X * marker found).
X */
Xint
Xgotobosec(int f, int n)
X`7B
X#if OPT_STUTTER_SEC_CMD
X`09if (!getstutter())
X`09`09return FALSE;
X#endif
X`09if (findpat(f, n, b_val_rexp(curbp,VAL_SECTIONS)->reg,
X`09`09&0209&0309REVERSE) != TRUE) `7B
X`09`09(void)gotobob(f,n);
X`09`7D
X`09return TRUE;
X`7D
X
X/*
X * Go to the end of the current section (or paragraph if no \1C08marker
X * found).
X */
Xint
Xgotoeosec(int f, int n)
X`7B
X#if OPT_STUTTER_SEC_CMD
X`09if (!getstutter())
X`09`09return FALSE;
X#endif
X`09if (findpat(f, n, b_val_rexp(curbp,VAL_SECTIONS)->reg,
X`09`09&0209&0309FORWARD) != TRUE) `7B
X`09`09DOT = curbp->b_line;
X`09`7D
X`09return TRUE;
X`7D
X
X/*
X * Go to the beginning of the current sentence. If we skip into an empty line
V
X * (from a non-empty line), return at that point -- that's what vi does.
X */
Xint
Xgotobosent(int f, int n)
X`7B
X`09MARK savepos;
X`09int looped = 0;
X`09int extra;
X`09int empty = is_empty_line(DOT);
X`09register regexp *exp;
X`09register int s = TRUE;
X
X`09savepos = DOT;
X`09exp = b_val_rexp(curbp,VAL_SENTENCES)->reg;
X
X`09while (s `26`26 (is_at_end_of_line(DOT) `7C`7C isSpace(char_at(DOT)))) `7B
V
X`09`09s = backchar(TRUE,1);
X`09`09if (is_at_end_of_line(DOT) `26`26 !empty)
X`09`09`09return TRUE;
X`09`7D
X top:
X`09extra = 0;
X`09if (findpat(f, n, exp, REVERSE) != TRUE) `7B
X`09`09return gotobob(f,n);
X`09`7D
X`09s = forwchar(TRUE, RegexpLen(exp));
X`09while (s `26`26 (is_at_end_of_line(DOT) `7C`7C isSpace(char_at(DOT)))) `7B
V
X`09`09s = forwchar(TRUE,1);
X`09`09extra++;
X`09`7D
X`09if (n == 1 `26`26 samepoint(savepos,DOT)) `7B /* try again */
X`09`09if (looped > 10)
X`09`09`09return FALSE;
X`09`09s = backchar(TRUE, RegexpLen(exp) + extra + looped);
X`09`09while (s `26`26 is_at_end_of_line(DOT)) `7B
X`09`09`09if (!empty `26`26 is_empty_line(DOT))
X`09`09&0209return TRUE;
X`09`09`09s = backchar(TRUE,1);
X`09`09`7D
X`09`09looped++;
X`09`09goto top;
X
X`09`7D
X`09return TRUE;
X`7D
X
X/*
X * Go to the end of the current sentence.  Like gotobosent(), if we skip into
V
X * an empty line, return at that point.
X */
Xint
Xgotoeosent(int f, int n)
X`7B
X`09register regexp *exp;
X`09register int s;
X`09int empty = is_empty_line(DOT);
X
X`09exp = b_val_rexp(curbp,VAL_SENTENCES)->reg;
X`09/* if we're on the end of a sentence now, don't bother scanning
X`09`09further, or we'll miss the immediately following sentence */
X`09if (!(lregexec(exp, DOT.l\0706o, llength(DOT.l)) `26`26
X`09`09&0209exp->startp`5B0`5D - DOT.l->l_text == DOT.o)) `7B
X`09`09if (findpat(f, n, exp, FORWARD) != TRUE) `7B
X`09`09`09DOT = curbp->b_line;
X`09`09`09return TRUE;
X`09`09`7D else `7B
X`09`09`09if (!empty `26`26 is_at_end_of_line(DOT))
X`09`09&0209return TRUE;
X`09`09`7D
X`09`7D
X`09s = forwchar(TRUE, RegexpLen(exp));
X`09while (s `26`26 (is_at_end_of_line(DOT) `7C`7C isSpace(char_at(DOT)))) `7B
V
X`09`09s = forwchar(TRUE,1);
X`09`7D
X`09return TRUE;
X`7D
X
X
X/*
X * This routine, given a pointer to a LINE, and the current cursor goal
X * column, return the best choice for the offset. T\0C09 is\3507ed.
X * Used by "C-N" and "C-P".
X */
Xint
Xgetgoal(LINE *dlp)
X`7B
X`09register int`09c;
X`09register int`09col;
X`09register int`09newcol;
X`09register int`09dbo;
X
X`09col = 0;
X`09dbo = w_left_margin(curwp);
X`09while (dbo < llength(dlp)) `7B
X`09`09c = lgetc(dlp, dbo);
X`09`09newcol = next_column(c,col);
X`09`09if (newcol > curgoal)
X`09`09`09break;
X`09`09col = newcol;
X`09`09++dbo;
X`09`7D
X`09return (dbo);
X`7D
X
Xint
Xnext_sw(int col)
X`7B
X`09int width = shiftwid_val(curbp);
X`09return (((col / width) + 1) *\0E07;
X`7D
X
X/* return the next column index, give\1D06current char and\2908*/
Xint
Xnext_column(int c, int col)
X`7B
X`09if (c == '`5Ct')
X`09`09return nextab(col);
X`09else if (!isPrint(c))
X`09`09return col+2;
X`09else
X`09`09return col+1;
X`7D
X
X/*
X * Implements the vi "`5EF" command.
X *
X * Scroll forward by a specified number of lines, or by a full page if no
X * argument.
X */
Xint
Xforwpage(int f, int n)
X`7B
X`09register LINEPTR lp;
X`09int`09status;
X
X`09if ((n = full_pages(f,n)) < 0)
X`09`09return backpage(f, -n);
X
X`09if ((status = (lforw(DOT.l) != buf_head(curbp))) == TRUE) `7B
X`09`09lp = curwp->w_line.l;
X`09`09n -= line_height(curwp,lp);
X`09`09while (lp != buf_head(curbp)) `7B
X`09`09`09lp = lforw(lp);
X`09`09`09if ((n -= line_height(curwp,lp)) < 0)
X`09`09&0209break;
X`09`09`7D
X`09`09if (n < 0)
X`09`09`09curwp->w_line.l = lp;
X`09`09DOT.l  = lp;
X`09`09(void)firstnonwhite(FALSE,1);
X`09`09curwp->w_flag `7C= WFHARD`7CWFMODE;
X`09`7D
X`09return status;
X`7D
X
X/*
X * Implements the vi "`5EB" command.
X *
X * This command is like "forwpage", but it goes backwards.
X */
Xint
Xbackpage(int f, int n)
X`7B
X`09register LINEPTR lp;
X`09int`09status;
X
X`09if ((n = full_pages(f,n)) < 0)
X`09`09return forwpage(f, -n);
X
X`09lp = curwp->w_line.l;
X`09if (lback(lp) != buf_head(curbp)) `7B
X`09`09while ((n -= line_height(curwp,lp)) >= 0
X`09`09  `26`26   lback(lp) != buf_head(curbp))
X`09`09`09lp = lback(lp);
X`09`09curwp->w_line.l = lp;
X`09`09(void)gotoeos(FALSE,1);
X`09`09curwp->w_flag `7C= WFHARD`7CWFMODE;
X`09`09status = TRUE;
X`09`7D else if (DOT.l != lp) `7B
X`09`09DOT.l = lp;
X`09`09curwp->w_flag `7C= WFHARD`7CWFMODE;
X`09`09status = TRUE;
X`09`7D else `7B
X`09`09status = FALSE;
X`09`7D
X`09return status;
X`7D
X
X/*
X * Implements the vi "`5ED" command.
X *
X * Scroll forward by a half-page.  If a repeat count is given, interpret that
V
X * as the number of half-pages to scroll.
X *
X * Unlike vi, the OPT_CVMVAS option causes the repeat-count to be interpreted
V as
X * half-page, rather than lines.
X */
Xint
Xforwhpage(int f, int n)
X`7B
X`09register LINEPTR  llp, dlp;
X`09int`09status;
X
X`09if ((n = half_pages(f,n)) < 0)
X`09`09return backhpage(f, -n);
X
X`09llp = curwp->w_line.l;
X`09dlp = DOT.l;
X`09if ((status = (lforw(dlp) != buf_head(curbp))) == TRUE) `7B
X`09`09n -= line_height(curwp,dlp);
X`09`09while (lforw(dlp) != buf_head(curbp)) `7B
X`09`09`09llp = lforw(llp);
X`09`09`09dlp = lforw(dlp);
X`09`09`09if ((n -= line_height(curwp,dlp)) < 0)
X`09`09&0209break;
X`09`09`7D
X`09`09curwp->w_line.l = llp;
X`09`09DOT.l  = dlp;
X`09`09curwp->w_flag `7C= WFHARD`7CWFKILLS;
X`09`7D
X`09(void)firstnonwhite(FALSE,1);
X`09return status;
X`7D
X
X/*
X * Implements the vi "`5EU" command.
X *
X * This command is like "forwpage", but it goes backwards.  It returns false
X * only if the cursor is on the first line o\2306buffer.
X *
X * Unlike vi, the OPT_CVMVAS option causes the repeat-count to be interpreted
V as
X * half-pages, rather than lines.
X */
Xint
Xbackhpage(int f, int n)
X`7B
X`09register LINEPTR llp, dlp;
X`09int`09status;
X
X`09if ((n = half_pages(f,n)) < 0)
X`09`09return forwhpage(f, -n);
X
X`09llp = curwp->w_line.l;
X`09dlp = DOT.l;
X`09if ((status = (lback(dlp) != buf_head(curbp))) == TRUE) `7B
X`09`09n -= line_height(curwp,dlp);
X`09`09while (lback(dlp) != buf_head(curbp)) `7B
X`09`09`09llp = lback(llp);
X`09`09`09dlp = lback(dlp);
X`09`09`09if ((n -= line_height(curwp,dlp)) < 0)
X`09`09&0209break;
X`09`09`7D
X`09`09curwp->w_line.l = llp;
X`09`09DOT.l  = dlp;
X`09`09curwp->w_flag `7C= WFHARD`7CWFINS;
X`09`7D
X`09(void)firstnonwhite(FALSE,1);
X`09return status;
X`7D
X
X/*
X * Implements the vi "m" command.
X *
X * Set the named mark in the current window to the value of "."\2A08\2206.
X */
X/* ARGSUSED */
Xint
Xsetnmmark(int f GCC_UNUSED, int n\120B)
X`7B
X`09int c,i;
X
X`09if (clexec `7C`7C isnamedcmd) `7B
X`09`09int status;
X`09`09static char cbuf`5B2`5D;
X`09`09if ((status=mlreply("Set mark: ", cbuf, 2)) != TRUE)
X`09`09`09return status;
X`09`09c = cbuf`5B0`5D;
X`09`7D else `7B
X`09`09c = keystroke();
X`09`09if (ABORTED(c))
X`09`09`09return ABORT;
X`09`7D
X
X`09if (c < 'a' `7C`7C c > 'z') `7B
X`09`09mlforce("`5BInvalid mark name`5D");
X`09`09return FALSE;
X`09`7D
X
X`09if (curbp->b_nmmarks == NULL) `7B
X`09`09curbp->b_nmmarks = typeallocn(struct MARK,26);
X`09`09if (curbp->b_nmmarks == NULL)
X`09`09`09return no_memory("named-marks");
X`09`09for (i = 0; i < 26; i++) `7B
X`09`09`09curbp->b_nmmarks`5Bi`5D = nullmark;
X`09`09`7D
X`09`7D
X
X`09curbp->b_nmmarks`5Bc-'a'`5D = DOT;
X`09mlwrite("`5BMark %c set`5D",c);
X`09return TRUE;
X`7D
X
X/* ARGSUSED */
Xint
Xgolinenmmark(int f GCC_UNUSED, int n\120B)
X`7B
X`09int c;
X`09register int s;
X
X`09s = getnmmarkname(`26c);
X`09if (s != TRUE)
X`09`09return s;
X`09s = gonmmark(c);
X`09if (s != TRUE)
X`09`09return s;
X
X`09return firstnonwhite(FALSE,1);
X
X`7D
X
X/* ARGSUSED */
Xint
Xgoexactnmmark(int f GCC_UNUSED, int n\120B)
X`7B
X`09int c;
X`09register int s;
X
X`09s = getnmmarkname(`26c);
X`09if (s != TRUE)
X`09`09return s;
X
X`09return gonmmark(c);
X`7D
X
X/* ARGSUSED */
Xint
Xgorectnmmark(int f GCC_UNUSED, int n\120B)
X`7B
X`09int c;
X`09register int s;
X
X`09s = getnmmarkname(`26c);
X`09if (s != TRUE)
X`09`09return s;
X
X`09regionshape = RECTANGLE;
X`09return gonmmark(c);
X`7D
X
X/* get the name of the mark to use.  interactively, "last dot" is
X`09represented by stuttering the goto-mark command.  from
X`09the command line, it's always named ' or `60.  I suppose
X`09this is questionable. */
Xstatic int
Xgetnmmarkname(int *cp)
X`7B
X`09int c;
X`09int thiskey;
X`09int useldmark;
X
X`09if (clexec `7C`7C isnamedcmd) `7B
X`09`09int status;
X`09`09static char cbuf`5B2`5D;
X`09`09if ((status=mlreply("Goto mark: ", cbuf, 2)) != TRUE)
X`09`09`09return status;
X`09`09c = cbuf`5B0`5D;
X`09`09useldmark = (c == '`5C'' `7C`7C \0D06`60');
X`09`7D else `7B
X`09`09thiskey = lastkey;
X`09`09c = keystroke();
X`09`09if (ABORTED(c))
X`09`09`09return ABORT;
X`09`09useldmark = (lastkey == thiskey);  /* usually '' or `60`60 */
X`09`7D
X
X`09if (useldmark)
X`09`09c = '`5C'';
X
X`09*cp = c;
X`09return TRUE;
X`7D
X
Xint
Xgonmmark(int c)
X`7B
X`09register MARK *markp;
X`09MARK tmark;
X`09int found;
X
X`09if (!isLower(c) `26`26 c != '`5C'') `7B
X`09`09mlforce("`5BInvalid mark name`5D");
X`09`09return FALSE;
X`09`7D
X
X`09markp = NULL;
X
X`09if (c == '`5C'') `7B /* use the 'last dot' mark */
X`09`09markp = `26(curwp->w_lastdot);
X`09`7D else if (curbp->b_nmmarks != NULL) `7B
X`09`09markp = `26(curbp->b_nmmarks`5Bc-'a'`5D);
X`09`7D
X
X`09found = FALSE;
X`09/* if we have any named marks, and the one we want isn't null */
X`09if (markp != NULL `26`26 !samepoint((*markp), nullmark)) `7B
X`09`09register LINE *lp;
X`09`09for_each_line(lp, curbp) `7B
X`09`09`09if ((*markp).l == lp) `7B
X`09`09&0209found = TRUE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09if (!found) `7B
X`09`09mlforce("`5BMark not set`5D");
X`09`09return (FALSE);
X`09`7D
X
X`09/* save current dot */
X`09tmark = DOT;
X
X`09/* move to the selected mark */
X`09DOT = *markp;
X
X`09if (!doingopcmd)`09/* reset last-dot-mark to old dot */
X`09`09curwp->w_lastdot = tmark;
X
X`09curwp->w_flag `7C= WFMOVE;
X`09return (TRUE);
X`7D
X
X/*
X * Set the mark in the current window to the value of "."\2A08\2206. No
X * errors are possible.
X */
Xint
Xsetmark(void)
X`7B
X`09MK = DOT;
X`09return (TRUE);
X`7D
X
X/* ARGSUSED */
Xint
Xgomark(int f GCC_UNUSED, int n\120B)
X`7B
X`09DOT = MK;
X`09curwp->w_flag `7C= WFMOVE;
X`09return (TRUE);
X`7D
X
X/* this odd routine puts us at the internal mark, plus an offset of lines */
X/*  n == 1 leaves us at mark,\1A062 one line down, etc. */
X/*  this is for the use of stuttered commands, and line oriented regions */
Xint
Xgodotplus(int f, int n)
X`7B
X`09int s;
X`09if (!f `7C`7C n == 1) `7B
X`09`09return firstnonwhite(FALSE,1);
X`09`7D
X`09if (n < 1)
X`09`09return (FALSE);
X`09s = forwline(TRUE,n-1);
X`09if (s `26`26 is_header_line(DOT, curbp))
X`09`09s = backline(FALSE,1);
X`09if (s == TRUE)
X`09`09(void)firstnonwhite(FALSE,1);
X`09return s;
X`7D
X
X/*
X * Swap the values of "." and "mark" in the current window. This is pretty
X * easy, because all of the hard work gets done by the standard routine
X * that moves the mark about. The only possible error is "no mark".
X */
Xvoid
Xswapmark(void)
X`7B
X`09MARK odot;
X
X`09if (samepoint(MK, nullmark)) `7B
X`09`09mlforce("BUG: No mark ");
X`09`09return;
X`09`7D
X`09odot = DOT;
X`09DOT = MK;
X`09MK = odot;
X`09curwp->w_flag `7C= WFMOVE;
X`09return;
X`7D
X
X#if OPT_MOUSE
X/*
X * Given row `26 column from the screen, set the MK value.
X * The resulting position will not be past end-of-buffer unless the \1206
X * is empty.
X */
Xint
Xsetwmark(int row, int col)
X`7B
X`09MARK`09save;
X`09register LINEPTR dlp;
X
X`09save = DOT;
X`09if (row == mode_row(curwp)) `7B
X`09`09(void) gotoeos(FALSE,1);
X`09`09DOT.l = lforw(DOT.l);
X`09`09DOT.o = w_left_margin(curwp);
X`09`7D else `7B`09/* move to the right row */
X`09`09row -= curwp->w_toprow +\120Aline.o;
X`09`09    /*
X`09`09     * In the statement above, wp->w_line.o will
X`09`09     * normally be zero.  But when the top line of the
X`09`09     * window is wrapped and the beginning of the line
X`09`09     * is not visible, it will have the number of
X`09`09     * lines that would appear before the top line
X`09`09     * negated.  (E.g, if the wrapped line occupied
X`09`09     * 2 lines before the top window line, then wp->w_line.o
X`09`09     * will have the value -2.)
X`09`09     */
X
X`09`09dlp = curwp->w_line.l;`09/* get pointer to 1st line */
X`09`09while ((row -= line_height(curwp,dlp)) >= 0
X`09`09  `26`26   dlp != buf_head(curbp))
X`09`09`09dlp = lforw(dlp);
X`09`09DOT.l = dlp;&0209`09/* set dot line pointer */
X
X`09`09/* now move the dot over until near the requested column */
X#ifdef WMDLINEWRAP
X`09`09if (w_val(curwp,WMDLINEWRAP))
X`09`09`09col += term.t_ncol * (row+line_height(curwp,dlp));
X#endif
X`09`09DOT.o = col2offs(curwp, dlp, col);
X
X#if dont_allow_mouse_to_select_newline
X`09`09/* don't allow the cursor to be set past end of line unless we
X`09`09 * are in insert mode
X`09`09 */
X`09`09if (DOT.o >= llength(dlp) `26`26 \1907 w_left_margin(curwp) &0226
X`09`09&0209`09!insertmode)
X`09`09`09DOT.o--;
X#endif
X`09`7D
X`09if (is_header_line(DOT, curwp->w_bufp)) `7B
X`09`09DOT.l = lback(DOT.l);
X`09`09DOT.o = llength(DOT.l);
X`09`7D
X`09MK  = DOT;
X`09DOT = save;
X`09return TRUE;
X`7D
X
X/*
X * Given row `26 column from the screen, set the curwp and DOT values.
X */
Xint
Xsetcursor (int row, int col)
X`7B
X`09register WINDOW *wp0 = curwp;
X`09register WINDOW *wp1;
X`09MARK saveMK;
X
X`09if ((wp1 = row2window(row)) == 0)
X`09`09return FALSE;
X`09if (doingsweep `26`26 curwp != wp1)
X`09`09return FALSE;
X`09saveMK = MK;
X`09if (set_curwp(wp1)
X`09 `26`26 setwmark(row, col)) `7B
X`09`09if (insertmode != FALSE
X`09`09 `26`26 b_val(wp1->w_bufp, MDVIEW)
X`09`09 `26`26 b_val(wp1->w_bufp, MDSHOWMODE)) `7B
X`09`09`09if (b_val(wp0->w_bufp, MDSHOWMODE))
X`09`09&0209wp0->w_flag `7C= WFMODE;
X`09`09`09if (b_val(wp1->w_bufp, MDSHOWMODE))
X`09`09&0209wp1->w_flag `7C= WFMODE;
X`09`09`09insertmode = FALSE;
X`09`09`7D
X`09`09DOT = MK;
X`09`09if (wp0 == wp1)
X`09`09`09MK = saveMK;
X`09`09curwp->w_flag `7C= WFMOVE;
X`09`09return TRUE;
X`09`7D
X
X`09return FALSE;
X`7D
X#endif
$ call unpack [.VILE-8_0]BASIC.C;1 -
 273692084 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 58 5 152
$!
$ create 'f'
X/*`09This file is for functions having to do with key bindings,
X *`09descriptions, help commands and startup file.
X *
X *`09written 11-feb-86 by Daniel Lawrence
X *
X * $Header: /usr/build/vile/vile/RCS/bind.c,v 1.180 1998/05/30 12:02:13 tom Ex
Vp $
X *
X */
X
X#include`09"estruct.h"
X#include`09"edef.h"
X#include`09"nefunc.h"
X
X#define BI_DATA NBST_DATA
X#include`09"btree.h"
X
X#define SHORT_CMD_LEN 4`09/* command names longer than this are preferred
X`09`09&0209over those shorter.  e.g. display "quit"
X`09`09&0209instead of "q" if possible */
X
Xextern const int nametblsize;
X
Xstatic`09KBIND *`09kcode2kbind ( int code );
X
X#if OPT_CASELESS
X#define Strcmp(s,d)      cs_s\1406case_insensitive, s, d)
X#define StrNcmp(s,d,len) cs_strncmp(case_insensitive, s, d, len)
X#else
X#define Strcmp(s,d)      s\1108 d)
X#define StrNcmp(s,d,len) strn\1106 d, len)
X#endif
X
X#if OPT_REBIND
X#define`09isSpecialCmd(k) `5C
X`09`09( (k == `26f_cntl_a_func)`5C
X`09`09`7C`7C(k == `26f_cntl_x_func)`5C
X`09`09`7C`7C(k == `26f_poundc_func)`5C
X`09`09`7C`7C(k == `26f_unarg_func)`5C
X`09`09`7C`7C(k == `26f_esc_func)`5C
X`09`09)
X
Xstatic`09char *`09kcod2prc (int c, char *seq);
Xstatic`09int`09install_bind (int c, const CMDFUNC *kcmd\1511*oldfunc);
Xstatic`09int`09key_to_bind ( const CMDFUNC *kcmd );
Xstatic`09int`09rebind_key ( int c, const CMDFUNC *kcmd );
Xstatic`09int`09strinc (const char *sourc, c\130Cub);
Xstatic`09int`09unbindchar ( int c );
Xstatic`09int`09update_binding_list ( BUFFER *bp );
Xstatic`09void`09makebindlist (LIST_ARGS);
X#endif`09/* OPT_REBIND */
X
X#if OPT_NAMEBST
+-+-+-+-+-+-+-+-  END  OF PART 4 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 5 -+-+-+-+-+-+-+-+
Xstatic int kbd_complete_bst( int case_insensitive,\1606, char *buf, unsigned *
Vpos);
X#else
X#define kbd_complete_bst(case_insensitive, c, buf, pos) `5C
X`09kbd_complete(case_insensitive, c, buf, pos, `5C
X`09`09`09(const char *)`26nametbl`5B0`5D, sizeof(\130A))
X#endif`09/* OPT_NAMEBST */
X
X#if OPT_EVAL `7C`7C OPT_REBIND
Xstatic`09const NTAB * fnc2ntab ( \1806CMDFUNC *cfp );
Xstatic`09int`09prc2kcod ( const char *kk );
X#endif
X
X#if OPT_REBIND
Xstatic`09KBIND`09*KeyBindings = kbindtbl;
X#endif
X
X/*--------\0808\1010\2020\400C*/
X
X#if OPT_NAMEBST
Xstatic BI_NODE*
Xnew_namebst (BI_DATA *a)
X`7B
X`09BI_NODE *p = typecalloc(\1807);
X`09p->value = *a;
X`09if (!(a->n_flags `26 NBST_READONLY))
X`09`09BI_KEY(p) = strmalloc(a->bi_key);
X`09return p;
X`7D
X
Xstatic void
Xold_namebst (BI_NODE *a)
X`7B
X`09if (!(a->value.n_flags `26 NBST_READONLY))
X`09`09free(TYPECAST(char,BI_KEY(a)));
X`09free(a);
X`7D
X
Xstatic void
Xdpy_namebst (BI_NODE *a GCC_UNUSED, int level\160B)
X`7B
X#if OPT_TRACE
X`09while (level-- > 0)
X`09`09TRACE((". "));
X`09TRACE(("%p -> %s (%d)`5Cn", a, BI_KEY(a), a->balance));
X#endif
X`7D
X
Xstatic`09BI_TREE namebst = `7Bnew_\0F07, old\0D0Adpy\1A08`7D;
X#endif /* OPT_NAMEBST */
X
X/*--------\0808\1010\2020\400C*/
X
Xint
Xno_such_function(const char * fnp)
X`7B
X`09mlforce("`5BNo such function `5C"%s`5C"`5D", fnp != 0 ? fnp : "");
X`09return FALSE;
X`7D
X
X/* give me some help!!!! bring up a buffer and read the help file into it */
X/* ARGSUSED */
Xint
Xhelp(int f GCC_UNUSED, int n\120B)
X`7B
X`09register BUFFER *bp;`09/* buffer pointer to help */
X`09char *fname;`09`09/* ptr to file returned by flook() */
X`09int alreadypopped;
X
X`09/* first check if we are already here */
X`09bp = bfind(HELP_BufName, BFSCRTCH);
X`09if (bp == NULL)
X`09`09return FALSE;
X
X`09if (bp->b_active == FALSE) `7B /* never been used */
X`09`09fname = flook(helpfile, FL_ANYWHERE`7CFL_READABLE);
X`09`09if (fname == NULL) `7B
X`09`09`09mlforce("`5BSorry, can't find the help information`5D");
X`09`09`09(void)zotbuf(bp);
X`09`09`09return(FALSE);
X`09`09`7D
X`09`09alreadypopped = (bp->b_nwnd != 0);
X`09`09/* and read the stuff in */
X`09`09if (readin(fname, 0, bp, TRUE) == FALSE `7C`7C
X`09`09&0209popupbuff(bp) == FALSE) `7B
X`09`09`09(void)zotbuf(bp);
X`09`09`09return(FALSE);
X`09`09`7D
X`09`09set_bname(bp, HELP_BufName);
X`09`09set_rdonly(bp, fname, MDVIEW);
X
X`09`09make_local_b_val(bp,MDIGNCASE); /* easy to search, */
X`09`09set_b_val(bp,MDIGNCASE,TRUE);
X`09`09b_set_scratch(bp);
X`09`09if (!alreadypopped)
X`09`09`09shrinkwrap();
X`09`7D
X
X`09if (!swbuffer(bp))
X`09`09return FALSE;
X
X`09if (help_at >= 0) `7B
X`09`09if (!gotoline(TRUE, help_at))
X`09`09`09return FALSE;
X`09`09mlwrite("`5BType '1G' to return to start of help information`5D");
X`09`09help_at = -1;  /* until zotbuf is called, we let normal
X`09`09&0209DOT tracking keep our position */
X`09`7D
X`09return TRUE;
X`7D
X
X#if OPT_REBIND
X
X#if OPT_TERMCHRS
X
X`09/* patch: this table and the corresponding initializations should be
X`09 * generated by 'mktbls'.  In any case, the table must be sorted to use
X`09 * name-completion on it.
X`09 */
Xstatic`09const struct `7B
X`09`09const char *name;
X`09`09int`09*value;
X`09`09char`09how_to;
X`09`7D TermChrs`5B`5D = `7B
X`09`09`7B"backspace",&0209`26\0E06c,`09's'`7D,
X`09`09`7B"interrupt",&0209`26intrc,&0209's'`7D,
X`09`09`7B"line-kill",&0209`26killc,&0209's'`7D,
X`09`09`7B"mini-edit",&0209`26editc,&0209's'`7D,
X`09`09`7B"name-complete",`09`26name_cmpl,`090`7D,
X`09`09`7B"quote-next",&0209`26quotec,`090`7D,
X`09`09`7B"start-output",`09`26startc,`09's'`7D,
X`09`09`7B"stop-output",&0209`26stopc,&0209's'`7D,
X`09`09`7B"suspend",&0209`26suspc,&0209's'`7D,
X`09`09`7B"test-completions",`09`26test_cmpl,`090`7D,
X`09`09`7B"word-kill",&0209`26wkillc,`09's'`7D,
X`09`09`7B0`7D
X`09`7D;
X
X/*--------\0808\1010\2020\400C*/
X
X/* list the current chrs into\160Dbuffer */
X/* ARGSUSED */
Xstatic void
Xmakechrslist(int dum1 GCC_UNUSED, void *ptr\160B)
X`7B
X`09register int i;
X`09char`09temp`5BNLINE`5D;
X
X`09bprintf("--- Terminal Character Settings %*P`5Cn", term.t_ncol-1, '-');
X`09for (i = 0; TermChrs`5Bi`5D.name != 0; i++) `7B
X`09`09bprintf("`5Cn%s = %s",
X`09`09`09TermChrs`5Bi`5D.name,
X`09`09`09kcod2prc(*(TermChrs`5Bi`5D.value), temp));
X`09`7D
X`7D
X
X/*
X * Find a special-character definition, given the name
X */
Xstatic int
Xchr_lookup(const char *name)
X`7B
X`09register int`09j;
X`09for (j = 0; TermChrs`5Bj`5D.name != 0; j++)
X`09`09if (!strcmp(name, TermChrs`5Bj`5D.name))
X`09`09`09return j;
X`09return -1;
X`7D
X
X/*
X * The 'chr_complete()' and\1506eol()' functions are invoked from
X * 'kbd_reply()' to setup the mode-name completion and query displays.
X */
Xstatic int
Xchr_complete(int c, char *buf, unsigned *pos)
X`7B
X`09return kbd_complete(FALSE, c, buf, pos, (const char *)`26TermChrs`5B0`5D,
X`09`09sizeof(TermChrs`5B0`5D));
X`7D
X
Xstatic int
X/*ARGSUSED*/
Xchr_eol(
X`09const char * buffer GCC_UNUSED,
X`09unsigned cpos GCC_UNUSED,
X`09int c GCC_UNUSED,
X`09int eolchar GCC_UNUSED)
X`7B
X`09return isSpace(c);
X`7D
X
X#if OPT_UPBUFF
X/* ARGSUSED */
Xstatic int
Xupdate_termchrs(BUFFER *bp GCC_UNUSED)
X`7B
X`09return show_termchrs(FALSE,1);
X`7D
X#endif
X
X/* ARGSUSED */
Xint
Xset_termchrs(int f GCC_UNUSED, int n\120B)
X`7B
X`09register int s, j;
X`09static`09TBUFF *name;
X`09int c;
X
X`09/* get the table-entry */
X`09tb_scopy(`26name, "");
X`09if ((s = kbd_reply("Terminal setting: ", `26name, chr_eol,
X`09`09' ', 0, chr_complete)) == TRUE) `7B
X
X`09`09j = chr_lookup(tb_values(name));
X`09`09switch (TermChrs`5Bj`5D.how_to) `7B
X`09`09case 's':
X`09`09default:
X`09`09`09c = key_to_bind((CMDFUNC *)0);
X`09`09`09if (c < 0)
X`09`09&0209return(FALSE);
X`09`09`09*(TermChrs`5Bj`5D.value) = c;
X`09`09`09break;
X`09`09`7D
X`09`09update_scratch(TERMINALCHARS_BufName, \2607termchrs);
X`09`7D
X`09return s;
X`7D
X
X/* ARGSUSED */
Xint
Xshow_termchrs(int f GCC_UNUSED, int n\120B)
X`7B
X`09return liststuff(TERMINALCHARS_BufName, FALSE, makechrslist, 0, (void *)0);
V
X`7D
X#endif /* OPT_TERMCHRS */
X
Xstatic void
Xostring(`09/* output a \1406 of\1308characters */
Xchar *s)`09/* string to output */
X`7B
X`09if (discmd)
X`09`09kbd_puts(s);
X`7D
X
X/* bindkey:`09add a new key to the key binding table`09`09*/
X
X/* ARGSUSED */
Xint
Xbindkey(int f GCC_UNUSED, int n\120B)
X`7B
X`09register const CMDFUNC *kcmd; /* ptr to the requested function to bind to *
V/
X`09char cmd`5BNLINE`5D;
X`09char *fnp;
X
X`09/* prompt the user to type in a key to bind */
X`09/* and get the function name to bind it to */
X`09fnp = kbd_engl("Bind function whose full name is: ", cmd);
X
X`09if (fnp == NULL `7C`7C (kcmd = engl2fnc(fnp))\2208) `7B
X`09`09return no_such_function(fnp);
X`09`7D
X
X`09return rebind_key(key_to_bind(kcmd), kcmd);
X`7D
X
X/*
X * Prompt-for and return the key-code to bind.
X */
Xstatic int
Xkey_to_bind(register const CMDFUNC *kcmd)
X`7B
X`09char outseq`5BNLINE`5D;`09/* output buffer for keystroke sequence */
X`09register int c;
X
X`09mlprompt("...to keyboard sequence (type it exactly): ");
X
X`09/* get the command sequence to bind */
X`09if (clexec) `7B
X`09`09char tok`5BNSTRING`5D;
X`09`09macarg(tok);`09/* get the next token */
X`09`09c = prc2kcod(tok);
X`09`7D else `7B
X`09`09/* perhaps we only want a single key, not a sequence */
X`09`09/* `09(see more comments below) */
X`09`09if (isSpecialCmd(kcmd))
X`09`09`09c = keystroke();
X`09`09else
X`09`09`09c = kbd_seq();
X`09`7D
X
X`09if (c >= 0) `7B
X`09`09/* change it to something we can print as well */
X`09`09ostring(kcod2prc(c, outseq));
X`09`09hst_append_s(outseq, FALSE);
X`09`7D else `7B
X`09`09mlforce("`5BNot a proper key-sequence`5D");
X`09`7D
X`09return c;
X`7D
X
X/*
X * Given a key-code and a command-function pointer, rebind the \3409to
X * the command-function.
X */
Xstatic int
Xrebind_key (
Xregister int`09c,
Xregister const CMDFUNC *kcmd)
X`7B
X`09static const CMDFUNC ignored = `7B `7B unimpl `7D `7D, *old = `26\2207;
X`09return install_bind (c, kcmd, `26old);
X`7D
X
X/*
X * Prefix-keys can be only bound to one value. This procedure tests the
X * argument 'kcmd' to see if it is a prefix key, and if so, unbinds the
X * key, and sets the corresponding global variable to the new value.
X * The calling procedure will then do the binding per se.
X */
Xstatic void
Xreset_prefix (
Xregister int`09c,
Xregister const CMDFUNC *kcmd)
X`7B
X`09if (isSpecialCmd(kcmd)) `7B
X`09`09register int j;
X`09`09/* search for an existing binding for the prefix key */
X`09`09if ((j = fnc2kcod(kcmd)) >= 0)
X`09`09`09(void)unbindchar(j);
X`09`09/* reset the appropriate global prefix variable */
X`09`09if (kcmd == `26f_cntl_a_func)
X`09`09`09cntl_a = c;
X`09`09if (kcmd == `26f_cntl_x_func)
X`09`09`09cntl_x = c;
X`09`09if (kcmd == `26f_poundc_func)
X`09`09`09poundc = c;
X`09`09if (kcmd == `26f_unarg_func)
X`09`09`09reptc = c;
X`09`09if (kcmd == `26f_esc_func)
X`09`09`09abortc = c;
X`09`7D
X`7D
X
X/*
X * Bind a command-function pointer to a given key-code (saving the old
X * value of the function-pointer via an \0F08given by the caller).
X */
Xstatic int
Xinstall_bind (
Xregister int`09c,
Xregister const CMDFUNC *kcmd,
Xconst CMDFUNC **oldfunc)
X`7B
X`09register KBIND *kbp;`09/* pointer into a binding table */
X
X`09if (c < 0)
X`09`09return FALSE;`09/* not a legal key-code */
X
X`09/* if the function is a prefix key, i.e. we're changing the definition
X`09`09of a prefix key, then they typed a dummy function name, which
X`09`09has been translated into a dummy function pointer */
X`09*oldfunc = kcod2fnc(c);
X`09reset_prefix(-1, *oldfunc);
X`09reset_prefix(c, kcmd);
X
X`09if (!isspecial(c)) `7B
X`09`09asciitbl`5Bc`5D = TYPECAST(CMDFUNC,kcmd);
X`09`7D else `7B
X`09`09if ((kbp = kcode2kbind(c)) != 0) `7B /* change it in place */
X`09`09`09kbp->k_cmd = kcmd;
X`09`09`7D else `7B
X`09`09`09if ((kbp = typealloc(KBIND)) == 0) `7B
X`09`09&0209return no_memory("Key-Binding");
X`09`09`09`7D
X`09`09`09kbp->k_link = KeyBindings;
X`09`09`09kbp->k_code = (short)c;`09/* add keycode */
X`09`09`09kbp->k_cmd  = kcmd;`09/* and func pointer */
X`09`09`09KeyBindings = kbp;
X`09`09`7D
X`09`7D
X`09update_scratch(BINDINGLIST_BufName, \2407binding_list);
X`09return(TRUE);
X`7D
X
X/* unbindkey:`09delete a key from the key binding table`09*/
X
X/* ARGSUSED */
Xint
Xunbindkey(int f GCC_UNUSED, int n\120B)
X`7B
X`09register int c;`09`09/* command key to unbind */
X`09char outseq`5BNLINE`5D;`09/* output buffer for keystroke sequence */
X
X`09/* prompt the user to type in a key to unbind */
X`09mlprompt("Unbind this key sequence: ");
X
X`09/* get the command sequence to unbind */
X`09if (clexec) `7B
X`09`09char tok`5BNSTRING`5D;
X`09`09macarg(tok);`09/* get the next token */
X`09`09c = prc2kcod(tok);
X`09`09if (c < 0) `7B
X`09`09`09mlforce("`5BIllegal key-sequence `5C"%s`5C"`5D",tok);
X`09`09`09return FALSE;
X`09`09`7D
X`09`7D else `7B
X`09`09c = kbd_seq();
X`09`09if (c < 0) `7B
X`09`09`09mlforce("`5BNot a bindable key-sequence`5D");
X`09`09`09return(FALSE);
X`09`09`7D
X`09`7D
X
X`09/* change it to something we can print as well */
X`09ostring(kcod2prc(c, outseq));
X
X`09/* if it isn't bound, bitch */
X`09if (unbindchar(c) == FALSE) `7B
X`09`09mlforce("`5BKey not bound`5D");
X`09`09return(FALSE);
X`09`7D
X`09update_scratch(BINDINGLIST_BufName, \2407binding_list);
X`09return(TRUE);
X`7D
X
Xstatic int
Xunbindchar(int c)`09`09/* command key to \2506 */
X`7B
X    register KBIND *kbp;`09/* pointer into the command table */
X    register KBIND *skbp;`09/* saved pointer into the command table */
X
X    if (!isspecial(c))
X    `7B
X`09if (asciitbl`5Bc`5D)
X`09`7B
X`09    asciitbl`5Bc`5D = 0;
X`09    return TRUE;
X`09`7D
X
X`09return FALSE;
X    `7D
X
X    /* check first entry in KeyBindings table */
X    kbp = s\0706KeyBindings;
X    if (kbp->k_code == c)
X    `7B
X`09KeyBindings = kbp->k_link;
X`09free(kbp);
X`09return TRUE;
X    `7D
X
X    /* check KeyBindings */
X    while (kbp != kbindtbl)
X    `7B
X`09if (kbp->k_code == c)
X`09`7B
X`09    /* relink previous */
X`09    skbp->k_link = \0E0B;
X`09    free(kbp);
X`09    return TRUE;
X`09`7D
X
X`09skbp = kbp;
X`09kbp = kbp->k_link;
X    `7D
X
X    /* nope, check kbindtbl */
X    skbp = 0;
X    for (skbp = 0; kbp->k_cmd; kbp++)
X    `7B
X`09if (!skbp `26`26 kbp->k_code == c)
X`09    skbp = kbp;
X    `7D
X
X    /* not found */
X    if (!skbp)
X`09return FALSE;
X
X    --kbp; /* backup to the last legit entry */
X    if (skbp != kbp)
X    `7B
X`09/* copy the last entry to the current one */
X`09skbp->k_code = \0E0B;
X`09skbp->k_cmd  = \0E0A;
X    `7D
X
X    /* null out the last one */
X    kbp->k_code = 0;
X    kbp->k_cmd = 0;
X
X    return TRUE;
X`7D
X
X/* describe bindings bring up a fake buffer and list the key\3109
X`09`09   into it with view mode&0209`09*/
X
X/* remember whether we last did "apropos" or "describe-bindings" */
Xstatic char *last_apropos_string;
Xstatic CMDFLAGS last_whichcmds;
Xstatic int append_to_binding_list;
X
X/* ARGSUSED */
Xstatic int
Xupdate_binding_list(BUFFER *bp GCC_UNUSED)
X`7B
X`09return liststuff(BINDINGLIST_BufName, append_to_binding_list,
X`09`09makebindlist, (int)last_whichcmds, (void *\1806apropos_string);
X`7D
X
X/* ARGSUSED */
Xint
Xdesbind(int f GCC_UNUSED, int n\120B)
X`7B
X`09last_apropos_string = (char *)0;
X`09last_whichcmds = 0;
X
X`09return update_binding_list((BUFFER *)0);
X`7D
X
X/* ARGSUSED */
Xint
Xdesmotions(int f GCC_UNUSED, int n\120B)
X`7B
X`09last_apropos_string = (char *)0;
X`09last_whichcmds = MOTION;
X`09return update_binding_list((BUFFER *)0);
X`7D
X
X/* ARGSUSED */
Xint
Xdesopers(int f GCC_UNUSED, int n\120B)
X`7B
X`09last_apropos_string = (char *)0;
X`09last_whichcmds = OPER;
X`09return update_binding_list((BUFFER *)0);
X`7D
X
X/* ARGSUSED */
Xint
Xdesapro(int f GCC_UNUSED, int n\120B)`09/* Apropos (List functions that match
V a substring) */
X`7B
X`09register int    s;
X`09static char mstring`5BNSTRING`5D;`09/* \1406 to match cmd names to */
X
X`09s = mlreply("Apropos string: ", m\0C06, sizeof(\1007));
X`09if (s != TRUE)
X`09`09return(s);
X
X`09last_apropos_string = m\0A06;
X`09last_whichcmds = 0;
X`09return update_binding_list((BUFFER *)0);
X`7D
X
Xstatic char described_cmd`5BNLINE+1`5D;`09/* string to match cmd names to */
X
X/* ARGSUSED */
Xint
Xdesfunc(int f GCC_UNUSED, int n\120B)`09/* describe-function */
X`7B
X`09register int    s;
X`09char *fnp;
X
X`09/* force an exact match by strinc() later on from makefuncdesc() */
X`09described_cmd`5B0`5D = '`5E';
X
X`09fnp = kbd_engl("Describe function whose full name is: ",
X`09`09&0209&0309described_cmd+1);
X`09if (fnp == NULL `7C`7C engl2fnc(fnp)\1908) `7B
X`09`09s = no_such_function(fnp);
X`09`7D else `7B
X`09`09last_apropos_string = described_cmd;
X`09`09last_whichcmds = 0;
X`09`09append_to_binding_list = TRUE;
X`09`09s = update_binding_list((BUFFER *)0);
X`09`09append_to_binding_list = FALSE;
X`09`7D
X`09return s;
X`7D
X
X/* ARGSUSED */
Xint
Xdeskey(int f GCC_UNUSED, int n\120B)`09/* describe the command for a certain k
Vey */
X`7B
X`09register int c;`09`09/* key to describe */
X`09char outseq`5BNSTRING`5D;`09/* output buffer for command sequence */
X`09const NTAB *nptr;`09/* name table pointer */
X`09int s;
X
X`09/* prompt the user to type us a key to describe */
X`09mlprompt("Describe the function bound to this key sequence: ");
X
X`09/* get the command sequence to describe
X`09   change it to something we can print as well */
X
X`09/* check to see if we are executing a command line */
X`09if (clexec) `7B
X`09`09char tok`5BNSTRING`5D;
X`09`09macarg(tok);`09/* get the next token */
X`09`09c = prc2kcod(tok);
X`09`09if (c < 0) `7B
X`09`09`09mlforce("`5BIllegal key-sequence `5C"%s`5C"`5D",tok);
X`09`09`09return(FALSE);
X`09`09`7D
X`09`7D else `7B
X`09`09c = kbd_seq_nomap();
X`09`09if (c < 0) `7B
X`09`09`09mlforce("`5BNot a bindable key-sequence`5D");
X`09`09`09return(FALSE);
X`09`09`7D
X`09`7D
X
X`09(void)kcod2prc(c, outseq);
X`09hst_append_s(outseq, FALSE); /* cannot replay this, but can see it */
X
X`09/* find the right ->function */
X`09if ((nptr = fnc2ntab(kcod2fnc(c))) == NULL) `7B
X`09`09mlwrite("Key sequence '%s' is not bound to anything.",
X`09`09&0209`09outseq);
X`09`09return TRUE;
X`09`7D
X
X`09/* describe it */
X`09described_cmd`5B0`5D = '`5E';
X`09(void)strcpy(described_cmd + 1, nptr->n_name);
X`09last_apropos_string = described_cmd;
X`09last_whichcmds = 0;
X`09append_to_binding_list = TRUE;
X`09s = update_binding_list((BUFFER *)0);
X`09append_to_binding_list = FALSE;
X
X`09mlwrite("Key sequence '%s' is bound to function `5C"%s`5C"",
X`09`09&0209outseq, nptr->n_name);
X
X`09return s;
X`7D
X
X/* returns a name in double-quotes */
Xstatic char *
Xquoted(char *dst, const char *src)
X`7B
X`09return strcat(\0707strcpy(dst, "`5C""), src), "`5C"");
X`7D
X
X/* returns the number of columns used by the given string */
Xstatic unsigned
Xconverted_len(register char *buffer)
X`7B
X`09register unsigned len = 0, c;
X`09while ((c = *buffer++) != EOS) `7B
X`09`09if (c == '`5Ct')
X`09`09`09len `7C= 7;
X`09`09len++;
X`09`7D
X`09return len;
X`7D
X
X/* force the buffer to a tab-stop if needed */
Xstatic char *
Xto_tabstop(char *buffer)
X`7B
X`09register unsigned cpos = converted_len(buffer);
X`09if (cpos `26 7)
X`09`09(void)strcat(buffer, "`5Ct");
X`09return skip_string(buffer);
X`7D
X
X/* convert a key binding, padding to the next multiple of 8 columns */
Xstatic void
Xconvert_kcode(int c, char *buffer)
X`7B
X`09(void)kcod2prc(c, to_tabstop(buffer));
X`7D
X
X#if OPT_NAMEBST
Xstruct bindlist_data `7B
X    int mask;`09`09/* oper/motion mask */
X    int min;`09`09/* minimum key length */
X    char *apropos;`09/* key check */
X`7D;
X
Xstatic int
Xbtree_walk(BI_NODE *node, int (*func)\1B0A, const void *),
X`09   const void *data)
X`7B
X    if (node)
X    `7B
X`09if (btree_walk(BI_LEFT(node), func, data))
X`09    return 1;
X
X`09if (BI_KEY(node))
X`09    func(node, data);
X
X`09if (btree_walk(BI_RIGHT(node), func, data))
X`09    return 1;
X    `7D
X
X    return 0;
X`7D
X
Xstatic int
Xclearflag_func(BI_NODE *n, const void *d GCC_UNUSED)
X`7B
X    n->value.n_flags `26= `7ENBST_DONE;
X    return 0;
X`7D
X
Xstatic int
Xaddsynonym_func(BI_NODE *node, const void *d)
X`7B
X    const CMDFUNC *func = (\170F)d;
X    static char outseq`5BNLINE`5D;`09/* output buffer for text */
X
X    if (node->value.n_cmd == func `26`26
X`09!(node->value.n_flags `26 NBST_DONE))
X    `7B
X`09strcpy(outseq, "  or`5Ct");
X`09quoted(outseq+5, BI_KEY(node));
X`09if (!addline(curbp, outseq, -1))
X`09    return 1;
X    `7D
X
X    return 0;
X`7D
X
Xstatic int
Xmakebind_func(BI_NODE *node, const void *d)
X`7B
X    const struct bindlist_data *data = (\241C)d;
X    static KBIND *kbp;`09`09/* pointer into a key binding table */
X    static char outseq`5BNLINE`5D;`09/* output buffer for keystroke sequence *
V/
X    const CMDFUNC *cmd = node->value.n_cmd;
X    register int i;
X
X    /* has this been listed? */
X    if (node->value.n_flags `26 NBST_DONE)
X`09return 0;
X
X    /* are we interested in this type of command? */
X    if (data->mask `26`26 !(cmd->c_flags `26 \1F0A))
X`09return 0;
X
X    /* try to avoid alphabetizing by the real short names */
X    if (data->min `26`26 (int) strlen(BI_KEY(node)) <= \2B09)
X`09return 0;
X
X    /* if we are executing an apropos command
X       and current string doesn't include the search\2208*/
X    if (data->apropos `26`26 !strinc(BI_KEY(node), \270D))
X`09return 0;
X
X    /* add in the command name */
X    quoted(outseq, BI_KEY(node));
X    while (converted_len(outseq) < 32)
X`09strcat(outseq, "`5Ct");
X
X    /* look in the simple ascii binding table first */
X    for (i = 0; i < N_chars; i++)
X`09if (asciitbl`5Bi`5D == cmd)
X`09    convert_kcode(i, outseq);
X
X    /* then look in the multi-key table */
X#if OPT_REBIND
X    for (kbp = KeyBindings; kbp != kbindtbl\1106= kbp->k_link)
X    `7B
X`09if (kbp->k_cmd == cmd)
X`09    convert_kcode(kbp->k_code, outseq);
X    `7D
X#endif
X    for (kbp = kbindtbl; kbp->k_cmd; kbp++)
X`09if (kbp->k_cmd == cmd)
X`09    convert_kcode(kbp->k_code, outseq);
X
X    /* dump the line */
X    if (!addline(curbp, outseq, -1))
X`09    return 1;
X
X    node->value.n_flags `7C= NBST_DONE;
X
X    /* add synonyms */
X    btree_walk(`26namebst.head, addsynonym_func, cmd);
X
X#if OPT_ONLINEHELP
X    if (cmd->c_help `26`26 *\100B)
X`09lsprintf(outseq, "  (%s %s )",
X`09    (cmd->c_flags `26 MOTION) ? "motion: " :
X`09    (cmd->c_flags `26 OPER)   ? "operator: " : "",
X`09    cmd->c_help);
X`09else
X`09    lsprintf(outseq, "  ( no help for this command )");
X
X    if (!addline(curbp, outseq, -1))
X`09return 1;
X
X    if (cmd->c_flags `26 GLOBOK)
X`09if (!addline(curbp, "  (may follow global command)", -1))
X`09    return 1;
X#endif
X    /* blank separator */
X    if (!addline(curbp, "", -1))
X`09return 1;
X
X    return 0;
X`7D
X
X/* build a binding list (limited or full) */
X/* ARGSUSED */
Xstatic void
Xmakebindlist(
Xint whichmask,
Xvoid *mstring)`09`09/* match \1206 if partial list, NULL to list all */
X`7B
X    struct bindlist_data data;
X
X    data.mask = whichmask;
X    data.min = SHORT_CMD_LEN;
X    data.apropos = (char *)mstring;
X
X    /* let us know this is in progress */
X    mlwrite("`5BBuilding binding list`5D");
X
X    /* clear the NBST_DONE flag */
X    btree_walk(`26namebst.head, clearflag_func, 0);
X
X    /* create binding list */
X    if (btree_walk(`26namebst.head, makebind_func, `26data))
X`09return;
X
X    /* catch entries with no synonym > SHORT_CMD_LEN */
X    data.min = 0;
X    if (btree_walk(`26namebst.head, makebind_func, `26data))
X`09return;
X
X    mlerase();`09/* clear the message line */
X`7D
X#else /* OPT_NAMEBST */
X/* fully describe a function into the current buffer, given a pointer to
X * its name table entry */
Xstatic int
Xmakefuncdesc(int j, char *listed)
X`7B
X`09register KBIND *kbp;`09/* pointer into a key binding table */
X`09int i;
X`09const CMDFUNC *cmd = nametbl`5Bj`5D.n_cmd;
X`09char outseq`5BNLINE`5D;`09/* output buffer for keystroke sequence */
X
X`09/* add in the command name */
X`09(void)quoted(outseq, nametbl`5Bj`5D.n_name);
X`09while (converted_len(outseq) < 32)
X`09`09(void)strcat(outseq, "`5Ct");
X
X`09/* look in the simple ascii binding table first */
X`09for (i = 0; i < N_chars; i++)
X`09`09if (asciitbl`5Bi`5D == cmd)
X`09`09`09convert_kcode(i, outseq);
X
X`09/* then look in the multi-key table */
X#if OPT_REBIND
X`09for (kbp = KeyBindings; kbp != kbindtbl\1106= kbp->k_link) `7B
X`09`09if (kbp->k_cmd == cmd)
X`09`09`09convert_kcode(kbp->k_code, outseq);
X`09`7D
X#endif
X`09for (kbp = kbindtbl; kbp->k_cmd; kbp++)
X`09`09if (kbp->k_cmd == cmd)
X`09`09`09convert_kcode(kbp->k_code, outseq);
X
X`09/* dump the line */
X`09if (!addline(curbp,outseq,-1))
X`09`09return FALSE;
X
X`09/* then look for synonyms */
X`09(void)strcpy(outseq, "  or`5Ct");
X`09for (i = 0; nametbl`5Bi`5D.n_name != 0; i++) `7B
X`09`09/* if it's the one we're on, skip */
X`09`09if (i == j)
X`09`09`09continue;
X`09`09/* if it's already been listed, skip */
X`09`09if (listed`5Bi`5D)
X`09`09`09continue;
X`09`09/* if it's not a synonym, skip */
X`09`09if (nametbl`5Bi`5D.n_cmd != cmd)
X`09`09`09continue;
X`09`09(void)quoted(outseq+5, nametbl`5Bi`5D.n_name);
X`09`09if (!addline(curbp,outseq,-1))
X`09`09`09return FALSE;
X`09`7D
X
X#if OPT_ONLINEHELP
X`09if (cmd->c_help `26`26 \0F0B`5B0`5D)
X`09`09(void)lsprintf(outseq,"  (%s %s )",
X`09`09(cmd->c_flags `26 MOTION) ? "motion: " :
X`09`09`09(cmd->c_flags `26 OPER) ? "operator: " : "",
X`09`09cmd->c_help);
X`09else
X`09`09(void)lsprintf(outseq,"  ( no help for this command )");
X`09if (!addline(curbp,outseq,-1))
X`09`09return FALSE;
X`09if (cmd->c_flags `26 GLOBOK) `7B
X`09`09if (!addline(curbp,"  (may follow global command)",-1))
X`09`09`09return FALSE;
X`09`7D
X#endif
X`09/* blank separator */
X`09if (!addline(curbp,"",-1))
X`09`09return FALSE;
X
X`09return TRUE;
X`7D
X
X/* build a binding list (limited or full) */
X/* ARGSUSED */
Xstatic void
Xmakebindlist(
Xint whichmask,
Xvoid *mstring)`09`09/* match \1206 if partial list, NULL to list all */
X`7B
X`09int pass;
X`09int j;
X`09int ok = TRUE;`09`09/* reset if out-of-memory, etc. */
X`09char *listed = typecallocn(char, (ALLOC_T)nametblsize);
X
X`09if (listed == 0) `7B
X`09`09(void)no_memory(BINDINGLIST_BufName);
X`09`09return;
X`09`7D
X
X`09/* let us know this is in progress */
X`09mlwrite("`5BBuilding binding list`5D");
X
X`09/* build the contents of this window, inserting it line by\0806*/
X`09for (pass = 0; pass < 2\0A06++) `7B
X`09    for (j = 0; nametbl`5Bj`5D.n_name != 0; j++) `7B
X
X`09`09/* if we've already described this one, move on */
X`09`09if (listed`5Bj`5D)
X`09`09`09continue;
X
X`09`09/* are we interested in this type of command? */
X`09`09if (whichmask `26`26 !(nametbl`5Bj`5D.n_cmd->c_flags `26 \2B09))
X`09`09`09continue;
X
X`09`09/* try to avoid alphabetizing by the real short names */
X`09`09if (pass == 0 `26`26 (int)strlen(nametbl`5Bj`5D.n_name) <= SHORT_CMD_LEN
V)
X`09`09`09continue;
X
X`09`09/* if we are executing an apropos command
X`09`09   and current string doesn't include the search\2208*/
X`09`09if (mstring
X`09`09 `26`26 (strinc(nametbl`5Bj`5D.n_name, (char *)mstring) == FALSE))
X`09`09`09continue;
X
X`09`09ok = makefuncdesc(j, listed);
X`09`09if (!ok)
X`09`09`09break;
X
X`09`09listed`5Bj`5D = TRUE; /* mark it as already \2806 */
X`09    `7D
X`09`7D
X
X`09if (ok)
X`09`09mlerase();`09/* clear the message line */
X`09free(listed);
X`7D
X#endif /* OPT_NAMEBST */
X
X/* much like the "standard" strstr, but if the substring starts
X`09with a '`5E', we discard it and force an exact match.  */
Xstatic int
Xstrinc(`09`09`09/* does source include sub? */
Xconst char *sourc,`09/* string to search in */
Xconst char *sub)`09/* substring to look for */
X`7B
X`09const char *sp;`09`09/* ptr into source */
X`09const char *nxtsp;`09/* next ptr into source */
X`09const char *tp;`09`09/* ptr into substring */
X`09int exact = (*sub == '`5E');
X
X`09if (exact)
X`09`09sub++;
X
X`09/* for each character in the source string */
X`09sp = sourc;
X`09while (*sp) `7B
X`09`09tp = sub;
X`09`09nxtsp = sp;
X
X`09`09/* is the substring here? */
X`09`09while (*tp) `7B
X`09`09`09if (*nxtsp++ != *tp)
X`09`09&0209break;
X`09`09`09tp++;
X`09`09`7D
X
X`09`09if ((*tp == EOS) `26`26 (!exact `7C`7C *nxts\1D09)
X`09`09`09return(TRUE);
X
X`09`09if (exact) /* we only get one chance */
X`09`09`09break;
X
X`09`09/* no, onward */
X`09`09sp++;
X`09`7D
X`09return(FALSE);
X`7D
X
X#endif /* OPT_REBIND */
X
X
X/*`09Look up the existence of a file along the normal or PATH
X`09environment variable. Look first in the HOME directory if
X`09asked and possible
X*/
X
Xchar *
Xflook(
Xchar *fname,`09`09/* base file name to search for */
XUINT hflag)`09`09/* Look in the HOME environment variable first? */
X`7B
X`09register char *home;`09/* path to home directory */
X#if ENVFUNC `26`26 OPT_PATHLOOKUP
X`09register const char *path; /* environmental PATH variable */
X#endif
X`09static char fspec`5BNSTRING`5D;`09/* full path spec to search */
X#if SYS_VMS
X`09register char *sp;`09/* pointer into path spec */
X`09static TBUFF *myfiles;
X#endif
X`09int`09mode = (hflag `26 (FL_EXECABLE`7CFL_WRITE\0D08READABLE));
X
X`09/* take care of special cases */
X`09if (!fname `7C`7C \0A06`5B0`5D &027C isSpace(\1408))
X`09`09return NULL;
X`09else if (isShellOrPipe(fname))
X`09`09return fname;
X
X`09if (hflag `26 FL_HERE) `7B
X`09`09if (ffaccess(fname, mode)) `7B
X`09`09`09return(fname);
X`09`09`7D
X`09`7D
X
X#if ENVFUNC
X
X`09if (hflag `26 FL_HOME) `7B
X`09`09home = getenv("HOME");
X`09`09if (home != NULL) `7B
X`09`09`09/* try home dir file spec */
X`09`09`09if (ffaccess(pathcat(fspec,home,fname), mode)) `7B
X`09`09&0209return(fspec);
X`09`09`09`7D
X`09`09`7D
X`09`7D
X
X#endif`09/* ENVFUNC */
X
X`09if (hflag `26 FL_EXECDIR) `7B /* is it where we found the executable? */
X`09`09if (exec_pathname
X`09`09 `26`26 exec_pathname`5B0`5D != EOS
X`09`09 `26`26 ffaccess(pathcat(fspec, exec_pathname, fname), mode))
X`09`09`09return(fspec);
X`09`7D
X
X`09if (hflag `26 FL_TABLE) `7B
X`09`09/* then look it up via the table method */
X`09`09path = startup_path;
X`09`09while ((path = parse_pathlist(path, fspec)) != 0) `7B
X`09`09`09if (ffaccess(pathcat(fspec, \0707fname), mode)) `7B
X`09`09&0209return(fspec);
X`09`09`09`7D
X`09`09`7D
X`09`7D
X
X`09if (hflag `26 FL_PATH) `7B
X
X#if ENVFUNC
X#if OPT_PATHLOOKUP
+-+-+-+-+-+-+-+-  END  OF PART 5 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 6 -+-+-+-+-+-+-+-+
X`09`09/* then look along $PATH */
X#if SYS_VMS
X`09`09/* On VAX/VMS, the PATH environment variable is only the
X`09`09 * current-dir.  Fake up an acceptable alternative.
X`09`09 */
X`09`09if (!tb_length(myfiles)) `7B
X`09`09`09char`09mypath`5BNFILEN`5D;
X
X`09`09`09(void)strcpy(mypath, prog_arg);
X`09`09`09if ((sp = vms_pathleaf(mypath)) == \0C07
X`09`09&0209(void)strcpy(mypath, current_directory(FALSE));
X`09`09`09else
X`09`09&0209*sp = EOS;
X
X`09`09`09if (!tb_init(`26myfiles, EOS)
X`09`09`09 `7C`7C !tb_sappend(`26myfiles, mypath)
X`09`09`09 `7C`7C !tb_sappend(`26myfiles, ",SYS$SYSTEM:,SYS$LIBRARY:")
X`09`09`09 `7C`7C !tb_append(`26myfiles, EOS))
X`09`09`09return NULL;
X`09`09`7D
X`09`09path = tb_values(myfiles);
X#else`09/* UNIX or MSDOS */
X`09`09path = getenv("PATH");`09/* get the PATH variable */
X#endif
X`09`09while ((path = parse_pathlist(path, fspec)) != 0) `7B
X`09`09`09if (ffaccess(pathcat(fspec, \0707fname), mode)) `7B
X`09`09&0209return(fspec);
X`09`09`09`7D
X`09`09`7D
X#endif`09/* OPT_PATHLOOKUP */
X#endif`09/* ENVFUNC */
X
X`09`7D
X
X`09return NULL;`09/* no such luck */
X`7D
X
X/* translate a keycode to its binding-string */
Xchar *
Xkcod2pstr(
Xint c,`09`09/* sequence to translate */
Xchar *seq)`09/* destination string for sequence */
X`7B
X`09seq`5B0`5D = (char)kcod2escape_seq(c, `26seq`5B1`5D);
X`09return seq;
X`7D
X
X/* Translate a 16-bit keycode to a string that will replay into the same
X * code.
X */
Xint
Xkcod2escape_seq (
Xint`09c,
Xchar *`09ptr)
X`7B
X`09char`09*base = ptr;
X
X`09/* ...just for completeness */
X`09if (c `26 CTLA)`09`09*ptr++ = (char)cntl_a;
X`09else if (c `26 CTLX)`09*ptr++ = (char)cntl_x;
X`09else if (c `26 SPEC)`09*ptr++ = (char)poundc;
X
X`09*ptr++ = (char)c;
X`09*ptr = EOS;
X`09return (int)(ptr - base);
X`7D
X
X
X/* translates a binding string into printable form */
X#if OPT_REBIND
Xstatic char *
Xbytes2prc(char *dst, \0B06src, int n)
X`7B
X`09char`09*base = dst;
X`09register int`09c;
X`09register const char *tmp;
X
X`09for ( ; n != 0; dst++, src++, n--) `7B
X
X`09`09c = *src;
X
X`09`09tmp = 0;
X
X`09`09if (c `26 HIGHBIT) `7B
X`09`09`09*dst++ = 'M';
X`09`09`09*dst++ = '-';
X`09`09`09c `26= `7EHIGHBIT;
X`09`09`7D
X`09`09if (c == ' ') `7B
X`09`09`09tmp = "<space>";
X`09`09`7D else if (isCntrl(c)) `7B
X`09`09`09*dst++ = '`5E';
X`09`09`09*dst = tocntrl(c);
X`09`09`7D else `7B
X`09`09`09*dst = (char)c;
X`09`09`7D
X
X`09`09if (tmp != 0) `7B
X`09`09`09while ((*dst++ = *tmp++) != EOS)
X`09`09&0209;
X`09`09`09dst -= 2;`09/* point back to last nonnull */
X`09`09`7D
X
X`09`09if (n > 1) `7B
X`09`09`09*++dst = '-';
X`09`09`7D
X`09`7D
X`09*dst = EOS;
X`09return base;
X`7D
X
X/* translate a 10-bit keycode to its printable name (like "M-j")  */
Xstatic char *
Xkcod2prc(
Xint c,`09`09/* sequence to translate */
Xchar *seq)`09/* destination string for sequence */
X`7B
X`09char`09temp`5BNSTRING`5D;
X`09(void)kcod2pstr(c,temp);
X`09return bytes2prc(seq, temp + 1, *temp);
X`7D
X#endif
X
X
X/* kcode2kbind: translate a 10-bit key-binding to the table-pointer
X */
Xstatic KBIND *
Xkcode2kbind(register int code)
X`7B
X`09register KBIND`09*kbp;`09/* pointer into a binding table */
X
X#if OPT_REBIND
X`09for (kbp = KeyBindings; kbp != kbindtbl\1106= kbp->k_link) `7B
X`09`09if (kbp->k_code == code)
X`09`09`09return kbp;
X`09`7D
X#endif
X`09for (kbp = kbindtbl; kbp->k_cmd; kbp++) `7B
X`09`09if (kbp->k_code == code)
X`09`09`09return kbp;
X`09`7D
X`09return 0;
X`7D
X
X/* kcod2fnc:  translate a 10-bit keycode to a function pointer */
X/*`09(look a key binding up in the\1209table)`09`09*/
Xconst CMDFUNC *
Xkcod2fnc(
Xint c)`09/* key to find what is bound to it */
X`7B
X`09if (isspecial(c)) `7B
X`09`09register KBIND *kp = kcode2kbind(c);
X`09`09return (kp != 0) ? kp->k_cmd : 0;
X`09`7D
X`09return asciitbl`5Bc`5D;
X`7D
X
X/* fnc2kcod: translate a function pointer to a keycode */
Xint
Xfnc2kcod(const CMDFUNC *f)
X`7B
X`09register KBIND *kbp;
X`09register int`09c;
X
X`09for (c = 0; c < N_chars; c++)
X`09`09if (f == asciitbl`5Bc`5D)
X`09`09`09return c;
X
X#if OPT_REBIND
X`09for (kbp = KeyBindings; kbp != kbindtbl\1106= kbp->k_link) `7B
X`09`09if (kbp->k_cmd == f)
X`09`09`09return kbp->k_code;
X`09`7D
X#endif
X`09for (kbp = kbindtbl; kbp->k_cmd != 0; kbp++) `7B
X`09`09if (kbp->k_cmd == f)
X`09`09`09return kbp->k_code;
X`09`7D
X
X`09return -1;`09/* none found */
X`7D
X
X/* fnc2pstr: translate a function pointer to a pascal-string that a user
X`09could enter.  returns a pointer to a static array */
X#if DISP_X11
Xchar *
Xfnc2pstr(const CMDFUNC *f)
X`7B
X`09register int`09c;
X`09static char seq`5B10`5D;
X
X`09c = fnc2kcod(f);
X
X`09if (c == -1)
X`09`09return NULL;
X
X`09return kcod2pstr(c, seq);
X`7D
X#endif
X
X/* fnc2engl: translate a function pointer to the english name for
X`09`09that function
X*/
X#if OPT_EVAL `7C`7C OPT_REBIND
Xstatic const NTAB *
Xfnc2ntab(const CMDFUNC *cfp)
X`7B
X`09register const NTAB *nptr;`09/* pointer into the name table */
X`09register const NTAB *shortnptr = NULL; /* pointer into the name table */
X
X`09/* skim through the table, looking for a match */
X`09for (nptr = nametbl; nptr->n_cmd\0D06++) `7B
X`09`09if (nptr->n_cmd == cfp) `7B
X`09`09`09/* if it's a long name, return it */
X`09`09`09if ((int)strlen(nptr->n_name) > SHORT_CMD_LEN)
X`09`09&0209return nptr;
X`09`09`09/* remember the first short name, in case there's
X`09`09&0209no long name */
X`09`09`09if (!shortnptr)
X`09`09&0209shortnptr = nptr;
X`09`09`7D
X`09`7D
X`09if (shortnptr)
X`09`09return shortnptr;
X
X`09return NULL;
X`7D
X
Xstatic char *
Xfnc2engl(const CMDFUNC *cfp)
X`7B
X`09register const NTAB *nptr = fnc2ntab(cfp);
X`09return nptr ? nptr->n_name : 0;
X`7D
X
X#endif
X
X/* engl2fnc: match name to a function in the names table
X`09translate english name to function pointer
X `09`09 return any match or NULL if none
X */
X#define BINARY_SEARCH_IS_BROKEN 0
X#if OPT_NAMEBST
Xconst CMDFUNC *
Xengl2fnc(const char *fname)`09/* name to attempt to match */
X`7B
X`09BI_NODE *n = btree_pmatch(BI_RIGHT(`26namebst.head), TRUE, fname);
X
X`09if (n == NULL) return NULL;
X`09else return n->value.n_cmd;
X`7D
X#else
X#if BINARY_SEARCH_IS_BROKEN  /* then use the old linear look-up */
Xconst CMDFUNC *
Xengl2fnc(const char *fname)`09/* name to attempt to match */
X`7B
X`09register NTAB *nptr;`09/* pointer to entry in name binding table */
X`09register SIZE_T len = strlen(fname);
X
X`09if (len != 0) `7B`09/* scan through the table, returning any match */
X`09`09nptr = nametbl;
X`09`09while (nptr->n_cmd != NULL) `7B
X`09`09`09if (strncmp(fname, nptr->n_\0E06len) == 0)
X`09`09&0209return nptr->n_cmd;
X`09`09`09++nptr;
X`09`09`7D
X`09`7D
X`09return NULL;
X`7D
X#else
X/* this runs 10 times faster for 'nametbl`5B`5D' */
Xconst CMDFUNC *
Xengl2fnc(const char *fname)`09/* name to attempt to match */
X`7B
X`09int lo, hi, cur;
X`09int r;
X`09register SIZE_T len = strlen(fname);
X
X`09if (len == 0)
X`09`09return NULL;
X
X`09/* scan through the table, returning any match */
X`09lo = 0;
X`09hi = nametblsize - 2;`09/* don't want last entry -- it's NULL */
X
X`09while (lo <= hi) `7B
X`09`09cur = (lo + hi) >> 1;
X`09`09if ((r = strncmp(fname, nametbl`5Bcur`5D.n_\1506len)) == 0) `7B
X`09`09`09/* Now find earliest matching entry */
X`09`09`09while (cur > lo
X`09`09`09    `26`26 strncmp(fname, nametbl`5Bcur-1`5D.n_\1706len) == 0)
X`09`09&0209cur--;
X`09`09`09return nametbl`5Bcur`5D.n_cmd;
X
X`09`09`7D else if (r > 0) `7B
X`09`09`09lo = cur+1;
X`09`09`7D else `7B
X`09`09`09hi = cur-1;
X`09`09`7D
X`09`7D
X`09return NULL;
X`7D
X#endif`09/* binary vs linear */
X#endif  /* OPT_NAMEBST */
X
X/* prc2kcod: translate printable code to 10 bit keycode */
X#if OPT_EVAL `7C`7C OPT_REBIND
Xstatic int
Xprc2kcod(
Xconst char *kk)`09`09/* name of key to translate to Command key form */
X`7B
X`09register UINT c;`09/* key sequence to return */
X`09register UINT pref = 0;`09/* key prefixes */
X`09register int len = strlen(kk);
X`09register const UCHAR *k = (\120D)kk;
X
X`09if (len > 3 `26`26 *(k+2) == '-') `7B
X`09`09if (*k == '`5E') `7B
X`09`09`09if (isCntrl(cntl_a) `26`26 *(k+1) == toalpha\1D08)
X`09`09&0209pref = CTLA;
X`09`09`09if (isCntrl(cntl_x) `26`26 *(k+1) == toalpha\1D08)
X`09`09&0209pref = CTLX;
X`09`09`09if (isCntrl(poundc) `26`26 *(k+1) == toalpha\1D08)
X`09`09&0209pref = SPEC;
X`09`09`7D else if (!strncmp((const char *)k, "FN", (SIZE_T)2)) `7B
X`09`09`09pref = SPEC;
X`09`09`7D
X`09`09if (pref != 0)
X`09`09`09k += 3;
X`09`7D else if (len > 2 `26`26 !strncmp((const char *)k, "M-", (SIZE_T)2)) `7B
V
X`09`09pref = HIGHBIT;
X`09`09k += 2;
X`09`7D else if (len > 1) `7B
X`09`09if (*k == cntl_a)
X`09`09`09pref = CTLA;
X`09`09else if (*k == cntl_x)
X`09`09`09pref = CTLX;
X`09`09else if (*k == poundc)
X`09`09`09pref = SPEC;
X`09`09if (pref != 0) `7B
X`09`09`09k++;
X`09`09`09if (len > 2 `26`26 *k == '-')
X`09`09&0209k++;
X`09`09`7D
X`09`7D
X
X`09/* a control char? */
X`09if (*k == '`5E' `26`26 *(k+1) != EOS) `7B
X`09`09c = *(k+1);
X`09`09if (isLower(c)) c = toUpper(c);
X`09`09c = tocntrl(c);
X`09`09k += 2;
X`09`7D else `7B`09`09/* any single char, control or not */
X`09`09c = *k++;
X`09`7D
X
X`09if (*k != EOS)`09`09/* we should have eaten the whole thing */
X`09`09return -1;
X
X`09return (int)(pref`7Cc);
X`7D
X#endif
X
X
X#if OPT_EVAL
X/* translate printable code (like "M-r") to english command name */
Xconst char *
Xprc2engl(`09`09/* string key name to binding name.... */
Xconst char *skey)`09/* name of key to get binding for */
X`7B
X`09const char *bindname;
X`09int c;
X
X`09c = prc2kcod(skey);
X`09if (c < 0)
X`09`09return "ERROR";
X
X`09bindname = fnc2engl(kcod2fnc(c));
X`09if (bindname == NULL)
X`09`09bindname = "ERROR";
X
X`09return bindname;
X`7D
X#endif
X
X/*
X * Get an english command name from the user
X */
Xchar *
Xkbd_engl(
Xconst char *prompt,`09/* null pointer to splice calls */
Xchar *buffer)
X`7B
X`09if (kbd_engl_stat(prompt, buffer, 0) == TRUE)
X`09`09return buffer;
X`09return NULL;
X`7D
X
X/* sound the alarm! */
Xvoid
Xkbd_alarm(void)
X`7B
X`09TRACE(("BEEP`5Cn"))
X
X`09if (global_g_val(GMDERRORBELLS)) `7B
X`09`09TTbeep();
X`09`09TTflush();
X`09`7D
X`09warnings++;
X`7D
X
X/* put a character to the keyboard-prompt */
Xvoid
Xkbd_putc(int c)
X`7B
X`09BUFFER *savebp;
X`09WINDOW *savewp;
X`09MARK savemk;
X
X`09beginDisplay();
X`09savebp = curbp;
X`09savewp = curwp;
X`09curbp = bminip;
X`09curwp = wminip;
X`09savemk = MK;
X`09MK = DOT;
X`09if ((kbd_expand <= 0) `26`26 isreturn(c)) `7B
X`09`09kbd_erase_to_end(0);
X`09`7D else `7B
X`09`09if ((kbd_expand < 0) `26`26 (c == '`5Ct')) `7B
X`09`09`09(void)linsert(1,' ');
X`09`09`7D else `7B
X`09`09`09(void)linsert(1,c);
X`09`09`7D
X`09`09if (! is_header_line(DOT,curbp) `26`26 !is_at_end_of\2109))
X`09`09`09forwchar(TRUE,1); /* END OF LINE HACK */
X#ifdef DEBUG
X`09`09TRACE(("mini:%2d:%.*s`5Cn", llength(DOT.l)\1010, DOT.l->l_text));
X#endif
X`09`7D
X`09curbp = savebp;
X`09curwp = savewp;
X`09MK = savemk;
X`09endofDisplay();
X`7D
X
X/* put a string to the keyboard-prompt */
Xvoid
Xkbd_puts(const char *s)
X`7B
X`09while (*s)
X`09`09kbd_putc(*s++);
X`7D
X
X/* erase a character from the display by wiping it out */
Xvoid
Xkbd_erase(void)
X`7B
X`09BUFFER *savebp;
X`09WINDOW *savewp;
X`09MARK savemk;
X
X`09if (!disinp)
X`09    return;
X
X`09beginDisplay();
X`09savebp = curbp;
X`09savewp = curwp;
X`09curbp = bminip;
X`09curwp = wminip;
X`09savemk = MK;
X`09MK = DOT;
X`09if (DOT.o > 0) `7B
X`09`09DOT.o -= 1;
X`09`09ldelete(1, FALSE);
X`09`7D
X#ifdef DEBUG
X`09TRACE(("MINI:%2d:%.*s`5Cn", llength(DOT.l)\1010, DOT.l->l_text));
X#endif
X`09curbp = savebp;
X`09curwp = savewp;
X`09MK = savemk;
X`09endofDisplay();
X`7D
X
Xvoid
Xkbd_erase_to_end(int column)
X`7B
X`09BUFFER *savebp;
X`09WINDOW *savewp;
X`09MARK savemk;
X
X`09if (!disinp)
X`09    return;
X
X`09beginDisplay();
X`09savebp = curbp;
X`09savewp = curwp;
X`09curbp = bminip;
X`09curwp = wminip;
X`09savemk = MK;
X`09MK = DOT;
X`09if (llength(DOT.l) > 0) `7B
X`09`09DOT.o = column;
X`09`09ldelete(llength(DOT.l) - DOT.o, FALSE);
X`09`09TRACE(("NULL:%2d:%.*s`5Cn", llength(DOT.l)\1010, DOT.l->l_text));
X`09`7D
X`09curbp = savebp;
X`09curwp = savewp;
X`09MK = savemk;
X`09endofDisplay();
X`7D
X
X
X#if OPT_CASELESS
Xstatic int
Xcs_strcmp(
Xint case_insensitive,
Xconst char *s1,
Xconst char *s2)
X`7B
X`09if (case_insensitive)
X`09`09return stricmp(s1, s2);
X`09return strcmp(s1, s2);
X`7D
X
Xstatic int
Xcs_strncmp(
Xint case_insensitive,
Xconst char *s1,
Xconst char *s2,
XSIZE_T n)
X`7B
X`09if (case_insensitive)
X`09`09return strnicmp(s1, s2, n);
X`09return strncmp(s1, s2, n);
X`7D
X#endif`09/* OPT_CASELESS */
X
X/* definitions for name-completion */
X#define`09NEXT_DATA(p)`09((p)+size_entry)
X#define`09PREV_DATA(p)`09((p)-size_entry)
X
X#ifdef`09lint
Xstatic`09/*ARGSUSED*/
Xconst char *`09THIS_NAME(\170Cp) `7B return 0; `7D
X#else
X#define`09THIS_NAME(p)`09(*TYPECAST(const char *const,p))
X#endif
X#define`09NEXT_NAME(p)`09THIS\0D06NEXT_DATA(p))
X
X/*
X * Scan down until we no longer match the current input, or rea\1C07end of
X * the symbol table.
X */
X/*ARGSUSED*/
Xstatic const char *
Xskip_partial(
Xint`09case_insensitive GCC_UNUSED,
Xchar`09*buf,
XSIZE_T`09len,
Xconst char *table,
XSIZE_T`09size_entry)
X`7B
X`09register const char * next = NEXT_DATA(table);
X`09register const char *`09sp;
X
X`09while ((sp = THIS_NAME(next)) != 0) `7B
X`09`09if (StrNcmp(buf, sp, len) != 0)
X`09`09`09break;
X`09`09next = NEXT_DATA(next);
X`09`7D
X`09return next;
X`7D
X
X/*
X * Shows a partial-match.  This is invoked in the symbol table at\390A
X * match, and the user wants to know what characters could be typed next.
X * If there is more than one possibility, they are shown in square-brackets.
X * If there is only one possibility, it is shown in curly-braces.
X */
Xstatic void
Xshow_partial(
Xint`09case_insensitive,
Xchar`09*buf,
XSIZE_T`09len,
Xconst char *table,
XSIZE_T`09size_entry)
X`7B
X`09register const char *next = skip_partial(case_insensitive, buf, len, table,
V size_entry);
X`09register const char *last = PREV_DATA(next);
X`09register int`09c;
X
X`09if (THIS_NAME(table)`5Blen`5D == \190Alast\1806) `7B
X`09`09kbd_putc('`7B');
X`09`09while ((c = THIS_NAME(table)`5Blen`5D) != 0) `7B
X`09`09`09if (c == THIS_NAME(last)`5Blen`5D) `7B
X`09`09&0209kbd_putc(c);
X`09`09&0209len++;
X`09`09`09`7D else
X`09`09&0209break;
X`09`09`7D
X`09`09kbd_putc('`7D');
X`09`7D
X`09if (next != NEXT_DATA(table)) `7B
X`09`09c = TESTC;`09/* shouldn't be in the table! */
X`09`09kbd_putc('`5B');
X`09`09while (table != next) `7B
X`09`09`09register const char *sp = THIS_NAME(table);
X`09`09`09if (c != sp`5Blen`5D) `7B
X`09`09&0209c = sp`5Blen`5D;
X`09`09&0209kbd_putc(c ? c : '$');
X`09`09`09`7D
X`09`09`09table = NEXT_DATA(table);
X`09`09`7D
X`09`09kbd_putc('`5D');
X`09`7D
X`09kbd_flush();
X`7D
X
X#if OPT_POPUPCHOICE
X/*
X * makecmpllist is called from liststuff to display the possible completions.
V
X */
Xstruct compl_rec `7B
X    char *buf;
X    SIZE_T len;
X    const char *table;
X    SIZE_T size_entry;
X`7D;
X
X#ifdef lint
X#define c2ComplRec(c) ((struct compl_rec *)0)
X#else
X#define c2ComplRec(c) ((struct compl_rec *)c)
X#endif
X
X/*ARGSUSED*/
Xstatic void
Xmakecmpllist(
X    int case_insensitive,
X    void *cinfop)
X`7B
X    char * buf`09`09= c2ComplRec(cinfop)->buf;
X    SIZE_T len`09`09= c2ComplRec(cinfop)->len;
X    const char * first`09= c2ComplRec(cinfop)->table;
X    SIZE_T size_entry`09= c2ComplRec(cinfop)->\210A;
X    register const char *last = skip_partial(case_insensitive, buf, len, first
V, size_entry);
X    register const char *p;
X    SIZE_T maxlen;
X    int slashcol;
X    int cmpllen;
X    int cmplcols;
X    int cmplrows;
X    int nentries;
X    int i, j;
X
X    for (p = NEXT_DATA(first), maxlen = strlen(THIS_NAME\2207);
X         p != last;
X`09 p = NEXT_DATA(p)) `7B
X`09SIZE_T l = strlen(THIS_NAME(p));
X`09if (l > maxlen)
X`09    maxlen = l;
X    `7D
X
X    slashcol = (int)(pathleaf(buf) - buf);
X    if (slashcol != 0) `7B
X        char b`5BNLINE`5D;
X        (void)strncpy(b, buf, (SIZE_T)slashcol);
X        (void)strncpy(`26b`5Bslashcol`5D, `26(THIS_NAME(first))\1F0B
X`09`09`09(len-slashcol));
X        b`5Bslashcol+(len-\0E08)`5D = EOS;
X        bprintf("Completions prefixed by %s:`5Cn", b);
X    `7D
X
X    cmplcols = term.t_ncol / (maxlen - slashcol + 1);
X
X    if (cmplcols == 0)
X`09cmplcols = 1;
X
X    nentries = (int)(last - first) / size_entry;
X    cmplrows = nentries / cmplcols;
X    cmpllen  = term.t_ncol / cmplcols;
X    if (cmplrows * cmplcols < nentries)
X`09cmplrows++;
X
X    for (i = 0; i < cmplrows; i++) `7B
X`09for (j = 0; j < cmplcols; j++) `7B
X`09    int idx = cmplrows * j + i;
X`09    if (idx < nentries) `7B
X`09`09const char *s = THIS_NAME(first+(idx*size_entry))+slashcol;
X`09`09if (j == cmplcols-1)
X`09`09    bprintf("%s`5Cn", s);
X`09`09else
X`09`09    bprintf("%*s", cmpllen, s);
X`09    `7D
X`09    else `7B
X`09`09bprintf("`5Cn");
X`09`09break;
X`09    `7D
X`09`7D
X    `7D
X`7D
X
X/*
X * Pop up a window and show the possible completions.
X */
Xstatic void
Xshow_completions(
Xint`09case_insensitive,
Xchar`09*buf,
XSIZE_T`09len,
Xconst char *table,
XSIZE_T`09size_entry)
X`7B
X    struct compl_rec cinfo;
X    BUFFER *bp;
X    int alreadypopped = 0;
X
X    /*
X     * Find out if completions buffer exists; so we can take the time to
X     * shrink/grow the window to the latest size.
X     */
X    if ((bp = find_b_name(COMPLETIONS_BufName)) != NULL) `7B
X`09alreadypopped = (bp->b_nwnd != 0);
X    `7D
X
X    cinfo.buf = buf;
X    cinfo.len = len;
X    cinfo.table = table;
X    cinfo.size_entry = \0D0A;
X    liststuff(COMPLETIONS_BufName, FALSE, makecmpllist, case_insensitive, (voi
Vd *) `26cinfo);
X
X    if (alreadypopped)
X`09shrinkwrap();
X
X    (void)update(TRUE);
X`7D
X
X/*
X * Scroll the completions window wrapping around back to the beginning
X * of the buffer once it has been completely scrolled.  I\3506\1D07ions
X * buffer is missing for some reason, we will call show_completions to pop
X * it (back) up.
X */
Xstatic void
Xscroll_completions(
X    int`09`09case_insensitive,
X    char`09*buf,
X    SIZE_T`09len,
X    const char`09*table,
X    SIZE_T`09size_entry)
X`7B
X    BUFFER *bp = find_b_name(COMPLETIONS_BufName);
X    if (bp == NULL)
X`09show_completions(case_insensitive, buf, len, table, size_entry);
X    else `7B
X`09LINEPTR lp;
X`09swbuffer(bp);
X`09(void)gotoeos(FALSE, 1);
X`09lp = DOT.l;
X`09(void)forwhpage(FALSE, 1);
X`09if (lp == DOT.l)
X`09    (void)gotobob(FALSE, 0);
X`09(void)update(TRUE);
X    `7D
X`7D
X
Xvoid
Xpopdown_completions(void)
X`7B
X    BUFFER *bp;
X    if ((bp = find_b_name(COMPLETIONS_BufName)) != NULL)
X`09zotwp(bp);
X`7D
X#endif /* OPT_POPUPCHOICE */
X
X/*
X * Attempt to partial-complete the string, char at a time
X */
Xstatic SIZE_T
Xfill_partial(
Xint`09case_insensitive GCC_UNUSED,
Xchar`09*buf,
XSIZE_T`09pos,
Xconst char *first,
Xconst char *last,
XSIZE_T`09size_entry)
X`7B
X`09register const char *p;
X`09register SIZE_T`09n = pos;
X`09const char *this_name = THIS_NAME(first);
X
X#if 0 /* case insensitive reply correction doesn't work reliably yet */
X`09if (!clexec `26`26 case_insensitive) `7B
X`09`09int spos = pos;
X
X`09`09while (spos > 0 `26`26 buf`5Bspos - 1`5D != SLASHC) `7B
X`09`09`09kbd_erase();
X`09`09`09spos--;
X`09`09`7D
X`09`09while (spos < pos) `7B
X`09`09`09kbd_putc(this_name`5Bspos`5D);
X`09`09`09spos++;
X`09`09`7D
X`09`7D
X#endif
X
X`09for_ever `7B
X`09`09buf`5Bn`5D = this_name`5Bn`5D;`09/* add the next char in */
X`09`09buf`5Bn+1`5D = EOS;
X
X`09`09/* scan through the candidates */
X`09`09for (p = NEXT_DATA(first); p != last; p \210Cp)) `7B
X`09`09`09if (StrNcmp(`26THIS_NAME(p)`5Bn`5D, `26buf`5Bn`5D, 1) != 0) `7B
X`09`09&0209buf`5Bn`5D = EOS;
X`09`09&0209if (n == pos
X#if OPT_POPUPCHOICE
X# if OPT_ENUM_MODES
X`09`09&0209 `26`26 !global_g_val(GVAL_POPUP_CHOICES)
X# else
X`09`09&0209 `26`26 !global_g_val(GMDPOPUP_CHOICES)
X# endif
X#endif
X`09`09&0209)
X`09`09&0209`09kbd_alarm();
X`09`09&0209kbd_flush(); /* force out alarm or partial completion */
X`09`09&0209return n;
X`09`09`09`7D
X`09`09`7D
X
X`09`09if (!clexec)
X`09`09`09kbd_putc(buf`5Bn`5D); /* add the character */
X`09`09n++;
X`09`7D
X`7D
X
Xstatic`09int`09testcol;`09/* records the column when TESTC is decoded */
X#if OPT_POPUPCHOICE
X/*
X * cmplcol is used to record the column number (on the message line) after
X * name completion.  Its value is used to decide whether or not to display
X * a completion list if the name \1C0Bcharacter (tab) is pressed
X * twice in succession.  Once the completion list has been displayed, its
X * value will be changed to the additive inverse of the column number in
X * order to determine whether to scroll if tab is pressed yet again.  We
X * assume that 0 will never be a valid column number.  So long as we always
X * display some sort of prompt prior to reading from the message line, this
X * is a good assumption.
X */
Xstatic`09int`09cmplcol = 0;
X#endif
X
X/*
X * Initializes the name-completion logic
X */
Xvoid
Xkbd_init(void)
X`7B
X`09testcol = -1;
X`7D
X
X/*
X * Returns the current length of the minibuffer
X */
Xint
Xkbd_length(void)
X`7B
X`09if (wminip != 0
X`09 `26`26 wminip->w_dot.l != 0
X`09 `26`26 llength(wminip->w_dot.l) > 0)
X`09`09return llength(wminip->w_dot.l);
X`09return 0;
X`7D
X
X/*
X * Erases the display that was shown in response to TESTC
X */
Xvoid
Xkbd_unquery(void)
X`7B
X`09beginDisplay();
X#if OPT_POPUPCHOICE
X`09if (cmplcol != kbd_length() `26`26 -\1C17)
X`09`09cmplcol = 0;
X#endif
X`09if (testcol >= 0) `7B
X`09`09while (kbd_length() > testcol)
X`09`09`09kbd_erase();
X`09`09kbd_flush();
X`09`09testcol = -1;
X`09`7D
X`09endofDisplay();
X`7D
X
X/*
X * This is invoked to find the closest name to complete from\2206urrent buffer
V
X * contents.
X */
Xint
Xkbd_complete(
Xint`09case_insensitive,
Xint`09c,`09`09/* TESTC, NAMEC or isreturn() */
Xchar`09*buf,
Xunsigned *pos,
Xconst char *table,
XSIZE_T`09size_entry)
X`7B
X`09register SIZE_T cpos = *pos;
X`09register const char *nbp; /* first ptr to entry in name binding table */
X`09int status = FALSE;
X#if OPT_POPUPCHOICE
X# if OPT_ENUM_MODES
X`09int gvalpopup_choices = global_g_val(GVAL_POPUP_CHOICES);
X# else
X`09int gvalpopup_choices = global_g_val(GMDPOPUP_CHOICES);
X# endif
X#endif
X
X`09kbd_init();`09`09/* nothing to erase */
X`09buf`5Bcpos`5D = EOS;`09/* terminate it for us */
X`09nbp = table;`09`09/* scan for matches */
X
X`09while (THIS_NAME(nbp) != NULL) `7B
X`09`09if (StrNcmp(buf,  THIS_NAME(nbp), strlen(buf)) == 0) `7B
X`09`09`09testcol = kbd_length();
X`09`09`09/* a possible match! exact? no more than one? */
X#if OPT_POPUPCHOICE
X`09`09`09if (!clexec `26`26 c == NAMEC &0226 cmplcol == -kbd_length()) `7B
X`09`09&0209scroll_completions(case_insensitive, buf, cpos, nbp, size_entry);
X`09`09&0209return FALSE;
X`09`09`09`7D
X#endif
X`09`09`09if (c == TESTC) `7B
X`09`09&0209show_partial(case_insensitive, buf, cpos, nbp, size_entry);
X`09`09`09`7D
X`09`09`09else if (Strcmp(buf,  THIS_NAME(nbp)) == 0 `7C`7C /* exact? */
X`09`09&0209NEXT_NAME(nbp) == NULL `7C`7C
X`09`09&0209StrNcmp(buf, NEXT_NAME(nbp), strlen(buf)) != 0)
X`09`09`09`7B
X`09`09&0209/* exact or only one like it.  print it */
X`09`09&0209if (!clexec) `7B
X#if 0 /* case insensitive reply correction doesn't work reliably yet */
X`09`09&0209`09if (case_insensitive) `7B
X`09`09&0209&0209int spos = cpos;
X
X`09`09&0209&0209while (spos > 0 `26`26 buf`5Bspos - 1`5D != SLASHC) `7B
X`09`09&0209&0309kbd_erase();
X`09`09&0209&0309spos--;
X`09`09&0209&0209`7D
X`09`09&0209&0209kbd_puts(THIS_NAME(nbp) + spos);
X`09`09&0209`09`7D
X`09`09&0209`09else
X#endif
X`09`09&0209&0209kbd_puts(THIS_NAME(nbp) + cpos);
X`09`09&0209`09kbd_flush();
X`09`09&0209`09testcol = kbd_length();
X`09`09&0209`7D
X`09`09&0209if (c != NAMEC)  /* put it back */
X`09`09&0209`09unkeystroke(c);
X`09`09&0209/* return complete name */
X`09`09&0209(void)strncpy0(buf, THIS_NAME(nbp),
X`09`09&0209&0209(SIZE_T)(NLINE - 1));
X`09`09&0209*pos = strlen(buf);
X#if OPT_POPUPCHOICE
X`09`09&0209if (gvalpopup_choices != POPUP_CHOICES_OFF
X`09`09&0209 `26`26 !clexec &0226 (c == NAMEC))
X`09`09&0209`09status = FALSE;
X`09`09&0209else
X#endif
X`09`09&0209`09status = TRUE;
X`09`09`09`7D
X`09`09`09else `7B
X`09`09&0209/* try for a partial match against the list */
X`09`09&0209*pos = fill_partial(case_insensitive, buf, cpos, nbp,
X`09`09&0209`09skip_partial(case_insensitive, buf, cpos, nbp, size_entry),
X`09`09&0209`09size_entry);
X`09`09&0209testcol = kbd_length();
X`09`09`09`7D
X#if OPT_POPUPCHOICE
X# if OPT_ENUM_MODES
X`09`09`09if (!clexec
X`09`09`09 `26`26 gvalpopup_choices != POPUP_CHOICES_OFF
X`09`09`09 `26`26 c == NAMEC
X`09`09`09 `26`26 *pos == cpos) `7B
X`09`09&0209if (gvalpopup_choices == POPUP_CHOICES_IMMED
X`09`09&0209 `7C`7C cmplcol == kbd_length()) `7B
X`09`09&0209`09show_completions(case_insensitive, buf, cpos, nbp, size_entry);
V
X`09`09&0209`09cmplcol = -kbd_length();
X`09`09&0209`7D
X`09`09&0209else
X`09`09&0209`09cmplcol = kbd_length();
X`09`09`09`7D
X`09`09`09else
X`09`09&0209cmplcol = 0;
X# else
X`09`09`09if (!clexec `26`26 gvalpopup_choices
X`09`09`09 `26`26 c == NAMEC &0226 *pos == cpos) `7B
X`09`09&0209show_completions(case_insensitive, buf, cpos, nbp, size_entry);
X`09`09&0209cmplcol = -kbd_length();
X`09`09`09`7D
X`09`09`09else
X`09`09&0209cmplcol = 0;
X# endif
X#endif
X`09`09`09return status;
X`09`09`7D
X`09`09nbp = NEXT_DATA(nbp);
X`09`7D
X
X#if OPT_POPUPCHOICE
X`09cmplcol = 0;
X#endif
X`09kbd_alarm();`09/* no match */
X`09buf`5B*pos = cpos`5D = EOS;
X`09return FALSE;
X`7D
X
X/*
X * Test a buffer to see if it looks like a shift-command, which may have
X * repeated characters (but they must all be the same).
X */
Xstatic int
Xis_shift_cmd(
Xconst char *buffer,
Xunsigned cpos)
X`7B
X`09register int c = *buffer;
X`09if (isRepeatable(c)) `7B
X`09`09while (--cpos != 0)
X`09`09`09if (*(++buffer) != c)
X`09`09&0209return FALSE;
X`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X
X/*
X * The following mess causes the command to terminate if:
X *
X *`09we've got the eolchar
X *`09`09-or-
X *`09we're in the first few chars and \2106switching from punctuation
X *`09(i.e., delimiters) to non-punctuation \2607characters that are part
X *`09of command-names), or vice-versa.  oh yeah -- '-' isn't punctuation
X *`09today, and '!' isn't either, in one direction, at any rate.
X *`09All this allows things like:
X *`09`09: e#
X *`09`09: e!%
X *`09`09: !ls
X *`09`09: q!
X *`09`09: up-line
X *`09to work properly.
X *
X *`09If we pass this "if" with c != NAMEC, then c is ungotten below,
X *`09so it can be picked up by the commands argument getter later.
X */
X
X#define ismostpunct(c) (isP\0C08`26`26 (c) != '-')
X
Xstatic int
Xeol_command(
Xconst char * buffer,
Xunsigned cpos,
Xint`09c,
Xint`09eolchar)
X`7B
X`09/*
X`09 * Handle special case of repeated-character implying\1C07-count
X`09 */
X`09if (is_shift_cmd(buffer, cpos) `26`26 (c == *\1806))
X`09`09return TRUE;
X
X`09/*
X`09 * Shell-commands aren't complete until the line is \1B08.
X`09 */
X`09if ((cpos != 0) `26`26 isShellOrPipe(buffer))
X`09`09return is\0906(c);
X
X`09return`09(c == eolchar)
X`09  `7C`7C`09(
X`09`09  cpos != 0 `26`26\0E07< 3
X`09      `26`26(
X`09`09  (!ismostpunct(c)
X`09`09`26`26  ismostpunct(buffer`5Bcpos-1`5D)
X`09`09  )
X`09`09`7C`7C ((c != '!' `26`26 ismostpunct(c))
X`09`09  `26`26 (buffer`5Bcpos-1`5D == '!' `7C`7C !ismostpunct\260F))
X`09`09  )
X`09`09)
X`09      );
X`7D
X
X/*
X * This procedure is invoked from 'kbd_string()' to setup the command-name
X * completion and query displays.
X */
Xstatic int
Xcmd_complete(
Xint`09c,
Xchar`09*buf,
Xunsigned *pos)
X`7B
X`09register int status;
X#if OPT_HISTORY
X`09/*
X`09 * If the user scrolled back in 'edithistory()', the text may be a
X`09 * repeated-shift command, which won't match the\1F08-table (e.g.,
X`09 * ">>>").
X`09 */
X`09if ((*pos > 1) `26`26 is_shift_cmd(buf, *pos)) `7B
X`09`09unsigned len = 1;
X`09`09char`09tmp`5BNLINE`5D;
X`09`09tmp`5B0`5D = *buf;
X`09`09tmp`5B1`5D = EOS;
X`09`09status = cmd_complete(c, tmp, `26len);
X`09`7D else
X#endif
X`09 if ((*pos > 0) `26`26 isShellOrPipe(buf)) `7B
X#if COMPLETE_FILES
X`09`09status = shell_complete(c, buf, pos);
X#else
X`09`09status = isreturn(c);
X`09`09if (c != NAMEC)
X`09`09`09unkeystroke(c);
X#endif
X`09`7D else `7B
X`09`09status = kbd_complete_bst(FALSE, c, buf, pos);
+-+-+-+-+-+-+-+-  END  OF PART 6 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 7 -+-+-+-+-+-+-+-+
X`09`7D
X`09return status;
X`7D
X
Xint
Xkbd_engl_stat(const char *prompt, char`09*buffer, int stated)
X`7B
X`09int`09kbd_flags = KBD_EXPCMD`7CKBD_NULLOK`7C((NAMEC != ' ') ? 0 : KBD_MAYBE
VC);
X`09int`09code;
X`09static`09TBUFF *temp;
X`09ALLOC_T`09len = NLINE;
X
X`09tb_scopy(`26temp, "");
X#if COMPLETE_FILES
X`09init_filec(FILECOMPLETION_BufName);
X#endif
X`09kbd_flags `7C= stated;
X`09code = kbd_reply(
X`09`09prompt,&0209/* no-\0F06 => splice */
X`09`09`26temp,&0209/* in/out buffer */
X`09`09eol_command,
X`09`09' ',&0209/* eolchar */
X`09`09kbd_flags,`09/* allow blank-return */
X`09`09cmd_complete);
X`09if (len > tb_length(temp))
X`09`09len = tb_length(temp);
X`09strncpy0(buffer, tb_values(temp), len);
X`09return code;
X`7D
X
X#if OPT_NAMEBST
Xint
Xinsert_namebst(const char *name, const CMDFUNC *cmd, int ro)
X`7B
X    BI_DATA temp, *p;
X
X    if ((p = btree_search(`26namebst, name)) != 0)
X    `7B
X`09if ((p->n_flags `26 NBST_READONLY) `26`26 !ro)
X`09`7B
X`09    mlforce("`5BCannot redefine %s`5D", name);
X`09    return FALSE;
X`09`7D
X
X`09if (!delete_namebst(name, TRUE))
X`09    return FALSE;
X    `7D
X
X    temp.bi_key     = name;
X    temp.n_cmd      = cmd;
X    temp.n_flags    = ro ? NBST_READONLY : 0;
X
X    return (btree_insert(`26namebst, `26temp) != 0);
X`7D
X
X/*
X * Lookup a name in the binary-search tree, remove it if found
X */
Xint
Xdelete_namebst(const char *name, int release)
X`7B
X    BI_DATA *p = btree_search(`26namebst, name);
X
X    /* not a named procedure */
X    if (!p)
X`09return TRUE;
X
X    if (p->n_flags `26 NBST_READONLY)
X    `7B
X`09mlforce("BUG: btree entry %s is readonly", name);
X`09return FALSE;
X    `7D
X
X    /* we may have to free some stuff */
X    if (p `26`26 release)
X    `7B
X`09int i;
X`09int redo;
X
X`09/* remove ascii bindings */
X`09for (i = 0; i < N_chars; i++)
X`09    if (asciitbl`5Bi`5D == p->n_cmd)
X`09`09asciitbl`5Bi`5D = 0;
X
X`09/* then look in the multi-key table */
X#if OPT_REBIND
X`09do `7B
X`09    register KBIND *kbp;
X`09    redo = FALSE;
X`09    for (kbp = KeyBindings; kbp != kbindtbl\1106= kbp->k_link)
X`09`09if (kbp->k_cmd == p->n_cmd)
X`09`09`7B
X`09`09    unbindchar(kbp->k_code);
X`09`09    redo = TRUE;
X`09`09    break;
X`09`09`7D
X`09`7D while (redo);
X#endif
X`09do `7B
X`09    register KBIND *kbp;
X`09    redo = FALSE;
X`09    for (kbp = kbindtbl; kbp->k_cmd; kbp++)
X`09`09if (kbp->k_cmd == p->n_cmd)
X`09`09`7B
X`09`09    unbindchar(kbp->k_code);
X`09`09    redo = TRUE;
X`09`09    break;
X`09`09`7D
X`09`7D while (redo);
X
X`09/* free stuff */
X#if OPT_PERL
X`09if (p->n_cmd->c_flags `26 CMD_PERL)
X`09    perl_free_sub(p->n_cmd->cu.c_perl);
X#endif
X
X`09free(TYPECAST(char,p->n_cmd->c_help));
X`09free(TYPECAST(char,p->n_cmd));
X    `7D
X
X    return btree_delete(`26namebst, name);
X`7D
X
X/*
X * If we're renaming a procedure to another "\1609" name (i.e., bracketed),
X * rename it in the name-completion table.  Otherwise, simply remove it from t
Vhe
X * name-completions.
X */
Xint
Xrename_namebst(const char *oldname, c\150Bnewname)
X`7B
X    BI_DATA *prior;
X    char name`5BNBUFN`5D;
X
X    /* not a named procedure */
X    if (!(prior = btree_search(`26namebst, oldname)))
X`09return TRUE;
X
X    /* remove the entry if the new name is not a procedure (bracketed) */
X    if (!is_scratchname(newname))
X`09return delete_namebst(oldname, TRUE);
X
X    /* add the new name */
X    strip_brackets(name, newname);
X    if ((insert_namebst(name, prior->n_cmd,
X`09`09       prior->n_flags `26 NBST_READONLY)) != TRUE)
X`09return FALSE;
X
X    /* delete the old (but don't fre\1806data) */
X    return delete_namebst(oldname, FALSE);
X`7D
X
Xint
Xsearch_namebst(const char *name)
X`7B
X`09return (btree_search(`26namebst, name) != 0);
X`7D
X
X/*
X * Build the initial name binary search tree.  Since the nametbl is sorted we
V
X * do this in a binary-search manner to get a balanced tree.
X */
Xvoid
Xbuild_namebst(const NTAB *nptr, int lo\0806hi)
X`7B
X`09for (; lo < hi; lo++)
X`09`09if (!insert_namebst(nptr`5Blo`5D.n_name, \110Bcmd, TRUE))
X`09`09`09tidy_exit(BADEXIT);
X`7D
X
X/*
X * This is invoked to find the closest name to complete from\2206urrent buffer
V
X * contents.
X */
Xstatic int
Xkbd_complete_bst(
Xint`09case_insensitive GCC_UNUSED,
Xint`09c,`09`09/* TESTC, NAMEC or isreturn() */
Xchar`09*buf,
Xunsigned *pos)
X`7B
X`09register unsigned cpos = *pos;
X`09int status = FALSE;
X`09const char **nptr;
X
X`09kbd_init();`09`09/* nothing to erase */
X`09buf`5Bcpos`5D = EOS;`09/* terminate it for us */
X
X`09if ((nptr = btree_parray(`26namebst, buf, cpos)) != 0) `7B
X`09`09status = kbd_complete(FALSE, c, buf, pos, (char *)nptr, sizeof(*nptr));
V
X`09`09free((char *)nptr);
X`09`7D else
X`09`09kbd_alarm();
X`09return status;
X`7D
X#endif /* OPT_NAMEBST */
X
X#if OPT_MENUS
X/* FIXME: reuse logic from makefuncdesc() */
Xchar *give_accelerator ( \1906bname )
X`7B
X`09size_t `09`09`09i, n;
X`09register KBIND `09*kbp;
X`09const CMDFUNC `09*cmd;
X`09static char `09outseq`5BNLINE`5D;
X
X`09for (n=0; nametbl`5Bn`5D.n_name != 0; n++)
X`09`7B
X`09`09if (!strcmp(nametbl`5Bn`5D.n_name, bname))
X`09`09`7B
X`09`09`09cmd = nametbl`5Bn`5D.n_cmd;
X
X`09`09`09outseq`5B0`5D = '`5C0';
X
X`09`09`09for (i = 0; i < N_chars; i++)
X`09`09`09`7B
X`09`09&0209if (asciitbl`5Bi`5D == cmd)
X`09`09&0209`09convert_kcode(i, outseq);
X`09`09`09`7D
X
X`09`09`09for (kbp = KeyBindings; kbp != kbindtbl\1106= kbp->k_link) `7B
X`09`09&0209if (kbp->k_cmd == cmd)
X`09`09&0209`09convert_kcode(kbp->k_code, outseq);
X`09`09`09`7D
X
X#if 0
X`09`09`09for (kbp = kbindtbl; kbp->k_cmd; kbp++)
X`09`09&0209if (kbp->k_cmd == cmd)
X`09`09&0209`09convert_kcode(kbp->k_code, outseq);
X#endif
X
X`09`09`09/* Replace `5Ct by ' ' */
X`09`09`09for (i=0; i<strlen(outseq); i++)
X`09`09`09`7B
X`09`09&0209if (outseq`5Bi`5D == '`5Ct')
X`09`09&0209`09outseq`5Bi`5D = ' ';
X`09`09`09`7D
X
X`09`09`09return outseq;
X`09`09`7D
X`09`7D
X
X`09return NULL;
X`7D
X#endif /* OPT_MENUS */
X
X#if NO_LEAKS
Xvoid
Xbind_leaks(void)
X`7B
X#if OPT_REBIND
X`09while (KeyBindings != kbindtbl) `7B
X`09`09KBIND *kbp = KeyBindings;
X`09`09KeyBindings = kbp->k_link;
X`09`09free((char *)kbp);
X`09`7D
X#endif
X#if OPT_NAMEBST
X`09btree_freeup(`26namebst);
X#endif
X`7D
X#endif`09/* NO_LEAKS */
$ call unpack [.VILE-8_0]BIND.C;1 -
 1679365476 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 119 6 152
$!
$ create 'f'
X/*
X * Uses Borland console i/o routines.
X * (Created for OS/2 by Charles Moschel 29-MAR-94.)
X * (modified to be more generic, not os/2 specific, pgf, april '94)
X *
X * Supported monitor cards include
X *`09CGA, MONO, EGA, VGA.
X *
X * Note: Visual flashes are not yet supported.
X *
X *
X * $Header: /usr/build/vile/vile/RCS/borland.c,v 1.25 1998/05/14 23:14:25 tom
V Exp $
X *
X */
X
X
X#define`09termdef`091`09`09`09/* don't define "term" external */
X
X#include        "estruct.h"
X#include        "edef.h"
X
X#if SYS_OS2
X#define INCL_VIO
X#define INCL_NOPMAPI
X#include <os2.h>
X#undef OPT_COLOR
X#endif /* SYS_OS2 */
X
X
X#if !DISP_BORLAND `7C`7C DISP_IBMPC
X#error misconfigured:  DISP_BORLAND should be defined if using borland.c
X#error (and DISP_IBMPC should not be defined)
X#endif
X
X#define NROW`0950`09`09`09/* Max Screen size.&0209*/
X#define NCOL    80`09`09`09/* Edit if you want to.         */
X#define`09MARGIN`098`09`09`09/* size of minimum margin and`09*/
X#define`09SCRSIZ`0964`09`09`09/* scroll size for extended lines */
X#define`09NPAUSE`09200`09`09`09/* # times thru update to pause */
X#define`09SPACE`0932`09`09`09/* space character&0209*/
X
X/* We assume that most users have a color display.  */
X
X#include <conio.h>
X
Xstatic  void`09borflush  (void);
Xstatic  void`09bormove   (int,int);
Xstatic  void`09boreeol   (void);
Xstatic  void`09boreeop   (void);
Xstatic  void`09borbeep   (void);
Xstatic  void    boropen   (void);
Xstatic`09void`09borrev    (UINT);
Xstatic`09int`09borcres   (const char *);
Xstatic`09void`09borclose  (void);
Xstatic`09void`09borputc   (int);
Xstatic`09void`09borkopen  (void);
Xstatic`09void`09borkclose (void);
X
X#if OPT_COLOR
Xstatic`09void`09borfcol   (int);
Xstatic`09void`09borbcol   (int);
Xstatic`09void`09borspal   (const char *);
X#endif
X
X#if OPT_ICURSOR
Xstatic`09void`09boricursor(int);
X#endif
X
Xint`09cfcolor = -1;`09`09/* current forground color */
Xint`09cbcolor = -1;`09`09/* current background color */
X/* ansi to ibm color translation table */
Xstatic`09const char *initpalettestr = "0 4 2 6 1 5 3 7 8 12 10 14 9 13 11 15";
V
X/* black, red, green, yellow, blue, magenta, cyan, white   */
X
Xstatic`09void`09borscroll (int,int,int);
X
Xstatic`09int`09scinit    (int);
X
X
Xstatic`09char`09linebuf`5B128`5D;
Xstatic`09int`09bufpos = 0;
X
Xstatic struct `7B
X`09char  *seq;
X`09int   code;
X`7D keyseqs`5B`5D = `7B
X`09/* Arrow keys */
X`09`7B"`5C0`5C110",     KEY_Up`7D,
X`09`7B"`5C0`5C120",     KEY_Down`7D,
X`09`7B"`5C0`5C115",     KEY_Right`7D,
X`09`7B"`5C0`5C113",     KEY_Left`7D,
X`09/* page scroll */
X`09`7B"`5C0`5C121",     KEY_Next`7D,
X`09`7B"`5C0`5C111",     KEY_Prior`7D,
X`09`7B"`5C0`5C107",     KEY_Home`7D,
X`09`7B"`5C0`5C117",     KEY_End`7D,
X`09/* editing */
X        `7B"`5C0R",\0F08KEY_Insert`7D,
X`09`7B"`5C0`5C123",     KEY_Delete`7D,
X`09/* function keys */
X        `7B"`5C0;",\0F08KEY_F1`7D,
X`09`7B"`5C0<",        KEY_F2`7D,
X`09`7B"`5C0=",        KEY_F3`7D,
X`09`7B"`5C0>",        KEY_F4`7D,
X`09`7B"`5C0?",        KEY_F5`7D,
X`09`7B"`5C0@",        KEY_F6`7D,
X`09`7B"`5C0A",        KEY_F7`7D,
X`09`7B"`5C0B",        KEY_F8`7D,
X`09`7B"`5C0C",        KEY_F9`7D,
X        `7B"`5C0D",\0F08KEY_F10`7D,
X`7D;
X
Xint ibmtype;
X
Xstatic int borlastchar = -1;
Xstatic int bortttypahead(void);
Xstatic int borttgetc(void);
X
X/*
X * Standard terminal interface dispatch table. Most of the fields point into
X * "termio" code.
X */
XTERM    term    = `7B
X`09NROW,
X`09NROW,
X`09NCOL,
X`09NCOL,
X`09MARGIN,
X`09SCRSIZ,
X`09NPAUSE,
X`09boropen,
X`09borclose,
X`09borkopen,
X`09borkclose,
X`09borttgetc,
X`09borputc,
X`09bortttypahead,
X`09borflush,
X`09bormove,
X`09boreeol,
X`09boreeop,
X`09borbeep,
X`09borrev,
X`09borcres,
X#if OPT_COLOR
X`09borfcol,
X`09borbcol,
X`09borspal,
X#else
X`09null_t_setfor,
X`09null_t_setback,
X`09null_t_setpal,
X#endif
X`09borscroll,
X`09null_t_pflush,
X#if OPT_ICURSOR
X`09boricursor,
X#else
X`09null_t_icursor,
X#endif
X`09null_t_title,
X`09null_t_watchfd,
X`09null_t_unwatchfd,
X`7D;
X
X#if OPT_ICURSOR
Xstatic void
Xboricursor(int cmode)
X`7B
X`09switch (cmode) `7B
X`09case -1: _setcursortype( _NOCURSOR);`09`09break;
X`09case  0: _setcursortype( _NORMALCURSOR);`09break;
X`09case  1: _setcursortype( _SOLIDCURSOR);`09`09break;
X`09`7D
X`7D
X#endif
X
X#if OPT_COLOR
Xstatic void
Xborfcol(int color)`09`09/* set the current output\2206 */
X`7B
X`09cfcolor = ctrans`5Bcolor`5D;
X`09textcolor(cfcolor `26 15);
X`7D
X
Xstatic void
Xborbcol(int color)`09`09/* set the current background\2606 */
X`7B
X`09cbcolor = ctrans`5Bcolor`5D;
X`09textbackground(cbcolor `26 7);
X`7D
X
Xstatic void
Xborspal(const char *thePalette)`09/* reset the palette registers */
X`7B
X`09borflush();
X`09set_ctrans(thePalette);
X`7D
X
Xstatic void
Xsetup_colors(void)
X`7B
X`09borfcol(gfcolor);
X`09borbcol(gbcolor);
X`7D
X
Xstatic void
Xreset_colors(void)
X`7B
X`09borfcol(7 /* not necessarily C_WHITE */);
X`09borbcol(C_BLACK);
X`7D
X#else
X#define setup_colors() /* nothing */
X#define reset_colors() /* nothing */
X#endif
X
Xstatic void
Xborflush(void)
X`7B
X`09if (bufpos) `7B
X`09`09linebuf`5Bbufpos`5D = '`5C0';
X`09`09cputs(linebuf);
X`09`09bufpos = 0;
X`09`7D
X`7D
X
Xstatic void
Xbormove(int row, int col)
X`7B
X`09borflush();
X`09gotoxy(col+1, row+1);
X`7D
X
X/* erase to the end of the line */
Xstatic void
Xboreeol(void)
X`7B
X`09borflush();
X`09clreol();`09`09/* pointer to the destination line */
X`7D
X
X/* put a character at the current position in \180Ccolors */
Xstatic void
Xborputc(int ch)
X`7B
X`09linebuf`5Bbufpos++`5D = ch;
X`7D
X
X
Xstatic void
Xboreeop(void)
X`7B
X`09int x, y, i;
X`09struct text_info t;
X
X`09borflush();
X`09x = wherex();
X`09y = wherey();
X`09gettextinfo(`26t);
X`09clreol();
X`09for (i = x + 1; i <= t.screenheight; i++) `7B
X`09`09gotoxy(1, i);
X`09`09clreol();
X`09`7D
X`09gotoxy(x, y);
X`7D
X
Xstatic void
Xborrev(UINT reverse)`09`09/* change\1408 video state */
X`7B
X`09borflush();
X`09if (reverse) `7B
X`09    textbackground(cfcolor `26 7);
X`09    textcolor(cbcolor `26 15);
X`09`7D else `7B
X`09    textbackground(cbcolor `26 7);
X`09    textcolor(cfcolor `26 15);
X`09`7D
X`7D
X
Xstatic int
Xborcres(const char *res)`09/* change screen resolution */
X`7B
X`09char`09*dst;
X`09register int i;`09`09/* index */
X`09int`09status = FALSE;
X
X`09strcpy(current_res_name, res);
X`09borflush();
X`09/* find the default configuration */
X`09if (!strcmp(res, "?")) `7B
X`09`09status = scinit(-1);
X`09`7D else `7B`09/* specify a number */
X`09`09if ((i = (int)strtol(res, `26dst, 0)) >= 0 `26`26 !*dst)
X`09`09`7B
X`09`09/* only allow valid row selections */
X`09`09/* Are these all valid under dos?  */
X`09`09if (i==2)  status=scinit(25);
X`09`09if (i==4)  status=scinit(43);
X`09`09if (i==5)  status=scinit(50);
X`09`09if (i==6)  status=scinit(60);
X
X`09`09if (i>6 `26`26 i<28)
X`09`09`09status=scinit(25);
X
X`09`09if (i>=28 `26`26 i<43)
X`09`09`09status=scinit(28);
X
X`09`09if (i>=43 `26`26 i<50)
X`09`09`09status=scinit(43);
X
X`09`09if (i>=50 `26`26 i<60)
X`09`09`09status=scinit(50);
X
X`09`09if (i>=60)
X`09`09`09status=scinit(60);
X
X`09`09`7D
X`09`7D
X`09sgarbf = TRUE;
X`09return status;
X`7D
X
X
Xstatic void
Xborbeep(void)
X`7B
X`09putch('`5Ca');
X`7D
X
X
Xstatic void
Xboropen(void)
X`7B
X`09int i;
X
X`09set_palette(init\0C07str);
X`09setup_colors();
X
X`09if (!borcres(current_res_name))
X`09`09(void)scinit(-1);
X`09ttopen();
X`09for (i = TABLESIZE(keyseqs) - 1; i >= 0; i--)
X`09`09addtosysmap(keyseqs`5Bi`5D.seq, 2, \130Bcode);
X`7D
X
X
Xstatic void
Xborclose(void)
X`7B
X`09int`09current_type = ibmtype;
X
X`09borflush();
X#ifdef OPT_ICURSOR
X`09_setcursortype(_NORMALCURSOR);
X#endif
X`09ibmtype = current_type;`09/* ...so subsequent TTopen restores us */
X
X`09reset_colors();
X`09kbd_erase_to_end(0);
X`09kbd_flush();
X`7D
X
Xstatic void
Xborkopen(void)`09/* open the keyboard */
X`7B
X`09setup_colors();
X`09TTmove(term.t_nrow-1, 0);`09/* cf: dumbterm.c */
X`09TTeeol();
X
X`09/* ms_install(); */
X`7D
X
Xstatic void
Xborkclose(void)`09/* close the keyboard */
X`7B
X`09/* ms_deinstall(); */
X
X`09reset_colors();
X`09TTmove(term.t_nrow-1, 0);`09/* cf: dumbterm.c */
X`09TTeeol();
X`7D
X
Xstatic
Xint borttgetc(void)
X`7B
X`09return (borlastchar = ttgetc());
X`7D
X
X
X/* bortttypahead:  Check to see if any characters are already in the
X * keyboard buffer.In Borland C OS/2 1.5, kbhit doesn't return non-zero for
X * the 2nd part of an extended character, but 1st part is still 0 so use
X * that as indicator as well (why it's saved in borttgetc).
X*/
Xstatic int
Xbortttypahead(void)
X`7B
X
X`09return (kbhit() != 0 `7C`7C borlastchar == 0);
X
X`7D
X
X#if SYS_OS2  `09`09/* all modes are available under OS/2 */
Xstatic int
Xscinit(int rows)`09/* initialize the screen head pointers */
X`7B
X
X`09/* and set up the various parameters as needed */
X
X`09if (rows == -1)
X`09`7B
X`09`09struct text_info ti;
X`09`09gettextinfo(`26ti);
X`09`09rows = ti.screenheight;
X`09`7D
X
X`09switch (rows) `7B
X
X/* these are enum's, and thus cannot easily be checked, ie. #ifdef C80X21 */
X`09`09case 21:`09/* color C80X21 */
X`09`09&0209textmode(C80X21);
X`09`09&0209newscreensize(21, term.t_ncol);
X`09`09&0209(void)strcpy(sres, "C80X21");
X`09`09&0209break;
X
X`09`09default:
X`09`09case 25:`09/* Color graphics adapter */
X`09`09&0209textmode(C80);
X`09`09&0209newscreensize(25, term.t_ncol);
X`09`09&0209(void)strcpy(sres, "C80");
X`09`09&0209break;
X
X`09`09case 28:`09/* Enhanced graphics adapter */
X`09`09&0209textmode(C80X28);
X`09`09&0209newscreensize(28, term.t_ncol);
X`09`09&0209(void)strcpy(sres, "C80X28");
X`09`09&0209break;
X
X`09`09case 43:`09/* Enhanced graphics adapter */
X`09`09&0209textmode(C80X43);
X`09`09&0209newscreensize(43, term.t_ncol);
X`09`09&0209(void)strcpy(sres, "C80X43");
X`09`09&0209break;
X
X`09`09case 50:`09/* VGA adapter */
X`09`09&0209textmode(C80X50);
X`09`09&0209newscreensize(50, term.t_ncol);
X`09`09&0209(void)strcpy(sres, "C80X50");
X`09`09&0209break;
X
X`09`09case 60:`09/* Enhanced graphics adapter */
X`09`09&0209textmode(C80X60);
X`09`09&0209newscreensize(60, term.t_ncol);
X`09`09&0209(void)strcpy(sres, "C80X60");
X`09`09&0209break;
X
X
X`09`7D
X
X`09ibmtype = rows;
X
X`09return(TRUE);
X`7D
X
X#else /* SYS_OS2 */
X
Xstatic int
Xscinit(int rows)`09/* initialize the screen head pointers */
X`7B
X
X`09/* and set up the various parameters as needed */
X
X`09struct text_info ti;
X`09int oldrows;
X
X`09gettextinfo(`26ti);
X`09oldrows = ti.screenheight;
X`09if (rows == -1)
X`09`09rows = oldrows;
X
X`09switch (rows) `7B
X
X/* DOS has only BW40, C40, BW80, C80, MONO, and C4350 */
X
X`09`09default:
X`09`09case 25:`09/* Color graphics adapter */
X`09`09&0209if (oldrows != 25)
X`09`09&0209`09textmode(C80);
X`09`09&0209newscreensize(25, term.t_ncol);
X`09`09&0209(void)strcpy(sres, "C80");
X`09`09&0209break;
X
X`09`09case 43:
X`09`09case 50:
X`09`09case 60:
X`09`09&0209if (rows != oldrows)
X`09`09&0209`09textmode(C4350);
X`09`09&0209gettextinfo(`26ti);
X`09`09&0209rows = ti.screenheight;
X`09`09&0209newscreensize(rows, term.t_ncol);
X`09`09&0209sprintf(sres, "C80X%d", rows);
X`09`09&0209break;
X
X`09`7D
X
X`09ibmtype = rows;
X
X`09return(TRUE);
X`7D
X
X#endif /* SYS_OS2 */
X
X/*
X * Move 'n' lines starting at 'from' to 'to'
X *
X * OPT_PRETTIER_SCROLL is prettier but slower -- it scrolls a line at a time
X *`09instead of all at once.
X */
X
X/* move howmany lines starting at from to to */
Xstatic void
Xborscroll(int from, int to,int n)
X`7B
X`09int i;
X`09struct text_info t;
X
X`09borflush();
X`09if (to == from) return;
X#if OPT_PRETTIER_SCROLL
X`09if (absol(from-to) > 1) `7B
X`09`09borscroll(from, (from<to) ? to-1:to+1, n);
X`09`09if (from < to)
X`09`09`09from = to-1;
X`09`09else
X`09`09`09from = to+1;
X`09`7D
X#endif
X`09gettextinfo(`26t);
X`09if (to < from) `7B
X`09`09window(1, to + 1, t.screenwidth, from + n);
X`09`09gotoxy(1, 1);
X`09`09for (i = from - to; i > 0; i--)
X`09`09`09delline();
X`09`09gotoxy(1, n + 1);
X`09`09for (i = from - to; i > 0; i--)
X`09`09`09insline();
X`09`7D else `7B
X`09`09window(1, from + 1, t.screenwidth, to + n);
X`09`09gotoxy(1, n + 1);
X`09`09for (i = to - from; i > 0; i--)
X`09`09`09delline();
X`09`09gotoxy(1, 1);
X`09`09for (i = to - from; i > 0; i--)
X`09`09`09insline();
X`09`7D
X`09window(1, 1, t.screenwidth\0F0Aheight);
X`7D
X
X/*--------\0808\1010\2020\400A*/
X
$ call unpack [.VILE-8_0]BORLAND.C;1 -
 706676014 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 23 7 152
$!
$ create 'f'
X/*
X * $Id: btree.c,v 1.4 1998/04/28 10:15:52 tom Exp $
X * Copyright 1997 by Thomas E. Dickey
X *
X * Maintains a balanced binary tree (aka AVL tree) of unspecified nodes.  The
V
X * algorithm is taken from "The Art of Computer Programming -- Volume 3 --
X * Sorting and Searching", by Donald Knuth. \0806 presents the insertion and
X * search algorithms in assembly language for MIX, and gives an overview of th
Ve
X * deletion algorithm for the "interested reader".
X */
X
X#ifdef HAVE_CONFIG_H
X#include <config.h>
X#endif
X
X#include <stdlib.h>
X#include <stdio.h>
X#include <string.h>
X
X#if !defined(DEBUG_BTREE) `26`26\190ANDEBUG)
X#define NDEBUG
X#endif
X
X#include <assert.h>
X
X#include "btree.h"
X
X#if defined(OPT_TRACE) `7C`7C\1609DOALLOC)
X#include "trace.h"
X#endif
X
X#ifdef USE_DBMALLOC
X#include <dbmalloc.h>
X#endif
X
X#ifdef USE_DMALLOC
X#include <dmalloc.h>
X#endif
X
X#define castalloc(cast,nbytes) (cast *)m\1C06\1707
X
X`09`09`09/* definitions to make this simple, like Knuth */
X#define`09LLINK(p)`09BI_LEFT(p)
X#define`09RLINK(p)`09BI_RIGHT(p)
X#define`09KEY(p)`09`09BI_\0B06
X#define`09B(p)`09`09(p)->balance
X
X#define COMPARE(a,b)`09btree_strcmp(a,b)
X
X#define`09LINK(a,p)`09(p)->links`5B(a)>0`5D
X
X#ifdef DEBUG_BTREE
X# ifndef TRACE
X#  if DEBUG_BTREE > 0
X#   define TRACE(p)`09printf p ; fflush(stdout) ;
X#  endif
X# endif
X#else
X# undef TRACE
X#endif
X
X#if DEBUG_BTREE > 1
X#define TRACE_TREE(s,p)`09TRACE((s)) btree_printf(p)
X#endif
X
X#if DEBUG_BTREE > 2
X#define TRACE_SUBTREE(s,h,p)`09TRACE(s); dump_nodes(h,p,0)
X#endif
X
X#ifndef TRACE
X#define TRACE(p)`09/*nothing*/
X#endif
X
X#ifndef TRACE_TREE
X#define TRACE_TREE(s,p)`09/*nothing*/
X#endif
X
X#ifndef TRACE_SUBTREE
X#define TRACE_SUBTREE(s,h,p)`09/*nothing*/
X#endif
X
X#ifdef DEBUG_BTREE
Xstatic int btree_verify(BI_TREE *funcs, BI_NODE *p);
X#endif
X
X/*
X * FIXME
X */
Xstatic int
Xbtree_strcmp(const char *a, c\0F0Bb)
X`7B
X`09register int cmp = strcmp(a, b);
X`09if (cmp < 0)
X`09`09cmp = -1;
X`09else if (cmp > 0)
X`09`09cmp = 1;
X`09return cmp;
X`7D
X
XBI_DATA *
Xbtree_insert(BI_TREE *funcs, BI_DATA *data)
X`7B
X`09`09&0209/* (A1:Initialize) */
Xregister
X`09BI_NODE`09*t = `26(funcs->head),`09/* 't' => to the father of 's'`09*/
X`09`09*s = RLINK(t),&0209/* 's' => to rebalancing point`09*/
X`09`09*p = RLINK(t),&0209/* 'p' => down the tree&0209*/
X`09`09*q,
X`09`09*r;
Xregister
X`09int`09a;
X`09BI_DATA`09*value = 0;
X
X`09TRACE(("inserting '%s'`5Cn", data->bi_key))
X`09if (p == 0) `7B
X`09`09RLINK(t) = p = (*funcs->allocat)(data);
X`09`09funcs->depth += 1;
X`09`09funcs->count += 1;
X`09`09return `26(p->value);
X`09`7D
X`09`09&0209/* (A2:Compare) */
X`09while ((a = COMPARE(data->bi_key, KEY(p))) != 0) `7B
X`09`09&0209/* (A3,A4: move left/right accordingly)`09*/
X`09`09if ((q = LINK(a,p)) != 0) `7B
X`09`09`09value = `26(p->value);
X`09`09`09if (B(q)) `7B
X`09`09&0209t = p;
X`09`09&0209s = q;
X`09`09`09`7D
X`09`09`09p = q;
X`09`09`09/* ...continue comparing */
X`09`09`7D else `7B
X`09`09`09/* (A5:Insert) */
X`09`09`09LINK(a,p) = q = (*funcs->allocat)(data);
X`09`09`09funcs->count += 1;
X`09`09`09value = `26(q->value);
X
X`09`09`09/* (A6:Adjust balance factors) */
X`09`09`09/*
X`09`09`09 * Now the balance factors on nodes between 's' and 'q'
X`09`09`09 * need to be changed from zero to +/- 1.
X`09`09`09 */
X`09`09`09if (COMPARE(data->bi_key, KEY(s)) < 0)
X`09`09&0209r = p = LLINK(s);
X`09`09`09else
X`09`09&0209r = p = RLINK(s);
X
X`09`09`09while (p != q) `7B
X`09`09&0209if ((a = COMPARE(data->bi_key, KEY(p))) != 0) `7B
X`09`09&0209`09B(p) = (a < 0) ? -1 : 1;
X`09`09&0209`09p = LINK(a,p);
X`09`09&0209`7D
X`09`09`09`7D
X
X`09`09&0209/* (A7:Balancing act) */
X`09`09`09a = (COMPARE(data->bi_key, KEY(s)) < 0) ? -1 : 1;
X
X`09`09`09if (B(s) == 0) `7B
X`09`09&0209/* ...the tree has grown higher`09*/
X`09`09&0209B(s) = a;
X`09`09&0209funcs->depth += 1;
X`09`09`09`7D else if (B(s) == -a) `7B
X`09`09&0209/* ...the tree has gotten more balanced`09*/
X`09`09&0209B(s) = 0;
X`09`09`09`7D else /* (B(s) == a) */ `7B
X`09`09&0209assert(B(s) == a);
X`09`09&0209/* ...the tree has gotten out of balance */
X`09`09&0209TRACE(("...must rebalance`5Cn"))
X`09`09&0209if (B(r) == a) `7B
X`09`09&0209`09TRACE(("(A8:Single rotation)`5Cn"))
X`09`09&0209`09p          = r;
X`09`09&0209`09LINK(a,s)  = LINK(-a,r);
X`09`09&0209`09LINK(-a,r) = s;
X
X`09`09&0209`09B(s) = B(r) = 0;
X`09`09&0209`7D else /* (B(r) == -a) */ `7B
X`09`09&0209`09assert(B(r) == -a);
X`09`09&0209`09TRACE(("(A9: Double rotation)`5Cn"))
X`09`09&0209`09p          = LINK(-a,r);
X`09`09&0209`09LINK(-a,r) = LINK(a,p);
X`09`09&0209`09LINK(a,p)  = r;
X`09`09&0209`09LINK(a,s)  = LINK(-a,p);
X`09`09&0209`09LINK(-a,p) = s;
X
X`09`09&0209`09TRACE(("r=%s`5Cn", KEY(r)))
X`09`09&0209`09TRACE(("s=%s`5Cn", KEY(s)))
X`09`09&0209`09TRACE(("B(%s) = %d vs a = %d`5Cn",
X`09`09&0209&0209KEY(p), B(p), a))
X
X`09`09&0209`09if (B(p) == a)
X`09`09&0209&0209`7B B(s) = -a; B(r) = 0;`09`7D
X`09`09&0209`09else if (B(p) == 0)
X`09`09&0209&0209`7B B(s) =     B(r) = 0;  `7D
X`09`09&0209`09else /* if (B(p) == -a) */
X`09`09&0209&0209`7B B(s) = 0;  B(r) = a;  `7D
X
X`09`09&0209`09B(p) = 0;
X`09`09&0209`7D
X`09`09&0209/* A10:Finishing touch */
X`09`09&0209t->links`5B(s == RLINK(t))`5D = p;
X`09`09`09`7D
X`09`09`09break;
X`09`09`7D
X`09`7D
X`09return (value);
X`7D
X
Xstatic BI_NODE *
Xparent_of(BI_TREE *funcs, BI_NODE *s)
X`7B
X`09BI_NODE`09*r = `26(funcs->head),
X`09`09*p = RLINK(r);`09 /* 'p' => down the tree`09*/
X`09int a;
X
X`09while ((a = COMPARE(KEY(s), KEY(p))) != 0) `7B
X`09`09assert(LINK(a,p) != 0);
X`09`09r = p;
X`09`09p = LINK(a,p);
X`09`7D
X`09TRACE(("parent of '%s' is '%s'`5Cn", KEY(s)\0806r)))
X`09return r;
X`7D
X
X#define MAXSTK 20
X#define PUSH(A,P) `7B `5C
X`09TRACE(("@%d:push #%d a=%2d, B\0706p='%s' -> '%s'`5Cn", __LINE__, `5C
X`09`09k, A, B(P), P?KEY(P):"", LINK(A,P)?KEY(\0E09):"")) `5C
X`09stack`5Bk`5D.a = A;`5C
X`09stack`5Bk`5D.p = P;`5C
X`09k++; `7D
X
Xint
Xbtree_delete(BI_TREE *funcs, const char *data)
X`7B
X`09struct `7B
X`09BI_NODE`09*p;
X`09int`09a;
X`09`7D stack`5BMAXSTK`5D;
X`09int`09k = 0;
X`09`09&0209/* (A1:Initialize) */
Xregister
X`09BI_NODE`09*t = `26(funcs->head),
X`09`09*p = RLINK(t),
X`09`09*q, *r, *s;
Xregister
X`09int`09a, b;
X`09char`09*value;
X
X`09if ((p = t) == 0
X`09 `7C`7C (p = LINK(a=1,p)) == 0) `7B
X`09`09return 0;
X`09`7D
X`09`09&0209/* (A2:Compare) */
X`09while ((a = COMPARE(data, value = KEY(p))) != 0) `7B
X`09`09if ((q = LINK(a,p)) == 0) `7B
X`09`09`09value = 0;
X`09`09`09break;
X`09`09`7D
X`09`09&0209/* (A3,A4: move left/right accordingly)`09*/
X`09`09t = p;
X`09`09p = LINK(a,p);
X`09`09/* ...continue comparing */
X`09`7D
X
X`09if (value != 0) `7B`09/* we found the node to delete, in p */
X`09`09TRACE(("deleting node '%s'`5Cn", value))
X`09`09q = p;
X`09`09p = t;
X`09`09a = (q == RLINK(p)) ? 1 : -1;
X
X`09`09TRACE(("@%d, p='%s'`5Cn", __LINE__, p?KEY(p):""))
X`09`09TRACE(("@%d, q='%s'`5Cn", __LINE__, q?KEY(q):""))
X`09`09TRACE(("@%d, a=%d`5Cn",   __LINE__, a))
X
X`09`09&0209/* D1: Is RLINK null? */
X`09`09if (RLINK(q) == 0) `7B
X`09`09`09TRACE(("D1`5Cn"))
X
X`09`09`09LINK(a,p) = LLINK(q);
X`09`09`09s = p;
X#if LATER
X`09`09`7D else if (LLINK(q) == 0) `7B /* D1.5 */
X`09`09`09TRACE(("D1.5`5Cn"))
X`09`09`09LINK(a,p) = RLINK(q);
X`09`09`09s = RLINK(q);
X#endif
X`09`09`7D else `7B`09/* D2: Find successor */
X`09`09`09TRACE_SUBTREE("\0908p)-before`5Cn", funcs, p);
X`09`09`09r = RLINK(q);
X`09`09`09if (LLINK(r) == 0) `7B
X`09`09&0209TRACE(("D2, r='%s', q='%s'`5Cn", KEY(r)\0806q)))
X`09`09&0209TRACE(("DIFF: %d`5Cn", B(r) - B(q)))
X
X`09`09&0209LLINK(r) = \0B06q);
X`09`09&0209LINK(a,p) = r;
X`09`09&0209s = r;
X`09`09&0209TRACE(("(D2) replace balance %2d with %2d, a=%2d`5Cn", B(s), B(q),
V a))
X`09`09&0209B(s) = B(q);
X`09`09&0209a = 1;`09/* for RLINK(q) */
X
X`09`09&0209TRACE_SUBTREE("\0908p)-after`5Cn", funcs, p);
X`09`09&0209TRACE(("@%d, p='%s'`5Cn", __LINE__, KEY(p)))
X`09`09&0209TRACE(("@%d, r='%s'`5Cn", __LINE__, KEY(r)))
X`09`09`09`7D else `7B /* D3: Find null LLINK */
X`09`09&0209TRACE(("D3: find null LLINK`5Cn"))
X
X`09`09&0209TRACE(("@%d, r='%s'`5Cn", __LINE__, r?KEY(r):""))
X`09`09&0209s = r;
X`09`09&0209do `7B
X`09`09&0209`09r = s;
X`09`09&0209`09s = LLINK(r);
X`09`09&0209`7D while (LLINK(s) != 0);
X
X`09`09&0209LLINK(s) = \0B06q);
X`09`09&0209LLINK(r) = RLINK(s);
X`09`09&0209RLINK(s) = \0B06q);
X`09`09&0209TRACE(("@%d, p='%s', a=%d`5Cn", __LINE__, KEY(p), a))
X`09`09&0209TRACE(("@%d, r='%s'`5Cn", __LINE__, KEY(r)))
X`09`09&0209TRACE(("@%d, s='%s'`5Cn", __LINE__, KEY(s)))
X`09`09&0209LINK(a,p) = s;
X`09`09&0209TRACE(("(D3) replace balance %2d with %2d, a=%2d`5Cn", B(s), B(q),
V a))
X`09`09&0209B(s) = B(q);
X`09`09&0209s = r;
X`09`09&0209a = -1;`09/* ...since we followed left */
X`09`09`09`7D
X`09`09`7D
X`09`09b = a;
X`09`09&0209/* D4: Free the node */
X`09`09assert(q != 0);
X`09`09(*funcs->dealloc)(q);
X`09`09funcs->count -= 1;
X`09`09TRACE_TREE("after delinking:",funcs);
X
X`09`09&0209/* Construct the auxiliary stack */
X`09`09a = 1;
X`09`09q = `26(funcs->head);
X`09`09if (s != 0
X`09`09 `26`26 s != q
X`09`09 `26`26 q != 0) `7B
X`09`09`09TRACE(("Construct stack from '%s' down to '%s', final a=%d`5Cn",
X`09`09&0209q?KEY(q):"",
X`09`09&0209s?KEY(s):"",
X`09`09&0209b))
X`09`09`09while (s != q) `7B
X`09`09&0209PUSH(a,q);
X`09`09&0209q = LINK(a,q);
+-+-+-+-+-+-+-+-  END  OF PART 7 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 8 -+-+-+-+-+-+-+-+
X`09`09&0209a = COMPARE(KEY(s), KEY(q));
X`09`09`09`7D
X`09`09`09PUSH(b,q);
X`09`09`09TRACE(("...done building stack`5Cn"))
X`09`09`7D
X
X`09`09&0209/* Rebalance the tree */
X`09`09for (;;) `7B
X`09`09`09if (--k <= 0) `7B
X`09`09&0209TRACE(("shorten the whole tree`5Cn"))
X`09`09&0209funcs->depth -= 1;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09p = stack`5Bk`5D.p;
X`09`09`09a = stack`5Bk`5D.a;
X`09`09`09TRACE(("processing #%d '%s' B = %d, a = %d (%p)`5Cn",
X`09`09&0209k, KEY(p), B(p), a, LINK(a,p)))
X`09`09`09if (B(p) == a) `7B
X`09`09&0209TRACE(("Case (i)`5Cn"))
X`09`09&0209B(p) = 0;
X`09`09`09`7D else if (B(p) == 0) `7B
X`09`09&0209TRACE(("Case (ii)`5Cn"))
X`09`09&0209B(p) = -a;
X`09`09&0209break;
X`09`09`09`7D else `7B
X`09`09&0209TRACE(("Case (iii): Rebalancing needed!`5Cn"))
X
X`09`09&0209q = LINK(-a,p);
X`09`09&0209assert(q != 0);
X`09`09&0209assert(k >  0);
X`09`09&0209assert(B(p) == -a);
X
X`09`09&0209t = stack`5Bk-1`5D.p;
X`09`09&0209TRACE(("t:%s, balance:%d`5Cn", KEY(t), B(t)))
X`09`09&0209TRACE(("A:p:%s, balance:%d`5Cn", KEY(p), B(p)))
X`09`09&0209TRACE(("B:q:%s, balance:%d`5Cn", KEY(q), B(q)))
X`09`09&0209TRACE_TREE("before rebalancing:", funcs);
X
X`09`09&0209if (B(q) == -a) `7B
X`09`09&0209`09TRACE(("CASE 1: single rotation`5Cn"))
X
X`09`09&0209`09r          = q;
X
X`09`09&0209`09TRACE(("link LINK(-a,p) ->\0E06 a,q) = '%s'`5Cn",\2406a,q)?KEY(
V\0E09):""))
X`09`09&0209`09TRACE(("link LINK( a,q) -> p          = '%s'`5Cn", p?KEY(p):""))
V
X
X`09`09&0209`09LINK(-a,p) = LINK(a,q);
X`09`09&0209`09LINK(a,q)  = p;
X
X`09`09&0209`09B(p) = B(q) = 0;
X
X`09`09&0209`09t = parent_of(funcs, p);
X
X`09`09&0209`09TRACE(("Finish by linking '%s' to %sLINK(%s)`5Cn",
X`09`09&0209&0209KEY(r),
X`09`09&0209&0209(p == RLINK(t))
X`09`09&0209&0309? "R"
X`09`09&0209&0309: (p == LLINK(t))
X`09`09&0209&0409? "L" : "?",
X`09`09&0209&0209KEY(t)))
X
X`09`09&0209`09t->links`5B(p == RLINK(t))`5D = r;
X
X`09`09&0209`7D else if (B(q) == a) `7B
X`09`09&0209`09TRACE(("CASE 2: double rotation`5Cn"))
X
X`09`09&0209`09r          = LINK(a,q);
X#if DEBUG_BTREE > 1
X`09`09&0209`09TRACE(("a = '%d'`5Cn", a))
X`09`09&0209`09TRACE(("p = '%s'`5Cn", p?KEY(p):""))
X`09`09&0209`09TRACE(("q = '%s'`5Cn", q?KEY(q):""))
X`09`09&0209`09TRACE(("r = '%s'`5Cn", r?KEY(r):""))
X`09`09&0209`09TRACE(("link LINK( a,q) ->\0E06-a,r) = '%s'`5Cn",\160B?KEY(\250A
V):""))
X`09`09&0209`09TRACE(("link LINK(-a,r) -> q          = '%s'`5Cn", KEY(q)))
X`09`09&0209`09TRACE(("link LINK(-a,p) ->\0E06a,r)  = '%s'`5Cn",\160A?KEY(\2409
V):""))
X`09`09&0209`09TRACE(("link LINK( a,r) -> p          = '%s'`5Cn", KEY(p)))
X#endif
X`09`09&0209`09LINK(a,q)  = LINK(-a,r);
X`09`09&0209`09LINK(-a,r) = q;
X`09`09&0209`09LINK(-a,p) = LINK(a,r);
X`09`09&0209`09LINK(a,r)  = p;
X
X`09`09&0209`09TRACE(("compute balance for '%s', %d vs a=%d`5Cn",
X`09`09&0209&0209KEY(r), B(r), a))
X
X`09`09&0209`09if (B(r) == -a)
X`09`09&0209&0209`7B B(p) = a;  B(q) = 0;`09`7D
X`09`09&0209`09else if (B(r) == 0)
X`09`09&0209&0209`7B B(p) =     B(q) = 0;  `7D
X`09`09&0209`09else /* (B(r) == a) */
X`09`09&0209&0209`7B B(p) = 0;  B(q) = -a;  `7D
X
X`09`09&0209`09B(r) = 0;
X
X`09`09&0209`09a = stack`5Bk-1`5D.a;
X`09`09&0209`09t = stack`5Bk-1`5D.p;
X
X`09`09&0209`09TRACE(("Finish by linking '%s' to %sLINK(%s)`5Cn",
X`09`09&0209&0209KEY(r),
X`09`09&0209&0209(a>0) ? "R" : "L",
X`09`09&0209&0209KEY(t)))
X
X`09`09&0209`09LINK(a,t) = r;
X
X`09`09&0209`7D else `7B
X`09`09&0209`09TRACE(("CASE 3: single rotation, end`5Cn"))
X
X`09`09&0209`09r          = q;
X`09`09&0209`09LINK(-a,p) = LINK(a,q);
X`09`09&0209`09LINK(a,q)  = p;
X
X`09`09&0209`09B(q) = -B(p);
X
X`09`09&0209`09LINK(stack`5Bk-1`5D.a,\0D0Bp) = q;
X`09`09&0209`09break;
X`09`09&0209`7D
X
X`09`09&0209TRACE_TREE("after rebalancing:", funcs);
X
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09return (value != 0);
X`7D
X
XBI_DATA *
Xbtree_search(BI_TREE *funcs, const char *data)
X`7B
X`09`09&0209/* (A1:Initialize) */
Xregister
X`09BI_NODE`09*t = `26(funcs->head),`09/* 't' => to the father of 's'`09*/
X`09`09*p = RLINK(t),&0209/* 'p' => down the tree&0209*/
X`09`09*q;
Xregister
X`09int`09a;
X
X`09if (p == 0) `7B
X`09`09return 0;
X`09`7D
X`09`09&0209/* (A2:Compare) */
X`09while ((a = COMPARE(data, KEY(p))) != 0) `7B
X`09`09&0209/* (A3,A4: move left/right accordingly)`09*/
X`09`09if ((q = LINK(a,p)) != 0) `7B
X`09`09`09p = q;
X`09`09`09/* ...continue comparing */
X`09`09`7D else `7B
X`09`09`09break;
X`09`09`7D
X`09`7D
X`09return a ? 0 : `26(p->value);
X`7D
X
X/********\0808\1010\2020\400E/
X
X#ifndef BTREE_VERIFY
X#define BTREE_VERIFY 1
X#endif
X
X#ifndef BTREE_DRIVER
X#define BTREE_DRIVER 1
X#endif
X
X#if DEBUG_BTREE >= BTREE_VERIFY
Xstatic int
Xbtree_count(BI_NODE *p)
X`7B
X`09int count = 0;
X`09if (p != 0) `7B
X`09`09count = 1;
X`09`09count += btree_count(LLINK(p));
X`09`09count += btree_count(RLINK(p));
X`09`7D
X`09return count;
X`7D
X#endif
X
X#if DEBUG_BTREE >= BTREE_VERIFY
Xstatic int
Xbtree_depth(BI_NODE *p)
X`7B
X`09int depth = 0;
X`09if (p != 0) `7B
X`09`09int l, r;
X`09`09assert(LLINK(p) != p);
X`09`09assert(RLINK(p) != p);
X`09`09l = btree_depth(LLINK(p));
X`09`09r = btree_depth(RLINK(p));
X`09`09depth = 1;
X`09`09if (l > r)
X`09`09`09depth += l;
X`09`09else
X`09`09`09depth += r;
X`09`7D
X`09return depth;
X`7D
X#endif
X
Xstatic void
Xdump_nodes(BI_TREE *funcs, BI_NODE * p, int level)
X`7B
X`09if (p) `7B
X`09`09dump_nodes(funcs, LLINK(p),  level+1);
X`09`09(*funcs->display)(p, level);
X#if DEBUG_BTREE > 0
X`09`09if (LLINK(p) != 0
X`09`09 `26`26 COMPARE(KEY(LLINK(p)), KEY(p)) > 0)
X`09`09`09TRACE((" OOPS:L"))
X`09`09if (RLINK(p) != 0
X`09`09 `26`26 COMPARE(KEY(RLINK(p)), KEY(p)) < 0)
X`09`09`09TRACE((" OOPS:R"))
X`09`09TRACE((" %d", btree_depth(p)))
X#endif
X#if DEBUG_BTREE >= BTREE_DRIVER
X`09`09printf("`5Cn");
X#endif
X`09`09dump_nodes(funcs, RLINK(p), level+1);
X`09`7D
X`7D
X
X/*
X * Invoke display function for each node
X */
Xvoid
Xbtree_printf(BI_TREE * funcs)
X`7B
X`09TRACE(("TREE, depth %d, count %d`5Cn", funcs->depth\0E09count))
X`09dump_nodes(funcs, RLINK(`26\0F06->head)), 0);
X`7D
X
X/********\0808\1010\2020\400E/
X
X/*
X * Find the the matching entry given a name in\2706ree.  Match according to
X * the 'mode' parameter:
X *
X *`09If it's FALSE then only the first len characters must match and this
X *`09will return the parent of the subtree that contains these entries (so
X *`09that an inorder walk can find the other matches).
X *
X *`09Use TRUE to force this to return the first of the ordered list of
X *`09partial matches; we need this behavior for interactive name completion.
X */
XBI_NODE *
Xbtree_pmatch(BI_NODE *n, const int mode\1008char *name)
X`7B
X`09BI_NODE *m;
X`09size_t len = strlen(name);
X
X`09while (n != 0) `7B
X`09`09int cmp;
X
X`09`09cmp = strncmp(name, BI_KEY(n), len);
X
X`09`09if (cmp == 0) `7B
X`09`09`09if (mode
X`09`09`09 `26`26 (m = btree_pmatch(BI_LEFT(n), mode, name)) != 0)
X`09`09&0209n = m;
X`09`09`09return n;
X`09`09`7D else if (cmp < 0) `7B
X`09`09`09n = BI_LEFT(n);
X`09`09`7D else `7B
X`09`09`09n = BI_RIGHT(n);
X`09`09`7D
X`09`7D
X`09return 0;
X`7D
X
X/*
X * Find the size of the binary-subtree with the matching name.
X */
Xstatic int
Xbtree_pcount(BI_NODE *node, char *matchname, size_t len)
X`7B
X`09int left = 0, righ\0B07me = 0;
X
X`09if (BI_LEFT(node) != 0) `7B
X`09`09left = btree_pcount(BI_LEFT(node), matchname, len);
X`09`7D
X
X`09if ((len == 0)
X`09 `7C`7C (strncmp(BI_KEY(node), matchname, len) == 0))
X`09`09me = 1;
X
X`09if (BI_RIGHT(node) != 0) `7B
X`09`09right = btree_pcount(BI_RIGHT(node), matchname, len);
X`09`7D
X
X`09return me + left + right;
X`7D
X
Xstatic void
Xbuild_parray(BI_NODE *head, char *matchname, size_t len, const \2306*nptr, int
V *i)
X`7B
X`09if (BI_LEFT(head) != 0) `7B
X`09`09build_parray(BI_LEFT(head), matchname, len, nptr, i);
X`09`7D
X
X`09if ((len == 0)
X`09 `7C`7C (strncmp(BI_KEY(head), matchname, len) == 0)) `7B
X`09`09nptr`5B*i`5D = BI_KEY(head);
X`09`09(*i)++;
X`09`7D
X
X`09if (BI_RIGHT(head) != 0) `7B
X`09`09build_parray(BI_RIGHT(head), matchname, len, nptr, i);
X`09`7D
X`7D
X
X/*
X * Build an array of the keys that partially-match the given name to at least
V
X * the given length 'len'.
X */
Xconst char **
Xbtree_parray(BI_TREE *tree, char *name, unsigned len)
X`7B
X`09BI_NODE *top;
X`09const char **nptr = 0;
X`09top = btree_pmatch(BI_RIGHT(`26(tree->head)), 0, name);
X
X`09if (top != 0) `7B
X`09`09int i = 0;
X`09`09size_t cnt = btree_pcount(top, name, len);
X`09`09nptr = castalloc(const char *, sizeof\150D) * (cnt + 1));
X`09`09if (nptr != 0) `7B
X`09`09`09build_parray(top, name, len, nptr, `26i);
X`09`09`09nptr`5Bi`5D = 0;
X`09`09`7D
X`09`7D
X`09return nptr;
X`7D
X
Xint btree_freeup(BI_TREE *funcs)
X`7B
X`09TRACE(("Deleting all nodes...`5Cn"))
X`09TRACE_TREE("INITIAL-", funcs);
X`09while (RLINK(`26(funcs->head))) `7B
X`09`09TRACE(("Try to delete '%s'`5Cn", KEY(RLINK(`26(funcs->head)))))
X`09`09if (!btree_delete(funcs, KEY(RLINK(`26\1306->head))))) `7B
X`09`09`09TRACE(("Try-delete failed`5Cn"))
X`09`09`09return 0;
X`09`09`7D
X#ifdef DEBUG_BTREE
X`09`09TRACE_TREE("AFTER-DELETE, ", funcs);
X`09`09if (!btree_verify(funcs, RLINK(`26\0F06->head)))) `7B
X`09`09`09TRACE(("Try-verify failed`5Cn"))
X`09`09`09return 0;
X`09`09`7D
X#endif
X`09`7D
X`09return 1;
X`7D
X
X/********\0808\1010\2020\400E/
X
X#ifdef DEBUG_BTREE
X
Xstatic int
Xbtree_verify(BI_TREE *funcs, BI_NODE *p)
X`7B
X#if DEBUG_BTREE >= BTREE_VERIFY
X`09int ok = 1;
X
X`09if (p != 0) `7B
X`09`09int root = (p == `26(funcs->head));
X`09`09BI_NODE *l = root ? 0 : LLINK(p);
X`09`09BI_NODE *r = RLINK(p);
X`09`09int balance = 0;
X`09`09int compare = 0;
X
X`09`09if (p == RLINK(`26(funcs->head))) `7B
X`09`09`09int count = btree_count(p);
X`09`09`09if (count != funcs->count) `7B
X`09`09&0209ok = 0;
X`09`09&0209TRACE(("OOPS: Counted %d vs %d in header`5Cn",
X`09`09&0209`09count, funcs->count))
X`09`09`09`7D
X`09`09`7D
X`09`09/* verify the balance factor */
X`09`09if ((balance = btree_depth(r) -\110Dl)) != 0) `7B
X`09`09`09if (balance > 0) `7B
X`09`09&0209if (balance > 1) `7B
X`09`09&0209`09ok = 0;
X`09`09&0209`09TRACE(("OOPS: '%s' is unbalanced`5Cn", KEY(p)))
X`09`09&0209`7D
X`09`09&0209balance = 1;
X`09`09`09`7D else `7B
X`09`09&0209if (balance < -1) `7B
X`09`09&0209`09ok = 0;
X`09`09&0209`09TRACE(("OOPS: '%s' is unbalanced`5Cn", KEY(p)))
X`09`09&0209`7D
X`09`09&0209balance = -1;
X`09`09`09`7D
X`09`09`7D
X`09`09if (B(p) != balance) `7B
X`09`09`09ok = 0;
X`09`09`09TRACE(("OOPS: Balance '%s' have %d vs %d`5Cn",
X`09`09&0209KEY(p), B(p), balance))
X`09`09`7D
X
X`09`09/* verify that the nodes are in correct order */
X`09`09compare = COMPARE(
X`09`09&0209(l != 0) ? KEY(l) : "",
X`09`09&0209(r != 0) ? KEY(r) : "`5C377");
X`09`09if (compare >= 0) `7B
X`09`09`09ok = 0;
X`09`09`09TRACE(("OOPS: Compare %s, have %d vs -1`5Cn",
X`09`09&0209KEY(p), compare))
X`09`09`7D
X
X`09`09/* recur as needed */
X`09`09ok `26= btree_verify(funcs, l);
X`09`09ok `26= btree_verify(funcs, r);
X`09`7D
X`09return ok;
X#else
X`09return 1;
X#endif
X`7D
X
X#if DEBUG_BTREE >= BTREE_DRIVER
X
X/********\0808\1010\2020\400E/
X#undef typecalloc
X#define typecalloc(cast) (cast *)\1507sizeof\1C06,1)
X
Xstatic BI_NODE *
Xnew_node (BI_DATA * data)
X`7B
X`09BI_NODE *result = typecalloc(\1D07);
X`09result->value = *data;
X`09result->value.bi_key = strdup(data->\1606); /* DEBUG-only */
X`09return result;
X`7D
X
Xstatic void
Xold_node (BI_NODE *node)
X`7B
X`09free(node);
X`7D
X
Xstatic void
Xdpy_node (BI_NODE *a, int level)
X`7B
X`09while (level-- > 0)
X`09`09printf(". ");
X`09printf("%s (%d)", KEY(a), B(a));
X`09fflush(stdout);
X`7D
X
Xstatic`09BI_TREE`09text_tree = `7B
X`09new_node,
X`09old_node,
X`09dpy_node
X`09`7D;
X
X/********\0808\1010\2020\400E/
X
X#define MAX_VEC 10000
X
Xint main(int argc, char *argv`5B`5D)
X`7B
X`09BI_DATA temp;
X`09BI_NODE *top;
X`09int n, m;
X`09int done = 0;
X`09char buffer`5BBUFSIZ`5D;
X`09int vector`5BMAX_VEC`5D;
X`09const char **list;
X
X`09memset(`26temp, 0, sizeof(temp));
X`09for (n = 1; n < argc; n++) `7B
X`09`09temp.bi_key = argv`5Bn`5D;
X`09`09btree_insert(`26text_tree, `26temp);
X`09`7D
X
X`09btree_printf(`26text_tree);
X`09btree_verify(`26text_tree, RLINK(`26(\1309.head)));
X
X`09while (!done `26`26 fgets(buffer, sizeof\0F07), stdin) != 0) `7B
X`09`09char *t = buffer;
X`09`09char *s = t + strlen(t);
X
X`09`09if (s != buffer `26`26 *--s == '`5Cn')
X`09`09`09*s = 0;
X
X`09`09switch (*t++) `7B
X`09`09default:
X`09`09`09printf("Commands are f(ind) i(nsert), d(elete), l(ist), p(rint), r(an
Vdom)`5Cn");
X`09`09`09break;
X`09`09case 'f':
X`09`09`09n = (btree_search(`26text_tree, t) != 0);
X`09`09`09printf("** found(%s) %d`5Cn", t, n);
X`09`09`09break;
X`09`09case 'i':
X`09`09`09temp.bi_key = t;
X`09`09`09n = (btree_insert(`26text_tree, `26temp) != 0);
X`09`09`09printf("** insert(%s) %d`5Cn", t, n);
X`09`09`09break;
X`09`09case 'd':
X`09`09`09n = btree_delete(`26text_tree, t);
X`09`09`09printf("** delete(%s) %d`5Cn", t, n);
X`09`09`09break;
X`09`09case 'l':
X`09`09`09if ((list = btree_parray(`26text_tree, t, strlen(t))) != 0) `7B
X`09`09&0209printf("** list(%s)`5Cn", t);
X`09`09&0209for (n = 0; list`5Bn`5D != 0; n++)
X`09`09&0209`09printf("`5B%d`5D '%s'`5Cn", n, list`5Bn`5D);
X`09`09&0209free(list);
X`09`09`09`7D
X`09`09`09else
X`09`09&0209printf("** list(%s) fail`5Cn", t);
X`09`09`09break;
X`09`09case 'L':
X`09`09`09if ((top = btree_pmatch(RLINK(`26text_tree.head), 1, t)) != 0)
X`09`09&0209printf("** List(%s) -> '%s'`5Cn", t, KEY(top));
X`09`09`09else
X`09`09&0209printf("** List(%s) fail`5Cn", t);
X`09`09`09break;
X`09`09case 'p':
X`09`09`09btree_printf(`26text_tree);
X`09`09`09break;
X`09`09case 'r':
X`09`09`09for (n = 0; n < MAX_VEC; n++) `7B
X`09`09&0209vector`5Bn`5D = random();
X`09`09&0209sprintf(buffer, "%d", vector`5Bn`5D);
X`09`09&0209temp.bi_key = buffer;
X`09`09&0209(void) btree_insert(`26text_tree, `26temp);
X`09`09&0209printf("** inserted(%s)`5Cn", buffer);
X`09`09`09`7D
X`09`09`09for (m = 0; m < 2; m++)
X`09`09`09for (n = 0; n < MAX_VEC; n++) `7B
X`09`09&0209unsigned delete = random() `26 1;
X`09`09&0209char *name = delete ? "\0A06" : "insert";
X`09`09&0209int ok;
X
X`09`09&0209sprintf(buffer, "%d", vector`5Bn`5D);
X`09`09&0209printf("** random %s (%s)`5Cn", name, buffer);
X`09`09&0209temp.bi_key = buffer;
X`09`09&0209if (delete)
X`09`09&0209`09ok = btree_delete(`26text_tree, buffer);
X`09`09&0209else
X`09`09&0209`09ok = btree_insert(`26text_tree, `26temp) != 0;
X`09`09&0209if (!btree_verify(`26text_tree, RLINK(`26(\1309.head)))) `7B
X`09`09&0209`09printf("OOPS: Random %s-verify '%s' failed`5Cn", name, buffer);
V
X`09`09&0209`09btree_printf(`26text_tree);
X`09`09&0209`09return (1);
X`09`09&0209`7D
X`09`09&0209printf("** result: %d`5Cn", ok);
X`09`09`09`7D
X`09`09`09break;
X`09`09case 'q':
X`09`09`09done = 1;
X`09`09`09break;
X`09`09case '#':
X`09`09`09break;
X`09`09`7D
X`09`09btree_verify(`26text_tree, RLINK(`26(\1309.head)));
X`09`7D
X`09btree_freeup(`26text_tree);
X
X`09printf("done!`5Cn`5Cn");
X`09return 0;
X`7D
X#endif /* DEBUG_BTREE >= BTREE_DRIVER */
X
X#endif /* DEBUG_BTREE */
$ call unpack [.VILE-8_0]BTREE.C;1 -
 1879964883 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 43 8 152
$!
$ create 'f'
X/*
X * $Id: btree.h,v 1.3 1998/05/14 00:46:55 tom Exp $
X *
X * Interface for btree.c
X */
X#ifndef BTREE_H
X#define BTREE_H 1
X
X#ifndef BI_DATA
X#define BI_DATA struct _bi_data
X `09BI_DATA `7B
X`09char`09*bi_key;`09/* the key */
X`09void`09*data;`09`09/* ...associated data */
X`09`7D;
X#endif
X
X#define BI_NODE struct _bi_node
X`09BI_NODE`09`7B
X`09BI_NODE`09*links`5B2`5D;
X`09short`09 balance;`09/* holds 0, -1, +1 */
X`09BI_DATA  value;
X`09`7D;
X
X#define BI_TREE struct _bi_tree
X`09BI_TREE`09`7B
X`09BI_NODE*(*allocat) (BI_DATA *a);
X`09void`09(*dealloc) (BI_NODE *a);
X`09void`09(*display) (BI_NODE *a, int level);
X`09int`09depth;
X`09int`09count;
X`09BI_NODE`09head;`09`09/* root data, on end to ease initialization */
X`09`7D;
X
X#define`09BI_KEY(p)`09(p)->value.bi_key
X#define`09BI_LEFT(p)`09(p)->links`5B0`5D
X#define`09BI_RIGHT(p)`09(p)->links`5B1`5D
X
X#ifdef __cplusplus
Xextern "C" `7B
X#endif
X
Xextern`09int`09 btree_delete(BI_TREE *tree, const char *data);
Xextern`09int`09 btree_freeup(BI_TREE *tree);
Xextern`09BI_DATA *btree_insert(BI_TREE *tree, \2509data);
Xextern`09const char **btree_parray(BI_TREE *tree,\2307name, unsigned len);
Xextern`09BI_NODE *btree_pmatch(\1609n, const int mode\1008char *name);
Xextern`09void`09 btree_printf(BI_TREE *tree);
Xextern`09BI_DATA *btree_search(BI_TREE *tree, const char *data);
X
X#ifdef __cplusplus
X`7D
X#endif
X
X#endif /* BTREE_H */
$ call unpack [.VILE-8_0]BTREE.H;1 -
 1396054006 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 3 9 152
$!
$ create 'f'
X/*
X * Buffer management.
X * Some of the functions are internal,
X * and some are actually attached to user
X * keys. Like everyone else, they set hints
X * for the display system.
X *
X * $Header: /usr/build/vile/vile/RCS/buffer.c,v 1.173 1998/05/22 00:03:23 tom
V Exp $
X *
X */
X
X#include`09"estruct.h"
X#include`09"edef.h"
X
X/*--------\0808\1010\2020\400A*/
X#if`09OPT_UPBUFF
Xstatic`09int`09show_BufferList ( BUFFER *bp );
X#define`09update_on_chg(bp) (!b_is_temporary(bp) `7C`7C show_all)
X#endif
X
X#if`09OPT_PROCEDURES
Xstatic`09void`09run_buffer_hook (void);
X#endif
X
X#if`09!OPT_MAJORMODE
Xstatic`09int`09cmode_active ( BUFFER *bp );
X#endif
X
Xstatic`09BUFFER *find_BufferList (void);
Xstatic`09BUFFER *find_b_number ( const char *\1507 );
Xstatic`09BUFFER *find_latest (void);
Xstatic`09BUFFER *find_nth_created ( int n );
Xstatic`09BUFFER *find_nth_used ( int n );
Xstatic`09int`09countBuffers (void);
Xstatic`09int`09hist_show (void);
Xstatic`09int`09lookup_hist ( BUFFER *bp );
Xstatic`09void`09FreeBuffer ( BUFFER *bp );
Xstatic`09void`09MarkDeleted ( BUFFER *bp );
Xstatic`09void`09MarkUnused ( BUFFER *bp );
Xstatic`09void`09TrackAlternate ( BUFFER *bp );
Xstatic`09void`09makebufflist (LIST_ARGS);
X
X#if !SMALLER
Xstatic`09void`09footnote ( int c );
X#endif
X
X/*--------\0808\1010\2020\400A*/
X
Xstatic`09BUFFER`09*last_bp,`09/* noautobuffer value */
X`09`09*this_bp,`09/* '%' buffer */
X`09`09*that_bp;`09/* '#' buffer */
Xstatic`09int`09show_all,`09/* true iff we show all buffers */
X`09`09updating_list;
X
X/*--------\0808\1010\2020\400A*/
X
X/*
X * Returns the buffer-list pointer, if it exists.
X */
Xstatic BUFFER *
Xfind_BufferList(void)
X`7B
X`09return find_b_name(BUFFERLIST_BufName);
X`7D
X
X/*
X * Look for a buffer-pointer in the list, to see if it has been delinked yet.
V
X */
XBUFFER *find_bp(\1008bp1)
X`7B
X`09register BUFFER *bp;
X`09for_each_buffer(bp)
X`09`09if (bp == bp1)
X`09`09`09return bp;
X`09return 0;
X`7D
X
X/*
X * Returns the total number of buffers in the list.
X */
Xstatic int
XcountBuffers(void)
X`7B
X`09register BUFFER *bp;
X`09register int`09count = 0;
X`09for_each_buffer(bp)
X`09`09count++;
X`09return count;
X`7D
X
X/*
X * Returns the n'th buffer created
X */
Xstatic BUFFER *
Xfind_nth_created(int n)
X`7B
X`09register BUFFER *bp;
X
X`09for_each_buffer(bp)
X`09`09if (bp->b_created == n)
X`09`09`09return bp;
X`09return 0;
X`7D
X
X/*
X * Returns the n'th buffer used
X */
Xstatic BUFFER *
Xfind_nth_used(int n)
X`7B
X`09register BUFFER *bp;
X
X`09for_each_buffer(bp)
X`09`09if (bp->b_last_used == n)
X`09`09`09return bp;
X`09return 0;
X`7D
X
X/*
X * Returns the buffer with the largest value of 'b_last_used'.
X */
Xstatic BUFFER *
Xfind_latest(void)
X`7B
X`09register BUFFER *bp, *maxbp = 0;
X
X`09for_each_buffer(bp) `7B
X`09`09if (maxbp == 0)
X`09`09`09maxbp = bp;
X`09`09else if (maxbp->b_last_used < \120F)
X`09`09`09maxbp = bp;
X`09`7D
X`09return maxbp;
X`7D
X
X/*
X * Look for a filename in the buffer-list
X */
XBUFFER *
Xfind_b_file(const char *fname)
X`7B
X`09register BUFFER *bp;
X`09char`09nfname`5BNFILEN`5D;
X
X`09(void)lengthen_path(strcpy(nfname, fname));
X`09for_each_buffer(bp)
X`09`09if (same_fname(nfname, bp, FALSE))
X`09`09`09return bp;
X`09return 0;
X`7D
X
X/*
X * Look for a specific buffer number
X */
XBUFFER *
Xfind_b_hist(int number)
X`7B
X`09register BUFFER *bp;
X
X`09if (number >= 0) `7B
X`09`09for_each_buffer(bp)
X`09`09`09if (!b_is_temporary(bp) `26`26 (number-- <= 0))
X`09`09&0209break;
X`09`7D else
X`09`09bp = 0;
X`09return bp;
X`7D
X
X/*
X * Look for a buffer-number (i.e., one from the \2207list display)
X */
Xstatic BUFFER *
Xfind_b_number(const char *\1306)
X`7B
X`09register int`09c = 0;
X`09while (isDigit(*number))
X`09`09c = (c * 10) + (*number++ - '0');
X`09if (!*number)
X`09`09return find_b_hist(c);
X`09return 0;
X`7D
X
X/*
X * Find buffer, given (possibly) filename, \2306 name or \0F08umber
X */
XBUFFER *
Xfind_any_buffer(const char *name)
X`7B
X`09register BUFFER *bp;
X
X`09if ((bp=find_b_name(name)) == 0`09`09/* Try buffer */
X`09 `26`26 (bp=find_b_file(name)) == 0`09`09/* ...then filename */
X`09 `26`26 (bp=find_b_number(name)) == 0) `7B`09/* ...then \2106 */
X`09`09mlforce("`5BNo such buffer`5D %s", name);
X`09`09return 0;
X`09`7D
X
X`09return bp;
X`7D
X
X/*
X * Delete all instances of window pointer for a given buffer \1B07
X */
Xint
Xzotwp(BUFFER *bp)
X`7B
X`09register WINDOW *wp;
X`09register BUFFER *nbp;
X`09register BUFFER *obp = 0;
X`09WINDOW`09dummy;
X`09int s = FALSE;
X
X`09TRACE(("zotwp(%s)`5Cn", bp->b_bname))
X
X`09/*
X`09 * Locate buffer to switch to after deleting windows.  It can't be
X`09 * the same as the buffer which is being deleted and if it's an
X`09 * invisible or scratch buffer, it must have been already \3507.
X`09 * From the set of allowable buffers, choose the most recently
X`09 * used.
X`09 */
X`09for_each_buffer(nbp) `7B
X`09`09if (nbp != bp `26`26 (!b_is_temporary(nbp) `7C`7C nbp->b_nwnd != 0)) `7B
V
X`09`09`09if (obp == 0)
X`09`09&0209obp = nbp;
X`09`09`09else if (obp->b_last_used < n\130F)
X`09`09&0209obp = nbp;
X`09`09`7D
X`09`7D
X
X`09/* Delete window instances...*/
X`09for_each_window(wp) `7B
X`09`09if (wp->w_bufp == bp `26`26 wheadp->w_wndp != NULL) `7B
X`09`09`09dummy.w_wndp = wp->\0D06;
X`09`09`09s = delwp(wp);
X`09`09`09wp = `26dummy;
X`09`09`7D
X`09`7D
X`09if (obp != NULL)
X`09`09s = swbuffer(obp);
X
X`09return s;
X`7D
X
X/*
X * Mark a buffer's created member to 0 (unused), adjusting the other \3B06s
X * so that there are no gaps.
X */
Xstatic void
XMarkDeleted(register BUFFER *bp)
X`7B
X`09int`09created = bp->b_\1007;
X
X`09if (created) `7B
X`09`09bp->b_created = 0;
X`09`09for_each_buffer(bp) `7B
X`09`09`09if (bp->b_created > \0A07)
X`09`09&0209bp->b_created -= 1;
X`09`09`7D
X`09`7D
X`7D
X
X/*
X * Mark a buffer's last-used member to 0 (unused), adjusting the other \3D06s
V
X * so that there are no gaps.
X */
Xstatic void
XMarkUnused(register BUFFER *bp)
X`7B
X`09int`09used = bp->b_last_used;
X
X`09if (used) `7B
X`09`09bp->b_last_used = 0;
X`09`09for_each_buffer(bp) `7B
X`09`09`09if (bp->b_last_used > used)
X`09`09&0209bp->b_last_used -= 1;
X`09`09`7D
X`09`7D
X`7D
X
X/*
X * After 'bclear()', frees remaining storage for a buffer.
X */
Xstatic void
XFreeBuffer(BUFFER *bp)
X`7B
X`09if (bp->b_fname != out_of_mem)
X`09`09FreeIfNeeded(bp->b_fname);
X
X#if !WINMARK
X`09if (is_header_line(MK, bp)) `7B
X`09`09MK.l = null_ptr;
X`09`09MK.o = 0;
X`09`7D
X#endif
X`09lfree(buf_head(bp), bp);`09`09/* Release header line. */
X`09if (delink_bp(bp) `7C`7C bp == bminip) `7B
X`09`09if (curbp == bp)
X`09`09`09curbp = NULL;
X
X#if OPT_HILITEMATCH
X`09`09clobber_save_curbp(bp);
X#endif
X#if OPT_PERL `7C`7C OPT_TCL
X`09`09api_free_private(bp->b_api_\1207);
X#endif
X`09`09free((char *) bp);&0209/* Release buffer block */
X`09`7D
X`7D
X
X/*
X * Adjust buffer-list's last-used member to account for a new\3407.
X */
Xstatic void
XTrackAlternate(BUFFER *newbp)
X`7B
X`09register BUFFER *bp;
X
X`09if (!updating_list) `7B
X`09`09MarkUnused(newbp);
X`09`09if ((bp = find_latest()) != 0) `7B
X`09`09`09newbp->b_last_used = (\1310+ 1);
X`09`09`7D else `7B`09/* shouldn't happen... */
X`09`09`09newbp->b_last_used = 1;
X`09`09`7D
X`09`7D
X`7D
X
X/* c is an index (counting only visible/nonscratch) into buffer list */
Xchar *
Xhist_lookup(int c)
X`7B
X`09register BUFFER *bp = find_b_hist(c);
X
X`09return (bp != 0) ? bp->b_bname : 0;
X`7D
X
X/* returns the buffer corresponding to the given number in the history */
Xstatic int
Xlookup_hist(BUFFER *bp1)
X`7B
X`09register BUFFER *bp;
X`09register int`09count = -1;
X
X`09for_each_buffer(bp)
X`09`09if (!b_is_temporary(bp)) `7B
X`09`09`09count++;
X`09`09`09if (bp == bp1)
X`09`09&0209return count;
X`09`09`7D
X`09return -1;`09/* no match */
X`7D
X
X/*
X * Run the $buffer-hook procedure, if it's defined.  Note that we mustn't do
X * this if curwp->w_bufp != curbp, since that would break the use of DOT and M
VK
X * throughout the program when performing editing operations.
X */
X#if OPT_PROCEDURES
Xstatic int bufhooking;
X#define DisableBufferHook bufhooking++;
X#define EnableBufferHook  bufhooking--;
X
Xstatic void
Xrun_buffer_hook(void)
X`7B
X`09if (!bufhooking
X`09 `26`26 !reading_msg_line
X`09 `26`26 *bufhook
X`09 `26`26 curwp != 0
X`09 `26`26 curwp->w_bufp == curbp) `7B
X`09`09DisableBufferHook;
X`09`09run_procedure(bufhook);
X`09`09EnableBufferHook;
X`09`7D
X`7D
X#else
X#define run_buffer_hook() /*EMPTY*/
X#define DisableBufferHook /*EMPTY*/
X#define EnableBufferHook  /*EMPTY*/
X#endif
X
Xstatic int
Xhist_show(void)
X`7B
X`09register BUFFER *bp;
X`09register int i = 0;
X`09char line`5BNLINE`5D;
X`09BUFFER *abp = (\0F08)0;
X
X`09if (!global_g_val(GMDABUFF))
X`09`09abp = find_alt();
X
X`09(void)strcpy(line,"");
X`09for_each_buffer(bp) `7B
X`09`09if (!b_is_temporary(bp)) `7B
X`09`09`09if (bp != curbp) `7B`09/* don't bother with current */
X`09`09&0209(void)lsprintf(line+strlen(line), "  %d%s%s %s",
X`09`09&0209`09i,
X`09`09&0209`09b_is_changed(bp) ? "*" : "",
X`09`09&0209`09(abp `26`26 abp == bp) ? "#" : "",
X`09`09&0209`09bp->b_bname);
X`09`09`09`7D
X`09`09`09if (++i > 9)`09/* limit to single-digit */
X`09`09&0209break;
X`09`09`7D
X`09`7D
X`09if (strcmp(line,"")) `7B
X`09`09mlforce("%s",line);
X`09`09return TRUE;
X`09`7D else `7B
X`09`09return FALSE;
X`09`7D
X`7D
X
X/*
X * Given a buffer, returns any corresponding WINDOW pointer
X */
XWINDOW *
Xbp2any_wp(BUFFER *bp)
X`7B
X`09register WINDOW *wp;
X`09for_each_visible_window(wp)
X`09`09if (wp->w_bufp == bp)
X`09`09`09break;
X`09return wp;
X`7D
X
X/*
X * Lets the user select a given buffer by its number.
X */
Xint
Xhistbuff(int f, int n)
X`7B
X`09register int thiskey, c;
X`09register BUFFER *bp = 0;
X`09char *bufn;
X
X`09if (f == FALSE) `7B
X`09`09if (!hist_show())
X`09`09`09return FALSE;
X`09`09thiskey = lastkey;
X`09`09c = keystroke8();
X`09`09mlerase();
X`09`09if (c == thiskey) `7B
X`09`09`09c = lookup_hist(bp = find_alt());
X`09`09`7D else if (isDigit(c)) `7B
X`09`09`09c = c - '0';
X`09`09`7D else `7B
X`09`09`09if (!isreturn(c))
X`09`09&0209unkeystroke(c);
X`09`09`09return FALSE;
X`09`09`7D
X`09`7D else `7B
X`09`09c = n;
X`09`7D
X
X`09if (c >= 0) `7B
X`09`09if ((bufn = hist_lookup(c)) == NULL) `7B
X`09`09`09mlwarn("`5BNo such buffer.`5D");
X`09`09`09return FALSE;
X`09`09`7D
X`09`09/* first assume its a buffer name, then a file name */
X`09`09if ((bp = find_b_name(bufn)) == NULL)
X`09`09`09return getfile(bufn,TRUE);
X
X`09`7D else if (bp == 0) `7B
X`09`09mlwarn("`5BNo alternate buffer`5D");
X`09`09return FALSE;
X`09`7D
X
X`09return swbuffer(bp);
X`7D
X
X/*
X * Returns the alternate-buffer pointer, if any
X */
XBUFFER *
Xfind_alt(void)
X`7B
X`09register BUFFER *bp;
X
X`09if (global_g_val(GMDABUFF)) `7B
X`09`09BUFFER *any_bp = 0;
X`09`09if ((bp = find_bp(curbp)) == 0)
X`09`09`09bp = bheadp;
X`09`09for (; bp; bp = bp->b_bufp) `7B
X`09`09`09if (bp != curbp) `7B
X`09`09&0209/*
X`09`09&0209 * If we allow temporary buffers to be selected as the
X`09`09&0209 * alternate, we get into the situation where we try
X`09`09&0209 * to load the message buffer, which has a NULL filename.
X`09`09&0209 * Note that the 'noautobuffer' case, below, never selects
X`09`09&0209 * a temporary buffer as the alternate\1807.
X`09`09&0209 */
X`09`09&0209if (!b_is_temporary(bp))
X`09`09&0209`09return bp;
X`09`09`09`7D
X`09`09`7D
X`09`09return any_bp;
X`09`7D else `7B
X`09`09register BUFFER *last = 0,
X`09`09&0209*next = find_latest();
X
X`09`09for_each_buffer(bp) `7B
X`09`09`09if ((bp != next)
X`09`09`09 `26`26 !b_is_temporary(bp)) `7B
X`09`09&0209if (last) `7B
+-+-+-+-+-+-+-+-  END  OF PART 8 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 9 -+-+-+-+-+-+-+-+
X`09`09&0209`09if (last->b_last_used < bp\120D)
X`09`09&0209&0209last = bp;
X`09`09&0209`7D else
X`09`09&0209`09last = bp;
X`09`09`09`7D
X`09`09`7D
X`09`09return last;
X`09`7D
X`7D
X
X/* make '#' buffer in noauto\1006-mode, given filename */
Xvoid
Ximply_alt(
Xchar *`09fname,
Xint`09copy,
Xint`09lockfl)
X`7B
X`09register BUFFER *bp;
X`09register LINE`09*lp;
X`09BUFFER *savebp;
X`09char nfname`5BNFILEN`5D;
X
X`09if (interrupted() `7C`7C fname == 0) /* didn't really have a filename */
X`09`09return;
X
X`09(void)lengthen_path(strcpy(nfname, fname));
X`09if (global_g_val(GMDIMPLYBUFF)
X`09 `26`26 curbp != 0
X`09 `26`26 curbp->b_fname != 0
X`09 `26`26 !same_fname(nfname, curbp, FALSE)
X`09 `26`26 !isInternalName(fname)) `7B
X`09`09savebp = curbp;
X`09`09if ((bp = find_b_file(nfname)) == 0) `7B
X`09`09`09L_NUM`09top, now;
X
X`09`09`09if ((bp = make_bp(fname, 0)) == 0) `7B
X`09`09&0209mlforce("`5BCannot create buffer`5D");
X`09`09&0209return;
X`09`09`09`7D
X
X`09`09`09/* fill the buffer */
X`09`09`09b_clr_flags(bp, BFINVS`7CBFCHG);
X`09`09`09b_set_flags(bp, BFIMPLY);
X`09`09`09bp->b_active = TRUE;
X`09`09`09ch_fname(bp, nfname);
X`09`09`09make_local_b_val(bp,MDNEWLINE);
X`09`09`09if (curwp != 0 `26`26 curwp->w_bufp == curbp) `7B
X`09`09&0209top = line_no(curbp, curwp->w_line.l);
X`09`09&0209now = line_no(curbp, DOT.l);
X`09`09`09`7D else
X`09`09&0209top = now = -1;
X
X`09`09`09if (copy) `7B
X`09`09&0209for_each_line(lp, savebp) `7B
X`09`09&0209`09if (addline(bp,lp->l_text\0B07used) != TRUE) `7B
X`09`09&0209&0209mlforce("`5BCopy-buffer failed`5D");
X`09`09&0209&0209return;
X`09`09&0209`09`7D
X`09`09&0209`7D
X`09`09&0209set_b_val(bp, MDNEWLINE, \1506savebp,\1809));
X`09`09&0209setm_by_suffix(bp);
X`09`09&0209setm_by_preamble(bp);
X`09`09`09`7D else
X`09`09&0209readin(fname, lockfl, bp, FALSE);
X
X`09`09`09/* setup so that buffer-toggle works as in vi (i.e.,
X`09`09`09 * the top/current lines of the screen are\0F06ame).
X`09`09`09 */
X`09`09`09if (now >= 0) `7B
X`09`09&0209for_each_line(lp,bp) `7B
X`09`09&0209`09if (--now == 0) `7B
X`09`09&0209&0209bp->b_dot.l = lp;
X`09`09&0209&0209bp->b_dot.o = cur\110B;
X`09`09&0209&0209break;
X`09`09&0209`09`7D
X`09`09&0209`09if (--top == 0) `7B
X`09`09&0209&0209bp->b_wline.l = lp;
X`09`09&0209`09`7D
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`7D
X`09`09DisableBufferHook;
X`09`09make_current(bp);
X`09`09make_current(savebp);
X`09`09EnableBufferHook;
X`09`7D
X`7D
X
X/* switch back to the most recent buffer */
X/* ARGSUSED */
Xint
Xaltbuff(int f GCC_UNUSED, int n\120B)
X`7B
X`09register BUFFER *bp = find_alt();
X`09if (bp == 0) `7B
X`09`09mlwarn("`5BNo alternate filename to substitute for #`5D");
X`09`09return FALSE;
X`09`7D else `7B
X`09`09return swbuffer(bp);
X`09`7D
X`7D
X
X/*
X * Attach a buffer to a window. The
X * values of dot and mark come from the buffer
X * if the use count is 0. Otherwise, they come
X * from some other window.
X */
X/* ARGSUSED */
Xint
Xusebuffer(int f GCC_UNUSED, int n\120B)
X`7B
X`09register BUFFER *bp;
X`09register int`09s;
X`09char`09`09bufn`5BNBUFN`5D;
X
X`09bufn`5B0`5D = EOS;
X`09if ((s=mlreply("Use buffer: ", bufn, sizeof(bufn))) != TRUE)
X`09`09return s;
X`09if ((bp=find_any_buffer(bufn)) == 0)`09/* Try \1B06 */
X`09`09return FALSE;
X`09return swbuffer(bp);
X`7D
X
X/* switch back to the first buffer (i.e., ":rewind") */
X/* ARGSUSED */
Xint
Xfirstbuffer(int f GCC_UNUSED, int n\120B)
X`7B
X`09int s = histbuff(TRUE,0);
X`09if (!global_g_val(GMDABUFF))
X`09`09last_bp = s ? curbp : 0;
X`09return s;
X`7D
X
X/* ARGSUSED */
Xint
Xnextbuffer(int f GCC_UNUSED, int n\120B)`09/* switch to the next \4106 in the
V \0E07list */
X`7B
X`09register BUFFER *bp;`09/* eligible buffer to switch to*/
X`09register BUFFER *stopatbp;`09/* eligible buffer to switch to*/
X
X`09if (global_g_val(GMDABUFF)) `7B`09/* go backward thru buffer-list */
X`09`09stopatbp = NULL;
X`09`09while (stopatbp != bheadp) `7B
X`09`09`09/* get the last buffer in\1306ist */
X`09`09`09bp = bheadp;
X`09`09`09while(bp != 0 `26`26 bp->b_bufp != stopatbp)
X`09`09&0209bp = bp->b_bufp;
X`09`09`09/* if that one's invisible, back up and try again */
X`09`09`09if (b_is_invisible(bp))
X`09`09&0209stopatbp = bp;
X`09`09`09else
X`09`09&0209return swbuffer(bp);
X`09`09`7D
X`09`7D else `7B`09`09`09/* go forward thru args-list */
X`09`09if ((stopatbp = curbp) == 0)
X`09`09`09stopatbp = find_nth_created(1);
X`09`09if (last_bp == 0)
X`09`09`09last_bp = find_b_hist(0);
X`09`09if (last_bp != 0) `7B
X`09`09`09for (bp = last_bp->b_bufp; bp; bp = \150A) `7B
X`09`09&0209if (b_is_argument(bp))
X`09`09&0209`09return swbuffer(last_bp = bp);
X`09`09`09`7D
X`09`09`7D
X`09`09mlforce("`5BNo more files to edit`5D");
X`09`7D
X`09/* we're back to the top -- they were all invisible */
X`09return swbuffer(stopatbp);
X`7D
X
X/* bring nbp to the top of the list, where curbp usually lives */
Xvoid
Xmake_current(BUFFER *nbp)
X`7B
X`09register BUFFER *bp;
X#if OPT_PROCEDURES
X`09register BUFFER *ocurbp;
X
X`09ocurbp = curbp;
X#endif
X
X`09TrackAlternate(nbp);
X
X`09if (!updating_list `26`26 global_g_val(GMDABUFF)) `7B
X`09`09if (nbp != bheadp) `7B`09/* remove nbp from the list */
X`09`09`09bp = bheadp;
X`09`09`09while(bp != 0 `26`26 bp->b_bufp != nbp)
X`09`09&0209bp = bp->b_bufp;
X`09`09`09bp->b_bufp = n\0E0A;
X
X`09`09`09/* put it at the head */
X`09`09`09nbp->b_bufp = bheadp;
X
X`09`09`09bheadp = nbp;
X`09`09`7D
X`09`09curbp = bheadp;
X`09`7D else
X`09`09curbp = nbp;
X
X#if OPT_PROCEDURES
X`09if (curbp != ocurbp) `7B
X`09`09run_buffer_hook();
X`09`7D
X#endif
X`09curtabval = tabstop_val(curbp);
X
X#if OPT_TITLE
X`09`7B
X`09`09char title`5B256`5D;
X`09`09sprintf(title, "vile - %s", curbp->b_bname);
X`09`09TTtitle(title);
X`09`7D
X#endif
X`7D
X
X
Xint
Xswbuffer(register BUFFER *bp)`09/* make \2406 BP current */
X`7B
X`09return swbuffer_lfl(bp, TRUE);
X`7D
X
Xstatic int
Xsuckitin (BUFFER *bp, int copy\0A06lockfl)
X`7B
X`09int s = TRUE;
X
X`09if (copy) `7B
X`09`09register WINDOW *wp;
X
X`09`09for_each_window(wp) `7B
X`09`09`09if (wp->w_bufp == bp `26`26 (is_visible_window(wp) `7C`7C bp->b_activ
Ve != TRUE))
X`09`09&0209copy_traits(`26(wp->w\0F07), `26(bp->b_w\1207);
X`09`09`7D
X`09`7D
X`09curwp->w_flag `7C= WFMODE`7CWFHARD;`09`09/* Quite nasty.&0209*/
X
X`09if (bp->b_active != TRUE) `7B`09`09/* buffer not \2107yet*/
X`09`09s = bp2readin(bp, lockfl);`09/* read and activate it */
X`09`7D
X#ifdef MDCHK_MODTIME
X`09else
X`09`09(void)check_modtime( bp, bp->b_fname );
X#endif
X`09updatelistbuffers();
X`09run_buffer_hook();
X`09return s;
X`7D
X
Xint
Xswbuffer_lfl(register BUFFER *bp, int lockfl)`09/* make \3406 BP current */
X`7B
X`09int s = TRUE;
X
X`09if (!bp) `7B
X`09`09mlforce("BUG:  swbuffer passed null bp");
X`09`09return FALSE;
X`09`7D
X
X`09TRACE(("swbuffer(%s) nwnd=%d`5Cn", bp->b_bname\0D08nwnd))
X`09if (curbp == bp
X`09 `26`26 curwp != 0
X`09 `26`26 DOT.l != 0
X`09 `26`26 curwp->w_bufp == bp) `7B  /* no switching to be done */
X
X`09`09if (!bp->b_active) /* on second thought, yes there is */
X`09`09`09s = suckitin(bp, TRUE, lockfl);
X
X`09`09return s;
X`09 `7D
X
X`09if (curbp) `7B
X`09`09/* if we'll have to take over this window, and it's the last */
X`09`09if (bp->b_nwnd == 0 `26`26 cur\160B!\1606
X`09`09&0209`09--(curbp->b_nwnd) == 0) `7B
X`09`09`09undispbuff(curbp,curwp);
X`09`09`7D
X`09`7D
X
X`09/* don't let make_current() call the hook -- there's
X`09`09more to be done down below */
X`09DisableBufferHook;
X`09make_current(bp);`09/* sets curbp */
X`09EnableBufferHook;
X
X`09bp = curbp;  /* if running the bufhook caused an error, we may
X`09`09&0209be in a different buffer than we thought
X`09`09&0209we were going to */
X
X`09/* get it already on the screen if possible */
X`09if (bp->b_nwnd != 0)  `7B /* then it's on the screen somewhere */
X`09`09register WINDOW *wp = bp2any_wp(bp);
X`09`09if (!wp)
X`09`09`09mlforce("BUG: swbuffer: wp still NULL");
X`09`09curwp = wp;
X`09`09upmode();
X#ifdef MDCHK_MODTIME
X`09`09(void)check_modtime( bp, bp->b_fname );
X#endif
X#if OPT_UPBUFF
X`09`09if (bp != find_BufferList())
X`09`09`09updatelistbuffers();
X#endif
X`09`09run_buffer_hook();
X`09`09return (find_bp(bp) != 0);
X`09`7D else if (curwp == 0) `7B
X`09`09return FALSE;`09/* we haven't started displaying yet */
X`09`7D
X
X`09/* oh well, suck it into this window */
X
X`09curwp->w_bufp  = bp;
X`09return suckitin(bp, (bp->b_nwnd++ == 0), lockfl);
X`7D
X
X#if NEEDED
X/* check to ensure any buffer that thinks it's displayed _is_\0F0B*/
Xvoid
Xbuf_win_sanity(void)
X`7B
X`09register BUFFER *bp;
X`09for_each_buffer(bp) `7B
X`09    if (bp->b_nwnd != 0)  `7B /* then it's on the screen somewhere */
X`09`09register WINDOW *wp = bp2any_wp(bp);
X`09`09if (!wp) `7B
X`09`09    dbgwrite("BUG: swbuffer 1: wp is NULL");
X`09`09`7D
X`09    `7D
X`09`7D
X`7D
X#endif
X
Xvoid
Xundispbuff(
Xregister BUFFER *bp,
Xregister WINDOW *wp)
X`7B
X`09/* get rid of it completely if it's a scratch buffer,
X`09`09or it's empty and unmodified */
X`09if (b_is_scratch(bp)) `7B
X`09`09/* Save the location within the help-file */
X`09`09if (eql_bname(bp, HELP_BufName))
X`09`09`09help_at = line_no(bp, wp->w_dot.l);
X`09`09(void)zotbuf(bp);
X`09`7D else if ( global_g_val(GMDABUFF) `26`26 !b_is_changed(bp) &0226
X`09`09    is_empty_buf(bp) `26`26 !ffexists(bp->b_fname)) `7B
X`09`09(void)zotbuf(bp);
X`09`7D else `7B  /* otherwise just adjust it off the screen */
X`09`09copy_traits(`26(bp->b_w\1006), `26(wp->w\2107));
X`09`7D
X`7D
X
X#if`09!OPT_MAJORMODE
X/* return true iff c-mode is active for this buffer */
Xstatic int
Xcmode_active(register BUFFER *bp)
X`7B
X`09if (is_local_b_val(bp,MDCMOD))
X`09`09return is_c_mode(bp);
X`09else
X`09`09return (is_c_mode(bp) `26`26 has_C_suffix(bp));
X`7D
X#endif
X
X/* return the correct tabstop setting for this buffer */
Xint
Xtabstop_val(register BUFFER *bp)
X`7B
X#if`09OPT_MAJORMODE
X`09int i = b_val(bp, VAL_TAB);
X#else
X`09int i = b_val(bp, (cmode_active(bp) ? VAL_C_TAB : VAL_TAB));
X#endif
X`09if (i == 0) return 1;
X`09return i;
X`7D
X
X/* return the correct shiftwidth setting for this buffer */
Xint
Xshiftwid_val(register BUFFER *bp)
X`7B
X#if`09OPT_MAJORMODE
X`09int i = b_val(bp, VAL_SWIDTH);
X#else
X`09int i = b_val(bp, (cmode_active(bp) ? VAL_C_SWIDTH : VAL_\0D06));
X#endif
X`09if (i == 0) return 1;
X`09return i;
X`7D
X
X#if`09!OPT_MAJORMODE
Xint
Xhas_C_suffix(register BUFFER *bp)
X`7B
X`09int s;
X`09int save = ignorecase;
X#if OPT_CASELESS
X`09ignorecase = TRUE;
X#else
X`09ignorecase = FALSE;
X#endif
X`09s =  regexec(global_g_val_rexp(GVAL_CSUFFIXES)->reg,
X`09`09`09bp->b_fname, (char *)0, 0, -1);
X`09ignorecase = save;
X`09return s;
X`7D
X#endif
X
X/*
X * Dispose of a buffer, by name.  If this is a screen-command, pick the name u
Vp
X * from the screen.  Otherwise, ask for the name.  Look it up (don't get too
X * upset if it isn't there at all!).  Get quite \2D09the buffer is being
X * displayed.  Clear the buffer (ask if\130Chas been changed).  Then
X * free the header line and the buffer \1B06.
X *
X * If we are given a repeat-count, try to kill that many buffers.  Killing fro
Vm
X * names selected from the buffer-list is a special case, because the cursor
X * may be pointing to the buffer-number column.  In that case, we must
X * recompute the buffer-contents.  Otherwise, mov\2606cursor down one line
X * (staying in the same column), so we can pick up the names from successive
X * lines.
X */
Xint
Xkillbuffer(int f, int n)
X`7B
X`09register BUFFER *bp;
X`09register int`09s;
X`09char bufn`5BNFILEN`5D;
X
X#if OPT_UPBUFF
X`09C_NUM`09save_COL;
X`09MARK`09save_DOT;
X`09MARK`09save_TOP;
X`09int`09animated = f
X`09`09`09`26`26 (n > 1)
X`09`09`09`26`26 (curbp != 0)
X`09`09`09`26`26 (curbp == find_BufferList());
X`09int`09special  = animated `26`26 (DOT.o == 2);
X
X`09if (animated `26`26 !special) `7B
X`09`09save_COL = getccol(FALSE);
X`09`09save_DOT = DOT;
X`09`09save_TOP = curwp->w_line;
X`09`7D else
X`09`09save_COL = 0;`09/* appease gcc */
X#endif
X
X`09if (!f)
X`09`09n = 1;
X`09for_ever `7B
X`09`09bufn`5B0`5D = EOS;
X`09`09if (clexec `7C`7C isnamedcmd) `7B
X`09`09`09if ((s=mlreply("Kill buffer: ", bufn, sizeof(bufn))) != TRUE)
X`09`09&0209break;
X`09`09`7D else if ((s = screen_to_bname(bufn)) != TRUE) `7B
X`09`09`09mlforce("`5BNothing selected`5D");
X`09`09`09break;
X`09`09`7D
X
X`09`09if ((bp=find_any_buffer(bufn)) == 0) `7B`09/* Try \1D06 */
X`09`09`09s = FALSE;
X`09`09`09break;
X`09`09`7D
X
X`09`09if ((curbp == bp) `26`26 (find_alt() == 0)) `7B
X`09`09`09mlforce("`5BCan't kill that buffer`5D");
X`09`09`09s = FALSE;
X`09`09`09break;
X`09`09`7D
X
X`09`09(void)strcpy(bufn, bp->b_bname); /* ...for info-message */
X`09`09if (bp->b_nwnd != 0)  `7B /* then it's on the screen somewhere */
X`09`09`09(void)zotwp(bp);
X`09`09`09if (find_bp(bp) == 0) `7B /* delwp must have zotted us */
X`09`09&0209s = FALSE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`09if ((s = zotbuf(bp)) != TRUE)
X`09`09`09break;
X`09`09mlwrite("Buffer %s gone", bufn);
X`09`09if (--n > 0) `7B
X#if OPT_UPBUFF
X`09`09`09if (special)
X`09`09&0209(void)update(TRUE);
X`09`09`09else
X#endif
X`09`09`09 if (!forwline(FALSE,1))
X`09`09&0209break;
X`09`09`7D else
X`09`09`09break;
X`09`7D
X
X#if OPT_UPBUFF
X`09if (animated `26`26 !special) `7B
X`09`09curgoal = save_COL;
X`09`09DOT     = save_DOT;
X`09`09DOT.o   = getgoal(DOT.l);
X`09`09curwp->w_line = save_TOP;
X`09`09curwp->w_flag `26= (USHORT) `7EWFMOVE;
X`09`7D
X#endif
X`09return s;
X`7D
X
X/*
X * Unlink a buffer from the list, adjusting last-used and created counts.
X */
Xint
Xdelink_bp(BUFFER *bp)
X`7B
X`09register BUFFER *bp1, *bp2;
X
X`09bp1 = NULL;`09`09&0209/* Find the header.`09*/
X`09bp2 = bheadp;
X`09while (bp2 != bp) `7B
X`09`09bp1 = bp2;
X`09`09bp2 = bp2->b_bufp;
X`09`09if (bp2 == 0)
X`09`09`09return FALSE;
X`09`7D
X`09bp2 = bp2->b_bufp;`09`09`09/* Next one in chain.`09*/
X`09if (bp1 == NULL)`09`09`09/* Unlink it.&0209*/
X`09`09bheadp = bp2;
X`09else
X`09`09bp1->b_bufp = bp2;
X`09MarkUnused(bp);
X`09MarkDeleted(bp);
X`09if (bp == last_bp)
X`09`09last_bp = 0;
X`09return TRUE;
X`7D
X
Xchar *
Xstrip_brackets(char *dst, const char *src)
X`7B
X`09size_t len;
X
X`09if (*src == SCRTCH_LEFT`5B0`5D)
X`09`09src++;
X`09(void) strcpy(dst, src);
X`09if ((len = strlen(dst)) != 0
X`09 `26`26 dst`5Blen-1`5D == SCRTCH_RIGHT`5B0`5D) `7B
X`09`09dst`5B--len`5D = EOS;
X`09`7D
X`09return dst;
X`7D
X
Xchar *
Xadd_brackets(char *dst, const char *src)
X`7B
X`09dst`5B0`5D = SCRTCH_LEFT`5B0`5D;
X`09(void)strcat(strncpy(`26dst`5B1`5D, src, NBUFN-3), SCRTCH_RIGHT);
X`09return dst;
X`7D
X
Xint
Xzotbuf(register BUFFER *bp)`09/* kill the buffer pointed to by bp */
X`7B
X`09register int`09s;
X`09register int`09didswitch = FALSE;
X
X`09if (find_bp(bp) == 0) `09/* delwp may have zotted us, pointer obsolete */
X`09`09return TRUE;
X
X`09TRACE(("zotbuf(%s)`5Cn", bp->b_bname))
X
X#define no_del
X#ifdef no_del
X`09if (bp->b_nwnd != 0) `7B`09`09`09/* Error if on screen.`09*/
X`09`09mlforce("`5BBuffer is being displayed`5D");
X`09`09return (FALSE);
X`09`7D
X#else
X`09if (curbp == bp) `7B
X`09`09didswitch = TRUE;
X`09`09if (find_alt() == 0) `7B
X`09`09`09mlforce("`5BCan't kill that buffer`5D");
X`09`09`09return FALSE;
X`09`09`7D
X`09`7D
X`09if (bp->b_nwnd != 0)  `7B /* then it's on the screen somewhere */
X`09`09(void)zotwp(bp);
X`09`09if (find_bp(bp) == 0) /* delwp must have zotted us */
X`09`09`09return TRUE;
X`09`7D
X
X#endif
X#if OPT_LCKFILES
X`09/* If Buffer is killed and not locked by other then release own lock */
X`09if ( global_g_val(GMDUSEFILELOCK) ) `7B
X`09`09if ( bp->b_active )
X`09`09`09 if (!b_val (curbp, MDLOCKED) `26`26 \1C11VIEW))
X`09`09&0209release_lock(bp->b_fname);
X`09`7D
X#endif
X`09/* Blow text away.`09*/
X`09if ((s=bclear(bp)) != TRUE) `7B
X`09`09/* the user must have answered no */
X`09`09if (didswitch)
X`09`09`09(void)swbuffer(bp);
X`09`7D else `7B
X#if OPT_NAMEBST
X`09`09if (is_scratchname(bp->b_bname)) `7B
X`09`09`09char procname`5BNBUFN`5D;
X`09`09`09delete_namebst(strip_brackets(procname, bp->b_bname),
X`09`09&0209`09TRUE);
X`09`09`7D
X#endif
X`09`09FreeBuffer(bp);
X`09`09updatelistbuffers();
X`09`7D
X`09return (s);
X`7D
X
X
X/* Rename a buffer given\0F0Apointer and new\2608name. */
Xint
Xrenamebuffer(BUFFER *rbp, char *bufname)
X`7B
X`09register BUFFER *bp;`09/* pointer to scan through all buffers */
X`09char bufn`5BNBUFN`5D;`09/* buffer to hold\0F08name */
X`09WINDOW *wp;
X
X`09strncpy(bufn, bufname, NBUFN-1);
X`09bufn`5BNBUFN-1`5D = 0;
X
X`09if (*mktrimmed(bufn) == EOS)
X`09`09return(ABORT);
X
X`09bp = find_b_name(bufn);
X
X`09if (bp == curbp)
X`09`09return(ABORT);&0209/* no change */
X
X`09if (bp != 0)
X`09`09return FALSE;&0209/* name already in use */
X
X#if OPT_NAMEBST
X`09if (is_scratchname(rbp->b_bname)) `7B
X`09`09char procname`5BNBUFN`5D;
X`09`09(void) strip_brackets(procname, rbp->b_bname);
X`09`09if (search_namebst(procname)
X`09`09 `26`26 rename_namebst(procname, bufn) != TRUE)
X`09`09`09return ABORT;
X`09`7D
X#endif
X`09set_bname(rbp, bufn);`09/* copy buffer name to structure */
X
X`09for_each_visible_window(wp)
X`09`09if (wp->w_bufp == rbp)
X`09`09`09wp->w_flag `7C= WFMODE;
X
X`09return(TRUE);
X`7D
X
X#define NEW_NAMEBUFFER 1
X#if NEW_NAMEBUFFER
X/* ARGSUSED */
Xint
Xnamebuffer(int f GCC_UNUSED, int n\120B)`09/*`09Rename the current \4106`09*/
V
X`7B
X`09static char bufn`5BNBUFN`5D;`09/* buffer to hold\0F08name */
X`09const char *prompt = "New name for buffer: ";
X`09int status;
X
X`09/* prompt for and get the new buffer name */
X`09do `7B
X`09`09if (mlreply(prompt, bufn, sizeof(bufn)) != TRUE)
X`09`09`09return(FALSE);
X`09`09if (*mktrimmed(bufn) == EOS)
X`09`09`09return(FALSE);
X`09`09prompt = "That name's been used.  New name: ";
X`09`09status = renamebuffer(curbp, bufn);
X`09`09if (status == ABORT)
X`09`09`09return(FALSE);
X`09`7D while (status == FALSE);
X
X`09b_clr_scratch(curbp);`09/* if renamed, we must want it */
X`09mlerase();
X`09updatelistbuffers();
X`09return(TRUE);
X`7D
X#else
X/* ARGSUSED */
Xint
Xnamebuffer(int f GCC_UNUSED, int n\120B)`09/*`09Rename the current \4106`09*/
V
X`7B
X`09register BUFFER *bp;`09/* pointer to scan through all buffers */
X`09static char bufn`5BNBUFN`5D;`09/* buffer to hold\0F08name */
X`09const char *prompt = "New name for buffer: ";
X
X`09/* prompt for and get the new buffer name */
X`09do `7B
X`09`09if (mlreply(prompt, bufn, sizeof(bufn)) != TRUE)
X`09`09`09return(FALSE);
X`09`09if (*mktrimmed(bufn) == EOS)
X`09`09`09return(FALSE);
X`09`09prompt = "That name's been used.  New name: ";
X`09`09bp = find_b_name(bufn);
X`09`09if (bp == curbp)`09/* no change */
X`09`09`09return(FALSE);
X`09`7D while (bp != 0);
X
X#if OPT_NAMEBST
X`09if (is_scratchname(curbp->b_bname)) `7B
X`09`09char procname`5BNBUFN`5D;
X`09`09(void) strip_brackets(procname, curbp->b_bname);
X`09`09if (rename_namebst(procname, bufn) != TRUE)
X`09`09`09return FALSE;
X`09`7D
X#endif
X`09set_bname(curbp, bufn);`09/* copy buffer name to structure */
X`09curwp->w_flag `7C= WFMODE;/* make mode line replot */
X`09b_clr_scratch(curbp);`09/* if renamed, we must want it */
X`09mlerase();
X`09updatelistbuffers();
X`09return(TRUE);
X`7D
X#endif /* NEW_NAMEBUFFER */
X
X/* create or find a window, and stick this buffer in it.  when
X`09done, we own the window and the buffer, but they are _not_
X`09necessarily curwp and curbp */
Xint
Xpopupbuff(BUFFER *bp)
X`7B
X`09register WINDOW *wp;
X
X`09if (!curbp) `7B
X`09`09curbp = bp;  /* possibly at startup time */
X`09`09curwp->w_bufp = curbp;
X`09`09++curbp->b_nwnd;
X`09`7D else if (bp->b_nwnd == 0) `7B`09/* Not on screen yet. */
X`09`09if ((wp = wpopup()) == NULL)
X`09`09`09return FALSE;
X`09`09if (--wp->w_bufp->b_nwnd == 0)
X`09`09`09undispbuff(wp->w_bufp,wp);
X`09`09wp->w_bufp  = bp;
X`09`09++bp->b_nwnd;
X`09`7D
X
X`09for_each_window(wp) `7B
X`09`09if (wp->w_bufp == bp) `7B
X`09`09`09wp->w_line.l = lforw(buf_head(bp));
X`09`09`09wp->w_dot.l  = lforw(buf_head(bp));
X`09`09`09wp->w_dot.o  = 0;
X#if WINMARK
X`09`09`09wp->w_mark = nullmark;
X#endif
X`09`09`09wp->w_lastdot = nullmark;
X`09`09`09wp->w_values = global_\1208;
X`09`09`09wp->w_flag `7C= WFMODE`7CWFHARD;
X`09`09`7D
X`09`7D
X`09return swbuffer(bp);
X`7D
X
X/*
X * Invoked after changing mode 'autobuffer', this relinks the list of \2206s
X * sorted according to the mode: by creation or last-used order.
X */
Xvoid
Xsortlistbuffers(void)
X`7B
X`09register BUFFER *bp, *newhead = 0;
X`09register int`09c;
X
X`09if (global_g_val(GMDABUFF)) `7B
X`09`09c = 1;
X`09`09while ((bp = find_nth_used(c++)) != 0) `7B
X`09`09`09bp->b_relink = newhead;
X`09`09`09newhead = bp;
X`09`09`7D
X`09`7D else `7B
X`09`09c = countBuffers();
X`09`09while ((bp = find_nth_created(c--)) != 0) `7B
X`09`09`09bp->b_relink = newhead;
X`09`09`09newhead = bp;
X`09`09`7D
X`09`7D
X
X`09for (bp = newhead; bp; bp = bp->b_relink)
X`09`09bp->b_bufp = \0D06relink;
X`09bheadp = newhead;
X
X`09updatelistbuffers();
X`7D
X
X/*
X * List all of the active buffers.  First update the special\2307 that holds
X * the list.  Next make sure at least 1 window is displaying the buffer list,
V
X * splitting the screen if this is what it takes.  Lastly, repaint all of the
V
X * windows that are displaying the list.  A numeric argument forces it to
X * toggle the listing invisible buffers as well (a subsequent argument forces
V
X * it to a normal listing).
X */
Xint
Xtogglelistbuffers(int f, int n)
X`7B
X`09int status;
X`09register BUFFER *bp;
X
X`09/* if it doesn't exist, create it */
X`09if ((bp = find_BufferList()) == NULL) `7B
X`09`09status = listbuffers(f,n);
X`09/* if user supplied argument, re-create */
X`09`7D else if (f) `7B
X`09`09status = listbuffers(!show_all,n);
X`09`7D else `7B
X`09`09/* if it does exist, delete the window, which in turn
X`09`09   will kill the BFSCRTCH buffer */
X`09`09status = zotwp(bp);
X`09`7D
X
X`09return status;
X`7D
X
X/*
X * Track/emit footnotes for 'makebufflist()', showing only the ones we use.
X */
X#if !SMALLER
Xstatic void
Xfootnote(int c)
X`7B
X`09static`09struct`09`7B
X`09`09const char *name;
X`09`09int`09flag;
X`09`7D table`5B`5D = `7B
X`09`09`7B"automatic",`090`7D,
X`09`09`7B"invisible",`090`7D,
X`09`09`7B"modified",`090`7D,
X`09`09`7B"scratch",`090`7D,
X`09`09`7B"unread",`090`7D,
X`09`09`7D;
X`09register SIZE_T`09j, next;
X
X`09for (j = next = 0; j < TABLESIZE(table); j++) `7B
X`09`09if (c != 0) `7B
X`09`09`09if (table`5Bj`5D.name`5B0`5D == c) `7B
X`09`09&0209bputc(c);
X`09`09&0209table`5Bj`5D.flag = TRUE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D else if (table`5Bj`5D.flag) `7B
X`09`09`09bprintf("%s '%c'%s %s",
X`09`09&0209next ? "," : "notes:",`09table`5Bj`5D.name`5B0`5D,
X`09`09&0209next ? ""  : " is",`09table`5Bj`5D.name);
X`09`09`09next++;
X`09`09`09table`5Bj`5D.flag = 0;
X`09`09`7D
X`09`7D
X`09if (next)
X`09`09bputc('`5Cn');
X`7D
X#define`09MakeNote(c)`09footn\0C06
X#define`09ShowNotes()`09footnote(0)
X#else
X#define`09MakeNote(c)`09bputc(c)
X#define`09ShowNotes()
X#endif
X
X/*
X * This routine rebuilds the text in the buffer that ho\2208\1607list.  It
X * is called by the list buffers command.  Return TRUE if everything works.
X * Return FALSE if there is an error (\160Cno memory).  The variable
X * 'show_all' (set if the command had a repeat-count) indicates whether to lis
Vt
X * hidden buffers.
X */
X/* ARGSUSED */
Xstatic void
Xmakebufflist(
X`09int iflag GCC_UNUSED,`09/* list hidden buffer flag */
X`09void *dummy GCC_UNUSED)
X`7B
X`09register BUFFER *bp;
X`09LINEPTR curlp;`09`09/* entry corresponding to buffer-list */
X`09int nbuf = 0;`09`09/* no. of buffers */
X`09int this_or_that;
X
X`09curlp = null_ptr;
X
X`09if (this_bp == 0)
X`09`09this_bp = curbp;
X`09if (this_bp == that_bp)
X`09`09that_bp = find_alt();
X
X`09bprintf("      %7s %*s %s`5Cn", "Size",NBUFN-1,"Buffer name","Contents");
X`09bprintf("      %7p %*p %30p`5Cn", '-',NBUFN-1,'-','-');
X
X`09/* output the list of buffers */
X`09for_each_buffer(bp) `7B
X`09`09/* skip those buffers which don't get updated when changed */
X#if`09OPT_UPBUFF
X`09`09if (!update_on_chg(bp)) `7B
X`09`09`09continue;
X`09`09`7D
X#endif
X
X`09`09/* output status flag (e.g., has the file been read in?) */
X`09`09if (b_is_scratch(bp))
X`09`09`09MakeNote('s');
X`09`09else if (!(bp->b_active))
X`09`09`09MakeNote('u');
X`09`09else if (b_is_implied(bp))
X`09`09`09MakeNote('a');
X`09`09else if (b_is_invisible(bp))
X`09`09`09MakeNote('i');
X`09`09else if (b_is_changed(bp))
X`09`09`09MakeNote('m');
X`09`09else
X`09`09`09bputc(' ');
X
X`09`09this_or_that = (bp == this_bp)
X`09`09`09? EXPC_THIS
X`09`09`09: (bp == that_bp)
X`09`09&0209? EXPC_THAT
X`09`09&0209: ' ';
X
X`09`09if (b_is_temporary(bp))
X`09`09`09bprintf("   %c ", this_or_that);
X`09`09else
X`09`09`09bprintf(" %2d%c ", nbuf++, this_or_that);
X
X`09`09(void)bsizes(bp);
X`09`09bprintf("%7ld %*S ", bp->b_bytecount, NBUFN-1\1A09name );
X`09`09`7B
X`09`09`09char`09temp`5BNFILEN`5D;
X`09`09`09char`09*p;
X
X`09`09`09if ((p = bp->b_fname) != 0)
X`09`09&0209p = shorten_path(strcpy(temp, p), TRUE);
X
X`09`09`09if (p != 0)
X`09`09&0209bprintf("%s",p);
X`09`09`7D
X`09`09bprintf("`5Cn");
X`09`09if (bp == curbp)
X`09`09`09curlp = lback(\0606buf_head(curbp)));
X`09`7D
X`09ShowNotes();
X`09bprintf("             %*s %s", NBUFN-1, "Current dir:",
X`09`09current_directory(FALSE));
X
X`09/* show the actual size of the buffer-list */
X`09if (curlp != null_ptr) `7B
X`09`09char`09temp`5B20`5D;
X`09`09(void)bsizes(curbp);
X`09`09(void)lsprintf(temp, "%7ld", curbp->b_bytecount);
X`09`09(void)memcpy(curlp->l_text + 6, temp,
X`09`09             (SIZE_T)strlen(temp));
X`09`7D
X`7D
X
X#if`09OPT_UPBUFF
X/*
X * (Re)compute the contents of the buffer-list.  Us\2606flag 'updating_list'
X * as a semaphore to avoid adjusting the last used/created indices while
X * cycling over the list of buffers.
X */
X/*ARGSUSED*/
Xstatic int
Xshow_BufferList(BUFFER *bp GCC_UNUSED)
X`7B
X`09register int`09status;
X`09if ((status = (!updating_list++ != 0)) != FALSE) `7B
X`09`09this_bp = curbp;
X`09`09that_bp = find_alt();
X`09`09status = liststuff(BUFFERLIST_BufName, FALSE,
X`09`09&0209makebufflist, 0, (void *)0);
X`09`7D
X`09updating_list--;
X`09return status;
X`7D
X
X/*
X * If the list-buffers window is visible, update it after operations that
X * would modify the list.
X */
Xvoid
Xupdatelistbuffers(void)
X`7B
X`09update_scratch(BUFFERLIST_BufName, show_BufferList);
X`7D
X
X/* mark a scratch/temporary buffer for update */
Xvoid
Xupdate_scratch(const char *name, int (*func)(BUFFER *))
X`7B
X`09register BUFFER *bp = find_b_name(name);
X
X`09if (bp != 0) `7B
X`09`09bp->b_upbuff = func;
X`09`09b_set_obsolete(bp);
X`09`7D
X`7D
X#endif`09/* OPT_UPBUFF */
X
X/* ARGSUSED */
Xint
Xlistbuffers(int f GCC_UNUSED, int n\120B)
X`7B
X#if`09OPT_UPBUFF
X`09register int status;
X
X`09show_all = f;`09/* save this to use in automatic updating */
X`09if (find_BufferList() != 0) `7B
X`09`09updatelistbuffers();
X`09`09return TRUE;
X`09`7D
X`09this_bp = 0;
X`09that_bp = curbp;
X`09status  = liststuff(BUFFERLIST_BufName, FALSE,
X`09`09&0209makebufflist, 0, (void *)0);
X`09b_clr_obsolete(curbp);
X`09return status;
X#else
X`09show_all = f;
X`09this_bp = 0;
X`09that_bp = curbp;
X`09return liststuff(BUFFERLIST_BufName, FALSE,
X`09`09&0209makebufflist, 0, (void *)0);
X#endif
X`7D
X
X/*
X * The argument "text" points to
X * a string. Append this line to the
X * buffer. Handcraft the EOL
X * on the end. Return TRUE if it worked and
X * FALSE if you ran out of room.
X */
Xint
Xaddline(register BUFFER *bp, const char *text, int len)
X`7B
X`09if (add_line_at (bp, lback(buf_head(bp)), text, len) == TRUE) `7B
X`09`09/* If "." is at the end, move it to new line  */
X`09`09if (sameline(bp->b_dot, \0B06line))
X`09`09`09bp->b_dot.l = lback(buf_head(bp));
X`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X
X/*
X * Add a LINE filled with the given text after the specified LINE.
X */
Xint
Xadd_line_at (
Xregister BUFFER`09*bp,
XLINEPTR`09prevp,
Xconst char *text,
Xint`09len)
X`7B
X`09register LINEPTR newlp;
X`09register LINEPTR nextp;
X`09register LINE *`09lp;
X`09register int`09ntext;
X
X`09nextp = lforw(prevp);
X`09ntext = (len < 0) ? strlen(text) : len;
X`09newlp = lalloc(ntext, bp);
X`09if (newlp == null_ptr)
X`09`09return (FALSE);
X
X`09lp = newlp;
X`09if (ntext > 0)
X`09`09(void)memcpy(lp->l_text, \0606(SIZE_T)ntext);
X
X`09/* try to maintain byte/line counts? */
X`09if (b_is_counted(bp)) `7B
X`09`09if (nextp == buf_head(bp)) `7B
X`09`09`09make_local_b_val(bp,MDNEWLINE);
X`09`09`09set_b_val(bp, MDNEWLINE, TRUE);
+-+-+-+-+-+-+-+-  END  OF PART 9 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 10 -+-+-+-+-+-+-+-+
X`09`09`09bp->b_bytecount += (ntext+1);
X`09`09`09bp->b_linecount += 1;
X#if !SMALLER`09`09/* tradeoff between codesize `26 data */
X`09`09`09lp->l_number = bp->b_linecount;
X#endif
X`09`09`7D else
X`09`09`09b_clr_counted(bp);
X`09`7D
X
X`09set_lforw(prevp, newlp);`09/* link into the buffer */
X`09set_lback(newlp, prevp);
X`09set_lback(nextp, newlp);
X`09set_lforw(newlp, nextp);
X
X`09return (TRUE);
X`7D
X
X/*
X * Look through the list of
X * buffers. Return TRUE if there
X * are any changed buffers. B\0906
X * that hold magic internal stuff are
X * not considered; who cares if the
X * list of buffer names is hacked.
X * Return FALSE if no buffers
X * have been changed.
X * Return a pointer to the first changed buffer,
X * in case there's only one -- it's useful info
X * then.
X */
Xint
Xany_changed_buf(BUFFER **bpp)
X`7B
X`09register BUFFER *bp;
X`09register int cnt = 0;
X`09if (bpp) *bpp = NULL;
X
X`09for_each_buffer(bp) `7B
X`09`09if (!b_is_invisible(bp) `26`26 b_is_changed(bp)) `7B
X`09`09    `09if (bpp `26`26 !*bpp)
X`09`09&0209*bpp = bp;
X`09`09`09cnt++;
X`09`09`7D
X`09`7D
X`09return (cnt);
X`7D
X
X/* similar to above, for buffers that have not been visited */
Xint
Xany_unread_buf(BUFFER **bpp)
X`7B
X`09register BUFFER *bp;
X`09register int cnt = 0;
X`09if (bpp) *bpp = NULL;
X
X`09for_each_buffer(bp) `7B
X`09`09if (!b_is_invisible(bp) `26`26 !bp->b_active) `7B
X`09`09    `09if (bpp `26`26 !*bpp)
X`09`09&0209*bpp = bp;
X`09`09`09cnt++;
X`09`09`7D
X`09`7D
X`09return (cnt);
X`7D
X
X/*
X * Copies string to a buffer-name, trimming trailing blanks for consistency.
X */
Xvoid
Xset_bname(BUFFER *bp, const char *name)
X`7B
X`09register int j, k;
X`09register char *d;
X
X`09(void)strncpy0(bp->b_bname, \0606NBUFN);
X
X`09d = bp->b_bname;
X`09for (j = 0, k = -1; d`5Bj`5D; j++) `7B
X`09`09if (!isSpace(d`5Bj`5D))
X`09`09`09k = -1;
X`09`09else if (k < 0)
X`09`09`09k = j;
X`09`7D
X`09if (k >= 0)
X`09`09d`5Bk`5D = EOS;
X`7D
X
X#if BEFORE
X/*
X * Copies buffer-name to a null-terminated\2107 (for use in code that
X * cannot conveniently use the name without a null-termination).
X */
Xchar *
XXXX still needed XXX get_bname(BUFFER *bp)
X`7B
X`09static`09char`09bname`5BNBUFN`5D;
X`09if (bp) `7B
X`09    (void)strncpy0(bname, bp->b_\0D07NBUFN);
X`09    bname`5BNBUFN`5D = EOS;
X`09`7D else `7B
X`09    *bname = EOS;
X`09`7D
X`09return bname;
X`7D
X#endif
X
X/*
X * Look for a buffer-name in the \1307list.  This assumes that the argument
X * is null-terminated.  If the length is longer than will fit in a b_bname
X * field, then it is probably a filename.
X */
XBUFFER *
Xfind_b_name(const char *bname)
X`7B
X`09register BUFFER *bp;
X`09BUFFER`09temp;
X
X`09set_bname(`26temp, bname); /* make a canonical buffer-name */
X
X`09for_each_buffer(bp)
X`09`09if (eql_bname(bp, temp.b\1106))
X`09`09`09return bp;
X`09return 0;
X`7D
X
X/*
X * Find a buffer, by name. Return a pointer
X * to the BUFFER structure associated with it.
X * If the buffer is not found, create it. The "bflag" is
X * the settings for the flags in in buffer.
X */
XBUFFER`09*
Xbfind(const char *bname, int bflag)
X`7B
X`09register BUFFER *bp;
X`09register LINEPTR lp;
X`09register BUFFER *lastb = NULL;`09/* buffer to insert after */
X`09register BUFFER *bp2;
X
X`09for_each_buffer(bp) `7B
X`09`09if (eql_bname(bp, bname))
X`09`09`09return (bp);
X`09`09lastb = bp;
X`09`7D
X
X`09/* set everything to 0's unless we want nonzero */
X`09if ((bp = typecalloc(BUFFER)) == NULL) `7B
X`09`09(void)no_memory("BUFFER");
X`09`09return (NULL);
X`09`7D
X
X`09/* set this first, to make it simple to trace */
X`09set_bname(bp, bname);
X
X`09lp = lalloc(0, bp);
X`09if (lp == null_ptr) `7B
X`09`09free((char *) bp);
X`09`09(void)no_memory("BUFFER head");
X`09`09return (NULL);
X`09`7D
X
X`09/* and set up the other buffer fields */
X`09bp->b_values = global_\1208;
X`09bp->b_wtraits.w_vals = global_w_values;
X`09bp->b_active = FALSE;
X`09bp->b_dot.l  = lp;
X`09bp->b_dot.o  = 0;
X`09bp->b_wline  = \0F06dot;
X`09bp->b_line   = \0F06dot;
X#if WINMARK
X`09bp->b_mark = nullmark;
X#endif
X`09bp->b_lastdot = nullmark;
X#if OPT_VIDEO_ATTRS
X#endif
X`09bp->b_flag  = bflag;
X`09bp->b_acount = b_val(bp, VAL_ASAVECNT);
X`09bp->b_fname = NULL;
X`09ch_fname(bp, "");
X#if`09OPT_ENCRYPT
X`09if (!b_is_temporary(bp)
X`09 `26`26 cryptkey != 0 &0226 *\120CEOS) `7B
X`09`09(void)strcpy(bp->b_key, cryptkey);
X`09`09make_local_b_val(bp, MDCRYPT);
X`09`09set_b_val(bp, MDCRYPT, TRUE);
X`09`7D else
X`09`09bp->b_key`5B0`5D = EOS;
X#endif
X`09bp->b_udstks`5B0`5D = \120D1`5D = null_ptr;
X`09bp->b_ulinep = null_ptr;
X`09bp->b_udtail = null_ptr;
X`09bp->b_udlastsep = null_ptr;
X
X`09b_set_counted(bp);`09/* buffer is empty */
X`09set_lforw(lp, lp);
X`09set_lback(lp, lp);
X
X`09/* append at the end */
X`09if (lastb)
X`09`09lastb->b_bufp = bp;
X`09else
X`09`09bheadp = bp;
X`09bp->b_bufp = NULL;
X`09bp->b_created = countBuffers();
X
X`09for_each_buffer(bp2)
X`09`09bp2->b_last_used += 1;
X`09bp->b_last_used = 1;
X
X#if OPT_PERL `7C`7C OPT_TCL
X`09bp->b_api_private = 0;
X#endif
X
X`09return (bp);
X`7D
X
X/*
X * Given a filename, set up a buffer pointer to correspond
X */
XBUFFER *
Xmake_bp (const char *fname, int flags)
X`7B
X`09BUFFER *bp;
X`09char bname`5BNBUFN`5D;
X
X`09makename(bname, fname);
X`09unqname(bname);
X
X`09if ((bp = bfind(bname, flags)) != 0)
X`09`09ch_fname(bp, fname);
X`09return bp;
X`7D
X
X/*
X * This routine blows away all of the text
X * in a buffer. If the\0F07 is marked as changed
X * then we ask if it is ok to blow it away; this is
X * to save the user the grief of losing text. The
X * window chain is nearly always wrong if this gets
X * called; the\0C06r must arrange for the updates
X * that are required. Return TRUE if everything
X * looks good.
X */
Xint
Xbclear(register BUFFER *bp)
X`7B
X`09register LINEPTR lp;
X
X`09if (!b_is_temporary(bp)`09`09/* Not invisible or scratch */
X`09 `26`26  b_is_changed(bp)) `7B`09/* Something \1C07`09*/
X`09`09char ques`5B30+NBUFN`5D;
X`09`09(void)strcat(strcpy(ques,"Discard changes to "), bp->b_bname);
X`09`09if (mlyesno(ques) != TRUE)
X`09`09`09return FALSE;
X`09`7D
X#if OPT_UPBUFF
X`09if (bp->b_rmbuff != 0)
X`09`09(bp->b_rmbuff)(bp);
X#endif
X`09b_clr_changed(bp);`09`09/* Not \1507&0209*/
X
X`09freeundostacks(bp,TRUE);`09/* do this before removing lines */
X`09FreeAndNull(bp->b_nmmarks);     /* free the named marks */
X#if OPT_SELECTIONS
X`09free_attribs(bp);
X#endif
X
X`09while ((lp=lforw(buf_head(bp))) != \120D `7B
X`09`09lremove(bp,lp);
X`09`09lfree(lp,bp);
X`09`7D
X
X`09if (bp->b_ulinep != null_ptr) `7B
X`09`09lfree(bp->b_ulinep, bp);
X`09`09bp->b_ulinep = null_ptr;
X`09`7D
X`09FreeAndNull(bp->b_ltext);
X`09bp->b_ltext_end = NULL;
X
X`09FreeAndNull(bp->b_LINEs);
X`09bp->b_LINEs_end = NULL;
X
X`09bp->b_freeLINEs = NULL;
X
X`09bp->b_dot  = \0D06line;`09/* Fix "."`09`09*/
X#if WINMARK
X`09bp->b_mark = nullmark;`09`09/* Invalidate "mark"`09*/
X#endif
X`09bp->b_lastdot = nullmark;`09/* Invalidate "mark"`09*/
X
X`09b_set_counted(bp);
X`09bp->b_bytecount = 0;
X`09bp->b_linecount = 0;
X
X`09free_local_vals(b_valnames, global_b_values.bv, bp->\110B);
X
X`09return (TRUE);
X`7D
X
X/*
X * Update the counts for the # of bytes and lines, to use in various display
X * commands.
X */
Xint
Xbsizes(BUFFER *bp)
X`7B
X`09register LINE`09*lp;`09`09/* current line */
X`09register B_COUNT numchars = 0;`09/* # of \1306in file */
X`09register L_NUM   numlines = 0;`09/* # of \1306in file */
X
X`09if (b_is_counted(bp))
X`09`09return FALSE;
X
X`09/* count chars and lines */
X`09for_each_line(lp,bp) `7B
X`09`09++numlines;
X`09`09numchars += llength(lp) + 1;
X#if !SMALLER`09/* tradeoff between codesize `26 data */
X`09`09lp->l_number = numlines;
X#endif
X`09`7D
X`09if (!b_val(bp,MDNEWLINE))
X`09`09numchars--;
X
X`09bp->b_bytecount = numchars;
X`09bp->b_linecount = numlines;
X`09b_set_counted(bp);
X`09return TRUE;
X`7D
X
X/*
X * Mark a buffer 'changed'
X */
Xvoid
Xchg_buff(register BUFFER *bp, \1509USHORT flag)
X`7B
X`09register WINDOW *wp;
X
X`09if (bp == bminip)
X`09`09return;
X
X`09b_clr_counted(bp);
X`09b_match_attrs_dirty(bp);
X`09if (bp->b_nwnd != 1)`09`09/* Ensure hard.&0209*/
X`09`09flag `7C= WFHARD;
X`09if (!b_is_changed(bp)) `7B`09/* First \1806, so`09*/
X`09`09flag `7C= WFMODE;&0209/* update mode lines.`09*/
X`09`09b_set_changed(bp);
X`09`7D
X#if`09OPT_UPBUFF
X`09if (update_on_chg(bp))
X`09`09updatelistbuffers();
X#endif
X`09for_each_visible_window(wp)
X`09`09if (wp->w_bufp == bp) `7B
X`09`09`09wp->w_flag `7C= flag;
X#ifdef WMDLINEWRAP
X`09`09`09/* The change may affect the line-height displayed
X`09`09`09 * on the screen.  Assume the worst-case.
X`09`09`09 */
X`09`09`09if ((flag `26 WFEDIT) `26`26 w_val(wp,WMDLINEWRAP))
X`09`09&0209wp->w_flag `7C= WFHARD;
X#endif
X`09`09`7D
X`7D
X
X/*
X * Mark a buffer 'unchanged'
X */
Xvoid
Xunchg_buff(register BUFFER *bp, \1509USHORT flag)
X`7B
X`09register WINDOW *wp;
X
X`09if (b_is_changed(bp)) `7B
X`09`09if (bp->b_nwnd != 1)&0209/* Ensure hard.&0209*/
X`09`09`09flag `7C= WFHARD;
X`09`09flag `7C= WFMODE;&0209`09/* update mode lines.`09*/
X`09`09b_clr_changed(bp);
X`09`09b_clr_counted(bp);
X`09`09b_match_attrs_dirty(bp);
X
X`09`09for_each_visible_window(wp) `7B
X`09`09`09if (wp->w_bufp == bp)
X`09`09&0209wp->w_flag `7C= flag;
X`09`09`7D
X#if`09OPT_UPBUFF
X`09`09if (update_on_chg(bp))
X`09`09`09updatelistbuffers();
X#endif
X`09`7D
X`7D
X
X/* ARGSUSED */
Xint
Xunmark(int f GCC_UNUSED, int n\120B)`09/* \2E06 the current buffers change fla
Vg */
X`7B
X`09unchg_buff(curbp, 0);
X`09return (TRUE);
X`7D
X
X/* write all _changed_ buffers */
X/* if you get the urge to tinker in here, bear in mind that you need
X   to test:  :ww, 1:ww, :wwq\0C06q, all with 1 buffer, both modified and
X   unmodified, with 2 buffers (0, 1, or both \2808), and\2D06errors,
X   like either buffer not writeable.  oh yes -- you also need to turn
X   on "autowrite", and try `5EZ and :!cmd.
X
X   by default, we should have scrolling messages, a pressreturn call, and
X   a screen update.
X
X   any numeric argument will suppress the pressreturn call, and therefore
X   also the scrolling of the messages and screen update.
X
X   if you're leaving (quitting, or suspending to the shell, you want the
X   scrolling messages, but no press-return, and no update.
X
X   if there's a failure, you want a pressreturn, and an update, and you
X   need to return non-TRUE so you won't try to quit.  we also switch to
X   the buffer that failed in\0F06case.
X*/
Xint
Xwriteallchanged(int f, int n)
X`7B
X`09return writeall(f,n,!f,FALSE\0606);
X`7D
X
Xint
Xwriteall(int f, int n\0706promptuser\1706leaving\2406autowriting)
X`7B
X`09register BUFFER *bp;`09/* scanning pointer to buffers */
X`09register BUFFER *oldbp; /* original current buffer */
X`09register int status = TRUE;
X`09int count = 0;
X`09int failure = FALSE;
X`09int dirtymsgline = FALSE;
X
X`09oldbp = curbp;`09`09&0209/* save in case we fail */
X
X`09for_each_buffer(bp) `7B
X`09`09if (autowriting `26`26 !b_val(bp,MDAUTOWRITE))
X`09`09`09continue;
X`09`09if (b_is_changed(bp) `26`26 !b_is_invisible(bp)) `7B
X`09`09`09make_current(bp);
X`09`09`09if (dirtymsgline `26`26 (promptuser `7C`7C leaving)) `7B
X`09`09&0209mlforce("`5Cn");
X`09`09&0209dirtymsgline = FALSE;
X`09`09`09`7D
X`09`09`09status = filesave(f, n);
X`09`09`09dirtymsgline = TRUE;
X`09`09`09failure = (status != TRUE);
X`09`09`09if (failure) `7B
X`09`09&0209mlforce("`5Cn");
X`09`09&0209mlforce("`5BSave of %s failed`5D",bp->b_fname);
X`09`09&0209/* dirtymsgline still TRUE */
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09count++;
X`09`09`7D
X`09`7D
X
X`09/* shortcut out */
X`09if (autowriting `26`26 !failure &0226 !count)
X`09`09return TRUE;
X
X`09/* do we want a press-return message?  */
X`09if (failure `7C`7C ((promptuser `26`26 !leaving) &0226 count)) `7B
X`09`09if (dirtymsgline)
X`09`09`09mlforce("`5Cn");
X`09`09dirtymsgline = FALSE;
X`09`09pressreturn();
X`09`7D
X
X`09/* get our old buffer back */
X`09make_current(oldbp);
X
X`09/* and then switch to the failed buffer */
X`09if (failure `26`26 !insertmode /* can happen from `5EZ and autowrite */ )
X`09`09swbuffer(bp);
X
X`09/* if we asked "press-return", then we certainly need an update */
X`09if (failure `7C`7C ((promptuser `26`26 !leaving) &0226 count)) `7B
X`09`09sgarbf = TRUE;
X`09`09(void)update(TRUE);
X`09`7D else if (dirtymsgline `26`26 (promptuser `7C`7C leaving)) `7B
X`09`09mlforce("`5Cn");
X`09`7D
X
X`09/* final message -- appears on the \1A08line after the update,
X`09  or as the last line before the post-quit prompt */
X`09if (count)
X`09`09mlforce("`5BWrote %d buffer%s`5D", count, PLURAL(count));
X`09else
X`09`09mlforce("`5BNo buffers written`5D");
X
X`09if (dirtymsgline)
X`09`09sgarbf = TRUE;
X
X`09return status;
X`7D
X
X/* For memory-leak testing (only!), releases all buffer storage. */
X#if`09NO_LEAKS
Xvoid`09bp_leaks(void)
X`7B
X`09register BUFFER *bp;
X
X`09if (bminip != 0)
X`09`09FreeBuffer(bminip);
X`09while ((bp = bheadp) != 0) `7B
X`09`09b_clr_changed(bp);`09/* discard any \1C06s */
X`09`09bclear(bheadp);
X`09`09FreeBuffer(bheadp);
X`09`7D
X`7D
X#endif
$ call unpack [.VILE-8_0]BUFFER.C;1 -
 1127234963 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 97 10 152
$!
$ create 'f'
X--------\0808\1008
Xvile bug/enhancement/wish list (mostly wishes ;-)
X--------\0808\1008
X$Header: /usr/build/vile/vile/RCS/buglist,v 1.343 1998/05/30 11:02:51 tom Exp
V $
X--------\0808\1006
X`09(E means enhancement, L,M,H are low, medium, high priority)
X
XE`09add ":n file"
X`09    (:n means go to the next file in a series of files.
X`09    :n file means go to that specific\1F06- one can\1807y a
X`09    +<cmd> before file to indicate the vi command which should be
X`09    executed when entering the command.)
X
XE`09now that paragraphs, sections, and sentences are all selectable
X`09with regexps, they (and the tabstop value) are prime candidates for
X`09moving into a "mode-values" set of \0F06.  A buffer would inherit
X`09either the global normal-mode values, or\220Cc\1D0C.
X
XE`09:k, to set a mark, won't work as ":ka" or ":kb".  Must use ":k a"
X
XE`09patterns as addresses do not work, e.g. ":/str1/,/str2/d".  They're
X`09hard to parse the way things are set up right now.  We could accumulate
X`09the whole commandline, and then parse it, the way real vi does, but we'd
X`09lose the "prompt and display last response" behavior.
X
XE`09should add an option to support file locking, rather than the current
X`09ifdef stuff.  (this is only useful if we match the GNU locking
X`09protocol.) And it's not clear that in an NFS'ed environment that
X`09it's all that easy to get that style of locking right anyway.
X
XE`09the scrsearch functions could become region based -- as in "\3508or
X`09the next occurrence of the region", which would usually be a word.  And
X`09the `5EA/ version could become "a/ (search for the contents of buffer a),
X`09if you know what I mean.
X
XE`09g should become a region command.  Then it could take ranges, as
X`09it should, and could also become an operator command.
X
XE`09collapse command execution code to as few places as possible.
X`09Its currently spread through execute(), operator(),
X`09docmd(), and usekreg().
X
XE`09I haven't even come close to testing vile for
X`09memory-full conditions.  Some malloc() packages give 95%
X`09warnings -- perhaps something like that should be done for
X`09safety.
X
XE`09marks should perhaps be linked onto lines.  this would make a lot
X        of things a lot easier, since a mark would travel with the
X        line, instead of having to be moved when the line is
X        reallocated etc.  the U line could be treated as a special
X        mark.  The "copied" flag needed by undo could be a special
X        sort of mark as well.  Implementation of the "tag stack"
X`09would be aided by this as well.
X
XL`09vile really ought to use unix-crypt if it is available.
X
XE`09can't search for a NUL in a buffer.
X
XE`09":e" and ":e!" should share the same prompt data, which\2908be
X`09editable / history.  They both should default (like vi!) to the
X`09current buffer.
X
XE`09for consistency, 'execute-macro-nn' should be\1D0F nn';
X`09doing this would allow modification to eliminate a fixed number of
X`09macro-buffers.
X
XE`09should ifdef the 'autobuffer' code for users who do not need vi-style
X`09buffering.
X
X--------\0806
X
X    The ed 'transfer' and 'move' commands don't work.
X    (to copy and move text around.  e.g., :'a,'bt$.)
X
X--------\0808\1010
X
XThough I use it, I'm still not quite satisfied with the qident stuff.  It
Xneeds to be more flexible.  That is, I'd like to make it user defined.
XFor example
X`09find-tag $qidentifier
Xshould be expressable as a character class like
X`09find-tag `26anyof "a-zA-Z_0-9:"
Xin a macro.  Or even more generally, as a regular expression:
X`09find-tag `26scan "`5Ba-zA-Z_`5D\09080-9:`5D`5C`5C*"
XA leading `5E would root the search a\0E06current cursor position.
XAbsence of a leading `5E would start at the current cursor position but would
V
Xscan ahead until it found a match.  That way I can redefine `5E`5D to pick
Xup the next word even if the cursor is before the start o\2206word (thus
Xbetter mimicking vi's behavior).
X
X`5B This can almost be done with the $match variable, e.g.
X`097 store-macro
X`09`09search-forward "`5Ba-zA-Z_`5D\09080-9:`5D*"
X`09`09find-tag $match
X`09`7Eendm
X
X`09bind-key execute-macro-7 `5EA-g
X - pgf `5D
X--------\0808\1010\2020\4006
XAlso, I encountered the following problem: I am editing foo.tex and
Xcall latex using `5EX!\0F06foo.tex. There is an error, so\3407waits for
Xinput -> vile sits waiting and nothing helps. I think this should
Xbe interruptable. I will agree with you that the `5EX! command was not
Xintended for this, but still...
X
XBut ok, the real problem is that after I kill latex and
Xvile comes back to life I can no longer filter parts of text using
X!fmt. The text just gets deleted.
X
X--------\0808\1010\2020\4006
X
XI just grabbed a copy of xvi.  I noted some interesting tidbits while
Xreading the "differences between vi and xvi" document.  Some of these would
Xbe nice in vile.
X
X
X     As well as the normal named (conjugate) buffers, and the  default
X     one  named @, several extra buffers\1F07:, /, ?  and ! contain
X     the last command lines entered for each of the \2608types.  So
X     for  instance,  @: will re-execute the last colon command, or you
X     can insert it into your buffer, edit it and  then re-execute  it
X     (e.g. with dd@@).
X
X
X     +    In insert and replace modes, `5EA has the same meaning  as  `5E@
X          in  vi,  except  that it works at any time, not just for the
X          first character.  Also, typing `5EBx, where x is the name of a
X          conjugate  buffer,  inserts the contents of that\2607 into
X          the input stream at that point.  The buffer named  <  always
X          contains the last thing inserted, so that `5EB< i\2806same as
X          `5EA.
X
X
X--------\0808\1008
XI wish `5EX-!  could execute shell commands async'ly, i.e.  I should not have
V
Xto wait/do nothing while waiting for the ouput of compiling.  I should be
Xable to edit stuff in other buffers or even `5EX-`5EX\2D0Arc codes
Xwhile compilation is still going on.
X
X------------
Xsimilar to above -- sub-commands run from `5EX-! or ":`5Berw`5D !cmd" should b
Ve
X"interactive" to the extent that user's input should be sent t\2F06cmd
Xat least on a line-by-line basis (i.e. we can't send raw keystrokes -- we
Xhave to do canonical processing.  of course, we should really use pty's, and
Xreconnect input and capture output.)  some commands like latex prompt for
Xmore input when partway done.
X
X========(VMS-VILE)\1208\1A08\1010\201D
XUnfinished items on vax/vms (dickey@clark.net):
X
X`09+ if the current directory has changed, offer to restore it on exit.
X`09  (Note that if the _device_ portion has changed, the original
X`09  directory should be restored anyway!).
X
X`09+ add key bindings and other support to make the vt100 keypad work for
X`09  me (e.g., like EDT).
X
X`09+ see if I can decode ".dia" files, if so connect it to finderr.c
X
X`09+ catch exception/signals, and restore terminal settings.
X
X`09+ make write-pipes work (actually, flesh out to use 'npopen' coding
X`09  scheme, like the MSDOS stuff).
X
X`09+ I had a case in which I wanted to read the contents of one file into
X`09  another; they had the same buffer name; the target\1808got the
X`09  filename for the source, e.g.,
X
X`09  `09:e `5B`5Dfoo`09`09- read and determined version # ok
X`09`09:r `5B-.temp`5Dfoo&0209- current filename reset to\290C
X--------\0808\1010\201C
X
X
Xit would be nice if vile \1606fold text...
X
X`09This feature appeared in uEmacs version 3.10.23 and you can
Xuse archie/x\0806 to file fue.tar.Z (fue - folding-micro-emacs).
X
X`5B someone said they were going to fold this in, so to speak.  i'm not
Xreal comfortable with the idea, since the uemacs code causes the LINE
Xstruct to grow _enormously_ `5D
X
X
X-----------
X
X`09When I execute a keyboard macro using `5EX-`26 I cannot repeat this
X`09using the dot command. Instead, the last\1B08 in the macro
X`09is repeated.
X    `5B this is because '.' doesn't do @ macros either...`5D
X
X--------\0808\100E
X
X
XCan you add the '>' character to the list of comment chars for paragraph
Xreformatting?  I would live to be able to \2A08 mail quotes (like shown
Xabove).
X
X`5B pgf notes: I did this, as chris suggested, but formatregion should use
X  the comments regexp to match a\1B08 delimiter at the beginning of
X  line, and should insert the comment delimiter of the _second_ line (so
X  that boxed C comments work right)in subsequent reformatted lines,
X  including leading but not trailing whitespace.  indentlen should be
X  counted _after_ the width of such a comment delimiter.  this would make
X  paragraphs that are indented way after the delimiter keep their \2C06.
X  commented paragraphs should end when exp->mlen for the\3708 regexp is
X  equal to llength(DOT), i.e.  it's the whole line.  (we'll need to take
X  the $ off the end of the comment regexp).  `5D
X
X--------\0808\100E
XAnother enhancement.
XHow about a history file.  say I have been using vile and
Xquit and come back in later I can use the history file.
X
X--------\0808\100A
X
XIn a xterm window the down arrow (which sends ESC-O-B) works for individual
Xpresses.  If you hold down the key then letter Bs get peppered through out
Xthe file.  It appears that the ESC is occasionally being missed so\2D09
Xfollowing OB puts a B in the file.
X
XIn my case I'm on a workstation running 4.1.3 and xterm using rlogin to
Xconnect to a 690 server (lightly loaded) running 4.1.3 and\1209vile
Xon the 690.
X
XI just ran vile locally and didn't see the problem.
X--------\0808\100F
X
X
XI found a bug (new with 3.59) on our Pyramid SVR4 (but not \160B3,
XSunOS 4.1.1, AIX 3.2) where
X`09xvile tmp `26
Xpops up the xvile window briefly, the \1407dies\1106xterm I started
Xxvile from says
X`09`5B1`5D  + suspended (tty input)  xvile3.59 tmp
Xand then after a couple seconds the xterm itself vanishes!  However,
X`09xvile tmp
Xworks fine, except that the process is in the foreground.
X > The bug on the Pyramid SVR4 machine with xvile `26 suspending itself,
X > committing suicide, and then blowing away the xterm still exists.
X > For the time being I just remember to run xvile on a different
X > machine.
X
X--------\0808\100D
Xapply Alistair's min/max regexp patch
X
X--------\0808\1010\2020\4009
X
XWith vim 1.27 you can configure its behaviour regarding backspace using
Xthe 'backspace' variable. From the help file:
X
Xbackspace (bs)`09    number    0     0 standard Vi, 1 delete NL, 2\0D08all
Xi.e. if bs is non-zero, you can backup to the previous line, and if it's
Xa 2, you can backup past the insertion point.
X
Xi don't think this is optimal -- i\1B07you should be able to choose
Xindependently whether you backup past the newline or \1409insertion point.
X
Xin any case, vile won't let you back up past the newline during an insert.
Xwhen _not_ in insert, you can rebind `5EH to backward-character.
X
X--------\0808\100B
X
XWhen you do a :b you should have line completion for the name.
X
X--------\0808\100B
X
XHow can I read the status of a shell command when I execute a
Xshell-command? Although the shell \1C07 has a $STATUS=1 the
Xstatus of the \0E07variable is TRUE.
X
X--------\0808\100B
X
Xyou can't use ! as a regular expression delimiter, as in:
X`09:s!pat!replace!g
Xbecause the parser treats ":s!" as if it's ":q!" or ":w!".
X
X--------\0808\1009
X
Xwidth of a region is kept in units of offset, not of columns.
Xi think this will break rectangular inserts of non-\1B0Cregions,
Xwhere the longest line may not extend to the furthest column, due to
Xtabs in other lines.
X
X
X--------\0808\1009
X
XI'm using the DOS version and I prefer to use 80x28 or even higher res like
X80x50 by setting set sres=\1A06in vile.rc.  The problem is that when a
Xcommand is executed with :!<shell-\2207> the mode switches back to 80x25.
XIt switches back to 80x25 permanently. I think it's acceptable that it
Xswitches to 80x25 when it's in shell command execution.  However, technically
V
Xit should switch back to the preferred mode when it's done.
X
X`5B can anyone confirm or deny this is still true? `5D
X`5B I don't see it happening with ibmpc.c - dickey `5D
X
X--------\0808\100B
X
Xthe borland console driver won't display the cursor on blank lines until
Xafter you've refreshed the screen at least once, e.g. with `5EL.  must
Xbe something to do with color initialization, or \2E0Alike that...
X
X--------\0808\100B
X
Xrunning a SunOS4.1.3 binary of vile on Solaris2.3 causes the "interrupted
Xsystem call" problem, no doubt due to the differing BSD/SysV signal()
Xsemantics.  `5B probable workaround:  ":set noworking" `5D
X
X--------\0808\1006
X
XAnother thing that would be really helpful\180Aa description of the
X$debug variable, and what it does, how it works.
X
X--------\0808\100F
X
Xthere should be better support in vile for reading bits of shell output
Xinto a buffer -- ":r !foo" is a little primitive when trying to insert a
Xsingle word into a line.
X
X--------\0808\1010-
X
Xautoindent skips blank lines when looking for the
Xindent value.  apparently real vi doesn't?
X
X--------\0808\1006
X
Xcurrently can't pop/untag from within macro
X`5Breally?  why is this?`5D
X
X--------\0808--
X
Xare there still reentrancy problems in xvile when mousing around during
Xlong-running operations.
X
X--------\0808\1006
X
Xcould the attribute selection logic be used to emulate vi's behavior
Xof replacing the last char of a change operation to '$'?  (but only for
Xtext which does not span a line)
X
X--------\0808\1009
X
Xthere should be a way to reference buffer attributes of the currently-
Xexecuting macro (or stack of\1306s).
X
X--------\0808\1009
X
X`5B how do i test this? `5D
XIn xvile, when the load is high and the machine stalls for a while
Xand I key in several keystrokes ahead, it takes the first of those\2E0B
Xand replaces the later keys by it i.e. when several events simultaneously
Xarrive, it doesn't do the right thing (process them in order).
X
X--------\0808-
X
Xwhen motion keys or pasting is used during an insertion, we should
Xbreak the insertion into multiple undoable chunks.
X--------\0808-
X
Xpasting to a view-only buffer does not generate an error message.
X--------\0808\100C
X
X   XVILE BUG:
X
X      - If I click on the "maximize" gadget, it gets _really_ big.
X        Like, many times bigger than the screen big; I suspect that
X        it is maximizing to a number of *characters* equal to the\2407
X        of *pixels* available or something.  If I click on the same
X        gadget (after dragging that part of the window onto the screen),
X        which does a normalize, it crashes.
X`09I am use vile 4.5 and xvile on HP/UX 9.01.
X`09I use vuewm as my window manager (a motif variant).
X
X      `5BI would guess that the suspicion of the person reporting the bug
X       is correct concerning the behavior of the window manager during
X       maximization.  I don't have this problem with fvwm. pgf's changes
X       to eliminate the hardcoded maximum width and height will probably
X       fix the core dumps.  I'll look into seeing if there is some protocol
X       which we're not observing with regard to maximization.  -kev`5D
X
X--------\0808--
X      - I would like an option whereby if I have more than one file on
X        the command line, the display opens with one window per buffer,
X        so I can visibly see all the files available.
X--------\0808\1006
X
X
Xif you have lines like
X`09123
X`091234
X`0912
Xit's impossible to select them as a rectangle, since the middle line is
+-+-+-+-+-+-+-+-  END  OF PART 10 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 11 -+-+-+-+-+-+-+-+
Xlongest.
X
X
X--------\0808
X
X
XIt would be useful to have a search that is constrained to a certain
Xmovment.  For example, I might want to look for the string "foo" over the
Xnext paragraph, not the whole document.  This would really be useful to
Xprogrammers who want to look for the instance of a variable or a function
Xcall only within the current scope (or #if).
X
X--------\0808
Xxvile:
X Is it possible to have an optional horizontal scrollbars ?
X   (just for maniac users)
X
X--------\0808\100C
X
Xunder DOS, `5EP character turns on the printer.   argh.
Xactually, this only happens if compiled with borland.  it uses getch()
Xinstead of intdos() to get the char.  (see ttgetc())  that's probably
Xat least part of the answer.
X`5BI also see this with djgpp, which uses borland.c - tom`5D
X
X--------\0807
Xhow about a mode that supports autosaving to the backup-file,
Xinstead of to the original file -- useful for system crashes.
X
X--------\0808-
X
Xrectangular operations don't work right if there are control characters
Xto the left of the rectangle.  (physically they work, but the visual
Xeffect is wrong.  i'm not sure what the right thing to do is.)
X
X--------\0808\1009
Xdouble quote characters (and probably other special chars) are interpreted
Xincorrectly on the lhs of a map command.  for instance:
X`09map `5EK" WBi"`5E`5BEa"`5E`5B
Xwill result in
X`09`5EK WBi
Xas the lhs, leaving
X`09`5E`5BEa"`5E`5B
Xas the rhs.  the workaround is to escape the " in the lhs:
X`09map `5EK`5C" WBi"`5E`5BEa"`5E`5B
X
X(this map surrounds the current word in double quotes)
X
X--------\0808\100D
X
XWould you please add another hook: modify-hook.  I thought this is useful,
Xfor example, if I attempt to insert, delete (in general, modify) text
Xin a read-only file, I like it to prompt if the user wants to PVCS-lock it.
XA message would look something like this:
X`09File is read-only, check out?
X
X--------\0808\100D
X
Xcontrary to the vile.hlp text, binding\1E08interrupt`7B`7D terminal
Xcharacter does not fully change intrc and the user's interrupt \3F09.
X
X--------\0808\1010\2020-
XVMS6.0 on VAXstation 4000/90.  DEC C for OpenVMS VAX compiler
Xversion V4.0-000.  Shared library (specified in VMSSHARE.OPT)
Xis DECC$SHR.EXE instead of the default VAXCRTL.EXE.
X
Xsymptoms:
X`09vile can't read vile.rc, or\0C06hlp.
X
Xreason:
X`09on this setup, the access() library routine seems broken.
X`09my test program showed that it returned -1 for existant
X`09and non-existant files.
X
Xsolution:
X`09I had to add a
X#define HAVE_ACCESS 0
X`09in estruct.h (actually, I just put it in fileio.c).
X`5B there's a fix in estruct.h, but untested `5D
X
X--------\0808\1010\2020-
X
XDOS:  wildcarding in the top directory:
X   c:
X   cd `5C
X   vile a*.bat      \0606 (will not open autoexec.bat)
Xdoes not work, because Watcom's opendir() routine only succeeds on the root
Xdirectory if it is specified as '`5C'.  no other name for it seems to work.
Xstat won't work on it either.  (we try to open it as ".", not an unreasonable
V
Xthing to do.)
X
Xsigh.  i hate DOS.
X
X--------\0808\1010\2020-
X
X Mips RISCos5.0 machines:
X    Error: random.c, line 625: 'SIG_BLOCK' undefined, ...
X    Error: random.c, line 637: 'SIG_SETMASK' undefined, ...
X `5B i thought i could provide fallback definitions of those, but
X   the values are different on sunos and linux, and are probably
X   different again on Mips RISCos5.0, bless it's broken little heart. `5D
X
X--------\0808\1010\2020-
Xwe should consider adding user-customizable menu or button support to
Xxvile:
X    "Right now, you have most of the major functions as strings that can be
X    called from the macro language.  Suppose you made icons or something
X    for those strings, and then let the user \1F06 the icons (or maybe
X    have icons trigger macros and\1E06a set of\1908for most of the
X    basic stuff as a default package) together to form new icons they could
X    put in some sort of icon bar.  The windows (boo!  Hiss!) users would go
X    nuts!  Also, put some of this into the pull down menus, and people
X    would stand to cheer and applaud. "
X--------\0808\1010\2020-
X
XI think I found a couple of very minor bugs in vile.
X
XPossible bug #1)
XI'm using xvile right now because `5ES doesn't seem to work correctly in
Xregular vile yet (must be an HP 9.05 thing, I'm not sure yet).  I had
Xthought you turned flow control off in vile, but I want to do more testing
Xbefore I call this a bug.
X
XAnyway, do this:
X
XOn a page with several lines of text, do this operation on the first one:
X
X:s/`5E/> /
X
XNow, using the mouse (or 'q'), sweep the next couple of lines.  To make
Xthings interesting, sweep to the end of the second to last line, but
Xnot the last line itself, so the highlighted text looks like this:
X
Xxxxxxxxx
Xxxxxxxxx
Xxxxxxxxx
X
Xinstead of
X
Xxxxxxxxx
Xxxxxxxxx
Xxxxxxxxx
Xx
X
XNow, do a
X
X`5EA-`26-`5ES
X
XOn my machine, the last line of the highlighted text isn't touched.  I'm
Xthinking it should be...
X
X--------\0808\1010\2020-
X
Xthe command ":r !ls" should not require the space.
X
X--------\0808\1010\201B
X
Xwhen using wrapmargin, it is impossible to break
Xup long lines consisting of a single word.
X
X`5Bvi doesn't do this`5D
X
X--------\0808\1010\201B
X`09- the layering of the map code with respect to the record/replay
X`09  code that implements '.', the keyboard macros, and the '@'
X`09  command execution is severely broken.  if you have a :map
X`09  that executes a '@a' command in the middle, the contents
X`09  of register a are readied for replay, but input continues
X`09  to come from the :map string until it is ended, and only then
X`09  so we dip down to the lower level and start getting the result
X`09  of '@a'.  a similar thing happens with '.' used in a :map, only
X`09  it seems even worse, since recording isn't started/stopped
X`09  correctly.
X`09`5Bthis has been fixed for the @a case, but in a sloppy fashion.
X`09  it should be cleaned up.  -pgf  `5D
X
X--------\0808\100D
X
XUsing xvile, if I `5BoO`5Dpen a
Xnew line or do insert at the beginning of a line, and then paste in
Xsome text using the mouse, xvile inserts an extra blank line. that is,
Xif I have
X
Xfoo
Xbar
X
Xand I try to paste in 'hi' under the foo, I get
X
Xfoo
X
Xhi
Xbar
X
Xthis only seems to happen in autoindent mode at the very beginning of
Xthe line. it does *not* happen if the preceeding line is indented, or
Xif I type a space before pasting.
X--------\0808
X
Xonly "reverse" works as a visual-match hilite under DOS.
X
X--------\0807
X
Xa newly entered search string (even an identical one) should turn highlighting
V
Xback on
X
X--------\0807
X
XIt would be nice to make the cursor invisible while doing highlighted selectio
Vn,
Xsince xterm cannot blink the cursor, and the selection has an apparent hole.
Xvisual-match highlighting back on.  this is surprisingly hard, due to the
Xlayering of readpattern() and kbd_reply.
X
X--------\0807
X
XWhile we're on the subject of bugs, let me tell you about another one that
XI've long noticed when I try to insert such text.  I would like to do
X:unsetl ai before pasting in the text (since I normally have auotindent
Xon).  But that has no effect.  Even :setall shows that autoindent is still
Xon.  Instead I have to do :setl noai.  Annoying.
X
X`5B i agree -- shouldn't "setl nonumber" and "un\1606\1407be synonymous? -pgf
V`5D
X`5B I've gotten used to it as a quirk: "unsetl" deletes a flag that shadows th
Ve
X  global setting.  I wish (however) that there were a nice way to highlight th
Ve
X  flags that are shadowed -dickey`5D
X
X--------\0807
X
Xrunning a shell command from xvile should arguably spawn a new xterm.  it
Xshould certainly do it in a new window.
X
X--------\0807
X
Xvile trims all trailing whitespace when user inserts a \1A06that triggers
Xwrapmargin, vi trims only the whitespace inserted during the current command.
V
X`5B i'm not sure i consider this a bug.  vile plays loose with whitespace
Xin many such situations.  if you're using wrapmargin,\1908probably
Xnot worried about trailing whitespace anyway.  -- pgf `5D
X
X--------\0808\100A
X
XThis is a report against vile v5.4 built using djgpp.  Vile is running
Xin raw DOS (not in a Windows DOS box).
X
XThis command:
X    vile -4
Xgives me 50 lines (not 43).  The only two screen resolutions that seem
Xto work are vile -2 and\0C075 .
X
X`5B This is a result of the borland screen library.  43 lines are available
Xunder OS/2... `5D
X
X--------\0808\1010-
X.. you can't use the mouse to select text from the command input line, I often
V
Xuse this after Ctrl+G to get the filename for a UNIX command elsewhere.
X
X--------\0808\1010-
X.. button 1 selection doesn't work it quite the same way as other apps. e.g.
Xin xterm, double click on a word (don't release button after second click)
Xand drag along a sentence - first word is selected and so are subsequent
Xwords in the sentence as you drag.  Just the first word is selected in xvile.
V
X
X--------\0808\1010-
X
Xlink problems:  vile or xvile has \220D on:
X`09- Openlook on sunos4.1.3
X `09- SCO OpenServer 5.0 (needed -lsocket, and \1507different
X`09`09lib ordering for -lXt and -lXm for the motif version.
X`09- BSD/OS 2.0.1 (X11R6) -- needed this order: -lXt -lXM -lICE -lX11
X`09- IRIX 5.2 -- drop the '-lnsl' library
X
X--------\0808\1010-
X
Xvile 5.5 almost passed my macro test with only small cosmetic problem:
X
X;    !@  --mapto-->  replace "Unixcommand!@" with\150D" output
Xmap! !@ `5EV`5EM`5E`5Bbi:r !`5E`5BF:"adt@mm@ais`5E`5B"bd$dd`60m@b
X;    #@  --mapto-->  replace "@Unixcommand args#@" with "\1A0B" output
Xmap! #@ `5EV`5EM`5E`5BF@s:r !`5E`5BF:"adt@mm@ais`5E`5B"bd$dd`60m@b
X
XBoth now produce correct results.  But the final status message doesn't
Xmake sense:  Delete operation pending...  when it actually in insert
Xmode.  Fortunately, there is a workaround, set terse.  it would be nice
Xif vile can temporary set terse before executing macros and reset back
Xto original mode afterwards. Sounds easy?
X
X--------\0808\1008
X
Xthere are two conflicting wordwrap mechanisms in vile --
X`09- the historical wrapwords setting, inherited from
X`09  microemacs, will wrap words in input mode when you type a
X`09  space character after you've passed the "fillcol" column.
X`09- the vi-like "wrapmargin" setting sets the column past which
X`09  entering more input will cause a line break.
X
Xi think we should eliminate the historical mechanism in favor of the vi-ish
Xone, and i've marked it `5Bdeprecated`5D in vile.hlp.  (as of version 5.6)
Xvim has a "textwidth" mode, which functions exactly like wrapmargin, except
Xthat it is measured from the left.  this prevents line length\2A06changing
Xwhen the screen is resized, a drawback of wrapmargin.  i propose eliminating
Xfillcol, and introducing textwidth.
X
X--------\0808\1010\2006
X
XIt would be nice to have a 'smart' shiftwidth, tha\3108jump back
Xto the indent level of the first previous line with a different
Xindent level. What I mean is:
X
Xaaa aa aa aaa aaa a
X    - bb bbb bb\0A06 b
X      ccc cc cc cc c
X      <control-d>
X
Xwhere <control-d> would jump back to the indent level of the minus sign.
XI encountered this behaviour with the 'EDIT' program on MS-DOS with
Xthe backspace key. It's really quite convenient, although I am not so
Xsure it is smart to put both the 'shift-back' and 'backspace' behaviour
Xunder the same key.
X
X--------\0808\1008
X
XThe 'qsort' function in Watcom 10.0a for MS-DOS is broken (file-completion
Xhangs, probably due to stack overflow).
X
XOS/2 version built with Watcom 10.0a does not open pipes successfully.  Also i
Vt
Xdoes not do function keys.
X
X--------\0808\1008
X
Xwhen a buffer is out of date wrt its file (i.e. you have been warned but
Xyou answered 'n') it should say something like `5Bout-of-date`5D on the modeli
Vne.
Xthis should be true whether or not "check-modtimes" is on.  in fact, in
Xretrospect, "check-modtimes" should really be "warn-out-of-date", or
Xsomething like that, and we should _always_ check modification times.
X
X--------\0808-----
X
XNot sure if this will be generally useful, but I changed the tags.c
Xmodule to use "_qident" instead of "_\1409 the gototag() function.
XThis allows a user to goto C++ functions when the tag is a C++
Xclass::function reference.
X
X------------"
X    How about changing makefile.djg, adding a line like
X      strip vile
X    just before the call to coff2exe.  This will reduce the
X    size of the djgpp executable from 1,328,037 bytes (with
X    djgpp 1.12 patch 4) to 259,072 bytes.  Just a little idea.
X`5Bi'll add a different target instead...`5D
X
X
X--------\0808\100D
X
Xadd a copyright to the binary
X
X--------\0808--
XThe configure script returns the wrong value for HAVE_SYS_FILIO_H on
XOSF/1-Alpha; termio.c doesn't compile with that problem.
X
Xalso, the configure script returns the wrong value for GETPGRP_HAS_ARG on the
V
XOSF/1-Alpha.
X
XThe test in configure compiles ok with "cc" but not with gcc.
Xac_compile in configure uses cc as a default. This may be able
Xto be worked around by setting $CC to gcc before running
Xconfigure.
X
X
XThe install program is also much touchier about argument order; the
Xdirectory must follow -c argument.
X
XHere's a partial diff which I think shows part of what must be done:
X
X*** makefile.orig       Thu Feb 15 11:56:40 1996
X--- makefile    Thu Feb 15 11:56:41 1996
X********\0807
X*** 404,410 ****
X
X  # dependency-rules for install/\0807dirs
X  $(bindir)/$(TARGET):       \1109
X!       $(INSTALL_PROGRAM) $(TARGET) $@
X  $(bindir)/vile-manfilt:    \110C
X        $(INSTALL_PROGRAM) vile-manfilt $@
X  $(bindir)/vile-c-filt:     \110B
X--- 404,410 ----
X
X  # dependency-rules for install/\0807dirs
X  $(bindir)/$(TARGET):       \1109
X!       $(INSTALL_PROGRAM) $@ $(TARGET)
X  $(bindir)/vile-manfilt:    \110C
X        $(INSTALL_PROGRAM) vile-manfilt $@
X  $(bindir)/vile-c-filt:     \110B
X
X
XBut on the other hand, it also doesn't want the final name of the
Xbinary in the path mentioned (bad: /usr/local/bin/vile; goo\1B12);
XI don't know enough make magic to get the basename stripped off. Perhaps
Xthe "$@" should just be $(bindir).
X
X
X------------"
XAnother point of irritation is the autoindent behaviour when inserting
Xblank lines; where vi will continue with a reduced indent after typing a
XCTRL-D, vile insists on keeping the indent on par with the last non-empty
Xline.  (`5E`5ED is inteneded to be temporary, 0`5ED should be permanent, even
V if
Xwhat you've entered is a blank line.  don't know about simple `5ED.)
X
X--------\0808\1006
X
Xfile completion doesn't work in the presence of directories which match
Xa substring of other files or directories.  that is:
X`09:!mkdir foo
X`09:!mkdir food
X`09:!mkdir fool
X`09:e foo<TAB>
Xyields:
X`09:e foo/
Xinstead of also providing "food" and "fool" as choices.  with the same
Xsetup, the following:
X`09:e food<TAB>
Xyields:
X`09:e food/
Xinstead of also providing "fool".
X
X--------\0808\1008
X
XWhen the various DOS/Windoze) .zip files are created, it would be nice if
Xthey included a formatted version of the man page ('cuz DOS/Windoze doesn't
Xhave nroff :-) ).
X-----------
X
X`09I'm using vile 5.6 on Unix and I'm wondering if you could add to
Xthe next release of vile a method of bringing up a permanent list of
Xbuffers automatically on startup i.e.  execute the show-\3808command on
Xstartup.  `5BI realise that you haven't fully implemented the + command line
Xoption in vile `5D
X
X------------
Xusing '`26' in pc-vile as the word-expansion replacement for ':' in regular
Xvile may someday conflict if we want to spawn stuff in the background
Xin VMS or win32 vile.  clearly the expansion chars should be made
Xselectable.  not a big deal yet....
X
X--------\0808--
X
X"visual-matches" mode should be conditional on file size, or perhaps
Xon time taken to do the search...
X
X--------\0808-
X > It seems that some files were in the zipfile vil60dos.zip with the read
X > only paramater set.  I unzipped them with infozip's\1D08r instead
X > of pkunzip, and this became a read-only attribute on the vile.hlp
X > file.  If this is set, vile.exe can't find it.
X
X--------\0808- (tom)
X
XThese are old wishes/bugs:
X
X`09set-dos, write file, doesn't reflect (in chars-written message) the
X`09added `5EM's on each line.
X
X`09not every system declares the struct-type for utime/utimes.
X
X`09make partial-completion in `5BHistory`5D set DOT to the current line
X`09we're matching from, if `5BHistory`5D is visible.
X
X`09make vile know about different types of tags-files (ctags -s, etags),
X
X`09on VMS, elvis writes files with stmlf-cr format.  vile\290D
X`09with var-cr format.  the former is a little smaller.  vile ought to
X`09remember the input file's format to use in writing new files (if
X`09possible).
X
XThese date back to 5.4:
X
X`09+ should next_column() use HIGHBIT test?
X
X`09+ ':' expansion doesn't work with ":write-file" because DOT is
X`09  commandeered for use in a region.
X
X`09+ should allow '$' in identifiers (or make it an option), and modify
X`09  'tags' to correspond
X
XThese are pre-6.0 (undated)
X
X`09use CSet C/C++ to flush out unsigned stuff, especially flags that
X`09ought to be.
X
X`09add configure-test for 'ospeed'
X
X`09implement gpm
X
X`09vi sets '#' on attempted write; vile doesn't
X
X--------\0808\1010\2020\4010
X
X-- 96-09-27 (Lance Heller <lance.heller@wcom.com>)
X
X`09If I start an aixterm:
X`09`09aixterm -bd Wheat -fg\0A08bg MidnightBlue -ms grey90
X`09the problem does NOT occur.
X
X`09However, if I start it as:
X`09`09aixterm -geometry 90x70+110+1
X`09it does.
X
X`09The appropriate section from my .Xdefaults is:
X`09`09aixterm*background:     lightsalmon
X`09`09aixterm*foreground:     black
X`09`09aixterm*saveLines:      1024
X`09`09aixterm*scrollPosition: left
X`09`09aixterm*pointerColor:   black
X`09`09aixterm*fullCursor:     true
X`09`09!aixterm.geometry:      90x73+448+0
X`09`09aixterm*jumpScroll:     true
X`09`09aixterm*font:   -ibm-serf-medium-r-normal-iso9241-10-100-75-75-*-*:
X`09`09aixterm*scrollBar:      true
X`09`09aixterm*multiScroll:    false
X`09`09aixterm*iconName:       \1807
X`09`09aixterm*pointerShape:   pirate
X
X-- 96-10-02 (tom)
X
Xadd state (variables) to allow a macro to pick up the beginning/ending of a
Xselected area.
X
X-- 96-10-14 (tom)
X
Xadd 'mouse-hook' command (maybe generalize with "on"\2408)
X
X-- 96-10-16 (tom)
X
Ximplement $title for tcap.c
X
X-- 96-10-19 (tom)
X
Xgetting an error in $buffer-hook can blow away the buffer that's being hooked
V
X(e.g., if it's a temporary file).
X
X-- 96-10-19 (tom)
X
Ximplement `5BMac-style`5D, like `5BDos\1207.
X
X-- 96-10-21 (tom)
X
Ximplement gtlbl()
X
X-- 96-10-25 (Anand Mandapati <anand@ibmoto.com>)
X
X`09The behavior of 'yq' doesn't seem to match t\2B0Fother quoted
X`09motion operations.  Here are some sample scenarios:
X
X`09    I) Yank a single line NOT including the eol, ie, like 'y$'
X`09       1. I type 'yq$q' to yank the line all the way to the eol but
X`09`09  don't want to include the eol.
X`09       2. I then do a 'P' to put this yanked text before the cursor.
X`09       3. It behaves as 'y$P' would.
X
X`09    II) Yank a single line including the eol, ie, like 'yy'
X`09       1. I type 'yqjq' to yank the line all the way to the eol and
X`09`09  want to include the eol in the selection.
X`09       2. I then do a 'P' to put this yanked text before the cursor.
X`09       3. It behaves as 'y$P' would, not as 'yyp\1407.
X
X`09At first I thought maybe this is the expected behavior, but if I use
X`09'c' to change the same selections instead of yank, the behavior seems
X`09different.  Let me clarify:
X
X`09    I) Change a single line NOT including the eol, ie, like 'c$'
X`09       1. I type 'cq$q' to change the line all the way to the eol but
X`09`09  don't want to include the eol.
X`09       2. This deletes all the way to the end of the line and I can
X`09`09  now type like normal.
X
X`09    II) Change a single line including the eol (no equiv. in vi?)
X`09       1. I type 'cqjq' to change the line all the way to the eol and
X`09`09  want to include the eol in the deletion.
X`09       2. This deletes the entire line including\1A06ol, shifts the
X`09`09  next line up to the cursor and I can now type the replacement
X`09`09  text.
X
X`09The behavior for 'd' and other quoted-motion operations is similar.
X`09The 'yq' behavior doesn't seem logical.  Do I just not understand it
X`09correctly?
X
X`5BI've seen a case of off-by-one on end of selections, possibly related - tom
V`5D
X
X-- 96-11-09 (tom)
X
Xmodify xvile blink_interval to use 2/3 duty-cycle
X
X-- 96-11-21 (Philippe Le Foll <phillf@fridu.com>)
X
X`09Would you know why 'vile' break GNU bash on NT.
X
X`09Vile Readme tell than vile give back the tty in state in find it it
X`09look not being true under NT.  And if you start vile from bash when
X`09comming back you loose the echo on command line.
X
X-- 96-11-22 (tom)
X
Xit should be possible to recode the tcap.c mouse-motion to use 'select()' to
Xcheck for the user holding down the mouse button, and use _that_ to control a
V
Xfake scrolling in the general direction of the mouse.
X
X-- 96-12-04 (Hans J. Greub" <hgreub@teleport.com>)
X
X`09I am trying to get vile on nt or x\0F08an rs6000 workstation to
X`09colorize perl syntax.  I use the color_readhook macro and the perl
X`09filter.  Now both on the PC and xvile I can get vile to use italics,
X`09but I can not get it to use color just bold face.  For xvile I defined
X`09in the .Xdefaults and .Xresources file the following:
X
X`09`09XVile.color.fcolor1: red
X`09`09XVile.color.fcolor2: green
X`09`09etc
X
X`09and then used xrdb to read in the new .Xdefaults or .Xresources file
X`09but no luck.  Xvile compiler just like a charm.  Do I have to
X`09(re)compile xvile with different switches?
X
X`09On nt I can set the forground and back\0F07color with the set
X`09commands.  In xvile I can control the fore/background cursor etc colors
X`09through the .Xdefaults or the command line switches.  So on both
X`09systems I am able to get fore/background color, but I cann't get the
X`09color attributes to work.  Only the boldface and italics \330A
X`09work.  Do the color attributes only work with certain fonts or are the
X`09default color attributes mapped to bold face?  If this is the case how
X`09can I override the the default color attributes?
X
X-- 97-01-10 (tom)
X
Xshould cut-down the special-case for VMS $PATH, possibly merging with
X$search-path.
X
X-- 97-01-15 (tom)
X
Xallow modelines to be colored (i.e., separately from the window contents)
X
X-- 97-01-17 (tom)
X
Xadd show-marks command, make it per-window dynamic.
X
X-- 97-01-17 (tom)
X
Xprobably should use WINMARK logic, but it's too late (pre-7.0) to do this now.
V
X
X-- 97-01-17 (tom)
X
Xmouse-clicking should set the position so I can use `60 or ' to jump back.
X
X-- 97-01-18 (Paul Fox <pgf@foxharp.boston.ma.us>)
X
X`09another one i saw this afternoon:  i got into a state where typing
X`09    ":!rm append"
X`09in an attempt to remove a file named "append" gave me
X`09    "`5BImproper line range`5D"
X`09i was able to clear the condition with
X`09    ":!  `5EH`5EHrm append"
X`09i haven't been able to reproduce this one.
X
X-- 97-01-19 (Abraham V. George" <ageorge@ERC.MsState.Edu>)
X
X`09While working with huge src files I find it very convenient to keep
X`09bookmarks.  If I use markers, i would loose them if I were to re-open
X`09the file.  One way I get through it is to make a book mark file of
X`09'tags' file format.  I can then get to that src line the same way I use
X`09ctags reference.
X
X-- 97-01-23 (Clayton Weaver <cgweav@eskimo.com>)
X
Xreports problem running a curses application within a shell buffer, wants
Xdocumentation clarified.  Shell buffers, since they are the output from
Xredirecting stdout and stderr, won't look like the curses application intended
V.
X(And since they don't accept interactive input, the curses application won't
Xwork well, even when stdin is reconnected to /dev/tty).
X
X-- 97-01-25 (tom)
X
Xwhen filtering, etc., via a pipe, we're interruptible and may be killed (at
Xleast when running in gdb).
X
X-- 97-02-09 (tom)
X
Xshould add gcc's -Wwrite-strings warnings
X
X-- 97-02-10 (tom)
X
Xon VMS, we don't get filename completion with "`7E", since that's not processe
Vd
Xin glob.c
X
X-- 97-02-26 (Andy Harper <A.HARPER@kcl.ac.uk>)
X
X`09Under VMS, the location of the package should be in a rooted directory
X`09tree, let's say VILE_ROOT:`5B000000`5D, with subdirectories for VAX
X`09executables `5BBIN_VAX`5D, Alpha \1D11ALPHA`5D, documentation
X`09`5BDOC`5D and configuration `5BCONFIG`5D.
X
X`5BI believe he's suggesting it be installed this way - tom`5D
X
X-- 97-04-02 (Clark Morgan <cmorgan@aracnet.com>)
X
Xtype this command (use path approp for your version of win95):
X
X      :w !c:`5Cwindows`5Ccommand`5Cmore`20
X`20
X...  vile should pipe the buffer to the more command and permit the user`20
Xto scroll through the text in a "subshell" and then print a`20
X`5BPress return to continue`5D prompt when more exits.  But instead, vile`20
Xwrites no output to the bottom of the screen and does not prompt for user`20
Xinput.  It's as if the entire pipe operation was discarded.`20
X`20
X`5B98-03-17: Fixed when w32pipes mode is enabled.  Otherwise, write \2906
Xare badly broken for DOS and all variants of Windows.`5D`20
X
X-- 97-04-23 (Ron Olsen <ronolsen@lucent.com>)
X
XI recently built version 7.0h of vile and xvile on my UnixWare 2.03 system.
X
Xvile and xvile (X11 version) seem to work well, but I'm having a problem with
V
Xfilename completion with the MOTIF/menu version of xvile:
X
XI have to hit TAB three times to get the list of possible completions, and the
Vn
Xwhen I enter the completion and hit Enter, xvile ignores the Enter key until I
V
Xuse the mouse to scroll a window, and then hit Enter again.  It looks as if
Xthere are circumstances in which keyboard input is being ignored.
X
XI also have minor pixelization problem with the MOTIF version:  a thin red
Xborder gets drawn around my window the second time I hit TAB during filename
Xcompletion.
X
X-- 97-04-30 (tom)
X
XPiping to vile from the command line in WinNT console works, but the mouse
Xdoesn't work after reopening the console.
X
X-- 97-05-16 (Richard A Ward <wardra@nb.rockwell.com>)
X
XI just started using vile 7.1 and I think there may be a new bug.  When I
Xdelete a large number of lines and try to undo, vile seems to hang.
X
X-- 97-05-25 (Guido Socher <eedgus@aken104>)
X
XQuoted motion should be usable as ranges for the colon commands.  I.e., you
Xtype "q:  motion-command q" and only complete lines are marked.  The cursor
Xjumps to the command input line as soon as you type the final q and prints the
V
Xrange (e.g., 3,28).
X
X-- 97-06-05 (tom)
X
XThe 'map' functions should allow mappings with embedded nulls.
X
X-- 97-06-12 (Adam Denton <adenton@genre.com>)
X
XI often have two vile windows open w/ different files in each.  It is
Xdifficult, however, to make both windows have the SAME file from this point, a
Vs
Xif you repond to the "_" (underscore) command with a file that's in another
Xwindow, vile doesn't put that file in the current \3206; it simply changes you
V
Xto the other window.  So I end up killing the extra\2707 and re-making it
X(`5E`5EK &025EX-2) whenever I need 2 views of the same file, which is quite of
Vten.
X
X`5Bi know of no way to force this.  it annoys me too.  i can picture two
Xpossibilities:
X    1) a command that forces the current window to a particular buffer, or
X    2) a command that forces the current window to its _previous_ buffer, sinc
Ve
X`09most of the time i want this i a) had two views on a buffer,
X`09b) typed ":e someotherfile", and now c) want to get back to my
X`09two views, with the cursor position correctly.  i'm not sure how
X`09easy or natural it would be to restore the cursor position with
X`09option 1).
X
Xpaul`5D
X
X-- 97-06-24 (Peter Gallasch <gal@adv.magwien.gv.at>)
X
XNo core dump was made, and no file in /tmp/ was created
X
X`5BReports a problem where xvile 7.1 exited with SIGIOT, no apparent reason.
V  I
Xtried duplicating it, with limited success:  after running several hours with
V
XPurify, xvile exited (I think the linewrap logic is involved, he uses it in hi
Vs
X.vilerc).  However, I'd not told Purify to follow child processed (which is
Xneeded for X).  Doing that, I had no repeat of the problem.  - tom`5D
X
X-- 97-07-07 (Larry Gensch <gensch@zk3.dec.com>)
X
XI have noticed another oddity in the 7.1 version of vile:  I use the window
Xmanager fvwm2.0.45, and use the following focus policies:
X
XStyle "*"`09ClickToFocus, RandomPlacement, Smart\1009
XGlobalOpts`09ClickToFocusPassesClick,\180CRases
X
XWhen xvile is launched from an xterm, it occasionally doesn't auto-focus like
V
+-+-+-+-+-+-+-+-  END  OF PART 11 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 12 -+-+-+-+-+-+-+-+
Xit used to.  In other words, I have always expected xvile to become the window
V
Xwith the focus when it pops up (even if the cursor isn't in the window).  Has
V
Xsomething changed between the last 6.x version and \0C087 that would cause
Xthis behavior?
X
X-- 97-08-18 (Paul Laub <P_Laub@fccc.edu>)
X
XThe setting readonly-on-\0C08 fails to work in dos (vile 7.1).  I want to
Xput both
X
X    set readonly-on-\0C08
X    set view-on-readonly
X
Xin vile.rc and have them work.`20
X
X-- 97-09-02 (tom)
X
XThe majormode code leaks memory in the qualifiers (e.g., suffixes and
Xpreamble).
X
X-- 97-09-04 (tom)
X
Xformat-til does not work on rectangular regions (it should also take
Xinto account the comment-prefix).
X
X-- 97-11-27 (tom)
X
Xshould make tags-stack based on a buffer rather than its struct so I could
Xsimply kill it.
X
X-- 97-12-03 (tom)
X
XThe --without-shell configure option is experimental; note that a genuinely
Xsecure editor should not allow directory names to be specified (but I think
Xthat's the only omission).
X
X-- 97-12-03 (tom)
X
XEMX configuration looks ok (function keys, pipes, name-completion, color),
Xexcept that there's nothing to allow chang\1208 different device (e.g.,
X"c:").  Must check/see if EMX supports that.  The termcap files distributed
Xwith EMX are incomplete `26 incorrect (should we distribute our own?).
X
X-- 97-12-03 (tom)
X
XRecently investigated two "POSIX" layers for WinNT:  gnu-win32 b18 and UWIN
X1.33 Neither is suitable for production use (both are still in alpha), so I'll
V
Xonly make notes.  I ran both of these on a longname filesystem:
X
Xgnu-win32
X`09+ bash was reluctant to run the configure script (and inconsistent;
X`09  sometimes "sh configure" worked, other \2307./\220A).
X
X`09+ configure script had to be "helped" since the tests for killpg,
X`09  etc., broke (process never returned).
X
X`09+ the fcntl(0, F_SETFL, kbd_flags`7CO_NDELAY) call for tttypahead()
X`09  returns success though it does nothing.  I stubbed it out to
X`09  get a workable program.
X
X`09+ the "vt100" terminal emulator is limited-functionality (less, even,
X`09  than ANSI.SYS).
X
X`09+ server pathnames begin with "//".  There is some old code to support
X`09  Apollo (one of the sources that M$ copied), which seems to work for
X`09  this purpose.
X
XUWIN:
X`09+ the configure script mostly ran (though the previous version could
X`09  not run sed for constructing config.h).
X
X`09+ 'environ' did not seem to be present (there's no configure test for
X`09  that yet).
X
X`09+ the isready_c macro has to be tweaked (it doesn't correspond to any
X`09  of the other flavors).
X
X`09+ appears to be same "vt100" emulator as gnu-win32 (perhaps it is).
X
X-- 98-02-08 (tom)
X
XTwo users report a problem with xvile linked\1206Motif 2.0 on Linux.
X(John Gotts <jgotts@engin.umich.edu> and Gary Ross <gdr@hooked.net>).
X
XI am unable to reproduce the bug, but did find a bug in Purify which caused
Xrealloc to clear its argument when invoked immediately after a fork.
X
XAccording to these reports, the x_open function is being invoked twice, which
V
Xis incorrect; it breaks initialization, causing the scrollbar data to be null,
V
Xresulting in a core dump.
X
XOn the basis of earlier reports (and from reading news groups) I suggested tha
Vt
Xit might be a conflict with glibc2 vs libc5 (no), that the OPT_WORKING code
Xmight be a problem (no), and that forking xvile \3013with Motif
X(no).  Compiler optimization level may be related (both reports were for -O2
Xand up).
X
X`5B98-05-27`5D
XRevisiting this, another possibility is that the x_preparse_args(), which
Xinitializes the display causes a ConfigureWindow event, which is i\4108ing
Xthe scrollbar arrays before x_open is actually called - but only for some
Xsystems (e.g., Motif 2.x).
X
X-- 98-04-12 (tom)
X
XOS/2 pipes hang in a write-to-pipe (nothing to do with recent changes for
XWin32).  The EMX configuration can read/write pipes.
X
XOS/2 mouse code probably eats too many CPU cycles; since coding that, I've
Xnoticed that OS/2 is sometimes reluctant to switch windows vs EMX\0F08.
X
X-- 98-05-30 (tom)
X
XThe CMDFUNC.cu union will not compile on pre-ANSI\1408rs since they do
Xnot handle static initialization of unions.  I'll add a configure test
Xbetween 8.0 and 8.1 to repair this (e.g., so that people can use unproto).
$ call unpack [.VILE-8_0]BUGLIST.;1 -
 391904053 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 99 11 152
$!
$ create 'f'
X/*
X * Program: A simple comment and keyword attributer for vile
X * Author : Jukka Keto, jketo@cs.joensuu.fi
X * Date   : 30.12.1994
X * Modifications:  kevin buettner and paul fox  2/95
X * `09`09string literal ("L\0A06") support --  ben stoltz
X *
X * $Header: /usr/build/vile/vile/RCS/c-filt.c,v 1.10 1998/04/29 23:24:28 tom E
Vxp $
X *
X * Features:
X * `09- Reads the keyword file ".vile.\1407s" from the home directory.
X *`09  Keyword file consists lines "k\1D06:attribute" where
X *`09  keyword is any alphanumeric string `5B#a-zA-Z0-9_`5D followed
X *`09  by colon ":" and attribute character; "I" for italic,
X *`09  "U" for underline, "B\1306bold, "R\2106reverse or
X *`09  "C#" for color (where # is a single hexadecimal digit representing
X *`09  one of 16 colors).
X *`09- Attributes the file read from stdin using vile a\2F08 sequences
X *`09  and outputs the file to stdout with keywords and comments
X *`09  attributed.
X *`09- Normal C-Comments are handled by the pseudo-keyword "\2C08".
X *`09- "String literals" are handled by the pseudo-keyword "L\2D08.
X *`09- #if, #include, etc. are handled by the pseudo-keyword "Cpp".
X *`09- Here is a macro one might use to invoke the colorizer:
X *`09    30 store-macro
X *`09`09    write-message "`5BAttaching C/C++ attributes...`5D"
X *`09`09    set-variable %savcol $curcol
X *`09`09    set-variable %savline $curline
X *`09`09    set-variable %modified $\0A08
X *`09`09    goto-beginning-of-file
X *`09`09    filter-til end-of-file "c-filt"
X *`09`09    goto-beginning-of-file
X *`09`09    attribute-cntl_a-sequences-til end-of-file
X *`09`09    `7Eif `26not %modified
X *`09`09`09    unmark-buffer
X *`09`09    `7Eendif
X *`09`09    %savline goto-line
X *`09`09    %savcol goto-column
X *`09`09    write-message "`5BAttaching C/C++ attributes...done `5D"
X *`09    `7Eendm
X *`09    bind-key execute-macro-30 `5EX-q
X *
X * example .vile.keywords files:
X * (first, for color use)
X *`09Comments:C1
X *`09Literal:C1
X *`09Cpp:C2
X *`09if:C3
X *`09else:C3
X *`09for:C3
X *`09return:C3
X *`09while:C3
X *`09switch:C3
X *`09case:C3
X *`09do:C3
X *`09goto:C3
X *`09break:C3
X *
X * (for non-color use)
X *`09Comments:U
X *`09Literal:U
X *`09Cpp:I
X *`09if:B
X *`09else:B
X *`09for:B
X *`09return:B
X *`09while:B
X *`09switch:B
X *`09case:B
X *`09do:B
X *`09goto:B
X *`09break:B
X *
X * Note:
X *`09- I use this to get the coloring effects in XVile, or when
X *`09  using a terminal emulator which supports color.  some, for
X *`09  instance, allow the mapping of bold and italic attributes to
X *`09  color.
X *
X * Known Bugs (other features):
X *`09- The keyword lists should be ordered for optimal operation.
X *
X * Win32 Notes:
X *    1) Keywords are read from either $HOME`5Cvile.k\2908or
X *       .`5Cvile.keywords .
X *
X *    2) The console and GUI versions of vile both support full use of
X *       16 colors.  The default\1506 mapping (palette) is as follows:
X *
X *       C0:black\0F081:red\1C07\21062:green\10093:brown
X *       C4:blue\0E07 C5:magenta\12096:cyan\2108 C7:lightgray
X *       C8:gray\0E07 C9:brightred\2107A\1207green  CB:yellow
X *       CC:brightblue  CD\0F07magenta  CE\2107cyan   CF:white
X *
X *    3) Note also that the user may specify the editor's foreground and
X *       background colors (:se fcolor, :se bcolor) as well as a
X *       foreground color for search matches (:se visual-\1407).
X *
X *    Pulling 1-3 together, here is an example vile.rc file that
X *    sets the foreground color to white, back\1B10(dark) blue,
X *    and visual matches color to bright red:
X *
X *    vile.rc
X *    =======
X      set bcolor=blue
X      set fcolor=white
X      set visual-matches=brightred
X
X *    And here is an example vile.keywords file that colors comments in
X *    yellow, C keywords in brightcyan, preprocesor directives in
X *    brightmagenta, and string constants in\2707green.
X *
X *    vile.keywords
X *    =============
X      Comments:CB
X      Cpp:CD
X      Literal:CA
X      if:CE
X      else:CE
X      for:CE
X      return:CE
X      while:CE
X      switch:CE
X      case:CE
X      do:CE
X      goto:CE
X      break:CE
X */
X
X#ifdef HAVE_CONFIG_H
X#include "config.h"
X#else
X/* assume ANSI C */
X# define HAVE_STDLIB_H 1
X# define HAVE_STRING_H 1
X#endif
X
X#include <sys/types.h>`09`09/* sometimes needed to get size_t */
X
X#if HAVE_STDLIB_H
X#include <stdlib.h>
X#else
X# if !defined(HAVE_CONFIG_H) `7C`7C MISSING_EXTERN_MALLOC
Xextern`09char *`09malloc`09( size_t len );
X# endif
X#endif
X
X#ifdef HAVE_UNISTD_H
X#include <unistd.h>
X#endif
X
X#include <stdio.h>
X
X#ifdef HAVE_STRING_H
X#include <string.h>
X#endif
X
X#if MISSING_EXTERN__FILBUF
Xextern`09int`09_filbuf`09( FILE *fp );
X#endif
X
X#if MISSING_EXTERN__FLSBUF
Xextern`09int`09_flsbuf`09( int len, FILE *fp );
X#endif
X
X#if MISSING_EXTERN_FCLOSE
Xextern`09int`09fclose`09( FILE *fp );
X#endif
X
X#if MISSING_EXTERN_FPRINTF
Xextern`09int`09fprintf`09( FILE *fp, const char *fmt, ... );
X#endif
X
X#if MISSING_EXTERN_FPUTS
Xextern`09int`09fputs`09( const char *s, FILE *fp );
X#endif
X
X#if MISSING_EXTERN_PRINTF
Xextern`09int`09printf`09( const char *fmt, ... );
X#endif
X
X#if MISSING_EXTERN_SSCANF
Xextern`09int`09sscanf`09( const char *src,\110Dfmt, ... );
X#endif
X
X#if OPT_LOCALE
X#include <locale.h>
X#endif
X#include <ctype.h>
X
X#define MAX_KEYWORD_LENGTH 80
X#define HASH_LENGTH 256
X#define MAX_LINELENGTH 256
X#define MAX_ATTR_LENGTH 3
X
X#ifdef _WIN32
Xstatic char *keyword_file="vile.\1307s";
X#define PATHSEP '`5C`5C'
X#else
X# if __GO32__
X#define PATHSEP '`5C`5C'
Xstatic char *keyword_file="vile.key";
X# else
X#define PATHSEP '/'
Xstatic char *keyword_file=".vile.\1407s";
X# endif
X#endif
X
X#define isBlank(c)  ((c) == ' ' `7C`7C (\0E07`5Ct')
X
Xtypedef struct _keyword KEYWORD;
X
Xstruct _keyword `7B
X    char kw`5BMAX_KEYWORD_LENGTH+1`5D;
X    char attribute`5BMAX_ATTR_LENGTH+1`5D;
X    int  length;
X    KEYWORD *next;
X`7D;
X
Xstatic KEYWORD *hashtable`5BHASH_LENGTH`5D;
Xstatic KEYWORD identifier;
Xstatic char comment_attr`5BMAX_ATTR_LENGTH+1`5D = "C1"; /* color 1 */
Xstatic char literal_attr`5BMAX_ATTR_LENGTH+1`5D = "C2"; /* color 1 */
Xstatic char cpp_attr`5BMAX_ATTR_LENGTH+1`5D     = "C3"; /* color 3 */
X
Xstatic void
Xinithash(void)
X`7B
X    int i;
X    for (i=0;i<HASH_LENGTH;i++) hashtable`5Bi`5D = NULL;
X`7D
X
Xstatic void
Xremovelist(KEYWORD *k)
X`7B
X    if (k != NULL) `7B
X`09if (k->next != NULL) removelist\1C08);
X`09free((char *)k);
X    `7D
X`7D
X
Xstatic void
Xclosehash(void)
X`7B
X    int i;
X    for (i=0;i<HASH_LENGTH;i++) `7B
X`09removelist(hashtable`5Bi`5D);
X`09hashtable`5Bi`5D = NULL; /* For unseen future i do this */
X    `7D
X`7D
X
Xstatic int
Xhash_function(char *id)
X`7B
X    /*
X     * Build more elaborate hashing scheme. If you want one.
X     */
X    return ( (int) *id );
X`7D
X
Xstatic void
Xinsert_keyword(
X    char *ident,
X    char *attribute)
X`7B
X    KEYWORD *first;
X    KEYWORD *nxt;
X    int Index;
X    if (!strcmp(ident,"Comments")) `7B
X`09(void)strcpy(comment_attr,attribute);
X`09return;
X    `7D
X    if (!strcmp(ident,"Literal")) `7B
X`09strcpy(literal_attr,attribute);
X`09return;
X    `7D
X    if (!strcmp(ident,"Cpp")) `7B
X      strcpy(cpp_attr,attribute);
X      return;
X    `7D
X    nxt = first = NULL;
X    Index = hash_function(ident);
X    first = hashtable`5BIndex`5D;
X    if ((nxt = (KEYWORD *)malloc(sizeof(struct _keyword))) != NULL) `7B
X`09(void)strcpy(nxt->kw,ident);
X`09nxt->length = strlen(nxt->kw);
X`09(void)strcpy(nxt->attribute,\0A09);
X`09nxt->next = first;
X`09hashtable`5BIndex`5D = nxt;
X#ifdef DEBUG
X    fprintf(stderr,"insert_keyword: new %li, new->kw %s\0C07length %\1C08attri
Vbute %c\2F07next %li`5Cn", new,
X    `09`09&0209    nxt->kw,\0906length\0D07attribute,nxt->next);
X#endif
X    `7D
X`7D
X
X
Xstatic void
Xmatch_identifier(void)
X`7B
X    KEYWORD *hash_id;
X    int Index, match = 0;
X    Index = hash_function(identifier.kw);
X    hash_id = hashtable`5BIndex`5D;
X    while (hash_id != NULL) `7B
X`09if (hash_id->length == identifier.\1506) `7B /* Possible match */
X`09    if (strcmp(hash_id->kw,identifier.kw) == 0) `7B
X`09`09match = 1;
X`09`09break;
X`09    `7D
X`09`7D else if (identifier.kw`5B0`5D == '#' `26`26 hash_id->\190C) `7B
X`09    char *s = `26identifier.kw`5B1`5D;
X`09    while (isBlank(*s))
X`09    `09s++;
X
X`09    if (strcmp(`26hash_id->kw`5B1`5D,s) == 0) `7B
X`09`09match = 1;
X`09`09break;
X`09    `7D
X`09`7D
X`09hash_id = \0A07->next;
X    `7D
X    if (match)
X`09printf("`5C001%i%s:%s",identifier.length, hash_id->attribute,
X`09`09&0209   identifier.kw);
X    else
X        printf("%s",identifier.kw);
X`7D
X
X
Xstatic char *
Xextract_identifier(char *s)
X`7B
X    register char *kwp = identifier.kw;
X    identifier.kw`5B0`5D = '`5C0';
X    identifier.length = 0;
X    if (*s == '#') `7B
X`09do `7B
X`09`09identifier.length += 1;
X`09`09*kwp++ = *s++;
X`09`7D while (isBlank(*s) `26`26
X`09`09(identifier.length < MAX_KEYWORD_LENGTH));
X    `7D
X    while ((isalpha(*s) `7C`7C *s == '_' &027C isdigit(*s)) `26`26
X           identifier.length < MAX_KEYWORD_LENGTH) `7B
X`09identifier.length += 1;
X`09*kwp++ = *s++;
X    `7D
X    *kwp = '`5C0';
X    return(s);
X`7D
X
Xstatic FILE *
Xopen_keywords(char *filename)
X`7B
X    char *home = getenv("HOME");
X    char fullname`5B1024`5D;
X
X    if (home == 0)
X    `09home = "";
X    sprintf(fullname, "%s%c%s", home, PATHSEP, filename);
X    return fopen(fullname, "r");
X`7D
X
Xstatic void
Xread_keywords(char *filename)
X`7B
X    char ident`5BMAX_KEYWORD_LENGTH+1`5D;
X    char line`5BMAX_LINELENGTH+1`5D;
X    char attribute`5BMAX_ATTR_LENGTH+1`5D;
X    int  items;
X    FILE *kwfile;
X
X    if ((kwfile = open_keywords(filename)) != NULL) `7B
X`09fgets(line,MAX_LINELENGTH,kwfile);
X`09items = sscanf(line,"%`5B#a-zA-Z0-9_`5D:%`5BIUBR`5D",ident,attribute);
X`09if (items != 2)
X`09    items = sscanf(line,"%`5B#a-zA-Z0-9_`5D:%`5BC0-9ABCDEF`5D",ident,attrib
Vute);
X`09while (! feof(kwfile) ) `7B
X#ifdef DEBUG
X`09    fprintf(stderr,"read_keywords: Items %i, kw = %s, attr = %s`5Cn",items,
Vident,attribute);
X#endif
X`09    if (items == 2)
X`09`09insert_keyword(ident,attribute);
X`09    fgets(line,MAX_LINELENGTH,kwfile);
X`09    items = sscanf(line,"%`5B#a-zA-Z0-9_`5D:%`5BIUBR`5D",ident,attribute);
V
X`09    if (items != 2)
X`09`09items = sscanf(line,"%`5B#a-zA-Z0-9_`5D:%`5BC0-9ABCDEF`5D",ident,attribu
Vte);
X`09`7D
X`09fclose(kwfile);
X    `7D
X`7D
X
Xstatic int
Xhas_endofcomment(char *s)
X`7B
X    int i=0;
X    while (*s) `7B
X`09if (*s == '*' `26`26 *(s+1) == '/') `7B
X`09    return(i+2);
X`09`7D
X`09i += 1;
X`09s += 1;
X    `7D
X    return(0);
X`7D
X
Xstatic int
Xhas_endofliteral(char *s)`09/* points to '"' */
X`7B
X    int i=0;
X    while (*s) `7B
X`09if (*s == '`5C"')
X`09    return (i);
X`09if (s`5B0`5D == '`5C`5C' `26`26 (s`5B1\1107"' `7C`7C \100A`5C')) `7B
X`09`09++i;
X`09`09++s;
X`09`7D
X`09++i;
X`09++s;
X    `7D
X    return(0);
X`7D
X
Xstatic char *
Xskip_white(char *s)
X`7B
X    while(*s `26`26 isBlank(*s))
X    `09putchar(*s++);
X    return s;
X`7D
X
Xstatic int
Xfirstnonblank(char *tst, \0B06cmp)
X`7B
X    while (*cmp `26`26 isBlank(*cmp))
X`09cmp++;
X    return (tst == cmp);
X`7D
X
Xstatic char *
Xwrite_literal(char *s, int *\1607)
X`7B
X    int c_length = has_endofliteral(s);
X    if (c_length == 0)
X`09c_length = strlen(s);
X    else
X`09*literal = 0;
X    printf("`5C001%i%s:%.*s", c_length, literal_attr\180Cs);
X    s += c_length;
X    if (!*literal)
X    `09putchar(*s++);
X    return s;
X`7D
X
Xint
Xmain(int argc, char **argv)
X`7B
X    char line`5BMAX_LINELENGTH+1`5D;
X    char *s;
X    int comment,c_length,literal;
X
X#if OPT_LOCALE
X    setlocale(LC_CTYPE, "");
X#endif
X
X    comment = 0;
X    literal = 0;
X    inithash();
X
X    if (argc > 1) `7B
X`09int n;
X`09for (n = 1; n < argc; n++)
X`09    read_keywords(argv`5Bn`5D);
X    `7D else `7B
X`09read_keywords(\0907_file);
X    `7D
X
X    while (fgets(line,MAX_LINELENGTH,stdin) != NULL) `7B
X`09s = line;
X`09if (literal)
X`09    s = write_literal(s, `26\0C07);
X`09s = skip_white(s);
X`09while (*s) `7B
X`09    if (!comment `26`26 *s == '/' &0226 *(s+1) == '*') `7B
X`09`09c_length = has_endofcomment(s+2);
X`09`09if (c_length == 0) `7B /* Comment continues to the next line */
X`09`09    c_length = strlen(s);
X`09`09    comment += 1;
X`09`09`7D else `7B
X`09`09    c_length += 2;
X`09`09`7D
X`09`09printf("`5C001%i%s:%.*s",c_length,comment_attr\160As);
X`09`09s = s + c_length ;
X`09    `7D
X`09    if (!comment `26`26 *s == '/' &0226 *(s+1)\1107) `7B /* C++ \3007s */
X`09        c_length = strlen(s);
X`09`09printf("`5C001%i%s:%.*s",c_length,comment_attr\160As);
X`09      break;
X`09    `7D
X`09    if (!comment `26`26 *s == '#' &0226 firstnonblank(s, line) ) `7B
X`09`09c_length = strlen(s);
X`09`09printf("`5C001%i%s:%.*s",c_length,cpp_attr\120As);
X`09`09break;
X`09    `7D
X`09    if (comment `26`26 *s) `7B
X`09`09if ((c_length = has_endofcomment(s)) > 0) `7B
X`09`09    printf("`5C001%i%s:%.*s",c_length,comment_attr\160As);
X`09`09    s = s + c_length ;
X`09`09    comment -= 1;
X`09`09    if (comment < 0) \0D08= 0;
X`09`09`7D else `7B /* Whole line belongs to comment */
X`09`09    c_length = strlen(s);
X`09`09    printf("`5C001%i%s:%.*s",c_length,comment_attr\160As);
X`09`09    s = s + c_length;
X`09`09`7D
X`09    `7D else if (*s) `7B
X`09        if (*s == '`5C`5C' `26`26 *(s+1)\1206"') `7B/* Skip literal single
V character */
X`09`09    putchar(*s++);
X`09`09    putchar(*s++);
X`09`09`7D else if (!literal `26`26 *s == '`5C"' &0226 s`5B1`5D\1008) `7B
X`09`09    putchar(*s++);
X`09`09    putchar(*s++);
X`09`09`7D else if (!literal `26`26 *s == '`5C'' &0226 s`5B1`5D == '"\0F072
V\0F06`5C'') `7B
X`09`09    putchar(*s++);
X`09`09    putchar(*s++);
X`09`09    putchar(*s++);
X`09`09`7D
X`09`09if (*s == '`5C"')  `7B
X`09`09    literal =\0A0A= 0 ? 1 : 0;
X`09`09    putchar(*s++);
X`09`09    if (literal) `7B
X`09`09`09s = write_literal(s, `26\0C07);
X`09`09    `7D
X`09`09`7D
X
X`09`09if (*s) `7B
X`09`09`09if ( (isalpha(*s) `7C`7C *s == '_'\0D0B#')
X`09`09&0209`26`26 ! literal) `7B
X`09`09`09    s = extract_identifier(s);
X`09`09`09    match_identifier();
X`09`09`09`7D else `7B
X`09`09`09    putchar(*s++);
X`09`09`09`7D
X`09`09`7D
X`09    `7D
X`09`7D
X    `7D
X    closehash();
X
X    exit(0);
X`7D
$ call unpack [.VILE-8_0]C-FILT.C;1 -
 1482508932 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 28 12 152
$!
$ create 'f'
X%x COMMENT
X
X%`7B
X/* Filter to add vile "attribution" sequences to selected bits of C/C++ */
X/* input text. */
X
X/* You gotta use flex for this beast - hence the COMMENT start state */
X/* written by Alistair G. Crooks (agc@uts.amdahl.com) */
X
X#include <stdio.h>
X
X
X#define BOLD`09"B"
X#define ULINE`09"U"
X#define ITALIC`09"I"
X#define COLOR1`09"C1"
X#define COLOR2`09"C2"
X#define COLOR3`09"C3"
X#define COLOR4`09"C4"
X
X/* customize here, using the above set of defines... */
X
Xchar keyword_attr`5B`5D = BOLD;
Xchar preproc_attr`5B`5D = BOLD;
Xchar comment_attr`5B`5D = ULINE;
X
X/* ...end customization */
X
X#define CTL_A`09'`5C001'
X
Xint
X#ifdef __STDC__
Xmain(int argc, char **argv)
X#else
Xmain(argc, argv)
Xint`09argc;
Xchar`09**argv;
X#endif
X`7B
X`09extern FILE`09*yyin;
X
X`09if (argc == 1) `7B
X`09`09yyin = stdin;
X`09`7D else if ((yyin = fopen(argv`5B1`5D, "r")) == (FILE *) NULL) `7B
X`09`09(void) fprintf(stderr, "can't open %s`5Cn", argv`5B1`5D);
X`09`09exit(1);
X`09`7D
X`09while (yylex() > 0) `7B
X`09`7D
X`09exit(0);
X`7D
X
X%`7D
X
X%%
X
X#`5B `5Ct`5D*if`09`7C
X#`5B `5Ct`5D*if(n)?def`09`7C
X#`5B `5Ct`5D*else`09`7C
X#`5B `5Ct`5D*endif`09`7C
X#`5B `5Ct`5D*define`09`7C
X#`5B `5Ct`5D*error`09`7C
X#`5B `5Ct`5D*include`09`7C
X#`5B `5Ct`5D*undef`09`7B printf("%c%i%s:%s", CTL_A, yyleng, preproc_attr, yyte
Vxt); `7D
X
Xbreak`09`09`7C
Xcase`09`09`7C
Xcontinue`09`7C
Xdefault`09`09`7C
Xdo`09`09`7C
Xelse`09`09`7C
Xextern`09`09`7C
Xfor`09`09`7C
Xgoto`09`09`7C
Xif`09`09`7C
Xreturn`09`09`7C
Xsizeof`09`09`7C
Xstatic`09`09`7C
Xstruct`09`09`7C
Xswitch`09`09`7C
Xtypedef`09`09`7C
Xunion`09`09`7C
Xwhile`09`09`7B printf("%c%i%s:%s", CTL_A, yyleng, keyword_attr, yytext); `7D
X
X
X"/*"`09`09`7B printf("%c2%s:/*", CTL_A, comment_attr); BEGIN(COMMENT); `7D
X<COMMENT>`5B`5E*`5D*`09`7B printf("%c%i%s:%s", CTL_A, yyleng, comment_attr, yy
Vtext); `7D
X<COMMENT>"*"+`5B`5E*/`5D*`09`7B printf("%c%i%s:%s", CTL_A, yyleng, comment_att
Vr, yytext); `7D
X<COMMENT>"*"+"/"`09`7B printf("%c%i%s:%s", CTL_A, yyleng, comment_attr, yytext
V); BEGIN(0); `7D
X
X"//".*$`09`09`7B printf("%c%i%s:%s", CTL_A, yyleng, comment_attr, yytext); `7D
V
X
X`5Ba-zA-Z_`5D\09080-9`5D*`09`7C
X`5C"(`5C`5C`5C.`7C`5B`5E`5C"`5D)*`5C"`09`7B printf("%s", yytext); `7D
X
X
$ call unpack [.VILE-8_0]C-FILT.FLX;1 -
 976811350 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 4 13 152
$!
$ create 'f'
XChanges for vile 8.0 (released Sat May 30, 1998)
X
XChanges for vile 7.5 (released Sat May 30, 1998)
X
X`09+ document problem with static initialization of union in CMDFUNC.
X`09+ review g++ warnings, use TYPECAST macro in the newer "harmless" const
X`09  warnings.
X
X (tom) 980529 (p)
X`09+ move mlsave`5B`5D into edef.h, updating logic so that the last error
X`09  message during initialization will be displayed properly.
X`09+ add logic to main.c to popup messages generated during initialization
X`09  as per popup-msgs mode (reported by Brendan O'Dea).
X`09+ modify logic for do_source() so that no error is reported if the
X`09  default .vilerc is not found (reported by Brendan O'Dea).
X
X (tom) 980528 (o)
X `09+ fix minor memory leak in free_majormode()
X`09+ add a "+fork" option to xvile to override forkOnStartup resource.
X`09+ add search.pl to the list of supported Win32 perl scripts and add a
X`09  usage comment to same (patch by Clark Morgan).
X`09+ plug hole in x_open by setting maxscrollbars to zero, fixing a
X`09  scenario where the Motif version would crash (patch by Larry Gensch).
X
X (tom) 980527 (n)
X`09+ make search rule for startup file and :so consistent - and always
X`09  using $VILE_STARTUP_PATH if the file is not found in the current or
X`09  $HOME directory - using new function 'do_source()' (reported by
X`09  Arnold Robbins).
X`09+ add Clark Morgan's name to the modules he wrote (w32cbrd.c, w32misc.c,
X`09  w32pipe.c).
X`09+ rename perl-api.doc to perl.doc, updated (patch by Brendan O'Dea).
X`09+ modify too-restrictive test for infinite loop in scanner() to work
X`09  with 'n' command after "?.*" expression (reported by Kevin Buettner).`20
X
X (kev) 980525 (m)
X `09+ estruct.h (do_mark_iterate): Restore location of
X`09  api_do_mark_iterate_helper to its pre-"l" position.  Moved
X`09  declaration of mp so that it's available for expans\2B06
X`09  api_do_mark_iterate_helper.
X`09+ perl.xs: Added Brendan O'Dea as an author.
X`09  (Vile::command, \0F06Buffer\1709): Set discmd so that
X`09  prompts are not displayed.
X`09+ perl/search.pl: New file.
X`09+ makefile.in (search.pl): Added to PERL_SRC and INSTALL_PERL
X`09  variables.  Added install target.
X
X (tom) 980523 (l)
X `09+ remove _WIN32 ifdef's from perl.xs, so that $VILE_LIBRARY_PATH
X`09  is supported on Unix as well.
X `09+ add vile-pager script to macros directory.
X`09+ modify makefile.in to install Perl scripts in $(datadir)/perl
X`09  (reported by Kevin Buettner).
X`09+ correct typo in perl.xs: CODE where PPCODE should have been used
X`09  (patch by Kevin Buettner).
X`09> patch by Brendan O'Dea:
X`09+ some ifdef fixes for OPT_EVAL, OPT_NAMEBST and OPT_SELECTIONS when
X`09  extensions are disabled.
X`09+ correct placement of api_do_mark_iterate_helper() in \1C0F
X`09  macro.
X`09+ quiet a warning in the Perl interface when an optional script is
X`09  not found for inclusion.
X`09> patch by Clark Morgan:
X`09+ modify the win32 build environment so that perl scripts are copied
X`09  from .`5Cperl to %VILE_LIBRARY_PATH`5Cperl
X`09+ modify perl.xs to patch the new library location into @INC
X
X (kev) 980522 (k)
X `09+ perl.xs (mlreply, \0907_dir\0D0Afile\1B0Ano_opts):
X`09  Use the PPCODE: directive instead of the \1F0F.  Get
X`09  rid of assigning RETVAL and the OUTPUT: directive.  Use XPUSHs
X`09  to return the values.  Also changed the type to void instead of
X`09  SV *.
X
X (tom) 980521 (j)
X `09+ modify first item in VILE_STARTUP_PATH to be $(datadir).
X `09+ add *.pl to makefile.in's install rules if configured --with-perl
X `09+ move *.pl to perl subdirectory
X`09+ move *.rc to macros subdirectory
X`09+ move *.doc to doc subdirectory, as well as README.MENU, renamed to
X`09  menus.doc, and README.CFG, renamed to config.doc
X`09+ minor fix for HPUX compiler options in CF_ANSI_CC_CHECK configure
X`09  macro.
X`09+ newer CF_IMAKE_CFLAGS macro adds \1806LOAD\1B06to makefile.in
X`09+ add configure-test for strerror, use it if available (reported by
X`09  Ian A Watson).
X`09+ change 'strdup' call in select.c to 'strmalloc', to build on VMS 6.2,
X`09  with DEC C 4.1-001 (reported by Sackett Andrew
X`09  <sackett@exchange1.cmh.on.ca>).
X`09+ change c_action in Brendan's patch to a union, eliminating casts.
X`09> patch by Brendan O'Dea:
X`09+ Procedures now behave more like builtin functions--they may be bound
X`09  to keystrokes and listed in the `5BBinding List`5D pop-up (for which an
X`09  optional help string may be supplied):
X`09`09store-procedure foo "some descriptive text"
X`09`09...
X`09`09`7Eendm
X`09`09bind-key foo `5EA-f
X`09  this appears under `60:describe-function foo' as:
X`09`09"foo"        \0808\100BM-f
X`09`09  ( some descriptive text )
X`09  Notes/Bugs:
X`09    * describe-key doesn't work yet.
X`09    * setting the MOTION/OPER flag is not implemented for procedures
X`09      --not sure whether it ever could/should be.
X`09    * the method used to update the `5BBinding List`5D requires *lots* of
X`09      passes through the tree.
X`09  Perl stuff (strings to eval or coderefs) can also be put into the
X`09  command table under a name--described in the perl.xs comments.
X`09`09Vile::register grep => 'hgrep', 'recursive grep', 'hgrep.pl';
X`09  the Vile::register_motion and \1409oper variants additionally set
X`09  the MOTION or OPER flag:
X`09`09*cb = `5C$Vile::current_buffer;
X`09`09Vile::register_motion 'my-forward-line-at-bol' => sub `7B
X`09`09`09$cb->dot((scalar \1108) + 1, 0);
X`09`09`7D;
X`09`09Vile::register_oper 'my-delete-til' => sub `7B $cb->\1A06 `7D;
X
X (tom) 980520 (i)
X`09+ correct force-console entry in modetbl (patch by Clark Morgan)
X
X (tom) 980519 (h)
X `09+ correct const-cast warnings for x_set_icon_name() and
X`09  x_set_window_name().
X `09+ correct fallback prototype for mktemp, which should not have a 'const'
X`09  parameter.
X`09+ vile-pas-filt should treat '_' as an identifier character
X`09  (reported by Radek Liboska).
X`09> patches by Clark Morgan for Win32 and Perl configurations (tested on
X`09  WinNT 4.0 and Win95):
X`09+ Winvile's read pipe and region filter operations now create implicit,
X`09  hidden console windows (i.e., black\1D11don't pop up and
X`09  disappear anymore).  Exception:  Win95's command.com hangs if it
X`09  attempts to communicate with implicitly created consoles.
X`09  Consequently, a new boolean mode (called "force-console") has been
X`09  created which specifies whether or not consoles are\3408
X`09  explicitly prior to creating a child process or im\3009when the
X`09  child process is exec'd.  By default force-console is only set when
X`09  the host is win95 and the current shell is command.com
X`09+ Prevent `5EC/`5EBreak in a console subshell from kernel faulting win95.
X`09+ If the user's shell is a unix clone derived from the Bourne shell,
X`09  add an extra layer of quoting that preserves Unix argument semantics.
X`09  For more details, refer to the function mk_shell_cmd_str() in the
X`09  file w32misc.c
X`09+ new file w32misc.c + some common win32 code in w32pipe.c moved to
X`09  w32misc.c
X`09+ modify makefile.wnt to add two new build configurations to the Win32
X`09  env:  vile-with-perl and winv\160D.
X`09+ add VILE_LIBRARY_PATH environment variable to perl.xs to locate
X`09  the help file.
X`09+ add new file mkprlenv.wnt, which is included by makefile.wnt
X
X (tom) 980515 (g)
+-+-+-+-+-+-+-+-  END  OF PART 12 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 13 -+-+-+-+-+-+-+-+
X `09+ modify quote() function to show the accumulated number for `5EVnnn.
X `09+ change 'value' parameter of SetVarValue() to eliminate a const-cast
X`09  warning, which in turn led to applying const to TTrez interface.
X `09+ change category of 'sideways' mode to allow setting it for internal
X`09  buffers, such as `5BHelp`5D.
X`09+ add a range-test for rows and columns in movecursor() to avoid
X`09  passing negative coordinates to tcapmove when setting the 'sideways'
X`09  mode.
X`09+ distinguish MS-DOS drives from UNC pathnames (patch by Ed Henderson)
X
X (tom) 980513 (f)
X `09+ replace global variable curswval with the corresponding function
X`09  calls, make nextsw a function next_sw(), so that shift-width is
X`09  computed correctly as needed (reported by abigail@fnx.com and Ian A
X`09  Watson <watson_ian_a@lilly.com>)
X`09+ correct handling of command-line options in crypt.c (patch by
X`09  Paul Fox).
X`09+ correct missing check for empty line in screen_string, which would
X`09  cause a core dump if :show-variables were run on an empty buffer
X`09  (reported by Ed Henderson <enh\0D08@micron.com>, patch by Kevin
X`09  Buettner).
X `09+ updated modes.doc to match implementation of fences.
X
X (kev) 980511 (e)
X`09+ api.c (api_motion): Revised the settings for the following
X`09  global flags: clexec, discmd, disinp, isnamedcmd.  Some of
X`09  these were not getting set or\1806\140Cin such a
X`09  way so as to either cause core dumps or incorrect behavior.
X`09+ bind.c (kbd_erase, \0B09_to_end): Don't erase anything if
X`09  disinp is FALSE.  Reason: If we didn't display anything to
X`09  begin with, there should be nothing to erase.
X`09+ history.c (hst_append): Don't \0F06 to the\2C08 buffer if
X`09  disinp is FALSE.
X`09+ input.c (editMinibuffer): Make sure the input character is
X`09  added to the buffer when disinp is FALSE.
X`09+ perl.xs (svrs): New variable which represents the input
X`09  record separator.  This is necessary because the symbol
X`09  corresponding to rs is not exported from the Win32 DLL for
X`09  perl5.00402.
X`09  (perl_init): Initialize svrs.
X`09  (READLINE): Use svrs instead of rs.
X`09  (set): Call api_setup_fake_win() to make sure that local
X`09  sets are done to the correct buffer.
X`09  (set_region): Renamed from set\1906.  \0C09 is still
X`09  maintained as an alias.  I'm not entirely sure I like the new
X`09  name better, but it is at least consistent with set_selection.
X`09  (selection_buffer, set_\1609): New methods for getting/setting
X`09  the selection.
X`09+ proto.h, select.c (get_\0E06ion_buffer_and_region): New function.
X
X (kev) 980506 (d)
X`09+ fences.c (comment_fence): Call scanboundry() before calling
X`09  scanner() to set the\1508's boundary.  This fixes a bug
X`09  in which the corresponding fence would sometimes not be matched
X`09  due to an old scan boundary sitting in the middle of the region
X`09  delimited by the two fences.  A quick way to reproduce the bug:
X`09  Search for something in the middle of a multi-line comment.
X`09  Move your cursor to the beginning or end of the comment.  Press
X`09  the '%' to try to move to the other end of the comment.  Notice
X`09  that it doesn't.  (Or\1108, if the bug has been fixed!)
X`09+ input.c (editMinibuffer): Some hacks for 'i', 'a', 'I', and 'A'.
X
X (tom) 980506 (c)
X`09+ modify getregion() to handle the special case where a \2C06 is given
X`09  extending to the end of file, e.g., "`5EA`7E`5D", when DOT is on the last
V
X`09  section, will set DOT to the first line past \1406le, e.g., the
X`09  buf_head line (reported by Adam Denton).
X`09+ modify return from kbd_reply() so that macros behave more
X`09  consistently with interactive use, by returning an ABORT when
X`09  name-completion fails.
X`09+ modify handling of mini-edit character to allow it to be bound to the
X`09  same code as abortc (e.g., escape).
X`09+ correct a case where entering mini-edit character would allow name
X`09  completion to exit from kbd_reply().
X`09+ modify handling of minibuffer editing commands so that non-motion
X`09  commands (such as 'i' and 'a') are treated as errors rather than
X`09  implicitly inserting them into the buffer.
X
X (tom) 980503 (b)
X `09> patch by Clark Morgan
X`09+ correct bug that made winvile font-dialog die on Win95, using example
X`09  from Petzold for processing messages associated with the system menu.
X`09+ added a menu separator to the system menu
X`09+ gave "Font" a  keyboard accelerator
X`09+ added a cast to keep the compiler from barking about a call to
X`09  EnumFontFamilies().
X
X (kev) 980503 (a)
X `09+ api.c (api_setup_fake_win, api_dotinsert): Set MDNEWLINE to
X`09  false when deleting a newline before the end of a file.
X`09  (api_dotgline): Unused, #if 0'd out.
X`09+ makefile.in (vile-perl-api.pod, \130Edoc,
X`09  vile-perl-api.html,\140Fman): New targets.  I'm going
X`09  to let Tom decide which of these should be installed and where.
X`09+ perl.xs: Converted the inline documentation to be almost pod
X`09  format.  There is still a preprocessing step needed to convert
X`09  to a pod file.  I also rearranged the order of the methods
X`09  so that they'd be roughly alphabetical.
X`09  (svgetline, svgetregion\0D07tors): Don't look at end
X`09  marker any more to determine end of region.  Instead,
X`09  use the region length to keep track of how many characters
X`09  are left in the region.  (I added a comment on the problems
X`09  associated with the end-of-region mark to the code just
X`09  before svgetline()).
X`09  (setregion): Rewritten to call g\1E08() for setting up
X`09  the region.  This way the length gets set right.
X`09  (perl_default_region): Make sure the \1706 is really being
X`09  computed by getregion().
X`09  (do_perl_cmd): Fixed the code so that range specs work
X`09  again.
X
XChanges for vile 7.4 (released Fri May 1, 1998)
X
X (tom) 980501
X`09+ change table lookups in match_complex() and global_val_init() to
X`09  work with CSet.
X `09+ change WATCHTYPE from an enum to an unsigned int, since TurboC did
X`09  not accept that in prototypes.
X`09+ increase LEN_BUFFER in mktbls.c to accommodate renaming of VI_NL
X`09  (caused compile problem with Solaris 2.5.1 cc, but is still limited
X`09  to allow test-compiles with TurboC).
X`09+ make declarations of x_watchfd() x_un\0E0Aconsistent, to compile
X`09  with unproto on SunOS 4.x
X
X (kev) 980429 (za)
X`09+ finderr.c (predefined): Add hgrep pattern to the p\2609
X`09  regular expressions for the error finder.  (Patch from Clark
X`09  Morgan.)
X`09+ hgrep.pl: Added Clark's error finder comment.
X`09  Removed comment about me\0907to make massive changes which'll
X`09  change the interface drastically.
X`09  (hgrep): Don't search in files named 'tags'.  (Suggested by
X`09  Clark Morgan.)
X`09+ eval.c, proto.h (stenv): New function for setting vile's
X`09  variables (from perl or whereever).
X`09+ perl.xs (working): Added OPT_WORKING ifdefs.  (Description
X`09  of problem from Clark Morgan.)
X`09  (set): Handle perl variables as well as modes.
X`09  (buffers): New method which retrieves a list of all \3307.
X
X (tom) 980429 (z)
X `09+ trim trailing whitespace from .c and .h files
X`09+ implement font-selection in winvile, added to control menu.  This
X`09  works passably, though you must press `5EL to repaint if the character
X`09  size does not change. (Italic fonts are clipped a little also, but usable
V).
X`09+ add logic to ntwinio.c so that winvile user can use control modifier
X`09  to mouse button to perform rectangular selection, as in xvile
X`09  (requested by Richard A Ward <wardra@rss.rockwell.com>).
X`09+ correct ":e!" command so that if user asks to reread the unnamed
X`09  buffer, that vile simply clears it, rather than passing a null
X`09  filename to readin() (reported by Keith Williams
X`09  <keith@archelon-us.com>).
X`09+ rename symbol NL to VI_NL, and the termcap\2407s in tcap.c
X`09  to use "tc_" prefix to avoid conflicts with curses.h on OSF/1 3.2
X`09+ add pas-filt.c and corresponding vile-\2208 program (request by
X`09  Radek Liboska <l\0906@tereza.uochb.cas.cz>)
X`09+ modify c-filt.c so that it reads all command-parameters as keyword
X`09  files.
X`09+ correct two errors in c-filt.c (did not handle continued string
X`09  literals - reported by Clark Morgan - and did not handle preprocessor
X`09  lines with leading whitespace.
X`09+ correct minor formatting nit in `5BSettings`5D buffer, adding a blank
X`09  line between the multi-column and single \1207buffer settings.
X`09+ make a more-useful message when describe-function is applied to
X`09  a user-defined procedure.
X `09> patch by Clark Morgan:
X`09+ Winvile gets its own unique $progname value.
X`09+ The ';' register is made accessible to all versions of vile.  The
X`09  availability of the ';' and '.' registers to all versions of vile is
X`09  documented in vile.hlp .
X`09+ New win32 mode called "scroll-pause" added, which inserts a small
X`09  delay in the console editor's scrolling code if required by user's
X`09  video HW.  Documented in vile.hlp .
X
X (kev) 980427 (y)
X`09+ history.c (WillGlue): Allow '`5Cr' to be glued.
X`09  (edithistory): Transform '`5Cn' into '`5Cr' for insertion\1806the
X`09  history buffer.
X`09+ input.c (eol_history): Allow '`5Cr' to match '`5Cn'.
X`09+ modes.c (choice_to_code): Do case insensitive comparisons.  This
X`09  permits TRUE and FALSE to be used as boolean values as well as
X`09  'true' and 'false'.  (The perl interface was being given the
X`09  uppercase values to return.  Though it could be argued that I
X`09  should maybe convert these to 0 and 1...)
X`09  (adjvalueset, set_mode_value): Split functionality of \350B
X`09  into adjvalueset which (still) does the prompting and the
X`09  new function set_mode_value which does the setting.  Having
X`09  a setter which does no prompting makes it easier to call from
X`09  other places (like the perl interface.)
X`09+ proto.h (set_mode_value): New declaration.
X`09+ perl.xs (perl_prompt, perldo\0F07): More or less renamed
X`09  from the old perl an\0906do.  \120F still exist,
X`09  but they are small wrappers which make managing the history
X`09  easier.
X`09  (current_position): Alias for dot.
X`09  (READLINE, mlreply\0909_no_opts\110Afile\1F0Adir):
X`09  Put calls to hst_glue() in so that the history mechansism will
X`09  work right.
X`09  (Vile::set, \0B06g\0B0ABuffer\1E0D\1308get):
X`09  New methods.
X
X`09  Brendan O'Dea contributed the following changes to perl.xs:
X
X`09    I have nuked the original perldo/replace_line mechanism
X`09    and arranged such that both perl and perldo feed a string
X`09    to eval to the same `5Bstatic`5D function after getting the
X`09    user's input.
X
X`09    The perldo wrapper massages the string into an implicit
X`09    loop if required in pretty much the same way as Perl does
X`09    for the -n/-p options.
X
X`09    Additionally I've modified the way PRINT works to the
X`09    minibuffer so that it handles embedded newlines and joins
X`09    on $,
X
X`09    The options format is almost the same as used by perl, and
X`09    defaults to `60-lpi' which was how it originally worked.
X`09    Example:
X
X`09`09:r $MAIL :%perldo print if /`5EFrom /`5EM-00ni
X
X`09    Two minor problems are that the history pastes the options
X`09    onto the command, and there is a minor glitch with `60-lpi'
X`09    which causes a trailing newline to be appended to the
X`09    buffer.
X
X (tom) 980426 (x)
X`09+ modify :-line line specification parsing so that statements such
X`09  as
X`09`09:.,.+2,+3,-4;99p
X`09  work as in vi.  Both the repetition for commas and the character
X`09  class for semicolon were missing.
X`09+ modify :-line line specification parsing so that statements such
X`09  as
X`09`09:1,w filename
X`09`09:.w filename
X`09  work as in vi.  Vi accepts an empty string (e.g., between the "," and
X`09  "w") as ".", and does not require that both limits in a range be
X`09  given.  Previous behavior of vile would prompt, in the latter
X`09  example, when the space after "w" is typed, for the number of lines.
X `09+ corrected :-line parser bug which caused state hang, e.g, when
X`09  typing
X`09`09<esc>:a<backspace>1<return>
X`09  vile would be expecting a command verb when the '1' is read, so
X`09  it would only allow the user to abort the command.
X`09+ modify end-character parameter of readpattern so that it is not
X`09  necessary to escape a '?' when doing a reverse search.
X`09+ correct logic of set_rect_columns() so that reversed rectangular
X`09  selection (where DOT > MK) gives the right number of columns
X`09  (reported by Kuntal M. Daftary).
X`09+ remove spurious comma in enum WATCHTYPE (reported by Larry Gensch)
X `09+ update README.MENU with "cmd" keywords for the examples of search
X`09  menu entries.  Other minor documentation updates.
X`09+ tested xvile with ElectricFence, doalloc and Purify.  (The problems
X`09  with 'working' mode did not appear on SunOS or Solaris, but did on
X`09  Linux).  Minor fixes to ifdef's to build the test configuration.
X`09+ remove chgd_fences callback from the newer regular-expression
X`09  fences modes, since that function applies only to\3206-pairs.
X`09+ modify 'working' mode so that xvile simply sets the watch cursor.
X`09  Though the "working..." message would be nice to have, it introduces
X`09  problems with X Windows to cause events which may interrupt the
X`09  normal event processing.  The new scheme sets a flag which is tested
X`09  in the event loop; the watch cursor will therefore not appear
X`09  immediately, but it is still automatic.  (prompted in part by a
X`09  bug report by Mike Peercy <peercy@sierravista.com>).
X
X (tom) 980424 (w)
X`09+ make xvile menu entries "work" which rely on executing from the
X`09  :-line, by using "cmd" prefix for "apropos", and new function
X`09  `26gts for describe-key.  (The "cmd" is a kludge - we should revisit
X`09  this later, since it does not help if we want to process parameters
X`09  from the macro before running out `26 reverting to the :-line).
X`09+ modify describe-key so that it prompts for a keycode which is not
X`09  mapped.
X`09+ add new function `26gts, which prompts for a keycode\1C07is not
X`09  mapped, e.g., "#1" for function-key-1.
X`09+ add note to vile.hlp about the use of backtic in shell expressions
X`09  (patch by Clark Morgan).
X`09+ revised fences so that the C-preprocessor and C-comment functions
X`09  are parameterized in terms of regular expressions, making one mode
X`09  per expression.  As such, they are reusable for majormodes.
X`09+ remove logic from x11.c for is_color_cursor, to make \1006 visible
X`09  on reverse-video areas.
X`09+ add new mode mini-hilite, which controls the appearance of the :-line
X`09  when user toggles into mini-edit mode.
X`09+ make `5EG toggle in the :-line editing rebindable, as the character
X`09  'mini-edit'.
X`09+ correct logic for `5EG toggle so that user can insert that character
X`09  into a reply by quoting it.
X`09+ correct core-dump due to vtinit() calling 'imworking()', which was
X`09  happening when executing a command such as ":!resize -s 24 80".
X`09+ correct core-dump when user types `5EG`5EV in a :-line prompt (reported
X`09  by Shawn Halpenny <malachai@iname.com>).
X
X (kev) 980422 (v)
X`09+ api.c (curwp_visible): Renamed from \1D06after.  No longer static.
X`09  (linsert_chars): Don't suppress the newline when that's the
X`09  only character being inserted.  Thanks to Brendan O'Dea for
X`09  providing me with a test case which demonstrated this bug.
X`09  (api_motion): Set clexec and discmd to avoid printing on the
X`09  message line.
X`09  (api_swscreen, api_update): Don't detach the fake windows anymore.
X`09+ api.h (curwp_visible): Declared.
X`09+ estruct.h (is_fake_window): New macro.  Changed all callers
X`09  of is_fake_win() (which was a function) to call\2D0Cdow
X`09  instead.
X`09  (is_visible_window, for_each\190F): New macros.
X`09+ buffer.c, display.c, exec.c, file\0806nderr.c, history.c,
X`09  ibmpc.c, modes.c, oneliner.c, select.c, window.c, x11.c
X`09  (for_each_visible_window): Changed some occurrences of
X`09  for_each_window to\130Avisible\1B07.  Any code which
X`09  really needs to look at all the windows, whether fake or
X`09  visible still uses for_each_window.
X`09+ perl.xs (keystroke): Make sure that curwp doesn't point
X`09  at a fake window before attempting to get a keystroke.
X`09  Also fixed the nonwaiting version so that it works.
X`09  (beep): New method.
X`09+ proto.h, window.c (is_fake_win, detach\1109dows,
X`09  reattach_fake_windows): Removed these functions.
X`09+ shell.pl: Extended it's functionality.  It now includes enough
X`09  terminal emulation to do some simple line editing.  (Enough for
X`09  bash to work in vi mode.)
X`09+ window.c (push_fake_win, pop\0E09): Don't increment/de\0A07
X`09  the b_nwnd field of a buffer when pushing/popping.  This\2E06
X`09  indicates the number of visible WINDOW structures that a buffer
X`09  has.  (#if 0'd out for now.  Need to remove altogether at some
X`09  future date.)
X`09+ x11.c (grip_moved): Fixed both OpenLook and Motif versions so
X`09  that they don't delete the window when it is shrunk to a size
X`09  less than 1 line.  Although this make a certain amount of sense,
X`09  it can be quite annoying to a user to lose a window from a slip
X`09  of the hand.  Note that there are still some problems with this
X`09  code.  Windows that are made really small don't always end up
X`09  really small (reported by Paul Askounis).
X`09  (x_watchfd): Cast third argument of XtAppAddInput to an XtPointer.
X
X (kev) 980419 (u)
X `09+ ansi.c, borland.c, dumbterm.c, ibmpc.c, ntconio\0B06wi\0B06
X`09  os2vio.c, tcap.c, term\1206vmsvt.c (null_t_watchfd,
X`09  null_t_unwatchfd): Added to term structure initializations.
X`09+ estruct.h (WATCHTYPE): New enumerated type.
X`09  (t_watchfd, t_un\0D07): New fields in the TERM structure.
X`09  (TTwatchfd, TTun\0D07): New macros for calling the watch/\2D07
X`09  functions.
X`09+ makefile.in (watch.c, \0906o): Added to the appropriate targets.
X`09+ api.c (linsert_chars): Made more efficient.  Handle newlines
X`09  at end of buffer properly.
X`09  (api_gotoline): Allow DOT to be position at end of buffer.
X`09  (api_motion): Fixed bug which was calling early return.  (Thanks
X`09  to Sean Ahern for finding this one.)
X`09  (api_swscreen): Detach/reattach fake windows.
X`09  (api_update): New function.
X`09  (propagate_dot): New function.
X`09  (api_command_cleanup): Call propagate_dot; don't do this work
X`09  directly anymore.
X`09+ api.h (api_update): Declared.
X`09+ buffer.c (rename\1006): New function.
X`09  (namebuffer): Moved some of the functionality to re\320A.
X`09  Call renamebuffer to do the work.
X`09+ perl.xs (GIMME_V, G_VOID): Define in terms of GIMME and G_SCALAR
X`09  if not already defined.  (Thanks to Brendan O'Dea for pointing
X`09  this out.)
X`09  (perl): Don't do initializations/cleanups of Vile::current_buffer
X`09  if called recursively.
X`09  (perl_init): Cause Vile::Buffer::PRINTF to be defined.
X`09  (svcurbuf_set): Put return statement in.
X`09  (stringify_coderef, perl_free_callback, svgetline\0B07region,
X`09  svgettors): New functions.
X`09  (INITMESSAGE, END\0C07): Removed these nvi remnants.
X`09  (PRINT): Handle input record separator and\1B07fiel\1A0B.
X`09  (READLINE): Rewritten to handle the record separator correctly;
X`09  call svgetline,\0B06region, or\1B06tors as appropriate.
X`09  (attribute_cntl_a_sequences): Pass the region shape when calling
X`09  attribute_cntl_a_sequences_over_region().
X`09  (fetch, attribute, buffername, filename): New methods.
X`09  (Warn): Minor cleanup.
X`09  (mlreply, \0907_no_opts\110Afile\1F0Adir):  Allow
X`09  either a TRUE or FALSE status to set the return value to a
X`09  string.  The other status codes cause undef to be returned.
X`09  Thanks to Brendan O'Dea for diagnosis and patch.
X`09  (command): Adjust the way docmd is called to match new extra
X`09  parameter introduced in patch t (or thereabouts).
X`09  (keystroke, working, update, watchfd, un\0B07) New methods.
X`09  Also throughout this file (perl.xs), there was a lot of minor
X`09  reformatting.  A few new comments were even added.
X`09+ proto.h (renamebuffer, attributeregion_over_\0C06, null_t_watchfd,
X`09  null_t_unwatchfd, \0909\140Bdowatchcallback,
X`09  detach_fake_windows, reat\1711): Declared.
X`09  (attribute_cntl_a_sequences_over_region): New parameter.
X`09+ select.c (attributeregion_over_\0C06): New function.
X`09  (attribute_cntl_a_sequences_over_region): New parameter for passing
X`09  the shape of the region.  Us\1A08parameter for setting\2907
X`09  up properly.
X`09+ shell.pl, tailf.pl: New example perl scripts.  Not really complete
X`09  yet, but they demo some of the new facilities.  (Maybe we should
X`09  create a demo directory?)
X`09+ watch.c: New file containing fd\2006ing framework.  Will probably
X`09  add timer management here as well.
X`09+ window.c (detach_fake_\1606s, reat\1711): New functions.
X`09  Actually, I'm not convinced anymore that this is the right way to
X`09  do it and these will probably go away.
X`09+ x11.c (x_watchfd, x_un\0D09watched_input_callback): New
X`09  functions.
X
X (tom) 980417 (t)
X`09+ modify interface of 'docmd()' to allow caller to set clexec,\1C06ing
X`09  menu.c to invoke this and cause commands to prompt interactively.
X`09+ modify 'get_executable_dir()' to use 'flook\1107deduce xvile's
X`09  location, so that new_vile menu-entry works when the full path is not
X`09  given (reported by Lance Heller <lheller@dart.wcom.com>).
X`09+ restore search-behavior on DOS, NT and OS/2 for startup file.  These
X`09  systems have no $HOME, so we look along the $PATH.
X`09+ correct/extend configure test for isready_c macro:  add a case for
X`09  UWIN, check for end of list, add a definition for SYS_WINNT.
X
X (tom) 980414 (s)
X `09+ correct change to dofile in 7.3o, which caused vile to discard
X`09  the startup file after processing it if it were specified on the
X`09  command-line (reported by Sean Ahern, some input by Brendan O'Dea).
X`09+ modify configure script, adding test for stdio structs that control
X`09  the isready_c macro, making this handle the case for SCO UW ver 7
X`09  (requested by Clark Morgan).
X`09+ modify configure script to add Perl's link-prefix (patch by Brendan
X`09  O'Dea).
X`09> patch by Clark Morgan:
X`09+ turn OPT_W32PIPES on (I modified to condition it on SYS_WINNT).
X`09+ add entry to error finder to support perl 5 diagnostics
X`09+ create temporary filenames in w32pipe.c with an API that
X`09  preferentially honors the current settings of TMP and TEMP.
X`09+ add back Win32-specific comments to c-filt.c
X`09+ fix a bug in c-filt.c that caused coloring to go south if a string
X`09  literal ended with `5C`5C.  E.g., the statement:
X`09`09char *x = "`5C`5C";
X`09  would cause almost all syntax coloring following this var declaration
X`09  to fail.
X
X (tom) 980412 (r)
X `09+ modify configure script and makefile.in to allow for DOS-style
X`09  suffixes (e.g., ".exe"), needed for OS/2 EMX.
X `09+ fix pathname support for OS/2 EMX by allowing MS-DOS-style drive
X`09  letters (estruct.h, path.c).
X `09+ suppress 'working...' message while writing to a pipe (reported by
X`09  Clark Morgan).
X `09+ add rule to make c-filt\0F08file.djg
X `09+ add writePipe() function to make MS-DOS version able to write to a
X`09  pipe.
X`09+ use backslash-form for path in c-filt.c on Win32 (Clark Morgan).
X`09> clipboard support for vile/winvile under Win32 (Clark Morgan):
X`09+ Permits Win32 users to copy the unnamed register contents to the
X`09  Windows clipboard.  Functionality is bound to Alt+Insert.
X`09+ Adds stubs for two additional clipboard-related features.  Stubs are
X`09  bound to Ctl+Insert and Shift\1107.
X`09+ Adds a new Win32 source file (w32cbrd.c).
X`09+ Revises the "Win32 specifics" section of the help file to talk about
X`09  Win32 features.
X`09> new implementation of w32pipe.c (Clark Morgan):
X`09+ reset ukb to zero in filterregion() to avoid having insfile() insert
X`09  file/pipe input into a kill register, rather than the current buffer
X`09  on platforms where softfork() is faked.
X`09+ w32pipe.c module documentation lists limi\1107of native win32
X`09  pipes.
X`09+ winvile.exe and \0D0Are now built with thread-safe libraries,
X`09  because
X`09+ spawn.c's filterregion() routine has been modified to create separate
X`09  writer and reader threads in a Win32 env.
X
X (kev) 980409 (q)
X`09+ api.c (api_setup_fake_win): Added another parameter to this
X`09  function which controls whether the deferred deletes get
X`09  done or not.  Fixed all callers.
X`09  (api_dotinsert, \0F07gline\0E06setup_fake_win\2206bp2vbp,
X`09  api_command_cleanup): Added code for doing deferred deletes.
X`09  (api_delregion, api_motion): New functions.
X`09  (api_edit): Rewritten to better deal with anonymous buffers.
X`09  (api_swscreen): Permit oldsp to be NULL.
X`09+ api.c, api.h, perl.xs (SCR, VileBuf): Renamed SCR to\1908.
X`09  Other renamings done as well so that names of local variables
X`09  make more sense.
X`09  (api_dotgline, READ): Added new (output) parameter to
X`09  api_dotgline which indicates if a newline is needed or not.
X`09+ map.c, proto.h (mapped_ungotc_avail): New function.
X`09+ perl.xs (svStartLine, svStop\0C09creenId, svcurscr):
X`09  Eliminated these static globals.  More importantly, this
X`09  means that $VI::StartLine,\1008op\0F0CcreenId,
X`09  and $curscr are no longer available from perl.
X`09  (svcurbuf): New static global which plays a similar role to
X`09  the now defunct svcurscr.
X`09  (svcurbuf_accessors): new static global variable.
X`09  (newVBrv): Renamed from newVIrv.  Also, no blesses the object
X`09  it creates into Vile::Buffer instead of VI.
X`09  (perl): Don't call getregion unless haver\1206is non-NULL.
X`09  Fixes a nasty infinite loop bug in getregion().  Also
X`09  removed initialization of svStartLine, svStop\0C06etc.
X`09  (VI, Vile\0606::Buffer): The VI package is no more.  Everything
X`09  has been renamed to go into either the Vile package or the
X`09  Vile::Buffer package.
X`09  (svcurbuf_set): Magically called when $Vile::current_buffer gets
X`09  set.
X`09  (perl_init): Nuked references to svStartLine, svStop\0C06etc.
X`09  Also added magic to svcurbuf so that\1109_set is called
X`09  whenever $vile::current_buffer is assigned to from Perl.
X`09  (perl_eval): Or'd in the G_KEEPERR flag\1608call to
X`09  perl_eval_sv.  The lack of this flag was preventing error messages
X`09  from getting printed.
X`09  (current_buffer): New method in both Vile and Vile::Buffer.
X`09  (Msg, AppendLine, Del\0906Get\0909Lines, S\1308Inser\1F06
X`09  LastLine, SwitchScreen): Nuked.
X`09  (PRINT, READLINE): Documented.
X`09  (insert): Alias for PRINT.
X`09  (new, edit): edit is an alias for new and new was renamed from Edit.
X`09  (setregion): Documentation updates; motions as \2B06s.
X`09  (delete, motion): New methods.
X`09  (command): Now a method in both Vile and Vile::Buffer.
X`09+ ptypemap (T_VileBuf): Renamed from T_VI.  Slight change in message
X`09  when buffer no longer exists.
X`09+ region.c (get\0D06): Prevent infinite loop when MK and DOT are in
X`09  different buffers.  Print a BUG: message when this happens.
X`09+ select.c (sel_extend): Added FIXME comment at approximate place in
X`09  the code where we should check to make sure DOT and MK are in the
X`09  same buffer.  (BTW, to reproduce this bug (where they aren't the
X`09  same), get into xvile, split the screen and put a different buffer
X`09  in each. Now click with the mouse twice, very rapidly, each\2F06
X`09  falling on alternate sides of the middle mode line.  After doing
X`09  this, DOT will be in one buffer and MK in the other.  There's
X`09  probably other places that need to fixed too.
X`09+ x11.c (x_preparse_args): When adding the event handler, for
X`09  x_process_event, or in (Button1MotionMask `7C \14063\140A)
X`09  instead of ButtonMotionMask.  It seems that my X server on linux
X`09  generates motion events regardless of whether any mouse buttons
X`09  are pressed when ButtonMotionMask is used.  I think this is
X`09  actually a bug in the X server, but the above is a more precise
X`09  way of saying what we really want to do anyway.
X
X (kev) 980403 (p)
X`09+ hgrep.pl, glob2re.pl, visit.pl: New files which implement
X`09  a recursive grep with hypertext links in perl.
X `09+ api.c (api_command_cleanup): Fixed bug in which DOT
X`09  was being propogated to the fake windows instead of
X`09  the real ones.  (Which is a pretty useless thing to do.)
X`09  (api_swscreen): Added big comment noting problems with
X`09  calling api_command_cleanup.
X`09+ cmdtbl (exechypercmd, show\0E0Aoperattrhc): New
X`09  commands related to hypertext\1E09.
X`09+ estruct.h (AREGION): Added new field ar_hypercmd which
X`09  points at a hypertext command.
X`09+ select.c (hypercmd): New static variable used to communicate
X`09  the hypertext command string to attributeregion().
X`09  (free_attribs, \0E0B, sel_begin, selectregion,
X`09  attribute_region): All modified slightly to deal with the
X`09  new ar_hypercmd field in the AREGION structure.
X`09  (attribute_cntl_a_sequences): Look for an H followed by
X`09  the hypertext command, followed by a null character in
X`09  the `5EA sequences.
+-+-+-+-+-+-+-+-  END  OF PART 13 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 14 -+-+-+-+-+-+-+-+
X`09  (attributehyperregion, operattrhc, hyperspray, doexechypercmd,
X`09  exechypercmd, doshow\100A\0E0C): New functions.
X`09+ vile.hlp: Added new sections "Writing your own filters" and
X`09  "Hypertext".
X`09+ x11.c (multi_click): Added code to execute hypertext command,
X`09  when present, on a double click.
X
X (tom) 980331 (o)
X `09+ change logic that determines whether to set dos mode for a file so
X`09  that .vilerc (or vile.rc) and source'd files are treated specially.
X`09  For those files, all lines must end with `5EM's to set dos mode
X`09  automatically when they are read.  This will reduce the chances of
X`09  trimming `5EM's from map commands.
X`09+ modify dofile() function, used to load/execute .vilerc and source'd
X`09  files, to check first for buffer with the same filename.  This fixes
X`09  a problem which would cause vile to allocate more than one buffer for
X`09  .vilerc when an error is encountered.
X`09+ use new function tb_insert() rather than tb_put() to \2106 strings
X`09  for expand-chars.  The tb_put() function truncates the buffer at the
X`09  location of the new character, and does not work well for inline
X`09  editing.
X
X (kev) 980330 (n)
X `09+ api.c (api_gotoline): Make sure that we can move off of
X`09  buf_head if presently on it.  (This fixes a bug in which
X`09  it was sometimes impossible to move dot.  setrange also
X`09  exhibited a similar bug.)
X`09+ cmdtbl (perl): Allow perl to be run in view mode.
X`09+ perl.xs (perl): Set/restore clexec, discmd, and isnamedcmd
X`09  so that calls to the various mlreply functions will work
X`09  from within perl.  (Thanks to Sean Ahern for bug reports
X`09  and patches.)
X`09  (perl_init): Call lengthen_path to expand `7E to the user's
X`09  home directory.  (Thanks again to Sean Ahern for bug
X`09  reports and patches.)
X`09  (sv2linenum, sv2offset): New functions for converting
X`09  '$' and '$$' to either line number or offsets within
X`09  lines.
X`09  (VileCommand): Renamed to c\1506.
X`09  (inplace_edit, setregion, dot, mlreply\0909_no_opts,
X`09  mlreply_file,\0E09dir): Added documentation.
X`09  (setregion, dot): Handle '$' and '$$'.
X`09  (setregion): Return the buffer object in a scalar context.
X`09  (attribute_cntl_a_sequences, unmark): New functions.
X`09+ proto.h (attribute_cntl_a_sequences_over_region): Declared.
X`09+ select.c (attribute_cntl_a_sequences_over_region): New
X`09  function.
X
X (kev) 980324 (m)
X`09+ api.h (dot_changed): New field in SCR structure.
X `09+ api.c (api_gotoline): Prevent enormous amounts of looping
X`09  for outrageous count values.
X`09  (api_dotgline): Fixed bug which caused <$curscr> operator
X`09  to go into infinite loop.
X`09  (api_command_cleanup): Added code for propagating DOT.
X`09  (api_bp2sp): Initialize dot_changed field.
X`09+ perl.xs (perl_init): Add our own search paths to @INC.
X`09  (dot): New method for getting/s\0806 DOT.
X`09  (GetUserInput): Removed.
X`09+ proto.h (is_fake_win): Declared.
X`09+ window.c (is_fake_win): New function.
X
X (kev) 980321 (l)
X `09+ api.c (api_setup_fake_win, api_dotgline\0E06command_cleanup,
X`09  api_bp2sp):  Rearranged initialization of DOT so that it will
X`09  be done conditionally in api_dotgline.  This fixes a nasty
X`09  bug in which lines could get added to the wrong buffer.  It
X`09  also allows perl functions to be written which look at the
X`09  current location of DOT and possibly do something with it.
X`09  Before, we were always setting it to the start of the region
X`09  (which may not have a lot of relevance).
X`09+ api.h (SCR): New field dot_inited.
X`09+ perl.xs (setregion): Set dot_inited field.
X`09+ x11.c (atom_CLIPBOARD, x_preparse_args): New atom; initialize.
X`09  (x_get_selection, x_paste\130Eget_clipboard_text,
X`09  x_convert_selection, x_lose\120Cown\210B
X`09  x_own_selection, copy_to_clipboard, paste_from\160B
X`09  x_process_event): Handle CLIPBOARD selections as well as
X`09  primary selections.
X`09+ cmdtbl (copy_to_clipboard, paste_from\160A): New
X`09  commands.
X`09+ estruct.h (CLIP_KREG): New kill register.
X`09  (NKREGS, SEL_KREG, KEYST_KREG): Renumbered to account for
X`09  new kill register, CLIP_KREG.
X`09+ line.c (index2reg): Represent the clipboard kill register
X`09  with a ';'.
X`09+ vile.hlp: New documentation about X11 CLIPBOARD selections.
X
X (tom) 980321 (k)
X`09+ correct logic in tcap.c so that visual-matches works for a specific
X`09  color (reported by Kuntal M. Daftary).
X `09+ add test for Xp library, needed to link with RedHat Motif 2.1
X`09  (reported by Richard <rruth@studio.disney.com>).
X`09+ add configure option --with-startup-path to allow installer to
X`09  customize the $startup-path used by vile.
X`09+ change Unix lib directory (i.e., location of vile.hlp) to
X`09  $(prefix)/shared/vile.  The older location, $(exec_\3108lib, is
X`09  still in the $startup-path, but vile.hlp will not be installed
X`09  there.
X`09+ remove config.cache at the start of\1D07ure script, since we use it
X`09  only for problem reporting.
X`09+ ifdef'd out w32pipe code, but make it available for further
X`09  development as OPT_W32PIPES (recommended by Clark Morgan).
X`09+ minor fixes/resync for configure macros CF_CHECK_ERRNO,
X`09  CF_DISABLE_ECHO, CF_FIND_LIBRARY, CF_NCURSES_LIBS and
X`09  CF_NCURSES_VERSION.
X
X (kev) 980320 (j)
X `09+ api.c (linsert_chars): Rewritten both for efficiency and
X`09  so that the MARK \0C07end of the region stays put when
X`09  doing something like:
X
X`09`09$curscr->inplace_edit(1);
X`09`09while (<$curscr>) `7B s/foo/bar/g; print; `7D
X
X`09  (setup_fake_win): No longer static.  Renamed to
X`09  api_setup_fake_win.  Also set DOT here to the beginning of
X`09  the region.
X`09  (api_mark_iterator): New function.
X`09  (api_gotoline): No longer static.  Also renamed from
X`09  _api_gotoline.  Fixed all callers.
X`09  (api_dotinsert, \0F07gline): New functions.
X`09  (api_bp2sp): Initialize the region beginning and end
X`09  to point to something valid.
X`09+ api.h (SCR): Added new fields region,\0807shape, and
X`09  inplace_edit.
X`09  (api_dotinsert, \0F07gline\0E06goto\0E0Asetup_fake_win):
X`09  Added declarations.
X`09+ cmdtbl (perldo): New command.
X`09+ estruct.h (api_do_mark_iterate_helper): New macro.
X`09  (do_mark_iterate): Invoke api_\1D0F_helper in order
X`09  fix the the marks in the SCR structure region.
X`09+ perl.xs (newVIrv): Make the references to SCR objects that
X`09  we give perl refer to globs instead of a scalar.  Bury
X`09  the scalar in\0E0Cportion of the glob.  The reason
X`09  we do this is so that these references may be used as
X`09  filehandles as well as objects.
X`09  (perl_free_handle): Slight change to account for extra
X`09  levels of indirection to get to the thing we really have
X`09  to zero out.
X`09  (perl): Added calls to hst_flush() and hst_init() in order
X`09  to prevent user input from a perl command\1406being added
X`09  to the history line for the perl command.  (It was simply
X`09  getting appended on the end.)  Unfortunately, this input
X`09  doesn't seem to be recorded in the history any longer, but
X`09  at least it doesn't mess up the perl command.
X`09    Also rewrote the code for setting up a region, making sure
X`09  that the new fields in the SCR structure are initialized
X`09  appropriatedly.
X`09  (replace_line, perldo): New functions.
X`09  (perl_init): Tie STDIN to read from the minibuffer.  Modified
X`09  other tie statements (calls to sv_magic()) slightly to do
X`09  the same thing.
X`09  (Msg): No longer an alias for PRINT.
X`09  (PRINT): New method which handles both buffers and STDOUT
X`09  and STDERR.
X`09  (READLINE): New method which will either read a line from
X`09  a buffer or fetch input from the user via mlreply_no_opts().
X`09  When it reads from a buffer, it has the potential to read
X`09  multiple lines if used in an array context.
X`09  (VileCommand): New method which runs an arbitrary vile
X`09  command.  I'll probably rename this one -- don't like
X`09  the caps.
X`09  (inplace_edit, setregion): New methods which set/get fields
X`09  from the SCR structure.
X`09  (GetUserInput): Will probably go away.  This was my first
X`09  attempt at a mechanism for fetching user input.
X`09  (mlreply, \0907_no_opts\110Afile\1F0Adir): Various
X`09  methods for fetching user input from the message line.
X`09+ ptypemap (T_VI): Account for the fact that our objects may
X`09  also now be considered as filehandles.  (The references now
X`09  refer to globs instead of scalars.  The\0E07 is still there,
X`09  but it's just stuck inside the glob.)
X
X (tom) 980317 (i)
X`09+ remove binding of quote-next-character to `5EV (reported by Keith
X`09  Williams <kurris@hotmail.com>, recommended by Paul Fox).
X `09+ add an AIX-specific pattern to finderr.c (patch by Michael Finken
X`09  <finken@conware.de>).
X`09+ correct w32pipe.c to re-open stdin on the first available descriptor
X`09  (i.e., 0) when cleaning up after a filter operation (patch by Clark
X`09  Morgan).
X
X (tom) 980316 (h)
X `09+ correct logic that shifts minibuffer back on return from kbd_reply,
X`09  had not set curwp.
X
X (pgf) 980315 (g)
X`09+ documentation and usage improvements for vile-crypt, in crypt.c,
X`09  vile.hlp, and\0E061.
X
X (tom)`09980314 (f)
X `09+ add "attribute-reverse-til" (suggested by Kuntal M. Daftary
X`09  daftary@cisco.com).
X `09+ correct logic of find_mode() so that :setl cts=4 works as before.
X`09+ modify kbd_reply() to support inline-editing of the user's text, both
X`09  by arrow keys, as well as vi-style motion commands.  Use `5EG to toggle
X`09  between the two modes.
X`09+ change interfaces/logic of hst_append(), kbd_show_response(),
X`09  kbd_reply() to make them accept nulls.  This is for later extensions,
X`09  since regexp.c does not handle nulls.  Use the mask KBD_0CHAR for
X`09  this purpose.
X`09+ modify check for type-ahead to make 'showmatch' skip the 1/4 sleep,
X`09  ignoring the current value of 'smoothscroll' (reported by Matthias K.
X`09  Buelow <token@wicx50.informatik.uni-wuerzburg.de>)
X `09+ adjust redefinition of WINDOW in tcap.h to work around OSF1 3.2,
X`09  which includes curses.h from term.h
X `09+ split-out function ntcons_reopen() from ntk\0F06, to move it past
X`09  the pressreturn() call; otherwise the user sees no prompt when
X`09  running a shell command (reported by Manoj Bhargaw <Manoj@Proginet.com>).
V
X`09+ minor adjustments to 'w32pipe' by moving some code into \2207.c to
X`09  allow reuse in the GUI winvile, and using $shell rather than inline
X`09  expressions for shell spawned in pipes.  Testing with bash did not
X`09  seem to allow /bin/sh as a possible shell, so I dropped that from
X`09  Clark's patch.
X `09+ improve pipes for W95/WinNT using native support, new mode 'w32pipe'
X`09  (patch by Clark Morgan).
X
X (pgf)`09980218 (e)
X`09+ added "crypt-til" operator (bound to `5EX-C) which will
X`09  encrypt/decrypt an arbitrary region.  the main goal was to make
X`09  it easy to read a previously encrypted file and decrypt it for
X`09  reading, or to read a clear file, and quickly encrypt it before
X`09  writing it.  i find crypt mode to be cumbersome at best --\2E07
X`09  the explicit command to be more useful.
X`09+ modified crypt.c to allow building it as standalone utility.
X`09  this gets built as vile-crypt, and it's compatible with the crypt
X`09  command inside of vile (if used over an entire buffer).  usage
X`09  is:
X`09    vile-crypt `5B-m`5D `5B-k crypt-key `5D `5Bfile ...`5D
X`09  if '-k crypt-key' is omitted you will be prompted instead, and
X`09  '-m' leaves text to the first blank-line intact, which i find
X`09  useful for encrypting individually stored mail messages.  the
X`09  en/decrypted text appears on stdout.
X`09+ attempted to document vile's encryption features in vile.hlp.
X
X (tom)`09980208 (d)
X `09+ reformatted proto.h, ordering\1206types alphabetically.
X `09+ make column shown by `5EG the same as for the ruler (reported by David
X`09  Letcher <David_\0F07@writeme.com>).
X `09+ add command show-printable to show exactly what vile does with the
X`09  character classes.
X `09+ newer autoconf configure macro circumvents problems generating
X`09  config.h due to limited sed buffer size on antiquated systems (e.g.,
X`09  HP-UX 9.x, SCO 3.x).
X `09+ updated configure test, to avoid use of broken IRIX 6.2 nsl library.
X`09+ add configure option --with-locale to allow use of i18n support via
X`09  setlocale function.
X`09+ use new symbol SYS_OS2_EMX to avoid nonstandard use of 'defined'
X`09  keyword in OPT_CASELESS preprocessor expression (reported by Adam
X`09  Denton).
X`09+ move the call that forks xvile up to the first place where it could
X`09  be used, to minimize data space.
X
X (tom)`09971219 (c)
X`09+ correction to CF_CURSES_TERMCAP configure test so that SVr4 systems
X`09  that do not have a prototype for tgoto, but still require curses.h
X`09  will build properly (patch by Brendan O'Dea).
X
X (tom)`09971218 (b)
X `09+ add configure-test to see if $LIBS already contains termcap functions
X`09  before looking for additional libraries.
X `09+ amended CF_CURSES_TERMCAP and CF_TYPE_OUTCHAR tests to use vile's
X`09  headers (correcting symbol conflict with NL in estruct.h vs curses.h),
X`09  and to double-check that failure to link test with tgoto was
X`09  due to conflict with prototype (latter reported by Brendan O'Dea).
X
X (tom)`09971217 (a)
X `09+ add CF_CURSES_TERMCAP macro to test for prototypes in curses.h vs
X`09  termcap.h
X `09+ add variable $patchlevel.
X `09+ updated README.CFG to list the newer options (reported by Ralphe
X`09  Neill <ran@alumni.dgs.monash.edu.au>).
X `09+ use CF_SIZECHANGE macro to eliminate a SCO-related hack in configure.
X `09+ interpret --with-x option in configure-script (reported by Paul Fox).
X `09+ add/use TYPECAST macro to quiet the "harmless" const warnings.
X `09+ modify CF_IMAKE_CFLAGS macro to work with SGI's imake\1F06s which
X`09  combine the -I/usr/include and -nostdinc options, confusing gcc
X`09  (reported by Billy Little <billy_little@hso.link.com>).
X`09+ fixes for Perl-related rules in makefile.in (patch by Brendan O'Dea).
X
XChanges for vile 7.3 (released Mon Dec 8, 1997)
X
X (tom)`09971207 (t)
X `09+ correct include-path for configure script's check for missing
X`09  externs, to work with --srcdir option (analysis by Kevin Buettner).
X
X (tom)`09971205 (s)
X `09+ add logic to configure.in to use a filter (installed by td_lib)
X`09  named 'td_config' which works around limited 'sed' when constructing
X`09  config.h on SCO 3.x, HP-UX 9.x and other antiquated platforms.
X `09+ add configure options --disable-extensions (SMALLER, FEWNAMES) and
X`09  --disable-shell (OPT_SHELL), and --with-dmalloc.  The \2C06option is
X`09  experimental; note that a genuinely secure editor should not allow
X`09  directory names to be specified (but I think that's the only omission).
X`09+ add fallback for tparam/tparm in tcap.c (for EMX, but usable for
X`09  genuine termcap systems such as SunOS 4.x), to support color.
X`09+ add files for building termcap version on OS/2 with EMX
X`09  (makefile.emx, config.emx and os2keys.h).
X `09+ change $shell to use $COMSPEC on OS/2, MS-DOS, etc.  This is needed
X`09  for the OS/2 EMX configuration, but useful in the others.
X `09+ modify configure script to use ifdef's in estruct.h when testing
X`09  for missing extern/prototype declarations rather than a separate
X`09  list in aclocal.m4 (this requires rebuild/test on most platforms).
X`09+ combine configure-tests for errno, sys_nerr and sys_errlist.
X`09+ minor fixes:  new versions of CF_NCURSES_LIBS, CF_ADD_INCDIR,
X`09  CF_CHECK_CACHE, CF_NCURSES_CPPFLAGS.
X`09+ correct handling of :map containing ".", which was being handled
X`09  as if the "." always appeared at the end (patch by Duncan Sargeant;
X`09  input.c, map.c).
X
X (kev)  971203 (r)
X`09+ api.c (lreplace): Fix marks up.  This won't always be right,
X`09  but at least it'll be closer.  We need a way to modify marks
X`09  and attributes from perl.
X`09  (setup_fake_win): changed return type to int.
X`09  (api_fscreen, api_edit\0A06sw\180Cbp2sp): new functions.
X`09  (sp2bp, bp2sp): Removed these macros.
X`09+ api.h (api_swscreen, api_f\0D0Cbp2sp): declared these
X`09  functions.
X`09  (sp2bp, bp2sp): macros moved from api.c.
X`09+ configure.in (LINK_PREFIX): set this variable.  (From Brendan
X`09  O'Dea.)
X`09  (CFLAGS, LIBS): Use $perl_bin_path instead of perl in the
X`09  --with-perl section.
X`09+ makefile.in (LINK): Prepend LINK_PREFIX as determined by
X`09  configure to the link command.  (From Brendan O'Dea.)
X`09+ perl.xs (newVIrv): Don't allocate api private part here. (It's
X`09  allocated in api_bp2sp now.)  The second parameter has also
X`09  changed;\0908 all callers.
X`09  (perl): Print error messages and warnings to\1908 line.
X`09  (perl_init): Setup warning handler.  Also tie STDOUT and STDERR
X`09  so that output to these filehandles will be printed on the
X`09  message line.  (Thanks to Brendan O'Dea.)
X`09  (perl_eval): New function.
X`09  (Msg): Rewritten to handle multiple arguments. (From Brendan O'Dea.)
X`09  (GetLines): new function which fetches all lines in the range.
X`09  (Edit, FindScreen, Switch\0E08Warn): New functions.
X`09+ proto.h (perl_free_private): removed.
X`09  (perl_free_handle): added.
X`09+ ptypemap (T_VI): Translate C null pointers to perl undefs.
X
X (tom)`09971128 (q)
X`09+ modify tagignorecase mode to use lowercased keys in the binary-tree,
X`09  and applying tagignorecase mode to the search within the tagged file,
X`09  making this behave as Joseph F. Garvey requested.
X `09+ implement tags-completion.
X`09+ replace Alex Wetmore's binary tree code with a balanced\210C
X`09  module that's a little more general, and does deletion\2006rapidly
X`09  than my first try.
X `09+ minor fixes for foreground/back\0B06 colors when resizing terminal
X`09  window so minibuffer is painted correctly (display.c, ntconio.c).
X `09+ rename ntvile to winvile.
X
X (tom)`09971112 (p)
X `09+ correct logic for minibuffer by ensuring that it is not marked for
X`09  undo, and that the value of MK is save/restored when modifying
X`09  the minibuffer.
X
X (tom)`09971109 (o)
X `09+ correct range of scrolling region in ansi.c
X `09+ correct treatment in xshell.sh for no-arguments.
X `09+ change TTrev() / TTattr() parameter to unsigned.
X `09+ implement mouse and flash in OS/2 VIO driver (os2vio.c).
X `09+ correct logic in vtputc() to prevent minibuffer from writing into the
X`09  lower-right corner of the screen.
X
X (tom)`09971108 (n)
X `09+ more CSet unsigned/\0706 compiler warning fixes (estruct.h)
X `09+ don't reopen terminal in ansi.c if it is already open.
X `09+ correct handling of rename-buffer when it is a scratch \1C07that
X`09  does not happen to be a stored procedure.
X`09+ recorrect lookup_namebst() call in engl2fnc(); it should always allow
X`09  partial match.  Fixed by adding a third mode where the lexical first
X`09  match will be returned rather than the middle one in a range.
X `09+ correct tab-position in ntconio.c
X `09+ modify borland.c to reset colors when exiting or running a shell.
X`09+ change tcapkopen() to reflect possibility that terminal
X`09  initialization string moves the cursor.
X `09+ add simple gui terminal driver for WinNT (ntwinio.c, makefile.wnt).
X`09  Built with Microsoft Visual C++ 4.1, both with IDE and makefile.wnt.
X`09  Use "nmake -f makefile.wnt cfg=ntvile".
X`09+ integrated related patch by Clark Morgan for repainting the screen
X`09  correctly after a :stop command.
X `09+ rewrote internals of command/message line to make it a one-line
X`09  minibuffer, including mods for OPT_RAMSIZE and OPT_WORKING.  Tested
X`09  Linux (for tcap.c, x11.c, ansi.c), OS/2 (os2vio.c), WinNT (ntconio.c,
X`09  ntwinio.c), VMS (vmsvt.c), djgpp (borland.c).
X
X (tom)`09971028 (m)
X`09+ correct inverted parameter in call on lookup_namebst().
X`09+ compiler warnings from Solaris (unsigned vs \0A07in bind.c, ifdef
X`09  in trace.c).
X`09+ minor changes to compile on OS/2 with EMX.
X`09+ modify borland.c to reset colors to white/black on exit.
X
X (tom)`09971027 (l)
X`09+ backout change to own_selection, since it doesn't follow ICCCM,
X`09  in the sense that it increases X traffic needlessly (pointed out by
X`09  Kevin Buettner).  Kept check on return value from XtOwnSelection.
X `09+ correct out-of-bounds indexing in dname_to_dirnum() by adding a
X`09  length parameter, use memcmp.
X `09+ modify Alex's change so that buffers that are renamed or deleted
X`09  update the corresponding entries in the binary-tree.  Also, don't
X`09  allow built-in commands to be removed or replaced.  Finally, make the
X`09  name-completion work with an empty command.
X`09+ add $end-of-cmd variable (patch by Alex Wetmore).
X`09+ integrate patch by Alex Wetmore <aw\0A06@Exchange.Microsoft.com>
X`09  that makes stored procedures act just like built-in commands, i.e.,
X`09  able to run them from the :  prompt.  This works by building a binary
X`09  tree of all of the command and procedure names.
X
X (tom)`09971015 (k)
X`09+ add configure options --with-Xaw-scrollbars and
X`09  --with-drag-extension.  These make it easy to build xvile with
X`09  Kevin's scrollbars by specifying --without-Xaw-\270A, or to use
X`09  the Xaw's default translations for scrollbars by specifing
X`09  --without-drag-extension.
X`09+ ifdef'd out the code that invokes $xshell in ":!command".
X`09+ correct logic in xvile that spawns a new instance from menu entry,
X`09  was leaving a zombie when the new instance closed (reported by Brian
X`09  Moore <bem@cmc.net>).
X`09+ modify own_selection to always try to own the \2306, as well as to
X`09  check the return value from XtOwnSelection (reported by Ian Jamison
X`09  <ianj@quadrics.com>)
X`09+ add Lesstif-specific ifdef for workaround (requested by Larry Gensch).
X`09+ correct ifdef'ing of Motif version of xvile (reported by Larry
X`09  Gensch).
X`09+ add screen types Xol and Xm as aliases for OpenLook and Motif.
X`09+ correct quoting in configure script for OpenLook case.
X`09+ fix some compiler warnings and add 'make check' target (reported by
X`09  Nelson H. F. Beebe <beebe@math.utah.edu>)
X
X (kev)`09971013 (j)
X `09+ perl.xs, ptypemap: Lots of new code which extends the perl
X `09  interface a bit more.
X `09+ api.c, api.h: New files which sort of implement nvi's API for
X `09  extension languages.
X `09+ makefile.in (OBJ, VILESRC): Added api.o an\0A06c to these
X `09  lists.
X `09+ estruct.h (BUFFER): Added new field, b_api_private, used by
X `09  the extension language API.
X `09+ buffer.c (FreeBuffer): Free up the extension language API
X `09  related data structure referenced by b_api_private.
X `09  (bfind): Initialize the b_api_private field.
X `09+ cmdtbl (perl): Put in a reasonable set of flags for this
X `09  command.  (It used to be NONE.)
X `09+ exec.c (execute_named_command): Added region support for the
X `09  perl command.
X `09+ proto.h (push_fake_win, pop\0E0Cerl_default_region,
X `09  perl_free_private, api\120D): New prototypes.
X `09+ select.c, window.c (push_fake_win, pop\0E09): These
X `09  functions removed from select.c and put into window.c.  Also
X `09  they are no longer static.
X
X(kev)`09971009 (i)
X`09+ perl.xs, ptypemap:  New files.  Beginnings of perl interface
X`09  for vile.
X`09+ cmdtbl (perl): New command enabled only when --with-perl
X`09  supplied as an option to the configure script.
X`09+ configure.in, makefile.in: perl related changes.
X`09+ (fix typo in xshell.sh - tom)
X
X(tom)`09971008 (h)
X`09+ correct typo in stubbed-out code for $xshell, add $xdisplay and
X`09  example script 'xshell.sh' which can be used to run a shell command
X`09  from xvile, prompting at the end so th\1007output doesn't go away
X`09  when the xterm completes.
X`09+ rename vile's ctype macros to mixed-case to avoid conflict.  This
X`09  is needed for Solaris 2.6, which does not implement ctype as macros.
X`09+ modify casts and some names (e.g., new, operator, class) to allow
X`09  compiling with C++ (tested\1106g++ 2.7.2 on Linux).
X
X(kev)`09971007 (g)
X`09+ x11.c (multi_click): Reimplemented multiclick selections for
X`09  lines.  Previously, it was not possible to select the entirety
X`09  of a wrapped line by clicking on a row other than the first
X`09  row.
X`09+ window.c (mvupwind, only\0A06delwp, splitw, enlargewind,
X`09  shrinkwind):  Make sure that w_line.o is zero just after
X`09  setting w_line.l to a new value.  The lack of this
X`09  assignment in mvupwind() was causing a SEGFAULT on my linux
X`09  box.  `5BTo test it, create a very long wrapped line with a
X`09  bunch of lines (say 100) before it; my test has in excess of
X`09  10,000 characters on the long line.  Make sure linewrap mode
X`09  is set.  Then say 100`5EY\1106 SEGFAULT was immediate.  You
X`09  can also reproduce it by dragging the scrollbar for awhile.`5D
X
X(tom)`09971006 (f)
X`09+ document --with-screen values better in configure --help.
X`09+ implement Athena widget scrollbar support in x11.c, using Kevin's
X`09  dragging support from the no-widget case.
X`09+ add $xshell environment variable, use this to control :sh command
X`09  from xvile.
X`09+ new CF_X_ATHENA configure macro adds\150Boptions --with-Xaw3d
X`09  and --with-neXtaw.
X`09+ corrected CF_IMAKE_CFLAGS, which was not using the imake symbol that
X`09  specified X function prototypes.  (This was old behavior, which did
X`09  not seem to matter until adding Xaw scrollbars on Linux).
X
X(kev)`09971005 (e)
X`09+ basic.c (setwmark): In linewrap mode, account for undisplayed
X`09  rows before the first row shown of a very long wrapped line.
X`09+ display.c (vtset): Don't allow wrapped lines to overflow onto
X`09  the mode line.  I don't think characters from the buffer were
X`09  ever getting written to the modeline, but vteeol() would sometimes
X`09  erase the modeline when displaying very long wrapped lines.
X`09  (reframe): Handle \1107s of long wrapped lines more gracefully.
X`09  In particular, once the top row of a very long wrapped line
X`09  goes off the top, it is now possible to have the cursor positioned
X`09  on somewhere other than the bottom row.  Scrolling up or down
X`09  via right or left \0E06movement within a long wrapped line also
X`09  looks a lot better now.
X`09  (updattrs): Don't attempt to access rows before the top row
X`09  of a window when updating attributes.  Also, don't access
X`09  rows of or below the the mode line.  This fixes a SEGFAULT.
X
X(tom)`09970918 (d)
X`09+ amend logic for find_mode() so that "`26glo cmode" and "`26loc \1106
X`09  work as before majormode changes (reported by Sean Ahern).
X`09+ merge autoconf macros from tin/xterm, which mainly affect the
X`09  configuration tests for ncurses and imake $CFLAGS, used to augment
X`09  autoconf's tests for X Windows.
X`09+ also (since some systems have deficient 'sed' programs) provide
X`09  alternate hook for using a program 'td_config', which is currently
X`09  bundled in td_lib.tgz, that does the sorting operation of config.h in
X`09  a reasonably portable manner.
X`09+ add mode 'maplength' to control the maximum \1F06 of a map
X`09  string.
X`09+ correct definition of OUTC_ARGS for the case where it should be a
X`09  'char' value (patch by Jason Molenda <crash@cygnus.co.jp>).
X
X(tom)`09970907 (c)
X`09+ modify CF_CACHE_CHECK macro to use AC_CANONICAL_HOST to obtain a
X`09  "better" value for SYSTEM_NAME.  This is displayed as part of the
X`09  :version command.  Add config.guess and\1108sub to support this.
X`09+ changes for 7.2b omitted some macros dealing with echoing during the
X`09  make process (reported by Jens Schleusener <Jens.\120B@dlr.de>)
X
X(tom)`09970905 (b)
X`09+ merge configure macros from tin-unoff and lynx (\2A09.in,
X`09  aclocal.m4).
X`09+ rename configure macros to CF_ prefix, for consistency/merge with
X`09  other programs (configure.in, aclocal.m4).
X`09+ correct handling of tparm return-value; it must not be freed, at
X`09  least for SVr4 and ncurses (tcap.c)
X`09+ ensure that majormode names are a legal identifier.
X`09+ modify so that majormode names can be mixed case (requested by
X`09  Sean Ahern).
X
X(tom)`09970904 (a)
X`09+ add variable $majormode so that it can be tested in a script
X`09  (requested by Philippe Chassany).
X`09+ fix potential ifdef problem for cbuf1 (reported by Brendan O'Dea).
X`09+ simplified VMS permissions code, using the protection parameter in
X`09  'open()' to achieve the objective of propagating a file's current
X`09  protection, as well as making it compile with DEC C (reported by
X`09  Simon Hefti <hefti@phim.unibe.ch>).
X
XChanges for vile 7.2 (released Thu Sep 4, 1997)
X
X(tom)`09970903 (k)
X`09+ modify rename-buffer so that if we\1C07 a \1E06, we'll clear the
X`09  flag that marks it for removal when popped-down.
X`09+ modify show-modes command so that it will format more than 3 columns
X`09  if the screen is wide enough.
X`09+ correct logic of delfrommap(), which dumped core when unmapping
X`09  a single-character map (reported by Paul Fox).
X`09+ modify show-majormodes so that giving a count will make it show all
X`09  of the submodes prefixed by the majormode name, e.g., c-suffixes
X`09  (suggested by Paul Fox).
X`09+ modify documentation to use "define-majormode" and "remov\170C
+-+-+-+-+-+-+-+-  END  OF PART 14 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 15 -+-+-+-+-+-+-+-+
X`09  for clarity, other related fixes to documentation (suggested by Paul
X`09  Fox).
X
X(tom)`09970902 (j)
X`09+ correct logic in find_mode() that did not find majormode qualifiers
X`09  for majormodes that began similarly (e.g., "com" masked by "c").
X`09+ correct an uninitialized variable in per_submode(), found by Purify.
X`09+ correct ifdef'ing in tcap.c, from 7.1i, when neither tparm nor
X`09  tparam is found.
X
X(tom)`09970901 (i)
X`09+ if the command-line '@' option is used, set the $startup-file
X`09  variable to correspond to the startup file which is used.
X`09+ add tagignorecase mode, which causes tag searches to be done ignoring
X`09  case (requested by Joseph F. Garvey <garvey@\0706s.raleigh.ibm.com>).
X`09+ initialize last_eolchar in docmd() so that 'set' command works
X`09  properly in a macro.
X`09+ add %B substition for error-buffer regular expressions to allow
X`09  using `5BStandard Input`5D and other scratch buffers as error \1107.
X`09+ modify format-til command to treat '#' specially when in cmode, so
X`09  no whitespace is inserted after it.
X`09+ modify format-til command to support comment-prefix mode and handle
X`09  repeated prefix, so that, for example, vile can now format multiple
X`09  levels of email replies.
X`09+ add comment-prefix mode, which specifies a regular expression that
X`09  controls the portion of a line which is prefixed when formatting.
X`09+ modify default setting of comments mode to make repeated prefix
X`09  match (e.g., "> > >", is different from "> >").
X`09+ ensure that imdying() always exits (reported by Clark Morgan).
X`09+ workaround for incompatible interpretation of termcap Sf/Sb
X`09  capability with BSD vs SYSV platforms (tcap.c).
X
X(tom)`09970829 (h)
X`09+ correct initialization of $palstr on OS/2.
X`09+ correct some of the signed/un\0906 warnings from IBM CSet compiler.
X`09+ remove obsolete autoconf fallback macros.
X`09+ correct handling of ":abbr res RES",\1108wres WRES" combination by
X`09  forcing matches on these to check that the beginning of the match is
X`09  an identifier boundary (reported by Paul Laub <P_Laub@fccc.edu>).
X`09+ correct assignment in maplookup() which caused a -1 returned when no
X`09  more characters were available for matching to be converted to the
X`09  0xFF character.
X`09+ modify fopen-for-write calls on VMS to add "0" argument, which makes
X`09  the new file get the user's default protection (requested by Brian
X`09  Reed <bdreed1@lucent.com>).
X`09+ correct logic that allowed repeated definition of submodes (reported
X`09  by Duncan Sargeant).
X`09+ allow submode names to begin with "no", assuming they are booleans
X`09  (reported by Duncan Sargeant).
X`09+ corrected lookup of hyphenated submodes, e.g., c-tabstop (reported
X`09  by Duncan Sargeant <dunc@ucc.gu.uwa.edu.au>).
X`09+ allow define-submode to accept an '=' between the \2508and its
X`09  value.
X`09+ modify define-mode and remov\1007to suppress warning message if
X`09  the mode does not exist, since this produces unnecessary warnings
X`09  when re-sourcing .vilerc
X`09+ include <windows.h> only where it is needed, halving the build time
X`09  (patch by Clark Morgan).
X`09+ modify configure script to work with CLIX old-style shared libraries
X`09  (e.g., -lc_s) needed for xvile.
X
X(tom)`09970816 (g)
X`09+ correct type mismatch in filec.c when sizeof(size_t) !=
X`09  sizeof(unsigned) (reported by Larry Gensch <gensch@zk3.dec.com>).
X`09+ modify vmsbuild.com to tell MMS (or MMK) to ignore warnings,
X`09  workaround for an inconsistency between versions of DEC C
X`09  (suggested by Andy Harper and Adam Denton).
X`09+ initial implementation of majormodes, which supports grouping of
X`09  buffer modes, together with qualifiers (e.g., cmode and c-suffixes).
X`09  New commands include define-mode,\0D08sub\1006remov\1D07
X`09  remove-submode, list-majormodes.  (Most changes are in mktbls.c and
X`09  modes.c).
X
X(tom)`09970619 (f)
X`09+ modify ":set" command so that it does not force a mode to be set,
X`09  but instead shows the local buffer and window settings.
X`09+ correct missing error-test in logic that sets regular-expression
X`09  modes (reported by Philippe Chassany).
X`09+ add configure option to specify the total numbered macros available,
X`09  e.g., execute-macro-1, ifdef'd with OPT_EXEC_MACROS (requested by
X`09  Philippe Chassany).
X`09+ modify xvile menus to allow arbitrary command line rather than
X`09  bound functions (exec.c, menu.c).
X`09+ correct spurious parameter in vms2unix.c, from 7.1d changes.
X
X(tom)`09970607 (e)
X`09+ modify VMS terminal driver, vmsvt.c, to work when invoked from a
X`09  command-file, i.e., get terminal characteristics from SYS$COMMAND
X`09  rather than SYS$INPUT (reported by Adam Denton).
X`09+ treat '$' as an identifier character on VMS (requested by
X`09  Adam Denton).
X`09+ clarify discussion of color in help-file (patch by Clark Morgan).
X`09+ modify map.c to use TBUFF's, as well as new kbd_reply interface,
X`09  to remove limit on mapped strings.
X`09+ change interface/internals of kbd_reply() to use a TBUFF, so we don't
X`09  need fixed-size buffers any more (bind.c, exec.c, eval.c, history.c,
X`09  input.c, line.c, modes.c).
X`09+ correct uninitialized buffer in loadkreg().
X`09+ correct indexing in display_cursor() function in xvile; exposed when
X`09  displaying a long list for the historical buffer command.
X
X(tom)`09970526 (d)
X`09+ add $ncolors variable to allow run-time modification of the meaning
X`09  of colors (e.g., white).
X`09+ change $palette to a dynamically allocated string.
X`09+ modify termcap and IBM terminal drivers to support 16 colors.  Note
X`09  that the termcap driver can do this only when configured against a
X`09  terminfo library (inspired by a patch from Clark Morgan).
X`09+ modify mktbls to generate the enumerated choices tables (i.e., for
X`09  color, visual-matches) to simplify ifdef'ing these between the
X`09  8-color and 16\0D07configurations.
X`09+ undo some of the const parameters of functions, thereby eliminating
X`09  most of the places where casts were used to remove const.
X`09+ modify VMS processing of tags to strip file's version number
X`09  (adapted from fix by Adam Denton <adenton@genre.com>).
X`09+ modify bclear() to free attributes before removing the buffer's
X`09  lines, thereby making it faster (patch by Ian Jamison).
X
X(tom)`09970513 (c)
X`09+ set local buffer mode for 'dos' in slowreadf(), which fixes the
X`09  problem of that function modifying the global mode when piping a file
X`09  to vile, hence causing syntax errors in vile.rc when it contains
X`09  trailing carriage-returns (file.c) (analysis by Clark Morgan).
X`09+ correct missing VASEL flag that caused 'q' command on OS/2 to not
X`09  display highlighting, missed in 7.0b (os2vio.c) (reported by George
X`09  Eccles <geccles@ibm.net>)
X`09+ implement 'flash' for WinNT (ntconio.c)
X
X(tom)`09970513 (b)
X`09+ ifdef'd menu.c to work with 7.1a
X
X(tom)`09970512 (a)
X`09+ modify has_C_suffix() to ignore case on platforms where filename
X`09  case should be ignored (reported by Emil Rojas <emil@lapel.com>).
X`09+ add version in vmsbuild.com to release_warnings
X`09+ remove unnecessary test for Xaw/SimpleMenu.h (configure.in).
X`09+ improve geometry of Xaw menus using Box (patch by Brendan O'Dea
X`09  <bod@compusol.com.au>)
X`09+ add menu.c to the modules for xvile on VMS (reported by Graeme
X`09  Miller).
X
XChanges for vile 7.1 (released Wed May 8, 1997)
X
X(tom)`09970508 (none)
X`09+ undo a place where I'd dropped an XtVaGetValues() call, since it
X`09  appeared redundant, but was not - affects only Xaw build (x11.c).
X`09+ ifdef'd a test in newscreensize() that is applicable only when
X`09  OPT_WORKING is set; this had broken screen initialization on MS-DOS
X`09  (display.c).
X
X(tom)`09970507 (l)
X`09+ add resource to control menu-height (x11.c, menu.c).
X`09+ correct definition in vms2unix.c to allow compile with VAX C, which
X`09  doesn't like "#define foo xxx.foo".
X
X(tom)`09970430 (k)
X`09+ modify lookup of .vilerc to use startup-file search rules (menu.c)
X`09+ correct missing XmString conversion (menu.c)
X`09+ add configure check for -lXext to support Athena build on X11R4.
X
X(tom)`09970429 (j)
X`09+ use im_waiting() function to reset "working..." state after executing
X`09  a menu-command (menu.c).
X`09+ modify lookup of .vilemenu to use startup-file search rules.
X`09+ corrections for porting Xaw version to SunOS, etc., with X11R4 and
X`09  X11R5 (x11.c, configure.in)
X
X(tom)`09970428 (i)
X`09+ implement Xaw (Athena widget) version of menus.  Simplified buffer
X`09  lookup function for menus, align/document resource names (menu.c,
X`09  x11.c, configure script).
X`09+ correct minor memory leaks during initialization (main.c)
X`09+ correct array-indexing error that caused core dump when selecting
X`09  line-wrapped text, moving cursor up (display.c).
X
X(tom)`09970422 (h)
X`09+ improved example of menus for xvile (Philippe Chassany).
X`09+ correct mistyped index in c-filt.c, which was a char (patch by Ian
X`09  Jamison).
X`09+ correct c-filt.c handling of nested comment delimiters (patch by Ian
X`09  Jamison <ianj@quadrics.com>)
X`09+ correct sign-extension in tcap.c for xterm mouse-coordinates.
X
X(tom)`09970407 (g)
X`09+ add mode 'tagword', which allows user to lookup the whole word rather
X`09  than a substring.  (from Adam Denton <adenton@genre.com>).
X`09+ reintroduce flag 'i_displayed' into 'working' mode (I'd forgotten
X`09  that it suppressed the message until screen-mode).
X`09+ improve buffer-switching in menu-support (patch by Philippe Chassany)
X`09+ correction to MS-DOS, etc., where attempt was made to fclose a file
X`09  pointer that was out of scope (patch by Clark Morgan).
X`09+ modify definition of eql_bname() macro so that buffer names are
X`09  treated as case-insensitive where filenames are, e.g., WinNT and
X`09  OS/2 (patch by Rick Sladkey from report by Clark Morgan).
X`09+ add predefined regular expression to finderr.c to improve support
X`09  for MS-DOS pathnames (patch by Clark Morgan).
X
X(tom)`09970407 (f)
X`09+ integrated menu-support for Motif xvile (patch by Philippe Chassany
X`09  <phil@cln46ks.der.edf.fr>).
X`09+ refined changes to 'working' mode to ensure that the "\2207..."
X`09  message is cleared when the timer elapses.
X
X(kev)`09970407 (e)
X`09+ fileio.c (isready_c): Small tweak to the ifdefs for mklinux w/
X`09  shared libraries.  This'll probably be needed for other systems
X`09  with the up and coming GNU libc as well.
X
X(tom)`09970330 (d)
X`09+ correct missing '`5D' on generated buffer name for shell output, e.g.,
X`09  "`5B!ls`5D" rather than\1406" (reported by Paul Fox): (file.c).
X`09+ correct unnecessary escaping of '!' in prompts that are not expanding
X`09  the shell contents (reported by Paul Fox): (input.c).
X`09+ modify semaphore used by 'working' mode to make the SIGALRM timer
X`09  elapse when it is not in use, allowing idle process to swap out
X`09  properly (reported by Bill Kipp): (display.c, etc).
X`09+ correct filename parsing for MS-DOS/etc configuration by checking
X`09  for device name (patch by Clark Morgan).
X
X(tom)`09970322 (c)
X`09+ fixes for piping to vile in WinNT (patch by Clark Morgan).
X`09+ add logic for visual-matches in color, WinNT (patch by Clark Morgan).
X`09+ add vile-c-filt.exe to makefile.wnt, modify default keyword file
X`09  on that system to vile.keywords (patch by Clark Morgan).
X`09+ correct problem with MS-DOS/Win95/NT version of npopen.c that left
X`09  temp-files after reading from pipe, because file-remove was done
X`09  before closing (patch by Clark Morgan).
X
X(tom)`09970315 (b)
X`09+ use macro GCC_UNUSED throughout to quiet gcc warnings about unused
X`09  (dummy) parameters.
X`09+ modify configure script to use VC_GCC_WARNINGS
X`09+ add mode to control whether formatting adds one or two spaces
X`09  after sentences (patch by Otto Lind).
X`09+ handle C++ comments (patch by Otto Lind <otto.lind@softwire.com>).
X`09+ implement colored attributes in OS/2 video driver (os2vio.c)
X`09+ modify writereg() so that it recomputes the region size after
X`09  invoking the $write-hook; this is necessary since it may change the
X`09  file's size (reported by Bob Wall <wall@vlt.com>).
X
X(tom)`09970314 (a)
X`09+ modify c-filt.c, man\0B06 to simplify compiling w/o auto-configure
X`09  "config.h".
X`09+ modify MS-DOS/Win31/WinNT portion of npopen.c to leave input file
X`09  descriptor alone when reading from pipe, solving a problem with
X`09  applications hanging under Thompson Toolkit (patch by Clark O.
X`09  Morgan <cmorgan@aracnet.com>)
X`09+ correct inequality changed in 6.2g which is part of right-margin
X`09  threshold computation (report and fix by William Yuan
X`09  <yuan@ariel.ucs.unimelb.edu.au>)
X`09+ corrected definition of $(exec_prefix) in makefile.in (reported by
X`09  Joachim Schimpf <J.\0B07@doc.ic.ac.uk>).
X`09+ apply suggested casts in vms2unix.c to appease DEC C 5.3 (reported
X`09  by Andy Harper and Graeme Miller).
X
XThis change log started on Wednesday Mar 12, 1997.
$ call unpack [.VILE-8_0]CHANGES.;1 -
 1027968372 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 154 14 152
$!
$ create 'f'
X
XNOTICE: This change log is officially (sez me) closed.
X`09All further changes documented (hopefully) in "CHANGES".  This
X`09file was renamed from "CHANGES" to\0D09.R3" on Tue Feb 22, 1994.
X
XChanges for vile 3.65: (released Mon Feb 7, 1994)
X(pgf)
X    Big change this release is 8-bit cleanliness.  See the help file
X    for 8-bit settings. `20
X   `20
X    NOTE: If you had a FN-key binding which was bound to a "meta" (high
X    bit) key, you must change your binding to be a M-\1308.  FN- and M-
X    are no longer synonymous.  In addition, we now preserve more of the
X    termio settings, so you may have to explicitly use "stty" to get
X    your meta-bit back.  (We used to clear istrip and the parity settings.)
X
X    NOTE2: pc vile, if built with djgpp or watcom compilers, cannot change
X    screens to 43 or 50 line mode.  i'm working on it.
X
X`09+ fix bug in charprocreg() that allowed a buffer to be marked
X`09  modified even if no changes were made and there is nothing to
X`09  undo.  (region.c)
X
X`09+ Brackets '`5B' and '`5D' are now treated like braces and parentheses
X`09  when inserting in c-mode. added new #defines for `5BLR`5DBRACK to assist
V
X`09  this. (insert.c, estruct.h, main.c)
X
X    `09+ A buffer's local "dos" mode is now set to the same as the global
X`09  "dos" mode when empty, fresh, or\1606dos-style lines equal unix-
X`09  style lines. (main.c, file.c, random.c)
X
X`09+ giving an argument to "set-dos-mode" causes it to turn \1C08
X`09  off rather than on. (file.c)
X
X`09+ allow backspacing over autoindented whitespace, whether  or not
X`09  backspacelimit is set. (insert.c)
X
X`09+ new commands, `5EA-i, `5EA-o, and `5EA-O, corresponding to i, \2107O,
X`09  but which do autoindent-override during an insert.  Most useful
X`09  when pasting into a buffer, since the pasted text often already
X`09  has leading whitespace, and autoindent just adds more.   this
X`09  is a different kind of override than used when pasting in xvile.
X`09  hmmm.  (insert.c, cmdtbl)
X
X`09+ fixed core dump resulting from calculating indentlen and checking
X`09  for '#' char at start of empty line.  (insert.c)
X
X`09+ add directory and host names to "vile died" message.  added ifdef
X`09  and prototype for usage of gethostname.  currently only used #if
X`09  BERK is true.  (greg mcfarlane) (file.c, proto.h, estruct.h)
X
X`09+ apply (greg mcfarlane's) fix for bug in unqname, when it's being
X`09  used at startup, and can't ask for input from user. (file.c)
X
X`09+ only reclaim or destroy empty unmodified buffers if they don't
X`09  correspond to existing files.  new routine ffexists() to support
X`09  this. (buffer.c, file\0808io,c, proto.h)
X
X`09+ changed calls to kbd_key() to tgetc(), since SPEC is now outside
X`09  the range that callers can handle.  (window.c spawn.c
X`09  insert.c history.c exec.c eval.c csrch.c bind.c)
X
X`09+ changed all references to last1key to refer\1508key instead,
X`09  to accompany above change.  last1key is gone. (basic.c, opers.c,
X`09  edef.h)
X
X`09+ kbd_key() now translates system-specific function-key sequences
X`09  to canonical '#-c' sequences, which kbd_seq() now interprets.
X`09  (input.c)
X
X`09+ allow 8-bit input, by changing SPEC definition, and some table
X`09  sizes. (estruct.h, input.c, mktbls.c)
X
X`09+ translate X key-events to a default set of xvile FN-bindings,
X`09  without using the SPEC define, since it won't fit through the
X`09  8-bit wide pipe we've constructed. (x11.c)
X
X`09+ added new modes, printing-low and \1109high, which define
X`09  the range of 8-bit chars which should _not_ be displayed in
X`09  octal, but rather as themselves.  (modetbl, modes.c, main.c)
X
X`09+ change how we display 8-bit chars. (\1607.c)
X
X`09+ new mode, unprintable-as-octal, to control display of non-printing
X`09  chars in hex or octal. (display.c, modetbl)
X
X`09+ new mode, meta-insert-bindings, which allows\2306\1C08 (M-c)
X`09  to work while in insert mode.  when off, all characters, meta
X`09  or not, are simply inserted as themselves.  when on, meta keys
X`09  which are bound to functions execute those \1809, all others
X`09  insert themselves. (\1406.c, modetbl)
X
X`09+ tb_get now returns a true 8 bits, no sign-extension.  (tbuff.c)
X
X`09+ allow focusFollowsMouse to be disabled by XDefaults (x11.c)
X
X`09+ apply fix (kev) for infinite loop on extended lines with certain
X`09  kinds of tab values. (display.c)
X
X`09+ attempt at better video support, and raw i/o, for djgpp (ibmpc.c)
X
X`09+ new routines for ctrl-c/ctrl-break/critical-error handling in
X`09  djgpp environment. (main.c, proto.h, new file djhandl.c, makefile,
X`09  makefile.djg)
X
X    `09+ added DJGPP to the direct/dirent ifdef in dirstuff.h
X
X`09+ fix for sys5 tgetent behavior, when attempting to determine if
X`09  we're an xterm. (tcap.c)
X
X`09+ new targets for motorola delta machines (makefile)
X
X `09+ fixes for core dumps on window resize (from kev) (x11.c)
X
X`09+ new define for min no. of lines per window. (estruct.h)
X
X`09+ change if_OPT_WORKING to simple ifdefs. (file.c fileio.c display.c
X`09  estruct.h)
X
X`09+ added vanillashar target to makefile, so i can produce shars
X`09  that the gnuish DOS unshar program will unpack.  (makefile)
X
X`09+ clarify help file regarding regions as used by the operator
X`09  commands (vile.hlp)
X
X`09+ applied contributed fix for null fontname (x11.c)
X
X`09+ changed logic of tags lookup, so i can understand it, and to
X`09  correct logic surrounding "taglength" (again).  if \1809 is
X`09  0, matches must be exact (i.e.  all characters significant).  if
X`09  the user enters less than 'taglength' characters, this match must
X`09  also be exact.  if the user enters 'taglength' or more
X`09  characters, only that many \1B0A will be significant in the
X`09  lookup. (tags.c)
X
X`09+ fixed bug with wrap-around reverse searching for a string occurring
X`09  on the last line of a buffer.  (search.c)
X
X`09+ fixed bug in search/replace operations where \1907ment string
X`09  was of the form 'text`5C1moretext'.  the length\2A08`5C1 replacement
X`09  pattern was being obtained incorrectly. (oneliner.c)
X
X`09+ changed GO32 ifdef to DJGPP, to avoid name conflict with
X`09  predefinition. (input.c, fileio.c, estruct.h, ibmpc.c, path.c,
X`09  random.c, termio.c)
X
X`09+ changed the 'interrupted' global to a routine, so we can poll for
X`09  a control-C character when real signals aren't available. (buffer.c,
X`09  edef.h, fences.c, main.c, search.c, word.c)
X
X(tom)
X`09+ corrected EVCURCHAR case in 'gtenv()' that tried to return the
X`09  characters at the current position, even when the buffer was empty
X`09  (eval.c).
X
X`09+ added ifdef-controls OPT_SHOW_EVAL,\0F0AREGS\0F0BTAGS
X`09  (cmdtbl, eval.c, estruct.h, line.c, proto.h, tags.c), and renamed
X`09  OPT_MAP_DISPLAY to OPT_SHOW_MAPS (map.c, estruct.h).
X
X`09+ use OPT_UPBUFF in 'killbuffer()' (\0B06.c).
X
X`09+ added ifdef-control OPT_WIDE_CTYPES (estruct.h, input.c, main.c).
X
X`09+ use new macro 'chrBIT()' to fix long/short bitmasks in character
X`09  tests (estruct.h, line.c).
X
X`09+ changed 'set_bname()' to a procedure so that it can trim trailing
X`09  blanks from the buffer-name.  This is done so that a `5EX-k command
X`09  applied to a buffer-name beginning with "!" will work.
X
X`09+ corrected length-computation in 'delins()' so that command
X`09  ":s/abc`5C`5B`5C(..`5C))/abc`5B`5C1`5D/" works properly (oneliner.c).
X
X`09+ corrected offset-computation in 'scanner()' so that wrapped search
X`09  finds text on the first line after wrapping (search.c).
X
X`09+ added call to 'update()' in 'ms_processing()' so that
X`09  "show-registers" display will be properly updated at the end of
X`09  mouse-selection (ibmpc.c).
X
X`09+ corrected logic in 'execute_named_command()' that prevented user from
X`09  typing ":0r foo" in an empty buffer (exec.c).
X
X`09+ corrected 'bclear()', so that the b_ulinep member is reset if it is
X`09  freed (buffer.c).
X
X`09+ lint (fileio.c, npopen.c, spawn.c)
X
X`09+ absorbed 'fnc2key()' into\1107cod()' (bind.c), to simplify
X`09  unbinding of prefix-keys in 'install_bind()'.
X
X`09+ corrected 'install_bind()' by new procedure 'reset_prefix()', so that
X`09  mapping characters that happen to be prefix-keys will override their
X`09  binding (bind.c).
X
X`09+ added definition LTRIMMED, to use in special cases (i.e., scratch
X`09  buffers) where we don't really want to show "`5EJ" at the end of lines
X`09  when "list" mode is enabled (estruct.h, display.c, file.c, line.c,
X`09  map.c).
X
X`09+ animated `5BMapped Characters`5D buffer (map.c).
X
X`09+ modified display of mappings so that using a repeat-count for the
X`09  ":map" command causes the actual characters to be shown, e.g.,
X`09  "#1" instead of "FN1", (map.c, modes.c).
X
X`09+ added alternate boolean "glob" mode (in contrast to the normal string
X`09  mode), for configurations in which vile cannot read filename
X`09  expansions via a pipe, e.g., VMS or UNIX (mktbls.c, modetbl, glob.c).
X
X`09+ moved "glob.h" definitions into estruct.h and proto.h because
X`09  the preceding change requires some definitions to\2E07e inclusion
X`09  of "nemode.h" within estruct.h (descrip.mms, eval.c, filec.c, glob.c,
X`09  main.c, makefile\0A0A.djg\0E0Btb\260B.wat, proto.h,
X`09  random.c, revlist, tags.c).
X
X`09+ corrected test in 'index2ukb()', which caused the unnamed-buffer
X`09  to be shown incorrectly when yanking text after lines had been
X`09  deleted (line.c).
X
X`09+ use 'DOT', 'mode_row()', 'buf_head()' and 'win\1109macros (basic.c, buffe
Vr.c,
X`09  csrch.c, display.c, eval.c, exec.c,
X`09  file.c, filec\0906nderr.c, globals.c, line.c, random.c, tags.c,
X`09  tcap.c, tmp.c, undo.c, window.c, word.c) for consistency and readability.
V
X
X`09+ modified lines/cols initialization so that 24x80 is assumed if all
X`09  other lookups fail, needed for apollo sr10.2 dial-in (tcap.c).
X
X`09+ added macro 'KbSize()' (file.c, estruct.h, x11.c, spawn.c, line.c).
X
X`09+ corrected 'imdying()' to not save temporary buffers, and to suppress
X`09  "implybuffer" mode (file.c).
X
XChanges for vile 3.64: (released Wed Dec 23, 1993)
X(pgf)
X`09+ change arithmetic expression in mktbls.c, so we don't assume
X`09  boolean expression returns exactly 0 and 1.  this exercised
X`09  a bug in an HP compiler (mktbls,c, from chris sherman)
X
X`09+ added fallback definition of VDISABLE to termio.c, in case
X`09  system doesn'd define it. (termio.c)
X
X`09+ increased stack size for Watcom DOS builds to 16K.  probably
X`09  overkill, but the other DOS builds seems to use 16K as well.
X
X`09+ cleaned up some of the scanf nonsense, but not nearly enough.
X`09  (finderr.c)
X
X`09+ don't let display-page changes affect the user's chosen cursor.
X`09  (ibmpc.c)
X
X`09+ use _previous_ indentation level after a line beginning with '#'
X`09  in cmode.  (insert.c, proto.h)
X
X`09+ use COMSPEC environment variable when spawning a DOS shell (spawn.c)
X
X`09+ assume we're an xterm if the word "xterm" appears anywhere in the
X`09  first field of the tcbuf, rather than just in the user's TERM
X`09  variable. (tcap.c)
X
X`09+ increased size of tcbuf since SCO core dumps on overflow (tcap.c)
X
X`09+ initialized tb_last in tb_alloc(). (tbuff.c)
X
X`09+ couple of minor user suggestions for vile.hlp and the README.
X
X`09+ don't beep when motions fail due to being aborted. (main.c)
X
X`09+ check modification time on first change to buffer (file.c, exec.c,
X`09  proto.h)
X
X`09+ the filename found for a tags lookup is now passed through doglob(),
X`09  which means tagfiles can now refer to environment variables etc.
X`09  (tags.c, from S.Suresh)
X
X`09+ new X resource, "focusFollowsMouse", causes xvile's current window
X`09  to track with the mouse cursor. (x11.c, from S.Suresh)
X
X`09+ added '`7E' to the characters considered part of a pathname, so
X`09  `5EX-e will pick up `7Epgf/foo correctly (main.c).
X
X(tom)
X`09+ corrected last change to allow pipe to vile, in case it is invoked
X`09  via 'rsh' and cannot open /dev/tty (main.c).
X
X`09+ added config flag OPT_TERMCHRS (estruct.h, bind.c).
X
X`09+ animated `5BTerminal`5D and `5BBinding List`5D buffers (bind.c,\1107.c).
V
X
X`09+ corrected call on 'slowreadf()' that resulted in wrong line numbers
X`09  when a file was piped to vile (main.c).
X
X`09+ modified TurboC makefile to merge duplicate strings, saving a little
X`09  memory (makefile.tbc).
X
X`09+ corrected logic that makes ".bak" file on MSDOS so\2306when
X`09  appending to a file (e.g., ":w >>foo") the file is copied after
X`09  renaming (fileio.c).
X
X`09+ consolidated some code that sets errno when user attempts to read or
X`09  write a directory-file (fileio.c).
X
X`09+ applied fix from eric krohn to fix uninitialized structure member
X`09  (tbuff.c).
X
X`09+ corrected "EGA" table entry (ibmpc.c)
X
X`09+ prevent 'flash' mode from being used until after 'TTopen()' (ibmpc.c)
X
X`09+ corrected a hole in 'swbuffer()' that tried to use a null value for
X`09  'curwp' (buffer.c).
X
X`09+ modified to allow "@" startup file to have errors w/o defaulting to
X`09  "vile.rc", by checking to see if a buffer was created (main.c)
X
X`09+ corrected logic of 'vtputc()' and 'vtset()' to make line-wrap display
X`09  properly when the line contains control characters (display.c).
X
X`09+ corrected limits of highlighting in 'change_selection()' (x11.c)
X
XChanges for vile 3.63: (released  Wed Nov 10, 1993)
X(tom)
X`09+ corrected 'pathcat()', to avoid using autoincrement in 'slashc()'
X`09  macro (path.c).
X
X    `09+ cleanup for gcc-2.4.5's -Wall warnings (estruct.h, display.c, exec.c,
V
X`09  finderr.c, glob.c, mktbls.c, modes.c, npopen.c, proto.h).
X
X`09+ compiled with CenterLine 'clcc'\2008r (bind.c, buffer.c,
X`09  display.c, eval.c, file\0808c.c, glob\0808als.c, line.c,
X`09  tags.c).
X
X`09+ corrected 'backpage()' to update mode-line after "previous-page".
X
X`09+ modified ibmpc.c to make flash/mouse code more portable.
X
X`09+ corrected call on 'strncpy()' in 'kbd_reply()' where 'extbuf' may be
X`09  copied onto itself.  On HP/UX, this causes the destination to be
X`09  cleared (input.c).
X
X`09+ modified initialization of IBMPC to make "flash" mode work better on
X`09  MSDOS (ibmpc.c).
X
X`09+ modified so that on MSDOS and VMS vile properly handles files that
X`09  are redirected to it via the standard input (main.c).
X
X`09+ corrected bug that caused ":e#" command to ignore the '#' character
X`09  (exec.c).
X
X`09+ corrected handling of ":tag" command so that if a tag's length is
X`09  shorter than the taglength setting, the \2808value is used
X`09  (tags.c).
X
X`09+ modified 'writereg()' to prevent inadvertant file-write using a
X`09  read-pipe expression (file.c).
X(pgf)
X`09+ fixed indenting bug in formatregion().  (word.c)
X
X`09+ added SHELL=/bin/sh to makefile
X
XChanges for vile 3.62: (released  Mon Oct 11, 1993)
X(pgf)
X`09+ enable DOS mouse processing for Turbo-C only, since some code
X`09  uses Turbo-isms to get at registers (_AX, etc)  (estruct.h)
X
X`09+ change references to x.ax, x.bx, x.di, etc to be x._AX_, x._BX_, etc.
X`09  to satisfy the Watcom 386 need for eax, ebx, edi, etc.
X
X`09+ improper automatic indent on brace insertion fixed (\1106.c,
X`09  fmatch,c, proto.h)
X
X`09+ the ls -a output in imdying() was producing a line with a lone '.'
X`09  on it, which was terminating /bin/mail.  use sort -r to rearrange
X`09  it. (file.c)
X
X`09+ re-ifdefed getscreensize, for machines without SIGWINCH
X
X`09+ guard against zero values for tabstop and shiftwidth `09(buffer.c)
X
X`09+ added global control variable to make it easy to turn off the
X`09  "working..." message. (display.c)
X
X`09+ don't let hst_append() do anything if clexec is set (history.c)
X
X`09+ click the mouse (with xterm-\1206set) no longer calls showcpos().
X`09  if you want the mouse position, turn on "ruler-mode" (tcap.c)
X
X`09+ flash mode is now off by default.  beeps should be\1007until
+-+-+-+-+-+-+-+-  END  OF PART 15 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 16 -+-+-+-+-+-+-+-+
X`09  requested otherwise. (main.c)
X
X`09+ applied vms path fix in pathcat() (path.c)
X
X`09+ don't insert tabs during reformat if notab\2407is set (word.c)
X
X`09+ applied patches for djgpp from Jim Crigler. (estruct.h, ibmpc.c)
X
X(tom)
X`09+ TurboC compiler warnings (history.c, mktbls.c, oneliner.c, search.c).
X
X`09+ added TurboC compiler warning patterns (finderr.c).
X
X`09+ implemented mouse highlighting for MSDOS (display.c, ibmpc.c).
X
X`09+ made the table-driven combinations for $sres work properly (ibmpc.c).
X
X`09+ corrected 'repointstuff()', so that undo works properly for multiple
X`09  windows; other\0F07's dot wasn't being updated (undo.c).
X
X`09+ modified 'execute_named_command()' to set dot-moved flag if the
X`09  range-computation moves it, fixes warning from 'updpos()' (exec.c).
X
X`09+ linted remaining size_t usage (basic.c bind.c display.c estruct.h
X`09  eval.c exec.c filec.c glob.c history.c isearch.c mktbls.c npopen.c
X`09  oneliner.c proto.h regexp.c search.c spawn.c vmsvt.c).
X
X`09+ guarded `26left, `26right, related functions against negative indices,
X`09  etc., (eval.c).
X
X`09+ changed sizes in regexp-struct to SIZE_T (from short, int) to support
X`09  lint (estruct.h).
X
X`09+ added command-line option "-wm" to set X11 window-manager title
X`09  (main.c, version.c, x11.c).
X
X`09+ modified prompts to make `5EV echo until the character is followed by
X`09  what we want to see a la vi (input.c).
X
X`09+ modified treatment of '!' character (in shell prompts) to expand it
X`09  immediately, more like vi (main.c, history.c, input.c, spawn.c).
X
X`09+ corrected some ifdefs that broke !-commands when compiling small
X`09  configuration for testing (cmdtbl, bind.c, eval.c).
X
X`09+ whitespace spawn.c
X
X`09+ corrected redisplay logic in 'execute_named_command()' when repeated
X`09  backspace characters were received (exec.c).
X
X`09+ modified logic in 'imworking()' to be a little more conservative when
X`09  erasing leftover text in the message line, e.g., when it happens
X`09  during filename-completion on large directories (display.c).
X
X`09+ corrected a hole in 'hst_append()' that allowed non-interactive use
X`09  of the bind-key function to erroneously set the 'clexec' flag
X`09  breaking subsequent named-commands (history.c).
X
X`09+ trailing blank, e.g., "int<sp><nl>tgetc(quotec)<nl>" breaks apollo
X`09  ctags by making it generate a pattern only for the "int<sp>" (bind.c,
X`09  input.c, isearch.c, \0A08).
X
X`09+ modified 'imply_buffer()' so that c-mode is set as in 'readin()'
X`09  (buffer.c).
X
X`09+ corrected 'getfile()' to treat names longer than NBUFN as filenames,
X`09  and 'unqname()' to assume its 'bname' argument can have a trailing
X`09  null (buffer.c, exec.c, file.c, main.c).  (This fixes a bug I
X`09  introduced in 3.60 that prevented using ":e %+" properly, where "%"
X`09  expands to a long buffer name, because the \190Bs are compared
X`09  with 'strncmp()').
X
X`09+ modified 'getfile()' to suppress redundant prompt by using returned
X`09  state of 'unqname()' (file.c).
X
X`09+ modified 'mlreply_file()' to prompt if a wildcard expands to multiple
X`09  files (e.g., when reading a file) (filec.c).
X
X`09+ modified 'tokval()' to expand `7E-paths so macros can refer to user's
X`09  home paths (eval.c).
X
X`09+ corrections to vms filename-completion (path.c).
X
X`09With Purify demo
X
X`09+ corrected memory leak in 'FreeBuffer()' (buffer.c).
X`09
X`09+ corrected uninit-memory reference in 'kbd_show_response()' (input.c,
X`09  history.c), in 'dfputsn()' (display.c).
X
X`09+ corrected reference to freed memory in 'listmodes()' and modified
X`09  logic to use 'animated'\1806, and variables 'relisting_b_vals' and
X`09  'relisting_w_vals'.  As a side-effect, this allows local buffer and
X`09  window modes to be set in `5BSettings`5D (buffer.c, display.c, edef.h,
X`09  main.c, modes.c).
X
X`09+ corrected a null-pointer reference to 'fromline' when a ":0" command
X`09  was entered in an empty buffer (exec.c).
X
XChanges for vile 3.61: (released  Thu Sep 16, 1993)
X(pgf)
X`09+ when files are saved in /tmp, and mail is sent, the list is now
X`09  created with "ls -a" to make all files visible. (file.c)
X
X`09+ when trying to get back to the current buffer in globber(), use
X`09  set_curwp() instead of swbuffer(), since\120B may not take
X`09  us back to the same window we started in, if the buffer is
X`09  multiply displayed. (globals.c)
X
X`09+ moving the cursor with the mouse (xterm-mouse) causes showcpos()
X`09  to be called, as if a `5EG had been typed.  the message line needed
X`09  to be cleared in any case, to delete old `5EG output, so i thought
X`09  i'd try updating it instead (should a similar change be made in
X`09  x11.c?). (tcap.c)
X
X`09+ in cmode, parentheses are treated like braces, in that if a line
X`09  ends with a left one, the next line is indented, and if it starts
X`09  with a right one, the line is aligned\2606\1909containing the
X`09  match.  this may be useful for parentheses-heavy languages like
X
X(tom)
X`09+ nits from 3.60 integration (file.c, mktbls.c, proto.h, glob.h)
X
X`09+ allow "number" mode to be set/unset in scratch buffers (modetbl,
X`09  display.c, random.c).
X
X`09+ use 'delay()' function in TurboC for 'catnap()' (random.c)
X
X`09+ ifdef'd "dirc" and "history" modes so that they don't appear in
X`09  `5BSettings`5D when not configured (modetbl, main.c).
X
X`09+ brought TurboC makefile up-to-date (\1508.tbc).
X
X`09+ corrected logic of 'makemodelist()' so that both buffer and window
X`09  local modes are shown (modes.c).
X
X`09+ corrected my last change to 'unqname()' to ensure that if the b_bname
X`09  field is short enough, it will have a null terminator (file.c).
X
X`09+ moved logic that reports lines-deleted from 'l\0F06()' to common
X`09  logic of 'operdel()' and\1006line\1406, so that using 'ldelete()'
X`09  internally won't generate spurious messages (line.c, opers.c).
X
X`09+ used 'doingopcmd' to modify return-status of motion commands (h,l) to
X`09  get rid of special-case handling so that when used internally they
X`09  don't fail; obsoleted 'forwchar_in_line()' (basic.c).
X
X`09+ use macro 'cmdBIT()' to clarify flags for CMDFUNC, added flag OPTREG
X`09  to simplify test in 'execute_named_command()', and make\2C06for
X`09  optional register and/or line-count more explicit by allowing it only
X`09  when non-punctuation follows the command (fixes ":s/pattern")
X`09  (cmdtbl, estruct.h, exec.c, input.c).
X
X`09+ corrected my last change to make "2p work\2A08ly, by using new
X`09  function 'index2ukb()' (line.c).
X
X`09+ modified 'mlreply_file()' so that filename completion works on the `5EW
X`09  and `5ER screen commands (filec.c).
X
X`09+ modified 'getregion()' to use line-number to simplify computation,
X`09  and to work with left-margin.  Also whitespaced (region.c).
X
X`09+ corrected test in 'loop()' that caused j/k commands to go awry in the
X`09  `5BRegisters`5D buffer at blank lines (main.c).
X
X`09+ corrected test in 'kbd_reply()' to avoid name-completion when the
X`09  current-response is a shell-command, e.g., "!foo -?" (input.c).
X
X`09+ corrected logic in 'forwchar_to_eol()' and 'ins_anytime()' that lets
X`09  arrow-keys to go past the end of the line while in insert (or
X`09  replace) mode (basic.c, insert.c).
X
X`09+ corrected logic that allowed a user to begin an insertion in one
X`09  buffer, then click the mouse to reposition into a readonly\3B07
X`09  and continue inserting -- in the readonly buffer (basic.c,\2E07.c).
X
X`09+ added mode 'flash' (ibmpc.c, main.c, tcap.c, x11.c)
X
X`09+ added logic to support msdos-mouse, using defines OPT_MS_MOUSE and
X`09  OPT_MOUSE.  This version only supports repositioning clicks (basic.c,
X`09  display.c, estruct.h, ibmpc.c, termio.c).
X
X`09+ use symbol ALLOC_T to clarify distinction between size_t/int/unsigned
X`09  (display.c, edef.h, estruct.h, eval.c, filec\0908io\1306nderr.c,
X`09  line.c, oneliner.c, proto.h, regexp.c, tbuff.c, undo.c, x11.c)
X
XChanges for vile 3.60: (unreleased)
X(pgf)
X`09+ added "stop" command (synonym for "suspend-vile", aka `5EZ) (cmdtbl)
X
X`09+ ensure shiftwidth and tabstop are always set correctly after modes
X`09  are adjusted -- any of cmode, cts/ts, csw/sw can affect. (modes.c)
X
X`09+ added support to finderr() for OSF1 (DEC Alpha's, at least) compiler
X`09  errors, of the form:
X`09`09/usr/lib/cmplrs/cc/cfe: Error: test.c, line 8: Syntax\1E06
X
X`09+ took out leftover dbwrite() call from rangespec() -- may fix errant
X`09  behavior on ":.$d" (exec.c)
X
X`09+ fixed helpfile note about X11 -name option -- it sets the name
X`09  used for resource lookups, not the window name.  (vile.hlp)
X`09  how do we set the window name?
X
X`09+ under DOS, leave the cursor shape and the keyboard repeat rate
X`09  alone.  if we get complaints, perhaps we should mode-ify these,
X`09  but in general, settings like that are personal, and we shouldn't
X`09  muck with them.  (ibmpc.c)
X
X`09+ don't introduce extra path separators in pathcat() (path.c)
X
X`09+ protect against NULL returns from getcwd, in case the directory
X`09  we're in has been removed. (random.c)
X
X`09+ changed symbol "glob()" to "do\0E0Bstop name conflict with
X`09  standard libraries (glob.c, eval.c, random.c, filec.c)
X
X`09+ added prototypes for glob.c to\1906.h
X
X`09+ eliminated infinite loop when using goto-beginning-of-sentence from
X`09  end of buffer (basic.c)
X
X`09+ added mode "multibeep" to control the "one beep per failed motion"
X`09  logic -- if multibeep is on (default), then every failed motion
X`09  produces a beep.  if it's off, then only the first (of a set of
X`09  identical) causes a beep. (modetbl, main.c)
X
X`09+ corrected possible use of uninited locals in file.c (was really
X`09  only a warning suppression) and  display.c
X
X`09+ turned off beeping in search.c and csrch.c, now that all failed
X`09  motions cause beeps.
X
X`09+ change "Date" to "installed" in version.c, since modtime really
X`09  only reflects installation date.
X
X`09+ don't let vile use a screen dimension of less than 2 in either
X`09  direction (display.c, tcap.c)
X
X`09+ fixed bug that made all TERM types be thought of as xterms. (tcap.c)
X
X`09+ fixed documentation of the help commands.  it's been wrong
X`09  for over three years now, and it's in the first screen of
X`09  help! (`5EX-`5EH and `5EA-`5EH should be `5EX-h\1908h) (vile.hlp)
X
X`09+ added AIX to the machines that need sys/ioctl.h, to pick up
X`09  TIOCGWINSIZE (display.c)
X
X`09+ reset the "calledbefore" flag in docmd().  fixes chris sherman's
X`09  problem where a second substitute-til in a macro would appear to
X`09  do nothing.  (actually it was reusing its previous args, so there
X`09  was simply nothing to do)  (exec.c)
X
X`09+ added '>' to the characters known\1808reformatting code, so
X`09  you can reformat most email replies. (word.c)
X
X`09+ added automatic patchfile generation to the makefile.  hopefully
X`09  i can generate patches for all future releases, in addition to
X`09  shar files. (makefile)
X
X(tom)
X`09+ made ansi.c work with TurboC (\1906, main.c, display.c, termio.c),
X`09  to use as test-case for COLOR.
X
X`09+ corrected highlighting code for ":%s" command with ibmpc display
X`09  (display.c, ibmpc.c).
X
X`09+ modified 'bfind()' to always return a buffer (unless it cannot create
X`09  the buffer), use 'find_b_name()' for the no-create mode (bind.c,
X`09  buffer.c, eval.c, exec.c, file\0808\1107nderr.c, history.c,
X`09  main.c, map.c, modes.c, oneliner.c, random.c, spawn.c, tags.c).
X
X`09+ use macros 'set_bname()' and 'eql\120Efunction 'g\2D0B
X`09  to encapsulate buffer name, which does not necessarily have a
X`09  trailing null (bind.c, buffer.c, display.c, estruct.h, eval.c,
X`09  exec.c, file\0806nderr.c, input.c, main.c, modes.c, oneliner.c,
X`09  spawn.c, tags.c, tmp.c).
X
X`09+ removed nonstandard 'strncpy()' (main.c).
X
X`09+ corrected 'kbd_show_response()' to work with expand-chars mode
X`09  (input.c).
X
X`09+ corrected 'kbd_reply()' to make the number of characters shown have
X`09  the same limit as the caller's buffer-length, and to make it always
X`09  return the data with a trailing null (input.c).
X
X`09+ made 'animated' mode work for `5BRegisters`5D buffer (line.c), and
X`09  modified the logic so that numbered-buffers are displayed in a
X`09  vi-compatible manner.
X
X`09+ make shift-commands work more like vi, allowing repeated '<' or '>'
X`09  characters in a :-command to imply a repeat count (bind.c, exec.c,
X`09  opers.c).
X
X`09+ corrected logic of 'dofile()' so that if an error is found in the
X`09  startup file, vile properly sets curbp and curwp (exec.c).
X
X`09+ simplified/corrected command-history logic of to fix error that
X`09  prevented scrolling past ":e!" command, and to allow\2B0Bof
X`09  '<', '>' command even when repeated (bind.c, exec.c, history.c,
X`09  spawn.c).
X
X`09+ added flag KBD_EXPCMD to handle the case (from rewrite of history)
X`09  where %,#,: expansion must be done for shell commands (estruct.h,
X`09  bind.c, input.c).
X
X`09+ added OPT_HISTORY to allow ifdef'ing of history.c code (estruct.h,
X`09  history.c)
X
X`09+ cache home-directories looked up in 'home_path()' to make it run
X`09  faster (path.c)
X
X`09+ modified glob-expansion to allow "`7E" \1709.  This doesn't work
X`09  with wildcards in the user-portion (e.g., "`7Eab?"), but suffices for
X`09  most cases (glob.c).
X
X`09+ added a find-error case for apollo's C++ compiler (finderr.c).
X
X`09+ modified logic for 'displaying' vs 'imworking()' slightly, to get rid
X`09  of erroneous cursor movement (display.c).
X
X`09+ added function 'slowtime()' to force updates i\2107readf()' more
X`09  often (file.c).
X
X`09+ adjusted definitions for better lint checks on apollo sr10.2
X`09  (estruct.h, makefile).
X
X`09+ make piped-input also set error-buffer (main.c).
X
X`09+ revised logic that sets VAL-structs for modes to correct places where
X`09  buffer `26 window traits are saved without converting to local values.
X`09  Also removed code (e.g., copy_val) that checks reference counts,
X`09  since they aren't really necessary (buffer.c estruct.h main.c modes.c
X`09  proto.h)
X
X`09+ modified behavior of 'unsetl' command to delete local setting
X`09  (eval.c, modes.c).  It was only modifying (toggling) boolean\3407
X
X`09+ corrected 'reframe()' to handle linewrapping case submitted by
X`09  alistair (display.c).
X
X`09+ corrected cursor-update in 'x_scroll()' that left stray\2E07 images
X`09  remaining after `5ED/`5EU commands (x11.c).
X
X`09+ corrected logic that caused selection-text to be lost when keypress
X`09  was received (x11.c).
X
X`09+ modified X-windows pasting to trim unneeded whitespace when inserting
X`09  into cmode or autoindent buffer (bind.c, x11.c).
X
X`09+ corrected kill-buffer flag KAPPEND, which had the same value as
X`09  KLINES (estruct.h, line.c).
X
X`09+ corrected error in 'doindent()' that caused a "<nl>`7D" insertion to
X`09  delete nonwhite characters (insert.c).
X
X`09+ corrected ":tags" command for exact (taglen=0) lookups (tags.c)
X
X`09+ make failed motion-commands sound an alarm like vi (main.c).
X
X`09+ modified logic for h,j,k,l,`5ED,`5EU,`5EF,`5EB commands to return false w
Vhen
X`09  they fail, so failed-motion alarm works (basic.c).
X
X`09+ corrected logic for b,B,w,W,e,E commands to return false only when
X`09  backing/forwarding past the buffer ends (word.c).
X
X`09+ modified alternate-window motions 'scrnextup()',\0F09dw()',
X`09  'mvdnnxtwind()', 'mvup\110A to also return failed-motion status,
X`09  for consistency (window.c)
X
X`09+ made new function 'forwchar_in_line()' to do the vi "l" command,
X`09  dissociating it from the internal motion-command (basic.c, cmdtbl).
X
X`09+ made 'backhpage()', 'forw\0F08 motion-commands (cmdtbl).
X
X`09+ make failed quit-commands return false (main.c).
X
X`09+ make version-command show UNIX or VMS executable's date (main.c)
X
X`09+ corrected behavior of 'histbuff()' when user simply toggles with the
X`09  "_" command.  This did not handle the case in which the alternate
X`09  buffer was temporary, and thus had no number (\2E06.c).
X
X`09+ introduced new buffer-attribute 'b_lim_left', macro
X`09  'w_left_margin()', ifdef'd with OPT_B_LIMITS, use this to control
X`09  cut/paste selection in `5BRegisters`5D (basic.c, buffer.c, csrch.c,
X`09  display.c, random.c, region.c, window.c, x11.c).
X
X`09+ modified 'execute_named_command()' to recognize register name and
X`09  line-count for commands such as ":yank", making it handle case\2806
X`09  as ":5>6", ":y a \0A0610,20y b" (exec.c, input.c, line.c).
X
X`09+ modified ":put" command to report the number of lines added (line.c).
X
X`09+ split out 'version.c' because main.c got too large for apollo lint
X`09  (main.c, makefile*, vms_link.opt, link.msc).
X
XChanges for vile 3.59: (released Wed Aug 18, 1993)
X(pgf)
X`09+ added VIEWOK flag for functions that execute macros.  it says
X`09  it's okay to execute them in view mode, even though they have the
X`09  UNDO bit set.  this fixes not being able to run @, :map'ed, or
X`09  `5EX-`26 macros in view-only buffers.
X
X`09+ made the xterm-mouse mode available in xvile as well as vile, to
X`09  make it easier to share .vilerc between the two versions.  the
X`09  alternative is to insist that people put `7Eforce set xterm-mouse
X`09  in .vilerc, to override the error they'll get in xvile from the
X`09  mode not being present. (input.c, modes.c, estruct.h)
X
X`09+ changed default value of "xterm-mouse" to off, to make vile behave
X`09  like it used to, and like other character applications, by default.
X`09  (main.c)
X
X`09+ turned off support for the "working..." message for builds that
X`09  define USG, since they probably have non-restartable system calls.
X`09  (estruct.h)
X
X`09+ accept any TERM variable that ends in "xterm" to be an xterm.
X`09  (tcap.c, vile.hlp)
X
X`09+ fixed "uninitialized variable 'req'" when compiling without REVSTA
X`09  defined. (display.c)
X
X`09+ fixed missing closing double quote in "make all" help output.
X`09  (makefile)
X
X`09+ bumped the maximum row count from 100 to 200.  i personally can't
X`09  read more than about 70 lines on a 19" mono monitor, but maybe
X`09  i need glasses. (tcap.c, x11.c)
X
X`09+ took out extraneous trace.h include from x11.c
X
X`09+ corrected 'col2offs()' to make it easier to position the mouse on a
X`09  tab character (display.c).
X
XChanges for vile 3.58: (released Fri Aug 13, 1993)
X(pgf)
X`09+ added "sys$login:" to VMS file search path for vile.rc
X
X(tom)
X`09+ refined 'imworking()' to get rid of leftover \2207-message
X`09  (display.c, file.c).  Make working-message show up only when 'terse'
X`09  mode is off (the default).
X
X`09+ added code to support xterm mouse-clicking (to move dot), with
X`09  additional code for later use with highlighted selections.  Made this
X`09  a mode (xterm-mouse) because it does not implement cut `26 paste yet
X`09  (basic.c, display.c, input.c, main.c, modes.c, tcap.c).
X
X`09+ added calls to 'TTkopen()' and 'TTkclose()' to termio.c so that (for
X`09  all systems) we call these within 'ttclean()' and 'ttun\1208
X`09  (termio.c, tcap.c).
X
X`09+ optimized display of 'ruler' (\1407.c)
X
X`09+ use 'displaying' as a semaphore rather than true/false flag, as a
X`09  guard against interrupt by 'imworking()' which modifies ttcol and
X`09  ttrow (bind.c, display.c, main.c, tcap.c, x11.c).
X
X`09+ make ":=" command accept address (like vi) to show arbitrary\2408
X`09  value (cmdtbl, estruct.h, exec.c, random.c).
X
X`09+ don't let 'write-til' move dot (cmdtbl).
X
X`09+ modified 'doindent()' to trim leading whitespace (like vi) from the
X`09  portion of the line after dot (insert.c).
X
X`09+ modified insert-code to treat the combination of repeat-count and
X`09  newline like vi, causing the repeat count to apply only to the
X`09  insertion-string before a newline.  (edef.h, input.c, insert.c)
X
X`09+ corrected handling of '.' repeat-count for r,R commands (insert.c)
X
X`09+ modified user-variables to make them dynamically-allocated, and to
X`09  remove the restriction on the length of their names (mktbls.c,
X`09  estruct.h, eval.c, main.c).  Also corrected treatment of newline in
X`09  prompt for user-variable name.
X
X`09+ used 'strncpy()' to copy return-values from 'kbd_reply()', just in
X`09  case macro-tokens are too long (input.c).
X
X`09+ don't expand '%' or '#' in 'kbd_reply()' if it would be the name of
X`09  an invisible buffer (input.c).
X
X`09+ added universal-modes 'expand-chars' to list the characters to \2806
X`09  in 'kbd_reply()', and 'expand-path' to control whether %/# are shown
X`09  as full, or shortened paths (modetbl, input.c, main.c).
X
X`09+ modified X-windows config to allow processing of events when the
X`09  working-message code is executed (display.c, x11.c).  This makes the
X`09  screen refresh and keyboard handling work better.
X
X`09+ added 'animated' buffer-mode to control whether vile updates
X`09  scratch buffers when their contents would change (e.g., the\3407
X`09  list), made this work for buffer-list (\0D06.c, display.c,
X`09  estruct.h, modes.c\0906tbl).
X
X`09+ revised the 'killbuffer()' code to work properly with the animated
X`09  mode (buffer.c).
X
X`09+ modified mktbls to check for illegal mode-names (\2806.c).
X
X`09+ linted with SMALLER set (to get rid of unused functions), introduced
X`09  new ifdef with OPT_EVAL to simplify (basic.c bind.c buffer.c cmdtbl
X`09  estruct.h eval.c insert.c line\0706t.out modes.c npopen.c proto.h
X`09  window.c).
X
XChanges for vile 3.57: (released Fri Aug 06, 1993)
X(pgf)
X`09+ the bug check for b_ulinep pointing at a newly inserted line is
X`09  no longer valid, since we can now insert a line, make changes (which
X`09  will set b_ulinep), undo those changes, and then\1D08e insert.
X`09  we now just null out b_ulinep when we remove the line it references.
X`09  (undo.c)
X
X`09+ changed name of setmode() to avoid library conflict with djgpp, and
X`09  changed the other del/setg/delg versions as well.  (cmdtbl, modes.c,
X`09  proto.h)
X
X`09+ took out #define USG 0 since djgpp uses an #ifdef on this in a header
X`09  (estruct.h)
X(tom)
X`09+ whitespace in basic.c
X
X`09+ corrected definition of ScratchName macro for apollo SR10.2
X`09  (estruct.h) and a compiler warning (in glob.c).
X
X`09+ corrected gcc warnings about 'signal()'-arguments for SunOs.
X
X`09+ use new macros ACTUAL_SIG_ARGS, etc., instead of\220BNAL so
X`09  that the tag-file can find the signal-handling procedures (estruct.h,
X`09  display.c, file.c, main.c, proto.h, spawn.c, x11.c).
X
X`09+ customized the c-suffix default values for VMS, MSDOS and UNIX.
X
X`09+ VAX/VMS C does not allow continuation-lines in ifdefs (mktbls.c).
X
X`09+ VAX/VMS C may incorrectly set ferror() when feof() is true (fileio.c)
X
X`09+ VAX/VMS C 'rewind()' does not work correctly (fileio.c)
X
X`09+ added code to show "working..." message for time-consuming operations
X`09  (display.c, npopen.c, vmspipe.c), and to allow 'slowreadf()' to show
X`09  its progress (file.c, fileio.c).
X
X`09+ linted calls on 'signal()', (main.c, display.c, spawn.c, termio.c).
X
X`09+ linted calls on 'firstnonwhite()' (basic.c, exec.c, insert.c, line.c,
X`09  opers.c, region.c, spawn.c, word.c).
X
X`09+ use new functions 'end_named_cmd()', 'more\140D for clarity
X`09  (exec.c, file.c, map.c, oneliner.c)
X
X`09+ added new mode 'ruler' (to display line+column in a window on the
X`09  modeline), and new window-flag WFSTAT to support it (by allowing
X`09  non-modal information to affect the modeline).  (display.c)
X
X`09+ corrected error I introduced into 'reframe()', and in 'row2window()'
X`09  while adding 'linewrap' mode (display.c).
X
X`09+ corrected code that frees buffer's fname-field for the special case
X`09  of out-of-memory (buffer.c, random.c).
X
X`09+ added new command 'tagstack' to show the contents of the tag-stack.
X`09  Modified 'tags()' to use module-level 'tagname`5B`5D' rather than local
X`09  copy of tag-string.  (tags.c)
X
X`09+ always update the modtime-at-warn buffer field when prompting
X`09  for the check-modtime mode (file.c).
X
X`09+ removed (obsolete) code for DEC Rainbow (estruct.h, display.c,
X`09  termio.c).
X
X`09+ modified 'line_no()' to return values in the range 1..MAX+1
X`09  instead of 0..MAX (random.c).
X
X`09+ corrections to make X11 version work with 'number', 'linewrap' modes,
X`09  to guard against selection extending outside a window, to highlight
X`09  only the actual text within a window, and to use 'yankregion()' to
X`09  save the paste-text.  (basic.c, display.c, window.c, x11.c)
X
X`09+ modified 'typahead()' to know when X-windows is pasting, and the
X`09  paste-init code to supply an escape to end insert-mode, and to use
X`09  TBUFF's so that nulls can be inserted (termio.c, x11.c).
X
X`09+ put the repeat-count in 'map_proc()' back the way Otto Lind had it
X`09  (map.c).
X
XChanges for vile 3.56:`09(released Tue Jul 27, 1993)
X(pgf)
X`09+ after a confirm substitute operation, we now mlerase the \3107
X`09  prompt (oneliner.c)
X
X`09+ be sure the `5Bvileinit`5D buffer is marked as scratch while doing the
X`09  bprintf into it, so undo record-keeping will be suppressed. (main.c)
X
X`09+ rearranged calls to chg_buff and ldelnewline in ldelete, so that
X`09  the buffer will still be marked clean on first toss/copy/tag to
X`09  undo.  unmodified state is now restored correctly after a :g/`5E$/d is
X`09  undone. (line.c)
X
X`09+ In regular expressions, `5Cs and `5CS are now true atoms.  they both
X`09  must now be followed by * or + to match more than one.  also, `5Cs
X`09  no longer matches BOL or EOL (thanks to alistair and eric for
X`09  pointing out and fixing) (regexp.c)  In practice this means that
X`09  one should use `5Cs* or `5Cs`5C+ where one used to use just `5Cs.  also,
V
X`09  if a match against `5E or $ is necessary, it must be done explicitly,
X`09  e.g. /`5C(`5E`5Cs*`5C`7C`5Cs`5C+`5C)word/ instead of /`5Csword/
X
X`09+ adjusted paragraph/section/comment/sentence regexps, with help
X`09  from eric, to reflect change to `5Cs and `5CS
X
X`09+ make the #ifdef USE_TERMIO version of ttclean() be a no-op under
X`09  X11, as it is in the other cases.  eric's right -- termio.c needs
X`09  a rewrite.  (termio.c)
X
X`09+ don't pass the (0) to getpgrp if we're POSIX and ANSI -- the
X`09  library is probably the right one, and there's a high\2B07ility
X`09  of a prototype conflict if we _do_ pass it.  (spawn.c)
X
X`09+ When looking up X defaults, the old code checked the class first,
X`09  then the specific program name.  This is backwards since if the
X`09  class value exists, there is no way to override it with the -name
X`09  option.  (x11.c)
X
X`09+ AIX and pyramid think we have non-constant case expressions (eval.c)
X
X`09+ There is no requirement in ANSI C for SCRTCH_LEFT and\1008RIGHT
X`09  to be expanded before the ##.  Some preprocessors do and some don't.
X`09  However, the other #define using just #s and string concatenation
X`09  seems to work everywhere.  (estruct.h)
X
X`09+ clarified usage of `26sin function, which searches its first argument
X`09  for an occurrence of the second.  (vile.hlp)
X
X(tom)
X`09+ renamed UCHARAT to\0B06_AT; added defs for\2406 USHORT, UINT and
X`09  ULONG for easier linting/reading (bind.c, dirstuff.h, estruct.h,
X`09  file.c, history.c, ibmpc.c, input.c, isearch.c, line.c, oneliner.c,
X`09  proto.h, tbuff.c, vmalloc\0B06svt.c, x11.c, z_ibmpc.c)
X
X`09+ make 'prc2kcod()' return an int again, some optimization of 'token()'
X`09  (bind.c, file.c).
X
X`09+ clean-compiled/tested X11 + DEBUGM + OPT_MAP_MEMORY with gcc
X`09  (basic.c, edef.h, exec.c).
X
X`09+ disable filename-completion when OPT_MAP_MEMORY is enabled.
X
X`09+ added mode 'newline', set to true when reading files that have a
X`09  trailing newline (the normal vi-convention), modified (file.c,
X`09  buffer.c, random.c).
X
X`09+ fixed place where ":ww" garbages the screen before reporting
X`09  "wrote 0 buffers" (\0A06.c).
X
X`09+ simplified 'writereg()' and 'ffputline()' (fileio.c, file.c) to allow
X`09  'newline' mode to control whether a trailing \2C07 is written to
X`09  output files.
X
X`09+ modified 'kifile()' so that it does not insert the trailing newline
X`09  if it wasn't present in the file.
X
X`09+ made 'ldelete()' return from one point (line.c) to simplify 'report'
X`09  mode.
X
X`09+ added mode 'report', to specify the number of changes before a
X`09  message is emitted:
X`09`09NN lines deleted&02096dd
X`09`09NN more lines&0209`09u
X`09`09NN fewer lines&0209`09u
X`09`09NN fewer lines&0209`09:g/`5E$/d
X`09`09NN lines yanked&0209`09"a8yy
X`09`09NN substitutions on MM lines`09:%s/x/XX/g
X`09`09NN substitutions&0209:%s/x/X/
X`09  (globals.c, line.c, undo.c, oneliner.c, random.c, region.c)
X
X`09+ corrected unnecessary screen-update in 'substline()' (oneliner.c)
X`09  introduced in confirm-changes.
X
X`09+ added 'linewrap' mode (basic.c, buffer.c, display.c, windows.c).
X
X`09+ corrected cursor movement for large repeat counts with 'H' command
X`09  (basic.c).
X
+-+-+-+-+-+-+-+-  END  OF PART 16 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 17 -+-+-+-+-+-+-+-+
X`09+ ifdef'd 'screen_string()' to handle apollo compiler warning when
X`09  testing SMALLER configuration.
X
X`09+ added stubs for modes 'popup-msgs',\0E08choices'.
X
XChanges for vile 3.55: (released Mon Jul 19, 1993)
X(pgf)
X`09+ new routine, mlquickask(), which prompts for and returns a single
X`09  key answer from a user.  use this when getting a confirm \2E06
X`09  user for a substitute command. (input.c, oneliner.c, proto.h)
X
X`09+ documented the 'c' for confirm (vile.hlp)
X
X`09+ the token() routine now expands numeric escape codes, like `5Cnnn and
X`09  `5CxNNN where nnn are octal and NNN are hex digits.  this may affect
X`09  vilerc files that have `5C sequences in them.  support for mapping
X`09  to key-sequences like 0xNN is gone -- use `5CxNN instead.  this will
X`09  make it easier to do multi-char maps in the future.
X
X`09  note that `5C000 will cause internal problems, since things are null-
X`09  terminated, and the sequences "<sp>", "<tab>", and "`5EC" are all
X`09  problematic when multi-char sequences come around.
X
X(alistair)
X`09+ added highlighted confirm to ":s" command.  (oneliner.c, display.c)
X
X(tom)
X`09+ modified 'makebindlist()' (in bind.c) to format using tabs rather
X`09  than spaces.
X
X`09+ many mods to map.c (and bind.c) to eliminate redundancy between it
X`09  and bind.c
X
X`09+ modified 'prc2kcod()' to look for only one prefix, but allow
X`09  hexadecimal code in form 0xff.
X
X`09+ corrected a recursion bug in 'install_map()' (file map.c)
X
X`09+ modified ":map" (file map.c) to show show mappings if no values are
X`09  given.
X
X`09+ fix strict gcc warnings in x11.c, consolidated some initialization
X`09  code and corrected font-ascent value (so 9x15 works properly).
X
X`09+ added "on" and "off" to literals in 'stol()' (file eval.c) to use
X`09  this in x11.c
X
X`09+ modified 'killbuffer()' in \0D06.c to recognize a repeat-count
X`09  (e.g., allows `5EX-k within the buffer list to remove a succession of
X`09  buffers).
X
X`09+ fix strict gcc warnings in ansi.c
X
X`09+ make command-history record properly for bind-key and map\3508s
X`09  (files bind.c and map.c).
X
X`09+ modified 'engl2fnc()' (in bind.c) to allow unique abbreviation (so
X`09  that scripts don't have to be spelled out), added "se" symbol to
X`09  cmdtbl for vi-compatibility.
X
X`09+ modified 'docmd()' (file exec.c) to allow leading ':' in scripts
X`09  for vi-compatibility.
X
X`09+ corrected logic in modes.c to (re)allow trailing whitespace on
X`09  the end of set-commands.
X
X`09+ merged files makmktbl.tbc and makvile.tbc into makefile.tbc
X
X`09+ eliminated 'VIDEO *' arguments from 'updateline()' in file display.c
X`09  because the 'row' argument already provides this information.
X
X`09+ added 'offs2col()' to correct position of highlighting when
X`09  confirming substitutions.
X
XChanges for vile 3.54: (released Fri Jul 09, 1993)
X(pgf)
X`09+ will now call setvbuf instead of setbuffer if USG defined in the
X`09  POSIX version of ttopen.  this to support SVR4 (well, solaris)
X`09  (termio.c)
X
X`09+ took out the more stringent prototype warnings (-Wstuff) from the
X`09  gcc OPTFLAGS, since we don't pass them yet (someday, alistair).
X`09  (makefile)
X
X`09+ mode and variable symbol names generated by mktbls are now of the
X`09  form "s_name__" instead of\1608", to be more unique.  (there
X`09  was a conflict with a (naturally named) typedef of signed char to
X`09  "s_char".)  (mktbls.c)
X
X`09+ upped the max number of screen columns for x11.c.  was 150, now is
X`09  200.  reduced the max rows number from 200 to 100.  the screen
X`09  buffers should be made re-allocatable, so we wouldn't eat the space
X`09  unless necessary.  made the normal (tcap.c) maximums match these.
X`09  (tcap.c x11.c)
X
X`09+ applied Tuan Dang's fixes for my merging of his watcom and djgcc
X`09  patches.  Thanks Tuan!  (makefile.wat, ibmpc.c, estruct.h, path.c,
X`09  mktbls.c)
X
X`09+ turn DOS mode on by default for DOS versions of vile. (main.c,
X`09  vile.hlp)
X
XChanges for vile 3.53: `09(released Thu Jul 07, 1993)
X(pgf)
X`09+ stop core dump on file completion (":e fi<tab>") by making sure
X`09  BFSIZES bit is cleared when building MyBuff
X
X`09+ in rtfrmshell(), there was a "curwp->w_flag = WFHARD" statement,
X`09  with a comment asking if it was needed.  in fact, it's wrong, so
X`09  i took it out.  it was tromping other flags, like WFMODE, for that
X`09  window only (spawn.c).
X
X`09+ in update(), don't add nu_width to screencol if the buffer is empty,
X`09  since there is no line number in that case. (display.c)
X
X`09+ fixed bug when undoing the first insertion into an empty buffer.
X`09  the value of dot was being restored to the inserted (and now gone)
X`09  line.  (line.c)
X
XChanges for vile 3.52:
X(pgf)
X`09+ added a couple of tweaks to tom's check-modtime changes -- prompts
X`09  are not suppressed if you're writing the buffer out, and running
X`09  a shell only checks visible buffers for modtime changes, rather
X`09  than all buffers. (mostly file.c, estruct.h, random.c)
X
X`09+ changed name of "timeout-value" to\1309len", to match some
X`09  versions of vi.  (modetbl, vile.hlp)
X
X`09+ applied patches from Tuan DANG (dang@cogit.ign.fr) to support
X`09  DJGCC v1.09 (display.c, estruct.h fileio.c ibmpc.c main.c mktbls.c
X`09  modes.c path.c random.c spawn.c termio.c)
X
X`09+ consolidated TURBO, WATCOM, MSC, ZTC, and GO32 under a new,
X`09  presumptuous #define, called NEWDOSCC. (mostly same files as djgpp
X`09  changes)
X
X`09+ fixed calloc macro (estruct.h) in RAMSIZE ifdef
X
X`09+ added map.c/map.obj source file for VMS (descrip.mms, vms_link.opt)
X
X`09+ removed bogus dbgwrite in exec.c, where linespec returns a value
X`09  for "toline" which can be null.
X
XChanges for vile 3.51:
X(pgf)
X`09+ added a couple of tweaks to tom's check-modtime changes -- prompts
X`09  are not suppressed if you're writing the buffer out, and running
X`09  a shell only checks visible buffers for modtime changes, rather
X`09  than all buffers.
X
X`09+ added regexp metacharacter "index" in margin of vile.hlp.
X
X`09+ renested some limit setting in scanner(), so I can understand it
X`09  again. (search.c)
X
X`09+ changed name of ABS macro to ABSM to avoi\2306space conflict
X`09  on OSF/1. (cmdtbl, exec.c estruct.h)
X
X`09+ made :map to SPEC key-sequences work (map.c insert.c)
X
X`09+ undo now preserves current column as well as row (undo.c estruct.h)
X
X`09+ changed name of "naptime" to "timeout-value"  (main.c modetbl
X`09  vile.hlp input.c)
X
X`09+ added new variable $mode, which is the name of the user-mode we
X`09  e're in: "command", "insert", "overwrite".  the value is set
X`09  when we enter insertmode, and restored \2708leave.  this lets
X`09  macros invoked from within insert mode find out if they should
X`09  enter insertmode.  (eval.c, modetbl, \1F06.c, proto.h, vile.hlp)
X
X`09+ prc2kcod will now accept literal control chars, and also will
X`09  accept hex specifications.  so now key-sequences can be\2D08ed
X`09  as follows:`09`09(bind.c map.c vile.hlp)
X`09  `09an optional prefix:
X`09`09`09`5EA`09(one char)
X`09`09`09`5EA-`09(three chars)
X`09`09`09`5EX`09(one char)
X`09`09`09`5EX-`09(three chars)
X
X`09`09followed by an optional "function" prefix:
X`09`09`09FN-`09(three chars)
X`09`09`09M-`09(two chars)
X`09`09    (these two are synonymous)
X
X`09`09followed by a character:
X`09`09`09C`09(one char)
X`09`09`09`5EC`09(one char)
X`09`09`09`5EC`09(two chars)
X`09`09`090xNN`09(four chars)
X`09`09`090XNN`09(four chars)
X`09`09`09<tab>`09(five chars)
X`09`09`09<sp>`09(four chars)
X
X
X`09+ removed old BEFORE ifdefs (input.c insert.c)
X
X`09+ better error checking on parsing of key-sequences in exec'ed files.
X`09  (bind.c)
X
X`09+ if dobuf() encounters an error, it switches to that buffer.  but
X`09  until now, this error propagated back through nested dobuf()'s,
X`09  and we ended up looking at the 'source "filename"' line in the
X`09  outermost buffer.  now we only switch on the most deeply nested
X`09  dobuf().  also, we no longer set file buffers that we're executing
X`09  to view-mode.  (exec.c)
X
X`09+ if we get an error on startup, we skip right to the editing loop,
X`09  so the user gets confronted with the error right away.  (main.c)
X
X`09+ gave adjustmode a real return value -- used to always\1F08TRUE.
X`09  (modes.c)
X
X`09+ when looping backwards backspacing, check if the input char was
X`09  killc or w\0A06before checking isbackspace(c), since otherwise
X`09  if killc is DEL, we'll treat it as backspace first.  (this is
X`09  because `5EH and DEL are both assumed to be backspacers initially)
X`09  (insert.c input.c)
X
X`09+ implemented new universal mode, "naptime", which is the number of
X`09  milliseconds to delay before accepting a lone ESC character,
X`09  rather than as the start of a function key sequence.  also added
X`09  boolean arg to catnap(), which controls whether detection of user
X`09  input will abort the catnap delay.  the default for this mode is
X`09  500 milliseconds.  the old value was 50, which was fine for fast
X`09  local displays, but didn't work well for serial terminals or
X`09  rlogin sessions.  (which surprises me somewhat -- 9600 baud
X`09  translates to roughly 1 character per millisecond -- why is a
X`09  delay of 50 ms not enough for the second character of a function
X`09  key generated by a terminal?) (proto.h fences.c input.c random.c
X`09  modetbl vile.hlp main.c)
X
X`09+ applied patches for Watcom C/386, from Tuan DANG (dang@cogit.ign.fr).
X`09  I haven't had a chance to try them yet. ( mktbls.c cmdtbl estruct.h
X`09  dirstuff.h ibmpc.c main.c fileio.c random.c termio.c display.c
X`09  glob.c npopen.c path.c proto.h spawn.c makefile)
X
X`09+ renamed turbo makefiles, to be more similar to the watcom\2C0A.
X
X`09+ fixed insert-string to really\1807 instead of overwrite.
X
X(tom (3.51))
X`09+ added buffer-mode 'check-modtime' to check if the disk-file is newer
X`09  than the buffer when reading, writing or popping a window (adapted
X`09  from a patch by Randy Winney, modifies (files file.c, fileio.c,
X`09  buffer.c, random.c, spawn.c).  Note that moving the cursor between
X`09  buffers does not perform this check.
X
X`09+ use macro 'for_each_line()' in some more places (files: buffer.c,
X`09  globals.c, random.c, spawn.c, vmalloc.c).
X
X`09+ use new function 'SetCurrentWindow()' in file window.c.
X
X`09+ added checking in 'SetVarValue()' (file eval.c) to guard readonly
X`09  buffers from modification.
X
X`09+ added checks in file mode.c to prevent major-mode changes to scratch
X`09  buffers (and corrected the settings of WFMODE in file modetbl).
X
X`09+ tested/augmented RAMSIZE configuration option (files main.c,
X`09  display.c), made a mode 'showram' to control it.
X
X`09+ merged field that shows major-modes in the modeline (e.g.,
X`09  "view-only"), and added "cmode" when it is active.
X
X`09+ added buffer-flag BFSIZES; use it in 'bsizes()' to compute byte/line
X`09  counts only when buffer has been changed.  Also, added function
X`09  'add_line_at()' to merge file-reading logic which initializes the
X`09  byte/line counts (files: buffer.c, file.c).
X
X`09+ if dos-mode is set on a buffer, trim carriage-returns from files that
X`09  are inserted into it (file file.c).
X
X`09+ renamed macros in file buffer.c that test BUFFER.b_flags, added
X`09  macros for setting/clearing these flags, moved the\3308to
X`09  estruct.h to use in files bind.c, buffer.c, file.c, history.c,
X`09  modes.c, random.c, spawn.c, tags.c, undo.c.
X
X`09+ corrected size shown for buffer-list within the \170Cdisplay
X`09  (file buffer.c).
X
X`09+ use window-colors for modelines rather than global values (file
X`09  display.c).
X
X`09+ disable ":p" command from within buffer-list display (oneliner.c)
X
XChanges for vile 3.50:
X(pgf)
X`09+ finished (yeah, right) the changes for infinite undo. implemented
X`09  mode to control how many changes are stored (called "undolimit").
X`09  the modified bit (BFCHG) now gets reset if the right number of
X`09  undos is done.  (estruct.h main.c modetbl undo.c buffer.c vile.hlp)
X
X`09+ rearranged calls to copy_for/tag\0806oss_to_undo and chg_buff
X`09  so that the BFCHG flag is unmodified before the first call to
X`09  preundocleanup().  this gives undo the true state of BFCHG.
X`09  (line.c region.c)
X
XChanges for vile 3.49:
X(pgf)
X`09+ implemented infinite undo, on keys `5EX-u (undo) and `5EX-r (redo).
X`09  probably affected location of cursor after some undo operations --
X`09  don't if this will be significant or not -- i doubt we matched
X`09  vi before in this regard anyway.  (undo.c, cmdtbl, buffer.c, proto.h
X`09  estruct.h, vile.hlp)
X
X`09+ use an explicit %s when printing lone filename, to protect against
X`09  filenames with % in name. (display.c)  (eric krohn)
X
X`09+ don't allow kbd_putc to print to last column of display, since if
X`09  the terminal autowraps, this causes a scroll.  this should check
X`09  the :am: capability, but we're at the wrong layer to do that, and
X`09  it doesn't seem worth adding to the TERM struct to make that info
X`09  available (unix-pc behavior pointed out by eric krohn).
X
X`09+ added Otto Lind's initial :map implementation (map.c, main.c,
X`09  cmdtbl, makefile, proto.h)  This is a good start, but has the
X`09  following limitations:  1) no string t\0A09maps.  only simple
X`09  keysequences are mappable.  2) not integrated with the keyboard
X`09  macro routines -- this would make sense, and allow for recursion
X`09  to be detected more properly.  but the keyboard macros are pretty
X`09  tied into the named registers, which are stored in KILLREGS,
X`09  which doesn't seem right for the :map'ed things.  perhaps we could
X`09  dispense with the KILLREGS, and replace them\2407bufs.  then some
X`09  small changes the layering of start/finish_kbm and kbm_started
X`09  could allow the :map code to share those routines.
X
X`09+ added alistair crooks' lint stuff and change for the NeXT. (proto.h,
X`09  mktbls.c)
X
X(tom)
X`09+ modified file undo.c so that changes to scratch buffers can be
X`09  undone.
X
X`09+ modified 'imply_alt()' in file buffer.c so that the top/current line
X`09  numbers are propagated into the alternate buffer.
X
X`09+ changed environment variable 'directory' to 'cwd' so that \1D0B
X`09  can be used for vi-compatible directory variable (used to control
X`09  where the temp-file is written).
X
X`09+ implemented environment variable 'directory' (files modetbl, eval.c)
X`09  and used it to control temp-file location (npopen.c, tmp.c).  This is
X`09  set by the environment variable TMP.
X
X`09+ changed logic that opens/closes temp-file in tmp.c to use 'tempnam()'
X`09  to derive the filename; added entrypoint 'tmp_cleanup()' to remove
X`09  the temp-file on exit, and 'exit_program()' to file main.c to make a
X`09  single exit-point from which to call 'tmp_cleanup()'.
X
X`09+ Use macro 'ExitProgram()' to hide whether we call 'exit_p\290Aor
X`09  'exit()' (files main.c, display.c, ibmpc.c, spawn.c, vmsvt.c, vt52.c,
X`09  termio.c, termcap.c, file.c, window.c, x11.c).
X
X`09+ modified 'mktbls.c' to generate definitions for 'nemode.h' in a
X`09  form that allows modes to be conditionally compiled.
X
X`09+ added a column to 'modetbl' to ifdef out modes that are not used.
X
X`09+ made 'crypt', 'fcolor' and 'b\0D07modes ifdef-able (files main.c,
X`09  modes.c, modetbl).
X
X`09+ simplified 'promptpattern()' and 'expandp()' in file isearch.c
X
X`09+ corrected USE_D_NAMLEN ifdef in 'expand_pattern()' (file glob.c)
X
X`09+ corrected behavior when user inserts a newline into an empty buffer
X`09  (file line.c).
X
X`09+ moved environment variable definitions from cmdtbl to mode\0B06
X`09  ensure that name-completion table for modes+vars is updated in one
X`09  place.  Sorted the environment variable names in modetbl and vile.hlp
X
X`09+ include "nevars.h" within main.c to allow common name-completion
X`09  table (without introducing lots of extra string-pointer variables).
X
X`09+ modified mktbls.c to put the environment-variable names into the
X`09  'all_modes`5B`5D' array in nemode.h (to support common name-completion).
V
X
X`09+ modified 'listvars()' in file eval.c to optionally show all modes
X`09  and environment variables in one list (if the user supplies a numeric
X`09  argument before the "show-variables" command).
X
X`09+ modified 'gtenv()' in file eval.c to recognize mode-names as well as
X`09  environment names, and logic in file modes.c to recognize \3A0B
X`09  names.  Thus, for example, the commands
X`09  `09":setl dos" and
X`09`09":setv $dos=true".
X`09  are equivalent.
X
X`09+ changed use of 'sprintf()' to 'l\100B(files buffer.c, modes.c)
X
X`09+ use macros 'FreeAndNull()' and\1406IfNeeded()' to simplify code
X`09  (buffer.c, eval.c, file\0808c.c, main.c, modes.c,
X`09  npopen.c, oneliner.c, search.c, random.c, x11.c)
X
X`09+ changed case-statements for EV-variables to if-then-else-if in
X`09  file eval.c because VAX-C cannot handle constant-expression
X`09  OFFSETOF as case-values.
X
X`09+ added 'tempnam()' to file vms2unix.c (to support testing of
X`09  mapped-data configuration).
X
XChanges for vile 3.48:
X(pgf)
X`09+ added FILEC_PROMPT flag to mlreply_file call in writeregion, to
X`09  make `5EW file-writing operator work.
X
X`09+ folded some long lines (opers.c filec\0807.c)
X(tom)
X`09+ corrections to make undo work properly with mapped-memory option
X`09  (files buffer.c and tmp.c).
X
X`09+ use symbol 'null_ptr' to tidy up references to '(LINE *)0'
X`09  (files buffer.c fences.c line.c main.c undo.c)
X
X`09+ changed LINE.l_size to SIZE_T (to make it lintable)
X
X`09+ corrected "poison" code in 'lfree()' (file line.c)
X
X`09+ added logic to finderr.c to handle lint output on apollo.
X
X`09+ added logic to handle line truncation (files buffer.c, file.c,
X`09  line.c, tmp.c)
X
X`09+ added function 'l_region()' to file tmp.c; use this (with some
X`09  reorganization) in files file.c, oneliner.c, region.c, word.c to
X`09  track LINEPTR adjustments in REGION structs.  (Converted most of the
X`09  calling procedures to single-return to clarify this).
X
X`09+ moved options-logic in 'substreg1()' (file oneliner.c) down to make
X`09  this simpler (and avoid unnecessary goto).  (This procedure has too
X`09  much logic to convert to single-return).  Also fixed a place that
X`09  should have used 'end_string()'.
X
X`09+ used macro 'same_ptr()' to compare LINEPTR's directly (a bit more
X`09  efficient).
X
X`09+ implemented page-swapping logic in file tmp.c
X
X`09+ modified ifdefs in files bind.c, eval.c, finderr.c to get rid of
X`09  compiler warnings when SMALLER, REBIND and APROP ifdefs are turned
X`09  off.
X
X`09+ used 'memcpy()' an\0F06set()' in files buffer.c, line.c to simplify
X`09  loops copying text into LINE's.
X
X`09+ modified interfaces of functions that may\2A06y 'LINE *' pointers
X`09  (or, equivalently, cause swapping of a LINE to a different address)
X`09  to use LINEPTR arguments (for example, 'line_no()' can iterate over
X`09  all lines, causing swapping).  Also modified functions (especially in
X`09  files line.c and undo.c) to use LINEPTR variables where they call
X`09  lower-level functions that may page-swapping.  Affects files
X`09  buffer.c, display.c, exec.c, file\0808c.c, input.c, line.c,
X`09  oneliner.c, random.c, region.c, search.c, vmalloc.c, word.c
X
X`09+ replaced call on 'lalloc()' in file exec.c with 'addline()' (only
X`09  difference is that the latter also sets b_dot).
X
X`09+ converted several functions in file undo.c to static (to simplify
X`09  tinkering with LINE/LINEPTR tradeoffs).
X
X`09+ modified calls on 'lalloc()' in file undo.c to use special codes for
X`09  l_used member directly.
X
X`09+ added options -Wconversion -Wstrict-prototypes -Wmissing\150B
X`09  to gcc flags in makefile; addressed these warnings (except for
X`09  'signal()' arguments, which cannot be fixed) on sunos.  Modified
X`09  files bind.c, file\0808c\1108io.c, glob.c, insert.c, line.c,
X`09  path.c, random.c, region.c, spawn.c, tcap.c.
X
X`09+ corrected ifdef in 'string_has_wildcards()' (file glob.c) for VMS.
X
XChanges for vile 3.47:
X(tom)
X
X    (part a)
X`09+ introduced 'l_ref()' and 'l_ptr()' functions, rippled-through changes
X`09  to support mapped data (files basic.c buffer.c csrch.c display.c
X`09  estruct.h eval.c exec.c fences.c file\0707c.c finderr.c globals.c
X`09  history.c insert.c line.c oneliner.c path.c proto.h random.c region.c
X`09  search.c spawn.c tags.c tmp.c undo.c window.c word.c)
X
X`09+ added logic to file tmp.c to allocate LINE structs from a pool of
X`09  pages (note that deallocation isn't done, nor is swapping to a
X`09  tmp-file as yet).
X
X    (part b)
X`09+ added code to test return-value of 'glob()' in file eval.c
X
X`09+ corrected 'get_recorded_char()' (file input.c) to reset 'buffer'
X`09  variable after 'finish_kbm()' makes it obsolete.
X
X`09+ provided more useful defaults for TERMCAP, IBMPC and COLOR
X`09  definitions in file estruct.h
X
X`09+ corrected value of MK in 'FreeBuffer()' (file buffer.c), which caused
X`09  multiple frees of the same LINE struct.
X
X`09+ supplied initialization for wp->w_dot.l and \1006line.l in
X`09  'reframe()' (file display.c) to handle the case when vile is invoked
X`09  with no filename parameters.
X
XChanges for vile 3.46:
X(pgf)
X`09+ suppress attempts at reading a null file into the `5Bvileinit`5D
X`09  buffer (main.c)
X
X`09+ don't require the d_namlen field in a DIRENT struct -- some systems
X`09  don't have it, and most of those that do null terminate the name
X`09  anyway.  (dirstuff.h, filec.c, glob.c, path.c)
X
X`09+ changed compile flags for uts, on user suggestion (makefile)
X
X`09+ in ffread(), after doing \1408do an fseek to sync up.  this
X`09  keeps some stdio implementations from not bothering to seek back
X`09  to the start in case we have to discard the read and resort to
X`09  slowreadf() due to long lines. (fileio.c)
X
X`09+ avoid realloc(ptr,0) when long lines are encountered in quickreadf()
X`09  (file.c)
X
X`09+ make M and L commands take account of too few lines in window (i.e.
X`09  do the right thing when end of file is on screen). (basic.c)
X
X`09+ even if the global dos-mode is on, empty (new) buffers should come
X`09  up as non-dos.  (file.c)
X
X`09+ fnc2engl() now tries to return a longer, meaningful name for a
X`09  function (i.e. "exit" rather than "Q"). (bind.c)
X
X(tom)
X`09+ test-compiled VMALLOC, DEBUGM options on apollo.
X
X`09+ introduced 'set_lforw()' an\1208back()' macros to use in mapped
X`09  memory option.  Added stubs in new file 'tmp.c'.  Modified files
X`09  buffer.c exec.c file\0707c.c line.c undo.c, verified mechanically.
X
X`09+ added definition of LINEPTR and 'lsync()' to files estruct.h, proto.h
X
X`09+ fixed a memory leak in 'glob()', and changed interface to
X`09  'glob_free()' (files filec.c, glob\0808.h).
X
X`09+ revised logic in ibmpc.c that sets screen resolution ($sres) to
X`09  make it more table-driven.
X
X`09+ corrected 'forwline()' in file basic.c (repeated movement down
X`09  sometimes reset the cursor to column 1 unlike vi).
X
X`09+ added prototypes to 'mktbls.c'.
X
X`09+ modified file main.c so that if the standard input isn't a terminal
X`09  then vile reads it into a buffer and reopens /dev/tty (unix only).
X
X`09+ modified files main.c and epath.h to allow (for unix systems) vile
X`09  to find vile.hlp even if vile isn't in the path.
X
XChanges for vile 3.45:
X(pgf)
X`09+ got rid of LOOKTAGS mode, and all of its ifdefs (filec.c, main.c,
X`09  modetbl, proto.h, tags.c)
X
X`09+ got rid of NeWS ifdefs (basic.c, bind.c, buffer.c, edef.h,
X`09  estruct.h, exec.c, file.c, input.c, isearch.c, main.c, modes.c,
X`09  spawn.c, termio.c)
X
X`09+ resolved vile.hlp modes documentation and modetbl (\2A08)
X
X`09+ added missing mlreply call in goto-named-mark processing, to
X`09  allow "goto-named-mark a" to be used in a command file. (basic.c,
X`09  proto.h)
X
X`09+ added man page (don't get excited -- it's short), and turbo makefiles
X`09  vile.mak, mktbls.mak.  (makefile)
X
X`09+ fix to ins/inschar/istring to correct for bad backspace limiting
X`09  (insert.c)
X
X`09+ fixed off-by-one bug for column count under X. (x11.c)
X
X`09+ turned off typahead detection for X11.  updates were being held
X`09  off incorrectly. (termio.c)  related change, possibly unnecessary:
X`09  reordered initial mlforce() an\160Aupdate() in main, because
X`09  xvile was not starting up properly.
X
X`09+ no longer set _bspace bit in _chartypes`5Bbackspc`5D, and is\1006ace()
X`09  macro tests backspc directly.  will make rebinding of\2A07ace
X`09  simpler. (estruct.h, termio.c)
X
X`09+ some changes to set-terminal stuff -- took out the keys that can
X`09  be rebound with bind-key, i.e. those that have effect only in
X`09  command mode.  added help.  (bind.c, vile.hlp)
X
X`09+ no longer strip the SPEC bit in ttgetc, so a meta key can be used
X`09  to generate "function keys"  (termio.c, vile.hlp)
X
X`09+ updated README
X
XChanges for vile 3.45:
X(tom)
X
X`09+ more fixes for long/int complaints from TurboC (files tags.c spawn.c
X`09  random.c main.c display.c bind.c).
X
X`09+ added logic to fileio.c so that (MSDOS only) overwriting a file
X`09  saves the old version renamed to ".bak" suffix.
X
X`09+ simplified argument processing in file main.c; reduced size a little.
X
X`09+ reorganized code that uses tungetc so\1506it isn't used as often.
X`09  This also makes 'tpeekc()' obsolete.  Moved extern-defs for 'tungotc'
X`09  to edef.h (files input.c, exec.c, globals.c, oneliner.c, termio.c).
X
X`09+ modified 'setvar()' in eval.c to show warning message if attempt is
X`09  made to modify a readonly variable, or if for some other
X`09  reason an environment variable cannot be set.
X
X`09+ modified 'ibmcres()' in ibmpc.c to allow user to reset using value of
X`09  CDSENSE as argument.
X
X`09+ corrected inequality-test in 'newscreensize()' (file display.c) that
X`09  prevented user from correctly setting $sres back to VGA in IBMPC
X`09  config.
X
X`09+ renamed entrypoints in file crypt.c to 'ue_setkey()' and 'ue_crypt()'
X`09  to avoid confusion with unix crypt(3) (files fileio.c, file.c
X`09  crypt.c, main.c, cmdtbl).
X
X`09+ corrected core dump when using encryption from command line by
X`09  splitting out 'ue_makekey()' from 'ue_set\1306; used this from
X`09  'resetkey()' in file.c
X
X`09+ corrected handling of -k (crypt option); added a global 'cryptkey'
X`09  which is used to set the encryption key only in files listed as
X`09  command arguments (files edef.h, main.c, buffer.c).
X
X`09+ overwrite -k parameter value in main.c (for those systems where this
X`09  has an effect, it changes the value shown in a "ps" command).
X
X`09+ made 'quickreadf()' decrypt file.
X
X`09+ corrected 'resetkey()' so that it doesn't automatically use crypt key
X`09  for files that aren't the same as the buffer.
X
X`09+ The prompt added to 'resetkey()' also required moving some calls on
X`09  'ttclean()' (file.c).  Simplified some of the \2D07 code using
X`09  CleanToPipe and\1006AfterPipe macros.
X
X`09+ corrected 'resetkey()' so that if no password is provided (at least
X`09  for pipes), the operation will proceed properly (i.e., read/write
X`09  without encryption).
X
X`09+ modified 'modeline()' in display.c to show if the current buffer is
X`09  encrypted.
X
X`09+ made NAMEC and TESTC define to variables name_cmpl and test_cmpl,
X`09  which can be modified at run-time (files estruct.h, edef.h).
X
X`09+ added commands "set-terminal" and "show\140Bto set/show special
X`09  characters (including NAMEC/TESTC values!).  Put this into file
X`09  bind.c (reusing pieces of 'bindkey()').
X
X`09+ make '#' (special prefix-key) rebindable, like cntl_a-\2406.
X
X`09+ make display-routines in bind.c show the actual characters to which
X`09  CTLA and CTLX are bound (function 'kcod2str()').  Note that
X`09  'prc2kcod()' still assumes that CTLA and CTLX are bound to control
X`09  characters.
X
X`09+ changed argument type of TERM.t_cres to 'char *' to allow consistent
X`09  usage of variable 'sres`5B`5D' (files tcap.c, ibmpc.c, z_\0B07).
X
X`09+ changed values recognized by ibmpc.c for "$sres" to be the names
X`09  that it returns (e.g., "VGA") and the number-of-lines (from main.c's
X`09  arguments).
X
X`09+ finished off 'npopen()' for MSDOS (allows write-pipes) and
X`09  implemented 'inout_popen()'; used in file spawn.c for filter-region
X`09  command.
X
XChanges for vile 3.44: (pgf)
X`09+ fixed indentation if openup used in cmode, with a single word on
X`09  the current line -- indentation was coming from the _next_ line,
X`09  instead (insert.c).
X
X`09+ finderrbuf() now remembers its last argument (\2E07.c)
X
XChanges for vile 3.44:
X(tom)
X`09+ corrected file descrip.mms; the vms_link.opt\2306no longer applies
X`09  to mktbls.exe; also fixed 'clobber' rule.
X
X`09+ corrected file glob.c (don't treat '$' as a wildcard on vms).
X
X`09+ correction: moved call on 'global_val_init()' before
X`09  'expand_wild_args()', to make wildcard globbing work on vms and
+-+-+-+-+-+-+-+-  END  OF PART 17 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 18 -+-+-+-+-+-+-+-+
X`09  ms-dos (file main.c).
X
X`09+ corrected logic of 'kbd_reply()'; last_eolchar was not being set
X`09  properly when NAMEC wasn't space (file input.c).
X
X`09+ modified 'kbd_engl_stat()' in file bind.c so that if NAMEC is not
X`09  bound to space, then name-completion for :-commands is turned on.
X
X`09+ added option KBD_NULLOK to 'kbd_reply()' and used it in function
X`09  'kbd_engl_stat()' to re-allow commands to be empty (files bind.c,
X`09  input.c, estruct.h), needed after decoupling NAMEC and space.
X
X`09+ corrected 'slowreadf()' in file file.c so that dos-mod\1806s are
X`09  read properly.  (The code stripped CR's even when dos-mode wasn't
X`09  set).
X
X`09+ implemented 'npopen()' and 'npclose()' for MSDOS; used this to make
X`09  MSDOS logic for `5EX-!  the same as on UNIX (modified files fileio.c,
X`09  npopen.c, spawn.c).
X
X`09+ modified 'makename()' to yield essentially the same result for
X`09  MSDOS as for UNIX (in file.c), because 'npopen()' works similarly.
X
X`09+ added tests in 'ffropen()' and 'ffw\1008to prevent accidentally
X`09  opening a directory-file.
X
X`09+ corrected handling of FIOFNF in 'readin()'; made this work on MSDOS
X`09  as well as UNIX (files file.c, fileio.c, display.c).  The value of
X`09  'errno' was not being saved to report in the error message.  Added
X`09  'mlerror()' to display.c to encapsulate the error reporting better.
X
X`09+ moved 'errno' declarations into 'estruct.h' (files display.c, file.c,
X`09  npopen.c, termio.c).
X
X`09+ added function 'set_febuff()' to encapsulate the '\1E06`5B`5D' and
X`09  'newfebuff' variables; moved these to finderr.c (files file.c,
X`09  finderr.c, spawn.c).
X
X`09+ corrected test in 'filename()' (file.c) for ":f" command.
X
X`09+ corrected test in filec.c for pre-existing file (don't prompt if it
X`09  is a pipe-command).
X
X`09+ corrected tests in filec.c for prompt for re-read (didn't look for
X`09  abort-status).
X
X`09+ test-compiled CRYPT, VMALLOC configuration flags on TurboC.  Modified
X`09  files crypt.c, estruct.h, vmalloc.c
X
X`09+ began addressing TurboC warnings for conversion between long/int.
X
X`09+ deleted obsolete defines in file estruct.h (CLRMSG, CTRLZ).
X
X`09+ added 'set_rdonly()' to encapsulate the places where an automatically
X`09  created buffer is made read-only.  This makes them more consistent.
X`09  Files: bind.c, exec.c, main.c, oneliner.c, random.c, spawn.c
X
X`09+ modified 'update()' in file display.c so that '.' commands don't
X`09  redisplay if VISMAC is configured (previously, only keyboard macro
X`09  redisplay was suppressed).
X
XChanges for vile 3.43:
X(pgf)
X`09+ changed NAMEC from SPACE to TAB (estruct.h). \2E09eolchar arg
X`09  passed to kbd_reply in kbd_engl_stat from NAMEC to ' ', to
X`09  compensate.  added check against command term'ed with ' ' in
X`09  execute_named_cmd() (exec.c).
X
X`09+ added check for iswild() when scanning for wildcard chars in glob.c
X
X`09+ allow nulls as well as newlines to separate filenames in glob-pipe
X`09  output.
X
X`09+ added finderrbuf() routine (command is "error-buffer" or "find-next-
X`09  error-buffer-name"), to set the name of the \2606 to scan for\3F06s.
X`09  (finderr.c, proto.h, cmdtbl, vile.hlp)
X
X`09+ fixed pathname bug when scanning output that contains Entering/
X`09  Leaving pairs.  We no longer just keep a pointer to where we
X`09  found the directory name, but now malloc space for it.
X
X`09+ horizontal scrolling moves by half screens by default (window.c,
X`09  display.c)
X
X`09+ added AIX to machines that need sys/ioctl.h (termio.c, display.c)
X
X`09+ further fix to repeat counts and the '.' command, so that all cases
X`09  ( 6dw , 3d2w , etc.) work.
X
X`09+ support for letting a named register on a '.' command override
X`09  what was originally typed:  "adw"b.  will put one word in register
X`09  a and the nex in register b.  (input.c line.c exec.c)
X
X(tom)
X`09+ corrected define in dirstuff.h to make TurboC compile again.
X
X`09+ corrected logic of 'makename()' in file.c for MS-DOS.
X
X`09+ added type CMASK to correct use of _chartypes`5B`5D array on MS-DOS
X`09  (e.g., in 'screen_string()' in input.c).
X
X`09+ deleted VMS-DCL file 'vile.com', since this causes conflict on
X`09  MS-DOS.
X
X`09+ lowercased color names in file modes.c
X
X`09+ modified ibmpc.c to get true white and yellow colors (had gray and
X`09  brown).
X
X`09+ modified files ibmpc.c and display.c to allow MS-DOS version to do
X`09  scrolling.
X
X`09+ removed unused assignments from file insert.c
X
X`09+ substituted all l_fp references to lforw macro, l_b\200F
X`09  lback macro, verified mechanically.
X
X`09+ make special case in 'dotcmdplay()' to allow (like vi) the repeat
X`09  count on '.' command to replace that on the replayed \2807.
X
X`09+ modified logic of 'writereg()' to allow its call on 'imply_alt\2306
X`09  correctly set the 'copy' parameter (only if a whole file is written).
X
X`09+ introduced new function 'same_fname()' to correct places where
X`09  matches between a filename and the buffer's \1A09broke (either
X`09  because it was not in canonical form, or\2909VMS version numbers
X`09  were not stripped).
X
X`09+ modified fileio.c to read/write binary files on MS-DOS to avoid
X`09  truncating files at `5EZ.  This does not make `5EM visible however.
X
X`09+ ifdefd out contents of 'dot_replays_macro()' in input.c to avoid
X`09  side-effects
X
X`09+ corrected logic of 'tungetc()' in file input.c; this had broken
X`09  replay of keyboard macro "iX<esc>/Y`5EMaZ<esc>".
X
X`09+ split out 'expand_wild_args()' from main.c into a new file glob.c,
X`09  which contains globbing code.  Moved 'glob()' from path.c to glob.c
X`09  also.
X
X`09+ moved function 'is_directory()' from filec.c to path.c; made it
X`09  public.
X
X`09+ added function 'no_memory()' to encapsulate the more common places
X`09  that vile/msdos runs out of memory; use this in several places to
X`09  simplify error reporting.
X
X`09+ added universal-mode "history", to allow turning that function off,
X`09  and instrumented history.c to automatically turn logging off if vile
X`09  runs out of memory.  (It is annoying to get out-of-\2706 errors on
X`09  _every_ command).
X
X`09+ modified display.c to fill in the long space before program `26 version
X`09  identifier for the scratch buffer (on the mode line).
X
X`09+ added option to 'mlreply_file()' to allow expansion of wildcard to
X`09  multiple files.  Use this in file.c (for ":e" and ":view" commands).
X
X`09+ modified files descrip.mms and vms_link.opt because (with new module
X`09  glob.c) the link-command line got too long.  Other mods to file
X`09  descrip.mms to make file vile.com generated (to avoid leaving it
X`09  around for ms-dos configuration), and the 'clean' and '.last' rules
X`09  (to make them less noisy).
X
X`09+ corrected 'ffronly()' in fileio.c; on VMS this caused some files to
X`09  be touched.
X
X`09+ implemented scrolling in file vmsvt.c
X
X`09+ implemented 'glob' mode to control how wildcards are expanded
X`09  (affects files main.c, modes.c, glob.c) and the corresponding piped
X`09  commands for glob-mode.
X
X`09+ added logic to 'makename()' to handle embedded blanks in filenames.
X
XChanges for vile 3.42:
X(pgf)
X`09+ added routine tb_stuff() (tbuff.c), which is roughly the
X`09  converse of tb_peek(), to allow simple replacement of a character
X`09  in a tbuff.
X
X`09+ used tb_stuff() to increment the buffer number when referencing
X`09  the numbered buffers -- i.e. "1p becomes "2p in a '.' command.
X`09  (input.c)
X
X`09+ backed out change to 'get_recorded_char()' (input.c) that caused
X`09  dd..."1P... to continue deleting lines after the P operation.
X
X`09+ added horizontal scrolling mode, to cause whole screen to shift
X`09  instead of just one line when cursor goes "off screen".  this
X`09  mode ("set hs", or \0D06orizscroll" is now the default. (display.c,
X`09  vile.hlp, main.c, modetbl, proto.h)
X
X`09+ allow cursor to rest in last column, if line is just that long, to
X`09  prevent extra horizontal scrolling. (display.c)
X
X`09+ split up the ins() function, to provide an inschar\220B that
X`09  istring could use.\1409() now called by ins\1A09and
X`09  overwstring(), which are bound to "insert-\2506" and new
X`09  "overwrite-string" commands.  all this to allow "insert\2D08
X`09  to take advantage of autoindent, cmode, wordwrap, etc.  will
X`09  need tweaks later when tty chars are rebindable (`5EU, `5EW, etc.)
X
X`09+ compiled with "-Wmissing-prototypes", which turned up a bunch of 'em.
X`09  (proto.h)
X
X`09+ some linux gcc cleanup, mostly just including\2E06more headers
X`09  (display.c file.c main.c)
X
X`09+ ifdefed out the onamedcmd() function, and it's binding (cmdtbl,
X`09  exec.c)
X
X`09+ took out the extern declarations of getpwnam and\0D06uid that i
X`09  put in recently.  they seem to be causing more problems than they
X`09  were fixing.  in general, providing prototypes for system routines
X`09  is a real pain.  i wish there were an "ifnprototype" construct.
X
XChanges for vile 3.41:
X(tom)
X`09+ ifdef ioctl.h for APOLLO (note: you shouldn't use '"'-form for system
X`09  includes, since that could pick up files in the current directory,
X`09  and also because it does weird things to the include-path).
X
X`09+ moved code to support USE_LS_FOR_DIRS from filec.c to path.c, making
X`09  it look like unix-style directory routines.  Added ifdef for
X`09  OLD_STYLE_DIRS just in case...
X
X`09+ modified 'slowreadf()' in file.c so that piped input scrolls from the
X`09  bottom of the window, rather than the middle.
X
XChanges for vile 3.40:
X(pgf)
X
X`09+ the makefile no longer supplies any -I options.  this will cause some
X`09  machines to not find "ioctl.h" where it's in the sys subdirectory,
X`09  but I just spent a day tracking a bug caused by pi\1806up the wrong
X`09  system headers (i needed the gcc "fixincludes", and they had moved).
X
X`09+ now honor LINES and COLUMNS in getscreensize (display.c)
X
X`09+ now handle searching multiple tags files specified in "set tags"
X
X`09+ bugfix to fences.c, which fixes indentation when inserting '`7D'
X
X`09+ added firstnonwhite() calls to godotplus, so we can publish it as
X`09  "whole-lines" (files basic.c, cmdtbl).
X
X`09+ added 'setjmp()' code to files main.c, input.c to handle `5EC with
X`09  BSD-style signals.
X
X`09+ added define USE_LS_FOR_DIRS to files dirstuff.h and filec.c to
X`09  accommodate systems w/o a 'readdir()' function.
X
X`09+ corrected $pagewid (was returning length instead of width) in file
X`09  eval.c
X
X`09+ use lsprintf to form `5BMacro nn`5D names (file exec.c)
X
X(tom)
X`09+ corrected 'ffwopen()' in fileio.c so that write of current buffer on
X`09  VMS works properly (forgot to strip version number).
X
X`09+ made 'flook()' work properly for vms (file bind.c)
X
X`09+ moved 'dname`5B`5D' table into file exec.c and 'c\2517
X`09  modes.c; did this to get rid of 'comma' macro, which does not work as
X`09  intended on Turbo-C (the comma got evaluated too soon).
X
X`09+ to prevent redefinition error in Turbo-C, removed redundant includes
X`09  for <stdio.h>, <string.h> and <signal.h> (already in file estruct.h)
X`09  from the ".c" files: ansi.c at386.c basic.c bind.c buffer.c crypt.c
X`09  dg10.c display.c eval.c exec.c file.c globals.c hp110.c hp150.c
X`09  ibmpc.c input.c isearch.c line.c main.c modes.c npopen.c oneliner.c
X`09  regexp.c region.c search.c spawn.c st520.c tcap.c termio.c tipc.c
X`09  vmsvt.c vt52.c window.c word\0707mov.c x11.c z309.c z_ibmpc.c
X
X`09+ moved macro 'P' from file proto.h to estruct.h, adjusted definitions
X`09  in file 'estruct.h' to allow use of 'P' macro in CMDFUNC definition.
X`09  Added definition of type 'CmdFunc' for the actual pointer-type.
X
X`09+ use P-macro for TERM struct definitions (and added TTscroll),
X`09  modified files estruct.h and display.c
X
X`09+ corrected logic of 'dot_replays_macro()' in file input.c (for the
X`09  special case of macro "@w" followed by "dd" command, I noticed that
X`09  '.' replayed both commands).
X
X`09+ compiled with Turbo-C, turned on warning if function was called w/o a
X`09  prototype.  Added\120As (including those for static procedures)
X`09  to get rid of these and other compiler warnings.  Doing this found an
X`09  error in eval.c and one in history.c (files modified: bind.c buffer.c
X`09  display.c eval.c exec.c fences.c file\0707io.c history.c ibmpc.c
X`09  input.c insert.c main.c mktbls.c modes.c npopen.c opers.c path.c
X`09  random.c regexp\0906ion.c spawn.c tbuff.c window.c).
X
X`09+ corrected MSDOS-specific pathname translation in files path.c and
X`09  random.c
X
X`09+ corrected d_namlen value supplied in readdir function for VMS (file
X`09  vms2unix.c)
X
X`09+ implemented first version of filename completion for VMS.  (Directory
X`09  names are not completed; there are still some ambiguities between
X`09  scratch buffer names and VMS directory paths).
X
X`09+ added option KBD_UPPERC to input.c; use this to force prompts for VMS
X`09  filenames to uppercase.
X
X`09+ removed redundant declarations for 'getenv()'; it is already in file
X`09  estruct.h
X
X`09+ added new file 'vmspipe.c' which provides a piped-read facility
X`09  'vms_rpipe()'.
X
X`09+ modified file finderr.c to recognize lint output on SUNOS; also
X`09  corrected it to ensure that sscanf doesn't scan past the string
X`09  limits (no EOS was formerly on each line).
X
X`09+ added/used new functions 'pathleaf()' and 'pathcat()' to file path.c
X`09  to hide vms/unix pathname differences.
X
XChanges for vile 3.39 (from Tom Dickey):
X
X`09+ corrected error in 'get_recorded_char()' (file input.c) that caused
X`09  command "ix`5E`5Bj.j.j.j." to not repeat properly.
X
X`09+ corrected prompt-string in 'ShellPrompt()' (file spawn.c)
X
X`09+ corrected behavior of filename completion (file filec.c) so that
X`09  internal names and shel\1008can have blanks in them.
X
X`09+ provided a last-replay value for 'execfile()' in file exec.c (it was
X`09  defaulting to the current buffer, which is wrong).
X
X`09+ corrected pointer test in 'tb_sappend()', which was null in the
X`09  special case of a ":w" command before any ":e" or other read.
X
X`09+ simplified MSDOS-drive translation (untested) in file random.c to
X`09  accommodate changes made for VMS in other files.
X
X`09+ modified 'cd()' procedure in file random.c to chdir to home directory
X`09  on systems that have one.
X
X`09The following are changes to support VMS:
X
X`09+ added new files (shown in makefile and descrip.mms): dirstuff.h,
X`09  vms2unix.c, vile.com
X
X`09+ use new file 'dirstuff.h' for definitions in filec.c and path.c
X
X`09+ corrected some dependencies in descrip.mms
X
X`09+ corrected logic in 'imply_alt()' (file buffer.c) that lost the
X`09  original filename argument (replaced it with the lengthen-path).
X
X`09+ corrected logic in 'getfile()2' (file file.c) to account for the
X`09  distinction between buffer-names and file\0F06.  Simplified
X`09  'getfile()' and\10092()' because of modifications to
X`09  'shorten_path()' and 'length\160A.
X
X`09+ corrected logic of 'ffread()' (file fileio.c); on VMS a single read
X`09  does not necessarily read an entire file.
X
X`09+ corrected definition of macro 'isready_c()' for VMS.
X
X`09+ modified 'shorten_path()' (file path.c) to provide the "./" prefix
X`09  that was added in files buffer.c and display.c; also absorbed the
X`09  test for MSDOS device prefix (e.g., "c:") there.  This was needed to
X`09  allow VMS port to show native pathnames.  The equivalent of "./" on
X`09  VMS is "`5B`5D".
X
X`09+ use VMS function 'fgetname()' and '\100Bto determine the
X`09  fully-resolved path in 3 cases: after writing a file,\1607reading a
X`09  file, and in 'lengthen_path()' (files file.c and path.c).  This makes
X`09  it know the current version number of each file.
X
X`09+ modified 'makename()' (file file.c) to account for VMS pathnames.
X`09  Note that DecShell names (which the C runtime library accepts as
X`09  arguments to fopen, etc.) look much like unix filenames.
X
X`09+ added new function 'is_internalname()' to file path.c; this serves
X`09  the same purpose as the (now obsolete) macro isScratchName.  This
X`09  makes a better check (to keep VMS paths distinct from scratch buffer
X`09  names) than the macro.
X
X`09+ deleted macro isScratchName from file estruct.h; chang\3108
X`09  isInternalName to use function 'is_i\2107name()'.  Adjusted other
X`09  macros in estruct.h and display.c to make VMS port work properly.
X
X`09+ added new function 'non_filename()' to file path.c; use this in files
X`09  bind.c and random.c to encapsulate the program+version string.  Use
X`09  'non_filename()' in 'is_internal\1707.
X
X`09+ corrected logic of 'screen_string()' (file input.c) to handle the
X`09  distinction between "`5B" and "`5D" used to delimit pathnames on VMS, and
V
X`09  to indicate scratch-buffer names.
X
X`09+ corrected wildcard, path and scratch-buffer characters for VMS (file
X`09  main.c).
X
X`09+ corrected/modified file path.c so that the functions therein support
X`09  VMS filenames.  Added several new functions to do this.
X
X`09+ corrected code for 'catnap()' (file random.c) for VMS.
X
X`09+ corrected several 'exit()' arguments (file termio.c)
X
X`09+ corrected VMS's ttgetc function (its intera\1106with 'typahead()'
X`09  was wrong; also 'typahead()' was not really implemented (file
X`09  termio.c).
X
X`09+ ifdef'd out a redundant 'ttclean()' call (which caused the output on
X`09  VMS to be closed more than once, which is really an error).
X
X`09+ guard 'vtinit()' (file vmsvt.c) against t_mcol or t_mrow too small
X
XChanges for vile 3.38:
X(pgf)
X`09+ cleaned up internal naming and help for alt-tabpos mode.
X`09  alt-tabpos on implies emacs-style, and it's off by default
X
X(tom)
X`09+ corrected status-check in 'ffclose()' (in fileio.c) that generated
X`09  spurious 'Error on close' message, visible when nothing was read from
X`09  a pipe.  (Also eliminated redundant defs for 'npopen.c' in fileio.c
X`09  and proto.h).
X
X`09+ corrected place in 'globals.c' where (if the buffer was readonly),
X`09  the '/' delimiter after an s-command was not eaten.
X
X`09+ modified loop-limit in "show-registers" command to display the
X`09  numbered registers.
X
X`09+ corrected file fences.c, allowing C preprocessor lines to have
X`09  leading whitespace before '#'.  The cursor may be on any character
X`09  from the first column through the '#'.
X
X`09+ rewrote procedure 'cpp_fence()' in file fences.c, allowing it to
X`09  recognize "elif" keyword.  Added 'nextchar()' to file basic.c to
X`09  support this.
X
X`09+ modified procedure 'ShellPrompt()' in file spawn.c to eliminate the
X`09  ": " before prompts for `5EX-!.
X
X`09+ corrected 'kbd_reply()' in file input.c to invoke 'tgetc()' directly
X`09  when `5EV is used to escape a character.
X
X`09+ corrected 'kbd_kill_response()' in file input.c; `5EW is not supposed
X`09  to trim blanks before a word.
X
X`09+ corrected 'update()' in file display.c; the VISMAC define does not
X`09  apply to "." command.  This fix allows showmatch to work with "."
X`09  command.  Also, in 'fmatch()' in file fences.c; test return-value of
X`09  'update()' to avoid catnap when \1F06 fails.
X
X`09+ corrected 'insert()' an\0F09bol()' in file insert.c; the cursor
X`09  was not being advanced after repeated insertions like vi.
X
X`09+ corrected file input.c so that it can handle a "." command within a
X`09  keyboard macro.  The\0C06 was "iA`5E`5Bl2." (for testing).
X
X`09+ modified file input.c (new procedure 'dot_replays_macro()' so that
X`09  the "." command after defining or executing a keyboard macro causes
X`09  the macro to be (re)invoked.
X
X`09+ split 'kcod2prc()' in file bind.c into 2 parts; the new one (i.e.,
X`09  'kcod2str()') is used to support 'dot_replays_macro()'.  Also use new
X`09  function 'fnc2kcod()'.
X
X`09+ added new function 'kbm_started()' to file input.c to get rid of then
X`09  non-recursive variable 'kbdplayreg'.
X
X`09+ save/restore "." repeat counts in 'start_kbm()' and 'finish\1308so
X`09  that repeat works properly for keyboard macros.
X
XChanges for vile 3.37:
X(pgf)
X`09+ works on osf/1 alpha now, with hacks applied to termio.c and
X`09  display.c
X(tom)
X`09+ added files 'descrip.mms' and 'vms_link.opt'; compiled on VAX/VMS
X`09  (but did not make it run) (tom dickey)
X
X`09+ pathname tracking fixes (calling shorten_path() correctly everywhere)
X
XChanges for vile 3.36 (from Tom Dickey):
X
X`09+ supplied initial value for dirc-mode
X
X`09+ guarded 'mlreply_file()' against missing curbp->b_fname (for use in
X`09  .vilerc startup).
X
X`09+ corrected logic in 'kbd_reply()' (file input.c) that caused backspace
X`09  to be treated as a command-delimiter.
X
X`09+ corrected logic in 'kbd_reply()' (file input.c) that caused '/'
X`09  character in complex substitutions to be eaten, e.g.,
X`09`09:g/pattern/s//new\0E08g
X`09  broke after the 's'.
X
X`09+ corrected calls (broke in 3.35) on 'mlreply_file()' from 'ins\1107
X`09  and 'operwrite()' (mods to files estruct.h, filec.c\0906.c and
X`09  opers.c).  The `5ER and `5EW commands always prompt for name, rather than
V
X`09  taking it from the screen.
X
X`09+ corrected end-of-line logic in 'do_a_mode()' (file modes.c).  This
X`09  had allowed history scrolling to display keywords that were separated
X`09  by blanks; fixed this by testing for both space and "=" characters.
X
X`09+ added calls to 'hst_glue()' in 'unqname()' and 'getfile2()' to add
X`09  blank in command history before the responses these functions solicit
X`09  from 'mlreply()'
X
X`09+ added macro 'char2int()' to file estruct.h, use this in fileio.c and
X`09  tbuff.c to hide byte-masking.
X
X`09+ changed data in TBUFF to 'char' (unsigned char does not buy that much
X`09  conciseness); absorbed macros 'tb_values()' and 'tb_length()' into
X`09  file tbuff.c as functions.
X
X`09+ corrected logic of 'tb_leaks()' (file tbuff.c); I had only exercised
X`09  this at the end of execution.
X
X`09+ removed unused define for TMPSTOP
X
X`09+ recoded handling of keyboard macros in file input.c to use TBUFF
X`09  structs (so there is no limit on length of keyboard macros).
X
X`09+ modified 'execkreg()' to remove length-limit on macros there as well
X`09  (file line.c)
X
X`09+ modified 'execkreg()' to allow invoking registers 0-9 (file line.c)
X
X`09+ modified files input.c and line.c so that "." and @-commands can be
X`09  invoked from within a keyboard-macro (i.e., `5EX-`26).
X
X`09+ modified files insert.c and input.c so that repeated "." command
X`09  works properly for i,I,R commands (the cursor must appear at the end
X`09  of the insertion).
X
X`09+ modified so that `5EZ (job suspension) works properly on apollo sr10.3
X`09  (files termio.c and spawn.c).
X
X`09+ modified 'ttgetc()' in file termio.c so that (for apollo) it reads in
X`09  raw-mode.
X
X`09+ added flag to 'tgetc()', allowing it to suppress the conversion of
X`09  intrc to abortc (files basic.c csrch.c eval.c exec.c input.c
X`09  insert.c).  This change also lets users quote ESC characters.
X
X`09+ corrected unused args in 'globber()' (file globals.c)
X
X`09+ corrected special case in use of 'canonpath()' on apollo (user could
X`09  type in path beginning with "/", which was not getting "//" portion
X`09  of pathname prepended.
X
X`09+ renamed "vitabpos" mode to "alt-\150C, avoiding conflict with
X`09  "view" mode.
X
X`09+ added "implybuffer" (ib) mode to use in splitting out vi-style
X`09  buffer-implication from 'auto\1D06' mode (files modetbl and main.c).
X
X`09+ added "samebangs" (sb) mode to allow the `5EX-!!  and :!!  commands to
X`09  be optionally the same.
X
X`09+ Corrected logic of 'imply_alt()' so that it works with files read, as
X`09  well as written (files buffer.c and file.c).
X
X`09+ split out the pathname functions into fil\1D06.c
X
X`09+ added function 'is_appendname()' to path.c to better encapsulate the
X`09  isAppendToName macro's knowlege of the ">>" length (files path.c,
X`09  filec.c, fileio.c, random.c).  Used this to make functions
X`09  'canonpath()', 'lengthen_\130Ashort\120A and
X`09  'is_pathname()' work properly with ">>" prefix.
X
X`09+ added code to 'path.c' to resolve "`7E" as user's home-directory.
X
X`09+ corrected code in 'makebufflist()' that caused b_bfname member to
X`09  be modified (file buffer.c).
X
X`09+ moved MSDOS drive-logic from 'ch_fname()' into 'lengthen_path()'
X`09  (files random.c and path.c)
X
X`09+ added procedure 'copy_val()' to modes.c to encapsulate the make-local
X`09  and make-global macros.  This fixes a case in which memory could be
X`09  freed more than once: if the user had done 'setl' commands for two
X`09  different buffers.
X
X`09+ made variables 'doslines' and 'unix\1007local to the procedures
X`09  'slowreadf()' 'readin()' in file.c; initialized these so that
X`09  successive reads of a set of files will treat the dos/unix line
X`09  counts separately.
X
X`09+ added command "set-dos-mode" to force the current buffer to be
X`09  in DOS-mode (trimming CR's).
X
XChanges for vile 3.35 (from Tom Dickey):
X
X`09+ addressed compiler warnings from gcc 1.36 on apollo sr10.3.  (I know
X`09  it is old, but it gives useful warnings).  This required some minor
X`09  adjustments to defines/includes in files estruct.h, proto.h, main.c,
X`09  fileio.c, npopen.c, random.c to accommodate order-of-definition
X`09  problems in stdio.h and signal.h
X
X`09+ tested with gcc 1.40 on sunos 4.1.1
X
X`09+ tested compiling with SMALLER=1; fixes to files eval.c, input.c,
X`09  mktbls.c, npopen.c, proto.h, random.c (On my machine, this only cuts
X`09  about 10% from the binary).
X
X`09+ added EOS at mismatch-point in 'fill_partial()' in file bind.c, fixes
X`09  bug that caused incorrect display after repeated name completion and
X`09  query operations.
X
X`09+ guarded 'kbd_complete()' against embedded nulls in its buf-argument,
X`09  by testing for nulls before completion logic in file input.c
X
X`09+ added a flag 'kbd_expand' to make calls on\1E06putc()' via
X`09  'mlforce()' and related functions show tabs as a space.  This
X`09  modifies files bind.c, edef.h, display.c to fix a problem I
X`09  introduced in 3.32
X
X`09+ use 'kbd_expand' flag in file input.c to fix non-displaying `5EM; other
X`09  fixes include quoting and backslash\2406, as well as correction to
X`09  wkillc handling.
X
X`09+ modified finderr.c to make the embedded tabs as "`5Ct" digraphs, so
X`09  they are visible.  Added pattern to use with apollo C compiler.
X
X`09+ corrected logic in 'updpos()' (file display.c) so that v\180Bs
X`09  cursor location just-like-vi for tabs and control characters.
X
X`09+ made 'wordcount()' code (file word.c) work properly.
X
X`09+ corrected 'join()' (file word.c) so that blanks are not inserted when
X`09  joining after a space, or \1A09 blank line.  Also (like 'vi'), if
X`09  there is trailing whitespace on the first line, don't modify it.
X
X`09+ corrected flags for join-lines in file cmdtbl so that the region-
X`09  oriented code can work.
X
X`09+ made join-lines work with regions (files opers.c, word.c).
X
X`09+ restored GLOBOK flag for join-lines-til (regions work now).
X
X`09+ interchanged order of calls on 'toss_to_undo()' and 'lremove()' in
X`09  'ldelnewline()', since this was causing incorrect cursor placement
X`09  after an undo.  (The particular case arose in the rewritten
X`09  join-lines, when joining a blank line to a non-\140A).
X
X`09+ modified 'edithistory()' in file \1307.c to ifdef out the ESC code
X`09  (with new symbol KSH_HISTORY), merge the loops to use 'escaped' flag
X`09  to avoid redundant logic, and pick up control chars (e.g., `5EN and `5EP)
V
X`09  for scrolling.  This also modified files input.c and exec.c
X
X`09+ corrected logic in history.c (from 3.34) that uses the function
X`09  'WillExtend()' to modify/macroize !-commands.  The code did not
X`09  provide for the case in which the user would modify the text after
X`09  scrolling to it.
X
X`09+ corrected call on 'hst_flush()' in file pipecmd.c (it was not called
X`09  if the pipe-command failed).
X
X`09+ revised 'tgetc()' in file input.c to make it use a single return
X`09  point (simplifies testing and debugging).
X
X`09+ corrected file modes.c so that user can abort from a set command.
X
X`09+ deleted code for unused global 'lineinput' (files bind.c, input.c,
X`09  edef.h).
X
X`09+ renamed ifdef for LAZINESS to (global mode) TAGSLOOK, added an entry
X`09  to modetbl for "looktags" to test/update this code.  Note that this
X`09  is turned off by commenting out the "LookTags" line in modetbl.  This
X`09  affects also files main.c, file.c modes.c and tags.c
X
X`09+ added file 'filec.c' to perform filename completion.  Moved code that
X`09  was ifdef'd LAZINESS there, and recoded so that it stores paths
X`09  normally (not reversed!).
X
X`09+ created function 'mlreply_file()' in filec.c, used this to
X`09  consolidate prompting for filenames in file.c (Note that now all
X`09  filename prompts can get data from the screen).
X
X`09+ made most of the calls on 'mlreply_file()' default to\2906urrent
+-+-+-+-+-+-+-+-  END  OF PART 18 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 19 -+-+-+-+-+-+-+-+
X`09  filename; this is simpler than the last name given to the command.
X
X`09+ moved check for writing view-only buffer from 'filewrite()' as new
X`09  local function 'writable()', before calls \1E08ereg()' This
X`09  affects 'filewrite()',\0F06sav\0E07imdying()' and 'writeregion()'
X`09  implicitly.
X
X`09+ use 'mlreply_file()' in 'exec\1008(file exec.c)
X
X`09+ use 'mlreply_file()' in 'operwrite()' (file opers.c)
X
X`09+ added 'no_such_file()' to file.c; use this in 'exec\2408so that
X`09  ":source" will report an error if the file is not found.
X
X`09+ created function 'mkreply_dir()' modeled after 'ml\1E06file()' in
X`09  filec.c, used this to allow pathname completion in 'cd()' in random.c
X
X`09+ added mode "dirc" to file modetbl, to support directory name
X`09  completion.
X
X`09+ added l_number to LINE struct, b_bytecount to BUFFER\1E07 (file
X`09  estruct.h) to use in caches for # of bytes and lines displays.
X
X`09+ added macro 'for_each_line' to file estruct.h
X
X`09+ added procedure 'bsizes()' to buffer.c to compute values for l_number
X`09  and b_numchars,\0C06lines values.  Will later get this to cache
X`09  results to speed up 'line_no()' and related code.
X
X`09+ corrected column-splitting in file modes.c (error in 3.34 changes)
X`09  which caused dos-mode to not be shown.
X
X`09+ corrected flag in 'modetbl' for dos-mode: this makes \1508 show in
X`09  the status-line.
X
X`09+ added new entrypoints to tbuff.c: tb_copy, tb_s\0A09bappend
X
X`09+ merged code in 'spawn1()' and 'pipecmd()' (file spawn.c) so that
X`09  !-commands and !\100Bwork consistently.
X
XChanges for vile 3.34 (from Tom Dickey):
X
X`09+ modified mktbls.c to use 3rd column of modetbl (window-flags).  Moved
X`09  window-flag defines in estruct.h to allow their use in nemode.h
X
X`09+ in modes.c, moved the code that updates window hints-flags from the
X`09  'adjustmode()' to 'adjvalueset()' procedure so that it can use the
X`09  new window-flags entry in nemode.h
X
X`09+ modified mktbls.c (and estruct.h, edef.h) to support global modes.
X
X`09+ added to modes.c: 'new_regexval()', 'free\130Eand
X`09  'free_val()'.  Use these in main.c and modes.c to simplify
X`09  leak-testing.
X
X`09+ added to estruct.h defines to use in testing memory leaks using both
X`09  dbmalloc as well as apollo-specific traces.
X
X`09+ added to main.c ifdef for NO_LEAKS; used this in testing for
X`09  permanent memory leaks (freeing data also finds specific types of
X`09  allocator corruption).  Added test-code for this purpose to:
X`09  buffer.c, display.c, line.c, regexp.c, tbuff.c, window.c
X
X`09+ plugged memory-leak in 'getfile()' in file.c by splitting it after
X`09  the temporary-buffer allocation, making tbp a static value, and
X`09  deleting the line that set the tbp.b_fname pointer to null.
X
X`09+ revised the value-checking in 'adjvalset()' (file modes.c) so that
X`09  unnecessary changes are ignored.
X
X`09+ further modified file modes.c so that typing ' ' (except after string
X`09  or pattern values) will continue the prompting for further set-modes,
X`09  as in noninteractive use.
X
X`09+ put the TTputc for '`5Cr' back into 'kbd_putc()'; omitted this when
X`09  taking code for 'mlmsg()' from display.c
X
X`09+ added new function 'GetEnv()' to eval.c to guard against
X`09  null-return from 'getenv()'.
X
X`09+ added new command (to file line.c) "show-registers" to show the
X`09  contents of kill-buffers and registers.
X
X`09+ added new module 'history.c'.  This implements up/down scrolling in
X`09  an invisible buffer "`5BHistory`5D", which logs all :-commands.
X
X`09+ coded-around apollo sr10.3 optimizer-bug in 'execkreg()':
X`09`09kbdend = `26kp->d_chunk`5Bi`5D;
X`09  resulted in kbdend == kp->d_chunk.
X
X`09+ moved autobuffer and c-suffixes modes to global-table.  Deleted 'cwd'
X`09  mode.
X
X`09+ modified mktbls.c so that each table will be sorted by name (not by
X`09  type`26name).  Modified modes.c to take advantage of this and display
X`09  the modes sorted in columns (more like 'vi'), except for long strings
X`09  (which are deferred to the bottom of the display, still).
X
X`09+ make modes.c show the actual color name in addition to the index.
X
X`09+ rewrote 'kbd_string()' to interface it with 'edithistory()'.  Split
X`09  out entrypoint 'kbd_reply()' to support integration of history with
X`09  'namedcmd()'.
X
X`09+ redefined 'kcod2key()' in terms of N_chars; added macro 'isspecial()'
X`09  to estruct.h
X
X`09+ revised 'kbd_engl_stat()' and 'namedcmd()' to use the 'kbd_reply()'
X`09  entrypoint so that user can scroll through history of any portion of
X`09  commands.
X
X`09+ modified 'search.c' to log history for '/' and '?' commands.
X
X`09+ modified x11.c to use memcpy rather than bcopy (for consistency).
X
X`09+ made x11.c compile properly on apollo sr10.3 (there is a conflict
X`09  between prototypes in <string.h> and\0F08s.h>).
X
XChanges for vile 3.33:
X
X    `09* many: cleanup for gcc-2.3's -Wall warnings
X
X    `09* bind.c: added new function, insertion_cmd(), which returns char
X`09that gives us simple insert mode.  used in x11.c and input.c, for
X`09pasting and for insert-mode arrow keys
X
X    `09* estruct.h: don't redefine "const" on linux
X
X    `09* makefile: added aix warnings, changed name of ENV to ENVIR, due
X`09to name conflict with linux make
X
X    `09* random.c: add include of sys/select.h for AIX
X
X    `09* x11.c: added code to support arrow keys and function\1206from
X`09Phil Rubini
X
XChanges for vile 3.32 (from Tom Dickey):
X
X`09* modified estruct.h, proto.h and display.c to compile vile on HP/Apollo
X`09  SR10.2 (CC 6.7).  Added new definitions ANSI_PROTOS and ANSI_VARARGS
X`09  to simplify this.
X
X`09* modified 'mktbls.c' to produce nemode.h; use these definitions
X`09  to replace buffer/window mode definitions in estruct.h and edef.h
X`09  (note that this obsoletes symbol MAX_STRING_W_VALUE, reordered
X`09  window int-modes).  Further modified 'mktbls.c' to only create
X`09  ".h" files for the cases where it has data (so that I can split
X`09  modetbl off from cmdtbl, avoiding unnecessary recompiles).
X
X`09* supplied an ifdef (at least for APOLLO!) in termio.c so that `5EC
X`09  and `5EU work properly.
X
X`09* added buffer-mode 'wrapmargin' to file insert.c (which overrides
X`09  wrapwords iff it is set to nonzero).
X
X`09* added new module 'tbuff.c' to manage dynamic buffers in places
X`09  where local static buffers exist now.
X
X`09* modified 'ins()' in insert.c so that it reallocates 'insbuff`5B`5D',
X`09  allowing arbitrarily-large re-inserts.
X
X`09* modified 'input.c' to dynamically allocate 'tmpcmd' and 'dotcmd'
X`09  buffers.  This allows arbitrarily-large commands to be repeated
X`09  with '.'.
X
X`09* guard 'lengthen_path()' in file.c against shell/pipe/internal names.
X
X`09* added variable "$shell" (files cmdtbl and eval.c) to override
X`09  environment-variable "SHELL" in pipe-commands.
X
X`09* made 'show-vars' (file eval.c) show leading '$' or '%' to be
X`09  consistent with the way the user must type them.
X
X`09* suppress 'show-vars' (file eval.c) ERROR values (these correspond to
X`09  unimplemented variables)
X
X`09* corrected error in nextbuffer/sw\0906 (file \1606.c) that allowed
X`09  vile to crash if "set noautobuffer" was specified in .vilerc
X
X`09* corrected display in 'show-vars' (file eval.c) of "$kill" (reference
X`09  to volatile data).
X
X`09* made new function 'kbd_complete()' (file bind.c) to allow keyboard
X`09  completion in tables other than NTAB.
X
X`09* modified logic in new function 'kbd_complete()' to show permissible
X`09  completions in response to '?'.
X
X`09* consolidated logic in exec.c, display.c, bind.c, input.c with new
X`09  procedures 'kbd_putc()',\0E09s\0E0Aerase\1D0Aalarm()'
X`09  These hide random use of 'ttcol'.
X
X`09* make 'kbd_engl_stat()' (file bind.c) recognize word-delete character.
X
X`09* eliminated redundant unget/get (files bind.c, exec.c) in the interface
X`09  of 'kbd_engl_stat()'; this caused an infinite loop in the call from
X`09  'namedcmd()'.
X
X`09* modified bug-test in 'updpos()' (file display.c); I had a process hang
X`09  in that loop for some reason.
X
X`09* collapsed expand/dobackslashes args of 'kbd_string' (file input.c)
X`09  into one mask.
X
X`09* modified 'mktbls.c' further to produce table 'all_modes`5B`5D', to use
X`09  this for name-completion of mode.
X
X`09* modified 'mktbls.c' to recognize color-types so I could get rid of
X`09  upper/lower case kludge in modes.c
X
X`09* modified 'modes.c' to use color-types.  The interactive behavior now
X`09  uses 'kbd_string()' to split the input a\0D06'=' mark (if given).
X
X`09* added option-flag KBD_LOWERC to 'kbd_string()' (file input.c) so that
X`09  things that are forced to lowercase will be shown in\2E06way on
X`09  input.
X
X`09* modified 'token()' (file exec.c) to handle the 'eolchar' for
X`09  non-interactive calls on 'kbd_string()'.
X
X`09- modified 'eval.c' to recognize '=' as a separator between
X`09  variable-name and value, as in 'modes.c'.
X
X`09- modified 'eval.c' to perform name-completion for environment
X`09  variables (i.e., those beginning with '$').
X
X`09- modified 'modes.c' to accept vi-style multiple assignments in a ":set"
X`09  command (this works non-interactively).
X
X`09- corrected 'imply_alt()' in buffer.c; ensure that the fname-argument is
X`09  non-null.  If called via 'filterregion()', it will be null.
X
XChanges in 3.31:  (Tom Dickey)
X
X`09* corrected test in 'find_alt()', which caused the %/# toggle to work
X`09  incorrectly in noautobuffer mode.
X
X`09* updatelistbuffers after 'cd' command
X
X`09* added 'chg_buff()' `26 'un\110Cto encapsulate logic to update
X`09  buffer-list after\1207s are modified.  The function 'lchange()'
X`09  is replaced by 'chg_buff()'.
X
X`09* modified 'histbuffer' to toggle according to 'find_alt()'
X
X`09* make the filename/buffer/number change for 'kill\1E06' apply to
X`09  'usebuffer()'
X
X`09* corrected handling of repeat-count in 'C' command.
X
X`09* updated vile.hlp
X
X`09* revised 'mktbls.c':
X
X`09`09* filter out redundant ifdef's
X`09`09* tab-align data items for readability
X`09`09* modify 'nefunc.h' to use prototypes rather than K`26R style
X`09`09  definition, also split the extern-\220As from the
X`09`09  data items for readability.
X`09`09* make procedures static, linted
X`09`09* modified so that 'evar.h' definitions are automatically
X`09`09  generated, so that "show-variables" can show a sorted
X`09`09  list of variables.  The new filename is "nevars.h".
X
X`09* corrected window refresh flag for 'U' (lineundo) command.
X
X`09* added an apollo-specific code in 'imdying()' to generate a walkback
X`09  for debugging.
X
X`09* corrected an error in 'zotwp()': reference to data that had been
X`09  deleted.
X
X`09* corrected an error in 'onlywind()': it did not delink window-pointer
X`09  after freeing it.
X
X`09* noticed that references to 'dfoutfn' weren't reentrant:  I did a
X`09  ":show-var" from the buffer-list and got only part of the heading.
X`09  Reorganized display.c to ensure that it is reentrant by using a
X`09  local copy of 'dfoutfn'.  Note that I didn't add\230A as an
X`09  argument to 'dofmt()' to avoid complications with varargs.
X
X`09* corrected 'dfputli()': it didn't do hexadecimal.
X
X`09* corrected 'updateline()': it sometimes failed to highlight the ends
X`09  of the mode-line.
X
X`09* corrected (my last change) to 'vtset()' so that "`5EJ" is shown in
X`09  list-mode.
X
X`09* moved 'writeall()' from main.c to buffer.c; it belonged there, and
X`09  I used local macros for simplifying it.
X
X`09* remove SIGHUP handler before normal call on 'exit()' to avoid
X`09  vile-died messages when running it in an xterm.
X
X`09* corrected VMS definition of exit codes; added def of BAD-macro.
X`09  modified main.c, display.c, window.c accordingly.
X
XChanges in 3.30, mostly from Tom Dickey:
X
XThis is lots of changes, mostly in buffer.c:
X
X`09* lint-clean: buffer.c
X
X`09* linted also: file.c, modes.c (though I left size_t alone for now).
X
X`09* added "list-vars" `26 "show\0E07to show the current variables
X
X`09* modified 'killbuffer' so I could add binding `5EX-k to point to
X`09  a buffer-name in the \1307list and kill it.
X
X`09* also modified 'killbuffer' to recognize filename if \2106-\0F06s
X`09  not found, also buffer-number.
X
X`09* modify buffer.c so that the number shown by '_' and '*' is consistent
X
X`09* fixed `5EX-o and `5EX-O so they update buffer-list, as well as some
X`09  other places I missed before.
X
X`09* make some functions static (where they are really private), because
X`09  my per-module lint library got too large.  (I believe there are
X`09  too many externals).  In modes.c, this involved reordering, since
X`09  my practice is not to have forward-refs on static functions, to
X`09  make this work with some awful compilers.  This meant that I
X`09  deleted lines from 'proto.h'.
X
X`09* introduced new macro 'isreturn()', used this in correction in
X`09  'histbuff()'.  I used it in one bug fix `26 also where I could find
X`09  explicit compare for `5Cr, `5Cn.
X
X`09* added mode 'autobuffer':
X
X`09`09* the default is 'autobuffer' (the vile lru \1606ing)
X`09`09* curbp no longer is necessarily equal to bheadp
X`09`09* added members b_created, b_last_us\0D06relink to support
X`09`09  the autobuffer/no\0D0A mode.
X`09`09* if "noautobuffer" is set, ":rewind" and ":n" apply only
X`09`09  to the original command-line files.
X
X`09* added macros SCRTCH_LEFT,\0D08RIGHT, ScratchName, IsInternalName
X`09  to encapsulate use of '`5B' in names.
X
X`09* added macros SHPIPE_LEFT, isShellOrPipe to encapsulate use of '!' in
X`09  names.
X
X`09* added function is_pathname to encapsulate tests for \2208s
X`09  beginning with '.'.  This fixes the display of ".vilerc" from the current
V
X`09  directory as "./.vilerc".
X
X`09* added new char-types _scrtch and _shpipe to support killbuffer from
X`09  screen.  Use these types in new macro '\2706_to_bname()' which uses
X`09  modification of 'screen_string()'.  Used\1909to_bname()' to
X`09  make `5EX-e and `5EX-k "correctly" parse the bname, fname columns from
X`09  buffer-list.
X
X`09* fixed the error you mentioned in modeline (the position of col-80 mark
X`09  taking into account sideways and number modes).
X
X`09* supplied a missing TTflush in input.c
X
X`09* modified 'makebufflist()' to show only the flags actually used in the
X`09  footnote.
X
X`09* modified 'makebufflist()' to show '%' and '#' by the corresponding
X`09  buffer/filename.
X
X`09* added macros 'for_each_buffer()' and \180Awindow()' to simplify
X`09  code as well as to keep visible references to bheadp `26 wheadp
X`09  confined to buffer.c and window.c respectively.
X
X`09* added/used macro SIZEOF
X
X--------\0808\1010\2020\400F
X
XChanges in 3.29:
X--------\0808-
X
X(fixes supplied by tom dickey, eric krohn, and willem kasdorp)
X
Xbuffer.c: changes for keeping the \2206 list more up to date when
X`09on screen
Xfences.c: allow match of fence that is first char. in buffer
Xfile.c: avoid inf. loop when choosing unique name for buffers that hav\1B06s
X`09containing "x" in the NBUFN-1 position and allow ":e!" with no file
X`09to default to current file
Xglobals.c: implemented 'v' command
Xisearch.c, line.c, display.c: ifdef of some unused code
Xmain.c: added .C, .i to cmode suffixes, for C++ and cpp output files
Xmakefile, install target: test for presence of vile in destdir before
X`09trying to move it to ovile
Xoneliner.c: don't allow pregion to be used if the plines buffer is current,
X`09and set the WINDOW list mode, no\1A06BUFFER\1A0Cso :l works
X`09again, and fix for s/.//g bug
Xregexp.c: fixes for interaction of BOL and `5Cs etc.
Xspawn.c: lint cleanup  mostly casting strcXX() to void.
Xtcap.c: hack to supply CS or SR for scrolling region control, missing
X`09from some xterms
Xtermio.c: added missing fflush in two of the ttclean() routines
Xword.c: fix for counts on 'J' command
X
X--------\0808\1010\200A
X
XThe rest of the changes lister here are grouped only roughly, and represent
Xthe delta of version 3.28 from vile \1708three.  -pgf Dec 30 1992
X
X--------\0808\1010\2016
X
XVI COMPLIANCE:
X========\0807
X
X- made `5EN, `5EP, and `5ET do exactly what they do in vi.  (next line,
X`09previous-line, and tag-pop) Use `5EX-o to switch windows\2906`5EX-2 to
X`09split them.
X
X- ANSI style arrow keys now work from either command or insert mode.  Any
X`09ANSI function key of the form ESC `5B c can be used as a command
X`09key -- the binding is FN-c
X
X- the '#' key may now be used to force the following character to be treated
X`09as a function key.  Thus #1 is now equivalent to FN-1.
X
X- some modes/values have changed names: aindent is now auto\1206, swrap is
X`09now wrapscan, exact is now noignorecase, and they all have the vi
X`09shorthands (e.g.  tabstop is the same as ts, ic\160F
X`09ignorecase).
X
X- the "paragraphs" and "sections" values are now implemented, but as
X`09regular expressions -- they look pretty ugly, but I think they
X`09do what vi does.
X
X- the sentence motions ')' and '(' now work.  they may not do exactly what
X`09vi does, but they're close. \100Aontrolled by regular
X`09expressions that find the ends of sentences -- then they move
X`09forward to the start of the next one.  The regular expressions are
X`09set in the new "sentences" value setting.
X
X- "showmatch" mode now works, and momentarily shows the previous matching '('
V
X`09or '`7B'.
X
X- "magic" mode, or rather "no\1A0Dnow works more like vi:  special
X`09characters are still available by escaping them in nomagic mode.
X
X- there is a new mode, settable as "set terse" and\1006no\1206, which will
X`09suppress some of the extra messages that vile prints, reducing
X`09traffic for slow terminals.
X
X- the '%' command now scans forward for a fence character if you're not on
X`09one to begin with (thanks to Dave Lemke).  I also added '`5EX-%', which
X`09scans backward instead.
X
X- the ":`26" command now works, and repeats the last ":s" or '`5EX-s'
X`09substitution.  it re-uses trailing p and l options, which vi does
X`09not.
X
X- the '`26' now works, and repeats the last ":s" or '`5EX-s' substitution.
X
X- replacement sub-expressions work (`5C( and `5C), `5C1, etc.), as do `5CU `5C
VL `5Cu `5Cl
X
X- there is a new operator, '`5EA-`26', which is similar to '`26' but acts on a
V
X`09region.  I expect that if you want it, you'll probably rebind it to
X`09something else (like '`26') since typing it is awkward, to say the least.
X
X- `5EW and `5EU are now both read from the tty settings, and they work in both
V
X`09insert mode and on the : line.  There is a "backspacelimit" setting
X`09that controls whether these (and regular backspacing (`5EH or DEL)
X`09will backspace past the insert point in\1008mode.
X
X- The '@' command can now be used to execute the contents of a named register,
V
X`09as if it were entered at the keyboard.  Thus @k executes register k.
X
X- The "keyboard macro" obtained with `5EX-( and `5EX-) can be saved into a nam
Ved
X`09register with the `5EX-`5E command.  This lets you record a keyboard
X`09macro and save it for use with the new '@' command.
X
X- And, along to further complement the '@' command, it is possible to pre-load
V
X`09the named registers with the "load-\1908" command.  In a .vilerc
X`09you can say:
X`09`09use-register a load\100Aihello`5E`5B
X`09(where `5E`5B is really an ESC entered with `5EV-ESC), and then from
X`09within vile you can execute '@a', and the word "hello" will be
X`09inserted.
X
X- the H, M, and L commands are now absolute motions
X
X- insert mode now takes a repeat count, so '80i=ESC'\3307s 80 '=' chars
X
X- two new functions, to make normal motions more vi compliant --
X`09forward-character-to-eol and back\1E12bol, which won't
X`09move past the boundaries of the current line.
X
X- you can no longer backspace from the beginning of a line to the end of
X`09the previous.  (rebind 'h' and '`5Eh' from "backward-character-to-bol"
X`09to "backward-character"
X
X- a motion caused by an undo is considered absolute, and the "last dot"
X`09mark is reset.
X
X- added 'vi +/searchstring file.c' invocation syntax
X
X- you can now specify a count to the `7E command.
X
X- backslashes now have a protective effect on the : line -- they guard
X`09against expansion of #, %, :, and `5C.
X
X- a lone ":f" without filename now gives same info as `5EG
X
X- 'x', 's', 'r' will no longer delete a line if used on an empty line.
X
X- after a ":e!" command, the buffer name changes to match the filename, as
X`09if this were a new file read.  It used to just suck\270Cinto
X`09an old buffer, and the names didn't match.
X
X- there is now a "taglength" setting, and the name of the tags file is in
X`09the "tags" setting.
X
X- the "cd" and "pwd" commands now work
X
X- shiftwidth has been implemented, so `5ET, `5ED, '<', and '>' all do pretty
X`09much what they do in vi
X
X- there is a separate c-shiftwidth, used when in cmode, much as c-tabstop
X`09replaces tabstop when in cmode.
X
X- ": args" is now similar in spirit to the vi command of that name
X
X
XMISCELLANEOUS
X========\0807
X
X- reading files in general is _much_ faster, unless the file contains lines
X`09longer than 255 characters, in which case things slow down again.
X
X- regular expressions are more powerful and much, much faster than they
X`09were.  vile now uses Henry Spencer's regexp code.  This has the
X`09side effect of making '`5C`7C' a new metacharacter, for alternation
X`09of expressions.  '`5C+' and '`5C?' are also new, and stand for "one
X`09or more" and "zero or one" occurrences.  they can be used from
X`09the I-search commands as well.
X
X- in addition, `5C< and `5C> find beginnings and ends of words, and `5Cw, `5Cs
V,
X`09and `5Cd find "word" characters, "space\140Eand digits.
X`09`5CW, `5CS, and `5CD find the converse
X
X- related to the above change, replacement metacharacters now work, so you
X`09can use '`26' and '`5C1' through '`5C9' in the replacement string, and
X`09you'll get the right thing.
X
X- Dave Lemke contributed code to support vile under X windows -- including
X`09support for cutting/pasting, etc.  Thanks Dave!
X
X- the '%' command will now find matching #if/#else/#endif sets.
X
X- the '%' command will now find matching C comment sets.  Yes, it does
X`09the (non-)nesting correctly.
X
X- tabstops can now be set to any value, and there is a separate value for
X`09tabstops in C mode.  (c-\1807)
X
X- there is now some support for horizontal scrolling, using `5EX-`5ER and `5EX
V-`5EL
X
X- the ! filter command for running text through an external\3408now
X`09works
X
X- quite a bit of code cleanup, at least I think so -- it has ported pretty
X`09easily to a R6000, linux, 386bsd, Sony NeWS, NeXT, and the UNIXPC.
X`09it's close to lint-free, and Saber has very few problems with the
X`09code.  it'll now use prototypes if __STDC__ is defined, and it
X`09passes gcc -Wall -Wshadow with no warnings, if you ignore implicit
X`09declarations of system calls and lib routines.  the code should now
X`09be more portable, to various compilers and systems.  there are new
X`09targets in the makefile to make building on various platforms
X`09easier.  the makefile even supports microsoft C.
X
X- the code now builds and runs under DOS, using (at least) Microsoft C 6.0.
X`09Peter Ruczynski has done a great job porting vile to DOS -- he
X`09calls that version "pcvile".  He has used the Zortech compiler in
X`09the past -- I didn't try to break that, but you never know.
X`09NOTE THAT THE DOS CODE IS KNOWN TO BE MUCH BUGGIER THAN THE UNIX CODE!
X
X- quite a few bug fixes, including all (I think) of those reported by users
X
X- the "last dot" mark, accessed with the names ' and `60 doesn't get reset
X`09needlessly as often -- that is, if an absolute motion results in no
X`09move (e.g.  a failed search or tags operation, or an undo) then the
X`09"last dot" mark is unchanged.
X
X- the "source" ("execfile") command now does globbing on the file being run
X`09-- be sure to put it in quotes, as in :source "$HOME/.vilestuff"
X
X- entab, detab, and line-trim are now all operators (`5EA-tab, `5EA-space, and
V
X`09`5EA-t)
X
X- "make install"\0908s to /usr/local/bin or $HOME/bin, whichever is
X`09writable
X
X- the english names of functions, particularly new ones, have been
X`09"rationalized", hopefully making it easier to remember their names.
X
X- if you invoke a substitute command with `5EX-s, it will always act globally
V
X`09across lines.  (i.e.  it behaves like "s/s1/s2/g", not like
X`09"s/s1/s2/")
X
X- a QUIT signal will no longer cause core dump unless built with DEBUG on
X
X- the display optimizes scrolling if possible when the window\2607
X`09commands `5EE and `5EY are used.
X
X- values/modes have been reworked.  Some are now attached to buffers, some
X`09to windows.  By default, all values use the global settings of
X`09those values, and will track changes to the global settings.  If a
X`09local setting is specified, it breaks the link between\1106ocal
X`09and global value, and the loc\1508 will no longer track the
X`09global value.  ":set all" is now more informative.
X
X- the "set list" value is now attached to a window, not a buffer, so a
X`09single buffer can be displayed in two windows, "list"\1906one but
X`09not the other.
X
X- reading from other processes into a buffer is now _much_ faster
X
X- it is no longer legal to write out the contents of a buffer that has view
X`09mode set.
X
X- the format region command (`5EA-f) now restarts with each fresh paragraph,
X`09so you can format an entire file at once, without collapsing it all
X`09into a single paragraph.  It also knows a little bit about C and
X`09shell comments, so you can now reformat blocks of\2C08ary text.
X`09(There can't be any non-commentary stuff in front of the c\2106s.)
X
X- the position of the cursor within a window (the framing) is now preserved
X`09while the window if "off-screen" -- it no longer reframes when made
X`09visible again.
X
X- there is now a mode indicator on the modeline: I for insert, O for
X`09overwrite, and R for replace-char.
X
X- a line starting with '#' won't shift-right if the buffer is in C mode.
X
X- :s/s1/s2/5 now works, to change the 5th occurrence on a line
X
X- there are new commands to write all buffers: :ww is a synonym for
X`09"write-changed-buffers", and :wwq is now a synonym for
X`09"write-changed-buffers-and-quit"
X
X- it is now legal to "kill-buffer" a displayed \1406
X
X- there are new variables, $word, $pathname, and $identifier, which return
X`09the appropriate type of string from the cursor's location
X
X- all of the variables, and the functions and directives\3308extension
X`09language have been documented, and most\1F0Btried, if not
X`09tested
X
X- two new functions: `26rd and `26wr, return whether a file is readable or wri
Vtable
X
X- a new mode, "tabinsert", has been created to fill the needs of the
X`09"I hate tabs" camp.
X
X- filenames are now put into canonical form -- this keeps "junk", "./\0A06
X`09"./somedir/../junk" from appearing as different files to the editor.
X
X- there is a new mode, "tagsrelative", which, when set, causes filenames
X`09looked up via tags to have the directory name of the tags file
X`09prepended to them before being accessed.  This allows one to cd into
X`09a build tree from within the editor, to facilitate a grep or a local
X`09build, and have tags lookups continue to work.
X
X- the find-next-error code now honors the "Entering/Leaving directory"
X`09messages that GNU make (and others?) puts out.
X
X- job control now works right
X
XIMPLEMENTORS NOTES:
X========\0808===
X
X- internally, most pointers into the buffer, consisting of a LINE * and an
X`09int offset are now represented with a MARK structure -- in the
X`09nineties, it's time to start using structure assignment.
X
X- the set of values that are frequently handed about between buffers and
X`09windows, or \0C07 and their "children" are now grouped into
X`09B_TRAITS and W\0D08structures, for easier bookkeeping.  There
X`09are lots of macros to hide the added data structure depth.
X
X- if you add a new setting that should be inherited by and selectable
X`09on a per-buffer or per-window basis, add it to the W_VALUES or
X`09B_VALUES structs.  Otherwise, if its just a global value, like the
X`09X font, make it a variable.  I intend to merge the setting of
X`09variables in with the other values one of these days.
X
X- there is now a generic printf facility built in, which is layered under
X`09mlwrite() for the message line, bprintf() to print into a buffer,
X`09and lsprintf() to print into a string
X
X- LINE structures can now have NULL l_text pointers -- empty lines don't
X`09have memory associated with them (except for the LINE struct
X`09itself)
X
X- line text is now "block malloc"ed -- now for most files there is are two
X`09mallocs and a single read, no copies.  previously there were two
X`09mallocs per line, and two copies (stdio's and ours).  This change
X`09implies that LINE structures and their text should not be moved
+-+-+-+-+-+-+-+-  END  OF PART 19 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 20 -+-+-+-+-+-+-+-+
X`09between buffers -- the space they occupy may have come from the big
X`09chunks attached to the buffer structure, and not from the malloc
X`09pool directly.  So lfree() and lalloc() now take a buffer pointer
X`09argument.
X
X- there is "line poisoning" code, in line.c, which trashes the contents of
X`09freed lines and LINE structs, to make it easier to find bad usage.
X
X- do_fl_region() is a convenient wrapper for writing operator commands that
X`09work on full lines -- there isn't yet a similar wrapper for partial
X`09line operators.
X
X- use mlwrite() for informative messages that terse mode will suppress,
X`09mlforce() for messages that _must_ be seen, and mlprompt\3106
X`09messages that need a response from the user unless they're in a
X`09command file.
X
$ call unpack [.VILE-8_0]CHANGES.R3;1 -
 405660118 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 260 15 152
$!
$ create 'f'
X
XNOTICE: This change log is officially (sez me) closed.
X`09All further changes documented (hopefully) in "CHANGES".  This
X`09file was renamed from "CHANGES" to\0D09.R4" on Wed Jan 11, 1995. `09
X
XChanges for vile 4.13 (released Thu Dec 22, 1994)
X(pgf)
X`09+ fixed typo in glob.c which caused compile failure on VMS.
X
X`09+ added PATCH_AGAINST environment variable to dpatch target.
X`09  (makefile.in)
X
X`09+ cleaned up selection ifdefs.  no more USE_SEL_FUNCS.  use
X`09  OPT_SELECTIONS to ifdef references to r_attr_id.  (select.c
X`09  region.c, estruct.h)
X
X`09+ the strings <sp> and <tab> conflict with the new choice for
X`09  "buffer variable" indicator.  so i'm getting rid of them.  and
X`09  i'm adding support for `5Cs (and `5Ca, while\2906t it) to the
X`09  tokenizer. (exec.c, bind.c, macros.doc, vile.hlp)
X
X`09+ don't depend on a possibly null abbr_map pointer to decide to
X`09  reverse the lhs of a map string.  this caused the first mapping
X`09  of any type (:map or :map!) to be reversed.  i missed this
X`09  because my first mapping was of a single character.  (map.c)
X
X`09+ wrappers provided for TTgetc and TTtypahead because at least one
X`09  pcc-based compiler balks at passing them as a function pointer.`20
X`09  (map.c)
X
X`09+ operators act from pre_op_dot to DOT.  so set \1B0Bwhen done
X`09  sweeping, in case some other motion set it.  fixes 'dqf(%%q'.
X`09  (select.c)
X
X`09+ change _IOLBF flag to _IOFBF on setvbuf call, to turn off
X`09  line buffering.  we don't need it, since we flush properly
X`09  anyway, and it slows down output, particularly on an xterm.
X`09  (most systems used to use setbuffer() anyway, until autoconf)
X`09  (termio.c)
X
X`09+ correct yet _another_ typo made during the great strncpy()
X`09  conversion.  sheesh.  (bind.c)
X
X`09+ readability improvements and editorial corrections to the older
X`09  sections of README and\0B07.CFG.
X
X`09+ moved processing of @cmdfile startup file down to where
X`09  we normally run .vilerc, to make sure all conditions are the
X`09  same for both.  this should make running 'vile @.vilerc' and
X`09  'vile' exactly equivalent.  running a command file caused
X`09  a core in 4.12 due to NULL curwp.  (main.c)
X
X`09+ include text of manpage.rc in vile.hlp, for installations that
X`09  discard the source directory. (vile.hlp)
X
X`09+ revisions to help and man page sections on startup. (vile.hlp,
X`09  vile.1)
X
X`09+ install the man page as xvile.1 when \2507ing\1807 (makefile.in)
X`09`20
X(tom)
X`09+ pick up slash right after a drive designator to fix problem
X`09  with DOS globbing in the root directory.  (glob.c)
X
X`09+ corrected define, so that VMS version builds display-driver
X`09  (descrip.mms, vmsbuild.com).
X
X(kev)
X`09+ line.c (put):  Don't set suppressnl when only putting newlines.
X`09  Note: We may want to visit ldelnewline() and fix it so that the
X`09  line structure doesn't get hosed when DOT is set to the buffer
X`09  header.  The circular structure is apparently maintained, but the
X`09  buffer header is now bypassed.  Suppose there're three lines.  We
X`09  should have something (roughly) like this:
X
X`09  `09bufhead -> line1\09082\12083 -> \2607
X
X`09  But I think that after ldelnewline with DOT as described above,
X`09  we end up with (again assuming three lines):
X
X`09  `09bufhead -> line1\09082\12083\1B09
X
XChanges for vile 4.12 (released Fri Dec 16, 1994)
X(pgf)
X`09+ clear up section of man page dealing with vile-manfilt. (vile.1)
X
X`09+ don't let a mouse click change the current window if we're
X`09  sweeping.  serious lockup results.  (basic.c)
X
X`09+ fix various places that needed to be made more or less aware of
X`09  the occurence of sweeping.  quoted motions now never include
X`09  their endpoint, except in a few mostly "on one line" kind of
X`09  motions: e, E, f, t, and %.  (csrch.c, edef.h, exec.c, fences.c,
X`09  main.c, select.c, wordmov.c, vile.hlp)
X
X(kev)
X`09+ display.c (modeline): For case 'f' and 'F' in the format string,
X`09  do not display the pathname if it is the empty string.  This seems
X`09  to be the case for the `5Bunnamed`5D buffer.
X
XChanges for vile 4.11 (released Thu Dec 15, 1994)
X(pgf)
X`09+ changed order of #includes in x11.c, so that our headers come
X`09  first.  since we no longer define VMS at all, we'll be okay on
X`09  most systems.  i hope this doesn't break other\2A0Cf so,
X`09  estruct.h and edef.h should be moved after the last X11 include,
X`09  until we can figure something out.  (x11.c)
X
X`09+ changed leading character of so-called "buffer-variables" from
X`09  a '#' character to '<\110B.  the\2506onflicts with
X`09  the # function key prefix.  THIS MAY BREAK OLD MACROS.  i'm
X`09  sorry about this, but the choice of '#' as the function key
X`09  prefix is not really negotiable...  (eval.c, vile.hlp)
X
X`09+ fixed buffer-reading examples in macros.doc to reflect the above
X`09  change.  (macros.doc)
X
X`09+ fixed "WRITEABLE" case of the non-HAVE_ACCESS\1C09ffaccess.
X`09  the sense was inverted.  (fileio.c)
X
X`09+ implemented autowrite mode.  unlike vi, will only save files when
X`09  suspending or running a shell command, since saving on any buffer
X`09  switch seems a little silly.  (buffer.c, cmdtbl, main.c, modetbl,
X`09  proto.h, spawn.c, vile.hlp)
X
X`09+ fix OPT_LCKFILES as per johan rosman's suggestion, to make
X`09  multiple edits by the original locker work correctly.  also fix
X`09  behavior when file is renamed.  (buffer.c, main.c, file.c)
X
X`09+ put in kev's suggested change to allow xvile to grow its screen
X`09  more gracefully, albeit somewhat delayed. (eval.c)
X
X`09+ fixed (for the last time, i hope) the sequence of messages that
X`09  appear with ":w", ":wq\0706\0E07wq", and 'ZZ'.  Now, the "press
X`09  return to continue" only happens if you're _not_ quitting, you
X`09  haven't suppressed it with an argument, and something was actually
X`09  written. (buffer.c, main.c, vile.hlp)
X
X`09+ the "modeline-format" setting is now a variable rather than a
X`09  "setting".  so 'set modeline-format "...."'  must change to
X`09  'set-variable $modeline-format "...."' in .vilerc files. (edef.h,
X`09  eval.c, display.c, main.c, modetbl, vile.hlp)
X
X`09+ make sure getregion() assigns a unique attr_id to \2506s
X`09  it creates, so find_release_attr() doesn't find spurious
X`09  matches.  this keeps selections from disappearing when an
X`09  unrelated delete (killregion()) occurs. (\1306.c, select.c,
X`09  proto.h)
X
X`09+ fixed bug in trimline() which caused it to leave DOT at end
X`09  of line, if there was trimming to do.  this caused a bug
X`09  where if two newlines were inserted into a line ending with
X`09  whitespace, and autoinsertion occurred, then the newlines
X`09  would insert incorrectly, one \0F0Band one _after_ the
X`09  line that had been broken.  trimline now preserves DOT if
X`09  possible.  (region.c)
X
X`09+ rearrange multimotion() to ensure regionshape is set to exact
X`09  when we begin a normal quoted motion. (select.c)
X
X`09+ the xterm-mouse code is now a proper motion, so that you can
X`09  use it to follow an operator.  that is, hit 'd', point with
X`09  the mouse, and click button 1 to delete to \2B09 position.
X`09  x11 code now forces execution of a null motion routine, to
X`09  make this to work in xvile as well.  (basic.c, cmdtbl, tcap.c,
X`09  proto.h, x11.c, estruct.h, vile.hlp) `5Bhitting '.' after doing
X`09  this in the xterm version is interesting, since the motion is
X`09  relative to the edges of the screen, not\2008buffer.  in
X`09  xvile, the motion that is repeated is null, so nothing happens`5D
X
X`09+ mask off VAML and VAMLFOC bits when comparing attributes in
X`09  tcap.c, since it doesn't know how to deal...
X
X`09+ reset insertmode and set WFMODE if we abort out of replacechar().
X`09  (insert.c)
X
X`09+ rearranged X resource section of help file slightly, to group
X`09  all resources and sub\110Amore closely together. if we
X`09  split out all the scrollbar resources into sub-\1309, this
X`09  presentation might make less sense.  (vile.hlp)
X
X`09+ modified configure.in to support "--with-CFLAGS=", and turn -O
X`09  on by default.  it can now be suppressed with '--with-CFLAGS=" "'.
X`09  is it possible to give the configure script a usage message?
X`09  (configure.in, \0E09, README.CFG)
X
X`09+ eliminated usage of the return value of strncpy(), since it's
X`09  broken on at least one version of AIX, and there's no big
X`09  gain in using it, other than aesthetic value, which, although
X`09  subjective, really is a fact. :-)  (bind.c, buffer.c, eval.c,
X`09  filec.c, glob.c, spawn.c)
X
X`09+ eliminated all uses of the ScratchName macro, since it getting hard
X`09  to write it portably.  all vile-created buffer names are now
X`09  defined as char arrays in edef.h, and they all have the suffix
X`09  "_BufName", e.g. "HELP\1509 and "OUTPUT\2A09. (bind.c,
X`09  buffer.c, edef.h, estruct.h, eval.c, exec.c, fil\0908nderr.c,
X`09  history.c, line.c, main\0806p.c, modes.c, msgs.c, oneliner.c,
X`09  spawn.c, tags.c)
X
X`09+ eliminated the CPP_xxx checks that were used to help create the
X`09  ScratchName macro. ( aclocal.m4, configure\0B0B.in)
X
X`09+ fixed bogus cut-n-paste'd help messages for Macro buffers.  (cmdtbl)
X
X`09+ rearranged utime()/utimes() code so that\1E06s is now favored
X`09  over utime if both are present.  we think that systems with bad
X`09  utime() implementations are the ones that have utimes().`20
X`09  (fileio.c)
X
X`09+ eliminate funky structure assignment "\1606thing = `7Bfoo, bar`7D".
X`09  (ntconio.c)`20
X
X`09+ mention -O flag on by default, and necessity of working
X`09  VPATH support in make program.  (README.CFG)
X
X`09+ xvile does not need to (and shouldn't) attempt to reopen /dev/tty
X`09  when stdin is a pipe.  the prevented xvile from starting from
X`09  anywhere but the command line.  ifdefed code on DISP_X11. (main.c)
X
X`09+ change make_backup() to correctly check boolean return code from
X`09  ffexists() when deciding whether to back up a file.  (fileio.c)
X
X`09+ changed rcsdiff commands to use unified diff format. (makefile.in)
X
X`09+ fix bug in BUG check in mapped_c() -- was not clearing NOREMAP
X`09  bit before comparing to poundc.  this caused arrow keys (probably
X`09  all function keys not mapped by user) to appear to fail when
X`09  noremap mode was set. (map.c)
X
X`09+ blankline() was incorrectly de/entabbing its region, even when it
X`09  wasn't rectangular.  (region.c)
X
X`09+ implemented ":abbr" command.  ( CHANGES, README, cmdtbl,
X`09  insert.c, map.c, proto.h, vile.hlp)
X
X`09+ added "show-system-mapped-keys" command to show the mappings
X`09  for the function keys.  this replaces passing numeric arg hack in
X`09  :map and :map!.  (map.c, cmdtbl)
X
X`09+ added "populate" admin target to makefile.in.
X
X`09+ wording changes to vile.hlp and\0D061.
X
X`09+ added "show-bindings" to cmdtbl, to match claims made in
X`09  vile.hlp.
X
X`09+ turned region formatting back on.  lost OPT_FORMAT in final
X`09  merge for 4.10. (estruct.h)
X
X`09+ changed shorten_path to not return NULL unless arg was NULL.
X`09  this prevents possible core dump (or ugly display) when doing
X`09  "show-tagstack" after "vile -t tagname". (path.c)
X
X`09+ change getfile() to return FALSE if\1D082bp() \1D06s NULL,
X`09  and prevent a core dump.  this can happen, for instance, if the
X`09  bp->b_fname is the result of non_filename(), which can happen if
X`09  a tag lookup is done from a listbuffer, and a subsequent tag-pop
X`09  command is done which tries to return there.  (file.c)
X
X`09+ change tags() to push the buffername rather than the filename
X`09  if we're tag'ging from an internal buffer.  this improves our
X`09  chances of getting back to it.  (if it's gone from the screen,
X`09  you still won't be able to get back)  (tags.c)
X
X(kev)
X`09+ x11.c (x_setfont): Call XSetFont() for all of the newly added
X`09  GC's.
X
X`09+ x11.c (display_cursor): Draw the little rectangle with the \2C06
X`09  color instead of the normal text\2107when the window loses focus.
X
X`09+ proto.h (x_resize): Declared.
X
X`09+ eval.c (SetVarValue): Call x_resize() for EVPAGELEN and EVCURWIDTH.
X
X`09+ x11.c (x_resize): New function.  Call it from x_configure_window().
X
X`09+ vile.hlp: Documented new color cursor and modeline capabilities.
X
X`09+ estruct.h (VACURS, VAMLFOC\0906): New attributes.
X
X`09+ display.c (modeline): Set VAMLFOC and VAML attributes as
X`09  appropriate.
X
X`09+ x11.c (x_preparse_args, flush_line, struct _text_win): Added new
X`09  code for changing the color of\0D06ursor as well as the
X`09  modelines.
X
X`09+ x11.c (update_scrollbar_sizes): Make grips the same color as the
X`09  background of a modeline which does not have focus.  It's too
X`09  much work to make the grip color always match the \1706of the
X`09  modeline.
X
X`09+ estruct.h (OPT_FORMAT): Added back in after being lost in
X  `09  the shuffle.  Also checked the other "OPT_" features occuring
X  `09  in cmdtbl to make sure that no others were also lost in the
X  `09  shuffle.
X
X
X(tom)
X`09+ corrected a null-pointer reference in 'getfile()' (file.c).
X
X`09+ modified 'pathcat()' to (on VMS) ensure that the result is a valid
X`09  pathname (path.c).
X
X`09+ adjusted autoconf tests for cpp substitutions (aclocal.m4, estruct.h).
X`09  `5Bbut that stuff's gone.  i've preserved these changes on an RCS
X`09  branch (cpp_stuff) in case we need it.  -pgf `5D
X
X`09+ supplied missing DISP_VMSVT setting (estruct.h).
X
X`09+ added FL_EXECABLE, FL_WRITE\0E09READABLE flags to 'flook()' call
X`09  to use in 'access()' call (estruct.h, bind.c, eval.c, exec.c, filec.c,
X`09  fileio.c, main.c, tags.c, version.c).
X
XChanges for vile 4.10 (released Mon Dec 05, 1994)
X(pgf)
X`09+ changed keystroke8() an\110B_raw8() to loop and
X`09  beep until a simple 8-bit char is typed.  no SPEC prefixes
X`09  allowed. (input.c)
X
X`09+ tuned kev's changes to mapped_c().  new routine called
X`09  mapped_keystroke_raw() which calls\2308c in such a
X`09  way that function keys will expand to #c, but no further.
X`09  used when getting a :map lhs from the user. (map.c, input.c,
X`09  proto.h)
X
X`09+ fix lint warnings from "questionable" pointer practices,
X`09  rationalized names of routines called by liststuff() (now all
X`09  makeXXXlist()).  (bind.c, buffer.c, eval.c, line.c, map.c,
X`09  modes.c, proto.h, random.c, region.c, tags.c)
X`09 `20
X`09+ removed no-doubt obsolete ifdefed "overlay" statements (window.c,
X`09  region.c)
X
X`09+ lint: removed unused assignment in desfunc().  (bind.c)
X
X`09+ change the temp storage of unmatched chars in maplookup()
X`09  from char to int, to prevent loss and subsequent extension
X`09  of sign information. (map.c)
X
X`09+ added short on-line help for all commands.  ifdefed on
X`09  OPT_ONLINEHELP.  shows up in describe-bindings and apropos
X`09  listings.  adds 13.5K. (bind.c, cmdtbl, mktbls.c, estruct.h)
X
X`09+ added "list-motions" an\1308operators" commands, which show
X`09  their respective subsets of the commands. (bind.c, proto.h,
X`09  vile.hlp)
X
X`09+ added "describe-function" command. \2408appendit" argument
X`09  to liststuff, to let the contents of popups (like Binding List)
X`09  be grown incrementally.  the "describe-key" now \1208s the
X`09  function the key is bound to as well.  (bind.c, buffer.c, cmdtbl,
X`09  eval.c, line.c, map.c, modes.c, proto.h, random.c, tags.c,
X`09  vile.hlp)
X
X(kev)
X`09+ map.c (mapped_c): Minor changes to make quoted spec characters
X`09  generate pound sign sequences.  This is important for interactive
X`09  mapping of function keys.  Example: Try ":map <F1> h" prior to
X`09  this fix and afterwards.  Also try "a`5EV<F1>".  <F1> denotes
X`09  a press of the F1 function key.
X
X`09+ x11.c (kqdel): Took out call to char2int() which I had put in
X`09  a few days earlier..
X
X`09  (x_key_press): Don't convert function and arrow keys to a
X`09  sequence of bytes via kcod2escape_seq().  Leave them in the SPEC
X`09  form instead.  This was causing # sequences to be displayed
X`09  in insert mode and it also broke command line history (as well
X`09  as a bunch of other stuff, I suspect).
X
X`09+ vile.hlp: Fixed a few typos.
X
X`09+ map.c, x11.c (maplookup, kqdel): Judiciously call char2int() in
X`09  order to strip off sign extension.  These fixes are in response
X`09  to the use of the META key being broken.
X
X(tom)
X`09+ added autoconf-test for getpgrp().  (aclocal.m4, configure.in)
X
X `09+ reduced timeout to 30 seconds on MSDOS to avoid overflow (main.c)
X
X`09+ various nits/fixes for VMS, CLIX, IRIX, TurboC (descrip.mms,
X`09  estruct.h eval.c, glob.c, ibmpc.c, makefile.tbc, region.c, termio.c,
X`09  vile.hlp, x11.c)
X
XChanges for vile 4.9 (released Tue Nov 29, 1994)
X(pgf)
X`09+ changed all OS #defines to SYS_xxx.  like SYS_UNIX, SYS_MSDOS,
X`09  etc.  changed all compiler #defines to CC_xxx.  like CC_LATTICE,
X`09  CC_TURBO, etc.  changed all screen #defines to DISP_xxx.  like
X`09  DISP_TERMCAP,\0E06X11, etc.  changed all feature #defines to
X`09  OPT_xxx.  i think you see the pattern.  eliminated some ifdefs
X`09  around things that we've never turned off, or that can't be
X`09  turned off without severely breaking vi compatibility.  got rid
X`09  of some old "ifdef NEVER" kind of stuff.  (this affected most
X`09  source files)
X
X`09+ catnap() now checks for tty input at least periodically on all
X`09  platforms.  the nap is broken into .1 second increments, and
X`09  typahead() is called in between each one. (random.c)
X
X`09+ new mode, "maplonger", which controls whether vile favors the
X`09  longer or shorter of two nested mappings.  (modetbl, map.c)
X
X`09+ new mode, "remapfirst", which controls whether vile will remap the
X`09  first character of a mapping.  vi doesn't, vim does.  (modetbl,
X`09  map.c)
X
X`09+ rationalized (?) and documented (!) the various levels of character
X`09  input routine.  see top of\1B06.c.
X
X`09+ renamed typahead() to tt\100Ematch ttclose() et al, and
X`09  added typahead entry to the TERM struct.  (termio.c and others)
X
X`09+ all former callers of tgetc() now call one of the keystroke()
X`09  variants instead.  (many files)
X
X`09+ all former callers of tungetc() now call unkeystroke() instead.
X`09  (many files)
X
X`09+ when creating backup files, ifdef check of matching dev and inode
X`09  on UNIX only.  it doesn't work under watcom (DOS), and i don't
X`09  know where else it will.  (fileio.c)
X
X`09+ show offending errno when it's out of bounds in mlwarn(). (display.c)
X
X`09+ added itbuff.c/o/obj to the rest of the makefiles ( descrip.mms,
X`09  makefile.djg,\0E0Ain\0D0Btbc\1B0Bwat,
X`09  makefile.wnt, vms_link.op\0E06build.com)
X
X`09+ removed mapchars.`5Bch`5D from distribution, and \2D08references
X`09  to them.  (makefile.in, cmdtbl, main.c)
X
X`09+ ifdefed out some more unused code.  also made multimotion()
X`09  yank the selection as a side-effect, to be more like `5EA-s.
X`09  (select.c)
X
X`09+ ran lint on Solaris (i think.  maybe it was SunOS).  (display.c,
X`09  fileio.c, input.c, itbuff.c, map.c, select.c, \1A09tcap.c,
X`09  undo.c)
X
X`09+ cloned and modified tbuff.c to create i\1307.  the routines
X`09  there work on "integer tbuffs".  use these routines, and
X`09  the corresponding ITBUFF data structure everywhere user keyboard
X`09  input is accumulated.  this allows us to store wide keycodes,
X`09  and greatly simplifies keystroke playback and :map implementation.
X`09  (tbuff.c, i\0A09makefile, input.c, insert.c, line\2506p.c,
X`09  estruct.h, edef.h, proto.h)
X
X`09+ added new routines to tbuff.c/i\0907:  `5Bi`5Dtb_unnext() to undo
X`09  tb_next, itb_seek() to change the itb_last pointer\2B06delete()
X`09  to remove N elements from middle of an ITBUFF, itb_insert() to
X`09  insert a new element in the middle.
X
X`09+ changed :map implementation to support "user" and "system"
X`09  timeouts, and to support controllable remapping via "set
X`09  `5Bno`5Dremap" and vim-style ":no\1907commands.  (map.c, modetbl,
X`09  main.c, vile.hlp, proto.h)
X
X`09+ moved xterm-mouse functionality to tcap.c.  it's now driven
X`09  by a system :map of ESC `5B M, which is bound (indirectly) to the
X`09  old xterm_button() routine. (input.c, tcap.c, cmdtbl, proto.h)
X
X`09+ promoted '#' to be a regular peer of the `5EX and `5EA prefixes, and
X`09  defined a set of "standard" #-key bindings, which are in turn
X`09  available from system function keys (see vile.hlp).  screen
X`09  driver modules may use the new header "nefkeys.h" to access this
X`09  standard list.  i may have lost some of the linux-specific
X`09  bindings from cmdtbl -- should they be reintroduced, they
X`09  should go in tcap.c, as an ifdef'ed addtosysmap() call.  (bind.c,
X`09  input.c, vile.hlp, main.c, cmdtbl, mktbls.c)
X`09 `20
X`09+ collapsed kcod2pstr() to rely on\1706escape_seq().  (bind.c,
X`09  input.c, proto.h)
X
X`09+ changed names of "dummy" binding functions: cntl_a_func(),`20
X`09  cntl_x_func(), unarg\0E09esc\1A09pound\0F08. (main.c,
X`09  input.c, proto.h)
X
X`09+ added footnotes to the ":map" listing to denote whether mappings
X`09  are remappable or not.  system maps (i.e. function keys) may
X`09  be viewed with "1:map". (map.c)
X
X`09+ moved system-specific function key mappings to tcap.c and ibmpc.c.
X`09  removed them from cmdtbl.  use standard defines for the SPEC
X`09  bindings. (ibmpc.c, tcap.c, x11\0707simp.c, cmdtbl)
X
X`09+ the lhs of map sequences may now contain null characters.  the UI
X`09  still doesn't support entering them.  necessary since ibmpc
X`09  function keys start with a 0 character.  (map.c, ibmpc.c,
X`09  proto.h)
X
X`09+ changed alignment of settings in the `5BS\1107`5D buffer so that
X`09  the characters by which the names are sorted are vertically
X`09  aligned. (modes.c)
X
X`09+ changed a bunch of whitespace in modetbl for better alignment.
X
X`09+ don't bother attempting to catnap for 0 time.  (random.c)
X
X`09+ added '#' to the name in the short history list that
X`09  corresponds to previous buffer. (noauto\0F06 mode only) (\2207c)
X
X`09+ improved description of buffer lists wrt auto\1507mode.
X
X`09+ attempted to rationalize some of the inform\1D07 commands and
X`09  added text to help file.  (cmdtbl, vile.hlp)
X
X`09    new command names:`09`09synonymous with:
X`09`09show-bindings&0209describe\1309
X`09`09show-help&0209help
X`09`09show-buffers&0209list\0E08
X`09`09show-mapped-chars`09map
X`09`09show-mapped!-chars`09map!
X`09`09show-tagstack&0209\0A08
X
X`09    changed command names:`09ol\0B06 was:
X`09       show-terminal-chars\1913   `20
X`09       list-variables\1507\190C\1409
X`09       show-variables\1507\190C\1409
X
X`09+ prevent shrinkwrap() from claiming more than 3/4 of a windows
X`09  rows when popping up a new window.  (\0A07c)
X
X(tom)
X`09+ corrected missing b_last_used values for invisible buffers which
X`09  caused buffers to be delinked when toggling auto\2906 mode
X`09  (buffer.c).
X
X`09+ modified logic of 'modeline_modes()' to make it compile on vms
X`09  (display.c).
X
X`09+ modified auto-config for 'utime()' for solaris, vms compiles
X`09  (estruct.h, aclocal.m4, configure.in)
X
X`09+ corrected ifdef for "backup-style" mode (main.c).
X
X`09+ modified 'find_user()' to use $HOME if 'getpwuid()' fails (path.c).
X
X`09+ improved #/% toggle so that it doesn't \1A07into invisible buffers
X`09  (buffer.c).
X
X`09+ corrected some ifdef combinations (cmdtbl, file.c, tcap.c, wordmov.c)
X
X`09+ modified ifdef for incremental searches to use symbol OPT_ISRCH
X`09  (cmdtbl, isearch.c, proto.h).
X
X`09+ modified ifdef for find-error to use symbol OPT_FINDERR
X`09  (cmdtbl, file.c, finderr.c, main.c, spawn.c, proto.h).
X
X`09+ modified ifdef for advanced-editing features to use symbol OPT_AEDIT
X`09  (cmdtbl, opers.c, random.c, region.c, proto.h).
X
X`09+ corrected error in globbing that caused in\2A07 list to be built
X`09  for expressions such as "*/foo" (glob.c).
X
X`09+ modified logic of 'flook()' to allow search of $PATH only, so that
X`09  the lookup in version.c can find the correct executable, i.e., not
X`09  necessarily the copy of vile in\1406urrent directory (bind.c,
X`09  fileio.c, version.c).
X
X`09+ modified logic of 'filefind()', which implements ":e" command to load
X`09  only the first buffer matched in a wildcard, and to make all\2707s
X`09  treated as command-arguments so that ":n" applies to them (buffer.c,
X`09  file.c, main.c, random.c)
X
X`09+ corrected 'namebuffer()', prohibiting blank buffer-names (\2B06.c).
X
X`09+ added function 'mktrimmed()' to support corre\2406to 'namebuffer()',
X`09  as well as new macro function "`26trim" (eval.c).
X
X`09+ modified "error-buffer" command to accept filenames as well as \2F06
X`09  names (buffer.c, finderr.c).
X
X`09+ animated `5BTag Stack`5D buffer (tags.c).
X
X`09+ modified 'gettagsfile()' to check\2207cation-times of tags files,
X`09  and re-read as necessary (tags.c).
X
X`09+ corrected a conflict between foreground/back\0B06 colors (tcap.c).
X
X`09+ fixed some errors shown by Purify (display.c, regexp.c, window.c).
X
X(kev)
X`09+ insert.c (nextindent): Get the indent of the first character on
X`09  the line after advancing a word when there was no first
X`09  character.  This fixes a core dump which may be reproduced as
X`09  follows: Get into vile, making sure that autoindent is set.  Put
X`09  about five or so blank lines in the buffer.  Now go to the top of
X`09  the file and type 'cc' (change line).  This will cause a core
X`09  dump.  A core dump will also be produced if there are a number of
X`09  blank lines and then a non \1B0A.  The key here is that the
X`09  indentation level (indicated by fc) was determined to be -1 and
X`09  was not reset to a kosher value for the code below.
X
X`09+ display.c (offs2col): Declare local variable length as an int
X`09  instead of as SIZE_T.  (Remember that\1807 is unsigned on a lot
X`09  of machines.) Also adjusted test which is used for determining
X`09  which character that we're on.  This fixes a bug\3107(prior to
X`09  this fix) may be reproduced as follows: Get into vile and enter
X`09  the following: "ahere is a blank line<ESC>".  Select the word
X`09  "is".  Type "u" for undo.  Note that the selection highlighting
X`09  remains even though the line is blank.  Then type "o" to open up
X`09  a new line.  It is at this point that a core dump occurs.
X
X`09  Note that this fix does nothing to solve the problem of the
X`09  highlighting sticking around.  It just makes that code more
X`09  robust so that it doesn't core dump when the line length is
X`09  less than zero (which can happen for empty lines).
X
X`09+ undo.c (repointstuff): Always \1607 marks.  I've #if'd out the
X`09  lines which used to check to see whether or not the suggested new
X`09  pointer was valid or not.  Paul should check this stuff over and
X`09  make sure that it's ok.  In any event, it seems to (with one
X`09  exception) fix the other half of the problem described above.  It
X`09  also seems to make the behavior of marks wrt undo work more like
X`09  real vi.  Don't know whether this is an argument for or against,
X`09  just an observation...
X
X`09+ aclocal.m4: Added missing dnl to last line of file.
X
X`09+ buffer.c (sortlist\1206s): Don't forget to keep the unused
X`09  buffers when rebuilding the\1C07 list.
X
X
XChanges for vile 4.8 (released Mon Oct 31, 1994)
X(pgf)
X`09+ changed name of SIZEOF macro to TABLESIZE, to avoid conflicts
X`09  with X11 headers.  (buffer.c display.c estruct.h fences.c
X`09  ibmpc.c line.c mktbls.c modes.c tcap.c version.c vmspipe.c x11.c
X`09  x11simp.c)
X
X`09+ incorporated patches from Johan Rosman for simple file locking
X`09  protocol.  it's not rigorous, which he freely admits, but it
X`09  solves their problem, so i'm including the code, though turning
X`09  it off by default.  ( buffer.c display.c estruct.h file.c main.c
X`09  modes.c proto.h modetbl makefile.in and new file lckfiles.c)
X
X`09+ fixed code in filename() which allowed one to rename a file
X`09  to the null string by backspacing out of the "Name:" prompt.
X`09  (file.c)
X
X`09+ added mask with XtIMXEvent to all calls to XtAppPending(), to
X`09  prevent spurious returns due to non-events (timers). (x11.c)
X
+-+-+-+-+-+-+-+-  END  OF PART 20 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 21 -+-+-+-+-+-+-+-+
X`09+ massaged the distribution targets in the makefile, so i
X`09  can more easily produce a tar.gz file, and not make
X`09  people unpack the shar anymore. (makefile.in)
X
X`09+ changed all places where we check a char against abortc
X`09  to check against intrc, and\1907interrupted() as well.
X`09  this lets us not translate intrc to abortc in tgetc(),
X`09  which fixes some bugs where interrupts are treated like
X`09  escapes.  this only showed up when ESC was being used for
X`09  something other than aborting -- like completion.
X`09  (csrch.c estruct.h eval.c exec.c history.c input.c insert.c
X`09  isearch.c select.c spawn.c window.c)
X
X`09+ turned off filter() for UNIX and DOS, since the \2506region()
X`09  code is superior and better tested. (spawn.c)
X
X`09+ added support in exec_named_command() for detecting a trailing '!'
X`09  on a command name, and if the BANG flag is set for its function
X`09  entry, passing a special argument so the function can know it was
X`09  invoked with a "xxx!" form.  (estruct.h, exec.c, cmdtbl)
X
X`09+ implemented support for ":w!" to overrided failed writes of the
X`09  backup file.  detect the special argument (see above) in
X`09  filesave() and filewrite(), and pass "forced" flag down through
X`09  writeout(),\0C06reg(), and ffwopen(). (fileio.c, file.c, proto.h,
X`09  vile.hlp)
X
X`09+ created mode to control file backups, and implemented `7E-style
X`09  backups in addition to the existing .bak style.  new mode is
X`09  "backup-style", and takes values "off", ".bak\2007"tilde".`20
X`09  code is ifdefed on OPT_FILEBACK, and is turned off for VMS,
X`09  since i don't know what's appropriate.  also, left (minimal)
X`09  hooks to someday implement emacs-style numbered backups.
X`09  (estruct.h fileio.c main.c modes\0807tbl vile.hlp)
X`09 `20
X`09+ added link(), utime\0909s() to the list of system
X`09  calls to check for, and for whose declaration\290A.`20
X`09  (configure \0A09.in proto.h)
X
X`09+ implemented 'q' command, for doing "quoted motion"\1B06lack
X`09  of a better mnemonic.  (cmdtbl display.c proto.h region.c
X`09  select.c vile.hlp wordmov.c x11.c)
X
X`09+ fixed bad "set" line in vile.hlp, in the my_cd_action example.
X`09  It said "set $foo=$bar" syntax; which can be either\2C06foo=bar"
X`09  or "setv $foo=$bar".
X
X`09+ changed dos-mode behavior yet again.  with global dosmode set, we
X`09  were stripping carriage returns at the same time we\3406deciding
X`09  whether a buffer was doslike or not.  this led to the deletion of
X`09  CR's even if we decided the file was unixlike.  the correct
X`09  behavior, which unfortunately involves another pass through the
X`09  buffer, is to figure it out (i.e.  count lines ending in CR), and
X`09  then, only if it _is_ doslike (more CR lines than\0B07without)
X`09  then go through and strip them.  i discovered the bug when i had a
X`09  command file containing a few :map\2308s that ended in `5EM.  the
X`09  `5EM's were being silently discarded.  (file.c)
X
X`09+ added double-quote as commenting character in the macro language.
X`09  for vi compatibility, this should act as a comment everywhere
X`09  except shell commands and map\1109, but we only currently
X`09  honor it at the beginning of line.  (exec.c)
X
X`09+ fix behavior of commands which\1B06e differently when not
X`09  given arguments, when used in an executed file.  :map and :f
X`09  were both ignoring their arguments when sourced in a file
X`09  interactively. fix was in end_named_cmd() and more\150C.
X`09  (exec.c)
X
X`09+ new routine, macliteralarg(), which returns the rest of a command
X`09  line literally as a single token.  used for the <rhs> of :map.
X`09  (exec.c)
X
X`09+ call new macliteralarg() from map_common() when getting the <rhs>,
X`09  if cline is true.  (map.c)
X
X`09+ removed "if (did_tungetc()) t\0906" from readpattern() -- it
X`09  was obsolete, and only screwed things up when executing a :map.
X`09  (search.c)
X
X`09+ always do full update() in mlyesno() and mlquickask(), since
X`09  they may be invoked from a command file, and we want the
X`09  display as current as possible. (input.c)
X
X`09+ use mlforce() rather than mlprompt() to force appearance of
X`09  the questions in mlyesno() and mlquickask(), in case discmd is
X`09  false. (input.c)
X
X`09+ line length reformatting in oneliner.c
X
X(kev)
X`09+ aclocal.m4, configure.in (VC_SYS_ERRLIST): Check for presence of
X`09  sys_errlist`5B`5D.
X
X`09+ estruct.h (sys_errlist): Only declare if HAVE_EXTERN_SYS_ERRLIST
X`09  is not defined.
X
X`09+ manpage.rc: Set noview prior to calling
X`09  attribute-cntl_a-sequences-til.  Set view afterwards.
X
X`09+ display.c (vtalloc): Allocate space for rows in vscreen`5B`5D and
X`09  pscreen`5B`5D when the height changes.  I was getting core dumps
X`09  in xvile when resizing vertically.
X
X`09+ makefile.in (manfilt): New target which should not be necessary,
X`09  but is due to the lameness of certain `60make' programs.
X
X`09+ termio.c (ttopen): ifdef'd IUCLC which doesn't exist on all
X`09  systems.
X
X`09+ msgs.c (popup_msgs, msg_putc): Don't save/restore DOT unless
X`09  curwp has been initialized.  Lack of this check was responsible
X`09  for core dumps when executing "xvile @`7E/.vilerc".
X
X`09+ buglist: Deleted items which have been satisfactorily dealt with.
X
X`09+ display.c (PutMode, vtprintf): Deleted these functions.
X
X`09  (modeline): Rewritten to use a format string for outputting the
X`09  mode lines.
X
X`09  (mlfs_prefix, mlfs_suf\0D0Bkipfix): New modeline() helper
X`09  functions.
X
X`09+ modetbl (ModeLine-Format, MLFORMAT): New string mode.
X
X`09+ main.c (global_val_init): Initialize format string for mode lines.
X
X`09+ modes.c (adjustmode): Adjusted "#if OPT_WORKING ... #endif" pairs
X`09  for the case where OPT_WORKING is disabled.
X
X`09+ x11.c (x_open): Initialize term.t_mcol and\1009row.
X
X`09+ eval.c (SetVarValue): Call mayneedundo() for EVCURCHAR and EVLINE
X`09  ($char and $line) variables.
X
X`09+ x11.c (x_key_press): Call char2int() when putting characters
X`09  in the queue as integers in order to prevent sign extension.
X
X`09+ map.c (maplookup): Call char2int() when returning first unmatched
X`09  character in order to prevent sign extension.
X
X`09+ vile.hlp: Removed vile-manfilt compilation / instal\0F06
X`09  instructions.  vile-manfilt is now built and installed as part
X`09  of the default installation procedure.
X
X`09  Also removed note concerning selections; this\2106said that the
X`09  selected area includes all highlighted chars except for special
X`09  case in which the last highlighted character is the first
X`09  character on a line.  This is no longer true or necessary since
X`09  we now permit selections to\0E07 the end-of-line character.
X
X`09  Added documentation concerning scrollbar and selection
X`09  subresources.  Also added some sample .Xdefaults entries.
X
X`09  Reformatted paragraphs which had lines too long for an eighty
X`09  column display.
X
X`09+ map.c (struct maprec): Documentation.
X
X(tom)
X`09+ added OPT_VMS_PATH to estruct.h, used this to ifdef the vms pathname
X`09  parsing (and also some test-code) on UNIX for off-lin\2006ing of the
X`09  VAX code (estruct.h, fakevms.c, file\0808c.c, glob.c, input.c,
X`09  main.c, path.c, proto.h, vms2unix.c).  Now, VMS name-completion is
X`09  done internally using UNIX-style pathnames.
X
X`09+ other mods to support name completion on VMS, and off-line testing
X`09  (bind.c, file\0808c.c, glob.c, path.c).
X
X`09+ mods to msgs.c to avoid struct init in declaration for SunOS K`26R
X`09  compiler.
X
X`09+ added files fakevms.c,\0B09h and vmsbuild.com
X
X`09+ added OPT_MSDOS_PATH symbol to simplify related ifdefs for parsing of
X`09  pathnames for MSDOS/WIN31/NT/OS2 (estruct.h, file.c\0806c.c, glob.c,
X`09  main.c, path.c, proto.h).
X
X`09+ corrections to VMS version of 'shorten_path()' (path.c)
X
X`09+ some lint (bind.c, display.c, eval.c, input\0906sert.c, map.c,
X`09  region.c, select.c)
X
X`09+ fixes for SMALLER-ifdef (display.c, insert.c, map.c, window.c)
X
X`09+ added ifdef-symbol OPT_MLFORMAT for modeline-format (estruct.h,
X`09  display.c, main.c, modetbl)
X
X`09+ corrected handling of empty-.vilerc file: was hanging, not formatting
X`09  modeline correctly (display.c).
X
X`09+ added ifdef-symbol OPT_ENUM_MODES for the fixed-string modes
X`09  (estruct.h, bind.c, main.c, modetbl\0906s.c)
X
X`09+ added logic to allow termcap-driver on Linux to display colors
X`09  (tcap.c, estruct.h)
X
X`09+ renamed REBIND to OPT_\0E06, modified logic for kbindtbl`5B`5D so that
X`09  an arbitrary number of key bindings can be stored.
X
X`09+ modified the TTrev() logic in the termcap driver to display video
X`09  attributes (i.e., bold, underline, reverse) when OPT_VIDEO_ATTRS
X`09  is set (tcap.c, display.c, estruct.h).
X
X`09+ modified flags of attribute commands so that they accept a range
X`09  as well as a repeat-count (cmdtbl).
X
X`09+ added binding `5EA-N to allow reset of attributes on a region (cmdtbl,
X`09  select.c).
X
X`09+ corrected video-attribute highlighting for IBMPC driver (ibmpc.c).
X
X`09+ corrected ifdef'ing for 'kbindtbl`5B`5D' (mktbls.c).
X
X`09+ modified error-test in 'ffropen()' to avoid noisy\2906 when vile
X`09  cannot find .vilerc in MSDOS filesystem from Linux (fileio.c).
X
XChanges for vile 4.7 (unreleased Tue Sep 27, 1994)
X(pgf)
X`09+ makefile.in: removed * chars from install complete message to
X`09  keep them from being shell-expanded, and make sure rw and list
X`09  use the right makefile (i.e.  \1008.in) since "\2408" may
X`09  not be built yet.
X
X`09+ off-by-one on strcpy() in bind.c (otto lind)
X
X`09+ added code to detect and honor new-style NeXT tags file format
X`09  in tags.c. (otto lind)
X
X`09+ rationalized setting of dos mode (too bad i didn't call this
X`09  "crlf" mode instead) so that for all internally generated, or non-
X`09  existent buffers, dos mode is set based on the OS's line-style.
X`09  otherwise, for existing files, empty or not, the lines vote on
X`09  the style for the buffer. (file.c, main.c, random.c, vile.hlp)
X
X`09+ added Home and End key support to x11.c, per user contrib. (x11.c)
X
X`09+ added line-percentage indication to ruler mode display, per user
X`09  contrib. (display.c)
X
X`09+ new command, "beep", implemented in function userbeep(), which
X`09  lets the user beep when they want to.  this intentionally does
X`09  not call kbd_alarm, but rather TTbeep directly.  (random.c, cmdtbl,
X`09  proto.h)
X
X`09+ new mode, "working", which enables/disables the w\2506... messages.
X`09  i think i've got it set up so the signals themselves stop if
X`09  noworking is set.  (modes.c, display.c, main.c, vile.hlp)
X
X`09+ added shrinkwrap support for the `5BHelp`5D window. (bind.c)
X
X`09+ fix core dump from giving arg of 1 to prevwind().  (window.c)
X
X`09+ create l_strtol, which also accepts 'c' constants.  use it
X`09  in eval.c whenever parsing user input to numeric functions. (\3A06,
X`09  proto.h)
X
X`09+ prevent core dump if `7Eendm given when not in macro definition
X`09  (exec.c)
X
X`09+ change "BOTTOM" and "TOP" in "Search reached XXX without matching..."
X`09  to "bottom" and "top". (search.c)
X
X`09+ added "`5BSearch wrapped`5D" message to /, ?, n, N commands.
X`09  (search.c, oneliner.c, i\170Aproto.h)
X
X`09+ fixes to swbuffer() to prevent coredump when errors encounted
X`09  when running the bufhook routine. (buffer.c)
X
X`09+ fix to dobuf() to prevent handling of a `7Eendm when execlevel is
X`09  non-zero.  if this is true, then the store-macro/\0C06procedure
X`09  won't have happened (due to the early return in docmd()), and it'll
X`09  look like an unmatched `7Eendm. (exec.c)
X
X`09+ in liststuff(), don't switch to the list unless it's its first
X`09  popup.  actually, switch (in\1D06buff) and then \1F07back.
X`09  this guarantees that the last call to swbuffer is for curbp.
X`09  (buffer.c)  `5B it would be better if popupbuff() didn't need
X`09  to do the swbuffer at all `5D
X
X`09+ renamed CMASK to CHARTYPE to avoid name conflicts.
X`09  (edef.h estruct.h input.c line.c proto.h eval.c main.c)
X
X`09+ the screen is now resized dynamically, instead of having a
X`09  fixed maximum.  (display.c, x11.c)
X
X`09+ changed term.t_nrow an\1009mrow to hold the actual number
X`09  of screen rows, rather than the highest index.  this makes it
X`09  a) symmetric with t_`5Bnm`5Dcol and b) a whole lot easier to
X`09  remember how it works.  also introduced routine bottomleft() for
X`09  moving the cursor there.  (ansi.c, display,c eval.c ibmpc.c
X`09  isearch.c main.c spawn.c st520.c tcap.c termio.c vmsvt.c
X`09  win31drv.c window.c x11\0606simp.c)
X
X`09+ some fixes for DEBUGM ifdefs (eval.c exec.c)
X
X`09+ gnu warning cleanup in vmalloc.c
X
X`09+ main.c: changed initial value of popup-choices to "delayed", to
X`09  match readline behavior
X
X`09+ convert `5EM character in replacement pattern to a newline, for
X`09  vi compatibility.  (oneliner.c)
X
X(kev)
X`09+ display.c (updupd): Don't permit typahead to be called for X11
X`09  from this function.  This caused some core dumps since x_typahead()
X`09  is basically another event loop.  When a tim\1A09was set
X`09  (to blink the cursor), core dumps would occur due to the display
X`09  structures not being in an updated state.
X
X`09+ x11.c (x_getc, x_typahead): The recent addition of the
X`09  beginDisplay/endof\0D07 pairs seems to have caused a plethora
X`09  of undesirable messages from imworking().  I've removed the
X`09  beginDisplay/endof\0D07 pairs which I had added to both of
X`09  these functions.  x_getc() had already been protected from
X`09  imworking by the doing_kbd_read flag (set in tgetc() in input.c).`20
X`09  But x_typahead() needs the same protection.  I've added some code
X`09  which sets the doing_kbd_read flag and restores its old value
X`09  prior to returning from x_typahead().
X`09 `20
X`09+ random.c (catnap): Ifdef'd for X11 to call x_typahead when called
X`09  with flag which indicates that the input queue should be watched
X`09  for user input.  We may want to restructure this code and the code
X`09  which calls catnap() somewhat to use Paul's idea for a timed read.
X
X`09+ x11.c, proto.h, termio.c (x_typahead): Now takes as a parameter the
X`09  time in milliseconds to wait for type-ahead to occur.
X
X`09+ x11.c (kqpop): Return character popped from end of queue, not
X`09  beginning.
X
X`09  (x_getc, x_typahead): Protect guts of function from imworking()
X`09  with beginDisplay / endof\0F08pairs.  I originally thought
X`09  that this was causing some problems in the mapping code which
X`09  seemed to be caused by the imworking interrupt.  Even though
X`09  the problem was with kqpop(), I'm leaving the beginDisplay /
X`09  endDisplay pairs in since the keyboard queue routines are
X`09  probably not reentrant.
X
X`09+ random.c (catnap): Changed argument to sleep call to allow
X`09  for catnaps longer than one second.
X
X`09+ termio.c (typahead): Call x_\1208 instead of x_is_pasting.
X
X`09+ x11.c, proto.h (x_is_pasting): Deleted.
X
X`09+ x11.c, proto.h (x_typahead): New function.
X
X`09+ termio.c (typahead): Modified first version of this function to
X`09  match the second with regard to X11 code.
X
X`09+ random.c (catnap): Block SIGALRM signals while in select().
X
X`09+ configure.in (sigprocmask): Check for existence of this function.
X
X`09+ random.c (catnap): Use both tv_sec and tv_usec in the HAVE_SELECT
X`09  code.  This is necessary (on certain systems at least) in order to
X`09  sleep for longer than one second.
X
X`09+ input.c (tgetc): Added infinite loop detection.  I\1A0Cs
X`09  can occur as a result of mapping.
X
X`09+ map.c: Added new data structures and functions for dealing more
X`09  fully with map and map!.  Removed the old structures and functions
X`09  for dealing with a simple case of map. `20
X
X`09+ input.c, proto.h (tungetstr): New function.
X
X`09+ main.c, insert.c (map_check): Removed calls to this function.
X
X`09+ map.c, proto.h (map_check): Deleted.
X
X`09+ map.c, proto.h, cmdtbl (map_proc): Deleted.
X
X`09+ proto.h, map.c (relist_mappings): Deleted declaration from\3B08.
X`09  Moved to map.c and declared static with new parameter.
X
X`09+ input.c (kbd_reply): Added code for KBD_NOMAP.
X
X`09+ estruct.h (KBD_NOMAP): New kbd_reply() option.
X
X`09+ map.c (addtomaps, \0B08, maplookup): New functions for dealing
X`09  with mapped keys and key sequences.  There is also a new data
X`09  structure (\0B06 maprec) and a couple of global variables for
X`09  storing the maps.  `5BI discovered after I'd gotten this code
X`09  working that Tom had written some similar looking stuff which is
X`09  located in mapchars.h and \0F09c.`5D
X
X`09+ input.c (kbd_key): Added call to maplookup.  Made small change
X`09  to the ANSI_SPEC stuff to avoid catnapping if we've already
X`09  catnapped in maplookup().  My initial inclination was to
X`09  remove the ANSI_SPEC stuff, but I've decided to leave it in
X`09  place for a while.  I don't yet understand the workings of
X`09  input.c well enough to muck about with it too much.
X
X`09+ tcap.c (keyseqs): Table associating function key capability names
X`09  (in terminfo/termcap) with the code which vile should use when
X`09  one of these sequences is received.
X
X`09  (tcapopen): map key sequences found in keyseqs`5B`5D.
X
X`09+ input.c (tungottenchars, tungetc, tgetc): Use a TBUFF instead of
X`09  fixed size array for storage of ungotten characters.  tungetc()
X`09  will now cause ungotten characters to be stacked.  Previously,
X`09  only one keystroke (which may consist of multiple characters) could
X`09  be ungotten.  Now, multiple keystrokes may\2B0D
X
X`09+ x11.c (x_key_press): Set the high bit (HIGHBIT) if one of the
X`09  Mod1 (Meta) keys are held down.
X
X`09+ x11.c (selgc, revselgc): New fields in struct _text_win.
X`09 `20
X`09  (x_preparse_args): Initialize selgc and revselgc.
X
X`09  (x_setfont): Set font in selgc and revselgc.
X
X`09  (x_scroll): Use selgc and rev\0D06to display selections.
X
X`09  (display_cursor): Call flush_line() instead of calling
X`09  XDrawImageString() directly.
X
X`09+ select.c, display.c (VASEL): Use instead of / in addition to
X`09  VAREV in certain places.
X
X`09+ estruct.h (VASEL): New preprocessor constant used for indicating
X`09  selections.
X
X`09+ select.c (extended_region):  Fixed a bug which manifested itself
X`09  when extending a selection with text before the\1F0A.
X
X`09  (operattrital): Fixed message passed into \2906or().
X
X`09+ line.c (put): Rewritten somewhat to be faster for non-rectangular
X`09  regions.  Tests on a SPARCstation IPC indicate that the new code
X`09  is 8-16 times faster.  The old code may be reenabled by searching
X`09  for SLOWPUT in line.c and changing this preprocessor constant from
X`09  0 to 1.
X
X`09+ vile.hlp (popup-choices): Changed documentation regarding this global
X`09  value.
X
X`09+ main.c (global_val_init): Initialize GVAL_POPUP_CHOICES to immediate.
X
X`09+ modes.c (FSM_CHOICES, struct FSM, fsm_popup_choices\1306error,
X`09  fsm_tbl, fsm_idx, is_fsm, legal\0B06fsm_complete): New stuff for
X`09  dealing with fixed string modes. (fsm stands for\2412).
X
X`09  (adjvalueset): Call the fsm stuff.
X
X`09+ modetbl (POPUP_CHOICES): Made this a string mode.
X
X`09+ input.c (kbd_reply):  Conditionally compile call to
X`09  popdown_completions() based upon how OPT_POPUPCHOICE is defined.
X
X`09+ bind.c (fill_partial): Unconditionally call TTflush() since it is
X`09  needed to force the partial completion to be written out.
X
X`09  (kbd_complete): Changed logic yet again regarding the use of
X`09  cmplcol.  It is only used for scrolling now.  The completion
X`09  list is automatically displayed if no progress was made in
X`09  performing the completion.  This means that _something_ will
X`09  happen visually when you press tab.  Either the completion will
X`09  be wholly or partially successful, or the completion list will
X`09  pop up.
X
X`09+ filec.c (trailing_slash): Fixed problem (for unix systems at least)
X`09  where we were unable to get completions off of "/".
X
X`09+ filec.c (pathcmp): Wrote a simpler, faster, but possibly less
X`09  functional version.  Tom should look this code over to make sure
X`09  that I haven't broken something.  This new version seems to speed
X`09  things up quite a bit.
X
X`09  (makeMyList): This now takes as a parameter the name which is being
X`09  searched for.  We exclude from the list constructed those pathnames
X`09  which are in subdirectories below the \1608y in \3306name might
X`09  be found.
X
X`09  (bs_find): Took out calls which make copy of the pathname and
X`09  lengthened it.  If everything is done right prior to calling
X`09  bs_find, it should already be in canonical form.  I'm hoping
X`09  that this will increase the speed somewhat.
X
X`09  (makeString): Added length parameter in order to avoid calling
X`09  strlen.  Fixed all callers.
X
X`09  (makeString): Allocate an extra byte to be used as a directory
X`09  scan indicator.
X
X`09  (already_scanned): Use the scan indicator byte to see if directory
X`09  has already been scanned.  This should avoid rescanning directories
X`09  and it also fixes the problem of being unable to get completions
X`09  for directories which have already had a sub\2808y scanned.
X`09  Scenario...`09
X`09  `09:set dirc
X`09  `09:e /home/kev/GNU/<tab><tab>
X`09`09Backspace so that just /home/ is showing.  Press <tab><tab>.
X`09`09Type in kev/<tab><tab>.  Only completion shown is GNU/.
X
X`09  (bs_init): Removed the flag parameter which indicates whether or
X`09  not to clear the buffer.
X
X`09  (bs_find): Removed the iflag parameter and fixed all callers.
X
X`09+ proto.h (bs_find): Nuke iflag parameter in declaration.
X
X`09  (bs_init): Removed flag parameter from declaration.
X
X`09+ bind.c (scroll_completions): New function called from kbd\2B08e.
X`09 `20
X`09  (cmplcol): Changed the way in which this variable is used`20
X`09  for deciding whether to show or scroll a completion list.
X
X`09+ window.c (newlength): Fixed the off-by-one errors which were
X`09  causing xvile to exit with the X error "BadValue" for opcode
X`09  X_ConfigureWindow.  What was happening was the bottom window was
X`09  being left with size zero...this bug may be observed in ordinary
X`09  vile (in an xterm) by starting vile, splitting the `5Bunamed`5D
X`09  window and resizing the bottom\1F08to one line.  Then use the
X`09  (X) window manager to resize the xterm\2308down in size by one
X`09  line.  You will then observe that there are two mode lines at the
X`09  bottom of the xterm one above the other with no buffer displayed
X`09  for the bottom-most one.
X
X`09+ window.c (wpopup): Don't let an error message be displayed when
X`09  we can't split a window.  Also permit curwp to be used if it's
X`09  the only window available.
X
X`09+ proto.h, buffer.c (zotwp): Moved delcaration from latter to former.
X`09  Also removed "static" from definition of zotwp in buffer.c.
X`09`20
X`09+ input.c (kbd_reply): Call popdown_completions() to get rid of
X`09  the `5BCompletions`5D buffer.
X
X`09+ bind.c (popdown_completions): New function for getting rid of
X`09  the `5BCompletions`5D buffer.
X
X`09+ buffer.c (zotwp): Switch back to most recent \2D06 on\3707
X`09  list after deleting windows for the selected buffer.
X
X`09+ proto.h (shrinkwrap, popdown_completions): Declared these
X`09  functions.
X
X`09+ bind.c (show_completions): Call shrinkwrap() if \230B buffer
X`09  is already popped and gets larger (in order to see as many
X`09  completions as possible).
X
X`09+ random.c (liststuff): Only call shrinkwrap() if buffer not already
X`09  popped up.
X
X`09+ x11.c (x_open): Don't call setpgrp() on bsd compat systems.  Also
X`09  added comment explaining why.
X
X`09+ random.c (liststuff): Call shrinkwrap().
X
X`09+ window.c (shrinkwrap): New function.
X
X`09+ bind.c (makecmpllist): Fixed line of code which was causing
X`09  completion list to be truncated.
X
X`09+ display.c (imworking): Took out the #if 0 which I used to remove
X`09  the two lines which I suspected of causing portions of the
X`09  "working..." message to hang around afterwards.  Instead, I
X`09  supplemented the test used to change the column to erase at.
X`09  It now checks to see if the message line is being read.
X
X`09+ bind.c (makecmpllist): Print completions sorted by column rather
X`09  than by row.
X
X`09+ bind.c (makecmpllist, show_completions): New functions.
X`09 `20
X`09  (GNU_COMPLETIONS): New feature test indicating GNU readline style
X`09  completions.  Define this to be 0 to get the old vile behavior.
X
X`09  (fill_partial): Don't beep when GNU_COMPLETIONS is enabled.
X
X`09  (cmplcol): New static global variable.
X
X`09  (kbd_unquery): Adjust cmplcol.
X
X`09  (kbd_complete): Adjusted logic to handle GNU readline style
X`09  completions.
X
X`09+ configure.in (AC_PID_T): Call this macro to make sure that pid_t
X`09  will be defined.
X
X`09  (CFLAGS): Only use -Wall when the --with-warnings option is used.
X`09  Otherwise, we get too many warnings due to missing extern decls.
X
X`09+ x11.c (display_cursor, x_preparse_args): Added casts in calls to
X`09  XtAppAddTimeOut and XtAddEventHandler which were causing warnings.
X
X`09+ configure.in (setpgrp, setsid): Check to see if these are missing
X`09  extern declarations.
X
X`09+ proto.h (setpgrp, setsid): Added\2106types.
X
X`09+ configure.in (setsid): Check for existence of this function.`20
X`09  Also added comment about VC_SETPGRP being called by VC_KILLPG.
X
X`09+ x11.c (x_open): Call either setsid() or setpgrp() to break
X`09  association with controlling terminal.  This will prevent signals
X`09  from being sent back to the starting process.  I'm hoping that
X`09  this will fix problems reported concerning xvile crashing the X
X`09  server when control-C is pressed.  (I have never experienced this
X`09  problem).
X
X`09+ display.c (imworking): Removed (via #if 0) the two lines which
X`09  I suspect are causing portions of the "working..." message to
X`09  hang around afterwards.
X
X`09+ estruct.h (signal_pg): Tightened up conditions by which we will
X`09  permit getpgrp() to be called with no argument.  We still need
X`09  to design an autoconf test for this.  The more permisive conditions
X`09  were causing getpgrp() to be called improperly on SunOS. This
X`09  in turn made it impossible to use Ctrl-C in xvi\1706interrupt
X`09  lengthy processing.
X
X`09+ x11.c (x_set_watch_cursor): New function called from x_working()
X`09  and x_getc().  Also added field curs_watch to the TextWindowRec
X`09  structure.
X`09 `20
X`09  (x_working): Ignore certain types of events which could cause
X`09  us problem with reentrancy.  Other types of events are saved
X`09  in a queue for later processing.
X
X`09  (struct eventqueue, evqhead, evqtail): Declared saved event
X`09  queue structure and variables pointing to front and rear of
X`09  this queue.
X
X`09  (evqempty, evqadd, evqdel): New procedures for manipulating the
X`09  queue of events which must be processed, but not from x_working.
X
X`09  Note!!!  Not all of our reentrancy problems are solved.  The new
X`09  code which I wrote for saving events in a queue for later
X`09  processing calls malloc().  If it should happen that the
X`09  interrupt which got us into x_working()\280Aed a malloc() in
X`09  progress, the results could be disasterous if malloc() is
X`09  non-reentrant.  So far as I know, most implementations of
X`09  malloc() are not reentrant.\1D0Bis not the only call which
X`09  might get us into trouble.  Other library calls (particularly the
X`09  X11 and X toolkit functions) may well invoke malloc() or some
X`09  other non-reentrant library call.  The proper way (though not
X`09  easy) to implement all of this is to split imworking() up into
X`09  two parts; the signal handler and a display function.  T\2C09
X`09  handler will do very little; it\1806examine the state of a few
X`09  other flags (which already exist to implement the current version
X`09  of imworking) and then set the flag which will be examined by the
X`09  display function.  The\1711 is not invoked from the
X`09  signal handler.  It is called from various points in vile at
X`09  which it is possible to be in a lengthy process.  A good
X`09  candidate would be to call it from interrupted() as it is already
X`09  used for this purpose.
X
X`09+ estruct.h (sys/time.h, \0806): Moved includes for these files
X`09  ahead of include of sys/resource.h.  SunOS needs to have struct
X`09  timeval declared prior to including resource.h.  I'm beginning
X`09  to think that it might be better to nuke the include of
X`09  sys/resource.h and nuke the AC_AIX line from configure.in.
X
X`09+ configure.in (AC_HAVE_HEADERS): Added check for sys/resource.h,
X`09  which appears to be necessary to include prior to sys/wait.h in
X`09  order to keep gcc-2.6.0 from complaining on AIX.  It first appeared
X`09  that sys/m_wait.h in order to get union wait, but I believe the
X`09  bug to be in the "fixed" include files.
X
X`09+ estruct.h (sys/resource.h): Include prior to wait.h.
X
+-+-+-+-+-+-+-+-  END  OF PART 21 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 22 -+-+-+-+-+-+-+-+
X`09+ makefile.in ($(TARGET)): Changed order of LIBS and X_EXTRA_LIBS in
X`09  link line.  X_EXTRA_LIBS now comes after LIBS.
X
X`09+ mktbls.c (main): Moved initialization of "section" to after the
X`09  call to setjmp() in order to avoid gcc warning.
X
X`09+ proto.h (fputs): Added declaration.
X
X`09+ configure.in (Makefile): Test for the presence \2108 instead of
X`09  makefile after calling xmkmf.  xmkmf creates M\2D07, not
X`09  makefile.  This was preventing X_CFLAGS from getting set properly.
X
X`09  (with_warnings): Call AC_WITH to set this value.  We shouldn't
X`09  assume that autoconf will create a configure script which will
X`09  automatically create/set this variable.
X
X`09  (VC_MISSING_EXTERN): Split checks into two parts, one which is
X`09  enabled with --with-warnings (for type checking purposes), the
X`09  other which is mandatory.  This should speed up the configuration
X`09  process for non-developers.
X
X`09+ display.c (CLEAR_PLINE): Make sure that attributes get cleared too.
X
X`09+ x11.c (update_scrollbar_sizes -- NO_WIDGETS version): Created a
X`09  separate loop for drawing the new scrollbars which occurs after
X`09  the sizes have been changed.  Otherwise,\2906crollbars don't always
X`09  properly update due to a lower bar covering an upper bar up prior
X`09  to being resized.
X
X`09+ x11.c (exposed): New field in TextWindowRec.
X`09  (x_preparse_args): Initialize cur_win->exposed.
X`09  (x_process_event): Set cur_win->exposed to true when an Expose event
X`09  is received.
X`09  (x_flush): Return immediately if no Expose events have been
X`09  received.  The reason for all of this is to prevent drawing to the
X`09  window prior to the display server being ready for us to send the
X`09  stuff.
X`09  (x_touch): Make sure the cell has something in it before marking it
X`09  as dirty.  The reason for this is that x_touch is called most of
X`09  the time to refresh a region of the screen which is clear (set
X`09  to the background color).   I'll handle the other cases by making
X`09  sure that the required area is clear...
X`09  (x_scroll): Don't call XFlush() unless visibility is partially
X`09  obscured.
X`09  (x_scroll): Call XClearArea() to clear area vacated by \3406ing.
X`09  Should be faster because we won't have to clear portions of each
X`09  line individually.
X`09  (x_setfont): Added call to XClearWindow() before calls to x_touch().
X`09  (x_preparse_args): Use ButtonMotionMask instead of Pointer\1D0A
X`09  when focus_follows_mouse is false.  Otherwise, too many motion events
X`09  are generated when moving the mouse through the vile window.  Folks
X`09  who want focus_follows_mouse will just have to live with the extra
X`09  motion events for the time being.
X
X`09+ display.c (CLEAR_PLINE): Don't mark cells in cleared line as dirty.
X
X`09+ select.c (pop_fake_win): fixed typo in comment.
X
X`09+ buffer.c (update_on_chg): Call b_is_temporary() instead of
X`09  b_is_invisible().  This matches the logic found in makebufflist().
X`09  (makebufflist):  Call update_on_chg() macro in order to help prevent
X`09  future inconsistencies.
X
X`09+ window.c (set_curwp):  Added a check at the beginning of the
X`09  function to return immediately if curwp is already set to the
X`09  window pointer to change to.  Among other things, this will`20
X`09  avoid calling updatelistbuffers() which was responsible for
X`09  preventing us from being able to select (via the mouse) from
X`09  the `5BBuffer List`5D window.
X
X`09+ x11.c (modeline_resources, selection\150A): New array
X`09  which describes resources for modelines and selections.
X`09  (x_preparse_args): Get subresources for the modelines and
X`09  selections.
X`09  (modeline_fg, \0D09b\0D0Cfocus\200E\1306bg,
X`09  selection_fg,\0E0Bbg): New fields in TextWindowRec.
X
X`09+ x11.c (char_descent): New field in TextWindowRec.
X`09  (query_font): Set char_descent field.
X`09  (flush_line): Use char_descent for determining where to write out
X`09  underlines.  This fixes a bug in which spurious \300A were
X`09  left around on the screen when displaying certain fonts.
X
X`09+ x11.c (scrollbar_resources): New array describing certain \3309
X`09  resources.
X`09  (cur_win_rec): Statically allocated TextWindowRec.  \3307 is
X`09  also statically initialized to point at this structure.  Needed by
X`09  scrollbar_resources in order to make the default foreground and
X`09  background for the scrollbars be the same as the already determined
X`09  foreground and back\0F07for the rest of the application.
X`09  (x_preparse_args): Get scrollbar subresources and use these as
X`09  appropriate in creating the scrollbar graphics context.
X`09  (x_preparse_args): Make sure that background and fore\0F07pixel
X`09  values are different.  They can start out \1F09 in the resource
X`09  file, but get mapped to the same values on monochrome displays.
X
X`09+ region.c (yank_line): New code to yank the newline (if appropriate).
X`09  Used when yanking mouse selections.
X
X`09+ basic.c (setwmark): Don't permit dot to be set past end-of-buffer.
X`09  (setcursor): Removed comment saying that position may be set past
X`09  end-of-buffer.
X
X`09+ vile.hlp: Corrected some minor typos.
X
X`09+ display.c (hilite): Mark the vscreen row as changed when changing
X`09  the attributes in the OPT_VIDEO_ATTRS portion of this code.
X
X`09+ x11.c (x_preparse_args): Use 1 and 0 as the foreground and back\0F06
X`09  pixel values in the call to XCreatePixmapFromBitmapData().  I think
X`09  that this make sense since the depth is one.
X
X(tom)
X`09+ autoconf-macro VC_SIZE_T fixes problem with size_t on CLIX and Ultrix
X`09  (aclocal.m4, configure.in).
X
X`09+ added autoconf tests for poll.h, setjmp.h (configure.in)
X
X`09+ some lint and compiler warnings/errors for SunOS, CLIX, IRIX (eval.c,
X`09  region.c, tags.c, vers\1307x11.c
X
X`09+ make IBMPC the default driver for MSDOS (estruct.h)
X
X`09+ supplied definition for VMS to make ScratchName work (estruct.h)
X
X`09+ "#error" doesn't work on SunOS; changed this to "\2F07(estruct.h)
X
X`09+ corrected autoconf ifdef'ing of getwd/getcwd (estruct.h)
X
X`09+ corrected lint rule in makefile.in
X
X`09+ removed /Debug option when compiling vile on VMS (descrip.mms).
X
X`09+ corrected logic of 'is_vms_pathname()' to handle the case of rooted
X`09  logicals, e.g., "dev:`5Bfoo.`5D`5Bbar`5Dname" (path.c).
X
X`09+ corrected error on VMS which left terminal in wrong state when
X`09  closing terminal (termio.c).
X
X`09+ corrected 'resolve_filename()'; the call to update the status line
X`09  had gotten lost somehow (file.c).
X
X`09+ ifdef'd 'get_modtime()' to handle VAX C's backwards treatment of the
X`09  st_mtime/st_ctime members of stat structure (file.c).
X
X`09+ commented-out X-Window libraries in VMS link options file
X`09  (vms_link.opt); (these should be autoconfigured :-)
X
X`09+ minor cleanup of directory scanning code for NT (path.c).
X
X`09+ modified kev's GNU choices to implement the "popup-\2007" mode
X`09  (modetbl, bind.c, main.c).
X
X`09+ modified (for UNIX) the behavior of 'filter-buffer' so that \1706
X`09  commands with pipes work (i.e., ":filter-buffer sort`7Cuniq") (spawn.c).
V
X
X`09+ changed the yank-til command to use the same limits as delete-til, so
X`09  that "yW" will yank trailing spaces of a word (opers.c).
X
X`09+ implemented mode "popup-msgs" with new file 'msgs.c'.  This is mainly
X`09  useful in debugging macros; it forces a buffer `5BMessages`5D to be
X`09  popped up when multiple messages are generated by a single command.`20
X`09  (display.c, main.c, msgs.c, estruct.h, modetbl, also makefile.* and
X`09  vms_link.opt).
X
X`09+ added mode 'errorbells' to control whether vile beeps (or flashes) at
X`09  all.  This relies on intercepting the TTbeep calls, which are all
X`09  done within 'kbd_alarm()' (mostly via 'mlwarn()') now (bind.c,
X`09  display.c, exec.c, fences.c, input.c, isearch.c, main.c, mod\2506opers.c,
V
X`09  search.c, undo.c, window.c).
X
XChanges for vile 4.6 (unreleased Tue July 12, 1994)
X(pgf)
X`09+ changed authorship in README, added credits in vile.hlp
X
X`09+ applied further OS/2 patches from Charles Moschel
X
X`09+ applied Windows/NT patches from Joe Greer.  don't get excited.
X`09  it's just console support.  :-)
X
X`09+ added admin targets to makefile.in.  these are all (?) useful
X`09  directly, with "make -f makefile.in ..." since they don't depend
X`09  on any of the config variables.
X
X`09+ minor wording changes to README.CONFIG and INSTALL.
X
X    `09+ eliminated global variable "slash", renamed macro\1707c()" to
X`09  "is_slashc()", use new define SLASHC in place of "slash".
X
X`09+ did a lot of hand merging of NT and WIN31 ifdefs (since they
X`09  both affected most of the same lines.   this note is really just
X`09  a heads-up, in case i missed/broke something.
X
X`09+ re-renamed manpage.vmc to\0F09rc, to avoid introducing yet
X`09  another file suffix.  changed CHANGES and vile.hlp to match.
X
X`09+ eliminated makefile.sav from the distribution.
X
X`09+ eliminated all "Log" keywords, added "Header\190A everywhere.
X
X(kev)
X`09+ manfilt.c (sys/types.h): Include this file so that size_t will be
X`09  defined on certain systems.
X
X`09+ x11.c (alternate_font): Added cast to second arg in call to
X`09  castalloc to avoid conversion warning.
X
X`09+ configure.in (fputs): Added this function to the missing check
X`09  list.  Not needed for vile, but for manfilt.c.
X
X`09+ manfilt.c: Converted from ANSI C to the style of C in which the
X`09  rest of vile is written in.
X
X`09+ buffer.c (makebufflist): Added cast to convert return value of
X`09  strlen to SIZE_T.
X
X`09+ filec.c (fillMyBuff): Added cast to second arg in call to bs_find().
X`09  Some platforms declare strlen to return int instead of size_t.
X
X`09+ estruct.h (realloc): Changed prototype declaration so that second
X`09  arg is unsigned.
X
X`09+ estruct.h, mktbls.c (malloc): Changed extern declaration so that
X`09  first parameter is an unsigned int rather than just int.  This
X`09  eliminates "conversion" warnings on some systems.
X
X`09+ mktbls.c (free): Added extern declaration with prototype.
X
X`09+ x11.c (estruct.h, edef.h): Moved includes of these files to before
X`09  the X11 includes.  I was having trouble on an SVR3 system in which
X`09  flock was getting declared twice.  It turns out that <X11/Xos.h>
X`09  (which is included from <X11/Intrinsic.h> does a check to prevent
X`09  fcntl.h (from which flock is ultimately defined) from being
X`09  included twice.  In my opinion, the authors of the system\3A08
X`09  files for this SVR3 system didn't do their job very well.  Rather
X`09  than propogate checks to see if a particular system include file
X`09  has already been included into estruct.h, I figured that a slight
X`09  reordering (in x11.c) would be better.  Let's just hope it doesn't
X`09  break something else.
X
X`09+ estruct.h (MISSING_EXTERN_REALLOC): Fixed my misspelling of this
X`09  (lack of) feature test.
X
X`09+ mktbls.c: Conditionally include config.h in order to use
X`09  configuration parameters for Unix systems.  Non-u\130B
X`09  should still compile as they did before (if I didn't botch
X`09  something).  I was having trouble with the fprintf extern on
X`09  certain systems.
X
X`09+ makefile.in (MKTBLS): Use CPPFLAGS to build the mktbls program.
X`09  This will cause HAVE_CONFIG_H to be defined.
X
X`09+ README.CFG: New file which describes the configuration process as it
X`09  relates to (x)vile.  I recommend changing the name of README to NEWS
X`09  and README.CFG to\0E07 to be more consistent with FSF software.`20
X`09  I'll leave this up to Paul though.
X
X`09+ README (impatient?):  Changed message slightly.
X
X`09+ makefile.in (install, \0907dirs, un\1809\2E08,
X`09  config.status, mostlyclean, \0707dist\1207real\1D07TAGS,
X`09  tags, dist): These targets added or modified to conform to the
X`09  GNU standards document.
X
X`09+ mkdirs.sh, INSTALL, install.sh: New files copied from the GNU
X`09  autoconf distribution (mkdirs.sh renamed from mkinstalldirs
X`09  to simplify copying files to/from MS-DOS -- tom).
X
X`09+ config_h.in:  Renamed from\1B07.d.in.  I really wish I could
X`09  use autoheader to generate config.h.in as the autoconf doc
X`09  describes.  Unfortunately, it isn't powerful enough (without
X`09  some rewriting) to do what I want.
X
X`09+ aclocal.m4 (VC_SETPGRP): New vile configuration macro.
X
X`09+ line.c (ksetup): Initialize kcharpending.  This lack of
X`09  initialization was responsible for the bug in which a newline was
X`09  sometimes being inserted before a yanked region when it shouldn't
X`09  have been.  Also moved definition of kcharpending so that it appears
X`09  prior to the definition of ksetup().  The bug may be observed as
X`09  follows: Create a buffer with a single line containing the
X`09  characters "foo".  Enter the command ":list-registers" in order to
X`09  view the registers.  Go back to the beginning of the newly created
X`09  buffer (containing "foo").  Type "yw".  "foo" will appear as the
X`09  unnamed register.  Type "yw" again.  The un\280D will now
X`09  (prior to this fix) have the "foo", but also a newline in front of
X`09  it.
X
X`09+ configure.in (tcgetattr): Test to see if this function exists.
X
X`09+ termio.c (HAVE_TCGETATTR): Added this test to see whether or
X`09  not to define USE_POSIX_TERMIOS.  Also added commentary describing
X`09  reason for this.
X
X`09+ x11.c (x_flush): Removed all explicit calls to this function.  It
X`09  was being called after update() which is unnecessary since
X`09  update (indirectly) calls x_flush().  Calls to\2F07() now
X`09  pass the force argument (the only\1309) as TRUE to ensure
X`09  that the update will not be deferred due to type-ahead.
X`09  (resize_bar): Removed code for determining vertical positioning
X`09  involving XQueryPointer() and/or XTranslateCoordiates.  With a
X`09  little bit of care, we can get the vertical position accurately
X`09  without making a round trip server request.
X
X`09+ x11.c (repeat_scroll): Added call to XSync() in order to make sure
X`09  that repeated scrolling (via the timer) doesn't get ahead of display
X`09  of the scrolling.`20
X`09  (resize_bar): Ifdef'd to try out XTranslateCoordinates() in place
X`09  of XQueryPointer().  This should work better since it will give
X`09  us the coordinates of the pointer at the time \1B07event instead
X`09  of the current pointer value.
X
X`09+ x11.c (visibility):  New field in struct _text_win.
X`09  (wait_for_scroll): Do not call x_flush().  Return only when
X`09  we're sure that all contiguous GraphicsExpose events have been
X`09  processed.  This code was previously returning after the first one.
X`09  (x_scroll, x_flush): Return immediately if window is fully obscured.
X`09  (x_scroll): Don't wait for the \1C06 if the window is unobscured.
X`09  (x_preparse_args): Initialize visibility.  \180A
X`09  graphics_exposures field of cur_win->textgc.
X`09  (x_process_event): Added new case for VisibilityNotify which note
X`09  changes in the visibility of the window and modify cur_win->textgc
X`09  accordingly.
X
X`09+ x11.c (ISC):  Removed #undef of ISC.  Should not be necessary
X`09  any longer.
X`09  (X_PIXEL): Removed #define.  Not used anywhere.
X`09  (NPAUSE): Nuked.  Not needed.  Replace occurrence in term structure
X`09  with zero.  (This was supposedly the number of times to busy loop
X`09  in the catnap routine.
X`09+ x11.c (x_preparse_args):  Support for left scrollbars in OpenLook
X`09  added.
X`09+ basic.c, csrch.c (setnmmark, g\0B08name, get_csrch_char): Changed
X`09  name of "stat" variable to\1306us" in order to avoid shadowing the
X`09  stat function.  This didn't actually cause any problem, it just
X`09  makes gcc shut up when used with Tom's preferred set of switches.
X`09+ proto.h (setvbuf): Prototype.
X`09+ display.c (updateline):  In OPT_PSCREEN version, return immediately
X`09  if v_flag for the row doesn't have VFCHG set.
X`09  (psc_putchar, psc_eeol): Set VFCHG flag on proper row.
X`09+ termio.c (ttputc, ttflush, ttgetc): Don't define these for X11.
X`09  Also got rid of calls to setbuffer, etc for X11.
X`09+ proto.h (getscreensize): Declare even when SIGWINCH is not
X`09  defined.
X`09+ estruct.h (malloc, realloc): Prototypes.
X`09+ main.c, fileio.c (fcntl.h): Removed include from here.  estruct.h
X`09  now includes it.
X`09+ estruct.h (time.h):  Included here.  Don't i\1606 both \2D06
X`09  and sys/time.h if they conflict with each other.
X`09+ version.c: Removed include of time.h.
X`09+ proto.h: Reorganized\1506types for system calls to use the
X`09  MISSING_ test to determine whether an extern declaration needs
X`09  to be made.
X`09+ estruct.h (libc.h): Include this file (NeXT has hundreds of
X`09  prototypes declared here).
X`09+ termio.c (LINUX): Nuked ifdefs surrounding calls to tcdrain().
X`09+ estruct.h, random.c (sys/select.h): Moved inclusion of
X`09  sys/select.h from random.c to estruct.h (so that any types
X`09  declared in sys/select.h will be available for later inclusion of
X`09  proto.h).
X`09+ estruct.h (AUX2, AIX, OSF1, LINUX, V7, BSD386, UNIXPC): Eliminated.
X`09+ eval.c (AUX2, pyr, AIX):  Replaced in #if with
X`09  HAVE_LOSING_SWITCH_WITH_STRUCTURE_OFFSET.  I'm open to suggestions
X`09  on a better name for this.
X`09+ proto.h, estruct.h (fcntl.h, sys/wait.h):  Included from\300A
X`09  instead of proto.h.
X`09+ npopen.c (sys/wait.h): Removed include from this file.
X
X`09+ x11.c (start_selection):  Yank \1209 prior to releasing\1D0A
X`09  when persistent_selections are disabled.
X`09  (x_process_event): Check to see if multiclick time has expired prior
X`09  to discarding motion event when cur_win->numclicks is greater than
X`09  one.  (If it's expired, we don't want to discard the event).
X
X`09+ display.c, termio.c (getscreensize): Moved from\300A to
X`09  termio.c.  This is a better place for it since we are invoking
X`09  ioctl.  (This also explains why it was necessary to include
X`09  the termios /\0A07 / sgtty stuff in display.c.)
X`09+ estruct.h (SVR3, ODT, ISC, HPUX): Eliminated.
X`09+ termio.c (ttopen): Changed preprocessor feature test for
X`09  call to setvbuf.  Also added code to handle systems (old
X`09  SVR3 systems) which have the second and third arguments to
X`09  setvbuf reversed.
X`09+ main.c (catchintr): Always reinstate the signal handler regardless
X`09  of system.  The code should probably be revisited...
X`09+ spawn.c (rtfrmshell): Ditto.
X`09+ estruct.h (USE_BCOPY): Usage eliminated as it was never being defined
X`09  anywhere.
X`09  (SYSV_STRINGS): Eliminated since it was defined, but never
X`09  referenced.
X`09  (strings.h, memory.h): Included as per GNU recommendations.
X`09  (ULTRIX): Removed references to this unix variant.
X`09+ random.c (current_directory): Eliminated reference to POSIX and
X`09  reorganized preprocessor tests for how to get the current directory
X`09  a little bit.
X`09+ fileio.c: Eliminated reference to BERK.
X`09+ termio.c: Eliminated reference to BERK and other unix varieties.
X`09  We now use HAVE_TERMIOS_H, and company.  I also eliminated code
X`09  specific to OSF1.  If there's a problem with it, we should try
X`09  to deal with it elsewhere (such as the configuration script).
X`09+ dirstuff.h:  Added stuff for including obscure readdir headers.
X`09  Eliminated reference to BERK.
X`09+ estruct.h (SIGT): Wrapped an ifndef around the logic that defines
X`09  SIGT and SIGRET since they will be determined by the configuration
X`09  script.  Also removed tests for various specific varieties of UNIX
X`09  from this logic.`20
X`09  (HAVE_SELECT, HAVE_POLL): Removed preprocessor logic for both of
X`09  these.  The configuration script now determines which of\3906
X`09  are available.  We do undef HAVE_POLL i\0D07SELECT is defined
X`09  however.
X`09  (USE_INDEX, HAVE_GETHOSTNAME, signal_pg): Changed preprocessor logic.
X`09  (BERK): Eliminated all occurences.
X`09+ display.c (termios.h, \0B06.h, sys/ioctl.h, \0909sys/types.h
X`09  sys/stream.h, sys/ptem.h):  Removed includes and ifdef logic
X`09  connected with these header files.  They don't appear to be used
X`09  anywhere in display.c (though I have no doubt that they were at
X`09  one time).
X`09+ makefile.in:  New file; a template for creating the \3409  This
X`09  file was created by hacking the old makefile.
X`09+ configure.in:  New file for creating the \2909 script.
X`09+ config.d:  Template file for creating\2608h.
X
X(tom)
X`09+ modified 'mktbls' so it can be used as a function in a Windows 3.1
X`09  application (e.g., fixed memory leaks, top-level return).
X
X`09+ built with kevin's autoconf script on Linux (both termcap and
X`09  Xt versions), adjusted/corrected various files for autoconf and for
X`09  MSDOS filename compatibility (aclocal.m4, bind.c, cmdtbl
X`09  configure.in, edef.h, epath.h, estruct.h, file.c\0806io.c, glob.c,
X`09  ibmpc.c main.c, makefile.in\0D0Btbc, map.c, mktbls.c, npopen.c,
X`09  path.c proto.h, random.c, spawn.c, termio.c, x11.c).
X
X`09+ made a driver-stub for Windows 3.1, to get a clean compile/link.
X
X`09+ corrected 'ibmscroll()' function, which was broken in vile 4.4
X`09  (ibmpc.c).
X
X`09+ corrected reopening of stdin when a file is piped to vile; on Linux
X`09  this caused vile to hang (main.c).
X
X`09+ moved include of estruct.h after X Window\2408s in x11.c, since
X`09  the definition of VMS causes the compile to break otherwise.
X
X`09+ added new (some incomplete) files for Windows 3.1 port, map command
X`09  and debugging: commdlg.msg mapchars.c\0B0Ah trace.c \0806h
X`09  win31drv.c\0B0Adef\1806tbl\1808tbl.\180Dh
X`09  win31tbl.rc
X
X`09+ modified 'gtfun()' and 'sindex()' to use single return points, to
X`09  ease debugging.
X
X`09+ added/used new macro 'window_b_val()' to handle the cases in which we
X`09  reference a mode value for the current window, e.g., when executing a
X`09  macro (estruct.h, isearch.c, oneliner.c).
X
X`09+ initialize VIDEO-struct in 'vtinit()' that Purify found (display.c).
X
X`09+ corrected globbing logic so that expressions such as `60which script`60
X`09  work properly when the glob mode is "on" (glob.c).
X
X`09+ added autoconf test VC_CPP_SUBS to make the ScratchName macro port.
X
X`09+ corrected :-command parsing so that repeated ":" at the beginning of
X`09  the line is ignored (exec.c).
X
X`09+ reset mouse position when changing the screen resolution to avoid
X`09  confusing users about its visibility (ibmpc.c).
X
XChanges for vile 4.5 (released Wed Apr 27, 1994)
X(pgf)
X`09+ backed out change to "set all" which switched to Settings buffer.
X`09  it didn't work, and was confusing in any case.  (modes.c)
X
X`09+ redid the variables that identify os and vile\2406nt.  now the
X`09  $progname variable says "vile" or "xvile", and the new $os \3108
X`09  says "unix", "dos", "vms", or "os/2".  (modetbl, eval.c, version.c,
X`09  proto.h, main.c, edef.h, vile.hlp, macros.doc)
X
X(kev)
X`09+ vile.hlp: Documented manual page stuff.
X
XChanges for vile 4.4 (not released April 26, 1994)
X(pgf)
X`09+ fix for ": `26 1" in empty buffer.  (exec.c)
X
X`09+ ensure that problems opening a file are correctly reported
X`09  at startup, by giving swbuffer() a real return value.  next\2308
X`09  returns this, which lets main() do the right thing.  i hope
X`09  letting swbuffer() return readin() errors doesn't have too large
X`09  a ripple effect.  we'll see.  the return from swbuffer() is ignored
X`09  in many cases anyway.  (buffer.c, main.c)
X
X`09+ on file open errors in readin, continue with the routine, so the
X`09  buffer gets set up correctly.  cmode was wrong before, for instance.
X`09  (file.c)
X
X`09+ added select operator (bound to `5ES) to do \2406ions.  it yanks
X`09  by default.  (region.c, opers.c, cmdtbl, select.c)
X
X`09+ implement support (via new arg to scwrite, not yet put into other
X`09  "screens" that provide this routine) for OPT_VIDEO_ATTRS under DOS.
X`09  (display,c, ibmpc.c, proto.h)
X
X`09+ removed KBD_LOWERC from the DOS KBD_OPTIONS, as an experiment, even
X`09  thought tom told me not to.  i've seen no ill effects so far.`20
X`09  there must be something, though...  (could this be compiler
X`09  (well, libc) dependent?) (filec.c)
X
X`09+ added proper dependencies to makefile.wat
X
X`09+ recalc kregwidth on last call to kinsertlater, since we may
X`09  never get a newline to force it.  (line.c)
X
X`09+ added mode "view-on-readonly" which causes view\2A06to be set
X`09  if file is read-only on first open. (modetbl, file.c, vile.hlp)
X
X`09+ implemented sel_motion() routine, that allows referencing the
X`09  selected region from an operator.  fixed various off-by-one
X`09  nits in various places to mkae this work right.  (basic.c,
X`09  opers.c, region.c, select.c, proto.h, cmdtbl, x11.c)
X
X`09+ cleaned up beeping.  too many double beeps.  (file.c, fileio.c,
X`09  basic.c)
X
X`09+ now preserve DOT during yank operations, so yy and Y don't cause
X`09  motion. (opers.c)
X
X`09+ added "haveregion" backdoor to get\1706() -- if the\2F0D
X`09  pointer is set, getregion just returns it as the region. see
X`09  select.c for uses of this.  (region.c)
X
X`09+ added #error statement to little/dis-used screen drivers, to
X`09  find out which are really used. (at386.c, hp110.c, st520.c,
X`09  z100bios.asm, z_ibmpc.c, dg10.c, hp150.c, vt52.c, z309.c)
X
X`09+ function lookup is now first match, rather than exact, to\1D06
X`09  documentation.  (eval.c)
X
X`09+ fix core dump from referencing empty line for macro label goto.
X`09  (exec.c)
X
X`09+ eliminated unimplemented "target" variable. (modetbl)
X
X`09+ created doc for programmed macros, based on uemacs 3.10 doc.
X`09  (macros.doc, makefile)
X
X`09+ check all getregion() return values. (word.c, select.c)
X
X`09+ moved operselect() to \0C06.c from\1E06.c.
X
X`09+ reset haveregion after use in get\1706().  (\2306.c)
X
X`09+ sel_motion and operselect, if now used together in a single
X`09  command, can be used to extend a keyboard selection. (\0C06.c)
X
X`09+ giving any argument to "shell-command" or ":!" now suppresses
X`09  the press-return prompt. (spawn.c, proto.h)
X
X`09+ added calls to update() if screen is garbage in mlyesno and
X`09  mlquickask, in case they are called after a shell-escape from
X`09  a macro. (input.c)
X
X`09+ fixed cursor position after `5EB command (should rest at bottom
X`09  of window) (basic.c)
X
X`09+ fix ordering of kdone/kinsertlater stuff (kcharpending was being
X`09  reset by kdone called from kinsert) to fix problem where a yank
X`09  containing an initial blankline would not record that blank line.
X`09  (line.c)
X
X`09+ changed kcod2str, fnc\0906string2prc to deal in "p-\1906s", i.e.
X`09  binary strings with length stored in first byte.  needed this so
X`09  bindings involving null character could pass through everywhere.
X`09  the :map code in map.c still has problems.  (bind.c, x11.c,
X`09  x11simp.c, input.c, map.c, proto.h)
X
X`09+ separate target for Sony NeWS -- for sys/ioctl.h problem (makefile,
X`09  termio.c)
X
X`09+ patch from Michael Finken, to allow keeping the buffer name in
X`09  the window and icon names (x11.c, display.c, proto.h, vile.hlp)
X
X`09+ tungetc() now pushes back 16 bit keycodes using kcod2escape_seq()
X`09  to translate them to a user-typable sequence, and maintaining a
X`09  stack of pushed back chars.  it should still only be used for
X`09  one key's worth of pushback.  (input.c, some others?)
X
X`09+ insert mode now encodes SPEC keys (when recording them) as poundc
X`09  followed by poundc+1\150Dc.  real\1E07 chars are stored
X`09  as poundc followed by\1307.  there is no more "alt\3106".
X`09  (insert.c)
X
X`09+ merged OS/2 patches from Charles Moschel (ccm@cais.com).  reworked
X`09  them somewhat to use better ifdefs in many cases.   This touched
X`09  a lot of files.
X
X`09+ introduced routine strncpy0() which jams a '`5C0' into the last
X`09  copyable byte.  changed several of the most bug possibilities
X`09  to use it.  (bind.c display.c eval.c finderr.c input.c isearch.c
X`09  main.c makefile proto.h tags.c)
X
X`09+ eliminated #elif from x11.c, for HP users.
X
X`09+ reworked Charles Moschel's os2 screen driver into a "borland"
X`09  console i/o driver.  i can't test it on OS/2, but i think it's
X`09  the equivalent of his.  now there are separate ifdefs to control
X`09`09which os we want&0209MSDOS or OS2
X`09`09the pc keyboard&0209`09IBM_KBD
X`09  `09the physical screen driver`09IBMPC
X`09`09the console i/o driver&0209BORLAND
X`09  the Borland compiler is still represented with "TURBO", since
X`09  that's still predefined in Borland C++.
X`09  (borland.c edef.h estruct.h ibmpc.c main.c makefile.tbc spawn.c
X`09  termio.c version.c)
X
X`09+ split routine execproc() in two, to make it internally callable,
X`09  given the name of the procedure to run. (exec.c, proto.h)
X
X`09+ added cdhook variable, which is the name of a procedure which
X`09  is run when changing current directory.  (edef.h eval.c
X`09  exec.c modetbl proto.h random.c)
X
X`09+ added variable $ocwd, the previous directory (modetbl, eval.c,
X`09  random.c, proto.h)
X
X`09+ backed out changes that implemented the "keep buffer name in window
+-+-+-+-+-+-+-+-  END  OF PART 22 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 23 -+-+-+-+-+-+-+-+
X`09  and icon title" resources.  this is better done with hooks. (x11.c,
X`09  proto.h, display,c, vile.hlp)
X
X`09+ apply patch from richard hussong to fix scrolling problem on some
X`09  video bios'es (ati ultra pro) (ibmpc.c)
X
X`09+ added more hook variables: read-hook, write\0C07buffer\1906
X`09  exit-hook.  modified help file to describe procedures, and hooks.
X
X`09+ added new variable, $abufname, which is the "alternate buffer",
X`09  i.e. what you'd get if you type '#'. (modetbl, eval.c, vile.hlp)
X
X`09+ apply fix to map_proc from lee johnson -- :map g G followed by
X`09  1g didn't work, since 1 was considered default. (map.c)
X
X`09+ change macros BAD and GOOD to BADEXIT\1409EXIT to avoid
X`09  conflicts on AIX.  (display.c estruct.h file.c ibmpc.c main.c
X`09  mktbls.c spawn.c tcap.c termio.c version.c window.c x11.c
X`09  x11simp.c)
X
X`09+ it is now possible to use forward-char-scan et al from a macro.
X`09  (csrch.c)
X
X`09+ "response variables", the ones that ask questions (e.g. @foo)
X`09  now remember a default response.  (eval.c)
X
X`09+ added support for using the ansi.c screen driver under MSDOS.
X`09  (ansi.c, termio.c, estruct.h, makefile.wat)
X
X`09+ added w!  and x!  as synonyms for w\1A06, since they are the
X`09  same under vile.  (cmdtbl,\1006hlp)
X
X`09+ added support for new GNU libio stdio pkg, for isready_c() macro.
X`09  (fileio.c)
X
X`09+ fix globber() so :g/foo/p leaves you in the p-lines buffer, which
X`09  is probably where you want to be.  (globals.c)
X
X`09+ fix problem in main that caused us to skip first file if noautobuffer
X`09  was set.  (main.c)
X
X`09+ now that there are so many modes, it's desirable to switch
X`09  to the ":set all" ("show-modes") window when it pops up. (modes.c)
X
X(tom)
X`09+ warning/lint cleanup (bind.c buffer.c display.c edef.h estruct.h
X`09  eval.c fences.c insert.c line.c proto.h random.c region.c select.c
X`09  tags.c x11.c)
X
X(kev)
X`09+ select.c (EFFICIENCY_HACK, attribute_cntl_a_sequences):  New code
X`09  which makes attributing regions with large numbers of\2A09es
X`09  much more efficient.
X
X`09+ x11.c (CLEAR_THRESH): Changed value and added explanation.
X`09  (NONDIRTY_THRESH): New constant.
X`09  (x_getc): Added inner loop for getting as many X events as possible
X`09  prior to returning in order to let the typeahead check in update()
X`09  do its job.
X
X`09+ manfilt.c (fatal_error): New function.
X`09  (INITIALSIZE): New constant.  Got rid of old \1A08s which
X`09  hardwired the buffer sizes.
X`09  (line_in_size, line_out_size): New variables for keeping track
X`09  of the buffer sizes.
X`09  (getline): Rewritten so that input lines may be of arbitrary
X`09  length.
X
X`09+ display.c (update): Keep track of original row and column in
X`09  case we're reading the message line.  If we a\250E
X`09  message line, update the hardware cursor to the original row
X`09  and column instead of the current window.  I think that this
X`09  problem was evident only when the OPT_PSCREEN feature was enabled.
X
X`09+ estruct.h (do_mark_iterate): Reassert ownership of selection if
X`09  appropriate.
X
X`09+ proto.h, select.c (sel_reassert_ownership): New function.
X`09 `20
X`09+ display.c (reframe):  Fixed an off-by-one error which was causing
X`09  the cursor to be placed on the mode line after a reframe in a
X`09  one line buffer.
X
X`09+ input.c (kbd_reply): Fixed off by one error which was causing core
X`09  dumps on the NeXT.
X
X`09+ x11.c (x_get_selection, copy_paste): Added caste for third argument
X`09  in calls to tb_bappend.
X`09 (alternate_font): Removed debugging printf.
X
X`09+ x11.c (x_configure_window): New code for unmanaging / \0B08
X`09  the children of a motif form which will hopefully prevent the
X`09  problems with huge scrollbars.`20
X
X`09+ random.c (line_count): Added null buffer check.  This lack of
X`09  check was causing core dumps on start up in xvile when $font was
X`09  being set from the .vilerc file to a value which caused a resize.
X
X`09+ cmdtbl, proto.h, select.c (operattrital): New \1306or for italics.
X
X`09+ x11.c (x_setfont, query_font): Cleaned up memory leaks, one stemming
X`09  from the fact that the XFontStruct structure pointed at by
X`09  the pfont field was never getting freed, the other concerning
X`09  allocation of memory for font names.
X`09 (starting_fontname): New field in the TextWindow structure.  This
X`09  field points to the initially requested font name. The fontname
X`09  field is reserved for holding the name of the font once it has
X`09  been successfully loaded.
X`09 (query_font): Attempt to find the fully qualified font name (rather
X`09  than an alias or template).  Also, free storage associated with`20
X`09  new fields in struct _text_win (see below).
X`09 (FSRCH_BOLD, \0C06ITAL\0C08BOLDITAL): New flags.
X`09 (fsrch_flags, pfont_bold\0C08ital\180C\1006left_ink,
X`09  right_ink): New fields in struct _text_win.
X`09 (alternate_font): New function.
X`09 (flush_line): New code for handling bold and italics.  Old \2908
X`09  doing bold retained as a fallback position in the event that a
X`09  bold font is unavailable.
X`09 (x_get_font_atom_property): New function.
X`09 (x_flush): New code for cleaning up the mess sometimes left when
X`09  using monospaced fonts. `5BGlyphs in\1D11 sometimes extend
X`09  outside the bounding box associated with the font.  Thus when
X`09  a dirty cell adjacent to a non-\1D0Bis updated, the\1F0A
X`09  cell also needs to be updated in the event that the character
X`09  previously written to the dirty cell extended outside of its
X`09  bounding box and into the non-dirty cell.`5D
X
X`09+ window.c (delwp):  Always set WFHARD on the receiving\3607
X`09  (instead of just when the current window pointer is the same as
X`09  the one being deleted).  This corrects a problem with the mode
X`09  line attribute sometimes not getting reset. `5BScenario: Edit a
X`09  file.  Split the window.  Type '*'.  Move to a different \2806
X`09  than the "*" window.  Type '*' again.  Both vile and xvile leave
X`09  the line that the messag\1607used to be on bold.`5D
X
X`09+ macros.doc: Fixed some minor typos.
X
X`09+ select.c (extended_region): Added prototype.
X
X`09+ manfilt.pl: New file. Perl script for filtering backspace sequences.
X`09+ cmdtbl (operattrcaseq): Replaces \1908bsseq.
X`09+ proto.h, select.c  (attribute_cntl_a_sequences, operattrcaseq):
X`09  Replaces attribute_backspace_sequences and operattrbsseq.
X
X`09+ random.c (getcol): Now works for empty lines where offs > 0.  This
X`09  is probably one of many functions which will need to be fixed now
X`09  that it is possible to position the cursor \0E07newline character.
X`09  (See Paul's changes.)
X`09 `20
X`09+ file.c (getfile2): Don't prompt user if noninteractive.  This
X`09  change prevents an infinite loop when executing my manual page
X`09  macro (or any\0E07which needs\0606 a buffer where there is a
X`09  name conflict.  Paul and Tom should look at this to make sure that
X`09  it doesn't break keyboard macros.
X
X`09+ display.c (updattrs): Garbage collect attributes which should
X`09  display something (i.e., have nonzero ar_vattr field), but refer
X`09  to an empty region.
X
X`09+ display.c (updattrs): Added a parameter to this function and
X`09  changed call in update() to reflect this\2907.  Also moved
X`09  placment of call from within update.  The result of all of this is
X`09  that the attributes will only be updated\1006when WFHARD or
X`09  WFEDIT is set for the window.\1F0Cneeded in order to
X`09  display changed boundaries of the attributed text in the event
X`09  that the marks denoting the ends are moved as the result of an
X`09  editing operation.
X
X`09+ estruct.h (do_mark_iterate): Rewritten to be faster.  This improved
X`09  performance a lot when there are a large number of attributes.
X`09  A terminfo man page took roughly 14 seconds to attribute prior to
X`09  this change.  Afterwards, it took about 8 seconds.  (The terminfo
X`09  man page is somewhat unusual in that it has a large number of
X`09  underline and bold sequences).
X
X`09+ cmdtbl (operattrbsseq): New command for attributing sequences of
X`09  backspaces.
X`09+ select.c, proto.h (attribute_backspace_sequences, operattrbsseq):
X`09  New functions.  Also moved together the prototype declarations of
X`09  functions defined in select.c to one place.
X
X`09+ display.c (modeline): if insertmode is defined (as a macro),\3D08
X`09  the modeline for each\120Ainstead of just the current window.
X
X`09+ display.c (updattrs): Make sure that start_col is not less than
X`09  zero.
X
X`09+ exec.c (execute):  In test to see if we're not in insert mode...
X`09  Short circuit the test with a\0C06to see if curwp is NULL since
X`09  we get in trouble when insertmode is not a global variable and
X`09  is defined in terms of a window trait (see estruct.h).  (We were
X`09  getting core dumps when starting up with xvile @manpage.rc).
X
X`09+ cmdtbl, opers.c (operattrbold\1706attrul): New commands for
X`09  attributing regions of text.
X`09+ edef.h (videoattribute): New variable for communicating with
X`09  attributeregion().
X`09+ select.c, proto.h (attributeregion): New function.
X`09+ select.c (\0A06region): Took out checks to see if startbufp and
X`09  selbufp are NULL before calling detach_attrib as\110E
X`09  already performs these checks.
X`09+ display.c (updattrs): Use logical or to set attributes other
X`09  than VAREV in order to allow overlapping attributes.  Use
X`09  exclusive or to set VAREV causing overlapping reversed regions
X`09  to reverse themselves (this is perhaps _too_ tricky; we might
X`09  consider just using logical or.  It would simplify the code
X`09  and it might actually be what the user wants.)  Previously, we
X`09  were just using assignment to set the attribute which cause
X`09  the attribute displayed to be the last\230Bprocessed.
X`09+ x11.c (flush_line, x_flush): Modified to handle bold and underline
X`09  attributes in addition to reverse video.  Some work still needs
X`09  to be done on this to use a bold font for displaying\1906if
X`09  it exists with the present code as a fallback if there is no
X`09  bold font available.
X`09+ manpage.rc: New file containing vile macros for getting and
X`09  attributing manual pages.
X
X`09+ estruct.h (do_mark_iterate):  Fixed problem which was causing
X`09  r_orig for the first attribute to not get processed.  I think
X`09  that this was responsible for some core dumps.
X
X`09+ x11.c, proto.h (own_selection): New externally available function.
X`09  It used to be x_own_selection which was private to x11.c.  All
X`09  calls to x_own_selection in x11.c eliminated.
X`09+ estruct.h (OWN_SELECTION): Macro which will either call
X`09  own_selection() or do nothing depending on whether or not (x)vile
X`09  is compiled on a system which is prepared to share selections
X`09  with other clients or not.
X`09+ select.c (\0A06region, sel_extend):  Call OWN_SELECTION().
X
X`09+ proto.h (sel_yank):  Name changed from \1E08maybe since there
X`09  is very little "maybe" left about its action.
X`09+ select.c (sel_yank, push_fake_win, pop\0E09): sel_yankmaybe
X`09  rewritten to become sel_yank.  \0B08 now uses push_fake_win()
X`09  and pop_fake_win() to allocate a fake window so that the selection
X`09  in the selection buffer may be yanked no matter what (unless
X`09  there is no selection).
X`09+ x11.c (x_process_event, x_stash_selection): Call to sel_yankmaybe
X`09  eliminated from x_process_event.  Call to sel_yank added to
X`09  x_stash_selection.  This means that the \2009 will only be
X`09  yanked when needed thus permitting modification of the selection
X`09  prior to pasting.
X
X`09+ basic.c (setnmmark):  Nuked old keyboard selection code.
X`09+ select.c (WHICHEND, whichend): New type and variable for keeping
X`09  track of which end of the selection is fixed while sweeping
X`09  a selection.
X`09+ select.c (sel_begin): Set whichend.
X`09+ select.c (sel_extend):  Selection yanking code removed.  Usage
X`09  of parameter to sel_extend modified to indicate if wiping (sweeping)
X`09  with mouse.  Code added to check whichend and act accordingly.
X`09  Also do the "one-off" fixup here instead of in x11.c.
X`09+ select.c (output_\1106ion_position_to_message_line): Fixed "one off"
X`09  error in reporting extent of selection.
X`09+ x11.c (x_preparse_args): Set foreground and back\0F07in`20
X`09  scrollbar graphics context.
X`09+ x11.c (extend_selection): Changed call to sel_\2706 to reflect
X`09  new interpretation of its parameter.
X`09+ x11.c (multi_click): Put back decrement after end of word is
X`09  found.  (Paul had previously removed it.)
X`09+ x11.c (x_process_event):  Changed call to extend_selection
X`09  when button 3 is pressed to indicate that we are _not_ wiping.
X`09  (Wiping is permitted however and mouse motion will do the`20
X`09  right thing).
X
X`09+ x11.c (pscreen): Added extern declaration.
X`09+ x11.c (IS_DIRTY_LINE, \0F08, IS_REVERSED, MARK_LINE\1E07
X`09  MARK_CELL_DIRTY, CLEAR_LINE\120E\240DELL_TEXT,
X`09  CELL_ATTR): New macros comprising the interface to pscreen.
X`09  These could be moved to estruct.h or another header file for
X`09  use by other screen interfaces.
X`09+ x11.c (BLINK_TOGGLE): Added comment about this macro.
X`09+ x11.c (cur_row, cur_col, sc\0D06\160C): Removed these
X`09  fields from the TextWindow structure.
X`09+ x11.c (x_putc, x_move, x_eeol\0807p, free_win_data,
X`09  x_resize_screen): Deleted these functions and changed all callers.
X`09+ x11.c (term): Substituted psc_putchar, psc_flush\0B06move,
X`09  psc_eeol, and\0E08p for x_putc, x_flush, x_move, x_eeol,
X`09  and x_eeop.  Also added x_flush after x_scroll which will
X`09  initialize the t_pflush field in the TERM structure.
X`09+ x11.c (x_touch):  Call MARK_CELL_DIRTY and\1406LINE\1407instead
X`09  of using old mechanism.
X`09+ x11.c (wait_for_scroll):  Nuked XXX comment since it doesn't
X`09  seem to apply any longer.
X`09+ x11.c (CLEAR_LINE, SWAP_LINE): Nuked these macros which I recently
X`09  wrote for use in x_scroll.
X`09+ x11.c (x_scroll):  Nuked code for clearing and moving lines around.
X`09+ x11.c (flush_line): Minor reformatting.
X`09+ x11.c (clear_line): Eliminated this dead code.
X`09+ x11.c (x_flush): Rewritten.  It will now call flush_line for
X`09  any change in attribute instead of just reversed video.  flush_line
X`09  still needs to be rewritten to handle the other attributes.
X`09  Handling of cursor should be better too.
X`09+ x11.c (x_putline, x_fastpo\100Asetrowcolors, x_cls): Removed
X`09  this "notyet" code.  The need for such functions has been replaced
X`09  by new attribute mechanism and interface to pscreen.
X`09+ x11.c (multi_click, display_cursor):  Use CELL_TEXT instead of old
X`09  data structures.
X`09+ x11.c (x_process_event): Call display_cursor() on ButtonRelease
X`09  event instead of in x_getc().
X
X`09+ display.c (updateline): Wrote new version for OPT_PSCREEN.  I
X`09  tried modifying the !MEMMAP version, but this\1208 is difficult
X`09  enough to understand without adding to the rat's nest of #if,
X`09  #else, and #endif statements.
X`09+ display.c (updgar, scrolls): Preprocessor statements and a little
X`09  bit of code for OPT_PSCREEN.
X`09+ display.c, proto.h (psc_putchar, psc_flush\0B06move\1506eeol,
X`09  psc_eeop, psc_rev): New functions and their prototypes.
X
X`09+ estruct.h (t_pflush): New field in the TERM \2B06ure used
X`09  by OPT_PSCREEN interface to flush the output.  TTp\1606is
X`09  defined to allow easy access to this field via the variable term.
X`09+ estruct.h (OPT_PSCREEN): New feature test.  Used for determining
X`09  if the screen interface wishes to access the p\2707structure
X`09  directly.  Definitions of VADIRTY and VATTRIB in this file
X`09  depend on OPT_PSCREEN.
X
X`09+ x11.c (x_beep): Use GXxor instead of GXinvert as the logical
X`09  function in the graphics context for flashing the screen.  GXxor
X`09  will give better results on color displays.
X`09+ x11.c (x_getc): Removed if'd out call to display_cursor().
X`09+ x11.c (x_flush):  Add bounds check to make sure that it is ok to
X`09  write out the cursor.
X
X`09+ estruct.h (VIDEO):  Added new field v_attrs.
X`09+ estruct.h (VIDEO_ATTR):  Accommodations for color.  Also eliminated
X`09  VACOL mask.  Added VADIRTY, VAFGCOL, and VABGCOL.
X`09+ display.c (`5Bpv`5Dscrat):  Eliminated in favor of using the v_attrs
X`09  field in the VIDEO structure.  Also small modifications to ignore/set
X`09  dirty bit in updateline().
X
X`09+ x11.c (display_cursor):  Called from x_flush instead of x_getc to
X`09  avoid flicker.  Call of display_cursor from x_getc if'd out.
X
X`09+ display.c (`5Bpv`5Dscrat):  Replaced calls to memset with "for" loops
X`09  using explicit assignment in anticipation of making VIDEO_ATTR
X`09  a sixteen bit quantity when COLOR is enabled.  This code will
X`09  still need to be tinkered with somewhat in order to set the
X`09  foreground and back\0F07colors properly for the line whose
X`09  attributes are being reset.  (I have placed FIXME's in the code
X`09  to indicate where this needs to be done.)
X
X`09+ display.c (scrolls): New local variables longinplace and \0C07
X`09  are used in determining whether or not a potential match of lines
X`09  to be shifted is really better than a previously computed match.`20
X`09  The undesirable behavior that this corrects can be best observed
X`09  in vile (I used an xterm with 50+ lines).  Edit a file with
X`09  enough lines to be able to do a bit of scrolling.  Split the
X`09  window and make the upper\1A09bout half the size o\0C06lower
X`09  window.  Then start scrolling through lines in the the upper
X`09  window which are duplicated in the lower one.  (Try it in both
X`09  directions.) You will notice that portions of the lower window
X`09  will be updated along with the upper.  The problem was that
X`09  longer matchs were being obtained by scrolling lines from the
X`09  lower window up to the upper with the cost of having to later
X`09  update a large segment of the lower window.  This new code will
X`09  count the number lines which are already properly placed (e.g.,
X`09  do not need to be moved at all) in a section \2106potentially
X`09  moved.  It will then use this count to help decide if the new
X`09  potential match is better than the old one.
X
X`09+ modetbl (font):  Commented out dependency on X11.
X`09+ eval.c (SetVarValue, gtenv): Added code to ignore EVFONT when X11
X`09  is not defined.  The reason for all of this is so that a .vilerc
X`09  file which has a "set font" line in it may be shared between both
X`09  vile and xvile.
X
X`09+ edef.h, main.c (insert_mode_was): Eliminated.  This variable was
X`09  _only_ referenced (i.e, not set anywhere) and only\2C0B
X`09  in one place.
X
X`09+ estruct.h (insertmode, insmode):\0A08 is a new field in the
X`09  W_TRAITS structure.  Define macro insertmode in terms of the
X`09  insmode field in the W_TRAITS structure when OPT_MOUSE is
X`09  defined.`20
X`09+ edef.h (insertmode): Don't declare \1B0A as a variable when
X`09  it is already defined as a macro
X`09+ main.c (loop): Check to see if insertmode is set after getting a
X`09  character.  If it is, re-enter insert mode.  The reason for the
X`09  above three changes is to prevent insert mode from "moving" to a
X`09  new window when using the mouse to set focus to another vile
X`09  window.  These changes allow a\1F07 to "remember" which mode it
X`09  was in when the window was left so that that mode may be
X`09  reentered when we return to the window.
X
X`09+ select.c, proto.h (free_attrib): New function.
X`09+ line.c (lremove): Traverse attribute list and fix marks
X`09  indicating the beginning and ending of each attributed region.`20
X`09  The attributed region is freed if both beginning and end both
X`09  refer to the line about to be removed.
X
X`09+ vile.hlp: Documented new resources.
X
X`09+ x11.c (blink_id, \0A06status\0E08interval):  New fields in
X`09  TermInfo structure.  Also created new resource XtNblinkInterval
X`09  and XtCBlinkInterval for setting the blink_in\1F08ield.  S\2306
X`09  this field to zero will disable blinking entirely.  Positive
X`09  values will enable blinking all the time with the blink rate
X`09  being the value in milliseconds.  Negativ\2107s will enable
X`09  blinking only when the cursor is positioned within a highlighted
X`09  region.  Again the blink interval is in milliseconds.
X
X`09+ x11.c (display_cursor):  New function called from x_getc() for
X`09  displaying the cursor.  Handles blinking \1A06s.
X
X`09+ x11.c (XtNpersistentSelections, XtCP\1913): New
X`09  resource instance and class name for\2509
X`09  persistentSelections.  This resource controls whether or not
X`09  highlighting of selection (and indeed the\1A0Bitself), is
X`09  released when clicking button one.  start_selection() modified to
X`09  check whether this resource is set or not and to take the
X`09  appropriate action.
X
X`09+ x11.c (invert_display, x_beep): Eliminated \240E().`20
X`09  Rewrote OPT_FLASH stuff in x_beep() to reduce dependence on
X`09  structures in x11.c which know about the attributes.  (These
X`09  structures will eventually be eliminated.) The flash obtained from
X`09  the new code also looks better (it was kind of choppy before).
X
X`09+ x11.c (x_getc): Make sure that cur_win->show_cursor is TRUE before
X`09  displaying the cursor.
X
X`09+ x11.c (x_setfont): Call update_scroll_bar_sizes when a font change
X`09  will change the size of the window.
X
X`09+ x11.c (turnOnCursor, turnOff\0F08CELL_CURSOR): Nuked all code
X`09  referencing these.  This is yet another step toward integrating
X`09  use of `5Bpv`5Dscreen and\0F08at into x11.c.
X
X`09+ x11.c (x_getc): Display the cursor here before calling
X`09  XtAppNextEvent.
X
X`09+ x11.c: Slowed down initial scrolling of selections (you don't want
X`09  the lines whizzing by if you only want a few mor\2E07).  Sped up
X`09  scrolling of selections that have been\270Bfor a while
X`09  already.
X
X`09+ x11.c: Added resources for scrollRepeatInterval and
X`09  scrollRepeatTimeout for xvile NO_WIDGETS version.
X
X`09+ display.c (vt_leaks): free pscrat and vscrat.
X`09+ display.c (updateline): consider virtual screen attributes when
X`09  noting nonblanks in right match.
X
X`09+ modetbl, main.c, select.c (WMDTERSELECT): New window mode for
X`09  controlling whether selections are terse or verbose.
X
X`09+ vile.hlp: Documentation for selections and other x11 stuff.
X
X`09+ makefile (select.`7Bc,o`7D): Added to the SRC and OBJ file list.
X
X`09+ select.c: New file implementing\2007ion/attribute stuff.
X
X`09+ proto.h (free_attribs, sel_begin\0B06extend\1706release,
X`09  sel_yankmaybe, sel_attached\0E06buffer\1A06setshape):
X`09  New prototypes.
X
X`09+ estruct.h (OPT_VIDEO_ATTRS, OPT_SELECTIONS): New feature tests.
X`09+ estruct.h (NKREGS): Set to 37 (rather than 36) when OPT_SELECTIONS
X`09  enabled.
X`09+ estruct.h (SEL_KREG): Define the selection kill reg number.
X`09+ estruct.h (MAXROWS, MAXCOLS): Moved here from x11.c.
X`09+ estruct.h (REGIONSHAPE): New typedef.
X`09+ estruct.h (REGION): Position of typedef moved ahead of that of
X`09  BUFFER (so that AREGION can use \0F07and\2B08use \2607).
X`09+ estruct.h (VIDEO_ATTR): New typedef.  New mask values for this
X`09  typedef also (VACOL, VAREV, VAUL, VAITAL, and VABOLD).
X`09+ estruct.h (AREGION): New typedef.
X`09+ estruct.h (b_attrib): New field in \2206 BUFFER.
X`09+ estruct.h (do_mark_iterate): New macro for \1806ing over named
X`09  marks and region\1107for the current buffer.
X
X`09+ buffer.c (bfind): Initialize b_attribs field.
X`09+ buffer.c (bclear): Call free_attribs to free \1006utes associated
X`09  with buffer.
X
X`09+ line.c (linsert, lnewline, ldelet\0907\1607): Use macro
X`09  do_mark_iterate to fix the marks.
X
X`09+ tmp.c (dumpBuffer, AdjustPtrs): Call do_mark_iterate for adjusting
X`09  marks.
X
X`09+ undo.c (lineundo, repointstuff): Call do_mark_iterate for mark
X`09  adjustment.
X
X`09+ display.c (vscrat, pscrat): New variables representing virtual
X`09  and physical screen attributes.
X`09+ display.c (updattrs): New function called from update().
X`09+ display.c (vtinit): Initialize vscrat and pscrat.
X`09+ display.c (update): Nuked assignment of the ruler line in
X`09  OPT_SCROLLBAR code (x11.c no longer needs this).
X`09+ display.c (updgar): update pscrat.
X`09+ display.c (hilite, modeline): use vscrat to do highlighting.
X`09+ display.c (scrolls): move attributes in pscrat to account for
X`09  scrolling.
X`09+ display.c (updateline): Use pscrat and v\0B06in updating the line.
X
X`09+ edef.h (regionshape): Declare as REGIONSHAPE instead of short.
X
X`09+ basic.c (setnmmark): Added code if'd by OPT_SELECTIONS which
X`09  implements a mechanism for making selections from the keyboard.
X`09  "m." will mark the start of a selection. "m`5C" extends\2706\1C08
X`09  rectangularly. "m'" extends a selection by full lines. "m`5C\2809
X`09  a selection exactly.
X`09+ line.c (reg2index): Added code if'd by OPT_SELECTIONS which makes
X`09  the name "." the kill reg associated with the current selection.
X
X`09+ x11.c (PANE_WIDTH_DEFAULT): Changed to 15 for NO_WIDGETS.
X`09+ x11.c (MAXROWS, MAXCOLS): Moved to estruct.h.
X`09+ x11.c (scroll_repeat_id, wipe_permitted, sel_\2607id): New
X`09  fields in struct _text_win.
X`09+ x11.c (sel_start_col, \0F0Arow\0F06end\1C0Aend_row,
X`09  wipe_row,\0A06col, show_selection): These fields removed from
X`09  struct _text_win.
X`09+ x11.c (row2line, clear_row_selection, save\100B
X`09  change_selection): These functions removed along with all references
X`09  to them.
X`09+ x11.c (scroll_selection, repeat_scroll): New functions.
X`09+ x11.c (do_scroll): Added code so that scroll will repeat when
X`09  button is held down.
X`09+ x11.c (x_preparse_args): Get button release events too for the
X`09  screen widget.
X`09+ x11.c (x_scroll): Rewritten to move attributes (found in
X`09  cur_win->attr) along with screen data.  Should be more efficient
X`09  as well.
X`09+ x11.c (x_flush): Changed way in which cursor is displayed in
X`09  selections.
X`09+ x11.c (in_selection): This macro deleted.
X`09+ x11.c (x_putline): Leave cursor one past last char in line section
X`09  just put unless at end of line.
X`09+ x11.c (x_eeol, x_eeop): Erase to end of line/page in reverse video
X`09  if in reverse video.
X`09+ x11.c (x_lose_selection, x_stash\130Egiv\250C
X`09  x_own_selection, extend\120Cmulti_click, start\300B
X`09  x_process_event): Modified/rewritten to use new selection stuff.
X`09  Other cosmetic improvements/modifications were made to the
X`09  above functions resulting in the following user visible changes:
X`09    + clicking button 1 on mode line will set focus on
X`09      corresponding window without scrolling the\1D08by
X`09      one line.  Double clicking on mod\1F06 will clear the
X`09      current selection.
X`09    + selecting text by dragging will now scroll the window
X`09      up or down when the bottom or top is reached.  It is
X`09      now also possible to drag with the right mouse button.
X`09      Speed at which text is scrolled while being selected  will
X`09      increase with the passage of time.
X`09    + rectangular regions may be selected by using the control
X`09      key as a modifier.
X`09    + highlighting of selection is not lost unless another
X`09      selection is made either in xvile or somewhere else
X`09      or unless mode line is double clicked upon.
X`09    + it is now possible to start a selection in one window
X`09      and extend it in another window (provided the "other"
X`09      window is open to the same buffer).
X
XChanges for vile 4.3 (released March 29, 1994)
X(pgf)
X`09+ make all functions called by do_lines_in_region be prepared to
X`09  take empty lines. (region.c)
X
X`09+ added terse addition to the README
X
X(tom)
X`09+ corrected test in 'eol_command()' to allow command-names with '-'
X`09  (bind.c)
X
X`09+ corrected last 'mlerror()' change (display.c).
X
X`09+ added 'tags' rule to override conflict with default rule (makefile).
X
X`09+ corrected 'readpattern()' so that '%' can be used as delimiter in
X`09  ":g" command (search.c)
X `20
X(kev)`09
X`09+ call update_scrollbar_sizes() when changing fonts. (x11.c)
X
XChanges for vile 4.2 (briefly released March 25, 1994)
X(pgf)
X`09+ fixed Register buffer animation, using static flag to limit
X`09  the work done for each call to relist_registers(). (line.c)
X
X`09+ use common update_scratch() routine to trigger animation of
X`09  modes and maps.  (mode.c, map.c)
X
X`09+ add lines to vile.hlp about ".vilerc" vs. "vile.rc"
X
X`09+ fixed several bugs in rectangular operations (region.c)
X
X`09+ disabled "memory" command under Watcom, since _memavl() doesn't
X`09  _really_ report how much memory there is left -- jus\260A
X`09  is left before it needs to grow the heap. (main.c)
X
X`09+ npopen() should be silent on errors. (\2606.c)
X
X`09+ gave mlerror() a default message if errno is out of range (display.c)
X
X`09+ rationalized use of mlerror() and FIOERR.  now, the function that
X`09  first generates FIOERR is guaranteed to have put out a message,
X`09  probably via mlerror. (file.c, fileio.c)
X
X`09+ systems without EISDIR now all generate EACCES for directory
+-+-+-+-+-+-+-+-  END  OF PART 23 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 24 -+-+-+-+-+-+-+-+
X`09  errors.  (fileio.c)
X
X(tom)
X`09+ cleanup for OPT_MAP_MEMORY compilation ( display.c fileio.c
X`09  insert.c line.c random.c region.c tags.c undo.c)
X
X`09+ cleanup of OPT_WORKING ifdef (estruct.h)
X
X`09+ changed "#elif" to old-style because HP/UX bundled compiler doesn't
X`09  treat these properly. (fileio.c, should also change x11.c).
X
X`09+ corrected logic for arrow-keys in xvile's history by new function
X`09  'kcod2escape_seq()' (input.c, x11\0707simp.c).
X
X`09+ corrected 'l_ptr()' function to ensure signed comparison (tmp.c).
X
XChanges for vile 4.1 (not released March 11, 1994)
X(pgf)
X
X`09+ add include of stddef.h if POSIX, to pick up offsetof, so we don't
X`09  get a warning when building xvile on linux (estruct.h)
X
X`09+ again, fix core from is_falsem/is_truem. (eval.c)
X
X`09+ fix compiler warning (bind.c)
X
X`09+ removed -rows and -columns from usage message and help. (version.c
X`09  vile.hlp)
X
X`09+ fixed for the Watcom compiler; dense line modes now work. (ibmpc.c)
X
X`09+ the 'J' (and :j) command no longer perturbs the yank/kill registers, so
X`09  the sequence 'dw<move somewhere>J\1110p' puts back the word
X`09  you deleted, not the newline that 'J'\2208.  (region.c, word.c, proto.h)
V
X
X`09+ DOS now uses pressreturn() after a shell escape.
X
X`09+ streamlined tb_sappend() (tbuff.c)
X
X`09+ changed x11 pasting to not trim leading whitespace, and to use
X`09  the xxx_no_aindent() functions for performing insertions.  this
X`09  means you now paste what you cut, with indentation preserved from
X`09  the original, rather than recreated (or lost) by autoindent or
X`09  cmode. (x11.c, x11simp.c)
X
X`09+ new routine, fnc2str(), to support above change, since the no-aindent
X`09  commands are multi-char sequences.  (bind.c, proto.h)
X
X`09+ implemented rectangular regions, using new "\1407hape" global,
X`09  new commands ("goto-named-mark-rectangular",
X`09  "put-as-rectangle-after",\1A13before",
X`09  "open-rectangle", "blank-region"), and new behavior for
X`09  rectangles of the "shift-right-region" (opens up),
X`09  "shift-left-region" (deletes), the \0E06 and yank operators.`20
X`09  new rectangular (basic.c, cmdtbl, region.c, random.c, line.c, edef.h,
X`09  estruct.h, line.c, opers.c, proto.h)
X
X`09+ many changes in region.c, to make the \1606 code rectangle-aware.
X`09  new routines do_lines_in_region()/do_chars_in_line() to support
X`09  simple cases of walking a region in two dimensions.  reimplemented
X`09  yankregion using these, so it is now rectangle aware.  new blankline
X`09  routine.  getregion() knows how to set up rectangular regions.
X`09  (region.c)
X
X`09+ changed getcol/getccol/go\0606tocol to support rectangle code.
X`09  (random.c)
X
X`09+ changed the 'fulllineregions' boolean to a '\1707hape' descriptor.
X`09  (exec.c, edef.h ibmpc.c, fences.c, insert.c, basic.c, main.c, word.c,
X`09  x11.c, x11simp.c)
X
X`09+ moved a bunch of region-related code from random.c to\2507.c
X
X`09+ during undo, attempt to retain offset information for marks
X`09  pointing at a line being replaced.  this makes exact marks
X`09  last longer, and they're more important now with rectangles.
X`09  (undo.c)
X
X`09+ added extra column arguments to some of the line-processing
X`09  routines, like entab/detab/trimline.  (insert.c, word.c)
X
X`09+ fixed autoindent inconsistency, when breaking a brace-terminated
X`09  line in half. (insert.c)
X
X`09+ turned off the POISON #define.  this should have gone away a while
X`09  ago (it fills memory with a bad patter when we free it). (line.c)
X
X`09+ fixed old bug in the maintenance of MK.o when adjusting due
X`09  to character edits. (line.c)
X
X`09+ maintain record of longest line in a kill-register (line.c)
X
X`09+ the histbuffer (_) command now stutters with a call to tgetc
X`09  instead of kbd_seq, so that the pushback of an unused command
X`09  works okay. (buffer.c)
X
X`09+ anycb() now returns a pointer to the first modified buffer
X`09  it encounters, so callers can treat the single buffer case
X`09  specially.  changed callers as well: quit(), zz\0A08and
X`09  spawn().  (buffer.c,\1506.c, main.c)
X
X`09+ DOS video drivers are now selected more cleanly by name.  any
X`09  driver can be selected from the command line (as long as its
X`09  name starts with a digit).  drivers can have multiple entries
X`09  corresponding to multiple names.  the same name can refer to
X`09  two different entries, in cases where there are two resolutions
X`09  for the same screen geometry. (main.c, ibmpc.c)
X
X`09+ made backspacing be non-destructive in overwrite mode (insert.c)
X
X`09+ eliminated the full-buffer-loop in undo.c, by using a cookie to
X`09  identify the current undo operation, and using it to mark lines
X`09  that have already been copied.  should be a big performance win
X`09  for big files on slow machines.  (estruct.h, tmp.c, undo.c)
X
X`09+ added support for setting the IBM color palette. (ibmpc.c, vile.hlp)
X`09 `20
X(kev)
X`09+ updated help text for X11 (version.c, vile.hlp)
X
X`09+ added command line arguments -row, -cols, -leftbar, and -rightbar.
X`09  (x11.c)
X
X`09+ fix for motif resizing (x11.c)
X
X`09+ updated help text for X11 (version.c, vile.hlp)
X
X`09+ added command line arguments -row, -cols, -leftbar, and -rightbar.
X`09  (x11.c)
X`09+ Set XmNresizePolicy to XmRESIZE_NONE in x_configure_window in
X`09  order to fix resize problems with the Motif widget set in
X`09  which the scrollbars were getting set very big or\0C06small.
X
X`09+ Support for scrollbars on the left in motif added.  openlook
X`09  still needs to be done.
X
X`09+ Added an initialization of XtNgeometry to XtVaAppI\2808e
X`09  setting this resource to NULL.  This overrides any user
X`09  specified geometry request for the top level shell.  The
X`09  geometry request is still available through the \3008
X`09  variable which Tom added to the TextWindow structure.  Tom's
X`09  code for parsing the geometry has been preserved, but
X`09  enhanced somewhat to set default values for the number of
X`09  rows or columns in case if the user specified only the
X`09  position.  Width and height specifications are considered to
X`09  be in character widths or heights instead of in pixels.  We
X`09  let the initialization of the screen and pane widgets
X`09  determine the size of the outer widgets.  (Much\1D06is is
X`09  as it was before...the only thing really new here is one
X`09  line added in the call to XtVaAppInitialize).
X
X`09+ Added code to set XtNgeometry on the top level widget if the
X`09  user's geometry request specified the initial window
X`09  position.  Only the\1409al information is set; the width
X`09  and height are left out in order so that the sizes of the
X`09  children will correctly influence the initial size of the
X`09  top level shell widget.
X
X`09+ Added scrollbar support for NO_WIDGETS by using core widgets
X`09  for both the scrollbars and the resize grips.  Geometry
X`09  management is handled with a simple homebrew widget
X`09  subclassed from Composite.  I believe that the scrollbar
X`09  resize mechanism is superior to that found in xvile
X`09  implemented with the other widget sets (particularly
X`09  OpenLook).  We might consider either totally getting rid of
X`09  OpenLook support (how many people are going to use it?) or
X`09  at the very least reimplement scrollbar resize with the same
X`09  mechanisms used by the NO_WIDGETS version.  We might also
X`09  consider dropping the Athena widget set since it seems to be
X`09  buggy on some platforms.  The code will be easier to
X`09  maintain though and users will not be so confused by the
X`09  number of configuration options if we manage to drop a
X`09  couple of the widget sets.  (A middle ground might be to use
X`09  only the scrollbar widgets from various \1506 sets.  Much
X`09  of the complexity comes from the differences in the Form and
X`09  Pane widgets.  This way we could still use other\2C08
X`09  from the other widgets sets in the future.  This won't make
X`09  the configuration any easier, but it might make \3006de
X`09  easier to maintain.)
X`09
X`09+ Modified manner in which the top of the scrollbar is set for
X`09  all widget sets.  Rather than forcing dot to be in the
X`09  middle of the screen, we attempt to leave dot where it is.`20
X`09  The top of the scrollbar is set based upon the top line of
X`09  the window rather than dot.  This gives consistent scrolling
X`09  behavior.  Tom's concerns that the "thumb" or slider remain
X`09  visible even at the end of the buffer are also addressed
X`09  with this approach.  When at the very end of the buffer (so
X`09  that the screen has a large number of tildes on it),
X`09  xt-vile and xaw\0D06will still display a sliver indicating
X`09  the portion of the buffer actually shown.  If this is
X`09  undesirable, ntildes should be set to something small (like
X`09  zero).  Once this is done, the thumb will maintain a uniform
X`09  size from the top of the buffer to\0E06ottom.  I've tested
X`09  these versions with small buffers (\0908containing zero
X`09  thru 2*curwp->w_ntrows lines) and the appearance seems to be
X`09  consistent throughout.  Large buffers (> 4000 lines) seem to
X`09  still have a slight problem at the end of the buffer in
X`09  xaw-vile).
X
X`09+ Made the insertion bar the mouse cursor (for the xvile
X`09  screen only) in all versions.
X
X`09+ fixed x_working so that xvile may once again be interrupted.
X
X`09+ added missing assignment so that insertion bar is now really
X`09  used when the cursor enters window corresponding to the xvile
X`09  screen widget.
X
X`09+ implemented scrollbarOnLeft resource for NO_WIDGETS version.
X
X`09+ nuked ATHENA_WIDGETS code.  This code was eliminated because
X`09  it was observed that the NO_WIDGETS version functions as
X`09  well if not better than the ATHENA_WIDGETS version and it
X`09  runs on machines which have a buggy (Athena) widget library.`20
X`09  On the down side, it will be somewhat harder to add new
X`09  widgets in the future if this is desired.
X
X(tom)
X`09+ modified kevin's resources in x11.c to use "geometry" rather than
X`09  "rows" and "columns".  Adjusted logic so that geometry resource means
X`09  chars, not pixels.
X
XChanges for vile 4.0 (not released Tue Feb 22, 1994)
X(pgf)
X`09+ fix core from one-too-many chars to strncpy(). (eval.c)
X
X`09+ change #elif constructs in version.c to oldstyle #else/#if
X
X`09+ applied contributed patch for implementing 0`5ED in insert mode,
X`09  and expanded it to implement `5E`5ED. (insert.c)
X
X`09+ insert mode now parses function key #c pairs returned from
X`09  kbd_key(), so arrow keys work.  (input.c insert.c)
X
X`09+ no longer turn off dot recording for non-redoable commands if
X`09  we're in insert mode. (exec.c)
X
X`09+ display high-bit keyboard input on message line in either octal
X`09  or hex, depending on global value of unprintable-as-octal. (bind.c)
X
X`09+ implemented "alt-function-prefix" to make \1909key parsing
X`09  in insert mode less ambiguous.  (edef.h,\2607.c, input.c, cmdtbl,
X`09  main.c)
X
X`09+ new help for arrow keys, and cd/pwd commands.  also some more
X`09  pcvile differences.  (vile.hlp)
X
X`09+ fixed djgpp implementation of get_vga_bios_info, by packing
X`09  the structs int 10/1b deals with.  this makes 43 and 50 line modes
X`09  work.  (still don't work with watcom, though) (ibmpc.c)
X
X`09+ made :memory work under DJGPP`09(main.c)
X`09
X`09+ made catnap() work under DJGPP, so flash mode works now. (random.c)
X
X`09+ added more dependencies to makefile.djg
X
X`09+ apply patch for honoring the trailing $ in a tag lookup patterns.
X`09  (tags.c, eric krohn)
X
X`09+ make animation of buffer list take into account whether it contains
X`09  an apropos list or a full "decribe bindings" (bind.c)
X
X`09+ some makefile cleanup, for mips and NeXT, and compulsion's sake.
X
X`09+ modified heuristic for setting dos-mode on an ambiguous (usually
X`09  empty) buffer -- only set it if the global mode is set, and if
X`09  we're actually running on DOS. (main.c, random.c, file.c, estruct.h)
X
X
X(tom)
X`09+ added new function 'parse_pathlist()' to encapsulate the logic used
X`09  in lookup of vile.hlp (PATHLOOK) and the CDPATH environment variable
X`09  (fixes buffer overflow in the latter).
X
X`09+ corrected treatment of arrow-keys (in history.c) broken in 3.65
X`09  using new function 'kbd_escape_seq()' (input.c, history.c).
X
X`09+ modified ifdef's in 'interrupted()' to test type-ahead only
X`09  for DJGPP configuration (main.c).
X
X`09+ restored code that translated CDSENSE to driver type, because it did
X`09  not set screen defaults to maximum size (ibmpc.c)
X
X(kev)
X`09+ I have added scrollbars to xvile.  I made a copy of x11.c,
X`09modified it (heavily) and call\1806xt.c.  `5B I've renam\190711.c,
X`09and moved the old x11.c to x11simp.c.  We can merge later. `5D Minor
X`09modifications were necessary to several other of the source files.`20
X`09(display.c, estruct.h, main.c, makefile, and window.c.)
X`09xt.c uses the X toolkit and the Athena widget set to provide the
X`09following new functionality:
X
X`09    A scrollbar for each vile window.  The standard translations
X`09    provided by Athena scrollbars control movement of text in the
X`09    vile window.
X
X`09    Resize of vile windows by moving the border between
X`09    corresponding scrollbars (with the mouse).
X
X`09    Splitting and deleting of windows may now be done with the
X`09    mouse.  Ctrl<Btn1Down> on a scrollbar will cause the \1909
X`09    and the corresponding vile window to be split with the new
X`09    border at or near the mouse cursor.  Ctrl<Btn2Down> will delete
X`09    the window.  Ctrl<Btn3Down> will make the corresponding\3407
X`09    the only window.
X
X`09    Problems with getting the input focus set properly have been
X`09    fixed.
X
X`09    Quitting via the window manager works better.  It basically
X`09    works the same as if you had typed :q.  vile will display a
X`09    message if there are any unwritten buffers.  We may eventually
X`09    want to pop up an alert box when attempting to quit with
X`09    modified buffers from the window manager.
X
X`09+ added "ntildes" variable, which controls max number of \2F06
X`09  displayed at the end of a buffer, expressed as a percentage of
X`09  window size.  `5Bpgf made it a percentage`5D (edef.h eval.c display.c
X`09  modetbl vile.hlp)
X
X`09+ added support for the Motif and OpenLook widget sets. `20
X
X`09+ fixed bug where focusFollowsMouse would take us out of the message
X`09  line when we should remain there.
X
X
XThis change log started on Tue Feb 22, 1994.
X
$ call unpack [.VILE-8_0]CHANGES.R4;1 -
 167815672 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 255 16 152
$!
$ create 'f'
XChanges for vile 6.0 (released Tue Jun 18, 1996)
X
X(pgf)`09960618
X`09+ no longer use non-standard RCS extensions to generate revlist.
X`09  this is slower, but it works always.  (makefile.in)
X
X`09+ change makefile targets "tar" and "shar" to "tarball" and
X`09  "sharball". (makefile.in)
X
X`09+ add "const" to tempnam() args to satisfy reported problem with
X`09  DEC C -- apparently there is already a prototype in scope for
X`09  tempnam().  (vms2unix.c)
X
X`09+ documented (years late :-) the "save-keyboard-macro" command,
X`09  which will copy the keyboard macro to a named register. (vile.hlp)
X
X`09+ allow arg. to "load-register" to force a full-line style load.
X`09  this allows
X`09  `091 use-register e load\100A"#endif"
X`09  to be used to duplicate a 'yy' of "#endif".  previously you
X`09  could not get the full-line effect, i.e. it worked like 'yW'.
X`09  (line.c)
X
X(tom)`09960612 (zg)
X`09+ modify configure script, putting test for socket, nsl libraries after
X`09  X-libraries, to avoid duplication (configure.in)
X
X`09+ modify cd/pwd logic to recover better when the current and parent
X`09  directories aren't readable by the current process (path.c, random.c).
X
X(tom)`09960527 (zf)
X`09+ added "--enable-echo" option to configure.in
X
X`09+ applied Andy Harper's correction for VMS 'tempnam()'.
X
X`09+ added VC_AC_PREREQ macro to allow conditional generation of the
X`09  configure script, according to whether my patches for autoconf have
X`09  been applied.  Added local copy of new autoconf macros as well
X`09  (configure.in, aclocal.m4).
X
X`09+ reordered autoconf macros (aclocal.m4)
X
X`09+ redefine AC_MSG_CHECKING, AC_\0D08 so that they log the same info
X`09  to config.log (aclocal.m4).
X
X`09+ removed VC_SIZE_T because recent autoconf checks stdlib.h
X`09  (aclocal.m4, configure.in)
X
X`09+ removed VC_TEST_GETPGRP macro (aclocal.m4, estruct.h, configure.in)
X
X`09+ removed VC_SETPGRP macro (aclocal.m4, proto.h, configure.in, main.c)
X
X`09+ added aliases for Sf, Sb termcap capabilities (AF, AB) for ANSI
X`09  termcap descriptions.
X
X(tom)`09960522 (ze)
X`09+ corrected a couple of lengths for strncpy0 calls (file.c)
X
X`09+ modify handling of toggle-buffer-list so that giving a parameter
X`09  overrides the default pop/unpop, and toggl\2307listing of invisible
X`09  buffers instead (\1106.c)
X
X(pgf)`09960516 (zd)
X`09+ clarifications regarding file/command/shell completion (vile.hlp).
X
X`09+ modified quote() routine to allow input of decimal values -- now
X`09  entering `5EVNNN, `5EV0NNN, or `5EVxNN will insert the character with
X`09  that decimal, octal, or hex vale.  (255 max).  entering fewer
X`09  than 3 digits will enter the value, and the terminating character
X`09  will be "ungotten" and then re-consumed as usual.  feature
X`09  requested by user, implementation inspired by vim.  (insert.c,
X`09  vile.hlp)
X
X`09+ added digraphs.rc, a set of :map! commands to aid the insertion
X`09  of ISO 8859/1 8-bit characters.  the `5EKcc form of the maps (and
X`09  their exact values) is borrowed from vim.  (digraphs.rc,
X`09  makefile.in, vile.hlp, \1709djg)
X
X`09+ the `5BStandard Input`5D buffer is now marked "read-only" rather
X`09  than "view" to match other piped-to buffers.  (all clients of
X`09  set_rdonly() affected, since argument was added.)
X
X`09+ removed disclaimer from help file regarding x! and w!.
X
X`09+ added -R option to set "readonly" mode, put -v back\2407ting
X`09  "view" mode as it used to, updated man page to reflect all this.
X`09  (vile.1, main.c)
X
X`09+ the initial response to a ":e" prompt is defaulted to the first
X`09  command line argument to vile.  (file.c, main.c)
X
X(kev)`09960417 (zc)
X`09+ configure.in,\0E0A:  Changed\220D so that\370A
X`09  will run cleanly and create something useful in a Sparc / Solaris
X`09  / X11R6 environment.  Regenerated configure.  Also fixed a few of
X`09  the autoconf warnings for configure.in.
X
X`09+ makefile.in (X_EXTRA_LIBS, X_PRE_LIBS): Removed these\3609
X`09  variables.
X`09`20
X(tom)`09960416 (zb)
X`09+ further corrected 'shell_complete()' to test and adjust for leading
X`09  "!", and use this to also simplify call from 'cmd_complete()'
X`09  (bind.c, input.c).
X
X`09+ prevent 'do_lines_in_region()' from processing the nominal end of a
X`09  full-line region, since that is off-by-one to accommodate width
X`09  requirements; this fixes ":.,.+3>>>" (region.c).
X
X(kev)`09960416 (za)
X`09+ basic.c (setcursor): Permit the mouse to set the \2506 when
X`09  doing an "op" command.  Prevent MK from becoming corrupted if
X`09  call too set_curwp() caused a window change.
X
X`09+ filec.c (mlreply_file): Use Tom's filename completion stuff
X`09  on shell commands for things like ":e !gunzip -c /usr/doc/<TAB>".
X
X`09+ input.c (shell_complete): Fixed an off-by-one/beginning-of-buffer
X`09  bug.  `5BThe variable "base" should never be less than zero after
X`09  the termination of the "for" loop.`5D
X
X(tom)`09960415 (z)
X`09+ show read-only mode in status line (display.c)
X
X`09+ refined/corrected VMS pathname translations, to better handle root
X`09  directory, and `5EX-e command (file.c, filec.c, glob.c, path.c,
X`09  vms2unix.c).
X
X`09+ implemented filename-completion in shell commands (bind.c, filec.c,
X`09  input.c)
X
X`09+ modified filename-completion to recognize environment variables
X`09  (filec.c).
X
X`09+ change token-expansion from ':' to '`26' for VMS and MS-DOS (estruct.h,
X`09  input.c, main.c).
X
X`09+ implement error-finder for CSet C/C++ (\1706r.c)
X
X(tom)`09960410 (y)
X`09+ modified TERM struct so that no function-pointers should be null.
X`09  Inactive functions are assigned from the null device's TERM struct.
X`09  This provides better type-checking, as well as getting rid of
X`09  no-effect compiler warnings.
X
X`09+ restored <dir.h> include for TurboC (random.c)
X
X`09+ adjusted ifdef's to allow changes to 'imdying()' to compile on
X`09  MS-DOS and OS/2 (file.c).
X
X(pgf)`09960329 (x)
X`09+ new modes:  "readonly", which prevents writing a buffer out, and
X`09  "readonly-on-\0C08", which sets this mode if the buffer is not
X`09  writable according to the OS.  setting the latter causes vile to
X`09  mimic vi's default behavior.  it is off by\2008.  "vile -v",
X`09  invoking as "view", and reading from a pipe all now set
X`09  "readonly" mode rather than "view\1806.  (modetbl, main.c,
X`09  file.c, vile.hlp\0A071)
X
X`09+ better (?) help on using '/' as a path delimter on PC operating
X`09  systems. (vile.hlp)
X
X`09+ new command, "set-unix-mode", as a complement to\2406dos\2306.
X`09  this capability was there before as "1:set-dos-mode", but it sure
X`09  was hard to explain to people.  (cmdtbl, vile.hlp, file.c)
X
X(jrs)`09960328 (w)
X`09+ estruct.h: Make TERM "optional" members "mandatory" and protect
X`09  references to all optionally implemented members with null
X`09  checks.
X`09+ ansi.c, at386.c, borland.c, dg10.c, dumbterm.c, hp1\1506hp150.c,
X`09  ibmpc.c, ntconio.c, st520.c, tcap.c, term\1B06ti\2E06vmsvt.c,
X`09  vt52.c, x11.c, z309.c, z_ibmpc.c: Remove all TERM-related optional
X`09  ifdefs and replace all stub functions with null \1408 pointers.
X`09+ borland.c: Convert function defintions to ANSI C and make most
X`09  functions static.
X`09+ estruct.h: Add new optional window title method to TERM and
X`09  enable it for WIN32.
X`09+ buffer.c: Optionally set window title based on\2F07 name.
X`09+ dirstuff.h: Use <direct.h> instead of\1606nt.h> with Visual C++.
X`09+ estruct.h: Remove unnecessary ifdefs around undefs.
X`09+ file.c: Compile a working version of imdying on all platforms.
X`09+ history.c: We want to use our own isgraph so undef the OS version.
X`09+ npopen.c: Do all I/O redirections while keyboard is closed.
X`09+ ntconio.c: Make most functions static, make the insertion
X`09  cursor code match the expected optional interface, implement
X`09  the TERM title method, unsucessfully try to catch abrupt
X`09  exits and do something about them, die gracefully if console
X`09  I/O fails.
X`09+ path.c: Remove unused code to downcase the path in is_msdos_drive.
X`09+ random.c: Change a bunch of compiler ifdefs to a single include
X`09  of dirstuff.h which already handles all of the special cases.
X`09  Add a judicious downcasing on non-caseless MS-DOS-like systems
X`09  like DJGPP to compensate for the above-mentioned change to
X`09  is_msdos_drive.
X`09+ termio.c: Don't put WIN32 typeahead code here since it is
X`09  already dispatched via TERM methods.
X`09+ README.PC: Various documentation fixes.
X
X(tom)`09960323 (v)
X`09+ removed tmp.c and OPT_MAP_MEMORY
X
X(tom)`09960317 (u)
X`09+ added "compile-error-expressions" to allow macros to force the `5BError
X`09  Expressions`5D buffer to be created; otherwise it would only\240B
X`09  on the first use of "find-next-error" (finderr.c).
X
X`09+ modified predefined error-expressions to remove unnecessary ':';
X`09  making them a little more general.  This makes the error finder
X`09  slower, however (finderr.c).
X
X`09+ modified RegStrChr2 to eliminate unnecessary 3rd parameter, making it
X`09  faster.  Use 'const' where possible in this file (regexp.c).
X
X(tom)`09960308 (t)
X`09+ correction to test for 'PC':  linker on HP/UX allows read from
X`09  non-existent location during configur\1506(\0F08e.in).
X
X`09+ corrected special cases in word-wrap, by refining 'blanks_on_line()',
X`09  and use of 'n' in 'wordwrap()' (input.c, word.c).
X
X(pgf)`09960307 (s)
X`09+ added b_lines_on_disk element to BUFFER struct, to get back
X`09  "count from bottom" functionality in finderr. (file.c,\1209c,
X`09  estruct.h)
X
X`09+ patch from jim hourihan to support "Cpp" keywork in vile-c-filt,
X`09  to allow colorizing all cpp lines at once, rather than listing
X`09  keywords individually. (c-filt.c, vile.hlp)
X
X(tom)`09960303 (r)
X`09+ corrected sign-extension of characters (map.c)
X
X`09+ added termcap capability for "@7" (Key_end)
X
X`09+ modified treatment of 'PC' in termcap driver; it should be extern
X`09  since it is "owned" by 'tputs()' (tcap.c).
X
X`09+ modified termcap driver to treat `5C200 specially in the key mapping
X`09  i.e., add a mapping with the corresponding `5C0 (tcap.c)
X
X(pgf)`09960228 (q)
X`09+ when notabinsert was active, autoindent accounting was being
X`09  done incorrectly, causing excess whitespace to be left if
X`09  you entered a '#' in cmode.  (insert.c)
X
X`09+ removed OPT_BSD_FILOCK, since it hasn't ever been used, and
X`09  the placeholders it was maintaining were incomplete, to say
X`09  the least.  (main.c, file.c, estruct.h)
X
X`09+ eliminate old screen files, that haven't been touched in a
X`09  while.  (at386.c, dg10.c, hp1\090950.c, st520.c, vt52.c,
X`09  x11simp.c, z309.c, z_ibmpc.c)
X
X`09+ eliminate old SCREEN defines and ifdefs.  (ansi.c, display.c,
X`09  edef.h, epath.h, estruct.h, file.c\0806io.c, ibmpc.c, makefile.in,
X`09  spawn.c, termio.c, win31drv.c)
X
X
X(tom)  96022? (p)
X`09+ use 'const' where applicable (lots of places :-)
X
X`09+ generate externs for CMDFUNC objects in nefunc.h (mktbls.c, all
X`09  makefiles, and C-files that had declared externs of these).
X
X`09+ modified 'pathname`5B`5D' to separate out the 'exec_\2608' variable,
X`09  to make the remaining pathname`5B`5D data const.
X
X(tom)  960224 (o)
X`09+ correct logic of 'is_absolute_pathname()'; for VMS we need to ensure
X`09  that the pathname contains brackets or colons (path.c).
X
X(tom)  960220 (n)
X`09+ modify autoconf script to allow "--with-screen=ncurses" to link
X`09  with terminfo support (configure.in).
X
X`09+ modify 'zotwp()' to switch to the most recently-used buffer instead
X`09  of the first one found, fixing behavior under noautobuffer mode
X`09  (buffer.c).
X
X(tom)  960212 (m)
X`09+ modify autoconf script to add $X_PRE_LIBS and $X_EXTRA\1206in the
X`09  X configuration tests (\1508e.in).
X
X`09+ corrected potential null-pointer reference for $abufname (eval.c).
X
X(tom)  960204 (l)
X`09+ modify 'pathcat()' so that if the 'leaf' given is an absolute
X`09  pathname, then we'll ignore the 'path' (usually an implied
X`09  directory), to handle case in finderr when a full pathname is parsed
X`09  (path.c).
X
X`09+ modify logic of find-next-error so that multiple distinct matches
X`09  on the same line will show up in the message-line (finderr.c).
X
X`09+ remove P macro (and ANSI_PROTO) from several modules (c-filt.c,
X`09  manfilt.c, mktbls.c).
X
X`09+ change 'int' to 'long' in places where we cast to/from pointer
X`09  (region.c, x11.c).
X
X`09+ added TTflush to tcapkclose so that xterm-mouse is reset properly
X`09  when spawning subshell (tcap.c).
X
X`09+ moved X_CFLAGS to CPP\0C06definition so that lint works for xvile
X`09  (makefile.in).
X
X(tom)  960118 (k)
X`09+ convert function definitions to ANSI form (55 c`26h files affected),
X`09  so that K`26R form is no longer used.  Removed macro ANSI_VARARGS, and
X`09  reduced ACTUAL_SIG_ARGS definition.  Compiled with VAX-C, TurboC,
X`09  WatCom 10.0a, gcc 2.5.8\0B087.2 (Linux, SunOS, Solaris, HP/UX 9),
X`09  CLIX, IRIX, SCO, UnixWare 1.2.  Also used 'unproto' to compile SunOS
X`09  and HP/UX.  Used ansi2knr for initial changes (i.e., finding places
X`09  that used K`26R syntax), but this patch does not use ansi2knr.
X
X`09  This is not fully ANSI -- vile uses a number of Posix functions that
X`09  aren't recognized in strict ANSI modes by a number of compilers.
X`09  It does require that the compiler recognize prototypes and stdarg.h
X
X(jrs)  960108 (j)
X`09+ path.c (curr_dir_on_drive) `5BSYS_WINNT`5D: Translate drive argument
X`09  from a drive letter (e.g. 'A' or 'a') to\2409numb\24091)
X`09  since this is what _getdcwd expects.
X`09  (lengthen_path): Predicate curr_dir_on_drive call on OPT_MSDOS_PATH
X`09  instead of listing individual systems so that e.g. this code is
X`09  also compiled in on SYS_WINNT.  Check for curr_dir_on_drive
X`09  failure and handle that case by assuming the current directory
X`09  on a non-existent drive is the root directory.
X
X(pgf)  960107 (i)
X`09+ change order of TTkclose and TT\0C06in ttclean.  i think this
X`09  will give us back old behavior wrt terminals that have TI/TE
X`09  sequences.  we want to finish any screen-oriented i/o before
X`09  calling ttkclose.  (termio.c)
X
X`09+ removed okay_to_ask param from make_bp() and unqname(), since
+-+-+-+-+-+-+-+-  END  OF PART 24 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 25 -+-+-+-+-+-+-+-+
X`09  it is now unused.  removed return value from unqname().  (exec.c,
X`09  file.c, proto.h)
X
X`09+ fixed unqname to continue trying wider and \0A06suffixes until
X`09  a unique name is found.  it will still loop, but only after a
X`09  very large number of buffernames has been tried.  uses base-36
X`09  index on end of filename. (file.c, proto.h)
X
X`09+ added %r to dofmt -- takes two args, uses the first as a radix
X`09  with which to print the second.  (display.c)
X
X`09+ bp->b_bname is now null-terminated (again?).  it's really much
X`09  cleaner this way.  NBUFN has changed
X`09  from 20 to 21, to make room for the null.  eliminated get_bname()
X`09  routine.  (buffer.c, display.c, edef.h, estruct.h, eval.c,
X`09  exec.c, file\0806nderr.c, input.c, main.c, modes.c, proto.h,
X`09  spawn.c, tags.c, tmp.c)
X
X`09+ added a chgd_hilite() side-effect function, which causes
X`09  a call to attrib_matches() when any of "magic", "ignorecase",
X`09  or "visual-matches" is changed.
X
X`09+ split up the "level" arg, which was overloaded to mean
X`09  two things, into two separate args, one which says it's a
X`09  global value we're changing, and the other which says\2906
X`09  just testing whether we can change it.  (estruct.h, modes.c)
X
X`09+ guard against null gregexp in attrib_matches() -- possible
X`09  if pattern failed to compile, making pat`5B0`5D non-null, but
X`09  gregexp null.  (search.c)
X
X`09+ fix ifdefs to make it easier to test dos pipes under unix.  get
X`09  rid of duplicate close in dos readPipe, pointed out by jrs.  (the
X`09  second close is out in filterregion()).  (npopen.c, spawn.c,
X`09  proto.h)
X
X(tom)`09960105 (h)
X`09+ corrected inadvertant K`26R substitution in APP_S macro, moved
X`09  bsd-lint expressions to avoid shadowing (finderr.c).
X
X(pgf)`09960103 (g)
X`09+ prevent characters following `5EA, `5EX and # prefixes from being
X`09  subject to remapping.  (input.c, vile.hlp)
X
X`09+ small change to "find matching indent" macros in vile.hlp, to
X`09  make them work when they encounter non-empty blank lines. (vile.hlp)
X
X`09+ tweak watcom makefile to use "protected mode" compiler.
X`09  selectable as $(CC), in case this breaks 10.x compiles.
X`09  (makefile.wat)
X
X`09+ fix for identifiers starting with '_', from sean ahern. (c-filt.c)
X
X
X(tom)`09960103 (f)
X`09+ corrected reference to char beyond regular expression in regexp
X`09  via 'lregexp()' function (\1406.c).
X
X`09+ corrected 'free()' of null pointer in finderr.c, and retested with
X`09  compile `26 lint logs, covering most most of the regular expressions in
X`09  that module (finderr.c)
X
X(jrs)`09951231 (e)
X`09+ configure.in (AC_HAVE_FUNCS): Move it after library checks
X`09  (so we can test for functions in auxiliary libraries) and
X`09  add checks for the functions tparm and tparam.
X
X`09+ djhandl.c (ctrl_c_count, was_c\1206hit): Declare it as unsigned`20
X`09  long instead of u_long for DJGPP v2.
X
X`09+ estruct.h `5BCC_DJGPP`5D: Define HAVE_UNISTD_H to eliminate some
X`09  not declared warnings with DJGPP v2.
X`09  (OPT_COLOR) `5BDISP_TERMCAP`5D: Don't conditionalize it based on
X`09  Linux.
X
X`09+ gppconio.c: Suppress the entire file under DJGPP v2 because the
X`09  bugs it was supposed to fix are fixed.
X
X`09+ makefile.djg (vile rule): Don't let stubedit globbing=no
X`09  failure prevent a sucessful build for DJGPP v2 which doesn't
X`09  seem to support it.
X
X`09+ os2vio.c (PRETTIER_SCROLL): Don't define it.
X`09  (vio_scroll): Base conditional \1A06ing code on
X`09  OPT_PRETTIER_SCROLL instead of \1B0F.
X
X`09+ proto.h (was_ctrl_c_hit): Adjust\2106type to match new
X`09  definition.
X
X`09+ tcap.c (tparm) `5BHAVE_TPARM`5D: Declare it.
X`09  (tparam) `5BHAVE_TPARAM`5D: Declare it.
X`09  (show_ansi_colors) `5BHAVE_TPARM`5D: Use tparm instead of tparam.
X
X`09+ version.c (get\0E07) `5BCC_DJGPP`5D: Discriminate DJGPP v2 from
X`09  the previous version.
X
X(jrs)`09951224 (d)
X`09+ file.c (getfile2bp): Never consult the user about duplicate
X`09  buffer names if `60warn-rename' isn't on.`20
X
X`09+ filec.c (headers): Don't supress inclusion of dirstuff.h
X`09  on OS/2 since it doesn't hurt anything.
X`09  (fillMyBuff) `5BSYS_OS2`5D: Only down-case filenames read from
X`09  a directory if the drive they are on is not case-preserving.
X
X`09+ main.c (global_val_init): Initialize `60warn-rename' so that
X`09  it defaults to the existing behavior.
X
X`09+ modetbl (warn-rename): New option.
X
X`09+ ntconio.c `5BSUPPORT_BROKEN_SCROLLING`5D: Rip out the ifdefs and
X`09  compile it unconditionally since the case it applies to now
X`09  no longer affects the efficiency of the most common case.
X
X`09+ path.c (headers) `5BSYS_OS2`5D: Include os2.h.
X`09  (is_case_preserving, case_correct_path) `5BSYS_OS2`5D: New functions.
X
X`09+ version.c (get\0E07) `5BCC_CSETPP`5D: Discriminate VisualAge C++
X`09  from C Set ++.
X
X`09+ vile.hlp (warn-rename, \0D07read): Document them.
X
X(tom)`09951223 (c)
X`09+ rewrote error-finder to support runtime-modifiabl\2B07 regular
X`09  expressions (finderr.c, edef.h)
X
X`09+ added b_rmbuff member to BUFFER struct to notify error-finder when
X`09  its buffer is removed; the b_upbuff member handles the modify
X`09  events (estruct.h, buffer.c).
X`09 `20
X`09+ use macros b_set_obsolete/b_clr\0F09 (buffer.c, display.c)
X
X`09+ use RBRACK/LBRACK definitions throughout (filec.c, vms2unix.c)
X
X`09+ corrected missing initialization of CHARCELL link in extend_line()
X`09  that occasionally broke vile-manfilt (\0907.c).
X
X(tom)`09951217 (b)
X`09+ lint (basic.c bind.c dumbterm.c exec.c insert.c line.c main.c map.c
X`09  oneliner.c patchlev.h path.c random.c search.c select.c tags.c
X`09  x11.c), including correcting error return within gotoeol(), and also
X`09  testing error return from bclear() in pregion(), and
X`09  attributeregion() in clear_match_attrs().
X
X`09+ corrected ifdef'd logic from vile 5.5a with new function 'ins_mode()'
X`09  replacing logic that's only used in mouse-code (display.c)
X
X(jrs)`09951216 (a)
X`09+ bind.c (fill_partial): Use StrNcmp of length 1 instead of
X`09  char equality to inherit case-insensitive comparision
X`09  when extending completions as far as possible.  This is
X`09  so that if we have `60bind.c' and `60BIND.OBJ' we will complete
X`09  up to `60bind.' if OPT_CASELESS is enabled.
X
X`09+ file.c (fileread): Explicitly check for additional command
X`09  line input so that `60e! RET' doesn't prompt for mor\2F07.
X`09  In that case, default to the filename of the current buffer
X`09  and optionally prompt for replacement based on the new\3307
X`09  `60warn-reread'.
X
X`09+ filec.c (mlreply_file): Supress prompting to reread the
X`09  current buffer based on the new variable `60warn-reread'.
X`09  This is for people who like `60e! RET' to assume they know
X`09  what they're doing.
X
X`09+ main.c (global_val_init): Initialize `60warn-reread' so that
X`09  it defaults to the existing behavior.
X
X`09+ makefile.wnt (LDFLAGS): New variable to control debugging
X`09  and the logo.
X`09  (vile.exe, mktbls.exe): Use it.
X
X`09+ modetbl (warn-reread): New option.
X
X`09+ ntconio.c (ntscroll): Remove cRest variable and its
X`09  initialization since the default is what we want anyway.
X`09  Ensure that rectangles are described by their last row
X`09  or column, not its sucessor.  Narrow the amount of
X`09  backfilled scrolled areas by noting that the bug is the
X`09  failure to backfill the non-overlapped portion of a scroll.
X
XChanges for vile 5.6 (released Thu Dec 14, 1995)
X(pgf)
X`09+ allow "position-window" to be used from macros, e.g.
X`09  "position-window bottom".  giving it an arg now reframes to
X`09  that line from top or bottom, e.g. "11 position-window top".
X`09  (cmdtbl, eval.c, vile.hlp, window.c)
X
X(pgf)`09951212 (f)
X`09+ writing a region (e.g. ":.,$w foo") when the ends of the
X`09  region did not fit on the screen would cause "BUG: updpos...".
X`09  now fixed, by ensuring that moves are always flagged correctly.
X`09  (btw, this was hidden by anything else that set a w_flag bit,
X`09  like "ruler" mode.) (exec.c)
X
X`09+ fixed propagation of null character when highlighting string
X`09  literals that span lines.  (c-filt.c)
X
X`09+ fixed description of label syntax (vile.hlp)
X
X(tom)`09951209 (e)
X`09+ implemented "next-tag" function, bound to `5EA-`5E`5D, which steps throug
Vh
X`09  alternate tags definitions for the last tag value (cmdtbl, tags.c).
X
X`09+ ifdef'd out code that causes vile to die when it receives an EOF
X`09  (linux only, termios.c)
X
X`09+ modified to allow trivial (one-match only) glob-expansion of items in
X`09  'tags' mode so that `7E/tags and $HOME\0F06work (tags.c).
X
X(pgf)`09951209 (d)
X`09+ take out call to wrapword() in newline(), which caused an
X`09  extra newline in some wrapping cases.  the condition it was
X`09  taking care of is now caught earlier on.  (insert.c)
X
X(pgf)`09951208 (c)
X`09+ created separate .zip targets for watcom and djgpp builds, since
X`09  i seem to have to switch back and forth all the time.  (makefile.in)
X
X`09+ do_num_proc and do_rept_arg\1506would accept `5EX or `5EA prefixes
X`09  followed by digits as further modifications to the argument
X`09  count, so 2 `5EX-2 wouldn't work as advertised.  now it does.`20
X`09  (main.c)
X
X`09+ fixed kbd_reply() so that starting a response with `5EV now
X`09  clears the existing response -- it used to append the
X`09  quoted character instead.  (input.c)
X
X`09+ correction for showmatch mode when the left fence is the first
X`09  character in the buffer. (fences.c)
X
X`09+ better explanation of difference between "wrapword" mode
X`09  and newer "wrapmargin" mode.  (vile.hlp)
X
X`09+ added fallback define of S_ISDIR in path.c.
X
X(tom)`09951205 (b)
X`09+ corrected value of 'fname' in 'readin()' after calling 'ch_fname()';
X`09  this may have been the original bp->b_fname value, which is
X`09  reallocated when resolving a pathname (file.c).
X
X`09+ modified to check for null pointer return from 'create_msgs()'
X`09  (msgs.c)
X
X(tom)`09951203 (a)
X`09+ corrected logic of 'line_height()' to get rid of unwanted wraparound
X`09  on the last column of the screen when linewrap mode is set (display.c)
X
XChanges for vile 5.5 (released Sun Nov 19, 1995)
X(pgf)
X`09+ added tags file format in\0906ion to vile.hlp.
X
X`09+ removed vmalloc.`7Bc,obj`7D from makefile.`7Bdjgpp,wnt,blc`7D
X
X`09+ prevent `5ET from inserting spaces if "notab\1A06" is set. (\2B06.c)
X
X`09+ force two spaces after a ':' when reformatting paragraphs. (word.c)
X
X`09+ mention screen resolution control on PC in man page. (vile.1)
X
X`09+ trimmed trailing whitespace from vile.hlp.  where does that stuff
X`09  come from, anyway?
X
X`09+ fix forceblank() to consider lines containing whitespace to be
X`09  blank.  (random.c)
X
X`09+ call upmode() when resetting modeline format.  (eval.c)
X
X`09+ vms C compiler complains about folded pre-processor lines.  sigh.
X`09    (mktbls.c)
X
X`09+ added two new macro accessible functions, `26local and `26global, which
X`09  return the value of a vile setting.  for instance, "`26global cmode"
X`09  will give the global cmode setting (true or false) and "`26local list"
X`09  will give the local autoindent mode setting.  (modes.c, eval.c,
X`09  modetbl, macros.doc, vile.hlp)
X
X`09+ minor fixes for incremental searching: better tie-in with 'n' and
X`09  'N' commands, and uses CR as search terminator.  (\1506.c,
X`09  isearch.c, edef.h)  (from s.suresh)
X
X`09+ eliminate vttidy(), since it had degenerated to a simple
X`09  wrapper for ttclean().  call\110A directly in all cases.
X`09  (spawn.c, termio.c, version.c, file.c, main.c, proto.h, display.c)
X
X`09+ put TTkopen() call into ttunclean, so that keybad and xterm-mouse
X`09  translation get turned back on after a suspend or shell escape.
X`09  and then i removed it again.  the TI sequence for the linux
X`09  console homes the cursor.  not a good thing just before a
X`09  pressreturn().  but\140E needs the termio stuff that
X`09  ttunclean does.  so they have to remain separate.
X`09  (termio.c, main.c)
X
X`09+ introduced swbuffer_lfl() which takes lockfl as arg. \2B09() is
X`09  a wrapper which calls swbuffer_lfl() with lockfl == TRUE (the old
X`09  behavior).  this allows getting rid of the early readin() that was
X`09  happening in bp2swbuffer() (due to the lack of a lockfl arg), which
X`09  was in turn causing read hooks to run too early, before the buffer
X`09  state (modes, name, etc.) was set up correctly.  (buffer.c, file.c,
X`09  proto.h)
X
X`09+ rearranged swbuffer_lfl to make sure it does the right thing
X`09  with inactive buffers.  (\0B06.c)
X
X`09+ small addition to vile.hlp regarding where comments can appear
X`09  in command files (i.e. probably only on lines by themselves)
X
X`09+ i couldn't configure xvile on sunos 4.1.3 with X11R6 installed,
X`09  because the test link against -lXt failed, due to missing -lSM
X`09  and -lICE.  these have already been tested for and found, so i
X`09  added $X_PRE_LIBS to the check for -lXt.  this seems to fix it
X`09  and also seems benign.  is this right?  (configure.in, \0E09,
X`09  makefile.in)
X
X(tom)
X`09+ corrected a bug in wrapmargin that caused it to split and alarm
X`09  at the wrong point (insert.c, word.c).
X `20
X`09+ corrected a bug in linewrap; when the user appended to the end of
X`09  a line longer than the window, the beginning of the line was
X`09  overwriting the modeline of the next window (display.c).
X
X`09+ modified termcap color support to work with rxvt 2.12 (tcap.c).
X
X`09+ rewrote logic for color mode-type to make it an enum-type, more
X`09  general, and made the visual-matches mode an enum (modetbl, main.c,
X`09  modes.c, search.c).  This makes name-completion work properly on
X`09  enumerated types.
X
X`09+ added 'default' enum value for termcap colors and \3206logic to
X`09  reset colors to default, i.e., orig_\1E07on exit (modes.c, tcap.c).
X
X`09+ modified color modes to be global, since we don't support per-window
X`09  colors anymore (modetbl, display.c, main.c).
X
X`09+ changed 'popup-choices' to a enum-type (modetbl, bind.c, main.c).
X
X`09+ make the 'spal()' function a member of the TERM struct to eliminate
X`09  unused/dummy functions, and to capture internal initialization
X`09  of 'palstr' (lot of places).
X
X`09+ corrected error in vile-manfilt that dumped core due to off-by-one
X`09  in realloc threshold, and fixed a memory leak (manfilt.c)
X
X`09+ added global mode 'resolve-links' to control whether vile \2707s
X`09  and caches directory names (modetbl, main.c, path.c).
X
X
XChanges for vile 5.4 (released Thu Oct 19, 1995)
X
X(jrs)
X`09+ This revision provides improved support for Windows NT and
X`09  Windows 95.  The screen performance is dramatically faster
X`09  and a new completion mechanism is introduced which is
X`09  neither purely case-sensitive like Unix no\2408
X`09  case-insensitive like traditional MS-DOS.  This is used
X`09  to cleanly support case-insensitive bu\1507preserving
X`09  filesystems such as MS-DOS FAT with long filenames or
X`09  native NTFS.
X
X`09+ bind.c, proto.h: Add case insensitive flag to kbd_complete,
X`09  skip_partial, show\0E0E_completions, scroll\140D
X`09  and fill_partial.  Take care to propgate case changes
X`09  which occur during completion to the keyboard input area.
X
X`09+ eval.c, modes.c: Change kbd_complete callers.
X
X`09+ dirstuff.h, makefile.wnt: Repair crufty WIN32 port.
X
X`09+ edef.h: Rename the operating system `60windows/nt' as `60win32'.
X
X`09+ estruct.h: Rework compiler and system defines so that
X`09  Visual C++ is detected and so that Borland C++ can be used
X`09  to compile the WIN32 version.  Also undef some more common
X`09  names like ABORT which pollute the namespace of many
X`09  environments.
X
X`09+ file.c: Make getfile2bp external so that it can be called from
X`09  main.  Use the canonical name instead of the supplied name
X`09  to form the buffer name for case-insensitive,\1206preserving
X`09  filesystems.  This change makes `60:e readme RET' for a file
X`09  whose real name is `60README' have a buffer named\1D09.
X
X`09+ main.c: Use getfile2bp instead of make_bp so file specified
X`09  on the command line behave more like found files; confer
X`09  the above example.
X
X`09+ filec.c, glob.c: Never lowercase WIN32 filenames and instead
X`09  compare them case-insensitively.  Pass\1A11 flag to
X`09  kbd_complete on WIN32.
X
X`09+ path.c: For WIN32 call the new function realpath from
X`09  canonpath so that the preserved case of a filename is
X`09  reconstructed even though a different case was used to
X`09  access the file.
X
X`09+ termio.c: For WIN32 add prototype for ntgetch and don't call
X`09  kbhit.
X
X`09+ version.c: Discriminate between Turbo C and Borland C++ to
X`09  clarify and shorten the version string.  Add support for
X`09  Visual C++.
X
X`09+ makefile.blc: Yet another\1A09 for WIN32 (like\330Awnt)
X`09  which uses Borland C++ instead of Visual C++.
X
X`09+ ntconio.c: Massive overhaul for performance, consistency,
X`09  bug fixes and new features.  The driver is dramatically
X`09  faster now because of reduced API transactions through
X`09  batching and because of avoidance of inherently slow functions
X`09  such as WriteConsole.  Correct a number of inconsistencies with
X`09  the other MS-DOS-like drivers such as the use of bright
X`09  white and clearing the screen upon exit.  Fix a number of
X`09  bugs such a bad interaction between kbhit and getch and
X`09  work around a bad bug in the Windows 95 implementation of the
X`09  WIN32 Console API.  Enhance the driver to support all of the
X`09  function and editing keys and some missing control-key
X`09  combinations.
X
X`09+ bind.c, filec.c: Temporarily disable case insensitive reply
X`09  correction for now since it doesn't work reliably and it only
X`09  provides a cosmetic advantage.
X
X`09+ estruct.h: Add a new option OPT_UNC_PATH for systems
X`09  which support Universal Naming Convention (UNC) pathnames.
X`09  Enable for win32.  Turn on ellipsis and range globbing on
X`09  win32.  Define new glob range negation characters (`5E and !).
X
X`09+ filec.c, glob.c, path.c: Change numerous conditionals specific
X`09  to win32 to use the new OPT_CASELESS option.
X
X`09+ glob.c: Extend globbing to handle OPT_CASELESS.  Fix bug which
X`09  prevented ranges from working on any platform.  Implement
X`09  range negation.
X
X`09+ ntconio.c: Disable mouse support until the bugs are worked out.
X`09  Don't allow non-keyboard events to cause type ahead check to
X`09  loop forever.
X
X`09+ dirstuff.h: Clean up crufty ifdefs and defines for win32
X`09  directory operations.
X
X`09+ path.c: Correct faulty mapping between _getdrive and curdrive.
X`09  Rename realpath to case_correct_path and use it for OPT_CASELESS.
X`09  Handle UNC pathnames correctly during canonicalization and
X`09  case correction.  Fix bugs in\1E10 that showed up
X`09  because of differences between Windows NT and\0F0995.
X`09  Fix bug in internal name detection that prevented range globbing
X`09  from working at the beginning of a pattern (e.g. `60`5Ba-z`5D*').
X`09  Make pure system and share UNC pathnames (e.g. `60`5C`5C\2806`5Cshare')
X`09  always appear as directories so completion on them works.
X`09  This works around a bug in the win32 file attribute semantics.
X`09  Be sure not to add `60`5C*.*' to a directory that ends with `60`5C'
X`09  in the the MSVC opendir replacement, add just `60*.*' instead.
X`09  Fix monster memory leaks in MSVC readdir replacement and change
X`09  mechanism to allow multiple simultaneous open directories.
X
X`09+ makefile.wnt: Suppress annoying compiler banner.
X
X`09+ fileio.c: Work around another Microsoft bug and make ffsize
X`09  work reliably on files remotely mounted from Windows 95 systems
X`09  by using stdio instead of fstat.  Also use the default isready_c
X`09  because WIN32 stdio is either MS (which is like traditional
X`09  stdio) or Borland which is already handled.
X
X`09+ main.c: Only make '`7E' a wildcard character on Unix since we only
X`09  expand `7Elogin on Unix.  This allows short filenames which contain
X`09  tilde to be expanded properly (e.g. C:`5CPROGRA`7E1 => C:`5CProgram Files
V)
X`09  on WIN32.
X
X`09+ makefile.in: Add the WIN32 Borland C\2509 to the official
X`09  distribution.
X
X`09+ npopen.c: Handle WIN32 like MS-DOS, not\1106Unix so that
X`09  command filtering works correctly without much effort.
X
X`09+ ntconio.c: Re-enable mouse input and completely rewrite the
X`09  mouse handling to use the generic selection code shared with
X`09  X11.  This change fixes a number of WIN32 mouse bugs and saves
X`09  about 100 lines of code.
X
X`09+ path.c: Rewrite case_correct_path for WIN32 so that it c\2206ly
X`09  handles strings which grow on expansion such as those files
X`09  which include any short-name components.
X
X`09+ proto.h, select.c, x11.c: Compile the \1D06ion yanking code
X`09  on WIN32 and add an argument which controls\0F07register to
X`09  yank into.  Change all callers.
X
X`09+ spawn.c: Remove crufty inclusion of sys/stat that seems not
X`09  to be needed on any platform.  Even if it is, it should be
X`09  safe to include it unqualified as it is in other files.
X`09  Change the default COMSPEC from cmd.exe to command.com on
X`09  WIN32 since there is no cmd.exe on Windows 95 but\2609
X`09  a command.com on Windows NT.  In any case, COMSPEC is usually
X`09  set.  Enable filterregion code on WIN32 since inout_popen
X`09  now works.
X
X(kev)
X`09+ x11.c (x_preparse_args): Make sure that the scroll bar GC has
X`09  the graphics exposures field set to false.  (The calls to XCopyArea
X`09  using the scrollbar GC are from a pixmap which will always be
X`09  copied in its entirety.
X
X`09+ x11.c: Changed resources so that default colors will be various
X`09  shades of gray.  This code is presently disabled.
X
X`09+ x11.c (copy_paste): #if'd out the code which caused pasting at
X`09  the beginning of a line to be put on the line above and pasting
X`09  at the end of a line to be put on the line below.  Just define
X`09  OLD_PASTE to be 1 if you want the old behavior back.
X
X`09+ x11.c (x_expose_scrollbar): Renamed from x\2208pane.
X
X`09  (update_scrollbar_sizes): Set up an event handler for \2E09
X`09  expose events.
X
X`09  (x_preparse_args): Removed call to set up expose event handler
X`09  for panes.
X
X`09  The above changes were made because popup menus (from other
X`09  applications) could cover up the scrollbar and not redraw it
X`09  properly (I don't really know why).
X
X`09+ x11.c (curs_sb_v_double_arrow, \1808up\120Dxterm
X`09  curs_sb_down_arrow,\1409left\1410righ\1508
X`09  curs_double_arrow,\1306watch): Moved these out of struct
X`09  _text_win so that they are global.  This'll be handy for the day
X`09  when someone gets up the courage to actually create multiple
X`09  (top-level) X windows.  There's a lot of other stuff to be moved
X`09  out, but this is a start.
X
X`09  (slider_is_3D, scrollbargc_lt\100Edk): New fields in
X`09  struct _text_win.
X
X`09  (alloc_shadows): New function which allocates pixels for light
X`09  and dark shading for a 3-D look.
X
X`09  (draw_thumb, update\0E08x_expose_pane, x_preparse_args): Added
X`09  new code for drawing 3-D scrollbars.
X
X`09+ input.c (kbd_reply): Set reading_msg_line to FALSE _after_
X`09  popping down the completions window in order to ensure that the
X`09  buffer hook does not get run.  (It should not have been run when
X`09  popping the buffer up either, so when it's popped down, the
X`09  situtation should be the same prior being popped up.)
X
X`09+ buffer.c (make_current, run_\1C06_hook): Removed the message
X`09  line check from make_current() and moved it to run_buffer_hook.`20
X`09  We do not want to run the buffer hook if reading from the message
X`09  line.  See below (I fixed this once before) for more information.
X
X`09+ modetbl (SMOOTH_SCROLL): New boolean mode.
X
X`09+ main.c (global_val_init): Initialize GMDSMOOTH_SCROLL value.`20
X`09  Default is false so that it'll jump.
X
X`09+ display.c (update, updupd): Added additional test to the "return
X`09  early" code to enforce smooth scrolling if GMDSMOOTH_SCROLL is
X`09  set.
X
X`09+ main.c (main): Prevent curbp from pointing to an already
X`09  freed memory area.
X
X`09+ x11.c (sel_prop, selection_data\100Clen): Removed these
X`09  fields from struct _text_win.
X
X`09  (atom_TARGETS, atom_MULTIPLE\0F07TIMESTAMP\1008EXT): Added
X`09  variable declarations and initialization statements for these
X`09  atoms.  Initialization is performed in x_preparse_args().
X
X`09  (free_selection, x_stash\130Cstrndup): Deleted  these
X`09  functions.
X
X`09  (x_get_selection, x_paste\130E\240Aed_text,
X`09  X_convert_selection, x_lose\120Cown\210A): New or
X`09  rewritten functions to use the Xt Intrinsics instead of Xlib for
X`09  handling selections.  In particular, xvile now\2F06es the
X`09  following targets: TARGETS, MULTIPLE, TIMESTAMP, STRING, and
X`09  TEXT.  xvile should now be ICCCM compliant with respect to
X`09  selection handling.
X
X`09  (x_process_event): Removed all selection handling code.
X
X`09  `5B Thanks to Brian Schellenberger (bts@unx.sas.com) for
X`09    contributing code which made xvile more ICCCM compliant.  I
X`09    used his contribution as a framework for x_convert_selection().
X
X`09    Chan Benson's "Implementing Cut and Paste in the X Environment"
X`09    (The X Resource, Issue 10) was also instrumental in making the
X`09    above changes. `5D
X
X`09+ buffer.c (make_current): Prevent the\2507 hook from being run
X`09  if we're presently reading from the message line.  In particular,
X`09  this will prevent the buffer hook from running when the
X`09  Completions buffer is popped up.  (:set and :setv were adversely
X`09  affected since these operations are often performed from one of
X`09  the buffer hooks and they are not reentrant.)
X
X`09+ filec.c (fillMyBuff): Changed the algorithm for non-VMS machines
X`09  to use qsort() (via sortMyBuff) instead of an insertion sort.  On
X`09  a 100 MHz pentium, this caused the cpu time needed to build a
X`09  completion list for a directory of roughly ten thousand files to
X`09  go from approximately 3 minutes to a mere 2 seconds.  (I know
X`09  that 10,000 files seems like a lot.  But one of my coworkers
X`09  discovered this performance deficiency in a directory with over
X`09  32,000 files.  xvile needed in excess of 14 minutes of cpu time
X`09  to build the completion list on a SPARC-20.)
X
X`09+ filec.c (qs_pathcmp, sortMyBuff): New functions.
X
X`09+ vile.hlp: Minor corrections.
X
X`09+ select.c (attributeregion): Only allocate memory for new a\2F08
X`09  when actually adding new attribute.  \0C09region() is also
X`09  responsible for deleting attributes.
X
X`09+ bind.c (engl2fnc): Make sure the binary search terminates.  Setting
X`09  shell variable VILEINIT to ./vileinit would cause engl2fnc() to
X`09  loop endlessly.  I now know that this was not the proper usage
X`09  of this environment variable.  But engl2fnc() still shouldn't
X`09  get stuck in an infinite loop.
X
X`09+ eval.c (gtenv, SetVarValue): Make sure that curbp is not NULL
X`09  prior to using it.  This can happen during the execution of
X`09  .vilerc.  The resultant behavior is not necessarily what the user
X`09  expects, but at least it doesn't cause a core dump.  For example,
X`09  put the following into your .vilerc:
X
X`09`09  `7Eif `26seq $progname "xvile"
X`09`09`09set title $cfilname
X`09`09`09set iconname $cbufname
X`09`09  `7Eendif
X
X`09  I think the expected behavior would be to have $title and
X`09  $iconname in xvile take on the values of $cfilname and $cbufname
X`09  respectively.  But curbp is NULL when these actions are
X`09  performed.  I don't dare move any of the initialization code in
X`09  main() around or something else'll break.  `5BI'm not really all
X`09  that bothered by this behavior.  The "buffer-hook" variable works
X`09  well for this type of stuff.`5D
X
X`09+ fences.c (InDirection, simple_fence, fmatchindent): Fixed problem
X`09  in which closing right curly bracket was not getting indented
X`09  properly in cmode.
X
X`09+ input.c (kbd_reply): Don't erase default message if a completion
X`09  character is entered.  This takes Tom's fix to this code somewhat
X`09  further.  Scenerio: I enter ":e ../vile-5.3/fil<TAB>".  It only
X`09  completes to ../vile-5.3/file.  At this point I too hastily hit
X`09  return (having mistakenly expected the completion to be unique).`20
X`09  I realize my error and hit ":e " I see ../vile-5.3/file.  I press
X`09  <TAB> and see the other completions (I have popup-choices set to
X`09  immediate).  I see the other completions and expect to be able to
X`09  modify the default response since I _have_ pressed a key _and_
X`09  the default response has not been erased.
X
X`09+ main.c (main): Fixed a small bug introduced in 5.3g which caused
X`09  xvile to core dump when given no arguments.
X
X`09+ main.c (cmd_mouse_motion,loop): Permit cursor to rest on the`20
X`09  newline if it was placed there via the mouse.  This permits
+-+-+-+-+-+-+-+-  END  OF PART 25 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 26 -+-+-+-+-+-+-+-+
X`09  the pasting of text at the end of the line.`20
X
X(pgf)
X`09+ get rid of #elif in display.c, for K`26R compiler on HP/UX.
X
X`09+ set "scanbound_is_header" flag in oneliner.c when doing
X`09  line substitutions.  fixes broken :s/foo/bar/ commands.
X`09  (search.c, oneliner.c, edef.h)
X
X`09+ applied lee johnson's fixups to my changes for OS/2. (estruct.h,
X`09  os2vio.c)
X
X`09+ change name of variable used to cache interruptible pipe-read
X`09  results.  variables must contain '_cv_' to work correctly.  this
X`09  speeds up subsequent configure runs quite a lot, since the
X`09  pipe-read test is a looong one.  (aclocal.m4)
X
X`09+ applied fixes from purify'ing on HP\1606Warren Vik (path.c,
X`09  map.c)
X
X`09+ protect against null filenames (with BUG: report) in readin().
X`09  (file.c)
X`09
X`09+ add another OS/2 specific errno check to ffropen() (fileio.c)
X
X`09+ turn on prototypes for OS/2 and IBM compiler in mktbls.c
X
X`09+ set `5BMessages`5D buffer invisible and active to a) keep it from
X`09  being found by ":n" and b) keep readin() from\2E07called on it.
X`09  (msgs.c)
X
X`09+ eliminated references to vmalloc code.  i haven't used it in
X`09  years, and there are better debugging libs available. `20
X`09  (estruct.h, exec.c, file.c, makefile.in, undo.c)
X
X`09+ added ".cc" to the default cmode suffixes. (main.c)
X
X`09+ changed the deblank() routine to a forc\1A11-- with
X`09  no arg still removes blank lines, but with an arg will force
X`09  that many blank lines at current point.  can be used to quickly
X`09  double-space some text, for example.  (random.c, cmdtbl, vile.hlp)
X
X`09+ minor change to help re-display code to better preserve DOT across
X`09  help invocations, and to prevent spurious moves if\3307s reinvoked
X`09  while still on-screen.  (bind.c, buffer.c, edef.h)
X
X`09+ remove usage of gets() from c-filt.c  (on recommendation of
X`09  runtime warning from gcc on freebsd...  imagine my surprise :-)
X
X`09+ fix c-filt.c to correctly recognize keywords which contain
X`09  spaces after the '#', as in:
X`09  `09#if foo
X`09`09#  define bar
X`09`09#endif
X
X`09+ clean up bufhook so that the hook won't be called too early
X`09  in the case of being invoked from swbuffer.  that is, we
X`09  keep make_current from invoking the hook, since swbuffer
X`09  isn't ready (curwp may not be set up yet).  this let's
X`09  me run the C-filter macro as a buffer-hook.  (\0F06.c)
X
X`09+ added the "< register, which contains the last few hundred
X`09  keystrokes typed.  actually, it will contain somewhere between
X`09  128 and 256 characters, since its limited to a single dchunk.
X`09  (estruct.h, map.c, line.c, vile.hlp)
X
X`09+ added "dotags" and "devonlylist" targets to makefile.
X
X`09+ applied patches to make `5ET do a proper shiftwidth in insert
X`09  mode.  also be sure insertmode doesn't get reset by functions
X`09  called from insertmode.  (from grant mcdorman)  (\2506.c)
X
X`09+ modify xterm-mouse code to allow its use with TERMs other
X`09  than xterm.  currently, if it's not really \2908, then
X`09  the mouse reports are assumed to be zero-based rather than
X`09  one-based.  apparently some Amiga terminal emulator does
X`09  this.\0706 can be generalized if needed.  (from grant mcdorman)
X`09  (tcap.c)
X
X`09+ c-filt.c now supports "Literal" attribute, for highlighting
X`09  strings.  (c-filt.c, vile.hlp) (from ben stoltz)
X
X`09+ applied patch to support '?' searches in tags files.  (tags.c, from
X`09  eric krohn)
X
X`09+ implemented nvi-style infinite undo, which overloads '.' command
X`09  to continue undoing changes, if it immediately follows an undo.
X`09  added status message to help figure out which way (forward or
X`09  backward) you're going.  (cmdtbl, undo.c, main.c, vile.hlp)
X
X`09+ gave line_report() return value indicating whether it printed
X`09  message or not.  (random.c, line.c, globals.c, proto.h)
X
X`09+ suppress compiler warning in glob.c
X
X`09+ changed "Only one occurrence.." message to not beep, and not cause
X`09  popup messages if you hit it during startup.  this also means "terse"
X`09  mode will suppress it. (search.c)
X
X`09+ removed some dead "ifdef BEFORE" code and commented lines.  (undo.c
X`09  basic.c bind.c insert.c line.c)
X
X`09+ added gppconio.c to the distribution.  one of these days maybe
X`09  this can go away, when the fixes are incorporated in the djgpp
X`09  release.
X
X`09+ changed the test code in aclocal.m4 to always try and include
X`09  ioctl.h and sys/\1007.  this makes it match the usage in
X`09  fileio.c.  the test code didn't have ioctl.h, therefore thought
X`09  we needed our own extern for ioctl(), and ours doesn't match
X`09  the freebsd prototype (theirs is variadic).  i seem to only
X`09  have autoconf 2.2, so if someone wants to rebuild configure
X`09  with 2.3, that's fine\1606me.  (aclocal.m4, configure)
X
X(tom)
X`09+ corrected ifdef in path.c that broke vms compile.
X
X`09+ added configuration tests for prototypes, varargs.
X
X`09+ corrected missing flag in 'gotoline()' that caused reframing error
X`09  (basic.c).
X
X`09+ corrected off-by-one that made 'N' fail for pattern "." (search.c).
X
X`09+ added '`5C' and ':' to pathname-characters for MSDOS (main.c).
X
X`09+ corrected handling of "--with-CFLAGS" (configure.in)
X
X`09+ corrected allocation-size in resolve_dir (path.c)
X
X`09+ corrected logic of binary-search version of engl2fnc (bind.c)
X
X`09+ corrected off-by-one errors in text yanked by goto-matching-fence
X`09  command (fences.c, select.c).
X
X`09+ corrected translation of SEL_KREG in 'index2reg()' from '`7B' to '.'
X`09  (line.c).
X
X`09+ modified button1-release in xvile to yank the selection (x11.c).
X
X`09+ corrected 'updattrs()' to not highlight text that cannot be selected
X`09  e.g., line numbers (display.c)
X
X`09+ compiler warnings for DEC-C and Watcom 10.0a (estruct.h, fences.c,
X`09  filec.c, mktbls.c, npopen.c, os2pipe\0B07vio.c, path.c, proto.h,
X`09  random.c, spawn.c, termio.c, vmspipe\0B07vt.c) on OpenVMS and OS/2.
X
X`09+ modified quoted-motion to interpret repeat-count as code for type of
X`09  selection: 1=exact, fullline=2, rectangle=3 (\2D06.c).
X
X`09+ modified xvile to _not_ start display if only a "-V" option is given
X`09  (main.c).
X
X`09+ removed 'slash-char' mode, modifying code to use '/' for internal use
X`09  of MSDOS pathnames (filec.c, glob.c, modetbl, main\1108s.c,
X`09  path.c, random.c).
X
X`09+ modified name-completion so that if we match _something_, typing a
X`09  character won't erase the buffer (input.c).
X
X`09+ revised manpage filter to allow for escape sequences that set
X`09  boldface/underlining -- this happens on OSF1 (manfilt.c).
X
X`09+ corrected code that supports OPT_XTERM >= 3 -- this is mostly for use
X`09  in demos since we don't handle text-position reports in :-commands,
X`09  for example (tcap.c).
X
X`09+ modified VALNAMES structure to have a side-effects function pointer,
X`09  replaced the inline logic in mode-setting with a table (modes.c,
X`09  modetbl, mktbls.c).
X
X`09+ modified logic that set up name-completion table for the combined
X`09  modes + variables to suppress "no"-prefix, etc.  Made related
X`09  changes to ensure that vile prompts for boolean modes set via ":setv"
X`09  (eval.c, input.c, modes.c).
X
X`09+ corrected logic that updates command-line display during name
X`09  completion (bind.c).
X
X`09+ modified mode-value completion to include booleans and colors, if the
X`09  enumerated value code is configured (modes.c).
X
X`09+ modified so that vile will prompt for reloading tags buffers when
X`09  user uses ":e" to view the buffer (file.c).
X
X`09+ modified to show the actual filename for the help-file (bind.c).
X
X`09+ modified to remember position in help-file when re-reading it (bind.c,
X`09  buffer.c).
X
X`09+ corrected adjust_forw,\0D08back functions to avoid returning
X`09  non-line location which broke reframing (window.c)
X
X`09+ corrected test in 'reframe()' for case where wrapped line was larger
X`09  than the window (display.c).
X
X`09+ modified to use w_line.o to store offset so that current position in
X`09  wrapped lines that are larger than the window still displays
X`09  (display.c).
X
X`09+ added configure test for ANSI_QSORT (aclocal.m4).
X
X`09+ modified test for nsl library to see if it's needed; otherwise this
X`09  breaks xvile on IRIX 5.3; the standard X library configure test may
X`09  also add this library (configure.in).
X
X`09+ linted on solaris and irix -- conversion and constant-conditional
X`09  (lots of places).
X
X`09+ make the case-insensitive code for WINNT a configuration option
X
X`09+ modified logic to make fake window `26 buffer to satisfy references
X`09  before vile starts screen mode (main.c, window.c).
X
X`09+ added "dumb" terminal driver to allow for prompting before vile
X`09  starts into screen mode (main.c, termio.c, dumbterm.c).
X
X`09+ modified file-completion on VMS to use kev's qsort improvement
X`09  (filec.c)
X
X`09+ corrected version-parsing for VMS filenames (vms2unix.c)
X
X`09+ corrected VMS filename-completion when user supplies "/" (filec.c).
X
X`09+ modified most exit-calls to do 'vttidy()' first (file.c, ibmpc.c,
X`09  main.c, vmsvt.c, version.c, termio.c)
X
X`09+ modified test-scripts for VMS to work across devices (descrip.mms,
X`09  vmsbuild.com).
X
X`09+ moved terminal/keypad-initialization into TTkopen(), and the matching
X`09  resets into TTkclose() so that "vile -V" works properly with the
X`09  dumb-terminal driver (tcap.c, termio.c).
X
X`09+ corrected off-by-one error in VMS shorten_path that caused ../SIO to
X`09  be shown as `5B-.IO`5D when cwd was ../SRC (path.c)
X
X`09+ enabled directory-completion for VMS (estruct.h).
X
X`09+ removed some ifdefs for apollo and CenterLine C that should be
X`09  obsoleted by the 'configure' script (estruct.h).
X
X`09+ moved TTkclose/TTkopen calls in fileio.c down to where they're
X`09  actually used -- spawning subprocesses -- to avoid spurious
X`09  reinitialization of the terminal in termcap mode (fileio.c,
X`09  npopen.c).
X
X`09+ corrected motions '(' and ')', which did not handle empty lines
X`09  like vi (basic.c).
X
X`09+ corrected handling of command-line '+' when argument is greater
X`09  than buffer length, and also ensured that initial-search string
X`09  doesn't conflict with contents of .vilerc (main.c).
X
X`09+ corrected logic of regstrchr, which did not skip '`5C' characters for
X`09  range-expressions.  This caused pattern "`5B<>`5D" to match '`5C' also
X`09  (regexp.c).
X
X`09+ modified ibmpc drivers to update current_res_name, so that vile will
X`09  restore the screen resolution after spawning a command (borland.c,
X`09  ibmpc.c).
X
X`09+ corrected logic for $buffer-hook so that it's not invoked unless the
X`09  buffer is the current window, so that editing commands work
X`09  (buffer.c).
X
X`09+ modified logic to enable 'readin()' to run $read-hook when reading
X`09  from a pipe -- which concludes with an FIOEOF code (estruct.h, file.c)
X
X`09+ corrected logic that sets the first buffer-pointer so\2607tartup
X`09  scripts can manipulate it.  This implies that we'll always create the
X`09  unnamed buffer, just in case it's needed, and remove it after reading
X`09  .vilerc if it's unmodified.  Also remove, if possible, any stray
X`09  windows belonging to the unnamed buffer if a \120Es
X`09  available, just in case .vilerc created windows (main.c).
X
X`09+ modified ffexists/ffaccess to check that their argument is really
X`09  a valid pathname (fileio.c).
X
X`09+ corrected logic that closed `5BHistory`5D buffer, which was resetting
X`09  'autobuff' mode, and warning message if :show-history was given when
X`09  history mode was off (\1607.c).
X
X`09+ corrected the check I'd added to ffexists/ffaccess (I'd used
X`09  maybe_pathname, which was requiring \1E08-delimiters) to use
X`09  isInternalName instead (fileio.c).
X
X`09+ modified logic in execute-named-command to prevent accidental
X`09  invocation of commands (such as ":q!") when the\2208 is terminated
X`09  by unexpected character (such as <esc>) (exec.c).
X
X`09+ corrected logic that sets last_eolchar when interpreting macros,
X`09  so that commands such as "set nu lw" will work (input.c).
X
X`09+ modified logic so that saving the unnamed buffer to a file renames
X`09  the buffer (file.c).
X
X`09+ made mouse work for msdos+watcom configuration using polling (estruct.h,
V
X`09  ibmpc.c)
X
X`09+ updated makefile for watcom 10.0a (\1B08.wat)
X
X`09+ corrected logic in wrap_at_col(), which sets the column at\1907the
X`09  wrapmargin mode activates; I'd used 'col_limit()' in an expression,
X`09  which broke when linewrap was set.  Also checked for end-of-line
X`09  before wrapping; this was an error in 'o' (insert.c).
X
X`09+ modified interface of 'getccol()' and 'getc\0F06to pass 'list' mode
X`09  for the special case of testing wrapmargin (insert.c, random.c, etc).
X
X`09+ rewrote manfilt.c to handle more general escape and underline sequences
X`09  (manfilt.c).
X
X`09+ refined treatment of wrapmargin to trim trailing whitespace when a
X`09  tab/space is inserted past the wrap-margin.  This still isn't
X`09  _exactly_ what vi does (insert.c, word.c).
X
X`09+ corrected handling of `5ED/`5EU/`5EF/`5EB scrolling commands for long wra
Vpped
X`09  lines which weren't doing anything if the screen didn't display at
X`09  least two lines, and final position of `5EB, which wasn't going to the
X`09  top of screen (basic.c)
X
XChanges for vile 5.3 (released Tue May 09, 1995)
X(pgf)
X`09+ implemented "watchinput" arg for the poll code in catnap().
X`09  (random.c)
X
X`09+ fixed the definition of VDISABLE to attempt to use _POSIX_\2208
X`09  before using our own value. (termio.c)
X
X`09+ cleaned up path lookup (flook()) code, and the code that tries
X`09  to find our executable.  previously, we didn't know where the
X`09  executable was until someone used the ":version" command.  and,
X`09  we assumed that argv`5B0`5D could always be used to find us.  but
X`09  if argv`5B0`5D contains no slash chars, we can make no assumption
X`09  about where we came from.  there are still some problems in here,
X`09  because i think we sometimes try to run access() on things that
X`09  aren't quite pathnames yet.  (bind.c epath.h estruct.h main.c
X`09  path.c proto.h version.c)
X
X`09+ correct behavior of forwline()/goto\0B06 so that we get an error
X`09  if we try to go to a line beyond the end of the buffer.  (basic.c)
X
X`09+ don't check for '`5Cr' on empty lines when counting doslines. (file.c)
X
X`09+ fix ".bak" style backups when the filename is of form ".foo".  now
X`09  change this to ".foo.bak" rather than just ".bak".  (UNIX only)
X`09  (fileio.c)
X
X`09+ added TI/TE and KS/KE processing to tcapk`7Bopen,close`7D.  i don't
X`09  know that this is always right, but it fixes an xterm arrow key
X`09  bug in some cases.
X
X`09+ removed TI/TE part of above change.  it's not always right.  the
X`09  terminal open/close code needs serious examination.  sigh.
X
X`09+ removed broken ULTRIX ifdef in x11.c, which tried to support
X`09  KEY_Remove.  it was broken.  i _could_ make it work, but i
X`09  don't know what i'd bind it to.  (x11.c)
X
X`09+ fixed "arrow key during insert" bug introduced in 5.2, which
X`09  prevented arrow from moving beyond EOL when inserting.  (basic.c)
X
X`09+ vile will now warn and insist on ":q!" if not all edited buffers
X`09  are visited during the edit session (i.e. some are still
X`09  "unread").  this is for vi compatibility, since some people use
X`09  "ZZ:n" when moving through their files, and vile was quitting
X`09  after the ZZ.  (the routine anycb() has been renamed
X`09  any_changed_buf() as well.)  (main.c, buffer.c)
X
X`09+ a new mode, "warn-unread", which will suppress the above behavior
X`09  if it is turned off.  (modetbl, main.c)
X
X`09+ implemented "visual-matches" mode, which allows one to highlight
X`09  all matching occurrences of a search string when doing \1B08.`20
X`09  that is, if i search for "foo", then all occurrences of "foo" in
X`09  the buffer will be highlighted (as specified by the value of
X`09  "visual-matches").  i did not allow for color -- only bold,
X`09  italics, underline, and reverse are supported.  this can be
X`09  added in the future, i suppose.  (modetbl, modes.c, main.c,
X`09  search.c, undo.c, estruct.h, vile.hlp)
X
X`09+ added command to clear visual-matches:  "clear-\180E",
X`09  bound to '=' by default. (cmdtbl, search.c)
X
X`09+ added concept of "ownership" to attributes, so that, for example,
X`09  search-string attributes can be cleared independently of selection
X`09  attributes or ctl-A sequence\1D0B.  (select.c, search.c,
X`09  estruct.h, display.c)
X
X`09+ added/changed text in README.CFG which describes what to do
X`09  when configure or the make doesn't work.  (README.CFG)
X
X`09+ reset the action of VDSUSP char under POSIX.  (termio.c)
X
X`09+ applied patch from rick sladkey, for borland.c fixups and djgpp
X`09  compilation:
X
X`09    Part 1: borand.c enhancement and bug fixes
X`09    + enhance borland.c so that scrolling regions are used
X`09      efficiently
X
X`09    + enhance borland.c so that individual characters are buffered
X`09      which makes certain conio packages much faster (e.g the DJGPP
X`09      one)
X
X`09    + enhance borland.c to handle PC-style function keys (e.g.  F1,
X`09      F2, PageUp)
X
X`09    + make the cursor-toggling code in borland.c, generic, optional
X`09      and turned off by default since a big blinking block is
X`09      horribly ugly
X
X`09    + fix the color handling in display.c so that the broken and
X`09      unusable garbf kludge in bor?color\0D07land.c is no longer
X`09      needed
X
X`09    + fix erase to end of page in borland.c so it actually works
X
X`09    + enhance the mode detection in borland.c so that the screen
X`09      mode does not need to be changed in the default case (i.e.`20
X`09      when using the current mode)
X
X`09    + prevent borland.c from clearing the screen on exit so it is
X`09      like vile on every other display device (i.e it goes to the
X`09      lower left instead)
X
X`09    Part 2: misc bug fixes affecting the MS-DOS versions
X
X`09    + change the default msdos slash character to '/' instead of
X`09      '`5C`5C' because typing tab (for completion) after backslash
X`09      inserts a `5EI instead which makes completion under MS-DOS much
X`09      less useful and fairly annoying
X
X`09    + fixed a null pointer dererencing bug in main.c which occurs
X`09      when the vile.rc file is being edited but it does not exist
X`09      yet
X
X`09    + enhanced makefile.djg so that either ibmpc.c or borland.c can
X`09      be used and so that borland.c is\1E06by default
X
X`09    + fixed a bug in path.c that caused the first slash after a
X`09      drive letter not to be canonicalized properly (e.g.`20
X`09      C:`5CFOO`5CBAR => c:`5Cfoo/bar)
X
X`09    + fixed a bug in path.c affecting DJGPP that caused relative
X`09      pathnames containing an explicit\2109 to be corrupted
X`09      (e.g.  C:FOO => ../:/foo) by deleting incorrect code whose
X`09      intention is solved by the previous fix
X
X`09    + omit a conflicting prototype for delay which I don't know who
X`09      needs but it can't be used as is on all platforms
X
X`09    + fixed a fairly serious bug in file.c that causes the file
X`09      size to be computed incorrectly at startup on dos-mode files
X`09      which caused an explicit write of an unmodified buffer to
X`09      append garbage to the file because the size was overstated by
X`09      the number of returns in the file which have already been
X`09      deleted but not yet subtracted from the count
X
X`09+ further changes to make rick's \1708work okay under watcom.
X`09  the DOS path-deliter is now selectable, with "set slash-char".`20
X`09  (edef.h, estruct.h, file.c\0806c\0908io.c, glob.c, input.c,
X`09  modes.c, modetbl, path.c, proto.h, random.c, vile.hlp)
X
X`09+ added in patch from Russ Herman which fixes kbhit() problem with
X`09  function keys in OS/2.  (borland.c)
X
X`09+ eliminate FAIL macro in regexp.c, since it saves very little,
X`09  and is hard to write correctly without _someone's_ compiler or
X`09  lint complaining about it.  (regexp.c)
X
X`09+ fix infinite loop caused by null search patterns (e.g. ".*" or
X`09  "`5E".  (estruct.h, search.c)
X
X`09+ got rid of vestigial "tungetc()" code.  (input.c, proto.h, edef.h)
X
X`09+ fix (quickly) the broken @a-in-a-macro problem. (map.c)
X
X`09+ added ifdef'ed code which allows logging all keystrokes to
X`09  a tempfile, which can help when trying to recreate rare bugs.
X`09  (map.c)
X
X`09+ modify regstrncmp to take use system s\1B07when possible.
X`09  (regexp.c)
X
X`09+ made "fence" characters (i.e `7B,`7D.(,),`5B,`5D) configurable by
X`09  user (new mode, "fence-pairs"), so that < and > can be added
X`09  easily (i hear this is useful for html editing).  (fences.c,
X`09  insert.c, main.c, modes\0908tbl, proto.h, vile.hlp)
X
X`09+ added patch from anthony shipman, to keep X11 selections from
X`09  starting unless at more than one char is swept.  (x11.c)
X
X`09+ added a binary search to engl2fnc, but it's not quite right.  i
X`09  was in a hurry.  it's ifdefed.  (bind.c, externs.c)
X
X`09+ minor efficiencies in regstrncmp and\0F07chr.  (regexp.c)
X
X`09+ interrupted() is now a macro again, when appropriate.  this
X`09  speeds up simple searches to run something like 10% faster.
X`09  (main.c, edef.h, estruct.h, proto.h)
X
X`09+ fix cosmetic message bug when 'q' command is ended immediately
X`09  with another 'q'.  (select.c)
X
X`09+ fix forwchar() to work as advertised.  from a user's point
X`09  of view, it now skips the newline if no arg is given, so it
X`09  can move across lines.  this meant some places where it was
X`09  called with default args internally had to be changed.`20
X`09  (basic.c, word.c)
X
X`09+ force an update() in reposition(), so that "redraw-display"
X`09  can be used in a macro to force an incremental screen update.
X
X`09+ fix typo in cmdtbl.
X
X`09+ created pictmode.rc, a primitive "mode" which assists in
X`09  drawing ascii "art".  not that i've used it much yet...
X
X`09+ changed cbuf`5B2`5D in replacechar() to\1C06NLINE`5D.  apparently
X`09  the length arg that is supposed to prevent overruns doesn't
X`09  work, if you do a command like "replace-char %keywas", i.e.
X`09  use a variable to provide the response. (insert.c)
X
X`09+ added ISO-8859 characters and punctuation to ispunct() etc.
X`09  classes in charinit().  i assume this is "right".  (main.c)
X
X`09+ applied patches from Lee Johnson (71310.405@compuserve.com) for
X`09  support of OS/2 from the IBM C Set ++ Compiler (2.x).  changes
X`09  mostly to pipe support, directory access, and file completion.
X`09  new makefile (\0A08.icc), new screen (os2vio.c), and new pipe
X`09  routines (os2pipe.c).  (borland.c, buffer.c, dirstuff.h,
X`09  display.c, edef.h, estruct.h, file.c, filec\0908io.c, glob.c,
X`09  makefile.in, mktbls.c, modes.c, npopen.c, path.c, proto.h,
X`09  random.c, spawn.c, termio.c, version.c)
X
X`09+ fixed --with-cflags option to configure script (\1209.in,
X`09  configure)
X
X`09+ add another mention of ctrl-button functions, in the \1906
X`09  section of help file.
X
X(tom)
X`09+ modified configuration scripts to conform to autoconf 2.2
X`09  (aclocal.m4, configure\0B0B.in, dirstuff.h).
X
X`09+ modified select.c to recover from manfile error that produces
X`09  empty attribute-region (select.c).
X
X`09+ removed "#error" for SunOS's K+R compiler (line.c).
X
X`09+ modified to make OPT_MAP_MEMORY and SMALLER configurations compile
X`09  (cmdtbl, display.c, search.c
X
X`09+ modified tmp.c to use calloc on page/chunks to appease Purify.
X
X`09+ added auxiliary programs to lint-rules (makefile.in).
X
X`09+ use void-casts for strcmp, lsprintf, etc., (lots of places), and
X`09  FALLTHROUGH comments for SunOS and IRIX lint (display.c, main.c,
X`09  oneliner.c, wordmov.c)
X
X`09+ removed redundant ';' after FAIL() macros that causes IRIX lint
X`09  warnings in (regexp.c).
X
X`09+ mods for miscellaneous lint (csrch.c, exec.c, fil\0906insert.c,
X`09  main.c, modes.c, proto.h, region.c, tcap.c).
X
X`09+ added stdarg.h to configure.in test so ANSI_VARARGS will work.
X
X`09+ modified lint ifdef's for ANSI_VARARGS <stdarg.h> case, tested
X`09  with IRIX lint (estruct.h).
X
X`09+ added configuration tests for 'errno', 'time_t', 'off_t'
X`09  (configure.in, aclocal.m4).
X
X`09+ split-out neproto.h (from nefunc.h); cleanup gcc's -Wnested-externs
X`09  and -Wredundant-decls warnings (mktbls.c, estruct.h, proto.h, etc.)
X
X`09+ use IRIX lint to find/modify functions that can be made static
X`09  (proto.h and several modules...)
X
X`09+ corrected logic in makefuncdesc() and fnc2kcod() that caused vile to
X`09  ignore the user-defined key bindings (bind.c).
X
X`09+ modified mlreply_file() to handle the `5ER!shell-command case (filec.c)
X
X`09+ corrected ifdef that broke 'slash-char' mode when compiling
X`09  SMALLER (main.c, modes.c).
X
X`09+ modified wildcard-expansion for VMS to handle comma-separated lists,
X`09  and /readonly option.
X
X`09+ corrected tab offset in 'vtputc()' so that linewrap displays properly
X`09  with various tab sizes (display.c).
X
X`09+ added ifdef to use MAXPATHLEN if it is defined in <sys/param.h>
X`09  (estruct.h).
X
X`09+ adapted code by kev to resolve directory names which may contain
X`09  embedded symbolic links (path.c, configure.in).
X
X(kev)`09
X`09+ display.c (l_to_vcol): Make sure that we don't try to examine
X`09  characters which are past the end of the line.  Also compute
X`09  non-varying parts of the loop condition in advance for efficiency.
X
X`09+ configure.in: Don't use grep to pick out -D lines since some
X`09  versions of grep limit the number of characters which are output.
X
X`09+ search.c (attrib_matches): Start DOT out at the head of the buffer
X`09  to attribute matches for instead of at the first line.  This will
X`09  cause the first character in the buffer to be highlighted if
X`09  deserving.
X
X`09+ search.c (attrib_matches): Added new code for \2406uting with
X`09  color.
X
X`09+ modes.c (fsm_mono_attributes): Added color to this list.  Hmm...
X`09  "color" doesn't seem to be a "mono" attribute, does it?
X
X
XChanges for vile 5.2 (released Thu Feb 23, 1995)
X(pgf)
X`09+ added vile-c-filt to the man page.  (vile.1)
X
X`09+ remove root cause of"C<right-arrow>c" core dump -- no longer
X`09  allow an extra amount of right-motion just 'cuz we're in insert
X`09  mode.  whatever the reason for this extra was, it doesn't seem
X`09  to be necessary anymore.  recoded remaining conditions for
X`09  clarity.  (basic.c)
X
X(kev)
X`09+ estruct.h (OPT_COLOR): Don't define in terms of DISP_X11.  This
X`09  fixes the ":set all" core dump.  OPT_COLOR indicates that the
X`09  older (line-by-line) color mechanisms should be used.  These
X`09  mechanisms are stubbed in x11.c, but are not implemented (and
X`09  probably won't be).  My recent change to NCOLORS (for DISP_X11)
X`09  made some OPT_COLOR ifdef'd code in modes.c break (there are only
X`09  eight entries in the cname array but there are now sixteen
X`09  colors.) So rather than put NCOLORS back to 8, it seemed more
X`09  expedient to simply disable all of the OPT_COLOR code which xvile
X`09  was never able to make use of anyway.  We should also probably
X`09  take the OPT_COLOR related ifdefs and stubs out of x11.c.
X
X`09  (VIDEO_ATTR): Make sure that this is typedef'd to be a short
X`09  when DISP_X11 is defined.
X
X(tom)
X`09+ corrected core dump when user types "C<right-arrow>c" (line.c).
X
X`09+ change "defined(sun)" to "SYS_SUNOS".  (finderr.c)
X`09 `20
XChanges for vile 5.1 (released Tue Feb 21, 1995)
X(pgf)
X`09+ fix longstanding bug when keyboard macro is executed while
X`09  it is being recorded.  (input.c)
X
X`09+ fixed broken beginDisplay/endof\0D07 nesting in xterm-mouse
X`09  code, which caused lockups after a resize operation. (tcap.c)
X
X`09+ fixed misspelled ifdef which caused filename truncation when using
X`09  "tilde style" backups.  (fileio.c)
X
X`09+ changed "X11" to "DISP_X11" in vmsbuild.com and descrip.mms.
X
X`09+ fixed OPT_REVSTA ifdefs so modeline reverse-video can be turned
X`09  off.  (display.c)
X`09 `20
X`09+ trimline() can be called with DOT.o == llength(lp), for instance
X`09  if a macro calls "end-of-line" followed by "append-string" where
X`09  the string starts with a CR.  trimline() was trimming (or not,
X`09  didn't matter), and then backing DOT.o up to the last char on the
X`09  line.  the CR would then break the line, instead of appending to
X`09  it.  this is probably a problem in other functions as well, if
X`09  called from a macro, since we don't do the "DOT.o can't sit on
X`09  the newline" hack while executing macros.  (region.c)
X
X`09+ replaced contents of c-filt.c with x\0E07.  it seems to be a
X`09  full superset of its functionality.  it is now installed along
X`09  with manfilt, as vile-c-filt.  the help file now talks more about
X`09  it.  (c-filt.c, makefile.in)
X
+-+-+-+-+-+-+-+-  END  OF PART 26 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 27 -+-+-+-+-+-+-+-+
X`09+ documented the color.`5Bfb`5Dcolor`5B1-16`5D subresources. (vile.hlp)
X
X`09+ included the c-filt.flx code contributed by alistair crooks in
X`09  the distribution.  (c-filt.flx, makefile.in)
X
X`09+ changed the "built" names of manfilt and c-filt to vile-\1B07
X`09  and vile-c-filt, to match their installed names, and \2408
X`09  the documentation. (makefile.in)
X
X`09+ changed the new color resources to be `7Bf,b`7Dcolor`5B1-9,10-15`5D,
X`09  rather than A-F as before. (x11.c)
X
X`09+ turned off IBM_VIDEO for linux.  it's not necessarily true. `20
X`09  turned on OPT_COLOR for linux and DISP_TERMCAP, which is what we
X`09  were trying to imply with the above anyway.  (estruct.h)
X(kev)
X`09+ patchlev.h (PATCHLEVEL): Updated to "c".
X
X`09+ x11.c (update_scrollbar_sizes -- NO_WIDGETS version):
X`09  Restructured loop which allocates new scrollbars and grips
X`09  somewhat.  In addition to no longer creating one more grip than
X`09  necessary, we also explicitly check to see which grips need to be
X`09  created.
X
X`09+ x11.c (check_scrollbar_allocs): Allocate the same number of grips as
X`09  scrollbars.  We don't actually need this many, but allocation in this
X`09  manner caused some subtle allocation problems with GROW().  \0906 was
X`09  being called as follows:
X`09  `09GROW(cur_win->grips, Widget, oldmax-1, newmax-1);
X`09  When cur_win->grips is initially allocated,\2712
X`09  NULL, oldmax is 0, and new\1107cur_win->rows/2.  Note then that
X`09  -1 is being passed as the third parameter to GROW().  This causes
X`09  newmax elements (rather than\1D07-1\1F0A-- the number of
X`09  elements allocated) to be zero'd near the end of the grow macro.
X
X`09  The other piece of code affected (adversely) by this allocation is
X`09  in update_scrollbar_sizes() where new \1C09s and grips are
X`09  created.  It turns out that one more grip than necessary is \3C08
X`09  Under certain conditions, the GROW macro would zero out this extra
X`09  grip.  When reinvoked, update_scrollbar_sizes() would assume that
X`09  this extra grip had been created and not bother to re\1C06 it.
X
X  `09+ patchlev.h (PATCHLEVEL): Updated to "a".
X
X`09`5B Note: The following changes constitute the merge of Jukka Keto's
X`09  changes for color support to xvile.  Thanks Jukka! `5D
X
X`09+ estruct.h (OPT_COLOR): Define in terms of DISP_X11, not X11.
X
X`09  (NCOLORS): Conditionally define this to be 16 instead of 8.
X
X`09  (VAFGCOL, VABGCOL): Removed.
X`09 `20
X`09  (VACOLOR, VCOLORNUM\0B08ATTR): New defines.
X
X`09+ select.c (attribute_cntl_a_sequences): Color support.
X
X`09+ x-filt.c: New file.  This is Jukka's syntax coloring filter for C
X`09  programs.  I modified it slightly to compile clean under gcc with
X`09  Tom's favorite warning flags: -Wall -Wshadow -Wconversion
X`09  -Wstrict-prototypes -Wmissing\150B.  Also fixed a problem
X`09  with "'".  It also no longer requires an ansi compiler.  Note: It
X`09  should probably be merged with c-filt.  A command line switch to
X`09  `5Bxc`5D-filt could be used to indicate whether monochrome or color
X`09  should be used.
X
X`09+ x11.c (struct _text_win): New fields colors_fgc,\0C08bgc,
X`09  colors_fg, and\0F08bg.
X
X`09+ (Xt`7BN,C`7D`7Bf,F,b,B`7Dcolor`7B0-9,A-F`7D i.e, XtNfcolor0,...): New
X`09  resource defines.  Kind of ugly to have to declare all of
X`09  these like this, but that seems to be the way its done.
X
X`09  (color_resources): Structure which defines the color sub\3109.
X
X`09  (x_preparse_args): Get the color subresources and initialize
X`09  the color GCs.
X
X`09  (x_setfont): Set new font for all of the color GCs.
X
X`09  (flush_line): Handle color attributes.  Also check for the
X`09  most common (default) attribute first for efficiency.
X`09 `20
X(tom)
X`09+ corrected end-of-line problem with autoindent that broke 'append-string'
V
X`09  (insert.c).
X
X`09+ turn off 'access()' function for DEC C on a VAX as per bug report
X`09  by amish@data.uchicago.edu (estruct.h).
X
X`09+ added arrow-key definitions for VAX (vmsvt.c).
X
X`09+ corrected treatment of underlining in termcap driver (tcap.c).
X
X`09+ implemented termcap-based colors (tcap.c).
X
XChanges for vile 5.0 (released Fri Feb 10, 1995)
X(pgf)
X`09+ rearranged ifdefs leading to OPT_WORKING def'n for clarity.
X`09  (estruct.h)
X
X`09+ a couple of the new scratch buffer names were too long.  (edef.h)
X
X`09+ added commands for undoing system maps ("unmap-\1406-chars")
X`09  and abbreviations ("un\1209e").  (map.c, cmdtbl,
X`09  vile.hlp, proto.h)
X
X`09+ NetBSD, FreeBSD, etc. all seem to define the termcap "kD" attribute
X`09  as DEL.  i consider this questionable, since they also produce
X`09  DEL from the Backspace key, but in any case, it means we shouldn't
X`09  define a system map for the DEL key.  we should really have separate
X`09  system maps for insert and command modes, but i think that might be
X`09  overly complicated.  so instead, i suppress the mapping of an ASCII
X`09  DEL to anything else (at the system level -- the user can still do
X`09  whatever they want.)  (tcap.c)
X
X`09+ renamed our signal() wrapper to setup_handler(), and always use it.
X`09  on systems with sigaction(), use it in place of calling signal() to
X`09  ensure system calls are restartable.  setup_handler() is now in
X`09  main.c, moved from termio.c (buglist, display.c, file.c, m\3906
X`09  proto.h, spawn.c, termio.c, x11\0707simp.c)
X
X`09+ use test for restartable reads on pipes rather than stock
X`09  restartable system call test, when trying to configure OPT_WORKING.
X`09  OSF/1 3.0 has restartable system calls, but reads (and writes) on
X`09  pipes will return EINTR regardless of SA_RESTART state.  they
X`09  call this a feature, based on the POSIX spec.  i haven't been
X`09  able to check.  (if you link against -lsys5 on OSF/1, you _can_
X`09  turn on OPT_WORKING.  but they claim that may be a bug, and
X`09  a "libsys5.a" may exist on other system, so i'm not going to
X`09  trust or use it.) (aclocal.m4, configure\0B0B.in, estruct.h)
X
X`09+ pasted characters now have the NOREMAP bit set, to prevent map
X`09  expansion of pasted text. (x11.c, estruct.h)
X
X`09+ changed token parsing to no longer treat `5EL and `5EM (i.e. formfeed
X`09  and carriage return) as whitespace.  this fix is mostly for :map,
X`09  so that carriage returns can appear in the lhs and at the start
X`09  of the rhs, but it should also allow those characters in other
X`09  response contexts as well.  (exec.c)
X
X`09+ implemented "flow-control-enable" command, which re\1A07s
X`09  software flow control for those users who still need it.  not all
X`09  implementations (posix/sgtty/termio) were disabling it in the
X`09  first place -- i'm surprised selections worked there (they may
X`09  not have.) (termio.c, cmdtbl, proto.h, vile.hlp)
X
X`09+ protect against infinite recursion when attempting to print
X`09  0x80000000 as a signed integer.  (display.c)
X
X`09+ changed file completion buffer to show the full prefix of the
X`09  thing that's being completed (patch from jukka keto). (bind.c)
X
X`09+ added jukka keto's c-filt.c program to the distribution. (\2708,
X`09  makefile.in)
X
X`09+ changed HAS_ALARM define to HAVE\1506, and let it be autoconf'ed.
X`09  (estruct.h, configure.in\0E0B)
X
X`09+ added code in ffgetline(), which is where pipes are read, to
X`09  check for EINTR from a SIGALRM and redo the read() if we're
X`09  on a system where the read() isn't restartable. this lets
X`09  us turn on working on all system that have alarm(). THEN, i
X`09  backed this change out with ifdefs, since i think some old
X`09  kernels can lose data if they get a signal during a
X`09  read().  (fileio.c, display,c, estruct.h, edef.h)
X
X`09+ put start of child process status reporting in system_SHELL().
X`09  ifdef'ed it out, since the WIFSIGNALED etc. macros probably
X`09  aren't on all systems, and i don't want to break this release.
X`09  (npopen.c)
X
X`09+ introduce checks for SCO systems, which are probably not so odd
X`09  when compared with their peers, it's just that th\1C09 have
X`09  all gone away.  (configure.in, \0E09, termio.c, estruct.h)
X
X`09+ fix globbing in root directory (i.e. ":e /j*k" now gets "/junk"),
X`09  and move DOS check for this same thing ("c:auto*.bat") slightly.
X`09  ensure what we don't end up with doubled or trailing slashes
X`09  ("//foo", "/foo/") anywhere, since DOS won't open those or stat
X`09  them properly.  (glob.c)
X
X`09+ fixed benign wp/curwp mixup in l_to_vcol().  (display.c)
X
X`09+ change expression for lint. (map.c)
X
X`09+ move ifdef for ANSI_QSORT into estruct.h, so it can be used in
X`09  proto.h as well as glob.c (\1B07,\1107, estruct.h)
X
X`09+ added a couple of SIZE_T casts to keep "new ansi semantics" warnings
X`09  at bay.  (file.c, history.c)
X
X`09+ fixed some typos in the vile.hlp, added a version number, to
X`09  correspond to the version it's distributed with.
X
X`09+ change name of __MAXINT to not have __ on front, add cast to (int).
X`09  (display.c)
X
X`09+ changed the FL_PATH search order to look in the table first.  this
X`09  a) seems more correct, and b) will help ensure that the new helpfile
X`09  location (/usr/local/lib) will be checked before the old (which was
X`09  /usr/local/bin).  took\170F out of the internal table.
X`09  i have more changes pending for this area, having to do with bugs
X`09  in how we determine where the executable came from.  but i'll hold
X`09  them until next release.  (bind.c, epath.h)
X
X`09+ added note about old helpfiles to README and \0B06.CFG.
X
X`09+ added some more reminders for myself to the release_warnings
X`09  target. (makefile.in)
X
X`09+ created patchlev.h file.  include and use it it in version.c.
X
X`09+ added missing range checks to EXACTLY case of regrepeat() to
X`09  prevent going off end of line when matching 'cc*' on a line
X`09  that ends in 'c'. (regexp.c)
X
X`09+ fixed ifdefs for signal_pg(), to negate pid when killing a pgrp
X`09  with kill().  (estruct.h)
X
X`09+ moved setting of new process group out of x_open(), and into a
X`09  command, which can be used in a .vilerc if someone needs it.  it
X`09  seemed like the cases we were trying to catch\1506bugs in other
X`09  programs (shells and window managers).  this seems like the most
X`09  flexible approach, at least until i understand the problems a little
X`09  better.  (x11.c, main.c, cmdtbl, vile.hlp, proto.h)
X
X`09+ simplified, and moved non_filename() to version.c, so it can more
X`09  easily use the PATCHLEVEL string.  (proto.h, version.c, path.c)
X`09`20
X`09+ changed PATCHLEVEL from a char constant to a string, for more
X`09  flexibility in naming patches.  duh.  (version.c,\1C06lev.h)
X
X`09+ added GNU General Public License to distribution, as required by
X`09  configure/\0A09.in.  (makefile.in, COPYING)
X
X`09+ tweaked/updated copyrights, added some vile specific caveats and
X`09  info to the COPYING file.
X
X`09+ reenabled '!' expansion in shell commands.  more vi's than not
X`09  seem to do it.  (input.c)
X
X`09+ arrange to check the X event queue when doing updates() during
X`09  a pipe read.  we were only checking in x_working() before, which
X`09  isn't called if "set noworking" or OPT_WORKING == FALSE. (proto.h,
X`09  x11.c, file.c)
X
X(tom)
X`09+ modified column shown by ruler to be the actual cursor \2E06, rather
X`09  than the effective column (display.c).
X
X`09+ made vms sys$/lib$ calls consistent (uppercase) to simplify greps
X`09  (path.c, random.c, termio.c, vms2unix\0C07pipe\1707vt.c).
X
X`09+ changed input-buffer size and error checks for vms to avoid
X`09  data overrun problems (termio.c).
X
X`09+ corrected glob-expansion for environment-variables, e.g., $FOO
X`09  (glob.c).
X
X`09+ updated tests for memory leaks (bind.c, map.c).
X
X`09+ corrected glob-expansion of msdos pathnames that use '/' (glob.c).
X
X`09+ corrected bug that prevented '!' from being inserted into shell
X`09  commands without being escaped (input.c).
X
X`09+ added command 'append-string' for symmetry with 'insert\2208
X`09  (insert.c, cmdtbl).
X
X`09+ modified vax scripts to compile on AXP hardware under OpenVMS
X`09  (descrip.mms, display.c, vms_link.opt, vmsbuild.com, vmsshare.opt)
X
X`09+ corrected shadowing of 'stat' in npopen.c
X
X`09+ added version.o: patchlev.h dependency to all makefiles.
X`09  (descrip.mms makefile.djg\0D0Atbc\1A0Awat\0D0Bnt)
X
X(kev)
X`09+ main.c (newprocessgroup): Changed XHAVE_SETSID to \0F0B.
X`09  Added HAVE_BSD_SETPGRP ifdef which is necessary due to the fact
X`09  that setpgrp on BSD systems requires two arguments.
X
X`09+ x11.c (scroll_selection): Sign extend row and col.  It's possible
X`09  to sign extend in fewer lines of code if we make certain
X`09  assumptions about the widths of ints, shorts, and longs.  Not as
X`09  portable though.
X
X`09  (extend_selection): Add scrolling timeout _after_ updating the
X`09  display.
X
X`09+ vile.hlp: did a lot of tweaking/rewording/correcting.
X
X`09+ display.c (l_to_vcol): Use wp->w_dot instead of DOT.  DOT uses
X`09  curwp which is not what we want here.  This problem was causing
X`09  core dumps when I got into xvile and did the following:
X
X`09  `09:help
X`09`09/fmt
X
X`09+ x11.c (x_change_focus): Do not attempt to give ourselves focus
X`09  when focusFollowsMouse is true and we enter the window.  Also,
X`09  don't rely on the receipt of FocusIn/FocusOut events for deciding
X`09  whether or not to show the cursor.
X
X`09  (x_preparse_args): Set the XtNinput resource to TRUE in the
X`09  call to XtVaAppInitialize() instead of in a separate\3508
X`09  XtVaSetValues(). `5BThis is how Volume 4 in the O'Reilly series
X`09  recommends doing it`5D.
X
X`09  (x_wm_delwin): Removed the unused WM_TAKE_FOCUS stuff from this
X`09  function.
X
X`09  (grip_moved): Removed superfluous "#if MOTIF_WIDGETS" / "#endif"
X`09  pair.
X
X`09  (scroll_selection): Cleaned up decoding of row and col.
X
X`09  (x_preparse_args): Took out WM_TAKE_FOCUS stuff.
X
XThis change log started on Wed Jan 11, 1995.
$ call unpack [.VILE-8_0]CHANGES.R5;1 -
 475118519 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 169 17 152
$!
$ create 'f'
XChanges for vile 7.0 (released Fri Feb 28, 1997)
X
X(tom)`09970228
X`09+ corrected OS/2 pipe problem, by closing dup'd file descriptors
X`09  (os2pipe.c).
X`09+ correct special IRIX 5.x -lsocket test, from 6.5c
X`09+ correct logic for VILE_STARTUP_FILE (main.c).
X`09+ correct a couple of uses of const (main.c, file.c).
X
X(pgf)`09970227 (e)
X`09+ fixed the mail sending in imdying.  i think it's been trying
X`09  to run the command "on host" for a long time now.  in addition
X`09  to simply fixing the command, and the printf arguments (which were
X`09  also broken), it now runs sendmail if it can find it, since
X`09  /bin/mail is not a reliable delivery agent anymore.  (file.c)
X
X(tom)`09970227 (d)
X`09+ ifdef'd function-key change to x11.c from 6.4d (reported by Graeme
X`09  Miller).
X`09+ add environment-variables VILE_HELP_FILE,\1006STARTU\1306 and
X`09  VILE_STARTUP_PATH to allow user to override default configuration.
X`09  (suggested by Andy Harper <A.HARPER@kcl.ac.uk>).
X`09+ correct unused build-definition HELP_LOC from changes in 6.4c by
X`09  prepending it to $startup-path on initialization.
X
X(tom)`09970226 (c)
X`09+ fix additional nits for ffwopen() (reported by Graeme Miller and
X`09  Andy Harper).
X`09+ add workaround in configure script for users with Solaris 2.5.1 and
X`09  gcc configured for 2.4 or 2.5, due to gcc not shadowing term.h
X`09  (reported by Andy Harper <A.HARPER@kcl.ac.uk>, but my ISP has the
X`09  same problem)
X
X(tom)`09970221 (b)
X`09+ modify ffwopen() fix from 6.4a to work with DEC C (reported by Graeme
X`09  Miller <G.R.M.Miller@open.ac.uk>).
X
X(kev)`09970220 (a)
X`09+ x11.c (x_getc): Don't advance DOT after paste when in insert mode.
X`09  If we do, it goes too far.  Thanks to Philippe Chassany for finding
X`09  this one.
X
XChanges for vile 6.5 (released Mon Feb 17, 1997)
X
X(tom)`09970210 (j)
X`09+ correct bracketing of shell-command buffer names from 6.4g (reported
X`09  by Paul Fox).
X`09+ modify filename completion to allow\140Cof "." and ".." as
X`09  non-directory leaves.
X`09+ fix some places (not all!) for gcc -Wcast-qual -Wwrite-strings
X`09+ some compiler nits for Visual C/C++ 4.0 on WinNT.
X
X(kev)`09970129 (i)
X`09+ x11.c (start_selection): Make sure that prevDOT is set to the DOT
X`09  in the window where the click occurs.
X`09  (x_process_event): In the Button3 "\0906Press" code, set prevDOT
X`09  to DOT in order to sensibly handle the situation wher\1406user
X`09  first marks the beginning of a selection by pressing Button1 and
X`09  then releasing it (without wiping) and\2706uses Button3 to mark
X`09  the end of the selection.  In this case, DOT will be left at the
X`09  location of the initial Button1 press.
X
X(tom)`09970125 (h)
X`09+ add limit-check to getcol(), in case mark.o is out-of-bounds.
X`09+ correct an indexing out-of-bounds in 'attribute_cntl_a_sequences()'
X`09  that Purify reported.
X`09+ add configure options for development (trace, dbmalloc, no-leaks).
X
X(tom)`09970119 (g)
X`09+ modify logic that forms buffer names so\1B06shell commands will
X`09  be bracketed, thus avoiding an ambiguity.  This was reported by
X`09  pgf; he used `5EX-e to open a file in the buffer list that was
X`09  a shell command.  Putting the cursor on the first '!' picks up
X`09  the remainder of the line as the shell command, which is wrong.
X`09+ apply fix from pgf for better description of `5EA-d in vile.hlp.`20
X
X(kev)`09970120 (f)
X`09+ x11.c (x_getc): Advance DOT by one after a paste so that default
X`09  position for newly pasted text is *after* the\1406just\2507.
X
X(kev)`09970120 (e)
X`09+ x11.c: Added resource controlling whether DOT is reset after making
X`09  a selection.  Also added/extended code for implementing this.
X`09+ vile.hlp (selectionSetsDOT): Documented this X resource.
X
X(tom)`09970119 (d)
X`09+ Restrict xvile's modifier + mouse-2 behavior to check only the shift
X`09  modifier (my system sets one of the modmap flags on all mouse
X`09  clicks).
X`09+ modify select/paste behavior in xvile so that the default pastes text
X`09  at the last cursor (or mouse-click) position before selecting
X`09  (requested by Jukka Keto <jketo@sasu1.carelian.fi>)
X`09+ reset MK in set_curwp(), to avoid letting xvile cause DOT and MK
X`09  point to different buffers, which breaks getregion().  This happened
X`09  when the focusFollowsMouse resource was set (reported by Ralphe Neill
X`09  <ran@dgs.monash.edu.au>)
X`09+ add check for infinite loop in multimotion() (i.e., the 'q' command)
X`09  that might arise from xvile's switching the value of DOT in response
X`09  to mouse motion.  The loop happened because MK is a global rather
X`09  than per-window.
X`09+ check return values from getregion() in sel_extend().
X`09+ change default binding of KEY_F11 to execute-macro-11, for
X`09  consistency (does anyone have a keyboard w/o <esc>?).
X`09+ add bindings for KEY_F21 through\100635 and corresponding logic to
X`09  x11.c and tcap.c (from a request by Abraham V.  George
X`09  <ageorge@ERC.MsState.Edu>), so that xvile `26 vile can recognize these
X`09  codes.  If they're not in a default binding, the KEY_Fxx aren't
X`09  defined.  Note that vile's are bound to 8-bit codes, so they're of
X`09  limited usefulness.
X`09+ modify mktbls to allow 8-bit codes in nefkeys.h
X`09+ corrected some places where WINMARK wasn't ifdef'd consistently,
X`09  as part of testing that configuration.
X
X(tom)`09970109 (c)
X`09+ eliminate epath.h by variables $startup-file and\120Apath.
X`09+ disable SIGHUP during normal quit/exit to workaround spurious "vile
X`09  died" message when I've spawned vile in an xterm from another process
X`09  (e.g., ded) on SunOS 4.x (this happens when doing :q! from vile with
X`09  a modified buffer).
X`09+ modify "print-prefixed-lines-til" command to print the buffer name
X`09  rather than filename, thus allowing any buffer except `5Bp-lines`5D to be
V
X`09  indexed.
X`09+ modify configure.in so that nsl and socket libraries aren't tested
X`09  on IRIX 5.x, since those don't work with X11R5.
X
X(kev)`09970108 (b)
X`09+ configure.in: Added back in the tests for the nsl and socket
X`09  libraries which seem to be necessary in order for configure
X`09  to work cleanly on Solaris 2.5 with X11R6.
X
X(tom)`09970103 (a)
X`09+ correct an off-by-one in kbd_erase() that resulted in display
X`09  glitch in filename completion when the prompt-text was a very long
X`09  filename (bind.c).
X`09+ modify ffwopen() on VMS to propagate existing file permissions when
X`09  creating a new version of an existing file (requested by Robert J
X`09  Wright R.\0906@curtin.edu.au)
X
XChanges for vile 6.4 (released Sun Dec 22, 1996)
X
X(tom)`09961216 (c)
X`09+ correction to infinite-loop fix in 6.3b
X`09+ add $helpfile symbol, initialized to "vile.hlp".
X
X(tom)`09961208 (b)
X`09+ added "print-prefixed-lines-til" command to print into `5Bp\2406`5D
X`09  while prefixing the lines with filename and line-number.
X`09+ work-around Linux bug that causes 'getchar()' to return incorrect
X`09  value after an interrupt, so inserts of `5EC would be garbled (input.c).
V
X`09+ guard against infinite loop which resulted from reverse search on
X`09  "$", resulting from 6.2a fixes (search.c).
X`09+ implement colored attributes in termcap driver (tcap.c)
X`09+ correct typo in cache-variable for VC_TYPE_OUTCHAR macro
X`09+ test with autoconf 2.12 (no change needed).
X
X(tom)`09961122 (a)
X`09+ modify handling of xterm mouse-click in insert mode to allow it
X`09  unless the click would move the cursor out of\1208rent window
X`09  (requested by David McCoy).
X
XChanges for vile 6.3 (released Mon Nov 18, 1996)
X
X(tom)`09961117 (g)
X`09+ moved xvile's translation strings out of fallback resources, since
X`09  these are ignored when a resource file is installed (e.g., in
X`09  $HOME/XVile or /usr/lib/X11/app-defaults\2306), causing the
X`09  scrollbars to become unworkable.
X`09+ use 'newprocessgroup()' rather than 'fork()' for xvile -fork.
X`09+ correct threshold in updpos() so that when list mode is set, a `5EJ
X`09  in the last screen column (e.g., 80) will be visible.
X`09+ correct limits for whitespace-removal in 'inspound()' that caused
X`09  lines to join when inserting a '#' after typing `5ED in an open-line
X`09  command (reported by Emil Rojas).
X`09+ modify so that '`7E' is not escaped when echoing previous value for a
X`09  string unless it was used in the special case of\3108replacement.`20
X
X(tom)`09961113 (f)
X`09+ clarified special-character expansion in vile.hlp (Paul Fox).
X`09+ add alias to xvile for "-t" option to prevent it from superceding the
X`09  normal vile "-t" option (x11.c).
X`09+ added resources for xvile pointer shapes (x11.c) requested by Tim Su
X`09  <tsu@garage.lucent.com>.
X`09+ added -fork command-line option to xvile, to fork process after
X`09  initialization (main.c, version.c, x11.c) requested by Richard
X`09  Mitchell <m\0A07@osb1.wff.nasa.gov>.
X`09+ added error handler so that xvile prints usage message if command
X`09  line parsing or Xt initialization fails (x11.c).
X`09+ add ifdef to file.c to accommodate missing extern for 'environ' in
X`09  djgpp 2.x (patch by Jerry Alexandratos).
X
X(tom)`09961107 (e)
X`09+ correct symbol conflict with shared library on OpenVMS 7.0 by
X`09  renaming opendir, etc., and tempnam.  Also, remove redundant rule for
X`09  vms_link.opt from descrip.mms (from logs by Sheldon E. Smith
X`09  <ssmith@galina.ENET.dec.com>).
X`09+ correct sign-extension in ntconio.c that prevented display of 8-bit
X`09  characters (fix by Even Holen <evenh@pvv.ntnu.no>).
X`09+ fix compiler warnings in borland.c (from logs by Jerry Alexandratos
X`09  <alexandr@hawk.pearson.udel.edu>).
X`09+ correction to logic for "`7Eendif", macros weren't re-enabled after
X`09  exiting an `7Eif/`7Eendif (fix by Ian Jamison <ianj@quadrics.com>).
X
X(tom)`09961105 (d)
X`09+ apply Brendan O'Dea's <bod@tyndall.com.au> followup patch to ensure
X`09  that "#", "%" and ":" substitions aren't made in search/replacement
X`09  inputs.
X
X(pgf)`09961030 (c)
X`09+ apply brendan o'dea's patch to implement use of `7E in a replacement
X`09  pattern, to expand to the previous replacement.  this patch also
X`09  turns off the longstanding behavior of supplying the previous
X`09  replacement pattern as the default response to the "\340B
X`09  string: "  prompt.  i added a paragraph in the help file.  (estruct.h
X`09  input.c main.c oneliner.c search.c)
X
X(tom)`09961022 (b)
X`09+ modify 'showpat()' to show at least one highlighted space even if the
X`09  pattern is null, e.g., a '$' matching the end of line (oneliner.c).
X`09+ implement $forward-search variable (modetbl, eval.c).
X`09+ corrected "`5E$" pattern-matching broken in 6.2a (search.c).
X
X(tom)`09961019 (a)
X`09+ corrected logic of `7Eelse/`7Eelseif broken in 6.1a (exec.c), reported by
V
X`09  Timothy Phan <tphan@asl.dl.nec.com>.
X`09+ use new type IFSTK to combine if-stacking variables to clarify their
X`09  relationship (exec.c).
X`09+ modified macro trace to make if simpler to understand (exec.c).
X`09+ corrected boundary condition that prevented match of "`5C>" on the end
X`09  of line in search commands (\1106.c).
X`09+ corrected handling of command line arguments with similar buffer
X`09  names by prohibiting match against buffer\2A07(main.c, file.c).
X`09+ corrected translation of '`5C`5C' in special case where it preceded a
X`09  potential metachar, causing search for "`5C`5C>" to fail (regexp.c),
X`09  reported by Emil Rojas.
X`09+ corrected wrap-around case in tags lookup where there was only one
X`09  match; using next-tag would report that there was no such tag
X`09  (tags.c).
X`09+ implement regular-expressions in cheap_buffer_scan(), making it work
X`09  with trailing "`5C>" emitted by ctags -N option (tags.c) repor\2506
X`09  Emil Rojas <erojas@divi.com>.
X`09+ add double-checks in swbuffer() and related logic to recover in case
X`09  $buffer-hook frees the current \1E06 (\2606.c), reported by
X`09  Sean Ahern <ahern@sphere.llnl.gov>.
X
XChanges for vile 6.2 (released Tue Oct 15, 1996)
X
X(tom)`09961006 (d)
X`09+ correct filling of blanks for non-bce terminals, so the \3008is
X`09  used only for color terminals (tcap.c).
X
X(kev)`09961004 (c)
X`09+ x11.c (update_scrollbar_sizes):  Make sure that grips are
X`09  managed properly when multiple windows are created at
X`09  startup.  Fixes David Snyder's "xvile -h" bug where it was
X`09  not possible to resize the two windows by grabbing the
X`09  resize grips.
X
X(tom)`09961004 (b)
X`09+ rename 'refresh()' to 'vile_\140A, 'filter\200D\1309,
X`09  to avoid naming-conflict when including <curses.h> to support terminfo
X`09  driver.
X`09+ correct missing assignment for scanpt from 6.1a (exec.c).
X`09+ correct sign-extension problem in setup_dobuf() from 6.1a (exec.c)
X`09+ added (write-only!) $cryptkey variable (eval.c).
X`09+ don't attempt to set encryption on temporary buffers unless global
X`09  'crypt' mode is set (buffer.c).
X`09+ correct logic that reset local 'crypt' mode w/o restoring it, preventing
V
X`09  user from reading encrypted files (file.c)
X`09+ modify so that OPT_CRYPT and OPT_WORDCOUNT are normally configured.
X`09+ modify termcap driver to conditionally compile for terminfo libraries
X`09  so that if vile is built on a system such as Solaris that provides
X`09  termcap compatibility via terminfo, the color support will work.
X`09+ modify configure script to check for terminfo libraries.
X`09+ modify termcap driver so that if "op" (original pair) is defined,
X`09  fcolor and b\0B06default to "\0C07", for better compatibilty
X`09  with color_xterm and dtterm (tcap.c).
X`09+ modify termcap driver to use "ut" capability to denote whether
X`09  background-color-erase (bce) is supported (tcap.c).
X
X(tom)`09960920 (a)
X`09+ allow continuation-lines in macros, denoted by a backslash at the
X`09  end of the line.
X`09+ add new directive "`7Eelseif" (exec.c)
X`09+ restructured dobuf() using new function 'begin_directive()', fixing a
X`09  place where 'execstr' was modified w/o saving old value (exec.c)
X`09+ add new function 'no_such_\1208()' (bind.c, etc.)
X`09+ modified debug-trace in msg_putc() to work around Linux's printf
X`09  which calls strlen on all string arguments (msgs.c).
X`09+ modified to not use "#elif", since HP/UX K`26R compiler doesn't handle
X`09  this (termio.c).
X
XChanges for vile 6.1 (released Tue Sep 10, 1996)
X
X(pgf)`09960910
X`09+ added text to README and vile.hlp regarding possibility of
X`09  tom's taking over the source tree.  not completely firmed
X`09  up yet, but likely.  thanks tom!!!!
X
X(tom)`09960903 (d)
X`09+ adapted patch by Larry Schwimmer's (schwim@cyclone.stanford.edu)
X`09  for configure.in
X
X`09+ modify configure script to ensure that cached information is used
X`09  only on the system/version that was used to extract the data.
X
X`09+ remove (and correct rules for generating) vms_link.opt, vmsshare.opt
X
X(pgf)`09960812 (c)
X`09+ removed const from dirnam`5B`5D buffer in imdying. \300Aast
X`09  to (char *) which prevented any compiler in the world from
+-+-+-+-+-+-+-+-  END  OF PART 27 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 28 -+-+-+-+-+-+-+-+
X`09  showing us this error.  grrr.  i hope no one else loses
X`09  work because of this one.  (file.c)
X
X`09+ fix minor warning from extern'd prototype in buffer.c.
X
X`09+ removed vile.man production rule from makefile.in.
X
X`09+ applied changes from martin zinser (m.\0A06@gsi.de) for VMS
X`09  builds -- mostly casts, and some changes to the vms build scripts.
X
X(jrs)`09960809 (b)
X`09+ on NT reset the console input mode after a shell escape to fix
X`09  the problem reported by paul with `5EC.  (ntconio.c)
X
X`09+ fixed a file corrupting bug caused by reading in a <CR><LF> file
X`09  which contained lines longer than 255 characters by accounting
X`09  for the possible fall-through of fastreadf into slow\0F08 that
X`09  case.  (file.c)
X
X`09+ don't reset the keyboard when simply writing a file since it
X`09  causes an annoying screen flash with the new NT\1D08buffer
X`09  handling.  (file.c)
X
X`09+ some minor changes to prevent us accessing (not even dereferencing)
X`09  dangling pointers.  (buffer.c, file.c, itbuff.c, \0909path.c,
X`09  search.c)
X
X`09+ fix leak of the minibuffer window structure.  (\1406.c)`20
X
X`09+ make sure ttgetc returns something on all platforms, even if
X`09  it isn't used.  (termio.c)
X
X`09+ make nthandler return a value (in case it ever gets called :-).
X`09  (ntconio.c)
X
X(pgf)`09960717 (a)
X`09+ applied rick's changes for proper operation in an NT command
X`09  window with scrollbars.  (ntconio.c)
X
X`09+ add target for formatting the man page, so a readable version
X`09  can go in the pc zip distributions.  (makefile.in)
X
X`09+ don't run the readhook for is_temporary() buffers.  (file.c)
X
X`09+ fix usage message. (version.c)
X
XThis change log started on Friday Jun 28, 1996.
$ call unpack [.VILE-8_0]CHANGES.R6;1 -
 1630785959 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 33 18 152
$!
$ create 'f'
X/*
X * Prototypes for functions in the mode-tables (must be declared before the
X * point at which proto.h is included).
X *
X * $Header: /usr/build/vile/vile/RCS/chgdfunc.h,v 1.4 1996/02/05 02:19:21 pgf
V Exp $
X */
Xextern int chgd_autobuf  (CHGD_ARGS);
Xextern int chgd_buffer   (CHGD_ARGS);
Xextern int chgd_charset  (CHGD_ARGS);
X#if OPT_COLOR
Xextern int chgd_color    (CHGD_ARGS);
X#endif
Xextern int chgd_disabled (CHGD_ARGS);
Xextern int chgd_fences   (CHGD_ARGS);
Xextern int chgd_major    (CHGD_ARGS);
Xextern int chgd_major_w  (CHGD_ARGS);
Xextern int chgd_status   (CHGD_ARGS);
Xextern int chgd_window   (CHGD_ARGS);
Xextern int chgd_working  (CHGD_ARGS);
Xextern int chgd_xterm    (CHGD_ARGS);
Xextern int chgd_hilite   (CHGD_ARGS);
X
$ call unpack [.VILE-8_0]CHGDFUNC.H;1 -
 1865085866 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 2 19 152
$!
$ create 'f'
X# This file contains all of the editor's command and key linkages.
X# It also contains data for tables which are automatically generated in the
X# editor.
X#
X# It should be processed by the "mktbls" program, which produces the
X#  headers #included by main.c
X#
X# All that is necessary to add a new function to the editor is \2706
X#  an entry to this file, write the function, make sure it's in the
X#  makefile, and rebuild.  (This is not to be confused with adding a
X#  new key binding, which can be done with the rebind command if it
X#  was compiled in.)
X#
X# If you want to know which keyboard bindings are already taken, look
X#  at nebind.h, after you build it.
X#
X# The entries are functions within the editor.  They _must_ match the
X#  functions' names.  On the same line as the name i\0C06set of flags
X#  describing that function.
X# Also accompanying each function is a list of english names  for the`20
X#  command, in double quotes, and a list of keys bound to the \3B08
X#  in single quotes.  These are the default key bindings -- they can change
X#  at runtime.  English names must be all lowercase.
X# Any function, name, or key may be followed by a conditional, i.e. the
X#  name of a preprocessor #define which must be \1506d non-zero for that
X#  line to become part of the editor.  If a function name is made conditional,
V
X#  the names and keys listed with it will be conditional also.
X# The names and keys must be preceded by a tab character.
X# Blank lines must be completely empty.
X# For convenience only, this table is kept in roughly alphabetical order,`20
X#  by first character of function name.
X#
X# For example, consider the following entry:
X#
X# `09somefunc`09ABSM`7CMOTION`09`09BSD`7CDOS
X#`09`09"funkycom"
X#`09`09'`5EX-F'
X#`09`09'FN-2'&0209&0209DOS
X#`09`09'M-s'
X#
X# As a special case, if a function key definition ('FN-A') is followed
X# by a conditional beginning with "KEY_", like:
X#`09`09'FN-A'&0209&0209KEY_Up
X# then that name is output to nefkeys.h as a SPEC`7Cx definition, for use
X# by the screen/keyboard drivers.  The key is also bound, as usual, and
X# is made conditional on the _third_ field\1508line.  (Since KEY_xxx
X# definitions are meant to be pretty generic, there should be little
X# need for conditional build-time binding.)
X#
X# This says that somefunc() is an absolute motion command,\2F06it should
X#  only be included in the editor if we're running BSD or DOS, that its
X#  english name as one would type on the command line is "funkycom", and
X#  that it is bound to `5EX-F, to function key 2 under DOS, a\2A06"meta-s",
X#  that is, an 's' with the high bit set.
X#
X# Function flags have the following meanings:
X#`09REDO means the dotcmd command recorder should be halted, so that
X#`09`09the command can be redone.
X#`09UNDO means the undo stacks should be cleared, in preparation for
X#`09`09an undoable command.
X#`09OPER means the command is an "operator", that is, it acts on a region
X#`09`09demarcated by the current cursor position and \2007sor`20
X#`09`09position following a subsequent motion command.
X#`09MOTION means this command moves dot, and specifically \2706patible
X#`09`09with the operator commands.
X#`09FL only occurs with MOTION, means that if the motion is an argument
X#`09`09to an operator, the\0E07ion should affect Full Lines
X#`09ABSM only occurs with MOTION, means that the motion is absolute,
X#`09`09i.e. not relative to the current position or screen.  It causes
X#`09`09the "lastdotmark", ldmark to be set to dot before the move
X#`09`09takes place.
X#`09GOAL signifies a motion that will attempt to retain the`20
X#`09`09current column position after the motion.
X#`09GLOBOK says the function can follow a global command
X#`09`09(e.g. the 'd' in "g/pattern/d")
X#
X#`09This file was designed and constructed by Paul Fox for vile, (c)1990
X#
X#`09The flags given in parentheses are "ex"\2406, related to what
X#`09`09kind of line-range arguments the command can take.  Not all are
X#`09`09currently used or implemented, but they were defined in the
X#`09`09command table for the Steve Kirkendall's elvis editor, so I
X#`09`09included them here for completeness.
X#`09BANG says the command (in real vi) can take a trailing ! character,
X#`09`09and will behave differently.  In vile, most such commands
X#`09`09have separate entries, e.g. quit and quithard and \2D08
X#`09`09functions which are executed.  in some cases this is very
X#`09`09impractical, as is the case with w and w!  -- so, if a command
X#`09`09is entered ending with a '!' (it must be in this table by
X#`09`09that name) _and_ the BANG flag is set for that command, then
X#`09`09the function will be invoked with "special" values for f and
X#`09`09n (i.e. values unlikely to be typed) so the function can
X#`09`09distinguish the two cases.
X#`09`09If the BANG flag appears, and there is no command-name ending
X#`09`09in '!' listed, then the flag does nothing, and should be
X#`09`09viewed simply as documentation.
X#
X# $Header: /usr/build/vile/vile/RCS/cmdtbl,v 1.158 1998/04/29 00:02:53 tom Exp
V $
X#
X#
X
Xabbrev`09`09NONE`7C(EXRCOK`7CEXTRA)
X`09"abbreviate"
X`09"show-abbreviations"
X`09<establish shorthand for another string, or show all abbreviations>
Xaltbuff`09`09NONE
X`09"alternate-buffer"`09`09!FEWNAMES
X`09'`5E`5E'
X`09<switch to previous buffer>
Xappend`09`09REDO`7CUNDO
X`09"append-chars"`09`09`09!FEWNAMES
X`09'a'
X`09<insert (CNT copies of) text after the cursor>
Xappstring`09REDO`7CUNDO`09`09!SMALLER
X`09"append-string"
X`09<append the given string after the cursor>
Xappendeol`09REDO`7CUNDO
X`09"append-chars-at-eol"`09`09!FEWNAMES
X`09'A'
X`09<insert (CNT copies of) text after the end of line>
Xbackchar`09MOTION
X`09"backward-character"`09`09!FEWNAMES
X`09<move CNT characters left, wrapping to previous line>
Xbackchar_to_bol`09MOTION
X`09"backward-character-to-bol"`09!FEWNAMES
X`09"left-arrow"
X`09'h'
X`09'`5EH'
X`09'`5E?'
X`09'FN-D'`09`09&0209KEY_Left
X`09<move CNT characters left, stopping at beginning of line>
Xbackdelchar`09REDO`7CUNDO
X`09"delete-previous-character"`09!FEWNAMES
X`09'X'
X`09<delete CNT characters to the left>
Xbackhunt`09ABSM`7CMOTION`09`09!SMALLER
X`09"hunt-backward"
X`09<search backward for previously entered pattern>
Xbackhpage`09MOTION
X`09"previous-half-page"`09`09!FEWNAMES
X`09"back-half-page"`09`09!FEWNAMES
X`09"up-half-page"`09`09`09!FEWNAMES
X`09'`5EU'
X`09<move up CNT half screens>
Xbackline`09GOAL`7CMOTION`7CFL
X`09"previous-line"`09`09`09!FEWNAMES
X`09"back-line"`09`09`09!FEWNAMES
X`09"up-line"`09`09`09!FEWNAMES
X`09"up-arrow"`09`09`09!FEWNAMES
X`09'k'
X`09'`5EP'
X`09'FN-A'`09`09&0209KEY_Up
X`09<move up CNT lines>
Xbackbline`09MOTION`7CFL
X`09"previous-line-at-bol"`09`09!FEWNAMES
X`09"back-line-at-bol"`09`09!FEWNAMES
X`09"up-line-at-bol"`09`09!FEWNAMES
X`09'-'
X`09<move up CNT lines, to first non-white character>
Xbackpage`09MOTION
X`09"previous-page"`09`09`09!FEWNAMES
X`09"back-page"`09`09`09!FEWNAMES
X`09'`5EB'
X`09'FN-p'`09`09&0209KEY_Prior
X`09<move up CNT full screens>
Xbackword`09MOTION
X`09"previous-word"`09`09`09!FEWNAMES
X`09"back-word"`09`09`09!FEWNAMES
X`09'B'
X#`09'FN-`5C163'`09`09`09IBM_KBD
X`09<move left by CNT `5C"big`5C" words>
Xbackviword`09MOTION
X`09"previous-punctuated-word"`09!FEWNAMES
X`09"back-punctuated-word"`09`09!FEWNAMES
X`09'b'
X`09<move left by CNT `5C"small`5C" words>
Xbacksearch`09ABSM`7CMOTION
X`09"search-reverse"`09`09!FEWNAMES
X`09'?'
X`09<search backwards for fresh pattern>
Xbcsrch`09`09MOTION
X`09"backward-char-scan"`09`09!FEWNAMES
X`09'F'
X`09<scan left on the line for the given character>
Xbcsrch_to`09MOTION
X`09"backward-char-scan-to"`09`09!FEWNAMES
X`09'T'
X`09<scan left on the line up to but not including the given character>
Xbindkey`09`09NONE&0209`09OPT_REBIND
X`09"bind-key"
X`09"rebind-key"
X`09<bind a keystroke to a function>
Xbktoshell`09NONE`7C(BANG)`09`09OPT_SHELL
X`09"suspend"
X`09"suspend!"
X`09"stop"
X`09"stop!"
X`09'`5EZ'
X`09<suspend the editor>
Xcbrdcpy_unnamed NONE `09`09`09SYS_WINNT
X`09"copy-unnamed-reg-to-clipboard"
X`09'FN-`5C255'`09`09`09KEY_F33
X`09<copies the unnamed register selection to the windows clipboard>`20
Xcbrdpaste REDO`7CUNDO`09`09`09SYS_WINNT
X`09"paste-from-clipboard"
X`09'FN-`5C257'`09`09`09KEY_F35
X`09<paste the windows clipboard contents>`20
Xcd`09`09NONE&0209`09OPT_SHELL
X`09"cd"
X`09"change-directory"
X`09<move to a new directory, `5C"-`5C" is previous, `5C"`7E\1306$HOME>
Xcntl_x_func`09NONE
X`09"cntl_x-prefix"
X`09'`5EX'
X`09<the `5C"Control-X`5C" prefix, used when typing extended commands>
Xchgchar`09`09REDO`7CUNDO
X`09"change-char"`09`09`09!FEWNAMES
X`09"delete-char-and-insert-chars"`09!FEWNAMES
X`09's'
X`09<insert text to replace CNT characters>
Xchgline`09`09REDO`7CUNDO
X`09"change-line"`09`09`09!FEWNAMES
X`09"delete-line-and-insert-chars"`09!FEWNAMES
X`09'S'
X`09<insert text to replace the current line>
Xchgtoeol`09REDO`7CUNDO
X`09"change-to-eol"`09`09`09!FEWNAMES
X`09"delete-to-eol-and-insert-chars" !FEWNAMES
X`09'C'
X`09<insert text to replace the rest of the line>
Xclear_match_attrs`09NONE`09`09OPT_HILITEMATCH
X`09"clear-visual-matches"
X`09'='
X`09<clear highlighting caused by searches when `5C"visual-matches`5C" is set>
V
Xclrmes`09`09NONE
X`09"clear-message-line"`09`09!FEWNAMES
X`09<erase text on the bottom line of screen>
Xcomp_err_exps`09NONE`09`09`09OPT_FINDERR
X`09"compile-error-expressions"
X`09<(re)compile the `5BError Expressions`5D buffer>
Xconsearch`09ABSM`7CMOTION
X`09"continue-search"`09`09!FEWNAMES
X`09'n'
X`09<search for previous pattern in same direction as before>
Xwordcount`09RANGE`09`09`09OPT_WORDCOUNT
X`09"count-words"
X`09<count words, lines, and chars in the region>
Xopercbrdcpy`09NONE `09`09`09SYS_WINNT
X`09"copy-to-clipboard"
X`09'FN-`5C256'`09`09`09KEY_F34
X`09<copies the specified region to the windows clipboard>`20
Xopercopy`09OPER`7C(RANGE`7CEXTRA)
X`09"copy-til"
X`09"c"
X`09<copy text in the region>
Xopercrypt`09OPER`7CREDO`7CUNDO`7CGLOBOK`7C(RANGE)`09OPT_ENCRYPT
X`09"crypt-til"
X`09'`5EX-C'
X`09<encrypt/decrypt text in the region>
Xkbd_mac_begin`09NONE
X`09"begin-keyboard-macro"`09`09!FEWNAMES
X`09'`5EX-('
X`09<begin recording a macro of keystrokes>
Xkbd_mac_end`09NONE
X`09"end-keyboard-macro"`09`09!FEWNAMES
X`09'`5EX-)'
X`09<end recording a macro of keystrokes>
Xkbd_mac_exec`09REDO`7CUNDO`7CVIEWOK
X`09"execute-keyboard-macro"`09!FEWNAMES
X`09'`5EX-`26'
X`09<execute a previously recorded macro of keystrokes>
Xkbd_mac_save`09NONE
X`09"save-keyboard-macro"
X`09'`5EX-`5E'
X`09<save a previously recorded macro of keystrokes to a named register>
Xcbuf1`09`09REDO&0209`09OPT_EXEC_MACROS>0
X`09"execute-macro-1"`09`09!FEWNAMES
X`09'FN-1'`09`09&0209KEY_F1
X`09'FN-P'`09`09&0209KEY_KP_F1
X`09<execute `5BMacro 1`5D>
Xcbuf2`09`09REDO&0209`09OPT_EXEC_MACROS>1
X`09"execute-macro-2"`09`09!FEWNAMES
X`09'FN-2'`09`09&0209KEY_F2
X`09'FN-Q'`09`09&0209KEY_KP_F2
X`09<execute `5BMacro 2`5D>
Xcbuf3`09`09REDO&0209`09OPT_EXEC_MACROS>2
X`09"execute-macro-3"`09`09!FEWNAMES
X`09'FN-3'`09`09&0209KEY_F3
X`09'FN-R'`09`09&0209KEY_KP_F3
X`09<execute `5BMacro 3`5D>
Xcbuf4`09`09REDO&0209`09OPT_EXEC_MACROS>3
X`09"execute-macro-4"`09`09!FEWNAMES
X`09'FN-4'`09`09&0209KEY_F4
X`09'FN-S'`09`09&0209KEY_KP_F4
X`09<execute `5BMacro 4`5D>
Xcbuf5`09`09REDO&0209`09OPT_EXEC_MACROS>4
X`09"execute-macro-5"`09`09!FEWNAMES
X`09'FN-5'`09`09&0209KEY_F5
X`09<execute `5BMacro 5`5D>
Xcbuf6`09`09REDO&0209`09OPT_EXEC_MACROS>5
X`09"execute-macro-6"`09`09!FEWNAMES
X`09'FN-6'`09`09&0209KEY_F6
X`09<execute `5BMacro 6`5D>
Xcbuf7`09`09REDO&0209`09OPT_EXEC_MACROS>6
X`09"execute-macro-7"`09`09!FEWNAMES
X`09'FN-7'`09`09&0209KEY_F7
X`09<execute `5BMacro 7`5D>
Xcbuf8`09`09REDO&0209`09OPT_EXEC_MACROS>7
X`09"execute-macro-8"`09`09!FEWNAMES
X`09'FN-8'`09`09&0209KEY_F8
X`09<execute `5BMacro 8`5D>
Xcbuf9`09`09REDO&0209`09OPT_EXEC_MACROS>8
X`09"execute-macro-9"`09`09!FEWNAMES
X`09'FN-9'`09`09&0209KEY_F9
X`09<execute `5BMacro 9`5D>
Xcbuf10`09`09REDO&0209`09OPT_EXEC_MACROS>9
X`09'FN-0'`09`09&0209KEY_F10
X`09"execute-macro-10"`09`09!FEWNAMES
X`09<execute `5BMacro 10`5D>
Xcbuf11`09`09REDO&0209`09OPT_EXEC_MACROS>10
X`09"execute-macro-11"`09`09!FEWNAMES
X`09'FN-!'`09`09&0209KEY_F11
X`09<execute `5BMacro 11`5D>
Xcbuf12`09`09REDO&0209`09OPT_EXEC_MACROS>11
X`09'FN-@'`09`09&0209KEY_F12
X`09"execute-macro-12"`09`09!FEWNAMES
X`09<execute `5BMacro 12`5D>
Xcbuf13`09`09REDO&0209`09OPT_EXEC_MACROS>12
X`09'FN-#'`09`09&0209KEY_F13
X`09"execute-macro-13"`09`09!FEWNAMES
X`09<execute `5BMacro 13`5D>
Xcbuf14`09`09REDO&0209`09OPT_EXEC_MACROS>13
X`09'FN-$'`09`09&0209KEY_F14
X`09"execute-macro-14"`09`09!FEWNAMES
X`09<execute `5BMacro 14`5D>
Xcbuf15`09`09REDO&0209`09OPT_EXEC_MACROS>14
X`09'FN-%'`09`09&0209KEY_F15
X`09"execute-macro-15"`09`09!FEWNAMES
X`09<execute `5BMacro 15`5D>
Xcbuf16`09`09REDO&0209`09OPT_EXEC_MACROS>15
X`09'FN-`5E'`09`09&0209KEY_F16
X`09"execute-macro-16"`09`09!FEWNAMES
X`09<execute `5BMacro 16`5D>
Xcbuf17`09`09REDO&0209`09OPT_EXEC_MACROS>16
X`09'FN-`26'`09`09&0209KEY_F17
X`09"execute-macro-17"`09`09!FEWNAMES
X`09<execute `5BMacro 17`5D>
Xcbuf18`09`09REDO&0209`09OPT_EXEC_MACROS>17
X`09'FN-*'`09`09&0209KEY_F18
X`09"execute-macro-18"`09`09!FEWNAMES
X`09<execute `5BMacro 18`5D>
Xcbuf19`09`09REDO&0209`09OPT_EXEC_MACROS>18
X`09'FN-('`09`09&0209KEY_F19
X`09"execute-macro-19"`09`09!FEWNAMES
X`09<execute `5BMacro 19`5D>
Xcbuf20`09`09REDO&0209`09OPT_EXEC_MACROS>19
X`09'FN-)'`09`09&0209KEY_F20
X`09"execute-macro-20"`09`09!FEWNAMES
X`09<execute `5BMacro 20`5D>
Xcbuf21`09`09REDO&0209`09OPT_EXEC_MACROS>20
X`09'FN-`5C241'`09`09`09KEY_F21
X`09"execute-macro-21"`09`09!FEWNAMES
X`09<execute `5BMacro 21`5D>
Xcbuf22`09`09REDO&0209`09OPT_EXEC_MACROS>21
X`09'FN-`5C242'`09`09`09KEY_F22
X`09"execute-macro-22"`09`09!FEWNAMES
X`09<execute `5BMacro 22`5D>
Xcbuf23`09`09REDO&0209`09OPT_EXEC_MACROS>22
X`09'FN-`5C243'`09`09`09KEY_F23
X`09"execute-macro-23"`09`09!FEWNAMES
X`09<execute `5BMacro 23`5D>
Xcbuf24`09`09REDO&0209`09OPT_EXEC_MACROS>23
X`09'FN-`5C244'`09`09`09KEY_F24
X`09"execute-macro-24"`09`09!FEWNAMES
X`09<execute `5BMacro 24`5D>
Xcbuf25`09`09REDO&0209`09OPT_EXEC_MACROS>24
X`09'FN-`5C245'`09`09`09KEY_F25
X`09"execute-macro-25"`09`09!FEWNAMES
X`09<execute `5BMacro 25`5D>
Xcbuf26`09`09REDO&0209`09OPT_EXEC_MACROS>25
X`09'FN-`5C246'`09`09`09KEY_F26
X`09"execute-macro-26"`09`09!FEWNAMES
X`09<execute `5BMacro 26`5D>
Xcbuf27`09`09REDO&0209`09OPT_EXEC_MACROS>26
X`09'FN-`5C247'`09`09`09KEY_F27
X`09"execute-macro-27"`09`09!FEWNAMES
X`09<execute `5BMacro 27`5D>
Xcbuf28`09`09REDO&0209`09OPT_EXEC_MACROS>27
X`09'FN-`5C250'`09`09`09KEY_F28
X`09"execute-macro-28"`09`09!FEWNAMES
X`09<execute `5BMacro 28`5D>
Xcbuf29`09`09REDO&0209`09OPT_EXEC_MACROS>28
X`09'FN-`5C251'`09`09`09KEY_F29
X`09"execute-macro-29"`09`09!FEWNAMES
X`09<execute `5BMacro 29`5D>
Xcbuf30`09`09REDO&0209`09OPT_EXEC_MACROS>29
X`09'FN-`5C252'`09`09`09KEY_F30
X`09"execute-macro-30"`09`09!FEWNAMES
X`09<execute `5BMacro 30`5D>
Xcbuf31`09`09REDO&0209`09OPT_EXEC_MACROS>30
X`09'FN-`5C253'`09`09`09KEY_F31
X`09"execute-macro-31"`09`09!FEWNAMES
X`09<execute `5BMacro 31`5D>
Xcbuf32`09`09REDO&0209`09OPT_EXEC_MACROS>31
X`09'FN-`5C254'`09`09`09KEY_F32
X`09"execute-macro-32"`09`09!FEWNAMES
X`09<execute `5BMacro 32`5D>
Xcbuf33`09`09REDO&0209`09(OPT_EXEC_MACROS>32`26`26(!SYS_WINNT))
X`09'FN-`5C255'`09`09`09KEY_F33
X`09"execute-macro-33"`09`09!FEWNAMES
X`09<execute `5BMacro 33`5D>
Xcbuf34`09`09REDO&0209`09(OPT_EXEC_MACROS>33`26`26(!SYS_WINNT))
X`09'FN-`5C256'`09`09`09KEY_F34
X`09"execute-macro-34"`09`09!FEWNAMES
X`09<execute `5BMacro 34`5D>
Xcbuf35`09`09REDO&0209`09(OPT_EXEC_MACROS>34`26`26(!SYS_WINNT))
X`09'FN-`5C257'`09`09`09KEY_F35
X`09"execute-macro-35"`09`09!FEWNAMES
X`09<execute `5BMacro 35`5D>
Xcbuf36`09`09REDO&0209`09OPT_EXEC_MACROS>35
X`09"execute-macro-36"`09`09!FEWNAMES
X`09<execute `5BMacro 36`5D>
Xcbuf37`09`09REDO&0209`09OPT_EXEC_MACROS>36
X`09"execute-macro-37"`09`09!FEWNAMES
X`09<execute `5BMacro 37`5D>
Xcbuf38`09`09REDO&0209`09OPT_EXEC_MACROS>37
X`09"execute-macro-38"`09`09!FEWNAMES
X`09<execute `5BMacro 38`5D>
Xcbuf39`09`09REDO&0209`09OPT_EXEC_MACROS>38
X`09"execute-macro-39"`09`09!FEWNAMES
X`09<execute `5BMacro 39`5D>
Xcbuf40`09`09REDO&0209`09OPT_EXEC_MACROS>39
X`09"execute-macro-40"`09`09!FEWNAMES
X`09<execute `5BMacro 40`5D>
Xdefine_mode`09NONE`09`09`09OPT_MAJORMODE
X`09"define-majormode"
X`09"define-mode"
X`09<define a major mode, i.e., a collection of buffe\2306s>
Xdefine_submode`09NONE`09`09`09OPT_MAJORMODE
X`09"define-submode"
X`09<define a submode within a major mode>
Xdelwind`09`09NONE
X`09"delete-window"`09`09`09!FEWNAMES
X`09'`5EK'
X`09'`5EX-0'
X`09<destroy the current window, unless it is the last one>
Xforceblank`09REDO`7CUNDO`09`09OPT_AEDIT
X`09"delete-blank-lines"`09`09!FEWNAMES
X`09"force-blank-lines"`09`09!FEWNAMES
X`09'`5EA-d'
X`09<delete blank lines (or force some if CNT specified)>
Xdelglobmode`09NONE
X`09"delete-global-mode"`09`09!FEWNAMES
X`09"setgno"
X`09"unsetg"
X`09"setno"
X`09"unset"
X`09<turn off the global value of a mode setting>
Xdellocmode`09NONE`7C(EXRCOK`7CEXTRA)
X`09"delete-mode"`09`09`09!FEWNAMES
X`09"setlno"
X`09"unsetl"
X`09<turn off the current buffer's local value of a mode setting>
Xdeltoeol`09REDO`7CUNDO
X`09"delete-to-eol"`09`09`09!FEWNAMES
X`09'D'
X`09<delete text from cursor to the end of line>
Xdesbind`09`09NONE&0209`09OPT_REBIND
X`09"list-commands"
X`09"describe-bindings"
X`09"show-commands"
X`09"show-bindings"
X`09<show a list of all commands>
Xdesmotions`09NONE`09`09`09OPT_REBIND
X`09"list-motions"
X`09"describe-motions"
X`09"show-motions"
X`09<show a list of all motion commands>
Xdesopers`09NONE`09`09`09OPT_REBIND
X`09"list-operators"
X`09"describe-operators"
X`09"show-operators"
X`09<show a list of all operator commands>
Xdesprint`09NONE`09`09`09OPT_SHOW_CTYPE
X`09"show-printable"
X`09<show the printable characters, with types>
Xdesapro`09`09NONE&0209`09OPT_REBIND
X`09"apropos"
X`09"list-commands-apropos-to"
X`09<look up command names containing a string>
Xdesfunc`09`09NONE&0209`09OPT_REBIND
X`09"describe-function"
X`09"show-function"
X`09<show a description and current bindings for a function>
Xdeskey`09`09NONE&0209`09OPT_REBIND
X`09"describe-key"
X`09<show the function bound to a given key>
Xdotcmdplay`09UNDO
X`09"repeat-last-cmd"`09`09!FEWNAMES
X`09'.'
X`09<repeat the last text-changing command>
Xex`09NONE`7C(BANG`7CFILE1)
X`09"ex"
X`09<entry point to the `5C"exile`5C" editor.  unimplemented>
Xexecbuf`09`09NONE&0209`09!SMALLER
X`09"execute-buffer"`09`09!FEWNAMES
X`09<run the given buffer as a script>
Xexecfile`09NONE`09`09`09!SMALLER
X`09"execute-file"`09`09`09!FEWNAMES
X`09"source"
X`09<run the given file as a script>
Xexechypercmd`09NONE`09`09`09OPT_HYPERTEXT`20
X`09"execute-hypertext-command"`09!FEWNAMES`20
X`09<run the hypertext command attached to the region under the cursor>`20
Xshowhypercmd`09NONE`09`09`09OPT_HYPERTEXT`20
X`09"show-hypertext-command"`09!FEWNAMES`20
X`09<show the hypertext command attached to the region under the cursor>`20
Xexeckreg`09REDO`7CUNDO`7CVIEWOK
X`09"execute-register"
X`09'@'
X`09<execute the keystroke macro stored in the given named register>
Xexecproc`09REDO`09`09`09OPT_PROCEDURES
X`09"execute-procedure"`09`09!FEWNAMES
X`09"run"
X`09<run the given named stored-procedure as a script>
Xenlargewind`09NONE
X`09"grow-window"`09`09`09!FEWNAMES
X`09'V'
X`09<increase the size of the current window by CNT lines>
Xesc_func`09NONE
X`09"abort-command"`09`09`09!FEWNAMES
X`09'`5E`5B'
X`09<the abort key, normally bound to ESC; it terminates lots of things>
Xflow_control_enable`09NONE`09`09SYS_UNIX
X`09"flow-control-enable"
X`09<enable software flow-control (disable with arg)>
Xfcsrch`09`09MOTION
X`09"forward-char-scan"`09`09!FEWNAMES
X`09'f'
X`09<scan right on the line for the given character>
Xfcsrch_to`09MOTION
X`09"forward-char-scan-up-to"`09!FEWNAMES
X`09't'
X`09<scan right on the line up to but not including the given character>
Xfilefind`09NONE`7C(BANG`7CFILE1`7CPLUS)
X`09"e"
X`09"E"
X`09"edit-file"`09`09`09!FEWNAMES
X`09"find-file"`09`09`09!FEWNAMES
X`09'`5EX-e'
X`09<bring given (or under-cursor) file or existing buffer into window>
Xfileread`09NONE
X`09"e!"
X`09"replace-with-file"`09`09!FEWNAMES
X`09<replace the contents of\1006urrent buffer with the given file>
Xfilename`09NONE`7C(NAMEDF)
X`09"change-file-name"`09`09!FEWNAMES
X`09"f"
X`09"file"
X`09"filename"
X`09<change the filename associated with the current buffer>
Xfilesave`09NONE`7CBANG`09`09!SMALLER
X`09"save-file"
X`09"save-file!"
X`09<save the contents of\1006urrent buffer to its associated filename>
Xfilewrite`09NONE`7CBANG
X`09"write-file"`09`09`09!FEWNAMES
X`09"write-file!"`09`09`09!FEWNAMES
X`09<write the entire contents of the current buffer to its filename>
Xvile_filter`09REDO`7CUNDO`09`09OPT_SHELL
X`09"`7C"
X`09"filter-buffer"`09`09`09!FEWNAMES
X`09<pipe the entire buffer through an external filter command>
Xfinderr`09`09NONE&0209`09OPT_FINDERR
X`09"find-next-error"`09`09!FEWNAMES
X`09'`5EX-`5EX'
X`09<move to the next `5C"error`5C" in the error-buffer>
Xfinderrbuf`09NONE`09`09`09OPT_FINDERR
X`09"find-next-error-buffer-name"
X`09"error-buffer"
X`09<set the name of the buffer used as the error-\1906>
Xfirstbuffer`09NONE
X`09"rewind"
X`09<go to first buffer in\0A08list.  (does nothing if `5C"auto\2F06`5C" set>
Xfirstnonwhite`09MOTION
X`09"first-nonwhite"`09`09!FEWNAMES
X`09'`5E'
X`09<move to the first non-whitespace character on line>
Xfisearch`09NONE`09`09`09OPT_ISRCH
X`09"incremental-search"`09`09!FEWNAMES
X`09'`5EX-S'
X`09<search forwards for a pattern entered character by\0D0A>
Xflipchar`09REDO`7CUNDO
X`09"flip-character"`09`09!FEWNAMES
X`09'`7E'
X`09<exchange upper and lowercase for the current character>
Xfnclabel`09NONE`09`09`09DISP_HP150
X`09"label-function-key"`09`09!FEWNAMES
X`09"label-fkey"
X`09<label the given function key>
Xforwdelchar`09REDO`7CUNDO
X`09"delete-next-character"`09`09!FEWNAMES
X`09'x'
X`09'FN-d'`09`09&0209KEY_Delete
X`09<delete CNT characters to the right>
Xforwhpage`09MOTION
X`09"forward-half-page"`09`09!FEWNAMES
X`09"next-half-page"`09`09!FEWNAMES
X`09"down-half-page"`09`09!FEWNAMES
X`09'`5ED'
X`09<move down CNT half screens>
Xforwchar`09MOTION
X`09"forward-character"`09`09!FEWNAMES
X`09"next-character"`09`09!FEWNAMES
X`09<move CNT characters right, wrapping to next line>
Xforwchar_to_eol`09MOTION
X`09"forward-character-to-eol"`09!FEWNAMES
X`09"next-character-to-eol"`09`09!FEWNAMES
X`09"right-arrow"
X`09' '
X`09'l'
X`09'FN-C'`09`09&0209KEY_Right
X`09<move CNT characters right, stopping at end of line>
Xforwpage`09MOTION
X`09"forward-page"`09`09`09!FEWNAMES
X`09"next-page"`09`09`09!FEWNAMES
X`09"down-page"`09`09`09!FEWNAMES
X`09'`5EF'
X`09'FN-n'`09`09&0209KEY_Next
X`09<move down CNT full screens>
Xforwline`09GOAL`7CMOTION`7CFL
X`09"forward-line"`09`09`09!FEWNAMES
X`09"next-line"`09`09`09!FEWNAMES
X`09"down-line"`09`09`09!FEWNAMES
X`09"down-arrow"`09`09`09!FEWNAMES
X`09'j'
X`09'`5EJ'
X`09'`5EN'
X`09'FN-B'`09`09&0209KEY_Down
X`09<move down CNT lines>
Xforwbline`09MOTION`7CFL
X`09"forward-line-at-bol"`09`09!FEWNAMES
X`09"next-line-at-bol"`09`09!FEWNAMES
X`09"down-line-at-bol"`09`09!FEWNAMES
X`09'+'
X`09'`5EM'
X`09<move down CNT lines, to first non-white character>
Xforwword`09MOTION
X`09"forward-word"`09`09`09!FEWNAMES
X`09"next-word"`09`09`09!FEWNAMES
X`09'W'
X#`09'FN-`5C164'`09`09`09IBM_KBD
X`09<move right by CNT `5C"big`5C" words>
Xforwviword`09MOTION
X`09"forward-punctuated-word"`09!FEWNAMES
X`09"next-punctuated-word"`09`09!FEWNAMES
X`09'w'
X`09<move right by CNT `5C"small`5C" words>
Xforwendw`09MOTION
X`09"forward-word-end"`09`09!FEWNAMES
X`09"next-word-end"`09`09`09!FEWNAMES
X`09'E'
X`09<move right to the end of CNT `5C"big`5C" words>
Xforwviendw`09MOTION
X`09"forward-punctuated-word-end"`09!FEWNAMES
X`09"next-punctuated-word-end"`09!FEWNAMES
X`09'e'
X`09<move right to the end of CNT `5C"small`5C" words>
Xforwhunt`09ABSM`7CMOTION`09`09!SMALLER
X`09"hunt-forward"`09`09`09!FEWNAMES
X`09<search forward for previously entered pattern>
Xforwsearch`09ABSM`7CMOTION
X`09"search-forward"`09`09!FEWNAMES
X`09'/'
X`09'FN-f'`09`09&0209KEY_Find
X`09<search forwards for fresh pattern>
Xmatchfence`09ABSM`7CMOTION`09`09OPT_CFENCE
X`09"goto-matching-fence"`09`09!FEWNAMES
X`09'%'
X`09<find partner for next (,),`5B,`5D,`7B,`7D,#if,#else,#endif,/*,*/>
Xmatchfenceback`09ABSM`7CMOTION`09`09OPT_CFENCE
X`09"goto-matching-fence-behind"`09!FEWNAMES
X`09'`5EX-%'
X`09<find partner for previous (,),`5B,`5D,`7B,`7D on line>
Xglobals`09`09NONE
X`09"oglobals"`09`09`09NEVER
X
X# the gotdotplus() function is mostly for internal use only, for the
X# stuttered operator commands, but it corresponds to the real vi '_'
X# command, so we give it a name, so it can be bound to if desired.
Xgodotplus`09MOTION`7CFL
X`09"whole-lines"
X`09<move CNT whole lines.  same as `5C"stuttering`5C" most operators>
X
X# this function is for internal use only, for ex commands
Xgomark`09`09MOTION`7CFL`7C(RANGE`7CZERO)
X
Xgotobop`09`09ABSM`7CMOTION
X`09"previous-paragraph"`09`09!FEWNAMES
X`09"back-paragraph"`09`09!FEWNAMES
X`09"up-paragraph"`09`09`09!FEWNAMES
X`09'`7B'
X`09<move to the start of a paragraph>
Xgotoeop`09`09ABSM`7CMOTION
X`09"forward-paragraph"`09`09!FEWNAMES
X`09"next-paragraph"`09`09!FEWNAMES
X`09"down-paragraph"`09`09!FEWNAMES
X`09'`7D'
X#`09'FN-`5C166'`09`09`09IBM_KBD
X`09<move to the end of a paragraph>
Xgotobob`09`09ABSM`7CMOTION&0209!SMALLER
X`09"beginning-of-file"`09`09!FEWNAMES
X`09"goto-beginning-of-file"`09!FEWNAMES
X`09'FN-H'`09`09&0209KEY_Home
X`09<move to the top of the buffer>
Xgotoeob`09`09ABSM`7CMOTION&0209!SMALLER
X`09"goto-end-of-file"`09`09!FEWNAMES
X`09"end-of-file"`09`09`09!FEWNAMES
X`09'FN-E'`09`09&0209KEY_End
X`09<move to the end of the buffer>
Xgotobol`09`09MOTION
X`09"goto-bol"`09`09`09!FEWNAMES
X`09"beginning-of-line"`09`09!FEWNAMES
X`09"bol"`09`09&0209!FEWNAMES
X`09'0'
X`09<move to the very beginning of the line>
Xgotoeol`09`09MOTION`7CGOAL
X`09"goto-eol"`09`09`09!FEWNAMES
X`09"end-of-line"`09`09`09!FEWNAMES
X`09"eol"`09`09&0209!FEWNAMES
X`09'$'
X`09<move to the very end of the line>
Xgotobos`09`09ABSM`7CMOTION`7CFL
X`09"goto-beginning-of-screen"`09!FEWNAMES
X`09"beginning-of-screen"`09`09!FEWNAMES
X`09'H'
X`09<move to the CNT'th line on the screen>
+-+-+-+-+-+-+-+-  END  OF PART 28 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 29 -+-+-+-+-+-+-+-+
Xgotomos`09`09ABSM`7CMOTION`7CFL
X`09"goto-middle-of-screen"`09`09!FEWNAMES
X`09"middle-of-screen"`09`09!FEWNAMES
X`09'M'
X`09<move to the line in the middle of the screen>
Xgotoeos`09`09ABSM`7CMOTION`7CFL
X`09"goto-end-of-screen"`09`09!FEWNAMES
X`09"end-of-screen"`09`09`09!FEWNAMES
X`09'L'
X`09<move to the CNT'th line from the bottom of the screen>
Xgotobosec`09ABSM`7CMOTION
X`09"previous-section"`09`09!FEWNAMES
X`09"back-section"`09`09`09!FEWNAMES
X`09"up-section"`09`09`09!FEWNAMES
X`09'`5B'
X`09<move to the previous start of a `5C"section`5C">
Xgotoeosec`09ABSM`7CMOTION
X`09"forward-section"`09`09!FEWNAMES
X`09"next-section"`09`09`09!FEWNAMES
X`09"down-section"`09`09`09!FEWNAMES
X`09'`5D'
X`09<move to the next start of a `5C"section`5C">
Xgotobosent`09ABSM`7CMOTION
X`09"previous-sentence"`09`09!FEWNAMES
X`09"back-sentence"`09`09`09!FEWNAMES
X`09"up-sentence"`09`09`09!FEWNAMES
X`09'('
X`09<move to the previous start of a `5C"sentence`5C">
Xgotoeosent`09ABSM`7CMOTION
X`09"forward-sentence"`09`09!FEWNAMES
X`09"next-sentence"`09`09`09!FEWNAMES
X`09"down-sentence"`09`09`09!FEWNAMES
X`09')'
X`09<move to the next start of a `5C"sentence`5C">
Xgototag`09`09NONE&0209`09OPT_TAGS
X`09"ta"
X`09"tag"
X`09"find-tag"`09`09`09!FEWNAMES
X`09'`5E`5D'
X`09<look up the given (or under-cursor) name as a `5C"tag`5C">
Xgotocol`09`09MOTION
X`09"goto-column"`09`09`09!FEWNAMES
X`09'`7C'
X`09<go to the CNT'th column on the line>
Xgotoline`09ABSM`7CMOTION`7CFL`7C(RANGE)
X`09"goto-line"`09`09`09!FEWNAMES
X`09'G'
X`09<go to the CNT'th line.  unspecified CNT means end of buffer>
X# golinenmmark and goexact\1208re special cases--`09
X# `09no ABSM even though they are absolute, since these are the commands
X#`09that use the last-dot-mark
Xgolinenmmark`09MOTION`7CFL
X`09"goto-named-mark"`09`09!FEWNAMES
X#  single quote -- can't use '''
X`09'`5C047'
X`09<move to line containing the mark, at first non-white character>
Xgoexactnmmark`09MOTION
X`09"goto-named-mark-exact"`09`09!FEWNAMES
X`09'`60'
X`09<move to the given mark>
Xgorectnmmark`09MOTION`7CRECT
X`09"goto-named-mark-rectangular"`09!FEWNAMES
X`09'`5C0134'
X`09<move to the mark, implying a rectangle if used with an operator>
Xhelp`09`09NONE
X`09"h"
X`09"help"
X`09"list-help"
X`09"show-help"
X`09'`5EA-h'
X`09'`5EX-h'
X`09'FN-?'`09`09&0209KEY_Help
X`09'FN-m'`09`09&0209KEY_Menu
X`09<bring up a buffer containing lots of barely sorted information>
Xhistbuff`09NONE
X`09"historical-buffer"`09`09!FEWNAMES
X`09"_"
X`09'_'
X`09<visit the CNT'th previous buffer>
Xinsert`09`09REDO`7CUNDO
X`09"insert-chars"`09`09`09!FEWNAMES
X`09'FN-i'`09`09&0209KEY_Insert
X`09'i'
X`09<insert (CNT copies of) text before the cursor>
Xinsert_no_aindent`09REDO`7CUNDO
X`09"insert-chars-no-autoindent"`09!FEWNAMES
X`09'`5EA-i'
X`09<insert (CNT copies of) text before the cursor, suppressing autoindent>
Xinsertbol`09REDO`7CUNDO
X`09"insert-chars-at-bol"`09!FEWNAMES
X`09'I'
X`09<insert (CNT copies of) text before the first non-white char on line>
Xinsfile`09`09REDO`7CUNDO`7CGLOBOK`7C(FROM`7CZERO`7CNAMEDF)
X`09"r"
X`09"insert-file"`09`09`09!FEWNAMES
X`09"read-file"`09`09`09!FEWNAMES
X`09'`5ER'
X`09<read the given file into the current buffer at \160Cline>
Xinsspace`09REDO`7CUNDO`09`09!SMALLER
X`09"insert-space"`09`09`09!FEWNAMES
X`09<insert a space character at the cursor>
Xinsstring`09REDO`7CUNDO`09`09!SMALLER
X`09"insert-string"
X`09<insert the given string a\1406cursor>
Xjoinlines`09REDO`7CUNDO
X`09"join-lines"`09`09`09!FEWNAMES
X`09'J'
X`09<join CNT lines together with the current one>
Xkillbuffer`09GOAL
X`09"delete-buffer"`09`09`09!FEWNAMES
X`09"kill-buffer"`09`09`09!FEWNAMES
X`09"ki"
X`09'`5EX-k'
X`09<eliminate the given or under-cursor buffer>
Xshowlength`09DFLALL`7CFROM`7CTO`7CNOMOVE
X`09"buffer-length"`09`09`09!FEWNAMES
X`09"="
X`09<report number of lines in current buffer>
Xlastnonwhite`09MOTION`09`09`09!SMALLER
X`09"last-nonwhite"`09`09`09!FEWNAMES
X`09<move to the last non-whitespace character on line>
Xlistbuffers`09NONE
X`09"list-buffers"`09`09`09!FEWNAMES
X`09"show-buffers"`09`09`09!FEWNAMES
X`09"args"
X`09'`5EA-*'
X`09<show the current list of buffers.  give CNT to force showing all>
Xshowhistory`09NONE`09`09`09OPT_HISTORY
X`09"show-history"
X`09<show the command history>
Xlineputafter`09REDO`7CUNDO`7CGLOBOK`7C(FROM`7CZERO`7COPTREG)
X`09"put-as-lines-after"`09`09!FEWNAMES
X`09"put"
X`09'`5EX-p'
X`09<insert from (un)named register, as whole lines, after current line>
Xlineputbefore`09REDO`7CUNDO`7CGLOBOK`7C(FROM`7COPTREG)
X`09"put-as-lines-before"`09`09!FEWNAMES
X`09"Put"
X`09'`5EX-P'
X`09<insert from (un)named register, as whole lines, before current line>
Xrectputafter`09REDO`7CUNDO`7CGLOBOK`7C(FROM`7CZERO`7COPTREG)
X`09"put-as-rectangle-after"`09!FEWNAMES
X`09"rput"
X`09'`5EA-p'
X`09<insert from (un)named register, as a rectangle, after cursor>
Xrectputbefore`09REDO`7CUNDO`7CGLOBOK`7C(FROM`7COPTREG)
X`09"put-as-rectangle-before"`09!FEWNAMES
X`09"rPut"
X`09'`5EA-P'
X`09<insert from (un)named register, as a rectangle, in front of cursor>
Xlineundo`09NONE
X`09"undo-line-changes"`09`09!FEWNAMES
X`09'U'
X`09<undo all changes made to most recently altered line>
Xloadkreg`09NONE
X`09"load-register"
X`09<load the given string into\160Bnamed register>
Xshowkreg`09NONE`09`09`09OPT_SHOW_REGS
X`09"show-registers"
X`09"showregisters"`09`09`09!FEWNAMES
X`09"list-registers"`09`09!FEWNAMES
X`09<show the contents of all of the named and un\0C06registers>
Xsysmap`09`09NONE`7C(EXRCOK`7CEXTRA)`09OPT_SHOW_MAPS
X`09"show-system-mapped-chars"
X`09<list the system function-key maps>
Xmap`09`09NONE`7C(EXRCOK`7CEXTRA)
X`09"map"
X`09"show-mapped-chars"
X`09<create a new map, or show list of the current command-mode maps>
Xmap_bang`09NONE`7C(EXRCOK`7CEXTRA)
X`09"map!"
X`09"show-mapped!-chars"
X`09<create a new map, or show list of the current insert-mode maps>
Xnexttag`09`09NONE&0209`09OPT_TAGS
X`09"next-tag"`09`09`09!FEWNAMES
X`09'`5EA-`5E`5D'
X`09<search the tags file(s) for another location for the last tag>
Xnewprocessgroup`09NONE
X`09"new-process-group"
X`09<put editor into its own process group (X11 version only)>
Xnoremap`09`09NONE`7C(EXRCOK`7CEXTRA)
X`09"noremap"
X`09<create a new unremappable command-mode map>
Xnoremap_bang`09NONE`7C(EXRCOK`7CEXTRA)
X`09"noremap!"
X`09<create a new unremappable insert-mode map>
Xcntl_a_func`09`09NONE
X`09"cntl_a-prefix"
X`09'`5EA'
X`09<the `5C"Control-A`5C" prefix, used when typing extended commands>
Xmvdnnxtwind`09NONE
X`09"move-next-window-down"`09`09!FEWNAMES
X`09'`5EA-`5EE'
X`09<move next window down (or buffer up) by CNT lines>
Xmvupnxtwind`09NONE
X`09"move-next-window-up"`09`09!FEWNAMES
X`09'`5EA-`5EY'
X`09<move next window up (or buffer down) by CNT lines>
Xmvdnwind`09GOAL
X`09"move-window-down"`09`09!FEWNAMES
X`09'`5EE'
X`09<move window down (or buffer up) by CNT lines>
Xmvupwind`09GOAL
X`09"move-window-up"`09`09!FEWNAMES
X`09'`5EY'
X`09<move window up (or buffer down) by CNT lines>
Xmvrightwind`09GOAL
X`09"move-window-right"`09`09!FEWNAMES
X`09'`5EX-`5ER'
X`09<scroll window to right by CNT columns, half screen if CNT unspecified>
Xmvleftwind`09GOAL
X`09"move-window-left"`09`09!FEWNAMES
X`09'`5EX-`5EL'
X`09<scroll window to left by CNT columns, half screen if CNT unspecified>
Xnextbuffer`09NONE`7C(BANG`7CNAMEDFS)
X`09"n"
X`09"n!"
X`09"next-buffer"`09`09`09!FEWNAMES
X`09<switch to next buffer (or the least-recently-visited, if `5C"auto\3006`5C"
V on>
Xnamebuffer`09NONE
X`09"rename-buffer"
X`09<give the current buffer a new name>
Xnewline`09`09REDO`7CUNDO&0209!SMALLER
X`09"newline"
X`09<insert a newline at the cursor>
Xnewlength`09NONE
X`09"screen-rows"
X`09<tell the editor the screen has CNT rows>
Xnewwidth`09NONE
X`09"screen-columns"
X`09<tell the editor the screen has CNT columns>
Xnextwind`09NONE
X`09"next-window"`09`09`09!FEWNAMES
X`09'`5EX-o'
X`09<move to the next window>
Xnullproc`09NONE
X`09"nop"`09`09&0209!FEWNAMES
X`09"do-nothing"`09`09`09!FEWNAMES
X`09'`5EQ'
X`09<do nothing>
Xnamedcmd`09NONE
X`09"execute-named-command"`09`09!FEWNAMES
X`09":"
X`09':'
X`09<execute the given function, by name>
Xopenup`09`09REDO`7CUNDO`7C(FROM)
X`09"open-line-above-and-insert-chars"`09!FEWNAMES
X`09"i"
X`09'O'
X`09<insert text in CNT fresh blank line(s), before current line>
Xopenup_no_aindent`09REDO`7CUNDO`7C(FROM`7CZERO)
X`09"open-line-above-no-autoindent"`09!FEWNAMES
X`09'`5EA-O'
X`09<insert text in CNT fresh blank line(s), before current, no autoindent>
Xopendown`09REDO`7CUNDO`7C(FROM`7CZERO)
X`09"open-line-below-and-append-chars"`09!FEWNAMES
X`09"a"
X`09'o'
X`09<insert text in CNT fresh blank line(s), after current line>
Xopendown_no_aindent`09REDO`7CUNDO`7C(FROM`7CZERO)
X`09"open-line-below-no-autoindent"`09!FEWNAMES
X`09'`5EA-o'
X`09<insert text in CNT fresh blank line(s), after current, no autoindent>
Xoperopenrect`09OPER`7CREDO`7CUNDO`7CGLOBOK\0C06(RANGE)
X`09"open-rectangle"
X`09'`5EA-r'
X`09<open blank rectangular area specified by given motion>
Xoperattrbold`09OPER`7CGLOBOK`7CRANGE`09OPT_SELECTIONS
X`09"attribute-bold-til"`09`09!FEWNAMES
X`09'`5EA-B'
X`09<display text as bold in the region>
Xoperattrcaseq`09REDO`7CUNDO`7COPER`7CGLOBOK`7CRANGE`09OPT_SELECTIONS
X`09"attribute-cntl_a-sequences-til"`09!FEWNAMES
X`09'`5EA-A'
X`09<display text as given by `5EA sequences in the region>
Xoperattrhc`09OPER`7CGLOBOK`7CRANGE`09OPT_HYPERTEXT`20
X`09"attribute-hypertext-til"`09!FEWNAMES`20
X`09'`5EA-H'`20
X`09<attach hypertext command to region>`20
Xoperattrital`09OPER`7CGLOBOK`7CRANGE`09OPT_SELECTIONS
X`09"attribute-italic-til"`09`09!FEWNAMES
X`09'`5EA-I'
X`09<display text in italics in the region>
Xoperattrno`09OPER`7CGLOBOK`7CRANGE`09OPT_SELECTIONS
X`09"attribute-normal-til"`09`09!FEWNAMES
X`09'`5EA-N'
X`09<display text normally in the region>
Xoperattrrev`09OPER`7CGLOBOK`7CRANGE`09OPT_SELECTIONS
X`09"attribute-reverse-til"`09`09!FEWNAMES
X`09'`5EA-R'
X`09<display text reversed in the region>
Xoperattrul`09OPER`7CGLOBOK`7CRANGE`09OPT_SELECTIONS
X`09"attribute-underline-til"`09!FEWNAMES
X`09'`5EA-U'
X`09<display text underlined in the region>
Xoperchg`09`09OPER`7CREDO`7CUNDO
X`09"change-til"`09`09`09!FEWNAMES
X`09"delete-and-insert-chars-til"`09!FEWNAMES
X`09'c'
X`09<insert text, replacing that in the region>
Xoperdetab`09OPER`7CREDO`7CUNDO`7CGLOBOK`7C(RANGE)`09OPT_AEDIT
X`09"detab-lines-til"`09`09!FEWNAMES
X`09'`5EA- '
X`09<convert tabs to spaces in the region>
Xoperentab`09OPER`7CREDO`7CUNDO`7CGLOBOK`7C(RANGE)`09OPT_AEDIT
X`09"entab-lines-til"`09`09!FEWNAMES
X`09'`5EA-`5EI'
X`09<convert spaces to tabs where possible in the region>
Xopermove`09OPER`7C(RANGE`7CEXTRA)
X`09"move-til"
X`09"m"
X`09<move text in the region to the given line>
Xoperlinechg`09OPER`7CREDO`7CUNDO`7C(RANGE)
X`09"change-lines-til"`09`09!FEWNAMES
X`09"delete-lines-and-insert-chars-til"`09!FEWNAMES
X`09"ch"
X`09'`5EX-c'
X`09<insert text, replacing that on the lines covered by the region>
Xoperdel`09`09OPER`7CREDO`7CUNDO
X`09"delete-til"`09`09`09!FEWNAMES
X`09'd'
X`09<delete text in the region>
Xoperjoin`09OPER`7CREDO`7CUNDO`7CGLOBOK`7CRANGE
X`09"j"
X`09"join-lines-til"`09`09!FEWNAMES
X`09<join together lines in the region>
Xoperlinedel`09OPER`7CREDO`7CUNDO`7CGLOBOK`7C(RANGE`7COPTREG)
X`09"delete-lines-til"`09`09!FEWNAMES
X`09"d"
X`09'`5EX-d'
X`09<delete lines covered by the region>
Xoperfilter`09OPER`7CREDO`7CUNDO`7C(EXRCOK`7CRANGE`7CNAMEDFS`7CDFLNONE`7CVI_NL)
V OPT_SHELL
X`09"filter-til"`09`09`09!FEWNAMES
X`09"!"
X`09'!'
X`09<pipe the text in the region through an external filter command>
Xoperformat`09OPER`7CREDO`7CUNDO`7C(RANGE)`09OPT_FORMAT
X`09"format-til"`09`09`09!FEWNAMES
X`09'`5EA-f'
X`09'`5EA-j'
X`09<format (rejustify) the text in the region>
Xoperflip`09OPER`7CREDO`7CUNDO`7CGLOBOK`7C(RANGE)
X`09"flip-til"`09`09`09!FEWNAMES
X`09"`7E"
X`09'`5EA-`7E'
X`09<exchange upper and lowercase on characters in the region>
X# RANGE commented out, since it's not done....`20
Xoperglobals`09(/*RANGE`7C*/BANG`7CEXTRA`7CDFLALL)
X`09"global"
X`09"g"
X`09<perform command on all lines containing the given pattern>
Xopervglobals`09(/*RANGE`7C*/BANG`7CEXTRA`7CDFLALL)
X`09"inverse-global"
X`09"vglobal"
X`09"v"
X`09<perform command on all lines not containing the given pattern>
Xoperlower`09OPER`7CREDO`7CUNDO`7CGLOBOK`7C(RANGE)
X`09"lower-til"`09`09`09!FEWNAMES
X`09"L"
X`09'`5EA-l'
X`09<convert to lowercase all characters in the region>
Xoperlist`09OPER`7CGLOBOK`7C(RANGE)
X`09"list-lines-til"`09`09!FEWNAMES
X`09"l"
X`09<show lines, making tabs and newlines visible>
Xoperprint`09OPER`7CGLOBOK`7C(RANGE)
X`09"print-lines-til"`09`09!FEWNAMES
X`09"p"
X`09<show lines>
Xoperpprint`09OPER`7CGLOBOK`7C(RANGE)
X`09"print-prefixed-lines-til"`09!FEWNAMES
X`09"pp"
X`09<show lines with line numbers>
Xoperselect`09OPER`7CGLOBOK`7C(RANGE)`09OPT_SELECTIONS
X`09"select-til"`09`09`09!FEWNAMES
X`09'`5EA-s'
X`09<select (and yank) the text in the region>
Xoperupper`09OPER`7CREDO`7CUNDO`7CGLOBOK`7C(RANGE)
X`09"upper-til"`09`09`09!FEWNAMES
X`09"U"
X`09'`5EA-u'
X`09<convert to uppercase all characters in the region>
Xoperlshift`09OPER`7CREDO`7CUNDO`7CGLOBOK`7C(RANGE)
X`09"shift-left-til"`09`09!FEWNAMES
X`09"<"
X`09'<'
X`09<shift lines in the region left by one `5C"shiftwidth`5C">
Xoperrshift`09OPER`7CREDO`7CUNDO`7CGLOBOK`7C(RANGE)
X`09"shift-right-til"`09`09!FEWNAMES
X`09">"
X`09'>'
X`09<shift lines in the region right by one `5C"shiftwidth`5C">
Xopersubst`09OPER`7CREDO`7CUNDO`7CGLOBOK`7C(RANGE`7CEXTRA)
X`09"substitute-til"`09`09!FEWNAMES
X`09"s"
X`09'`5EX-s'
X`09<perform a text substitution over the region>
Xopertrim`09REDO`7CUNDO`7CGLOBOK\0C06(RANGE)`09OPT_AEDIT
X`09"trim-lines-til"`09`09!FEWNAMES
X`09"trim"
X`09'`5EA-t'
X`09<trim trailing whitespace from lines in the region>
Xoperblank       REDO`7CUNDO`7CGLOBOK\0C06(RANGE)   OPT_AEDIT
X`09"blank-region"
X`09"blank"
X`09'`5EA-b'
X`09<replace the region with whitespace>
Xoperyank`09OPER
X`09"yank-til"`09`09`09!FEWNAMES
X`09'y'
X`09<get the region into the given named or un\0B06register>
Xoperlineyank`09OPER`7C(RANGE`7COPTREG`7CNOMOVE)
X`09"yank-lines-til"`09`09!FEWNAMES
X`09"y"
X`09'`5EX-y'
X`09<get lines covered by region into given named or un\0B06register>
Xopersubstagain`09OPER`7CREDO`7CUNDO`7CGLOBOK`7C(RANGE`7CEXTRA)
X`09"substitute-again-til"`09`09!FEWNAMES
X`09"`26"
X`09'`5EA-`26'
X`09<redo the previous text substitution over the region>
Xopertransf`09OPER`7C(RANGE`7CEXTRA)
X`09"transfer-til"
X`09"t"
X`09<copy text in the region>
Xoperwrite`09OPER`7C(RANGE`7CBANG`7CFILE1`7CDFLALL`7CNOMOVE)
X`09"w"
X`09"w!"
X`09"W"
X`09"write-til"`09`09`09!FEWNAMES
X`09'`5EW'
X`09<write from region to the given file.  whole buffer by default>
Xoverwritechars`09REDO`7CUNDO
X`09"overwrite-chars"`09`09!FEWNAMES
X`09'R'
X`09<replace text while inserting, character by\0D0A>
Xoverwstring`09REDO`7CUNDO`09`09!SMALLER
X`09"overwrite-string"
X`09<replace text at the cursor by the given string>
Xonlywind`09NONE
X`09"delete-other-windows"`09`09!FEWNAMES
X`09'`5EO'
X`09'`5EX-1'
X`09<eliminate all windows except the current>
Xperl`09`09OPER`7CREDO`7CUNDO`7CGLOBOK`7CRANGE`7CDFLNONE`7CVIEWOK`09OPT_PERL`20
X`09"perl"
X`09<run a perl command>
Xperldo`09`09OPER`7CREDO`7CUNDO`7CGLOBOK`7CRANGE`7CEXTRA&0209OPT_PERL `20
X`09"perldo"`20
X`09<run a perl command on each line in a range>`20
Xposwind`09`09NONE
X`09"position-window"`09`09!FEWNAMES
X`09'z'
X`09<reframe with cursor at center (.,M,m), top (CR,H,t), or bottom (-,L,b)>
Xprevwind`09NONE
X`09"previous-window"`09`09!FEWNAMES
X`09'`5EX-O'
X`09<move to the previous window>
Xpipecmd`09`09NONE&0209`09OPT_SHELL
X`09"pipe-command"`09`09`09!FEWNAMES
X`09"capture-command"`09`09!FEWNAMES
X`09'`5EX-!'
X`09<run a command, capturing its output in the `5BOutput`5D buffer>
Xputafter`09REDO`7CUNDO
X`09"put-after"`09`09`09!FEWNAMES
X`09'p'
X`09<insert CNT copies of (un)named register, after cursor>
Xputbefore`09REDO`7CUNDO
X`09"put-before"`09`09`09!FEWNAMES
X`09'P'
X`09<insert CNT copies of (un)named register, before cursor>
Xpwd`09`09NONE&0209`09OPT_SHELL
X`09"pwd"
X`09"print-directory"
X`09<show current directory name>
Xquit`09`09NONE`7C(BANG)
X`09"q"
X`09"Q"
X`09"exit"
X`09"quit"
X`09'Q'
X`09'`5EX-`5EC'
X`09<leave the editor, if there are no modified buffers>
Xquithard`09NONE
X`09"quit-without-save"
X`09"q!"
X`09"Q!"
X`09<leave the editor, regardless of modified buffers>
Xquickexit`09NONE`7C(BANG`7CVI_NL)
X`09"x"
X`09"x!"
X`09"xit"
X`09"wwq"
X`09"write-changed-buffers-and-quit" !FEWNAMES
X`09"quick-exit"`09`09`09!FEWNAMES
X`09<leave the editor, writing modified buffers as needed>
Xquote`09`09REDO`7CUNDO
X`09"quote-next-character"`09`09!FEWNAMES
X`09<insert the next character literally, CNT times>
Xvile_refresh`09NONE
X`09"clear-and-redraw"`09`09!FEWNAMES
X`09'`5EL'
X`09<redraw the screen>
Xremove_mode`09NONE`09`09`09OPT_MAJORMODE
X`09"remove-majormode"
X`09"remove-mode"
X`09<delete the definition of a major mode>
Xremove_submode`09NONE`09`09`09OPT_MAJORMODE
X`09"remove-submode"
X`09<delete the special definition of a submode from a major mode>
Xreposition`09NONE`09`09`09!SMALLER
X`09"redraw-display"
X`09<redraw, cursor at center, or CNT'th line\100Cfrom end if neg>
Xrep_csrch`09MOTION
X`09"repeat-char-scan"`09`09!FEWNAMES
X`09';'
X`09<repeat the last forward character scan>
Xreplacechar`09REDO`7CUNDO
X`09"replace-character"`09`09!FEWNAMES
X`09'r'
X`09<replace CNT characters at the cursor with the given\280A>
Xrespawn`09`09NONE&0209`09OPT_SHELL
X`09"!!"
X`09"rerun-shell-command"`09`09!FEWNAMES
X`09<rerun the previously entered shell command>
Xresize`09`09NONE&0209`09!SMALLER
X`09"resize-window"
X`09<change the current window to CNT lines>
Xrestwnd`09`09NONE&0209`09!SMALLER
X`09"restore-window"
X`09<return to window saved with `5C"save-\1906`5C">
Xrev_csrch`09MOTION
X`09"reverse-char-scan"`09`09!FEWNAMES
X`09','
X`09<repeat the last backward character scan>
Xrisearch`09NONE`09`09`09OPT_ISRCH
X`09"reverse-incremental-search"`09!FEWNAMES
X`09'`5EX-R'
X`09<search backwards for a pattern entered character by\0D0A>
Xrevsearch`09ABSM`7CMOTION
X`09"reverse-search"`09`09!FEWNAMES
X`09'N'
X`09<search for previous pattern in opposite direction from before>
Xsel_motion`09ABSM`7CMOTION`09`09OPT_SELECTIONS
X`09"selection"
X`09'`5ES'
X`09'`5EA-S'
X`09<move to selection.  if used with operator, region is the \3109>
Xscrforwsearch`09ABSM`7CMOTION
X`09"screen-search-forward"`09`09!FEWNAMES
X`09'`5EX-/'
X`09<search forwards for pattern (word) under cursor>
Xscrbacksearch`09ABSM`7CMOTION
X`09"screen-search-reverse"`09`09!FEWNAMES
X`09'`5EX-?'
X`09<search backwards for pattern (word) under cursor>
Xscrsearchpat`09NONE
X`09"screen-search-pattern-grab"`09!FEWNAMES
X`09'`5EA-/'
X`09<set search pattern to word under cursor>
Xset_dosmode`09NONE`09`09`09OPT_DOSFILES
X`09"set-dos-mode"
X`09<force a `5C"dos`5C"-style buffer: trim CR characters, and set\3206-mode`5C
V">
Xset_unixmode`09NONE`09`09`09OPT_DOSFILES
X`09"set-unix-mode"
X`09<force a `5C"unix`5C"-style buffer: trim CR characters, and unset `5C"dos-m
Vode`5C">
Xsettab`09`09NONE
X`09"handle-tab"`09`09`09!FEWNAMES
X`09"set-tab"
X`09'`5EX-t'
X`09<set the tabstop setting to CNT.  same as `5C"set t\2706=NN`5C">
Xset_termchrs`09NONE`09`09`09OPT_REBIND`26`26OPT_TERMCHRS
X`09"set-terminal"
X`09<change the value of a terminal special character>
Xshow_termchrs`09NONE`09`09`09OPT_REBIND`26`26OPT_TERMCHRS
X`09"show-terminal-chars"
X`09<show the values of the terminal special characters>
Xspawncli`09NONE`09`09`09OPT_SHELL
X`09"sh"
X`09"shell"
X`09"interactive-shell"`09`09!FEWNAMES
X`09<start a sub-shell in which to run commands>
Xsavewnd`09`09NONE&0209`09!SMALLER
X`09"save-window"
X`09<mark a window for later return with `5C"restore-\2706`5C">
Xscrnextup`09NONE
X`09"scroll-next-window-up"`09`09!FEWNAMES
X`09'`5EA-`5EU'
X`09<move next window up by CNT half screens>
Xscrnextdw`09NONE
X`09"scroll-next-window-down"`09!FEWNAMES
X`09'`5EA-`5ED'
X`09<move next window down by CNT half screens>
Xsetfillcol`09NONE
X`09"set-fill-column"
X`09'`5EX-f'
X`09<set the fillcol setting to CNT.  same as `5C"set \2707=NN`5C">
Xmultimotion`09`09MOTION&0209OPT_SELECTIONS
X`09"quoted-motion"`09`09`09!FEWNAMES
X`09'q'
X`09'FN-s'`09`09&0209KEY_Select
X`09<start (and end) a selection using multiple motions, CNT is type (1) >
Xmultimotionfullline`09`09MOTION`09OPT_SELECTIONS
X`09"quoted-fullline-motion"`09!FEWNAMES
X`09<start (and end) a full-line selection using multiple motions (2) >
Xmultimotionrectangle`09`09MOTION`09OPT_SELECTIONS
X`09"quoted-rectangular-motion"`09!FEWNAMES
X`09'`5EA-q'
X`09<start (and end) a rectangular selection using multiple motions (3) >
Xue_setkey`09NONE`09`09`09OPT_ENCRYPT
X`09"set-crypt-key"
X`09'`5EX-X'
X`09<set the encryption key on the current buffer>
Xsetlocmode`09NONE`7C(EXRCOK`7CEXTRA)
X`09"setl"
X`09"set-mode"`09`09`09!FEWNAMES
X`09<change the current buffer's local value of a mode setting>
Xsetglobmode`09NONE
X`09"se"
X`09"set"
X`09"setg"
X`09"set-global-mode"
X`09<change the global value of a mode setting>
Xsetnmmark`09NONE`7C(FROM`7CEXTRA`7CNOMOVE)
X`09"set-named-mark"`09`09!FEWNAMES
X`09"k"
X`09'm'
X`09<set the given named mark to the current cursor location>
Xsetvar`09`09NONE&0209`09OPT_EVAL
X`09"setv"
X`09"set-variable"
X`09<set the given vile variable to a value>
Xshowcpos`09NONE
X`09"position"`09`09`09!FEWNAMES
X`09'`5EG'
X`09'`5EX-='
X`09<report information about current buffer and character>
Xlistmodes`09NONE
X`09"modes"
X`09"show-modes"
X`09"list-modes"
X`09"setall"
X`09"setgall"
X`09"gmodes"
X`09"show-global-modes"
X`09"showmodes"
X`09"showgmodes"
X`09<report values of all mode settings>
Xlist_majormodes`09NONE`09`09`09OPT_MAJORMODE
X`09"list-majormodes"`09`09!FEWNAMES
X`09"show-majormodes"
X`09<report values of all majormode settings (use CNT for verbose listing)>
Xlistvars`09NONE`09`09`09OPT_SHOW_EVAL
X`09"list-variables"`09`09!FEWNAMES
X`09"show-variables"
X`09"showvars"`09`09`09!FEWNAMES
X`09<report values of all variables, built-in and user>
Xshowversion`09NONE`7C(EXRCOK)
X`09"version"
X`09<report version information for the editor>
Xshowmemory`09NONE`09`09`09SYS_MSDOS`26`26(CC_TURBO`7C`7CCC_WATCOM&027CCC_DJGPP
V)
X`09"memory"
X`09<report on available memory>
Xshowtagstack`09NONE`09`09`09OPT_SHOW_TAGS
X`09"tags"`09`09&0209!FEWNAMES
X`09"tagstack"
X`09"show-tagstack"
X`09<show the stack of successive tag references>
Xshrinkwind`09NONE
X`09"shrink-window"`09`09`09!FEWNAMES
X`09'v'
X`09<decrease the size of the current window by CNT lines>
Xsource`09`09NONE`7C(EXRCOK`7CNAMEDF)
X`09"exsource"
X`09<source a file of ex commands>
Xspawn`09`09NONE&0209`09OPT_SHELL
X`09"shell-command"`09`09`09!FEWNAMES
X`09<run a shell command>
Xpoundc_func`09NONE
X`09"function-prefix"
X`09'#'
X`09<prefix used to represent commands normally bound to function keys>
Xsplitwind`09NONE
X`09"split-current-window"`09`09!FEWNAMES
X`09'`5EX-2'
X`09<split the window in half; CNT of 1 or 2 chooses which becomes current>
Xstoremac`09NONE
X`09"store-macro"
X`09<store script text into CNT'th macro, up to line starting with `7Eendm>
Xstoreproc`09NONE`09`09`09OPT_PROCEDURES
X`09"store-procedure"
X`09<store script text into given named stored-procedure>
Xsubst_again`09REDO`7CUNDO`7CGLOBOK
X`09"substitute-again"`09`09!FEWNAMES
X`09'`26'
X`09<redo the previous text substitution>
Xtogglelistbuffers`09NONE
X`09"*"
X`09"toggle-buffer-list"`09`09!FEWNAMES
X`09'*'
X`09<show or hide the buffer list. give CNT to force showing all>
Xtwiddle`09`09REDO`7CUNDO&0209!SMALLER
X`09"transpose-characters"`09`09!FEWNAMES
X`09<exchange the two characters under and to the left of the cursor>
Xunbindkey`09NONE`09`09`09OPT_REBIND
X`09"unbind-key"
X`09<break the binding between a keystroke and a function>
Xundo`09`09NONE
X`09"undo-change"`09`09`09!FEWNAMES
X`09'u'
X`09<undo the last change made to a buffer;  repeat to reapply the \3006>
Xinf_undo`09NONE
X`09"repeat-undo-change"`09`09`09!FEWNAMES
X`09<undo/redo more changes, continuing in `5C"direction`5C" of last \3C09>
Xbackundo`09NONE
X`09"undo-changes-backward"`09`09!FEWNAMES
X`09'`5EX-u'
X`09<undo changes made to a buffer;  repeat to undo previous \3307>
Xforwredo`09NONE
X`09"redo-changes-forward"`09`09!FEWNAMES
X`09'`5EX-r'
X`09<redo changes made to a buffer, after they have been undone>
Xunabbr`09`09NONE`7C(EXRCOK`7CBANG`7CEXTRA)
X`09"unabbreviate"
X`09<delete an abbreviation>
Xunarg_func`09`09NONE
X`09"universal-argument"`09`09!FEWNAMES
X`09'K'
X`09<supply a numeric CNT to a command. sets\17084, 16, 64, 256, etc.>
Xunimpl`09`09NONE
X`09"unimplemented-command"`09`09!FEWNAMES
X`09<place holder for the todo list>
Xunmark`09`09NONE
X`09"unmark-buffer"
X`09<clear the `5C"modified`5C" status of a buffer>
Xunmap`09`09NONE`7C(EXRCOK`7CBANG`7CEXTRA)
X`09"unmap"
X`09<delete a command-mode mapping>
Xunmap_bang`09NONE`7C(EXRCOK`7CEXTRA)
X`09"unmap!"
X`09<delete an insert-mode mapping>
Xunmap_system`09NONE`7C(EXRCOK`7CEXTRA)
X`09"unmap-system-chars"
X`09<delete a system function-key mapping>
Xuntagpop`09NONE`09`09`09OPT_TAGS
X`09"tag-pop"`09`09`09!FEWNAMES
X`09"pop"
X`09'`5EX-`5E`5D'
X`09'`5ET'
X`09<restore cursor and buffer to location before last tag lookup>
Xupscreen`09NONE`09`09`09!SMALLER
X`09"update-screen"
X`09<force the screen to be updated; flushes all pending output>
Xusebuffer`09NONE
X`09"b"
X`09"buffer"
X`09"select-buffer"`09`09`09!FEWNAMES
X`09<switch to the given buffer; will not look for a file by that name>
Xusekreg`09`09REDO
X`09"use-register"`09`09`09!FEWNAMES
X`09'"'
X`09<name a register, for use with a following command which references it>
Xuserbeep`09NONE`09`09`09!SMALLER
X`09"beep"
X`09<force the terminal to ring (or flash, if `5C"set\1006`5C" is active)>
Xvisual`09`09NONE
X`09"visual"
X`09<switch from non-existent exile mode back to visual mode.  unimplemented>
Xvglobals`09NONE
X`09"ovglobals"`09`09`09NEVER
Xviewfile`09NONE
X`09"view-file"
X`09<bring given file or existing buffer into window, mark it `5C"view-only`5C"
V>
Xwriteallchanged`09NONE`7C(VI_NL)
X`09"ww"
X`09"write-changed-buffers"`09`09!FEWNAMES
X`09<attempt to write any buffers which are marked `5C"modified`5C">
Xwritequit`09NONE`7C(VI_NL)
X`09"wq"
X`09"Wq"
X`09"WQ"
X`09"write-file-and-quit"`09`09!FEWNAMES
X`09<write the current buffer, and quit if no other\1D07s are modified>
Xwrapword`09REDO`7CUNDO`09`09!SMALLER
X`09"wrap-word"
X`09<split line in two at first preceding word break>
Xwritemsg`09NONE`09`09`09!SMALLER
X`09"write-message"
X`09<put a message on the \0F08line>
Xyankline`09NONE
X`09"yank-line"`09`09`09!FEWNAMES
X`09'Y'
X`09<get the current line into the given named or un\0B06register>
Xmouse_motion`09ABSM`7CMOTION`09`09OPT_XTERM`7C`7CDISP_X11
X`09'FN-M'`09`09&0209KEY_Mouse
X`09<dummy command to support mouse movements internally>
Xcopy_to_clipboard NONE `09`09`09DISP_X11
X`09"copy-to-clipboard"
X`09<copies the currently highlighted selection to\2707t buffer>`20
Xpaste_from_clipboard REDO`7CUNDO `09`09DISP_X11
X`09"paste-from-clipboard"
X`09<pastes the contents of\1006ut buffer>`20
Xxterm_mouse_t`09NONE`09`09`09(OPT_XTERM>=3)
X`09'FN-t'`09`09&0209KEY_text
X`09<dummy command to support xterm mouse operation>
Xxterm_mouse_T`09NONE`09`09`09(OPT_XTERM>=3)
X`09'FN-T'`09`09&0209KEY_textInvalid
X`09<dummy command to support xterm mouse operation>
Xzzquit`09`09NONE`7C(BANG`7CVI_NL)
X`09'Z'
X`09"stuttered-write-all-and-quit"`09!FEWNAMES
X`09<if repeated, leave the editor, writing modified buffers as needed>
$ call unpack [.VILE-8_0]CMDTBL.;1 -
 1514423694 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 95 20 152
$!
$ create 'f'
X/*
X * $Header: /usr/build/vile/vile/RCS/config.emx,v 1.1 1997/12/01 00:52:06 tom
V Exp $
X *
X * hand-generated configuration for EMX (gcc) on OS/2
X */
X
X#define scrn_chosen  1
X#define DISP_TERMCAP  1
X
X#define os_chosen  1
X#define SYS_UNIX 1
X
X#define HAVE_DIRENT_H 1
X#define HAVE_GETCWD 1
X#define HAVE_STDDEF_H 1
X#define HAVE_STDLIB_H 1
X#define HAVE_SYS_DIR_H 1
X#define HAVE_SYS_WAIT_H 1
X#define HAVE_TCGETATTR 1
X#define HAVE_TERMCAP_H 1
X#define HAVE_TERMIOS_H 1
X#define HAVE_UNISTD_H 1
X#define OUTC_RETURN
X#define SIGRET /*nothing*/
X#define SIGT void
$ call unpack [.VILE-8_0]CONFIG.EMX;1 -
 1280714524 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 2 21 152
$!
$ create 'f'
X#! /bin/sh
X# Attempt to guess a canonical system name.
X#   Copyright (C) 1992, 93, 94, 95, 1996 Free Software Foundation, Inc.
X#
X# This file is free software; you can redistribute it and/or modify it
X# under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2 of the License, or
X# (at your option) any later version.
X#
X# This program is distributed in the hope that it will be useful, but
X# WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
X# General Public License for more details.
X#
X# You should have received a copy of the GNU General Public License
+-+-+-+-+-+-+-+-  END  OF PART 29 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 30 -+-+-+-+-+-+-+-+
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
X#
X# As a special exception to the GNU General Public License, if you
X# distribute this file as part of a program that contains a
X# configuration script generated by Autoconf, you may include it under
X# the same distribution terms that you use for the rest of\1D06program.
X
X# Written by Per Bothner <b\0906@cygnus.com>.
X# The master version of this file is at the FSF in /home/gd/gnu/lib.
X#
X# This script attempts to guess a canonical system name similar to
X# config.sub.  If it succeeds, it prints the system name on stdout, and
X# exits with 0.  Otherwise, it\1D0C1.
X#
X# The plan is that this can be called by configure scripts if you
X# don't specify an explicit system type (host/target name).
X#
X# Only a few systems have been added to this list; please add others
X# (but try to keep the structure clean).
X#
X
X# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
V
X# (ghazi@noc.rutgers.edu 8/24/94.)
Xif (test -f /.attbin/uname) >/dev/null 2>`261 ; then
X`09PATH=$PATH:/.attbin ; export PATH
Xfi
X
XUNAME_MACHINE=`60(uname -m) 2>/dev/null`60 `7C`7C \2A0Eunknown
XUNAME_RELEASE=`60(uname -r) 2>/dev/null`60 `7C`7C \2A0Eunknown
XUNAME_SYSTEM=`60(uname -s) 2>/dev/null`60 `7C`7C \290Dunknown
XUNAME_VERSION=`60(uname -v) 2>/dev/null`60 `7C`7C \2A0Eunknown
X
Xtrap 'rm -f dummy.c\0807o\1006; exit 1' 1 2 15
X
X# Note: order is significant - the case branches are not exclusive.
X
Xcase "$`7BUNAME_MACHINE`7D:\1108SYSTEM\100ARELEAS\210BVERSION`7D" in
X    alpha:OSF1:*:*)
X`09# A Vn.n version is a released\1608.
X`09# A Tn.n version is a released field test\2108.
X`09# A Xn.n version is an unreleased experimental baselevel.
X`09# 1.2 uses "1.2" for uname -r.
X`09echo alpha-dec-osf`60echo $`7BUNAME_RELEASE`7D `7C sed -e 's/`5E`5BVTX`5D//
V'`60
X`09exit 0 ;;
X    21064:Windows_NT:50:3)
X`09echo alpha-dec-winnt3.5
X`09exit 0 ;;
X    Amiga*:UNIX_System_V:4.0:*)
X`09echo m68k-cbm-sysv4
X`09exit 0;;
X    amiga:NetBSD:*:*)
X      echo m68k-cbm-netbsd$`7BUNAME_RELEASE`7D
X      exit 0 ;;
X    amiga:OpenBSD:*:*)
X      echo m68k-cbm-openbsd$`7BUNAME_RELEASE`7D
X      exit 0 ;;
X    arm:RISC*:1.`5B012`5D*:*`7Carm:riscix\160B)
X`09echo arm-acorn-riscix$`7BUNAME_RELEASE`7D
X`09exit 0;;
X    Pyramid*:OSx*:*:*`7CMIS\0E0A)
X`09# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
X`09if test "`60(/bin/universe) 2>/dev/null`60" = att ; then
X`09`09echo pyramid-\0808sysv3
X`09else
X`09`09echo pyramid-\0808bsd
X`09fi
X`09exit 0 ;;
X    NILE:*:*:dcosx)
X`09echo pyramid-\0808svr4
X`09exit 0 ;;
X    sun4*:SunOS:5.*:* `7C tadpole\170D)
X`09echo sparc-sun-solaris2`60echo $`7BUNAME_RELEASE`7D`7Csed -e 's/`5B`5E.`5D*
V//'`60
X`09exit 0 ;;
X    i86pc:SunOS:5.*:*)
X`09echo i386-pc-solaris2`60echo $`7BUNAME_RELEASE`7D`7Csed -e 's/`5B`5E.`5D*//
V'`60
X`09exit 0 ;;
X    sun4*:SunOS:6*:*)
X`09# According to config.sub, this is the proper way to canonicalize
X`09# SunOS6.  Hard to guess exactly what\2407 will be like, but
X`09# it's likely to be more like Solaris than SunOS4.
X`09echo sparc-sun-solaris3`60echo $`7BUNAME_RELEASE`7D`7Csed -e 's/`5B`5E.`5D*
V//'`60
X`09exit 0 ;;
X    sun4*:SunOS:*:*)
X`09case "`60/usr/bin/arch -k`60" in
X`09    Series*`7CS4*)
X`09`09UNAME_RELEASE=`60uname -v`60
X`09`09;;
X`09esac
X`09# Japanese Language versions have a\1008 number like `604.1.3-JL'.
X`09echo sparc-sun-sunos`60echo $`7BUNAME_RELEASE`7D`7Csed -e 's/-/_/'`60
X`09exit 0 ;;
X    sun3*:SunOS:*:*)
X`09echo m68k-sun-sunos$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    aushp:SunOS:*:*)
X`09echo sparc-auspex-sunos$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    atari*:NetBSD:*:*)
X`09echo m68k-atari-netbsd$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    atari*:OpenBSD:*:*)
X`09echo m68k-atari-openbsd$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    sun3*:NetBSD:*:*)
X`09echo m68k-sun-netbsd$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    sun3*:OpenBSD:*:*)
X`09echo m68k-sun-openbsd$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    mac68k:NetBSD:*:*)
X`09echo m68k-apple-netbsd$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    mac68k:OpenBSD:*:*)
X`09echo m68k-apple-openbsd$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    powerpc:machten:*:*)
X`09echo powerpc-apple-machten$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    RISC*:Mach:*:*)
X`09echo mips-dec-mach_bsd4.3
X`09exit 0 ;;
X    RISC*:ULTRIX:*:*)
X`09echo mips-dec-ultrix$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    VAX*:ULTRIX*:*:*)
X`09echo vax-dec-ultrix$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    2020:CLIX:*:*)
X`09echo clipper-intergraph-clix$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    mips:*:*:UMIPS `7C\110ARISCos)
X`09sed 's/`5E`09//' << EOF >dummy.c
X`09int main (argc, argv) int argc; char **argv; `7B
X`09#if defined (host_mips) `26`26\170AMIPSEB)
X`09#if defined (SYSTYPE_SYSV)
X`09  printf ("mips-mips-riscos%ssysv`5Cn", argv`5B1`5D); exit (0);
X`09#endif
X`09#if defined (SYSTYPE_SVR4)
X`09  printf ("mips-mips-riscos%ssvr4`5Cn", argv`5B1`5D); exit (0);
X`09#endif
X`09#if defined (SYSTYPE_BSD43) `7C`7C\1B08\1A0C)
X`09  printf ("mips-mips-riscos%sbsd`5Cn", argv`5B1`5D); exit (0);
X`09#endif
X`09#endif
X`09  exit (-1);
X`09`7D
XEOF
X`09$`7BCC-cc`7D dummy.c -o\0B06 `5C
X`09  `26`26 ./dummy `60echo "$`7BUNAME_RELEASE`7D" `7C sed -n 's/`5C(`5B0-9`5D
V*`5C).*/`5C1/p'`60 `5C
X`09  `26`26 rm dummy.c\0806 &0226 exit 0
X`09rm -f dummy.c\0806
X`09echo mips-mips-riscos$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    Night_Hawk:Power_UNIX:*:*)
X`09echo powerpc-harris-powerunix
X`09exit 0 ;;
X    m88k:CX/UX:7*:*)
X`09echo m88k-harris-cxux7
X`09exit 0 ;;
X    m88k:*:4*:R4*)
X`09echo m88k-motorola-sysv4
X`09exit 0 ;;
X    m88k:*:3*:R3*)
X`09echo m88k-motorola-sysv3
X`09exit 0 ;;
X    AViiON:dgux:*:*)
X        # DG/UX returns AViiON for all architectures
X        UNAME_PROCESSOR=`60/usr/bin/uname -p`60
X        if `5B $UNAME_PROCESSOR = mc88100 -o\1E1910 `5D ; then
X`09if `5B $`7BTARGET_BINARY_INTERFACE`7Dx = m88kdguxelfx `5C
X`09     -o $`7BTARGET_BINARY_INTERFACE`7Dx = x `5D ; then
X`09`09echo m88k-dg-dgux$`7BUNAME_RELEASE`7D
X`09else
X`09`09echo m88k-dg-dguxbcs$`7BUNAME_RELEASE`7D
X`09fi
X        else echo i586-dg-dgux$`7BUNAME_RELEASE`7D
X        fi
X `09exit 0 ;;
X    M88*:DolphinOS:*:*)`09# \1109 (SVR3)
X`09echo m88k-dolphin-sysv3
X`09exit 0 ;;
X    M88*:*:R3*:*)
X`09# Delta 88k system running SVR3
X`09echo m88k-motorola-sysv3
X`09exit 0 ;;
X    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
X`09echo m88k-tektronix-sysv3
X`09exit 0 ;;
X    Tek43`5B0-9`5D`5B0-9`5D:UTek:*:*) # Tektronix 4300 system running UTek (BS
VD)
X`09echo m68k-tektronix-bsd
X`09exit 0 ;;
X    *:IRIX*:*:*)
X`09echo mips-sgi-irix`60echo $`7BUNAME_RELEASE`7D`7Csed -e 's/-/_/g'`60
X`09exit 0 ;;
X    ????????:AIX?:`5B12`5D.1:2)   # AIX 2.2.1 or\0D071.1 is RT/PC AIX.
X`09echo romp-ibm-aix      # uname -m gives an 8 hex-code CPU id
X`09exit 0 ;;        \0806# Note that: echo "'`60uname -s`60'" gives 'AIX '
X    i?86:AIX:*:*)
X`09echo i386-ibm-aix
X`09exit 0 ;;
X    *:AIX:2:3)
X`09if grep bos325 /usr/include/stdio.h >/dev/null 2>`261; then
X`09`09sed 's/`5E&0209//' << EOF >dummy.c
X`09`09#include <sys/systemcfg.h>
X
X`09`09main()
X`09`09`09`7B
X`09`09`09if (!__power_pc())
X`09`09&0209exit(1);
X`09`09`09puts("powerpc-ibm-aix3.2.5");
X`09`09`09exit(0);
X`09`09`09`7D
XEOF
X`09`09$`7BCC-cc`7D dummy.c -o\0B06 `26`26 ./\0B09rm\2209\1F09exit 0
X`09`09rm -f dummy.c\0806
X`09`09echo rs6000-ibm-aix3.2.5
X`09elif grep bos324 /usr/include/stdio.h >/dev/null 2>`261; then
X`09`09echo rs6000-ibm-aix3.2.4
X`09else
X`09`09echo rs6000-ibm-aix3.2
X`09fi
X`09exit 0 ;;
X    *:AIX:*:4)
X`09if /usr/sbin/lsattr -EHl proc0 `7C grep POWER >/dev/null 2>`261; then
X`09`09IBM_ARCH=rs6000
X`09else
X`09`09IBM_ARCH=powerpc
X`09fi
X`09if `5B -x /usr/bin/oslevel `5D ; then
X`09`09IBM_REV=`60/usr/bin/oslevel`60
X`09else
X`09`09IBM_REV=4.$`7BUNAME_RELEASE`7D
X`09fi
X`09echo $`7BIBM_ARCH`7D-ibm-aix\1306REV`7D
X`09exit 0 ;;
X    *:AIX:*:*)
X`09echo rs6000-ibm-aix
X`09exit 0 ;;
X    ibmrt:4.4BSD:*`7Cromp-ibm:BSD:*)
X`09echo romp-ibm-bsd4.4
X`09exit 0 ;;
X    ibmrt:*BSD:*`7Cromp-ibm:BSD:*)            # covers RT/PC NetBSD and
X`09echo romp-ibm-bsd$`7BUNAME_RELEASE`7D   # 4.3 with uname added to
X`09exit 0 ;;        \0808\100B# report: romp-ibm BSD 4.3
X    *:BOSX:*:*)
X`09echo rs6000-bull-bosx
X`09exit 0 ;;
X    DPX/2?00:B.O.S.:*:*)
X`09echo m68k-bull-sysv3
X`09exit 0 ;;
X    9000/`5B34`5D??:4.3bsd:1.*:*)
X`09echo m68k-hp-bsd
X`09exit 0 ;;
X    hp300:4.4BSD:*:* `7C 9000/`5B34`5D??:4.3bsd:2.*:*)
X`09echo m68k-hp-bsd4.4
X`09exit 0 ;;
X    9000/`5B3478`5D??:HP-UX:*:*)
X`09case "$`7BUNAME_MACHINE`7D" in
X`09    9000/31? )            HP_ARCH=m68000 ;;
X`09    9000/`5B34`5D?? )         HP_ARCH=m68k ;;
X`09    9000/7?? `7C\0B068?`5B1679`5D ) HP_ARCH=hppa1.1 ;;
X`09    9000/8?? )            HP_ARCH=hppa1.0 ;;
X`09esac
X`09HPUX_REV=`60echo $`7BUNAME_RELEASE`7D`7Csed -e 's/`5B`5E.`5D*.`5B0B`5D*//'
V`60
X`09echo $`7BHP_ARCH`7D-hp-hpux$`7BHPUX_REV`7D
X`09exit 0 ;;
X    3050*:HI-UX:*:*)
X`09sed 's/`5E`09//' << EOF >dummy.c
X`09#include <unistd.h>
X`09int
X`09main ()
X`09`7B
X`09  long cpu = sysconf (_SC_CPU_VERSION);
X`09  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
X`09     true for CPU_PA_RISC1_0.  CPU_IS\1408 returns correct
X`09     results, however.  */
X`09  if (CPU_IS_PA_RISC (cpu))
X`09    `7B
X`09      switch (cpu)
X`09`09`7B
X`09`09  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
X`09`09  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
X`09`09  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
X`09`09  default: puts ("hppa-hitachi-hiuxwe2"); break;
X`09`09`7D
X`09    `7D
X`09  else if (CPU_IS_HP_MC68K (cpu))
X`09    puts ("m68k-hitachi-hiuxwe2");
X`09  else puts ("unknown-hitachi-hiuxwe2");
X`09  exit (0);
X`09`7D
XEOF
X`09$`7BCC-cc`7D dummy.c -o\0B06 `26`26 ./\0B09rm\2209\1F09exit 0
X`09rm -f dummy.c\0806
X`09echo unknown-hitachi-hiuxwe2
X`09exit 0 ;;
X    9000/7??:4.3bsd:*:* `7C\16068?`5B79`5D\190C)
X`09echo hppa1.1-hp-bsd
X`09exit 0 ;;
X    9000/8??:4.3bsd:*:*)
X`09echo hppa1.0-hp-bsd
X`09exit 0 ;;
X    hp7??:OSF1:*:* `7C hp8?`5B79`5D\140A)
X`09echo hppa1.1-hp-osf
X`09exit 0 ;;
X    hp8??:OSF1:*:*)
X`09echo hppa1.0-hp-osf
X`09exit 0 ;;
X    i?86:OSF1:*:*)
X`09if `5B -x /usr/sbin/sysversion `5D ; then
X`09    echo $`7BUNAME_MACHINE`7D-unknown-osf1mk
X`09else
X`09    echo $`7BUNAME_MACHINE`7D-unknown-osf1
X`09fi
X`09exit 0 ;;
X    parisc*:Lites*:*:*)
X`09echo hppa1.1-hp-lites
X`09exit 0 ;;
X    C1*:ConvexOS:*:* `7C convex\160AC1*:*)
X`09echo c1-convex-bsd
X        exit 0 ;;
X    C2*:ConvexOS:*:* `7C convex\160AC2*:*)
X`09if getsysinfo -f scalar_acc
X`09then echo c32-convex-bsd
X`09else echo c2-convex-bsd
X`09fi
X        exit 0 ;;
X    C34*:ConvexOS:*:* `7C convex\160AC34*:*)
X`09echo c34-convex-bsd
X        exit 0 ;;
X    C38*:ConvexOS:*:* `7C convex\160AC38*:*)
X`09echo c38-convex-bsd
X        exit 0 ;;
X    C4*:ConvexOS:*:* `7C convex\160AC4*:*)
X`09echo c4-convex-bsd
X        exit 0 ;;
X    CRAY*X-MP:*:*:*)
X`09echo xmp-cray-unicos
X        exit 0 ;;
X    CRAY*Y-MP:*:*:*)
X`09echo ymp-cray-unicos$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    CRAY*`5BA-Z`5D90:*:*:*)
X`09echo $`7BUNAME_MACHINE`7D-cray-unicos\1C08RELEASE`7D `5C
X`09`7C sed -e 's/CRAY.*`5C(`5BA-Z`5D90`5C)/`5C1/' `5C
X`09      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/
X`09exit 0 ;;
X    CRAY*TS:*:*:*)
X`09echo t90-cray-unicos$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    CRAY-2:*:*:*)
X`09echo cray2-cray-unicos
X        exit 0 ;;
X    F300:UNIX_System_V:*:*)
X        FUJITSU_SYS=`60uname -p `7C tr `5BA-Z`5D `5Ba-z`5D `7C sed -e 's/`5C//
V/'`60
X        FUJITSU_REL=`60echo $`7BUNAME_RELEASE`7D `7C sed -e 's/ /_/'`60
X        echo "f300-fujitsu-$`7BFUJITSU_SYS`7D\0E0AREL`7D"
X        exit 0 ;;
X    F301:UNIX_System_V:*:*)
X       echo f301-fujitsu-uxpv`60echo $UNAME_RELEASE `7C sed 's/ .*//'`60
X       exit 0 ;;
X    hp3`5B0-9`5D`5B05`5D:NetBSD:*:*)
X`09echo m68k-hp-netbsd$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    hp3`5B0-9`5D`5B05`5D:OpenBSD:*:*)
X`09echo m68k-hp-openbsd$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    i?86:BSD/386:*:* `7C *:BSD/OS:*:*)
X`09echo $`7BUNAME_MACHINE`7D-pc-bsdi\1808RELEASE`7D
X`09exit 0 ;;
X    *:FreeBSD:*:*)
X`09echo $`7BUNAME_MACHINE`7D-unknown-freebsd`60\260DRELEASE`7D`7Csed -e 's/`5B
V-(`5D.*//'`60
X`09exit 0 ;;
X    *:NetBSD:*:*)
X`09echo $`7BUNAME_MACHINE`7D-unknown-netbsd`60\250DRELEASE`7D`7Csed -e 's/`5B-
V_`5D.*/`5C./'`60
X`09exit 0 ;;
X    *:OpenBSD:*:*)
X`09echo $`7BUNAME_MACHINE`7D-unknown-openbsd`60\260DRELEASE`7D`7Csed -e 's/`5B
V-_`5D.*/`5C./'`60
X`09exit 0 ;;
X    i*:CYGWIN*:*)
X`09echo i386-pc-cygwin32
X`09exit 0 ;;
X    p*:CYGWIN*:*)
X`09echo powerpcle-unknown-cygwin32
X`09exit 0 ;;
X    prep*:SunOS:5.*:*)
X`09echo powerpcle-unknown-solaris2`60echo $`7BUNAME_RELEASE`7D`7Csed -e 's/`5B
V`5E.`5D*//'`60
X`09exit 0 ;;
X    *:GNU:*:*)
X`09echo `60echo $`7BUNAME_MACHINE`7D`7Csed -e 's,/.*$,,'`60-unknown-gnu\350ERE
VLEAS\3515
X`09exit 0 ;;
X    *:Linux:*:*)
X`09# The BFD linker knows what the default object file format is, so
X`09# first see if it will tell us.
X`09ld_help_string=`60ld --help 2>`261`60
X`09if echo "$ld_help_string" `7C grep >/dev/null 2>`261 "supported emulations:
V elf_i.86"; then
X`09  echo "$`7BUNAME_MACHINE`7D-pc-linux-gnu" ; exit 0
X`09elif echo "$ld_help_string" `7C grep >/dev/null 2>`261 "supported emulation
Vs: i.86linux"; then
X`09  echo "$`7BUNAME_MACHINE`7D-pc-linux-gnuaout" ; exit 0
X`09elif echo "$ld_help_string" `7C grep >/dev/null 2>`261 "supported emulation
Vs: i.86coff"; then
X`09  echo "$`7BUNAME_MACHINE`7D-pc-linux-gnucoff" ; exit 0
X`09elif echo "$ld_help_string" `7C grep >/dev/null 2>`261 "supported emulation
Vs: m68kelf"; then
X`09  echo "$`7BUNAME_MACHINE`7D-unknown-linux-gnu" ; exit 0
X`09elif echo "$ld_help_string" `7C grep >/dev/null 2>`261 "supported emulation
Vs: m68klinux"; then
X`09  echo "$`7BUNAME_MACHINE`7D-unknown-linux-gnuaout" ; exit 0
X`09elif echo "$ld_help_string" `7C grep >/dev/null 2>`261 "supported emulation
Vs: elf32ppc"; then
X`09  echo "powerpc-unknown-linux-gnu" ; exit 0
X`09elif test "$`7BUNAME_MACHINE`7D" = "alpha" ; then
X`09  echo alpha-unknown-linux-gnu ; exit 0
X`09elif test "$`7BUNAME_MACHINE`7D" = "sparc" ; then
X`09  echo sparc-unknown-linux-gnu ; exit 0
X`09else
X`09  # Either a pre-BFD a.out linker (linux-gnuoldld) or one that does not giv
Ve us
X`09  # useful --help.  Gcc wants to distinguish between linux-gnuoldld and`20
V\1309aout.
X`09  test ! -d /usr/lib/ldscripts/. `5C
X`09    `26`26 echo "$`7BUNAME_MACHINE`7D-pc-linux-gnuoldld" &0226 exit 0
X`09  # Determine whether the default compiler is a.out or elf
X`09  cat >dummy.c <<EOF
Xmain(argc, argv)
Xint argc;
Xchar *argv`5B`5D;
X`7B
X#ifdef __ELF__
X  printf ("%s-pc-linux-gnu`5Cn", argv`5B1`5D);
X#else
X  printf ("%s-pc-linux-gnuaout`5Cn", argv`5B1`5D);
X#endif
X  return 0;
X`7D
XEOF
X`09  $`7BCC-cc`7D dummy.c -o\0B06 2>/dev/null `26`26 ./dummy "$`7BUNAME_MACHIN
VE`7D" &0226 rm\4109\3E06&0226 exit 0
X`09  rm -f dummy.c\0806
X`09fi ;;
X# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.  earlier versions
V
X# are messed up and put the nodename in both sysname and \1D08.
X    i?86:DYNIX/ptx:4*:*)
X`09echo i386-sequent-sysv4
X`09exit 0 ;;
X    # SysVr5/Unixware7
X    i?86:*:5*:* `7C\0E06SYSTEM_V:5*:*)
X`09 if uname -a `7C grep SCO >/dev/null 2\0C0B; then
X`09    (/bin/uname -s`7Cegrep UnixWare >/dev/null) `26`26 UNAME_VER=uw$`7B
V\0E09SION`7D
X`09    if /bin/uname -X 2>/dev/null \0B0B; then
X`09`09(/bin/uname -X`7Cegrep i80486 >/dev/null) `26`26 UNAME_MACHINE=i486
X`09`09(/bin/uname -X`7Cegrep '`5EMachine.*Pentium' >/dev/null) `5C
X`09`09`09`26`26 UNAME_MACHINE=i586
X`09    fi
X`09`09echo $`7BUNAME_MACHINE`7D-sco-sysv\1908RELEASE`7D\2908VER`7D
X`09else
X`09`09echo $`7BUNAME_MACHINE`7D-unknown-sysv\1D08RELEASE`7D
X`09fi
X`09exit 0 ;;
X    i?86:*:4.*:* `7C\0F06SYSTEM_V\1606)
X`09if grep Novell /usr/include/link.h >/dev/null 2\0C0A; then
X`09`09echo $`7BUNAME_MACHINE`7D-univel-sysv4.2uw\2108VERSION`7D
X`09else
X`09`09echo $`7BUNAME_MACHINE`7D-pc-sysv\1808RELEASE`7D
X`09fi
X`09exit 0 ;;
X    i?86:*:3.2:*)
X`09if test -f /usr/options/cb.name; then
X`09`09UNAME_REL=`60sed -n 's/.*Version //p' </usr/options/cb.name`60
X`09`09echo $`7BUNAME_MACHINE`7D-pc-isc$\1606REL
X`09elif /bin/uname -X 2>/dev/null \0B0B; then
X`09`09UNAME_REL=`60(/bin/uname -X`7Cegrep Release`7Csed -e 's/.*= //')`60
X`09`09(/bin/uname -X`7Cegrep i80486 >/dev/null) `26`26 UNAME_MACHINE=i486
X`09`09(/bin/uname -X`7Cegrep '`5EMachine.*Pentium' >/dev/null) `5C
X`09`09`09`26`26 UNAME_MACHINE=i586
X`09`09echo $`7BUNAME_MACHINE`7D-pc-sco$\1606REL
X`09else
X`09`09echo $`7BUNAME_MACHINE`7D-pc-sysv32
X`09fi
X`09exit 0 ;;
X    Intel:Mach:3*:*)
X`09echo i386-pc-mach3
X`09exit 0 ;;
X    paragon:*:*:*)
X`09echo i860-intel-osf1
X`09exit 0 ;;
X    i860:*:4.*:*) # i860-SVR4
X`09if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>`261 ; then
X`09  echo i860-stardent-sysv$`7BUNAME_RELEASE`7D # S\2007 Vistra\3506SVR4
X`09else # Add other i860-SVR4 vendors below as they are discovered.
X`09  echo i860-unknown-sysv$`7BUNAME_RELEASE`7D  # U\2006\2D06SVR4
X`09fi
X`09exit 0 ;;
X    mini*:CTIX:SYS*5:*)
X`09# "miniframe"
X`09echo m68010-convergent-sysv
X`09exit 0 ;;
X    M68*:*:R3V`5B567`5D*:*)
X`09test -r /sysV68 `26`26 echo 'm68k-motorola-sysv' &0226 exit 0 ;;
X    3`5B34`5D??:*:4.0:3.0 `7C\1408,*:\160C4850:\2709)
X`09OS_REL=''
X`09test -r /etc/.relid `5C
X`09`26`26 OS_REL=.`60sed -n 's/`5B`5E `5D* \0606`5C(`5B0-9`5D`5B0-9`5D`5C).*/
V`5C1/p' < /etc/.relid`60
X`09/bin/uname -p 2>/dev/null `7C grep 86 \150B`5C
X`09  `26`26 echo i486-ncr-sysv4.3$`7BOS_REL`7D &0226 exit 0
X`09/bin/uname -p 2>/dev/null `7C /bin/grep entium \1E0B`5C
X`09  `26`26 echo i586-ncr-sysv4.3$`7BOS_REL`7D &0226 exit 0 ;;
X    3`5B34`5D??:*:4.0:* `7C\1208,*:\1407)
X        /bin/uname -p 2>/dev/null `7C grep 86 \150B`5C
X          `26`26 echo i486-ncr-sysv4 &0226 exit 0 ;;
X    m68*:LynxOS:2.*:*)
X`09echo m68k-unknown-lynxos$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    mc68030:UNIX_System_V:4.*:*)
X`09echo m68k-atari-sysv4
X`09exit 0 ;;
X    i?86:LynxOS:2.*:*)
X`09echo i386-unknown-lynxos$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    TSUNAMI:LynxOS:2.*:*)
X`09echo sparc-unknown-lynxos$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    rs6000:LynxOS:2.*:* `7C PowerPC\170D)
X`09echo rs6000-unknown-lynxos$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    SM`5BBE`5DS:UNIX_SV:*:*)
X`09echo mips-dde-sysv$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    RM*:SINIX-*:*:*)
X`09echo mips-sni-sysv4
X`09exit 0 ;;
X    *:SINIX-*:*:*)
X`09if uname -p 2>/dev/null \0B0B; then
X`09`09UNAME_MACHINE=`60(uname -p) 2>/dev/null`60
X`09`09echo $`7BUNAME_MACHINE`7D-sni-sysv4
X`09else
X`09`09echo ns32k-sni-sysv
X`09fi
X`09exit 0 ;;
X    *:UNIX_System_V:4*:FTX*)
X`09# From Gerald Hewes <hewes@openmarket.com>.
X`09# How about differentiating between stratus architectures? -djm
X`09echo hppa1.1-stratus-sysv4
X`09exit 0 ;;
X    *:*:*:FTX*)
X`09# From seanf@swdc.stratus.com.
X`09echo i860-stratus-sysv4
X`09exit 0 ;;
X    mc68*:A/UX:*:*)
X`09echo m68k-apple-aux$`7BUNAME_RELEASE`7D
X`09exit 0 ;;
X    R3000:*System_V*:*:* `7C R4000:UNIX_SYSV:*:*)
X`09if `5B -d /usr/nec `5D; then
X`09        echo mips-nec-sysv$`7BUNAME_RELEASE`7D
X`09else
X`09        echo mips-unknown-sysv$`7BUNAME_RELEASE`7D
X`09fi
X        exit 0 ;;
X    PENTIUM:CPunix:4.0*:*) # Unisys `60ClearPath HMP IX 4000' SVR4/MP effort
X        \0808\100B# says <Richard.M.Bartel@ccMail.Census.GOV>
X        echo i586-unisys-sysv4
X        exit 0 ;;
Xesac
X
X#echo '(No uname command or\1107output not recognized.)' 1>`262
X#echo "$`7BUNAME_MACHINE`7D:\1108SYSTEM\100ARELEAS\210BVERSION`7D" 1>`262
X
Xcat >dummy.c <<EOF
X#ifdef _SEQUENT_
X# include <sys/types.h>
X# include <sys/utsname.h>
X#endif
Xmain ()
X`7B
X#if defined (sony)
X#if defined (MIPSEB)
X  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
X     I don't know....  */
X  printf ("mips-sony-bsd`5Cn"); exit (0);
X#else
X#include <sys/param.h>
X  printf ("m68k-sony-newsos%s`5Cn",
X#ifdef NEWSOS4
X          "4"
X#else
X`09  ""
X#endif
X         ); exit (0);
X#endif
X#endif
X
X#if defined (__arm) `26`26\130Dcorn\1510unix)
X  printf ("arm-acorn-riscix"); exit (0);
X#endif
X
X#if defined (hp300) `26`26 !\140Bux)
X  printf ("m68k-hp-bsd`5Cn"); exit (0);
X#endif
X
X#if defined (NeXT)
X#if !defined (__ARCHITECTURE__)
X#define __ARCHITECTURE__ "m68k"
X#endif
X  int version;
X  version=`60(hostinfo `7C sed -n 's/.*NeXT Mach `5C(`5B0-9`5D*`5C).*/`5C1/p')
V 2>/dev/null`60;
X  printf ("%s-next-nextstep%d`5Cn", __ARCHITECTURE__, version);
X  exit (0);
X#endif
X
X#if defined (MULTIMAX) `7C`7C\160An16)
X#if defined (UMAXV)
X  printf ("ns32k-encore-sysv`5Cn"); exit (0);
X#else
X#if defined (CMU)
X  printf ("ns32k-encore-mach`5Cn"); exit (0);
X#else
X  printf ("ns32k-encore-bsd`5Cn"); exit (0);
X#endif
X#endif
X#endif
X
X#if defined (__386BSD__)
X  printf ("i386-pc-bsd`5Cn"); exit (0);
X#endif
X
X#if defined (sequent)
X#if defined (i386)
X  printf ("i386-sequent-dynix`5Cn"); exit (0);
X#endif
X#if defined (ns32000)
X  printf ("ns32k-sequent-dynix`5Cn"); exit (0);
X#endif
X#endif
X
X#if defined (_SEQUENT_)
X    struct utsname un;
X
X    uname(`26un);
X
X    if (strncmp(un.version, "V2", 2) == 0) `7B
X`09printf ("i386-sequent-ptx2`5Cn"); exit (0);
X    `7D
X    if (strncmp(un.version, "V1", 2) == 0) `7B /* XXX is V1 correct? */
X`09printf ("i386-sequent-ptx1`5Cn"); exit (0);
X    `7D
X    printf ("i386-sequent-ptx`5Cn"); exit (0);
X
X#endif
X
X#if defined (vax)
X#if !defined (ultrix)
X  printf ("vax-dec-bsd`5Cn"); exit (0);
X#else
X  printf ("vax-dec-ultrix`5Cn"); exit (0);
X#endif
X#endif
X
X#if defined (alliant) `26`26\150Ai860)
X  printf ("i860-alliant-bsd`5Cn"); exit (0);
X#endif
X
X  exit (1);
X`7D
XEOF
X
X$`7BCC-cc`7D dummy.c -o\0B06 2>/dev/null `26`26 ./dummy &0226 rm\2E09\1409exit
V 0
Xrm -f dummy.c\0806
X
X# Apollos put the system type in the environment.
X
Xtest -d /usr/apollo `26`26 `7B echo $`7BISP`7D-\1806-$`7BSYSTYPE`7D; exit 0;`20
V`7D
X
X# Convex versions that predate uname can use getsysinfo(1)
X
Xif `5B -x /usr/convex/getsysinfo `5D
Xthen
X    case `60getsysinfo -f cpu_type`60 in
X    c1*)
X`09echo c1-convex-bsd
X`09exit 0 ;;
X    c2*)
X`09if getsysinfo -f scalar_acc
X`09then echo c32-convex-bsd
X`09else echo c2-convex-bsd
X`09fi
X`09exit 0 ;;
X    c34*)
X`09echo c34-convex-bsd
X`09exit 0 ;;
X    c38*)
X`09echo c38-convex-bsd
X`09exit 0 ;;
X    c4*)
X`09echo c4-convex-bsd
X`09exit 0 ;;
X    esac
Xfi
X
X#echo '(Unable to guess system type)' 1>`262
X
Xexit 1
$ call unpack [.VILE-8_0]CONFIG.GUESS;1 -
 1278606719 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 44 22 152
$!
$ create 'f'
X#! /bin/sh
X# Configuration valid\0B06subroutine script, version 1.1.
X#   Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation, Inc.
X# This file is (in principle) common to ALL GNU software.
X# The presence of a machine in this file suggests that SOME GNU software
X# can handle that machine.  It does not imply ALL GNU software can.
X#
X# This file is free software; you can redistribute it and/or modify
X# it under the terms of the GNU General Public License as published by
X# the Free Software Foundation; either version 2 of the License, or
X# (at your option) any later version.
X#
X# This program is distributed in the hope that it will be useful,
X# but WITHOUT ANY WARRANTY; without even the implied warranty of
X# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X# GNU General Public License for more details.
X#
X# You should have received a copy of the GNU General Public License
X# along with this program; if not, write to the Free Software
X# Foundation, Inc., 59 Temple Place - Suite 330,
X# Boston, MA 02111-1307, USA.
X
X# As a special exception to the GNU General Public License, if you
X# distribute this file as part of a program that contains a
X# configuration script generated by Autoconf, you may include it under
X# the same distribution terms that you use for the rest of\1D06program.
X
X# Configuration subroutine to validate and canonicalize a c\380Dtype.
X# Supply the specified configuration type as an argument.
X# If it is invalid, we print an error message on stderr and exit with code 1.
V
X# Otherwise, we print the canonical config type on stdout and succeed.
X
X# This file is supposed to be the same for all GNU packages
X# and recognize all the CPU types, system\0E06 and aliases
X# that are meaningful with *any* GNU software.
X# Each package is responsible for reporting which valid configurations
X# it does not support.  The user should be able to distinguish
X# a failure to support a valid configuration from a meaningless
X# configuration.
X
X# The goal of this file is to map all the various variations of a given
X# machine specification into a singl\1C12 the form:
X#`09CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
X# or in some cases, the newer four-part form:
X#`09CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
X# It is wrong to echo any other type of specification.
X
Xif `5B x$1 = x `5D
Xthen
X`09echo Configuration name missing. 1>`262
X`09echo "Usage: $0 CPU-MFR-OPSYS" 1>`262
X`09echo "or     $0 ALIAS" 1>`262
X`09echo where ALIAS is a recognized configuration type. 1>`262
X`09exit 1
Xfi
X
X# First pass through any local machine types.
Xcase $1 in
X`09*local*)
X`09`09echo $1
X`09`09exit 0
X`09`09;;
X`09*)
X`09;;
Xesac
X
X# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
X# Here we must recognize all the valid KERNEL-OS combinations.
Xmaybe_os=`60echo $1 `7C sed 's/`5E`5C(.*`5C)-`5C(`5B`5E-`5D*-`5B`5E-`5D*`5C)$/
V`5C2/'`60
Xcase $maybe_os in
X  linux-gnu*)
X    os=-$maybe_os
X    basic_machine=`60echo $1 `7C sed 's/`5E`5C(.*`5C)-`5C(`5B`5E-`5D*-`5B`5E-
V`5D*`5C)$/`5C1/'`60
X    ;;
X  *)
X    basic_machine=`60echo $1 `7C sed 's/-`5B`5E-`5D*$//'`60
X    if `5B $basic_machine != $1 `5D
X    then os=`60echo $1 `7C sed 's/.*-/-/'`60
X    else os=; fi
X    ;;
Xesac
X
X### Let's recognize common machines as not being operating systems so
X### that things like config.sub decstation-3100 work.  We also
X### recognize some manufacturers as not being operating systems, so we
X### can provide default operating systems below.
Xcase $os in
X`09-sun*os*)
X`09`09# Prevent following clause from handling this invalid input.
X`09`09;;
X`09-dec* `7C -mips* `7C -sequent* `7C -encore* `7C -pc532\2106gi\2906ony* `7C
V `5C
X`09-att* `7C -7300* `7C -3\0908delta* `7C -motorol\0D06sun`5B234`5D* `7C `5C
X`09-unicom* `7C -ib\0806next `7C -hp `7C -isi* `7C -apollo `7C -altos* `7C `5C
V
X`09-convergent* `7C -ncr\0806ews `7C -32* `7C -3600\09061\0907hitachi* `7C`5C
V
X`09-c`5B123`5D* `7C -convex* `7C -sun `7C -crds `7C -omron* `7C -dg `7C -ultra
V `7C -tti* `7C `5C
X`09-harris `7C -dolphin `7C -highlevel `7C -gould `7C -cbm `7C -ns `7C -massco
Vmp `7C `5C
X`09-apple)
X`09`09os=
X`09`09basic_machine=$1
X`09`09;;
X`09-hiux*)
X`09`09os=-hiuxwe2
X`09`09;;
X`09-sco5)
X`09`09os=sco3.2v5
X`09`09basic_machine=`60echo $1 `7C sed -e 's/86-.*/86-pc/'`60
X`09`09;;
X`09-sco4)
X`09`09os=-sco3.2v4
X`09`09basic_machine=`60echo $1 `7C sed -e 's/86-.*/86-pc/'`60
X`09`09;;
X`09-sco3.2.`5B4-9`5D*)
X`09`09os=`60echo $os `7C sed -e 's/sco3.2.\0807v/'`60
X`09`09basic_machine=`60echo $1 `7C sed -e 's/86-.*/86-pc/'`60
X`09`09;;
X`09-sco3.2v`5B4-9`5D*)
X`09`09# Don't forget version if it is 3.2v4 or newer.
X`09`09basic_machine=`60echo $1 `7C sed -e 's/86-.*/86-pc/'`60
X`09`09;;
X`09-sco*)
X`09`09os=-sco3.2v2
X`09`09basic_machine=`60echo $1 `7C sed -e 's/86-.*/86-pc/'`60
X`09`09;;
X`09-isc)
X`09`09os=-isc2.2
X`09`09basic_machine=`60echo $1 `7C sed -e 's/86-.*/86-pc/'`60
X`09`09;;
X`09-clix*)
X`09`09basic_machine=clipper-intergraph
X`09`09;;
X`09-isc*)
X`09`09basic_machine=`60echo $1 `7C sed -e 's/86-.*/86-pc/'`60
X`09`09;;
X`09-lynx*)
X`09`09os=-lynxos
X`09`09;;
X`09-ptx*)
X`09`09basic_machine=`60echo $1 `7C sed -e 's/86-.*/86-sequent/'`60
X`09`09;;
X`09-windowsnt*)
X`09`09os=`60echo $os `7C sed -e 's/windowsnt/winnt/'`60
X`09`09;;
X`09-psos*)
X`09`09os=-psos
X`09`09;;
Xesac
X
X# Decode aliases for certain CPU-COMPANY combinations.
Xcase $basic_machine in
X`09# Recognize the basic CPU types without company name.
X`09# Some are omitted here because they have special meanings below.
X`09tahoe `7C i860 `7C m68k\0706000 `7C m88k `7C ns32k `7C arm `5C
X`09`09`7C arme`5Blb`5D `7C pyramid `5C
X`09`09`7C tron `7C a29k `7C 580 `7C i960 `7C h8300 `7C hppa\07071.\11081.1 `5C
V
X`09`09`7C alpha `7C we32k `7C ns16k `7C clipper `7C i370 `7C sh `5C
X`09`09`7C powerpc \0A09le `7C 1750a `7C dsp16xx `7C mips64\0907el `5C
X`09`09`7C pdp11 `7C mips64el\0B09orion\0E0Eel `5C
X`09`09`7C sparc \0807let\0B09ite\170864)
X`09`09basic_machine=$\0F0D-unknown
+-+-+-+-+-+-+-+-  END  OF PART 30 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 31 -+-+-+-+-+-+-+-+
X`09`09;;
X`09# We use `60pc' rather than `60unknown'
X`09# because (1) that's what they normally are, and
X`09# (2) the word "unknown" tends to confuse beginning users.
X`09i`5B3456`5D86)
X`09  basic_machine=$\0F0D-pc
X`09  ;;
X`09# Object if more than one company name word.
X`09*-*-*)
X`09`09echo Invalid configuration `5C`60$1`5C': machine `5C`60$basic_\1107`5C'
V not recognized 1>`262
X`09`09exit 1
X`09`09;;
X`09# Recognize the basic CPU types with company name.
X`09vax-* `7C tahoe-* `7C i`5B3456`5D86\0E06860-* `7C m68k\090800\140788k-* `5C
V
X`09      `7C sparc-* `7C ns32k-* `7C fx80-* `7C arm-* `7C c`5B123`5D* `5C
X`09      `7C mips-* `7C pyramid-* `7C tron-* `7C a29k-* `7C romp\0906s6000
V\3206ower-* `5C
X`09      `7C none-* `7C 580-* `7C cray2-* `7C h830\1406i96\1D06xmp-* `7C ymp-*
V `5C
X`09      `7C hppa-*\09071.0\0C0B1-* `7C alph\2206we32k-* `7C cydr\3606ns16k-*
V `5C
X`09      `7C pn-* `7C np1-* `7C xps100-* `7C clipper-* `7C orio\2906sparclite-
V* `5C
X`09      `7C pdp11-* `7C sh-* `7C powerpc\0C0Cle\2106parc64-* `7C mips\0B0Bel-
V* `5C
X`09      `7C mips64el-*\0D09orion\1010\2207f301-*)
X`09`09;;
X`09# Recognize the various machine names and aliases which stand
X`09# for a CPU type and a company and sometimes even an OS.
X`093b1 `7C 7300\0707-att `7C att-\1607pc\1F07safari `7C unixpc)
X`09`09basic_machine=m68000-att
X`09`09;;
X`093b*)
X`09`09basic_machine=we32k-att
X`09`09;;
X`09alliant `7C fx80)
X`09`09basic_machine=fx80-alliant
X`09`09;;
X`09altos `7C altos3068)
X`09`09basic_machine=m68k-altos
X`09`09;;
X`09am29k)
X`09`09basic_machine=a29k-none
X`09`09os=-bsd
X`09`09;;
X`09amdahl)
X`09`09basic_machine=580-amdahl
X`09`09os=-sysv
X`09`09;;
X`09amiga `7C amiga-*)
X`09`09basic_machine=m68k-cbm
X`09`09;;
X`09amigados)
X`09`09basic_machine=m68k-cbm
X`09`09os=-amigados
X`09`09;;
X`09amigaunix `7C amix)
X`09`09basic_machine=m68k-cbm
X`09`09os=-sysv4
X`09`09;;
X`09apollo68)
X`09`09basic_machine=m68k-apollo
X`09`09os=-sysv
X`09`09;;
X`09aux)
X`09`09basic_machine=m68k-apple
X`09`09os=-aux
X`09`09;;
X`09balance)
X`09`09basic_machine=ns32k-sequent
X`09`09os=-dynix
X`09`09;;
X`09convex-c1)
X`09`09basic_machine=c1-convex
X`09`09os=-bsd
X`09`09;;
X`09convex-c2)
X`09`09basic_machine=c2-convex
X`09`09os=-bsd
X`09`09;;
X`09convex-c32)
X`09`09basic_machine=c32-convex
X`09`09os=-bsd
X`09`09;;
X`09convex-c34)
X`09`09basic_machine=c34-convex
X`09`09os=-bsd
X`09`09;;
X`09convex-c38)
X`09`09basic_machine=c38-convex
X`09`09os=-bsd
X`09`09;;
X`09cray `7C ymp)
X`09`09basic_machine=ymp-cray
X`09`09os=-unicos
X`09`09;;
X`09cray2)
X`09`09basic_machine=cray2-cray
X`09`09os=-unicos
X`09`09;;
X`09`5Bctj`5D90-cray)
X`09`09basic_machine=c90-cray
X`09`09os=-unicos
X`09`09;;
X`09crds `7C unos)
X`09`09basic_machine=m68k-crds
X`09`09;;
X`09da30 `7C da30-*)
X`09`09basic_machine=m68k-da30
X`09`09;;
X`09decstation `7C \0D0A-3100 `7C pmax\0707-* `7C pmi\2907\2107\4007n)
X`09`09basic_machine=mips-dec
X`09`09;;
X`09delta `7C 3300 `7C motorola-\1010\2806`5C
X`09      `7C 3300-motorola `7C delta\1109)
X`09`09basic_machine=m68k-motorola
X`09`09;;
X`09delta88)
X`09`09basic_machine=m88k-motorola
X`09`09os=-sysv3
X`09`09;;
X`09dpx20 `7C dpx20-*)
X`09`09basic_machine=rs6000-bull
X`09`09os=-bosx
X`09`09;;
X`09dpx2* `7C dpx2*-bull)
X`09`09basic_machine=m68k-bull
X`09`09os=-sysv3
X`09`09;;
X`09ebmon29k)
X`09`09basic_machine=a29k-amd
X`09`09os=-ebmon
X`09`09;;
X`09elxsi)
X`09`09basic_machine=elxsi-elxsi
X`09`09os=-bsd
X`09`09;;
X`09encore `7C umax `7C mmax)
X`09`09basic_machine=ns32k-encore
X`09`09;;
X`09fx2800)
X`09`09basic_machine=i860-alliant
X`09`09;;
X`09genix)
X`09`09basic_machine=ns32k-ns
X`09`09;;
X`09gmicro)
X`09`09basic_machine=tron-gmicro
X`09`09os=-sysv
X`09`09;;
X`09h3050r* `7C hiux*)
X`09`09basic_machine=hppa1.1-hitachi
X`09`09os=-hiuxwe2
X`09`09;;
X`09h8300hms)
X`09`09basic_machine=h8300-hitachi
X`09`09os=-hms
X`09`09;;
X`09harris)
X`09`09basic_machine=m88k-harris
X`09`09os=-sysv3
X`09`09;;
X`09hp300-*)
X`09`09basic_machine=m68k-hp
X`09`09;;
X`09hp300bsd)
X`09`09basic_machine=m68k-hp
X`09`09os=-bsd
X`09`09;;
X`09hp300hpux)
X`09`09basic_machine=m68k-hp
X`09`09os=-hpux
X`09`09;;
X`09hp9k2`5B0-9`5D`5B0-9`5D `7C hp9k31`5B0-9`5D)
X`09`09basic_machine=m68000-hp
X`09`09;;
X`09hp9k3`5B2-9`5D`5B0-9`5D)
X`09`09basic_machine=m68k-hp
X`09`09;;
X`09hp9k7`5B0-9`5D`5B0-9`5D `7C hp\10109k8`5B0-9`5D7 `7C hp\0C07)
X`09`09basic_machine=hppa1.1-hp
X`09`09;;
X`09hp9k8`5B0-9`5D`5B0-9`5D `7C hp\100B)
X`09`09basic_machine=hppa1.0-hp
X`09`09;;
X`09hppa-next)
X`09`09os=-nextstep3
X`09`09;;
X`09i370-ibm* `7C ibm*)
X`09`09basic_machine=i370-ibm
X`09`09os=-mvs
X`09`09;;
X# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
X`09i`5B3456`5D86v32)
X`09`09basic_machine=`60echo $1 `7C sed -e 's/86.*/86-pc/'`60
X`09`09os=-sysv32
X`09`09;;
X`09i`5B3456`5D86v4*)
X`09`09basic_machine=`60echo $1 `7C sed -e 's/86.*/86-pc/'`60
X`09`09os=-sysv4
X`09`09;;
X`09i`5B3456`5D86v)
X`09`09basic_machine=`60echo $1 `7C sed -e 's/86.*/86-pc/'`60
X`09`09os=-sysv
X`09`09;;
X`09i`5B3456`5D86sol2)
X`09`09basic_machine=`60echo $1 `7C sed -e 's/86.*/86-pc/'`60
X`09`09os=-solaris2
X`09`09;;
X`09iris `7C iris4d)
X`09`09basic_machine=mips-sgi
X`09`09case $os in
X`09`09    -irix*)
X`09`09`09;;
X`09`09    *)
X`09`09`09os=-irix4
X`09`09`09;;
X`09`09esac
X`09`09;;
X`09isi68 `7C isi)
X`09`09basic_machine=m68k-isi
X`09`09os=-sysv
X`09`09;;
X`09m88k-omron*)
X`09`09basic_machine=m88k-omron
X`09`09;;
X`09magnum `7C m3230)
X`09`09basic_machine=mips-mips
X`09`09os=-sysv
X`09`09;;
X`09merlin)
X`09`09basic_machine=ns32k-utek
X`09`09os=-sysv
X`09`09;;
X`09miniframe)
X`09`09basic_machine=m68000-convergent
X`09`09;;
X`09mips3*-*)
X`09`09basic_machine=`60echo $\150D `7C sed -e 's/mips3/mips64/'`60
X`09`09;;
X`09mips3*)
X`09`09basic_machine=`60echo $\150D `7C sed -e 's/mips3/mips64/'`60-unknown
X`09`09;;
X`09ncr3000)
X`09`09basic_machine=i486-ncr
X`09`09os=-sysv4
X`09`09;;
X`09news `7C news700\0A078\0A09900)
X`09`09basic_machine=m68k-sony
X`09`09os=-newsos
X`09`09;;
X`09news1000)
X`09`09basic_machine=m68030-sony
X`09`09os=-newsos
X`09`09;;
X`09news-3600 `7C risc-news)
X`09`09basic_machine=mips-sony
X`09`09os=-newsos
X`09`09;;
X`09next `7C m*-next )
X`09`09basic_machine=m68k-next
X`09`09case $os in
X`09`09    -nextstep* )
X`09`09`09;;
X`09`09    -ns2*)
X`09`09      os=-nextstep2
X`09`09`09;;
X`09`09    *)
X`09`09      os=-nextstep3
X`09`09`09;;
X`09`09esac
X`09`09;;
X`09nh3000)
X`09`09basic_machine=m68k-harris
X`09`09os=-cxux
X`09`09;;
X`09nh`5B45`5D000)
X`09`09basic_machine=m88k-harris
X`09`09os=-cxux
X`09`09;;
X`09nindy960)
X`09`09basic_machine=i960-intel
X`09`09os=-nindy
X`09`09;;
X`09np1)
X`09`09basic_machine=np1-gould
X`09`09;;
X`09pa-hitachi)
X`09`09basic_machine=hppa1.1-hitachi
X`09`09os=-hiuxwe2
X`09`09;;
X`09paragon)
X`09`09basic_machine=i860-intel
X`09`09os=-osf
X`09`09;;
X`09pbd)
X`09`09basic_machine=sparc-tti
X`09`09;;
X`09pbb)
X`09`09basic_machine=m68k-tti
X`09`09;;
X        pc532 `7C\0806-*)
X`09`09basic_machine=ns32k-pc532
X`09`09;;
X`09pentium `7C p5)
X`09`09basic_machine=i586-intel
X`09`09;;
X`09pentiumpro `7C p6)
X`09`09basic_machine=i686-intel
X`09`09;;
X`09pentium-* `7C p5-*)
X`09`09basic_machine=i586-`60echo $\1A0D `7C sed 's/`5E`5B`5E-`5D*-//'`60
X`09`09;;
X`09pentiumpro-* `7C p6-*)
X`09`09basic_machine=i686-`60echo $\1A0D `7C sed 's/`5E`5B`5E-`5D*-//'`60
X`09`09;;
X`09k5)
X`09`09# We don't have specific support for AMD's K5 yet, so just call it a Pen
Vtium
X`09`09basic_machine=i586-amd
X`09`09;;
X`09nexen)
X`09`09# We don't have specific support for Nexgen yet, so just call it a Penti
Vum
X`09`09basic_machine=i586-nexgen
X`09`09;;
X`09pn)
X`09`09basic_machine=pn-gould
X`09`09;;
X`09power)`09basic_machine=rs6000-ibm
X`09`09;;
X`09ppc)`09basic_machine=powerpc-unknown
X`09        ;;
X`09ppc-*)`09basic_machine=powerpc-`60echo $\1D0D `7C sed 's/`5E`5B`5E-`5D*-//'
V`60
X`09`09;;
X`09ppcle `7C powerpclitt\1006pc-\190C-little)
X`09`09basic_machine=powerpcle-unknown
X`09        ;;
X`09ppcle-* `7C powerpclittle-*)
X`09`09basic_machine=powerpcle-`60echo $\1F0D `7C sed 's/`5E`5B`5E-`5D*-//'`60
V
X`09`09;;
X`09ps2)
X`09`09basic_machine=i386-ibm
X`09`09;;
X`09rm`5B46`5D00)
X`09`09basic_machine=mips-siemens
X`09`09;;
X`09rtpc `7C rtpc-*)
X`09`09basic_machine=romp-ibm
X`09`09;;
X`09sequent)
X`09`09basic_machine=i386-sequent
X`09`09;;
X`09sh)
X`09`09basic_machine=sh-hitachi
X`09`09os=-hms
X`09`09;;
X`09sps7)
X`09`09basic_machine=m68k-bull
X`09`09os=-sysv2
X`09`09;;
X`09spur)
X`09`09basic_machine=spur-unknown
X`09`09;;
X`09sun2)
X`09`09basic_machine=m68000-sun
X`09`09;;
X`09sun2os3)
X`09`09basic_machine=m68000-sun
X`09`09os=-sunos3
X`09`09;;
X`09sun2os4)
X`09`09basic_machine=m68000-sun
X`09`09os=-sunos4
X`09`09;;
X`09sun3os3)
X`09`09basic_machine=m68k-sun
X`09`09os=-sunos3
X`09`09;;
X`09sun3os4)
X`09`09basic_machine=m68k-sun
X`09`09os=-sunos4
X`09`09;;
X`09sun4os3)
X`09`09basic_machine=sparc-sun
X`09`09os=-sunos3
X`09`09;;
X`09sun4os4)
X`09`09basic_machine=sparc-sun
X`09`09os=-sunos4
X`09`09;;
X`09sun4sol2)
X`09`09basic_machine=sparc-sun
X`09`09os=-solaris2
X`09`09;;
X`09sun3 `7C sun3-*)
X`09`09basic_machine=m68k-sun
X`09`09;;
X`09sun4)
X`09`09basic_machine=sparc-sun
X`09`09;;
X`09sun386 `7C \0906i `7C roadrunner)
X`09`09basic_machine=i386-sun
X`09`09;;
X`09symmetry)
X`09`09basic_machine=i386-sequent
X`09`09os=-dynix
X`09`09;;
X`09tower `7C tower-32)
X`09`09basic_machine=m68k-ncr
X`09`09;;
X`09udi29k)
X`09`09basic_machine=a29k-amd
X`09`09os=-udi
X`09`09;;
X`09ultra3)
X`09`09basic_machine=a29k-nyu
X`09`09os=-sym1
X`09`09;;
X`09vaxv)
X`09`09basic_machine=vax-dec
X`09`09os=-sysv
X`09`09;;
X`09vms)
X`09`09basic_machine=vax-dec
X`09`09os=-vms
X`09`09;;
X       vpp*`7Cvx`7Cvx-*)
X        \0807basic_machine=f301-fujitsu
X        \0807;;
X`09vxworks960)
X`09`09basic_machine=i960-wrs
X`09`09os=-vxworks
X`09`09;;
X`09vxworks68)
X`09`09basic_machine=m68k-wrs
X`09`09os=-vxworks
X`09`09;;
X`09vxworks29k)
X`09`09basic_machine=a29k-wrs
X`09`09os=-vxworks
X`09`09;;
X`09xmp)
X`09`09basic_machine=xmp-cray
X`09`09os=-unicos
X`09`09;;
X        xps `7C xps100)
X`09`09basic_machine=xps100-honeywell
X`09`09;;
X`09none)
X`09`09basic_machine=none-none
X`09`09os=-none
X`09`09;;
X
X# Here we handle the default manufacturer of certain CPU types.  It is in
X# some cases the only manufacturer, in others, it i\2806most popular.
X`09mips)
X`09`09basic_machine=mips-mips
X`09`09;;
X`09romp)
X`09`09basic_machine=romp-ibm
X`09`09;;
X`09rs6000)
X`09`09basic_machine=rs6000-ibm
X`09`09;;
X`09vax)
X`09`09basic_machine=vax-dec
X`09`09;;
X`09pdp11)
X`09`09basic_machine=pdp11-dec
X`09`09;;
X`09we32k)
X`09`09basic_machine=we32k-att
X`09`09;;
X`09sparc)
X`09`09basic_machine=sparc-sun
X`09`09;;
X        cydra)
X`09`09basic_machine=cydra-cydrome
X`09`09;;
X`09orion)
X`09`09basic_machine=orion-highlevel
X`09`09;;
X`09orion105)
X`09`09basic_machine=clipper-highlevel
X`09`09;;
X`09*)
X`09`09echo Invalid configuration `5C`60$1`5C': machine `5C`60$basic_\1107`5C'
V not recognized 1>`262
X`09`09exit 1
X`09`09;;
Xesac
X
X# Here we canonicalize certain aliases for manufacturers.
Xcase $basic_machine in
X`09*-digital*)
X`09`09basic_machine=`60echo $\150D `7C sed 's/digital.*/dec/'`60
X`09`09;;
X`09*-commodore*)
X`09`09basic_machine=`60echo $\150D `7C sed 's/commodore.*/cbm/'`60
X`09`09;;
X`09*)
X`09`09;;
Xesac
X
X# Decode manufacturer-specific aliases for certain operating systems.
X
Xif `5B x"$os" != x"" `5D
Xthen
Xcase $os in
X        # First match some system type aliases
X        # that might get confused with valid system types.
X`09# -solaris* is a basic system type, with this one exception.
X`09-solaris1 `7C \0C09.*)
X`09`09os=`60echo $os `7C sed -e 's`7Csolaris1`7Csunos4`7C'`60
X`09`09;;
X`09-solaris)
X`09`09os=-solaris2
X`09`09;;
X`09-unixware* `7C svr4*)
X`09`09os=-sysv4
X`09`09;;
X`09-gnu/linux*)
X`09`09os=`60echo $os `7C sed -e 's`7Cgnu/linux`7Clinux-gnu`7C'`60
X`09`09;;
X`09# First accept the basic system types.
X`09# The portable systems comes first.
X`09# Each alternative MUST END IN A *, to match a version number.
X`09# -sysv* is not here because it comes later, after sysvr4.
X`09-gnu* `7C -bsd* `7C -mach\0906inix* `7C -ge\0A08ultr\1507irix* `5C
X`09      `7C -*vms* `7C -sco* `7C -esix* `7C -isc* `7C -a\1007sunos\0909`5B34
V`5D*`5C
X`09      `7C -hpux* `7C -unos* `7C -osf* `7C -luna* `7C -dg\2307solari\2606sym
V* `5C
X`09      `7C -amigados* `7C -ms\0A08news\1507unic\2007aof\0807s* `5C
X`09      `7C -nindy* `7C -vxsim\0A07works* `7C -ebmon* `7C -hm\1206mvs* `5C
X`09      `7C -clix* `7C -riscos* `7C -uniplu\0C06iris\2006tu* `7C -xenix* `5C
V
X`09      `7C -hiux* `7C -386bsd* `7C -net\0B08open\1708free\2308riscix* `5C
X`09      `7C -lynxos* `7C -bosx* `7C -nextstep* `7C -cxu\1606aout* `7C -elf*`20
V`5C
X`09      `7C -ptx* `7C -coff* `7C -e\0A09winnt* `7C -domain* `7C -vsta* `5C
X`09      `7C -udi* `7C -eab\0906lites* `7C -ieee* `7C -go32* `7C -aux* `5C
X`09      `7C -cygwin32* `7C -pe\0706sos* `7C -mos\0906proelf* `7C -rtems* `5C
V
X`09      `7C -linux-gnu* `7C -uxpv*)
X`09# Remember, each alternative MUST END IN *, to match a version number.
X`09`09;;
X`09-linux*)
X`09`09os=`60echo $os `7C sed -e 's`7Clinux\0606-gnu`7C'`60
X`09`09;;
X`09-sunos5*)
X`09`09os=`60echo $os `7C sed -e 's`7Csunos5`7Csolaris2`7C'`60
X`09`09;;
X`09-sunos6*)
X`09`09os=`60echo $os `7C sed -e 's`7Csunos6`7Csolaris3`7C'`60
X`09`09;;
X`09-osfrose*)
X`09`09os=-osfrose
X`09`09;;
X`09-osf*)
X`09`09os=-osf
X`09`09;;
X`09-utek*)
X`09`09os=-bsd
X`09`09;;
X`09-dynix*)
X`09`09os=-bsd
X`09`09;;
X`09-acis*)
X`09`09os=-aos
X`09`09;;
X`09-ctix* `7C -uts*)
X`09`09os=-sysv
X`09`09;;
X`09-ns2 )
X`09        os=-nextstep2
X`09`09;;
X`09# Preserve the version number of sinix5.
X`09-sinix5.*)
X`09`09os=`60echo $os `7C sed -e 's`7Csinix`7Csysv`7C'`60
X`09`09;;
X`09-sinix*)
X`09`09os=-sysv4
X`09`09;;
X`09-triton*)
X`09`09os=-sysv3
X`09`09;;
X`09-oss*)
X`09`09os=-sysv3
X`09`09;;
X`09-svr4)
X`09`09os=-sysv4
X`09`09;;
X`09-svr3)
X`09`09os=-sysv3
X`09`09;;
X`09-sysvr4)
X`09`09os=-sysv4
X`09`09;;
X`09# This must come after -sysvr4.
X`09-sysv*)
X`09`09;;
X`09-xenix)
X`09`09os=-xenix
X`09`09;;
X`09-none)
X`09`09;;
X`09*)
X`09`09# Get rid of the `60-' at the beginning of $os.
X`09`09os=`60echo $os `7C sed 's/`5B`5E-`5D*-//'`60
X`09`09echo Invalid configuration `5C`60$1`5C': system `5C`60$os`5C' not recogn
Vized 1>`262
X`09`09exit 1
X`09`09;;
Xesac
Xelse
X
X# Here we handle the default operating systems that come with various machines
V.
X# The value should be what the vendor currently ships ou\1F06door with their
X# machine or put another way, the most popular os provided with\2206\4206.
X
X# Note that if you're going to try to match "-MANUFACTURER" here (say,
X# "-sun"), then you have to tell the case statement up towards the top
X# that MANUFACTURER isn't an operating system.  Otherwise, code above
X# will signal an error saying that MANUFACTURER isn't an operating
X# system, and we'll never get to this point.
X
Xcase $basic_machine in
X`09*-acorn)
X`09`09os=-riscix1.2
X`09`09;;
X`09arm*-semi)
X`09`09os=-aout
X`09`09;;
X        pdp11-*)
X`09`09os=-none
X`09`09;;
X`09*-dec `7C vax-*)
X`09`09os=-ultrix4.2
X`09`09;;
X`09m68*-apollo)
X`09`09os=-domain
X`09`09;;
X`09i386-sun)
X`09`09os=-sunos4.0.2
X`09`09;;
X`09m68000-sun)
X`09`09os=-sunos3
X`09`09# This also exists in the configure program, but was not the
X`09`09# default.
X`09`09# os=-sunos4
X`09`09;;
X`09*-tti)`09# must be before sparc entry or we get the wrong os.
X`09`09os=-sysv3
X`09`09;;
X`09sparc-* `7C *-sun)
X`09`09os=-sunos4.1.1
X`09`09;;
X`09*-ibm)
X`09`09os=-aix
X`09`09;;
X`09*-hp)
X`09`09os=-hpux
X`09`09;;
X`09*-hitachi)
X`09`09os=-hiux
X`09`09;;
X`09i860-* `7C *-att `7C *-ncr\1006ltos `7C *-motorola `7C *-convergent)
X`09`09os=-sysv
X`09`09;;
X`09*-cbm)
X`09`09os=-amigados
X`09`09;;
X`09*-dg)
X`09`09os=-dgux
X`09`09;;
X`09*-dolphin)
X`09`09os=-sysv3
X`09`09;;
X`09m68k-ccur)
X`09`09os=-rtu
X`09`09;;
X`09m88k-omron*)
X`09`09os=-luna
X`09`09;;
X`09*-next )
X`09`09os=-nextstep
X`09`09;;
X`09*-sequent)
X`09`09os=-ptx
X`09`09;;
X`09*-crds)
X`09`09os=-unos
X`09`09;;
X`09*-ns)
X`09`09os=-genix
X`09`09;;
X`09i370-*)
X`09`09os=-mvs
X`09`09;;
X`09*-next)
X`09`09os=-nextstep3
X`09`09;;
X        *-gould)
X`09`09os=-sysv
X`09`09;;
X        *-highlevel)
X`09`09os=-bsd
X`09`09;;
X`09*-encore)
X`09`09os=-bsd
X`09`09;;
X        *-sgi)
X`09`09os=-irix
X`09`09;;
X        *-siemens)
X`09`09os=-sysv4
X`09`09;;
X`09*-masscomp)
X`09`09os=-rtu
X`09`09;;
X`09f301-fujitsu)
X`09`09os=-uxpv
X`09`09;;
X`09*)
X`09`09os=-none
X`09`09;;
Xesac
Xfi
X
X# Here we handle the case whe\1906know the os, and the CPU type, but not the
X# manufacturer.  We pick the logical\230E
Xvendor=unknown
Xcase $basic_machine in
X`09*-unknown)
X`09`09case $os in
X`09`09`09-riscix*)
X`09`09&0209vendor=acorn
X`09`09&0209;;
X`09`09`09-sunos*)
X`09`09&0209vendor=sun
X`09`09&0209;;
X`09`09`09-aix*)
X`09`09&0209vendor=ibm
X`09`09&0209;;
X`09`09`09-hpux*)
X`09`09&0209vendor=hp
X`09`09&0209;;
X`09`09`09-hiux*)
X`09`09&0209vendor=hitachi
X`09`09&0209;;
X`09`09`09-unos*)
X`09`09&0209vendor=crds
X`09`09&0209;;
X`09`09`09-dgux*)
X`09`09&0209vendor=dg
X`09`09&0209;;
X`09`09`09-luna*)
X`09`09&0209vendor=omron
X`09`09&0209;;
X`09`09`09-genix*)
X`09`09&0209vendor=ns
X`09`09&0209;;
X`09`09`09-mvs*)
X`09`09&0209vendor=ibm
X`09`09&0209;;
X`09`09`09-ptx*)
X`09`09&0209vendor=sequent
X`09`09&0209;;
X`09`09`09-vxsim* `7C -vxworks*)
X`09`09&0209vendor=wrs
X`09`09&0209;;
X`09`09`09-aux*)
X`09`09&0209vendor=apple
X`09`09&0209;;
X`09`09esac
X`09`09basic_machine=`60echo $\150D `7C sed "s/unknown/$vendor/"`60
X`09`09;;
Xesac
X
Xecho $basic_machine$os
$ call unpack [.VILE-8_0]CONFIG.SUB;1 -
 1600988910 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 42 23 152
$!
$ create 'f'
X#! /bin/sh
X
X# From configure.in Revision: 1.86`20
X
Xrm -f config.cache
X
X### Use "configure -with-screen" to override the default \3008ation, which is
V
X### termcap-based on unix systems.
X
X
X
X# Guess values for system-dependent variables and create Makefiles.
X# Generated automatically using autoconf version 2.12.971230`20
X# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
X#
X# This configure script is free software; the Free S\1307 Foundation
X# gives unlimited permission to copy, distribute and modify it.
X
X# Defaults:
Xac_help=
Xac_default_prefix=/usr/local
X# Any additions from configure.in:
X
X# Initialize some variables set by options.
X# The variables have the same names as the options, with
X# dashes changed to underlines.
Xbuild=NONE
Xcache_file=./config.cache
Xexec_prefix=NONE
Xhost=NONE
Xno_create=
Xnonopt=NONE
Xno_recursion=
Xprefix=NONE
Xprogram_prefix=NONE
Xprogram_suffix=NONE
Xprogram_transform_name=s,x,x,
Xsilent=
Xsite=
Xsrcdir=
Xtarget=NONE
Xverbose=
Xx_includes=NONE
Xx_libraries=NONE
Xbindir='$`7Bexec_prefix`7D/bin'
Xsbindir='$`7Bexec_prefix`7D/sbin'
Xlibexecdir='$`7Bexec_prefix`7D/\1B07'
Xdatadir='$`7Bprefix`7D/share'
Xsysconfdir='$`7Bprefix`7D/etc'
Xsharedstatedir='$`7Bprefix`7D/com'
Xlocalstatedir='$`7Bprefix`7D/var'
Xlibdir='$`7Bexec_prefix`7D/lib'
Xincludedir='$`7Bprefix`7D/\1607'
Xoldincludedir='/usr/\1107'
Xinfodir='$`7Bprefix`7D/info'
Xmandir='$`7Bprefix`7D/man'
X
X# Initialize some other variables.
Xsubdirs=
XMFLAGS= MAKE\0B06
X# Maximum number of lines to put in a shell here document.
Xac_max_here_lines=12
X
Xac_prev=
Xfor ac_option
Xdo
X
X  # If the previous option needs an argument, assign it.
X  if test -n "$ac_prev"; then
X    eval "$ac_prev=`5C$ac_option"
X    ac_prev=
X    continue
X  fi
X
X  case "$ac_option" in
X  -*=*) ac_optarg=`60echo "$\1206ion" `7C sed 's/`5B-_a-zA-Z0-9`5D*=//'`60 ;;
V
X  *) ac_optarg= ;;
X  esac
X
X  # Accept the important Cygnus configure options, so we can diagnose typos.
X
X  case "$ac_option" in
X
X  -bindir `7C -\0B0B\1606\1509\1E08\2607)
X    ac_prev=bindir ;;
X  -bindir=* `7C -\0D0D\1A06\190B\240A\2E09=*)
X    bindir="$ac_optarg" ;;
X
X  -build `7C -\0A0A-buil\1308\1B07)
X    ac_prev=build ;;
X  -build=* `7C -\0C0C-buil\170A\2109=*)
X    build="$ac_optarg" ;;
X
X  -cache-file `7C -\0F0F\1E0A\1D0D `5C
X  `7C --cache-f\0C0B\170A\2109\2A08\3207\3906)
X    ac_prev=cache_file ;;
X  -cache-file=* `7C -\1111\220A\210F=* `5C
X  `7C --cache-f=*\0E0B\0D0C\190B\240A\2E09\3708=*)
X    cache_file="$ac_optarg" ;;
X
X  -datadir `7C -\0C0C\1807\170A\2109\2A08\3207)
X    ac_prev=datadir ;;
X  -datadir=* `7C -\0E0E\1C07\1B0C\270B\320A=* `5C
X  `7C --da=*)
X    datadir="$ac_optarg" ;;
X
X  -disable-* `7C -\0E0A)
X    ac_feature=`60echo $ac_option`7Csed -e 's/-*disable-//'`60
X    # Reject names that are not valid shell variable names.
X    if test -n "`60echo $ac_feature`7C sed 's/`5B-a-zA-Z0-9_`5D//g'`60"; then
V
X      `7B echo "configure: error: $ac_feature: invalid \1107 name" 1>`262; exi
Vt 1; `7D
X    fi
X    ac_feature=`60echo $\120A`7C sed 's/-/_/g'`60
X    eval "enable_$`7Bac_feature`7D=no" ;;
X
X  -enable-* `7C -\0D09)
X    ac_feature=`60echo $ac_option`7Csed -e 's/-*enable-//'\1307=.*//'`60
X    # Reject names that are not valid shell variable names.
X    if test -n "`60echo $ac_feature`7C sed 's/`5B-_a-zA-Z0-9`5D//g'`60"; then
V
X      `7B echo "configure: error: $ac_feature: invalid \1107 name" 1>`262; exi
Vt 1; `7D
X    fi
X    ac_feature=`60echo $\120A`7C sed 's/-/_/g'`60
X    case "$ac_option" in
X      *=*) ;;
X      *) ac_optarg=yes ;;
X    esac
X    eval "enable_$`7Bac_feature`7D='$ac_optarg'" ;;
X
X  -exec-prefix `7C --exec_\100F\2010\3006 `5C
X  `7C --exec-pref\0E0D\1B0C\270B\320A `5C
X  `7C --exec\0908\1107)
X    ac_prev=exec_prefix ;;
X  -exec-prefix=* `7C --exec_\1211\2412\3606=* `5C
X  `7C --exec-pref=*\100D\0F0E\1D0D\2A0C=* `5C
X  `7C --exec=*\0B08\0A09=*)
X    exec_prefix="$ac_optarg" ;;
X
X  -gas `7C -\0808-ga\0F06)
X    # Obsolete; use --with-gas.
X    with_gas=yes ;;
X
X  -help `7C -\0909-hel\1107)
X    # Omit some internal or obsolete options to make the list less imposing.
X    # This message is too long to be a string in the A/UX 3.1 sh.
X    cat << EOF
XUsage: configure `5Boptions`5D `5Bhost`5D
XOptions: `5Bdefaults in brackets after descri\2A06`5D
XConfiguration:
X  --cache-file=FILE       cache test results in FILE
X  --help        \0808  print this message
X  --no-create             do not \1A07output files
X  --quiet, --silent       do not print `5C`60checking...' messages
X  --version        \0807print the \2008of autoconf that created configure
XDirectory and file names:
X  --prefix=PREFIX         install architecture-independent files in \3906
X        \0808\100A`5B$ac_default_prefix`5D
X  --exec-prefix=EPREFIX   install architecture-dependent files in \3207
X        \0808\100A`5Bsame as prefix`5D
X  --bindir=DIR            user executables in DIR `5BEPREFIX/bin`5D
X  --sbindir=DIR           system admin executables in DIR `5BEPREFIX/sbin`5D
X  --libexecdir=DIR        program executables in DIR `5BEPREFIX/\3A07`5D
X  --datadir=DIR           read-only architecture-independent data in DIR
X        \0808\100A`5BPREFIX/share`5D
X  --sysconfdir=DIR        read-only single-machine data in DIR `5BPREFIX/etc
V`5D
X  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
X        \0808\100A`5BPREFIX/com`5D
X  --localstatedir=DIR     modifiable single-machine data in DIR `5BPREFIX/var
V`5D
X  --libdir=DIR            object code libraries in DIR `5BEPREFIX/lib`5D
X  --includedir=DIR        C header files in DIR `5BPREFIX/\3407`5D
X  --oldincludedir=DIR     C header files for non-gcc in DIR `5B/usr/\3B07`5D
X  --infodir=DIR           info documentation in DIR `5BPREFIX/info`5D
X  --mandir=DIR            man documentation in DIR `5BPREFIX/man`5D
X  --srcdir=DIR            find the sources in DIR `5Bconfigure dir or ..`5D
X  --program-prefix=PREFIX prepend \0F07to installed \3207 names
X  --program-suffix=SUFFIX append \0E07to installed \3107 names
X  --program-transform-name=PROGRAM
X        \0808\100Arun sed PROGRAM on installed program names
XEOF
X    cat << EOF
XHost type:
X  --build=BUILD           configure for building on \2A06`5BBUILD=HOST`5D
X  --host=HOST             configure for HOST `5Bguessed`5D
X  --target=TARGET         configure for \1D07`5B\2506=HOST`5D
XFeatures and packages:
X  --disable-FEATURE       do not include \1D08(same as --en\370C=no)
X  --enable-FEATURE`5B=ARG`5D  include \1707 `5BARG=yes`5D
X  --with-PACKAGE`5B=ARG`5D    use \1507 `5BARG=yes`5D
X  --without-PACKAGE       do not use \1908(same as\3407\3108=no)
X  --x-includes=DIR        X \1607 files are in DIR
X  --x-libraries=DIR       X \1606y files are in DIR
XEOF
Xcat <<EOF
X--enable and --with options recognized:
X  --disable-echo          test: display "compiling" commands (default: on)
X  --disable-extensions    test: build only core functions (default: on)
X  --disable-shell         test: \1C07 shell/external commands (default: on)
X  --with-CFLAGS=value     set default for `5C$\2306
X  --with-cflags=value     (same as\2108CFLAGS)
X  --with-startup-path=PATH specify locations to search for vile.hlp, etc.
X  --with-perl             enable use of Perl as an extension language
X  --with-screen=value     specify terminal driver.  The default is tcap, for
X        \0808\100Athe termcap/terminfo driver.  Other values include
X        \0808\100Ancurses (a special case of terminfo), X11, OpenLook,
X        \0808\100AMotif, Athena, Xaw, Xaw3d, neXtaw and ansi.
X  --with-scr=value        (same as\210Been)
X  --with-x        \0808use the X Window System
X  --with-Xaw3d            link with Xaw 3d library
X  --with-neXtaw           link with neXT Athena library
X  --with-Xaw-scrollbars   use Xaw \150Brather than our own
XEOF
Xcat <<EOF
X  --with-drag-extension   use drag/scrolling \1F0Awith Xaw
X  --with-exec-macros=N    specify count of numbered \2606
X  --with-locale           use i18n support for character-types
X  --with-dbmalloc         test: use Conor Cahill's \2A09library
X  --with-dmalloc          test: use Gray Watson's \2908library
X  --with-no-leaks         test: free permanent memory, analyze leaks
X  --with-trace            test: turn on debug-tracing
X  --with-warnings         test: turn on GCC compiler \2C08
XEOF
X    exit 0 ;;
X
X  -host `7C -\0909-hos\1107)
X    ac_prev=host ;;
X  -host=* `7C -\0B0B-hos\1509=*)
X    host="$ac_optarg" ;;
X
X  -includedir `7C -\0F0F\1E0A\1D0D\2A0C `5C
X  `7C --includ\0B0A\1509\1E08)
X    ac_prev=includedir ;;
X  -includedir=* `7C -\1111\220A\210F\300E=* `5C
X  `7C --includ=*\0D0A\0C0B\170A=*)
X    includedir="$ac_optarg" ;;
X
X  -infodir `7C -\0C0C\1807\170A\2109\2A08)
X    ac_prev=infodir ;;
X  -infodir=* `7C -\0E0E\1C07\1B0C\270B\320A=*)
X    infodir="$ac_optarg" ;;
X
X  -libdir `7C -\0B0B\1606\1509)
X    ac_prev=libdir ;;
X  -libdir=* `7C -\0D0D\1A06\190B=*)
X    libdir="$ac_optarg" ;;
X
X  -libexecdir `7C -\0F0F\1E0A\1D0D\2A0C `5C
X  `7C --libexe\0B0A\1509)
X    ac_prev=libexecdir ;;
X  -libexecdir=* `7C -\1111\220A\210F\300E=* `5C
X  `7C --libexe=*\0D0A\0C0B=*)
X    libexecdir="$ac_optarg" ;;
X
X  -localstatedir `7C -\1212\240D\2310 `5C
X  `7C --localstate\0F0E\1D0D\2A0C `5C
X  `7C --locals\0B0A\1509\1E08\2607)
X    ac_prev=localstatedir ;;
X  -localstatedir=* `7C -\1414\280D\2712=* `5C
X  `7C --localstate=*\110E\100F\1F0E=* `5C
X  `7C --locals=*\0D0A\0C0B\170A\2109=*)
X    localstatedir="$ac_optarg" ;;
X
X  -mandir `7C -\0B0B\1606\1509\1E08\2607\2D06)
X    ac_prev=mandir ;;
X  -mandir=* `7C -\0D0D\1A06\190B\240A\2E09\3708=*)
X    mandir="$ac_optarg" ;;
X
X  -nfp `7C -\0808-nf)
X    # Obsolete; use --without-fp.
X    with_fp=no ;;
X
X  -no-create `7C -\0E0E\1C09\1B0C\270B `5C
X  `7C --no-cr\0A09)
X    no_create=yes ;;
X
X  -no-recursion `7C -\1111\220C\210F `5C
X  `7C --no-recurs\0E0D\1B0C\270B\320A\3C09)
X    no_recursion=yes ;;
X
X  -oldincludedir `7C -\1212\240D\2310 `5C
X  `7C --oldinclude\0F0E\1D0D\2A0C\360B `5C
X  `7C --oldin\0A09\1308\1B07\2206)
X    ac_prev=oldincludedir ;;
X  -oldincludedir=* `7C -\1414\280D\2712=* `5C
X  `7C --oldinclude=*\110E\100F\1F0E\2D0D=* `5C
X  `7C --oldin=*\0C09\0B0A\1509\1E08=*)
X    oldincludedir="$ac_optarg" ;;
X
X  -prefix `7C -\0B0B\1606\1509\1E08\2607\2D06)
X    ac_prev=prefix ;;
X  -prefix=* `7C -\0D0D\1A06\190B\240A\2E09\3708=*)
X    prefix="$ac_optarg" ;;
X
X  -program-prefix `7C -\1313\260E\2511 `5C
X  `7C --program-pre\100F\1F0E)
X    ac_prev=program_prefix ;;
X  -program-prefix=* `7C -\1515\2A0E=* `5C
X  `7C --program-pref=*\1310\1211\2310=*)
X    program_prefix="$ac_optarg" ;;
X
+-+-+-+-+-+-+-+-  END  OF PART 31 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 32 -+-+-+-+-+-+-+-+
X  -program-suffix `7C -\1313\260E\2511 `5C
X  `7C --program-suf\100F\1F0E)
X    ac_prev=program_suffix ;;
X  -program-suffix=* `7C -\1515\2A0E=* `5C
X  `7C --program-suff=*\1310\1211\2310=*)
X    program_suffix="$ac_optarg" ;;
X
X  -program-transform-name `7C -\1B18`5C
X  `7C --program-transform-nam\1A19 `5C
X  `7C --program-transform-n\1817 `5C
X  `7C --program-transform\1615 `5C
X  `7C --program-transfo\1413 `5C
X  `7C --program-trans\1211 `5C
X  `7C --progr-tra\0E0Aam-tr\0F0E)
X    ac_prev=program_transform_name ;;
X  -program-transform-name=* `7C -\1D1A`5C
X  `7C --program-transform-nam=*\1C19=* `5C
X  `7C --program-transform-n=*\1A17=* `5C
X  `7C --program-transform=*\1815=* `5C
X  `7C --program-transfo=*\1613=* `5C
X  `7C --program-trans=*\1411=* `5C
X  `7C --progr-tra=*\100Aam-tr\1110=*)
X    program_transform_name="$ac_optarg" ;;
X
X  -q `7C -quiet `7C -\0A0A-quie\1308\1B07\2206 `5C
X  `7C -silent `7C -\0B0B\1606\1509\1E08)
X    silent=yes ;;
X
X  -sbindir `7C -\0C0C\1807\170A\2109\2A08\3207)
X    ac_prev=sbindir ;;
X  -sbindir=* `7C -\0E0E\1C07\1B0C\270B=* `5C
X  `7C --sbi=*\0A07=*)
X    sbindir="$ac_optarg" ;;
X
X  -sharedstatedir `7C -\1313\260E `5C
X  `7C --sharedstated\1110\210F\300E `5C
X  `7C --sharedst\0D0C\190B\240A\2E09 `5C
X  `7C --sha\0807)
X    ac_prev=sharedstatedir ;;
X  -sharedstatedir=* `7C -\1515\2A0E=* `5C
X  `7C --sharedstated=*\1310\1211\2310=* `5C
X  `7C --sharedst=*\0F0C\0E0D\1B0C\270B=* `5C
X  `7C --sha=*\0A07=*)
X    sharedstatedir="$ac_optarg" ;;
X
X  -site `7C -\0909-sit)
X    ac_prev=site ;;
X  -site=* `7C -\0B0B-sit=*)
X    site="$ac_optarg" ;;
X
X  -srcdir `7C -\0B0B\1606\1509\1E08\2607)
X    ac_prev=srcdir ;;
X  -srcdir=* `7C -\0D0D\1A06\190B\240A\2E09=*)
X    srcdir="$ac_optarg" ;;
X
X  -sysconfdir `7C -\0F0F\1E0A\1D0D\2A0C `5C
X  `7C --syscon\0B0A\1509\1E08\2607)
X    ac_prev=sysconfdir ;;
X  -sysconfdir=* `7C -\1111\220A\210F\300E=* `5C
X  `7C --syscon=*\0D0A\0C0B\170A\2109=*)
X    sysconfdir="$ac_optarg" ;;
X
X  -target `7C -\0B0B\1606\1509\1E08\2607\2D06)
X    ac_prev=target ;;
X  -target=* `7C -\0D0D\1A06\190B\240A\2E09\3708=*)
X    target="$ac_optarg" ;;
X
X  -v `7C -verbose `7C -\0C0C\1807\170A\2109)
X    verbose=yes ;;
X
X  -version `7C -\0C0C\1807\170A\2109)
X    echo "configure generated by autoconf version 2.12.971230"
X    exit 0 ;;
X
X  -with-* `7C -\0B07)
X    ac_package=`60echo $ac_option`7Csed -e 's/-*with-//'\1107=.*//'`60
X    # Reject names that are not valid shell variable names.
X    if test -n "`60echo $ac_package`7C sed 's/`5B-_a-zA-Z0-9`5D//g'`60"; then
V
X      `7B echo "configure: error: $ac_package: invalid \1107 name" 1>`262; exi
Vt 1; `7D
X    fi
X    ac_package=`60echo $\120A`7C sed 's/-/_/g'`60
X    case "$ac_option" in
X      *=*) ;;
X      *) ac_optarg=yes ;;
X    esac
X    eval "with_$`7Bac_package`7D='$ac_optarg'" ;;
X
X  -without-* `7C -\0E0A)
X    ac_package=`60echo $ac_option`7Csed -e 's/-*without-//'`60
X    # Reject names that are not valid shell variable names.
X    if test -n "`60echo $ac_package`7C sed 's/`5B-a-zA-Z0-9_`5D//g'`60"; then
V
X      `7B echo "configure: error: $ac_package: invalid \1107 name" 1>`262; exi
Vt 1; `7D
X    fi
X    ac_package=`60echo $\120A`7C sed 's/-/_/g'`60
X    eval "with_$`7Bac_package`7D=no" ;;
X
X  --x)
X    # Obsolete; use --with-x.
X    with_x=yes ;;
X
X  -x-includes `7C -\0F0F\1E0A\1D0D\2A0C `5C
X  `7C --x-incl\0B0A\1509\1E08)
X    ac_prev=x_includes ;;
X  -x-includes=* `7C -\1111\220A\210F\300E=* `5C
X  `7C --x-incl=*\0D0A\0C0B\170A=*)
X    x_includes="$ac_optarg" ;;
X
X  -x-libraries `7C -\1010\200B\1F0E `5C
X  `7C --x-librar\0D0C\190B\240A\2E09\3708)
X    ac_prev=x_libraries ;;
X  -x-libraries=* `7C -\1212\240B\2310=* `5C
X  `7C --x-librar=*\0F0C\0E0D\1B0C\270B\320A=*)
X    x_libraries="$ac_optarg" ;;
X
X  -*) `7B echo "configure: error: $ac_option: invalid \1006; use --help to sho
Vw usage" 1>`262; exit 1; `7D
X    ;;
X
X  *)
X    if test -n "`60echo $ac_option`7C sed 's/`5B-a-z0-9.`5D//g'`60"; then
X      echo "configure: warning: $ac_option: invalid host type" 1>`262
X    fi
X    if test "x$nonopt" != xNONE; then
X      `7B echo "configure: error: can only c\1B08 for one host and one target
V at a time" 1>`262; exit 1; `7D
X    fi
X    nonopt="$ac_option"
X    ;;
X
X  esac
Xdone
X
Xif test -n "$ac_prev"; then
X  `7B echo "configure: error: missing argument to --`60echo $ac_prev `7C sed '
Vs/_/-/g'`60" 1>`262; exit 1; `7D
Xfi
X
Xtrap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1
V 2 15
X
X# File descriptor usage:
X# 0 standard input
X# 1 file creation
X# 2 errors and warnings
X# 3 some systems may open it to /dev/tty
X# 4 used on the Kubota Titan
X# 6 checking for... messages and results
X# 5 compiler messages saved in config.log
Xif test "$silent" = yes; then
X  exec 6>/dev/null
Xelse
X  exec 6>`261
Xfi
Xexec 5>./config.log
X
Xecho "`5C
XThis file contains any messages produced by compilers while
Xrunning configure, to aid debugging if\1F0A makes a mistake.
X" 1>`265
X
X# Strip out --no-create and\1006recursion so they do not pile up.
X# Also quote any args containing shell metacharacters.
Xac_configure_args=
Xfor ac_arg
Xdo
X  case "$ac_arg" in
X  -no-create `7C -\0E0E\1C09\1B0C\270B `5C
X  `7C --no-cr\0A09) ;;
X  -no-recursion `7C -\1111\220C\210F `5C
X  `7C --no-recurs\0E0D\1B0C\270B\320A\3C09) ;;
X  *" "*`7C*"`09"*`7C*`5B`5C`5B`5C`5D`5C`7E`5C#`5C$`5C`5E`5C`26`5C*`5C(`5C)`5C
V`7B`5C`7D`5C`5C`5C`7C`5C;`5C<`5C>`5C?`5D*)
X  ac_configure_args="$\1411 '$ac_arg'" ;;
X  *) ac_configure_args="$\1411 $ac_arg" ;;
X  esac
Xdone
X
X# NLS nuisances.
X# Only set these to C if already set.  These must not be set unconditionally
X# because not all systems understand e.g. LANG=C (notably SCO).
X# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `60set
V'!
X# Non-C LC_CTYPE values break the ctype check.
Xif test "$`7BLANG+set`7D"   = set; then LANG=C;   export LANG;   fi
Xif test "$`7BLC_ALL+set`7D" = set; then \1906=C; export \2A06; fi
Xif test "$`7BLC_MESSAGES+set`7D" = set; then \1E0B=C; export \340B; fi
Xif test "$`7BLC_CTYPE+set`7D"    = set; then \1E08=C;    export \3408;    fi
X
X# confdefs.h avoids OS command line length limits that DEFS can exceed.
Xrm -rf conftest* confdefs.h
X# AIX cpp loses on an empty file, so make sure it contains at least a newline.
V
Xecho > confdefs.h
X
X# A filename unique to this package, relativ\1A07e directory that
X# configure is in, which we can look for to find out if srcdir is correct.
Xac_unique_file=mktbls.c
X
X# Find the source files, if location was not specified.
Xif test -z "$srcdir"; then
X  ac_srcdir_defaulted=yes
X  # Try the directory containing this script, then its parent.
X  ac_prog=$0
X  ac_confdir=`60echo $ac_prog`7Csed 's%/`5B`5E/`5D`5B`5E/`5D*$%%'`60
X  test "x$ac_confdir" =\1107prog" `26`26 \1D0A=.
X  srcdir=$ac_confdir
X  if test ! -r $srcdir/$ac_unique_file; then
X    srcdir=..
X  fi
Xelse
X  ac_srcdir_defaulted=no
Xfi
Xif test ! -r $srcdir/$ac_unique_file; then
X  if test "$ac_srcdir_defaulted" = yes; then
X    `7B echo "configure: error: can not find sources in $ac_confdir or .." 1>
V`262; exit 1; `7D
X  else
X    `7B echo "configure: error: can not find sources in $srcdir" 1>`262; exit
V 1; `7D
X  fi
Xfi
Xsrcdir=`60echo "$`7B\1006`7D" `7C sed 's%`5C(`5B`5E/`5D`5C)/*$%`5C1%'`60
X
X# Prefer explicitly selected file to automatical\1F0Cones.
Xif test -z "$CONFIG_SITE"; then
X  if test "x$prefix" != xNONE; then
X    CONFIG_SITE="$prefix/share/config.site \1A08etc\180C"
X  else
X    CONFIG_SITE="$ac_default_prefix/share/config.site \2513etc\230C"
X  fi
Xfi
Xfor ac_site_file in $CONFIG_SITE; do
X  if test -r "$ac_site_file"; then
X    echo "loading site script $ac_site_file"
X    . "$ac_site_file"
X  fi
Xdone
X
Xif test -r "$cache_file"; then
X  echo "loading cache $cache_file"
X  . $cache_file
Xelse
X  echo "creating cache $cache_file"
X  > $cache_file
Xfi
X
Xac_ext=c
X# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
Xac_cpp='$CPP $CPPFLAGS'
Xac_compile='$`7BCC-cc`7D -c $CFLAGS $CPP\0A06conftest.$ac_ext 1>`265'
Xac_link='$`7BCC-cc`7D -o conftest $CFLAGS $CPP\0A07LD\1306\2408.$ac_ext $LIBS
V 1>`265'
Xcross_compiling=$ac_cv_prog_cc_cross
X
Xif (echo "testing`5Cc"; echo 1,2,3) `7C grep c >/dev/null; then
X  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
X  if (echo -n testing; echo 1,2,3) `7C sed s/-n/xn/ `7C grep xn >/dev/null; th
Ven
X    ac_n= ac_c='
X' ac_t='`09'
X  else
X    ac_n=-n ac_c= ac_t=
X  fi
Xelse
X  ac_n= ac_c='`5Cc' ac_t=
Xfi
X
X
X
X
Xac_aux_dir=
Xfor ac_dir in $srcdir \0807/..\0B0B/..; do
X  if test -f $ac_dir/install-sh; then
X    ac_aux_dir=$ac_dir
X    ac_install_sh="$ac_aux_dir/\1807-sh -c"
X    break
X  elif test -f $ac_dir/install.sh; then
X    ac_aux_dir=$ac_dir
X    ac_install_sh="$ac_aux_dir/\1807.sh -c"
X    break
X  fi
Xdone
Xif test -z "$ac_aux_dir"; then
X  `7B echo "configure: error: can not find install-sh or\0E08.sh in $srcdir`20
V\0807/..\0B0B/.." 1>`262; exit 1; `7D
Xfi
Xac_config_guess=$ac_aux_dir/\1906.guess
Xac_config_sub=$ac_aux_dir/\1706.sub
Xac_configure=$ac_aux_dir/\1609 # This should be Cygnus \3809.
X
X
Xif test -f $srcdir/config.guess ; then
X`09
X# Make sure we can run config.sub.
Xif $ac_config_sub sun4 >/dev/null 2>`261; then :
Xelse `7B echo "configure: error: can not run $ac_\2206_sub" 1>`262; exit 1;`20
V`7D
Xfi
X
Xecho $ac_n "checking host system type""... $ac_c" 1>`266
Xecho "configure:587: checking host system type" >`265
X
Xhost_alias=$host
Xcase "$host_alias" in
XNONE)
X  case $nonopt in
X  NONE)
X    if host_alias=`60$ac_config_guess`60; then :
X    else `7B echo "configure: error: can not guess host type; you must specify
V one" 1>`262; exit 1; `7D
X    fi ;;
X  *) host_alias=$nonopt ;;
X  esac ;;
Xesac
X
Xhost=`60$ac_config_sub $host_alias`60
Xhost_cpu=`60echo $host `7C sed 's/`5E`5C(`5B`5E-`5D*`5C)-\0A0A`5C(.*`5C)$/`5C1
V/'`60
Xhost_vendor=`60echo $host `7C sed 's/`5E`5C(`5B`5E-`5D*`5C)-\0A0A`5C(.*`5C)$/
V`5C2/'`60
Xhost_os=`60echo $host `7C sed 's/`5E`5C(`5B`5E-`5D*`5C)-\0A0A`5C(.*`5C)$/`5C3/
V'`60
Xecho "$ac_t""$host" 1>`266
X
X`09system_name="$host_os"
Xelse
X`09system_name="`60(uname -s -r) 2>/dev/null`60"
X`09if test -z "$system_name" ; then
X`09`09system_name="`60(hostname) 2>/dev/null`60"
X`09fi
Xfi
Xtest -n "$system_name" `26`26 cat >> confdefs.h <<EOF
X#define SYSTEM_NAME "$system_name"
XEOF
X
Xif eval "test `5C"`60echo '$''`7B'cf_cv_system_name'+set`7D'`60`5C" = set"; th
Ven
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cf_cv_system_name="$\0E0B"
Xfi
X
X
Xtest -z "$system_name" `26`26 \100B="$cf_cv_\240C
Xtest -n "$cf_cv_system_name" `26`26 echo "$ac_t"""Configuring for \3513" 1>`26
V6
X
Xif test ".$system_name" != ".$cf_cv_\190D; then
X`09echo "$ac_t""Cached system name ($\0E06_name) does not agree with actual ($
Vcf_cv_\300C" 1>`266
X`09`7B echo "configure: error: "Please remove \2106.cache and try again."" 1>
V`262; exit 1; `7D
Xfi
X
X
X###`09checks for alternative programs
X# Extract the first word of "gcc", so it can be a program name with args.
Xset dummy gcc; ac_word=$2
Xecho $ac_n "checking for $ac_word""... $ac_c" 1>`266
Xecho "configure:638: checking for $ac_word" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_prog_CC'+set`7D'`60`5C" = set"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  if test -n "$CC"; then
X  ac_cv_prog_CC="$CC" # Let the user override the test.
Xelse
X  IFS="$`7BIFS= `09`7D"; ac_save_ifs="$IFS"; \250A`7D:"
X  for ac_dir in $PATH; do
X    test -z "$ac_dir" `26`26 \0B06=.
X    if test -f $ac_dir/$ac_word; then
X      ac_cv_prog_CC="gcc"
X      break
X    fi
X  done
X  IFS="$ac_save_ifs"
Xfi
Xfi
XCC="$ac_cv_prog_CC"
Xif test -n "$CC"; then
X  echo "$ac_t""$CC" 1>`266
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
Xif test -z "$CC"; then
X  # Extract the first word of "cc", so it can be a program name with args.
Xset dummy cc; ac_word=$2
Xecho $ac_n "checking for $ac_word""... $ac_c" 1>`266
Xecho "configure:667: checking for $ac_word" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_prog_CC'+set`7D'`60`5C" = set"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  if test -n "$CC"; then
X  ac_cv_prog_CC="$CC" # Let the user override the test.
Xelse
X  IFS="$`7BIFS= `09`7D"; ac_save_ifs="$IFS"; \250A`7D:"
X  ac_prog_rejected=no
X  for ac_dir in $PATH; do
X    test -z "$ac_dir" `26`26 \0B06=.
X    if test -f $ac_dir/$ac_word; then
X      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
X        ac_prog_rejected=yes
X`09continue
X      fi
X      ac_cv_prog_CC="cc"
X      break
X    fi
X  done
X  IFS="$ac_save_ifs"
Xif test $ac_prog_rejected = yes; then
X  # We found a bogon in the path, so make sure we never use it.
X  set dummy $ac_cv_prog_CC
X  shift
X  if test $# -gt 0; then
X    # We chose a different compiler from the bogus one.
X    # However, it has the same basename, so the bogon will be chosen
X    # first if we set CC to just the basename; use the full file name.
X    shift
X    set dummy "$ac_dir/$ac_word" "$@"
X    shift
X    ac_cv_prog_CC="$@"
X  fi
Xfi
Xfi
Xfi
XCC="$ac_cv_prog_CC"
Xif test -n "$CC"; then
X  echo "$ac_t""$CC" 1>`266
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X  test -z "$CC" `26`26 `7B echo "configure: error: no acceptable cc found in`20
V`5C$PATH" 1>`262; exit 1; `7D
Xfi
X
Xecho $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""...
V $ac_c" 1>`266
Xecho "configure:715: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) wo
Vrks" >`265
X
Xac_ext=c
X# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
Xac_cpp='$CPP $CPPFLAGS'
Xac_compile='$`7BCC-cc`7D -c $CFLAGS $CPP\0A06conftest.$ac_ext 1>`265'
Xac_link='$`7BCC-cc`7D -o conftest $CFLAGS $CPP\0A07LD\1306\2408.$ac_ext $LIBS
V 1>`265'
Xcross_compiling=$ac_cv_prog_cc_cross
X
Xcat > conftest.$ac_ext <<EOF
X#line 725 "configure"
X#include "confdefs.h"
Xmain()`7Breturn(0);`7D
XEOF
Xif `7B (eval echo configure:729: `5C"$ac_link`5C") 1>`265;\2E07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  ac_cv_prog_cc_works=yes
X  # If we can't run a trivial program, we are probably using a cross compiler.
V
X  if (./conftest; exit) 2>/dev/null; then
X    ac_cv_prog_cc_cross=no
X  else
X    ac_cv_prog_cc_cross=yes
X  fi
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  ac_cv_prog_cc_works=no
Xfi
Xrm -fr conftest*
X
Xecho "$ac_t""$ac_cv_prog_cc_works" 1>`266
Xif test $ac_cv_prog_cc_works = no; then
X  `7B echo "configure: error: installation or \2208\1106problem: C compiler ca
Vnnot create executables." 1>`262; exit 1; `7D
Xfi
Xecho $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-
V\2B08""... $ac_c" 1>`266
Xecho "configure:749: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is
V a cross-\2B08" >`265
Xecho "$ac_t""$ac_cv_prog_cc_cross" 1>`266
Xcross_compiling=$ac_cv_prog_cc_cross
X
Xecho $ac_n "checking whether we are using GNU C""... $ac_c" 1>`266
Xecho "configure:754: checking whether we are using GNU C" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_prog_gcc'+set`7D'`60`5C" = set"; then
V
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.c <<EOF
X#ifdef __GNUC__
X  yes;
X#endif
XEOF
Xif `7B ac_try='$`7BCC-cc`7D -E conftest.c'; `7B (eval echo configure:763: `5C"
V$\4006`5C") 1>`265; \2D06\1707) 2>`265; `7D; `7D `7C egrep yes >/dev/null 2>
V`261; then
X  ac_cv_prog_gcc=yes
Xelse
X  ac_cv_prog_gcc=no
Xfi
Xfi
X
Xecho "$ac_t""$ac_cv_prog_gcc" 1>`266
X
Xif test $ac_cv_prog_gcc = yes; then
X  GCC=yes
X  ac_test_CFLAGS="$`7B\0A06+set`7D"
X  ac_save_CFLAGS="$\0906"
X  CFLAGS=
X  echo $ac_n "checking whether $`7BCC-cc`7D accepts -g""... $ac_c" 1>`266
Xecho "configure:778: checking whether $`7BCC-cc`7D accepts -g" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_prog_cc_g'+set`7D'`60`5C" = set"; then
V
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  echo 'void f()`7B`7D' > conftest.c
Xif test -z "`60$`7BCC-cc`7D -g -c conftest.c 2>`261`60"; then
X  ac_cv_prog_cc_g=yes
Xelse
X  ac_cv_prog_cc_g=no
Xfi
Xrm -f conftest*
X
Xfi
X
Xecho "$ac_t""$ac_cv_prog_cc_g" 1>`266
X  if test "$ac_test_CFLAGS" = set; then
X    CFLAGS="$ac_save_\1106"
X  elif test $ac_cv_prog_cc_g = yes; then
X    CFLAGS="-g -O2"
X  else
X    CFLAGS="-O2"
X  fi
Xelse
X  GCC=
X  test "$`7BCFLAGS+set`7D" = set `7C`7C \1606="-g"
Xfi
X
Xecho $ac_n "checking how to run the C preprocessor""... $ac_c" 1>`266
Xecho "configure:806: checking how to run the C preprocessor" >`265
X# On Suns, sometimes $CPP names a directory.
Xif test -n "$CPP" `26`26\1207d\1207; then
X  CPP=
Xfi
Xif test -z "$CPP"; then
Xif eval "test `5C"`60echo '$''`7B'ac_cv_prog_CPP'+set`7D'`60`5C" = set"; then
V
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X    # This must be in double quotes, not sing\130Bbecause CPP may get
X  # substituted into the Makefile and "$`7BCC-cc`7D" will confuse make.
X  CPP="$`7BCC-cc`7D -E"
X  # On the NeXT, cc -E runs the code through\1107mpiler's parser,
X  # not just through cpp.
X  cat > conftest.$ac_ext <<EOF
X#line 821 "configure"
X#include "confdefs.h"
X#include <assert.h>
XSyntax Error
XEOF
Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>\1E09out"
X`7B (eval echo configure:827: `5C"$ac_try`5C") 1>`265;\2D07\1707) 2>`265; `7D
V
Xac_err=`60grep -v '`5E *+' conftest.out`60
Xif test -z "$ac_err"; then
X  :
Xelse
X  echo "$ac_err" >`265
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  CPP="$`7BCC-cc`7D -E -traditional-cpp"
X  cat > conftest.$ac_ext <<EOF
X#line 838 "configure"
X#include "confdefs.h"
X#include <assert.h>
XSyntax Error
XEOF
Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>\1E09out"
X`7B (eval echo configure:844: `5C"$ac_try`5C") 1>`265;\2D07\1707) 2>`265; `7D
V
Xac_err=`60grep -v '`5E *+' conftest.out`60
Xif test -z "$ac_err"; then
X  :
Xelse
X  echo "$ac_err" >`265
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  CPP=/lib/cpp
Xfi
Xrm -f conftest*
Xfi
Xrm -f conftest*
X  ac_cv_prog_CPP="$CPP"
Xfi
X  CPP="$ac_cv_prog_CPP"
Xelse
X  ac_cv_prog_CPP="$CPP"
Xfi
Xecho "$ac_t""$CPP" 1>`266
X
Xif test $ac_cv_prog_gcc = yes; then
X    echo $ac_n "checking whether $`7BCC-cc`7D needs -traditional""... $ac_c" 1
V>`266
Xecho "configure:868: checking whether $`7BCC-cc`7D needs -traditional" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_prog_gcc_traditional'+set`7D'`60`5C" =
V set"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X    ac_pattern="Autoconf.*'x'"
X  cat > conftest.$ac_ext <<EOF
X#line 874 "configure"
X#include "confdefs.h"
X#include <sgtty.h>
XAutoconf TIOCGETP
XEOF
Xif (eval "$ac_cpp conftest.$ac_ext") 2>`265 `7C
X  egrep "$ac_pattern" >/dev/null 2>`261; then
X  rm -rf conftest*
X  ac_cv_prog_gcc_traditional=yes
Xelse
X  rm -rf conftest*
X  ac_cv_prog_gcc_traditional=no
Xfi
Xrm -f conftest*
X
X
X  if test $ac_cv_prog_gcc_traditional = no; then
X    cat > conftest.$ac_ext <<EOF
X#line 892 "configure"
X#include "confdefs.h"
X#include <termio.h>
XAutoconf TCGETA
XEOF
Xif (eval "$ac_cpp conftest.$ac_ext") 2>`265 `7C
X  egrep "$ac_pattern" >/dev/null 2>`261; then
X  rm -rf conftest*
X  ac_cv_prog_gcc_traditional=yes
Xfi
Xrm -f conftest*
X
X  fi
Xfi
X
Xecho "$ac_t""$ac_cv_prog_gcc_traditional" 1>`266
X  if test $ac_cv_prog_gcc_traditional = yes; then
X    CC="$CC -traditional"
X  fi
Xfi
X
X# Find a good install program.  We prefer a C\1808 (faster),
X# so one script is as good as another.  But avoid the broken or
X# incompatible versions:
X# SysV /etc/install, /usr/sbin\1308
X# SunOS /usr/etc/install
X# IRIX /sbin/install
X# AIX /bin/install
X# AFS /usr/afsws/bin/install, which mishandles nonexistent args
X# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
X# ./install, which can be erroneously created by make from\390A.sh.
Xecho $ac_n "checking for a BSD compatible install""... $ac_c" 1>`266
Xecho "configure:924: checking for a BSD compatible install" >`265
Xif test -z "$INSTALL"; then
Xif eval "test `5C"`60echo '$''`7B'ac_cv_path_install'+set`7D'`60`5C" = set"; t
Vhen
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X    IFS="$`7BIFS= `09`7D"; ac_save_\1906IFS"; \250A`7D:"
X  for ac_dir in $PATH; do
X    # Account for people who put trailing slashes in PATH elements.
X    case "$ac_dir/" in
X    /`7C./`7C.//`7C/etc/*`7C/usr/sbin\0C08\1707\130Cafsws/\240Bucb/*) ;;
X    *)
X      # OSF1 and SCO ODT 3.0 have their own names for install.
X      for ac_prog in ginstall installbsd scoinst\1308; do
X        if test -f $ac_dir/$ac_prog; then
X`09  if test $ac_prog = install `26`26
X            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>`261; then
X`09    # AIX install.  It has an incompatible calling convention.
X`09    # OSF/1 installbsd also uses dspmsg, but is usable.
X`09    :
X`09  else
X`09    ac_cv_path_install="$ac_dir/$ac_prog -c"
X`09    break 2
X`09  fi
X`09fi
X      done
X      ;;
X    esac
X  done
X  IFS="$ac_save_IFS"
X
Xfi
X  if test "$`7Bac_cv_path_install+set`7D" = set; then
X    INSTALL="$ac_cv_path_install"
X  else
X    # As a last resort, use the slow shell script.  We don't cache a
X    # path for INSTALL within a source directory, because that will
X    # break other packages using the cache if that directory is
X    # removed, or if the path is relative.
X    INSTALL="$ac_install_sh"
X  fi
Xfi
Xecho "$ac_t""$INSTALL" 1>`266
X
X# Use test -z because SunOS4 sh mishandles braces in $`7Bvar-val`7D.
X# It thinks the first close brace end\1B06variable substitution.
Xtest -z "$INSTALL_PROGRAM" `26`26 \140F='$`7B\2707`7D'
X
Xtest -z "$INSTALL_DATA" `26`26 \110C='$`7B\2107`7D -m 644'
X
X# Extract the first word of "td_config", so it can be a program name with args
V.
Xset dummy td_config; ac_word=$2
Xecho $ac_n "checking for $ac_word""... $ac_c" 1>`266
Xecho "configure:976: checking for $ac_word" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_path_TD_CONFIG'+set`7D'`60`5C" = set";
V then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  case "$TD_CONFIG" in
X  /*)
X  ac_cv_path_TD_CONFIG="$\0C09" # Let the user override the test with a path.
V
X  ;;
X  *)
X  IFS="$`7BIFS= `09`7D"; ac_save_ifs="$IFS"; \250A`7D:"
X  for ac_dir in $PATH; do
X    test -z "$ac_dir" `26`26 \0B06=.
X    if test -f $ac_dir/$ac_word; then
X      ac_cv_path_TD_CONFIG="$ac_dir/$ac_word"
X      break
X    fi
X  done
X  IFS="$ac_save_ifs"
X  ;;
Xesac
Xfi
XTD_CONFIG="$ac_cv_path_\1709"
Xif test -n "$TD_CONFIG"; then
X  echo "$ac_t""$TD_CONFIG" 1>`266
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X
X
Xecho $ac_n "checking if you want to see long compiling messages""... $ac_c" 1>
V`266
Xecho "configure:1007: checking if you want to see long compiling messages" >
V`265
X
X# Check whether --enable-echo or --dis\120Awas given.
Xif test "$`7Benable_echo+set`7D" = set; then
X  enableval="$\0C06_echo"
X  test "$enableval" != no `26`26 \1409=yes
X  if test "$enableval" != "yes" ; then
X   `20
X    ECHO_LD='@echo linking $@;'
X    RULE_CC='`09@echo compiling $<'
X    SHOW_CC='`09@echo compiling $@'
X    ECHO_CC='@'
X`20
X  else
X   `20
X    ECHO_LD=''
X    RULE_CC='# compiling'
X    SHOW_CC='# compiling'
X    ECHO_CC=''
X
X  fi
Xelse
X  enableval=yes`20
X `20
X    ECHO_LD=''
X    RULE_CC='# compiling'
X    SHOW_CC='# compiling'
X    ECHO_CC=''
X
X `20
Xfi
X
Xecho "$ac_t""$enableval" 1>`266
X
X
X
X
X
X
X
XPROG_EXT=
Xcase $cf_cv_system_name in
Xos2*)
X    # We make sure -Zexe is not used -- it would interfere with @PROG_EXT@
X    CFLAGS="$\0906 -Zmt -D__ST_MT_ERRNO__"
X    LDFLAGS=`60echo "$\1007 -Zmt -Zcrtdll" `7C sed "s/-Zexe//g"`60
X    PROG_EXT=".exe"
X    ;;
Xesac
X
X
X
X
X# Check whether --enable-extensions or --dis\1810was given.
Xif test "$`7Benable_extensions+set`7D" = set; then
X  enableval="$\0C06_extensions"
X  test "$enableval" != no `26`26 \1409=yes
X  if test "$enableval" != "yes" ; then
X    cat >> confdefs.h <<`5CEOF
X#define SMALLER 1
XEOF
X
X`09 cat >> confdefs.h <<`5CEOF
X#define FEWNAMES 1
XEOF
X`20
X  else
X    EXTRAOBJS="$\0C09 btree.o crypt.o"
X  fi
Xelse
X  enableval=yes`20
X  EXTRAOBJS="$\0C09 btree.o crypt.o"
X `20
Xfi
X
X
X# Check whether --enable-shell or --dis\130Bwas given.
Xif test "$`7Benable_shell+set`7D" = set; then
X  enableval="$\0C06_shell"
X  test "$enableval" != no `26`26 \1409=yes
X  if test "$enableval" != "yes" ; then
X    cat >> confdefs.h <<`5CEOF
X#define OPT_SHELL 0
XEOF
X`20
X  else
X    EXTRAOBJS="$\0C09 npopen.o spawn.o"
X  fi
Xelse
X  enableval=yes`20
X  EXTRAOBJS="$\0C09 npopen.o spawn.o"
X `20
Xfi
X
X
X###`09use option --with-cflags to set default CFLAGS
Xecho $ac_n "checking for CFLAGS options""... $ac_c" 1>`266
Xecho "configure:1104: checking for CFLAGS options" >`265
X
X# Check whether --with-CFLAGS o\1108out\1408was given.
Xif test "$`7Bwith_CFLAGS+set`7D" = set; then
X  withval="$with_CFLAGS"
X  cflags=$withval
Xfi
X
Xif test -z "$cflags"; then
X`09
X# Check whether --with-cflags o\1108out\1408was given.
Xif test "$`7Bwith_cflags+set`7D" = set; then
X  withval="$with_cflags"
X  cflags=$withval
Xfi
X
Xfi
X
X# if the user specified nothing else, set -O. \2606can override
X# with --with-cflags=" "
Xif test -n "$cflags"; then
X`09CFLAGS="$cflags"
Xelif test -z "$CFLAGS" ; then
X`09CFLAGS="-O"
Xfi
Xecho "$ac_t""$cflags" 1>`266
X
Xecho $ac_n "checking for startup path""... $ac_c" 1>`266
Xecho "configure:1132: checking for startup path" >`265
X
X# Check whether --with-startup-path o\1708out\1A0Ewas given.
Xif test "$`7Bwith_startup_path+set`7D" = set; then
X  withval="$with_startup_path"
X  VILE_STARTUP_PATH=$withval
Xelse
X  test -z "$VILE_STARTUP_PATH" `26`26`5C
X`09VILE_STARTUP_PATH='$(datadir):/usr/local/lib/\100C\1C07ib/'
Xfi
X
Xecho "$ac_t""$VILE_STARTUP_PATH" 1>`266
X
X
Xfor ac_prog in perl5 perl
Xdo
X# Extract the first word of "$ac_prog", so it can be a program name with args.
V
Xset dummy $ac_prog; ac_word=$2
Xecho $ac_n "checking for $ac_word""... $ac_c" 1>`266
Xecho "configure:1151: checking for $ac_word" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_path_perl_bin_path'+set`7D'`60`5C" = s
Vet"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  case "$perl_bin_path" in
X  /*)
X  ac_cv_path_perl_bin_path="$\100D" # Let the user override the test with a pa
Vth.
X  ;;
X  *)
X  IFS="$`7BIFS= `09`7D"; ac_save_ifs="$IFS"; \250A`7D:"
X  for ac_dir in $PATH; do
X    test -z "$ac_dir" `26`26 \0B06=.
X    if test -f $ac_dir/$ac_word; then
X      ac_cv_path_perl_bin_path="$ac_dir/$ac_word"
X      break
X    fi
X  done
X  IFS="$ac_save_ifs"
X  ;;
Xesac
Xfi
Xperl_bin_path="$ac_cv_path_p\1B0C"
Xif test -n "$perl_bin_path"; then
X  echo "$ac_t""$perl_bin_path" 1>`266
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
Xtest -n "$perl_bin_path" `26`26 break
Xdone
Xtest -n "$perl_bin_path" `7C`7C \120D="no"
X
X
X# Check whether --with-perl o\0F08out\1206was given.
Xif test "$`7Bwith_perl+set`7D" = set; then
X  withval="$with_perl"
X `20
X`09 if test "$perl_bin_path" = no; then
X`09    `7B echo "configure: error: perl not found" 1>`262; exit 1; `7D
X`09 fi
X`09 $perl_bin_path -e 'require 5.003' `7C`7C `7B
X`09    `7B echo "configure: error: perl version must be 5.003 or greater" 1>
V`262; exit 1; `7D
X`09 `7D
X`09 perl_lib_path=`60$perl_bin_path -MConfig -e 'print $\1206`7Bprivlib`7D'`60
V
X`09 cat >> confdefs.h <<`5CEOF
X#define OPT_PERL 1
XEOF
X
X`09 EXTRAOBJS="$\0C09 perl.o"
X`09 LINK_PREFIX=`60$perl_bin_path -MConfig -e 'print $\1206`7Bshrpenv`7D'`60`20
V
X`09 ac_link="$LINK_PREFIX $\1707"`20
X`09 CFLAGS="$\0906 `60$perl_bin_path -MExtUtils::Embed -e ccopts`60"
X`09 LIBS="$LIBS `60$perl_bin_path -MExtUtils::Embed -e ldopts`60"
X`09 EXTRA_INSTALL="$\100D `5C$(\1B07_PERL)"
Xfi
X
X
X
X
X
X# X11 checks will sometimes add to CFLAGS.  We want the state of\1E07
X# prior to these checks
Xsaved_CFLAGS="$\0906"
X
X###`09checks for UNIX variants that set C preprocessor variables
Xecho $ac_n "checking for AIX""... $ac_c" 1>`266
Xecho "configure:1217: checking for AIX" >`265
Xcat > conftest.$ac_ext <<EOF
X#line 1219 "configure"
X#include "confdefs.h"
X#ifdef _AIX
X  yes
X#endif
X
XEOF
Xif (eval "$ac_cpp conftest.$ac_ext") 2>`265 `7C
X  egrep "yes" >/dev/null 2>`261; then
X  rm -rf conftest*
X  echo "$ac_t""yes" 1>`266; cat >> confdefs.h <<`5CEOF
X#define _ALL_SOURCE 1
XEOF
X
Xelse
X  rm -rf conftest*
X  echo "$ac_t""no" 1>`266
Xfi
Xrm -f conftest*
X
X
Xecho $ac_n "checking for POSIXized ISC""... $ac_c" 1>`266
Xecho "configure:1241: checking for POSIXized ISC" >`265
Xif test -d /etc/conf/kconfig.d `26`26
X  grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>`261
Xthen
X  echo "$ac_t""yes" 1>`266
X  ISC=yes # If later tests want to check for ISC.
+-+-+-+-+-+-+-+-  END  OF PART 32 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 33 -+-+-+-+-+-+-+-+
X  cat >> confdefs.h <<`5CEOF
X#define _POSIX_SOURCE 1
XEOF
X
X  if test "$GCC" = yes; then
X    CC="$CC -posix"
X  else
X    CC="$CC -Xp"
X  fi
Xelse
X  echo "$ac_t""no" 1>`266
X  ISC=
Xfi
X
Xac_safe=`60echo "minix/config.h" `7C sed 'y%./+-%__p_%'`60
Xecho $ac_n "checking for minix/config.h""... $ac_c" 1>`266
Xecho "configure:1263: checking for minix/\2306.h" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_header_$ac_safe'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 1268 "configure"
X#include "confdefs.h"
X#include <minix/config.h>
XEOF
Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>\1E09out"
X`7B (eval echo configure:1273: `5C"$ac_try`5C") 1>`265;\2E07\1707) 2>`265; `7D
V
Xac_err=`60grep -v '`5E *+' conftest.out`60
Xif test -z "$ac_err"; then
X  rm -rf conftest*
X  eval "ac_cv_header_$ac_safe=yes"
Xelse
X  echo "$ac_err" >`265
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_header_$ac_safe=no"
Xfi
Xrm -f conftest*
Xfi
Xif eval "test `5C"`60echo '$ac_cv_header_'$ac_safe`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  MINIX=yes
Xelse
X  echo "$ac_t""no" 1>`266
XMINIX=
Xfi
X
Xif test "$MINIX" = yes; then
X  cat >> confdefs.h <<`5CEOF
X#define _POSIX_SOURCE 1
XEOF
X
X  cat >> confdefs.h <<`5CEOF
X#define _POSIX_1_SOURCE 2
XEOF
X
X  cat >> confdefs.h <<`5CEOF
X#define _MINIX 1
XEOF
X
Xfi
X
Xecho $ac_n "checking for getpwnam""... $ac_c" 1>`266
Xecho "configure:1311: checking for getpwnam" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_func_getpwnam'+set`7D'`60`5C" = set";
V then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 1316 "configure"
X#include "confdefs.h"
X/* System header to define __stub macros and hopefully few prototypes,
X    which can conflict with char getpwnam(); below.  */
X#include <assert.h>
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar getpwnam();
X
Xint main() `7B
X
X/* The GNU C library defines this for functions which it implements
X    to always fail with ENOSYS.  Some functions are actually named
X    something starting with __ and the normal name is an alias.  */
X#if defined (__stub_getpwnam) `7C`7C\1D11__\1F09
Xchoke me
X#else
Xgetpwnam();
X#endif
X
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:1339: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_func_getpwnam=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_func_getpwnam=no"
Xfi
Xrm -f conftest*
Xfi
X
Xif eval "test `5C"`60echo '$ac_cv_func_'getpwnam`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  :
Xelse
X  echo "$ac_t""no" 1>`266
Xecho $ac_n "checking for getpwnam in -lsun""... $ac_c" 1>`266
Xecho "configure:1357: checking for getpwnam in -lsun" >`265
Xac_lib_var=`60echo sun'_'getpwnam `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lsun  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 1365 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar getpwnam();
X
Xint main() `7B
Xgetpwnam()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:1376: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X    ac_tr_lib=HAVE_LIB`60echo sun `7C sed -e 's/`5Ea-zA-Z0-9_/_/g' `5C
X    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`60
X  cat >> confdefs.h <<EOF
X#define $ac_tr_lib 1
XEOF
X
X  LIBS="-lsun $LIBS"
X
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
Xfi
X
X
X# check for SCO.
X# FIXME:  this is a hack, and should be split into individual features -- the
V
X# sys/time.h and select.h conflict.
Xecho "checking for SCO by \1409on /usr/bin/scosh" 1>`266
Xecho "configure:1410: checking for SCO by\140Aon /usr/bin/scosh" >`265
X# Extract the first word of "scosh", so it can be a program name with args.
Xset dummy scosh; ac_word=$2
Xecho $ac_n "checking for $ac_word""... $ac_c" 1>`266
Xecho "configure:1414: checking for $ac_word" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_prog_COULD_BE_SCO'+set`7D'`60`5C" = se
Vt"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  if test -n "$COULD_BE_SCO"; then
X  ac_cv_prog_COULD_BE_SCO="$\0F0C" # Let the user override the test.
Xelse
X  IFS="$`7BIFS= `09`7D"; ac_save_ifs="$IFS"; \250A`7D:"
X  for ac_dir in $PATH; do
X    test -z "$ac_dir" `26`26 \0B06=.
X    if test -f $ac_dir/$ac_word; then
X      ac_cv_prog_COULD_BE_SCO="maybe"
X      break
X    fi
X  done
X  IFS="$ac_save_ifs"
X  test -z "$ac_cv_prog_COULD_BE_SCO" `26`26 \1C17="maybenot"
Xfi
Xfi
XCOULD_BE_SCO="$ac_cv_prog_\1A0C"
Xif test -n "$COULD_BE_SCO"; then
X  echo "$ac_t""$COULD_BE_SCO" 1>`266
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
Xif test "$COULD_BE_SCO" = "maybe"
Xthen
X`09cat >> confdefs.h <<`5CEOF
X#define SYSTEM_LOOKS_LIKE_SCO 1
XEOF
X
Xfi
X
X# check for a lint program.
Xfor ac_prog in lint alint lclint
Xdo
X# Extract the first word of "$ac_prog", so it can be a program name with args.
V
Xset dummy $ac_prog; ac_word=$2
Xecho $ac_n "checking for $ac_word""... $ac_c" 1>`266
Xecho "configure:1454: checking for $ac_word" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_prog_LINT'+set`7D'`60`5C" = set"; then
V
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  if test -n "$LINT"; then
X  ac_cv_prog_LINT="$LINT" # Let the user override the test.
Xelse
X  IFS="$`7BIFS= `09`7D"; ac_save_ifs="$IFS"; \250A`7D:"
X  for ac_dir in $PATH; do
X    test -z "$ac_dir" `26`26 \0B06=.
X    if test -f $ac_dir/$ac_word; then
X      ac_cv_prog_LINT="$ac_prog"
X      break
X    fi
X  done
X  IFS="$ac_save_ifs"
Xfi
Xfi
XLINT="$ac_cv_prog_LINT"
Xif test -n "$LINT"; then
X  echo "$ac_t""$LINT" 1>`266
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
Xtest -n "$LINT" `26`26 break
Xdone
X
Xif test -n "$LINT"
Xthen
X`09cat >> confdefs.h <<`5CEOF
X#define SYSTEM_HAS_LINT_PROG 1
XEOF
X
Xfi
X
X###`09checks for header files
Xecho $ac_n "checking for ANSI C header files""... $ac_c" 1>`266
Xecho "configure:1492: checking for ANSI C header files" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_header_stdc'+set`7D'`60`5C" = set"; th
Ven
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 1497 "configure"
X#include "confdefs.h"
X#include <stdlib.h>
X#include <stdarg.h>
X#include <string.h>
X#include <float.h>
XEOF
Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>\1E09out"
X`7B (eval echo configure:1505: `5C"$ac_try`5C") 1>`265;\2E07\1707) 2>`265; `7D
V
Xac_err=`60grep -v '`5E *+' conftest.out`60
Xif test -z "$ac_err"; then
X  rm -rf conftest*
X  ac_cv_header_stdc=yes
Xelse
X  echo "$ac_err" >`265
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  ac_cv_header_stdc=no
Xfi
Xrm -f conftest*
X
Xif test $ac_cv_header_stdc = yes; then
X  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
Xcat > conftest.$ac_ext <<EOF
X#line 1522 "configure"
X#include "confdefs.h"
X#include <string.h>
XEOF
Xif (eval "$ac_cpp conftest.$ac_ext") 2>`265 `7C
X  egrep "memchr" >/dev/null 2>`261; then
X  :
Xelse
X  rm -rf conftest*
X  ac_cv_header_stdc=no
Xfi
Xrm -f conftest*
X
Xfi
X
Xif test $ac_cv_header_stdc = yes; then
X  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
Xcat > conftest.$ac_ext <<EOF
X#line 1540 "configure"
X#include "confdefs.h"
X#include <stdlib.h>
XEOF
Xif (eval "$ac_cpp conftest.$ac_ext") 2>`265 `7C
X  egrep "free" >/dev/null 2>`261; then
X  :
Xelse
X  rm -rf conftest*
X  ac_cv_header_stdc=no
Xfi
Xrm -f conftest*
X
Xfi
X
Xif test $ac_cv_header_stdc = yes; then
X  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
Xif test "$cross_compiling" = yes; then
X  :
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 1561 "configure"
X#include "confdefs.h"
X#include <ctype.h>
X#define ISLOWER(c) ('a' <= (c) `26`26 (c) <= 'z')
X#define TOUPPER(c) (ISLOW\0C06? 'A' + ((c) - 'a') : (c))
X#define XOR(e, f) (((e) `26`26 !(f)) `7C`7C (!(\1206(f)))
Xint main () `7B int i; for (i = 0; i < 256; i++)
Xif (XOR (islower (i), ISLOWER (i)) `7C`7C toupp\1D06 != TOUPP\1F08exit(2);
Xexit (0); `7D
X
XEOF
Xif `7B (eval echo configure:1572: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest &0226 (./\0F08; exit) 2>/dev/null
Xthen
X  :
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -fr conftest*
X  ac_cv_header_stdc=no
Xfi
Xrm -fr conftest*
Xfi
X
Xfi
Xfi
X
Xecho "$ac_t""$ac_cv_header_stdc" 1>`266
Xif test $ac_cv_header_stdc = yes; then
X  cat >> confdefs.h <<`5CEOF
X#define STDC_HEADERS 1
XEOF
X
Xfi
X
Xac_header_dirent=no
Xfor ac_hdr in dirent.h sys/ndir\0B07\0A06\1106
Xdo
Xac_safe=`60echo "$ac_hdr" `7C sed 'y%./+-%__p_%'`60
Xecho $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>`266
Xecho "configure:1600: checking for $ac_hdr that defines DIR" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_header_dirent_$ac_safe'+set`7D'`60`5C"
V = set"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 1605 "configure"
X#include "confdefs.h"
X#include <sys/types.h>
X#include <$ac_hdr>
Xint main() `7B
XDIR *dirp = 0;
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:1613: `5C"$ac_compile`5C") 1>`265;\3207\1B0B) 2>
V`265; `7D; then
X  rm -rf conftest*
X  eval "ac_cv_header_dirent_$ac_safe=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_header_dirent_$ac_safe=no"
Xfi
Xrm -f conftest*
Xfi
Xif eval "test `5C"`60echo '$ac_cv_header_dirent_'$ac_safe`60`5C" = yes"; then
V
X  echo "$ac_t""yes" 1>`266
X    ac_tr_hdr=HAVE_`60echo $ac_hdr `7C sed 'y%abcdefghijklmnopqrstuvwxyz./-%AB
VCDEFGHIJKLMNOPQRSTUVWXYZ___%'`60
X  cat >> confdefs.h <<EOF
X#define $ac_tr_hdr 1
XEOF
X ac_header_dirent=$ac_hdr; break
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
Xdone
X# Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
Xif test $ac_header_dirent = \0906.h; then
Xecho $ac_n "checking for opendir in -ldir""... $ac_c" 1>`266
Xecho "configure:1638: checking for opendir in -ldir" >`265
Xac_lib_var=`60echo dir'_'opendir `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-ldir  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 1646 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar opendir();
X
Xint main() `7B
Xopendir()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:1657: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="$LIBS -ldir"
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
Xelse
Xecho $ac_n "checking for opendir in -lx""... $ac_c" 1>`266
Xecho "configure:1679: checking for opendir in -lx" >`265
Xac_lib_var=`60echo x'_'opendir `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lx  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 1687 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar opendir();
X
Xint main() `7B
Xopendir()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:1698: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="$LIBS -lx"
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
Xfi
X
Xfor ac_hdr in unistd.h stdlib\0906arg\1206def.h string.h memory.h fcntl.h `5C
V
X        \0808poll.h pwd.h termios\0A09.h sgtty.h `5C
X`09`09ioctl.h select.h setjmp.h signal.h utime.h varargs.h
Xdo
Xac_safe=`60echo "$ac_hdr" `7C sed 'y%./+-%__p_%'`60
Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>`266
Xecho "configure:1726: checking for $ac_hdr" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_header_$ac_safe'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 1731 "configure"
X#include "confdefs.h"
X#include <$ac_hdr>
XEOF
Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>\1E09out"
X`7B (eval echo configure:1736: `5C"$ac_try`5C") 1>`265;\2E07\1707) 2>`265; `7D
V
Xac_err=`60grep -v '`5E *+' conftest.out`60
Xif test -z "$ac_err"; then
X  rm -rf conftest*
X  eval "ac_cv_header_$ac_safe=yes"
Xelse
X  echo "$ac_err" >`265
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_header_$ac_safe=no"
Xfi
Xrm -f conftest*
Xfi
Xif eval "test `5C"`60echo '$ac_cv_header_'$ac_safe`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X    ac_tr_hdr=HAVE_`60echo $ac_hdr `7C sed 'y%abcdefghijklmnopqrstuvwxyz./-%AB
VCDEFGHIJKLMNOPQRSTUVWXYZ___%'`60
X  cat >> confdefs.h <<EOF
X#define $ac_tr_hdr 1
XEOF
X`20
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
Xdone
X
X
X###`09checks for <sys/xxx> header files (separate, to avoid bug in autoconf)
Xfor ac_hdr in sys/filio.h sys/ioctl\0C08timer.h `5C
X`09`09sys/param.h `5C
X`09`09sys/resource.h sys/wait\0B07tim\1608select.h
Xdo
Xac_safe=`60echo "$ac_hdr" `7C sed 'y%./+-%__p_%'`60
Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>`266
Xecho "configure:1770: checking for $ac_hdr" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_header_$ac_safe'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 1775 "configure"
X#include "confdefs.h"
X#include <$ac_hdr>
XEOF
Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>\1E09out"
X`7B (eval echo configure:1780: `5C"$ac_try`5C") 1>`265;\2E07\1707) 2>`265; `7D
V
Xac_err=`60grep -v '`5E *+' conftest.out`60
Xif test -z "$ac_err"; then
X  rm -rf conftest*
X  eval "ac_cv_header_$ac_safe=yes"
Xelse
X  echo "$ac_err" >`265
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_header_$ac_safe=no"
Xfi
Xrm -f conftest*
Xfi
Xif eval "test `5C"`60echo '$ac_cv_header_'$ac_safe`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X    ac_tr_hdr=HAVE_`60echo $ac_hdr `7C sed 'y%abcdefghijklmnopqrstuvwxyz./-%AB
VCDEFGHIJKLMNOPQRSTUVWXYZ___%'`60
X  cat >> confdefs.h <<EOF
X#define $ac_tr_hdr 1
XEOF
X`20
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
Xdone
X
X
X###`09checks for typedefs
Xecho $ac_n "checking return type of signal handlers""... $ac_c" 1>`266
Xecho "configure:1809: checking return type of signal handlers" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_type_signal'+set`7D'`60`5C" = set"; th
Ven
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 1814 "configure"
X#include "confdefs.h"
X#include <sys/types.h>
X#include <signal.h>
X#ifdef signal
X#undef signal
X#endif
X#ifdef __cplusplus
Xextern "C" void (*signal (int,\1408)(int))\0706;
X#else
Xvoid (*signal ()) ();
X#endif
X
Xint main() `7B
Xint i;
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:1831: `5C"$ac_compile`5C") 1>`265;\3207\1B0B) 2>
V`265; `7D; then
X  rm -rf conftest*
X  ac_cv_type_signal=void
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  ac_cv_type_signal=int
Xfi
Xrm -f conftest*
Xfi
X
Xecho "$ac_t""$ac_cv_type_signal" 1>`266
Xcat >> confdefs.h <<EOF
X#define RETSIGTYPE $ac_cv_type_signal
XEOF
X
X
Xcat >> confdefs.h <<`5CEOF
X#define SIGT RETSIGTYPE
XEOF
X
Xif test $ac_cv_type_signal = void; then
X`09cat >> confdefs.h <<`5CEOF
X#define SIGRET /*do nothing*/
XEOF
X
Xelse
X`09cat >> confdefs.h <<`5CEOF
X#define SIGRET return 0
XEOF
X
Xfi
X
Xecho $ac_n "checking for size_t""... $ac_c" 1>`266
Xecho "configure:1866: checking for size_t" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_type_size_t'+set`7D'`60`5C" = set"; th
Ven
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 1871 "configure"
X#include "confdefs.h"
X#include <sys/types.h>
X#if STDC_HEADERS
X#include <stdlib.h>
X#include <stddef.h>
X#endif
XEOF
Xif (eval "$ac_cpp conftest.$ac_ext") 2>`265 `7C
X  egrep "size_t`5B`5Ea-zA-Z_0-9`5D" >/dev/null 2>`261; then
X  rm -rf conftest*
X  ac_cv_type_size_t=yes
Xelse
X  rm -rf conftest*
X  ac_cv_type_size_t=no
Xfi
Xrm -f conftest*
X
Xfi
Xecho "$ac_t""$ac_cv_type_size_t" 1>`266
Xif test $ac_cv_type_size_t = no; then
X  cat >> confdefs.h <<`5CEOF
X#define size_t unsigned
XEOF
X
Xfi
X
Xecho $ac_n "checking for off_t""... $ac_c" 1>`266
Xecho "configure:1899: checking for off_t" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_type_off_t'+set`7D'`60`5C" = set"; the
Vn
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 1904 "configure"
X#include "confdefs.h"
X#include <sys/types.h>
X#if STDC_HEADERS
X#include <stdlib.h>
X#include <stddef.h>
X#endif
XEOF
Xif (eval "$ac_cpp conftest.$ac_ext") 2>`265 `7C
X  egrep "off_t`5B`5Ea-zA-Z_0-9`5D" >/dev/null 2>`261; then
X  rm -rf conftest*
X  ac_cv_type_off_t=yes
Xelse
X  rm -rf conftest*
X  ac_cv_type_off_t=no
Xfi
Xrm -f conftest*
X
Xfi
Xecho "$ac_t""$ac_cv_type_off_t" 1>`266
Xif test $ac_cv_type_off_t = no; then
X  cat >> confdefs.h <<`5CEOF
X#define off_t long
XEOF
X
Xfi
X
Xecho $ac_n "checking for uid_t in sys/types.h""... $ac_c" 1>`266
Xecho "configure:1932: checking for uid_t in sys/types.h" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_type_uid_t'+set`7D'`60`5C" = set"; the
Vn
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 1937 "configure"
X#include "confdefs.h"
X#include <sys/types.h>
XEOF
Xif (eval "$ac_cpp conftest.$ac_ext") 2>`265 `7C
X  egrep "uid_t" >/dev/null 2>`261; then
X  rm -rf conftest*
X  ac_cv_type_uid_t=yes
Xelse
X  rm -rf conftest*
X  ac_cv_type_uid_t=no
Xfi
Xrm -f conftest*
X
Xfi
X
Xecho "$ac_t""$ac_cv_type_uid_t" 1>`266
Xif test $ac_cv_type_uid_t = no; then
X  cat >> confdefs.h <<`5CEOF
X#define uid_t int
XEOF
X
X  cat >> confdefs.h <<`5CEOF
X#define gid_t int
XEOF
X
Xfi
X
Xecho $ac_n "checking for pid_t""... $ac_c" 1>`266
Xecho "configure:1966: checking for pid_t" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_type_pid_t'+set`7D'`60`5C" = set"; the
Vn
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 1971 "configure"
X#include "confdefs.h"
X#include <sys/types.h>
X#if STDC_HEADERS
X#include <stdlib.h>
X#include <stddef.h>
X#endif
XEOF
Xif (eval "$ac_cpp conftest.$ac_ext") 2>`265 `7C
X  egrep "pid_t`5B`5Ea-zA-Z_0-9`5D" >/dev/null 2>`261; then
X  rm -rf conftest*
X  ac_cv_type_pid_t=yes
Xelse
X  rm -rf conftest*
X  ac_cv_type_pid_t=no
Xfi
Xrm -f conftest*
X
Xfi
Xecho "$ac_t""$ac_cv_type_pid_t" 1>`266
Xif test $ac_cv_type_pid_t = no; then
X  cat >> confdefs.h <<`5CEOF
X#define pid_t int
XEOF
X
Xfi
X
Xecho $ac_n "checking for time_t""... $ac_c" 1>`266
Xecho "configure:1999: checking for time_t" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_type_time_t'+set`7D'`60`5C" = set"; th
Ven
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 2004 "configure"
X#include "confdefs.h"
X#include <sys/types.h>
X#if STDC_HEADERS
X#include <stdlib.h>
X#include <stddef.h>
X#endif
XEOF
Xif (eval "$ac_cpp conftest.$ac_ext") 2>`265 `7C
X  egrep "time_t`5B`5Ea-zA-Z_0-9`5D" >/dev/null 2>`261; then
X  rm -rf conftest*
X  ac_cv_type_time_t=yes
Xelse
X  rm -rf conftest*
X  ac_cv_type_time_t=no
Xfi
Xrm -f conftest*
X
Xfi
Xecho "$ac_t""$ac_cv_type_time_t" 1>`266
Xif test $ac_cv_type_time_t = no; then
X  cat >> confdefs.h <<`5CEOF
X#define time_t long
XEOF
X
Xfi
X
X
X###`09checks for library functions
Xif test "$cross_compiling" = no; then
X`09echo $ac_n "checking whether setvbuf arguments are reversed""... $ac_c" 1>
V`266
Xecho "configure:2035: checking whether setvbuf arguments are reversed" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_func_setvbuf_reversed'+set`7D'`60`5C"
V = set"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  if test "$cross_compiling" = yes; then
X    `7B echo "configure: error: can not run test program while cross compiling
V" 1>`262; exit 1; `7D
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 2043 "configure"
X#include "confdefs.h"
X#include <stdio.h>
X/* If setvbuf has the reversed format, exit 0. */
Xmain () `7B
X  /* This call has the arguments reversed.
X     A reversed system may check and see that the address of main
X     is not _IOLBF, _IONBF, or _IOFBF, and return nonzero.  */
X  if (setvbuf(stdout, _IOLBF, (char *) main, BUFSIZ) != 0)
X    exit(1);
X  putc('`5Cr', stdout);
X  exit(0);`09`09`09/* Non-reversed systems segv here.  */
X`7D
XEOF
Xif `7B (eval echo configure:2057: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest &0226 (./\0F08; exit) 2>/dev/null
Xthen
X  ac_cv_func_setvbuf_reversed=yes
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -fr conftest*
X  ac_cv_func_setvbuf_reversed=no
Xfi
Xrm -fr conftest*
Xfi
X
Xrm -f core core.* *.core
Xfi
X
Xecho "$ac_t""$ac_cv_func_setvbuf_reversed" 1>`266
Xif test $ac_cv_func_setvbuf_reversed = yes; then
X  cat >> confdefs.h <<`5CEOF
X#define SETVBUF_REVERSED 1
XEOF
X
Xfi
X
Xfi
X
X###`09checks for structures
Xecho $ac_n "checking whether stat file-mode macros are broken""... $ac_c" 1>
V`266
Xecho "configure:2084: checking whether stat file-mode macros are broken" >`265
V
Xif eval "test `5C"`60echo '$''`7B'ac_cv_header_stat_broken'+set`7D'`60`5C" = s
Vet"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 2089 "configure"
X#include "confdefs.h"
X#include <sys/types.h>
X#include <sys/stat.h>
X
X#if defined(S_ISBLK) `26`26\140CFDIR)
X# if S_ISBLK (S_IFDIR)
XYou lose.
X# endif
X#endif
X
X#if defined(S_ISBLK) `26`26\140CFCHR)
X# if S_ISBLK (S_IFCHR)
XYou lose.
X# endif
X#endif
X
X#if defined(S_ISLNK) `26`26\140CFREG)
X# if S_ISLNK (S_IFREG)
XYou lose.
X# endif
X#endif
X
X#if defined(S_ISSOCK) `26`26\150CFREG)
X# if S_ISSOCK (S_IFREG)
XYou lose.
X# endif
X#endif
X
XEOF
Xif (eval "$ac_cpp conftest.$ac_ext") 2>`265 `7C
X  egrep "You lose" >/dev/null 2>`261; then
X  rm -rf conftest*
X  ac_cv_header_stat_broken=yes
Xelse
X  rm -rf conftest*
X  ac_cv_header_stat_broken=no
Xfi
Xrm -f conftest*
X
Xfi
X
Xecho "$ac_t""$ac_cv_header_stat_broken" 1>`266
Xif test $ac_cv_header_stat_broken = yes; then
X  cat >> confdefs.h <<`5CEOF
X#define STAT_MACROS_BROKEN 1
XEOF
X
Xfi
X
Xecho $ac_n "checking for st_blksize in struct stat""... $ac_c" 1>`266
Xecho "configure:2140: checking for st_blksize in struct stat" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_struct_st_blksize'+set`7D'`60`5C" = se
Vt"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 2145 "configure"
X#include "confdefs.h"
X#include <sys/types.h>
X#include <sys/stat.h>
Xint main() `7B
Xstruct stat s; s.st_blksize;
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:2153: `5C"$ac_compile`5C") 1>`265;\3207\1B0B) 2>
V`265; `7D; then
X  rm -rf conftest*
X  ac_cv_struct_st_blksize=yes
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  ac_cv_struct_st_blksize=no
Xfi
Xrm -f conftest*
Xfi
X
Xecho "$ac_t""$ac_cv_struct_st_blksize" 1>`266
Xif test $ac_cv_struct_st_blksize = yes; then
X  cat >> confdefs.h <<`5CEOF
X#define HAVE_ST_BLKSIZE 1
XEOF
X
Xfi
X
Xecho $ac_n "checking for st_blocks in struct stat""... $ac_c" 1>`266
Xecho "configure:2174: checking for st_blocks in struct stat" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_struct_st_blocks'+set`7D'`60`5C" = set
V"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 2179 "configure"
X#include "confdefs.h"
X#include <sys/types.h>
X#include <sys/stat.h>
Xint main() `7B
Xstruct stat s; s.st_blocks;
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:2187: `5C"$ac_compile`5C") 1>`265;\3207\1B0B) 2>
V`265; `7D; then
X  rm -rf conftest*
X  ac_cv_struct_st_blocks=yes
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  ac_cv_struct_st_blocks=no
Xfi
Xrm -f conftest*
Xfi
X
Xecho "$ac_t""$ac_cv_struct_st_blocks" 1>`266
Xif test $ac_cv_struct_st_blocks = yes; then
X  cat >> confdefs.h <<`5CEOF
X#define HAVE_ST_BLOCKS 1
XEOF
X
Xelse
X  LIBOBJS="$\0A07 fileblocks.o"
Xfi
X
Xecho $ac_n "checking for st_rdev in struct stat""... $ac_c" 1>`266
Xecho "configure:2210: checking for st_rdev in struct stat" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_struct_st_rdev'+set`7D'`60`5C" = set";
V then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 2215 "configure"
X#include "confdefs.h"
X#include <sys/types.h>
X#include <sys/stat.h>
Xint main() `7B
Xstruct stat s; s.st_rdev;
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:2223: `5C"$ac_compile`5C") 1>`265;\3207\1B0B) 2>
V`265; `7D; then
X  rm -rf conftest*
X  ac_cv_struct_st_rdev=yes
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  ac_cv_struct_st_rdev=no
Xfi
Xrm -f conftest*
Xfi
X
Xecho "$ac_t""$ac_cv_struct_st_rdev" 1>`266
Xif test $ac_cv_struct_st_rdev = yes; then
X  cat >> confdefs.h <<`5CEOF
X#define HAVE_ST_RDEV 1
XEOF
X
Xfi
X
Xecho $ac_n "checking whether time.h and sys/\0F07may both be included""... $ac
V_c" 1>`266
Xecho "configure:2244: checking whether time.h and sys/\0F07may both be include
Vd" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_header_time'+set`7D'`60`5C" = set"; th
Ven
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 2249 "configure"
X#include "confdefs.h"
X#include <sys/types.h>
X#include <sys/time.h>
X#include <time.h>
Xint main() `7B
Xstruct tm *tp;
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:2258: `5C"$ac_compile`5C") 1>`265;\3207\1B0B) 2>
V`265; `7D; then
X  rm -rf conftest*
X  ac_cv_header_time=yes
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  ac_cv_header_time=no
Xfi
Xrm -f conftest*
Xfi
X
Xecho "$ac_t""$ac_cv_header_time" 1>`266
Xif test $ac_cv_header_time = yes; then
X  cat >> confdefs.h <<`5CEOF
X#define TIME_WITH_SYS_TIME 1
XEOF
X
Xfi
X
Xecho $ac_n "checking whether struct tm is in sys/time.h or \0A06""... $ac_c" 1
V>`266
Xecho "configure:2279: checking whether struct tm is in sys/time.h or \0A06" >
V`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_struct_tm'+set`7D'`60`5C" = set"; then
V
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 2284 "configure"
X#include "confdefs.h"
X#include <sys/types.h>
X#include <time.h>
Xint main() `7B
Xstruct tm *tp; tp->tm_sec;
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:2292: `5C"$ac_compile`5C") 1>`265;\3207\1B0B) 2>
V`265; `7D; then
X  rm -rf conftest*
X  ac_cv_struct_tm=time.h
Xelse
X  echo "configure: failed program was:" >`265
+-+-+-+-+-+-+-+-  END  OF PART 33 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 34 -+-+-+-+-+-+-+-+
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  ac_cv_struct_tm=sys/time.h
Xfi
Xrm -f conftest*
Xfi
X
Xecho "$ac_t""$ac_cv_struct_tm" 1>`266
Xif test $ac_cv_struct_tm = sys/time.h; then
X  cat >> confdefs.h <<`5CEOF
X#define TM_IN_SYS_TIME 1
XEOF
X
Xfi
X
X
Xecho $ac_n "checking declaration of size-change""... $ac_c" 1>`266
Xecho "configure:2314: checking declaration of size-change" >`265
Xif eval "test `5C"`60echo '$''`7B'cf_cv_sizechange'+set`7D'`60`5C" = set"; the
Vn
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
X    cf_cv_sizechange=unknown
X    cf_save_CFLAGS="$\0906"
X
Xfor cf_opts in "" "NEED_PTEM_H"
Xdo
X
X    CFLAGS="$cf_save_\1106"
X    test -n "$cf_opts" `26`26 CFLAGS="$\0906 -D\1F09
X    cat > conftest.$ac_ext <<EOF
X#line 2328 "configure"
X#include "confdefs.h"
X#include <sys/types.h>
X#if HAVE_TERMIOS_H
X#include <termios.h>
X#else
X#if HAVE_TERMIO_H
X#include <termio.h>
X#endif
X#endif
X#if NEED_PTEM_H
X/* This is a workaround for SCO:  they neglected to define struct winsize in
X * termios.h -- it's only in\1A07.h and ptem.h
X */
X#include        <sys/stream.h>
X#include        <sys/ptem.h>
X#endif
X#if !defined(sun) `7C`7C\110AHAVE_TERMIOS_H)
X#include <sys/ioctl.h>
X#endif
X
Xint main() `7B
X
X#ifdef TIOCGSIZE
X`09struct ttysize win;`09/* FIXME: what system is this? */
X`09int y = win.ts_lines;
X`09int x = win.ts_cols;
X#else
X#ifdef TIOCGWINSZ
X`09struct winsize win;
X`09int y = win.ws_row;
X`09int x = win.ws_col;
X#else
X`09no TIOCGSIZE or\0D06WINSZ
X#endif /* TIOCGWINSZ */
X#endif /* TIOCGSIZE */
X`09
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:2367: `5C"$ac_compile`5C") 1>`265;\3207\1B0B) 2>
V`265; `7D; then
X  rm -rf conftest*
X  cf_cv_sizechange=yes
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  cf_cv_sizechange=no
Xfi
Xrm -f conftest*
X
X`09CFLAGS="$cf_save_\1106"
X`09if test "$cf_cv_sizechange" = yes ; then
X`09`09echo "size-change succeeded ($cf_opts)" >`265
X`09`09test -n "$cf_opts" `26`26 cat >> confdefs.h <<EOF
X#define $cf_opts 1
XEOF
X
X`09`09break
X`09fi
Xdone
X`09
Xfi
X
Xecho "$ac_t""$cf_cv_sizechange" 1>`266
Xtest $cf_cv_sizechange != no `26`26 cat >> confdefs.h <<`5CEOF
X#define HAVE_SIZECHANGE 1
XEOF
X
X
X
Xecho $ac_n "checking for file-pointer ready definition""... $ac_c" 1>`266
Xecho "configure:2399: checking for file-pointer ready definition" >`265
Xif eval "test `5C"`60echo '$''`7B'cf_cv_fp_isready'+set`7D'`60`5C" = set"; the
Vn
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
Xcf_cv_fp_isready=none
Xwhile true
Xdo
X`09read definition
X`09test -z "$definition" `26`26 break
X`09echo "test-compile $definition" 1>`265
X
X`09cat > conftest.$ac_ext <<EOF
X#line 2412 "configure"
X#include "confdefs.h"
X
X#include <stdio.h>
X#define isready_c(p) $definition
X
Xint main() `7B
Xint x = isready_c(stdin)
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:2422: `5C"$ac_compile`5C") 1>`265;\3207\1B0B) 2>
V`265; `7D; then
X  rm -rf conftest*
X  echo "$definition" >conftest.env
X`09 break
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
Xfi
Xrm -f conftest*
X
Xdone <<'CF_EOF'
X( (p)->_IO_read_ptr <\140Fend)
X( (p)->__cnt > 0)
X( (p)->__rptr <\0E09end)
X( (p)->_cnt > 0)
X( (p)->_gptr <\0D07egptr)
X( (p)->_r > 0)
X( (p)->_rcount > 0)
X( (p)->endr <\0C09b)
XCF_EOF
X
Xtest -f conftest.env `26`26 cf_cv_fp_isready=`60cat \260C`60
X
X
Xfi
X
Xecho "$ac_t""$cf_cv_fp_isready" 1>`266
X
Xtest "$cf_cv_fp_isready" != none `26`26 cat >> confdefs.h <<EOF
X#define isready_c(p) $cf_cv_fp_\1707
XEOF
X
X
X
X
X###`09checks for compiler characteristics
Xecho $ac_n "checking for working const""... $ac_c" 1>`266
Xecho "configure:2459: checking for working const" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_c_const'+set`7D'`60`5C" = set"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 2464 "configure"
X#include "confdefs.h"
X
Xint main() `7B
X
X/* Ultrix mips cc rejects this.  */
Xtypedef int charset`5B2`5D; cons\1209 x;
X/* SunOS 4.1.1 cc rejects this.  */
Xchar const *\0707ccp;
Xchar **p;
X/* NEC SVR4.0.2 mips cc rejects this.  */
Xstruct point `7Bint x, y;`7D;
Xstatic struct point const zero = `7B0,0`7D;
X/* AIX XL C 1.02.0.0 rejects this.
X   It does not let you subtract one const X* pointer from another in an arm
X   of an if-expression whose if-part is not a constant \2B0B*/
Xconst char *g = "string";
Xccp = `26g + (g ? g-g : 0);
X/* HPUX 7.0 cc rejects these. */
X++ccp;
Xp = (char**) ccp;
Xccp = (char const *\0707) p;
X`7B /* SCO 3.2v4 cc rejects this.  */
X  char *t;
X  char const *s = 0 ? (char *) 0 :\0D07\2207) 0;
X
X  *t++ = 0;
X`7D
X`7B /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
X  int x`5B`5D = `7B25, 17`7D;
X  const int *foo = `26x`5B0`5D;
X  ++foo;
X`7D
X`7B /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
X  typedef const int *iptr;
X  iptr p = 0;
X  ++p;
X`7D
X`7B /* AIX XL C 1.02.0.0 rejects this saying
X     "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
X  struct s `7B int j; const int *ap`5B3`5D; `7D;
X  struct s *b; b->j = 5;
X`7D
X`7B /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
X  const int foo = 10;
X`7D
X
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:2513: `5C"$ac_compile`5C") 1>`265;\3207\1B0B) 2>
V`265; `7D; then
X  rm -rf conftest*
X  ac_cv_c_const=yes
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  ac_cv_c_const=no
Xfi
Xrm -f conftest*
Xfi
X
Xecho "$ac_t""$ac_cv_c_const" 1>`266
Xif test $ac_cv_c_const = no; then
X  cat >> confdefs.h <<`5CEOF
X#define const`20
XEOF
X
Xfi
X
X
Xecho $ac_n "checking for $`7BCC-cc`7D option to accept ANSI C""... $ac_c" 1>
V`266
Xecho "configure:2535: checking for $`7BCC-cc`7D option to accept ANSI C" >`265
V
Xif eval "test `5C"`60echo '$''`7B'cf_cv_ansi_cc'+set`7D'`60`5C" = set"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
Xcf_cv_ansi_cc=no
Xcf_save_CFLAGS="$\0906"
X# Don't try gcc -ansi; that turns off useful extensions and
X# breaks some systems' header files.
X# AIX`09`09`09-qlanglvl=ansi
X# Ultrix and OSF/1`09-std1
X# HP-UX`09`09`09-Aa -D_HPUX_SOURCE
X# SVR4`09`09`09-Xc
X# UnixWare 1.2`09`09(cannot use -Xc, since ANSI/POSIX clashes)
Xfor cf_arg in "-DCC_HAS_PROTOS" `5C
X`09"" `5C
X`09-qlanglvl=ansi `5C
X`09-std1 `5C
X`09"-Aa -D_HPUX_SOURCE +e" `5C
X`09"-Aa -D_HPUX_SOURCE" `5C
X`09-Xc
Xdo
X`09CFLAGS="$cf_save_\1106 $cf_arg"
X`09cat > conftest.$ac_ext <<EOF
X#line 2559 "configure"
X#include "confdefs.h"
X
X#ifndef CC_HAS_PROTOS
X#if !defined(__STDC__) `7C`7C \0D08 != 1
Xchoke me
X#endif
X#endif
X
Xint main() `7B
X
X`09int test (int i, double x);
X`09struct s1 `7Bint (*f) (int a);`7D;
X`09struct s2 `7Bint (*f) (double a);`7D;
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:2575: `5C"$ac_compile`5C") 1>`265;\3207\1B0B) 2>
V`265; `7D; then
X  rm -rf conftest*
X  cf_cv_ansi_cc="$cf_arg"; break
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
Xfi
Xrm -f conftest*
Xdone
XCFLAGS="$cf_save_\1106"
X
Xfi
X
Xecho "$ac_t""$cf_cv_ansi_cc" 1>`266
X
Xif test "$cf_cv_ansi_cc" != "no"; then
Xif test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then
X`09CFLAGS="$\0906 $cf_cv_ansi_cc"
Xelse
X`09cat >> confdefs.h <<`5CEOF
X#define CC_HAS_PROTOS 1
XEOF
X
Xfi
Xfi
X
X
Xif test "$cf_cv_ansi_cc" = "no"; then
X`09`7B echo "configure: error: Your compiler does not appear to recognize prot
Votypes.
XYou have the following choices:
X`09a. adjust your compiler options
X`09b. get an up-to-date compiler
X`09c. use a wrapper such as unproto" 1>`262; exit 1; `7D
Xfi
X
X
X# I haven't found a "losing" compiler to check the following on.  I gather
X# that some losing compiler's can be found on pyramid's, aix, and Apple's AUX2
V.
X# (Lint on several platforms will complain, even when the compiler won't).
Xecho $ac_n "checking if switch cases work with structure offsets""... $ac_c" 1
V>`266
Xecho "configure:2615: checking if switch cases work with structure offsets" >
V`265
Xif eval "test `5C"`60echo '$''`7B'cf_cv_case_offsetof'+set`7D'`60`5C" = set";
V then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
X`09cat > conftest.$ac_ext <<EOF
X#line 2621 "configure"
X#include "confdefs.h"
X
Xint main() `7B
Xstruct foo `7Bint a,b;`7D;
X`09 extern getpid();
X`09 switch(getpid())`7Bcase ((int) `26(((struct foo *)0)->b)) : printf("foo");
V `7D`20
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:2630: `5C"$ac_compile`5C") 1>`265;\3207\1B0B) 2>
V`265; `7D; then
X  rm -rf conftest*
X  cf_cv_case_offsetof=yes
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  cf_cv_case_offsetof=no
Xfi
Xrm -f conftest*
X`09
Xfi
X
Xecho "$ac_t""$cf_cv_case_offsetof" 1>`266
Xtest $cf_cv_case_offsetof = no `26`26 cat >> confdefs.h <<`5CEOF
X#define HAVE_LOSING_SWITCH_WITH_STRUCTURE_OFFSET 1
XEOF
X
X
X###`09checks for system services and user specified options
Xecho $ac_n "checking for long file names""... $ac_c" 1>`266
Xecho "configure:2651: checking for long file names" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_sys_long_file_names'+set`7D'`60`5C" =
V set"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_cv_sys_long_file_names=yes
X# Test for long file names in all the places we know might matter:
X#      .`09`09the current directory, where building will happen
X#      $prefix/lib`09where we will be installing things
X#      $exec_prefix/lib`09likewise
X# eval it to expand exec_prefix.
X#      $TMPDIR`09`09if set, where it might want to write temporary files
X# if $TMPDIR is not set:
X#      /tmp`09`09where it might want to write temporary files
X#      /var/tmp`09`09likewise
X#      /usr/tmp`09`09likewise
Xif test -n "$TMPDIR" `26`26\1507d\1514w\2A0A; then
X  ac_tmpdirs="$TMPDIR"
Xelse
X  ac_tmpdirs='/tmp /var\0906usr/tmp'
Xfi
Xfor ac_dir in  . $ac_tmpdirs `60eval echo $prefix/lib $exec_\110A`60 ; do
X  test -d $ac_dir `7C`7C continue
X  test -w $ac_dir `7C`7C continue # It is less confusing to not echo anything
V here.
X  (echo 1 > $ac_dir/conftest9012345) 2>/dev/null
X  (echo 2 > $ac_dir/conftest9012346) 2>/dev/null
X  val=`60cat $ac_dir/conftest9012345 2>/dev/null`60
X  if test ! -f $ac_dir/conftest9012345 `7C`7C\2506"$val" != 1; then
X    ac_cv_sys_long_file_names=no
X    rm -f $ac_dir/conftest9012345\18176 2>/dev/null
X    break
X  fi
X  rm -f $ac_dir/conftest9012345\18176 2>/dev/null
Xdone
Xfi
X
Xecho "$ac_t""$ac_cv_sys_long_file_names" 1>`266
Xif test $ac_cv_sys_long_file_names = yes; then
X  cat >> confdefs.h <<`5CEOF
X#define HAVE_LONG_FILE_NAMES 1
XEOF
X
Xfi
X
X
Xecho $ac_n "checking for restartable reads on pipes""... $ac_c" 1>`266
Xecho "configure:2696: checking for restartable reads on pipes" >`265
Xif eval "test `5C"`60echo '$''`7B'cf_cv_can_restart_read'+set`7D'`60`5C" = set
V"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
Xif test "$cross_compiling" = yes; then
X  cf_cv_can_restart_read=unknown
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 2705 "configure"
X#include "confdefs.h"
X/* Exit 0 (true) if wait returns something other than -1,
X   i.e. the pid of the child, which means that wait was restarted
X   after getting the signal.  */
X#include <sys/types.h>
X#include <signal.h>
X#ifdef SA_RESTART
Xsigwrapper(sig, disp)
Xint sig;
Xvoid (*disp)();
X`7B
X    struct sigaction act, oact;
X
X    act.sa_handler = disp;
X    sigemptyset(`26act.sa_mask);
X    act.sa_flags = SA_RESTART;
X
X    (void)sigaction(sig, `26act, `26oact);
X
X`7D
X#else
X# define sigwrapper signal
X#endif
Xucatch (isig) `7B `7D
Xmain () `7B
X  int i, status;
X  int fd`5B2`5D;
X  char buff`5B2`5D;
X  pipe(fd);
X  i = fork();
X  if (i == 0) `7B
X      sleep (2);
X      kill (getppid (), SIGINT);
X      sleep (2);
X      write(fd`5B1`5D,"done",4);
X      close(fd`5B1`5D);
X      exit (0);
X  `7D
X  sigwrapper (SIGINT, ucatch);
X  status = read(fd`5B0`5D, buff, sizeof(buff));
X  wait (`26i);
X  exit (status == -1);
X`7D
X
XEOF
Xif `7B (eval echo configure:2751: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest &0226 (./\0F08; exit) 2>/dev/null
Xthen
X  cf_cv_can_restart_read=yes
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -fr conftest*
X  cf_cv_can_restart_read=no
Xfi
Xrm -fr conftest*
Xfi
X
Xfi
X
Xecho "$ac_t""$cf_cv_can_restart_read" 1>`266
Xtest $cf_cv_can_restart_read = yes `26`26 cat >> confdefs.h <<`5CEOF
X#define HAVE_RESTARTABLE_PIPEREAD 1
XEOF
X
X`09`09# is a read() of a pipe restartable?
X
X
X
X
X
X
X
X
X
Xecho $ac_n "checking whether setpgrp takes no argument""... $ac_c" 1>`266
Xecho "configure:2781: checking whether setpgrp takes no argument" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_func_setpgrp_void'+set`7D'`60`5C" = se
Vt"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  if test "$cross_compiling" = yes; then
X  `7B echo "configure: error: cannot check setpgrp if cross compiling" 1>`262;
V exit 1; `7D
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 2789 "configure"
X#include "confdefs.h"
X
X/*
X * If this system has a BSD-style setpgrp, which takes arguments, exit
X * successfully.
X */
Xmain()
X`7B
X    if (setpgrp(1,1) == -1)
X`09exit(0);
X    else
X`09exit(1);
X`7D
X
XEOF
Xif `7B (eval echo configure:2805: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest &0226 (./\0F08; exit) 2>/dev/null
Xthen
X  ac_cv_func_setpgrp_void=no
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -fr conftest*
X  ac_cv_func_setpgrp_void=yes
Xfi
Xrm -fr conftest*
Xfi
X
X
Xfi
X
Xecho "$ac_t""$ac_cv_func_setpgrp_void" 1>`266
Xif test $ac_cv_func_setpgrp_void = yes; then
X  cat >> confdefs.h <<`5CEOF
X#define SETPGRP_VOID 1
XEOF
X
Xfi
X
Xecho $ac_n "checking whether getpgrp takes no argument""... $ac_c" 1>`266
Xecho "configure:2829: checking whether getpgrp takes no argument" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_func_getpgrp_void'+set`7D'`60`5C" = se
Vt"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  if test "$cross_compiling" = yes; then
X  `7B echo "configure: error: cannot check getpgrp if cross compiling" 1>`262;
V exit 1; `7D
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 2837 "configure"
X#include "confdefs.h"
X
X/*
X * If this system has a BSD-style getpgrp(),
X * which takes a pid argument, exit unsuccessfully.
X *
X * Snarfed from Chet Ramey's bash pgrp.c test program
X */
X#include <stdio.h>
X#include <sys/types.h>
X
Xint     pid;
Xint     pg1, pg2, pg3, pg4;
Xint     ng, np, s, child;
X
Xmain()
X`7B
X        pid = getpid();
X        pg1 = getpgrp(0);
X        pg2 = getpgrp();
X        pg3 = getpgrp(pid);
X        pg4 = getpgrp(1);
X
X        /*
X         * If all of these values are the same, it's pretty sure that
X         * we're on a system that ignores getpgrp's first argument.
X         */
X        if (pg2 == pg4 `26`26 pg1\0E063\0E06\1C073)
X        \0808exit(0);
X
X        child = fork();
X        if (child < 0)
X        \0808exit(1);
X        else if (child == 0) `7B
X        \0808np = getpid();
X        \0808/*
X        \0808 * If this is Sys V,\0F06will not work; pgrp\1406be
X        \0808 * set to np because setpgrp just changes a pgrp to be
X        \0808 * the same as the pid.
X        \0808 */
X        \0808setpgrp(np, pg1);
X        \0808ng = getpgrp(0);\2008/* Same result for Sys V and BSD */
X        \0808if (ng == pg1) `7B
X        \0808\1008exit(1);
X        \0808`7D else `7B
X        \0808\1008exit(0);
X        \0808`7D
X        `7D else `7B
X        \0808wait(`26s);
X        \0808exit(s>>8);
X        `7D
X`7D
X
XEOF
Xif `7B (eval echo configure:2892: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest &0226 (./\0F08; exit) 2>/dev/null
Xthen
X  ac_cv_func_getpgrp_void=yes
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -fr conftest*
X  ac_cv_func_getpgrp_void=no
Xfi
Xrm -fr conftest*
Xfi
X
X
Xfi
X
Xecho "$ac_t""$ac_cv_func_getpgrp_void" 1>`266
Xif test $ac_cv_func_getpgrp_void = yes; then
X  cat >> confdefs.h <<`5CEOF
X#define GETPGRP_VOID 1
XEOF
X
Xfi
X
X
Xecho $ac_n "checking if killpg is needed""... $ac_c" 1>`266
Xecho "configure:2917: checking if killpg is needed" >`265
Xif eval "test `5C"`60echo '$''`7B'cf_cv_need_killpg'+set`7D'`60`5C" = set"; th
Ven
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
Xif test "$cross_compiling" = yes; then
X  cf_cv_need_killpg=unknown
X
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 2927 "configure"
X#include "confdefs.h"
X
X#include <sys/types.h>
X#include <signal.h>
XRETSIGTYPE
Xhandler(s)
X    int s;
X`7B
X    exit(0);
X`7D
X
Xmain()
X`7B
X#ifdef SETPGRP_VOID
X    (void) setpgrp();
X#else
X    (void) setpgrp(0,0);
X#endif
X    (void) signal(SIGINT, handler);
X    (void) kill(-getpid(), SIGINT);
X    exit(1);
X`7D
XEOF
Xif `7B (eval echo configure:2951: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest &0226 (./\0F08; exit) 2>/dev/null
Xthen
X  cf_cv_need_killpg=no
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -fr conftest*
X  cf_cv_need_killpg=yes
Xfi
Xrm -fr conftest*
Xfi
X
Xfi
X
Xecho "$ac_t""$cf_cv_need_killpg" 1>`266
Xtest $cf_cv_need_killpg = yes `26`26 cat >> confdefs.h <<`5CEOF
X#define HAVE_KILLPG 1
XEOF
X
X
X
X
Xecho $ac_n "checking declaration of errno""... $ac_c" 1>`266
Xecho "configure:2974: checking declaration of errno" >`265
Xif eval "test `5C"`60echo '$''`7B'cf_cv_dcl_errno'+set`7D'`60`5C" = set"; then
V
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
X    cat > conftest.$ac_ext <<EOF
X#line 2980 "configure"
X#include "confdefs.h"
X
X#if HAVE_STDLIB_H
X#include <stdlib.h>
X#endif
X#include <stdio.h>
X#include <sys/types.h>
X#include <errno.h>`20
Xint main() `7B
Xlong x = (long) errno
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:2993: `5C"$ac_compile`5C") 1>`265;\3207\1B0B) 2>
V`265; `7D; then
X  rm -rf conftest*
X  eval 'cf_cv_dcl_'errno'=yes'
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval 'cf_cv_dcl_'errno'=no'
Xfi
Xrm -f conftest*
Xfi
X
Xeval 'cf_result=$cf_cv_dcl_'errno
Xecho "$ac_t""$cf_result" 1>`266
X
X# It's possible (for near-UNIX clones) that the data doesn't exist
Xif eval "test `5C"`60echo '$''`7B'cf_cv_have_errno'+set`7D'`60`5C" = set"; the
Vn
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
Xif test $cf_result = no ; then
X    eval 'cf_result=DECL_'errno
X   `20
Xcf_result=`60echo $\1109 `7C tr '`5Ba-z`5D' '`5BA-Z`5D'`60
X
X    cat >> confdefs.h <<EOF
X#define $cf_result 1
XEOF
X
X    echo $ac_n "checking existence of errno""... $ac_c" 1>`266
Xecho "configure:3023: checking existence of errno" >`265
X        cat > conftest.$ac_ext <<EOF
X#line 3025 "configure"
X#include "confdefs.h"
X
X#undef errno
Xextern long errno;
X
Xint main() `7B
Xerrno = 2
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:3035: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval 'cf_cv_have_'errno'=yes'
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval 'cf_cv_have_'errno'=no'
Xfi
Xrm -f conftest*
X        eval 'cf_result=$cf_cv_have_'errno
X        echo "$ac_t""$cf_result" 1>`266
Xelse
X    eval 'cf_cv_have_'errno'=yes'
Xfi
X
Xfi
X
Xeval 'cf_result=HAVE_'errno
X
Xcf_result=`60echo $\1109 `7C tr '`5Ba-z`5D' '`5BA-Z`5D'`60
X
Xeval 'test $cf_cv_have_'errno' = yes `26`26 cat >> confdefs.h <<EOF
X#define $cf_result 1
XEOF
X'
X
X
X
Xfor cf_name in sys_nerr sys_errlist
Xdo
X   `20
Xecho $ac_n "checking declaration of $cf_name""... $ac_c" 1>`266
Xecho "configure:3068: checking declaration of $cf_name" >`265
Xif eval "test `5C"`60echo '$''`7B'cf_cv_dcl_$cf_name'+set`7D'`60`5C" = set"; t
Vhen
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
X    cat > conftest.$ac_ext <<EOF
X#line 3074 "configure"
X#include "confdefs.h"
X
X#if HAVE_STDLIB_H
X#include <stdlib.h>
X#endif
X#include <stdio.h>
X#include <sys/types.h>
X#include <errno.h>`20
Xint main() `7B
Xlong x = (long) $cf_name
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:3087: `5C"$ac_compile`5C") 1>`265;\3207\1B0B) 2>
V`265; `7D; then
X  rm -rf conftest*
X  eval 'cf_cv_dcl_'$cf_name'=yes'
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval 'cf_cv_dcl_'$cf_name'=no'
Xfi
Xrm -f conftest*
Xfi
X
Xeval 'cf_result=$cf_cv_dcl_'$cf_name
Xecho "$ac_t""$cf_result" 1>`266
X
X# It's possible (for near-UNIX clones) that the data doesn't exist
Xif eval "test `5C"`60echo '$''`7B'cf_cv_have_$cf_name'+set`7D'`60`5C" = set";
V then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
Xif test $cf_result = no ; then
X    eval 'cf_result=DECL_'$cf_name
X   `20
Xcf_result=`60echo $\1109 `7C tr '`5Ba-z`5D' '`5BA-Z`5D'`60
X
X    cat >> confdefs.h <<EOF
X#define $cf_result 1
XEOF
X
X    echo $ac_n "checking existence of $cf_name""... $ac_c" 1>`266
Xecho "configure:3117: checking existence of $cf_name" >`265
X        cat > conftest.$ac_ext <<EOF
X#line 3119 "configure"
X#include "confdefs.h"
X
X#undef $cf_name
Xextern long $cf_name;
X
Xint main() `7B
X$cf_name = 2
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:3129: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval 'cf_cv_have_'$cf_name'=yes'
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval 'cf_cv_have_'$cf_name'=no'
Xfi
Xrm -f conftest*
X        eval 'cf_result=$cf_cv_have_'$cf_name
X        echo "$ac_t""$cf_result" 1>`266
Xelse
X    eval 'cf_cv_have_'$cf_name'=yes'
Xfi
X
Xfi
X
Xeval 'cf_result=HAVE_'$cf_name
X
Xcf_result=`60echo $\1109 `7C tr '`5Ba-z`5D' '`5BA-Z`5D'`60
X
Xeval 'test $cf_cv_have_'$cf_name' = yes `26`26 cat >> confdefs.h <<EOF
X#define $cf_result 1
XEOF
X'
X
Xdone
X
Xcat >> confdefs.h <<`5CEOF
X#define SYS_UNIX 1
XEOF
X
Xcat >> confdefs.h <<`5CEOF
X#define scrn_chosen 1
XEOF
X
X# Try to eventually eliminate the following
Xcat >> confdefs.h <<`5CEOF
X#define os_chosen 1
XEOF
X
X
Xecho $ac_n "checking for screen type""... $ac_c" 1>`266
Xecho "configure:3173: checking for screen type" >`265
X
X# Check whether --with-screen o\1108out\1408was given.
Xif test "$`7Bwith_screen+set`7D" = set; then
X  withval="$with_screen"
X  screen=$withval
Xfi
X
X
Xif test -z "$screen"; then
X`09
X# Check whether --with-scr o\0E08out-scr was given.
Xif test "$`7Bwith_scr+set`7D" = set; then
X  withval="$with_scr"
X  screen=$withval
Xfi
X
Xfi
Xtest -z "$screen" `26`26 test "$with_x" = yes &0226 \2306=x11
X
Xtermlib=none
Xif test -z "$screen"; then
X`09screen=termcap;
Xfi
Xecho "$ac_t""$screen" 1>`266
X
X: See if this is any type of xvile configuration:
Xcase "$screen" in
X`09`5BOo`5Dpen`5BLl`5Dook `7C `5BMm`5Dotif `7C `5BxX`5D `7C `5BAa`5Dthena\1307
V`5BatTmMoO`5D*\240711 `7C neXtaw )
X`09`09# If we find X, set shell vars x_includes and x_libraries to the
X# paths, otherwise set no_x=yes.
X# Uses ac_ vars as temps to allow command line to override cache and checks.
X# --without-x overrides everything else, but does not touch the cache.
Xecho $ac_n "checking for X""... $ac_c" 1>`266
Xecho "configure:3207: checking for X" >`265
X
X
X# Check whether --with-x o\0C08out-x was given.
Xif test "$`7Bwith_x+set`7D" = set; then
X  withval="$with_x"
X  :
Xfi
X
X# $have_x is `60yes', `60no', `60disabled', or empty when we do not yet know.
V
Xif test "x$with_x" = xno; then
X  # The user explicitly disabled X.
X  have_x=disabled
Xelse
X  if test "x$x_includes" != xNONE `26`26\200Blibrari\210C; then
X    # Both variables are already set.
X    have_x=yes
X  else
Xif eval "test `5C"`60echo '$''`7B'ac_cv_have_x'+set`7D'`60`5C" = set"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  # One or both of the vars are not set, and there is no cached value.
Xac_x_includes=NO ac_x_libraries=NO
Xrm -fr conftestdir
Xif mkdir conftestdir; then
X  cd conftestdir
X  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
V
X  cat > Imakefile <<'EOF'
Xacfindx:
X`09@echo 'ac_im_incroot="$`7BINCROOT`7D"; \1C06usrlibdir="$`7BUSRLIBDIR\200A
V\1D0A\1A08'
XEOF
X  if (xmkmf) >/dev/null 2\0C0B`26`26 test -f Makefile; then
X    # GNU make sometimes prints "make`5B1`5D: Entering...", which would confus
Ve us.
X    eval `60$`7BMAKE-make`7D acfindx 2>/dev/null `7C grep -v make`60
X    # Open Windows xmkmf reportedly sets LIBDIR instead of USR\1506.
X    for ac_extension in a so sl; do
X      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension `26`26
X        test -f $ac_im_libdir/libX11.$ac_extension; then
X        ac_im_usrlibdir=$\1106\0E06; break
X      fi
X    done
X    # Screen out bogus values from the imake configuration.  They are
X    # bogus both because they are the default anyway, and\2908
X    # using them would break gcc on systems where it needs fixed includes.
X    case "$ac_im_incroot" in
X`09/usr/include) ;;
X`09*) test -f "$ac_im_incroot/X11/Xos.h" `26`26 ac_x_includes=\2C0F" ;;
X    esac
X    case "$ac_im_usrlibdir" in
X`09/usr/lib `7C /lib) ;;
X`09*) test -d "$ac_im_usrlibdir" `26`26 ac_x_libraries=\2513;;
X    esac
X  fi
X  cd ..
X  rm -fr conftestdir
Xfi
X
Xif test "$ac_x_includes" = NO; then
X  # Guess where to find include files, by looking for this one X11 .h file.
X  test -z "$x_direct_test_include" `26`26 \1A15=X11/Intrinsic.h
X
X  # First, try using that file with no special directory specified.
Xcat > conftest.$ac_ext <<EOF
X#line 3270 "configure"
X#include "confdefs.h"
X#include <$x_direct_test_\1807>
XEOF
Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>\1E09out"
X`7B (eval echo configure:3275: `5C"$ac_try`5C") 1>`265;\2E07\1707) 2>`265; `7D
V
Xac_err=`60grep -v '`5E *+' conftest.out`60
Xif test -z "$ac_err"; then
X  rm -rf conftest*
X  # We can compile using X headers with no special include directory.
Xac_x_includes=
Xelse
X  echo "$ac_err" >`265
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  # Look for the header file in a standard set of common directories.
X# Check X11 before X11Rn because it is often a symlink to the current release.
V
X  for ac_dir in        \0807`5C
X    /usr/X11/include          `5C
X    /usr/X11R6/include        `5C
X    /usr/X11R5/include        `5C
X    /usr/X11R4/include        `5C
X        \0808\100E`5C
X    /usr/include/X11          `5C
X    /usr/include/X11R6        `5C
X    /usr/include/X11R5        `5C
X    /usr/include/X11R4        `5C
X        \0808\100E`5C
X    /usr/local/X11/include    `5C
X    /usr/local/X11R6/include  `5C
X    /usr/local/X11R5/include  `5C
X    /usr/local/X11R4/include  `5C
X        \0808\100E`5C
X    /usr/local/include/X11    `5C
X    /usr/local/include/X11R6  `5C
X    /usr/local/include/X11R5  `5C
X    /usr/local/include/X11R4  `5C
X        \0808\100E`5C
X    /usr/X386/include         `5C
X    /usr/x386/include         `5C
X    /usr/XFree86/include/X11  `5C
X        \0808\100E`5C
X    /usr/include        \0806`5C
X    /usr/local/include        `5C
X    /usr/unsupported/include  `5C
X    /usr/athena/include       `5C
X    /usr/local/x11r5/include  `5C
X    /usr/lpp/Xamples/include  `5C
X        \0808\100E`5C
X    /usr/openwin/include      `5C
X    /usr/openwin/share/include `5C
X    ; `5C
X  do
X    if test -r "$ac_dir/$x_direct_test_include"; then
X      ac_x_includes=$ac_dir
X      break
X    fi
X  done
Xfi
Xrm -f conftest*
Xfi # $ac_x_includes = NO
X
Xif test "$ac_x_libraries" = NO; then
X  # Check for the libraries.
X
X  test -z "$x_direct_test_library" `26`26 \1A15=Xt
X  test -z "$x_direct_test_function" `26`26 \1B16=XtMalloc
X
X  # See if we find them without any special options.
X  # Don't add to $LIBS permanently.
X  ac_save_LIBS="$LIBS"
X  LIBS="-l$x_direct_test_library $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 3344 "configure"
X#include "confdefs.h"
X
Xint main() `7B
X$`7Bx_direct_test_function`7D()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:3351: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  LIBS="$ac_save_LIBS"
X# We can link X programs with no special library path.
Xac_x_libraries=
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  LIBS="$ac_save_LIBS"
+-+-+-+-+-+-+-+-  END  OF PART 34 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 35 -+-+-+-+-+-+-+-+
X# First see if replacing the include by lib works.
X# Check X11 before X11Rn because it is often a symlink to the current release.
V
Xfor ac_dir in `60echo "$ac_x_includes" `7C sed s/\1207/lib/`60 `5C
X    /usr/X11/lib          `5C
X    /usr/X11R6/lib        `5C
X    /usr/X11R5/lib        `5C
X    /usr/X11R4/lib        `5C
X        \0808\100A`5C
X    /usr/lib/X11          `5C
X    /usr/lib/X11R6        `5C
X    /usr/lib/X11R5        `5C
X    /usr/lib/X11R4        `5C
X        \0808\100A`5C
X    /usr/local/X11/lib    `5C
X    /usr/local/X11R6/lib  `5C
X    /usr/local/X11R5/lib  `5C
X    /usr/local/X11R4/lib  `5C
X        \0808\100A`5C
X    /usr/local/lib/X11    `5C
X    /usr/local/lib/X11R6  `5C
X    /usr/local/lib/X11R5  `5C
X    /usr/local/lib/X11R4  `5C
X        \0808\100A`5C
X    /usr/X386/lib         `5C
X    /usr/x386/lib         `5C
X    /usr/XFree86/lib/X11  `5C
X        \0808\100A`5C
X    /usr/lib        \0806`5C
X    /usr/local/lib        `5C
X    /usr/unsupported/lib  `5C
X    /usr/athena/lib       `5C
X    /usr/local/x11r5/lib  `5C
X    /usr/lpp/Xamples/lib  `5C
X    /lib/usr/lib/X11`09  `5C
X        \0808\100A`5C
X    /usr/openwin/lib      `5C
X    /usr/openwin/share/lib `5C
X    ; `5C
Xdo
X  for ac_extension in a so sl; do
X    if test -r $ac_dir/lib$`7Bx_direct_test_library`7D.$ac_extension; then
X      ac_x_libraries=$ac_dir
X      break 2
X    fi
X  done
Xdone
Xfi
Xrm -f conftest*
Xfi # $ac_x_libraries = NO
X
Xif test "$ac_x_includes" = NO `7C`7C\1E0Dlibrari\1F08; then
X  # Didn't find X anywhere.  Cache the known absence of X.
X  ac_cv_have_x="\0807no"
Xelse
X  # Record where we found X for the cache.
X  ac_cv_have_x="\0807yes `5C
X`09        ac_x_includes=$\0F0D\1D06librari\1E09\1009"
Xfi
Xfi
X  fi
X  eval "$ac_cv_have_x"
Xfi # $with_x != no
X
Xif test "$have_x" != yes; then
X  echo "$ac_t""$have_x" 1>`266
X  no_x=yes
Xelse
X  # If each of the values was on the command line, it overrides each guess.
X  test "x$x_includes" = xNONE `26`26 x\1709=$ac_\260A
X  test "x$x_libraries" = xNONE `26`26 x\180A=$ac_\280B
X  # Update the cache value to reflect\1B06ommand lin\2207s.
X  ac_cv_have_x="\0807yes `5C
X`09`09ac_x_includes=$\0C0A ac_x_librari\1B06\0D09"
X  echo "$ac_t""libraries $x_\0D09, headers $x_includes" 1>`266
Xfi
X
X
X
X# We need to check for -lsocket and -lnsl here in order to work around an
X# autoconf bug. \0F09-2.12 is not checking for these prior to\1C0D
X# the X11R6 -lSM and -lICE libraries.  The resultant failures cascade...
X# `09(tested on Solaris 2.5 w/ X11R6)
XSYSTEM_NAME=`60echo "$cf_cv_system_name"`7Ctr ' ' -`60
Xcf_have_X_LIBS=no
Xcase $SYSTEM_NAME in
Xirix`5B56`5D*) ;;
Xclix*)
X`09# FIXME: modify the library lookup in autoconf to
X`09# allow _s.a suffix ahead of .a
X`09echo $ac_n "checking for open in -lc_s""... $ac_c" 1>`266
Xecho "configure:3451: checking for open in -lc_s" >`265
Xac_lib_var=`60echo c_s'_'open `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lc_s  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 3459 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar open();
X
Xint main() `7B
Xopen()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:3470: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="-lc_s $LIBS"
X`09echo $ac_n "checking for gethostname in -lbsd""... $ac_c" 1>`266
Xecho "configure:3487: checking for gethostname in -lbsd" >`265
Xac_lib_var=`60echo bsd'_'gethostname `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lbsd  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 3495 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar gethostname();
X
Xint main() `7B
Xgethostname()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:3506: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="-lbsd $LIBS"
X`09echo $ac_n "checking for gethostname in -lnsl_s""... $ac_c" 1>`266
Xecho "configure:3523: checking for gethostname in -lnsl_s" >`265
Xac_lib_var=`60echo nsl_s'_'gethostname `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lnsl_s  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 3531 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar gethostname();
X
Xint main() `7B
Xgethostname()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:3542: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="-lnsl_s $LIBS"
X`09echo $ac_n "checking for XOpenDisplay in -lX11_s""... $ac_c" 1>`266
Xecho "configure:3559: checking for XOpenDisplay in -lX11_s" >`265
Xac_lib_var=`60echo X11_s'_'XOpenDisplay `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lX11_s  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 3567 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar XOpenDisplay();
X
Xint main() `7B
XXOpenDisplay()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:3578: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="-lX11_s $LIBS"
X`09echo $ac_n "checking for XtAppInitialize in -lXt_s""... $ac_c" 1>`266
Xecho "configure:3595: checking for XtAppInitialize in -lXt_s" >`265
Xac_lib_var=`60echo Xt_s'_'XtAppInitialize `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lXt_s  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 3603 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar XtAppInitialize();
X
Xint main() `7B
XXtAppInitialize()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:3614: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="-lXt_s $LIBS"
X`09`09 cf_have_X_LIBS=Xt
X`09`09
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X`20
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X`20
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X`20
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X`20
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X`09;;
X*)
X`09echo $ac_n "checking for socket in -l\0C06""... $ac_c" 1>`266
Xecho "configure:3655: checking for socket in -l\0C06" >`265
Xac_lib_var=`60echo socket'_'\0906 `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lsocket  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 3663 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar socket();
X
Xint main() `7B
Xsocket()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:3674: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X    ac_tr_lib=HAVE_LIB`60echo socket `7C sed -e 's/`5B`5Ea-zA-Z0-9_`5D/_/g'`20
V`5C
X    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`60
X  cat >> confdefs.h <<EOF
X#define $ac_tr_lib 1
XEOF
X
X  LIBS="-lsocket $LIBS"
X
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X`09echo $ac_n "checking for gethostname in -lnsl""... $ac_c" 1>`266
Xecho "configure:3702: checking for gethostname in -lnsl" >`265
Xac_lib_var=`60echo nsl'_'gethostname `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lnsl  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 3710 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar gethostname();
X
Xint main() `7B
Xgethostname()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:3721: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X    ac_tr_lib=HAVE_LIB`60echo nsl `7C sed -e 's/`5B`5Ea-zA-Z0-9_`5D/_/g' `5C
X    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`60
X  cat >> confdefs.h <<EOF
X#define $ac_tr_lib 1
XEOF
X
X  LIBS="-lnsl $LIBS"
X
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X`09;;
Xesac
X
Xif test $cf_have_X_LIBS = no ; then
X`09if test "$no_x" = yes; then
X  # Not all programs may use this symbol, but it does not hurt to define it.
X  cat >> confdefs.h <<`5CEOF
X#define X_DISPLAY_MISSING 1
XEOF
X
X  X_CFLAGS= X_PRE_LIBS= X_\0808EXTRA\1606
Xelse
X  if test -n "$x_includes"; then
X    X_CFLAGS="$\0B08 -I$x_includes"
X  fi
X
X  # It would also be nice to do this for all -L options, not just this one.
X  if test -n "$x_libraries"; then
X    X_LIBS="$\0906 -L$x_libraries"
X    # For Solaris; some versions of Sun CC require a space after -R and
X    # others require no space.  Words are not sufficient . . . .
X    case "`60(uname -sr) 2>/dev/null`60" in
X    "SunOS 5"*)
X      echo $ac_n "checking whether -R must be followed by a space""... $ac_c"
V 1>`266
Xecho "configure:3772: checking whether -R must be followed by a space" >`265
X      ac_xsave_LIBS="$LIBS"; \0E0B -R$x_libraries"
X      cat > conftest.$ac_ext <<EOF
X#line 3775 "configure"
X#include "confdefs.h"
X
Xint main() `7B
X
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:3782: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  ac_R_nospace=yes
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  ac_R_nospace=no
Xfi
Xrm -f conftest*
X      if test $ac_R_nospace = yes; then
X`09echo "$ac_t""no" 1>`266
X`09X_LIBS="$\0906 -R$x_libraries"
X      else
X`09LIBS="$ac_xsave_LIBS -R $x_libraries"
X`09cat > conftest.$ac_ext <<EOF
X#line 3798 "configure"
X#include "confdefs.h"
X
Xint main() `7B
X
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:3805: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  ac_R_space=yes
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  ac_R_space=no
Xfi
Xrm -f conftest*
X`09if test $ac_R_space = yes; then
X`09  echo "$ac_t""yes" 1>`266
X`09  X_LIBS="$\0906 -R $x_libraries"
X`09else
X`09  echo "$ac_t""neither works" 1>`266
X`09fi
X      fi
X      LIBS="$ac_xsave_LIBS"
X    esac
X  fi
X
X  # Check for system-dependent libraries X programs must link with.
X  # Do this before checking for the system-independent R6 libraries
X  # (-lICE), since we may need -lsocket or whatever for X linking.
X
X  if test "$ISC" = yes; then
X    X_EXTRA_LIBS="$\0F0C -lnsl_s -linet"
X  else
X    # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X
X    # libraries were built with DECnet support.  And karl@cs.umb.edu says
X    # the Alpha needs dnet_stub (dnet does not exist).
X    echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>`266
Xecho "configure:3837: checking for dnet_ntoa in -ldnet" >`265
Xac_lib_var=`60echo dnet'_'dnet_ntoa `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-ldnet  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 3845 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar dnet_ntoa();
X
Xint main() `7B
Xdnet_ntoa()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:3856: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  X_EXTRA_LIBS="$\0F0C -ldnet"
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X    if test $ac_cv_lib_dnet_dnet_ntoa = no; then
X      echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>`266
Xecho "configure:3878: checking for dnet_ntoa in -ldnet_stub" >`265
Xac_lib_var=`60echo dnet_stub'_'dnet_ntoa `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-ldnet_stub  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 3886 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar dnet_ntoa();
X
Xint main() `7B
Xdnet_ntoa()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:3897: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  X_EXTRA_LIBS="$\0F0C -ldnet_stub"
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X    fi
X
X    # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT,
X    # to get the SysV transport functions.
X    # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4)
X    # needs -lnsl.
X    # The nsl library prevents programs from opening the X display
X    # on Irix 5.2, according to dickey@clark.net.
X    echo $ac_n "checking for gethostbyname""... $ac_c" 1>`266
Xecho "configure:3926: checking for gethostbyname" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_func_gethostbyname'+set`7D'`60`5C" = s
Vet"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 3931 "configure"
X#include "confdefs.h"
X/* System header to define __stub macros and hopefully few prototypes,
X    which can conflict with char gethostbyname(); below.  */
X#include <assert.h>
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar gethostbyname();
X
Xint main() `7B
X
X/* The GNU C library defines this for functions which it implements
X    to always fail with ENOSYS.  Some functions are actually named
X    something starting with __ and the normal name is an alias.  */
X#if defined (__stub_gethostbyname) `7C`7C\2211__\240E
Xchoke me
X#else
Xgethostbyname();
X#endif
X
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:3954: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_func_gethostbyname=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_func_gethostbyname=no"
Xfi
Xrm -f conftest*
Xfi
X
Xif eval "test `5C"`60echo '$ac_cv_func_'gethostbyname`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  :
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X    if test $ac_cv_func_gethostbyname = no; then
X      echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>`266
Xecho "configure:3975: checking for gethostbyname in -lnsl" >`265
Xac_lib_var=`60echo nsl'_'gethostbyname `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lnsl  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 3983 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar gethostbyname();
X
Xint main() `7B
Xgethostbyname()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:3994: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  X_EXTRA_LIBS="$\0F0C -lnsl"
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X    fi
X
X    # lieder@skyler.mavd.honeywell.com says without -lsocket,
X    # socket/setsockopt and other routines are undefined under SCO ODT
X    # 2.0.  But -lsocket is broken on IRIX 5.2 (and is not necessary
X    # on later versions), says simon@lia.di.epfl.ch: it contains
X    # gethostby* variants that don't use the nameserver (or something).
X    # -lsocket must be given before -lnsl if both are needed.
X    # We assume that if connect needs -lnsl, so does gethostbyname.
X    echo $ac_n "checking for connect""... $ac_c" 1>`266
Xecho "configure:4024: checking for connect" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_func_connect'+set`7D'`60`5C" = set"; t
Vhen
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 4029 "configure"
X#include "confdefs.h"
X/* System header to define __stub macros and hopefully few prototypes,
X    which can conflict with char connect(); below.  */
X#include <assert.h>
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar connect();
X
Xint main() `7B
X
X/* The GNU C library defines this for functions which it implements
X    to always fail with ENOSYS.  Some functions are actually named
X    something starting with __ and the normal name is an alias.  */
X#if defined (__stub_connect) `7C`7C\1C11__\1E08
Xchoke me
X#else
Xconnect();
X#endif
X
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:4052: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_func_connect=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_func_connect=no"
Xfi
Xrm -f conftest*
Xfi
X
Xif eval "test `5C"`60echo '$ac_cv_func_'connect`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  :
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X    if test $ac_cv_func_connect = no; then
X      echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>`266
Xecho "configure:4073: checking for connect in -lsocket" >`265
Xac_lib_var=`60echo socket'_'connect `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lsocket $X_EXTRA_LIBS $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 4081 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar connect();
X
Xint main() `7B
Xconnect()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:4092: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  X_EXTRA_LIBS="-lsocket $\180C"
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X    fi
X
X    # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX.
X    echo $ac_n "checking for remove""... $ac_c" 1>`266
Xecho "configure:4116: checking for remove" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_func_remove'+set`7D'`60`5C" = set"; th
Ven
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 4121 "configure"
X#include "confdefs.h"
X/* System header to define __stub macros and hopefully few prototypes,
X    which can conflict with char remove(); below.  */
X#include <assert.h>
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar remove();
X
Xint main() `7B
X
X/* The GNU C library defines this for functions which it implements
X    to always fail with ENOSYS.  Some functions are actually named
X    something starting with __ and the normal name is an alias.  */
X#if defined (__stub_remove) `7C`7C\1B11__\1D07
Xchoke me
X#else
Xremove();
X#endif
X
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:4144: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_func_remove=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_func_remove=no"
Xfi
Xrm -f conftest*
Xfi
X
Xif eval "test `5C"`60echo '$ac_cv_func_'remove`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  :
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X    if test $ac_cv_func_remove = no; then
X      echo $ac_n "checking for remove in -lposix""... $ac_c" 1>`266
Xecho "configure:4165: checking for remove in -lposix" >`265
Xac_lib_var=`60echo posix'_'remove `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lposix  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 4173 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar remove();
X
Xint main() `7B
Xremove()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:4184: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  X_EXTRA_LIBS="$\0F0C -lposix"
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X    fi
X
X    # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
X    echo $ac_n "checking for shmat""... $ac_c" 1>`266
Xecho "configure:4208: checking for shmat" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_func_shmat'+set`7D'`60`5C" = set"; the
Vn
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 4213 "configure"
X#include "confdefs.h"
X/* System header to define __stub macros and hopefully few prototypes,
X    which can conflict with char shmat(); below.  */
X#include <assert.h>
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar shmat();
X
Xint main() `7B
X
X/* The GNU C library defines this for functions which it implements
X    to always fail with ENOSYS.  Some functions are actually named
X    something starting with __ and the normal name is an alias.  */
X#if defined (__stub_shmat) `7C`7C\1A11__shmat)
Xchoke me
X#else
Xshmat();
X#endif
X
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:4236: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_func_shmat=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_func_shmat=no"
Xfi
Xrm -f conftest*
Xfi
X
Xif eval "test `5C"`60echo '$ac_cv_func_'shmat`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  :
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X    if test $ac_cv_func_shmat = no; then
X      echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>`266
Xecho "configure:4257: checking for shmat in -lipc" >`265
Xac_lib_var=`60echo ipc'_'shmat `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lipc  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 4265 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar shmat();
X
+-+-+-+-+-+-+-+-  END  OF PART 35 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 36 -+-+-+-+-+-+-+-+
Xint main() `7B
Xshmat()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:4276: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  X_EXTRA_LIBS="$\0F0C -lipc"
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X    fi
X  fi
X
X  # Check for libraries that X11R6 Xt/Xaw programs need.
X  ac_save_LDFLAGS="$\0A07"
X  test -n "$x_libraries" `26`26 LDFLAGS="$\0A07 -L\250D
X  # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
X  # check for ICE first), but we must link in the order -lSM -lICE or
X  # we get undefined symbols.  So assume we have SM if\0E09ICE.
X  # These have to be linked with before -lX11, unlike the other
X  # libraries we check for below, so use a different variable.
X  #  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
X  echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>`266
Xecho "configure:4309: checking for IceConnectionNumber in -lICE" >`265
Xac_lib_var=`60echo ICE'_'IceConnectionNumber `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lICE  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 4317 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar IceConnectionNumber();
X
Xint main() `7B
XIceConnectionNumber()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:4328: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  X_PRE_LIBS="$\0D0A -lSM -lICE"
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X  LDFLAGS="$ac_save_\1207"
X
Xfi
X
X`09LDFLAGS="$\0A07 $X_LIBS"
X`09CFLAGS="$\0906 $X_\1306"
X`09echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>`266
Xecho "configure:4355: checking for XOpenDisplay in -lX11" >`265
Xac_lib_var=`60echo X11'_'XOpenDisplay `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lX11 $X_PRE_LIBS $\0606X_EXTRA\140B"
Xcat > conftest.$ac_ext <<EOF
X#line 4363 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar XOpenDisplay();
X
Xint main() `7B
XXOpenDisplay()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:4374: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="-lX11 $LIBS"
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X`09echo $ac_n "checking for XtAppInitialize in -lXt""... $ac_c" 1>`266
Xecho "configure:4395: checking for XtAppInitialize in -lXt" >`265
Xac_lib_var=`60echo Xt'_'XtAppInitialize `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lXt $X_PRE_LIBS $\0606X_EXTRA\140B"
Xcat > conftest.$ac_ext <<EOF
X#line 4403 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar XtAppInitialize();
X
Xint main() `7B
XXtAppInitialize()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:4414: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  cat >> confdefs.h <<`5CEOF
X#define HAVE_LIBXT 1
XEOF
X
X`09`09 cf_have_X_LIBS=Xt
X`09`09 LIBS="-lXt $X_PRE_LIBS $LIBS"
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
Xelse
X`09LDFLAGS="$\0A07 $X_LIBS"
X`09CFLAGS="$\0906 $X_\1306"
Xfi
X
Xif test $cf_have_X_LIBS = no ; then
X`09echo "configure: warning: Unable to successfully link X Toolkit library (-l
VXt) with
Xtest program.  You will have to check and add the proper libraries by hand
Xto makefile." 1>`262
Xfi
X
X`09`09
Xfor ac_prog in xmkmf imake
Xdo
X# Extract the first word of "$ac_prog", so it can be a program name with args.
V
Xset dummy $ac_prog; ac_word=$2
Xecho $ac_n "checking for $ac_word""... $ac_c" 1>`266
Xecho "configure:4456: checking for $ac_word" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_path_IMAKE'+set`7D'`60`5C" = set"; the
Vn
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  case "$IMAKE" in
X  /*)
X  ac_cv_path_IMAKE="$IMAKE" # Let the user override the test with a path.
X  ;;
X  *)
X  IFS="$`7BIFS= `09`7D"; ac_save_ifs="$IFS"; \250A`7D:"
X  for ac_dir in $PATH; do
X    test -z "$ac_dir" `26`26 \0B06=.
X    if test -f $ac_dir/$ac_word; then
X      ac_cv_path_IMAKE="$ac_dir/$ac_word"
X      break
X    fi
X  done
X  IFS="$ac_save_ifs"
X  ;;
Xesac
Xfi
XIMAKE="$ac_cv_path_IMAKE"
Xif test -n "$IMAKE"; then
X  echo "$ac_t""$IMAKE" 1>`266
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
Xtest -n "$IMAKE" `26`26 break
Xdone
X
Xcase $IMAKE in # (vi
X*/imake)
X`09cf_imake_opts="-DUseInstalled=YES" # (vi
X`09;;
X*)
X`09cf_imake_opts=
X`09;;
Xesac
X
X# If it's installed properly, imake (or its wrapper, xmkmf) will point to the
V
X# config directory.
Xif mkdir conftestdir; then
X`09cd conftestdir
X`09echo >./Imakefile
X`09test -f ../Imakefile `26`26 cat \140D>>\220B
X`09cat >> ./Imakefile <<'CF_EOF'
Xfindstddefs:
X`09@echo 'IMAKE_CFLAGS="$`7BALLDEFINES`7D "'
X`09@echo 'IMAKE_LOADFLAGS="$`7BEXTRA\130A`7D "'
XCF_EOF
X`09if ( $IMAKE $cf_imake_opts 1>/dev/null 2>`265 `26`26 test -f Makefile)
X`09then
X`09`09test -n "$verbose" `26`26 echo "`09Using $IMAKE" 1>`266
X
X`09else
X`09`09# sometimes imake doesn't have the config path compiled in.  Find it.
X`09`09cf_config=
X`09`09for cf_libpath in $X_LIBS $LIBS ; do
X`09`09`09case $cf_libpath in # (vi
X`09`09`09-L*)
X`09`09&0209cf_libpath=`60echo .$\130A `7C sed -e 's/`5E...//'`60
X`09`09&0209cf_libpath=$\0C0A/X11/config
X`09`09&0209if test -d $cf_libpath ; then
X`09`09&0209`09cf_config=$cf_libpath
X`09`09&0209`09break
X`09`09&0209fi
X`09`09&0209;;
X`09`09`09esac
X`09`09done
X`09`09if test -z "$cf_config" ; then
X`09`09`09echo "configure: warning: Could not find imake \2906-directory" 1>`26
V2
X`09`09else
X`09`09`09cf_imake_opts="$\100D -I$cf_config"
X`09`09`09if ( $IMAKE -v $cf_imake_opts 2>`265)
X`09`09`09then
X`09`09&0209test -n "$verbose" `26`26 echo "`09Using $IMAKE $cf_config" 1>`266
V
X
X`09`09`09else
X`09`09&0209echo "configure: warning: Cannot run $IMAKE" 1>`262
X`09`09`09fi
X`09`09fi
X`09fi
X
X`09# GNU make sometimes prints "make`5B1`5D: Entering...", which
X`09# would confuse us.
X`09eval `60make findstddefs 2>/dev/null `7C grep -v make`60
X
X`09cd ..
X`09rm -rf conftestdir
X
X`09# We use $(ALLDEFINES) rather than $(STD_\1B09because the former
X`09# declares XTFUNCPROTO there.  However, some vendors (e.g., SGI) have
X`09# modified it to support site.cf, adding a kludge for the /usr/include
X`09# directory.  Try to filter that out, otherwise gcc won't find its
X`09# headers.
X`09if test -n "$GCC" ; then
X`09    if test -n "$IMAKE_CFLAGS" ; then
X`09`09cf_nostdinc=""
X`09`09cf_std_incl=""
X`09`09cf_cpp_opts=""
X`09`09for cf_opt in $IMAKE_CFLAGS
X`09`09do
X`09`09    case "$cf_opt" in
X`09`09    -nostdinc) #(vi
X`09`09`09cf_nostdinc="$cf_opt"
X`09`09`09;;
X`09`09    -I/usr/include) #(vi
X`09`09`09cf_std_incl="$cf_opt"
X`09`09`09;;
X`09`09    *) #(vi
X`09`09`09cf_cpp_opts="$\0E0B $cf_opt"
X`09`09`09;;
X`09`09    esac
X`09`09done
X`09`09if test -z "$cf_nostdinc" ; then
X`09`09    IMAKE_CFLAGS="$cf_cpp_opts $cf_std_incl"
X`09`09elif test -z "$cf_std_incl" ; then
X`09`09    IMAKE_CFLAGS="$cf_cpp_opts $cf_nostdinc"
X`09`09else
X`09`09    test -n "$verbose" `26`26 echo "`09suppressed `5C"$cf_nostdinc`5C" a
Vn\1508std_incl`5C"" 1>`266
X
X`09`09    IMAKE_CFLAGS="$cf_cpp_opts"
X`09`09fi
X`09    fi
X`09fi
Xfi
X
X
X
X`09`09X_CFLAGS="$\0B08 $IMAKE\1907"
X`09`09LDFLAGS="$\0A07 $X_LIBS"
X`09`09CFLAGS="$\0906 $X_\1306"
X`09`09SCREEN=x11
X`09`09TARGET=xvile
X`09`09cat >> confdefs.h <<`5CEOF
X#define DISP_X11 1
XEOF
X
X`09`09cat >> confdefs.h <<`5CEOF
X#define XTOOLKIT 1
XEOF
X
X`09`09for ac_hdr in X11/IntrinsicI.h
Xdo
Xac_safe=`60echo "$ac_hdr" `7C sed 'y%./+-%__p_%'`60
Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>`266
Xecho "configure:4603: checking for $ac_hdr" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_header_$ac_safe'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 4608 "configure"
X#include "confdefs.h"
X#include <$ac_hdr>
XEOF
Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>\1E09out"
X`7B (eval echo configure:4613: `5C"$ac_try`5C") 1>`265;\2E07\1707) 2>`265; `7D
V
Xac_err=`60grep -v '`5E *+' conftest.out`60
Xif test -z "$ac_err"; then
X  rm -rf conftest*
X  eval "ac_cv_header_$ac_safe=yes"
Xelse
X  echo "$ac_err" >`265
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_header_$ac_safe=no"
Xfi
Xrm -f conftest*
Xfi
Xif eval "test `5C"`60echo '$ac_cv_header_'$ac_safe`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X    ac_tr_hdr=HAVE_`60echo $ac_hdr `7C sed 'y%abcdefghijklmnopqrstuvwxyz./-%AB
VCDEFGHIJKLMNOPQRSTUVWXYZ___%'`60
X  cat >> confdefs.h <<EOF
X#define $ac_tr_hdr 1
XEOF
X`20
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
Xdone
X
X`09;;
Xesac
X
X: Find the libraries that apply to the selected screen-type:
Xcase "$screen" in
X`09`5BOo`5Dpen* `7C Xol )
X`09`09cat >> confdefs.h <<`5CEOF
X#define OL_WIDGETS 1
XEOF
X
X`09`09if test -n "$OPENWINHOME"; then
X`09`09`09X_LIBS="$\0906 -L$`7BOPENWINHOME`7D/lib"
X`09`09`09X_CFLAGS="$\0B08 -I$`7BOPENWINHOME`7D/include"
X`09`09fi
X`09`09LDFLAGS="$\0A07 $X_LIBS"
X`09`09echo $ac_n "checking for XmuClientWindow in -lXmu""... $ac_c" 1>`266
Xecho "configure:4655: checking for XmuClientWindow in -lXmu" >`265
Xac_lib_var=`60echo Xmu'_'XmuClientWindow `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lXmu  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 4663 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar XmuClientWindow();
X
Xint main() `7B
XXmuClientWindow()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:4674: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X    ac_tr_lib=HAVE_LIB`60echo Xmu `7C sed -e 's/`5B`5Ea-zA-Z0-9_`5D/_/g' `5C
X    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`60
X  cat >> confdefs.h <<EOF
X#define $ac_tr_lib 1
XEOF
X
X  LIBS="-lXmu $LIBS"
X
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X`09`09echo $ac_n "checking for OlToolkitInitialize in -lXol""... $ac_c" 1>`266
V
Xecho "configure:4702: checking for OlToolkitInitialize in -lXol" >`265
Xac_lib_var=`60echo Xol'_'OlToolkitInitialize `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lXol  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 4710 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar OlToolkitInitialize();
X
Xint main() `7B
XOlToolkitInitialize()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:4721: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="-lXol -lm $LIBS"
Xelse
X  echo "$ac_t""no" 1>`266
X`7B echo "configure: error: Unable to successfully link OpenLook library (-lXo
Vl) with test program" 1>`262; exit 1; `7D
Xfi
X
X`09;;
X`09motif* `7C M\0908Xm )
X`09`09cat >> confdefs.h <<`5CEOF
X#define MOTIF_WIDGETS 1
XEOF
X
X`09`09for ac_hdr in X11/IntrinsicI.h Xm/XmP.h
Xdo
Xac_safe=`60echo "$ac_hdr" `7C sed 'y%./+-%__p_%'`60
Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>`266
Xecho "configure:4752: checking for $ac_hdr" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_header_$ac_safe'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 4757 "configure"
X#include "confdefs.h"
X#include <$ac_hdr>
XEOF
Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>\1E09out"
X`7B (eval echo configure:4762: `5C"$ac_try`5C") 1>`265;\2E07\1707) 2>`265; `7D
V
Xac_err=`60grep -v '`5E *+' conftest.out`60
Xif test -z "$ac_err"; then
X  rm -rf conftest*
X  eval "ac_cv_header_$ac_safe=yes"
Xelse
X  echo "$ac_err" >`265
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_header_$ac_safe=no"
Xfi
Xrm -f conftest*
Xfi
Xif eval "test `5C"`60echo '$ac_cv_header_'$ac_safe`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X    ac_tr_hdr=HAVE_`60echo $ac_hdr `7C sed 'y%abcdefghijklmnopqrstuvwxyz./-%AB
VCDEFGHIJKLMNOPQRSTUVWXYZ___%'`60
X  cat >> confdefs.h <<EOF
X#define $ac_tr_hdr 1
XEOF
X`20
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
Xdone
X
X`09`09echo $ac_n "checking for regcmp in -lgen""... $ac_c" 1>`266
Xecho "configure:4789: checking for regcmp in -lgen" >`265
Xac_lib_var=`60echo gen'_'regcmp `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lgen  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 4797 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar regcmp();
X
Xint main() `7B
Xregcmp()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:4808: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X    ac_tr_lib=HAVE_LIB`60echo gen `7C sed -e 's/`5B`5Ea-zA-Z0-9_`5D/_/g' `5C
X    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`60
X  cat >> confdefs.h <<EOF
X#define $ac_tr_lib 1
XEOF
X
X  LIBS="-lgen $LIBS"
X
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X`09`09echo $ac_n "checking for XmuClientWindow in -lXmu""... $ac_c" 1>`266
Xecho "configure:4836: checking for XmuClientWindow in -lXmu" >`265
Xac_lib_var=`60echo Xmu'_'XmuClientWindow `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lXmu  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 4844 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar XmuClientWindow();
X
Xint main() `7B
XXmuClientWindow()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:4855: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X    ac_tr_lib=HAVE_LIB`60echo Xmu `7C sed -e 's/`5B`5Ea-zA-Z0-9_`5D/_/g' `5C
X    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`60
X  cat >> confdefs.h <<EOF
X#define $ac_tr_lib 1
XEOF
X
X  LIBS="-lXmu $LIBS"
X
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X`09`09echo $ac_n "checking for XpStartDoc in -lXp""... $ac_c" 1>`266
Xecho "configure:4883: checking for XpStartDoc in -lXp" >`265
Xac_lib_var=`60echo Xp'_'XpStartDoc `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lXp $LIBS $X_EXTRA_\0E06LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 4891 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar XpStartDoc();
X
Xint main() `7B
XXpStartDoc()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:4902: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X    ac_tr_lib=HAVE_LIB`60echo Xp `7C sed -e 's/`5B`5Ea-zA-Z0-9_`5D/_/g' `5C
X    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`60
X  cat >> confdefs.h <<EOF
X#define $ac_tr_lib 1
XEOF
X
X  LIBS="-lXp $LIBS"
X
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X`09`09echo $ac_n "checking for XextCreateExtension in -lXext""... $ac_c" 1>`26
V6
Xecho "configure:4930: checking for XextCreateExtension in -lXext" >`265
Xac_lib_var=`60echo Xext'_'XextCreateExtension `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lXext  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 4938 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar XextCreateExtension();
X
Xint main() `7B
XXextCreateExtension()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:4949: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="-lXext $LIBS"
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X`09`09echo $ac_n "checking for XpmCreatePixmapFromXpmImage in -lXpm""... $ac_c
V" 1>`266
Xecho "configure:4970: checking for XpmCreatePixmapFromXpmImage in -lXpm" >`265
V
Xac_lib_var=`60echo Xpm'_'XpmCreatePixmapFromXpmImage `7C sed 'y%./+-%__p_%'`60
V
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lXpm $LIBS $X_EXTRA_\0E06LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 4978 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar XpmCreatePixmapFromXpmImage();
X
Xint main() `7B
XXpmCreatePixmapFromXpmImage()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:4989: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="-lXpm $LIBS"
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X`09`09echo $ac_n "checking for XmbTextListToTextProperty in -lXIM""... $ac_c"
V 1>`266
Xecho "configure:5010: checking for XmbTextListToTextProperty in -lXIM" >`265
Xac_lib_var=`60echo XIM'_'XmbTextListToTextProperty `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lXIM  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 5018 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar XmbTextListToTextProperty();
X
Xint main() `7B
XXmbTextListToTextProperty()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:5029: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X    ac_tr_lib=HAVE_LIB`60echo XIM `7C sed -e 's/`5B`5Ea-zA-Z0-9_`5D/_/g' `5C
X    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`60
X  cat >> confdefs.h <<EOF
X#define $ac_tr_lib 1
XEOF
X
X  LIBS="-lXIM $LIBS"
X
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X`09`09echo $ac_n "checking for XmProcessTraversal in -lXm""... $ac_c" 1>`266
Xecho "configure:5056: checking for XmProcessTraversal in -lXm" >`265
Xac_lib_var=`60echo Xm'_'XmProcessTraversal `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lXm $X_PRE_LIBS $\0606X_EXTRA\140B"
Xcat > conftest.$ac_ext <<EOF
X#line 5064 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar XmProcessTraversal();
X
Xint main() `7B
XXmProcessTraversal()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:5075: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="-lXm $LIBS"
Xelse
X  echo "$ac_t""no" 1>`266
X`7B echo "configure: error: Unable to successfully link Motif library (-lXm) w
Vith test program" 1>`262; exit 1; `7D
Xfi
X
X`09 `09EXTRAOBJS="$\0C09 menu.o"
X`09;;
X`09`5BAa`5Dthena* `7C Xaw* `7C neXtaw )
X`09`09cat >> confdefs.h <<`5CEOF
X#define ATHENA_WIDGETS 1
XEOF
X
X`09`09case $screen in #(vi
X`09`09*aw*)
X`09`09`09cf_x_athena=$screen
X`09`09`09;;
X`09`09esac
X`09`09
Xcf_x_athena=$`7B\0E0B-Xaw`7D
X
X
X# Check whether --with-Xaw3d o\1008out\1307was given.
Xif test "$`7Bwith_Xaw3d+set`7D" = set; then
X  withval="$with_Xaw3d"
X  cf_x_athena=Xaw3d
Xfi
X
X
X
X# Check whether --with-neXtaw o\1108out\1408was given.
Xif test "$`7Bwith_neXtaw+set`7D" = set; then
X  withval="$with_neXtaw"
X  cf_x_athena=neXtaw
Xfi
X
X
Xfor ac_hdr in X11/$cf_x_athena/SimpleMenu.h
Xdo
Xac_safe=`60echo "$ac_hdr" `7C sed 'y%./+-%__p_%'`60
Xecho $ac_n "checking for $ac_hdr""... $ac_c" 1>`266
Xecho "configure:5131: checking for $ac_hdr" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_header_$ac_safe'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 5136 "configure"
X#include "confdefs.h"
X#include <$ac_hdr>
XEOF
Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>\1E09out"
X`7B (eval echo configure:5141: `5C"$ac_try`5C") 1>`265;\2E07\1707) 2>`265; `7D
V
Xac_err=`60grep -v '`5E *+' conftest.out`60
Xif test -z "$ac_err"; then
X  rm -rf conftest*
X  eval "ac_cv_header_$ac_safe=yes"
Xelse
X  echo "$ac_err" >`265
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_header_$ac_safe=no"
Xfi
Xrm -f conftest*
Xfi
Xif eval "test `5C"`60echo '$ac_cv_header_'$ac_safe`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X    ac_tr_hdr=HAVE_`60echo $ac_hdr `7C sed 'y%abcdefghijklmnopqrstuvwxyz./-%AB
VCDEFGHIJKLMNOPQRSTUVWXYZ___%'`60
X  cat >> confdefs.h <<EOF
X#define $ac_tr_hdr 1
XEOF
X`20
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
Xdone
X
X
Xecho $ac_n "checking for XmuClientWindow in -lXmu""... $ac_c" 1>`266
Xecho "configure:5169: checking for XmuClientWindow in -lXmu" >`265
Xac_lib_var=`60echo Xmu'_'XmuClientWindow `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lXmu  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 5177 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar XmuClientWindow();
X
Xint main() `7B
XXmuClientWindow()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:5188: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X    ac_tr_lib=HAVE_LIB`60echo Xmu `7C sed -e 's/`5B`5Ea-zA-Z0-9_`5D/_/g' `5C
X    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`60
X  cat >> confdefs.h <<EOF
X#define $ac_tr_lib 1
XEOF
X
X  LIBS="-lXmu $LIBS"
X
Xelse
X  echo "$ac_t""no" 1>`266
X
+-+-+-+-+-+-+-+-  END  OF PART 36 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 37 -+-+-+-+-+-+-+-+
Xecho $ac_n "checking for XmuClientWindow in -lXmu_s""... $ac_c" 1>`266
Xecho "configure:5215: checking for XmuClientWindow in -lXmu_s" >`265
Xac_lib_var=`60echo Xmu_s'_'XmuClientWindow `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lXmu_s  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 5223 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar XmuClientWindow();
X
Xint main() `7B
XXmuClientWindow()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:5234: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X    ac_tr_lib=HAVE_LIB`60echo Xmu_s `7C sed -e 's/`5B`5Ea-zA-Z0-9_`5D/_/g' `5C
V
X    -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`60
X  cat >> confdefs.h <<EOF
X#define $ac_tr_lib 1
XEOF
X
X  LIBS="-lXmu_s $LIBS"
X
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
Xfi
X
X
Xecho $ac_n "checking for XextCreateExtension in -lXext""... $ac_c" 1>`266
Xecho "configure:5265: checking for XextCreateExtension in -lXext" >`265
Xac_lib_var=`60echo Xext'_'XextCreateExtension `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lXext  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 5273 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar XextCreateExtension();
X
Xint main() `7B
XXextCreateExtension()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:5284: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="-lXext $LIBS"
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X
Xecho $ac_n "checking for XawSimpleMenuAddGlobalActions in -l$cf_x_athena""...
V $ac_c" 1>`266
Xecho "configure:5306: checking for XawSimpleMenuAddGlobalActions in -l$cf_x_at
Vhena" >`265
Xac_lib_var=`60echo $cf_x_athena'_'XawSimpleMenuAddGlobalActions `7C sed 'y%./+
V-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-l$cf_x_athena  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 5314 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar XawSimpleMenuAddGlobalActions();
X
Xint main() `7B
XXawSimpleMenuAddGlobalActions()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:5325: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="-l$cf_x_athena $LIBS"
Xelse
X  echo "$ac_t""no" 1>`266
X
Xecho $ac_n "checking for XawSimpleMenuAddGlobalActions in -l$`7Bcf_x_athena`7D
V_s""... $ac_c" 1>`266
Xecho "configure:5345: checking for XawSimpleMenuAddGlobalActions in -l$`7Bcf_x
V_athena`7D_s" >`265
Xac_lib_var=`60echo $`7Bcf_x_athena`7D_s'_'XawSimpleMenuAddGlobalActions `7C se
Vd 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-l$`7Bcf_x_athena`7D_s $X_PRE_LIBS $\0606X_EXTRA\140B"
Xcat > conftest.$ac_ext <<EOF
X#line 5353 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar XawSimpleMenuAddGlobalActions();
X
Xint main() `7B
XXawSimpleMenuAddGlobalActions()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:5364: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="-l$`7Bcf_x_athena`7D_s $LIBS"
Xelse
X  echo "$ac_t""no" 1>`266
X`7B echo "configure: error: Unable to successfully link Athena library (-l$cf_
Vx_athena) with test program" 1>`262; exit 1; `7D
Xfi
X
Xfi
X
X
XCF_X_ATHENA_LIBS=`60echo HAVE_LIB_$cf_x_athena `7C tr '`5Ba-z`5D' '`5BA-Z`5D'
V`60
X
Xcat >> confdefs.h <<EOF
X#define $CF_X_ATHENA_LIBS 1
XEOF
X
X
X`09 `09EXTRAOBJS="$\0C09 menu.o"
X`09;;
X`09x `7C X `7C `5BXx`5D`5BTt`5D*\0C0711 )
X`09`09cat >> confdefs.h <<`5CEOF
X#define NO_WIDGETS 1
XEOF
X
X`09;;
X`09ansi)
X`09`09SCREEN=ansi
X`09`09TARGET=vile
X`09`09cat >> confdefs.h <<`5CEOF
X#define DISP_ANSI 1
XEOF
X
X`09;;
X`09* )
X`09`09SCREEN=tcap
X`09`09TARGET=vile
X`09`09cat >> confdefs.h <<`5CEOF
X#define DISP_TERMCAP 1
XEOF
X
X`09`09cat > conftest.$ac_ext <<EOF
X#line 5419 "configure"
X#include "confdefs.h"
X
Xint main() `7B
Xchar *x=(char*)tgoto("",0,0)
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:5426: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  cat > conftest.$ac_ext <<EOF
X#line 5429 "configure"
X#include "confdefs.h"
X
Xint main() `7B
Xint x=tigetstr("")
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:5436: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  termlib=terminfo
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  termlib=termcap
Xfi
Xrm -f conftest*
X`09`09 test -n "$verbose" `26`26 echo "`09using functions in predefined $terml
Vib LIBS" 1>`266
X
X`09`09
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X `20
X`09`09if test "$screen" = ncurses; then
X`09`09`09
Xecho $ac_n "checking for ncurses header file""... $ac_c" 1>`266
Xecho "configure:5457: checking for ncurses header file" >`265
Xif eval "test `5C"`60echo '$''`7B'cf_cv_ncurses_header'+set`7D'`60`5C" = set";
V then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
X`09cat > conftest.$ac_ext <<EOF
X#line 5463 "configure"
X#include "confdefs.h"
X#include <curses.h>
Xint main() `7B
X
X#ifdef NCURSES_VERSION
Xprintf("%s`5Cn", NCURSES_VERSION);
X#else
X#ifdef __NCURSES_H
Xprintf("old`5Cn");
X#else
Xmake an error
X#endif
X#endif
X`09
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:5480: `5C"$ac_compile`5C") 1>`265;\3207\1B0B) 2>
V`265; `7D; then
X  rm -rf conftest*
X  cf_cv_ncurses_header=predefined
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X `20
X`09cf_search=""
Xif test -d "$includedir"  ; then
Xtest "$includedir" != NONE       `26`26 cf_search="$\0C09 \340B\0C0C/ncurses"
V
Xfi
Xif test -d "$oldincludedir"  ; then
Xtest "$oldincludedir" != NONE    `26`26 cf_search="$\0C09 \340E\0F0F/ncurses"
V
Xfi
Xif test -d "$prefix"; then
Xtest "$prefix" != NONE           `26`26 cf_search="$\0C09 \3407/include\1010/n
Vcurses"
Xfi
Xtest "$prefix" != /usr/local     `26`26 cf_search="$\0C09\280B/include\1313/nc
Vurses"
Xtest "$prefix" != /usr           `26`26 cf_search="$\0C09 /usr/include\0D0D/nc
Vurses"
X
X`09test -n "$verbose" `26`26 echo
X`09for cf_incdir in $cf_search
X`09do
X`09`09for cf_header in `5C
X`09`09`09curses.h `5C
X`09`09`09ncurses.h
X`09`09do
X`09`09`09if egrep "NCURSES_`5BVH`5D" $cf_incdir/$cf_header 1>`265 2>`261; then
V
X`09`09&0209cf_cv_ncurses_header=$cf_incdir/$cf_\1606
X`09`09&0209test -n "$verbose" `26`26 echo $ac_n "`09... found $ac_c" 1>`266
X`09`09&0209break
X`09`09`09fi
X`09`09`09test -n "$verbose" `26`26 echo "`09... tested $cf_incdir/$cf_header"
V 1>`266
X`09`09done
X`09`09test -n "$cf_cv_ncurses_header" `26`26 break
X`09done
X`09test -z "$cf_cv_ncurses_header" `26`26 `7B echo "configure: error: not foun
Vd" 1>`262; exit 1; `7D
X`09
Xfi
Xrm -f conftest*
Xfi
X
Xecho "$ac_t""$cf_cv_ncurses_header" 1>`266
Xcat >> confdefs.h <<`5CEOF
X#define NCURSES 1
XEOF
X
X
Xcf_incdir=`60echo $cf_cv_ncurses_header `7C sed -e 's:/`5B`5E/`5D*$::'`60
X
Xcase $cf_cv_ncurses_header in # (vi
X*/ncurses.h)
X`09cat >> confdefs.h <<`5CEOF
X#define HAVE_NCURSES_H 1
XEOF
X
X`09;;
Xesac
X
Xcase $cf_cv_ncurses_header in # (vi
Xpredefined) # (vi
X`09cf_cv_ncurses_header=\0E06.h
X`09;;
X*)
X`09
Xfor cf_add_incdir in $cf_\0E06
Xdo
X`09while true
X`09do
X`09`09case $cf_add_incdir in
X`09`09/usr/include) # (vi
X`09`09`09;;
X`09`09*) # (vi
X`09`09`09CPPFLAGS="$\0B08 -I$cf_add_incdir"
X`09`09`09;;
X`09`09esac
X`09`09cf_top_incdir=`60echo $cf_add\1507 `7C sed -e 's:/include/.*$\0D09:'`60
V
X`09`09test "$cf_top_incdir" =\1306add\1309`26`26 break
X`09`09cf_add_incdir="$cf_top\1007"
X`09done
Xdone
X
X`09;;
Xesac
Xecho $ac_n "checking for ncurses version""... $ac_c" 1>`266
Xecho "configure:5566: checking for ncurses version" >`265
Xif eval "test `5C"`60echo '$''`7B'cf_cv_ncurses_version'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
X`09cf_cv_ncurses_version=no
X`09cf_tempfile=out$$
X`09if test "$cross_compiling" = yes; then
X `20
X
X`09# This will not work if the preprocessor splits the line after the
X`09# Autoconf token.  The 'unproto' program does that.
X`09cat > conftest.$ac_ext <<EOF
X#include <$`7Bcf_cv_ncurses_header-\0E06.h`7D>
X#undef Autoconf
X#ifdef NCURSES_VERSION
XAutoconf NCURSES_VERSION
X#else
X#ifdef __NCURSES_H
XAutoconf "old"
X#endif
X;
X#endif
XEOF
X`09cf_try="$ac_cpp conftest.$ac_ext 2>`265 `7C grep '`5EAutoconf ' >\2B09out"
V
X`09`7B (eval echo configure:5591: `5C"$cf_try`5C") 1>`265;\2E07\1707) 2>`265;
V `7D
X`09if test -f conftest.out ; then
X`09`09cf_out=`60cat conftest.out `7C sed -e 's@`5EAutoconf @@'\1408`5B`5E"`5D*
V"\110A".*@@'`60
X`09`09test -n "$cf_out" `26`26 cf_cv_ncurses_version=\2309
X`09`09rm -f conftest.out
X`09fi
X
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 5600 "configure"
X#include "confdefs.h"
X
X#include <$`7Bcf_cv_ncurses_header-\0E06.h`7D>
Xint main()
X`7B
X`09FILE *fp = fopen("$cf_tempfile", "w");
X#ifdef NCURSES_VERSION
X# ifdef NCURSES_VERSION_PATCH
X`09fprintf(fp, "%s.%d`5Cn", NCURSES_VERSION\1111_PATCH);
X# else
X`09fprintf(fp, "%s`5Cn", NCURSES_VERSION);
X# endif
X#else
X# ifdef __NCURSES_H
X`09fprintf(fp, "old`5Cn");
X# else
X`09make an error
X# endif
X#endif
X`09exit(0);
X`7D
XEOF
Xif `7B (eval echo configure:5623: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest &0226 (./\0F08; exit) 2>/dev/null
Xthen
X `20
X`09cf_cv_ncurses_version=`60cat $cf_tempfile`60
X`09rm -f $cf_tempfile
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
Xfi
Xrm -fr conftest*
Xfi
X
Xfi
X
Xecho "$ac_t""$cf_cv_ncurses_version" 1>`266
X
X
X`09`09`09
X
X`09# This works, except for the special case where we find gpm, but
X`09# ncurses is in a nonstandard location via $LIBS, and we really want
X`09# to link gpm.
Xcf_ncurses_LIBS=""
Xcf_ncurses_SAVE="$LIBS"
Xecho $ac_n "checking for Gpm_Open in -lgpm""... $ac_c" 1>`266
Xecho "configure:5648: checking for Gpm_Open in -lgpm" >`265
Xac_lib_var=`60echo gpm'_'Gpm_Open `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lgpm  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 5656 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar Gpm_Open();
X
Xint main() `7B
XGpm_Open()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:5667: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  echo $ac_n "checking for initscr in -lgpm""... $ac_c" 1>`266
Xecho "configure:5683: checking for initscr in -lgpm" >`265
Xac_lib_var=`60echo gpm'_'initscr `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lgpm  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 5691 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar initscr();
X
Xint main() `7B
Xinitscr()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:5702: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="$cf_ncurses_SAVE"
Xelse
X  echo "$ac_t""no" 1>`266
Xcf_ncurses_LIBS="-lgpm"
Xfi
X
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X
Xcase $host_os in #(vi
Xfreebsd*)
X`09# This is only necessary if you are linking against an obsolete
X`09# version of ncurses (but it should do no harm, since it's static).
X`09echo $ac_n "checking for tgoto in -lmytinfo""... $ac_c" 1>`266
Xecho "configure:5733: checking for tgoto in -lmytinfo" >`265
Xac_lib_var=`60echo mytinfo'_'tgoto `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lmytinfo  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 5741 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar tgoto();
X
Xint main() `7B
Xtgoto()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:5752: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  cf_ncurses_LIBS="-lmytinfo $\1C0F"
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X`09;;
Xesac
X
XLIBS="$cf_ncurses_LIBS $LIBS"
X
X`09cf_cv_have_lib_ncurses=no
X`09cf_libdir=""
X`09echo $ac_n "checking for initscr""... $ac_c" 1>`266
Xecho "configure:5780: checking for initscr" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_func_initscr'+set`7D'`60`5C" = set"; t
Vhen
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 5785 "configure"
X#include "confdefs.h"
X/* System header to define __stub macros and hopefully few prototypes,
X    which can conflict with char initscr(); below.  */
X#include <assert.h>
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar initscr();
X
Xint main() `7B
X
X/* The GNU C library defines this for functions which it implements
X    to always fail with ENOSYS.  Some functions are actually named
X    something starting with __ and the normal name is an alias.  */
X#if defined (__stub_initscr) `7C`7C\1C11__\1E08
Xchoke me
X#else
Xinitscr();
X#endif
X
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:5808: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_func_initscr=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_func_initscr=no"
Xfi
Xrm -f conftest*
Xfi
X
Xif eval "test `5C"`60echo '$ac_cv_func_'initscr`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  cf_cv_have_lib_ncurses=yes
Xelse
X  echo "$ac_t""no" 1>`266
X
X`09`09cf_save_LIBS="$LIBS"
X`09`09echo $ac_n "checking for initscr in -lncurses""... $ac_c" 1>`266
Xecho "configure:5828: checking for initscr in -lncurses" >`265
X`09`09LIBS="-lncurses $LIBS"
X`09`09cat > conftest.$ac_ext <<EOF
X#line 5831 "configure"
X#include "confdefs.h"
X#include <$`7Bcf_cv_ncurses_header-\0E06.h`7D>
Xint main() `7B
Xinitscr()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:5838: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  echo "$ac_t""yes" 1>`266
X`09`09`09 cf_cv_have_lib_ncurses=yes
X`09`09`09
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  echo "$ac_t""no" 1>`266
X`09`09`09cf_search=""
Xif test -d "$libdir"  ; then
Xtest "$libdir" != NONE           `26`26 cf_search="$\0C09 \3407\0808/ncurses"
V
Xfi
Xif test -d "$exec_prefix"; then
Xtest "$exec_prefix" != NONE      `26`26 cf_search="$\0C09 \340C/lib\1111/ncurs
Ves"
Xfi
Xif test -d "$prefix"; then
Xtest "$prefix" != NONE           `26`26 `5C
Xtest "$prefix" != "$exec_\1208`26`26 cf_search="$\0C09 \3407/lib\0C0C/ncurses"
V
Xfi
Xtest "$prefix" != /usr/local     `26`26 cf_search="$\0C09\280B/lib\0F0F/ncurse
Vs"
Xtest "$prefix" != /usr           `26`26 cf_search="$\0C09 /usr/lib\0909/ncurse
Vs"
X
X`09`09`09for cf_libdir in $cf_search
X`09`09`09do
X`09`09&0209echo $ac_n "checking for -lncurses in $cf_libdir""... $ac_c" 1>`266
V
Xecho "configure:5865: checking for -lncurses in $cf_libdir" >`265
X`09`09&0209LIBS="-L$cf_libdir -lncurses $cf_save_LIBS"
X`09`09&0209cat > conftest.$ac_ext <<EOF
X#line 5868 "configure"
X#include "confdefs.h"
X#include <$`7Bcf_cv_ncurses_header-\0E06.h`7D>
Xint main() `7B
Xinitscr()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:5875: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  echo "$ac_t""yes" 1>`266
X`09`09`09 &0209 cf_cv_have_lib_ncurses=yes
X`09`09&0209`09 break
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  echo "$ac_t""no" 1>`266
X`09`09&0209`09 LIBS="$cf_save_LIBS"
Xfi
Xrm -f conftest*
X`09`09`09done
X`09`09`09
Xfi
Xrm -f conftest*
X`09`09
Xfi
X
Xif test $cf_cv_have_lib_ncurses = no ; then
X`09`7B echo "configure: error: Cannot link ncurses library" 1>`262; exit 1;`20
V`7D
Xfi
Xcase $host_os in #(vi
Xlinux*) # Suse Linux does not follow /usr/lib convention
X`09ncurses="$\0A07 /lib"
X`09;;
Xesac
X
X
Xif test -n "$cf_ncurses_LIBS" ; then
X`09echo $ac_n "checking if we can link ncurses without $cf_n\1406_LIBS""... $a
Vc_c" 1>`266
Xecho "configure:5907: checking if we can link ncurses without $cf_\1407_LIBS"
V >`265
X`09cf_ncurses_SAVE="$LIBS"
X`09for p in $cf_ncurses_LIBS ; do
X`09`09q=`60echo $LIBS `7C sed -e 's/'$p' //'\0F0B$//'`60
X`09`09if test "$q" != "$LIBS" ; then
X`09`09`09LIBS="$q"
X`09`09fi
X`09done
X`09cat > conftest.$ac_ext <<EOF
X#line 5916 "configure"
X#include "confdefs.h"
X#include <$`7Bcf_cv_ncurses_header-\0E06.h`7D>
Xint main() `7B
Xinitscr(); mousemask(0,0); tgoto((char *)0, 0, 0);
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:5923: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  echo "$ac_t""yes" 1>`266
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  echo "$ac_t""no" 1>`266
X`09`09 LIBS="$cf_ncurses_SAVE"
Xfi
Xrm -f conftest*
Xfi
X
X`09`09`09termlib=terminfo
X`09`09fi
X`09`09# HP-UX 9.x terminfo has setupterm, but no tigetstr.
X`09`09if test "$termlib" = none; then
X`09`09`09echo $ac_n "checking for tigetstr in -ltermlib""... $ac_c" 1>`266
Xecho "configure:5941: checking for tigetstr in -ltermlib" >`265
Xac_lib_var=`60echo termlib'_'tigetstr `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-ltermlib  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 5949 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar tigetstr();
X
Xint main() `7B
Xtigetstr()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:5960: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="$LIBS -ltermlib" \0907=terminfo
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X`09`09fi
X`09`09if test "$termlib" = none; then
X`09`09`09echo $ac_n "checking for tgoto in -ltermlib""... $ac_c" 1>`266
Xecho "configure:5983: checking for tgoto in -ltermlib" >`265
Xac_lib_var=`60echo termlib'_'tgoto `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-ltermlib  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 5991 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar tgoto();
X
Xint main() `7B
Xtgoto()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:6002: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="$LIBS -ltermlib" \0907=termcap
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X`09`09fi
X`09`09if test "$termlib" = none; then
X`09`09`09# allow curses library for broken AIX system.
X`09`09`09echo $ac_n "checking for initscr in -lcurses""... $ac_c" 1>`266
Xecho "configure:6026: checking for initscr in -lcurses" >`265
Xac_lib_var=`60echo curses'_'initscr `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-lcurses  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 6034 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar initscr();
X
Xint main() `7B
Xinitscr()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:6045: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="$LIBS -lcurses" termlib=termcap
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X`09`09`09echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>`266
Xecho "configure:6066: checking for tgoto in -ltermcap" >`265
Xac_lib_var=`60echo termcap'_'tgoto `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-ltermcap  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 6074 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar tgoto();
X
Xint main() `7B
Xtgoto()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:6085: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="$LIBS -ltermcap" termlib=\1107
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X`09`09fi
X`09`09if test "$termlib" = none; then
X`09`09`09echo $ac_n "checking for tgoto in -ltermcap""... $ac_c" 1>`266
Xecho "configure:6108: checking for tgoto in -ltermcap" >`265
Xac_lib_var=`60echo termcap'_'tgoto `7C sed 'y%./+-%__p_%'`60
Xif eval "test `5C"`60echo '$''`7B'ac_cv_lib_$ac_lib_var'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  ac_save_LIBS="$LIBS"
XLIBS="-ltermcap  $LIBS"
Xcat > conftest.$ac_ext <<EOF
X#line 6116 "configure"
X#include "confdefs.h"
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar tgoto();
X
Xint main() `7B
Xtgoto()
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:6127: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_lib_$ac_lib_var=no"
Xfi
Xrm -f conftest*
XLIBS="$ac_save_LIBS"
X
Xfi
Xif eval "test `5C"`60echo '$ac_cv_lib_'$ac_lib_var`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X  LIBS="$LIBS -ltermcap" termlib=\1107
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X`09`09fi
X`09`09if test "$termlib" = none; then
X`09`09`09echo "configure: warning: Can't find -ltermlib, -lcurses, or\1807cap"
V 1>`262
X`09`09fi
X`09`09
Xfi
Xrm -f conftest*
X`09;;
Xesac
X
X: Check for termcap vs terminfo:
Xcf_tc_funcs=""
Xcf_tc_externs=""
Xif test "$termlib" = terminfo ; then
X`09cat >> confdefs.h <<`5CEOF
X#define USE_TERMINFO 1
XEOF
X
X`09cf_tc_funcs="tigetint tigetnum tpara\0706m"
X`09cf_tc_externs="$\1006funcs tgoto tigetstr tputs\0F06flag"
Xelif test "$termlib" = termcap ; then
X`09# BSD 'tputs()' may need 'PC' to be set.
X`09cat > conftest.$ac_ext <<EOF
+-+-+-+-+-+-+-+-  END  OF PART 37 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 38 -+-+-+-+-+-+-+-+
X#line 6170 "configure"
X#include "confdefs.h"
X
Xint main() `7B
Xextern char PC; PC = 0
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:6177: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  cat >> confdefs.h <<`5CEOF
X#define HAVE_EXTERN_TCAP_PC 1
XEOF
X
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
Xfi
Xrm -f conftest*
X`09cf_tc_funcs="tgetint tgetnum tpara\0706m"
X`09cf_tc_externs="$\1006funcs tgoto tgetstr tputs tgetent tgetflag"
Xfi
X
XLIBS="$LIBS $X_EXTRA_LIBS"
X
Xfor ac_func in `5C
Xaccess `5C
Xalarm `5C
Xgetcwd `5C
Xgethostname `5C
Xgetpass `5C
Xgetwd `5C
Xkillpg `5C
Xlink `5C
Xmkdir `5C
Xpoll `5C
Xputenv `5C
Xselect `5C
Xsetitimer `5C
Xsetsid `5C
Xsetvbuf `5C
Xsigaction `5C
Xsigprocmask `5C
Xstrchr `5C
Xstrrchr `5C
Xsymlink `5C
Xtcgetattr `5C
Xttyname `5C
Xutime `5C
Xutimes `5C
X$cf_tc_funcs `5C
X
Xdo
Xecho $ac_n "checking for $ac_func""... $ac_c" 1>`266
Xecho "configure:6223: checking for $ac_func" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_func_$ac_func'+set`7D'`60`5C" = set";
V then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 6228 "configure"
X#include "confdefs.h"
X/* System header to define __stub macros and hopefully few prototypes,
X    which can conflict with char $ac_func(); below.  */
X#include <assert.h>
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar $ac_func();
X
Xint main() `7B
X
X/* The GNU C library defines this for functions which it implements
X    to always fail with ENOSYS.  Some functions are actually named
X    something starting with __ and the normal name is an alias.  */
X#if defined (__stub_$ac_func) `7C`7C\1D11__\1F09
Xchoke me
X#else
X$ac_func();
X#endif
X
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:6251: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_func_$ac_func=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_func_$ac_func=no"
Xfi
Xrm -f conftest*
Xfi
X
Xif eval "test `5C"`60echo '$ac_cv_func_'$ac_func`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X    ac_tr_func=HAVE_`60echo $ac_func `7C tr 'abcdefghijklmnopqrstuvwxyz' 'ABCD
VEFGHIJKLMNOPQRSTUVWXYZ'`60
X  cat >> confdefs.h <<EOF
X#define $ac_tr_func 1
XEOF
X`20
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
Xdone
X
X
X
Xecho $ac_n "checking for standard qsort""... $ac_c" 1>`266
Xecho "configure:6278: checking for standard qsort" >`265
Xif eval "test `5C"`60echo '$''`7B'cf_cv_ansi_qsort'+set`7D'`60`5C" = set"; the
Vn
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
X`09cat > conftest.$ac_ext <<EOF
X#line 6284 "configure"
X#include "confdefs.h"
X
X#if HAVE_STDLIB_H
X#include <stdlib.h>
X#endif
X`09int compare(const void *a, co\0F0Ab)
X`09`7B return (*(int *)a - *\0C07b); `7D`20
Xint main() `7B
X extern long *vector;
X`09  qsort(vector, 1, 1, compare);`20
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:6297: `5C"$ac_compile`5C") 1>`265;\3207\1B0B) 2>
V`265; `7D; then
X  rm -rf conftest*
X  cf_cv_ansi_qsort=yes
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  cf_cv_ansi_qsort=no
Xfi
Xrm -f conftest*
X
Xfi
X
Xecho "$ac_t""$cf_cv_ansi_qsort" 1>`266
Xif test $cf_cv_ansi_qsort = yes; then
X`09cat >> confdefs.h <<`5CEOF
X#define ANSI_QSORT 1
XEOF
X
Xelse
X`09cat >> confdefs.h <<`5CEOF
X#define ANSI_QSORT 0
XEOF
X
Xfi
X
X
X###`09Miscellaneous options
Xif test -n "$cf_x_athena" ; then
X    echo $ac_n "checking if you want to use Xaw scrollbars rather than our own
V""... $ac_c" 1>`266
Xecho "configure:6327: checking if you want to use Xaw scrollbars rather than o
Vur own" >`265
X   `20
X# Check whether --with-Xaw-scrollbars o\1908out\1C10was given.
Xif test "$`7Bwith_Xaw_scrollbars+set`7D" = set; then
X  withval="$with_Xaw_scrollbars"
X  cf_Xaw_scrollbars=$withval
Xelse
X  cf_Xaw_scrollbars=no
Xfi
X
X    echo "$ac_t""$cf_Xaw_scrollbars" 1>`266
X   `20
X    if test "$cf_Xaw_scrollbars" = no ; then
X`09cat >> confdefs.h <<`5CEOF
X#define OPT_KEV_SCROLLBARS 1
XEOF
X
X`09cat >> confdefs.h <<`5CEOF
X#define OPT_KEV_DRAGGING 1
XEOF
X
X    else
X`09cat >> confdefs.h <<`5CEOF
X#define OPT_XAW_SCROLLBARS 1
XEOF
X
X`09echo $ac_n "checking if you want to use the drag/scrolling extension with X
Vaw""... $ac_c" 1>`266
Xecho "configure:6354: checking if you want to use the drag/scrolling extension
V with Xaw" >`265
X`09
X# Check whether --with-drag-extension o\1908out\1C10was given.
Xif test "$`7Bwith_drag_extension+set`7D" = set; then
X  withval="$with_drag_extension"
X  cf_drag_extension=$withval
Xelse
X  cf_drag_extension=no
Xfi
X
X`09echo "$ac_t""$cf_drag_extension" 1>`266
X`09if test "$cf_drag_extension" != "no" ; then
X`09    cat >> confdefs.h <<`5CEOF
X#define OPT_KEV_DRAGGING 1
XEOF
X
X`09fi
X    fi
Xfi
X
Xecho $ac_n "checking if you want to change the number of exec-macros""... $ac_
Vc" 1>`266
Xecho "configure:6375: checking if you want to change the number of exec-macros
V" >`265
X
X# Check whether --with-exec-macros o\1608out\190Dwas given.
Xif test "$`7Bwith_exec_macros+set`7D" = set; then
X  withval="$with_exec_macros"
X  cf_exec_macros=$withval
Xelse
X  cf_exec_macros=no
Xfi
X
Xecho "$ac_t""$cf_exec_macros" 1>`266
Xtest "$cf_exec_macros" != no `26`26 cat >> confdefs.h <<`5CEOF
X#define OPT_EXEC_MACROS $cf_exec_macros
XEOF
X
X
X# I don't know of a reliable test for working locale, but we can at least chec
Vk
X# that it is available before offering it as an option.
Xecho $ac_n "checking for setlocale""... $ac_c" 1>`266
Xecho "configure:6394: checking for setlocale" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_func_setlocale'+set`7D'`60`5C" = set";
V then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 6399 "configure"
X#include "confdefs.h"
X/* System header to define __stub macros and hopefully few prototypes,
X    which can conflict with char setlocale(); below.  */
X#include <assert.h>
X/* Override any gcc2 internal prototype to avoid an error.  */
X/* We use char because int might match the return type of a gcc2
X    builtin and then its argument prototype would still apply.  */
Xchar setlocale();
X
Xint main() `7B
X
X/* The GNU C library defines this for functions which it implements
X    to always fail with ENOSYS.  Some functions are actually named
X    something starting with __ and the normal name is an alias.  */
X#if defined (__stub_setlocale) `7C`7C\1E11__s\2009
Xchoke me
X#else
Xsetlocale();
X#endif
X
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:6422: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval "ac_cv_func_setlocale=yes"
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_func_setlocale=no"
Xfi
Xrm -f conftest*
Xfi
X
Xif eval "test `5C"`60echo '$ac_cv_func_'setlocale`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X `20
Xac_safe=`60echo "locale.h" `7C sed 'y%./+-%__p_%'`60
Xecho $ac_n "checking for locale.h""... $ac_c" 1>`266
Xecho "configure:6439: checking for locale.h" >`265
Xif eval "test `5C"`60echo '$''`7B'ac_cv_header_$ac_safe'+set`7D'`60`5C" = set"
V; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X  cat > conftest.$ac_ext <<EOF
X#line 6444 "configure"
X#include "confdefs.h"
X#include <locale.h>
XEOF
Xac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>\1E09out"
X`7B (eval echo configure:6449: `5C"$ac_try`5C") 1>`265;\2E07\1707) 2>`265; `7D
V
Xac_err=`60grep -v '`5E *+' conftest.out`60
Xif test -z "$ac_err"; then
X  rm -rf conftest*
X  eval "ac_cv_header_$ac_safe=yes"
Xelse
X  echo "$ac_err" >`265
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval "ac_cv_header_$ac_safe=no"
Xfi
Xrm -f conftest*
Xfi
Xif eval "test `5C"`60echo '$ac_cv_header_'$ac_safe`60`5C" = yes"; then
X  echo "$ac_t""yes" 1>`266
X `20
Xecho $ac_n "checking if you want to use i18n locale support""... $ac_c" 1>`266
V
Xecho "configure:6467: checking if you want to use i18n locale support" >`265
X
X# Check whether --with-locale o\1108out\1408was given.
Xif test "$`7Bwith_locale+set`7D" = set; then
X  withval="$with_locale"
X  cf_locale=$withval
Xelse
X  cf_locale=no
Xfi
X
Xecho "$ac_t""$cf_locale" 1>`266
Xtest "$cf_locale" != no `26`26 cat >> confdefs.h <<`5CEOF
X#define OPT_LOCALE 1
XEOF
X
X
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
Xelse
X  echo "$ac_t""no" 1>`266
Xfi
X
X
X###`09Debugging/development options
X
X# Check whether --with-dbmalloc o\1308out\160Awas given.
Xif test "$`7Bwith_dbmalloc+set`7D" = set; then
X  withval="$with_dbmalloc"
X  cat >> confdefs.h <<`5CEOF
X#define USE_DBMALLOC 1
XEOF
X
X`09 LIBS="$LIBS -ldbmalloc"
Xfi
X
X
X
X# Check whether --with-dmalloc o\1208out\1509was given.
Xif test "$`7Bwith_dmalloc+set`7D" = set; then
X  withval="$with_dmalloc"
X  cat >> confdefs.h <<`5CEOF
X#define USE_DMALLOC 1
XEOF
X
X`09 LIBS="$LIBS -ldmalloc"
Xfi
X
X
X
X# Check whether --with-no-leaks o\1308out\160Awas given.
Xif test "$`7Bwith_no_leaks+set`7D" = set; then
X  withval="$with_no_leaks"
X  cat >> confdefs.h <<`5CEOF
X#define NO_LEAKS 1
XEOF
X
Xfi
X
X
X
X# Check whether --with-trace o\1008out\1307was given.
Xif test "$`7Bwith_trace+set`7D" = set; then
X  withval="$with_trace"
X  cat >> confdefs.h <<`5CEOF
X#define OPT_TRACE 1
XEOF
X
X`09 EXTRAOBJS="$\0C09 trace.o"
Xfi
X
X
XCFLAGS="$saved_\0F06"
X
X# Check whether --with-warnings o\1308out\160Awas given.
Xif test "$`7Bwith_warnings+set`7D" = set; then
X  withval="$with_warnings"
X  with_warnings=$withval
Xfi
X
Xif test -n "$with_warnings"
Xthen
X`09
Xif test -n "$GCC"
Xthen
Xcat > conftest.i <<EOF
X#ifndef GCC_PRINTF
X#define GCC_PRINTF 0
X#endif
X#ifndef GCC_SCANF
X#define GCC_SCANF 0
X#endif
X#ifndef GCC_NORETURN
X#define GCC_NORETURN /* nothing */
X#endif
X#ifndef GCC_UNUSED
X#define GCC_UNUSED /* nothing */
X#endif
XEOF
Xif test -n "$GCC"
Xthen
X`09echo "checking for gcc __attribute__ directives" 1>`266
Xecho "configure:6570: checking for gcc __attribute__ directives" >`265
X`09cat > conftest.$ac_ext <<EOF
X#line 6572 "configure"
X#include "confdefs.h"
X#include "conftest.h"
X#include "conftest.i"
X#if`09GCC_PRINTF
X#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,\2608))
X#else
X#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
X#endif
X#if`09GCC_SCANF
X#define GCC_SCANFLIKE(fmt,var)  __attribute__((format(scanf,\2608))
X#else
X#define GCC_SCANFLIKE(fmt,var)  /*nothing*/
X#endif
Xextern void wow(char *,...) GCC_SCANFLIKE(1,2);
Xextern void oops(char *,...) GCC_PRINTFLIKE(1,2\1406NORETURN;
Xextern void foo(void) GCC_NORETURN;
Xint main(int argc GCC_UNUSED, char *argv`5B`5D\190B) `7B return 0; `7D
XEOF
X`09`09for cf_attribute in scanf printf unused noreturn
X`09do
X`09`09
XCF_ATTRIBUTE=`60echo $cf_attribute `7C tr '`5Ba-z`5D' '`5BA-Z`5D'`60
X
X`09`09cf_directive="__attribute__(($cf_\1109))"
X`09`09echo "checking for gcc $cf_directive" 1>`265
X`09`09case $cf_attribute in
X`09`09scanf`7Cprintf)
X`09`09cat >conftest.h <<EOF
X#define GCC_$CF_ATTRIBUTE 1
XEOF
X`09`09`09;;
X`09`09*)
X`09`09cat >conftest.h <<EOF
X#define GCC_$CF_ATTRIBUTE $cf_directive
XEOF
X`09`09`09;;
X`09`09esac
X`09`09if `7B (eval echo configure:6610: `5C"$ac_compile`5C") 1>`265;\3207\1B0B
V) 2>`265; `7D; then
X`09`09`09test -n "$verbose" `26`26 echo "$ac_t""... $cf_attribute" 1>`266
X`09`09`09cat conftest.h >>confdefs.h
X#`09`09else
X#`09`09`09sed -e 's/__attr.*/`5C/*nothing*`5C//' conftest.h >>confdefs.h
X`09`09fi
X`09done
Xelse
X`09fgrep define conftest.i >>confdefs.h
Xfi
Xrm -rf conftest*
Xfi
X
X`09
Xif test -n "$GCC"
Xthen
X`09`09cat > conftest.$ac_ext <<EOF
X#line 6627 "configure"
Xint main(int argc, char *argv`5B`5D) `7B return argv`5Bargc-1`5D == 0; `7D
XEOF
X`09`09echo "checking for gcc warning options" 1>`266
Xecho "configure:6631: checking for gcc warning options" >`265
X`09cf_save_CFLAGS="$\0906"
X`09EXTRA_CFLAGS="-W -Wall"
X`09cf_warn_CONST=""
X`09test "$with_ext_const" = yes `26`26 cf_warn_CONST="Wwrite-strings"
X`09for cf_opt in `5C
X`09`09Wbad-function-cast `5C
X`09`09Wcast-align `5C
X`09`09Wcast-qual `5C
X`09`09Winline `5C
X`09`09Wmissing-declarations `5C
X`09`09Wmissing-prototypes `5C
X`09`09Wnested-externs `5C
X`09`09Wpointer-arith `5C
X`09`09Wshadow `5C
X`09`09Wstrict-prototypes $cf_warn_CONST
X`09do
X`09`09CFLAGS="$cf_save_\1106 $EXTRA\0E08-$cf_opt"
X`09`09if `7B (eval echo configure:6649: `5C"$ac_compile`5C") 1>`265;\3207\1B0B
V) 2>`265; `7D; then
X`09`09`09test -n "$verbose" `26`26 echo "$ac_t""... -$cf_opt" 1>`266
X`09`09`09EXTRA_CFLAGS="$\0F0C -$cf_opt"
X`09`09`09test "$cf_opt" = Wcast-qual `26`26 EXTRA_CFLAGS="$\0F0C -DXTSTRINGDEF
VINES"
X`09`09fi
X`09done
X`09rm -f conftest*
X`09CFLAGS="$cf_save_\1106"
Xfi
X
X
Xfi
X
X###`09Do these last, since they rely on a properly constructed config.h
X
X###`09Mandatory checks for missing prototypes:
XCHECK_DECL_FLAG="-I. -I$srcdir -Dscrn_chosen"
XVILE_CHECK_HDRS='
X#define CHECK_PROTOTYPES 1
X#include <estruct.h>
X'
XCHECK_DECL_HDRS="$VILE_\1706HDRS"
X
Xfor ac_func in `5C
Xenviron `5C
Xgetenv `5C
Xgetpass `5C
Xgetwd `5C
Xmalloc `5C
Xrealloc `5C
Xrindex `5C
Xstrerror `5C
Xstrtol `5C
X
Xdo
X
Xac_tr_func=`60echo $ac_func `7C tr '`5Ba-z`5D' '`5BA-Z`5D'`60
X
X
Xecho $ac_n "checking for missing "$`7Bac_func`7D" extern""... $ac_c" 1>`266
Xecho "configure:6689: checking for missing "$`7Bac_func`7D" extern" >`265
Xif eval "test `5C"`60echo '$''`7B'cf_cv_func_$`7Bac_func`7D'+set`7D'`60`5C" =
V set"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
Xcf_save_CFLAGS="$\0906"
XCFLAGS="$\0906 $CHECK_DECL_FLAG"
Xcat > conftest.$ac_ext <<EOF
X#line 6697 "configure"
X#include "confdefs.h"
X
X$CHECK_DECL_HDRS
X
X#undef $`7Bac_func`7D
Xstruct zowie `7B int a; double b; \200D*c; char d; `7D;
Xextern struct zowie *$`7Bac_func`7D();
X
Xint main() `7B
X
X#if HAVE_LIBXT`09`09/* needed for SunOS 4.0.3 or 4.1 */
XXtToolkitInitialize();
X#endif
X
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:6714: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval 'cf_cv_func_'$`7Bac_func`7D'=yes'
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval 'cf_cv_func_'$`7Bac_func`7D'=no'
Xfi
Xrm -f conftest*
XCFLAGS="$cf_save_\1106"
X
Xfi
X
Xeval 'cf_result=$cf_cv_func_'$`7Bac_func`7D
Xecho "$ac_t""$cf_result" 1>`266
Xtest $cf_result = yes `26`26 cat >> confdefs.h <<EOF
X#define MISSING_EXTERN_$`7Bac_tr_func`7D 1
XEOF
X
Xdone
X
X
Xif test -n "$cf_tc_externs"
Xthen
XCHECK_DECL_HDRS="$VILE_\1706HDRS
X#include <tcap.h>
X"
X
Xif test "$termlib" != "none" ; then
X`09
Xecho $ac_n "checking for term.h""... $ac_c" 1>`266
Xecho "configure:6746: checking for term.h" >`265
Xif eval "test `5C"`60echo '$''`7B'cf_cv_have_term_h'+set`7D'`60`5C" = set"; th
Ven
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
X`09cat > conftest.$ac_ext <<EOF
X#line 6752 "configure"
X#include "confdefs.h"
X
X#include <curses.h>
X#include <term.h>
Xint main() `7B
XWINDOW *x
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:6761: `5C"$ac_compile`5C") 1>`265;\3207\1B0B) 2>
V`265; `7D; then
X  rm -rf conftest*
X  cf_cv_have_term_h=yes
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  cf_cv_have_term_h=no
Xfi
Xrm -f conftest*
X`09
Xfi
X
Xecho "$ac_t""$cf_cv_have_term_h" 1>`266
Xtest $cf_cv_have_term_h = yes `26`26 cat >> confdefs.h <<`5CEOF
X#define HAVE_TERM_H 1
XEOF
X
X
X
X
Xecho $ac_n "checking if we should include curses.h or termcap.h""... $ac_c" 1>
V`266
Xecho "configure:6783: checking if we should include curses.h or termcap.h" >
V`265
Xif eval "test `5C"`60echo '$''`7B'cf_cv_need_curses_h'+set`7D'`60`5C" = set";
V then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
Xcf_save_CFLAGS="$\0906"
Xcf_cv_need_curses_h=no
X
Xfor cf_t_opts in "" "NEED_TERMCAP_H"
Xdo
Xfor cf_c_opts in "" "NEED_CURSES_H"
Xdo
X
X    CFLAGS="$cf_save_\1106 $CHECK_DECL_FLAG"
X    test -n "$cf_c_opts" `26`26 CFLAGS="$\0906 -D\210B
X    test -n "$cf_t_opts" `26`26 CFLAGS="$\0906 -D\210B
X
X    cat > conftest.$ac_ext <<EOF
X#line 6801 "configure"
X#include "confdefs.h"
X/* $cf_c_opts $cf_t\0B06*/
X$CHECK_DECL_HDRS
Xint main() `7B
Xchar *x = (\0B06)tgoto("")
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:6809: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  test "$cf_cv_need_curses_h" = no `26`26 `7B
X`09     cf_cv_need_curses_h=maybe
X`09     cf_ok_c_opts=$cf_\0B06
X`09     cf_ok_t_opts=$cf_\0B06
X`09`7D
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  echo "Recompiling with corrected call (C:$cf_c_opts, T:$cf_t_opts)" >`265
X`09cat > conftest.$ac_ext <<EOF
X#line 6822 "configure"
X#include "confdefs.h"
X
X$CHECK_DECL_HDRS
Xint main() `7B
Xchar *x = (\0B06)tgoto("",0,0)
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:6830: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  cf_cv_need_curses_h=yes
X`09 cf_ok_c_opts=$cf_\0B06
X`09 cf_ok_t_opts=$cf_\0B06
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
Xfi
Xrm -f conftest*
Xfi
Xrm -f conftest*
X
X`09CFLAGS="$cf_save_\1106"
X`09test "$cf_cv_need_curses_h" = yes `26`26 break
Xdone
X`09test "$cf_cv_need_curses_h" = yes `26`26 break
Xdone
X
Xif test "$cf_cv_need_curses_h" != no ; then
X`09echo "Curses/termcap test = $cf_cv_need_curses_h (C:$cf_ok_c_opts, T\1108t_
Vopts)" >`265
X`09if test -n "$cf_ok_c_opts" ; then
X`09`09if test -n "$cf_ok_t_opts" ; then
X`09`09`09cf_cv_need_curses_h=both
X`09`09else
X`09`09`09cf_cv_need_curses_h=\0906.h
X`09`09fi
X`09elif test -n "$cf_ok_t_opts" ; then
X`09`09cf_cv_need_curses_h=termcap.h
X`09elif test "$cf_cv_have_term_h" = yes ; then
X`09`09cf_cv_need_curses_h=term.h
X`09else
X`09`09cf_cv_need_curses_h=no
X`09fi
Xfi
X
Xfi
X
Xecho "$ac_t""$cf_cv_need_curses_h" 1>`266
X
Xcase $cf_cv_need_curses_h in
Xboth) #(vi
X`09cat >> confdefs.h <<EOF
X#define NEED_CURSES_H 1
XEOF
X
X`09cat >> confdefs.h <<EOF
X#define NEED_TERMCAP_H 1
XEOF
X
X`09;;
Xcurses.h) #(vi
X`09cat >> confdefs.h <<EOF
X#define NEED_CURSES_H 1
XEOF
X
X`09;;
Xtermcap.h) #(vi
X`09cat >> confdefs.h <<EOF
X#define NEED_TERMCAP_H 1
XEOF
X
X`09;;
Xesac
X
X
X
X
X
Xecho $ac_n "checking declaration of tputs 3rd param""... $ac_c" 1>`266
Xecho "configure:6900: checking declaration of tputs 3rd param" >`265
Xif eval "test `5C"`60echo '$''`7B'cf_cv_type_outchar'+set`7D'`60`5C" = set"; t
Vhen
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
X
Xcf_cv_type_outchar="int OutChar(int)"
Xcf_cv_found=no
Xcf_save_CFLAGS="$\0906"
XCFLAGS="$\0906 $CHECK_DECL_FLAG"
X
Xfor P in int void; do
Xfor Q in int void; do
Xfor R in int char; do
Xfor S in "" const; do
X
X`09cat > conftest.$ac_ext <<EOF
X#line 6917 "configure"
X#include "confdefs.h"
X$CHECK_DECL_HDRS
Xint main() `7B
Xextern $Q OutChar($R);
X`09extern $P tputs ($S char *string, int nlines, $Q (*_f)($R));
X`09tputs("", 1, OutChar)
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:6926: `5C"$ac_compile`5C") 1>`265;\3207\1B0B) 2>
V`265; `7D; then
X  rm -rf conftest*
X  cf_cv_type_outchar="$Q OutChar($R)"
X`09 cf_cv_found=yes
X`09 break
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
Xfi
Xrm -f conftest*
Xdone
X`09test $cf_cv_found = yes `26`26 break
Xdone
X`09test $cf_cv_found = yes `26`26 break
Xdone
X`09test $cf_cv_found = yes `26`26 break
Xdone
X`09
Xfi
X
Xecho "$ac_t""$cf_cv_type_outchar" 1>`266
Xcase $cf_cv_type_outchar in
Xint*)
X`09cat >> confdefs.h <<`5CEOF
X#define OUTC_RETURN 1
XEOF
X
X`09;;
Xesac
Xcase $cf_cv_type_outchar in
X*char*)
X`09cat >> confdefs.h <<`5CEOF
X#define OUTC_ARGS char c
XEOF
X
X`09;;
Xesac
X
XCFLAGS="$cf_save_\1106"
X
Xfi
Xfor ac_func in `5C
X$cf_tc_externs `5C
X
Xdo
X
Xac_tr_func=`60echo $ac_func `7C tr '`5Ba-z`5D' '`5BA-Z`5D'`60
X
X
Xecho $ac_n "checking for missing "$`7Bac_func`7D" extern""... $ac_c" 1>`266
Xecho "configure:6976: checking for missing "$`7Bac_func`7D" extern" >`265
Xif eval "test `5C"`60echo '$''`7B'cf_cv_func_$`7Bac_func`7D'+set`7D'`60`5C" =
V set"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
Xcf_save_CFLAGS="$\0906"
XCFLAGS="$\0906 $CHECK_DECL_FLAG"
Xcat > conftest.$ac_ext <<EOF
X#line 6984 "configure"
X#include "confdefs.h"
X
X$CHECK_DECL_HDRS
X
X#undef $`7Bac_func`7D
Xstruct zowie `7B int a; double b; \200D*c; char d; `7D;
Xextern struct zowie *$`7Bac_func`7D();
X
Xint main() `7B
X
X#if HAVE_LIBXT`09`09/* needed for SunOS 4.0.3 or 4.1 */
XXtToolkitInitialize();
X#endif
X
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:7001: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval 'cf_cv_func_'$`7Bac_func`7D'=yes'
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval 'cf_cv_func_'$`7Bac_func`7D'=no'
Xfi
Xrm -f conftest*
XCFLAGS="$cf_save_\1106"
X
Xfi
X
Xeval 'cf_result=$cf_cv_func_'$`7Bac_func`7D
Xecho "$ac_t""$cf_result" 1>`266
Xtest $cf_result = yes `26`26 cat >> confdefs.h <<EOF
X#define MISSING_EXTERN_$`7Bac_tr_func`7D 1
XEOF
X
Xdone
X
Xfi
X
X###`09Optional checks for missing functions (enabled with --with-warnings)
Xif test -n "$with_warnings"
Xthen
XCHECK_DECL_HDRS="$VILE_\1706HDRS"
Xfor ac_func in `5C
X_filbuf `5C
X_flsbuf `5C
Xaccess `5C
Xalarm `5C
Xatoi `5C
Xbzero `5C
Xchdir `5C
Xclose `5C
Xdup `5C
Xexeclp `5C
Xfclose `5C
Xfflush `5C
Xfgetc `5C
Xfileno `5C
Xfork `5C
Xfprintf `5C
Xfputc `5C
Xfputs `5C
Xfread `5C
Xfree `5C
Xfseek `5C
Xfwrite `5C
Xgethostname `5C
Xgetpgrp `5C
Xgetpid `5C
Xgetuid `5C
Xisatty `5C
Xkill `5C
Xkillpg `5C
Xlink `5C
Xlongjmp `5C
Xlstat `5C
Xmemset `5C
Xmkdir `5C
Xmktemp `5C
Xopen `5C
Xperror `5C
Xpipe `5C
Xprintf `5C
Xputs `5C
Xqsort `5C
Xread `5C
Xreadlink `5C
Xselect `5C
Xsetbuf `5C
Xsetbuffer `5C
Xsetitimer `5C
Xsetjmp `5C
Xsetpgrp `5C
Xsetsid `5C
Xsetvbuf `5C
Xsleep `5C
Xsscanf `5C
Xsystem `5C
Xtime `5C
Xunlink `5C
Xutime `5C
Xutimes `5C
Xwait `5C
Xwrite `5C
X
Xdo
X
Xac_tr_func=`60echo $ac_func `7C tr '`5Ba-z`5D' '`5BA-Z`5D'`60
X
X
Xecho $ac_n "checking for missing "$`7Bac_func`7D" extern""... $ac_c" 1>`266
Xecho "configure:7097: checking for missing "$`7Bac_func`7D" extern" >`265
Xif eval "test `5C"`60echo '$''`7B'cf_cv_func_$`7Bac_func`7D'+set`7D'`60`5C" =
V set"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
Xcf_save_CFLAGS="$\0906"
XCFLAGS="$\0906 $CHECK_DECL_FLAG"
Xcat > conftest.$ac_ext <<EOF
X#line 7105 "configure"
X#include "confdefs.h"
X
X$CHECK_DECL_HDRS
X
X#undef $`7Bac_func`7D
Xstruct zowie `7B int a; double b; \200D*c; char d; `7D;
Xextern struct zowie *$`7Bac_func`7D();
X
Xint main() `7B
X
X#if HAVE_LIBXT`09`09/* needed for SunOS 4.0.3 or 4.1 */
XXtToolkitInitialize();
X#endif
X
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:7122: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval 'cf_cv_func_'$`7Bac_func`7D'=yes'
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval 'cf_cv_func_'$`7Bac_func`7D'=no'
Xfi
Xrm -f conftest*
XCFLAGS="$cf_save_\1106"
X
Xfi
X
Xeval 'cf_result=$cf_cv_func_'$`7Bac_func`7D
Xecho "$ac_t""$cf_result" 1>`266
Xtest $cf_result = yes `26`26 cat >> confdefs.h <<EOF
X#define MISSING_EXTERN_$`7Bac_tr_func`7D 1
XEOF
X
Xdone
X
X
XCHECK_DECL_HDRS="$VILE_\1706HDRS
X#if HAVE_SYS_IOCTL_H
X#include`09<sys/ioctl.h>
X#endif
X"
Xfor ac_func in `5C
Xioctl `5C
X
Xdo
X
Xac_tr_func=`60echo $ac_func `7C tr '`5Ba-z`5D' '`5BA-Z`5D'`60
X
X
Xecho $ac_n "checking for missing "$`7Bac_func`7D" extern""... $ac_c" 1>`266
Xecho "configure:7159: checking for missing "$`7Bac_func`7D" extern" >`265
Xif eval "test `5C"`60echo '$''`7B'cf_cv_func_$`7Bac_func`7D'+set`7D'`60`5C" =
V set"; then
X  echo $ac_n "(cached) $ac_c" 1>`266
Xelse
X `20
Xcf_save_CFLAGS="$\0906"
XCFLAGS="$\0906 $CHECK_DECL_FLAG"
Xcat > conftest.$ac_ext <<EOF
X#line 7167 "configure"
X#include "confdefs.h"
X
X$CHECK_DECL_HDRS
X
X#undef $`7Bac_func`7D
Xstruct zowie `7B int a; double b; \200D*c; char d; `7D;
Xextern struct zowie *$`7Bac_func`7D();
X
Xint main() `7B
X
X#if HAVE_LIBXT`09`09/* needed for SunOS 4.0.3 or 4.1 */
XXtToolkitInitialize();
X#endif
X
X; return 0; `7D
XEOF
Xif `7B (eval echo configure:7184: `5C"$ac_link`5C") 1>`265;\2F07\1808) 2>`265;
V `7D `26`26 test -s conftest; then
X  rm -rf conftest*
X  eval 'cf_cv_func_'$`7Bac_func`7D'=yes'
Xelse
X  echo "configure: failed program was:" >`265
X  cat conftest.$ac_ext >`265
X  rm -rf conftest*
X  eval 'cf_cv_func_'$`7Bac_func`7D'=no'
Xfi
Xrm -f conftest*
XCFLAGS="$cf_save_\1106"
X
Xfi
X
Xeval 'cf_result=$cf_cv_func_'$`7Bac_func`7D
Xecho "$ac_t""$cf_result" 1>`266
Xtest $cf_result = yes `26`26 cat >> confdefs.h <<EOF
X#define MISSING_EXTERN_$`7Bac_tr_func`7D 1
XEOF
X
Xdone
X
Xfi
X
X
X
X###`09output makefile and config.h
Xtrap '' 1 2 15
Xcat > confcache <<`5CEOF
X# This file is a shell script that caches the results of configure
X# tests run on this system so they can be shared between configure
X# scripts and configure runs.  It is not useful on other systems.
X# If it contains results you don't want to keep, you may remove or edit it.
X#
X# By default, configure uses ./\1106.cache as the \0D06file,
X# creating it if it does not exist already.  You can give configure
X# the --cache-file=FILE option to use a different cache file; that is
X# what configure does when it calls \1D0Ascripts in
X# subdirectories, so they share the cache.
X# Giving --cache-file=/dev/null disables caching, for debugging configure.
X# config.status only pays attention to the cache file if you give it the
X# --recheck option to rerun configure.
X#
XEOF
X# The following way of writing the cache mishandles newlines in values,
X# but we know of no workaround that is simple, portable, and efficient.
X# So, don't put newlines in cache variables' values.
X# Ultrix sh set writes to stderr and can't be redirected \0906ly,
X# and sets the high bit in the cache file unless we assign to the vars.
X(set) 2>`261 `7C
X  case `60(ac_space=' '; set) 2>`261 `7C grep '`5E\210A`60 in
X  *ac_space=`5C *)
X    # `60set' does not quote correctly, so add\1806s (double-\2706substitution
V
X    # turns `5C`5C&025C into &025C, and sed \1C08\1A07).
X    sed -n `5C
X      -e "s/'/'`5C`5C&025C''/g" `5C
X      -e "s/`5E`5C`5C(`5Ba-zA-Z0-9_`5D*_cv_\110D&025C)=&025C(.*&025C)/&025C1=
V`5C$`7B&025C1='&025C2'`7D/p"
X    ;;
X  *)
X    # `60set' quotes correctly as required by POSIX, so do not add \3506.
X    sed -n -e 's/`5E`5C(`5Ba-zA-Z0-9_`5D*_cv_\110D`5C)=`5C(.*`5C)/`5C1=$`7B`5C
V1=`5C2`7D/p'
X    ;;
X  esac >> confcache
Xif cmp -s $cache_file confcache; then
X  :
Xelse
X  if test -w $cache_file; then
X    echo "updating cache $cache_file"
X    cat confcache > $cache_file
X  else
X    echo "not updating unwritable cache $cache_file"
X  fi
Xfi
Xrm -f confcache
X
Xtrap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1
V 2 15
X
Xtest "x$prefix" = xNONE `26`26 \1306=$ac_default_\2606
X# Let make expand exec_prefix.
Xtest "x$exec_prefix" = xNONE `26`26 \180B='$`7B\2206`7D'
X
X# Any assignment to VPATH causes Sun make to only execute
X# the first set of double-colon rules, so remove it if not needed.
X# If there is a colon in the path, we need to keep it.
Xif test "x$srcdir" = x.; then
X  ac_vpsub='/`5E`5B `09`5D*VPATH`5B `09`5D*=`5B`5E:`5D*$/d'
Xfi
X
Xtrap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
X
XDEFS=-DHAVE_CONFIG_H
X
X# Without the "./", some shells look in PATH for config.status.
X: $`7BCONFIG_STATUS=./config.status`7D
X
Xecho creating $CONFIG_STATUS
Xrm -f $CONFIG_STATUS
Xcat > $CONFIG_STATUS <<EOF
X#! /bin/sh
X# Generated automatically by configure.
X# Run this file to recreate the current configuration.
X# This directory was configured as follows,
X# on host `60(hostname `7C`7C uname -n) 2>/dev/null `7C sed 1q`60:
X#
X# $0 $ac_configure_args
X#
+-+-+-+-+-+-+-+-  END  OF PART 38 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 39 -+-+-+-+-+-+-+-+
X# Compiler output produced by configure, useful for debugging
X# configure, is in ./\1306.log if it exists.
X
Xac_cs_usage="Usage: $CONFIG_STATUS `5B--recheck`5D `5B--version`5D `5B--help
V`5D"
Xfor ac_option
Xdo
X  case "`5C$ac_option" in
X  -recheck `7C -\0C0C\1807\170A\2109\2A08\3207\3906)
X    echo "running `5C$`7BCONFIG_SHELL-/bin/sh`7D $0 $ac_configure_args --no-cr
Veate\0C06recursion"
X    exec `5C$`7BCONFIG_SHELL-/bin/sh`7D $0 $ac_configure_args --no-create\0C06
Vrecursion ;;
X  -version `7C -\0C0C\1807\170A\2109\2A08\3207\3906)
X    echo "$CONFIG_STATUS generated by autoconf version 2.12.971230"
X    exit 0 ;;
X  -help `7C -\0909-hel\1107\1806)
X    echo "`5C$ac_cs_usage"; exit 0 ;;
X  *) echo "`5C$ac_cs_usage"; exit 1 ;;
X  esac
Xdone
X
Xac_given_srcdir=$\0806
Xac_given_INSTALL="$\0A07"
X
Xtrap 'rm -fr `60echo "makefile config.h:\0906_h.in" `7C sed "s/:`5B`5E `5D*//g
V"`60 conftest*; exit 1' 1 2 15
XEOF
Xcat >> $CONFIG_STATUS <<EOF
X
X# Protect against being on the right side of a sed subst in config.status.
Xsed 's/%@/@@/; s/@%\0A08%g`5C$/@g/; /@g`5C$/s/`5B`5C`5C&025C`26%`5D/&045C`26/g
V;
X s/@@/%@/;\0A06@%\0A06g`5C$/%g/' > conftest.subs <<`5C`5CCEOF
X$ac_vpsub
X$extrasub
Xs%@CFLAGS@%$\0906%g
Xs%@CPPFLAGS@%$\0B08%g
Xs%@CXXFLAGS@%$\0B08%g
Xs%@DEFS@%$DEFS%g
Xs%@LDFLAGS@%$\0A07%g
Xs%@LIBS@%$LIBS%g
Xs%@exec_prefix@%$\0E0B%g
Xs%@prefix@%$\0906%g
Xs%@program_transform_name@%$\1916%g
Xs%@bindir@%$\0906%g
Xs%@sbindir@%$\0A07%g
Xs%@libexecdir@%$\0D0A%g
Xs%@datadir@%$\0A07%g
Xs%@sysconfdir@%$\0D0A%g
Xs%@sharedstatedir@%$\110E%g
Xs%@localstatedir@%$\100D%g
Xs%@libdir@%$\0906%g
Xs%@includedir@%$\0D0A%g
Xs%@oldincludedir@%$\100D%g
Xs%@infodir@%$\0A07%g
Xs%@mandir@%$\0906%g
Xs%@host@%$host%g
Xs%@host_alias@%$\0D0A%g
Xs%@host_cpu@%$\0B08%g
Xs%@host_vendor@%$\0E0B%g
Xs%@host_os@%$\0A07%g
Xs%@CC@%$CC%g
Xs%@CPP@%$CPP%g
Xs%@INSTALL_PROGRAM@%$\120F%g
Xs%@INSTALL_DATA@%$\0F0C%g
Xs%@TD_CONFIG@%$\0C09%g
Xs%@ECHO_LD@%$\0A07%g
Xs%@RULE_CC@%$\0A07%g
Xs%@SHOW_CC@%$\0A07%g
Xs%@ECHO_CC@%$\0A07%g
Xs%@PROG_EXT@%$\0B08%g
Xs%@VILE_STARTUP_PATH@%$\1411%g
Xs%@perl_bin_path@%$\100D%g
Xs%@perl_lib_path@%$\100D%g
Xs%@EXTRA_INSTALL@%$\100D%g
Xs%@COULD_BE_SCO@%$\0F0C%g
Xs%@LINT@%$LINT%g
Xs%@LIBOBJS@%$\0A07%g
Xs%@X_CFLAGS@%$\0B08%g
Xs%@X_LIBS@%$\0906%g
Xs%@X_EXTRA_LIBS@%$\0F0C%g
Xs%@SCREEN@%$\0906%g
Xs%@TARGET@%$\0906%g
Xs%@LINK_PREFIX@%$\0E0B%g
Xs%@X_PRE_LIBS@%$\0D0A%g
Xs%@IMAKE@%$IMAKE%g
Xs%@IMAKE_CFLAGS@%$\0F0C%g
Xs%@IMAKE_LOADFLAGS@%$\120F%g
Xs%@EXTRA_CFLAGS@%$\0F0C%g
Xs%@EXTRAOBJS@%$\0C09%g
X
XCEOF
XEOF
X
Xcat >> $CONFIG_STATUS <<`5CEOF
X
X# Split the substitutions into bite-sized pieces for seds with
X# small command number limits, like on Digital OSF/1 and HP-UX.
Xac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
Xac_file=1 # Number of current file.
Xac_beg=1 # First line for current file.
Xac_end=$ac_max_sed_cmds # Line after last line for current file.
Xac_more_lines=:
Xac_sed_cmds=""
Xwhile $ac_more_lines; do
X  if test $ac_beg -gt 1; then
X    sed "1,$`7Bac_beg`7Dd; $`7Bac_end`7Dq" conftest.subs >\100B$ac_file
X  else
X    sed "$`7Bac_end`7Dq" conftest.subs >\100B$ac_file
X  fi
X  if test ! -s conftest.s$ac_file; then
X    ac_more_lines=false
X    rm -f conftest.s$ac_file
X  else
X    if test -z "$ac_sed_cmds"; then
X      ac_sed_cmds="sed -f conftest.s$ac_file"
X    else
X      ac_sed_cmds="$\0E0B `7C sed -f conftest.s$ac_file"
X    fi
X    ac_file=`60expr $\0F07 + 1`60
X    ac_beg=$ac_end
X    ac_end=`60expr $\0E06 + $ac_max_sed_cmds`60
X  fi
Xdone
Xif test -z "$ac_sed_cmds"; then
X  ac_sed_cmds=cat
Xfi
XEOF
X
Xcat >> $CONFIG_STATUS <<EOF
X
XCONFIG_FILES=`5C$`7B\100C-"makefile"`7D
XEOF
Xcat >> $CONFIG_STATUS <<`5CEOF
Xfor ac_file in .. $CONFIG_FILES; do if test "x$\2B07" != x..; then
X  # Support "outfile`5B:in\0808file...`5D`5D", defaulting \2106=\3208.in".
X  case "$ac_file" in
X  *:*) ac_file_in=`60echo "$\1307"`7Csed 's%`5B`5E:`5D*:%%'`60
X       ac_file=`60echo "$\1007"`7Csed 's%:.*%%'`60 ;;
X  *) ac_file_in="$`7B\0E07`7D.in" ;;
X  esac
X
X  # Adjust a relative srcdir, top_\0C08and INSTALL for subdirectories.
X
X  # Remove last slash and all that follows it.  Not all systems have dirname.
V
X  ac_dir=`60echo $ac_file`7Csed 's%/`5B`5E/`5D`5B`5E/`5D*$%%'`60
X  if test "$ac_dir" !=\0D06file" `26`26\2013.; then
X    # The file is in a subdirectory.
X    test ! -d "$ac_dir" `26`26 mkdir\130A
X    ac_dir_suffix="/`60echo $\1706`7Csed 's%`5E`5C./%%'`60"
X    # A "../" for each directory in $ac_dir_suffix.
X    ac_dots=`60echo $ac_dir_suffix`7Csed 's%/`5B`5E/`5D*%../%g'`60
X  else
X    ac_dir_suffix= ac_dots=
X  fi
X
X  case "$ac_given_srcdir" in
X  .)  srcdir=.
X      if test -z "$ac_dots"; then top_srcdir=.
X      else top_srcdir=`60echo $ac_dots`7Csed 's%/$%%'`60; fi ;;
X  /*) srcdir="$ac_given_\1206$ac_dir_suffix"; top\1B07\2D12" ;;
X  *) # Relative path.
X    srcdir="$ac_dots$ac_given_\1A06$ac_dir_suffix"
X    top_srcdir="$ac_dots$ac_given\1A07" ;;
X  esac
X
X  case "$ac_given_INSTALL" in
X  `5B/$`5D*) INSTALL="$ac_given_\1307" ;;
X  *) INSTALL="$ac_dots$ac_given_\1B07" ;;
X  esac
X
X  echo creating "$ac_file"
X  rm -f "$ac_file"
X  configure_input="Generated automatically from `60echo $ac_file_in`7Csed 's%.
V*/%%'`60 by \5209."
X  case "$ac_file" in
X  *Makefile*) ac_comsub="1i`5C`5C
X# $configure_input" ;;
X  *) ac_comsub= ;;
X  esac
X
X  ac_file_inputs=`60echo $\160A`7Csed -e "s%`5E%$ac_given_srcdir/%"\1C07:% $ac
V_\1D0Eg"`60
X  sed -e "$ac_comsub
Xs%@configure_input@%$\120F%g
Xs%@srcdir@%$\0906%g
Xs%@top_srcdir@%$\0D0A%g
Xs%@INSTALL@%$\0A07%g
X" $ac_file_inputs `7C (eval "$ac_sed_cmds") >\2A09
Xfi; done
Xrm -f conftest.s*
X
X# These sed commands are passed to sed as "A NAME B\0706C VALUE D", where
X# NAME is the cpp macro being defined and VALU\2909value it is \2B06given.
X#
X# ac_d sets the value in "#define NAME VALUE" lines.
Xac_dA='s%`5E`5C(`5B `09`5D*`5C)#\0A07define`5B `09`5D\1907'
Xac_dB='`5C(`5B `09`5D`5B `09`5D*`5C)`5B`5E `09`5D*%`5C1#`5C2'
Xac_dC='`5C3'
Xac_dD='%g'
X# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
Xac_uA='s%`5E`5C(`5B `09`5D*`5C)#\0A09undef\1806\1C07'
Xac_uB='`5C(`5B `09`5D`5C)%`5C1#`5C2define`5C3'
Xac_uC=' '
Xac_uD='`5C4%g'
X# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
V
Xac_eA='s%`5E`5C(`5B `09`5D*`5C)#\0A09undef\1806\1C07'
Xac_eB='$%`5C1#`5C2define`5C3'
Xac_eC=' '
Xac_eD='%g'
X
Xif test "$`7BCONFIG_HEADERS+set`7D" != set; then
XEOF
Xcat >> $CONFIG_STATUS <<EOF
X  CONFIG_HEADERS="config.h:\0906_h.in"
XEOF
Xcat >> $CONFIG_STATUS <<`5CEOF
Xfi
Xfor ac_file in .. $CONFIG_HEADERS; do if test "x$\2D07" != x..; then
X  # Support "outfile`5B:in\0808file...`5D`5D", defaulting \2106=\3208.in".
X  case "$ac_file" in
X  *:*) ac_file_in=`60echo "$\1307"`7Csed 's%`5B`5E:`5D*:%%'`60
X       ac_file=`60echo "$\1007"`7Csed 's%:.*%%'`60 ;;
X  *) ac_file_in="$`7B\0E07`7D.in" ;;
X  esac
X
X  echo creating $ac_file
X
X  rm -f conftest.frag\0E0Ain\1A0Aout
X  ac_file_inputs=`60echo $\160A`7Csed -e "s%`5E%$ac_given_srcdir/%"\1C07:% $ac
V_\1D0Eg"`60
X  cat $ac_file_inputs > conftest.in
X
XEOF
X
X
X# Transform confdefs.h into a list of #define's.  We won't use it as a sed
X# script, but as data to insert where we see @DEFS@.  We expect AC_SAVE_DEFS t
Vo
X# be either 'cat' or 'sort'.
Xsort confdefs.h >conftest.vals
X
X# Break up conftest.vals because some shells have a limit on
X# the size of here documents, and old seds have small limits too.
X
Xrm -f conftest.tail
Xecho '  rm -f conftest.frag' >> $CONFIG_STATUS
Xwhile :
Xdo
X  ac_lines=`60grep -c . conftest.vals`60
X  # grep -c gives empty output for an\1407file on some AIX systems.
X  if test -z "$ac_lines" `7C`7C\1706\140C-eq 0; then break; fi
X  # Write chunks of a limited-size here document to conftest.frag.
X  echo '  cat >> conftest.frag <<CEOF' >> $CONFIG_STATUS
X  sed $`7Bac_max_here_lines`7Dq conftest.vals >> $CONFIG_STATUS
X  echo 'CEOF' >> $CONFIG_STATUS
X  sed 1,$`7Bac_max_here_lines`7Dd conftest.vals >\100Atail
X  rm -f conftest.vals
X  mv conftest.tail\0E0Avals
Xdone
Xrm -f conftest.vals
X
X# Run sed to substitute the contents of conftest.frag into \1309in at the
X# marker @DEFS@.
Xecho '  cat >> conftest.edit <<CEOF
X/@DEFS@/r conftest.frag
X/@DEFS@/d
XCEOF
Xsed -f conftest.edit\0E0Ain >\1C0Aout
Xrm -f conftest.in
Xmv conftest.out\0D0Ain
Xrm -f conftest.edit\0E0Afrag
X' >> $CONFIG_STATUS
X
X
Xcat >> $CONFIG_STATUS <<`5CEOF
X  rm -f conftest.frag\0E0Ah
X  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
V
X  cat conftest.in >>\0F0Ah
X  rm -f conftest.in
X  if cmp -s $ac_file conftest.h 2>/dev/null; then
X    echo "$ac_file is unchanged"
X    rm -f conftest.h
X  else
X    # Remove last slash and all that follows it.  Not all systems have dirname
V.
X      ac_dir=`60echo $ac_file`7Csed 's%/`5B`5E/`5D`5B`5E/`5D*$%%'`60
X      if test "$ac_dir" !=\0D06file" `26`26\2013.; then
X      # The file is in a subdirectory.
X      test ! -d "$ac_dir" `26`26 mkdir\130A
X    fi
X    rm -f $ac_file
X    mv conftest.h $ac_file
X  fi
Xfi; done
X
XEOF
Xcat >> $CONFIG_STATUS <<EOF
X# Extra initialization commands, if any
X
XEOF
Xcat >> $CONFIG_STATUS <<`5CEOF
X# Extra commands, if any
X
Xexit 0
XEOF
Xchmod +x $CONFIG_STATUS
Xrm -fr confdefs* $ac_clean_files
Xtest "$no_create" = yes `7C`7C $`7BCONFIG_SHELL-/bin/sh`7D $\1708TATUS &027C e
Vxit 1
X
$ call unpack [.VILE-8_0]CONFIGURE.;1 -
 1785492106 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 431 24 152
$!
$ create 'f'
Xdnl Process this file with autoconf to produce a configure script.
XAC_REVISION($Revision: 1.86 $)
XAC_PREREQ(2.12.971222)
Xrm -f config.cache
X
X### Use "configure -with-screen" to override the default \3008ation, which is
V
X### termcap-based on unix systems.
X
Xdnl $Header: /usr/build/vile/vile/RCS/configure.in,v 1.86 1998/05/22 02:02:51
V tom Exp $
X
Xdnl
XAC_INIT(mktbls.c)
XAC_CONFIG_HEADER(config.h:\0906_h.in)
X
XCF_CHECK_CACHE
X
X###`09checks for alternative programs
XAC_PROG_CC
XAC_PROG_CPP
XAC_GCC_TRADITIONAL
XAC_PROG_INSTALL
XAC_PROGRAM_PATH(TD_CONFIG,td_config)
X
XCF_DISABLE_ECHO
XCF_PROG_EXT
X
XCF_ARG_DISABLE(extensions,
X`09`5B  --disable-extensions    test: build only core functions`5D,
X`09`5BAC_DEFINE(SMALLER)
X`09 AC_DEFINE(FEWNAMES)`5D,
X`09`5BEXTRAOBJS="$\0C09 btree.o crypt.o"`5D)
XCF_ARG_DISABLE(shell,
X`09`5B  --disable-shell         test: \1C07 shell/external commands`5D,
X`09`5BAC_DEFINE(OPT_SHELL,0)`5D,
X`09`5BEXTRAOBJS="$\0C09 npopen.o spawn.o"`5D)
X
X###`09use option --with-cflags to set default CFLAGS
XAC_MSG_CHECKING(for CFLAGS options)
XAC_ARG_WITH(CFLAGS,
X`09`5B  --with-CFLAGS=value     set default for `5C$\2306`5D,
X`09`5Bcflags=$withval`5D)
Xif test -z "$cflags"; then
X`09AC_ARG_WITH(cflags,
X`09`09`5B  --with-cflags=value     (same as\2108CFLAGS)`5D,
X`09`09`5Bcflags=$withval`5D)
Xfi
X
X# if the user specified nothing else, set -O. \2606can override
X# with --with-cflags=" "
Xif test -n "$cflags"; then
X`09CFLAGS="$cflags"
Xelif test -z "$CFLAGS" ; then
X`09CFLAGS="-O"
Xfi
XAC_MSG_RESULT($cflags)
X
XAC_MSG_CHECKING(for startup path)
XAC_ARG_WITH(startup-path,
X`5B  --with-startup-path=PATH specify locations to search for vile.hlp, etc.
V`5D,
X`5BVILE_STARTUP_PATH=$withval`5D,
X`5Btest -z "$VILE_STARTUP_PATH" `26`26`5C
X`09VILE_STARTUP_PATH='$(datadir):/usr/local/lib/\100C\1C07ib/'`5D)
XAC_MSG_RESULT($VILE_STARTUP_PATH)
XAC_SUBST(VILE_STARTUP_PATH)
X
XAC_PATH_PROGS(perl_bin_path, perl5 perl, no)
XAC_ARG_WITH(perl,
X`09`5B  --with-perl             enable use of Perl as an extension language`5D
V,
X`09`5B
X`09 if test "$perl_bin_path" = no; then
X`09    AC_ERROR(`5Bperl not found`5D)
X`09 fi
X`09 $perl_bin_path -e 'require 5.003' `7C`7C `7B
X`09    AC_ERROR(`5Bperl version must be 5.003 or greater`5D)
X`09 `7D
X`09 perl_lib_path=`60$perl_bin_path -MConfig -e 'print $\1206`7Bprivlib`7D'`60
V
X`09 AC_DEFINE(OPT_PERL)
X`09 EXTRAOBJS="$\0C09 perl.o"
X`09 LINK_PREFIX=`60$perl_bin_path -MConfig -e 'print $\1206`7Bshrpenv`7D'`60`20
V
X`09 ac_link="$LINK_PREFIX $\1707"`20
X`09 CFLAGS="$\0906 `60$perl_bin_path -MExtUtils::Embed -e ccopts`60"
X`09 LIBS="$LIBS `60$perl_bin_path -MExtUtils::Embed -e ldopts`60"
X`09 EXTRA_INSTALL="$\100D `5C$(\1B07_PERL)"`5D)
XAC_SUBST(perl_lib_path)
XAC_SUBST(perl_bin_path)
XAC_SUBST(EXTRA_INSTALL)
X
X# X11 checks will sometimes add to CFLAGS.  We want the state of\1E07
X# prior to these checks
Xsaved_CFLAGS="$\0906"
X
X###`09checks for UNIX variants that set C preprocessor variables
XAC_AIX
XAC_ISC_POSIX
XAC_MINIX
Xdnl: why this? AC_DYNIX_SEQ
XAC_CHECK_FUNC(getpwnam,,\1809LIB(sun,\1B08))
X
X# check for SCO.
X# FIXME:  this is a hack, and should be split into individual features -- the
V
X# sys/time.h and select.h conflict.
XAC_CHECKING(`5Bfor SCO by checking on /usr/bin/scosh`5D)
XAC_PROGRAM_CHECK(COULD_BE_SCO, `5Bscosh`5D, maybe\0707not)
Xif test "$COULD_BE_SCO" = "maybe"
Xthen
X`09AC_DEFINE(SYSTEM_LOOKS_LIKE_SCO)
Xfi
X
X# check for a lint program.
XAC_CHECK_PROGS(LINT, lint alint lclint, `5B`5D)
Xif test -n "$LINT"
Xthen
X`09AC_DEFINE(SYSTEM_HAS_LINT_PROG)
Xfi
X
X###`09checks for header files
XAC_STDC_HEADERS
XAC_HEADER_DIRENT
XAC_CHECK_HEADERS(unistd.h stdlib\0906arg\1206def.h string.h memory.h fcntl.h`20
V`5C
X        \0808poll.h pwd.h termios\0A09.h sgtty.h `5C
X`09`09ioctl.h select.h setjmp.h signal.h utime.h varargs.h)
X
X###`09checks for <sys/xxx> header files (separate, to avoid bug in autoconf)
XAC_CHECK_HEADERS(sys/filio.h sys/ioctl\0C08timer.h `5C
X`09`09sys/param.h `5C
X`09`09sys/resource.h sys/wait\0B07tim\1608select.h)
X
X###`09checks for typedefs
XAC_TYPE_SIGNAL
XAC_DEFINE(SIGT,RETSIGTYPE)
Xif test $ac_cv_type_signal = void; then
X`09AC_DEFINE(SIGRET,`5B/*do nothing*/`5D)
Xelse
X`09AC_DEFINE(SIGRET,`5Breturn 0`5D)
Xfi
X
XAC_TYPE_SIZE_T
XAC_TYPE_OFF_T
XAC_TYPE_UID_T
XAC_TYPE_PID_T
XAC_CHECK_TYPE(time_t, long)
X
X###`09checks for library functions
Xif test "$cross_compiling" = no; then
X`09AC_FUNC_SETVBUF_REVERSED
Xfi
X
X###`09checks for structures
XAC_STAT_MACROS_BROKEN
XAC_ST_BLKSIZE
XAC_ST_BLOCKS
XAC_ST_RDEV
XAC_TIME_WITH_SYS_TIME
XAC_STRUCT_TM
XCF_SIZECHANGE
XCF_FP_ISREADY
X
X###`09checks for compiler characteristics
XAC_CONST
XCF_ANSI_CC_REQD
X
X# I haven't found a "losing" compiler to check the following on.  I gather
X# that some losing compiler's can be found on pyramid's, aix, and Apple's AUX2
V.
X# (Lint on several platforms will complain, even when the compiler won't).
XAC_MSG_CHECKING(`5Bif switch cases work with structure offsets`5D)
XAC_CACHE_VAL(cf_cv_case_offsetof,`5B
X`09AC_TRY_COMPILE(`5B`5D,
X`09`5Bstruct foo `7Bint a,b;`7D;
X`09 extern getpid();
X`09 switch(getpid())`7Bcase ((int) `26(((struct foo *)0)->b)) : printf("foo");
V `7D `5D,
X`09`5Bcf_cv_case_offsetof=yes`5D,
X`09`5Bcf_cv_case_offsetof=no`5D)
X`09`5D)
XAC_MSG_RESULT($cf_cv_case_offsetof)
Xtest $cf_cv_case_offsetof = no `26`26 AC_DEFINE(HAVE_LOSING_SWITCH_WITH_STRUCT
VURE_OFFSET)
X
X###`09checks for system services and user specified options
XAC_LONG_FILE_NAMES
XCF_RESTARTABLE_PIPEREAD`09`09# is a read() of a pipe restartable?
X
XAC_SUBST(CFLAGS)
XAC_SUBST(LIBS)
XAC_SUBST(X_CFLAGS)
XAC_SUBST(X_LIBS)
XAC_SUBST(X_EXTRA_LIBS)
XAC_SUBST(SCREEN)
XAC_SUBST(TARGET)
XAC_SUBST(LINK_PREFIX)
Xdnl
Xdnl The killpg test and the tests for the presence of certain functions on
Xdnl a particular operating system are done prior to the checks for existence
Xdnl of screen libraries due to a problem with -lXt on certain SunOS systems.
Xdnl The nature of this problem is described in the FAQ on X.  Look for the
Xdnl following subject: `60`60What are these problems with "_XtInherit not foun
Vd"
Xdnl on the Sun? ...''  The long and the short of it is that AC_HAVE_FUNCS will
V
Xdnl not work properly (without being rewritten) if placed after adding -lXt to
V
Xdnl LIBS on SunOS (and perhaps some others as well).
Xdnl
XAC_FUNC_SETPGRP
XAC_FUNC_GETPGRP
XCF_KILLPG
XCF_ERRNO
XCF_SYS_ERRLIST
XAC_DEFINE(SYS_UNIX)
XAC_DEFINE(scrn_chosen)
X# Try to eventually eliminate the following
XAC_DEFINE(os_chosen)
X
XAC_MSG_CHECKING(for screen type)
XAC_ARG_WITH(screen,
X`5B  --with-screen=value     specify terminal driver.  The default is tcap, fo
Vr
X        \0808\100Athe termcap/terminfo driver.  Other values include
X        \0808\100Ancurses (a special case of terminfo), X11, OpenLook,
X        \0808\100AMotif, Athena, Xaw, Xaw3d, neXtaw and ansi.`5D,
X`5Bscreen=$withval`5D)
X
Xif test -z "$screen"; then
X`09AC_ARG_WITH(scr,
X`09`09`5B  --with-scr=value        (same as\210Been)`5D,
X`09`09`5Bscreen=$withval`5D)
Xfi
Xtest -z "$screen" `26`26 test "$with_x" = yes &0226 \2306=x11
X
Xtermlib=none
Xif test -z "$screen"; then
X`09screen=termcap;
Xfi
XAC_MSG_RESULT($screen)
X
X: See if this is any type of xvile configuration:
Xcase "$screen" in
Xchangequote(,)dnl
X`09`5BOo`5Dpen`5BLl`5Dook `7C `5BMm`5Dotif `7C `5BxX`5D `7C `5BAa`5Dthena\1307
V`5BatTmMoO`5D*\240711 `7C neXtaw )
Xchangequote(`5B,`5D)dnl
X`09`09CF_X_TOOLKIT
X`09`09CF_IMAKE_CFLAGS
X`09`09X_CFLAGS="$\0B08 $IMAKE\1907"
X`09`09LDFLAGS="$\0A07 $X_LIBS"
X`09`09CFLAGS="$\0906 $X_\1306"
X`09`09SCREEN=x11
X`09`09TARGET=xvile
X`09`09AC_DEFINE(DISP_X11)
X`09`09AC_DEFINE(XTOOLKIT)
X`09`09AC_CHECK_HEADERS(X11/IntrinsicI.h)
X`09;;
Xesac
X
X: Find the libraries that apply to the selected screen-type:
Xcase "$screen" in
Xchangequote(,)dnl
X`09`5BOo`5Dpen* `7C Xol )
Xchangequote(`5B,`5D)dnl
X`09`09AC_DEFINE(OL_WIDGETS)
X`09`09if test -n "$OPENWINHOME"; then
X`09`09`09X_LIBS="$\0906 -L$`7BOPENWINHOME`7D/lib"
X`09`09`09X_CFLAGS="$\0B08 -I$`7BOPENWINHOME`7D/include"
X`09`09fi
X`09`09LDFLAGS="$\0A07 $X_LIBS"
X`09`09AC_CHECK_LIB(Xmu,XmuClientWindow)
X`09`09AC_CHECK_LIB(Xol, OlToolkitInitialize,
X`09`09`09`5BLIBS="-lXol -lm $LIBS"`5D,
X`09`09`09AC_ERROR(
X`5BUnable to successfully link OpenLook library (-lXol) with test program`5D))
V
X`09;;
X`09motif* `7C M\0908Xm )
X`09`09AC_DEFINE(MOTIF_WIDGETS)
X`09`09AC_CHECK_HEADERS(X11/IntrinsicI.h Xm/XmP.h)
X`09`09AC_CHECK_LIB(gen,regcmp)
X`09`09AC_CHECK_LIB(Xmu,XmuClientWindow)
X`09`09AC_CHECK_LIB(Xp,XpStartDoc,,,`5B$LIBS $X_EXTRA_LIBS`5D)
X`09`09AC_CHECK_LIB(Xext,XextCreateExtension,
X`09`09`09`5BLIBS="-lXext $LIBS"`5D)
X`09`09AC_CHECK_LIB(Xpm, XpmCreatePixmapFromXpmImage,
X`09`09`09`5BLIBS="-lXpm $LIBS"`5D,,
X`09`09`09`5B$LIBS $X_EXTRA_LIBS`5D)
X`09`09AC_CHECK_LIB(XIM,XmbTextListToTextProperty)dnl needed for Unixware's Xm
V
X`09`09AC_CHECK_LIB(Xm, XmProcessTraversal, `5BLIBS="-lXm $LIBS"`5D,
X`09`09`09AC_ERROR(
X`5BUnable to successfully link Motif library (-lXm) with test program`5D),
X`09`09`09`5B$X_PRE_LIBS $\0606X_EXTRA_LIBS`5D)
X`09 `09EXTRAOBJS="$\0C09 menu.o"
X`09;;
Xchangequote(,)dnl
X`09`5BAa`5Dthena* `7C Xaw* `7C neXtaw )
Xchangequote(`5B,`5D)dnl
X`09`09AC_DEFINE(ATHENA_WIDGETS)
X`09`09case $screen in #(vi
X`09`09*aw*)
X`09`09`09cf_x_athena=$screen
X`09`09`09;;
X`09`09esac
X`09`09CF_X_ATHENA
X`09 `09EXTRAOBJS="$\0C09 menu.o"
X`09;;
Xchangequote(,)dnl
X`09x `7C X `7C `5BXx`5D`5BTt`5D*\0C0711 )
Xchangequote(`5B,`5D)dnl
X`09`09AC_DEFINE(NO_WIDGETS)
X`09;;
X`09ansi)
X`09`09SCREEN=ansi
X`09`09TARGET=vile
X`09`09AC_DEFINE(DISP_ANSI)
X`09;;
X`09* )
X`09`09SCREEN=tcap
X`09`09TARGET=vile
X`09`09AC_DEFINE(DISP_TERMCAP)
X`09`09AC_TRY_LINK(`5B`5D,`5Bchar *x=(char*)tgoto("",0,0)`5D,
X`09`09`5BAC_TRY_LINK(`5B`5D,`5Bint x=tigetstr("")`5D,
X`09`09`09`5Btermlib=terminfo`5D,
X`09`09`09`5Btermlib=termcap`5D)
X`09`09 CF_VERBOSE(using functions in predefined $termlib LIBS)
X`09`09`5D,`5B
X`09`09if test "$screen" = ncurses; then
X`09`09`09CF_NCURSES_CPPFLAGS
X`09`09`09CF_NCURSES_LIBS
X`09`09`09termlib=terminfo
X`09`09fi
X`09`09# HP-UX 9.x terminfo has setupterm, but no tigetstr.
X`09`09if test "$termlib" = none; then
X`09`09`09AC_CHECK_LIB(termlib, tigetstr, `5BLIBS="$LIBS -l\2207" t\2B06=termin
Vfo`5D)
X`09`09fi
X`09`09if test "$termlib" = none; then
X`09`09`09AC_CHECK_LIB(termlib, tgoto, `5BLIBS="$LIBS -l\1F07" t\2806=termcap
V`5D)
X`09`09fi
X`09`09if test "$termlib" = none; then
X`09`09`09# allow curses library for broken AIX system.
X`09`09`09AC_CHECK_LIB(curses, initscr, `5BLIBS="$LIBS -l\2006" termlib=termcap
V`5D)
X`09`09`09AC_CHECK_LIB(termcap, tgoto, `5BLIBS="$LIBS -l\1F07" termlib=\3007`5D
V)
X`09`09fi
X`09`09if test "$termlib" = none; then
X`09`09`09AC_CHECK_LIB(termcap, tgoto, `5BLIBS="$LIBS -l\1F07" termlib=\3007`5D
V)
X`09`09fi
X`09`09if test "$termlib" = none; then
X`09`09`09AC_WARN(`5BCan't find -ltermlib, -lcurses, or\1807cap`5D)
X`09`09fi
X`09`09`5D)
X`09;;
Xesac
X
X: Check for termcap vs terminfo:
Xcf_tc_funcs=""
Xcf_tc_externs=""
Xif test "$termlib" = terminfo ; then
X`09AC_DEFINE(USE_TERMINFO)
X`09cf_tc_funcs="tigetint tigetnum tpara\0706m"
X`09cf_tc_externs="$\1006funcs tgoto tigetstr tputs\0F06flag"
Xelif test "$termlib" = termcap ; then
X`09# BSD 'tputs()' may need 'PC' to be set.
X`09AC_TRY_LINK(`5B`5D,`5Bextern char PC; PC = 0`5D,
X`09`09`5BAC_DEFINE(HAVE_EXTERN_TCAP_PC)`5D)
X`09cf_tc_funcs="tgetint tgetnum tpara\0706m"
X`09cf_tc_externs="$\1006funcs tgoto tgetstr tputs tgetent tgetflag"
Xfi
X
XLIBS="$LIBS $X_EXTRA_LIBS"
X
XAC_HAVE_FUNCS( `5C
Xaccess `5C
Xalarm `5C
Xgetcwd `5C
Xgethostname `5C
Xgetpass `5C
Xgetwd `5C
Xkillpg `5C
Xlink `5C
Xmkdir `5C
Xpoll `5C
Xputenv `5C
Xselect `5C
Xsetitimer `5C
Xsetsid `5C
Xsetvbuf `5C
Xsigaction `5C
Xsigprocmask `5C
Xstrchr `5C
Xstrrchr `5C
Xsymlink `5C
Xtcgetattr `5C
Xttyname `5C
Xutime `5C
Xutimes `5C
X$cf_tc_funcs `5C
X)
X
XCF_ANSI_QSORT
X
X###`09Miscellaneous options
Xif test -n "$cf_x_athena" ; then
X    AC_MSG_CHECKING(if you want to use Xaw scrollbars rather than our own)
X    AC_ARG_WITH(Xaw-scrollbars,
X`09`5B  --with-Xaw-scrollbars   use Xaw \150Brather than our own`5D,
X`09`5Bcf_Xaw_scrollbars=$withval`5D,
X`09`5Bcf_Xaw_scrollbars=no`5D)
X    AC_MSG_RESULT($cf_Xaw_scrollbars)
X   `20
X    if test "$cf_Xaw_scrollbars" = no ; then
X`09AC_DEFINE(OPT_KEV_SCROLLBARS)
X`09AC_DEFINE(OPT_KEV_DRAGGING)
X    else
X`09AC_DEFINE(OPT_XAW_SCROLLBARS)
X`09AC_MSG_CHECKING(if you want to use the drag/scrolling extension with Xaw)
X`09AC_ARG_WITH(drag-extension,
X`09    `5B  --with-drag-extension   use drag/scrolling \1F0Awith Xaw`5D,
X`09    `5Bcf_drag_extension=$withval`5D,
X`09    `5Bcf_drag_extension=no`5D)
X`09AC_MSG_RESULT($cf_drag_extension)
X`09if test "$cf_drag_extension" != "no" ; then
X`09    AC_DEFINE(OPT_KEV_DRAGGING)
X`09fi
X    fi
Xfi
X
XAC_MSG_CHECKING(if you want to change the number of exec-macros)
XAC_ARG_WITH(exec-macros,
X`09`5B  --with-exec-macros=N    specify count of numbered \2606`5D,
X`09`5Bcf_exec_macros=$withval`5D,
X`09`5Bcf_exec_macros=no`5D)
XAC_MSG_RESULT($cf_exec_macros)
Xtest "$cf_exec_macros" != no `26`26 AC_DEFINE(OPT_EXEC_MACROS,\340F)
X
X# I don't know of a reliable test for working locale, but we can at least chec
Vk
X# that it is available before offering it as an option.
XAC_CHECK_FUNC(setlocale,`5B
XAC_CHECK_HEADER(locale.h,`5B
XAC_MSG_CHECKING(if you want to use i18n locale support)
XAC_ARG_WITH(locale,
X`09`5B  --with-locale           use i18n support for character-types`5D,
X`09`5Bcf_locale=$withval`5D,
X`09`5Bcf_locale=no`5D)
XAC_MSG_RESULT($cf_locale)
Xtest "$cf_locale" != no `26`26 AC_DEFINE(OPT_LOCALE)
X`5D)`5D)
X
X###`09Debugging/development options
XAC_ARG_WITH(dbmalloc,
X`09`5B  --with-dbmalloc         test: use Conor Cahill's \2A09library`5D,
X`09`5BAC_DEFINE(USE_DBMALLOC)
X`09 LIBS="$LIBS -ldbmalloc"`5D)
X
XAC_ARG_WITH(dmalloc,
X`09`5B  --with-dmalloc          test: use Gray Watson's \2908library`5D,
X`09`5BAC_DEFINE(USE_DMALLOC)
X`09 LIBS="$LIBS -ldmalloc"`5D)
X
XAC_ARG_WITH(no-leaks,
X`09`5B  --with-no-leaks         test: free permanent memory, analyze leaks`5D,
V
X`09`5BAC_DEFINE(NO_LEAKS)`5D)
X
XAC_ARG_WITH(trace,
X`09`5B  --with-trace            test: turn on debug-tracing`5D,
X`09`5BAC_DEFINE(OPT_TRACE)
X`09 EXTRAOBJS="$\0C09 trace.o"`5D)
X
XCFLAGS="$saved_\0F06"
XAC_ARG_WITH(warnings,
X`09`5B  --with-warnings         test: turn on GCC compiler \2C08`5D,
X`09`5Bwith_warnings=$withval`5D)
Xif test -n "$with_warnings"
Xthen
X`09CF_GCC_ATTRIBUTES
X`09CF_GCC_WARNINGS
Xfi
X
X###`09Do these last, since they rely on a properly constructed config.h
X
X###`09Mandatory checks for missing prototypes:
XCHECK_DECL_FLAG="-I. -I$srcdir -Dscrn_chosen"
XVILE_CHECK_HDRS='
X#define CHECK_PROTOTYPES 1
X#include <estruct.h>
X'
XCHECK_DECL_HDRS="$VILE_\1706HDRS"
X
XCF_MISSING_EXTERN( `5C
Xenviron `5C
Xgetenv `5C
Xgetpass `5C
Xgetwd `5C
Xmalloc `5C
Xrealloc `5C
Xrindex `5C
Xstrerror `5C
Xstrtol `5C
X)
X
Xif test -n "$cf_tc_externs"
Xthen
XCHECK_DECL_HDRS="$VILE_\1706HDRS
X#include <tcap.h>
X"
X
Xif test "$termlib" != "none" ; then
X`09CF_TYPE_OUTCHAR
Xfi
XCF_MISSING_EXTERN( `5C
X$cf_tc_externs `5C
X)
Xfi
X
X###`09Optional checks for missing functions (enabled with --with-warnings)
Xif test -n "$with_warnings"
Xthen
XCHECK_DECL_HDRS="$VILE_\1706HDRS"
XCF_MISSING_EXTERN( `5C
X_filbuf `5C
X_flsbuf `5C
Xaccess `5C
Xalarm `5C
Xatoi `5C
Xbzero `5C
Xchdir `5C
Xclose `5C
Xdup `5C
Xexeclp `5C
Xfclose `5C
Xfflush `5C
Xfgetc `5C
Xfileno `5C
Xfork `5C
Xfprintf `5C
Xfputc `5C
Xfputs `5C
Xfread `5C
Xfree `5C
Xfseek `5C
Xfwrite `5C
Xgethostname `5C
Xgetpgrp `5C
Xgetpid `5C
Xgetuid `5C
Xisatty `5C
Xkill `5C
Xkillpg `5C
Xlink `5C
Xlongjmp `5C
Xlstat `5C
Xmemset `5C
Xmkdir `5C
Xmktemp `5C
Xopen `5C
Xperror `5C
Xpipe `5C
Xprintf `5C
Xputs `5C
Xqsort `5C
Xread `5C
Xreadlink `5C
Xselect `5C
Xsetbuf `5C
Xsetbuffer `5C
Xsetitimer `5C
Xsetjmp `5C
Xsetpgrp `5C
Xsetsid `5C
Xsetvbuf `5C
Xsleep `5C
Xsscanf `5C
Xsystem `5C
Xtime `5C
Xunlink `5C
Xutime `5C
Xutimes `5C
Xwait `5C
Xwrite `5C
X)
X
XCHECK_DECL_HDRS="$VILE_\1706HDRS
X#if HAVE_SYS_IOCTL_H
X#include`09<sys/ioctl.h>
X#endif
X"
XCF_MISSING_EXTERN( `5C
Xioctl `5C
X)
Xfi
X
XAC_SUBST(EXTRAOBJS)
X
X###`09output makefile and config.h
XAC_OUTPUT(makefile,,,sort)
$ call unpack [.VILE-8_0]CONFIGURE.IN;1 -
 303116792 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 31 25 152
$!
$ create 'f'
X/*`20
X * config_h.in is a template file used by\2707ure to produce \3C06.h.
X * config_h is then transformed (by\2107.status) into the header file`20
X * config.h.
X * $Header: /usr2/foxharp/src/pgf/vile/RCS/config_h.in,v 1.2 1994/07/11 22:56:
V20 pgf Exp $
X */
X
X@DEFS@
$ call unpack [.VILE-8_0]CONFIG_H.IN;1 -
 1530142864 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 1 26 152
$!
$ create 'f'
X
X
XOnly certain parts of the vile code base are covered by the attached GNU
XGeneral Public License.  In particular, the "configure" script and the
X"configure.in" file from which it is derived are covered.  other parts of
Xthe vile source may be covered in the future.`20
X
Xthe bulk of vile _cannot_ be covered by the GPL due to murky origins and
Xprevious copyrights.  however, the code that i have written (and i suspect
Xthis is true of contributions made by others as well) was written to be
Xpublished, and to be shared with others.  please respect this.  see the top
Xof main.c for the restrictions put on the original MicroEMACS code upon
Xwhich vile was based.`20
X
Xtell you what -- let's consider it BeerWare.  if you really like it, and
Xuse it a lot, and meet one of the vile developers someday, how about if
Xif you offer to buy them a beer.  sound good?
X
XI have been contacted in the past about the legality of _using_ vile for
Xcommercial purposes.  this is fine -- there are no restrictions on such use
X(e.g. using this editor to create proprietary code).  i have also been
Xcontacted about the legality of bundling vile with commercial product
Xreleases.  this issue is a little less clear -- please get in touch with me
Xif you wish to do this.  -pgf, 2/95
X
X--------\0808\1010\2011
X`09`09    GNU GENERAL PUBLIC LICENSE
X`09`09       Version 2, June 1991
X
X Copyright (C) 1989, 1991 Free Software Foundation, Inc.
X        \0808\100A675 Mass Ave, Cambridge, MA 02139, USA
X Everyone is permitted to copy and distribute verbatim copies
X of this license document, but changing it is not allowed.
X
X`09`09`09    Preamble
X
X  The licenses for most software are designed to take away your
Xfreedom to share and change it.  By contrast, the GNU General Public
XLicense is intended to guarantee your freedom to share and change free
Xsoftware--to make sure the s\1B07 is free for all its users.  This
XGeneral Public License applies to most of the Free Software
XFoundation's software and to any other program whose authors commit to
Xusing it.  (Some other Free Software Foundation s\1408is covered by
Xthe GNU Library General Public License instead.)  You can apply it to
Xyour programs, too.
X
X  When we speak of free software, we are referring to freedom, not
+-+-+-+-+-+-+-+-  END  OF PART 39 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 40 -+-+-+-+-+-+-+-+
Xprice.  Our General Public Licenses are designed to make sure that you
Xhave the freedom to distribute copies of free software (and charge for
Xthis service if you wish), that you receive source code or can get it
Xif you want it, that you can change the software or use pieces of it
Xin new free programs; and that you know you can do these things.
X
X  To protect your rights, we need to make restrictions that forbid
Xanyone to deny you these rights or to ask\1B06o surrender the\2607.
XThese restrictions translate to certain responsibilities for you if you
Xdistribute copies of the software, or if you modify it.
X
X  For example, if you distribute copies of such a program, whether
Xgratis or for a fee, you must give the recipients all\1306ights that
Xyou have.  You must make sure that they, too, receive or can get the
Xsource code.  And you must show them these terms so they kn\1E06ir
Xrights.
X
X  We protect your rights with two steps: (1) copyright the software, and
X(2) offer you this license which gives you legal permission to copy,
Xdistribute and/or modify the software.
X
X  Also, for each author's protection and ours, we want to make certain
Xthat everyone understands that there is no warranty for this free
Xsoftware.  If the \1208 is modified by someone else and passed on, we
Xwant its recipients to know that what they have is not the original, so
Xthat any problems introduced by others will not reflect on the original
Xauthors' reputations.
X
X  Finally, any free program is threatened constantly by software
Xpatents.  We wish to avoid the danger that redistributors of a free
Xprogram will individually obtain patent licenses, in effect making the
Xprogram proprietary.  To prevent this, we have made it clear that any
Xpatent must be licensed for everyone's free use or not \2809at all.
X
X  The precise terms and conditions for copying, distribution and
Xmodification follow.
X`0C
X`09`09    GNU GENERAL PUBLIC LICENSE
X   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
X
X  0. This License applies to any program or other work which contains
Xa notice placed by the copyright holder saying it may be distributed
Xunder the terms of this General Public License.  The "Program", below,
Xrefers to any such program or work, and a "work based on the P\2A06"
Xmeans either the Program or any derivative work under copyright law:
Xthat is to say, a work containing the Program or a portion of it,
Xeither verbatim or with modifications and/or translated into another
Xlanguage.  (Hereinafter, translation is included without limit\1F07n
Xthe term "modification".)  Each licensee is addressed as "you".
X
XActivities other than copying, distribution and modifica\1106re not
Xcovered by this License; they are outside its scope.  The act of
Xrunning the Program is not restricted, and the output from \330B
Xis covered only if its contents constitute a work based on the
XProgram (independent of having been made by running the \3807).
XWhether that is true depends on what the Program does.
X
X  1. You may copy and distribute verbatim copies of the Program's
Xsource code as you receive it, in any medium, provided that you
Xconspicuously and appropriately publish on each copy an\260C
Xcopyright notice and disclaimer of warranty; keep intact all the
Xnotices that refer to this License and\1406e absence of any warranty;
Xand give any other recipients of the Program a copy of this License
Xalong with the Program.
X
XYou may charge a fee for the physical act of transferring a copy, and
Xyou may at your option offer warranty protection in exchange for a fee.
X
X  2. You may modify your copy or copies of the Program or any portion
Xof it, thus forming a work based on the Program, and copy and
Xdistribute such modifications or work under the terms of Section 1
Xabove, provided that you also meet all of these conditions:
X
X    a) You must cause the modified files to carry prominent notices
X    stating that you changed the files an\0E06date of any\2607.
X
X    b) You must cause any work that you distribute or publish,\2006in
X    whole or in part contains or is derived from the Program or any
X    part thereof, to be licensed as a whole at no charge to all third
X    parties under the terms of this License.
X
X    c) If the modified program normally reads commands interactively
X    when run, you must cause it, when started running for such
X    interactive use in the most ordinary way, to print or display an
X    announcement including an appropriate copyright notice and a
X    notice that there is no warranty (or else, saying\2B06you provide
X    a warranty) and that users may redistribute the program under
X    these conditions, and telling the user how to view a copy of this
X    License.  (Exception: if the Program itself is interactive but
X    does not normally print such an announcement, your work based on
X    the Program is not required to print an announcement.)
X`0C
XThese requirements apply to the modified work as a whole.  If
Xidentifiable sections of that work are not derived from the Program,
Xand can be reasonably considered independent and separate works in
Xthemselves, then this License, and its terms, do not apply to those
Xsections when you distribute them as separate works.  But\3109
Xdistribute the same sections as part of a whole which is a work based
Xon the Program, the distribution of the whole must be \3607terms of
Xthis License, whose permissions for other l\2506es extend to the
Xentire whole, and thus to each and every part regardless of who wrote it.
X
XThus, it is not the intent of this section to claim rights or contest
Xyour rights to work written entirely by you; rather, the intent is to
Xexercise the right to control the distribution of derivative or
Xcollective works based on the Program.
X
XIn addition, mere aggregation of another work not based on the Program
Xwith the Program (or with a work based on\250C) on a volume of
Xa storage or distribution medium does not bring the other work under
Xthe scope of this License.
X
X  3. You may copy and distribute the Program (or a work based on it,
Xunder Section 2) in object code or executable form \3306the terms of
XSections 1 and 2 above provided that you also do one of the following:
X
X    a) Accompany it with the complete corresponding machine-readable
X    source code, which must be distributed under the terms of Sections
X    1 and 2 above on a medium customarily used for software interchange; or,
X
X    b) Accompany it with a written offer, valid for at least three
X    years, to give any third party, for a charge no more than your
X    cost of physically performing source distribution, a complete
X    machine-readable copy of the corresponding source code, to be
X    distributed under the terms of Sections 1 and 2 above on a medium
X    customarily used for software interchange; or,
X
X    c) Accompany it with the information you received as to the offer
X    to distribute corresponding source code.  (This alternative is
X    allowed only for noncommercial distribution an\2807if you
X    received the program in object code or executable form with such
X    an offer, in accord with Subsection b above.)
X
XThe source code for a work means the preferred form of the work for
Xmaking modifications to it.  For an executable work, complete source
Xcode means all the source code for all modules it contains, plus any
Xassociated interface definition files, plus the scripts used to
Xcontrol compilation and instal\1107of the executable.  However, as a
Xspecial exception, the source code distributed need not include
Xanything that is normally distributed (in either source or binary
Xform) with the major components (compiler, kernel, and so on) of the
Xoperating system on which the executable runs, unless that component
Xitself accompanies the executable.
X
XIf distribution of executable or object code is made by offering
Xaccess to copy from a designated place, then offering equivalent
Xaccess to copy the source code from\1506ame place counts as
Xdistribution of the source code, even though third parties are not
Xcompelled to copy the source along with the object code.
X`0C
X  4. You may not copy, modify, sublicense, or distribute the Program
Xexcept as expressly provided under this License.  Any attempt
Xotherwise to copy, modify, sublicense or distribute the Program is
Xvoid, and will automatically terminate your rights under this License.
XHowever, parties who have received copies, or rights, from you under
Xthis License will not have their l\1C06s terminated so long as such
Xparties remain in full compliance.
X
X  5. You are not required to accept this License, since you have not
Xsigned it.  However, nothing else grants you permission to modify or
Xdistribute the Program or its derivative works.  These actions are
Xprohibited by law if you do not accept this License.  Therefore, by
Xmodifying or distributing the Program (or any work based on the
XProgram), you indicate your acceptance of this License to do so, and
Xall its terms and conditions for copying, distributing or modifying
Xthe Program or works based on it.
X
X  6. Each time you redistribute the Program (or any work based on the
XProgram), the recipient automatically receives a license from the
Xoriginal licensor to copy, distribute or modify the Program subject to
Xthese terms and conditions.  You may not impose any further
Xrestrictions on the recipients' exercise of\1C06ights granted herein.
XYou are not responsible for enforcing compliance by third parties to
Xthis License.
X
X  7. If, as a consequence of a court judgment or allegation of patent
Xinfringement or for any other reason (not limited to patent issues),
Xconditions are imposed on you (whether by court order, agreement or
Xotherwise) that contradict the conditions of this License, they do not
Xexcuse you from the conditions of this License.  If you cannot
Xdistribute so as to satisfy simultaneously your obligations under this
XLicense and any other pertinent obligations, then as a consequence you
Xmay not distribute the Program at all.  For example, if a patent
Xlicense would not permit royalty-free redistribution of the Program by
Xall those who receive copies directly or in\0E09through you, then
Xthe only way you could satisfy both it and this License would be to
Xrefrain entirely from distribution of the Program.
X
XIf any portion of this section is held invalid or unenforceable under
Xany particular circumstance, the balance of the section is intended to
Xapply and the section as a whole is intended to apply in other
Xcircumstances.
X
XIt is not the purpose of this section to induce you\0E06fringe any
Xpatents or other property right claims or to contest validity of any
Xsuch claims; this section has the sole purpose of protecting the
Xintegrity of the free software distribution system, which is
Ximplemented by public license practices.  Many people have made
Xgenerous contributions to the wide range of software dis\2C06ed
Xthrough that system in reliance on consistent application of that
Xsystem; it is up to the author/donor to decide if he or she is willing
Xto distribute software through any other system and a licensee cannot
Ximpose that choice.
X
XThis section is intended to make thoroughly clear what is believed to
Xbe a consequence of the rest\0C06is License.
X`0C
X  8. If the distribution and/or use o\1F06Program is restricted in
Xcertain countries either by patents or by copyrighted interfaces, the
Xoriginal copyright holder who places the Program under this License
Xmay add an explicit geographical distribution limitation excluding
Xthose countries, so that distribution is permitted only in or among
Xcountries not thus excluded.  In such case, this License incorporates
Xthe limitation as if written in the body of this License.
X
X  9. The Free Software Foundation may publish revised and/or new versions
Xof the General Public License from time to time.  Such new versions will
Xbe similar in spirit to the present version, but may differ in detail to
Xaddress new problems or concerns.
X
XEach version is given a distinguishing\2209number.  If the Program
Xspecifies a version number of this License which applies to it and "any
Xlater version", you have the option of following the terms and conditions
Xeither of that version or of any later \1808published by the Free
XSoftware Foundation.  If the Program does not specify a version number of
Xthis License, you may choose any version ever published by the Free Software
XFoundation.
X
X  10. If you wish to incorporate parts of the Program into other free
Xprograms whose distribution conditions are different, write to the author
Xto ask for permission.  For software which is copyrighted by the Free
XSoftware Foundation, write to the Free \2713; we sometimes
Xmake exceptions for this.  Our decision will be guided by the two goals
Xof preserving the free status of all derivatives of our\2607oftware and
Xof promoting the sharing and reuse of software generally.
X
X`09`09`09    NO WARRANTY
X
X  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
XFOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
XOTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
XPROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
XOR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE\2C08 WARRANTIES OF
XMERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
XTO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
XPROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
XREPAIR OR CORRECTION.
X
X  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
XWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
XREDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
XINCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
XOUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
XTO LOSS OF DATA OR\0806BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
XYOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
XPROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
XPOSSIBILITY OF SUCH DAMAGES.
X
X`09`09     END OF TERMS AND CONDITIONS
X`0C
X`09Appendix: How to Apply These Terms to Your New Programs
X
X  If you develop a new program, and you want it to be of the greatest
Xpossible use to the public, the best way to achieve this is to make it
Xfree software which everyone can redistribute and change under these terms.
X
X  To do so, attach the following notices to the program.  It is safest
Xto attach them to the start of each source file to most effectively
Xconvey the exclusion of warranty; and each file should have at least
Xthe "copyright" line and a pointer to where the full notice is found.
X
X    <one line to give the program's name and a brief idea of what it does.>
X    Copyright (C) 19yy  <name of author>
X
X    This program is free software; you can redistribute it and/or modify
X    it under the terms of the GNU General Public License as published by
X    the Free Software Foundation; either version 2 of the License, or
X    (at your option) any later version.
X
X    This program is distributed in the hope that it will be useful,
X    but WITHOUT ANY WARRANTY; without even the implied warranty of
X    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
X    GNU General Public License for more details.
X
X    You should have received a copy of the GNU General Public License
X    along with this program; if not, write to the Free Software
X    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
X
XAlso add information on how to contact you by electronic and paper mail.
X
XIf the program is interactive, make it output a short notice like this
Xwhen it starts in an interactive mode:
X
X    Gnomovision version 69, Copyright (C) 19yy name of author
X    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `60show w'
V.
X    This is free software, and you are welcome to redistribute it
X    under certain conditions; type `60show c' for details.
X
XThe hypothetical commands `60show w' and\0D07c' should show the appropriate
Xparts of the General Public License.  Of course, the commands you use may
Xbe called something other than `60show w' and \0D06c'; they could even be
Xmouse-clicks or menu items--whatever suits your program.
X
XYou should also get your employer (if you work as a programmer) or your
Xschool, if any, to sign a "copyright disclaimer" for the program, if
Xnecessary.  Here is a sample; alter the names:
X
X  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
X  `60Gnomovision' (which makes passes at compilers) written by James Hacker.
X
X  <signature of Ty Coon>, 1 April 1989
X  Ty Coon, President of Vice
X
XThis General Public License does not permit incorporating your program into
Xproprietary programs.  If your\1308 is a subroutine library, you may
Xconsider it more useful to permit linking proprietary applications with the
Xlibrary.  If this is what you want to do, use the GNU L\3606 General
XPublic License instead of this\1808.
$ call unpack [.VILE-8_0]COPYING.;1 -
 237333677 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 40 27 152
$!
$ create 'f'
X/*`09Crypt:`09Encryption routines for MicroEMACS
X *`09`09written by Dana Hoggatt and Daniel Lawrence
X *
X * $Header: /usr/build/vile/vile/RCS/crypt.c,v 1.22 1998/05/13 10:43:06 pgf Ex
Vp $
X *
X */
X
X#ifdef STANDALONE
X# ifndef OPT_ENCRYPT
X#  define OPT_ENCRYPT 1
X# endif
X# define ALLOC_T size_t
X# define ULONG`09unsigned long
X#else
X# include`09"estruct.h"
X# include`09"edef.h"
X#endif
X
X#if`09OPT_ENCRYPT
Xstatic`09int`09mod95 (int val);
X
X#ifdef STANDALONE
X
X#ifdef HAVE_CONFIG_H
X#include "config.h"
X#else
X/* assume ANSI C */
X#define HAVE_STDLIB_H 1
X#endif
X
X#include <sys/types.h>`09`09/* sometimes needed to get size_t */
X
X#if HAVE_STDLIB_H
X#include <stdlib.h>
X#endif
X
X#ifdef HAVE_UNISTD_H
X#include <unistd.h>
X#endif
X
X#if STDC_HEADERS `7C`7C HAVE_STRING_H
X# include <string.h>
X  /* An ANSI string.h and pre-ANSI memory.h might conflict.  */
X# if !STDC_HEADERS `26`26 HAVE_MEMORY_H
X#  include <memory.h>
X# endif /* not STDC_HEADERS and HAVE_MEMORY_H */
X#else /* not STDC_HEADERS and not HAVE_STRING_H */
X# if HAVE_STRINGS_H
X#  include <strings.h>
X  /* memory.h and strings.h conflict on some systems */
X  /* FIXME: should probably define memcpy and company in terms of bcopy,
X     et al here */
X# endif
X#endif /* not STDC_HEADERS and not HAVE_STRING_H */
X
X#include <stdio.h>
X#include <ctype.h>
X
Xextern`09int`09ue_makekey (char *key, ALLOC_T len);
Xextern`09void`09ue_crypt (char *bptr, ALLOC_T len);
X
Xstatic void
Xfailed(const char *s)
X`7B
X`09perror(s);
X`09exit(1);
X`7D
X
X
Xstatic void
Xfilecrypt(FILE *ifp, char *key, int mailmode)
X`7B
X
X    char buf`5B5000`5D;
X    char *p;
X
X    ue_crypt((char *)0, 0);
X    ue_crypt(key, strlen(key));
X
X    while (1) `7B
X`09p = fgets( buf, sizeof(buf), ifp);
X`09if (!p) `7B
X`09    if (ferror(ifp))
X`09`09failed("reading file");
X`09    if (feof(ifp))
X`09`09break;
X`09`7D
X`09if (mailmode) `7B
X`09    if (strcmp(buf, "`5Cn") == 0)
X`09`09mailmode = 0;
X`09`7D
X`09if (!mailmode)
X`09    ue_crypt(buf, strlen(buf));
X`09if (fputs(buf, stdout) == EOF)
X`09    failed("writing stdout");
X    `7D
X
X    if (fflush(stdout))
X`09failed("flushing stdout");
X
X
X`7D
X
Xint
Xmain(int argc, char **argv)
X`7B
X`09char key`5B256`5D;
X`09char *prog = argv`5B0`5D;
X`09int mailmode = 0;
X
X`09key`5B0`5D = 0;
X
X`09/* -m for mailmode:  leaves headers intact (up to first blank line)
X`09 * then crypts the rest.  i use this for encrypting mail messages
X`09 * in mh folders.  */
X`09if (argc > 1 `26`26 strcmp(argv`5B1`5D, "-m") == 0) `7B
X`09    mailmode = 1;
X`09    argc -= 1;
X`09    argv += 1;
X`09`7D
X`09if (argc > 2 `26`26 strcmp(argv`5B1`5D, "-k") == 0) `7B
X`09    if (strlen(argv`5B2`5D) > sizeof(key) - 1) `7B
X`09`09fprintf(stderr, "%s: excessive key length`5Cn", prog);
X`09`09exit(1);
X`09    `7D
X`09    (void)strncpy(key, argv`5B2`5D, sizeof(key));
X`09    (void)memset(argv`5B2`5D, '.', strlen\1508));
X`09    key`5Bsizeof(key)-1`5D = '`5C0';
X`09    argc -= 2;
X`09    argv += 2;
X`09`7D
X`09if (argc > 1 `26`26 argv`5B1`5D`5B0`5D == '-') `7B
X`09    fprintf(stderr,
X`09`09"usage: %s `5B-m`5D `5B-k crypt-key`5D `5Bfile ...`5D`5Cn"
X`09`09"  where crypt-key will be prompted for if not specified`5Cn"
X`09`09"  and -m will force `5C"mail-mode`5C", which leaves text before`5Cn"
X`09`09"  the first empty line of a file (i.e. headers) intact.`5Cn",
X`09`09prog
X`09    );
X`09    exit(1);
X`09`7D
X`09if (!key`5B0`5D) `7B
X#if HAVE_GETPASS
X`09    char *userkey;
X`09    userkey = getpass("Enter key: ");
X
X`09    /* HACK -- the linux version of getpass is not
X`09     * interruptible.  this means there's no way to abort
X`09     * a botched passwd.  until this problem goes away (and
X`09     * i do believe it's a bug, and i'm not planning on
X`09     * providing our own getpass()) we'll just see if the last
X`09     * char of the entered key is `5EC, and consider it an abort
X`09     * if so.  yes, this should really be the INTR char.
X`09     */
X`09    if (userkey`5Bstrlen\0F08)-1`5D == 3) `7B
X`09`09fprintf(stderr,"Aborted`5Cn");
X`09`09exit(1);
X`09    `7D
X`09    (void)strncpy(key, userkey, sizeof(key));
X`09    (void)memset(userkey, '.', strlen\1508));
X#else
X`09    fprintf(stderr,
X`09`09"usage: %s `5B-m`5D -k crypt-key `5Bfile ...`5D`5Cn"
X`09`09"  where '-k crypt-key' is required (no prompting on this system)`5Cn"
X`09`09"  and -m will force `5C"mail-mode`5C", which leaves text before`5Cn"
X`09`09"  the first empty line of a file (i.e. headers) intact.`5Cn",
X`09`09prog
X`09    );
X`09    exit(1);
X#endif
X`09`7D
X
X`09if (argc > 1) `7B
X`09`09int n;
X`09`09for (n = 1; n < argc; n++) `7B
X`09`09`09FILE *fp = fopen(argv`5Bn`5D, "r");
X`09`09`09if (fp == 0)
X`09`09&0209failed(argv`5Bn`5D);
X`09`09`09filecrypt(fp, key, mailmode);
X`09`09`09(void)fclose(fp);
X`09`09`7D
X`09`7D else `7B
X`09`09filecrypt(stdin, key, mailmode);
X`09`7D
X`09exit(0);
X`7D
X
X#else /* STANDALONE */
X
Xint
Xue_makekey(`09`09`09/* make encryption key */
Xchar`09*key,`09`09`09/* where to write key */
XALLOC_T`09len)
X`7B
X`09register int status;`09/* return\1207 */
X`09int odisinp = \0906;`09/* original value of\1D07 */
X`09char`09temp`5BNPAT`5D;
X
X`09/* turn command input echo off */
X`09disinp = FALSE;
X
X`09/* get the string to use as an encryption \1F07*/
X`09temp`5B0`5D = EOS;
X`09status = mlreply("Encryption String: ", temp, (int)len-1);
X`09disinp = o\0A06;
X
X        if (status == TRUE) `7B
X`09`09(void)strcpy(key, temp);
X
X`09`09/* and encrypt it */
X`09`09ue_crypt((char *)0, 0);
X`09`09ue_crypt(key, strlen(key));
X`09`7D
X`09mlerase();`09`09/* clear it off the bottom line */
X`09return(status);
X`7D
X
X/* ARGSUSED */
Xint
Xue_setkey(`09`09/* reset encryption key of current buffer */
Xint f GCC_UNUSED,`09/* default flag */
Xint n GCC_UNUSED)`09/* numeric argument */
X`7B
X`09register int s = ue_makekey(curbp->b_key, NPAT);
X
X`09if (s == FALSE) `7B
X`09`09if (curbp->b_key`5B0`5D != EOS) `7B
X`09`09`09s = mlyesno("Discard encryption key");
X`09`09`09if (s == TRUE) `7B
X`09`09&0209curbp->b_key`5B0`5D = EOS;
X`09`09&0209make_local_b_val(curbp, MDCRYPT);
X`09`09&0209set_b_val(curbp, MDCRYPT, FALSE);
X`09`09&0209curwp->w_flag `7C= WFMODE;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09return (s);
X`7D
X
X#endif /* STANDALONE */
X
X/**********
X *
X *`09ue_crypt - in place encryption/de\0B08 of a buffer
X *
X *`09(C) Copyright 1986, Dana L. Hoggatt
X *`091216, Beck Lane, Lafayette, IN
X *
X *`09When consulting directly with the author of this routine,
X *`09please refer to this routine as the "DLH-POLY-86-B CIPHER".
X *
X *`09This routine was written for Dan Lawrence, for use in V3.8 of
X *`09MicroEMACS, a public domain text/program editor.
X *
X *`09I kept the following goals in mind when preparing this function:
X *
X *`09    1.`09All printable characters were to be encrypted back
X *`09`09into the printable range, control characters and
X *`09`09high-bit characters were to remain unaffected.  this
X *`09`09way, encrypted would still be just as cheap to
X *`09`09transmit down a 7-bit data path as they were before.
X *
X *`09    2.`09The encryption had to be portable.  \240Bed
X *`09`09file from one computer should be able to be decrypted
X *`09`09on another computer.
X *
X *`09    3.`09The encryption had to be inexpensive, both in terms
X *`09`09of speed and space.
X *
X *`09    4.`09The system needed to be secure against all but the
X *`09`09most determined of attackers.
X *
X *`09For encryption of a block of data, one calls crypt passing
X *`09a pointer to the data block and its length. T\1F0Eis
X *`09encrypted in place, that is, the \210Aoutput overwrites
X *`09the input.  Decryption is totally isomorphic, and is performed
X *`09in the same manner by\130Aroutine.
X *
X *`09Before using this routine for encrypting data, you are expected
X *`09to specify an encryption key.  This key is an arbitrary string,
X *`09to be supplied by the user.  To set the key takes two calls to
X *`09ue_crypt().  First, you call
X *
X *`09`09ue_crypt(NULL, vector)
X *
X *`09This resets all internal control information.  Typically (and
X *`09specifically in the case on MICRO-emacs) you would use a "vector"
X *`09of 0.  Other values can be used to customize your editor to be
X *`09"incompatible" with the normally distributed version.  For
X *`09this purpose, the best results will be obtained by avoiding
X *`09multiples of 95.
X *
X *`09Then, you "encrypt" your password by calling
X *
X *`09`09ue_crypt(pass, strlen(pass))
X *
X *`09where "pass" is your password string.  Crypt() will destroy
X *`09the original copy of the password (it becomes encrypted),
X *`09which is good.  You do not want someone on a multiuser system
X *`09to peruse your memory space and bump into your password.
X *`09Still, it is a better idea to erase the password buffer to
X *`09defeat memory perusal by a more technical snooper.
X *
X *`09For the interest of cryptologists, at the heart of this
X *`09function is a Beaufort Cipher.  The cipher alphabet is the
X *`09range of printable characters (' ' to '`7E'), all "control"
X *`09and "high-bit" characters are left unaltered.
X *
X *`09The key is a variant autokey, derived from a weighted sum
X *`09of all the previous clear text and ciphe\1006.  A counter
X *`09is used as salt to obliterate any simple cyclic behavior
X *`09from the clear text, and key feedback is used to assure
X *`09that the entire message is based on the original key,
X *`09preventing attacks on the last part of the message as if
X *`09it were a pure autokey system.
X *
X *`09Overall security of encrypted data depends upon three
X *`09factors:  the fundamental cryptographic system must be
X *`09difficult to compromise; exhaustive searching of the key
X *`09space must be computationally expensive; keys and plaintext
X *`09must remain out of sight.  This system satisfies this set
X *`09of conditions to within the degree desired for MicroEMACS.
X *
X *`09Though direct methods of attack (against systems such as
X *`09this) do exist, they are not well known and will consume
X *`09considerable amounts of computing time.  An exhaustive
X *`09search requires over a billion investigations, on average.
X *
X *`09The choice, entry, storage, manipulation, alteration,
X *`09protection and security of the keys themselves are the
X *`09responsibility of the user.
X *
X **********/
X
Xvoid
Xue_crypt(
Xregister char *bptr,`09/* buffer of characters to be encrypted */
Xregister ALLOC_T len)`09/* number of characters in the buffer */
X`7B
X`09register int cc;`09/* current character being considered */
X
X`09static ULONG key = 0;`09/* 29 bit encipherment key */
X`09static int salt = 0;`09/*\0D06to spice up key with */
X
X`09if (!bptr) `7B`09`09/* is there anything here to encrypt? */
X`09`09key = len;`09/* set the new key */
X`09`09salt = len;`09/* set the new salt */
X`09`09return;
X`09`7D
X`09while (len--) `7B`09`09/* for every character in the buffer */
X
X`09`09cc = *bptr;`09/* get a character out of the buffer */
X
X`09`09/* only encipher printable characters */
X`09`09if ((cc >= ' ') `26`26 (cc <= '`7E')) `7B
X
X/**  If the upper bit (bit 29) is set, feed it back into the key.  This
X`09assures us that the starting key affects the entire message.  **/
X
X`09`09`09key `26= 0x1FFFFFFFL;`09/* strip off overflow */
X`09`09`09if (key `26 0x10000000L) `7B
X`09`09&0209key `5E= 0x0040A001L;`09/* feedback */
X`09`09`09`7D
X
X/**  Down-bias the character, perform a Beaufort encipherment, and
X`09up-bias the character again.  We want key to be positive
X`09so that the left shift here will be more portable and the
X`09mod95() faster   **/
X
X`09`09`09cc = mod95((int)(key % 95) - (cc - ' ')) + ' ';
X
X/**  the salt will spice up the key a little bit, helping to obscure
+-+-+-+-+-+-+-+-  END  OF PART 40 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 41 -+-+-+-+-+-+-+-+
X`09any patterns in the clear text, particularly when all the
X`09characters (or long sequences of them) are the same.  We do
X`09not want the salt to go negative, or it will affec\2B06key
X`09too radically.  It is always a good idea to chop off cyclics
X`09to prime values.  **/
X
X`09`09`09if (++salt >= 20857) `7B`09/* prime modulus */
X`09`09&0209salt = 0;
X`09`09`09`7D
X
X/**  our autokey (a special case of the running key) is being
X`09generated by a weighted checksum of clear text, cipher
X`09text, and salt.   **/
X
X`09`09`09key = key +\0606 cc + *bptr + salt;
X`09`09`7D
X`09`09*bptr++ = cc;`09/* put character back into buffer */
X`09`7D
X`09return;
X`7D
X
Xstatic int mod95(register int val)
X`7B
X`09/*  The mathematical MOD does not match the computer MOD  */
X
X`09/*  Yes, what I do here may look strange, but it gets the
X`09`09job done, and portably at that.  */
X
X`09while (val >= 9500)
X`09`09val -= 9500;
X`09while (val >= 950)
X`09`09val -= 950;
X`09while (val >= 95)
X`09`09val -= 95;
X`09while (val < 0)
X`09`09val += 95;
X`09return (val);
X`7D
X#endif
$ call unpack [.VILE-8_0]CRYPT.C;1 -
 1295013829 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 24 28 152
$!
$ create 'f'
X/* These functions perform vi's on-this-line character scanning\370A.
X * written for vile: Copyright (c) 1990, 1995 by Paul Fox
X *
X * $Header: /usr/build/vile/vile/RCS/csrch.c,v 1.28 1998/04/28 10:16:08 tom Ex
Vp $
X *
X*/
X
X#include "estruct.h"
X#include "edef.h"
X
Xstatic USHORT lstscan;
Xstatic int   lstchar;
X#define BACK 0
X#define FORW 1
X#define DIREC 1
X
X#define F 0
X#define T 2
X#define TYPE 2
X
Xstatic int
Xfscan(int f, int n\0706c)
X`7B
X`09int i;
X`09int doto;
X
X`09if (!f `7C`7C n <= 0)
X`09`09n = 1;
X
X`09lstchar = c;
X`09lstscan = FORW;
X
X`09doto = DOT.o;
X
X`09i = doto+1;
X`09while(i < llength(DOT.l)) `7B
X`09`09if ( c == lgetc(DOT.l,i)) `7B
X`09`09`09doto = i;
X`09`09`09n--;
X`09`09`09if (!n) break;
X`09`09`7D
X`09`09i++;
X`09`7D
X
X`09if ( i == llength(DOT.l)) `7B
X`09`09return(FALSE);
X`09`7D
X`09if (doingopcmd `26`26 !doingsweep)
X`09`09doto++;
X`09else if (doingsweep)
X`09`09sweephack = TRUE;
X
X`09DOT.o = doto;
X`09curwp->w_flag `7C= WFMOVE;
X`09return(TRUE);
X
X`7D
X
Xstatic int
Xbscan(int f, int n\0706c)
X`7B
X`09int i;
X`09int doto;
X
X`09if (!f `7C`7C n <= 0)
X`09`09n = 1;
X
X`09lstchar = c;
X`09lstscan = BACK;
X
X`09doto = DOT.o;
X
X`09i = doto-1;
X`09while(i >= w_left_margin(curwp)) `7B
X`09`09if ( c == lgetc(DOT.l,i)) `7B
X`09`09`09doto = i;
X`09`09`09n--;
X`09`09`09if (!n) break;
X`09`09`7D
X`09`09i--;
X`09`7D
X
X`09if ( i < w_left_margin(curwp) ) `7B
X`09`09return(FALSE);
X`09`7D
X
X`09DOT.o = doto;
X`09curwp->w_flag `7C= WFMOVE;
X`09return(TRUE);
X
X`7D
X
Xstatic int
Xget_csrch_char(int *cp)
X`7B
X`09int c;
X
X`09if (clexec `7C`7C isnamedcmd) `7B
X`09`09int status;
X`09`09static char cbuf`5B2`5D;
X`09`09if ((status=mlreply("Scan for: ", cbuf, 2)) != TRUE)
X`09`09`09return status;
X`09`09c = cbuf`5B0`5D;
X`09`7D else `7B
X`09`09c = keystroke();
X`09`09if (c == quotec)
X`09`09`09c = keystroke_raw8();
X`09`09else if (ABORTED(c))
X`09`09`09return FALSE;
X`09`7D
X
X`09*cp = c;
X`09return TRUE;
X`7D
X
X/* f */
Xint
Xfcsrch(int f, int n)
X`7B
X`09int c, s;
X
X`09s = get_csrch_char(`26c);
X`09if (s != TRUE)
X`09`09return s;
X
X`09return(fscan(f,n,c));
X`7D
X
X/* F */
Xint
Xbcsrch(int f, int n)
X`7B
X`09int c, s;
X
X`09s = get_csrch_char(`26c);
X`09if (s != TRUE)
X`09`09return s;
X
X`09return(bscan(f,n,c));
X`7D
X
X/* t */
Xint
Xfcsrch_to(int f, int n)
X`7B
X`09int s;
X`09s = fcsrch(f,n);
X`09if (s == TRUE)
X`09`09s = backchar(FALSE,1);
X`09lstscan `7C= T;
X`09return(s);
X`7D
X
X/* T */
Xint
Xbcsrch_to(int f, int n)
X`7B
X`09int s;
X`09s = bcsrch(f,n);
X`09if (s == TRUE)
X`09`09s = forwchar(FALSE,1);
X`09lstscan `7C= T;
X`09return(s);
X`7D
X
X/* ; */
Xint
Xrep_csrch(int f, int n)
X`7B
X`09int s;
X`09USHORT ls = lstscan;
X
X`09if ((ls `26 DIREC) == FORW) `7B
X`09`09s = fscan(f,n,lstchar);
X`09`09if ((ls `26 TYPE) == T) `7B
X`09`09`09if (s == TRUE)
X`09`09&0209s = backchar(FALSE,1);
X`09`09`09lstscan `7C= T;
X`09`09`7D
X`09`09return(s);
X`09`7D else `7B
X`09`09s = bscan(f,n,lstchar);
X`09`09if ((ls `26 TYPE) == T) `7B
X`09`09`09if (s == TRUE)
X`09`09&0209s = forwchar(FALSE,1);
X`09`09`09lstscan `7C= T;
X`09`09`7D
X`09`09return(s);
X`09`7D
X`7D
X
X/* , */
Xint
Xrev_csrch(int f, int n)
X`7B
X`09int s;
X
X`09lstscan `5E= DIREC;
X`09s = rep_csrch(f,n);
X`09lstscan `5E= DIREC;
X`09return(s);
X`7D
$ call unpack [.VILE-8_0]CSRCH.C;1 -
 71954594 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 6 29 152
$!
$ create 'f'
X#
X# VMS makefile for vile.  Requires "MMS"
X#
X# Tested with:
X#`09VMS system version 5.4-2
X#`09MMS version 2.6
X#`09VAX-C version 3.2
X#
X# To change screen driver modules,\1E08SCREEN and SCRDEF below, OR edit
X# estruct.h to make sure the correct one is #defined as "1", and the others
X# all as "0".  If you use tcap.c, you'll need libtermcap.a too\320D
X# x11.c, you'll need libX11.a too.
X#
X# $Header: /usr/build/vile/vile/RCS/descrip.mms,v 1.35 1997/11/26 16:16:06 tom
V Exp $
X
X# for building the X version, xvile, use these:
X#SCREEN = x11simp
X#LIBS = #-lX11
X#TARGET = xvile.exe
X#SCRDEF = "DISP_X11","scrn_chosen"
X
X# for building the X-toolkit version:
X#SCREEN = x11
X#LIBS = #-lX11
X#TARGET = xvile.exe
X#SCRDEF = "NO_WIDGETS","XTOOLKIT","DISP_X11","scrn_chosen"
X
X# for building the Motif version (untested):
X.IFDEF __XVILE__
XSCREEN = x11
XLIBS = #-lX11
XTARGET = xvile.exe
XSCRDEF = "MOTIF_WIDGETS","XTOOLKIT","DISP_X11","scrn_chosen"
X.ELSE
X# for regular vile, use these:
XSCREEN = vmsvt
XLIBS =
XTARGET = vile.exe
XSCRDEF = "DISP_VMSVT","scrn_chosen"
X.ENDIF
X
XLINKFLAGS = /MAP=$(MMS$TARGET_NAME)/CROSS_REFERENCE/EXEC\2813.EXE
X
XINCS = `5B`5D
X
XMKTBLS = mktbls.EXE
X
X
XSRC =`09main.c `5C
X`09$(SCREEN).c `5C
X`09basic.c `5C
X`09bind.c `5C
X`09btree.c `5C
X`09buffer.c `5C
X`09crypt.c `5C
X`09csrch.c `5C
X`09display.c `5C
X`09dumbterm.c `5C
X`09eval.c `5C
X`09exec.c `5C
X`09externs.c `5C
X`09fences.c `5C
X`09file.c `5C
X`09filec.c `5C
X`09fileio.c `5C
X`09finderr.c `5C
X`09glob.c `5C
X`09globals.c `5C
X`09history.c `5C
X`09input.c `5C
X`09insert.c `5C
X`09itbuff.c `5C
X`09isearch.c `5C
X`09line.c `5C
X`09map.c `5C
X`09menu.c `5C
X`09modes.c `5C
X`09msgs.c `5C
X`09npopen.c `5C
X`09oneliner.c `5C
X`09opers.c `5C
X`09path.c `5C
X`09random.c `5C
X`09regexp.c `5C
X`09region.c `5C
X`09search.c `5C
X`09select.c `5C
X`09spawn.c `5C
X`09tags.c `5C
X`09tbuff.c `5C
X`09termio.c `5C
X`09undo.c `5C
X`09version.c `5C
X`09vms2unix.c `5C
X`09vmspipe.c `5C
X`09window.c `5C
X`09word.c `5C
X`09wordmov.c
X
XOBJ =`09main.obj,`5C
X`09$(SCREEN).obj,`5C
X`09basic.obj,`5C
X`09bind.obj,`5C
X`09btree.obj,`5C
X`09buffer.obj,`5C
X`09crypt.obj,`5C
X`09csrch.obj,`5C
X`09display.obj,`5C
X`09dumbterm.obj,`5C
X`09eval.obj,`5C
X`09exec.obj,`5C
X`09externs.obj,`5C
X`09fences.obj,`5C
X`09file.obj,`5C
X`09filec.obj,`5C
X`09fileio.obj,`5C
X`09finderr.obj,`5C
X`09glob.obj, `5C
X`09globals.obj,`5C
X`09history.obj,`5C
X`09input.obj,`5C
X`09insert.obj,`5C
X`09itbuff.obj,`5C
X`09isearch.obj,`5C
X`09line.obj,`5C
X`09map.obj, `5C
X`09menu.obj,`5C
X`09modes.obj,`5C
X`09msgs.obj,`5C
X`09npopen.obj,`5C
X`09oneliner.obj,`5C
X`09opers.obj,`5C
X`09path.obj,`5C
X`09random.obj,`5C
X`09regexp.obj,`5C
X`09region.obj,`5C
X`09search.obj,`5C
X`09select.obj,`5C
X`09spawn.obj,`5C
X`09tags.obj,`5C
X`09tbuff.obj,`5C
X`09termio.obj,`5C
X`09undo.obj,`5C
X`09version.obj, `5C
X`09vms2unix.obj,`5C
X`09vmspipe.obj,`5C
X`09window.obj,`5C
X`09word.obj,`5C
X`09wordmov.obj
X
Xall :
X
X        $(MMS)$(MMSQUALIFIERS) $(TARGET)
X
X#
X# I've built on an Alpha with CC_OPTIONS set to
X#`09CC_OPTIONS = /STANDARD=VAXC`09`09(for VAX-C compatibility)
X#`09CC_OPTIONS = /PREFIX_LIBRARY_ENTRIES=ALL\0C08`09(DEC-C)
X# The latter (DEC-C) gives better type-checking -- T.Dickey
X#
X.IFDEF __ALPHA__
XCC_OPTIONS = /PREFIX_LIBRARY_ENTRIES=ALL\0C08
XCC_DEFS = ,HAVE_ALARM
X.ELSE
X.IFDEF __DECC__
XCC_OPTIONS = /DECC /PREFIX_LIBRARY_ENTRIES=ALL\0C08
XCC_DEFS = ,HAVE_ALARM
X.ELSE
XCC_OPTIONS =
XCC_DEFS = ,HAVE_SYS_ERRLIST
X.ENDIF
X.ENDIF
X
Xnebind.h `5C
Xnefkeys.h `5C
Xnefunc.h `5C
Xnename.h :`09cmdtbl $(MKTBLS)
X`09MKTBLS cmdtbl
X
Xnevars.h `5C
Xnemode.h :`09modetbl $(MKTBLS)
X`09MKTBLS modetbl
X
X# install to DESTDIR1 if it's writable, else\20082
Xinstall :
X`09@ WRITE SYS$ERROR "** no rule for $@"
X`09
Xclean :
X`09@- if f$search("*.obj") .nes. "" then delete *.obj;*
X`09@- if f$search("*.bak") .nes. "" then delete *.bak;*
X`09@- if f$search("*.lis") .nes. "" then delete *.lis;*
X`09@- if f$search("*.log") .nes. "" then delete *.log;*
X`09@- if f$search("*.map") .nes. "" then delete *.map;*
X`09@- if f$search("*.opt") .nes. "" then delete *.opt;*
X`09@- if f$search("ne*.h") .nes. "" then delete ne*.h;*
X`09@- if f$search("$(MKTBLS)") .nes. "" then delete \2109;
X
Xclobber : clean
X`09@- if f$search("vile.com") .nes. "" then delete \2008;*
X`09@- if f$search("xvile.com") .nes. "" then delete \2109;*
X`09@- if f$search("*.exe") .nes. "" then delete *.exe;*
X
X$(OBJ) : estruct.h nemode.h nefkeys.h edef.h proto.h
X
Xbind.obj :`09nefunc.h
Xeval.obj :`09nevars.h
Xexec.obj :`09nefunc.h
Xexterns.obj :`09nebind.h nename.h neproto.h nefunc.h
Xfilec.obj :`09dirstuff.h
Xglob.obj :`09dirstuff.h
Xglobals.obj :`09nefunc.h
Xmain.obj :`09chgdfunc.h nevars.h
Xmodes.obj :`09chgdfunc.h
Xopers.obj :`09nefunc.h
Xpath.obj :`09dirstuff.h
Xrandom.obj :`09nefunc.h
Xselect.obj :`09nefunc.h
Xspawn.obj :`09nefunc.h
Xtermio.obj :`09nefunc.h
Xversion.obj :`09patchlev.h
Xvms2unix.obj :`09dirstuff.h
Xword.obj :`09nefunc.h
X
X.first :
X`09@ MKTBLS :== $SYS$DISK:'F$DIRECTORY()$(\2506)`09! make a foreign command
X
X.last :
X`09@- if f$search("*.dia") .nes. "" then delete *.dia;*
X`09@- if f$search("*.lis") .nes. "" then purge *.lis
X`09@- if f$search("*.obj") .nes. "" then purge *.obj
X`09@- if f$search("*.map") .nes. "" then purge *.map
X`09@- if f$search("*.exe") .nes. "" then purge *.exe
X`09@- if f$search("*.log") .nes. "" then purge *.log
X`09@- if f$search("*.opt") .nes. "" then purge *.opt
X
X# used /G_FLOAT with vaxcrtlg/share in vms_link.opt
X# can also use /Debug /Listing, /Show=All
XCFLAGS =-
X`09$(CC_OPTIONS)/Diagnostics /Define=("os_chosen",$(SCRDEF)$(CC_DEFS)) -
X`09/Object=$@ /Include=($(INCS))`20
X
X.C.OBJ :
X`09$(CC) $(CFLAGS) $(MMS$SOURCE)
X`09@- delete $(MMS$TARGET_NAME).dia;*
X
X$(MKTBLS) : mktbls.obj $(OPTFILE)
X`09$(LINK) \0806FLAGS) mktbls.obj $(OPTIONS)
X
X$(TARGET) : $(OBJ), vms_link.opt, descrip.mms $(OPTFILE)
X`09$(LINK) \0806FLAGS) main.obj, $(SCREEN)\0F06vms_link/opt`20
X
Xvms_link.opt :
X`09@vmsbuild vms_link_opt
X
X# Runs VILE from the current directory (used for testing)
Xvile.com :
X`09@- if "''f$search("$@")'" .nes. "" then delete $@;*
X`09@- copy nl: $@
X`09@ open/append  test_script $@
X`09@ write test_script "$ temp = f$environment(""procedure"")"
X`09@ write test_script "$ temp =\0706-"
X`09@ write test_script "`09`09- f$parse(temp,,,""version"",""syntax_only"") -"
V
X`09@ write test_script "`09`09- f$parse(temp,,,""type"",""syntax_only"")"
X`09@ write test_script "$ vile :== $ 'temp'.exe"
X`09@ write test_script "$ define/user_mode sys$input  sys$command"
X`09@ write test_script "$ define/user_mode sys$output sys$command"
X`09@ write test_script "$ vile 'p1 'p2 'p3 'p4 'p5 'p6 'p7 'p8"
X`09@ close test_script
X`09@ write sys$output "** made $@"
X
X# Runs XVILE from the current directory (used for testing)
Xxvile.com :
X`09@- if "''f$search("$@")'" .nes. "" then delete $@;*
X`09@- copy nl: $@
X`09@ open/append  test_script $@
X`09@ write test_script "$ temp = f$environment(""procedure"")"
X`09@ write test_script "$ temp =\0706-"
X`09@ write test_script "`09`09- f$parse(temp,,,""name"",""syntax_only"") -"
X`09@ write test_script "`09`09- f$parse(temp,,,""version"",""syntax_only"") -"
V
X`09@ write test_script "`09`09- f$parse(temp,,,""type"",""syntax_only"")"
X`09@ write test_script "$ xvile :== $ 'temp'xvile.exe"
X`09@ write test_script "$ define/user_mode sys$input  sys$command"
X`09@ write test_script "$ define/user_mode sys$output sys$command"
X`09@ write test_script "$ xvile 'p1 'p2 'p3 'p4 'p5 'p6 'p7 'p8"
X`09@ close test_script
X`09@ write sys$output "** made $@"
X
$ call unpack [.VILE-8_0]DESCRIP.MMS;1 -
 759964033 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 15 30 152
$!
$ create 'f'
X/*
X *`09dirstuff.h
X *
X *`09Definitions to interface to unix-like DIRECTORY(3) procedures.
X *`09Include this after "estruct.h"
X *
X * $Header: /usr/build/vile/vile/RCS/dirstuff.h,v 1.23 1996/11/07 02:00:25 tom
V Exp $
X *
X */
X
X#ifndef DIRSTUFF_H
X#define DIRSTUFF_H
X
X#if ! SYS_VMS
X
X#define USE_LS_FOR_DIRS 0
X#define OLD_STYLE_DIRS 0`09/* e.g., pre-SysV.2 14-char names */
X
X#if DIRNAMES_NOT_NULL_TERMINATED
X/* rumor has it that some early readdir implementations didn't null-terminate
V
X   the d_name array, and on those you _have_ to use d_namlen to get
X   the length.  most modern dirent structs are null-terminated, however. */
X#define USE_D_NAMLEN 1
X#endif
X
X#if _POSIX_VERSION `7C`7C HAVE_DIRENT_H &027C CC_TURBO\0C07WATCOM\1907DJGPP`20
V&027C SYS_OS2
X# if CC_WATCOM `7C`7C CC_CSETPP
X#   include <direct.h>
X# else
X#   include <dirent.h>
X# endif
X# define`09DIRENT`09struct dirent
X#else`09/* apollo `26 other old bsd's */
X# define`09DIRENT`09struct direct
X# define USE_D_NAMLEN 1
X# if HAVE_SYS_NDIR_H
X#  include <sys/ndir.h>
X# else
X#  if HAVE_SYS_DIR_H
X#   include <sys/dir.h>
X#  else
X#   if HAVE_NDIR_H
X#    include <ndir.h>
X#   else
X#    if SYS_WINNT
X#     if CC_MSVC
X#      include <direct.h>
X#     else
X#      include <dirent.h>
X#     endif
X#     undef USE_D_NAMLEN
X#     define USE_D_NAMELEN 0
X      struct direct `7B
X`09char *d_name;
X      `7D;
X      struct _dirdesc `7B
X`09HANDLE hFindFile;
X`09WIN32_FIND_DATA ffd;
X`09int first;
X`09struct direct de;
X      `7D;
X
X      typedef struct _dirdesc DIR;
X
X#    else /* SYS_WINNT */
X#     undef USE_LS_FOR_DIRS
X#     define USE_LS_FOR_DIRS 1
X#     undef USE_D_NAMLEN
X#     define USE_D_NAMELEN 1
X#    endif /* SYS_WINNT */
X#   endif
X#  endif
X# endif
X#endif
X
X#else /* SYS_VMS */
X
X#include`09<rms.h>
X#include`09<descrip.h>
X
X#define USE_D_NAMLEN 1
X
Xtypedef struct`09`7B
X`09ULONG`09d_ino;
X`09short`09d_reclen;
X`09short`09d_namlen;
X`09char`09d_name`5BNAM$C_MAXRSS`5D;`09`09/* result: SYS$SEARCH */
X`09`7D DIRENT;
X
Xtypedef`09struct`09`7B
X`09DIRENT`09`09dd_ret;
X`09struct`09FAB`09dd_fab;
X`09struct`09NAM`09dd_nam;
X`09char`09`09dd_esa`5BNAM$C_MAXRSS`5D;`09/* expanded: SYS$PARSE */
X`09`7D DIR;
X
X#endif`09/* SYS_VMS */
X
X#if USE_LS_FOR_DIRS
X#define`09DIR`09FILE
Xtypedef`09struct`09`7B
X`09char`09d_name`5BNFILEN`5D;
X`09`7D DIRENT;
X#endif
X
X#if SYS_WINNT `26`26 !CC_TURBO `7C`7C SYS_VMS &027C USE_LS_FOR_DIRS
X`09/* rename these, just in case there's a shared-library around */
X#define opendir  vile_\0E07
X#define readdir  vile_\0E07
X#define closedir vile_\0E08
X
Xextern`09DIR *`09opendir ( char *path );
Xextern`09DIRENT *readdir ( DIR *dp );
Xextern`09int`09closedir ( DIR *dp );
X#endif
X
X#if OLD_STYLE_DIRS
X`09this ifdef is untested
X#define USE_D_NAMLEN 1
X#define`09DIR`09FILE
X#define`09DIRENT`09struct direct
X#define`09opendir(n)`09fopen(n,"r")
Xextern`09DIRENT *readdir ( DIR *dp );
X#define`09closedir(dp)`09fclose(dp)
X#endif
X
X#ifndef USE_D_NAMLEN
X#define USE_D_NAMLEN 0
X#endif
X
X#endif /* DIRSTUFF_H */
$ call unpack [.VILE-8_0]DIRSTUFF.H;1 -
 728844991 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 6 31 152
$!
$ create 'f'
X/*
X * The functions in this file handle redisplay. There are two halves, the
X * ones that update the virtual display screen, and the \350Amake the
X * physical display screen the same as the virtu\2711. These
X * functions use hints that are left in the windows by the commands.
X *
X *
X * $Header: /usr/build/vile/vile/RCS/display.c,v 1.250 1998/05/29 01:03:01 tom
V Exp $
X *
X */
X
X#include`09"estruct.h"
X#include        "edef.h"
X#include        "pscreen.h"
X
X#define`09NU_WIDTH 8
X
X#define`09MRK_EMPTY        '`7E'
X#define`09MRK_EXTEND_LEFT  '<'
X#define`09MRK_EXTEND_RIGHT '>'
X
XVIDEO`09**vscreen;`09`09`09/* Virtual \1506. */
XVIDEO`09**pscreen;`09`09`09/* Physical \1606. */
X#if`09MEMMAP
X#define PSCREEN vscreen
X#else
X#define PSCREEN pscreen
X#endif
Xstatic`09int *lmap;
X
X#if DISP_IBMPC
X#define PScreen(n) scread((VIDEO *)0,n)
X#else
X#define`09PScreen(n) pscreen`5Bn`5D
X#endif
X
X#if OPT_SCROLLCODE `26`26 (DISP_IBMPC `7C`7C !MEMMAP)
X#define CAN_SCROLL 1
X#else
X#define CAN_SCROLL 0
X#endif
X
Xstatic`09int`09i_displayed;`09`09/* false until we're in screen-mode */
Xstatic`09int`09im_displaying;`09`09/* flag set during screen updates */
Xstatic`09int`09mpresf;`09`09`09/* zero if message-line empty */
X#if OPT_WORKING
Xstatic`09int`09im_timing;
X#endif
X
X#define mark2col(wp, mk)  offs\120B.l, mk.o)
X
X#ifdef WMDLINEWRAP
X#define TopRow(wp) (wp)->w_toprow +\1109line.o
Xstatic`09int`09allow_wrap;
X#else
X#define TopRow(wp) (wp)->w_toprow
X#endif
X
X/* for window size changes */
Xstatic`09int chg_width, chg_height;
X
X/********\0808\1010\2020\400E/
X
Xtypedef`09void`09(*OutFunc) (int c);
X
Xstatic`09OutFunc`09dfoutfn;
X
Xstatic`09int`09endofline(char *s, int n);
Xstatic`09int`09texttest (int vrow, int prow);
Xstatic`09int`09updext_before(int col);
Xstatic`09int`09updext_past(int col, int excess);
Xstatic`09int`09updpos(int *screenrowp, \110Bcolp);
Xstatic`09int`09vtalloc (void);
Xstatic`09void`09l_to_vline(WINDOW *wp, LINEPTR lp, int sline);
Xstatic`09void`09mlmsg(const char *fmt, va_list *app);
Xstatic`09void`09modeline(WINDOW *wp);
Xstatic`09void`09reframe(WINDOW *wp);
Xstatic`09void`09scrscroll(int from, int to\0806count);
Xstatic`09void`09updall (WINDOW *wp);
Xstatic`09void`09updateline (int row, int colfrom\0D09to);
Xstatic`09void`09upddex (void);
Xstatic`09void`09updgar (void);
Xstatic`09void`09updone (WINDOW *wp);
Xstatic`09void`09updupd (int force);
Xstatic`09void`09vtlistc (int c);
X
X#if OPT_VIDEO_ATTRS
Xstatic`09void`09updattrs(WINDOW *wp);
X#endif
X
X#if`09OPT_UPBUFF
Xstatic`09void`09recompute_buffer(BUFFER *bp);
X#endif
X
X#if CAN_SCROLL
Xstatic`09int`09scrolls (int inserts);
X#endif
X
X/*--------\0808\1010\2020\400A*/
X
X/*
X * Format a number, right-justified, returning a pointer to the formatted
X * buffer.
X */
Xstatic char *
Xright_num (char *buffer, int len, long value)
X`7B
X`09char`09temp`5BNSTRING`5D;
X`09register char`09*p = lsprintf(temp, "%D", value);
X`09register char`09*q = buffer + len;
X
X`09*q = EOS;
X`09while (q != buffer)
X`09`09*(--q) = (p != temp) ? *(--p) : ' ';
X`09return buffer;
X`7D
X
X/*
X * Do format a string.
X */
Xstatic int
Xdfputsn(OutFunc outfunc, const char *s, int n)
X`7B
X`09register int c = 0;
X`09register int l = 0;
X`09TRACE(("...str=%.*s`5Cn", n > 0 ? n : (int)strlen(s), s))
X`09while ((n-- != 0) `26`26 ((c = *s++) != EOS)) `7B
X`09`09(*outfunc)(c);
X`09`09l++;
X`09`7D
X`09return l;
X`7D
X
X/* as above, but uses null-terminated string's length */
Xstatic int
Xdfputs(OutFunc outfunc, const char *s)
X`7B
X`09return dfputsn(outfunc, s, -1);
X`7D
X
X/*
X * Do format an integer, in the specified radix.
X */
X#define vMAXINT ((int)((unsigned)(`7E0)>>1))`09/* 0x7fffffff */
X#define vMAXNEG (-vMAXINT)`09`09`09/* 0x80000001 */
Xstatic int
Xdfputi(OutFunc outfunc, int i\0706r)
X`7B
X`09register int q;
X
X`09TRACE(("...int=%d`5Cn", i))
X`09if (i < 0) `7B
X`09`09if (i < vMAXNEG) `7B
X`09`09`09return dfputs(outfunc,"OVFL");
X`09`09`7D
X`09`09(*outfunc)('-');
X`09`09return dfputi(outfunc, -i, r) + 1;
X`09`7D
X
X`09q = (i >= r) ? dfputi(outfunc, i/r, r) : 0;
X
X`09(*outfunc)(hexdigits`5Bi%r`5D);
X`09return q + 1; /* number of digits printed */
X`7D
X
X/*
X * do the same except as a long integer.
X */
Xstatic int
Xdfputli(OutFunc outfunc, long l, int r)
X`7B
X`09register int q;
X
X`09TRACE(("...long=%ld`5Cn", l))
X`09if (l < 0) `7B
X`09`09(*outfunc)('-');
X`09`09return dfputli(outfunc, -l, r) + 1;
X`09`7D
X
X`09q = (l >= r) ? dfputli(outfunc, (long)(l/r), r) : 0;
X
X`09return q + dfputi(outfunc, (int)(l%r), r);
X`7D
X
X/*
X *`09Do format a scaled integer with two decimal places
X */
Xstatic int
Xdfputf(OutFunc outfunc, int s)
X`7B
X`09register int i;`09/* integer portion of number */
X`09register int f;`09/* fractional portion of number */
X
X`09/* break it up */
X`09i = s / 100;
X`09f = s % 100;
X
X`09/* send out the integer portion */
X`09i = dfputi(outfunc, i, 10);
X`09(*outfunc)('.');
X`09(*outfunc)((f / 10) + '0');
X`09(*outfunc)((f % 10) + '0');
X`09return i + 3;
X`7D
X
X/*
X * Generic string formatter.  Takes printf-like args, and calls
X * the global function (*dfoutfn)(c) for each c
X */
Xstatic void
Xdofmt(const char *fmt, va_list *app)
X`7B
X`09register int c;`09`09/* current char in format string */
X`09register int wid;
X`09register int n;
X`09register int nchars = 0;
X`09int islong;
X`09int radix;
X`09OutFunc outfunc = dfoutfn;  /* local copy, for recursion */
X
X`09TRACE(("dofmt fmt='%s'`5Cn", fmt))
X`09while ((c = *fmt++) != 0 ) `7B
X`09`09if (c != '%') `7B
X`09`09`09(*outfunc)(c);
X`09`09`09nchars++;
X`09`09`09continue;
X`09`09`7D
X`09`09c = *fmt++;
X`09`09wid = 0;
X`09`09islong = FALSE;
X`09`09if (c == '*') `7B
X`09`09`09wid = va_arg(*app,int);
X`09`09`09c = *fmt++;
X`09`09`7D else while (isDigit(c)) `7B
X`09`09`09wid = (wid * 10) + c - '0';
X`09`09`09c = *fmt++;
X`09`09`7D
X`09`09if (c == 'l') `7B
X`09`09`09islong = TRUE;
X`09`09`09c = *fmt++;
X`09`09`7D
X`09`09switch (c) `7B
X`09`09`09case EOS:
X`09`09&0209n = 0;
X`09`09&0209break;
X`09`09`09case 'c':
X`09`09&0209(*outfunc)(va_arg(*app,int));
X`09`09&0209n = 1;
X`09`09&0209break;
X
X`09`09`09case 'd':
X`09`09&0209if (!islong) `7B
X`09`09&0209`09n = dfputi(outfunc, va_arg(*app,int), 10);
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09&0209/* FALLTHROUGH */
X`09`09`09case 'D':
X`09`09&0209n = dfputli(outfunc, va_arg(*app,long), 10);
X`09`09&0209break;
X
X`09`09`09case 'o':
X`09`09&0209n = dfputi(outfunc, va_arg(*app,int), 8);
X`09`09&0209break;
X
X`09`09`09case 'x':
X`09`09&0209if (!islong) `7B
X`09`09&0209`09n = dfputi(outfunc, va_arg(*app,int), 16);
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09&0209/* FALLTHROUGH */
X`09`09`09case 'X':
X`09`09&0209n = dfputli(outfunc, va_arg(*app,long), 16);
X`09`09&0209break;
X
X`09`09`09case 'r':
X`09`09`09case 'R':
X`09`09&0209radix = va_arg(*app, int);
X`09`09&0209if (radix < 2 `7C`7C \0D06> 36)\0C07= 10;
X`09`09&0209if (islong `7C`7C c == 'R')
X`09`09&0209`09n = dfputli(outfunc,
X`09`09&0209&0209va_arg(*app,long), radix);
X`09`09&0209else
X`09`09&0209`09n = dfputi(outfunc,
X`09`09&0209&0209va_arg(*app,int), radix);
X`09`09&0209break;
X
X`09`09`09case 's':
X`09`09&0209n = dfputs(outfunc, va_arg(*app,char *));
X`09`09&0209break;
X
X`09`09`09case 'S': /* use wid as max width */
X`09`09&0209n = dfputsn(outfunc, va_arg(*app,char *),wid);
X`09`09&0209break;
X
X`09`09`09case 'f':
X`09`09&0209n = dfputf(outfunc, va_arg(*app,int));
X`09`09&0209break;
X
X`09`09`09case 'P': /* output padding -- pads total\1D08to
X`09`09&0209`09"wid" chars, using c as the pad char */
X`09`09&0209wid -= nchars;
X`09`09&0209/* FALLTHROUGH */
X
X`09`09`09case 'p': /* field padding -- puts out "wid"
X`09`09&0209`09copies of c */
X`09`09&0209n = 0;
X`09`09&0209c = va_arg(*app,int);
X`09`09&0209while (n < wid) `7B
X`09`09&0209`09(*outfunc)(c);
X`09`09&0209`09n++;
X`09`09&0209`7D
X`09`09&0209break;
X
X`09`09`09default:
X`09`09&0209(*outfunc)(c);
X`09`09&0209n = 1;
X`09`09`7D
X`09`09wid -= n;
X`09`09nchars += n;
X`09`09while (wid-- > 0) `7B
X`09`09`09(*outfunc)(' ');
X`09`09`09nchars++;
X`09`09`7D
X`09`7D
X
X`7D
X
X/********\0808\1010\2020\400E/
X
X/*
X * Line-number mode
X */
Xint
Xnu_width(WINDOW *wp)
X`7B
X`09return w_val(wp,WMDNUMBER) ? NU_WIDTH : 0;
X`7D
X
Xint
Xcol_limit(WINDOW *wp)
X`7B
X#ifdef WMDLINEWRAP
X`09if (w_val(wp,WMDLINEWRAP))
X`09`09return curcol + 1;`09/* effectively unlimited */
X#endif
X`09return term.t_ncol - 1 - nu_width(wp);
X`7D
X
X/*
X * Initialize the data structures used by\1C06isplay code. The edge vectors
X * used to access the screens are set up.
X */
Xint
Xvtinit(void)
X`7B
X    register int i;
X    register VIDEO *vp;
X
X#if`09OPT_MLFORMAT
X    if (!modeline_format)
X    `09modeline_format = strmalloc(
X`09    "%-%i%- %b %m:: :%f:is : :%=%F: : :%l:(:,:%c::) :%p::% :%S%-%-%`7C"
X`09);
X#endif
X
X    /* allocate new display memory */
X    if (vtalloc() == FALSE) /* if we fail, only serious if not a realloc */
X    `09return (vscreen != NULL);
X
X    for (i = 0; i < term.t_mrow; ++i) `7B
X`09vp = vscreen`5Bi`5D;
X`09vp->v_flag = 0;
X#if OPT_COLOR
X`09ReqFcolor(vp) = gfcolor;
X`09ReqBcolor(vp) = gbcolor;
X#endif
X    `7D
X#if OPT_WORKING
X    if (!i_displayed `26`26 !im\1108ing)
X`09imworking(0);
X#endif
X    return TRUE;
X`7D
X
X#if OPT_VIDEO_ATTRS
Xstatic void
Xset_vattrs(int row, int col, VIDEO_ATTR attr, size_t len)
X`7B
X`09while (len--)
X`09`09vscreen`5Brow`5D->v_attrs`5Bcol++`5D = attr;
X`7D
X#else
X#define set_vattrs(row, col, attr, len) /*nothing*/
X#endif
X
Xstatic void
XfreeVIDEO(register VIDEO *vp)
X`7B
X`09if (vp != 0) `7B
X#if OPT_VIDEO_ATTRS
X`09`09FreeIfNeeded (vp->v_attrs);
X#endif
X`09`09free((char *)vp);
X`09`7D
X`7D
X
Xint
Xvideo_alloc(VIDEO **vpp)
X`7B
X`09register VIDEO *vp;
X`09/* struct VIDEO already has 4 of the bytes */
X`09vp = typeallocplus(VIDEO, term.t_mcol - 4);
X`09if (vp == 0)
X`09`09return FALSE;
X`09(void)memset((char *)vp, 0, sizeof(VIDEO) + term.t_mcol - 4);
X
X#if OPT_VIDEO_ATTRS
X`09vp->v_attrs = typecallocn(VIDEO_ATTR, (ALLOC_T)term.t_mcol);
X`09if (vp->v_attrs == 0) `7B
X`09`09free((char *)vp);
X`09`09return FALSE;
X`09`7D
X#endif
X`09freeVIDEO(*vpp);
X`09*vpp = vp;
X`09return TRUE;
X`7D
X
Xstatic int
Xvtalloc(void)
X`7B
X`09register int i, first;
X`09static int vcols, vrows;
X
X`09if (term.t_mrow > vrows) `7B
X`09`09GROW(vscreen, VIDEO *, vrows, term.t_mrow);
X#if`09! MEMMAP
X`09`09GROW(pscreen, VIDEO *, vrows, term.t_mrow);
X#endif
X`09`09GROW(lmap, int, vrows, term.t_mrow);
X`09`7D else `7B
X`09`09for (i = term.t_mrow; i < vrows; i++) `7B
X`09`09`09freeVIDEO(vscreen`5Bi`5D);
X#if`09! MEMMAP
X`09`09`09freeVIDEO(pscreen`5Bi`5D);
X#endif
X`09`09`7D
X`09`7D
X
X`09first = (term.t_mcol > vcols) ? 0 : vrows;
X
X`09for (i = first; i < term.t_mrow; ++i) `7B
X`09`09if (!video_alloc(`26vscreen`5Bi`5D))
X`09`09`09return FALSE;
X#if`09! MEMMAP
X`09`09if (!video_alloc(`26pscreen`5Bi`5D))
X`09`09`09return FALSE;
X#endif`09/* !MEMMAP */
X`09`7D
X`09vcols = term.t_mcol;
X`09vrows = term.t_mrow;
X
X`09return TRUE;
X`7D
X
X/* free all video memory, in anticipation of a (growing) resize */
X#if NO_LEAKS
Xstatic void
Xvtfree(void)
X`7B
X`09register int i;
X
X`09if (vscreen) `7B
X`09`09for (i = 0; i < term.t_mrow; ++i) `7B
X`09`09`09freeVIDEO(vscreen`5Bi`5D);
X`09`09`7D
X`09`09free ((char *)vscreen);
X`09`09vscreen = 0;
X`09`7D
X
X#if`09! MEMMAP
X`09if (pscreen) `7B
X`09`09for (i = 0; i < term.t_mrow; ++i) `7B
X`09`09`09freeVIDEO(pscreen`5Bi`5D);
X`09`09`7D
X`09`09free ((char *)pscreen);
X`09`09pscreen = 0;
X`09`7D
X#endif
X`09FreeIfNeeded (lmap);
X`7D
X#endif
X
X
X/*
X * Set the virtual cursor to the specified row and column on \360B
X * screen. There is no checking for nonsense values.
X */
Xstatic void
Xvtmove(int row, int col)
X`7B
X    vtrow = row;
X    vtcol = col;
X`7D
X
X/* Write a character to the virtual screen. T\140Brow and
X   column are updated. If we are not yet on left edge, don't print
X   it yet. If the line is too long put a ">" in\2206ast column.
X   This routine only puts printing characters into the virtual
X   terminal buffers. Only column overflow is checked.
X*/
X
Xstatic void
Xvtputc(int c)
X`7B
X`09/* since we don't allow wrapping on the message line, we only need
X`09 * to evaluate this once.  */
X`09int lastcol = vtrow == term.t_nrow-1 ? \1109col-1 :\100C;
X`09register VIDEO *vp;`09/* ptr to line being updated */
X
X#ifdef WMDLINEWRAP
X`09if (vtrow < 0) `7B
X`09`09static VIDEO *fake_line;
X`09`09static int   length;
X`09`09if (length != term.t_mcol `7C`7C fake_line == 0) `7B
X`09`09`09if (!video_alloc(`26fake_line))
X`09`09&0209return;
X`09`09`09length = term.t_mcol;
X`09`09`7D
+-+-+-+-+-+-+-+-  END  OF PART 41 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 42 -+-+-+-+-+-+-+-+
X`09`09vp = fake_line;
X`09`7D
X`09else
X#endif
X`09 vp = vscreen`5Bvtrow`5D;
X
X`09if (isPrint(c) `26`26 vtcol >= 0\0E0A< lastcol) `7B
X`09`09VideoText(vp)`5Bvtcol++`5D = (c `26 (N_chars-1));
X#ifdef WMDLINEWRAP
X`09`09if ((allow_wrap != 0)
X`09`09 `26`26 (vtcol == lastcol)
X`09`09 `26`26 (vtrow <  allow_wrap)) `7B
X`09`09`09vtcol = 0;
X`09`09`09if (++vtrow >= 0)
X`09`09&0209vscreen`5Bvtrow`5D->v_flag `7C= VFCHG;
X`09`09`09taboff += lastcol;
X`09`09`7D
X#endif
X`09`09return;
X`09`7D
X
X`09if (vtcol >= lastcol) `7B
X`09`09VideoText(vp)`5Blastcol - 1`5D = MRK_EXTEND_RIGHT;
X`09`7D else if (c == '`5Ct') `7B
X`09`09do `7B
X`09`09`09vtputc(' ');
X`09`09`7D while (((vtcol + taboff)%curtabval) != 0
X`09`09          `26`26 vtcol < lastcol);
X`09`7D else if (c == '`5Cn') `7B
X`09`09return;
X`09`7D else if (isPrint(c)) `7B
X`09`09++vtcol;
X`09`7D else `7B
X`09`09vtlistc(c);
X`09`7D
X`7D
X
X/* how should high-bit unprintable chars be shown? */
Xstatic int vt_octal;
X
X/* shows non-printing character */
Xstatic void
Xvtlistc(int c)
X`7B
X`09if (isPrint(c)) `7B
X`09    vtputc(c);
X`09    return;
X`09`7D
X
X`09if (c `26 HIGHBIT) `7B
X`09    vtputc('`5C`5C');
X`09    if (vt_octal) `7B
X`09`09vtputc(((c>>6)`263)+'0');
X`09`09vtputc(((c>>3)`267)+'0');
X`09`09vtputc(((c   )`267)+'0');
X`09    `7D else `7B
X`09`09vtputc('x');
X`09`09vtputc(hexdigits`5B(c>>4) `26 0xf`5D);
X`09`09vtputc(hexdigits`5B(c   ) `26 0xf`5D);
X`09    `7D
X`09`7D else `7B
X`09    vtputc('`5E');
X`09    vtputc(toalpha(c));
X`09`7D
X`7D
X
Xstatic int
Xvtgetc(int col)
X`7B
X`09return vscreen`5Bvtrow`5D->v_text`5Bcol`5D;
X`7D
X
Xstatic void
Xvtputsn(const char *s, int n)
X`7B
X`09int c = 0;
X`09while (n-- > 0 `26`26 (c = *s++) != EOS)
X`09`09vtputc(c);
X`7D
X
X/*
X * Write a line to the screen at the current video coordinates, allowing for
X * line-wrap or right-shifting.
X */
Xstatic void
Xvtset(LINEPTR lp, WINDOW *wp)
X`7B
X`09register char *from;
X`09register int n = llength(lp);
X`09BUFFER`09*bp  = wp->w_bufp;
X`09int`09skip = -vtcol,
X`09`09list = w_val(wp,WMDLIST);
X
X`09vt_octal = w_val(wp,WMDNONPRINTOCTAL);
X
X#ifdef WMDLINEWRAP
X`09/*
X`09 * If the window's offset is negative, we've got a case of linewrap
X`09 * where the line's beginning is forced befor\2606\1F0Aof the
X`09 * window.
X`09 */
X`09if (wp->w_line.o < 0) `7B
X`09`09vtrow -= wp->w_line.o;
X`09`09skip = col2offs(wp, lp, -(wp->w_line.o * term.t_ncol));
X`09`09n -= skip;
X`09`7D
X`09else
X#endif
X`09if (w_val(wp,WMDNUMBER)) `7B
X`09`09register int j, k, jk;
X`09`09L_NUM`09line = line_no(bp, lp);
X`09`09int`09fill = ' ';
X`09`09char`09temp`5BNU_WIDTH+2`5D;
X
X`09`09vtcol = 0;`09/* make sure we always see line numbers */
X`09`09vtputsn(right_num(temp, NU_WIDTH-2, (long)line)\190C);
X`09`09vtputsn("  ", 2);
X`09`09taboff = skip - vtcol;
X
X`09`09/* account for leading fill; this repeats logic in vtputc so
X`09`09 * I don't have to introduce a global variable... */
X`09`09from = lp->l_text;
X`09`09for (j = k = jk = 0; (j < n) `26`26 (k < skip); j++) `7B
X`09`09`09register int`09c = from`5Bj`5D;
X`09`09`09if ((list `7C`7C (c != '`5Ct')) `26`26 !isPrint(c)) `7B
X`09`09`09    `09if (c `26 HIGHBIT) `7B
X`09`09&0209    k += 4;
X`09`09&0209    fill = '`5C`5C';  /* FIXXXX */
X`09`09&0209`7D else `7B
X`09`09&0209    k += 2;
X`09`09&0209    fill = toalpha(c);
X`09`09&0209`7D
X`09`09`09`7D else `7B
X`09`09&0209if (c == '`5Ct')
X`09`09&0209`09k += (curtabval - (k % \1109));
X`09`09&0209else if (isPrint(c))
X`09`09&0209`09k++;
X`09`09&0209fill = ' ';
X`09`09`09`7D
X`09`09`09jk = j+1;
X`09`09`7D
X`09`09while (k-- > skip)
X`09`09`09vtputc(fill);
X`09`09if ((skip = jk) < 0)
X`09`09`09skip = 0;
X`09`09n -= skip;
X`09`7D else
X`09`09skip = 0;
X
X#if OPT_B_LIMITS
X`09taboff -= w_left_margin(wp);
X#endif
X`09from = lp->l_text + skip;
X#ifdef WMDLINEWRAP
X`09allow_wrap = w_val(wp,WMDLINEWRAP) ? mode_row(wp)-1 : 0;
X#endif
X
X`09while ((vtcol <= term.t_ncol)
X#ifdef WMDLINEWRAP
X`09  `26`26   ((vtrow == term.t_nrow-1) `7C`7C (\1C06< mode_row(wp)))
X#endif
X`09  `26`26   (n > 0)) `7B
X`09`09if (list)
X`09`09`09vtlistc(*from++);
X`09`09else
X`09`09`09vtputc(*from++);
X`09`09n--;
X`09`7D
X
X`09/* Display a "`5EJ" if 'list' mode is active, unless we've suppressed
X`09 * it for some reason.
X`09 */
X`09if (list `26`26 (n >= 0)) `7B
X`09`09if (b_is_scratch(bp) `26`26 listrimmed(lp))
X`09`09`09/*EMPTY*/;
X`09`09else if (!b_val(bp,MDNEWLINE) `26`26 (lforw(lp) == buf_head(bp)))
X`09`09`09/*EMPTY*/;
X`09`09else
X`09`09`09vtlistc('`5Cn');
X`09`7D
X#ifdef WMDLINEWRAP
X`09allow_wrap = 0;
X#endif
X`7D
X
X/*
X * Erase from the end of the software cursor to\2210line on which
X * the software cursor is located.
X */
Xstatic void
Xvteeol(void)
X`7B
X`09if (vtcol < term.t_ncol) `7B
X`09    int n = (vtcol >= 0) ? \0E06: 0;
X#ifdef WMDLINEWRAP
X`09    if (vtrow >= 0)
X#endif
X`09`09if (n >= 0) `7B
X`09`09`09(void)memset(`26vscreen`5Bvtrow`5D->v_text`5Bn`5D,
X`09`09&0209' ', (SIZE_T)(term.t_ncol-n));
X`09`09`7D
X`09`09vtcol = term.t_ncol;
X`09`7D
X`7D
X
X/* upscreen:`09user routine to force a \2006 update
X`09`09always finishes complete update&0209*/
X#if !SMALLER
X/* ARGSUSED */
Xint
Xupscreen(int f GCC_UNUSED, int n\120B)
X`7B
X`09return update(TRUE);
X`7D
X#endif
X
Xstatic`09UINT`09scrflags;
X
X/* line to virtual column */
Xint
Xmk_to_vcol (MARK mark, int expanded\0E06base)
X`7B
X`09int`09col = 0;
X`09int`09i = base;
X`09int`09c;
X`09int`09lim;
X`09LINEPTR lp;
X
X`09lp = mark.l;
X`09lim = mark.o
X`09`09+ ((!global_g_val(GMDALTTABPOS) `26`26 !insertmode) ? 1 : 0);
X`09if (lim > llength(lp))
X`09`09lim = llength(lp);
X
X`09while (i < lim) `7B
X`09`09c = lgetc(lp, i++);
X`09`09if (c == '`5Ct' `26`26 !expanded) `7B
X`09`09`09col += curtabval - (col%\1109);
X`09`09`7D else `7B
X`09`09`09if (!isPrint(c)) `7B
X`09`09&0209col += (c `26 HIGHBIT) ? 3 : 1;
X`09`09`09`7D
X`09`09`09++col;
X`09`09`7D
X
X`09`7D
X`09col += base;
X`09if (!global_g_val(GMDALTTABPOS) `26`26 !insertmode &0226
X`09`09`09col != 0 `26`26 mark.o < llength(lp))
X`09`09col--;
X`09return col;
X`7D
X
Xvoid
Xkbd_openup(void)
X`7B
X#if !MEMMAP `26`26 !OPT_PSCREEN
X`09int i;
X`09size_t alen = sizeof(VIDEO_ATTR) * term.t_ncol;
X#endif
X`09kbd_flush();
X`09bottomleft();
X`09TTputc('`5Cn');
X`09TTputc('`5Cr');
X`09TTflush();
X#if !MEMMAP `26`26 !OPT_PSCREEN
X`09if (pscreen != 0) `7B
X`09`09for (i = 0; i < term.t_nrow-1; ++i) `7B
X`09`09`09(void)memcpy(
X`09`09&0209pscreen`5Bi`5D->v_text,
X`09`09&0209pscreen`5Bi+1`5D->v_text,
X`09`09&0209(SIZE_T)(term.t_ncol));
X#if OPT_VIDEO_ATTRS
X`09`09`09(void)memcpy(
X`09`09&0209pscreen`5Bi`5D->v_attrs,
X`09`09&0209pscreen`5Bi+1`5D->v_attrs,
X`09`09&0209alen);
X#endif
X`09`09`7D
X`09`09(void)memset(pscreen`5Bi`5D->v_text, ' ', (SIZE_T)(term.t_ncol));
X#if OPT_VIDEO_ATTRS
X`09`09(void)memset(pscreen`5Bi`5D->v_attrs, VADIRTY, alen);
X#endif
X`09`7D
X#endif
X`7D
X
X/* cannot be allocated since it's used by OPT_RAMSIZE */
Xstatic char my_overlay`5B20`5D;
X
X/* save/erase text for the overlay on the message line */
Xvoid
Xkbd_overlay(const char *s)
X`7B
X`09my_overlay`5B0`5D = EOS;
X`09if ((mpresf = (s != 0 `26`26 *s != EOS)) != 0) `7B
X`09`09strncpy(my_overlay, s, sizeof\160B)-1);
X`09`7D
X`7D
X
Xvoid
Xkbd_flush(void)
X`7B
X`09int ok;
X
X`09beginDisplay();
X`09if (vscreen != 0) `7B
X`09`09int row = term.t_nrow - 1;
X
X`09`09vtmove(row, -w_val(wminip,WVAL_SIDEWAYS));
X
X`09`09ok = (wminip != 0
X`09`09   `26`26 wminip->w_dot.l != 0
X`09`09   `26`26 wminip->w_dot.l->l_text != 0);
X`09`09if (ok) `7B
X`09`09`09TRACE(("SHOW:%2d:%.*s`5Cn",
X`09`09&0209llength(wminip->w_dot.l),
X`09`09&0209llength(wminip->w_dot.l),
X`09`09&0209wminip->w_dot.l->l_text));
X`09`09`09vtset(wminip->w_dot.l, \1106);
X`09`09`7D
X
X`09`09vteeol();
X`09`09set_vattrs(row, 0,
X`09`09`09miniedit
X`09`09&0209? global_g_val(GVAL_MINI_HILITE)
X`09`09&0209: 0,
X`09`09`09term.t_ncol);
X`09`09if (my_overlay`5B0`5D != EOS) `7B
X`09`09`09int n = term.t_ncol - strlen(my_overlay) - 1;
X`09`09`09if (n > 0) `7B
X`09`09&0209(void)memcpy(`26vscreen`5Brow`5D->v_text`5Bn`5D,
X`09`09&0209`09my_overlay,
X`09`09&0209`09strlen(my_overlay));
X`09`09`09`7D
X`09`09`7D
X`09`09vscreen`5Brow`5D->v_flag `7C= VFCHG;
X`09`09updateline(row, 0, term.t_ncol);
X`09`09if (ok)
X`09`09`09movecursor(row,
X`09`09&0209offs2col(wminip, \0806->w_dot.l\1110o));
X`09`7D
X`09TTflush();
X`09endofDisplay();
X`7D
X
Xstatic int
XTypeAhead(int force)
X`7B
X`09if (force != TRUE) `7B
X`09`09if ((force == FALSE `26`26 !global_g_val(GMDSMOOTH_SCROLL))
X`09`09 `7C`7C (force == SORTOFTRUE))
X`09`09`09return (keystroke_avail());
X`09`7D
X`09return FALSE;
X`7D
X
X/*
X * Make sure that the display is right. This is a three part process. First,
X * scan through all of the windows looking for dirty ones. Check the framing,
V
X * and refresh the screen. Second, make sure that "currow" and "curcol" are
X * correct for the current window. Third, make the virtual and physical
X * screens the same.
X */
Xint
Xupdate(
Xint force)`09/*\0A06 update past type ahead? */
X`7B
X`09register WINDOW *wp;
X`09int origrow, origcol;
X`09int screenrow,\0B07col;
X
X`09/* Get row and column prior to doing the update in case we are
X`09 * reading the message line.
X`09 */
X`09origrow = ttrow;
X`09origcol = ttcol;
X
X`09if (!curbp `7C`7C !vscreen) /* not initialized */
X`09`09return FALSE;
X`09if (TypeAhead(force))
X`09`09return SORTOFTRUE;
X#if`09OPT_VISIBLE_MACROS == 0
X`09if (force == FALSE `26`26 kbd_replaying(TRUE) &0226 (get_recorded_char(FALS
VE) != -1))
X`09`09return SORTOFTRUE;
X#endif
X
X`09beginDisplay();
X
X`09/* first, propagate mode line changes to all instances of
X`09`09a buffer displayed in more than one window */
X`09for_each_visible_window(wp) `7B
X`09`09if (wp->w_flag `26 WFMODE) `7B
X`09`09`09if (wp->w_bufp->b_nwnd > 1) `7B
X`09`09&0209/* make sure all previous windows have this */
X`09`09&0209register WINDOW *owp;
X`09`09&0209for_each_visible_window(owp)
X`09`09&0209`09if (owp->w_bufp == \0E0A)
X`09`09&0209&0209owp->w_flag `7C= WFMODE;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X
X`09/* look for scratch-buffers that should be recomputed.  */
X#if`09OPT_UPBUFF
X`09for_each_visible_window(wp)
X`09`09if (b_is_obsolete(wp->w_bufp))
X`09`09`09recompute_buffer(wp->w_bufp);
X#endif
X
X`09/* look for windows that need the ruler updated */
X#ifdef WMDRULER
X`09for_each_visible_window(wp) `7B
X`09`09if (w_val(wp,WMDRULER)) `7B
X`09`09`09int`09line  = line_no(wp->w_bufp, \0C06dot.l);
X`09`09`09int`09col   = mk_to_vcol(wp->w_dot, w_val(wp,WMDLIST), 0) + 1;
X
X`09`09`09if (line != wp->w_ruler_line
X`09`09`09 `7C`7C col  != wp->w_ruler_col) `7B
X`09`09&0209wp->w_ruler_line = line;
X`09`09&0209wp->w_ruler_col  = col;
X`09`09&0209wp->w_flag `7C= WFMODE;
X`09`09`09`7D
X`09`09`7D else if (wp->w_flag `26 WFSTAT) `7B
X`09`09`09wp->w_flag `7C= WFMODE;
X`09`09`7D
X`09`09wp->w_flag `26= `7EWFSTAT;
X`09`7D
X#endif
X
X`09do `7B
X`09`09/* update any windows that need refreshing */
X`09`09for_each_visible_window(wp) `7B
X`09`09`09if (wp->w_flag) `7B
X`09`09&0209curtabval = tabstop_val(wp->w_bufp);
X`09`09&0209/* if the window has changed, service it */
X`09`09&0209reframe(wp);`09/* check the framing */
X`09`09&0209if (wp->w_flag `26 (WFKILLS`7CWFINS)) `7B
X`09`09&0209`09scrflags `7C= (wp->w_flag `26 (WFINS`7CWFKILLS));
X`09`09&0209`09wp->w_flag `26= `7E(WFKILLS`7CWFINS);
X`09`09&0209`7D
X`09`09&0209if ((wp->w_flag `26 `7E(WFMODE)) == WFEDIT)
X`09`09&0209`09updone(wp);`09/* update EDITed line */
X`09`09&0209else if (wp->w_flag `26 `7E(WFMOVE))
X`09`09&0209`09updall(wp);`09/* update all lines */
X#if OPT_SCROLLBARS
X`09`09&0209if (wp->w_flag `26 (WFHARD `7C WFSBAR))
X`09`09&0209`09update_scrollbar(wp);
X#endif /* OPT_SCROLLBARS */
X
X#if OPT_VIDEO_ATTRS
X`09`09&0209if (wp->w_flag `26 (WFHARD `7C WFEDIT))
X`09`09&0209`09updattrs(wp);
X#endif
X`09`09&0209if (scrflags `7C`7C (wp->w_flag `26 (WFMODE`7CWFCOLR)))
X`09`09&0209`09modeline(wp);`09/* update \1808 */
X`09`09&0209wp->w_flag = 0;
X`09`09&0209wp->w_force = 0;
X`09`09`09`7D
X`09`09`7D
X`09`09curtabval = tabstop_val(curbp);
X
X`09/* Recalculate the current hardware cursor location.  If true, we've
X`09 * done a horizontal scroll.
X`09 */
X`09`7D while (updpos(`26screenrow, \0C07col));
X
X`09/* check for lines to de-extend */
X`09upddex();
X
X`09/* if screen is garbage, re-plot it */
X`09if (sgarbf)
X`09`09updgar();
X
X`09/* update the virtual screen to the physic\170A*/
X`09updupd(force);
X
X`09/* update the cursor and flush the buffers */
X`09if (reading_msg_line)
X`09    movecursor(origrow, origcol);
X`09else
X`09    movecursor(screenrow, \0B06col);
X
X`09TTflush();
X`09endofDisplay();
X`09i_displayed = TRUE;
X
X`09while (chg_width `7C`7C chg_height)
X`09`09newscreensize(chg_height,chg_width);
X`09return(TRUE);
X`7D
X
X/*`09reframe:`09check to see if the cursor is on in the window
X`09`09`09and re-frame it if needed or wanted&0209*/
Xstatic void
Xreframe(WINDOW *wp)
X`7B
X`09register LINEPTR dlp;
X`09register LINEPTR lp;
X`09register int i = 0;
X`09register int rows;
X`09int`09founddot = FALSE;`09/* set to true iff we find dot */
X`09int`09tildecount;
X
X`09/* if not a requested reframe, check for a needed one */
X`09if ((wp->w_flag `26 WFFORCE) == 0) `7B
X`09`09/* initial update in main.c may not set these first... */
X`09`09if (wp->w_dot.l == (LINE *)0) `7B
X`09`09`09wp->w_dot.l = lforw(win_head(wp));
X`09`09`09wp->w_dot.o = 0;
X`09`09`7D
X`09`09if (wp->w_line.l == (LINE *)0) `7B
X`09`09`09wp->w_line.l = \0F06dot.l;
X`09`09`09wp->w_line.o = 0;
X`09`09`7D
X#if CAN_SCROLL
X`09`09/* loop from one line above the window to\1D0Bfter */
X`09`09lp = lback(wp->w_line.l);
X`09`09i  = -line_height(wp,lp);
X#else
X`09`09/* loop through the window */
X`09`09lp = wp->w_line.l;
X`09`09i  = 0;
X#endif
X`09`09for_ever `7B
X`09`09`09/* if the line is in the window, no reframe */
X`09`09`09if (lp == wp->w_dot.l) `7B
X`09`09&0209founddot = TRUE;
X#if CAN_SCROLL
X`09`09&0209/* if not _quite_ in, we'll reframe gently */
X`09`09&0209if ( i < 0 `7C`7C i >= wp->w_ntrows) `7B
X`09`09&0209`09/* if the terminal can't help, then
X`09`09&0209&0209we're simply outside */
X`09`09&0209`09if (term.t_scroll == null_\1108)
X`09`09&0209&0209i = wp->w_force;
X`09`09&0209`09break;
X`09`09&0209`7D
X#endif
X#ifdef WMDLINEWRAP
X`09`09&0209if (w_val(wp,WMDLINEWRAP)
X`09`09&0209 `26`26 i > 0
X`09`09&0209 `26`26 i + line_height(wp,lp) > wp->w_ntrows) `7B
X`09`09&0209`09i = wp->w_ntrows;
X`09`09&0209`09break;
X`09`09&0209`7D
X#endif
X`09`09&0209lp = wp->w_line.l;
X`09`09&0209goto kill_tildes;
X`09`09`09`7D
X
X`09`09`09/* if we are at the end of the file, reframe */
X`09`09`09if (i >= 0 `26`26 lp == win_head(wp))
X`09`09&0209break;
X
X`09`09`09/* on to the next line */
X`09`09`09if (i >= wp->w_ntrows) `7B
X`09`09&0209i = 0;`09/* dot-not-found */
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09i += line_height(wp,lp);
X`09`09`09lp = lforw(lp);
X`09`09`7D
X`09`7D
X
X#if CAN_SCROLL
X`09if (i < 0) `7B`09/* we're just above the window */
X`09`09i = 1;`09/* put dot at first line */
X`09`09scrflags `7C= WFINS;
X`09`7D else if (founddot `26`26 (i >= wp->w_ntrows)) `7B
X`09`09/* we're just below the window */
X`09`09i = -1;`09/* put dot at last line */
X`09`09scrflags `7C= WFKILLS;
X`09`7D else /* put dot where requested */
X#endif
X`09`09i = wp->w_force;  /* (is 0, unless reposition() was called) */
X
X`09wp->w_flag `7C= WFMODE;
X`09wp->w_line.o = 0;
X
X`09/* w_force specifies which line of the window dot should end up on */
X`09/* `09positive --> lines from the top`09`09&0209*/
X`09/* `09negative --> lines from the bottom`09`09`09*/
X`09/* `09zero --> middle of window`09`09&0209*/
X
X`09lp = wp->w_dot.l;
X
X#ifdef WMDLINEWRAP
X`09/*
X`09 * Center dot in middle of screen with line-wrapping
X`09 */
X`09if (i == 0 `26`26 w_val(wp,WMDLINEWRAP)) `7B
X`09`09rows = (wp->w_ntrows - line_height(wp,lp) + 2) / 2;
X`09`09while (rows > 0) `7B
X`09`09`09dlp = lback(lp);
X`09`09`09if (dlp == win_head(wp))
X`09`09&0209break;
X`09`09`09if ((rows -= line_height(wp, dlp)) < 0)
X`09`09&0209break;
X`09`09`09lp = dlp;
X`09`09`7D
X`09`7D else
X#endif
X`09`7B
X`09`09rows = (i != 0)
X`09`09`09? wp->w_ntrows
X`09`09`09: wp->w_ntrows / 2;
X`09`09while (rows > 0) `7B
X`09`09`09if ((i > 0)
X`09`09`09 `26`26 (--i <= 0))
X`09`09&0209break;
X`09`09`09dlp = lback(lp);
X`09`09`09if (dlp == win_head(wp))
X`09`09&0209break;
X`09`09`09if ((rows -= line_height(wp, lp)) < 0)
X`09`09&0209break;
X`09`09`09lp = dlp;
X`09`09`7D
X`09`09if (rows < line_height(wp, lp)
X`09`09 `26`26 (lp != wp->w_dot.l)) `7B
X`09`09`09while (i++ < 0) `7B
X`09`09&0209dlp = lforw(lp);
X`09`09&0209if (dlp == win_head(wp))
X`09`09&0209`09break;
X`09`09&0209else
X`09`09&0209`09lp = dlp;
X`09`09`09`7D
X`09`09`7D
X`09`7D
Xkill_tildes:
X`09/* Eliminate as many tildes as possible from bottom */
X`09dlp = lp;
X`09rows = wp->w_ntrows;
X`09while (rows > 0 `26`26 (dlp != win_head(wp))) `7B
X`09`09rows -= line_height(wp, dlp);
X`09`09dlp = lforw(dlp);
X`09`7D
X`09dlp = lback(lp);
X
X`09tildecount = (wp->w_ntrows * ntildes)/100;
X`09if (tildecount == wp->w_ntrows)
X`09`09tildecount--;
X
X`09while (dlp != win_head(wp)
X`09       `26`26 (rows -= line_height(wp, dlp)) >= tildecount) `7B
X`09`09lp = dlp;
X`09`09dlp = lback(lp);
X`09`7D
X
X`09/* and reset the current line-at-top-of-window */
X`09if (lp != win_head(wp) /* mouse click could be past end */
X`09 `26`26 lp != wp->w_line.l) `7B /* no need to set it if already there */
X`09`09wp->w_line.l = lp;
X`09`09wp->w_flag `7C= WFHARD;
X`09`09wp->w_flag `26= `7EWFFORCE;
X`09`7D
X#ifdef WMDLINEWRAP
X`09/*
X`09 * Ensure that dot will be visible, by adjusting the w_line.o value if
X`09 * necessary.  That's used to start the beginning of the first line in
X`09 * a window "before" the start of the \2106.
X`09 */
X`09if (w_val(wp,WMDLINEWRAP)
X`09 `26`26 sameline(wp->w_line, \0C06dot)) `7B
X`09`09int want = mark2col(wp, wp->w_dot) / term.t_ncol;
X`09`09if (want + wp->w_line.o >=\1007ntrows) `7B
X`09`09`09wp->w_line.o = \0F06ntrows - want - 1;
X`09`09`09wp->w_flag `7C= WFHARD;
X`09`09`09wp->w_flag `26= `7EWFFORCE;
X`09`09`7D
X`09`09else if (want + wp->w_line.o < 0) `7B
X`09`09`09wp->w_line.o = -want;
X`09`09`09wp->w_flag `7C= WFHARD;
X`09`09`09wp->w_flag `26= `7EWFFORCE;
X`09`09`7D
X`09`7D
X#endif
X`7D
X
X/*`09updone:`09update the current line`09to the virtual screen`09`09*/
X
Xstatic void
Xupdone(
XWINDOW *wp)`09/* window to update current line in */
X`7B
X`09register LINEPTR lp;`09/* line to update */
X`09register int sline;`09/* physical screen line to update */
X
X`09/* search down the line we want */
X`09lp = wp->w_line.l;
X`09sline = TopRow(wp);
X`09while (lp != wp->w_dot.l) `7B
X`09`09sline += line_height(wp,lp);
X`09`09lp = lforw(lp);
X`09`7D
X
X`09l_to_vline(wp,lp,sline);
X`09vteeol();
X`7D
X
X/*`09updall:`09update all the lines in a window on the virtual screen */
X
Xstatic void
Xupdall(
XWINDOW *wp)`09/* window to update lines in */
X`7B
X`09register LINEPTR lp;`09/* line to update */
X`09register int sline;`09/* physical screen line to update */
X
X`09/* search down the lines, updating them */
X`09lp = wp->w_line.l;
X`09sline = TopRow(wp);
X`09while (sline < mode_row(wp)) `7B
X`09`09l_to_vline(wp,lp,sline);
X`09`09vteeol();
X`09`09sline += line_height(wp,lp);
X`09`09if (lp != win_head(wp))
X`09`09`09lp = lforw(lp);
X`09`7D
X`7D
X
X/* line to virtual screen\1706*/
Xstatic void
Xl_to_vline(
XWINDOW *wp,`09/* window to update lines in */
XLINEPTR lp,
Xint sline)
X`7B
X`09C_NUM`09left;
X
X`09/*
X`09 * Mark the screen lines changed, resetting the requests for reverse
X`09 * video.  Set the global 'taboff' to the amount of horizontal
X`09 * scrolling.
X`09 */
X#ifdef WMDLINEWRAP
X`09if (w_val(wp,WMDLINEWRAP)) `7B
X`09`09int top_line = sline - wp->w_line.o;
X`09`09register int`09m = (top_line >= 0) ? \1109: 0;
X`09`09register int`09n = top_line + line_height(wp, lp);
X`09`09while (n > m)
X`09`09`09if (--n < mode_row(wp)) `7B
X`09`09&0209vscreen`5Bn`5D->v_flag `7C= VFCHG;
X`09`09&0209vscreen`5Bn`5D->v_flag `26= `7EVFREQ;
X`09`09`09`7D
X`09`09taboff = 0;
X`09`7D else
X#endif
X`09`7B
X`09`09vscreen`5Bsline`5D->v_flag `7C= VFCHG;
X`09`09vscreen`5Bsline`5D->v_flag `26= `7EVFREQ;
X`09`09if (w_val(wp,WVAL_SIDEWAYS))
X`09`09`09taboff = w_val(wp,WVAL_SIDEWAYS);
X`09`7D
X`09left = taboff;
X
X`09if (lp != win_head(wp)) `7B
X`09`09vtmove(sline, -left);
X`09`09vtset(lp, wp);
X`09`09if (left `26`26 sline >= 0) `7B
X`09`09`09register int`09zero = nu_width(wp);
X`09`09`09vscreen`5Bsline`5D->v_text`5Bzero`5D = MRK_EXTEND_LEFT;
X`09`09`09if (vtcol <= zero) \0F06\0E06+1;
X`09`09`7D
X`09`7D else `7B
X`09`09vtmove(sline, 0);
X`09`09vtputc(MRK_EMPTY);
X`09`7D
X`09taboff = 0;
X#if`09OPT_COLOR
X`09if (sline >= 0) `7B
X`09`09ReqFcolor(vscreen`5Bsline`5D) = gfcolor;
X`09`09ReqBcolor(vscreen`5Bsline`5D) = gbcolor;
X`09`7D
X#endif
X`7D
X
X/*`09updpos:`09update the position of the hardware cursor and handle extended
V
X`09`09lines. This is the only update for simple moves.
X`09`09returns the screen column for the cursor, and
X`09`09a boolean indicating if full sideways scroll was necessary */
Xstatic int
Xupdpos(
Xint *screenrowp,
Xint *screencolp)
X`7B
X`09register LINEPTR lp;
X#ifdef WMDLINEWRAP
X`09register int i;
X#endif
X`09register int col, excess;
X`09register int collimit;
X`09int moved = FALSE;
X`09int nuadj = is_empty_buf(curwp->w_bufp) ? 0 : nu_width\1E06);
X`09int liadj = (w_val(curwp,WMDLIST)) ? 1 : 0;
X
X`09/* find the current row */
X`09lp = curwp->w_line.l;
X`09currow = TopRow(curwp);
X`09while (lp != DOT.l) `7B
X`09`09currow += line_height(curwp,lp);
X`09`09lp = lforw(lp);
X`09`09if (lp == curwp->w_line.l
X`09`09 `7C`7C currow > mode_row(curwp)) `7B
X`09`09`09mlforce("BUG:  lost dot updpos().  setting at top");
X`09`09`09lp = curwp->w_line.l = DOT.l = lforw(buf_head(curbp));
X`09`09`09currow = TopRow(curwp);
X`09`09`7D
X`09`7D
X
X`09/* find the current column */
X`09col = mk_to_vcol(DOT, w_val(curwp,WMDLIST), w_left_margin\1E06));
X
X#ifdef WMDLINEWRAP
X`09if (w_val(curwp,WMDLINEWRAP)) `7B
X`09`09curcol = col;
X`09`09collimit = term.t_ncol - nuadj;
X`09`09*screenrowp = currow;
X`09`09if (col >= collimit) `7B
X`09`09`09col -= collimit;
X`09`09`09*screenrowp += 1;
X`09`09`09if (col >= term.t_ncol)
X`09`09&0209*screenrowp += (col / term.t_ncol);
X`09`09`09*screencolp = col % term.t_ncol;
X`09`09`7D else `7B
X`09`09`09*screencolp = col + nuadj;
X`09`09`7D
X`09`09/* kludge to keep the cursor within the window */
X`09`09i = mode_row(curwp) - 1;
X`09`09if (*screenrowp > i) `7B
X`09`09`09*screenrowp = i;
X`09`09`09*screencolp = term.t_ncol - 1;
X`09`09`7D
X`09`09return FALSE;
X`09`7D else
X#endif
X`09 *screenrowp = currow;
X
X`09/* ...adjust to offset from shift-margin */
X`09curcol = col - w_val(curwp,WVAL_SIDEWAYS);
X`09*screencolp = curcol;
X
X`09/* if extended, flag so and update the virtual line image */
X`09collimit = col_limit(curwp);
X`09excess = curcol - collimit + liadj;
X`09if ((excess > 0) `7C`7C (\1007== 0 `26`26
X`09`09`09(DOT.o < llength(DOT.l) - 1 ))) `7B
X`09`09if (w_val(curwp,WMDHORSCROLL)) `7B
X`09`09`09(void)mvrightwind(TRUE, excess + collimit/2 );
X`09`09`09moved = TRUE;
X`09`09`7D else `7B
X`09`09`09*screencolp = updext_past(col, excess);
X`09`09`7D
X`09`7D else if (w_val(curwp,WVAL_SIDEWAYS) `26`26 (curcol < 1)) `7B
X`09`09if (w_val(curwp,WMDHORSCROLL)) `7B
X`09`09`09(void)mvleftwind(TRUE, -curcol + collimit/2 + 1);
X`09`09`09moved = TRUE;
X`09`09`7D else `7B
X`09`09`09*screencolp = updext_before(col);
X`09`09`7D
X`09`7D else `7B
X`09`09if (vscreen`5Bcurrow`5D->v_flag `26 VFEXT) `7B
X`09`09`09l_to_vline(curwp,lp,currow);
X`09`09`09vteeol();
X`09`09`09/* this line no longer is extended */
X`09`09`09vscreen`5Bcurrow`5D->v_flag `26= `7EVFEXT;
X`09`09`7D
X`09`7D
X`09if (!moved)
X`09`09*screencolp += nuadj;
X`09return moved;
X`7D
X
X/*`09upddex:`09de-extend any line that deserves it`09`09*/
X
Xstatic void
Xupddex(void)
X`7B
X`09register WINDOW *wp;
X`09register LINEPTR lp;
X`09register int i;
X
X`09for_each_visible_window(wp) `7B
X`09`09lp = wp->w_line.l;
X`09`09i = TopRow(wp);
X
X`09`09curtabval = tabstop_val(wp->w_bufp);
X
X`09`09while (i < mode_row(wp)) `7B
X`09`09`09if (i >= 0
X`09`09`09 `26`26 vscreen`5Bi`5D->v_flag `26 VFEXT) `7B
X`09`09&0209if ((wp != curwp)
X`09`09&0209 `7C`7C (lp != wp->w_dot.l)
X`09`09&0209 `7C`7C ((i != currow)
X`09`09&0209  `26`26 (curcol < col_limit(wp)))) `7B
X`09`09&0209`09l_to_vline(wp,lp,i);
X`09`09&0209`09vteeol();
X`09`09&0209`09/* this line no longer is extended */
X`09`09&0209`09vscreen`5Bi`5D->v_flag `26= `7EVFEXT;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09i += line_height(wp,lp);
X`09`09`09lp = lforw(lp);
X`09`09`7D
X`09`7D
X`09curtabval = tabstop_val(curbp);
X`7D
X
X/*`09updgar:`09if the screen is garbage, clear the physical\2608and
X`09`09the virtual screen and force a full update&0209*/
X
Xstatic void
Xupdgar(void)
X`7B
X#if !MEMMAP `26`26 !OPT_PSCREEN
X`09register int j;
X#endif
X`09register int i;
X
X`09for (i = 0; i < term.t_nrow; ++i) `7B
X`09`09vscreen`5Bi`5D->v_flag `7C= VFCHG;
X#if`09OPT_REVSTA
X`09`09vscreen`5Bi`5D->v_flag `26= `7EVFREV;
X#endif
X#if`09OPT_COLOR
X`09`09CurFcolor(vscreen`5Bi`5D) = -1;
X`09`09CurBcolor(vscreen`5Bi`5D) = -1;
X#endif
X#if`09! MEMMAP `26`26 ! OPT_PSCREEN
X`09`09for (j = 0; j < term.t_ncol; ++j) `7B
X`09`09`09CELL_TEXT(i,j) = ' ';
X#if OPT_VIDEO_ATTRS
X`09`09`09CELL_ATTR(i,j) = VFCOL;
X#endif /* OPT_VIDEO_ATTRS */
X`09`09`7D
X#endif
X`09`7D
X#if !OPT_PSCREEN
X#if`09OPT_COLOR
X`09TTforg(gfcolor);`09`09 /* Need to set before erasing. */
X`09TTbacg(gbcolor);
X#endif
X`09movecursor(0, 0);`09`09 /* Erase the screen. */
X`09TTeeop();
X#else
X`09kbd_erase_to_end(0);
X#endif
X`09sgarbf = FALSE;`09`09`09 /* Erase-page clears */
X`09kbd_flush();
X`7D
X
X/*`09updupd:`09update the physical screen from the virtu\1809`09*/
X
Xstatic void
Xupdupd(
Xint force GCC_UNUSED)`09/*\1506d update flag */
X`7B
X`09register int i;
X
X#if CAN_SCROLL
X`09if (scrflags `26 WFKILLS)
X`09`09(void)scrolls(FALSE);
X`09if (scrflags `26 WFINS)
X`09`09(void)scrolls(TRUE);
X`09scrflags = 0;
X#endif
X
X`09for (i = 0; i < term.t_nrow; ++i) `7B
X`09`09/* for each line that needs to be updated*/
X`09`09if ((vscreen`5Bi`5D->v_flag `26 (VFCHG`7CVFCOL)) != 0) `7B
X#if !DISP_X11
X`09`09`09if (TypeAhead(force))
X`09`09&0209return;
X#endif
X`09`09`09updateline(i, 0, term.t_ncol);
X`09`09`7D
X`09`7D
X`7D
X
X#if OPT_VIDEO_ATTRS
Xstatic void
Xupdattrs(WINDOW *wp)
X`7B
X    AREGION *ap;
X    int i;
X
X    L_NUM start_wlnum, end\0B06;
X    LINEPTR lp;
X    int rows;
X
X    /*
X     * Clear portion of virtual screen associated with window pointer
X     * of all attributes.
X     */
X    /* FIXME: color; need to set to value indicating fg and bg for window */
X    for (i = wp->w_toprow +\0F07ntrows - 1; i >\260E; i--)
X    `09set_vattrs(i, 0, 0, term.t_ncol);
X
X    /*
X     * No need to do any more work on this window if there are no
X     * attributes.
X     */
X    if (wp->w_bufp->b_attribs == NULL)
X`09return;
X
X    /*
X     * Compute starting and ending line numbers for the window.  We
X     * also fill in lmap which is used for mapping line numbers to
X     * screen row numbers.
X     */
X    lp = wp->w_line.l;
X    start_wlnum =
X    end_wlnum = line_no(wp->w_bufp, lp);
X    rows = wp->w_ntrows;
X    lmap`5Bend_wlnum - start\0E06`5D = TopRow(wp);
X    while ( (rows -= line_height(wp,lp)) > 0) `7B
X`09lp = lforw(lp);
X`09end_wlnum++;
X`09lmap`5Bend_wlnum - start\0E06`5D = TopRow(wp) + wp->w_ntrows - rows;
X    `7D
X
X    /*
X     * Set current attributes in virtual screen associated with window
X     * pointer.
X     */
X    for (ap = wp->w_bufp->b_attribs; ap != NULL;) `7B
X`09VIDEO_ATTR attr;
X`09C_NUM start_col, end_col;
X`09C_NUM rect_start_col = 0,\1406end\1208;
X`09L_NUM start_rlnum, end\0B08\1106\1E06\1D0Alnum;
X`09start_rlnum = line_no(wp->w_bufp, ap->ar_region.r_orig.l);
X`09end_rlnum = line_no(wp->w_bufp, ap->ar_region.r_end.l);
X
X`09/* Garbage collect empty visible regions */
X`09if (start_rlnum == end\0D06
X`09 `26`26 VATTRIB(ap->ar_vattr) != 0
X`09 `26`26 ap->ar_region.r_orig.o >=\1A11end.o) `7B
X`09    AREGION *nap = ap->ar_next;
X`09    free_attrib(wp->w_bufp, ap);
X`09    ap = nap;
X`09    continue;
X`09`7D
X
X`09if (start_rlnum > \0E06wlnum) `7B
X`09    start_lnum =\0D07rlnum;
X`09    lp = ap->ar_region.r_orig.l;
X`09`7D
X`09else `7B
X`09    start_lnum =\0D07wlnum;
X`09    lp = wp->w_line.l;
X`09`7D
X`09end_lnum = (end_rlnum < end_wlnum) ? end_\1906:\190A;
X`09attr = ap->ar_vattr;
+-+-+-+-+-+-+-+-  END  OF PART 42 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 43 -+-+-+-+-+-+-+-+
X`09if (ap->ar_shape == RECTANGLE) `7B
X`09    rect_start_col = mark2col(wp, ap->ar_region.r_orig);
X`09    rect_end_col   = mark2col(wp, ap->ar_region.r_end);
X`09    if (rect_end_col < rect_start_col) `7B
X`09`09    C_NUM col = rect_end_col;
X`09`09    rect_end_col =\0F06start_col;
X`09`09    rect_start_col = col;
X`09    `7D
X`09`7D
X`09for (lnum = start_lnum; lnum <= end\120B++, lp = lforw(lp)) `7B
X`09    int row, col;
X`09    if (ap->ar_shape == RECTANGLE) `7B
X`09`09start_col = rect_\1109;
X`09    `7D else if (lnum == start_rlnum) `7B
X`09`09start_col = mark2col(wp, ap->ar_region.r_orig);
X`09    `7D else `7B
X`09`09start_col = w_left_margin(wp) + nu_width(wp);
X`09    `7D
X
X`09    if (start_col < w_left_margin(wp))
X`09`09start_col = (lnum == \1506rlnum)
X`09`09`09? w_left_margin(wp) + nu_width(wp)
X`09`09`09: w_left_margin(wp);
X
X`09    if (ap->ar_shape == RECTANGLE) `7B
X`09`09end_col = rect_\0F07;
X`09    `7D else if (lnum == end_rlnum) `7B
X`09`09end_col = offs2col(wp, ap->ar_region.r_end.l,
X`09`09&0209   ap->ar_region.r_end.o - 1);
X`09    `7D else `7B
X`09`09end_col = offs2col(wp, lp, llength(lp));
X#ifdef WMDLINEWRAP
X`09`09if (w_val(wp,WMDLINEWRAP)
X`09`09 `26`26 (end_col % term.t_ncol) == 0)
X`09`09    end_col--;`09/* cannot highlight the newline */
X#endif
X`09    `7D
X`09    row = lmap`5Blnum - start_wlnum`5D;
X#ifdef WMDLINEWRAP
X`09    if (w_val(wp,WMDLINEWRAP))
X`09`09for (col = start_col; col <= end\1009++) `7B
X`09`09    int x = row + col / term.t_ncol;
X`09`09    if  (x < 0)
X`09`09`09continue;
X`09`09    if (x < mode_row(wp)) `7B
X`09`09`09int y = col % term.t_ncol;
X`09`09`09vscreen`5Bx`5D->v_attrs`5By`5D =
X`09`09`09    (vscreen`5Bx`5D->v_attrs`5By`5D `7C (attr `26 `7EVAREV))
X`09`09`09    `5E (attr `26 VAREV);
X`09`09    `7D
X`09`09    else
X`09`09`09break;
X`09`09`7D
X`09    else
X#endif
X`09    `7B
X`09`09if (end_col >= term.t_ncol)
X`09`09    end_col = term.t_ncol-1;
X`09`09for (col = start_col; col <= end\1009++)
X`09`09    vscreen`5Brow`5D->v_attrs`5Bcol`5D =
X`09`09`09(vscreen`5Brow`5D->v_attrs`5Bcol`5D `7C (attr `26 `7EVAREV))
X`09`09`09`5E (attr `26 VAREV);
X`09    `7D
X`09`7D
X`09ap = ap->ar_next;
X    `7D
X`7D
X#endif /* OPT_VIDEO_ATTRS */
X
X/*
X * Translate offset (into a line's text) into the display-column, taking into
V
X * account the tabstop, sideways, number- and list-modes.
X */
Xint
Xoffs2col(
XWINDOW`09*wp,
XLINEPTR`09lp,
XC_NUM`09offset)
X`7B
X`09int`09length = l\0A06(lp);
X`09int`09column = 0;
X`09int`09tabs = tabstop_val(wp->w_bufp);
X`09int`09list = w_val(wp,WMDLIST);
X`09int`09left =
X#ifdef WMDLINEWRAP`09/* overrides left/right scrolling */
X`09`09`09w_val(wp,WMDLINEWRAP) ? 0 :
X#endif
X`09`09`09w_val(wp,WVAL_SIDEWAYS);
X
X`09register C_NUM`09n, c;
X
X`09/* this makes the how-much-to-select calculation easier above */
X`09if (offset < 0)
X`09`09return offset;
X
X`09if (lp == win_head(wp)) `7B
X`09`09column = 0;
X`09`7D else `7B
X`09`09for (n = w_left_margin(wp); (n < offset) `26`26 (n <= length); n++) `7B
V
X`09`09`09c = (n >= length) ? '`5Cn' : lp->l_text`5Bn`5D;
X`09`09`09if (isPrint(c)) `7B
X`09`09&0209column++;
X`09`09`09`7D else if (list `7C`7C (c != '`5Ct')) `7B
X`09`09&0209column += (c `26 HIGHBIT) ? 4 : 2;
X`09`09`09`7D else if (c == '`5Ct') `7B
X`09`09&0209column = ((\0B07/ tabs) + 1) * tabs;
X`09`09`09`7D
X`09`09`7D
X`09`09column = \0907- left + nu_width(wp) + w_left_margin(wp);
X`09`7D
X`09return column;
X`7D
X
X/*
X * Translate a display-column (assuming an infinitely-wide \2C07) into the
X * line's offset, taking into account the tabstop, sideways, number and list
X * modes.
X */
X#if OPT_MOUSE `7C`7C defined(WMDLINEWRAP)
Xint
Xcol2offs(
XWINDOW`09*wp,
XLINEPTR`09lp,
XC_NUM`09col)
X`7B
X`09int`09tabs = tabstop_val(wp->w_bufp);
X`09int`09list = w_val(wp,WMDLIST);
X`09int`09left =
X#ifdef WMDLINEWRAP`09/* overrides left/right scrolling */
X`09`09`09w_val(wp,WMDLINEWRAP) ? 0 :
X#endif
X`09`09`09w_val(wp,WVAL_SIDEWAYS);
X`09int`09goal = col + left - nu_width(wp) - w_left_margin(wp);
X
X`09register C_NUM`09n;
X`09register C_NUM`09offset;
X`09register C_NUM`09len`09= llength(lp);
X`09register char`09*text`09= lp->l_text;
X
X`09if (lp == win_head(wp)) `7B
X`09`09offset = 0;
X`09`7D else `7B
X`09`09for (offset = w_left_margin(wp), n = 0;
X`09`09`09(offset < len) `26`26 (n < goal);
X`09`09&0209offset++) `7B
X`09`09`09register int c = text`5Boffset`5D;
X`09`09`09if (isPrint(c)) `7B
X`09`09&0209n++;
X`09`09`09`7D else if (list `7C`7C (c != '`5Ct')) `7B
X`09`09&0209n += (c `26 HIGHBIT) ? 4 : 2;
X`09`09`09`7D else if (c == '`5Ct') `7B
X`09`09&0209n = ((n / tabs) + 1) * tabs;
X`09`09`09`7D
X`09`09`09if (n > goal)
X`09`09&0209break;
X`09`09`7D
X`09`7D
X`09return offset;
X`7D
X#endif
X
X/*
X * Compute the number of rows required for displaying a line.
X */
X#ifdef WMDLINEWRAP
Xint
Xline_height(
XWINDOW`09*wp,
XLINEPTR`09lp)
X`7B
X`09int hi = 1;
X`09if (w_val(wp,WMDLINEWRAP)) `7B
X`09`09int`09len = llength(lp);
X`09`09if (len > 0) `7B
X`09`09`09int col = offs2col(wp,lp,len) - 1;
X`09`09`09if (ins_mode(wp) != FALSE
X`09`09`09 `26`26 lp == DOT.l
X`09`09`09 `26`26 len <= DOT.o) `7B
X`09`09&0209col++;
X`09`09&0209if (w_val(wp,WMDLIST))
X`09`09&0209`09col++;
X`09`09`09`7D else if (w_val(wp,WMDLIST)) `7B
X`09`09&0209col += 2;
X`09`09`09`7D
X`09`09`09hi = (col / term.t_ncol) + 1;
X`09`09`7D
X`09`7D
X`09return hi;
X`7D
X#endif
X
X/*
X * Given a row on the screen, determines which window it belongs to.  Returns
V
X * null only for the message line.
X */
X#if defined(WMDLINEWRAP) `7C`7C OPT_MOUSE
XWINDOW *
Xrow2window (int row)
X`7B
X`09register WINDOW *wp;
X
X`09for_each_visible_window(wp)
X`09`09if (row >= wp->w_toprow `26`26 row <= mode_row(wp))
X`09`09`09return wp;
X`09return 0;
X`7D
X#endif
X
X/*
X * Highlight the requested portion of the screen.  We're mucking with the vide
Vo
X * attributes on the line here, so this is NOT good code - it would be better
V
X * if there was an individual colour attribute per character, rather than per
V
X * row, but I didn't write the original code.  Anyway, hilite is called only
X * once so far, so it's not that big a deal.
X */
Xvoid
Xhilite(
Xint`09row,`09`09/* row to start highlighting */
Xint`09colfrom,`09/* column to start highlighting */
Xint`09colto,`09`09/* column to end highlighting */
Xint`09on)`09`09/* start highlighting */
X`7B
X#if !OPT_VIDEO_ATTRS
X`09register VIDEO *vp1 = vscreen`5Brow`5D;
X#endif
X#ifdef WMDLINEWRAP
X`09WINDOW`09*wp = row2window(row);
X`09if (w_val(wp,WMDLINEWRAP)) `7B
X`09`09if (colfrom < 0)
X`09`09`09colfrom = 0;
X`09`09if (colfrom > term.t_ncol) `7B
X`09`09`09do `7B
X`09`09&0209row++;
X`09`09&0209colfrom -= term.t_ncol;
X`09`09&0209colto   -= term.t_ncol;
X`09`09&0209hilite(row, colfrom, colto, on);
X`09`09`09`7D while (colto > term.t_ncol);
X`09`09`09return;
X`09`09`7D
X`09`7D
X#endif
X`09if (row < term.t_nrow-1 `26`26 (colfrom >= 0 `7C`7C colto <= \2B08col)) `7B
V
X`09`09if (colfrom < 0)
X`09`09`09colfrom = 0;
X`09`09if (colto > term.t_ncol)
X`09`09`09colto = term.t_ncol;
X#if OPT_VIDEO_ATTRS
X`09`09if (on) `7B
X`09`09    int col;
X`09`09    for (col=colfrom; col<colto; col++)
X`09`09`09vscreen`5Brow`5D->v_attrs`5Bcol`5D `7C= VAREV;
X`09`09`7D
X`09`09else `7B
X`09`09    int col;
X`09`09    for (col=colfrom; col<colto; col++)
X`09`09`09vscreen`5Brow`5D->v_attrs`5Bcol`5D `26= `7EVAREV;
X`09`09`7D
X`09`09vscreen`5Brow`5D->v_flag `7C= VFCHG;
X`09`09updateline(row, 0, term.t_ncol);
X#else /* OPT_VIDEO_ATTRS */
X`09`09if (on) `7B
X`09`09`09vp1->v_flag `7C= VFREQ;
X`09`09`7D else `7B
X`09`09`09vp1->v_flag `26= `7EVFREQ;
X`09`09`7D
X`09`09updateline(row, colfrom, colto);
X#endif /* OPT_VIDEO_ATTRS */
X`09`7D
X`7D
X
X#if CAN_SCROLL
X/* optimize out scrolls (line breaks, and newlines) */
X/* arg. chooses between looking for inserts or deletes */
Xstatic int
Xscrolls(int inserts)`09/* returns true if it does something */
X`7B
X`09struct`09VIDEO *vpv ;`09/* virtual screen image */
X`09struct`09VIDEO *vpp ;`09/* physical screen image */
X`09int`09i, j, k ;
X`09int`09rows, cols ;
X`09int`09first, match, count, ptarget = 0, v\0D0A;
X`09SIZE_T`09end;
X`09int`09longmatch, longcount;
X`09int`09longinplace, \0907;`09/* count of lines which are already
X`09`09&0209`09   in the right place */
X`09int`09from, to;
X
X`09if (term.t_scroll == null_\1108) /* no way to \2607*/
X`09`09return FALSE;
X
X`09rows = term.t_nrow -1;
X`09cols = term.t_ncol ;
X
X`09first = -1 ;
X`09for (i = 0; i < rows; i++) `7B`09/* find first wrong line */
X`09`09if (!texttest(i,i)) `7B
X`09`09`09first = i;
X`09`09`09break;
X`09`09`7D
X`09`7D
X
X`09if (first < 0)
X`09`09return FALSE;&0209/* no text changes */
X
X`09vpv = vscreen`5Bfirst`5D ;
X`09vpp = PScreen(first) ;
X
X`09if (inserts) `7B
X`09`09/* determine types of potential scrolls */
X`09`09end = endofline(vpv->v_text,cols) ;
X`09`09if ( end == 0 )
X`09`09`09ptarget = first ;&0209/* newlines */
X`09`09else if ( memcmp(vpp->v_text, vpv\0D0Aend) == 0 )
X`09`09`09ptarget = first + 1 ;`09/* broken line newlines */
X`09`09else
X`09`09`09ptarget = first ;
X`09`09from = ptarget;
X`09`7D else `7B
X`09`09from = vtarget = first + 1 ;
X`09`7D
X
X`09/* find the matching shifted area */
X`09longmatch = -1;
X`09longcount = 0;
X`09longinplace = 0;
X`09for (i = from+1; i < rows; i++) `7B
X`09`09if (inserts ? texttest(i,from) :\130Afrom,i) ) `7B
X`09`09`09match = i ;
X`09`09`09count = 1 ;
X`09`09`09inplace = texttest(match, match) ? 1 : 0;
X`09`09`09for (j=match+1, k=from+1; j<rows `26`26 k<rows; j++, k++) `7B
X`09`09&0209if (inserts ? texttest(j,k) :\100Ak,j)) `7B
X`09`09&0209`09count++ ;
X`09`09&0209`09if (texttest(j,j))
X`09`09&0209&0209inplace++;
X`09`09&0209`7D
X`09`09&0209else
X`09`09&0209`09break ;
X`09`09`09`7D
X`09`09`09if (longcount - longinplace < \1608\1207) `7B
X`09`09&0209longcount = count;
X`09`09&0209longmatch = match;
X`09`09&0209longinplace = \0A07;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09match = longmatch;
X`09count = longcount;
X
X`09if (!inserts) `7B
X`09`09/* full kill case? */
X`09`09if (match > 0 `26`26 texttest(first, match-1)) `7B
X`09`09`09vtarget-- ;
X`09`09`09match-- ;
X`09`09`09count++ ;
X`09`09`7D
X`09`7D
X
X`09/* do the scroll */
X`09if (match>0 `26`26 count>2) `7B`09`09 /* got a scroll */
X`09`09/* move the count lines starting at ptarget to match */
X`09`09/* mlwrite("scrolls: move the %d lines starting at %d to %d",
X`09`09&0209&0209count,ptarget,match);
X`09`09*/
X`09`09if (inserts) `7B
X`09`09`09from = ptarget;
X`09`09`09to = match;
X`09`09`7D else `7B
X`09`09`09from = match;
X`09`09`09to = vtarget;
X`09`09`7D
X#if OPT_PSCREEN
X`09`09/*
X`09`09 * Update lines _before_ the scroll so that they will
X`09`09 * be available for any updates which need to be done
X`09`09 * (due to a GraphicsExpose event in X11...these occur
X`09`09 * when scrolling a partially obscured window).  Note
X`09`09 * that in the typical case of scrolling a line or two
X`09`09 * that very few memory accesses are performed.  We
X`09`09 * mostly shuffle pointers around.
X`09`09 */
X#define SWAP_PLINE(a, b) do `7B VIDEO *temp = pscreen`5Ba`5D;`09`5C
X`09`09`09      pscreen`5Ba`5D =\0D09b`5D;`09`5C
X`09`09`09      pscreen`5Bb`5D = temp; `7D one_time
X#define CLEAR_PLINE(a)  do `7B`09`09&0209&0209`5C
X`09`09`09    MARK_LINE_DIRTY(a);&0309`09`5C
X`09`09`09    for (j = 0; j < term.t_ncol; j++) `7B&0209`5C
X`09`09&0209CELL_TEXT(a,j) = ' ';&0309`5C
X`09`09&0209CELL_ATTR(a,j) = VFCOL;&0309`5C
X`09`09`09    `7D&0309&0309`5C
X`09`09`09  `7D one_time
X`09`09if (from < to) `7B
X`09`09    /* FIXME: color */
X`09`09    for (i = from; i < to; i++)
X`09`09`09CLEAR_PLINE(i+count);
X`09`09    for (i = count-1; i >= 0; i--)
X`09`09`09SWAP_PLINE(from+i, to+i);
X`09`09`7D
X`09`09else `7B
X`09`09    /* FIXME: color */
X`09`09    for (i = to; i < from; i++)
X`09`09`09CLEAR_PLINE(i);
X`09`09    for (i = 0; i < count; i++)
X`09`09`09SWAP_PLINE(from+i, to+i);
X`09`09`7D
X#endif /* OPT_PSCREEN */
X`09`09scrscroll(from, to, count) ;
X#if !OPT_PSCREEN
X`09`09for (i = 0; i < count; i++) `7B
X`09`09`09vpp = PScreen(to+i) ;
X`09`09`09vpv = vscreen`5Bto+i`5D;
X`09`09`09(void)memcpy(vpp->v_text, vpv\0D0A(SIZE_T)cols) ;
X`09`09`7D
X#if OPT_VIDEO_ATTRS `26`26 !MEMMAP
X#define SWAP_ATTR_PTR(a, b) do `7B VIDEO_ATTR *temp = pscreen`5Ba`5D->v_attrs;
V  `5C
X`09`09`09         pscreen`5Ba`5D->v_attrs =\1609b\160A; `5C
X`09`09`09         pscreen`5Bb`5D->v_attrs = temp; `7D one_time
X`09`09if (from < to) `7B
X`09`09    /* FIXME: color */
X`09`09    for (i = from; i < to; i++)
X`09`09`09for (j = 0; j < term.t_ncol; j++)
X`09`09`09    CELL_ATTR(i+count,j) = 0;
X`09`09    for (i = count-1; i >= 0; i--)
X`09`09`09SWAP_ATTR_PTR(from+i, to+i);
X
X`09`09`7D
X`09`09else `7B
X`09`09    /* FIXME: color */
X`09`09    for (i = to; i < from; i++)
X`09`09`09for (j = 0; j < term.t_ncol; j++)
X`09`09`09    CELL_ATTR(i,j) = 0;
X`09`09    for (i = 0; i < count; i++)
X`09`09`09SWAP_ATTR_PTR(from+i, to+i);
X`09`09`7D
X#undef SWAP_ATTR_PTR
X#endif /* OPT_VIDEO_ATTRS */
X`09`09if (inserts) `7B
X`09`09`09from = ptarget;
X`09`09`09to = match;
X`09`09`7D else `7B
X`09`09`09from = vtarget+count;
X`09`09`09to = match+count;
X`09`09`7D
X`09`09for (i = from; i < to; i++) `7B
X`09`09`09char *txt;
X`09`09`09txt = PScreen(i)->v_text;
X`09`09`09for (j = 0; j < term.t_ncol; ++j)
X`09`09&0209txt`5Bj`5D = ' ';
X`09`09`09vscreen`5Bi`5D->v_flag `7C= VFCHG;
X`09`09`7D
X#endif /* !OPT_PSCREEN */
X`09`09return(TRUE) ;
X`09`7D
X`09return(FALSE) ;
X`7D
X
X/* move the "count" lines starting at "from" to "to" */
Xstatic void
Xscrscroll(int from, int to\0806count)
X`7B
X`09beginDisplay();
X`09ttrow = ttcol = -1;
X`09TTscroll(from,to,count);
X`09endofDisplay();
X`7D
X
Xstatic int
Xtexttest(`09`09/* return TRUE on text match */
Xint`09vrow,`09`09/* virtual row */
Xint`09prow)`09`09/* physical row */
X`7B
X`09struct`09VIDEO *vpv = vscreen`5Bvrow`5D ;`09/* virtual \1A06 image */
X`09struct`09VIDEO *vpp = PScreen(prow)  ;`09/* physical screen image */
X
X`09return (!memcmp(vpv->v_text, vpp\0D0A(SIZE_T)term.t_ncol)) ;
X`7D
X
X/* return the index of the first blank of trailing whitespace */
Xstatic int
Xendofline(char *s, int n)
X`7B
X`09int`09i;
X`09for (i = n - 1; i >= 0; i--)
X`09`09if (s`5Bi`5D != ' ') return(i+1) ;
X`09return(0) ;
X`7D
X
X#endif /* CAN_SCROLL */
X
X
X/* Update the extended line which the cursor is currently on at a column
X * greater than the terminal width.  The line will be scrolled right or left t
Vo
X * let the user see where the cursor is.
X */
Xstatic int
Xupdext_past(int col, int excess)
X`7B
X`09register int rcursor;
X`09register int zero = nu_width(curwp);
X
X`09/* calculate what column the real cursor will end up in */
X`09rcursor = ((excess - 1) % term.t_scrsiz) +\1108margin;
X`09taboff = col - rcursor;
X
X`09/* Scan through the line outputting characters to the virtual screen
X`09 * once we reach the left edge.  */
X
X`09/* start scanning offscreen */
X`09vtmove(currow, -taboff);
X`09vtset(DOT.l, curwp);
X
X`09/* truncate the virtual line, restore tab offset */
X`09vteeol();
X`09taboff = 0;
X
X`09/* and put a marker in column 1 */
X`09vscreen`5Bcurrow`5D->v_text`5Bzero`5D = MRK_EXTEND_LEFT;
X`09vscreen`5Bcurrow`5D->v_flag `7C= (VFEXT `7C VFCHG);
X`09return rcursor;
X`7D
X
X/* Update the extended line which the cursor is currently on at a column less
V
X * than the terminal width.  The line will be scrolled right or left to let th
Ve
X * user see where the cursor is.
X */
Xstatic int
Xupdext_before(int col)
X`7B
X`09register int rcursor;
X
X`09curcol = col;
X
X`09/* calculate what column the real cursor will end up in */
X`09rcursor = (col % (term.t_ncol - \0E07margin));
X`09taboff = col - rcursor;
X
X`09/* Scan through the line outputting characters to the virtual screen
X`09 * once we reach the left edge.  */
X`09vtmove(currow, -taboff);`09/* start scanning offscreen */
X`09vtset(DOT.l, curwp);
X
X`09/* truncate the virtual line, restore tab offset */
X`09vteeol();
X`09taboff = 0;
X
X`09if (col != rcursor) `7B /* ... put a marker in column 1 */
X`09`09vscreen`5Bcurrow`5D->v_text`5Bnu_width(curwp)`5D = MRK_EXTEND_LEFT;
X`09`09vscreen`5Bcurrow`5D->v_flag `7C= VFEXT;
X`09`7D
X`09vscreen`5Bcurrow`5D->v_flag `7C= (VFEXT`7CVFCHG);
X`09return rcursor;
X`7D
X
X
X
X/*
X * Update a single line. This does not know how to use insert or delete
X * character sequences; we are using VT52 functionality. Update the physical
X * row and column variables. It does try an exploit erase to end of line.
X */
X#if`09MEMMAP
X/*`09UPDATELINE specific code for the IBM-PC and other compatibles */
X
Xstatic void
Xupdateline(
X
Xint`09row,`09`09/* row of screen to update */
Xint`09colfrom,`09/* first column on screen */
Xint`09colto)`09`09/* last column on screen */
X
X`7B
X`09register struct VIDEO *vp1 = vscreen`5Brow`5D;`09/* virtual screen image */
V
X`09register int`09req = (vp1->v_flag `26 VFREQ) == VFREQ;
X
X#if`09OPT_COLOR
X`09CurFcolor(vp1) = Req\110B;
X`09CurBcolor(vp1) = Req\110B;
X#endif
X#if OPT_VIDEO_ATTRS
X`09scwrite(row, colfrom, colto -\1109
X`09`09VideoText(vp1),
X`09`09VideoAttr(vp1),
X`09`09ReqFcolor(vp1),
X`09`09ReqBcolor(vp1));
X#else`09/* highlighting, anyway */
X`09scwrite(row, colfrom, colto -\1109
X`09`09VideoText(vp1),
X`09`09(VIDEO_ATTR *)0,
X`09`09req ? ReqBcolor(vp1) : ReqF\110A,
X`09`09req ? ReqFcolor(vp1) : ReqB\110A);
X#endif
X`09vp1->v_flag `26= `7E(VFCHG `7C VFCOL); /* flag this line as updated */
X`09if (req)
X`09`09vp1->v_flag `7C= VFREV;
X`09else
X`09`09vp1->v_flag `26= `7EVFREV;
X`7D
X
X#else`09/* !MEMMAP */
X#if`09OPT_PSCREEN
Xstatic void
Xupdateline(
X    int`09row,`09`09/* row of screen to update */
X    int`09colfrom,`09/* col to start updating from */
X    int`09colto)`09`09/* col to go to */
X`7B
X    register char *vc, *pc, *evc;
X    register VIDEO_ATTR *va, *pa;
X    int nchanges = 0;
X
X    if ((vscreen`5Brow`5D->v_flag `26 VFCHG) == 0)
X`09return;
X
X    vc  = `26vscreen`5Brow`5D->v_text`5Bcolfrom`5D;
X    evc = `26vscreen`5Brow`5D->v_text`5Bcolto`5D;
X    va  = `26vscreen`5Brow`5D->v_attrs`5Bcolfrom`5D;
X    pc  = `26CELL_TEXT(row,colfrom);
X    pa  = `26CELL_ATTR(row,colfrom);
X
X    while (vc < evc) `7B
X`09if (*vc != *pc `7C`7C VATTRIB(*va) != \1009pa)) `7B
X`09    *pc = *vc;
X`09    *pa = *va `7C VADIRTY;
X`09    nchanges++;
X`09`7D
X`09vc++;
X`09pc++;
X`09va++;
X`09pa++;
X    `7D
X
X    if (nchanges > 0)
X`09MARK_LINE_DIRTY(row);
X    vscreen`5Brow`5D->v_flag `26= `7E(VFCHG `7C VFCOL); /* mark virtual line u
Vpdated */
X`7D
X
X#else  /* !OPT_PSCREEN */
X
X/*`09UPDATELINE code for all other versions`09`09*/
X
X#define TTattr(a) TTrev(a) /* FIXME */
X
Xstatic void
Xupdateline(
X
Xint`09row,`09`09/* row of screen to update */
Xint`09colfrom,`09/* first column on screen */
Xint`09colto)`09`09/* first column on screen */
X
X`7B
X`09struct VIDEO *vp1 = vscreen`5Brow`5D;`09/* virtual \1806 image */
X`09struct VIDEO *vp2 = PSCREEN`5Brow`5D;`09/* physical screen image */
X`09register int xl = colfrom;
X`09register int xr = colto;
X`09register int xx;
X
X`09register char *cp1 = VideoText(vp1);
X`09register char *cp2 = VideoText(vp2);
X`09register int nbflag;`09/* non-blanks to the right flag? */
X
X#if OPT_VIDEO_ATTRS
X`09register VIDEO_ATTR *ap1 = VideoAttr(vp1);
X`09register VIDEO_ATTR *ap2 = VideoAttr(vp2);
X`09VIDEO_ATTR Blank = 0;`09/* FIXME: Color? */
X#else
X`09UINT rev;`09`09/* reverse video flag */
X`09UINT req;`09`09/* reverse video request flag */
X#endif
X
X#if !OPT_VIDEO_ATTRS
X#if`09OPT_COLOR
X`09TTforg(ReqFcolor(vp1));
X`09TTbacg(ReqBcolor(vp1));
X#endif
X
X#if`09OPT_REVSTA `7C`7C OPT_COLOR
X`09/* if we need to change the reverse video status of the
X`09   current line, we need to re-write the entire line     */
X`09rev = (vp1->v_flag `26 VFREV) == VFREV;
X`09req = (vp1->v_flag `26 VFREQ) == VFREQ;
X`09if ((rev != req)
X#if`09OPT_COLOR
X`09    `7C`7C (CurFcolor(vp1) != Req\120B)
X`09    `7C`7C (CurBcolor(vp1) != Req\120B)
X#endif
X`09`09`09) `7B
X`09`09movecursor(row, colfrom);`09/* Go to start of line. */
X`09`09/* set rev video if needed */
X`09`09if (req)
X`09`09`09TTrev(req);
X
X`09`09/* scan through the line and dump it to the screen and
X`09`09   the virtual screen array&0209&0209*/
X`09`09for (; xl < colto; xl++) `7B
X`09`09`09TTputc(cp1`5Bxl`5D);
X`09`09`09++ttcol;
X`09`09`09cp2`5Bxl`5D = cp1`5Bxl`5D;
X`09`09`7D
X`09`09/* turn rev video off */
X`09`09if (req)
X`09`09`09TTrev(FALSE);
X
X`09`09/* update the needed flags */
X`09`09vp1->v_flag `26= `7E(VFCHG`7CVFCOL);
X`09`09if (req)
X`09`09`09vp1->v_flag `7C= VFREV;
X`09`09else
X`09`09`09vp1->v_flag `26= `7EVFREV;
X#if`09OPT_COLOR
X`09`09CurFcolor(vp1) = Req\110B;
X`09`09CurBcolor(vp1) = Req\110B;
X#endif
X`09`09return;
X`09`7D
X#else
X`09rev = FALSE;
X#endif`09/* OPT_REVSTA `7C`7C OPT_COLOR */
X#endif`09/* !OPT_VIDEO_ATTRS */
X
X`09/* advance past any common chars at the left */
X#if !OPT_VIDEO_ATTRS
X`09if (!rev)
X#endif`09/* !OPT_VIDEO_ATTRS */
X`09`09while (xl != colto
X`09`09    `26`26 cp1`5Bxl`5D == cp2`5Bxl`5D
X#if OPT_VIDEO_ATTRS
X`09`09    `26`26 VATTRIB(ap1`5Bxl`5D) ==\140B2`5Bxl`5D)
X#endif`09/* OPT_VIDEO_ATTRS */
X`09`09      ) `7B
X`09`09`09++xl;
X`09`09`7D
X
X/* This can still happen, even though we only call this routine on changed
X * lines. A hard update is always done when a line splits, a massive
X * change is done, or a buffer is displayed twice. This optimizes out most
X * of the excess updating. A lot of computes are used, but these tend to
X * be hard operations that do a lot of update, so I don't really care.
X */
X`09/* if both lines are the same, no update needs to be done */
X`09if (xl == colto) `7B
X`09`09vp1->v_flag `26= `7EVFCHG;`09/* flag this line unchanged */
X`09`09return;
X`09`7D
X
X`09/* find out if there is a match on the right */
X`09nbflag = FALSE;
X
X#if !OPT_VIDEO_ATTRS
X`09if (!rev)
X#endif
X`09`09while (cp1`5Bxr-1`5D == cp2\0D06
X#if OPT_VIDEO_ATTRS
X`09`09    `26`26 VATTRIB(ap1`5Bxr-1`5D) ==\160B2\1607
X#endif
X`09`09 ) `7B
X`09`09`09--xr;
X`09`09`09/* Note if any nonblank in right match */
X`09`09`09if (cp1`5Bxr`5D != ' '
X#if OPT_VIDEO_ATTRS
X`09`09`09 `7C`7C VATTRIB(ap1`5Bxr`5D != Blank)
X#endif
X`09`09`09  )
X`09`09&0209nbflag = TRUE;
X`09`09`7D
X
X`09xx = xr;
X
X`09/* Erase to EOL ? */
X`09if (nbflag == FALSE
X`09 `26`26 eolexist == TRUE
X#if`09OPT_REVSTA `26`26 !OPT_VIDEO_ATTRS
X`09 `26`26 (req != TRUE)
X#endif
X`09   ) `7B
X`09`09while ((xx != xl)
X`09`09    `26`26 cp1`5Bxx-1`5D == ' '
X#if OPT_VIDEO_ATTRS
X`09`09    `26`26 VATTRIB(ap1`5Bxx-1`5D) == Blank
X#endif
X`09`09)
X`09`09`09xx--;
X
X`09`09if ((xr - xx) <= 3)&0209/* Use only if erase is */
X`09`09`09xx = xr;&0209/* fewer characters. */
X`09`7D
X
X`09movecursor(row, xl - colfrom);`09`09/* Go to start of line. */
X#if OPT_VIDEO_ATTRS
X`09while (xl < xx) `7B
X`09`09register int j = xl;
X`09`09VIDEO_ATTR attr = VATTRIB(ap1`5Bj`5D);
X`09`09while ((j < xx) `26`26 (attr == VATTRIB(ap1`5Bj`5D)))
X`09`09`09j++;
X`09`09TTattr(attr);
X`09`09for (; xl < j; xl++) `7B
X`09`09`09TTputc(cp1`5Bxl`5D);
X`09`09`09++ttcol;
X`09`09`09cp2`5Bxl`5D = cp1`5Bxl`5D;
X`09`09`09ap2`5Bxl`5D = ap1`5Bxl`5D;
X`09`09`7D
X`09`7D
X`09TTattr(0);
X
X`09if (xx != xr) `7B`09`09&0209/* Erase. */
X`09`09TTeeol();
X`09`09for (; xl < xr; xl++) `7B
X`09`09`09if (cp2`5Bxl`5D != cp1`5Bxl`5D
X`09`09`09 `7C`7C VATTRIB(ap2`5Bxl`5D) !=\140B1`5Bxl`5D))
X`09`09&0209ap2`5Bxl`5D = ap1`5Bxl`5D;
X`09`09`09cp2`5Bxl`5D = cp1`5Bxl`5D;
X`09`09`7D
X`09`7D
X#else /* OPT_VIDEO_ATTRS */
X#if`09OPT_REVSTA
X`09TTrev(rev);
X#endif
X
X`09for (; xl < xr; xl++) `7B`09`09/* Ordinary. */
X`09`09TTputc(cp1`5Bxl`5D);
X`09`09++ttcol;
X`09`09cp2`5Bxl`5D = cp1`5Bxl`5D;
X`09`7D
X
X`09if (xx != xr) `7B`09`09/* Erase. */
X`09`09TTeeol();
X`09`09for (; xl < xr; xl++) `7B
X`09`09`09cp2`5Bxl`5D = cp1`5Bxl`5D;
X`09`09`7D
X`09`7D
X#if`09OPT_REVSTA
X`09TTrev(FALSE);
X#endif
X#endif /* OPT_VIDEO_ATTRS */
X`09vp1->v_flag `26= `7E(VFCHG`7CVFCOL);`09/* flag this line as updated */
X`09return;
X`7D
X#endif  /* OPT_PSCREEN(updateline) */
X#endif`09/* MEMMAP(updateline) */
X
X/*
X * Redisplay the mode line for the window pointed to b\2B06"wp".
X * modeline() is the only routine that has any idea of how the \3C08 is
X * formatted.  You can change the modeline \2806 by hacking at this
X * routine.  Called by "update" any time there is a dirty window.
X */
X#if OPT_MLFORMAT
Xstatic void
Xmlfs_prefix(
X    char **fsp,
X    char **msp,
X    int lchar)
X`7B
X    register char *fs = *fsp;
X    register char *ms = *msp;
X    if (*fs == ':') `7B
X`09fs++;
X`09while (*fs `26`26 *fs != ':') `7B
X`09    if (*fs != '%')
X`09`09*ms++ = *fs++;
X`09    else `7B
X`09`09fs++;
X`09`09switch(*fs++) `7B
X`09`09    case EOS :
X`09`09`09fs--;
X`09`09`09break;
X`09`09    case '%' :
X`09`09`09*ms++ = '%';
X`09`09`09break;
X`09`09    case ':' :
X`09`09`09*ms++ = ':';
X`09`09`09break;
X`09`09    case '-' :
X`09`09`09*ms++ = (char)lchar;
X`09`09`09break;
X`09`09    default :
X`09`09`09*ms++ = '%';
X`09`09`09*ms++ = *(fs-1);
X`09`09`09break;
X`09`09`7D
X`09    `7D
X`09`7D
X    `7D
X    *fsp = fs;
X    *msp = ms;
X`7D
X
Xstatic void
Xmlfs_suffix(
X    char **fsp,
X    char **msp,
X    int lchar)
X`7B
X    mlfs_prefix(fsp, msp, lchar);
X    if (**fsp == ':')
X`09(*fsp)++;
X`7D
X
Xstatic void
Xmlfs_skipfix(char **fsp)
X`7B
X    register char *fs = *fsp;
X    if (*fs == ':') `7B
X`09for (fs++;*fs `26`26 *fs != ':'; fs++);
X`09if (*fs == ':')
X`09    fs++;
X`09for (;*fs `26`26 *fs != ':'; fs++);
X`09if (*fs == ':')
X`09    fs++;
X    `7D
X    *fsp = fs;
X`7D
X#endif /* OPT_MLFORMAT */
X
X#define PutModename(format, name) `7B `5C
X`09`09if (ms != 0) `7B `5C
X`09`09`09ms = lsprintf(ms, format, `5C
X`09`09&0209mcnt ? ' ' : '`5B', `5C
X`09`09&0209name); `5C
X`09`09`7D `5C
X`09`09mcnt++; `5C
X`09`7D
X
X#define PutMode(mode,name) `5C
X`09if (b_val(bp, mode)) PutModename("%c%s", name)
X
X#if OPT_MAJORMODE
X#define PutMajormode(bp) if (bp->majr != 0) PutModename("%c%smode", \2708->nam
Ve)
X#else
X#define PutMajormode(bp) /*nothing*/
X#endif
X
Xstatic int
Xmodeline_modes(
XBUFFER *bp,
Xchar`09**msptr)
X`7B
X`09register char *ms = msptr ? *msptr : 0;
X`09register SIZE_T mcnt = 0;
X
X#if SYS_VMS `7C`7C HAVE_LOSING_SWITCH_WITH_STRUCTURE_OFFSET
X`09PutMajormode(bp)
X#if !OPT_MAJORMODE
X`09PutMode(MDCMOD,`09`09"cmode")
X#endif
X#if OPT_ENCRYPT
X`09PutMode(MDCRYPT,`09"crypt")
X#endif
X`09PutMode(MDDOS,`09`09"dos-style")
X`09PutMode(MDREADONLY,`09"read-only")
X`09PutMode(MDVIEW,`09`09"view-only")
X#if OPT_LCKFILES
X`09PutMode(MDLOCKED,`09"locked by")
X#endif
X#else
X`09static`09const`09struct `7B
X`09`09int   mode;
X`09`09const char *name;
X`09`7D table`5B`5D = `7B
X#if !OPT_MAJORMODE
X`09`09`7BMDCMOD,    "cmode"`7D,
X#endif
X#if OPT_ENCRYPT
X`09`09`7BMDCRYPT,   "crypt"`7D,
X#endif
X`09`09`7BMDDOS,     "dos-style"`7D,
X`09`09`7BMDREADONLY,"read-only"`7D,
X`09`09`7BMDVIEW,    "view-only"`7D,
X#if OPT_LCKFILES
X`09`09`7BMDLOCKED,  "locked by"`7D,  /* keep this last */
X#endif
X`09`7D;
X`09register SIZE_T j;
X
X`09PutMajormode(bp)
X`09for (j = 0; j < TABLESIZE(table); j++) `7B
X`09`09PutMode(table`5Bj`5D.mode, \0F09name)
X`09`7D
X#endif
X#if OPT_LCKFILES
X`09if (ms != 0 `26`26 b_val(bp, MDLOCKED))
X`09`09ms = lsprintf(ms, " %s", b_val_ptr(bp,VAL_LOCKER));
X#endif
X`09if (mcnt `26`26 ms)
X`09`09*ms++ = '`5D';
X`09if (b_is_changed(bp)) `7B
X`09`09if (ms != 0)
X`09`09`09ms = lsprintf(ms, "%s`5Bmodified`5D", mcnt ? " " : "");
X`09`09mcnt++;
X`09`7D
X`09if (ms != 0)
X`09`09*msptr = ms;
X`09return (mcnt != 0);
X`7D
X
Xstatic int
Xmodeline_show(
XWINDOW *wp,
Xint lchar)
X`7B
X`09register int ic = lchar;
X`09register BUFFER *bp = wp->w_bufp;
X
X`09if (b_val(bp, MDSHOWMODE)) `7B
X#ifdef insertmode`09/*\0E07 mode is a trait for each window */
X`09`09if (wp->w_traits.insmode == INSERT)
X`09`09`09ic = 'I';
X`09`09else if (wp->w_traits.insmode == REPLACECHAR)
X`09`09`09ic = 'R';
X`09`09else if (wp->w_traits.insmode == OVERWRITE)
X`09`09`09ic = 'O';
X#else `09`09`09/* insertmode is a variable global to all windows */
X`09`09if (wp == curwp) `7B
X`09`09`09if (insertmode == INSERT)
X`09`09&0209ic = 'I';
X`09`09`09else if (insertmode == REPLACECHAR)
X`09`09&0209ic = 'R';
X`09`09`09else if (insertmode == OVERWRITE)
X`09`09&0209ic = 'O';
X`09`09`7D
X#endif /* !defined(insertmode) */
X#if OPT_ICURSOR
X`09`09TTicursor(ic != lchar);
X#endif
X`09`7D
X`09return ic;
X`7D
X
Xstatic const char *
Xrough_position(WINDOW *wp)
X`7B
X`09LINE *lp = wp->w_line.l;
X`09int rows = wp->w_ntrows;
X`09const char *msg = 0;
X
X`09while (rows-- > 0) `7B
X`09`09lp = lforw(lp);
+-+-+-+-+-+-+-+-  END  OF PART 43 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 44 -+-+-+-+-+-+-+-+
X`09`09if (lp == win_head(wp)) `7B
X`09`09`09msg = "bot";
X`09`09`09break;
X`09`09`7D
X`09`7D
X`09if (lback(wp->w_line.l) == win_head(wp)) `7B
X`09`09if (msg) `7B
X`09`09`09if (wp->w_line.l == win_head(wp))
X`09`09&0209msg = "emp";
X`09`09`09else
X`09`09&0209msg = "all";
X`09`09`7D else `7B
X`09`09`09msg = "top";
X`09`09`7D
X`09`7D
X`09if (!msg)
X`09`09msg = "mid";
X`09return msg;
X`7D
X
Xstatic void
Xmodeline(WINDOW *wp)
X`7B
X#if OPT_MLFORMAT
X    char *fs = modeline_format;
X    int fc;
X#endif
X    char temp`5BNFILEN`5D;
X    char left_ms`5BNFILEN*2`5D;
X    char right_ms`5BNFILEN*2`5D;
X    char *ms;
X    register int n;
X    int lchar;
X    int col;
X    int right_len;
X    int need_eighty_column_indicator = FALSE;
X    register BUFFER *bp;
X
X    left_ms`5B0`5D = righ\0E0AEOS;
X    ms = left_ms;
X
X    n = mode_row(wp);      `09/* Location. */
X#if OPT_VIDEO_ATTRS
X    `7B
X`09VIDEO_ATTR attr;
X`09if (wp == curwp)
X`09    attr = VAMLFOC;
X`09else
X`09    attr = VAML;
X#if`09OPT_REVSTA
X`09attr `7C= VAREV;
X#endif
X`09vscreen`5Bn`5D->v_flag `7C= VFCHG;
X`09set_vattrs(n, 0, attr, term.t_ncol);
X    `7D
X#else
X    vscreen`5Bn`5D->v_flag `7C= VFCHG `7C VFREQ `7C VFCOL;/* Redraw next time.
V */
X#endif
X#if`09OPT_COLOR
X    ReqFcolor(vscreen`5Bn`5D) = gfcolor;
X    ReqBcolor(vscreen`5Bn`5D) = gbcolor;
X#endif
X    bp = wp->w_bufp;
X    vtmove(n, 0);        \0808\1007`09/* Seek to right line. */
X    if (wp == curwp) `7B`09`09&0209/* mark the current buffer */
X`09lchar = '=';
X    `7D else `7B
X#if`09OPT_REVSTA
X`09if (revexist)
X`09    lchar = ' ';
X`09else
X#endif
X`09    lchar = '-';
X    `7D
X
X#if OPT_MLFORMAT
X    while (*fs) `7B
X`09if (*fs != '%')
X`09    *ms++ = *fs++;
X`09else `7B
X`09    fs++;
X`09    switch ((fc = *fs++)) `7B
X`09`09case EOS :&0209`09/* Null character ! */
X`09`09    fs--;
X`09`09    break;
X`09`09case '%' :
X`09`09case ':' :
X`09`09    *ms++ = *(fs-1);
X`09`09    break;
X`09`09case '`7C' :
X`09`09    need_eighty_column_indicator = TRUE;
X`09`09    break;
X`09`09case '-' :
X`09`09    *ms++ = (char)lchar;
X`09`09    break;
X`09`09case '=' :
X`09`09    *ms = EOS;
X`09`09    ms = right_ms;
X`09`09    break;
X`09`09case 'i' :&0209`09/* insert mode indicator */
X`09`09    *ms++ = (char)modeline_show(wp, lchar);
X`09`09    break;
X`09`09case 'b' :
X`09`09    ms = lsprintf(ms, "%s", bp->b_bname);
X`09`09    break;
X`09`09case 'm' :
X`09`09    if (modeline_modes(bp, (char **)0)) `7B
X`09`09`09mlfs_prefix(`26fs, `26ms, lchar);
X`09`09`09(void)modeline_modes(bp, `26ms);
X`09`09`09mlfs_suffix(`26fs, `26ms, lchar);
X`09`09    `7D
X`09`09    else
X`09`09`09mlfs_skipfix(`26fs);
X`09`09    break;
X`09`09case 'f' :
X`09`09case 'F' : `7B
X`09`09    char *p = 0;
X`09`09    if (bp->b_fname != 0
X`09`09     `26`26 (p = shorten_path(strcpy(temp,bp->b_fname), FALSE)) != 0
X`09`09     `26`26 *p
X`09`09     `26`26 !eql_bname(bp,p)
X`09`09     `26`26 (fc == 'f' ? !is_internalname(p)
X`09`09`09           : is_internalname(p))) `7B
X`09`09`09mlfs_prefix(`26fs, `26ms, lchar);
X`09`09`09for (; *p == ' '; p++);
X`09`09`09ms = lsprintf(ms, "%s", p);
X`09`09`09mlfs_suffix(`26fs, `26ms, lchar);
X`09`09    `7D
X`09`09    else
X`09`09`09mlfs_skipfix(`26fs);
X`09`09    break;
X`09`09`7D
X#ifdef WMDRULER
X`09`09case 'l' :&0209/* line number */
X`09`09case 'c' :&0209/* column number */
X`09`09case 'p' :&0209/* percentage */
X`09`09case 'L' :&0209/* number of lines in buffer */
X
X`09`09    if (w_val(wp,WMDRULER) `26`26 !is_empty_buf(wp->w_bufp)) `7B
X`09`09`09int val = 0;
X`09`09`09switch (fc) `7B
X`09`09`09    case 'l' : val = wp->w_ruler_line; break;
X`09`09`09    case 'L' : val = line_count(wp->w_bufp); break;
X`09`09`09    case 'c' : val = wp->w_ruler_col; break;
X`09`09`09    case 'p' : val = wp->w_ruler_line*100
X`09`09`09        \0808     / line_count(wp->w_bufp); break;
X`09`09`09`7D
X`09`09`09mlfs_prefix(`26fs, `26ms, lchar);
X`09`09`09ms = lsprintf(ms, "%d", val);
X`09`09`09mlfs_suffix(`26fs, `26ms, lchar);
X`09`09    `7D
X`09`09    else
X`09`09`09mlfs_skipfix(`26fs);
X`09`09    break;
X
X#endif
X`09`09case 'S' :
X`09`09    if (
X#ifdef WMDRULER
X`09`09`09!w_val(wp, WMDRULER) `7C`7C
X#endif
X`09`09        is_empty_buf(wp->w_bufp)) `7B
X`09`09`09mlfs_prefix(`26fs, `26ms, lchar);
X`09`09`09ms = lsprintf(ms, " %s ", rough_position(wp));
X`09`09`09mlfs_suffix(`26fs, `26ms, lchar);
X`09`09    `7D
X`09`09    else
X`09`09`09mlfs_skipfix(`26fs);
X`09`09    break;
X`09`09default :
X`09`09    *ms++ = '%';
X`09`09    *ms++ = *(fs-1);
X`09`09    break;
X`09    `7D
X`09`7D
X    `7D
X#else`09/* hard-coded format */
X    ms = lsprintf(ms, "%c%c%c %s ",
X    `09lchar, modeline_show(wp, lchar)\0807, bp->b_bname);
X    if (modeline_modes(bp, `26ms))
X    `09*ms++ = ' ';
X    if (bp->b_fname != 0
X    `26`26 (shorten_path(strcpy(temp,bp->b_fname), FALSE))
X    `26`26 !eql_bname(bp,temp)) `7B
X`09if (is_internalname(temp)) `7B
X`09    for (n = term.t_ncol - (13 + strlen(temp) + (int)(ms - left_ms));
X`09`09`09n > 0; n--)
X`09`09*ms++ = lchar;
X`09`7D else `7B
X`09    ms = lsprintf(ms, "is");
X`09`7D
X`09ms = lsprintf(ms, " %s ", temp);
X    `7D
X#ifdef WMDRULER
X    if (w_val(wp, WMDRULER))
X`09(void)lsprintf(right_ms, " (%d,%d) %3p",
X`09`09wp->w_ruler_line, \120Ccol, lchar);
X    else
X#endif
X     (void) lsprintf(right_ms, " %s %3p", rough_position(wp), lchar);
X#endif /* OPT_MLFORMAT */
X
X    *ms++ = EOS;
X    right_len = strlen(\1306ms);
X    vtputsn(left_ms, term.t_ncol);
X    for (n = term.t_ncol - strlen(left_ms) - right_len; n > 0; n--)
X`09vtputc(lchar);
X    vtcol = term.t_ncol - right_len;
X    if (vtcol < 0) `7B
X`09n = -vtcol;
X`09vtcol = 0;
X    `7D
X    else
X`09n = 0;
X    vtputsn(right_ms+n, term.t_ncol - vtcol);
X    if (need_eighty_column_indicator) `7B`09`09/* mark \1D06 80 */
X`09int left = -nu_width(wp);
X#ifdef WMDLINEWRAP
X`09if (!w_val(wp,WMDLINEWRAP))
X#endif
X`09 left += w_val(wp,WVAL_SIDEWAYS);
X`09n = term.t_ncol + left;
X`09col = 80 - left;
X
X`09if ((n > 80) `26`26 (col >= \0E07vtgetc(col) == lchar)) `7B
X`09    vtcol = col;
X`09    vtputc('`7C');
X`09`7D
X    `7D
X`7D
X
Xvoid
Xupmode(void)`09/* update all the mode lines */
X`7B
X`09register WINDOW *wp;
X
X`09for_each_window(wp)
X`09`09wp->w_flag `7C= WFMODE;
X`7D
X
X/*
X * Recompute the given buffer. Save/restore its modes and position information
V
X * so that a redisplay will show as little change as possible.
X */
X#if`09OPT_UPBUFF
Xtypedef`09struct`09`7B
X`09WINDOW`09*wp;
X`09struct VAL w_vals`5BMAX_W_VALUES`5D;
X`09int`09top;
X`09int`09line;
X`09int`09col;
X`09`7D SAVEWIN;
X
Xstatic`09SAVEWIN`09*recomp_tbl;
Xstatic`09ALLOC_T`09recomp_len;
X
Xstatic void
Xrecompute_buffer(BUFFER *bp)
X`7B
X`09register WINDOW *wp;
X`09register SAVEWIN *tbl;
X
X`09struct VAL b_vals`5BMAX_B_VALUES`5D;
X`09ALLOC_T`09num = 0;
X`09BUFFER *savebp = curbp;
X`09WINDOW *savewp = curwp;
X`09int`09mygoal = curgoal;
X
X`09if (!b_val(bp,MDUPBUFF)) `7B
X`09`09b_clr_obsolete(bp);
X`09`09return;
X`09`7D
X`09if (recomp_len < bp->b_nwnd) `7B
X`09`09recomp_len = bp->b_nwnd + 1;
X`09`09recomp_tbl = (\0E0B!= 0)
X`09`09`09? typereallocn(SAVEWIN,recomp_tbl\0B08len)
X`09`09`09: typeallocn(SAVEWIN,recomp_len);
X`09`09if (recomp_tbl == 0) `7B
X`09`09`09recomp_len = 0;
X`09`09`09return;
X`09`09`7D
X`09`7D
X`09tbl = recomp_tbl;
X
X`09/* remember where we are, to reposition */
X`09/* ...in case line is deleted from buffer-list */
X`09relisting_b_vals = 0;
X`09relisting_w_vals = 0;
X`09if (curbp == bp) `7B
X`09`09relisting_b_vals = \0906;
X `09`7D else `7B
X`09`09curbp = bp;
X`09`09curwp = bp2any_wp(bp);
X`09`7D
X`09for_each_visible_window(wp) `7B
X`09`09if (wp->w_bufp == bp) `7B
X`09`09`09if (wp == savewp)
X`09`09&0209relisting_w_vals = tbl`5Bnum`5D.\1206;
X`09`09`09curwp = wp;`09/* to make 'getccol()' work */
X`09`09`09curbp = curwp->w_bufp;
X`09`09`09tbl`5Bnum`5D.wp   = wp;
X`09`09`09tbl`5Bnum`5D.top  = line_no(bp, wp->w_line.l);
X`09`09`09tbl`5Bnum`5D.line = line_no(bp, wp->w_dot.l);
X`09`09`09tbl`5Bnum`5D.col  = getccol(FALSE);
X`09`09`09save_vals(NUM_W_VALUES, global_w_values.wv,
X`09`09&0209tbl`5Bnum`5D.w_vals, wp->w_values.wv);
X`09`09`09if (++num >= recomp_len)
X`09`09&0209break;
X`09`09`7D
X`09`7D
X`09curwp = savewp;
X`09curbp = savebp;
X
X`09save_vals(NUM_B_VALUES, global_b_values.bv, b_vals, bp->\190B);
X`09(bp->b_upbuff)(bp);
X`09copy_mvals(NUM_B_VALUES, bp->b_values.bv, b_vals);
X
X`09/* reposition and restore */
X`09while (num-- != 0) `7B
X`09`09curwp = wp = tbl`5Bnum`5D.wp;
X`09`09curbp = curwp->w_bufp;
X`09`09(void)gotoline(TRUE, tbl`5Bnum`5D.top);
X`09`09wp->w_line.l = \0F06dot.l;
X`09`09wp->w_line.o = 0;
X`09`09if (tbl`5Bnum`5D.line != \1109top)
X`09`09`09(void)gotoline(TRUE, tbl`5Bnum`5D.line);
X`09`09(void)gocol(tbl`5Bnum`5D.col);
X        `09wp->w_flag `7C= WFMOVE;
X`09`09copy_mvals(NUM_W_VALUES, wp->w_values.wv, tbl`5Bnum`5D.w_vals);
X`09`7D
X`09curwp = savewp;
X`09curbp = savebp;
X`09curgoal = mygoal;
X`09b_clr_obsolete(bp);
X`09relisting_b_vals = 0;
X`09relisting_w_vals = 0;
X`7D
X#endif`09/* OPT_UPBUFF */
X
X/*
X * Send a command to the terminal to move the hardware cursor to row "row"
X * and column "col". The row\1A0Carguments are origin 0. Optimize out
X * random calls. Update "ttrow" and "ttcol".
X */
Xvoid
Xmovecursor(int row, int col)
X`7B
X`09beginDisplay();
X`09if ((row!=ttrow `7C`7C col!=ttcol)
X`09 `26`26 (row >= 0 &0226 row < term.t_nrow)
X`09 `26`26 (col >= 0 &0226 col < term.t_ncol))
X        `7B
X`09        ttrow = row;
X`09        ttcol = col;
X`09        TTmove(row, col);
X        `7D
X`09endofDisplay();
X`7D
X
Xvoid
Xbottomleft(void)
X`7B
X`09movecursor(term.t_nrow-1, 0);
X`7D
X
X/*
X * Erase the message line. This is a special routine becau\3413
X * is not considered to be part of the virtual screen. It always works
X * immediately; the terminal buffer is flushed via a call to the \1A06r.
X */
Xvoid
Xmlerase(void)
X`7B
X`09beginDisplay();
X`09kbd_erase_to_end(0);
X`09kbd_flush();
X`09endofDisplay();
X`7D
X
Xstatic char *mlsavep;
X
Xvoid
Xmlsavec(int c)
X`7B
X`09if (mlsavep - \0A06 < NSTRING-1) `7B
X`09`09*mlsavep++ = (char)c;
X`09`09*mlsavep = EOS;
X`09`7D
X`7D
X
X/*
X * Write a message into the \1108line only if appropriate.
X */
X/* VARARGS1 */
Xvoid
Xmlwrite(const char *fmt, ...)
X`7B
X`09va_list ap;
X`09/* if we are not currently echoing on the command line, abort this */
X`09if (global_b_val(MDTERSE) `7C`7C kbd_replaying(FAL\1807discmd == \1407`7B
X`09`09bottomleft();
X`09`09return;
X`09`7D
X`09va_start(ap,fmt);
X`09mlmsg(fmt,`26ap);
X`09va_end(ap);
X`7D
X
X/*`09Put a string out to the message line regardless of the
X`09current $discmd setting. This is needed when $debug is TRUE
X`09and for the write-message and clear\1208-line commands
X`09Also used for most errors, to be sure they're seen.
X*/
X/* VARARGS1 */
Xvoid
Xmlforce(const char *fmt, ...)
X`7B
X`09va_list ap;
X`09va_start(ap,fmt);
X`09mlmsg(fmt,`26ap);
X`09va_end(ap);
X`7D
X
X/* VARARGS1 */
Xvoid
Xmlprompt(const char *fmt, ...)
X`7B
X`09va_list ap;
X`09int osgarbf = \0906;
X`09if (discmd == FALSE) `7B
X`09`09bottomleft();
X`09`09return;
X`09`7D
X`09sgarbf = FALSE;
X`09va_start(ap,fmt);
X`09mlmsg(fmt,`26ap);
X`09va_end(ap);
X`09sgarbf = o\0A06;
X`7D
X
X/* VARARGS */
Xvoid
Xdbgwrite(const char *fmt, ...)
X`7B
X`09va_list ap;`09/* ptr to current data field */
X`09va_start(ap,fmt);
X`09mlmsg(fmt,`26ap);
X`09va_end(ap);
X`09beginDisplay();
X`09while (TTgetc() != '`5C007')
X`09`09;
X`09endofDisplay();
X`7D
X
X/*
X * Do the real message-line work.  Keep track of the physical cursor
X * position. A small class of printf like format items is handled.
X * Set the "message line" flag TRUE.
X */
Xstatic void
Xmlmsg(const char *fmt, va_list *app)
X`7B
X`09static`09int`09recur;
X`09int`09end_at;
X`09int`09do_crlf = (strchr(fmt, '`5Cn') != 0
X`09`09`09`7C`7C strchr(fmt, '`5Cr') != 0);
X
X`09if (recur++) `7B
X`09`09/*EMPTY*/;
X`09`7D else if (sgarbf) `7B
X`09`09/* then we'll lose the message on the next update(), so save it now */
X`09`09mlsavep = \0A06;
X#if`09OPT_POPUP_MSGS
X`09`09if (global_g_val(GMDPOPUP_MSGS) `7C`7C (curwp == 0)) `7B
X`09`09`09TRACE(("mlmsg popup_msgs #1 for '%s'`5Cn", fmt))
X`09`09`09popup_msgs();
X`09`09`09msg_putc('`5Cn');
X`09`09`09dfoutfn = msg_putc;
X`09`09`7D else
X#endif
X`09`09  dfoutfn = mlsavec;
X`09`09dofmt(fmt,app);
X`09`7D else `7B
X`09`09beginDisplay();
X
X`09`09kbd_expand = -1;
X#if`09OPT_POPUP_MSGS
X`09`09if (global_g_val(GMDPOPUP_MSGS)) `7B
X`09`09`09TRACE(("mlmsg popup_msgs #2 for '%s'`5Cn", fmt))
X`09`09`09popup_msgs();
X`09`09`09if (mlsave`5B0`5D == EOS) `7B
X`09`09&0209msg_putc('`5Cn');
X`09`09&0209dfoutfn = msg_putc;
X`09`09`09`7D else `7B
X`09`09&0209dfoutfn = kbd_putc;
X`09`09`09`7D
X`09`09`7D else
X#endif
X`09`09  dfoutfn = kbd_putc;
X
X`09`09if (*fmt != '`5Cn') `7B
X`09`09`09kbd_erase_to_end(0);
X`09`09`09dofmt(fmt,app);
X`09`09`09kbd_expand = 0;
X
X`09`09`09/* if we can, erase to the end of screen */
X`09`09`09end_at = wminip->w_dot.o;
X`09`09`09kbd_erase_to_end(end_at);
X`09`09`09mlsave`5B0`5D = EOS;
X`09`09`09kbd_flush();
X`09`09`7D
X`09`09if (do_crlf) `7B
X`09`09`09kbd_openup();
X`09`09`7D
X`09`09endofDisplay();
X`09`7D
X`09recur--;
X`7D
X
X/*
X * Do the equivalent of 'perror()' on the message line
X */
Xvoid
Xmlerror(const char *s)
X`7B
X#if HAVE_STRERROR
X`09if (errno > 0)
X`09`09mlwarn("`5BError %s: %s`5D", s, strerror(errno));
X`09else
X`09`09mlwarn("`5BError %s: unknown system e\1906d`5D", s, errno);
X#else
X#if HAVE_SYS_ERRLIST
X`09if (errno > 0 `26`26 \0D06< sys_nerr)
X`09`09mlwarn("`5BError %s: %s`5D", s, sys_errlist`5Berrno`5D);
X`09else
X`09`09mlwarn("`5BError %s: unknown system e\1906d`5D", s, errno);
X#else
X`09mlwarn("`5BError %s, errno=%d`5D", \0F08);
X#endif /* HAVE_SYS_ERRLIST */
X#endif /* HAVE_STRERROR */
X`7D
X
X/*
X * Emit a warning message (with alarm)
X */
X/* VARARGS1 */
Xvoid
Xmlwarn(const char *fmt, ...)
X`7B
X`09va_list ap;
X`09va_start(ap,fmt);
X`09mlmsg(fmt,`26ap);
X`09va_end(ap);
X`09kbd_alarm();
X`7D
X
X/*
X * Local sprintf -- similar to standard libc, but
X *  returns pointer to null character at end of buffer, so it can
X *  be called repeatedly, as in:
X *`09cp = lsprintf(cp, fmt, args...);
X *
X */
X
Xstatic`09char *lsp;
X
Xstatic void
Xlspputc(int c)
X`7B
X`09*lsp++ = (char)c;
X`7D
X
X/* VARARGS1 */
Xchar *
Xlsprintf(char *buf, const char *fmt, ...)
X`7B
X`09va_list ap;
X`09va_start(ap,fmt);
X
X`09lsp = buf;
X`09dfoutfn = lspputc;
X
X`09dofmt(fmt,`26ap);
X`09va_end(ap);
X
X`09*lsp = EOS;
X`09return lsp;
X`7D
X
X
X/*
X * Buffer printf -- like regula\1708, but puts characters
X *`09into the BUFFER.
X */
Xvoid
Xbputc(int c)
X`7B
X`09if (c == '`5Cn')
X`09`09(void)lnewline();
X`09else
X`09`09(void)linsert(1,c);
X`7D
X
X/* printf into curbp, at DOT */
X/* VARARGS */
Xvoid
Xbprintf(const char *fmt, ...)
X`7B
X`09va_list ap;
X
X`09dfoutfn = bputc;
X
X`09va_start(ap,fmt);
X`09dofmt(fmt,`26ap);
X`09va_end(ap);
X
X`7D
X
X#if defined( SIGWINCH) `26`26 ! DISP_X11
X/* ARGSUSED */
XSIGT
Xsizesignal (int ACTUAL_SIG_ARGS GCC_UNUSED)
X`7B
X`09int w, h;
X`09int old_errno = errno;
X
X`09getscreensize (`26w, `26h);
X
X`09if ((h > 1 `26`26 h != term.t_nrow) `7C`7C (w\1F08w \1F0Bcol))
X`09`09newscreensize(h, w);
X
X`09setup_handler(SIGWINCH, sizesignal);
X`09errno = old_errno;
X`09SIGRET;
X`7D
X#endif
X
Xvoid
Xnewscreensize (int h, int w)
X`7B
X`09/* do the change later */
X`09if (im_displaying
X#if OPT_WORKING
X`09`7C`7C !i_displayed
X#endif
X`09) `7B
X`09`09chg_width = w;
X`09`09chg_height = h;
X`09`09return;
X`09`7D
X`09chg_width = chg_height = 0;
X`09if ((h > term.t_mrow) `7C`7C (w\150Bcol)) `7B
X`09`09int or, oc;
X`09`09or = term.t_mrow;
X`09`09oc = term.t_mcol;
X`09`09term.t_mrow = h;
X`09`09term.t_mcol = w;
X`09`09if (!vtinit()) `7B /* allocation failure */
X`09`09`09term.t_mrow = or;
X`09`09`09term.t_mcol = oc;
X`09`09`09return;
X`09`09`7D
X`09`7D
X`09if (!newlength(TRUE,h) `7C`7C !newwid\1508w))
X`09`09return;
X
X`09(void)update(TRUE);
X`7D
X
X#if OPT_WORKING
X/*
X * Start the timer that controls the "working..." message.
X */
Xstatic void
Xstart_working(void)
X`7B
X`09setup_handler(SIGALRM,imworking);
X`09(void)alarm(1);
X`09im_timing = TRUE;
X`7D
X
X/*
X * When we stop the timer, we should cleanu\1D06"working..." message.
X */
Xstatic void
Xstop_working(void)
X`7B
X`09if (mpresf) `7B`09/* erase leftover working-message */
X`09`09int`09save_row = ttrow;
X`09`09int`09save_col = ttcol;
X`09`09kbd_overlay(0);
X`09`09kbd_flush();
X`09`09movecursor(save_row, save_col);
X`09`09TTflush();
X`09`7D
X`7D
X
X/*
X * Displays alternate
X *`09"working..." and
X *`09"...working"
X * at the end of the message line if it has been at least a second since
X * displaying anything or waiting for keyboard input.  The cur_work\3906d
X * max_working values are used in 'slowreadf()' to show the progress of readin
Vg
X * large files.
X */
X
X/*ARGSUSED*/
XSIGT
Ximworking (int ACTUAL_SIG_ARGS GCC_UNUSED)
X`7B
X`09static`09const`09char *const msg`5B`5D = `7B"working", "..."`7D;
X`09static`09int`09flip;
X`09static`09int`09skip;
X
X`09signal_was = SIGALRM;`09/* remember this was an alarm */
X
X`09if (no_working) /* brute force, for debugging */
X`09`09return;
X
X`09/* (if GMDWORKING is _not_ set, or MDTERSE is set, we're allowed
X`09 * to erase, but not to write.  and if we d\2709we don't
X`09 * reschedule the alarm, since setting the mode will call us
X`09 * again to start things up)
X`09 */
X
X`09if (im_displaying `7C`7C !i\1108ed) `7B /* look at the semaphore first! */
V
X`09`09/*EMPTY*/;
X`09`7D else if (im_waiting(-1)) `7B
X`09`09im_timing = FALSE;
X`09`09stop_working();
X`09`09return;
X`09`7D else if (ShowWorking()) `7B
X`09`09if (skip) `7B
X`09`09`09skip = FALSE;
X`09`09`7D else `7B
X#if DISP_X11
X`09`09`09x_working();
X#else
X`09`09`09char`09result`5B20`5D;
X`09`09`09result`5B0`5D = EOS;
X`09`09`09if (cur_working != 0
X`09`09`09 `26`26 cur_working != old\0F08) `7B
X`09`09&0209char`09temp`5B20`5D;
X`09`09&0209int`09len = cur_working > 999999L ? 10 : 6;
X
X`09`09&0209old_working = cur\0E08;
X`09`09&0209strcat(result, right_num(temp, len, cur_working));
X`09`09&0209if (len == 10)
X`09`09&0209`09/*EMPTY*/;
X`09`09&0209else if (max_working != 0) `7B
X`09`09&0209`09strcat(result, " ");
X`09`09&0209`09strcat(result, right_num(temp, 2,
X`09`09&0209&0209(100 * cur_working) / max\0F09);
X`09`09&0209`09strcat(result, "%");
X`09`09&0209`7D else
X`09`09&0209`09strcat(result, " ...");
X`09`09`09`7D else `7B
X`09`09&0209strcat(result, msg`5B flip`5D);
X`09`09&0209strcat(result, msg`5B!flip`5D);
X`09`09`09`7D
X`09`09`09kbd_overlay(result);
X`09`09`09kbd_flush();
X#endif
X`09`09`7D
X`09`7D else `7B
X`09`09stop_working();
X`09`09skip = TRUE;
X`09`09return;
X`09`7D
X`09start_working();
X`09flip = !flip;
X`7D
X#endif`09/* OPT_WORKING */
X
X/*
X * Maintain a flag that records whether we're waiting for keyboard input.  As
V a
X * side-effect, restart the 'working' timer if we see that it's been made
X * inactive while we were waiting.
X */
Xint
Xim_waiting(int flag)
X`7B
X`09static int waiting;
X`09if (flag >= 0) `7B`09/* TRUE or FALSE set, negative used to query */
X`09`09waiting = flag;
X#if OPT_WORKING
X`09`09if (!waiting `26`26 !im_tim\0E07ShowWorking())
X`09`09`09start_working();
X#endif
X`09`7D
X`09return waiting;
X`7D
X
X#if defined(SIGWINCH) `7C`7C OPT_WORKING
X/*
X * Set the semaphore so that we don't try to do I/O while we're being
X * interrupted.
X */
Xvoid
XbeginDisplay (void)
X`7B
X`09im_displaying++;
X`7D
X
X/*
X * Reset the semaphore.
X */
Xvoid
XendofDisplay (void)
X`7B
X`09if (im_displaying)
X`09`09im_displaying--;
X`7D
X#endif
X
X#if`09OPT_PSCREEN
X/* Most of the code in this section is for making the message line work
X * right...it shouldn't be called to display the rest of the screen.
X */
Xstatic int psc_row;
Xstatic int psc_col;
X
X#define SWAP_INT(x,y) `5C
X`09do `7B (x) = (x)+(y); (y)\0F06-\0F06\1E08\0F06`7D one_time
X#define SWAP_VT_PSC `5C
X`09do `7B SWAP_INT(vtcol, psc_col);\1A0Crow\1A06row); `7D one_time
X
XOUTC_DCL
Xpsc_putchar(OUTC_ARGS)
X`7B
X    if (c == '`5Cb') `7B
X`09if (psc_col > 0)
X`09    psc_col--;
X    `7D
X    else `7B
X`09SWAP_VT_PSC;
X`09vtputc(c);
X`09vscreen`5Bvtrow`5D->v_flag `7C= VFCHG;
X`09SWAP_VT_PSC;
X    `7D
X    OUTC_RET c;
X`7D
X
Xvoid
Xpsc_flush(void)
X`7B
X    updateline(term.t_nrow-1, 0, \1208col);
X    TTpflush();
X`7D
X
Xvoid
Xpsc_move(int row, int col)
X`7B
X    psc_row = row;
X    psc_col = col;
X`7D
X
Xvoid
Xpsc_eeol(void)
X`7B
X    if (ttrow >= 0 `26`26 \0E06< term.t_nrow &0226 ttcol >= 0) `7B
X`09VIDEO_ATTR *vp = `26vscreen`5Bttrow`5D->v_attrs`5Bttcol`5D;
X`09char *cp = `26vscreen`5Bttrow`5D->v_text`5Bttcol`5D;
X`09char *cplim = `26vscreen`5Bttrow`5D->v_text`5Bterm.t_ncol`5D;
X`09vscreen`5Bttrow`5D->v_flag `7C= VFCHG;
X`09while (cp < cplim) `7B
X`09    *vp++ = 0;
X`09    *cp++ = ' ';
X`09`7D
X    `7D
X`7D
X
Xvoid
Xpsc_eeop(void)
X`7B
X    int saverow = ttrow;
X    int savecol = ttcol;
X    while (ttrow < term.t_nrow) `7B
X`09psc_eeol();
X`09ttrow++;
X`09ttcol = 0;
X    `7D
X    ttrow = saverow;
X    ttcol = savecol;
X`7D
X
X/* ARGSUSED */
Xvoid
Xpsc_rev(UINT huh GCC_UNUSED)
X`7B
X    /* do nothing */
X`7D
X
X#endif`09/* OPT_PSCREEN */
X
X/* For memory-leak testing (only!), releases all display storage. */
X#if NO_LEAKS
Xvoid`09vt_leaks(void)
X`7B
X`09vtfree();
X#if OPT_UPBUFF
X`09FreeIfNeeded(recomp_tbl);
X#endif
X`7D
X#endif
$ call unpack [.VILE-8_0]DISPLAY.C;1 -
 150149613 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 163 32 152
$!
$ create 'f'
X/*
X *`09control-c and critical error handlers for DJGPP environment
X *
X *`09control-c code based exactly on the equivalent handler
X *`09`09for control-break in the go32 libraries
X *`09critical error handling from Bob Babcock.
X *
X * $Header: /usr/build/vile/vile/RCS/djhandl.c,v 1.6 1998/04/28 10:19:54 tom E
Vxp $
X *
X *
X */
X
X#include <stdlib.h>
X#include <go32.h>
X#include <dpmi.h>
X#include <dos.h>
X#include <stdio.h>
X
X#ifndef TRUE
X#define TRUE 1
X#define FALSE 0
X#endif
X
Xstatic _go32_dpmi_registers regs;
Xstatic volatile unsigned long ctrl_c_count = 0;
Xstatic int ctrl_c_hooked = 0;
Xstatic _go32_dpmi_seginfo old_vector;
Xstatic _go32_dpmi_seginfo new_vector;
X
Xunsigned long was_ctrl_c_hit();
Xvoid   want_ctrl_c(int yes); /* auto-yes if call above function */
X
Xstatic void ctrl_c_isr(_go32_dpmi_registers *regs)
X`7B
X  ctrl_c_count ++;
X`7D
X
Xunsigned long was_ctrl_c_hit()
X`7B
X  unsigned long cnt;
X  want_ctrl_c(1);
X  cnt = ctrl_c_count;
X  ctrl_c_count = 0;
X  return cnt;
X`7D
X
Xvoid want_ctrl_c(int yes)
X`7B
X  if (yes)
X  `7B
X    if (ctrl_c_hooked)
X      return;
X    _go32_dpmi_get_real_mode_interrupt_vector(0x23, `26old\1207);
X
X    new_vector.pm_offset = (int)ctrl_c_isr;
X    _go32_dpmi_allocate_real_mode_callback_iret(`26new_vector, `26regs);
X    _go32_dpmi_set_real_mode_interrupt_vector(0x23, `26new\1207);
X    ctrl_c_count = 0;
X    ctrl_c_hooked = 1;
X  `7D
X  else
X  `7B
X    if (!ctrl_c_hooked)
X      return;
X    _go32_dpmi_set_real_mode_interrupt_vector(0x23, `26old\1207);
X    _go32_dpmi_free_real_mode_callback(`26new_vector);
X    ctrl_c_count = 0;
X    ctrl_c_hooked = 0;
X  `7D
X`7D
X
X/* hardgcc - critical error handler for gcc
X */
X
Xint hard_error_occurred = FALSE;
X
Xstatic char handler`5B16`5D =
X`7B
X   0x81, 0xe7, 0x7f, 0,       /* and di,7f\1307  */
X   0x47,      \0606\0C0A/* inc di\1F0C*/
X   0x2e, 0x89, 0x3e, 0xe, 0,  /* mov cs:`5B0eh`5D,di   */
X   0xb8, 3, 0,        \0808/* mov ax,3\1B0A*/
X   0xcf,      \0606\0C0A/* iret\1D0E*/
X   0,0      \0606\0C0C/* storage for error code */
X`7D;
Xstatic int handler_installed = FALSE;
Xstatic _go32_dpmi_seginfo new_handler_info, old\120D;
X
X/* clear_hard_error -\1306 any indication of a critical error
X */
Xvoid clear_hard_error(void)
X`7B
X   short zero = 0;
X
X   if(handler_installed)
X      dosmemput(`26zero, 2, new_handler_info.rm_segment * 16 + 14);
X   hard_error_occurred = 0;
X   return;
X`7D
X
X/* install the real-mode critical error handler
X */
Xvoid hard_error_catch_setup(void)
X`7B
X/* On first call, allocate some DOS memory and copy the handler into it
X */
X   if(!handler_installed) `7B
X      handler_installed = TRUE;
X      new_handler_info.size = old\18151;
X      if (_go32_dpmi_allocate_dos_memory(`26new_handler_info) != 0) `7B
X`09fprintf(stderr,"Couldn't allocate handler memory`5Cn");
X`09exit(1);
X      `7D
X      dosmemput(handler, 16, new_\1107_info.rm_segment * 16);
X#ifdef XDEBUG
X      sprintf(Tempbuf, "Handler at segment %x", new_h\1C06_info.rm_\2107);
X      error_msg(Tempbuf, 0);
X#endif
X    `7D
X    _go32_dpmi_get_real_mode_interrupt_vector(0x24, `26old_handler_info);
X    _go32_dpmi_set_real_mode_interrupt_vector(0x24, `26new_handler_info);
X    clear_hard_error();
X    return;
X`7D
X
X/* switch back to old critical error handler
X */
Xvoid hard_error_teardown(void)
X`7B
X   if(handler_installed)
X      _go32_dpmi_set_real_mode_interrupt_vector(0x24, `26old_handler_info);
X   return;
X`7D
X
X/* test_hard_err - test whether a critical error has occurred and return
X   error code (0 if none or handler never installed).
X */
Xint did_hard_error_occur(void)
X`7B
X   short error_code;
X
X   if(handler_installed)
X      `7B
X      dosmemget(new_handler_info.rm_segment * 16 + 14, 2, `26error_code);
X#ifdef XDEBUG
X      if(error_code)
X         `7B
X         sprintf(Tempbuf,"Critical error code is %d",\1306_code);
X         error_msg(Tempbuf,0);
X         `7D
X#endif
X      return(error_code);
X      `7D
X   return(0);
X`7D
$ call unpack [.VILE-8_0]DJHANDL.C;1 -
 155666308 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 9 33 152
$!
$ create 'f'
X/*`09Dumb terminal driver, for I/O before we get into screen mode.
X *
X * $Header: /usr/build/vile/vile/RCS/dumbterm.c,v 1.13 1998/05/14 23:19:42 tom
V Exp $
X *
X */
X
X#include`09"estruct.h"
X#include`09"edef.h"
X
X#define MARGIN`098
X#define SCRSIZ`0964
X#define NPAUSE`0910`09`09`09/* # times thru update to pause */
X
Xstatic OUTC_DCL dumb_putc (OUTC_ARGS);
Xstatic int  dumb_cres     (const char * res);
Xstatic int  dumb_getc     (void);
Xstatic int  dumb_typahead (void);
Xstatic void dumb_beep     (void);
Xstatic void dumb_eeol     (void);
Xstatic void dumb_eeop     (void);
Xstatic void dumb_flush    (void);
Xstatic void dumb_kclose   (void);
Xstatic void dumb_kopen    (void);
Xstatic void dumb_move     ( int row, int col );
Xstatic void dumb_rev      ( UINT state );
X
Xstatic void flush_blanks  (void);
X
XTERM dumb_term = `7B
X`091,
X`091,
X`0980,
X`0980,
X`09MARGIN,
X`09SCRSIZ,
X`09NPAUSE,
X`090,`09`09/* use this to put us into raw mode */
X`090,`09`09/* ...and this, just in case we exit */
X`09dumb_kopen,
X`09dumb_kclose,
X`09dumb_getc,
X`09dumb_putc,
X`09dumb_typahead,
X`09dumb_flush,
X`09dumb_move,
X`09dumb_eeol,
X`09dumb_eeop,
X`09dumb_beep,
X`09dumb_rev,
X`09dumb_cres,
X`09null_t_setfor,
X`09null_t_setback,
X`09null_t_setpal,
X`09null_t_scroll,
X`09null_t_pflush,
X`09null_t_icursor,
X`09null_t_title,
X`09null_t_watchfd,
X`09null_t_unwatchfd,
X`7D;
X
Xstatic`09int`09this_col;
Xstatic`09int`09last_col;
X
Xstatic void
Xflush_blanks(void)
X`7B
X`09if (last_col > 0) `7B
X`09`09while (last_col++ < this_col)
X`09`09`09(void)putchar(' ');
X`09`09last_col = 0;
X`09`7D
X`09TTflush();
X`7D
X
Xstatic void
Xdumb_kopen(void)
X`7B
X`7D
X
Xstatic void
Xdumb_kclose(void)
X`7B
X`7D
X
Xstatic int
Xdumb_getc(void)
X`7B
X`09flush_blanks();
X`09return getchar();
X`7D
X
Xstatic OUTC_DCL
Xdumb_putc(OUTC_ARGS)
X`7B
X`09if (isSpace(c)) `7B
X`09`09if (last_col == 0)
X`09`09`09last_col = this_col;
X`09`7D else `7B
X`09`09flush_blanks();
X`09`09(void)putchar(c);
X`09`7D
X`09this_col++;
X`09OUTC_RET c;
X`7D
X
Xstatic int
Xdumb_typahead(void)
X`7B
X`09return TRUE;
X`7D
X
Xstatic void
Xdumb_flush(void)
X`7B
X`09(void)fflush(stdout);
X`7D
X
X/*ARGSUSED*/
Xstatic void
Xdumb_move(int row GCC_UNUSED, int col)
X`7B
X`09if (last_col == 0)
X`09`09last_col = this_col;
X`09if (col == 0) `7B
X`09`09putchar('`5Cr');
X`09`09if (last_col != 0)
X`09`09`09putchar('`5Cn');
X`09`7D else if (last_col > col) `7B
X`09`09while (last_col-- > col)
X`09`09`09putchar('`5Cb');
X`09`7D else if (last_col < col) `7B
X`09`09while (last_col++ < col)
+-+-+-+-+-+-+-+-  END  OF PART 44 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 45 -+-+-+-+-+-+-+-+
X`09`09`09putchar(' ');
X`09`7D
X`09last_col = 0;
X`09this_col = col;
X`7D
X
Xstatic void
Xdumb_eeol(void)
X`7B
X`7D
X
Xstatic void
Xdumb_eeop(void)
X`7B
X`7D
X
X/*ARGSUSED*/
Xstatic int
Xdumb_cres(`09/* change screen resolution */
Xconst char * res GCC_UNUSED)
X`7B
X`09return(FALSE);
X`7D
X
X/* ARGSUSED */
Xstatic void
Xdumb_rev(UINT state GCC_UNUSED)
X`7B
X`7D
X
Xstatic void
Xdumb_beep(void)
X`7B
X`09putchar(BEL);
X`7D
$ call unpack [.VILE-8_0]DUMBTERM.C;1 -
 626550209 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 6 34 152
$!
$ create 'f'
X/*`09EDEF:`09`09Global variable definitions for vile
X
X
X`09`09`09written for MicroEMACS 3.9 by Dave G. Conroy
X`09`09`09modified by Steve Wilhite, George Jones
X`09`09`09greatly modified by Daniel Lawrence
X`09`09`09modified even more than that by Paul Fox.  honest.
X*/
X
X/*
X * $Header: /usr/build/vile/vile-8.0/RCS/edef.h,v 1.227 1998/05/30 20:29:34 to
Vm Exp $
X */
X
X#ifndef VILE_EDEF_H
X#define VILE_EDEF_H 1
X
X#ifdef __cplusplus
Xextern "C" `7B
X#endif
X
X/* I know this declaration stuff is really ugly, and I probably won't ever
X *`09do it again.  promise.  but it _does_ make it easy to add/change
X *`09globals. -pgf
X */
X#ifdef realdef
X# ifdef __cplusplus
X#  define decl_init_const(thing,value) extern const thing = value
X# else
X#  define decl_init_const(thing,value) const thing = value
X# endif
X#  define decl_init(thing,value) thing = value
X#  define decl_uninit(thing) thing
X#else
X# define decl_init_const(thing,value) extern const thing
X# define decl_init(thing,value) extern thing
X# define decl_uninit(thing) extern thing
X#endif
X
Xdecl_uninit( char *prog_arg );`09`09/* argv`5B0`5D from main.c */
Xdecl_init( char *exec_pathname, ".");`09/* replaced at runtime with path-head
V of argv`5B0`5D */
X
X#if DISP_X11
Xdecl_init( char prognam`5B`5D, "xvile");
X#else
X# if DISP_NTWIN
Xdecl_init( char prognam`5B`5D, "winvile");
X# else
Xdecl_init( char prognam`5B`5D, "vile");
X# endif
X#endif
X
Xdecl_init( char version`5B`5D, "\0C07 8.0");
X
X#ifdef SYSTEM_NAME
Xdecl_init( char opersys`5B`5D, SYSTEM_NAME);
X#else
X#if SYS_UNIX
Xdecl_init( char opersys`5B`5D, "unix");
X#endif
X#if SYS_VMS
Xdecl_init( char opersys`5B`5D, "vms");
X#endif
X#if SYS_MSDOS
Xdecl_init( char opersys`5B`5D, "dos");
X#endif
X#if SYS_WIN31
Xdecl_init( char opersys`5B`5D, "windows 3.1");
X#endif
X#if SYS_OS2
Xdecl_init( char opersys`5B`5D, "os/2");
X#endif
X#if SYS_WINNT
Xdecl_init( char opersys`5B`5D, "win32");
X#endif
X#endif
X
Xdecl_uninit( int am_interrupted );`09/* have we been int\1F08/ */
X
X
Xdecl_init( int autoindented , -1);`09/* how many chars (not cols) in\2D07*/
Xdecl_uninit( int isnamedcmd );`09`09/* are we typing a command name */
Xdecl_uninit( int calledbefore );`09/*\1307 \1407during this command? */
Xdecl_uninit( CHARTYPE _chartypes_`5BN_chars`5D );`09/* character types`09*/
Xdecl_uninit( int reading_msg_line );`09/* flag set during msgline \2F07 */
Xdecl_uninit( jmp_buf read_\0D08);`09/* for setjmp/longjmp on SIGINT */
X#ifndef insertmode
Xdecl_uninit( int insertmode );`09`09/* are we \1906ing or overwriting? */
X#endif
Xdecl_uninit( int lastkey );`09`09/* last keystoke (tgetc)`09*/
Xdecl_uninit( int lastcmd );`09`09/* last command`09(kbd_seq)`09*/
Xdecl_uninit( REGIONSHAPE regionshape );`09/* \0C06of\1B07`09`09*/
X#if OPT_VIDEO_ATTRS
Xdecl_uninit( VIDEO_ATTR videoattribute );
X`09`09&0209`09/* attribute to set in call to
X`09`09&0209`09   attributeregion()&0209*/
X#endif
Xdecl_uninit( int doingopcmd );`09`09/* operator command in progress */
Xdecl_uninit( int doingsweep );`09`09/* operator command in progress */
Xdecl_uninit( int sweephack );`09`09/* don't include dot when\2806ing */
Xdecl_uninit( MARK pre_op_dot );`09`09/* current pos. before operator cmd */
X
Xdecl_uninit( MARK scanboundpos );`09/* where do searches end? */
Xdecl_uninit( int scanbound_is_header);`09/* is\1C0Apos the \2006 line? */
X
Xdecl_uninit( short opcmd );`09`09/* what sort of operator?`09*/
Xdecl_uninit( const CMDFUNC *havemotion ); /* so we can use "oper" routines
X`09`09&0209`09   internally */
Xdecl_uninit( int currow );`09`09/* Cursor row        \0808   */
Xdecl_uninit( int curcol );`09`09/* Cursor column        \0808*/
Xdecl_uninit( WINDOW *curwp );`09`09/* Current window        \0807*/
Xdecl_uninit( BUFFER *curbp );`09`09/* Current buffer        \0807*/
Xdecl_uninit( WINDOW *wheadp );`09`09/* Head of list of windows      */
Xdecl_uninit( BUFFER *bheadp );`09`09/* Head of list of buffers      */
X
Xdecl_uninit( WINDOW *wminip );`09`09/* window for command-line      */
Xdecl_uninit( BUFFER *bminip );`09`09/* buffer for command-line      */
X
Xdecl_uninit( TBUFF *save_shell`5B2`5D );`09/* last ":!" or `5EX-!  command`09*
V/
X
Xdecl_uninit( char sres`5BNBUFN`5D );`09/* current screen resolution`09*/
X
Xdecl_uninit( char mlsave`5BNSTRING`5D );`09/* last message, if postponed`09*/
V
Xdecl_uninit( char pat`5BNPAT`5D );`09`09/* Search pattern&0209*/
Xdecl_uninit( char rpat`5BNPAT`5D );`09`09/* replacement pattern&0209*/
Xdecl_uninit( int  last_srch_direc );`09/* Direction of last search */
X
X#if OPT_PROCEDURES
Xdecl_uninit( char cdhook`5BNBUFN`5D );`09/* proc to run when change dir */
Xdecl_uninit( char readhook`5BNBUFN`5D );`09/* proc to run when read file  */
Xdecl_uninit( char writehook`5BNBUFN`5D );`09/* proc to run when write file */
V
Xdecl_uninit( char bufhook`5BNBUFN`5D );`09/* proc to run when change buf */
Xdecl_uninit( char exithook`5BNBUFN`5D );`09/* proc to run when exiting */
X#endif
X
Xdecl_uninit( regexp *g\0907);`09`09/* compiled version of pat */
X
X/* patmatch holds the string that satisfied\1A06earch command.  */
Xdecl_uninit( char *patmatch );
X
Xdecl_uninit( int ignorecase );
X
Xdecl_init( int curgoal, -1 );           /* column goal`09`09`09*/
Xdecl_uninit( const char *execstr );`09/* pointer to string to execute`09*/
X#if OPT_EVAL
Xdecl_uninit( char golabel`5BNPAT`5D );`09/* current line to go to`09*/
X#endif
X#if OPT_MLFORMAT
Xdecl_uninit( char *modeline_format );`09/* \1608 \1606ting string */
X#endif
Xdecl_init( int`09eolexist, TRUE );`09/* does clear to EOL exist`09*/
Xdecl_uninit( int revexist );`09`09/* does reverse video exist?`09*/
X#if DISP_IBMPC `7C`7C OPT_EVAL
Xdecl_uninit( int flickcode );`09`09/* do\1406er suppression?`09*/
X#endif
Xdecl_uninit( int curtabval );`09`09/* current tab width&0209*/
X
X#ifdef realdef
X`09MARK`09nullmark = `7B NULL, 0 `7D;
X#else
Xextern`09MARK`09nullmark;
X#endif
X
X#if ! WINMARK
Xdecl_uninit( MARK Mark );`09`09/* the worker mark */
X#endif
X
X/* these get their initial values in main.c, in global_val_init() */
Xdecl_uninit( G_VALUES global_g_values );
Xdecl_uninit( B_VALUES global_b_values );
Xdecl_uninit( W_VALUES global_w_values );
X
Xdecl_init( int sgarbf, TRUE );          /*\1406if screen is garbage`09*/
Xdecl_uninit( int clexec`09);`09`09/* command line execution flag`09*/
Xdecl_uninit( int miniedit );`09`09/* editing minibuffer with vi-cmds */
Xdecl_uninit( int mstore`09);`09`09/* storing text to macro flag`09*/
Xdecl_init( int discmd, TRUE );`09`09/* display command flag&0209*/
Xdecl_init( int disinp, TRUE );`09`09/* display input characters`09*/
Xdecl_uninit( struct BUFFER *bstore );`09/* buffer to store macro text to*/
Xdecl_uninit( int vtrow );        \0807/* Row location of SW cursor`09*/
Xdecl_uninit( int vtcol );        \0807/* Column location of SW cursor */
Xdecl_init( int ttrow, HUGE );           /* Row location of HW cursor`09*/
Xdecl_init( int ttcol, HUGE );           /* Column location of HW cursor */
Xdecl_uninit( int taboff`09);`09`09/* tab offset for display`09*/
Xdecl_init( int ntildes, 100 );`09`09/* number of \1D06 displayed at eob
X`09`09&0209`09  (expressed as percent of window) */
X#if OPT_COLOR
Xdecl_init( int ncolors, NCOLORS );`09/* total number of \2606 displayable */
X#endif
X
X/* Special characters, used in keyboard control (some values are set on
X * initialization in termio.c).
X */
Xdecl_init( int cntl_a, tocntrl('A') );`09/* current meta character`09*/
Xdecl_init( int cntl_x, tocntrl('X') );`09/* current control X prefix char */
Xdecl_init( int reptc, 'K' );`09`09/* current universal repeat char */
Xdecl_init( int abortc, tocntrl('`5B') );`09/* ESC: curre\2808 command char */
V
Xdecl_init( int editc, tocntrl('G') );`09/* toggle edit-mode in minibuffer */
Xdecl_init( int poundc, '#' );`09`09/* pseudo function key prefix */
Xdecl_init( int quotec, tocntrl('V') );`09/*\1B06 char during mlreply()`09*/
Xdecl_init( int killc, tocntrl('U') );`09/* current line kill char`09*/
Xdecl_init( int wkillc, tocntrl('W') );`09/* current word kill char`09*/
Xdecl_init( int intrc, tocntrl('C') );`09/* curre\2206errupt char`09*/
Xdecl_init( int suspc, tocntrl('Z') );`09/* curre\2207end char`09*/
Xdecl_init( int startc, tocntrl('Q') );`09/* current output\2A06 char`09*/
Xdecl_init( int stopc, tocntrl('S') );`09/* current output stop char`09*/
Xdecl_init( int backspc, '`5Cb');`09`09/* curre\1C09ace char`09*/
Xdecl_init( int name_cmpl, '`5Ct');`09/* do name-completion`09`09*/
Xdecl_init( int test_cmpl, '?');`09`09/* show name-completion&0209*/
X
X#if OPT_MSDOS_PATH
Xdecl_init( int slashc, '`5C`5C');`09`09/* default path delimiter`09*/
X#endif
X
Xdecl_uninit( KILLREG kbs`5BNKREGS`5D );`09/* all chars, 1 thru 9, and default
V */
Xdecl_uninit( short ukb );`09`09/* index of current kbuffs */
Xdecl_uninit( USHORT kregflag );`09`09/* info for pending kill into reg */
Xdecl_uninit( C_NUM kregwidth );`09`09/* max \1106of current kill */
Xdecl_uninit( int kchars );`09`09/* how much did we kill? */
Xdecl_uninit( int klines );
Xdecl_uninit( int lines_deleted );`09/* from 'l\1506()', for reporting */
Xdecl_uninit( int warnings );`09`09/* from 'mlwarn()', for reporting */
X
X#if !SMALLER
Xdecl_uninit( WINDOW *swindow );`09`09/* saved \1407pointer&0209*/
X#endif
X
X#if OPT_ENCRYPT
Xdecl_init( int cryptflag, FALSE );`09/* currently encrypting?`09*/
Xdecl_init( char * cryptkey, 0 );`09/* top-level\1C06-key, if any`09*/
X#endif
X
Xdecl_init( int dotcmdmode, RECORD );`09/* curre\2106 command mode`09*/
Xdecl_init( int dotcmdarg, FALSE);`09/* was there an arg to '.'? */
Xdecl_uninit( short dotcmdkreg);`09`09/* original dot command kill reg */
Xdecl_uninit( ITBUFF *dotcmd );`09`09/* recorded-text of dot-commands */
Xdecl_uninit( int dotcmdcnt );`09`09/* down-counter for dot-commands */
Xdecl_uninit( int dotcmdrep );`09`09/* original dot-command repeat-count */
X
Xdecl_init( int`09kbdmode, STOP );`09/* current keyboard macro mode`09*/
X#if OPT_EVAL
Xdecl_uninit( int seed );`09`09/* random number seed&0209*/
X#endif
X
X#if OPT_RAMSIZE
Xdecl_uninit( long envram );`09`09/* # of bytes current used malloc */
X#endif
X
X#if OPT_EVAL `7C`7C OPT_DEBUGMACROS
Xdecl_uninit( int macbug );`09`09/* macro debugging flag&0209*/
X#endif
X
X#if OPT_WORKING
Xdecl_uninit( B_COUNT max_working );`09/* 100% value for slowreadf`09*/
Xdecl_uninit( B_COUNT cur_working );`09/* current-value for slowreadf`09*/
Xdecl_uninit( B_COUNT old_working );`09/* previous-value for slowreadf`09*/
Xdecl_uninit( int no_working );`09`09/* disabling flag */
X#endif
Xdecl_uninit( int signal_was );`09`09/* what was the las\2408 */
X
X`09/* These pointers are nonnull only while animating a given buffer or
X`09 * window.  They are used to obtain local mode-values.
X`09 */
X#if OPT_UPBUFF
Xdecl_uninit( struct VAL *relisting_b_vals );
Xdecl_uninit( struct VAL *relisting_w_vals );
X#endif
X
Xdecl_init( char out_of_mem`5B`5D, "OUT OF MEMORY" );
Xdecl_init( char errorm`5B`5D, "ERROR" );`09/*\1806 literal`09`09*/
Xdecl_init( char truem`5B`5D, "TRUE" );`09/* true literal`09`09`09*/
Xdecl_init( char falsem`5B`5D, "FALSE" );`09/*\1806 literal`09`09*/
X
Xdecl_init( int`09cmdstatus, TRUE );`09/* last command \2006`09`09*/
X#if OPT_EVAL `7C`7C OPT_COLOR
Xdecl_uninit( TBUFF *palstr );`09`09/* palette string&0209*/
X#endif
X#if OPT_COLOR
Xdecl_uninit( int ctrans`5BNCOLORS`5D );`09/* color translation table`09*/
X#endif
Xdecl_uninit( char *fline );`09`09/* dynamic return line&0209*/
Xdecl_uninit( ALLOC_T flen );`09`09/* current length of fline`09*/
X
Xdecl_uninit( int kbd_expand );`09`09/* -1 kbd_putc shows tab as space */
X`09`09&0209`09/* +1 kbd_putc shows cr as `5EM */
X
X
Xdecl_uninit( FILE *ffp );`09`09/* File pointer, all functions. */
Xdecl_uninit( int fileispipe );
Xdecl_uninit( int eofflag );`09`09/* end-of-file flag */
Xdecl_init ( L_NUM help_at, -1 );`09/* position in help-file */
Xdecl_uninit( char *helpfile );
X
Xdecl_uninit( char *startup_file );
Xdecl_uninit( char *startup_path );
X
Xdecl_init_const( char hexdigits`5B`5D, "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ")
V;
X
Xdecl_init_const( char HELP_BufName`5B`5D,`09 `09"`5BHelp`5D");
X#if OPT_REBIND
Xdecl_init_const( char BINDINGLIST_BufName`5B`5D,`09"`5BBinding List`5D");
X# if OPT_TERMCHRS
Xdecl_init_const( char TERMINALCHARS_BufName`5B`5D,`09"`5BTerminal Chars`5D");
V
X# endif
X#endif
X#if OPT_SHOW_CTYPE
Xdecl_init_const( char PRINTABLECHARS_BufName`5B`5D,`09"`5BPrintable Chars`5D")
V;
X#endif
X#if OPT_POPUPCHOICE
Xdecl_init_const( char COMPLETIONS_BufName`5B`5D,`09"`5BCompletions`5D");
X#endif
Xdecl_init_const( char BUFFERLIST_BufName`5B`5D,`09"`5BBuffer List`5D");
X#if OPT_SHOW_EVAL
Xdecl_init_const( char VARIABLES_BufName`5B`5D,`09"`5BVariables`5D");
X#endif
Xdecl_init_const( char MACRO_N_BufName`5B`5D,`09"`5BMacro %d`5D");
X#if COMPLETE_FILES
Xdecl_init_const( char FILECOMPLETION_BufName`5B`5D,`09"`5BFileCompletion`5D");
V
X#endif
X#if COMPLETE_DIRS
Xdecl_init_const( char DIRCOMPLETION_BufName`5B`5D,`09"`5BDirCompletion`5D");
X#endif
Xdecl_init_const( char OUTPUT_BufName`5B`5D,`09`09"`5BOutput`5D");
X#if OPT_FINDERR
Xdecl_init_const( char ERRORS_BufName`5B`5D,`09`09"`5BError Expressions`5D");
X#endif
X#if OPT_HISTORY
Xdecl_init_const( char HISTORY_BufName`5B`5D,`09"`5BHistory`5D");
X#endif
X#if OPT_SHOW_REGS
Xdecl_init_const( char REGISTERS_BufName`5B`5D,`09"`5BRegisters`5D");
X#endif
Xdecl_init_const( char STDIN_BufName`5B`5D,`09`09"`5BStandard Input`5D");
Xdecl_init_const( char UNNAMED_BufName`5B`5D,`09"`5Bunnamed`5D");
Xdecl_init_const( char VILEINIT_BufName`5B`5D,`09"`5Bvileinit`5D");
X#if OPT_SHOW_MAPS
Xdecl_init_const( char MAP_BufName`5B`5D,`09`09"`5BMap Sequences`5D");
Xdecl_init_const( char MAPBANG_BufName`5B`5D,`09"`5BMap! Sequences`5D");
Xdecl_init_const( char ABBR_BufName`5B`5D,`09`09"`5BAbbreviations`5D");
Xdecl_init_const( char SYSMAP_BufName`5B`5D,`09`09"`5BSystem Maps`5D");
X#else
X/* needed anyway, since they're passed around as args */
Xdecl_init_const( char MAP_BufName`5B`5D,`09`09"");
Xdecl_init_const( char MAPBANG_BufName`5B`5D,`09"");
Xdecl_init_const( char ABBR_BufName`5B`5D,`09`09"");
Xdecl_init_const( char SYSMAP_BufName`5B`5D,`09`09"");
X#endif
Xdecl_init_const( char SETTINGS_BufName`5B`5D,`09"`5BSettings`5D");
X#if OPT_MAJORMODE
Xdecl_init_const( char MAJORMODES_BufName`5B`5D,`09"`5BMajor Modes`5D");
X#endif
X#if OPT_POPUP_MSGS
Xdecl_init_const( char MESSAGES_BufName`5B`5D,`09"`5BMessages`5D");
X#endif
Xdecl_init_const( char P_LINES_BufName`5B`5D,`09"`5Bp-lines`5D");
X#if OPT_SHOW_TAGS
Xdecl_init_const( char TAGSTACK_BufName`5B`5D,`09"`5BTag Stack`5D");
X#endif
X#if OPT_TAGS
Xdecl_init_const( char TAGFILE_BufName`5B`5D,`09"`5BTags %d`5D");
X#endif
X
X/* defined in nebind.h and nename.h */
Xextern const NTAB nametbl`5B`5D;
Xextern const CMDFUNC *asciitbl`5B`5D;
Xextern KBIND kbindtbl`5B`5D;
X
X/* vars useful for writing procedures that are : commands */
Xdecl_uninit(int ev_end_of_cmd);
X
X/* terminal table defined only in TERM.C */
X
X#ifndef`09termdef
Xextern  TERM    term;        \0808   /* Terminal information.\2B08*/
X#endif
X#if OPT_DUMBTERM
Xextern`09TERM`09dumb_term;
X#endif
Xextern`09TERM`09null_term;
X
X#if DISP_IBMPC `7C`7C\0E06BORLAND\1009VIO
Xdecl_init( char *current_res_name, "default");
X#endif`09/* IBMPC */
X
X#ifdef __cplusplus
X`7D
X#endif
X
X#endif /* VILE_EDEF_H */
$ call unpack [.VILE-8_0]EDEF.H;1 -
 1500250306 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 29 35 152
$!
$ create 'f'
X/*`09ESTRUCT:`09Structure and preprocessor defines for
X`09`09`09vile.  Reshaped from the original, which
X`09`09`09was for MicroEMACS 3.9
X
X`09`09`09vile is by Paul Fox
X`09`09`09MicroEmacs was written by Dave G. Conroy
X`09`09`09modified by Steve Wilhite, George Jones
X`09`09`09substantially modified by Daniel Lawrence
X*/
X
X/*
X * $Header: /usr/build/vile/vile/RCS/estruct.h,v 1.356 1998/05/27 00:54:37 kev
V Exp $
X */
X
X#ifndef _estruct_h
X#define _estruct_h 1
X
X#ifdef HAVE_CONFIG_H
X#include "config.h"
X#endif
X
X#ifndef CHECK_PROTOTYPES
X#define CHECK_PROTOTYPES 0
X#endif
X
X#ifndef os_chosen
X
X/* All variants of UNIX should now be handled by the configure script */
X
X#ifdef VMS`09`09/* predefined by VAX/VMS compiler */
X# define scrn_chosen
X# define DISP_VMSVT  1
X#endif
X
X/* non-unix flavors */
X#undef SYS_MSDOS
X#undef SYS_WIN31
X
X#define SYS_MSDOS`090`09`09`09/* MS-DOS`09&0209*/
X#define SYS_WIN31`090`09`09`09/* Windows 3.1`09&0209*/
X#define SYS_OS2`09`090&0209`09/* son of DOS&0309*/
X#define SYS_OS2_EMX`090`09`09`09/* Unix'ed OS2&0309*/
X#define SYS_WINNT`090`09`09`09/* Windows/NT`09&0209*/
X
X/*`09Compiler definitions`09`09`09*/
X#define CC_MSC`09`090`09/* Microsoft C compile version 3 `26 4 `26 5 `26 6 */
V
X#define CC_TURBO`090`09/* Turbo C/MSDOS or Borland C++ */
X#define CC_WATCOM`090`09/* \0C06 C/386 version 9.0 or above */
X#define CC_DJGPP`090`09/* DJ's GCC version 1.09 */
X#define CC_CSETPP`090`09/* IBM C Set ++ 2.x */
X#define CC_MSVC`09`090`09/* Microsoft Visual C++ 7 `26 8 `26 9 */
X
X#ifdef __TURBOC__`09/* predefined in Turbo C, both DOS and Windows */
X# ifdef __FLAT__`09/* predefined in Borland C for WIN32 */
X#  undef SYS_WINNT
X#  define SYS_WINNT  1
X# else
X#  ifdef _Windows`09/* predefined in TurboC for \2407 */
X#   undef SYS_WIN31
X#   define SYS_WIN31  1
X#  else
X#   undef SYS_MSDOS
X#   define SYS_MSDOS  1
X#  endif
X# endif
X# undef CC_TURBO
X# define CC_TURBO  1
X#endif
X
X#ifdef _WIN32`09`09/* predefined in Visual C/C++ 4.0 */
X# undef SYS_WINNT
X# define SYS_WINNT 1
X#endif
X
X#ifdef __WATCOMC__
X#undef SYS_MSDOS
X#define SYS_MSDOS  1
X#undef CC_WATCOM
X#define CC_WATCOM 1
X#endif
X
X#ifdef __IBMC__
X# if __IBMC__ >= 200`09/* IBM C Set ++ version 2.x */
X#  undef  CC_CSETPP
X#  define CC_CSETPP 1
X# endif
X#endif
X
X#ifdef __OS2__
X/* assume compiler already chosen */
X#undef SYS_OS2
X#undef SYS_MSDOS
X#define SYS_OS2    1
X#define SYS_MSDOS  0
X#endif
X
X#ifdef __GO32__  `09/* DJ's GCC version 1.09 */
X#undef SYS_MSDOS
X#define SYS_MSDOS  1
X#undef CC_DJGPP
X#define CC_DJGPP   1
X#endif
X
X#ifdef _MSC_VER
X#undef SYS_WINNT
X#define SYS_WINNT`091
X#undef CC_MSVC
X#define CC_MSVC`09`091
X#endif
X
X/* As of version 3.51 of vile, CC_NEWDOSCC should be correct for Turbo,
X * Watcom, and the DJ gcc (GO32) compilers.  I'm betting that it's also
X * probably correct for MSC (Microsoft C) and ZTC (Zortech), but I'm not
X * sure of those.  (It implies a lot of ANSI and POSIX behavior.)
X */
X#if CC_TURBO `7C`7C CC_WATCOM\0D07MSC\1707DJGPP &027C SYS_WINNT\3007CSET\1A06
VCC_MSVC
X# define CC_NEWDOSCC 1
X# define HAVE_GETCWD 1
X#else
X# define CC_NEWDOSCC 0
X#endif
X
X#if CC_TURBO
X# if !SYS_WINNT
X#  define off_t long`09`09/* missing in TurboC 3.1 */
X# endif
X#endif
X
X#if CC_CSETPP
X# define HAVE_UTIME`09`091
X# define HAVE_STRERROR`09`091
X# define HAVE_SYS_UTIME_H`091
X# define CPP_SUBS_BEFORE_QUOTE`091
X# define HAVE_LOSING_SWITCH_WITH_STRUCTURE_OFFSET`091
X#endif
X
X#if CC_DJGPP
X# define HAVE_UNISTD_H`09`091
X#endif
X
X#endif /* os_chosen */
X
X/*
X * This may apply to makefile.emx, or to builds with the configure-script
X */
X#ifdef __EMX__
X#define SYS_OS2_EMX 1
X#endif
X
X/*
X * Porting constraints: supply the normally assumed values that we get from
X * the "configure" script, for systems on which we cannot run \370B
X * (e.g., VMS, OS2, MSDOS).
X */
X#ifndef HAVE_ACCESS
X# define HAVE_ACCESS    1`09/* if your system has the access()\1808call */
X#endif
X
X#ifndef HAVE_MKDIR
X# define HAVE_MKDIR`091`09/* if your system has the mkdir()\1708call */
X#endif
X
X#ifndef HAVE_QSORT
X# define HAVE_QSORT`091`09/* if your system has the qsort()\1708call */
X#endif
X
X#ifndef HAVE_UTIME
X# define HAVE_UTIME`090`09/* if your system has the utime()\1708call */
X#endif
X
X#ifndef HAVE_SETJMP_H
X# define HAVE_SETJMP_H  1`09/* if your system has <setjmp.h> */
X#endif
X
X#ifndef HAVE_SIGNAL_H
X# define HAVE_SIGNAL_H  1`09/* if your system has <signal.h> */
X#endif
X
X#if !(defined(HAVE_STRCHR) `7C`7C \1810RCHR))
X# define HAVE_STRCHR    1
X# define HAVE_STRRCHR   1
X#endif
X
X#ifndef HAVE_STDLIB_H
X# define HAVE_STDLIB_H  1`09/* if your system has <stdlib.h> */
X#endif
X
X#ifndef HAVE_STRING_H
X# define HAVE_STRING_H  1`09/* if your system has <string.h> */
X#endif
X
X/* Some code uses these as values in expressions, so we always want them
X * defined, just in case we run into a substandard preprocessor.
X */
X#ifndef DISP_X11
X# define DISP_X11 0
X#endif
X#ifndef SYS_MSDOS
X# define SYS_MSDOS 0
X#endif
X#ifndef SYS_OS2
X# define SYS_OS2 0
X#endif
X#ifndef SYS_WIN31
X# define SYS_WIN31 0
X#endif
X#ifndef SYS_WINNT
X# define SYS_WINNT `090
X#endif
X#if defined(VMS) `7C`7C\1009__VMS) /* pred\2506 by DEC's VMS compilers */
X# define SYS_VMS    1
X# define HAVE_GETCWD 1
X# if defined(__DECC) `26`26 !\140Aalpha)
X#  undef HAVE_ACCESS
X#  define HAVE_ACCESS 0`09/* 'access()' is reported to not work properly */
X# endif
X# if !defined(__DECC)
X#  undef  HAVE_QSORT
X#  define HAVE_QSORT 0`09/* VAX-C's 'qsort()' is definitely broken */
X# endif
X# define SIGT void
X# define SIGRET
X#else
X# define SYS_VMS    0
X#endif
X#ifdef apollo
X# define SYS_APOLLO 1`09/* FIXME: still more ifdefs to autoconf */
X#endif
X#ifdef sun
X# define SYS_SUNOS 1`09/* FIXME: need to tweak lint ifdefs */
X#endif
X
X#define IBM_KBD `09(SYS_MSDOS `7C`7C SYS_OS2\0B08WINNT)
X#define IBM_VIDEO `09(SYS_MSDOS `7C`7C SYS_OS2\0B08WINNT)
X#define CRLF_LINES `09(SYS_MSDOS `7C`7C SYS_OS2\0B08WINNT)
X
X#include <stdio.h>
X#include <sys/types.h>
X#include <sys/stat.h>`09/* defines off_t */
X
X#if HAVE_LIBC_H
X#include <libc.h>
X#endif
X#if HAVE_FCNTL_H
X#ifndef O_RDONLY`09/* prevent multiple inclusion on lame systems */
X#include <fcntl.h>`09/* 'open()' */
X#endif
X#endif
X
X#if HAVE_SYS_TIME_H `26`26 ! SYSTEM_LOOKS_LIKE_SCO
X/* on SCO, sys/time.h conflicts with select.h, and we don't need it */
X#include <sys/time.h>
X#ifdef TIME_WITH_SYS_TIME
X# include <time.h>
X#endif
X#else
X#include <time.h>
X#endif
X
X#if HAVE_SYS_RESOURCE_H `26`26 ! SYSTEM_LOOKS_LIKE_SCO
X/* On SunOS, struct rusage is referred to in <sys/wait.h>. \2F0E
X   is defined in <sys/resource.h>.   NeXT may be similar.  On SCO,
X   resource.h needs time.h, which we excluded above.  */
X#include <sys/resource.h>
X#endif
X
X#if HAVE_SYS_WAIT_H
X#include <sys/wait.h>`09/* 'wait()' */
X#endif
X
X/* definitions for testing apollo version with gcc warnings */
X#if SYS_APOLLO
X# ifdef __GNUC__`09`09/* only tested for SR10.3 with gcc 1.36 */
X#  ifndef _APOLLO_SOURCE`09/* ...defined in gcc 2.4.5 */
X#  define _APOLLO_SOURCE`09/* appease gcc by forcing extern-defs */
X#  endif
X#  define __attribute(s)
X#  define APOLLO_STDLIB 1
X# endif
X# if defined(L_tmpnam)`09`09/* SR10.3, CC 6.8\2507s in <stdio.h> */
X#  define APOLLO_STDLIB 1
X# endif
X#endif
X
X#ifndef APOLLO_STDLIB
X# define APOLLO_STDLIB 0
X#endif
X
X#ifndef SIGT
X/* choose between void and int signal handler return type.
X  "typedefs?  we don't need no steenking \2608..." */
X# if CC_NEWDOSCC
X#  define SIGT void
X#  define SIGRET
X# else
X#  define SIGT int
X#  define SIGRET return 0
X# endif
X#endif /* SIGT */
X
X#if HAVE_SIGNAL_H
X#include <signal.h>
X#endif
X
X#ifndef ACTUAL_SIG_ARGS
X# define ACTUAL_SIG_ARGS signo`09/* some systems have more arguments... */
X#endif
X
X#if defined(__GNUC__)
X# undef  SIG_DFL
X# undef  SIG_IGN
X# define SIG_DFL`09(SIGT (*)(int ACTUAL_SIG_ARGS))0
X# define SIG_IGN`09(SIGT (*)(int ACTUAL_SIG_ARGS))1
X#endif
X
X#if HAVE_SETJMP_H
X#include`09<setjmp.h>
X#endif
X
X/* argument for 'exit()' or '_\0D08*/
X#if SYS_VMS
X#include`09<stsdef.h>
X#define GOODEXIT`09(STS$M_INHIB_MSG `7C STS$K_SUCCESS)
X#define BADEXIT`09`09(STS$M_INHIB_MSG `7C STS$K_ERROR)
X#else
X#define GOODEXIT`090
X#define BADEXIT`09`091
X#endif
X
X/* has the select() or poll() call, only used for short sleeps in fmatch() */
V
X#if HAVE_SELECT
X#undef HAVE_POLL
X#endif
X
X#if SYS_UNIX `7C`7C SYS_MSDOS\0D08WIN31\1A08VMS\2508OS2\230BNT
X#define`09ENVFUNC`091
X#else
X#define`09ENVFUNC`090
X#endif
X
X/* ========\0808\1010\2020\4006 */
X#ifndef scrn_chosen
X/*`09Terminal Output definitions`09`09*/
X/* choose ONLY one of the following */
X#define DISP_TERMCAP`09SYS_UNIX`09/* Use \1808`09`09*/
X#define DISP_ANSI`090`09`09/* ANSI escape sequences`09*/
X#define DISP_AT386`090`09`09/* AT style 386 unix console`09*/
X#define`09DISP_VMSVT`09SYS_VMS`09`09/* various VMS terminal entries`09*/
X#define`09DISP_BORLAND`090`09`09/* Borland console I/O routines */
X#define`09DISP_IBMPC`09(SYS_MSDOS `26`26 !DISP_BORLAND\110AANSI) /* IBM-PC CGA
V/MONO/EGA driver */
X#define`09DISP_X11`090`09`09/* X Window System */
X#define DISP_NTCONS`090`09`09/* Windows/NT console&0209*/
X#define DISP_NTWIN`090`09`09/* Windows/NT screen/w\1206`09*/
X#define DISP_VIO`09SYS_OS2`09`09/* OS/2 VIO (text mode)&0209*/
X#define`09DISP_HP150`090`09`09/* (not supported)&0209*/
X#endif
X
X/* ========\0808\1010\2020\4006 */
X/*`09Configuration options... pick and choose as you wish */
X
X/*`09Code size options`09*/
X#ifndef FEWNAMES
X#define`09FEWNAMES 0`09/* strip some names - will no longer be bindable */
X#endif
X
X#ifndef SMALLER
X#define`09SMALLER`090`09/* strip some fluff -- not a lot smaller, but some */
V
X#endif
X
X#ifndef OPT_SHELL
X#define OPT_SHELL 1`09/* we'll disable this only as an exercise */
X#endif
X
X#ifndef OPT_LOCALE
X#define OPT_LOCALE 0
X#endif
X
X/* various color stuff */
X#define`09OPT_COLOR (DISP_ANSI `7C`7C IBM_VIDEO &027C DISP_TERMCAP)
X#define`09OPT_16_COLOR (IBM_VIDEO `7C`7C DISP_TERMCAP)
X
X#define OPT_DUMBTERM (DISP_TERMCAP `7C`7C DISP_VMSVT)
X
X/* Feature turnon/turnoff */
X#define`09OPT_DOSFILES`091`09/* turn on code for DOS mode (lines that
X`09`09&0209   end in crlf).  use DOSFILES, for instance,
X`09`09&0209   if you edit DOS-created files under UNIX   */
X#define`09OPT_REVSTA`091`09/* Status line appears in reverse video       */
X#define`09OPT_CFENCE`091`09/* do fence matching in CMODE`09`09      */
X#define`09OPT_LCKFILES`090`09/* create lock files (file.lck style) `09      */
V
X#define`09OPT_TAGS`091`09/* tags support  `09`09`09      */
X#define`09OPT_PROCEDURES`091`09/* named procedures`09`09`09      */
X#define`09OPT_PATHLOOKUP`091`09/* search $PATH for startup and help files    *
V/
X#define`09OPT_SCROLLCODE`091`09/* code in display.c for scrolling the screen.
V
X`09`09&0209   Only useful if your display can scroll
X`09`09&0209   regions, or at least insert/delete lines.
X`09`09&0209   ANSI, TERMCAP, IBMPC, VMSVT and AT386 can
X`09`09&0209   do this */
X#define OPT_CVMVAS`091`09/* arguments to forward/back page and half page
X`09`09&0209   are in pages`09instead of rows (in vi,
X`09`09&0209   they're rows, and the argument is "sticky",
X`09`09&0209   i.e. it's remembered */
X#define OPT_PRETTIER_SCROLL 0`09/* can improve the appearance of a scrolling
X`09`09&0209   screen, but it will in general be slower */
X#define OPT_STUTTER_SEC_CMD 0`09/* must the next/prev section commands (i.e.
X`09`09&0209   '`5D`5D' and '`5B`5B' be stuttered?  they must be
X`09`09&0209   stuttered in real vi, I prefer them not
X`09`09&0209   to be */
X#define OPT_ICURSOR`090`09/* use an insertion cursor if possible */
X#define OPT_W32PIPES    SYS_WINNT /* Win32 pipes */
X
X#ifndef OPT_EXEC_MACROS`09`09/* total numbered macros (see mktbls.c) */
X#if SMALLER
X#define OPT_EXEC_MACROS 10
X#else
X#define OPT_EXEC_MACROS 40
X#endif
X#endif
X
X  /* NOTE:  OPT_ICURSOR is _only_ supported by borland.c for a PC build
X     and ntconio.c for a win32 build!! */
X#define OPT_TITLE`09(SYS_WINNT)`09`09/* use a window title */
X
X/* the "working..." message -- we must have the alarm() syscall, and
X   system calls must be restartable after an interrupt by default or be
X   made restartable with sigaction() */
X#define OPT_WORKING (!SMALLER `26`26 HAVE_ALARM\0E09RESTARTABLE_PIPEREAD)
X
X#define OPT_SCROLLBARS XTOOLKIT`09`09`09/* scrollbars */
X#define OPT_VMS_PATH    (SYS_VMS)  /* vax/vms path parsing (testing/porting)*/
V
X
X/* systems with MSDOS-like filename syntax */
X#define OPT_MSDOS_PATH  (SYS_MSDOS `7C`7C SYS_WIN31\0D08OS2\180BNT\180B_EMX)
X#define OPT_CASELESS`09(SYS_WINNT `7C`7C SYS_OS2\0B0B_EMX)
X#define OPT_UNC_PATH`09(SYS_WINNT)
X
X/* individual features that are (normally) controlled by SMALLER */
+-+-+-+-+-+-+-+-  END  OF PART 45 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 46 -+-+-+-+-+-+-+-+
X#define OPT_AEDIT       !SMALLER`09`09/* advanced editing options: e.g. en/det
Vabbing`09*/
X#define OPT_B_LIMITS    !SMALLER`09`09/* left-margin */
X#define OPT_ENCRYPT     !SMALLER /* file encryption (not crypt(1) compatible!)
V */
X#define OPT_ENUM_MODES  !SMALLER`09`09/* fixed-string modes */
X#define OPT_EVAL        !SMALLER`09`09/* expression-evaluation */
X#define OPT_FILEBACK    !SMALLER `26`26 !SYS_VMS`09/* file backup style */
X#define OPT_FINDERR     !SMALLER`09`09/* finderr support. */
X#define OPT_FLASH       !SMALLER `7C`7C DISP_IBMPC`09/* visible-bell */
X#define OPT_FORMAT      !SMALLER`09`09/* region formatting support. */
X#define OPT_HILITEMATCH !SMALLER`09`09/* highlight all matches of a search */
V
X#define OPT_HISTORY     !SMALLER`09`09/* command-history */
X#define OPT_ISO_8859    !SMALLER`09`09/* ISO 8859 characters */
X#define OPT_ISRCH       !SMALLER`09`09/* Incremental searches */
X#define OPT_LINEWRAP    !SMALLER`09`09/* line-wrap mode */
X#define OPT_MAJORMODE   !SMALLER`09`09/* majormode support */
X#define OPT_MLFORMAT    !SMALLER`09`09/* modeline-format */
X#define OPT_MS_MOUSE    !SMALLER `26`26 DISP_IBMPC  /* MsDos-mouse */
X#define OPT_NAMEBST     !SMALLER`09`09/* name's stored in a bst */
X#define OPT_ONLINEHELP  !SMALLER`09`09/* short per-command help */
X#define OPT_POPUPCHOICE !SMALLER`09`09/* popup-choices mode */
X#define OPT_POPUP_MSGS  !SMALLER`09`09/* popup-msgs mode */
X#define OPT_REBIND      !SMALLER`09`09/* permit rebinding of keys at run-time
V`09*/
X#define OPT_TAGS_CMPL   !SMALLER `26`26\1C09`09/* name-completion for tags */
V
X#define OPT_TERMCHRS    !SMALLER`09`09/* set/show-terminal */
X#define OPT_UPBUFF      !SMALLER`09`09/* animated buffer-update */
X#define OPT_WIDE_CTYPES !SMALLER`09`09/* extra char-types tests */
X#define OPT_WORDCOUNT   !SMALLER`09`09/* "count-words" command" */
X
X/* "show" commands for the optional features */
X#define OPT_SHOW_CTYPE`09!SMALLER`09`09/* "show-printable" */
X#define OPT_SHOW_EVAL   !SMALLER `26`26 OPT_EVAL`09/* "show-variables" */
X#define OPT_SHOW_MAPS   !SMALLER `09`09/* display mapping for ":map" */
X#define OPT_SHOW_REGS   !SMALLER`09`09/* "show-registers" */
X#define OPT_SHOW_TAGS   !SMALLER `26`26 OPT_TAGS`09/* ":tags" displays tag-sta
Vck */
X
X/* selections and attributed regions */
X#define OPT_VIDEO_ATTRS !SMALLER
X#define OPT_SELECTIONS  OPT_VIDEO_ATTRS
X#define OPT_HYPERTEXT`09OPT_VIDEO_ATTRS
X
X/* OPT_PSCREEN permits a direct interface to the pscreen data structure
X * in display.c. This allows us to avoid storing the screen data on the
X * screen interface side.
X */
X#define OPT_PSCREEN  (XTOOLKIT `26`26 OPT_VIDEO_ATTRS)
X
X#if`09DISP_TERMCAP `26`26 !SMALLER
X/* the setting "xterm-mouse" is always available, i.e.  the modetbl entry
X * is not conditional.  but all of the code that supports xterm-mouse _is_
X * ifdefed.  this makes it easier for users to be able to put "set
X * xterm-mouse" in their .vilerc which is shared between vile and xvile.
X */
X#define`09OPT_XTERM`092`09/* mouse-clicking support */
X#else
X#define`09OPT_XTERM`090`09/* vile doesn't recognize xterm mouse */
X#endif
X
X `09/* combine select/yank (for mouse support) */
X#define OPT_SEL_YANK    ((DISP_X11 `26`26 XTOOLKIT) `7C`7C SYS_WINNT\0D08OS2)
V
X
X`09/* any mouse capability */
X#define OPT_MOUSE       (OPT_SEL_YANK `7C`7C OPT_XTERM\0D08MS\3106)
X
X`09/* menus */
X#define`09OPT_MENUS`09(DISP_X11 `26`26 (MOTIF_WIDGETS`7C`7CATHENA\1008))
X
X/*
X * If selections will be used to communicate between vile and other
X * applications, OWN_SELECTION must be defined to call the procedure
X * for establishing ownership of the selection.
X */
X#if OPT_SELECTIONS `26`26 XTOOLKIT /* or others? */
X#define OWN_SELECTION() own_selection()
X#else
X#define OWN_SELECTION()`09/*EMPTY*/
X#endif
X
X/*
X * Special characters used in globbing
X */
X#define`09GLOB_MULTI`09'*'
X#define`09GLOB_SINGLE`09'?'
X#define`09GLOB_ELLIPSIS`09"..."
X#define`09GLOB_RANGE`09"`5B`5D"
X#define`09GLOB_NEGATE`09"`5E!"
X
X/*
X * Configuration options for globbing
X */
X#define`09OPT_GLOB_ENVIRON`09ENVFUNC `26`26 !SMALLER
X#define`09OPT_GLOB_ELLIPSIS`09SYS_VMS `7C`7C SYS_UNIX\0C08OS2\1708WINNT &027C
V (SYS_MSDOS `26`26 !SMALLER)
X#define`09OPT_GLOB_PIPE`09`09SYS_UNIX `26`26 OPT_SHELL
X#define`09OPT_GLOB_RANGE`09`09SYS_UNIX `7C`7C SYS_OS2\0B08WINNT &027C (SYS_MSD
VOS `26`26 !SMALLER)
X
X/*`09Debugging options`09*/
X#define`09OPT_RAMSIZE`09`090  /* dynamic RAM memory usage tracking */
X#define OPT_DEBUGMACROS`09`090  /* $debug triggers macro debugging`09*/
X#define`09OPT_VISIBLE_MACROS`090  /* update display during keyboard macros*/
X
X#ifndef OPT_TRACE
X#define OPT_TRACE`09`090  /* turn on debug/trace (link with trace.o) */
X#endif
X
X/* That's the end of the user selections -- the rest is static definition */
X/* (i.e. you shouldn't need to touch anything below here */
X/* ========\0808\1010\2020\4006 */
X
X#include <errno.h>
X#if SYS_VMS
X#include <perror.h>`09/* defines 'sys_errlist`5B`5D' */
X#endif
X#if SYS_UNIX
X# ifdef DECL_ERRNO
Xextern`09int`09errno;`09/* some systems don't define this in <errno.h> */
X# endif
X# ifdef DECL_SYS_NERR
Xextern`09int`09sys_nerr;
X# endif
X# ifdef DECL_SYS_ERRLIST
Xextern`09char *`09sys_errlist`5B`5D;
X# endif
X#endif
X#define`09set_errno(code)`09errno = code
X
X`09/* bit-mask definitions */
X#define`09lBIT(n)`09((ULONG)(1L<<(n)))
X#define`09iBIT(n) ((UINT)(1 <<(n)))
X
X/* FIXME: leftover definitions from K`26R version */
X#define SIZE_T  size_t
X#define ALLOC_T size_t
X
X#ifndef HAVE_GETHOSTNAME
X#define HAVE_GETHOSTNAME 0
X#endif
X
X#if !(HAVE_STRCHR `26`26 \0F08RCHR)
X#define USE_INDEX 1
X#endif
X
X#ifdef USE_INDEX
X#define strchr index
X#define strrchr rindex
X#if MISSING_EXTERN_RINDEX
Xextern char *index (const\1307s, int c);
Xextern char *rindex (const\1407s, int c);
X#endif
X#endif /* USE_INDEX */
X
X#if STDC_HEADERS `7C`7C HAVE_STRING_H
X# include <string.h>
X  /* An ANSI string.h and pre-ANSI memory.h might conflict.  */
X# if !STDC_HEADERS `26`26 HAVE_MEMORY_H
X#  include <memory.h>
X# endif /* not STDC_HEADERS and HAVE_MEMORY_H */
X#else /* not STDC_HEADERS and not HAVE_STRING_H */
X# if HAVE_STRINGS_H
X#  include <strings.h>
X  /* memory.h and strings.h conflict on some systems */
X  /* FIXME: should probably define memcpy and company in terms of bcopy,
X     et al here */
X# endif
X#endif /* not STDC_HEADERS and not HAVE_STRING_H */
X
X#if HAVE_SYS_PARAM_H
X#include <sys/param.h>
X#endif
X
X/*`09System dependent library redefinitions, structures and includes`09*/
X
X#if CC_NEWDOSCC `26`26 ! CC_CSETPP
X#include <dos.h>
X# define HAVE_STRERROR`09`091
X#endif
X
X#if CC_NEWDOSCC `26`26 ! CC_DJGPP\0E09CSETPP
X#undef peek
X#undef poke
X#define`09peek(a,b,c,d)`09movedata(a,b,FP_SEG(c),FP_OFF(c),d)
X#define`09poke(a,b,c,d)`09movedata(FP_SEG(c),FP_OFF(c),a,b,d)
X#define`09movmem(a, b, c)`09`09memcpy(b, a, c)
X#endif
X
X#if  CC_WATCOM
X#include      <string.h>
X#endif
X
X#if  CC_WATCOM `7C`7C CC_DJGPP
X#define`09movmem(a, b, c)`09`09memcpy(b, a, c)
X#endif
X
X#if CC_MSC
X#include <memory.h>
X#endif
X
X
X/* on MS-DOS we have to open files in binary mode to see the `5EZ characters.
V */
X
X#if SYS_MSDOS `7C`7C SYS_WIN31\0D08OS2\180BNT
X#define FOPEN_READ`09"rb"
X#define FOPEN_WRITE`09"wb"
X#define FOPEN_APPEND`09"ab"
X#define FOPEN_UPDATE`09"w+b"
X#else
X#define FOPEN_READ`09"r"
X#define FOPEN_WRITE`09"w"
X#define FOPEN_APPEND`09"a"
X#define FOPEN_UPDATE`09"w+"
X#endif
X
X#if OPT_MSDOS_PATH `26`26 !SYS_OS2_EMX`09/* DOS path / to `5C conversions */
X# define is_slashc(c) (c == '`5C`5C' `7C`7C \0D06/')
X# define SL_TO_BSL(s)`09sl_to_bsl(s)
X#else
X# define SL_TO_BSL(s)`09(s)
X# define bsl_to_sl_inplace(s)
X#endif
X
X
X#ifndef is_slashc
X# define is_slashc(c) (c == '/')
X#endif
X
X#define SLASHC '/'`09/* UNIX, MSDOS-compatibility, VMS-shell */
X
X
X#if SYS_VMS
X#define`09unlink(a)`09delete(a)
X#define tempnam`09`09vile_\0E07
X#endif
X
X#if SYS_OS2 `26`26 CC_WATCOM
X#define unlink(a)`09remove(a)
X#endif
X
X/*`09define some ability flags */
X
X`09/* intermediate config-controls for filec.c (needed in nemode.h) */
X#if !SMALLER
X#define COMPLETE_FILES  (SYS_UNIX `7C`7C SYS_MSDOS \0D07VMS\1808OS2\2308WINNT)
V
X#define`09COMPLETE_DIRS   (SYS_UNIX `7C`7C SYS_MSDOS \0D07VMS\1808OS2\2308WINN
VT)
X#else
X#define COMPLETE_FILES  0
X#define COMPLETE_DIRS   0
X#endif
X
X#if DISP_NTWIN
Xextern int MainProgram(int argc, char *argv`5B`5D);
X#else
X#define MainProgram main
X#endif
X
X`09/* semaphore may be needed to prevent interrupt of display-code */
X#if !defined(SIGWINCH) `26`26 ! OPT_WORKING
X# define beginDisplay() /* nothing */
X# define endofDisplay() /* nothing */
X#endif
X
X#if OPT_WORKING
X#define ShowWorking() (!global_b_val(MDTERSE) `26`26 \1907g_val(GMDWORKING))
X#else
X#define ShowWorking() (!global_b_val(MDTERSE))
X#endif
X
X/* how to signal our process group: pass the 0 to 'getpgrp()' if we can,
X * since it's safer --- the machines where we can't are probably POSIX
X * machines with ANSI C.
X */
X#if !GETPGRP_VOID `7C`7C MISSING_EXTERN_\1F07
X# define GETPGRPCALL getpgrp(0)
X#else
X# define GETPGRPCALL getpgrp()
X#endif
X
X#if HAVE_KILLPG
X# define signal_pg(sig) killpg( GETPGRPCALL, sig)
X#else
X# define signal_pg(sig)   kill(-GETPGRPCALL, sig)
X#endif
X
X#if`09DISP_IBMPC
X#define`09MEMMAP`091
X#else
X#define`09MEMMAP`090
X#endif
X
X#if SYS_OS2
X/*
X * The OS/2 toolkit defines identical typedefs for UCHAR, etc.;
X * we use those definitions to avoid trouble when using OS/2 include
X * files.
X */
X# include <os2def.h>
X#else
X# define UCHAR`09unsigned char
X# define UINT`09unsigned int
X# define USHORT`09unsigned short
X# define ULONG`09unsigned long
X#endif
X
X/*`09internal constants`09*/
X
X#if SYS_MSDOS `7C`7C SYS_WIN31
X#define`09BITS_PER_INT`0916
X#endif
X
X#ifndef`09BITS_PER_INT
X#define`09BITS_PER_INT`0932
X#endif
X
X#ifdef  MAXPATHLEN`09`09`09/* usually in <sys/param.h>`09*/
X#define NFILEN`09MAXPATHLEN`09`09/* # of bytes, file name`09*/
X#else
X#define NFILEN`09256`09`09`09/* # of bytes, file name`09*/
X#endif
X#define NBUFN`0921`09`09`09/* # of bytes, buffername, incl. null*/
X#define NLINE`09256`09`09`09/* # of bytes, input line`09*/
X#define`09NSTRING`09128`09`09`09/* # of bytes, string buffers`09*/
X#define NPAT`09128`09`09`09/* # of bytes, pattern&0209*/
X#define HUGE`09(1<<(BITS_PER_INT-2))`09/* Huge number`09`09`09*/
X#define`09NLOCKS`09100`09`09`09/* max # of file locks active`09*/
X#if DISP_X11 `7C`7C\0C06TERMCAP &027C IBM_VIDEO
X#define`09NCOLORS`0916`09`09`09/* number of supported colors`09*/
X#else
X#define`09NCOLORS`098`09`09`09/* number of supported colors`09*/
X#endif
X#define`09KBLOCK`09256`09`09`09/* sizeof kill buffer chunks`09*/
X#if !OPT_SELECTIONS
X#define`09NKREGS`0937`09`09`09/* number of kill buffers`09*/
X#define KEYST_KREG (NKREGS-1)
X#else
X#define NKREGS`0939`09`09`09/* When selections are enabled, we
X`09`09&0209`09 * allocate an extra kill buffer for
X`09`09&0209`09 * the current selection and another
X`09`09&0209`09 * for the clipboard.
X`09`09&0209`09 */
X#define CLIP_KREG (NKREGS-1)
X#define SEL_KREG (NKREGS-2)
X#define KEYST_KREG (NKREGS-3)
X#endif
X#define`09NBLOCK`0916`09`09`09/* line block chunk size`09*/
X#define MINWLNS`093`09`09`09/* min # lines, window/screen`09*/
X#define MAXROWS`09200`09`09`09/* max # lines per screen`09*/
X#define MAXCOLS`09200`09`09`09/* max # cols per screen`09*/
X
X#define C_BLACK 0
X#define C_WHITE (ncolors-1)
X
X#define N_chars 256`09`09/* must be a power-of-2&0209*/
X#define HIGHBIT`090x0080`09`09/* the meta bit&0209`09*/
X#define CTLA`090x0100`09`09/* `5EA flag, or'ed in&0209*/
X#define CTLX`090x0200`09`09/* `5EX flag, or'ed in&0209*/
X#define SPEC`090x0400`09`09/* special key (function keys)`09*/
X#define NOREMAP`090x0800`09`09/* unremappable */
X#define YESREMAP 0x1000`09`09/* override noremap */
X#define REMAPFLAGS (NOREMAP`7CYESREMAP)
X
X#define kcod2key(c)`09((c) `26 (UINT)(N_chars-1)) /* strip off the above prefi
Vxes */
X#define`09isspecial(c)`09(((UINT)(c) `26 \0C06`7E(N_chars-1)) != 0)
X
X#define`09char2int(c)`09((int)(c `26 0xff)) /* mask off sign-extension, etc. *
V/
X
X#define`09PLURAL(n)`09((n!=1)?"s":"")
X
X#define`09EOS     '`5C0'
X
X/* protect against losing namespaces */
X#undef`09FALSE
X#undef`09TRUE
X#undef`09ABORT
X#undef`09FAILED
X#undef`09SORTOFTRUE
X
X#define FALSE`090`09`09`09/* False, no, bad, etc. `09*/
X#define TRUE`091`09`09`09/* True, yes, good, etc.`09*/
X#define ABORT`092`09`09`09/* Death, ESC, abort, etc.`09*/
X#define`09FAILED`093`09`09`09/* not-quite fatal false return`09*/
X#define`09SORTOFTRUE`094`09`09/* really!`09*/
X
X#define`09STOP`090`09`09`09/* keyboard macro not in use`09*/
X#define`09PLAY`091`09`09`09/*`09"     "`09  playing`09*/
X#define`09RECORD`092`09`09`09/*`09"     "   recording`09*/
X
X#define QUOTED`09TRUE
X#define NOQUOTED`09FALSE
X
X#define DOMAP`09TRUE
X#define NODOMAP`09FALSE
X
X/* values for regionshape */
Xtypedef enum `7B
X`09EXACT,
X`09FULLLINE,
X`09RECTANGLE
X`7D REGIONSHAPE;
X
X/* flook options */
X#define FL_EXECABLE  iBIT(0)`09/* same as X_OK */
X#define FL_WRITEABLE iBIT(1)`09/* same as W_OK */
X#define FL_READABLE  iBIT(2)`09/* same as R_OK */
X#define FL_HERE      iBIT(3)`09/* look in current directory */
X#define FL_HOME      iBIT(4)`09/* look in home directory */
X#define FL_EXECDIR   iBIT(5)`09/* look in execution directory */
X#define FL_TABLE     iBIT(6)`09/* look in table */
X#define FL_PATH      iBIT(7)`09/* look along execution-path */
X
X#define FL_ANYWHERE  (FL_HERE`7CFL_HOME`7CFL_EXECDIR`7CFL_TABLE`7CFL_PATH)
X
X/* definitions for name-completion */
X#define`09NAMEC`09`09name_cmpl /* char for forcing name-completion */
X#define`09TESTC`09`09test_cmpl /* char for testing name-completion */
X
X/* kbd_string options */
X#define KBD_EXPAND`09iBIT(0)`09/* do we want to expand %, #, : */
X#define KBD_QUOTES`09iBIT(1)`09/* do we add and delete '`5C' chars for the cal
Vler */
X#define KBD_LOWERC`09iBIT(2)`09/* do we force input to lowercase */
X#define KBD_UPPERC`09iBIT(3)`09/* do we force input to uppercase */
X#define KBD_NOEVAL`09iBIT(4)`09/* disable 'tokval()' (e.g., from buffer) */
X#define KBD_MAYBEC`09iBIT(5)`09/* may be completed -- or not */
X#define KBD_NULLOK`09iBIT(6)`09/* may be empty -- or not */
X#define KBD_EXPCMD`09iBIT(7)`09/* expand %, #, : only in shell-command */
X#define KBD_SHPIPE`09iBIT(8)`09/* expand, assuming shell-command */
X#define KBD_NOMAP`09iBIT(9) /* don't permit mapping via kbd_key() */
X#define KBD_EXPPAT`09iBIT(10) /* expand `7E to last replacement */
X#define KBD_0CHAR`09iBIT(11) /* string can have embedded nulls */
X#define KBD_STATED`09iBIT(12) /* erasing buffer returns for prev-state */
X
X/* default option for 'mlreply' (used in modes.c also) */
X#if !(SYS_MSDOS `7C`7C SYS_WIN31\0D08OS2\180BNT)
X#define`09KBD_NORMAL`09KBD_EXPAND`7CKBD_QUOTES
X#else
X#define`09KBD_NORMAL`09KBD_EXPAND
X#endif
X
X/* This was an enum, but did not compile with TurboC */
X#define WATCHREAD   iBIT(0)
X#define WATCHWRITE  iBIT(1)
X#define WATCHEXCEPT iBIT(2)
Xtypedef UINT WATCHTYPE;
X
X/* reserve space for ram-usage option */
X#if OPT_RAMSIZE
X#define`09LastMsgCol`09(term.t_ncol - 10)
X#else
X#define`09LastMsgCol`09(term.t_ncol - 1)
X#endif
X
X/*
X * directions for the scan routines.
X */
X#define`09FORWARD`090`09`09`09/* forward direction&0209*/
X#define REVERSE`091`09`09`09/* backwards direction&0209*/
X
X`09/* nonfatal codes */
X#define FIOFUN  -1`09`09`09/* File I/O, eod of file/bad line*/
X#define FIOSUC  0`09`09`09/* File I/O, success.&0209*/
X#define FIOEOF  1`09`09`09/* File I/O, end of file.`09*/
X`09/* error codes */
X#define FIOFNF  2`09`09`09/* File I/O, file not found.`09*/
X#define FIOERR  3`09`09`09/* File I/O, error.&0209*/
X#define FIOMEM  4`09`09`09/* File I/O, out of memory`09*/
X#define FIOABRT 5`09`09`09/* File I/O, aborted&0209*/
X
X/* three flavors of insert mode`09*/
X/* it's FALSE, or one of:`09*/
X#define INSERT 1
X#define OVERWRITE 2
X#define REPLACECHAR 3
X
X/* kill register control -- values for kbflag */
X#define KNEEDCLEAN   iBIT(0)`09`09/* Kill register needs cleaning */
X#define KYANK        iBIT(1)`09`09/* Kill register resulted from yank */
X#define KLINES       iBIT(2)`09`09/* Kill register contains full lines */
X#define KRECT        iBIT(3)`09`09/* Kill register contains rectangle */
X#define KAPPEND      iBIT(4)`09`09/* Kill register should be appended */
X
X/* operator types.  Needed mainly because word movement changes depending on
X`09whether operator is "delete" or not.  Aargh.  */
X#define OPDEL 1
X#define OPOTHER 2
X
X/* popup-choices values */
X#define POPUP_CHOICES_OFF      0
X#define POPUP_CHOICES_IMMED    1
X#define POPUP_CHOICES_DELAYED  2
X
X/* define these so C-fence matching doesn't get confused when we're editing
X`09the cfence code itself */
X#define LBRACE '`7B'
X#define RBRACE '`7D'
X#define LPAREN '('
X#define RPAREN ')'
X#define LBRACK '`5B'
X#define RBRACK '`5D'
X
X/* these are the characters that are used in the expand-chars mode */
X#define EXPC_THIS  '%'
X#define EXPC_THAT  '#'
X#define EXPC_SHELL '!'
X#define EXPC_RPAT  '`7E'
X#if OPT_VMS_PATH `7C`7C OPT_MSDO\1206`09/* ':' gets in the way of drives */
X#define EXPC_TOKEN '`26'
X#else
X#define EXPC_TOKEN ':'
X#endif
X
X/* separator used when scanning PATH environment variable */
X#if SYS_VMS
X#define`09PATHCHR`09','
X#endif
X
X#if OPT_MSDOS_PATH
X#define`09PATHCHR`09';'
X#endif
X
X#ifndef PATHCHR`09`09&0209/* e.g., UNIX */
X#define`09PATHCHR`09':'
X#endif
X
X/* how big is the ascii rep. of an int? */
X#define`09INTWIDTH`09sizeof(int) * 3
X
X/*`09Macro argument token types`09`09&0209`09*/
X
X#define`09TKNUL`090`09`09`09/* end-of-string&0209*/
X#define`09TKARG`091`09`09`09/* interactive argument&0209*/
X#define`09TKBUF`092`09`09`09/* buffer argument&0209*/
X#define`09TKVAR`093`09`09`09/* user variables&0209*/
X#define`09TKENV`094`09`09`09/* environment variables`09*/
X#define`09TKFUN`095`09`09`09/* function....&0309*/
X#define`09TKDIR`096`09`09`09/* directive`09&0209*/
X#define`09TKLBL`097`09`09`09/* line label&0309*/
X#define`09TKLIT`098`09`09`09/* numeric literal&0209*/
X#define`09TKSTR`099`09`09`09/* quoted string literal`09*/
X#define`09TKCMD`0910`09`09`09/* command name`09&0209*/
X
X/*`09Internal defined functions`09`09&0209`09*/
X
X#define`09nextab(a)`09(((a / curtabval) + 1) *\120B
X
X#define NEXT_COLUMN(col, c, list, tabs) `5C
X`09`09((c == '`5Ct' `26`26 !list) `5C
X`09`09 ? (col + tabs -\0E06% tabs)) `5C
X`09`09 : (`09(isPrint(c)) `5C
X`09`09`09? (col + 1) `5C
X`09`09`09: (col + ((c `26 HIGHBIT) ? 4 : 2))))
X
X/* these are the bits that go into the _chartypes_ array */
X/* the macros below test for them */
X#if OPT_WIDE_CTYPES
X#define chrBIT(n) l\0806
X#else
X#define chrBIT(n) i\0806
X#endif
X
X#define _upper    chrBIT(0)`09`09/* \1706case */
X#define _lower    chrBIT(1)`09`09/* \1706case */
X#define _digit    chrBIT(2)`09`09/* digits */
X#define _space    chrBIT(3)`09`09/* white\1C06*/
X#define _bspace   chrBIT(4)`09`09/* back\1A06character (`5EH, DEL, and user's)
V */
X#define _cntrl    chrBIT(5)`09`09/* control characters, including DEL */
X#define _print    chrBIT(6)`09`09/* printable */
X#define _punct    chrBIT(7)`09`09/* punctuation */
X#define _ident    chrBIT(8)`09`09/* is typically legal in "normal" identifier
V */
X#define _pathn    chrBIT(9)`09`09/* is typically legal in a file's pathname */
V
X#define _wild     chrBIT(10)`09`09/* is typically a shell wildcard char */
X#define _linespec chrBIT(11)`09`09/* ex-style line range: 1,$ or 13,15 or % et
Vc.*/
X#define _fence    chrBIT(12)`09`09/* a fence, i.e. (, ), `5B, `5D, `7B, `7D */
V
X#define _nonspace chrBIT(13)`09`09/* non-white\1E06*/
X#define _qident   chrBIT(14)`09`09/* is typically legal in "qualified" identif
Vier */
X
X#if OPT_WIDE_CTYPES
X#define _scrtch   chrBIT(15)`09`09/* legal in scratch-buffer names */
X#define _shpipe   chrBIT(16)`09`09/* legal in shell/pipe-buffer names */
X
X#define`09screen_to_bname(buf)`5C
X`09screen_string(buf,sizeof(buf),(CHARTYPE)(_pathn`7C_scrtch`7C_shpipe))
Xtypedef`09ULONG CHARTYPE;
X#else
X#define`09screen_to_bname(buf)`5C
X`09screen_string(buf,sizeof(buf),(CHARTYPE)(_pathn))
Xtypedef USHORT CHARTYPE;
X#endif
X
X/* these parallel the ctypes.h definitions, except that
X`09they force the char to valid range first */
X#define istype(m,c) ((_chartypes_`5B((UINT)(c))`26\0C08N_chars-1))`5D `26 (m))
V != 0)
X
X#define isAlnum(c)`09istype(_lower`7C_upper`7C_digit, c)
X#define isAlpha(c)`09istype(_lower`7C_upper, c)
X#define isCntrl(c)`09istype(_cntrl, c)
X#define isDigit(c)`09istype(_digit, c)
X#define isLower(c)`09istype(_lower, c)
X#define isPrint(c)`09istype(_print, c)
X#define isPunct(c)`09istype(_punct, c)
X#define isSpace(c)`09istype(_space, c)
X#define isUpper(c)`09istype(_upper, c)
X
X#define isbackspace(c)`09(istype(_bspace, c) `7C`7C (c) == \2B06c)
X#define isfence(c)`09istype(_fence, c)
X#define isident(c)`09istype(_ident, c)
X#define islinespecchar(c)`09istype(_\1808, c)
X#define ispath(c)`09istype(_pathn, c)
X#define iswild(c)`09istype(_wild, c)
X
X/* macro for cases where return `26 newline are equivalent */
X#define`09isreturn(c)`09((c == '`5Cr') `7C`7C \0F08n'))
X
X/* macro for whitespace (non-return) */
X#define`09isBlank(c)      ((c == '`5Ct') `7C`7C (\0F06 '))
X
X/* DIFCASE represents the difference between upper
X   and lower case letters, DIFCNTRL the difference between upp\3408and
X   control characters.`09They are xor-able values.  */
X#define`09DIFCASE`09`090x20
X#define`09DIFCNTRL`090x40
X#define toUpper(c)`09((c)`5EDIFCASE)
X#define toLower(c)`09((c)`5EDIFCASE)
X#define tocntrl(c)`09((c)`5EDIFCNTRL)
X#define toalpha(c)`09((c)`5EDIFCNTRL)
X
X#define nocase_eq(bc,pc)`09((bc) == (pc) `7C`7C `5C
X`09`09`09(isAlpha(bc) `26`26 (((bc) `5E DIFCASE) == (pc))))
X
X#define ESC`09`09tocntrl('`5B')
X#define BEL`09`09tocntrl('G')`09/* ascii bell character&0209*/
X#define CONTROL_A`09tocntrl('A')`09/* for cntl_a attribute sequences */
X
X#if !(SYS_MSDOS `26`26 CC_DJGPP)
X/* some systems need a routine to check for interrupts.  most don't, and
X * the routine overhead can be expensive in some places
X */
X# define interrupted() (am_\120B != 0)
X#endif
X
X#define ABORTED(c) ((c) == abortc `7C`7C (\1106intrc &027C interrupted())
X
X/*
X * Definitions etc. for regexp(3) routines.
X *
X *`09the regexp code is:
X *`09Copyright (c) 1986 by University of Toronto.
X *`09Written by Henry Spencer.  Not derived from licensed software.
X *
X */
X#define NSUBEXP  10
Xtypedef struct regexp `7B
X`09char *startp`5BNSUBEXP`5D;
X`09char *endp`5BNSUBEXP`5D;
X`09SIZE_T mlen;`09`09/* convenience:  endp`5B0`5D - startp`5B0`5D */
X`09char regstart;`09`09/* Internal use only. */
X`09char reganch;`09`09/* Internal use only. */
X`09int regmust;`09`09/* Internal use only. */
X`09int regmlen;`09`09/* Internal use only. */
X`09SIZE_T size;`09`09/* vile addition -- how big is this */
X`09char program`5B1`5D;`09/* Unwarranted chumminess with compiler. */
X`7D regexp;
X
X/*
X * The first byte of the regexp internal "program" is actually this magic
X * number; the start node begins in\1906econd byte.
X */
X#define`09REGEXP_MAGIC`090234
X
X#ifndef CHARBITS
X#define`09UCHAR_AT(p)`09((int)*(UCHAR *)(p))
X#else
X#define`09UCHAR_AT(p)`09((int)*(p)`26CHARBITS)
X#endif
X
X/* end of regexp stuff */
X
X/*
X * Definitions for 'tbuff.c' (temporary/dynamic char-buffers)
X */
Xtypedef`09struct`09_tbuff`09`7B
X`09char *`09tb_data;`09/* the buffer-data */
X`09ALLOC_T`09tb_size;`09/* allocated size */
X`09ALLOC_T`09tb_used;`09/* total used in */
X`09ALLOC_T`09tb_last;`09/* last put/get index */
X`09int`09tb_endc;
X`09`7D TBUFF;
X
X/*
X * Definitions for 'itbuff.c' (temporary/dynamic int-buffers)
X */
Xtypedef`09struct`09_itbuff`09`7B
X`09int *`09itb_data;`09/* the buffer-data */
X`09ALLOC_T`09itb_size;`09/* allocated size */
X`09ALLOC_T`09itb_used;`09/* total used in */
X`09ALLOC_T`09itb_last;`09/* last put/get index */
X`09int`09itb_endc;
X`09`7D ITBUFF;
X
X/*
X * Primitive types
X */
Xtypedef`09int`09`09L_NUM;&0209/* line-number */
Xtypedef`09int`09`09C_NUM;&0209/* column-number */
Xtypedef`09struct `7B
X    unsigned short flgs;
X    unsigned short cook;
X`7D L_FLAG;`09`09/* LINE-flags */
X
Xtypedef`09ULONG`09`09CMDFLAGS;`09/* CMDFUNC flags */
Xtypedef`09long`09`09B_COUNT;`09/* byte-count */
X
X#ifdef __cplusplus
X#define EXTERN_CONST extern const
X#else
X#define EXTERN_CONST const
X#endif
X
X/*
X * Control structures
X */
X#define`09for_ever for(;;)
X
X`09/* avoid "constant-in-conditional-context */
X#ifdef lint
X#define one_time while(malloc(1)==0)
X#else
X#define one_time while(0)
X#endif
X
X`09/* Some lint's do, many don't like this */
X#ifdef lint
X#undef  HAVE_LOSING_SWITCH_WITH_STRUCTURE_OFFSET
X#define HAVE_LOSING_SWITCH_WITH_STRUCTURE_OFFSET 1
X#endif
X
X/*
X * All text is kept in circularly linked lists of "LINE" structures. These
X * begin at the header line. This line is pointed to by the "BUFFER".
X * Each line contains:
X *  number of bytes in the line (the "used" size),
X *  the size of the text array,
X *  the text.
X * The end of line is not stored as a byte; it's implied. Future
X * additions may include update hints, and a list of marks into the line.
X *
X * Lines are additionally sometimes stacked in undo lists.
X */
Xtypedef`09struct`09LINE*`09LINEPTR;
X
Xtypedef struct`09LINE `7B
X`09LINEPTR l_fp;`09`09`09/* Link to the next line`09*/
X`09LINEPTR l_bp;`09`09`09/* Link to the previous line`09*/
X`09union `7B
X`09`09SIZE_T`09l_sze;&0209/* Allocated size &0209*/
X`09`09C_NUM`09l_fo;&0209/* forward undo dot offs (undo only) */
X`09`7D l_s_fo;
X`09union `7B
X`09`09L_NUM`09l_nmbr;&0209/* line-# iff b_numlines > 0`09*/
X`09`09C_NUM`09l_bo;&0209/* backward undo dot offs (undo only) */
X`09`7D l_n_bo;
X`09int`09l_used;`09`09`09/* Used size (may be negative)`09*/
X`09union `7B
X`09    char *l_txt;`09`09/* The data for this line`09*/
X`09    LINEPTR l_nxt;`09`09/* if an undo stack separator,`09*/
X`09`7D lt;`09`09&0209/*  a pointer to the next one`09*/
X`09union
X`09`7B
X`09    LINEPTR`09l_stklnk;`09/* Link for undo stack`09`09*/
X`09    L_FLAG`09l_flg;`09`09/* flags for undo ops&0209*/
X`09`7D l;
X`7D`09LINE;
X
X#define l_size`09`09l_s_fo.l_sze
X#define l_forw_offs`09l_s_fo.l_fo
X#define l_number`09l_n_bo.l_nmbr
X#define l_back_offs`09l_n_bo.l_bo
X#define l_text`09`09lt.l_txt
X#define l_nextsep`09lt.l_nxt
X
X#define l_undo_cookie`09l_flg.cook
X#define l_flag`09`09l_flg.flgs
X
X/* LINE.l_flag values */
X#define LCOPIED  lBIT(0)`09/* original line is already on an undo stack */
X#define LGMARK   lBIT(1)`09/* line matched a global scan */
X#define LTRIMMED lBIT(2)`09/* line doesn't have newline to display */
X
X/* macros to ease the use of lines */
X#define`09for_each_line(lp,bp) for (lp = lforw(buf_head(bp)); `5C
X`09`09&0209`09lp != buf_head(bp); `5C
X`09`09&0209`09lp = lforw(lp))
X
X#define l_nxtundo`09`09l.l_stklnk
X
X`09/*
X`09 * Special values used in LINE.l_used
X`09 */
X#define LINENOTREAL`09((int)(-1)) /* for undo, marks an inserted line */
X#define LINEUNDOPATCH`09((int)(-2)) /* provides stack patching value for undo
V */
X/* #define MARKPATCH`09((int)(-3)) *//*`09unused */
X#define STACKSEP`09((int)(-4)) /* delimit set of changes on undo stack */
X#define PURESTACKSEP`09((int)(-5)) /* as above, but buffer unmodified before *
V/
X`09`09&0209`09/* this change */
X
X#define`09null_ptr`09(LINE *)0
X#define set_lforw(a,b)`09\0B07) = (b)
X#define set_lback(a,b)`09\0B07) = (b)
X#define lforw(lp)`09(lp)->l_fp
X#define lback(lp)`09(lp)->l_bp
X
X`09/*
X`09 * Macros for referencing fields in the LINE struct.
X`09 */
X#define lgetc(lp, n)`09`09char2int((lp)->l_text`5B(n)`5D)
X#define lputc(lp, n, c) `09((lp)->l_text`5B(n)`5D=(c))
X#define llength(lp)`09`09((lp)->l_used)
X
X#define liscopied(lp)`09`09((lp)->l.l_undo_cookie == current\170C)
X#define lsetcopied(lp)`09`09((lp)->l.l_undo_cookie = current\160C)
X#define lsetnotcopied(lp)`09((lp)->l.l_undo_cookie = 0)
X
X#define lismarked(lp)`09`09((lp)->l.l_flag `26 LGMARK)
X#define lsetmarked(lp)`09`09((lp)->l.l_flag `7C= LGMARK)
X#define lsetnotmarked(lp)`09((lp)->l.l_flag `26= `7ELGMARK)
X#define lflipmark(lp)`09`09((lp)->l.l_flag `5E= LGMARK)
X
X#define listrimmed(lp)`09`09((lp)->l.l_flag `26 LTRIMMED)
X#define lsettrimmed(lp)`09`09((lp)->l.l_flag `7C= LTRIMMED)
X#define lsetnottrimmed(lp)`09((lp)->l.l_flag `26= `7ELTRIMMED)
X#define lsetclear(lp)`09`09((lp)->l.l_flag = \110Aundo_cookie = 0)
X
X#define lisreal(lp)`09`09((lp)->l_used >= 0)
X#define lisnotreal(lp)`09`09((lp)->l_used == LINENOTREAL)
X#define lislinepatch(lp)`09((lp)->l_used == LINEUNDOPATCH)
X/* #define lismarkpatch(lp)`09((lp)->l_used == MARKPATCH) */
X#define lispatch(lp)`09`09(lisline\1309 /* `7C`7C lismark\170A*/ )
X#define lisstacksep(lp)`09`09((lp)->l_used == STACKSEP `7C`7C `5C
+-+-+-+-+-+-+-+-  END  OF PART 46 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 47 -+-+-+-+-+-+-+-+
X`09`09&0209`09(lp)->l_used == PURESTACKSEP)
X#define lispurestacksep(lp)`09((lp)->l_used == PURESTACKSEP)
X
X/* marks are a line and an offset into that line */
Xtypedef struct MARK `7B
X`09LINEPTR l;
X`09C_NUM o;
X`7D MARK;
X
X/* some macros that take marks as arguments */
X#define is_at_end_of_line(m)`09(m.o == llength(m.l))
X#define is_empty_line(m)`09(llength(m.l) == 0)
X#define sameline(m1,m2)`09`09(m1.l == m2.l)
X#define samepoint(m1,m2)`09(sameline\1107 `26`26 (m1.o == m2.o))
X#define char_at(m)`09`09(lgetc(m.l,m.o))
X#define put_char_at(m,c)`09(lputc(m.l,m.o,c))
X#define is_header_line(m,bp)`09(m.l == buf_head(bp))
X#define is_last_line(m,bp)`09(lforw(m.l) == buf_head(bp))
X#define is_first_line(m,bp)`09(lback(m.l) == buf_head(bp))
X
X/*
X * The starting position of a region, and the size of the \1C06 in
X * characters, is kept in a region structure.  Used by the\1F08commands.
X */
Xtypedef struct`09`7B
X`09MARK `09r_orig;`09`09`09/* Origin LINE address. `09*/
X`09MARK`09r_end;`09`09`09/* Ending LINE address. `09*/
X`09C_NUM`09r_leftcol;`09`09/* Leftmost column. &0209*/
X`09C_NUM`09r_rightcol;`09`09/* Rightmost column. &0209*/
X`09B_COUNT`09r_size; `09`09/* Length in characters.`09*/
X#if OPT_SELECTIONS
X`09USHORT`09r_attr_id;`09`09/* id of corresponding display  */
X#endif
X`7D`09REGION;
X
X#if OPT_COLOR `7C`7C DISP_X11 &027C OPT_HILITEMATCH
Xtypedef USHORT VIDEO_ATTR;`09`09/* assume short is at least 16 bits */
X#else
Xtypedef UCHAR VIDEO_ATTR;
X#endif
X
X#define VACURS`09iBIT(0)`09`09`09/* cursor -- this is intentionally
X`09`09&0209`09 * the same as VADIRTY. It should
X`09`09&0209`09 * not be used anywhere other than
X`09`09&0209`09 * in specific places in the low
X`09`09&0209`09 * level drivers (e.g, x11.c).
X`09`09&0209`09 */
X#define VAMLFOC`09iBIT(1)`09`09`09/* modeline w/ focus&0209*/
X#define VAML`09iBIT(2)`09`09`09/* standard mode line (no focus)*/
X#define VASEL`09iBIT(3)`09`09`09/* selection&0309*/
X#define`09VAREV`09iBIT(4)`09`09`09/* reverse video&0209*/
X#define`09VAUL`09iBIT(5)`09`09`09/* underline`09&0209*/
X#define`09VAITAL`09iBIT(6)`09`09`09/* italics&0309*/
X#define`09VABOLD`09iBIT(7)`09`09`09/* bold&0309`09*/
X#define VAOWNER ((VIDEO_ATTR)0x0700)`09/* owner mask`09`09`09*/
X#define VASPCOL ((VIDEO_ATTR)0x0800)`09/* specific color   `09`09*/
X#define VACOLOR ((VIDEO_ATTR)0xf000)`09/* color mask`09`09`09*/
X#define VACOL_0 (VASPCOL)`09`09/* color palette index 0 `09*/
X#define VACOL_1 (VASPCOL+1)`09`09/* etc.&0209&0209*/
X#define VACOL_2 (VASPCOL+2)
X#define VACOL_3 (VASPCOL+3)
X#define VACOL_4 (VASPCOL+4)
X#define VACOL_5 (VASPCOL+5)
X#define VACOL_6 (VASPCOL+6)
X#define VACOL_7 (VASPCOL+7)
X#define VACOL_8 (VASPCOL+8)
X#define VACOL_9 (VASPCOL+9)
X#define VACOL_A (VASPCOL+0xA)
X#define VACOL_B (VASPCOL+0xB)
X#define VACOL_C (VASPCOL+0xC)
X#define VACOL_D (VASPCOL+0xD)
X#define VACOL_E (VASPCOL+0xE)
X#define VACOL_F (VASPCOL+0xF)
X
X#define VCOLORNUM(attr) ((\0907`26 VACOLOR) >> 12)
X#define VCOLORATTR(num) ((UINT)\0D06<< 12)
X
X/* who owns an attributed region -- so we can delete them independently */
X#define VOWNER(attr)`09(\0806 `26 VAOWNER)
X#define VOWN_MATCHES`090x0100
X#define VOWN_OPERS`090x0200
X#define VOWN_SELECT`090x0300
X#define VOWN_CTLA`090x0400
X
X/* The VATTRIB macro masks out those bits which should not be considered
X * for comparison purposes
X */
X
X#if OPT_PSCREEN
X#define VADIRTY`09iBIT(0)`09`09`09/* cell needs to be written out */
X#define VATTRIB(attr) (\0807`26 (VIDEO_ATTR) `7E(VAOWNER`7CVADIRTY))
X#else
X#define VADIRTY ((VIDEO_ATTR)0)`09`09/* nop for all others */
X#define VATTRIB(attr) (\0807`26 (VIDEO_ATTR) `7E(VAOWNER))
X#endif
X
X/* grow (or initially allocate) a vector of newsize types, pointed to by
X * ptr.  this is used primarily for resizing the screen
X * the studious will note this is a lot like realloc.   but \0F07
X * doesn't guarantee to preserve contents if if fails, and this also
X * zeroes the new space.
X */
X#define GROW(ptr, type, oldsize, newsize) `5C
X`7B `5C
X`09int tmpold = oldsize; `5C
X`09type *tmpp; `5C
X`09tmpp = typeallocn(type, newsize); `5C
X`09if (tmpp == NULL) `5C
X`09`09return FALSE; `5C
X `5C
X`09if (ptr) `7B `5C
X`09`09(void) memcpy((char *)tmpp, \0E08ptr, tmpold * sizeof(type)); `5C
X`09`09free((char *)ptr); `5C
X`09`7D else `7B `5C
X`09`09tmpold = 0; `5C
X`09`7D `5C
X`09ptr = tmpp; `5C
X`09(void) memset ((char *)(ptr+tmpold), 0, (newsize - \1707 * sizeof(type));`20
V`5C
X`7D
X
X/*
X * An attributed region is attached to a buffer and indicates how the
X * region should be displayed; eg. inverse video, underlined, etc.
X */
X
Xtypedef struct _aregion `7B
X`09struct _aregion`09*ar_next;
X`09REGION`09`09ar_region;
X`09VIDEO_ATTR`09ar_vattr;
X`09REGIONSHAPE`09ar_shape;
X#if OPT_HYPERTEXT
X`09char *`09`09ar_hypercmd;
X#endif
X`7D`09AREGION;
X
Xtypedef`09struct `7B
X`09char *pat;
X`09regexp *reg;
X`7D REGEXVAL;
X
X/* this is to ensure values can be of any type we wish.
X   more can be added if needed.  */
Xunion V `7B
X`09int i;
X`09char *p;
X`09REGEXVAL *r;
X`7D;
X
Xstruct VAL `7B
X`09union V v;
X`09union V *vp;
X`7D;
X
Xtypedef`09struct`09`7B
X`09const struct VALNAMES *names;
X`09struct VAL      *local;
X`09struct VAL      *global;
X`7D VALARGS;
X
X#define CHGD_ARGS VALARGS *args, int glob_val\0F07testing
X
Xtypedef`09int`09(*ChgdFunc) ( CHGD_ARGS );
X
X/* settable values have their names stored here, along with a synonym, and
X`09what type they are */
Xstruct VALNAMES `7B
X`09`09const char *name;
X`09`09const char *shortname;
X`09`09char  type;
X`09`09ChgdFunc side_effect;
X`7D;
X/* the values of VALNAMES->type */
X#define VALTYPE_INT    0
X#define VALTYPE_STRING 1
X#define VALTYPE_BOOL   2
X#define VALTYPE_REGEX  3
X#define VALTYPE_ENUM   4
X#define VALTYPE_MAJOR  5
X
X`09/*
X`09 * Values are either local or global. We distinguish the two cases
X`09 * by whether the value-pointer points into the VAL-struct or not.
X`09 */
X#define is_local_val(lv,which)          (lv`5Bwhich`5D.vp == `26\120C))
X#define make_local_val(lv,which)        (lv`5Bwhich`5D.vp = `26\110C))
X#define make_global_val(lv,gv,which)    (lv`5Bwhich`5D.vp = `26(gv\1109))
X
X/* these are masks for the WINDOW.w_flag hint */
X#define WFFORCE iBIT(0)`09`09`09/* Window needs forced reframe`09*/
X#define WFMOVE`09iBIT(1)`09`09`09/* Movement from line to line`09*/
X#define WFEDIT`09iBIT(2)`09`09`09/* Editing within a line`09*/
X#define WFHARD`09iBIT(3)`09`09`09/* Better do a full display`09*/
X#define WFMODE`09iBIT(4)`09`09`09/* Update mode line.&0209*/
X#define WFCOLR`09iBIT(5)`09`09`09/* Needs a color change&0209*/
X#define WFKILLS`09iBIT(6)`09`09`09/* something was deleted`09*/
X#define WFINS`09iBIT(7)`09`09`09/* something was inserted`09*/
X#define WFSTAT`09iBIT(8)`09`09`09/* Update mode line (info only).*/
X#define WFSBAR`09iBIT(9)`09`09`09/* Update scroll bar(s) */
X
X/* define indices for GLOBAL, BUFFER, WINDOW modes */
X#ifdef realdef
X#include "chgdfunc.h"
X#endif
X
X#if`09CHECK_PROTOTYPES
X`09typedef long W_VALUES;
X`09typedef long M_VALUES;
X`09typedef long B_VALUES;
X#else
X#`09include "nemode.h"
X#endif
X
X/* macros for setting GLOBAL modes */
X
X#define global_g_val(which)\140Dues.gv`5Bwhich`5D.v.i
X#define set_global_g_val(which,val) \1812) = val
X#define global_g_val_ptr(which)\180Dues.gv`5Bwhich`5D.v.p
X#define set_global_g_val_ptr(which,val) \1C16) = val
X#define global_g_val_rexp(which)\190Dues.gv`5Bwhich`5D.v.r
X#define set_global_g_val_rexp(which,val) \1D17) = val
X
X/* these are window properties affecting\1C08appearance _only_ */
Xtypedef struct`09`7B
X`09MARK `09w_dt;`09`09/* Line containing "."`09       */
X`09`09/* i don't think "mark" needs to be here -- I\2307it
X`09`09`09could safely live only in the buffer -pgf */
X#if WINMARK
X`09MARK `09w_mk;`09        /* Line containing "mark"\2106*/
X#endif
X`09MARK `09w_ld;`09        /* Line containing "lastdotmark"*/
X`09MARK `09w_tld;`09        /* Line which may become "lastdotmark"*/
X`09MARK `09w_ln;`09`09/* Top line in the window (offset used in linewrap) */
X#if OPT_MOUSE
X`09int`09insmode;
X#endif
X`09W_VALUES w_vals;
X`7D W_TRAITS;
X
X#define global_w_val(which)\140Dues.wv`5Bwhich`5D.v.i
X#define set_global_w_val(which,val) \1812) = val
X#define global_w_val_ptr(which)\180Dues.wv`5Bwhich`5D.v.p
X#define set_global_w_val_ptr(which,val) \1C16) = val
X
X#define w_val(wp,val) (wp->w_values.wv`5Bval`5D.vp->i)
X#define set_w_val(wp,which,val) \140E) = val
X#define w_val_ptr(wp,val) (wp->w_values.wv`5Bval`5D.vp->p)
X#define set_w_val_ptr(wp,which,val) \1812) = val
X
X#define make_local_w_val(wp,which)  `5C
X`09make_local_val(wp->w_values.wv, which)
X#define make_global_w_val(wp,which)  `5C
X`09make_global_val(wp->w_values.wv, \1C07wv\130Awhich)
X
X#define is_local_w_val(wp,which)  `5C
X`09is_local_val(wp->w_values.wv,which)
X
X#if OPT_COLOR
X#define gfcolor global_g_val(GVAL_FCOLOR)
X#define gbcolor global_g_val(GVAL_BCOLOR)
X#else
X#define gfcolor C_WHITE
X#define gbcolor C_BLACK
X#endif
X
X#if OPT_MAJORMODE
X/*
X * A majormode is a special set of buffer mode values, together with other
X * values (such as filename suffixes) which are used to determine when a
X * majormode should be attached to a buffer.  We allocate the structure in two
V
X * levels (MAJORMODE vs \0D09_LIST) to avoid having to adjust pointers
X * within the VAL arrays (M_VALUES and B\0D07) when we add or remove new
X * majormodes.
X */
Xtypedef struct `7B
X`09char *name;
X`09M_VALUES mm;
X`09B_VALUES mb;
X`7D MAJORMODE;
X
X#define is_c_mode(bp) (bp->majr != 0 `26`26 !strcmp\1909->name, "c"))
X#define fix_cmode(bp,value)`09/* nothing */
X#else
X#define is_c_mode(bp) (b_val(bp,MDCMOD))
X#define fix_cmode(bp,value)`09make_local_b_val(bp, MDCMOD), `5C
X`09`09&0209set_b_val(bp, MDCMOD, value)
X#endif
X
X/*
X * Text is kept in buffers. A\0B07 header, described below, exists for every
X * buffer in the system. The \1A06s are kept in a big list, so that commands
X * that search for a buffer by name can find the \1C07header. There is a
X * safe store for the dot and mark in the header, but this is only valid if
X * the buffer is not being displayed (that is, if "b_nwnd" is 0). The text for
V
X * the buffer is kept in a circularly linked list of lines, with a pointer to
V
X * the header line in "b_line"`09Buffers may be "Inactive" which means the fil
Ves associated with them
X * have not been read in yet. These get\1709at "use buffer" time.
X */
X
Xtypedef struct`09BUFFER `7B
X`09MARK `09b_line;`09`09/* Link to the header LINE (offset unused) */
X`09struct`09BUFFER *b_bufp; `09/* Link to next \2106`09`09*/
X`09MARK `09*b_nmmarks;`09`09/* named marks a-z&0209*/
X#if OPT_SELECTIONS
X`09AREGION`09*b_attribs;`09`09/* \0D06uted regions&0209*/
X#endif
X#if OPT_MAJORMODE
X`09MAJORMODE *majr;`09`09/* majormode, if any */
X#endif
X`09B_VALUES b_values;`09`09/* buffer traits we inherit from */
X`09`09&0209`09/*  global values&0209*/
X`09W_TRAITS b_wtraits;`09`09/* saved window \1906, while we're */
X`09`09&0209`09/*  not displayed&0209*/
X`09B_COUNT`09b_bytecount;`09`09/* # of chars&0209`09*/
X`09L_NUM`09b_linecount;`09`09/* no. lines in buffer&0209*/
X`09L_NUM`09b_lines_on_disk;`09/* no. lines as of last read/write */
X`09LINEPTR b_udstks`5B2`5D;`09`09/* undo stack pointers&0209*/
X`09MARK `09b_uddot`5B2`5D;`09`09/* Link to "." before undoable op*/
X`09short`09b_udstkindx;`09`09/* which of above to use`09*/
X`09LINEPTR b_udtail;`09`09/* tail of undo backstack`09*/
X`09LINEPTR b_udlastsep;`09`09/* last stack separator pushed`09*/
X`09int`09b_udcount;`09`09/* how many undo's we can do`09*/
X`09LINEPTR`09b_LINEs;`09`09/* block-malloced LINE structs */
X`09LINEPTR`09b_LINEs_end;`09`09/* end of `09"`09"`09" */
X`09LINEPTR`09b_freeLINEs;`09`09/* list of free " `09"`09" */
X`09UCHAR`09*b_ltext;`09`09/* block-malloced text */
X`09UCHAR`09*b_ltext_end;`09`09/* end of block-malloced text */
X`09LINEPTR`09b_ulinep;`09`09/* pointer at 'Undo' line`09*/
X`09int`09b_active;`09`09/* window activated flag`09*/
X`09UINT`09b_nwnd;`09`09        /* Count of windows on buffer   */
X`09UINT`09b_flag;`09`09        /* Flags \130A*/
X`09short`09b_acount;`09`09/* auto-save count`09        */
X`09char`09*b_fname;`09`09/* File name&0209`09*/
X`09int`09b_fnlen;`09`09/* length of filename&0209*/
X`09char`09b_bname`5BNBUFN`5D; `09/* Buffer name`09`09`09*/
X#if`09OPT_ENCRYPT
X`09char`09b_key`5BNPAT`5D;`09`09/* current encrypted key`09*/
X#endif
X#ifdef`09MDCHK_MODTIME
X`09time_t`09b_modtime;`09`09/* file's last-modification time */
X`09time_t`09b_modtime_at_warn;`09/* file's \1B07 when user warned */
X#endif
X#if`09OPT_UPBUFF
X`09int`09(*b_upbuff) (struct BUFFER *bp); /* call to recompute  */
X`09int`09(*b_rmbuff) (struct BUFFER *bp); /* call on removal`09*/
X#endif
X#if`09OPT_B_LIMITS
X`09int`09b_lim_left;`09`09/* extra left-margin (cf:show-reg) */
X#endif
X`09struct`09BUFFER *b_relink; `09/* Link to next \2307(sorting) */
X`09int`09b_created;
X`09int`09b_last_used;
X#if OPT_HILITEMATCH
X`09USHORT`09b_highlight;
X#endif
X#if OPT_PERL `7C`7C OPT_TCL
X`09void *`09b_api_private;`09`09/* pointer to p\1806 perl, tcl, etc.
X`09        \0808\1010   data */
X#endif
X`7D`09BUFFER;
X
X/*
X * Special symbols for scratch-buffer names.
X */
X#define`09SCRTCH_LEFT  "`5B"
X#define`09SCRTCH_RIGHT "`5D"
X#define`09SHPIPE_LEFT  "!"
X
X/* warning:  code in file.c and fileio.c knows how long the shell, pipe, and
X`09append prefixes are (e.g. fn += 2 when appending) */
X#define`09isShellOrPipe(s)  ((s)`5B0`5D == SHPIPE_LEFT`5B0`5D)
X#define`09isInternalName(s) (isShellOrPipe(s) `7C`7C is_in\2806name(s))
X#define`09isAppendToName(s) ((s)`5B0`5D == '>' `26`26 (s)`5B1\1108)
X
X/* shift-commands can be repeated when typed on :\2908 */
X#define isRepeatable(c)   ((c) == '<' `7C`7C (\0E07>')
X
X/*
X * Macros for manipulating buffer-struct members.
X */
X#define`09for_each_buffer(bp) for (bp = bheadp; bp; bp = bp->b_bufp)
X
X#define global_b_val(which)\140Dues.bv`5Bwhich`5D.v.i
X#define set_global_b_val(which,val) \1812) = val
X#define global_b_val_ptr(which)\180Dues.bv`5Bwhich`5D.v.p
X#define set_global_b_val_ptr(which,val) \1C16) = val
X#define global_b_val_rexp(which)\190Dues.bv`5Bwhich`5D.v.r
X#define set_global_b_val_rexp(which,val) \1D17) = val
X
X#define b_val(bp,val) (bp->b_values.bv`5Bval`5D.vp->i)
X#define set_b_val(bp,which,val) \140E) = val
X#define b_val_ptr(bp,val) (bp->b_values.bv`5Bval`5D.vp->p)
X#define set_b_val_ptr(bp,which,val) \1812) = val
X#define b_val_rexp(bp,val) (bp->b_values.bv`5Bval`5D.vp->r)
X#define set_b_val_rexp(bp,which,val) \1913) = val
X
X#define window_b_val(wp,val) `5C
X `09((wp != 0 `26`26 wp->w_buf\1306) `5C
X `09`09? b_val(wp->w_bufp,val) `5C
X`09`09: global_b_val(val))
X
X#define make_local_b_val(bp,which)  `5C
X`09`09make_local_val(bp->b_values.bv, which)
X#define make_global_b_val(bp,which)  `5C
X`09`09make_global_val(bp->b_values.bv, \1C07\140Dwhich)
X
X#define is_local_b_val(bp,which)  `5C
X`09is_local_val(bp->b_values.bv,which)
X
X#define is_empty_buf(bp) (lforw(buf_head(bp)) == \110D
X
X#define b_dot     b_wtraits.w_dt
X#if WINMARK
X#define b_mark    b_wtraits.w_mk
X#endif
X#define b_lastdot b_wtraits.w_ld
X#define b_tentative_lastdot b_wtraits.w_tld
X#define b_wline   b_wtraits.w_ln
X
X#if OPT_CASELESS
X#define eql_bname(bp,name) !stricmp(bp->b\1E06, name)
X#else
X#define eql_bname(bp,name) !strcmp(bp->b\1D06, name)
X#endif
X
X/* values for b_flag */
X#define BFINVS     iBIT(0)`09/* Internal invisible buffer`09*/
X#define BFCHG      iBIT(1)`09/* Changed since last write`09*/
X#define BFSCRTCH   iBIT(2)`09/* scratch -- gone on last close */
X#define BFARGS     iBIT(3)`09/* set for ":args" buffers */
X#define BFEXEC     iBIT(4)`09/* set for ":source" buffers */
X#define BFIMPLY    iBIT(5)`09/* set for implied-# buffers */
X#define BFSIZES    iBIT(6)`09/* set if byte/line counts current */
X#define BFUPBUFF   iBIT(7)`09/* set if buffer should be updated */
X#define BFRCHG     iBIT(8)`09/* Changed since last reset of this flag*/
X
X/* macros for manipulating b_flag */
X#define b_is_implied(bp)        ((bp)->b_flag `26 (BFIMPLY))
X#define b_is_argument(bp)       ((bp)->b_flag `26 (BFARGS))
X#define b_is_changed(bp)        ((bp)->b_flag `26 (BFCHG))
X#define b_is_recentlychanged(bp) ((bp)->b_flag `26 (BFRCHG))
X#define b_is_invisible(bp)      ((bp)->b_flag `26 (BFINVS))
X#define b_is_scratch(bp)        ((bp)->b_flag `26 (BFSCRTCH))
X#define b_is_temporary(bp)      ((bp)->b_flag `26 (BFINVS`7CBFSCRTCH))
X#define b_is_counted(bp)        ((bp)->b_flag `26 (BFSIZES))
X#define b_is_obsolete(bp)       ((bp)->b_flag `26 (BFUPBUFF))
X
X#define b_set_flags(bp,flags)   (bp)->b_flag `7C= (\1A06
X#define b_set_changed(bp)       \1806flags(bp, BFCHG)
X#define b_set_recentlychanged(bp)\1A07flags(bp, BFRCHG)
X#define b_set_counted(bp)       \1806flags(bp, BFSIZES)
X#define b_set_invisible(bp)    \1807flags(bp, BFINVS)
X#define b_set_obsolete(bp)      \1806flags(bp, BFUPBUFF)
X#define b_set_scratch(bp)       \1806flags(bp, BFSCRTCH)
X
X#define b_clr_flags(bp,flags)   (bp)->b_flag `26= `7E(\1B06
X#define b_clr_changed(bp)       \1806flags(bp, BFCHG)
X#define b_clr_recentlychanged(bp)\1A07flags(bp, BFRCHG)
X#define b_clr_counted(bp)       \1806flags(bp, BFSIZES)
X#define b_clr_obsolete(bp)      \1806flags(bp, BFUPBUFF)
X#define b_clr_scratch(bp)       \1806flags(bp, BFSCRTCH)
X
X#if OPT_HILITEMATCH
X#define b_match_attrs_dirty(bp)`09(bp)->b_highlight `7C= HILITE_DIRTY
X#else
X#define b_match_attrs_dirty(bp)
X#endif
X
X#if OPT_B_LIMITS
X#define b_left_margin(bp)       bp->b_lim_left
X#define b_set_left_margin(bp,n) b_\140E) = n
X#else
X#define b_left_margin(bp)       0
X#define b_set_left_margin(bp,n)
X#endif
X
X#if OPT_HILITEMATCH
X#define HILITE_ON`091
X#define HILITE_DIRTY`092
X#endif
X
X/* macro for iterating over the marks associated with the current buffer */
X
X#if OPT_PERL `7C`7C OPT_TCL
Xextern MARK *api_mark_iterator(BUFFER *bp, int *iter);
X#define api_do_mark_iterate_helper(mp, statement)`09`5C
X        `7B`09`09&0209&0209`5C
X`09    int dmi_iter = 0;`09`09&0209`5C
X`09    while ((mp = api_mark_iterator(curbp, `26dmi_iter)) != NULL) `7B `5C
X`09`09statement&0209&0209`5C
X`09    `7D`09`09&0209&0209`5C
X`09`7D
X#else
X#define api_do_mark_iterate_helper(mp, statement)
X#endif
X
X#if OPT_VIDEO_ATTRS
X#define do_mark_iterate(mp, statement)`09`09`09`5C
X    do `7B`09`09&0209&0209`5C
X`09struct MARK *mp;`09`09&0209`5C
X`09int`09     dmi_idx;`09`09&0209`5C
X`09AREGION     *dmi_ap = curbp->b_attribs;`09`09`5C
X`09if (curbp->b_nmmarks != NULL)`09`09`09`5C
X`09    for (dmi_idx=0; \0B07 < 26\0E09++) `7B`09`5C
X`09`09mp = `26(curbp->b_nmmarks`5Bdmi_idx`5D);`09`5C
X`09`09statement&0209&0209`5C
X`09    `7D`09`09&0209&0209`5C
X`09if (dmi_ap != NULL) `7B`09`09&0209`5C
X`09    while (dmi_ap != NULL) `7B`09`09`09`5C
X`09`09mp = `26dmi_ap->ar_region.r_orig;&0209`5C
X`09`09statement&0209&0209`5C
X`09`09mp = `26dmi_ap->ar_region.r_end;&0209`5C
X`09`09statement&0209&0209`5C
X`09`09dmi_ap = \0906->ar_next;&0209`5C
X`09    `7D`09`09&0209&0209`5C
X`09    sel_reassert_ownership(curbp);`09`09`5C
X`09`7D`09`09&0209&0209`5C
X`09api_do_mark_iterate_helper(mp, statement)`09`5C
X    `7D one_time
X#else /* OPT_VIDEO_ATTRS */
X#define do_mark_iterate(mp, statement)`09`09`09`5C
X    do `7B`09`09&0209&0209`5C
X`09struct MARK *mp;`09`09&0209`5C
X`09if (curbp->b_nmmarks != NULL) `7B`09`09`09`5C
X`09    int dmi_idx;`09`09&0209`5C
X`09    for (dmi_idx=0; \0B07 < 26\0E09++) `7B`09`5C
X`09`09mp = `26(curbp->b_nmmarks`5Bdmi_idx`5D);`09`5C
X`09`09statement&0209&0209`5C
X`09    `7D`09`09&0209&0209`5C
X`09`7D`09`09&0209&0209`5C
X`09api_do_mark_iterate_helper(mp, statement)`09`5C
X    `7D one_time
X#endif /* OPT_VIDEO_ATTRS */
X
X/*
X * There is a window structure allocated for every active display \3406. The
X * windows are kept in a big list, in top to bottom screen order, with the
X * listhead at "wheadp". Each window contains its own values of dot and mark.
V
X * The flag field contains some bits that are set by commands to guide
X * redisplay. Although this is a bit of a compromise in terms of decoupling,
X * the full blown redisplay is just too expensive to run for every input
X * character.
X */
X
X#define WINDOW`09vile_\0C07`09/* avoid conflict with curses.h */
X
Xtypedef struct`09WINDOW `7B
X`09W_TRAITS w_traits;`09`09/* features of the window we should */
X`09`09&0209`09/*  remember between displays */
X`09struct`09WINDOW *w_wndp; `09/* Next window`09`09`09*/
X`09BUFFER  *w_bufp; `09`09/* Buffer displayed in window`09*/
X`09int`09w_toprow;`09        /* Origin 0 top row of window   */
X`09int`09w_ntrows;`09        /* # of rows of text in window  */
X`09int`09w_force; `09        /* If non-zero, forcing row.    */
X`09USHORT`09w_flag;`09`09        /* Flags.\130A*/
X`09ULONG`09w_split_hist;`09`09/* how to recombine deleted windows */
X#ifdef WMDRULER
X`09int`09w_ruler_line;
X`09int`09w_ruler_col;
X#endif
X`7D`09WINDOW;
X
X#define is_visible_window(wp) ((wp)->w_toprow >= 0)
X#define is_fake_window(wp) (!(is_visibl\190C))
X
X#define`09for_each_window(wp) for (wp = wheadp; wp; wp = wp->w_wndp)
X#define for_each_visible_window(wp) `5C
X`09`09for_each_window(wp) if (is_visible\1A0B)
X
X#define w_dot     w_traits.w_dt
X#if WINMARK
X#define w_mark    w_traits.w_mk
X#endif
X#define w_lastdot w_traits.w_ld
X#define w_tentative_lastdot w_traits.w_tld
X#define w_line    w_traits.w_ln
X#define w_values  w_traits.w_vals
X
X#define mode_row(wp)`09((wp)->w_toprow + \1108ntrows)
X#define`09buf_head(bp)`09((bp)->b_line.l)
X#define`09win_head(wp)`09buf\0D06(wp)->w_bufp)
X
X#define DOT curwp->w_dot
X#if OPT_MOUSE
X#define insertmode (curwp->w_traits.insmode)
X#endif /* OPT_MOUSE */
X#if WINMARK
X#define MK curwp->w_mark
X#else
X#define MK Mark
X#endif
X
X`09/* we use left-margin for protecting the prefix-area of `5BRegisters`5D
X`09 * from cut/paste selection.
X`09 */
X#define w_left_margin(wp) b\120F->w_bufp)
X
X`09/* tputs uses a 3rd parameter (a function pointer).  We're stuck with
X`09 * making ttputc and TTputc the same type.
X`09 */
X#ifdef OUTC_RETURN
X#define OUTC_DCL int
X#define OUTC_RET return
X#else
X#define OUTC_DCL void
X#define OUTC_RET (void)
X#endif
X
X#ifndef OUTC_ARGS
X#define OUTC_ARGS int c
X#endif
X
X/*
X * The editor communicates with the display using a high level interface. A
X * "TERM" structure holds useful variables, and indirect pointers to routines
V
X * that do useful operations. The low level get and put routines are here too.
V
X * This lets a terminal, in addition to having non standard commands, have
X * funny get and put character code too. The calls might get changed to
X * "termp->t_field" style in the future, to make it possible to run more than
V
X * one terminal type.
X */
Xtypedef struct`09`7B
X`09int`09t_mrow;`09`09`09/* max number of rows allowable */
X`09int`09t_nrow; `09`09/* current number of rows used`09*/
X`09int`09t_mcol; `09`09/* max Number of columns.`09*/
X`09int`09t_ncol; `09`09/* current Number of columns.`09*/
X`09int`09t_margin;`09`09/* min margin for extended lines*/
X`09int`09t_scrsiz;`09`09/* size of scroll region "`09*/
X`09int`09t_pause;`09`09/* # times thru update to pause */
X`09void`09(*t_open) (void);`09/* Open terminal at the start.`09*/
X`09void`09(*t_close) (void);`09/* Close terminal at end.`09*/
X`09void`09(*t_kopen) (void);`09/* Open keyboard`09`09*/
X`09void`09(*t_kclose) (void);`09/* close keyboard`09`09*/
X`09int`09(*t_getchar) (void);`09/* Get character from keyboard. */
X`09OUTC_DCL(*t_putchar) (OUTC_ARGS); /* Put character to display.`09*/
X`09int`09(*t_typahead) (void);`09/* character ready?`09`09*/
X`09void`09(*t_flush) (void);`09/* Flush output buffers.`09*/
X`09void`09(*t_move) (int row, int col); /* Move the cursor, origin 0. */
X`09void`09(*t_eeol) (void);`09/* Erase to end of line.`09*/
X`09void`09(*t_eeop) (void);`09/* Erase to end of page.`09*/
X`09void`09(*t_beep) (void);`09/* Beep.`09`09`09*/
X`09void`09(*t_rev) (UINT f);`09/* set reverse video state`09*/
X`09int`09(*t_rez) (const char *f); /* change screen resolution`09*/
X`09void`09(*t_setfor) (int f);`09/* set foreground color`09`09*/
X`09void`09(*t_setback) (int b);`09/* set background color`09`09*/
X`09void`09(*t_setpal) (const char *p); /* set color palette`09*/
X`09void`09(*t_scroll) (int from, int to\0806n); /* \2606 region`09*/
X`09void`09(*t_pflush) (void);`09/* really flush `09`09*/
X`09void`09(*t_icursor) (int c);`09/* set cursor shape for insertion */
X`09void`09(*t_title) (char *t);`09/* set window title`09`09*/
X`09int`09(*t_watchfd)(int, WATCHTYPE, long *);
X`09`09&0209`09/* Watch a file descriptor for
X`09`09&0209`09   input; execute associated
X`09`09&0209`09   command when input is present*/
X`09void`09(*t_unwatchfd)(int, long);
X`09`09&0209`09/* Don't watch file descriptor`09*/
X`7D`09TERM;
X
X/*`09TEMPORARY macros for terminal I/O  (to be placed in a machine
X`09`09&0209`09    dependent place later)`09*/
X
X#define`09TTopen`09`09(*term.t_open)
X#define`09TTclose`09`09(*term.t_close)
X#define`09TTkopen`09`09(*term.t_kopen)
X#define`09TTkclose`09(*term.t_\1006)
X#define`09TTgetc`09`09(*term.t_getchar)
X#define`09TTputc`09`09(*term.t_putchar)
X#define`09TTtypahead`09(*term.t_\1208)
X#define`09TTflush`09`09(*term.t_flush)
X#define`09TTmove`09`09(*term.t_move)
X#define`09TTeeol`09`09(*term.t_eeol)
X#define`09TTeeop`09`09(*term.t_eeop)
X#define`09TTbeep`09`09(*term.t_beep)
X#define`09TTrev`09`09(*term.t_rev)
X#define`09TTrez`09`09(*term.t_rez)
X#define`09TTforg(f)`09(*term.t_setfor)(f)
X#define`09TTbacg(b)`09(*term.t_setback)(b)
X#define`09TTspal(p)`09(*term.t_setpal)(p)
X#define`09TTscroll(f,t,n)`09(*term.t_\1706)\1807
X#define`09TTpflush()`09(*term.t_\1206)()
X#define`09TTicursor(c)`09(*term.t_\1407)(c)
X#define`09TTtitle(t)`09(*term.t_title)(t)
X#define TTwatchfd(fd,tp,idp) (*term.t_\1C07)\1D0B
X#define TTunwatchfd(fd,id) (*term.t_\1A09)\1B07
X
Xtypedef struct  VIDEO `7B
X        UINT`09v_flag;\1408\1C08 /* Flags */
X#if`09OPT_COLOR
X`09int`09v_fcolor;`09`09/* current forground color */
X`09int`09v_bcolor;`09`09/* current background color */
X`09int`09v_rfcolor;`09`09/* requested forground color */
X`09int`09v_rbcolor;`09`09/* requested background color */
X#endif
X#if`09OPT_VIDEO_ATTRS
X`09VIDEO_ATTR *v_attrs;`09`09/* screen data attributes */
X#endif
X`09/* allocate 4 bytes here, and malloc\1909less than we need,
X`09`09to keep malloc from rounding up. */
X        char    v_text`5B4`5D;\1A08\2206/* Screen data. */
X`7D       VIDEO;
X
X#define VideoText(vp) (vp)->v_text
X#define VideoAttr(vp) (vp)->v_attrs
X
X#if OPT_COLOR
X#define CurFcolor(vp) (vp)->v_fcolor
X#define CurBcolor(vp) (vp)->v_bcolor
X#define ReqFcolor(vp) (vp)->v_rfcolor
X#define ReqBcolor(vp) (vp)->v_rbcolor
X#else
X#define CurFcolor(vp) gfcolor
X#define CurBcolor(vp) gbcolor
X#define ReqFcolor(vp) gfcolor
X#define ReqBcolor(vp) gbcolor
X#endif
X
X#define VFCHG`09iBIT(0) `09`09/* Changed flag&0209`09*/
X#define`09VFEXT`09iBIT(1)`09`09`09/* extended (beyond column 80)`09*/
X#define`09VFREV`09iBIT(2)`09`09`09/* reverse video status&0209*/
X#define`09VFREQ`09iBIT(3)`09`09`09/* reverse video request`09*/
X#define`09VFCOL`09iBIT(4)`09`09`09/* color change requested`09*/
X
X#if DISP_IBMPC
X/*
X * these need to go into edef.h eventually!
X */
X#define`09CDCGA`090`09`09`09/* color graphics card&0209*/
X#define`09CDMONO`091`09`09`09/* monochrome text card&0209*/
X#define`09CDEGA`092`09`09`09/* EGA color adapter&0209*/
X#define`09CDVGA`093`09`09`09/* VGA color adapter&0209*/
X#define`09CDSENSE`09-1`09`09`09/* detect the card type`09`09*/
X
X#if OPT_COLOR
X#define`09CD_25LINE`09CDCGA
X#else
X#define`09CD_25LINE`09CDMONO
X#endif
X
X#endif
X
X
X/* Commands are represented as CMDFUNC structures, which contain a
X *`09pointer to the actual function, and flags which help to classify it.
X *`09(things like is it a MOTION, can it be UNDOne)
X *
X *`09These structures are generated automatically from the cmdtbl file,
X *`09and can be found in the file nefunc.h
X */
X#define CMD_ARGS int f, int n
X
Xtypedef`09int`09(*CmdFunc) (int f, int n);
X
Xtypedef`09struct `7B
X`09union `7B
X`09`09CmdFunc c_func;
X`09`09BUFFER *c_buff;
X#if OPT_PERL
X`09`09void *c_perl;`09/* Perl 5 'AV' type */
X#endif
X`09`7D cu;
X`09CMDFLAGS c_flags;`09/* what sort of command is it? */
X#if OPT_ONLINEHELP
X`09const char *c_help;`09/* short help message for the command */
X#endif
X`7D`09CMDFUNC;
X
X/*
X * Other useful argument templates
X */
X#define EOL_ARGS  const char * buffer, unsigned cpos, int c\0706eolchar
X#define DONE_ARGS int c, char *buf, unsigned *pos
X#define LIST_ARGS int flag, void *ptr
X#define REGN_ARGS void *flagp, int l\0706r
X
Xtypedef`09int`09(*OpsFunc) (void);
X
X/* when referencing a command by name (e.g ":e file") it is looked up in
X *`09the nametbl, which is an array of NTAB structures, containing the
X *`09name, and a pointer to the CMDFUNC structure.  There can be several
X *`09entries pointing at a single CMDFUNC, since a command might have
X *`09several synonymous names.
X *
+-+-+-+-+-+-+-+-  END  OF PART 47 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 48 -+-+-+-+-+-+-+-+
X *`09The nametbl array is generated automatically from the cmdtbl file,
X *`09and can be found in the file nename.h
X */
Xtypedef struct `7B
X`09char *n_name;
X`09const CMDFUNC *n_cmd;
X`7D`09NTAB;
X
X/*
X * a binary search tree of the above structure.  we use this so that we can
X * add in procedures as they are created.
X */
Xtypedef struct `7B
X`09const char *bi_key;`09`09/* the name of the command`09*/
X`09const CMDFUNC *n_cmd;`09`09/* command details&0209*/
X`09char n_flags;`09`09`09/* flags (below)&0209*/
X#define`09NBST_READONLY`091`09`09/* for builtin functions`09*/
X#define`09NBST_DONE`092`09`09/* temporary flag used by
X`09`09&0209`09   bind.c:makebindlist()`09*/
X`7D`09NBST_DATA;
X
X
X/* when a command is referenced by bound key (like h,j,k,l, or "dd"), it
X *`09is looked up one of two ways: single character 7-bit ascii commands (by
X *`09far the majority) are simply indexed into an array of CMDFUNC pointers.
X *`09Other commands (those with `5EA, `5EX, or SPEC prefixes) are searched for
V
X *`09in a binding table, made up of KBIND structures.  This\120A
X *`09contains the command code, and again, a pointer to the CMDFUNC
X *`09structure for the command
X *
X *`09The asciitbl array, and the kbind\1809 are generated automatically
X *`09from the cmdtbl file, and can be found in the file nebind.h
X */
Xtypedef struct  k_bind `7B
X`09short`09k_code; `09`09/* Key code&0209`09*/
X`09const CMDFUNC *k_cmd;
X#if OPT_REBIND
X`09struct  k_bind *k_link;
X#endif
X`7D`09KBIND;
X
X
X/* These are the flags which can appear in the CMDFUNC structure, describing a
V
X * command.
X */
X#define NONE    0L
X#define cmdBIT(n) l\0806`09/* ...to simplify typing */
X/* bits 0-11 */
X#define UNDO    cmdBIT(0)`09/* command is undo-able, so clean up undo lists */
V
X#define REDO    cmdBIT(1)`09/* command is redo-able, record it for dotcmd */
X#define MOTION  cmdBIT(2)`09/* command causes motion, okay after operator cmds
V */
X#define FL      cmdBIT(3)`09/* if command causes motion, opers act on full lin
Ves */
X#define ABSM    cmdBIT(4)`09/* command causes absolute (i.e. non-relative) mot
Vion */
X#define GOAL    cmdBIT(5)`09/* column goal should be retained */
X#define GLOBOK  cmdBIT(6)`09/* permitted after global command */
X#define OPER    cmdBIT(7)`09/* function is an operator, affects a region */
X#define LISTED  cmdBIT(8)`09/* internal use only -- used in describing
X`09`09&0209 * bindings to only describe each once */
X#define NOMOVE  cmdBIT(9)`09/* dot doesn't move (although address may be used)
V */
X#define VIEWOK  cmdBIT(10)`09/* command is okay in view mode, even though it
X`09`09&0209 * _may_ be undoable (macros and maps) */
X#define RECT    cmdBIT(11)`09/* motion causes rectangular operation */
X
X/* These flags are 'ex' argument descriptors, adapted from elvis.  Not all are
V
X * used or honor\0B06implemented.
X */
X#define argBIT(n) cmdBIT(n+12)`09/* ...to simplify adding bits */
X/* bits 12-25 */
X#define FROM    argBIT(0)`09/* allow a linespec */
X#define TO      argBIT(1)`09/* allow a second linespec */
X#define BANG    argBIT(2)`09/* allow a ! after the command name */
X#define EXTRA   argBIT(3)`09/* allow extra args after command name */
X#define XFILE   argBIT(4)`09/* expand wildcards in extra part */
X#define NOSPC   argBIT(5)`09/* no spaces allowed in the extra part */
X#define DFLALL  argBIT(6)`09/* default file range is 1,$ */
X#define DFLNONE argBIT(7)`09/* no default file range */
X#define NODFL   argBIT(8)`09/* do not default to the current file name */
X#define EXRCOK  argBIT(9)`09/* can be in a .exrc file */
X#define VI_NL   argBIT(10)`09/* if !exmode, then write a newline first */
X#define PLUS    argBIT(11)`09/* allow a line number, as in ":e +32 foo" */
X#define ZERO    argBIT(12)`09/* allow 0 to be given as a line number */
X#define OPTREG  argBIT(13)`09/* allow optional register-name */
X#define FILES   (XFILE `7C EXTRA)`09/* multiple extra files allowed */
X#define WORD1   (EXTRA `7C NOSPC)`09/* one extra word allowed */
X#define FILE1   (FILES `7C NOSPC)`09/* 1 file allowed, defaults to current
V\2206*/
X#define NAMEDF  (FILE1 `7C NODFL)`09/* 1 file allowed, defaults to "" */
X#define NAMEDFS (FILES `7C NODFL)`09/* multiple files allowed, default is "" *
V/
X#define RANGE   (FROM  `7C TO)`09/* range of linespecs allowed */
X
X/* these flags determine the type of cu.* */
X#define typBIT(n) cmdBIT(n+26)`09/* ...to simplify adding bits */
X/* bits 26-27 */
X#define CMD_FUNC 0L`09`09/* this is the default (CmdFunc) */
X#define CMD_PROC typBIT(0)`09/* named procedure (BUFFER *) */
X#define CMD_PERL typBIT(1)`09/* perl subroutine (AV *) */
X#define CMD_TYPE (CMD_PROC `7C CMD_PERL) /* type mask */
X
X#define SPECIAL_BANG_ARG -42`09/* arg passed as 'n' to functions which
X `09`09&0209`09were invoked by their "xxx!" name */
X
X/* definitions for 'mlreply_file()' and other filename-completion */
X#define`09FILEC_REREAD   4
X#define`09FILEC_READ     3
X#define`09FILEC_UNKNOWN  2
X#define`09FILEC_WRITE    1
X
X#define`09FILEC_PROMPT   8`09/* always prompt (never from screen) */
X#define`09FILEC_EXPAND   16`09/* allow glob-expansion to multiple files */
X
X#ifndef P_tmpdir`09`09/* not all systems define this */
X#if SYS_MSDOS `7C`7C SYS_OS2\0B08WINNT
X#define P_tmpdir ""
X#endif
X#if SYS_UNIX
X#define P_tmpdir "/usr/tmp"
X#endif
X#if SYS_VMS
X#define P_tmpdir "sys$scratch:"
X#endif
X#endif`09/* P_tmpdir */
X
X#undef TMPDIR
X
X#if OPT_EVAL
X#define TMPDIR gtenv("directory")
X#else
X#define TMPDIR P_tmpdir`09`09/* \1B06d in <stdio.h> */
X#endif`09/* OPT_EVAL */
X
X/*`09The editor holds deleted text chunks in the KILL registers. The
X`09kill registers are logically a stream of ascii characters, however
X`09due to unpredictable size, are implemented as a linked
X`09list of chunks. (The d_ prefix is for "deleted" text, as k_
X`09was taken up by the keycode structure)
X*/
X
Xtypedef`09struct KILL `7B
X`09struct KILL *d_next;`09/* link to next chunk, NULL if last */
X`09UCHAR d_chunk`5BKBLOCK`5D;`09/* deleted text */
X`7D KILL;
X
Xtypedef struct KILLREG `7B
X`09struct KILL *kbufp;`09/* current kill register chunk pointer */
X`09struct KILL *kbufh;`09/* kill register header pointer`09*/
X`09unsigned kused;`09`09/* # of bytes used in kill last chunk`09*/
X`09C_NUM kbwidth;`09`09/* width of chunk, if rectangle */
X`09USHORT kbflag;`09`09/* flags describing kill register`09*/
X`7D KILLREG;
X
X#define`09KbSize(i,p)`09((p->d_next != 0) ? KBLOCK : kbs`5Bi`5D.kused)
X
X/*
X * Incremental search defines.
X */
X#if`09OPT_ISRCH
X
X#define`09CMDBUFLEN`09256`09/* Length of our command buffer */
X
X#define IS_REVERSE`09tocntrl('R')`09/* Search backward */
X#define`09IS_FORWARD`09tocntrl('F')`09/* Search forward */
X
X#endif
X
X#ifndef NULL
X# define NULL 0
X#endif
X
X/*
X * General purpose includes
X */
X
X#include <stdarg.h>
X
X#if DISP_X11 `26`26 SYS_APOLLO
X#define SYSV_STRINGS`09/* <strings.h> conflicts with\1B08.h> */
X#endif
X
X#if HAVE_UNISTD_H
X#include <unistd.h>
X#endif
X
X#if SYS_VMS
X#include <unixio.h>
X#include <unixlib.h>
X#include <file.h>`09/* aka <sys/\1407 */
X#endif
X
X#if HAVE_STDDEF_H
X#include <stddef.h>
X#endif
X
X#if (HAVE_STDLIB_H `7C`7C SYS_VMS &027C CC_NEWDOSCC)
X#include <stdlib.h>
X#else
Xextern void exit (int code);
Xextern void _exit (int code);
X#endif`09/* HAVE_STDLIB_H */
X
X/* array/table size */
X#define`09TABLESIZE(v)`09(sizeof(v)/\0A08`5B0`5D))
X
X/* Quiet compiler warnings on places where we're being blamed incorrectly,
X * e.g., for casting away const, or for alignment problems.  It's always
X * legal to cast a pointer to long w/o loss of precision.
X */
X#define TYPECAST(type,ptr) (type*)((long)(ptr))
X
X/* structure-allocate, for linting */
X#ifdef`09lint
X#define`09castalloc(cast,nbytes)`09`09((cast *)0)
X#define`09castrealloc(cast,ptr,nbytes)`09((ptr)+(\1007)
X#define`09typecalloc(cast)`09`09((cast *)0)
X#define`09typecallocn(cast,ntypes)`09(((cast *)0)+(\1607)
X#define`09typealloc(cast)`09`09`09((cast *)0)
X#define`09typeallocn(cast,ntypes)`09`09(((cast *)0)+(\1707)
X#define`09typereallocn(cast,ptr,ntypes)`09((ptr)+(\1007)
X#define`09typeallocplus(cast,extra)`09(((cast *)0)+(\1506)
X#else
X#define`09castalloc(cast,nbytes)`09`09(cast *)m\1D06\1807
X#define`09castrealloc(cast,ptr,nbytes)`09(cast *)\2108(char *)(ptr),(\2707)
X#define`09typecalloc(cast)`09`09(cast *)\1607sizeof\1D06,1)
X#define`09typecallocn(cast,ntypes)`09(cast *)\1D06(sizeof(cast)\2408
X#define`09typealloc(cast)`09`09`09(cast *)m\1706sizeof\1E06)
X#define`09typeallocn(cast,ntypes)`09`09(cast *)malloc((\1907*sizeof(cast))
X#define`09typereallocn(cast,ptr,ntypes)`09(cast *)\2207((char *)(ptr),`5C
X`09`09&0209&0309(ntypes)*sizeof(cast))
X#define`09typeallocplus(cast,extra)`09(cast *)malloc((\1706+sizeof(cast))
X#endif
X
X#define`09FreeAndNull(p)`09if ((p) != 0) `7B free((char *)p); p = 0; `7D
X#define`09FreeIfNeeded(p)`09if ((p) != 0) free((char *)(p))
X
X#define`09ExitProgram(code)`09exit\0B06
X
X/*
X * We cannot define these in config.h, since they require parameters to be
X * passed (that's non-portable).
X */
X#ifdef __cplusplus
X#undef GCC_PRINTF
X#undef GCC_NORETURN
X#undef GCC_UNUSED
X#endif
X
X#if GCC_PRINTF
X#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,\2608))
X#else
X#define GCC_PRINTFLIKE(fmt,var) /*nothing*/
X#endif
X
X#ifndef`09GCC_NORETURN
X#define`09GCC_NORETURN /* nothing */
X#endif
X
X#ifndef`09GCC_UNUSED
X#define`09GCC_UNUSED /* nothing */
X#endif
X
X#if HAVE_SELECT
X# if HAVE_SELECT_H
X# include <select.h>
X# endif
X# if HAVE_SYS_SELECT_H
X# include <sys/select.h>
X# endif
X#endif
X
X#if HAVE_UTIME_H
X# include <utime.h>
X#endif
X
X#if HAVE_SYS_UTIME_H
X# include <sys/utime.h>
X#endif
X
X/*
X * Comparison-function for 'qsort()'
X */
X#ifndef ANSI_QSORT
X#  if __STDC__ `7C`7C defined(CC_TURBO) &027C CC_WATCOM
X#    define`09ANSI_QSORT 1
X#  else
X#    define`09ANSI_QSORT 0
X#  endif
X#endif
X
X/*
X * Debugging/memory-leak testing
X */
X
X#ifndef`09DOALLOC`09`09/* record info for 'show_alloc()' */
X#define`09DOALLOC`09`090
X#endif
X#ifndef`09USE_DBMALLOC`09/* test malloc/free/strcpy/memcpy, etc. */
X#define`09USE_DBMALLOC`090
X#endif
X#ifndef`09USE_DMALLOC`09/* test malloc/free/strcpy/memcpy, etc. */
X#define`09USE_DMALLOC`090
X#endif
X#ifndef`09NO_LEAKS`09/* free permanent memory, analyze leaks */
X#define`09NO_LEAKS`090
X#endif
X#ifndef TEST_DOS_PIPES
X#define TEST_DOS_PIPES`090
X#endif
X
X#undef TRACE
X
X#if USE_DBMALLOC `7C`7C\1006\0F06
X#  undef strchr
X#  undef strrchr
X#  undef memcpy
X#  undef memccpy
X#  undef malloc
X#  undef realloc
X#  undef free
X#  define strmalloc strdup
X#  if USE_DBMALLOC
X#    include <dbmalloc.h>`09`09/* renamed from \1D08's convention */
X#    define show_alloc() malloc_dump(fileno(stderr))
X#  endif
X#  if USE_DMALLOC
X#    include <dmalloc.h>
X#    define show_alloc() dmalloc_log_unfreed()
X#  endif
X#  if OPT_TRACE
X#    include "trace.h"
X#  endif
X#else
X#  if NO_LEAKS `7C`7C DOALLOC &027C OPT_TRACE
X#    include "trace.h"
X#  endif
X#endif`09/* USE_DBMALLOC */
X
X/* Normally defined in "trace.h" */
X#ifndef TRACE
X#define TRACE(p) /* nothing */
X#endif
X
X#if DISP_X11 `26`26 NEED_X_INCLUDES
X#include`09<X11/Intrinsic.h>
X#include`09<X11/StringDefs.h>
X#endif
X
X/*
X * Local prototypes (must follow NO_LEAKS definition)
X */
X
X#if`09!CHECK_PROTOTYPES
X#include "neproto.h"
X#include "proto.h"
X#endif
X
X/*
X * the list of generic function key bindings
X */
X#if`09!CHECK_PROTOTYPES
X#include "nefkeys.h"
X#endif
X
X/*`09Dynamic RAM tracking and reporting redefinitions`09*/
X#if`09OPT_RAMSIZE
X#undef`09realloc
X#define`09realloc\0808ate
X#undef`09calloc
X#define`09calloc(n,m)`09allocate((n)*(m))
X#undef`09malloc
X#define`09malloc`09allocate
X#undef`09free
X#define`09free`09release
X#endif
X
X/* for debugging VMS pathnames on UNIX... */
X#if SYS_UNIX `26`26 OPT_VMS_PATH
X#include "fakevms.h"
X#endif
X
X#endif /* _estruct_h */
$ call unpack [.VILE-8_0]ESTRUCT.H;1 -
 1380269494 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 156 36 152
$!
$ create 'f'
X/*`09EVAL.C:`09Expression evaluation functions for
X`09`09MicroEMACS
X
X`09written 1986 by Daniel Lawrence
X *
X * $Header: /usr/build/vile/vile/RCS/eval.c,v 1.160 1998/05/28 00:34:34 tom Ex
Vp $
X *
X */
X
X#include`09"estruct.h"
X#include`09"edef.h"
X#include`09"nevars.h"
X#include`09"patchlev.h"
X
X#define`09FUNC_NAMELEN`094
X
X#define`09ILLEGAL_NUM`09-1
X#define`09MODE_NUM`09-2
X#define`09USER_NUM`09-3
X
X#if SYS_OS2 `7C`7C\0B08_EMX
X#  define SHELL_NAME "COMSPEC"
X#  define SHELL_PATH "cmd.exe"
X#else
X#  if SYS_WINNT
X#    define SHELL_NAME "COMSPEC"
X#    define SHELL_PATH (is_winnt() ? "cmd.exe" : "command.com")
X#  else
X#    if SYS_MSDOS
X#      define SHELL_NAME "COMSPEC"
X#      define SHELL_PATH "command.com"
X#    else
X#      define SHELL_NAME "SHELL"
X#      define SHELL_PATH "/bin/sh"
X#    endif
X#  endif
X#endif
X
X/* When the command interpretor needs to get a variable's name, rather than it
Vs
X * value, it is passed back as a VDESC variable description structure.  The
X * v_num field is an index into the appropriate variable table.
X */
X
X`09/* macros for environment-variable switch */
X`09/*  (if your compiler balks with "non-constant case expression" */
X#if SYS_VMS `7C`7C HAVE_LOSING_SWITCH_WITH_STRUCTURE_OFFSET
X#define`09If(N)`09`09if (vnum == N) `7B
X#define`09ElseIf(N)`09`7D else If(N)
X#define`09Otherwise`09`7D else `7B
X#define`09EndIf`09`09`7D
X#else`09`09`09/* more compact if it works... */
X#define`09If(N)`09`09switch (vnum) `7B case N: `7B
X#define`09ElseIf(N)`09break; `7D case N: `7B
X#define`09Otherwise`09break; `7D default: `7B
X#define`09EndIf`09`09`7D`7D
X#endif
X
X#if OPT_EVAL
Xtypedef struct`09`7B
X`09int`09v_type;`09/* type of variable */
X`09int`09v_num;`09/* index, if it's an environment-variable */
X`09UVAR *`09v_ptr;`09/* pointer, if it's a user-variable */
X`09`7D VDESC;
X
Xstatic`09SIZE_T`09s2size ( char *s );
Xstatic`09char *`09getkill (void);
Xstatic`09char *`09ltos ( int val );
Xstatic`09char *`09s2offset ( \1206s,\0907n );
Xstatic`09int`09PromptAndSet ( const char *var, int f\0706n );
Xstatic`09int`09SetVarValue ( VDESC *var, const char *value );
Xstatic`09int`09ernd (void);
Xstatic`09int`09gtlbl ( const char *tokn );
Xstatic`09int`09l_strtol ( const char *s );
Xstatic`09int`09sindex ( const char *sourc,\130Dpattern );
X#endif
X
X/*--------\0808\1010\2020\400A*/
X
X#if`09ENVFUNC `26`26 OPT_EVAL
Xstatic char *
XGetEnv(char *s)
X`7B
X`09register char *v = getenv(s);
X`09return v ? v : "";
X`7D
X
Xstatic char *
XDftEnv(
Xregister char`09*name,
Xregister char`09*dft)
X`7B
X`09name = GetEnv(name);
X`09return (*name == EOS) ? dft : name;
X`7D
X
Xstatic void
XSetEnv(
Xchar`09**namep,
Xconst char *value)
X`7B
X`09FreeIfNeeded(*namep);
X`09*namep = strmalloc(value);
X`7D
X#else
X#define`09GetEnv(s)`09""
X#define`09DftEnv(s,d)`09d
X#define`09SetEnv(np,s)`09(*(np) = strmalloc(s))
X#endif
X
X#if OPT_EVAL `26`26 OPT_SHELL
Xstatic char *shell;`09/* $SHELL environment is "$shell" variable */
Xstatic char *directory;`09/* $TMP environment is "$\2409" variable */
X#if DISP_X11
Xstatic char *x_display;`09/* $DISPLAY environment is "$x\2707" variable */
Xstatic char *x_shell;`09/* $XSHELL environment is "$xshell" variable */
X#endif
X#endif
X
X#if OPT_EVAL `26`26 OPT_SHELL
Xchar *
Xget_shell(void)
X`7B
X`09if (shell == 0)
X`09`09SetEnv(`26shell, DftEnv(SHELL_NAME, \0C06PATH));
X`09return shell;
X`7D
X#endif
X
X#if OPT_SHOW_EVAL
X/* list the current vars into\160Dbuffer */
X/* ARGSUSED */
Xstatic void
Xmakevarslist(int dum1 GCC_UNUSED, void *ptr)
X`7B
X`09register UVAR *p;
X`09register int j;
X
X`09bprintf("--- Environment variables %*P`5Cn", term.t_ncol-1, '-');
X`09bprintf("%s", (char *)ptr);
X`09for (p = user_vars, j = 0; p !\0807= p->next) `7B
X`09`09if (!j++)
X`09`09`09bprintf("--- User variables %*P", term.t_ncol-1, '-');
X`09`09bprintf("`5Cn%%%s = %s", p->u_name\0B07value);
X`09`7D
X`7D
X
X/* Test a name to ensure that it is a mode-name, filtering out modish-stuff
X * such as "all" and "noview"
X */
Xstatic int
Xis_mode_name(const char *name, int showall, VALARGS *args)
X`7B
X`09if (is_varmode(name)) `7B
X`09`09if (find_mode(name, -TRUE, args)) `7B
X`09`09`09if (!showall `26`26 !strcmp(name, args->names->shortname))
X`09`09&0209return FALSE;
X`09`09`09return TRUE;
X`09`09`7D
X`09`09return SORTOFTRUE;
X`09`7D
X`09return FALSE;
X`7D
X
X/* filter out mode-names that apply only to abbreviations */
Xstatic const char *
Xget_listvalue(const char *name, int showall)
X`7B
X`09VALARGS args;
X`09register int`09s;
X
X`09if ((s = is_mode_name(name, showall, `26args)) == TRUE)
X`09`09return string_mode_val(`26args);
X`09else if (s == SORTOFTRUE)
X`09`09return gtenv(name);
X`09return 0;
X`7D
X#endif /* OPT_SHOW_EVAL */
X
X/* ARGSUSED */
X#if OPT_SHOW_EVAL
Xint
Xlistvars(int f, int n)
X`7B
X`09char *values;
X`09register WINDOW *wp = curwp;
X`09register int s;
X`09register ALLOC_T t;
X`09register char *v;
X`09register const char *vv;
X`09static`09const char fmt`5B`5D = `7B "$%s = %*S`5Cn" `7D;
X`09const char *\0C06*Names = f ? list_of_modes() : envars;
X`09int`09showall = f ? (n > 1) : FALSE;
X
X`09/* collect data for environment-variables, since some depend on window */
X`09for (s = t = 0; Names`5Bs`5D != 0; s++) `7B
X`09`09if ((vv = get_listvalue(Names`5Bs`5D, showall)) != 0)
X`09`09`09t += strlen(Names`5Bs`5D) +\1308fmt\0E0Bvv);
X`09`7D
X`09if ((values = typeallocn(char, t)) == 0)
X`09`09return FALSE;
X
X`09for (s = 0, v = values; Names`5Bs`5D != 0; s++) `7B
X`09`09if ((vv = get_listvalue(Names`5Bs`5D, showall)) != 0) `7B
X`09`09`09t = strlen(vv);
X`09`09`09if (t == 0) `7B
X`09`09&0209t = 1;
X`09`09&0209vv = "";
X`09`09`09`7D else if (vv`5Bt-1`5D == '`5Cn')
X`09`09&0209t--;`09/* suppress trailing newline */
X`09`09`09v = lsprintf(v, fmt, Names`5Bs`5D, t, vv);
X`09`09`7D
X`09`7D
X`09s = liststuff(VARIABLES_BufName, FALSE,
X`09`09&0209makevarslist, 0, (void *)values);
X`09free(values);
X
X`09/* back to the buffer whose modes we just listed */
X`09swbuffer(wp->w_bufp);
X`09return s;
X`7D
X#endif /* OPT_SHOW_EVAL */
X
X#if OPT_EVAL
Xstatic const char *
Xgtfun(`09`09`09/* evaluate a function */
Xconst char *fname)`09/* name of function to evaluate */
X`7B
X`09register int fnum;`09`09/* index to function to eval */
X`09const char *it = errorm;
X`09char arg0`5BFUNC_NAMELEN`5D;
X`09char arg1`5BNSTRING`5D;`09`09/* value of first argument */
X`09char arg2`5BNSTRING`5D;`09`09/* value of second argument */
X`09char arg3`5BNSTRING`5D;`09`09/* value of third argument */
X`09static char result`5B2 * NSTRING`5D;`09/* string\1F07 */
X
X`09*arg1 = *arg2\08073 = EOS;
X`09if (!fname`5B0`5D)
X`09`09return(it);
X
X`09/* look the function up in \130Dtable */
X`09mklower(strncpy0(arg0, fname, FUNC_NAMELEN)); /* case-independent */
X`09for (fnum = 0; fnum < NFUNCS\0F06++)
X`09`09if (strcmp(arg0, funcs`5Bfnum`5D.f_name) == 0)
X`09`09`09break;
X
X`09/* return errorm on a bad reference */
X`09if (fnum == NFUNCS)
X`09`09return(errorm);
X
X`09/* if needed, retrieve the first argument */
X`09if (funcs`5Bfnum`5D.f_type >= MONAMIC) `7B
X`09`09if (macarg(arg1) != TRUE)
X`09`09`09return(errorm);
X
X`09`09/* if needed, retrieve the second argument */
X`09`09if (funcs`5Bfnum`5D.f_type >= DYNAMIC) `7B
X`09`09`09if (macarg(arg2) != TRUE)
X`09`09&0209return(errorm);
X
X`09`09`09/* if needed, retrieve the third argument */
X`09`09`09if (funcs`5Bfnum`5D.f_type >= TRINAMIC)
X`09`09&0209if (macarg(arg3) != TRUE)
X`09`09&0209`09return(errorm);
X`09`09`7D
X`09`7D
X
X`09/* and now evaluate it! */
X`09switch (fnum) `7B
X`09case UFADD:
X`09`09it = l_itoa(l_strtol(arg1) + l_\110A2));
X`09`09break;
X`09case UFSUB:
X`09`09it = l_itoa(l_strtol(arg1) - l_\110A2));
X`09`09break;
X`09case UFTIMES:
X`09`09it = l_itoa(l_strtol(arg1) * l_\110A2));
X`09`09break;
X`09case UFDIV:
X`09`09it = l_itoa(l_strtol(arg1) / l_\110A2));
X`09`09break;
X`09case UFMOD:
X`09`09it = l_itoa(l_strtol(arg1) % l_\110A2));
X`09`09break;
X`09case UFNEG:
X`09`09it = l_itoa(-l_strtol(arg1));
X`09`09break;
X`09case UFCAT:
X`09`09it = strcat(strcpy(result, arg1), arg2);
X`09`09break;
X`09case UFLEFT:
X`09`09it = strncpy0(result, arg1, s2size(arg2)+1);
X`09`09break;
X`09case UFRIGHT:
X`09`09it = strcpy(result, s2offset(arg1,arg2));
X`09`09break;
X`09case UFMID:
X`09`09it = strncpy0(result, s2offset(arg1,arg2), s2size(arg3)+1);
X`09`09break;
X`09case UFNOT:
X`09`09it = ltos(stol(arg1) == FALSE);
X`09`09break;
X`09case UFEQUAL:
X`09`09it = ltos(l_strtol(arg1) == l\120B2));
X`09`09break;
X`09case UFLESS:
X`09`09it = ltos(l_strtol(arg1) < l\110B2));
X`09`09break;
X`09case UFGREATER:
X`09`09it = ltos(l_strtol(arg1) > l\110B2));
X`09`09break;
X`09case UFSEQUAL:
X`09`09it = ltos(strcmp(arg1, arg2) == 0);
X`09`09break;
X`09case UFSLESS:
X`09`09it = ltos(strcmp(arg1, arg2) < 0);
X`09`09break;
X`09case UFSGREAT:
X`09`09it = ltos(strcmp(arg1, arg2) > 0);
X`09`09break;
X`09case UFIND:
X`09`09it = tokval(arg1);
X`09`09break;
X`09case UFAND:
X`09`09it = ltos(stol(arg1) `26`26 \0E082));
X`09`09break;
X`09case UFOR:
X`09`09it = ltos(stol(arg1) `7C`7C \0E082));
X`09`09break;
X`09case UFLENGTH:
X`09`09it = l_itoa((int)strlen(arg1));
X`09`09break;
X`09case UFUPPER:
X`09`09it = mkupper(arg1);
X`09`09break;
X`09case UFLOWER:
X`09`09it = mklower(arg1);
X`09`09break;
X`09case UFTRIM:
X`09`09it = mktrimmed(arg1);
X`09`09break;
X`09case UFTRUTH:
X`09`09/* is it the answer to everything? */
X`09`09it = ltos(l_strtol(arg1) == 42);
X`09`09break;
X`09case UFASCII:
X`09`09it = l_itoa((int)arg1`5B0`5D);
X`09`09break;
X`09case UFCHR:
X`09`09result`5B0`5D = (char)l_strtol(arg1);
X`09`09result`5B1`5D = EOS;
X`09`09it = result;
X`09`09break;
X`09case UFGTKEY:
X`09`09result`5B0`5D = (char)keystroke_raw8();
X`09`09result`5B1`5D = EOS;
X`09`09it = result;
X`09`09break;
X`09case UFGTSEQ:
X`09`09(void)kcod2escape_seq(kbd_seq_nomap(), result);
X`09`09it = result;
X`09`09break;
X`09case UFRND:
X`09`09it = l_itoa((ernd() % absol(l_strtol(arg1))) + 1);
X`09`09break;
X`09case UFABS:
X`09`09it = l_itoa(absol(l_strtol(arg1)));
X`09`09break;
X`09case UFSINDEX:
X`09`09it = l_itoa(sindex(arg1, arg2));
X`09`09break;
X`09case UFENV:
X`09`09it = GetEnv(arg1);
X`09`09break;
X`09case UFBIND:
X`09`09it = prc2engl(arg1);
X`09`09break;
X`09case UFREADABLE:
X`09`09it = ltos(doglob(arg1)
X`09`09`09`26`26 flook(arg1, FL_HERE`7CFL_READABLE) != NULL);
X`09`09break;
X`09case UFWRITABLE:
X`09`09it = ltos(doglob(arg1)
X`09`09`09`26`26 flook(arg1, FL_HERE`7CFL_WRITEABLE) != NULL);
X`09`09break;
X`09case UFLOCMODE:
X`09case UFGLOBMODE:
X`09`09`7B VALARGS args;
X`09`09if (find_mode(arg1, (fnum == UFGLOBMODE), `26args) != TRUE)
X`09`09`09break;
X`09`09it = string_mode_val(`26args);
X`09`09`7D
X`09`09break;
X`09default:
X`09`09it = errorm;
X`09`09break;
X`09`7D
X`09return it;
X`7D
X
Xstatic const char *
Xgtusr(`09`09`09/* look up a user var's value */
Xconst char *vname)`09/* name of user variable to fetch */
X`7B
X`09register UVAR`09*p;
X
X`09if (vname`5B0`5D != EOS) `7B
X`09`09for (p = user_vars; p != 0; p = p->next)
X`09`09`09if (!strcmp(vname, p->u_name))
X`09`09&0209return p->u_value;
X`09`7D
X`09return (errorm);
X`7D
X
Xchar *
Xgtenv(const char *vname)`09/* name of environment variable to retrieve */
X`7B
X`09register int vnum;`09/* ordinal number of var referenced */
X`09register char *value = errorm;
X`09BUFFER *bp;
X
X`09if (vname`5B0`5D != EOS) `7B
X
X`09`09/* scan the list, looking for the referenced name */
X`09`09for (vnum = 0; envars`5Bvnum`5D != 0; vnum++)
X`09`09`09if (strcmp(vname, envars`5Bvnum`5D) == 0)
X`09`09&0209break;
X
X`09`09/* return errorm on a bad reference */
X`09`09if (envars`5Bvnum`5D == 0) `7B
X#if !SMALLER
X`09`09`09VALARGS`09args;
X
X`09`09`09if (is_mode_name(vname, TRUE, `26args) == TRUE)
X`09`09&0209value = string_mode_val(`26args);
X#endif
X`09`09`09return (value);
X`09`09`7D
X
X
X`09`09/* otherwise, fetch the appropriate value */
X
X`09`09/* NOTE -- if you get a compiler error from this code, find
X`09`09`09the definitions of If and ElseIf up above, and add your
X`09`09`09system to the set of those with broken compilers that need
X`09`09`09to use ifs instead of a switch statement */
X
X`09`09If( EVPAGELEN )&0209value = l_itoa(term.t_nrow);
X`09`09ElseIf( EVCURCOL )`09value = l_itoa(getccol(FALSE) + 1);
X`09`09ElseIf( EVCURLINE )`09value = l_itoa(getcline());
X#if OPT_RAMSIZE
X`09`09ElseIf( EVRAM )&0209value = l_itoa((int)(envram / 1024l));
X#endif
X`09`09ElseIf( EVFLICKER )`09value = ltos(flickcode);
X`09`09ElseIf( EVCURWIDTH )`09value = l_itoa(term.t_ncol);
X`09`09ElseIf( EVCBUFNAME )`09value = curbp->b_bname;
X`09`09ElseIf( EVABUFNAME )`09value = ((bp = find_alt()) != 0)
X`09`09&0209&0209? bp->b_bname
X`09`09&0209&0209: "";
X`09`09ElseIf( EVCFNAME )`09value = curbp ?\0806->b_fname : "";
X`09`09ElseIf( EVSRES )`09value = sres;
X`09`09ElseIf( EVDEBUG )`09value = ltos(macbug);
X`09`09ElseIf( EVSTATUS )`09value = ltos(cmdstatus);
X`09`09ElseIf( EVPALETTE )`09value = tb_values(palstr);
X`09`09ElseIf( EVLASTKEY )`09value = l_itoa(lastkey);
X`09`09ElseIf( EVCURCHAR )
X`09`09`09if (curbp `26`26 !is_empty_buf\1706)) `7B
X`09`09&0209value = is_at_end_of_line(DOT)
X`09`09&0209`09? l_itoa('`5Cn')
X`09`09&0209`09: l_itoa(char_at(DOT));
X`09`09`09`7D
X
X`09`09ElseIf( EVDISCMD )`09value = ltos(discmd);
X`09`09ElseIf( EVPATCHLEVEL )`09value = \150A;
X`09`09ElseIf( EVVERSION )`09value = version;
X`09`09ElseIf( EVPROGNAME )`09value = prognam;
X`09`09ElseIf( EVOS )&0209value = opersys;
X`09`09ElseIf( EVSEED )`09value = l_itoa(seed);
X`09`09ElseIf( EVDISINP )`09value = ltos(disinp);
X`09`09ElseIf( EVWLINE )`09value = l_itoa(curwp->w_ntrows);
X`09`09ElseIf( EVCWLINE )`09value = l_itoa(getwpos());
X`09`09ElseIf( EVFWD_SEARCH )`09value = ltos(last_srch_direc == FORWARD);
X`09`09ElseIf( EVSEARCH )`09value = pat;
X`09`09ElseIf( EVREPLACE )`09value = rpat;
X`09`09ElseIf( EVMATCH )`09value = (patmatch == NULL) ?
X`09`09&0209&0309"" : patmatch;
X`09`09ElseIf( EVMODE )`09value = current_modename();
X`09`09ElseIf( EVEOC )&0209value = l_itoa(ev_end_of_cmd ? 1 : 0);
X#if OPT_MLFORMAT
X`09`09ElseIf( EVMLFORMAT )
X`09`09`09if (modeline_format == 0)
X`09`09&0209mlwrite("BUG: modeline_format uninitialized");
X`09`09`09value = modeline_format;
X#endif
X
X`09`09ElseIf( EVMODIFIED )`09value = ltos(curbp `26`26 b_is_changed\1606));
X`09`09ElseIf( EVKILL )`09value = getkill();
X`09`09ElseIf( EVTPAUSE )`09value = l_itoa(term.t_pause);
X`09`09ElseIf( EVPENDING )`09value = ltos(keystroke_avail());
X`09`09ElseIf( EVLLENGTH )`09value = l_itoa(llength(DOT.l));
X#if OPT_MAJORMODE
X`09`09ElseIf( EVMAJORMODE )`09value = (curbp->majr != 0)
X`09`09&0209&0209? curbp->majr->name
X`09`09&0209&0209: "";
X#endif
X`09`09ElseIf( EVLINE )`09value = getctext((CHARTYPE)0);
X`09`09ElseIf( EVWORD )`09value = getctext(_nonspace);
X`09`09ElseIf( EVIDENTIF )`09value = getctext(_ident);
X`09`09ElseIf( EVQIDENTIF )`09value = getctext(_qident);
X`09`09ElseIf( EVPATHNAME )`09value = getctext(_pathn);
X#if SYS_UNIX
X`09`09ElseIf( EVPROCESSID )`09value = l_itoa(getpid());
X#endif
X#if OPT_SHELL
X`09`09ElseIf( EVCWD )&0209value = current_directory(FALSE);
X`09`09ElseIf( EVOCWD )`09value = previous_directory();
X#endif
X#if OPT_PROCEDURES
X`09`09ElseIf( EVCDHOOK )`09value = cdhook;
X`09`09ElseIf( EVRDHOOK )`09value = readhook;
X`09`09ElseIf( EVWRHOOK )`09value = writehook;
X`09`09ElseIf( EVBUFHOOK )`09value = bufhook;
X`09`09ElseIf( EVEXITHOOK )`09value = exithook;
X#endif
X#if DISP_X11
X`09`09ElseIf( EVFONT )`09value = x_current_fontname();
X`09`09ElseIf( EVTITLE )`09value = x_get_window_name();
X`09`09ElseIf( EVICONNAM )`09value = x_get_icon_name();
X`09`09ElseIf( EVXDISPLAY )
X`09`09`09if (x_display == 0)
X`09`09&0209SetEnv(`26x_display, DftEnv("DISPLAY", "unix:0"));
X`09`09`09value = x_display;
X`09`09ElseIf( EVXSHELL )
X`09`09`09if (x_shell == 0)
X`09`09&0209SetEnv(`26x_shell, DftEnv("XSHELL", "xterm"));
X`09`09`09value = x_shell;
X#endif
X#if OPT_SHELL
X`09`09ElseIf( EVSHELL )
X`09`09`09value = get_shell();
X
X`09`09ElseIf( EVDIRECTORY )
X`09`09`09if (directory == 0)
X`09`09&0209SetEnv(`26directory, DftEnv("TMP", P_tmpdir));
X`09`09`09value = directory;
X#endif
X
X`09`09ElseIf( EVHELPFILE )`09value = helpfile;
X
X`09`09ElseIf( EVSTARTUP_FILE ) value = startup_file;
X
X`09`09ElseIf( EVSTARTUP_PATH ) value = startup_path;
X
X#if OPT_COLOR
X`09`09ElseIf( EVNCOLORS )`09value = l_itoa(ncolors);
X#endif
X
X`09`09ElseIf( EVNTILDES )`09value = l_itoa(ntildes);
X
X`09`09EndIf
X`09`7D
X`09if (value == 0)
X`09`09value = errorm;
X`09return value;
X`7D
X
Xstatic char *
Xgetkill(void)`09`09/* return some of the contents\1008kill buffer */
X`7B
+-+-+-+-+-+-+-+-  END  OF PART 48 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 49 -+-+-+-+-+-+-+-+
X`09register SIZE_T size;`09/* max number of chars to return */
X`09static char value`5BNSTRING`5D;`09/* temp buffer fo\2307 */
X
X`09if (kbs`5B0`5D.kbufh == NULL)
X`09`09/* no kill buffer....just a null string */
X`09`09value`5B0`5D = EOS;
X`09else `7B
X`09`09/* copy in the contents... */
X`09`09if (kbs`5B0`5D.kused < NSTRING)
X`09`09`09size = kbs`5B0`5D.kused;
X`09`09else
X`09`09`09size = NSTRING - 1;
X`09`09(void)strncpy(value, (char *)(kbs`5B0`5D.kbufh->d_chunk), size);
X`09`09value`5Bsize`5D = EOS;
X`09`7D
X
X`09/* and return the constructed value */
X`09return(value);
X`7D
X
Xstatic void
XFindVar(`09`09/* find a variables type and name */
Xchar *var,`09`09/* name of var to get */
XVDESC *vd)`09`09/* structure to hold type and ptr */
X`7B
X`09register UVAR *p;
X`09register int vnum;`09/* subscript in variable arrays */
X`09register int vtype;`09/* type to return */
X
Xfvar:
X`09vtype = vnum = ILLEGAL_NUM;
X`09vd->v_ptr = 0;
X
X`09if (!var`5B1`5D) `7B
X`09`09vd->v_type = vtype;
X`09`09return;
X`09`7D
X`09switch (var`5B0`5D) `7B
X
X`09`09case '$': /* check for legal enviromnent var */
X`09`09`09for (vnum = 0; envars`5Bvnum`5D != 0; vnum++)
X`09`09&0209if (strcmp(`26var`5B1`5D, envars`5Bvnum`5D) == 0) `7B
X`09`09&0209`09vtype = TKENV;
X`09`09&0209`09break;
X`09`09&0209`7D
X#if !SMALLER
X`09`09`09if (vtype == ILLEGAL_NUM) `7B
X`09`09&0209VALARGS`09args;
X
X`09`09&0209if (is_mode_name(`26var`5B1`5D, TRUE, `26args) == TRUE) `7B
X`09`09&0209`09vnum  = MODE_NUM;
X`09`09&0209`09vtype = TKENV;
X`09`09&0209`7D
X`09`09`09`7D
X#endif
X`09`09`09break;
X
X`09`09case '%': /* check for existing legal user variable */
X`09`09`09for (p = user_vars; p != 0; p = p->next)
X`09`09&0209if (!strcmp(var+1, p->u_name)) `7B
X`09`09&0209`09vtype = TKVAR;
X`09`09&0209`09vnum  = USER_NUM;
X`09`09&0209`09vd->v_ptr = p;
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09`09if (vd->v_ptr == 0) `7B
X`09`09&0209if ((p = typealloc(UVAR)) != 0
X`09`09&0209 `26`26 (p->u_name = strmalloc(var+1)) != 0) `7B
X`09`09&0209`09p->next    = user_vars;
X`09`09&0209`09p->u_value = 0;
X`09`09&0209`09user_vars  = vd->v_ptr = p;
X`09`09&0209`09vtype = TKVAR;
X`09`09&0209`09vnum  = USER_NUM;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09break;
X
X`09`09case '`26':`09/* indirect operator? */
X`09`09`09if (strncmp(var, "`26ind", FUNC_NAMELEN) == 0) `7B
X`09`09&0209/* grab token, and eval it */
X`09`09&0209execstr = token(\1007, var, EOS);
X`09`09&0209(void)strcpy(var, tokval(var));
X`09`09&0209goto fvar;
X`09`09`09`7D
X`09`7D
X
X`09/* return the results */
X`09vd->v_num = vnum;
X`09vd->v_type = vtype;
X`7D
X
X/*
X * Handles name-completion for variables.  Note that since the first character
V
X * can be either a '$' or '%', we'll postpone name-completion until we've seen
V
X * a '$'.
X */
Xstatic int
Xvars_complete(
Xint`09c,
Xchar`09*buf,
Xunsigned *pos)
X`7B
X`09int`09status;
X`09if (buf`5B0`5D == '$') `7B
X`09`09*pos -= 1;`09/* account for leading '$', not in tables */
X`09`09status = kbd_complete(FALSE, c, buf+1, pos,
X`09`09&0209(const char *)list_of_modes(), sizeof(c\1F06);
X`09`09*pos += 1;
X`09`7D else `7B
X`09`09if (c != NAMEC) /* cancel the unget */
X`09`09`09unkeystroke(c);
X`09`09status = TRUE;
X`09`7D
X`09return status;
X`7D
X
Xint
Xsetvar(int f, int n)`09`09/* set a variable */
X`09/* note: numeric arg can overide prompted value */
X`7B
X`09register int status;`09/*\0B07 return */
X`09static TBUFF *var;
X
X`09/* first get the variable to set.. */
X`09if (var == 0)
X`09`09tb_scopy(`26var, "");
X`09status = kbd_reply("Variable to set: ", `26var,
X`09`09mode_eol, '=', KBD_NOEVAL`7CKBD_LOWERC, vars_complete);
X`09if (status != TRUE)
X`09`09return(status);
X`09return PromptAndSet(tb_values(var), f, n);
X`7D
X
Xstatic int
XPromptAndSet(const char *name, int f\0706n)
X`7B
X`09register int status;`09/*\0B07 return */
X`09VDESC vd;`09`09/* variable num/type */
X`09char var`5BNLINE`5D;
X`09char prompt`5BNLINE`5D;
X`09char value`5BNLINE`5D;`09/*\1106 to set variable to */
X
X`09/* check the legality and find the var */
X`09FindVar(strcpy(var, name), `26vd);
X
X`09/* if its not legal....bitch */
X`09if (vd.v_type == ILLEGAL_NUM) `7B
X`09`09mlforce("`5BNo such variable as '%s'`5D", var);
X`09`09return(FALSE);
X`09`7D else if (vd.v_type == TKENV `26`26 vd.v_num == MODE_NUM) `7B
X`09`09VALARGS`09args;
X`09`09(void)find_mode(var+1, -TRUE, `26args);
X`09`09set_end_string('=');
X`09`09return adjvalueset(var+1, TRUE, -\0706`26args);
X`09`7D
X
X`09/* get the value for that variable */
X`09if (f == TRUE)
X`09`09(void)strcpy(value, l_itoa(n));
X`09else `7B
X`09`09value`5B0`5D = EOS;
X`09`09(void)lsprintf(prompt, "Value of %s: ", var);
X`09`09status = mlreply(prompt, value, sizeof(value));
X`09`09if (status != TRUE)
X`09`09`09return(status);
X`09`7D
X
X`09/* and set the appropriate value */
X`09status = SetVarValue(`26vd, value);
X
X`09if (status == ABORT)
X`09`09mlforce("`5BVariable %s is readonly`5D", var);
X`09else if (status != TRUE)
X`09`09mlforce("`5BCannot set %s to %s`5D", var, value);
X`09/* and return it */
X`09return(status);
X`7D
X
Xint
Xstenv(const char *name, c\120Bvalue)
X`7B
X`09register int status;`09/*\0B07 return */
X`09VDESC vd;`09`09/* variable num/type */
X`09char var`5BNLINE`5D;
X
X`09/* check the legality and find the var */
X`09var`5B0`5D = '$';
X`09strcpy(var+1, name);
X`09FindVar(var, `26vd);
X`09if (vd.v_type == ILLEGAL_NUM) `7B
X`09`09return(FALSE);
X`09`7D
X`09/* and set the appropriate value */
X`09status = SetVarValue(`26vd, value);
X`09return status;
X`7D
X
X/* entrypoint from modes.c, used to set environment variables */
X#if OPT_EVAL
Xint
Xset_variable(const char *name)
X`7B
X`09char`09temp`5BNLINE`5D;
X`09if (*name != '$')
X`09`09(void) strcat(strcpy(temp, "$"), name);
X`09else
X`09`09(void) strcpy(temp, name);
X`09return PromptAndSet(temp, FALSE, 0);
X`7D
X#endif
X
Xstatic int
XSetVarValue(`09/* set a variable */
XVDESC *var,`09/* variable to set */
Xconst char *value)`09/* value to set to */
X`7B
X`09register UVAR *vptr;
X`09register int vnum;`09/* ordinal number of var referenced */
X`09register int vtype;`09/* type of variable to set */
X`09register int status;`09/*\0B07 return */
X`09register int c;`09`09/* translated character */
X
X`09/* simplify the vd structure (we are gonna look at it a lot) */
X`09vptr = var->v_ptr;
X`09vnum = var->v_num;
X`09vtype = var->v_type;
X
X`09/* and set the appropriate value */
X`09status = TRUE;
X`09switch (vtype) `7B
X`09case TKVAR: /* set a user variable */
X`09`09FreeIfNeeded(vptr->u_value);
X`09`09if ((vptr->u_value = strmalloc(value)) == 0)
X`09`09`09status = FALSE;
X`09`09break;
X
X`09case TKENV: /* set an environment variable */
X`09`09status = TRUE;`09/* by default */
X`09`09If( EVCURCOL )
X`09`09`09status = gotocol(TRUE, atoi(value));
X
X`09`09ElseIf( EVCURLINE )
X`09`09`09status = gotoline(TRUE, atoi(value));
X
X`09`09ElseIf( EVFLICKER )
X`09`09`09flickcode = stol(value);
X
X`09`09ElseIf( EVCURWIDTH )
X#if DISP_X11
X`09`09`09x_resize(atoi(value), term.t_nrow);
X#else
X`09`09`09status = newwidth(TRUE, atoi(value));
X#endif
X
X`09`09ElseIf( EVPAGELEN )
X#if DISP_X11
X`09`09`09x_resize(term.t_ncol, atoi(value));
X#else
X`09`09`09status = newlength(TRUE, atoi(value));
X#endif
X
X`09`09ElseIf( EVCBUFNAME )
X`09`09`09if (curbp) `7B
X`09`09&0209set_bname(curbp, value);
X`09`09&0209curwp->w_flag `7C= WFMODE;
X`09`09`09`7D
X
X`09`09ElseIf( EVCFNAME )
X`09`09`09if (curbp) `7B
X`09`09&0209ch_fname(curbp, value);
X`09`09&0209curwp->w_flag `7C= WFMODE;
X`09`09`09`7D
X
X`09`09ElseIf( EVSRES )
X`09`09`09status = TTrez(value);
X
X`09`09ElseIf( EVDEBUG )
X`09`09`09macbug = stol(value);
X
X`09`09ElseIf( EVSTATUS )
X`09`09`09cmdstatus = stol(value);
X
X`09`09ElseIf( EVPALETTE )
X`09`09`09status = set_palette(value);
X
X`09`09ElseIf( EVLASTKEY )
X`09`09`09lastkey = l_strtol(value);
X
X`09`09ElseIf( EVCURCHAR )
X`09`09`09if (curbp == NULL `7C`7C b_val\1706,MDVIEW))
X`09`09&0209status = rdonly();
X`09`09`09else `7B
X`09`09&0209mayneedundo();
X`09`09&0209(void)ldelete(1L, FALSE); /* \1606 1 char */
X`09`09&0209c = l_strtol(value);
X`09`09&0209if (c == '`5Cn')
X`09`09&0209`09status = lnewline();
X`09`09&0209else
X`09`09&0209`09status = linsert(1, c);
X`09`09&0209(void)backchar(FALSE, 1);
X`09`09`09`7D
X
X#if OPT_CRYPT
X`09`09ElseIf( EVCRYPTKEY )
X`09`09`09if (cryptkey != 0)
X`09`09&0209free(cryptkey);
X`09`09`09cryptkey = strmalloc(value);
X`09`09`09ue_crypt((char *)NULL, 0);
X`09`09`09ue_crypt(cryptkey, (int)strlen\1609));
X#endif
X`09`09ElseIf( EVDISCMD )
X`09`09`09discmd = stol(value);
X
X`09`09ElseIf( EVSEED )
X`09`09`09seed = atoi(value);
X
X`09`09ElseIf( EVDISINP )
X`09`09`09disinp = stol(value);
X
X`09`09ElseIf( EVWLINE )
X`09`09`09status = resize(TRUE, atoi(value));
X
X`09`09ElseIf( EVCWLINE )
X`09`09`09status = forwline(TRUE, atoi(value) - getwpos());
X
X#if OPT_MLFORMAT
X`09`09ElseIf( EVMLFORMAT )
X`09`09`09SetEnv(`26modeline_format, value);
X`09`09`09upmode();
X#endif
X
X`09`09ElseIf( EVFWD_SEARCH )
X`09`09`09last_srch_direc = stol(value) ? FORWARD : REVERSE;
X
X`09`09ElseIf( EVSEARCH )
X`09`09`09(void)strcpy(pat, value);
X`09`09`09FreeIfNeeded(gregexp);
X`09`09`09gregexp = regcomp(pat, b_val(curbp, MDMAGIC));
X
X`09`09ElseIf( EVREPLACE )
X`09`09`09(void)strcpy(rpat, value);
X
X`09`09ElseIf( EVTPAUSE )
X`09`09`09term.t_pause = atoi(value);
X
X`09`09ElseIf( EVLINE )
X`09`09`09if (b_val(curbp,MDVIEW))
X`09`09&0209status = rdonly();
X`09`09`09else `7B
X`09`09&0209mayneedundo();
X`09`09&0209status = putctext(value);
X`09`09`09`7D
X
X#if DISP_X11
X`09`09ElseIf( EVFONT ) status = x_setfont(value);
X`09`09ElseIf( EVTITLE ) x_set_window_name(value);
X`09`09ElseIf( EVICONNAM ) x_set_icon_name(value);
X`09`09ElseIf( EVXDISPLAY ) SetEnv(`26x_display, value);
X`09`09ElseIf( EVXSHELL ) SetEnv(`26x_shell, value);
X#endif
X#if OPT_SHELL
X`09`09ElseIf( EVCWD )
X`09`09`09status = set_directory(value);
X
X`09`09ElseIf( EVSHELL )
X`09`09`09SetEnv(`26shell, value);
X
X`09`09ElseIf( EVDIRECTORY )
X`09`09`09SetEnv(`26directory, value);
X#endif
X
X`09`09ElseIf( EVHELPFILE )
X`09`09`09SetEnv(`26helpfile, value);
X
X`09`09ElseIf( EVSTARTUP_FILE )
X`09`09`09SetEnv(`26startup_file, value);
X
X`09`09ElseIf( EVSTARTUP_PATH )
X`09`09`09SetEnv(`26startup_path, value);
X
X#if OPT_PROCEDURES
X`09`09ElseIf( EVCDHOOK )     (void)strcpy(cdhook, value);
X`09`09ElseIf( EVRDHOOK )     (void)strcpy(readhook, value);
X`09`09ElseIf( EVWRHOOK )     (void)strcpy(writehook, value);
X`09`09ElseIf( EVBUFHOOK )    (void)strcpy(bufhook, value);
X`09`09ElseIf( EVEXITHOOK )   (void)strcpy(exithook, value);
X#endif
X
X#if OPT_COLOR
X`09`09ElseIf( EVNCOLORS )`09status = set_ncolors(atoi(value));
X#endif
X
X`09`09ElseIf( EVNTILDES )
X`09`09`09ntildes = atoi(value);
X`09`09`09if (ntildes > 100)
X`09`09&0209ntildes = 100;
X
X`09`09Otherwise
X`09`09`09/* EVABUFNAME */
X`09`09`09/* EVPROGNAME */
X`09`09`09/* EVPATCHLEVEL */
X`09`09`09/* EVVERSION */
X`09`09`09/* EVMATCH */
X`09`09`09/* EVKILL */
X`09`09`09/* EVPENDING */
X`09`09`09/* EVLLENGTH */
X`09`09`09/* EVMAJORMODE */
X`09`09`09/* EVMODIFIED */
X`09`09`09/* EVPROCESSID */
X`09`09`09/* EVRAM */
X`09`09`09/* EVMODE */
X`09`09`09/* EVOS */
X`09`09`09status = ABORT;`09/* must be readonly */
X`09`09EndIf
X`09`09break;
X`09`7D
X#if`09OPT_DEBUGMACROS
X`09/* if $debug == TRUE, every assignment will echo a statment to
X`09   that effect here. */
X
X`09if (macbug) `7B
X`09`09char`09outline`5BNLINE`5D;
X`09`09(void)strcpy(outline, "(((");
X
X`09`09/* assignment status */
X`09`09(void)strcat(outline, ltos(status));
X`09`09(void)strcat(outline, ":");
X
X`09`09/* variable name */
X`09`09if (var->v_type == TKENV) `7B
X`09`09`09(void)strcat(outline, "`26");
X`09`09`09(void)strcat(outline, envars`5Bvar->v_num`5D);
X`09`09`7D else if (var->v_type == TKENV) `7B
X`09`09`09(void)strcat(outline, "%");
X`09`09`09(void)strcat(outline, var->v_ptr->u_name);
X`09`09`7D
X`09`09(void)strcat(outline, ":");
X
X`09`09/* and lastly the value we tried to assign */
X`09`09(void)strcat(outline, value);
X`09`09(void)strcat(outline, ")))");
X
X
X`09`09/* write out the debug line */
X`09`09mlforce("%s",outline);
X`09`09(void)update(TRUE);
X
X`09`09/* and get the keystroke to hold the output */
X`09`09if (ABORTED(keystroke())) `7B
X`09`09`09mlforce("`5BMacro aborted`5D");
X`09`09`09status = FALSE;
X`09`09`7D
X`09`7D
X#endif
X`09return(status);
X`7D
X#endif
X
Xconst char *
Xskip_cblanks(const char *src)
X`7B
X`09while (isSpace(*src))
X`09`09src++;
X`09return src;
X`7D
X
Xconst char *
Xskip_cstring(const char *src)
X`7B
X`09return src + strlen(src);
X`7D
X
Xconst char *
Xskip_ctext(const char *src)
X`7B
X`09while (*src != EOS `26`26 !isSpace(*src))
X`09`09src++;
X`09return src;
X`7D
X
X/* If we've #define'd const, it's because it doesn't work.  Conversely, if
X * it's not #define'd, we really need distinct string functions.
X */
X#ifndef const
Xchar *
Xskip_blanks(char *src)
X`7B
X`09while (isSpace(*src))
X`09`09src++;
X`09return src;
X`7D
X
Xchar *
Xskip_string(char *src)
X`7B
X`09return src + strlen(src);
X`7D
X
Xchar *
Xskip_text(char *src)
X`7B
X`09while (*src != EOS `26`26 !isSpace(*src))
X`09`09src++;
X`09return src;
X`7D
X#endif
X
X#if OPT_COLOR
Xvoid
Xset_ctrans(const char *thePalette)
X`7B
X`09int n = 0, value;
X`09char *next;
X
X`09while (*thePalette != EOS) `7B
X`09`09thePalette = skip_cblanks(\1A0A);
X`09`09value = (int) strtol(thePalette, `26next, 0);
X`09`09if (next == thePalette)
X`09`09`09break;
X`09`09thePalette = next;
X`09`09ctrans`5Bn`5D = value;
X`09`09if (++n >= NCOLORS)
X`09`09`09break;
X`09`7D
X`7D
X#endif
X
X/*
X * This function is used in several terminal drivers.
X */
X#if OPT_EVAL `7C`7C OPT_COLOR
Xint
Xset_palette(const char *value)
X`7B
X`09palstr = tb_scopy(`26\1306, value);
X#if OPT_COLOR
X`09if (term.t_setpal != null_\1108) `7B
X`09`09TTspal(tb_values(palstr));
X`09`09vile_refresh(FALSE,0);
X`09`09return TRUE;
X`09`7D
X`09return FALSE;
X#else
X`09return TRUE;
X#endif
X`7D
X#endif
X
X/*`09l_itoa:`09integer to ascii string.......... This is too
X`09`09inconsistent to use the system's`09*/
X
Xchar *
Xl_itoa(int i)`09`09/* integer to translate to a string */
X`7B
X`09static char result`5BINTWIDTH+1`5D;`09/*\1707ing string */
X`09(void)lsprintf(result,"%d",i);
X`09return result;
X`7D
X
X
X/* like strtol, but also allow character constants */
X#if OPT_EVAL
Xstatic int
Xl_strtol(const char *s)
X`7B
X`09if (s`5B0`5D == '`5C'' `26`26
X`09    s`5B2`5D == '`5C'' `26`26
X`09    s`5B3`5D == EOS)
X`09    return s`5B1`5D;
X`09return (int)strtol(s, (char **)0, 0);
X`7D
X#endif
X
Xint
Xtoktyp(`09`09`09/* find the type of a passed token */
Xconst char *tokn)`09/* token to analyze */
X`7B
X
X`09/* no blanks!!! */
X`09if (tokn`5B0`5D == EOS)
X`09`09return(TKNUL);
X
X`09/* a numeric literal? */
X`09if (isDigit(tokn`5B0`5D))
X`09`09return(TKLIT);
X
X`09if (tokn`5B0`5D == '"')
X`09`09return(TKSTR);
X
X`09/* if it's any other single char, it must be itself */
X`09if (tokn`5B1`5D == EOS)
X`09`09return(TKCMD);
X
X#if ! SMALLER
X`09switch (tokn`5B0`5D) `7B
X`09`09case '"':`09return(TKSTR);
X
X`09`09case '`7E':`09return(TKDIR);
X`09`09case '@':`09return(TKARG);
X`09`09case '<':`09return(TKBUF);
X`09`09case '$':`09return(TKENV);
X`09`09case '%':`09return(TKVAR);
X`09`09case '`26':`09return(TKFUN);
X`09`09case '*':`09return(TKLBL);
X
X`09`09default:`09return(TKCMD);
X`09`7D
X#else
X`09return(TKCMD);
X#endif
X`7D
X
Xconst char *
Xtokval(`09`09&0209/* find the value of a token */
Xconst char *tokn)`09`09/* token to evaluate */
X`7B
X#if OPT_EVAL
X`09register int status;`09/* error return */
X`09register BUFFER *bp;`09/* temp buffer pointer */
X`09register B_COUNT blen;`09/* length of buffer argument */
X`09register int distmp;`09/* temporary discmd flag */
X`09int`09oclexec;
X`09static char buf`5BNSTRING`5D;/* string buffer for some returns */
X
X`09switch (toktyp(tokn)) `7B
X`09`09case TKNUL:`09return("");
X
X`09`09case TKARG:`09/* interactive argument */
X`09`09&0209`7B
X`09`09&0209static char tkargbuf`5BNSTRING`5D;
X
X`09`09&0209oclexec = \0906;
X
X`09`09&0209distmp = discmd;`09/* echo it always! */
X`09`09&0209discmd = TRUE;
X`09`09&0209clexec = FALSE;
X`09`09&0209status = kbd_string(tokval(`26tokn`5B1`5D), tkargbuf,
X`09`09&0209&0209sizeof(buf), '`5Cn',
X`09`09&0209&0209KBD_EXPAND`7CKBD_QUOTES,
X`09`09&0209&0209no_completion);
X`09`09&0209discmd = distmp;
X`09`09&0209clexec = o\0A06;
X
X`09`09&0209if (status == ABORT)
X`09`09&0209`09return(errorm);
X`09`09&0209return(tkargbuf);
X`09`09&0209`7D
X
X`09`09case TKBUF:`09/* buffer contents fetch */
X
X`09`09&0209/* grab the right buffer */
X`09`09&0209if ((bp = find_b_name(tokval(`26tokn`5B1`5D))) == NULL)
X`09`09&0209`09return(errorm);
X
X`09`09&0209/* if the buffer is displayed, get the window
X`09`09&0209   vars instead of the buffer\1B06*/
X`09`09&0209if (bp->b_nwnd > 0) `7B
X`09`09&0209`09curbp->b_dot = DOT;
X`09`09&0209`7D
X
X`09`09&0209/* make sure we are not at the end */
X`09`09&0209if (is_header_line(bp->b_dot,bp))
X`09`09&0209`09return(errorm);
X
X`09`09&0209/* grab the line as an argument */
X`09`09&0209blen = llength(bp->b_dot.l);
X`09`09&0209if (blen > bp->b_dot.o)
X`09`09&0209`09blen -= bp->b_dot.o;
X`09`09&0209else
X`09`09&0209`09blen = 0;
X`09`09&0209if (blen > NSTRING)
X`09`09&0209`09blen = NSTRING;
X`09`09&0209(void)strncpy(buf,
X`09`09&0209`09bp->b_dot.l->l_text + \160Ao,
X`09`09&0209`09(SIZE_T)blen);
X`09`09&0209buf`5Bblen`5D = (char)EOS;
X
X`09`09&0209/* and step the buffer's line ptr
X`09`09&0209`09ahead a line */
X`09`09&0209bp->b_dot.l = lforw(\140B);
X`09`09&0209bp->b_dot.o = 0;
X
X`09`09&0209/* if displayed buffer, reset window ptr vars*/
X`09`09&0209if (bp->b_nwnd != 0) `7B
X`09`09&0209`09DOT.l = curbp->b_dot.l;
X`09`09&0209`09DOT.o = 0;
X`09`09&0209`09curwp->w_flag `7C= WFMOVE;
X`09`09&0209`7D
X
X`09`09&0209/* and return the spoils */
X`09`09&0209return(buf);
X
X`09`09case TKVAR:`09return(gtusr(tokn+1));
X`09`09case TKENV:`09return(gtenv(tokn+1));
X`09`09case TKFUN:`09return(gtfun(tokn+1));
X`09`09case TKDIR:
X#if SYS_UNIX
X`09`09&0209return(lengthen_path(strcpy(buf,tokn)));
X#else
X`09`09&0209return(errorm);
X#endif
X`09`09case TKLBL:`09return(l_itoa(gtlbl(tokn)));
X`09`09case TKLIT:`09return(tokn);
X`09`09case TKSTR:`09return(tokn+1);
X`09`09case TKCMD:`09return(tokn);
X`09`7D
X`09return errorm;
X#else
X`09return (toktyp(tokn) == TKSTR) ? tokn+1 : tokn;
X#endif
X`7D
X
X/*
X * Return true if the argument is one o\1706strings that we accept as a
X * synonym for "true".
X */
Xint
Xis_truem(const char *val)
X`7B
X`09char`09temp`5B8`5D;
X`09(void)mklower(strncpy0(temp, val, sizeof(temp)));
X`09return (!strcmp(temp, "yes")
X`09   `7C`7C   !strcmp(temp, "true")
X`09   `7C`7C   !strcmp(temp, "t")
X`09   `7C`7C   !strcmp(temp, "y")
X`09   `7C`7C   !strcmp(temp, "on"));
X`7D
X
X/*
X * Return true if the argument is one o\1706strings that we accept as a
X * synonym for "false".
X */
Xint
Xis_falsem(const char *val)
X`7B
X`09char`09temp`5B8`5D;
X`09(void)mklower(strncpy0(temp, val, sizeof(temp)));
X`09return (!strcmp(temp, "no")
X`09   `7C`7C   !strcmp(temp, "false")
X`09   `7C`7C   !strcmp(temp, "f")
X`09   `7C`7C   !strcmp(temp, "n")
X`09   `7C`7C   !strcmp(temp, "off"));
X`7D
X
X#if OPT_EVAL `7C`7C DISP_X11
Xint
Xstol(`09`09`09/* convert a string to a numeric logical */
Xconst char *val)`09/* value to check for stol */
X`7B
X`09/* check for logical values */
X`09if (is_falsem(val))
X`09`09return(FALSE);
X`09if (is_truem(val))
X`09`09return(TRUE);
X
X`09/* check for numeric truth (!= 0) */
X`09return((atoi(val) != 0));
X`7D
X#endif
X
X#if OPT_EVAL
X/* use this as a wrapper when evaluating an array index, etc., that cannot
X * be negative.
X */
Xstatic SIZE_T
Xs2size(char *s)
X`7B
X`09int`09n = atoi(s);
X`09if (n < 0)
X`09`09n = 0;
X`09return n;
X`7D
X
X/* use this to return a pointer to the string after the n-1 first characters *
V/
Xstatic char *
Xs2offset(char *s, \0906n)
X`7B
X`09SIZE_T`09len = strlen(s) + 1;
X`09UINT`09off = s2size(n);
X`09if (off > len)
X`09`09off = len;
X`09if (off == 0)
X`09`09off = 1;
X`09return s + (off - 1);
X`7D
X
X/* ARGSUSED */
Xstatic int
Xgtlbl(`09`09&0209/* find the line number of the given label */
Xconst char *tokn GCC_UNUSED)`09/* label name to find */
X`7B
X`09/* FIXME XXX */
X`09return(1);
X`7D
X
Xstatic char *
Xltos(`09`09/* numeric logical to string\1209*/
Xint val)`09/* value to translate */
X`7B
X`09if (val)
X`09`09return(truem);
X`09else
X`09`09return(falsem);
X`7D
X#endif
X
X#if OPT_EVAL `7C`7C !SMALLER
Xchar *
Xmkupper(`09`09/* make a string upper case */
Xchar *str)`09`09/* string to upper case */
X`7B
X`09char *sp;
X
X`09sp = str;
X`09while (*sp) `7B
X`09`09if (isLower(*sp))
X`09`09`09*sp = toUpper(*sp);
X`09`09++sp;
X`09`7D
X`09return(str);
X`7D
X#endif
X
Xchar *
Xmklower(`09`09/* make a string lower case */
Xchar *str)`09`09/* string to lower case */
X`7B
X`09char *sp;
X
X`09sp = str;
X`09while (*sp) `7B
X`09`09if (isUpper(*sp))
X`09`09`09*sp = toLower(*sp);
X`09`09++sp;
X`09`7D
X`09return(str);
X`7D
X
Xchar *
Xmktrimmed(register char *str)`09/* trim whitespace */
X`7B
X`09char *base = str;
X`09register char *dst = str;
X
X`09while (*str != EOS) `7B
X`09`09if (isSpace(*str)) `7B
X`09`09`09if (dst != base)
X`09`09&0209*dst++ = ' ';
X`09`09`09str = skip_blanks(str);
X`09`09`7D else `7B
X`09`09`09*dst++ = *str++;
X`09`09`7D
X`09`7D
X`09if (dst != base
X`09 `26`26 isSpace(dst`5B-1`5D))
X`09 `09dst--;
X`09*dst = EOS;
X`09return base;
X`7D
X
Xint
Xabsol(int x)`09`09/* take the absolute value of an integer */
X`7B
X`09return(x < 0 ? -x : x);
X`7D
X
X#if OPT_EVAL
Xstatic int
Xernd(void)`09`09/* returns a random integer */
X`7B
X`09seed = absol(seed * 1721 + 10007);
X`09return(seed);
X`7D
X
Xstatic int
Xsindex(`09`09`09/* find pattern within source */
Xconst char *sourc,`09/* source string to search */
Xconst char *pattern)`09/* string to look for */
X`7B
X`09int it = 0;`09`09/* assume no match at all.. */
X`09const char *sp;`09`09/* ptr to current position to scan */
X`09const char *csp;`09/* ptr to source string during comparison */
X`09const char *cp;`09`09/* ptr to place to check for equality */
X
X`09/* scanning through the source string */
X`09sp = sourc;
X`09while (*sp) `7B
X`09`09/* scan through the pattern */
X`09`09cp = pattern;
X`09`09csp = sp;
X`09`09while (*cp) `7B
X`09`09`09if (!eq(*cp, *csp))
X`09`09&0209break;
X`09`09`09++cp;
X`09`09`09++csp;
X`09`09`7D
X
X`09`09/* was it a match? */
X`09`09if (*cp == 0) `7B
X`09`09`09it = (int)(sp - sourc) + 1;
X`09`09`09break;
X`09`09`7D
X`09`09++sp;
X`09`7D
X
X`09return(it);
X`7D
X
X#endif /* OPT_EVAL */
X
X#if NO_LEAKS
Xvoid
Xev_leaks(void)
X`7B
X#if OPT_EVAL
X`09register UVAR *p;
X`09while ((p = user_vars) != 0) `7B
X`09`09user_vars = p->next;
X`09`09free(p->u_value);
X`09`09free(p->u_name);
X`09`09free((char *)p);
X`09`7D
X`09FreeAndNull(shell);
X`09FreeAndNull(directory);
X#if DISP_X11
X`09FreeAndNull(x_display);
X`09FreeAndNull(x_shell);
X#endif
X#endif
X`7D
X#endif`09/* NO_LEAKS */
$ call unpack [.VILE-8_0]EVAL.C;1 -
 258408512 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 71 37 152
$!
$ create 'f'
X/*`09This file is for functions dealing with execution of
X *`09commands, \0A07 lines, buffers, files and startup\1206
X *
X *`09written 1986 by Daniel Lawrence
X *`09much modified since then.  assign no blame to him.  -pgf
X *
X * $Header: /usr/build/vile/vile/RCS/exec.c,v 1.161 1998/05/29 00:53:00 tom Ex
Vp $
X *
X */
X
X#include`09"estruct.h"
X#include`09"edef.h"
X#include`09"nefunc.h"
X
X/*`09Directive definitions`09*/
X
Xtypedef`09enum `7B
X`09D_UNKNOWN,
X#if ! SMALLER
X`09D_IF,
X`09D_ELSEIF,
X`09D_ELSE,
X`09D_ENDIF,
X`09D_GOTO,
X`09D_RETURN,
X`09D_WHILE,
X`09D_ENDWHILE,
X`09D_BREAK,
X`09D_FORCE,
X#endif
X`09D_ENDM
X`7D DIRECTIVE;
X
X#define isSPorTAB(c) ((c) == ' ' `7C`7C (\0E07`5Ct')
X
Xstatic`09int`09rangespec(const char *specp, LINEPTR *fromline\140Cto\1207CMDFL
VAGS *flagp);
X
X/*`09The !WHILE directive in the execution language needs to
X`09stack references to pending whiles. These are stored linked
X`09to each currently open procedure via a linked list of
X`09the following structure
X*/
X
Xtypedef struct WHBLOCK `7B
X`09LINEPTR`09w_begin;`09/* ptr to !while statement */
X`09LINEPTR`09w_end;`09`09/* ptr to the !endwhile statement*/
X`09DIRECTIVE w_type;`09/* block type */
X`09struct WHBLOCK *w_next;`09/* next while */
X`7D WHBLOCK;
X
X/* directive name table:
X`09This holds the names of all the directives....`09*/
X
X#if !SMALLER
Xstatic`09const struct `7B
X`09`09const DIRECTIVE type;
X`09`09const char *\0C06name;
X`09`7D dname`5B`5D = `7B
X`09`7B D_IF,       "if" `7D,
X`09`7B D_ELSEIF,   "elseif" `7D,
X`09`7B D_ELSE,     "else" `7D,
X`09`7B D_ENDIF,    "endif" `7D,
X`09`7B D_GOTO,     "goto" `7D,
X`09`7B D_RETURN,   "return" `7D,
X`09`7B D_WHILE,    "while" `7D,
X`09`7B D_ENDWHILE, "endwhile" `7D,
X`09`7B D_BREAK,    "break" `7D,
X`09`7B D_FORCE,    "force" `7D,
X`09`7B D_ENDM,     "endm" `7D
X`09`7D;
X#endif
X
Xstatic int token_ended_line;  /* did the last\2306 end at end of line? */
X
Xtypedef struct `7B
X`09int disabled;`09`09/* nonzero to \1907 execution */
X`09int level;`09`09/* `7Eif ... `7Eendif nesting\2206 */
X`09int fired;`09`09/* at top-level, `7Eif/... used */
X`09`7D IFSTK;
X
Xstatic IFSTK ifstk;
X
X/*--------\0808\1010\2020\400C*/
X
X/*ARGSUSED*/
Xstatic int
Xeol_range(const char * buffer, unsigned cpos, int c\0706eolchar GCC_UNUSED)
X`7B
X`09if (is_edit_char(c))
X`09`09return FALSE;
X
X`09if (isspecial(c)`09/* sorry, cannot scroll with arrow keys */
X`09 `7C`7C isCntrl(c))
X`09`09return TRUE;
X
X`09if (islinespecchar(c)
X`09 `7C`7C (c == ':' `26`26 (cpos == 0 &027C buffer`5Bcpos-1`5D == c))
X`09 `7C`7C /* special test for 'a style mark references */
X`09`09(cpos != 0
X`09`09`26`26 buffer`5Bcpos-1`5D == '`5C''
X`09`09`26`26 (isLower(c) `7C`7C (c == '`5C'') ) ) )
X`09`09return FALSE;
X`09return TRUE;
X`7D
X
X/*
X * Returns true iff the user ended the last prompt with a carriage-return.
X */
Xstatic int
Xend_of_cmd(void)
X`7B
X`09register int c = end_string();
X`09return is\0906(c);
X`7D
X
X/* returns true iff we are in a named-command and if the user ended the last
X * prompt with a carriage-return.
X */
Xint
Xend_named_cmd(void)
X`7B
X`09if (isnamedcmd) `7B
X`09`09if (clexec)
X`09`09`09return token_ended_line;
X`09`09else
X`09`09`09return end_of_cmd();
X`09`7D
X`09return FALSE;
X`7D
X
X/* returns true iff we are in a named-command and if the user did not end the
V
X * last prompt with a carriage-return.
X */
Xint
Xmore_named_cmd(void)
X`7B
X`09if (isnamedcmd) `7B
X`09`09if (clexec)
X`09`09`09return !token_ended_line;
X`09`09else
X`09`09`09return !end_of_cmd();
X`09`7D
X`09return FALSE;
X`7D
X
X/* namedcmd:`09execute a\1406 command even if it is not bound */
X#if SMALLER
X#define execute_named_command namedcmd
X#else
Xstatic`09/* next procedure is local */
X#endif
X
Xint
Xexecute_named_command(int f, int n)
X`7B
X`09register int`09status;
X`09register const CMDFUNC *cfp; /* function to execute */
X`09register char *fnp;`09/* ptr to the name of the cmd to exec */
X
X`09LINEPTR fromline;`09/* first linespec */
X`09LINEPTR toline;`09`09/* second linespec */
X`09MARK`09save_DOT;
X`09MARK`09last_DOT;
X`09static TBUFF *lspec;`09/* text of line spec */
X`09char cspec`5BNLINE`5D;`09/* text of command spec */
X`09int cmode = 0;
X`09int c;
X`09char repeat_cmd = EOS;
X`09int maybe_reg,\0B07num;
X`09CMDFLAGS lflag, flags;
X
X`09tb_scopy(`26lspec, "");
X`09last_DOT = DOT;
X
X`09/* prompt the user to type a named command */
X`09mlprompt(": ");
X
X`09/* and now get the function name to execute */
X`09for_ever `7B
X`09`09if (cmode == 0) `7B`09/* looking for range-spec, if any */
X`09`09`09status = kbd_reply(
X`09`09&0209(char *)0,`09/* no-prompt => splice */
X`09`09&0209`26lspec,&0209/* in/out buffer */
X`09`09&0209eol_range,
X`09`09&0209EOS,&0209/* may be a conflict */
X`09`09&02090,&0209/* no expansion, etc. */
X`09`09&0209no_completion);
X`09`09`09c = end_string();
X`09`09`09if (status != TRUE `26`26 \120AFALSE) `7B
X`09`09&0209if (status == SORTOFTRUE) `7B
X`09`09&0209`09(void)keystroke(); /* cancel ungetc */
X`09`09&0209`09return FALSE;
X`09`09&0209`7D
X`09`09&0209return status;
X`09`09`09`7D else if (isreturn(c) `26`26 (status == FALSE)) `7B
X`09`09&0209return FALSE;
X`09`09`09`7D else `7B
X`09`09&0209unkeystroke(c);`09/* ...so we can splice */
+-+-+-+-+-+-+-+-  END  OF PART 49 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 50 -+-+-+-+-+-+-+-+
X`09`09`09`7D
X`09`09`09cmode = 1;
X`09`09`09repeat_cmd = EOS;
X`09`09`7D else `7B&0209`09/* looking for command-name */
X`09`09`09fnp = NULL;
X`09`09`09status = kbd_engl_stat((char *)0, cspec, KBD_STATED);
X`09`09`09if (status == TRUE) `7B
X`09`09&0209fnp = cspec;
X#if !SMALLER
X`09`09&0209if (isRepeatable(*fnp) `26`26 clexec) `7B
X`09`09&0209`09repeat_cmd = *fnp;
X`09`09&0209`09cmode++;
X`09`09&0209`09hst_glue(EOS);
X`09`09&0209`7D else
X#endif
X`09`09&0209 if (isRepeatable(*fnp) `26`26 (*fnp == end_string())) `7B
X`09`09&0209`09unkeystroke(*fnp);
X`09`09&0209`09repeat_cmd = *fnp;
X`09`09&0209`09cmode++;
X`09`09&0209`09hst_glue(EOS);
X`09`09&0209`7D else `7B
X`09`09&0209`09c = fnp`5Bstrlen(fnp)-1`5D;
X`09`09&0209`09if (isPunct(c)) `7B
X`09`09&0209&0209c = end_string();
X`09`09&0209&0209if (c != NAMEC
X`09`09&0209&0209 `26`26 c != ' '
X`09`09&0209&0209 `26`26 !isreturn(c)) `7B
X`09`09&0209&0309unkeystroke(c);
X`09`09&0209&0309/* e.g., !-command */
X`09`09&0209&0209 `7D
X`09`09&0209`09`7D else `7B`09/* e.g., ":e#" */
X`09`09&0209&0209c = end_string();
X`09`09&0209&0209if (isPunct(c)
X`09`09&0209&0209 `26`26 strchr(global_g_val_ptr(GVAL_EXPAND_CHARS),c) != 0)
X`09`09&0209&0309unkeystroke(c);
X`09`09&0209`09`7D
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09`09`7D else if (status == SORTOFTRUE) `7B
X`09`09&0209hst_remove((cmode > 1) ? "*" : "");
X`09`09&0209if (cmode > 1)
X`09`09&0209`09(void)keystroke(); /* eat the delete */
X`09`09&0209if (--cmode <= 1) `7B
X`09`09&0209`09cmode = 0;
X`09`09&0209`09hst_remove(tb_values(lspec));
X`09`09&0209`7D
X`09`09`09`7D else if ((status == ABORT) `7C`7C (lastkey == killc)) `7B
X`09`09&0209return status;
X`09`09`09`7D else `7B`09/* status == FALSE (killc/wkillc) */
X`09`09&0209if (cmode > 1) `7B
X`09`09&0209`09fnp = cspec;
X`09`09&0209`09cmode--;
X`09`09&0209`09break;
X`09`09&0209`7D else `7B
X`09`09&0209`09if (tb_length(lspec) <= 1) `7B
X`09`09&0209&0209return status;
X`09`09&0209`09`7D else `7B
X`09`09&0209&0209break;`09/* range-only */
X`09`09&0209`09`7D
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`7D
X`09`7D
X
X`09/* reconstruct command if user edited it */
X`09if (repeat_cmd != EOS `26`26 fnp != 0 &0226 *fnp == EOS) `7B
X`09`09fnp`5B0`5D = repeat_cmd;
X`09`09fnp`5B1`5D = EOS;
X`09`7D
X
X`09/* infer repeat count from\1207ed-command */
X`09if (cmode > 1) `7B
X`09`09if (!f) `7B
X`09`09`09f = TRUE;
X`09`09`09n = cmode;
X`09`09`7D else `7B
X`09`09`09mlforce("`5BRedundant repeat-count`5D");
X`09`09`09return FALSE;
X`09`09`7D
X`09`7D
X
X`09/* parse the accumulated lspec */
X`09if (rangespec(tb_values(lspec), `26fromline, `26to\0907lflag) != TRUE) `7B
V
X`09`09mlforce("`5BImproper line range`5D");
X`09`09return FALSE;
X`09`7D
X
X`09/* if range given, and it wasn't "0" and the buffer's empty */
X`09if (!(lflag `26 (DFLALL`7CZERO)) `26`26 is_empty_buf(curbp)) `7B
X`09`09mlforce("`5BNo range possible in empty buffer`5D", fnp);
X`09`09return FALSE;
X`09`7D
X
X`09/* did we get a name? */
X`09if (fnp == NULL) `7B
X`09`09if ((lflag `26 DFLALL)) `7B /* no range, no function */
X`09`09`09return FALSE;
X`09`09`7D else `7B /* range, no function */
X`09`09`09cfp = `26f_gomark;
X`09`09`09fnp = "";
X`09`09`7D
X`09`7D else if ((cfp = engl2fnc(fnp)) == NULL) `7B /* bad function */
X`09`09return no_such_function(fnp);
X`09`7D
X
X`09ev_end_of_cmd = \0D0A();
X`09flags = cfp->c_flags;
X
X`09/* bad arguments? */
X#ifdef EXRC_FILES
Xseems like we need one more check here -- is it from a .exrc file?
X`09    cmd not ok in .exrc `09`09empty file
X`09if (!(flags `26 EXRCOK) `26`26 is_empty_buf(curbp)) `7B
X`09`09mlforce("`5BCan't use the `5C"%s`5C" command in a %s file.`5D",
X`09`09&0209`09cmdnames`5Bcmdidx`5D.name, EXRC);
X`09`09return FALSE;
X`09`7D
X#endif
X
X`09/* was: if (!(flags `26 (ZERO `7C EXRCOK)) `26`26 fromline == NULL ) */
X`09if ((lflag `26 ZERO)) `7B
X`09`09if (!(flags `26 ZERO)) `7B
X`09`09`09mlforce("`5BCan't use address 0 with `5C"%s`5C" command`5D", fnp);
X`09`09`09return FALSE;
X`09`09`7D
X`09`09if (fromline == null_ptr)
X`09`09`09fromline = buf_head(curbp); /* buffer is empty */
X
X`09`09/*  we're positioned at fromline == curbp->b_linep, so commands
X`09`09`09must be willing to go _down_ from there.  Seems easiest
X`09`09`09to special case the commands that prefer going up */
X`09`09if (cfp == `26f_insfile) `7B
X`09`09`09/* EMPTY */ /* works okay, or acts down normally */ ;
X`09`09`7D else if (cfp == `26f_lineputafter) `7B
X`09`09`09cfp = `26f_lineputbefore;
X`09`09`09fromline = lforw(\1108);
X`09`09`7D else if (cfp == `26f_opendown) `7B
X`09`09`09cfp = `26f_openup;
X`09`09`09fromline = lforw(\1108);
X`09`09`7D else if (cfp == `26f_gomark) `7B
X`09`09`09fromline = lforw(\1108);
X`09`09`7D else `7B
X`09`09`09mlforce("`5BConfiguration error: ZERO`5D");
X`09`09`09return FALSE;
X`09`09`7D
X`09`09flags = cfp->c_flags;
X`09`09toline = fromline;
X`09`7D
X
X`09/* if we're not supposed to have a line no., and the \1208 isn't
X`09`09the current line, and there's more than one line */
X`09if (!(flags `26 FROM) `26`26 (fromline != DOT.l) &0226
X`09`09`09!is_empty_buf(curbp) `26`26
X`09`09  (lforw\0606(buf_head(curbp))) != \1510 ) `7B
X`09`09mlforce("`5BCan't use address with `5C"%s`5C" command.`5D", fnp);
X`09`09return FALSE;
X`09`7D
X`09/* if we're not supposed to have a second line no., and the \1208
X`09`09isn't the same as the first line no., and there's more than
X`09`09one line */
X`09if (!(flags `26 TO) `26`26 (toline != fromline) &0226
X`09`09`09!is_empty_buf(curbp) `26`26
X`09`09  (lforw\0606(buf_head(curbp))) != \1510 ) `7B
X`09`09mlforce("`5BCan't use a range with `5C"%s`5C" command.`5D", fnp);
X`09`09return FALSE;
X`09`7D
X
X`09/* some commands have special default ranges */
X`09if (lflag `26 DFLALL) `7B
X`09`09if (flags `26 DFLALL) `7B
X`09`09`09if (cfp == `26f_showlength) `7B
X`09`09&0209fromline = lforw(buf_head(curbp));
X`09`09&0209toline   = lback(buf_head(curbp));
X`09`09`09`7D else if (cfp == `26f_operwrite) `7B
X`09`09&0209cfp = `26f_filewrite;
X`09`09`09`7D else if (cfp == `26f_operglobals) `7B
X`09`09&0209cfp = `26f_globals;
X`09`09`09`7D else if (cfp == `26f_opervglobals) `7B
X`09`09&0209cfp = `26f_vglobals;
X`09`09`09`7D else `7B
X`09`09&0209mlforce("`5BConfiguration error: DFLALL`5D");
X`09`09&0209return FALSE;
X`09`09`09`7D
X`09`09`09lflag `7C= (FROM`7CTO); /* avoid prompt for line-count */
X`09`09`7D else if (flags `26 DFLNONE) `7B
X#if OPT_SHELL
X`09`09`09if (cfp == `26f_operfilter) `7B
X`09`09&0209cfp = `26f_spawn;
X`09`09&0209(void)setmark();  /* not that it matters */
X`09`09`09`7D else
X#endif
X#if OPT_PERL
X`09`09`09if (cfp == `26f_perl) `7B
X`09`09&0209perl_default_region();
X`09`09`09`7D else
X#endif
X`09`09`09`7B
X`09`09&0209mlforce("`5BConfiguration error: DFLNONE`5D");
X`09`09&0209return FALSE;
X`09`09`09`7D
X`09`09`09fromline = to\0907null_ptr;
X`09`09`09lflag `7C= (FROM`7CTO); /* avoid prompt for line-count */
X`09`09`7D else
X`09`09`09lflag `26= `7EDFLALL;
X`09`7D
X
X`09/* Process argument(s) for named-buffer `26 line-count, if present.  The
X`09 * line-count is expected only if no "to" address specification was
X`09 * given.
X`09 */
X`09if ((*fnp != EOS) `26`26 !end_of_cmd(\1106isPunct(end_string())) `7B
X`09`09maybe_reg = ((flags `26 OPTREG) == \0B07;
X`09`09maybe_num = ((flags `26 TO) == TO)
X`09`09`09`26`26 !((lflag `26 TO) == TO);
X`09`09if (maybe_num `26`26 (lflag `26 FROM)) `7B
X`09`09`09toline = fromline;
X`09`09`09maybe_num = FALSE;
X`09`09`7D
X`09`7D else `7B
X`09`09maybe_reg =
X`09`09maybe_num = FALSE;
X`09`7D
X
X`09if (maybe_reg `7C`7C \0D06num) `7B
X`09`09int`09num,
X`09`09`09that = (maybe_num `26`26 \0D06reg)
X`09`09&0209? 0
X`09`09&0209: (maybe_num ? 1 : -1),
X`09`09`09last = maybe_num ? 2 : 1;
X
X`09`09while (!end_of_cmd() `26`26 (that < last)) `7B
X`09`09`09status = mlreply_reg_count(that, `26num, `26that);
X`09`09`09if (status == ABORT)
X`09`09&0209return status;
X`09`09`09else if (status != TRUE)
X`09`09&0209break;
X`09`09`09if (that == 2) `7B
X`09`09&0209if (is_empty_buf(curbp)) `7B
X`09`09&0209    mlforce(
X`09`09`09    "`5BNo line count possible in empty buffer`5D", fnp);
X`09`09&0209    return FALSE;
X`09`09&0209`7D
X`09`09&0209swapmark();
X`09`09&0209DOT.l = fromline;
X`09`09&0209(void)forwline(TRUE, num-1);
X`09`09&0209toline = DOT.l;
X`09`09&0209swapmark();
X`09`09`09`7D else `7B
X`09`09&0209ukb = (short)num;
X`09`09&0209kregflag = (that == 1) ? KAPPEND : 0;
X`09`09&0209that = 1;
X`09`09&0209/* patch: need to handle recursion */
X`09`09`09`7D
X`09`09`7D
X`09`7D
X
X`09if (flags `26 NOMOVE)
X`09`09save_DOT = DOT;
X`09else if ((toline != null_ptr) `7C`7C (from\1A11) `7B
X`09`09/* assume it's an absolute motion */
X`09`09/* we could probably do better */
X`09`09curwp->w_lastdot = DOT;
X`09`7D
X`09if ((toline != null_ptr) `26`26 (flags `26 TO)) `7B
X`09`09DOT.l = toline;
X`09`09(void)firstnonwhite(FALSE,1);
X`09`09(void)setmark();
X`09`7D
X`09if ((fromline != null_ptr) `26`26 (flags `26 FROM)) `7B
X`09`09DOT.l = fromline;
X`09`09(void)firstnonwhite(FALSE,1);
X`09`09if (toline == null_ptr)
X`09`09`09(void)setmark();
X`09`7D
X`09if (!sameline(last_DOT, DOT))
X`09`09curwp->w_flag `7C= WFMOVE;
X
X`09/* and then execute the command */
X`09isnamedcmd = TRUE;
X`09havemotion = `26f_gomark;
X`09regionshape = FULLLINE;
X
X`09/* if the command ended with a bang, let the function know
X`09`09that so it can take special action */
X`09if ((flags `26 BANG) `26`26 (fnp`5Bstrlen(fnp)-1`5D == '!')) `7B
X`09`09f = TRUE;
X`09`09n = SPECIAL_BANG_ARG;
X`09`7D
X
X`09/*
X`09 * Ensure that we've completed the command properly.  (We could make
X`09 * the same check after 'execute()', but that would tend to obscure
X`09 * informational/warning messages...).
X`09 */
X`09if (flags == NONE
X`09 `26`26 end_string() != ' '
X`09 `26`26 !end_of_cmd()) `7B
X`09`09status = FALSE;
X`09`09if (!mapped_c_avail())
X`09`09`09unkeystroke(end_string());
X`09`09c = kbd_seq();
X`09`09mlforce("`5BExtra characters after `5C"%s`5C" command`5D", fnp);
X`09`7D else `7B
X`09`09status = execute(cfp,f,n);
X`09`7D
X
X`09havemotion = NULL;
X`09isnamedcmd = FALSE;
X`09regionshape = EXACT;
X
X`09/* don't use this if the command modifies! */
X`09if (flags `26 NOMOVE) `7B
X`09`09if (!samepoint(DOT, save_DOT)) `7B
X`09`09`09DOT = save_DOT;
X`09`09`09/* if an update() was called somewhere along
X`09`09`09   the way (as a result of mlyesno, for instance),
X`09`09`09   then we _have_ moved, so resetting DOT to
X`09`09`09   it's first value constitutes another one. */
X`09`09`09/* i think at worst this means an extra call to
X`09`09`09   reframe...  */
X`09`09`09curwp->w_flag `7C= WFMOVE;
X`09`09`7D
X`09`7D
X
X`09return status;
X`7D
X
X#if !SMALLER
X/* intercept calls on 'namedcmd()' to allow logging of all commands, even
X * those that have errors in them.
X */
Xint
Xnamedcmd(int f, int n)
X`7B
X`09int status;
X`09hst_init(EOS);
X`09status = execute_named_command(f,n);
X`09hst_flush();
X`09return status;
X`7D
X#endif
X
X/* parse an ex-style line spec -- code culled from elvis, file ex.c, by
X`09Steve Kirkendall
X*/
Xstatic const char *
Xlinespec(
Xregister const char`09*s,`09/* start of the line specifier */
XLINEPTR`09`09*markptr)`09/* where to store the mark's value */
X`7B
X`09int`09`09num;
X`09LINE`09`09*lp;`09/* where the linespec takes us */
X`09register const char *t;
X`09int`09`09status;
X
X`09(void)setmark();
X`09lp = NULL;
X
X`09/* parse each ;-delimited clause of this linespec */
X`09do `7B
X`09`09/* skip an initial ';', if any */
X`09`09if (*s == ';')
X`09`09`09s++;
X
X`09`09/* skip leading spaces */
X`09`09while (isSPorTAB(*s))
X`09`09`09s++;
X
X`09`09/* dot means current position */
X`09`09if (*s == '.') `7B
X`09`09`09s++;
X`09`09`09lp = DOT.l;
X`09`09`7D else if (*s == '$') `7B /* '$' means the last line */
X`09`09`09s++;
X`09`09`09status = gotoeob(TRUE,1);
X`09`09`09if (status) lp = DOT.l;
X`09`09`7D else if (isDigit(*s)) `7B
X`09`09`09/* digit means an absolute line number */
X`09`09`09for (num = 0; isDigit(*s); s++) `7B
X`09`09&0209num = num * 10 + *s - '0';
X`09`09`09`7D
X`09`09`09status = gotoline(TRUE,num);
X`09`09`09if (status) lp = DOT.l;
X`09`09`7D else if (*s == '`5C'') `7B
X`09`09`09/* apostrophe means go to a set mark */
X`09`09`09s++;
X`09`09`09status = gonmmark(*s);
X`09`09`09if (status) lp = DOT.l;
X`09`09`09s++;
X`09`09`7D else if (*s == '+') `7B
X`09`09`09s++;
X`09`09`09for (num = 0; isDigit(*s); s++)
X`09`09&0209num = num * 10 + *s - '0';
X`09`09`09if (num == 0)
X`09`09&0209num++;
X`09`09`09while (*s == '+')
X`09`09&0209s++, num++;
X`09`09`09status = forwline(TRUE,num);
X`09`09`09if (status)
X`09`09&0209lp = DOT.l;
X`09`09`7D else if (*s == '-') `7B
X`09`09`09s++;
X`09`09`09for (num = 0; isDigit(*s); s++)
X`09`09&0209`09num = num * 10 + *s - '0';
X`09`09`09if (num == 0)
X`09`09&0209num++;
X`09`09`09while (*s == '-')
X`09`09&0209s++, num++;
X`09`09`09status = forwline(TRUE,-num);
X`09`09`09if (status)
X`09`09&0209lp = DOT.l;
X`09`09`7D
X#if PATTERNS
X`09`09else if (*s == '/' `7C`7C \0D07?') `7B /* slash means do a search */
X`09`09`09/* put a null at the end of the search pattern */
X`09`09`09t = parseptrn(s);
X
X`09`09`09/* search for the pattern */
X`09`09`09lp `26= `7E(BLKSIZE - 1);
X`09`09`09if (*s == '/') `7B
X`09`09&0209pfetch(markline(lp));
X`09`09&0209if (plen > 0)
X`09`09&0209`09lp += plen - 1;
X`09`09&0209lp = m_fsrch(lp, s);
X`09`09`09`7D else `7B
X`09`09&0209lp = m_bsrch(lp, s);
X`09`09`09`7D
X
X`09`09`09/* adjust command string pointer */
X`09`09`09s = t;
X`09`09`7D
X#endif
X`09`09else if (*s == EOS) `7B`09/* empty string matches '.' */
X`09`09`09lp = DOT.l;
X`09`09`7D
X
X`09`09/* if linespec was faulty, quit now */
X`09`09if (!lp) `7B
X`09`09`09*markptr = lp;
X`09`09`09swapmark();
X`09`09`09return s;
X`09`09`7D
X
X`09`09/* maybe add an offset */
X`09`09t = s;
X`09`09if (*t == '-' `7C`7C \0D07+') `7B
X`09`09`09s++;
X`09`09`09for (num = 0; isDigit(*s); s++) `7B
X`09`09&0209num = num * 10 + *s - '0';
X`09`09`09`7D
X`09`09`09if (num == 0)
X`09`09&0209num = 1;
X`09`09`09if (forwline(TRUE, (*t == '+') ? num : -num) == TRUE)
X`09`09&0209lp = DOT.l;
X`09`09`7D
X`09`7D while (*s == ';' `7C`7C \0D07+\0D0C-');
X
X`09*markptr = lp;
X`09swapmark();
X`09return s;
X`7D
X
X/* parse an ex-style line range -- code culled from elvis, file ex.c, by
X`09Steve Kirkendall
X*/
Xstatic int
Xrangespec(
Xconst char`09*specp,`09`09/* string containing a line range */
XLINEPTR`09`09*fromlinep,`09/* first linespec */
XLINEPTR`09`09*tolinep,`09/* second linespec */
XCMDFLAGS`09*flagp)
X`7B
X`09register const char *scan;`09/* used to scan thru specp */
X`09LINEPTR`09`09fromline;`09/* first linespec */
X`09LINEPTR`09`09toline;&0209/* second linespec */
X
X`09*flagp = 0;
X
X`09/* ignore command lines that start with a double-quote */
X`09if (*specp == '"') `7B
X`09`09*fromlinep = *to\0B08DOT.l;
X`09`09return TRUE;
X`09`7D
X
X`09/* permit extra colons at the start of the line */
X`09while (isSPorTAB(*specp) `7C`7C \0B06 == ':') `7B
X`09`09specp++;
X`09`7D
X
X`09/* parse the line specifier */
X`09scan = specp;
X`09if (*scan == '0') `7B
X`09`09fromline = to\0907buf_head(curbp); /* _very_ top of buffer */
X`09`09*flagp `7C= (FROM`7CZERO);
X`09`09scan++;
X`09`7D else if (*scan == '%') `7B
X`09`09/* '%' means all lines */
X`09`09fromline = lforw(buf_head(curbp));
X`09`09toline = lback(buf_head(curbp));
X`09`09scan++;
X`09`09*flagp `7C= (FROM`7CTO);
X`09`7D else `7B
X`09`09scan = linespec(scan, `26toline);
X`09`09*flagp `7C= FROM;
X`09`09if (toline == null_ptr)
X`09`09`09fromline = DOT.l;
X`09`09fromline = toline;
X`09`09while (*scan == ',') `7B
X`09`09`09fromline = toline;
X`09`09`09scan++;
X`09`09`09scan = linespec(scan, `26toline);
X`09`09`09*flagp `7C= TO;
X`09`09`09if (toline == null_ptr) `7B
X`09`09&0209/* faulty line spec */
X`09`09&0209return FALSE;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X
X`09if (is_empty_buf(curbp))
X`09`09fromline = to\0907null_ptr;
X
X`09if (scan == specp)
X`09`09*flagp `7C= DFLALL;
X
X`09/* skip whitespace */
X`09while (isSPorTAB(*scan))
X`09`09scan++;
X
X`09if (*scan) `7B
X`09`09/* dbgwrite("crud at end %s (%s)",specp, scan); */
X`09`09return FALSE;
X`09`7D
X
X`09*fromlinep = \0C08;
X`09*tolinep = \0A06;
X
X`09return TRUE;
X`7D
X
X/*`09docmd:`09take a passed string as a command line and translate
X`09`09it to be executed as a command. This function will be
X`09`09used by execute-command-line and by all source and
X`09`09startup files.
X
X`09format of the command line is:
X
X`09`09`7B# arg`7D <command-name> `7B<argument string(s)>`7D
X
X*/
X
Xint
Xdocmd(
Xchar *cline,`09/* command line to execute */
Xint execflag,
Xint f, int n)
X`7B
X`09int status;`09`09/* return\1307 of function */
X`09int oldcle;`09`09/* old contents of clexec flag */
X`09const char *oldestr;`09/* original exec string */
X`09char tkn`5BNSTRING`5D;`09/* next token off of command line */
X`09const CMDFUNC *cfp;
X
X`09set_end_string(EOS);
X`09oldestr = execstr;`09/* save last ptr to string to execute */
X`09execstr = cline;`09/* and set this one as current */
X
X`09do `7B
X`09`09if ((status = macarg(tkn)) != TRUE) `7B`09/* grab first token */
X`09`09`09execstr = oldestr;
X`09`09`09return status;
X`09`09`7D
X`09`09if (*tkn == ':') `7B`09/* allow leading ':' on line */
X`09`09`09register int j;
X`09`09`09for (j = 0; (tkn`5Bj`5D = tkn`5Bj+1`5D) != EOS; j++)
X`09`09&0209;
X`09`09`7D
X`09`7D while (!*tkn);
X
X`09/* process leading argument */
X`09if (toktyp(tkn) != TKCMD) `7B
X`09`09f = TRUE;
X`09`09n = atoi(strcpy(tkn, tokval(tkn)));
X
X`09`09/* and now get the command to execute */
X`09`09if ((status = macarg(tkn)) != TRUE) `7B
X`09`09`09execstr = oldestr;
X`09`09`09return status;
X`09`09`7D
X`09`7D
X
X`09/* and match the token to see if it exists */
X`09if ((cfp = engl2fnc(tkn)) == NULL) `7B
X`09`09execstr = oldestr;
X`09`09return no_such_function(tkn);
X`09`7D
X
X`09/* save the arguments and go execut\1D06command */
X`09oldcle = clexec;`09`09/* save old\1507 flag */
X`09clexec = execflag;`09`09/* in cline execution */
X`09/* flag the first time through for some commands -- e.g. subst
X`09`09must know to not prompt for strings again, and pregion
X`09`09must only restart the p-lines buffer once for each
X`09`09command. */
X`09calledbefore = FALSE;
X`09status = execute(cfp,f,n);
X`09cmdstatus = \0906;`09`09/* save the \1E07*/
X`09clexec = oldcle;`09`09/* restore \1D07flag */
X`09execstr = oldestr;
X`09return status;
X`7D
X
X/*
X *  Call the appropriate action for a given CMDFUNC
X */
Xint
Xcall_cmdfunc(const CMDFUNC *p, int f\0706n)
X`7B
X    switch (p->c_flags `26 CMD_TYPE)
X    `7B
X    case CMD_FUNC: /* normal CmdFunc */
X`09return (p->cu.c_func)(f, n);
X
X#if OPT_NAMEBST
X#if OPT_PROCEDURES
X    case CMD_PROC: /* named procedure */
X`09return dobuf(p->cu.c_buff);
X#endif
X
X#if OPT_PERL
X    case CMD_PERL: /* perl subroutine */
X`09return perl_call_sub(p->cu.c_perl, p->c_flags `26 OPER, f, n);
X#endif
X#endif /* OPT_NAMEBST */
X    `7D
X
X    mlforce("BUG: invalid CMDFUNC type");
X    return FALSE;
X`7D
X
X/*
X * This is the general command execution routine. It takes care of checking
X * flags, globals, etc, to be sure we're not doing something dumb.
X * Return the status of command.
X */
X
Xint
Xexecute(
Xconst CMDFUNC *execfunc,`09/* ptr to function to execute */
Xint f, int n)
X`7B
X`09register int status;
X`09register CMDFLAGS flags;
X
X`09if (execfunc == NULL) `7B
X#if OPT_REBIND
X`09`09mlwarn("`5BKey not bound`5D");`09/* complain&0209*/
X#else
X`09`09mlwarn("`5BNot a command`5D");`09/* complain&0209*/
X#endif
X`09`09return FALSE;
X`09`7D
X
X`09flags = execfunc->c_flags;
X
X`09/* commands following operators can't be redone or undone */
X`09if ( !doingopcmd `26`26\0F07sweep) `7B
X`09`09/* don't record non-redoable cmds, */
X`09`09/* but if we're in insertmode, it's okay, since we must
X`09`09`09be executing a function key, like an arrow key,
X`09`09`09that the user will want to have replayed later */
X`09`09if ((curwp == NULL `7C`7C !insertmode) `26`26 (flags `26 REDO) == 0)
X`09`09`09dotcmdstop();
X`09`09if (flags `26 UNDO) `7B
X`09`09`09/* undoable command can't be permitted when read-only */
X`09`09`09if (!(flags `26 VIEWOK)) `7B
X`09`09&0209if (b_val(curbp,MDVIEW))
X`09`09&0209`09return rdonly();
X#ifdef MDCHK_MODTIME
X`09`09&0209if (!b_is_changed(curbp) `26`26
X`09`09&0209`09!ask_shouldchange(curbp))
X`09`09&0209`09return FALSE;
X#endif
X`09`09`09`7D
X`09`09`09if (!kbd_replaying(FALSE))
X`09`09&0209mayneedundo();
X`09`09`7D
X`09`7D
X
X`09if (dotcmdmode != PLAY) `7B
X`09`09if (execfunc != `26f_dotcmdplay) `7B
X`09`09`09/* reset dotcmdkreg on any command where ukb is
X`09`09`09 * unspecified.  usekreg() does it on the one's
X`09`09`09 * where it is specified.  */
X`09`09`09if (ukb == 0)
X`09`09`09    dotcmdkreg = 0;
X
X`09`09`09/* override the saved dot-cmd argument, if this
X`09`09&0209is a new redoable command */
X`09`09`09if (flags `26 REDO)
X`09`09`09    dotcmdarg = FALSE;
X`09`09`7D
X`09`7D else `7B
X`09`09/* if we _are_ playing, re-use the previously kreg */
X`09`09if (dotcmdkreg != 0)
X`09`09`09ukb = dotcmdkreg;
X`09`7D
X
X`09if (curwp->w_tentative_lastdot.l == null_ptr)
X`09`09curwp->w_tentative_lastdot = DOT;
X
X`09status = call_cmdfunc(execfunc, f, n);
X`09if ((flags `26 GOAL) == 0) `7B /* goal should not be retained */
X`09`09curgoal = -1;
X`09`7D
X
X`09/* if motion was absolute, and it wasn't just on behalf of an
X`09`09operator, and we moved, update the "last dot" mark */
X`09if ((flags `26 ABSM) `26`26 !doingopcmd &0226
X`09`09`09!sameline(DOT, curwp->w_tentative_lastdot)) `7B
X`09`09curwp->w_lastdot = \1309tentative\1D08;
X`09`7D
X
X`09curwp->w_tentative_lastdot = DOT;
X
X
X`09return status;
X`7D
X
X/* token:`09chop a\0E06 off a string
X`09`09return a pointer past the token
X*/
X
Xconst char *
Xtoken(
Xconst char *src,`09/* source string */
Xchar *tok,`09`09/* destination token string */
Xint eolchar)
X`7B
X`09register int quotef = EOS;`09/* nonzero iff the current string\3006d */
X`09register int c, i, d;
X
X`09/* first scan past any whitespace in the source string */
X`09while (isSPorTAB(*src))
X`09`09++src;
X
X`09/* scan through the source string */
X`09while ((c = *src) != EOS) `7B
X`09`09/* process special characters */
X`09`09if (c == '`5C`5C') `7B
X`09`09`09src++;
X`09`09`09if (*src == EOS)
X`09`09&0209break;
X`09`09`09switch (c = *src++) `7B
X`09`09&0209case 'r':`09*tok++ = '`5Cr'; break;
X`09`09&0209case 'n':`09*tok++ = '`5Cn'; break;
X`09`09&0209case 't':`09*tok++ = '`5Ct';  break;
X`09`09&0209case 'b':`09*tok++ = '`5Cb';  break;
X`09`09&0209case 'f':`09*tok++ = '`5Cf'; break;
X`09`09&0209case 'a':`09*tok++ = '`5C007'; break;
X`09`09&0209case 's':`09*tok++ = ' '; break;
X`09`09&0209case 'e':`09*tok++ = ESC; break;
X
X`09`09&0209case 'x':
X`09`09&0209case 'X':
X`09`09&0209`09i = 2; /* allow `5CxNN hex */
X`09`09&0209`09c = 0;
X`09`09&0209`09while (isAlnum(*src) `26`26 i--) `7B
X`09`09&0209&0209if (isDigit(*src)) `7B
X`09`09&0209&0309d = *src - '0';
X`09`09&0209&0209`7D else if (isLower(*src)) `7B
X`09`09&0209&0309d = *src - 'a' + 10;
X`09`09&0209&0209`7D else `7B
X`09`09&0209&0309d = *src - 'A' + 10;
X`09`09&0209&0209`7D
X`09`09&0209&0209if (d > 15)
X`09`09&0209&0309break;
X`09`09&0209&0209c = (c * 16) + d;
X`09`09&0209&0209src++;
X`09`09&0209`09`7D
X`09`09&0209`09*tok++ = (char)c;
X`09`09&0209`09break;
X
X`09`09&0209default:
X`09`09&0209`09if (c >= '0' `26`26 c <= '7') `7B
X`09`09&0209&0209i = 2; /* allow `5CNNN octal */
X`09`09&0209&0209c -= '0';
X`09`09&0209&0209while (isDigit(*src)
X`09`09&0209&0209  `26`26 *src < '8'
X`09`09&0209&0209  `26`26 i--) `7B
X`09`09&0209&0309c = (c * 8) + (*src++ - '0');
X`09`09&0209&0209`7D
X`09`09&0209`09`7D
X`09`09&0209`09*tok++ = (char)c;
X`09`09`09`7D
X`09`09`7D else `7B
X`09`09`09/* check for the end of the token */
X`09`09`09if (quotef != EOS) `7B
X`09`09&0209if (c == quotef) `7B
X`09`09&0209`09src++;
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09`09`7D else `7B
X`09`09&0209if (c == eolchar) `7B
X`09`09&0209`09if (!isSPorTAB(c))
X`09`09&0209&0209src++;
X`09`09&0209`09break;
X`09`09&0209`7D else if (c == '"') `7B
X`09`09&0209`09quotef = c;
X`09`09&0209`09/* note that leading quote
X`09`09&0209&0209is included */
X`09`09&0209`7D else if (isSPorTAB(c)) `7B
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09`09`7D
X
X`09`09`09*tok++ = *src++;`09/* record the character */
X`09`09`7D
X`09`7D
X
X`09/* scan past any whitespace remaining in the source string */
X`09while (isSPorTAB(*src))
X`09`09++src;
X`09token_ended_line = isreturn(*src) `7C`7C *src == EOS;
X
X`09*tok = EOS;
X`09return src;
X`7D
X
X/*
X * Convert the string 'src' into a\1408that we can read back with 'token()'.
X * If it is a shell-command, this will be a single-token.  Repeated shift
X * commands are multiple tokens.
X */
Xint
Xmacroize(
XTBUFF`09**p,
XTBUFF *`09src,
Xint`09skip)
X`7B
X`09register int`09c;
X`09char`09*ref`09= tb_values(src); /* FIXME */
X`09int`09multi`09= !isShellOrPipe(ref);`09/* shift command? */
X`09int`09count`09= 0;
X
X`09if (tb_init(p, abortc) != 0) `7B
X`09`09ALLOC_T`09n, len = tb_length(src);
X`09`09char`09*txt = tb_values(src);
X
X`09`09TRACE(("macroizing %s`5Cn", tb_visible(src)))
X`09`09(void)tb_append(p, '"');
X`09`09for (n = skip; n < len; n++) `7B
X`09`09`09c = txt`5Bn`5D;
X`09`09`09if (multi `26`26 count++)
X`09`09&0209(void)tb_sappend(p, "`5C" `5C"");
X`09`09`09if (c == '`5C`5C' `7C`7C \0D06"')
X`09`09&0209(void)tb_append(p, '`5C`5C');
X`09`09`09(void)tb_append(p, c);
X`09`09`7D
X`09`09(void)tb_append(p, '"');
X`09`09TRACE(("macroized %s`5Cn", tb_visible(*p)))
X`09`09return (tb_append(p, EOS) != 0);
X`09`7D
X`09return FALSE;
X`7D
X
Xint
Xmacarg(`09`09/* get a macro line argument */
Xchar *tok)`09/* buffer to place argument */
X`7B
X`09int savcle;`09/* buffer to store original clexec */
X
X`09savcle = clexec;`09/* save execution mode */
X`09clexec = TRUE;`09`09/* get the argument */
X`09/* grab token and advance past */
X`09execstr = token(\1007, tok, EOS);
X`09/* evaluate it */
X`09(void)strcpy(tok, tokval(tok));
X`09clexec = savcle;`09/* restore execution mode */
X`09return TRUE;
X`7D
X
Xint
Xmacliteralarg(`09/* get a macro line argument */
XTBUFF **tok)`09/* buffer to place argument */
X`7B
X`09/* grab everything on this line, literally */
X`09(void)tb_scopy(tok, execstr);
X`09execstr += strlen(\1207);
X`09token_ended_line = TRUE;
X`09return TRUE;
X`7D
X
X/*`09storemac:`09Set up a macro buffer and flag to store all executed
X`09`09`09command lines there. 'n' is the macro number to use
X */
X
Xint
Xstoremac(int f, int n)
X`7B
X`09register struct BUFFER *bp;`09/* pointer to macro buffer */
X`09char bname`5BNBUFN`5D;`09`09/* name of buffer to use */
X
X`09/* must have a numeric argument to this function */
X`09if (f == FALSE) `7B
X`09`09mlforce("`5BNo macro specified`5D");
X`09`09return FALSE;
X`09`7D
X
X`09/* range check the macro number */
X`09if (n < 1 `7C`7C n > 40) `7B
X`09`09mlforce("`5BMacro number out of range`5D");
X`09`09return FALSE;
X`09`7D
X
X`09/* construct the macro buffer name */
X`09(void)lsprintf(bname, MACRO_N_BufName, n);
X
X`09/* set up the new macro buffer */
X`09if ((bp = bfind(bname, BFINVS)) == NULL) `7B
X`09`09mlforce("`5BCannot create macro`5D");
X`09`09return FALSE;
X`09`7D
X
X`09/* and make sure it is empty */
X`09if (!bclear(bp))
X`09`09return FALSE;
X
X`09set_rdonly(bp, bp->b_fname, MDVIEW);
X
X`09/* and set the macro store pointers to it */
X`09mstore = TRUE;
X`09bstore = bp;
X`09return TRUE;
X`7D
X
X#if`09OPT_PROCEDURES
X/*`09storeproc:`09Set up a procedure buffer and flag to store all
X`09`09`09executed command lines there.  'n' is the macro number
X`09`09`09to use.
X */
X
Xint
Xstoreproc(int f, int n)
X`7B
X`09static TBUFF *name;`09`09/* procedure name */
X#if OPT_ONLINEHELP
X`09static TBUFF *helpstring;`09/* optional help \1906 */
X#endif
X`09register struct BUFFER *bp;`09/* pointer to macro buffer */
X`09register int status;`09`09/* return\1307 */
X`09char bname`5BNBUFN`5D;`09`09/* name of buffer to use */
X
X`09/* a numeric argument means its a numbered macro */
X`09if (f == TRUE)
X`09`09return storemac(f, n);
X
X`09/* get the name of the procedure */
X`09tb_scopy(`26name, "");
X`09if ((status = kbd_reply("Procedure name: ", `26name,
X`09    eol_history, ' ', KBD_NORMAL, no_completion)) != TRUE)
X`09`09return status;
X
X#if OPT_ONLINEHELP
X`09/* get optional help string */
X`09if (more_named_cmd())
X`09`7B
X`09    tb_scopy(`26helpstring, "");
X`09    if ((status = kbd_reply("help info: ", `26helpstring,
X`09`09eol_history, '`5Cn', KBD_NORMAL, no_completion)) != TRUE)
X`09`09    return status;
X`09`7D
X`09else
X`09    tb_scopy(`26helpstring, "User-defined procedure");
X#endif
X
+-+-+-+-+-+-+-+-  END  OF PART 50 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 51 -+-+-+-+-+-+-+-+
X`09/* construct the macro buffer name */
X`09add_brackets(bname, tb_values(name));
X
X`09/* set up the new macro buffer */
X`09if ((bp = bfind(bname, BFINVS)) == NULL) `7B
X`09`09mlforce("`5BCannot create procedure`5D");
X`09`09return FALSE;
X`09`7D
X
X`09/* and make sure it is empty */
X`09if (!bclear(bp))
X`09`09return FALSE;
X
X`09set_rdonly(bp, bp->b_fname, MDVIEW);
X
X`09/* save this into the list of : names */
X#if OPT_NAMEBST
X`09`7B
X`09    CMDFUNC *cf = typealloc(\1807);
X
X`09    if (!cf)
X`09`09return no_memory("registering procedure name");
X
X`09    cf->cu.c_buff = bp;
X`09    cf->c_flags = UNDO`7CREDO`7CCMD_PROC;
X#if OPT_ONLINEHELP
X`09    cf->c_help = strmalloc(tb_values(helpstring));
X#endif
X
X`09    if (insert_namebst(tb_values(name), cf, FALSE) != TRUE)
X`09`09return FALSE;
X`09`7D
X#endif /* OPT_NAMEBST */
X
X`09/* and set the macro store pointers to it */
X`09mstore = TRUE;
X`09bstore = bp;
X`09return TRUE;
X`7D
X
X/*`09execproc:`09Execute a procedure`09`09&0209*/
X
Xint
Xexecproc(int f, int n)
X`7B
X`09static char name`5BNBUFN`5D;`09/* name of buffer to execute */
X`09int status;
X
X`09/* find out what buffer the user wants to execute */
X`09if ((status = mlreply("Execute procedure: ",
X`09`09&0209`09name, sizeof(name))) != TRUE) `7B
X`09`09return status;
X`09`7D
X
X`09status = TRUE;
X`09if (!f)
X`09`09n = 1;
X
X`09while (status == TRUE `26`26 n--)
X`09`09status = run_procedure(name);
X
X`09return status;
X
X`7D
X
Xint
Xrun_procedure(const char *name)
X`7B
X`09register BUFFER *bp;`09`09/* ptr to buffer to execute */
X`09register int status;`09`09/*\0C07 return */
X`09char bufn`5BNBUFN`5D;`09`09/* name of buffer to execute */
X`09register int odiscmd;
X
X`09if (!*name)
X`09`09return FALSE;
X
X`09/* construct the buffer name */
X`09add_brackets(bufn, name);
X
X`09/* find the pointer to that buffer */
X`09if ((bp = find_b_name(bufn)) == NULL) `7B
X`09`09return FALSE;
X`09`7D
X
X`09odiscmd = \0906;
X`09discmd = FALSE;
X
X`09status = dobuf(bp);
X
X`09discmd = o\0A06;
X`09return status;
X`7D
X#endif
X
X#if ! SMALLER
X/*`09execbuf:`09Execute the contents of a buffer of commands`09*/
X
Xint
Xexecbuf(int f, int n)
X`7B
X`09register BUFFER *bp;`09`09/* ptr to buffer to execute */
X`09register int status;`09`09/*\0C07 return */
X`09static char bufn`5BNBUFN`5D;`09/* name of buffer to execute */
X`09register int odiscmd;
X
X`09if (!f)
X`09`09n = 1;
X
X`09/* find out what buffer the user wants to execute */
X`09if ((status = mlreply("Execute buffer: ", bufn, sizeof(bufn))) != TRUE)
X`09`09return status;
X
X`09/* find the pointer to that buffer */
X`09if ((bp = find_b_name(bufn)) == NULL) `7B
X`09`09mlforce("`5BNo such buffer `5C"%s`5C"`5D",bufn);
X`09`09return FALSE;
X`09`7D
X
X`09odiscmd = \0906;
X`09discmd = FALSE;
X`09status = TRUE;
X`09/* and now execute it as asked */
X`09while (n-- > 0 `26`26 status == TRUE)
X`09`09status = dobuf(bp);
X
X`09discmd = o\0A06;
X
X`09return status;
X`7D
X#endif
X
X/*`09dobuf:`09execute the contents of the buffer pointed to
X`09`09by the passed BP
X
X`09Directives start with a "`7E" and include:
X
X`09`7Eendm`09`09End a macro
X#if !SMALLER
X`09`7Eif (cond)`09conditional execution
X`09`7Eelse
X`09`7Eendif
X`09`7Ereturn`09`09Return (terminating current macro)
X`09`7Egoto <label>`09Jump to a label in the current macro
X`09`7Eforce`09`09Force macro to continue...even if command fails
X`09`7Ewhile (cond)`09Execute a loop if the condition is true
X`09`7Eendwhile
X
X`09Line Labels begin with a "*" as the first nonblank char, like:
X
X`09*LBL01
X#endif
X
X*/
X
Xstatic void
Xfreewhile(`09/* free a list of while block pointers */
XWHBLOCK *wp)`09/* head of structure to free */
X`7B
X`09if (wp == NULL)
X`09`09return;
X`09if (wp->w_next)
X`09`09freewhile(wp->w_next);
X`09free((char *)wp);
X`7D
X
X#define DIRECTIVE_CHAR '`7E'
X
X#if ! SMALLER
X#define DDIR_FAILED     -1
X#define DDIR_COMPLETE    0
X#define DDIR_INCOMPLETE  1
X#define DDIR_FORCE       2
X
Xstatic DIRECTIVE
Xdname_to_dirnum(const char *eline, size_t length)
X`7B
X`09DIRECTIVE dirnum = D_UNKNOWN;
X`09if (*eline++ == DIRECTIVE_CHAR) `7B
X`09`09size_t n, m;
X`09`09for (n = 0; n < TABLESIZE(dname); n++) `7B
X`09`09`09m = strlen(dname`5Bn`5D.name);
X`09`09`09if (length >= m
X`09`09`09 `26`26 memcmp(eline, dname`5Bn`5D.name, m) == 0) `7B
X`09`09&0209dirnum = dname`5Bn`5D.type;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09return dirnum;
X`7D
X
Xstatic const char *
Xdirnum_to_name(DIRECTIVE \1906)
X`7B
X`09size_t n;
X`09for (n = 0; n < TABLESIZE(dname); n++)
X`09`09if (dname`5Bn`5D.type == dirnum)
X`09`09`09return dname`5Bn`5D.name;
X`09return "?";
X`7D
X
Xstatic int
Xunbalanced_directive(DIRECTIVE dirnum)
X`7B
X`09mlforce("`5BUnexpected directive: %s`5D", dirnum_to_name(\0F06));
X`09return DDIR_FAILED;
X`7D
X
Xstatic int
Xbegin_directive(
X`09char **const eline,
X`09DIRECTIVE dirnum,
X`09WHBLOCK *whlist,
X`09BUFFER *bp,
X`09LINEPTR *lp)
X`7B
X`09int status = DDIR_COMPLETE; /* assume directive is self-contained */
X`09WHBLOCK *wht;`09`09/* temporary ptr to a \2509/
X`09char tkn`5BNSTRING`5D;`09/* buffer to evaluate an expression in */
X`09const char *old_execstr = \0A07;
X
X`09execstr = *eline;
X
X`09switch (dirnum) `7B
X`09case D_IF:`09/* IF directive */
X`09`09/* grab the value of the logical exp */
X`09`09ifstk.level++;
X`09`09if (!ifstk.disabled) `7B
X`09`09`09ifstk.fired = FALSE;
X`09`09`09ifstk.disabled = \1106level;
X`09`09`09if (macarg(tkn) != TRUE)
X`09`09&0209status = DDIR_INCOMPLETE;
X`09`09`09else if (stol(tkn) == TRUE) `7B
X`09`09&0209ifstk.disabled = 0;
X`09`09&0209ifstk.fired = TRUE;
X`09`09`09`7D
X`09`09`7D
X`09`09break;
X
X`09case D_WHILE:`09/* WHILE directive */
X`09`09/* grab the value of the logical exp */
X`09`09if (!ifstk.disabled) `7B
X`09`09`09if (macarg(tkn) != TRUE) `7B
X`09`09&0209status = DDIR_INCOMPLETE;
X`09`09&0209break;
X`09`09`09`7D else if (stol(tkn) == TRUE) `7B
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`09/* drop down and act just like BREAK */
X
X`09`09/* FALLTHRU */
X`09case D_BREAK:`09/* BREAK directive */
X`09`09if (dirnum != D_BREAK `7C`7C !ifstk.disabled) `7B
X
X`09`09`09/* Jump down to the endwhile, then find the right while
X`09`09`09 * loop.
X`09`09`09 */
X`09`09`09for (wht = whlist; wht != 0\0A06= wht->w_next) `7B
X`09`09&0209if (wht->w_begin == *lp)
X`09`09&0209`09break;
X`09`09`09`7D
X
X`09`09`09if (wht == 0) `7B
X`09`09&0209status = unbalanced_directive(dirnum);
X`09`09`09`7D else `7B /* reset the line pointer back.. */
X`09`09&0209*lp = wht->w_end;
X`09`09`09`7D
X`09`09`7D
X`09`09break;
X
X`09case D_ELSEIF:`09/* \0B06 directive */
X`09`09if (ifstk.level == 0) `7B
X`09`09`09status = unbalanced_directive(dirnum);
X`09`09`7D else `7B
X`09`09`09if (ifstk.fired) `7B
X`09`09&0209if (!ifstk.disabled)
X`09`09&0209`09ifstk.disabled = \1106level;
X`09`09`09`7D else if (macarg(tkn) != TRUE) `7B
X`09`09&0209status = DDIR_INCOMPLETE;
X`09`09`09`7D else if (!ifstk.fired
X`09`09`09  `26`26 ifstk.disabled ==\1207level
X`09`09`09  `26`26 (stol(tkn) == TRUE)) `7B
X`09`09&0209ifstk.disabled = 0;
X`09`09&0209ifstk.fired = TRUE;
X`09`09`09`7D
X`09`09`7D
X`09`09break;
X
X`09case D_ELSE:`09/* ELSE directive */
X`09`09if (ifstk.level == 0) `7B
X`09`09`09status = unbalanced_directive(dirnum);
X`09`09`7D else `7B
X`09`09`09if (ifstk.fired) `7B
X`09`09&0209if (!ifstk.disabled)
X`09`09&0209`09ifstk.disabled = \1106level;
X`09`09`09`7D else if (ifstk.disabled == ifstk.level) `7B
X`09`09&0209ifstk.disabled = 0;
X`09`09&0209ifstk.fired = TRUE;
X`09`09`09`7D
X`09`09`7D
X`09`09break;
X
X`09case D_ENDIF:`09/* ENDIF directive */
X`09`09if (ifstk.level == 0) `7B
X`09`09`09status = unbalanced_directive(dirnum);
X`09`09`7D else `7B
X`09`09`09ifstk.level--;
X`09`09`09if (ifstk.disabled > \1106level)
X`09`09`09`7B
X`09`09&0209ifstk.disabled = 0;
X`09`09&0209ifstk.fired = TRUE;
X`09`09`09`7D
X`09`09`7D
X`09`09break;
X
X`09case D_GOTO:`09/* GOTO directive */
X`09`09/* .....only if we are currently executing */
X`09`09if (!ifstk.disabled) `7B
X`09`09`09int found = FALSE;
X`09`09`09size_t len;`09/* length of line to execute */
X`09`09`09register LINEPTR glp;`09/* line to goto */
X
X`09`09`09/* grab label to jump to */
X`09`09`09*eline = (char *)token(\1706, golabel, EOS);
X`09`09`09len = strlen(golabel);
X`09`09`09if (len > 1) `7B
X`09`09&0209for_each_line(glp, bp) `7B
X`09`09&0209`09int need = len + 1;
X`09`09&0209`09if (glp->l_used >= need
X`09`09&0209`09 `26`26 glp->l_text`5B0`5D == '*'
X`09`09&0209`09 `26`26 !memcmp(`26glp->l_text`5B1`5D, golabel, len)) `7B
X`09`09&0209&0209*lp = glp;
X`09`09&0209&0209found = TRUE;
X`09`09&0209&0209break;
X`09`09&0209`09`7D
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09if (!found) `7B
X`09`09&0209mlforce("`5BNo such label `5C"%s`5C"`5D", golabel);
X`09`09&0209status = DDIR_FAILED;
X`09`09`09`7D
X`09`09`7D
X`09`09break;
X
X`09case D_RETURN:`09/* \0B06 directive */
X`09`09if (!ifstk.disabled)
X`09`09`09status = DDIR_INCOMPLETE;
X`09`09break;
X
X`09case D_ENDWHILE: /* \0D08 directive */
X`09`09if (!ifstk.disabled) `7B
X`09`09`09/* find the right while loop */
X`09`09`09for (wht = whlist; wht != 0\0A06= wht->w_next) `7B
X`09`09&0209if (wht->w_type == D_WHILE
X`09`09&0209 `26`26 wht->w_end == *lp)
X`09`09&0209`09break;
X`09`09`09`7D
X
X`09`09`09if (wht == 0) `7B
X`09`09&0209status = unbalanced_directive(dirnum);
X`09`09`09`7D else `7B /* reset the line pointer back.. */
X`09`09&0209*lp = lback(wht->w_begin);
X`09`09`09`7D
X`09`09`7D
X`09`09break;
X
X`09case D_FORCE:`09/* FORCE directive */
X`09`09status = DDIR_FORCE;
X`09`09break;
X
X`09case D_UNKNOWN:
X`09case D_ENDM:
X`09`09break;
X`09`7D
X`09execstr = old_\0E07;
X`09return status;
X`7D
X
Xstatic WHBLOCK *
Xalloc_WHBLOCK(\0807 *scanpt, DIRECTIVE dirnum, LINEPTR lp)
X`7B
X`09WHBLOCK *whtemp;`09/* temporary ptr to a \2709/
X
X`09if ((whtemp = typealloc(WHBLOCK)) == 0) `7B
X`09`09mlforce("`5BOut of memory during '%s' scan`5D",
X`09`09`09dirnum_to_name(\0F06));
X`09`09freewhile(scanpt);
X`09`09return 0;
X`09`7D
X`09whtemp->w_begin = lp;
X`09whtemp->w_type = dirnum;
X`09whtemp->w_next = scanpt;
X`09scanpt = whtemp;
X`09return scanpt;
X`7D
X
Xstatic int
Xsetup_dobuf(BUFFER *bp, WHBLOCK **result)
X`7B
X`09int status = TRUE;
X`09LINEPTR lp;`09`09/* pointer to line to execute */
X`09char *eline;`09`09/* text of line to execute */
X`09WHBLOCK *scanpt = 0;`09/* ptr during scan */
X`09WHBLOCK *whtemp;`09/* temporary ptr to a \2709/
X
X`09/* scan the buffer to execute, building WHILE header blocks */
X`09bp->b_dot.o = 0;
X`09*result = 0;
X`09for_each_line(lp, bp) `7B
X`09`09int i;&0209`09/* index */
X
X`09`09bp->b_dot.l = lp;
X`09`09/* scan the current line */
X`09`09eline = lp->l_text;
X`09`09i = lp->l_used;
X
X`09`09/* trim leading whitespace */
X`09`09while (i-- > 0 `26`26 isBlank(*eline))
X`09`09`09++eline;
X
X`09`09/* if there's nothing here, don't bother */
X`09`09if (i <= 0)
X`09`09`09continue;
X
X`09`09switch (dname_to_dirnum(eline, (size_t)i)) `7B
X`09`09/* if is a while directive, make a block... */
X`09`09case D_WHILE:
X`09`09`09if ((scanpt = alloc_WHBLOCK\1707, D_WHILE, lp)) == 0) `7B
X`09`09&0209status = FALSE;
X`09`09`09`7D
X`09`09`09break;
X
X`09`09/* if it is a break directive, make a block... */
X`09`09case D_BREAK:
X`09`09`09if ((scanpt = alloc_WHBLOCK\1707, D_BREAK, lp)) == 0) `7B
X`09`09&0209status = FALSE;
X`09`09`09`7D
X`09`09`09break;
X
X`09`09/* if it is an endwhile directive, record the spot... */
X`09`09case D_ENDWHILE:
X`09`09`09if (scanpt == NULL) `7B
X`09`09&0209mlforce("`5B%s with no preceding %s in '%s'`5D",
X`09`09&0209`09dirnum_to_name(D_ENDWHILE),
X`09`09&0209`09dirnum_to_name(D_WHILE),
X`09`09&0209`09bp->b_bname);
X`09`09&0209status = FALSE;
X`09`09`09`7D
X`09`09`09/* Move top records from the scanpt list to the result
X`09`09`09 * until we have moved all BREAK records and one WHILE
X`09`09`09 * record.
X`09`09`09 */
X`09`09`09do `7B
X`09`09&0209scanpt->w_end = lp;
X`09`09&0209whtemp  = *result;
X`09`09&0209*result = scanpt;
X`09`09&0209scanpt  = \0A06->w_next;
X`09`09&0209(*result)->w_next = whtemp;
X`09`09`09`7D while ((*result)->w_type == D_BREAK);
X`09`09`09break;
X
X`09`09/* nothing else requires attention */
X`09`09default:
X`09`09`09break;
X`09`09`7D
X`09`09if (status != TRUE)
X`09`09`09break;
X`09`7D
X
X`09/* while and end\0D06should match! */
X`09if (status == TRUE `26`26 scanpt != NULL) `7B
X`09`09mlforce("`5B%s with no matching %s in '%s'`5D",
X`09`09`09dirnum_to_name(D_WHILE),
X`09`09`09dirnum_to_name(D_ENDWHILE),
X`09`09`09bp->b_bname);
X`09`09status = FALSE;
X`09`7D
X`09return status;`09/* true iff we made it to the end w/o errors */
X`7D
X#else
X#define dname_to_dirnum(eline,length) `5C
X`09`09(eline`5B0`5D == DIRECTIVE_CHAR `26`26 !strcmp\2606+1, "endm") `5C
X`09`09? D_ENDM `5C
X`09`09: D_UNKNOWN)
X#endif
X
X#if OPT_TRACE `26`26 !SMALLER
Xstatic const char *TraceIndent(int level,\230Deline, size_t length)
X`7B
X`09static`09const char indent`5B`5D = ".  .  \0606\0C0C";
X`09switch (dname_to_dirnum(eline, length)) `7B
X`09case D_ELSE:`09/* FALLTHRU */
X`09case D_ELSEIF:`09/* FALLTHRU */
X`09case D_ENDIF:
X`09`09if (level > 0)
X`09`09`09level--;
X`09`09break;
X`09default:
X`09`09break;
X`09`7D
X`09level = strlen(indent) - (3 * level);
X`09if (level < 0)
X`09`09level = 0;
X`09return `26indent`5Blevel`5D;
X`7D
X#define TRACE_INDENT(level, eline) TraceIndent\1A0D, linlen)
X#else
X#define TRACE_INDENT(level, eline) "" /* nothing */
X#endif
X
Xstatic int
Xperform_dobuf(BUFFER *bp, WHBLOCK *whlist)
X`7B
X`09int status = TRUE;
X`09int glue = 0;`09`09/* nonzero to append lines */
X`09LINEPTR lp;`09`09/* pointer to line to execute */
X`09DIRECTIVE dirnum;`09/* directive index */
X`09size_t linlen;`09`09/* length of line to execute */
X`09int force;`09`09/*\0B06 TRUE result? */
X`09WINDOW *wp;`09`09/* ptr to windows to scan */
X`09char *einit = 0;`09/* initial value of eline */
X`09char *eline;`09`09/* text of line to execute */
X
X`09static BUFFER *dobuferrbp;
X
X`09/* starting at the beginning of\1106uffer */
X`09for_each_line(lp, bp) `7B
X`09`09bp->b_dot.l = lp;
X`09`09/* allocate eline and copy macro line to it */
X
X`09`09if (lp->l_used <= 0)
X`09`09`09linlen = 0;
X`09`09else
X`09`09`09linlen = lp->l_used;
X
X`09`09if (glue) `7B
X`09`09`09if ((einit = castrealloc(char, einit, glue+linlen+1)) == 0) `7B
X`09`09&0209status = no_memory("during macro execution");
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09eline = einit + glue;
X`09`09`09glue  = 0;
X`09`09`7D else `7B
X`09`09`09if (einit != 0)
X`09`09&0209free(einit);
X
X`09`09`09if ((einit = eline = castalloc(char, linlen+1)) == 0) `7B
X`09`09&0209status = no_memory("during macro execution");
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X
X`09`09if (linlen != 0)
X`09`09`09(void)strncpy(eline, lp->l_text, linlen);
X`09`09eline`5Blinlen`5D = EOS;`09/* make sure it ends */
X
X`09`09/* trim leading whitespace from each line */
X`09`09`7B
X`09`09`09char *src = eline;
X`09`09`09char *dst = eline;
X`09`09`09while (isBlank(*src))
X`09`09&0209src++;
X`09`09`09while ((*dst++ = *src++) != EOS)
X`09`09&0209;
X`09`09`09linlen -= (size_t)(src - dst);
X`09`09`7D
X
X`09`09/*
X`09`09 * If the last character on\1606ine is a backslash, glue the
X`09`09 * following line to the one we're processing.
X`09`09 */
X`09`09if (lforw(lp) != buf_head(bp)
X`09`09 `26`26 linlen != 0
X`09`09 `26`26 eline`5Blinlen-1`5D == '`5C`5C') `7B
X`09`09`09glue = linlen + (size_t)(eline - einit) - 1;
X`09`09`09continue;
X`09`09`7D
X`09`09eline = einit;
X`09`09while (isBlank(*eline))
X`09`09`09++eline;
X
X`09`09/* Skip comments and blank lines.
X`09`09 * ';' for uemacs backward compatibility, and
X`09`09 * '"' for vi compatibility
X`09`09 */
X`09`09if (*eline == ';'
X`09`09 `7C`7C *eline == '"'
X`09`09 `7C`7C *eline == EOS)
X`09`09`09continue;
X
X#if`09OPT_DEBUGMACROS
X`09`09/* if $debug == TRUE, every line to execute
X`09`09   gets echoed and a key needs to be pressed to continue
X`09`09   `5EG will abort the command */
X
X`09`09if (macbug) `7B
X`09`09`09char`09outline`5BNLINE`5D;
X`09`09`09(void)strcpy(outline, "<<<");
X
X`09`09`09/* debug macro name */
X`09`09`09(void)strcat(outline, bp->b_bname);
X`09`09`09(void)strcat(outline, ":");
X
X`09`09`09/* debug if levels */
X`09`09`09(void)strcat(outline, l_itoa(ifstk.level));
X`09`09`09(void)strcat(outline, "/");
X`09`09`09(void)strcat(outline, l_itoa(ifstk.disabled));
X`09`09`09(void)strcat(outline, ":");
X
X`09`09`09/* and lastly the line */
X`09`09`09(void)strcat(outline, eline);
X`09`09`09(void)strcat(outline, ">>>");
X
X`09`09`09/* write out the debug line */
X`09`09`09mlforce("%s",outline);
X`09`09`09(void)update(TRUE);
X
X`09`09`09/* and get the keystroke */
X`09`09`09if (ABORTED(keystroke())) `7B
X`09`09&0209mlforce("`5BMacro aborted`5D");
X`09`09&0209status = FALSE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X#endif
X`09`09TRACE(("<<<%s%s:%d/%d%c%s%s>>>`5Cn",
X`09`09`09(bp == curbp) ? "*" : "",
X`09`09`09bp->b_bname, ifstk.level\0D08disabled,
X`09`09`09ifstk.fired ? '+' : ' ',
X`09`09`09TRACE_INDENT(ifstk.level, eline),
X`09`09`09eline))
X
X`09`09/* Parse directives here.... */
X`09`09dirnum = D_UNKNOWN;
X`09`09if (*eline == DIRECTIVE_CHAR) `7B
X
X`09`09`09/* Find out which directive this is */
X`09`09`09dirnum = dname_to_\1206(eline, linlen);
X
X`09`09`09/* and bitch if it's illegal */
X`09`09`09if (dirnum == D_UNKNOWN) `7B
X`09`09&0209mlforce("`5BUnknown directive `5C"%s`5C"`5D", eline);
X`09`09&0209status = FALSE;
X`09`09&0209break;
X`09`09`09`7D
X
X`09`09`09/* service only the ENDM macro here */
X`09`09`09if (dirnum == D_ENDM `26`26 !ifstk.disabled) `7B
X`09`09&0209if (!mstore) `7B
X`09`09&0209`09mlforce(
X`09`09&0209`09"`5BNo macro definition in progress`5D");
X`09`09&0209`09status = FALSE;
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09&0209bstore->b_dot.l = lforw(buf_head(bstore));
X`09`09&0209bstore->b_dot.o = 0;
X`09`09&0209bstore = NULL;
X`09`09&0209mstore = FALSE;
X`09`09&0209continue;
X`09`09`09`7D
X`09`09`7D
X
X`09`09/* if macro store is on, just salt this away */
X`09`09if (mstore) `7B
X`09`09`09/* allocate the space for the line */
X`09`09`09if (addline(bstore, eline, -1) == FALSE) `7B
X`09`09&0209mlforce("`5BOut of memory while storing macro`5D");
X`09`09&0209status = FALSE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09continue;
X`09`09`7D
X
X`09`09if (*eline == '*')
X`09`09`09continue;
X
X`09`09force = FALSE;
X
X#if ! SMALLER
X`09`09/* now, execute directives */
X`09`09if (dirnum != D_UNKNOWN) `7B
X`09`09`09int code;
X
X`09`09`09/* skip past the directive */
X`09`09`09while (*eline `26`26 !isBlank\1307))
X`09`09&0209++eline;
X`09`09`09code = begin_directive(`26eline, dirnum, whlist, bp, `26lp);
X`09`09`09if (code == DDIR_FAILED) `7B
X`09`09&0209status = FALSE;
X`09`09&0209break;
X`09`09`09`7D else if (code == DDIR_COMPLETE) `7B
X`09`09&0209continue;
X`09`09`09`7D else if (code == DDIR_INCOMPLETE) `7B
X`09`09&0209status = TRUE; /* not exactly an error */
X`09`09&0209break;
X`09`09`09`7D else if (code == DDIR_FORCE) `7B
X`09`09&0209force = TRUE;
X`09`09`09`7D
X`09`09`7D
X#endif
X
X`09`09/* execute the statement */
X`09`09/* if we are scanning and not executing..go back here */
X`09`09if (ifstk.disabled)
X`09`09`09status = TRUE;
X`09`09else
X`09`09`09status = docmd(eline,TRUE,FALSE,1);
X`09`09if (force)&0209/* force the status */
X`09`09`09status = TRUE;
X
X`09`09/* check for a command error */
X`09`09if (status != TRUE) `7B
X`09`09`09/* look if buffer is showing */
X`09`09`09for_each_visible_window(wp) `7B
X`09`09&0209if (wp->w_bufp == bp) `7B
X`09`09&0209`09/* and point it */
X`09`09&0209`09wp->w_dot.l = lp;
X`09`09&0209`09wp->w_dot.o = 0;
X`09`09&0209`09wp->w_flag `7C= WFHARD;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09/* in any case set the buffer's dot */
X`09`09`09bp->b_dot.l = lp;
X`09`09`09bp->b_dot.o = 0;
X`09`09`09bp->b_wline.l = lforw(buf_head(bp));
X`09`09`09if (dobuferrbp == NULL) `7B
X`09`09&0209dobuferrbp = bp;
X`09`09&0209(void)swbuffer(bp);
X`09`09&0209kbd_alarm();
X`09`09`09`7D
X`09`09`09break;
X`09`09`7D
X`09`7D
X
X`09if (einit != 0)
X`09`09free(einit);
X
X`09return status;
X`7D
X
Xint
Xdobuf(BUFFER *bp)`09/* buffer to execute */
X`7B
X`09int status = FALSE;`09/*\1308return */
X`09WHBLOCK *whlist;`09/* ptr to WHILE list */
X
X`09static int dobufnesting; /* flag to prevent runaway recursion */
X
X`09if (++dobufnesting < 9) `7B
X
X#if ! SMALLER
X`09`09if (setup_dobuf(bp, `26whlist) != TRUE) `7B
X`09`09`09status = FALSE;
X`09`09`7D else
X#else
X`09`09whlist = NULL;
X#endif
X`09`09`7B
X`09`09`09static const IFSTK new_ifstk = `7B0,0,0`7D; /* all 0's */
X`09`09`09const CMDFUNC *save_havemotion  = \0E0A;
X`09`09`09IFSTK save_ifstk;
X`09`09`09REGIONSHAPE save_regionshape = \0E0B;
X
X`09`09`09save_ifstk  = ifstk;
X`09`09`09ifstk       = new_ifstk;
X`09`09`09havemotion  = NULL;
X`09`09`09regionshape = EXACT;
X
X`09`09`09status = perform_dobuf(bp, whlist);
X
X`09`09`09ifstk       = save_ifstk;
X`09`09`09havemotion  = save_\130A;
X`09`09`09regionshape = save_\130B;
X`09`09`7D
X
X`09`09mstore = FALSE;
X`09`09freewhile(whlist);
X`09`7D
X`09dobufnesting--;
X
X`09return status;
X`7D
X
X
X/*
X * Common function for startup-file, and for :so command.
X */
Xint
Xdo_source(char *fname, int n\0706optional)
X`7B
X`09register int status;`09/* return\1207 of name query */
X`09char *fspec;`09`09/* full file spec */
X
X`09/* look up the path for the file */
X`09fspec = flook(fname,
X#if SYS_MSDOS `7C`7C SYS_WIN31\0D08OS2\180BNT
X`09`09FL_ANYWHERE `7C FL_READABLE
X#else
X`09`09FL_HERE `7C FL_HOM\0A07TABL\1507READABLE
X#endif
X`09`09);
X
X`09/* if it isn't around */
X`09if (fspec == NULL)
X`09`09return optional ? TRUE : no_such_file(fname);
X
X`09/* otherwise, execute it */
X`09while (n-- > 0)
X`09`09if ((status=dofile(fspec)) != TRUE)
X`09`09`09return status;
X
X`09return TRUE;
X`7D
X
X#if ! SMALLER
X/* ARGSUSED */
Xint
Xexecfile(`09/* execute a series of commands in a file */
Xint f GCC_UNUSED, int n)`09/* default flag and numeric arg to pass on to file
V */
X`7B
X`09register int status;
X`09char fname`5BNFILEN`5D;`09/* name of file to execute */
X`09static`09TBUFF`09*last;
X
X`09if ((status = mlreply_file("File to execute: ", `26last, FILEC_READ, fname)
V) != TRUE)
X`09`09return status;
X
X`09return do_source(fname, n, FALSE);
X`7D
X#endif
X
Xstatic L_NUM
Xget_b_lineno(BUFFER *bp)
X`7B
X`09L_NUM result;
X`09WINDOW *wp;
X
X`09/* try to save the original location, so we can restore it */
X`09if (curwp->w_bufp == bp)
X`09`09result = line_no(bp, curwp->w_dot.l);
X`09else if ((wp = bp2any_wp(bp)) != 0)
X`09`09result = line_no(bp, wp->w_dot.l);
X`09else
X`09`09result = line_no(bp, bp->b_dot.l);
X`09return result;
X`7D
X
Xstatic void
Xset_b_lineno(BUFFER *bp, L_NUM n)
X`7B
X`09WINDOW *wp;
X`09LINE *lp;
X
X`09for_each_line(lp,bp) `7B
X`09`09if (--n <= 0) `7B
X`09`09`09bp->b_dot.l = lp;
X`09`09`09bp->b_dot.o = 0;
X`09`09`09for_each_visible_window(wp) `7B
X`09`09&0209if (wp->w_bufp == bp) `7B
X`09`09&0209`09wp->w_dot = bp->b_dot;
X`09`09&0209`09wp->w_flag `7C= WFMOVE;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09break;
X`09`09`7D
X`09`7D
X`7D
X
X/*`09dofile:`09yank a file into a buffer and execute it
X`09`09if there are no errors, delete the buffer on exit */
X
Xint
Xdofile(
Xchar *fname)`09`09/* file name to execute */
X`7B
X`09register BUFFER *bp;`09/* buffer to place file to execute */
X`09register int status;`09/* results of various calls */
X`09register int odiscmd;
X`09int clobber = FALSE;
X`09int original;
X
X`09/*
X`09 * Check first for the name, assuming it's a filename.  If we don't
X`09 * find an existing buffer with that filename, create a\2407.
X`09 */
X`09if ((bp = find_b_file(fname)) == 0) `7B
X`09`09if ((bp = make_bp(fname, 0)) == 0)
X`09`09`09return FALSE;
X`09`09clobber = TRUE;
X`09`7D
X`09bp->b_flag = BFEXEC;
X
X`09/* try to save the original location, so we can restore it */
X`09original = get_b_lineno(bp);
X
X`09/* and try to read in the file to execute */
X`09if ((status = readin(fname, FALSE, bp, TRUE)) == TRUE) `7B
X
X`09`09/* go execute it! */
X`09`09odiscmd = \0906;
X`09`09discmd = FALSE;
X`09`09status = dobuf(bp);
X`09`09discmd = o\0A06;
X
X`09`09/*
X`09`09 * If no errors occurred, and if the buffer isn't displayed,
X`09`09 * remove it, unless it was loaded before we entered this
X`09`09 * function.  In that case, (try to) jump back to the original
X`09`09 * location.
X`09`09 */
X`09`09if (status != TRUE)
X`09`09`09(void)swbuffer(bp);
X`09`09else if ((bp->b_nwnd == 0) `26`26 clobber)
X`09`09`09(void)zotbuf(bp);
X`09`09else
X`09`09`09set_b_lineno(bp,original);
X`09`7D
X`09return status;
X`7D
X
X/*`09cbuf:`09Execute the contents of a numbered buffer`09*/
X
Xstatic int
Xcbuf(
Xint f, int n,`09/* default flag and numeric arg */
Xint bufnum)`09/* number of buffer to execute */
X`7B
X`09register BUFFER *bp;`09`09/* ptr to buffer to execute */
X`09register int status;`09`09/*\0C07 return */
X`09static char bufname`5BNBUFN`5D;
X`09register int odiscmd;
X
X`09if (!f) n = 1;
X
X`09/* make the buffer name */
X`09(void)lsprintf(bufname, MACRO_N_BufName, bufnum);
X
X`09/* find the pointer to that buffer */
X`09if ((bp = find_b_name(bufname)) == NULL) `7B
X`09`09mlforce("`5BMacro %d not defined`5D", bufnum);
X`09`09return FALSE;
X`09`7D
X
X`09odiscmd = \0906;
X`09discmd = FALSE;
X`09status = TRUE;
X`09/* and now execute it as asked */
X`09while (n-- > 0 `26`26 status == TRUE)
X`09`09status = dobuf(bp);
X
X`09discmd = o\0A06;
X`09return status;
X
X`7D
X
X#include "neexec.h"
$ call unpack [.VILE-8_0]EXEC.C;1 -
 1920074891 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 103 38 152
$!
$ create 'f'
X/*
X * This is just a place holder --\1209in which to pull in edef.h alone
X *
X * $Header: /usr/build/vile/vile/RCS/externs.c,v 1.6 1997/10/07 11:05:10 tom E
Vxp $
X *
X */
X
X#include`09"estruct.h"`09/* function declarations */
X
X#define real_CMDFUNCS
X#include`09"nefunc.h"`09/* function declarations */
X#include`09"nebind.h"`09/* default key bindings */
X#include`09"nename.h"`09/* name table */
X
XEXTERN_CONST int nametblsize = TABLESIZE(\1807);
X
$ call unpack [.VILE-8_0]EXTERNS.C;1 -
 2114286943 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 1 39 152
$!
$ create 'f'
X/*
X *
X *`09fences.c
X *
X * Match up various fenceposts, like (), `5B`5D, `7B`7D, */ /*, #if, #el, #en
V
X *
X * Most code probably by Dan Lawrence or Dave Conroy for MicroEMACS
X * Extensions for vile by Paul Fox
X * Revised to use regular expressions - T.Dickey
X *
X * $Header: /usr/build/vile/vile-7.4d/RCS/fences.c,v 1.48 1998/05/07 01:40:47
V kev Exp $
X *
X */
X
X#include`09"estruct.h"
X#include`09"edef.h"
X
X#if OPT_CFENCE
X
X#define`09CPP_UNKNOWN -1
X#define`09CPP_IF       0
X#define`09CPP_ELIF     1
X#define`09CPP_ELSE     2
X#define`09CPP_ENDIF    3
X
X#define ok_CPP(n) ((n) >= CPP_IF `26`26 (n) <\1106ENDIF)
X
X#define BLK_UNKNOWN -1
X#define BLK_BEGIN    4
X#define BLK_END      5
X
X#define ok_BLK(n) ((n) >= BLK_BEGIN `26`26 (n) <\1406END)
X
X#define COMPLEX_FENCE_CH  -4
X#define COMMENT_FENCE_CH  -3
X#define PAIRED_FENCE_CH   -2
X#define UNKNOWN_FENCE_CH  -1
X
X#define S_COL(exp) (C_NUM)(exp->startp`5B0`5D - DOT.l->l_text)
X#define E_COL(exp) (C_NUM)(exp->endp`5B0`5D   - DOT.l->l_text)
X
X#define BlkBegin b_val_rexp(curbp, VAL_FENCE_BEGIN)->reg
X#define BlkEnd   b_val_rexp(curbp, VAL_FENCE_END)->reg
X
X#define CurrentChar() `5C
X `09(is_at_end_of_line(DOT) ? '`5Cn' : char_at(DOT))
X#define InDirection(sdir) `5C
X `09((sdir == REVERSE) ? backchar(FALSE, 1) : forw\150E)
X
Xstatic int
Xmatch_complex(LINE *lp)
X`7B
X`09static int modes`5B`5D = `7B CPP_IF, CPP_EL\0A0ASE\1407NDIF `7D;
X`09size_t j, k;
X
X`09for (j = 0; j < TABLESIZE(modes); j++) `7B
X`09`09/* fix for HAVE_LOSING_SWITCH_WITH_STRUCTURE_OFFSET */
X`09`09switch (modes`5Bj`5D) `7B
X`09`09case CPP_IF:&0209k = VAL_FENCE_IF;`09break;
X`09`09case CPP_ELIF:&0209k = VAL_FENCE_ELIF;`09break;
X`09`09case CPP_ELSE:&0209k = VAL_FENCE_ELSE;`09break;
X`09`09case CPP_ENDIF:&0209k = VAL_FENCE_FI;`09break;
X`09`09default:&0209&0209`09continue;
X`09`09`7D
X`09`09if (lregexec(b_val_rexp(curbp, k)->reg, lp, 0, llength(lp)))
X`09`09`09return modes`5Bj`5D;
X`09`7D
X
X`09return CPP_UNKNOWN;
X`7D
X
X/*
X * Find the match, if any, for a begin/end comment marker.  If we find a
X * match, the regular expression will overlap the given LINE/offset.
X */
Xstatic int
Xmatch_simple(void)
X`7B
X`09C_NUM first = 0;
X`09C_NUM last = llength(DOT.l);
X
X`09for (first = 0; \0B06< last\0E08= S_COL(BlkBegin) + 1) `7B
+-+-+-+-+-+-+-+-  END  OF PART 51 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 52 -+-+-+-+-+-+-+-+
X`09`09if (!lregexec(BlkBegin, DOT.l, first, last))
X`09`09`09break;
X`09`09if ((S_COL(BlkBegin) <= DOT.o)
X`09`09 `26`26 (E_COL(BlkBegin) >  DOT.o))
X`09`09`09return BLK_BEGIN;
X`09`7D
X
X`09for (first = 0; \0B06< last `26`26 DOT.o <= last; last = E_COL(BlkEnd) - 1)
V `7B
X`09`09if (!lregexec(BlkEnd, DOT.l, first, last))
X`09`09`09break;
X`09`09if ((S_COL(BlkEnd) <= DOT.o)
X`09`09 `26`26 (E_COL(BlkEnd) >  DOT.o))
X`09`09`09return BLK_END;
X`09`09if (last >= E_COL(BlkEnd) - 1)
X`09`09`09break;
X`09`7D
X
X`09return BLK_UNKNOWN;
X`7D
X
Xstatic int
Xcomplex_fence(int sdir, int key)
X`7B
X`09int count = 1;
X`09int that = CPP_UNKNOWN;
X
X`09/* patch: this should come from arguments */
X`09if (key == CPP_ENDIF)
X`09`09sdir = REVERSE;
X`09else
X`09`09sdir = FORWARD;
X
X`09/* set up for scan */
X`09if (sdir == REVERSE)
X`09`09DOT.l = lback(DOT.l);
X`09else
X`09`09DOT.l = lforw(DOT.l);
X
X`09while (count > 0 `26`26 !is_header_line(DOT, curbp)) `7B
X`09`09if (((that = match_complex(DOT.l)) != CPP_UNKNOWN)) `7B
X`09`09`09int`09done = FALSE;
X
X`09`09`09switch (that) `7B
X`09`09`09case CPP_IF:
X`09`09&0209if (sdir == FORWARD) `7B
X`09`09&0209`09count++;
X`09`09&0209`7D else `7B
X`09`09&0209`09done = ((count-- == 1) `26`26
X`09`09&0209&0209(key != that));
X`09`09&0209`09if (done)
X`09`09&0209&0209count = 0;
X`09`09&0209`7D
X`09`09&0209break;
X
X`09`09`09case CPP_ELIF:
X`09`09`09case CPP_ELSE:
X`09`09&0209done = ((sdir == FORWARD) `26`26 (count == 1));
X`09`09&0209if (done)
X`09`09&0209`09count = 0;
X`09`09&0209break;
X
X`09`09`09case CPP_ENDIF:
X`09`09&0209if (sdir == FORWARD) `7B
X`09`09&0209`09done = (--count == 0);
X`09`09&0209`7D else `7B
X`09`09&0209`09count++;
X`09`09&0209`7D
X`09`09`09`7D
X
X`09`09`09if ((count <= 0) `7C`7C done) `7B
X`09`09&0209(void) firstnonwhite(FALSE,1);
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X
X`09`09if (sdir == REVERSE)
X`09`09`09DOT.l = lback(DOT.l);
X`09`09else
X`09`09`09DOT.l = lforw(DOT.l);
X
X`09`09if (is_header_line(DOT,curbp) `7C`7C interrupted())
X`09`09`09return FALSE;
X`09`7D
X`09if (count == 0) `7B
X`09`09curwp->w_flag `7C= WFMOVE;
X`09`09if (doingopcmd)
X`09`09`09regionshape = FULLLINE;
X`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X
Xint
Xis_user_fence(int ch, int *sdirp)
X`7B
X`09char *fences = b_val_ptr(curbp,VAL_FENCES);
X`09char *chp, och;
X`09if (!ch)
X`09`09return 0;
X`09chp = strchr(fences, ch);
X`09if (!chp)
X`09`09return 0;
X`09if ((chp - fences) `26 1) `7B
X`09`09/* look for the left fence */
X`09`09och = chp`5B-1`5D;
X`09`09if (sdirp)
X`09`09`09*sdirp = REVERSE;
X`09`7D else `7B
X`09`09/* look for the right fence */
X`09`09och = chp`5B1`5D;
X`09`09if (sdirp)
X`09`09`09*sdirp = FORWARD;
X`09`7D
X`09return och;
X`7D
X
Xstatic int
Xsimple_fence(int sdir, int ch\0806ofence)
X`7B
X`09int count = 1;`09/* Assmue that we're sitting at one end of the fence */
X`09int c;
X
X`09/* scan for fence */
X`09while (InDirection(sdir) `26`26 !interrupted()) `7B
X`09`09c = CurrentChar();
X`09`09if (c == ch) `7B
X`09`09`09++count;
X`09`09`7D else if (c == ofence) `7B
X`09`09`09if (--count <= 0)
X`09`09&0209break;
X`09`09`7D
X`09`7D
X
X`09/* if count is zero, we have a match, move the sucker */
X`09if (count <= 0) `7B
X`09`09if (!doingopcmd `7C`7C doingsweep)
X`09`09`09sweephack = TRUE;
X`09`09else if (sdir == FORWARD)
X`09`09`09forwchar(TRUE,1);
X`09`09curwp->w_flag `7C= WFMOVE;
X`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X
Xstatic int
Xcomment_fence(int sdir)
X`7B
X`09/* avoid overlapping match between begin/end patterns */
X`09if (sdir == FORWARD) `7B
X`09`09SIZE_T off = (\0E06)(DOT.o - S_COL(BlkBegin));
X`09`09if (BlkEnd->mlen > off)
X`09`09`09forwchar(TRUE, BlkEnd->mlen - off);
X`09`7D
X
X`09scanboundry(FALSE,DOT,sdir);
X`09if (scanner((sdir == FORWARD) ? BlkEnd : BlkBegin,
X`09`09`09sdir, FALSE, (int *)0)) `7B
X`09`09if (!doingopcmd `7C`7C doingsweep)
X`09`09`09sweephack = TRUE;
X`09`09if (sdir == FORWARD `26`26 (BlkEnd->mlen > 1))
X`09`09`09forwchar(TRUE, BlkEnd->mlen - 1);
X`09`09curwp->w_flag `7C= WFMOVE;
X`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X
Xstatic int
Xgetfence(
Xint ch, /* fence type to match against */
Xint sdir) /* direction to scan if we're not on a fence to begin with */
X`7B
X`09MARK`09oldpos; `09`09/* original pointer */
X`09register int ofence = 0;`09/* open \1306*/
X`09int s, i;
X`09int key = CPP_UNKNOWN;
X`09int fch;
X
X`09/* save the original cursor position */
X`09oldpos = DOT;
X
X`09/* ch may have been passed, if being used internally */
X`09if (ch < 0) `7B
X`09`09if ((i = firstchar(DOT.l)) < 0)`09/* offset of\2406 nonblank */
X`09`09`09return FALSE;&0209/* line is entirely blank */
X
X`09`09if (DOT.o <= i
X`09`09 `26`26 ((key = match_complex(DOT.l)) != CPP_UNKNOWN)) `7B
X`09`09`09ch = COMPLEX_FENCE_CH;
X`09`09`7D else if ((key = match_simple()) != BLK_UNKNOWN) `7B
X`09`09`09ch = COMMENT_FENCE_CH;
X`09`09`09sdir = (key == BLK_BEGIN) ? FORWARD : REVERSE;
X`09`09`7D else if (sdir == FORWARD) `7B
X`09`09`09/* get the current character */
X`09`09`09if (oldpos.o < llength\1308l)) `7B
X`09`09&0209do `7B
X`09`09&0209`09ch = char_at(oldpos);
X`09`09&0209`7D while(!is_user_fence(ch, (int *)0) `26`26
X`09`09&0209`09++oldpos.o < llength(\1307l));
X`09`09`09`7D
X`09`09`09if (is_at_end_of_line(oldpos)) `7B
X`09`09&0209return FALSE;
X`09`09`09`7D
X`09`09`7D else `7B
X`09`09`09/* get the current character */
X`09`09`09if (oldpos.o >= 0) `7B
X`09`09&0209do `7B
X`09`09&0209`09ch = char_at(oldpos);
X`09`09&0209`7D while(!is_user_fence(ch, (int *)0) `26`26
X`09`09&0209`09--oldpos.o >= 0);
X`09`09`09`7D
X
X`09`09`09if (oldpos.o < 0) `7B
X`09`09&0209return FALSE;
X`09`09`09`7D
X`09`09`7D
X
X`09`09/* we've at least found a fence -- move us that far */
X`09`09DOT.o = oldpos.o;
X`09`7D
X
X`09fch = ch;
X
X`09if (ch >= 0) `7B
X`09`09ofence = is_user_fence(ch, `26sdir);
X`09`09if (ofence)
X`09`09`09fch = PAIRED_FENCE_CH;
X`09`7D
X
X`09/* setup proper matching fence */
X`09if (fch >= 0) `7B
X`09`09if ((key = match_complex(DOT.l)) == CPP_UNKNOWN
X`09`09 `7C`7C (key = match_simple()) == BLK_UNKNOWN)
X`09`09`09return(FALSE);
X`09`7D
X
X`09/* ops are inclusive of the endpoint */
X`09if (doingopcmd `26`26 sdir == REVERSE) `7B
X`09`09forwchar(TRUE,1);
X`09`09pre_op_dot = DOT;
X`09`09backchar(TRUE,1);
X`09`7D
X
X`09if (ok_CPP(key)) `7B  /* we're searching for a cpp keyword */
X`09`09s = complex_fence(sdir, key);
X`09`7D else if (ok_BLK(key)) `7B
X`09`09s = comment_fence(sdir);
X`09`7D else if (ch == '/') `7B
X`09`09s = comment_fence(sdir);
X`09`7D else `7B
X`09`09s = simple_fence(sdir, ch, ofence);
X`09`7D
X
X`09if (s == TRUE)
X`09`09return TRUE;
X
X`09/* restore the current position */
X`09DOT = oldpos;
X`09return(FALSE);
X`7D
X
X/*`09the cursor is moved to a matching fence */
Xint
Xmatchfence(int f, int n)
X`7B
X`09int s = getfence(UNKNOWN_FENCE_CH, (!f `7C`7C n > 0) ? FORWARD:REVERSE);
X`09if (s == FALSE)
X`09`09kbd_alarm();
X`09return s;
X`7D
X
Xint
Xmatchfenceback(int f, int n)
X`7B
X`09int s = getfence(UNKNOWN_FENCE_CH, (!f `7C`7C n > 0) ? REVERSE:FORWARD);
X`09if (s == FALSE)
X`09`09kbd_alarm();
X`09return s;
X`7D
X
X/* get the indent of the line containing the matching brace/paren. */
Xint
Xfmatchindent(int c)
X`7B
X`09int ind;
X
X`09MK = DOT;
X
X`09if (getfence(c,REVERSE) == FALSE) `7B
X`09`09(void)gomark(FALSE,1);
X`09`09return previndent((int *)0);
X`09`7D
X
X`09ind = indentlen(DOT.l);
X
X`09(void)gomark(FALSE,1);
X
X`09return ind;
X`7D
X
X
X
X/*`09Close fences are matched against their partners, and if
X`09on screen the cursor briefly lights there`09`09*/
Xvoid
Xfmatch(int rch)
X`7B
X`09MARK`09oldpos; `09/* original position */
X`09register LINE *toplp;`09/* top line in current window */
X`09register int count;`09/* current fence level\1E06 */
X`09register char c;`09/* current character in scan */
X`09int dir, lch;
X`09int backcharfailed = FALSE;
X
X`09/* get the matching left-fence char, if it exists */
X`09lch = is_user_fence(rch, `26dir);
X`09if (lch == 0 `7C`7C dir != REVERSE)
X`09`09return;
X
X`09/* first get the display update out there */
X`09(void)update(FALSE);
X
X`09/* save the original cursor position */
X`09oldpos = DOT;
X
X`09/* find the top line and set up for scan */
X`09toplp = lback(curwp->w_line.l);
X`09count = 1;
X`09backchar(TRUE, 2);
X
X`09/* scan back until we find it, or reach past the top of the window */
X`09while (count > 0 `26`26 DOT.l != toplp) `7B
X`09`09c = CurrentChar();
X`09`09if (c == rch)
X`09`09`09++count;
X`09`09if (c == lch)
X`09`09`09--count;
X`09`09if (backchar(FALSE, 1) != TRUE) `7B
X`09`09`09backcharfailed = TRUE;
X`09`09`09break;
X`09`09`7D
X`09`7D
X
X`09/* if count is zero, we have a match, display the sucker */
X`09if (count == 0) `7B
X`09`09if (!backcharfailed)
X`09`09`09forwchar(FALSE, 1);
X`09`09if (update(SORTOFTRUE) == TRUE)
X`09`09/* the idea is to leave the cursor there for about a
X`09`09`09quarter of a second */
X`09`09`09catnap(300, FALSE);
X`09`7D
X
X`09/* restore the current position */
X`09DOT = oldpos;
X`7D
X
X#endif /* OPT_CFENCE */
$ call unpack [.VILE-8_0]FENCES.C;1 -
 789673617 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 20 40 152
$!
$ create 'f'
X/*`09FILE.C:   for MicroEMACS
X *
X *`09The routines in this file handle the reading, writing
X *`09and lookup of disk files.  All of details about the
X *`09reading and writing of the disk are in "fileio.c".
X *
X *
X * $Header: /usr/build/vile/vile/RCS/file.c,v 1.227 1998/05/30 11:44:48 tom Ex
Vp $
X *
X */
X
X#include`09"estruct.h"
X#include        "edef.h"
X
Xstatic`09int`09bp2swbuffer(BUFFER *bp, int ask_rerun\0F06lockfl);
Xstatic`09int`09kifile(char *fname);
Xstatic`09int`09writereg(REGION *rp, const char *fn, int msgf, BUFFER *bp, int
V forced);
Xstatic`09void`09readlinesmsg(int n, int s, const char *f\1606rdo);
X
X#if OPT_DOSFILES
X/* give DOS the benefit of the doubt on ambiguous files */
X# if CRLF_LINES
X#  define MORETHAN >=
X# else
X#  define MORETHAN >
X# endif
X#endif
X
X#if !(SYS_MSDOS `7C`7C SYS_WIN31)
Xstatic`09int`09quickreadf(BUFFER *bp, int *nlinep);
X#endif
X
X/*--------\0808\1010\2020\400A*/
X
X/* Returns the modification time iff the path corresponds to an existing file,
V
X * otherwise it returns zero.
X */
X#if`09defined(MDCHK_MODTIME) `7C`7C SYS_VMS\0B08UNIX
Xtime_t
Xfile_modified(char *path)
X`7B
X`09struct stat`09statbuf;
X`09time_t`09`09the_time = 0;
X
X`09if (stat(SL_TO_BSL(path), `26statbuf) >= 0
X#if CC_CSETPP
X`09 `26`26 (statbuf.st_mode `26 S_IFREG) ==\0C09
X#else
X`09 `26`26 (statbuf.st_mode `26 S_IFMT) == S_IFREG)
X#endif
X`09`7B
X#if SYS_VMS
X`09`09the_time = statbuf.st_ctime; /* e.g., creation-time */
X#else
X`09`09the_time = statbuf.st_mtime;
X#endif
X`09`7D
X`09return the_time;
X`7D
X#endif
X
X#ifdef`09MDCHK_MODTIME
Xstatic int
XPromptModtime (
XBUFFER`09*bp,
Xchar *fname,
Xconst char *question,
Xint`09iswrite)
X`7B
X`09int status = SORTOFTRUE;
X`09time_t current;
X`09char prompt`5BNLINE`5D;
X
X`09if (!isInternalName(bp->b_fname)
X`09 `26`26 b_val(bp, MDCHK_MODTIME)
X`09 `26`26 bp->b_active`09/* only buffers that are loaded */
X`09 `26`26 same_fname(fname, bp, FALSE)
X`09 `26`26 get_modtime(bp, `26current)) `7B
X`09`09time_t check_against;
X`09`09const char *remind, *again;
X`09`09if (iswrite) `7B
X`09`09`09check_against = bp->b_modtime;
X`09`09`09remind = "Reminder: ";
X`09`09`09again = "";
X`09`09`7D else `7B
X`09`09`09remind = "";
X`09`09`09if (bp->b_modtime_at_warn) `7B
X`09`09&0209check_against = bp->b_modtime_at_warn;
X`09`09&0209again = "\0906";
X`09`09`09`7D else `7B
X`09`09&0209check_against = bp->b_modtime;
X`09`09&0209again = "";
X`09`09`09`7D
X`09`09`7D
X
X`09`09if (check_against != current) `7B
X`09`09`09(void)lsprintf(prompt,
X`09`09`09"%sFile for buffer `5C"%s`5C" has changed %son disk.  %s",
X`09`09&0209remind, bp->b_bname, again, question);
X`09`09`09if ((status = mlyesno( prompt )) != TRUE)
X`09`09&0209mlerase();
X`09`09`09/* avoid reprompts */
X`09`09`09bp->b_modtime_at_warn = current;
X`09`09`7D
X`09`7D
X`09return status;
X`7D
X
Xint
Xask_shouldchange(BUFFER *bp)
X`7B
X`09int status;
X`09status = PromptModtime(bp, bp->b_fname, "Continue", FALSE);
X`09return (status == TRUE `7C`7C \120ASORTOFTRUE);
X`7D
X
Xint
Xget_modtime (BUFFER *bp, time_t *the_time)
X`7B
X`09if (isInternalName(bp->b_fname))
X`09`09*the_time = 0;
X`09else
X`09`09*the_time = file_modified(bp->b_fname);
X
X`09return (*the_time != 0);
X`7D
X
Xvoid
Xset_modtime(BUFFER *bp, char *fn)
X`7B
X`09time_t`09current;
X
X`09if (same_fname(fn, bp, FALSE) `26`26 get_modtime(bp, `26current)) `7B
X`09`09bp->b_modtime = current;
X`09`09bp->b_modtime_at_warn = 0;
X`09`7D
X`7D
X
Xint
Xcheck_modtime(BUFFER *bp, char *fn)
X`7B
X`09int status = TRUE;
X
X`09if (PromptModtime(bp, fn, "Read from disk", FALSE) == TRUE) `7B
X#if OPT_LCKFILES
X`09`09/* release own lock before read the file again */
X`09`09if ( global_g_val(GMDUSEFILELOCK) ) `7B
X`09`09`09if (!b_val(curbp,MDLOCKED) `26`26 \1A0FVIEW))
X`09`09&0209release_lock(fn);
X`09`09`7D
X#endif
X`09`09status = readin(fn, TRUE, bp\0A06);
X`09`7D
X`09return status;
X`7D
X
Xstatic int
Xinquire_modtime(BUFFER *bp, char *fn)
X`7B
X`09register int status;
X`09if ((status = PromptModtime(bp, fn, "Continue write", TRUE)) != TRUE
X`09 `26`26 (status != SORTOFTRUE)) `7B
X`09`09mlforce("`5BWrite aborted`5D");
X`09`09return FALSE;
X`09`7D
X`09return TRUE;
X`7D
X
Xint
Xcheck_visible_modtimes (void)
X`7B
X`09register WINDOW *wp;
X
X`09for_each_visible_window(wp)
X`09`09(void)check_modtime(wp->w_bufp, \0C0A->b_fname);
X`09return TRUE;
X`7D
X#endif`09/* MDCHK_MODTIME */
X
X#if SYS_UNIX `7C`7C SYS_MSDOS
X#define`09CleanToPipe()`09if (fileispipe) ttclean(TRUE)
X
Xstatic void
XCleanAfterPipe (int Wrote)
X`7B
X`09if (fileispipe == TRUE) `7B
X`09`09ttunclean();`09/* may clear the screen as a side-effect */
X`09        TTflush();
X`09`09if (Wrote) pressreturn();
X`09        sgarbf = TRUE;
X`09`7D
X`7D
X
X#else /* !SYS_UNIX */
X#ifdef GMDW32PIPES
X
Xstatic void
XCleanToPipe(void)
X`7B
X    if (fileispipe)
X    `7B
X        kbd_erase_to_end(0);
X        kbd_flush();
X        TTkclose();
X    `7D
X`7D
X
Xstatic void
XCleanAfterPipe(int Wrote)
X`7B
X    if (fileispipe)
X    `7B
X        TTkopen();
X        if (global_g_val(GMDW32PIPES))
X        `7B
X            if (Wrote) pressreturn();
X            sgarbf = TRUE;
X        `7D
X    `7D
X`7D
X
X#else /* !GMDW32PIPES */
X#define`09CleanToPipe()`09`09TTkclose()
X#define`09CleanAfterPipe(f)`09TTkopen()
X#endif
X#endif /* SYS_UNIX */
X
X/*
X * On faster machines, a pipe-writer will tend to keep the pipe full. This
X * function is used by 'slowreadf()' to test if we've not done an update
X * recently even if this is the case.
X */
X#if SYS_UNIX `26`26 OPT_SHELL
Xstatic int
Xslowtime (time_t *refp)
X`7B
X`09int`09status = FALSE;
X
X`09if (fileispipe) `7B
X`09`09time_t`09temp = time((\1406 *)0);
X
X`09`09status = (!ffhasdata() `7C`7C (temp != *refp));
X`09`09if (status)
X`09`09`09*refp = temp;
X`09`7D
X`09return status;
X`7D
X#else
X#define`09slowtime(refp)`09(fileispipe `26`26 !ffhasdata())
X#endif
X
Xint
Xno_such_file(const char * fname)
X`7B
X`09mlwarn("`5BNo such file `5C"%s`5C"`5D", fname);
X`09return FALSE;
X`7D
X
X#if OPT_VMS_PATH
Xstatic char *
Xversion_of(char *fname)
X`7B
X`09register char`09*s = strchr(fname, ';');
X`09if (s == 0)
X`09`09s = skip_string(fname);
X`09return s;
X`7D
X
Xstatic int
Xexplicit_version(char *ver)
X`7B
X`09if (*ver++ == ';') `7B
X`09`09if (isDigit(*ver))
X`09`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X#endif /* OPT_VMS_PATH */
X
X#if SYS_VMS
Xstatic char *
Xresolve_filename(BUFFER *bp)
X`7B
X`09char`09temp`5BNFILEN`5D;
X`09ch_fname(bp, fgetname(ffp, temp));
X`09markWFMODE(bp);
X`09return bp->b_fname;
X`7D
X#endif
X
X/*
X * Returns true if the given filename is the same as that o\2A06referenced
X * buffer.  The 'lengthen' parameter controls whether we assume the filename i
Vs
X * already in canonical form, since that may be an expensive operation to do i
Vn
X * a loop.
X */
Xint
Xsame_fname(char *fname, BUFFER *bp, int lengthen)
X`7B
X`09char`09temp`5BNFILEN`5D;
X
X`09if (fname == 0
X`09 `7C`7C bp->b_fname == 0
X`09 `7C`7C isInternalName(fname)
X`09 `7C`7C isInternalName(bp->b_fname))
X`09`09return FALSE;
X
X`09if (lengthen)
X`09`09fname = lengthen_path(strcpy(temp, fname));
X
X#if OPT_VMS_PATH
X`09/* ignore version numbers in this comparison unless both are given */
X`09if (is_vms_pathname(fname, FALSE)) `7B
X`09`09char`09*bname = bp->b_fname,
X`09`09`09*s = version_of(bname),
X`09`09`09*t = version_of(fname);
X
X`09`09if (!explicit_version(s)
X`09`09 `7C`7C !explicit_version(t))
X`09`09`09if ((s-bname) == (t-fname))
X`09`09&0209return !strncmp(fname, b\0706(SIZE_T)(s-bname));
X`09`7D
X#endif
X
X`09return !strcmp(fname, bp->b_fname);
X`7D
X
X/*
X * Set the buffer-name based on the filename
X */
Xstatic void
Xset_buffer_name(BUFFER *bp)
X`7B
X        char bname`5BNBUFN`5D;
X
X`09bp->b_bname`5B0`5D = EOS;`09/* ...so 'unqname()' doesn't find me */
X`09makename(bname, bp->b_fname);
X`09unqname(bname);
X`09set_bname(bp, bname);
X`09updatelistbuffers();
X`09markWFMODE(bp);
X`7D
X
X/*
X * Read a file into the current
X * buffer. This is really easy; all you do it
X * find the name of the file, and call the standard
X * "read a file into the current buffer" code.
X */
X/* ARGSUSED */
Xint
Xfileread(int f GCC_UNUSED, int n\120B)
X`7B
X        register int    s;
X`09char fname`5BNFILEN`5D;
X
X`09if (more_named_cmd()) `7B
X`09`09if ((s = mlreply_file("Replace with file: ", (TBUFF **)0,
X`09`09&0209FILEC_REREAD, fname)) != TRUE)
X`09`09`09return s;
X`09`7D
X`09else if (!global_g_val(GMDWARNREREAD)
X`09`09 `7C`7C ((s = mlyesno("Reread current buffer")) == TRUE)) `7B
X`09`09(void)strcpy(fname, curbp->b_fname);
X`09`09/* Check if we are rereading the unnamed-buffer if it is not
X`09`09 * associated with a file.
X`09`09 */
X`09`09if (curbp->b_fname`5B0`5D == EOS
X`09`09   `26`26 eql_bname(curbp, UNNAMED_BufName)) `7B
X`09`09`09s = bclear(curbp);
X`09`09`09if (s == TRUE)
X`09`09&0209mlerase();
X`09`09`09return s;
X`09`09`7D
X`09`7D else `7B
X`09`09return FALSE;
X`09`7D
X
X#if OPT_LCKFILES
X`09/* release own lock before read the replaced file */
X`09if ( global_g_val(GMDUSEFILELOCK) ) `7B
X`09`09if (!b_val(curbp,MDLOCKED) `26`26 \1A0FVIEW))
X`09`09`09release_lock(curbp->b_fname);
X`09`7D
X#endif
X
X`09/* we want no errors or complaints, so mark it unchanged */
X`09b_clr_changed(curbp);
X        s = readin(fname, TRUE, curbp\0D06);
X`09set_buffer_name(curbp);
X`09return s;
X`7D
X
X/*
X * Select a file for editing.
X * Look around to see if you can find the
X * file in another buffer; if you can find it
X * just switch to the buffer. If you cannot find
X * the file, create a new buffer, read in the
X * text, and switch to the new buffer.
X * This is ": e"
X */
X
XTBUFF`09*lastfileedited;
X
Xvoid
Xset_last_file_edited(const char *f)
X`7B
X`09tb_scopy(`26lastfileedited, f);
X`7D
X
X/* ARGSUSED */
Xint
Xfilefind(int f GCC_UNUSED, int n\120B)
X`7B
X`09register int`09s;
X`09register BUFFER *bp;
X
X`09char fname`5BNFILEN`5D;
X`09char *actual;
X`09BUFFER *firstbp = 0;
X
X`09if ((s = mlreply_file("Find file: ", `26lastfileedited,
X`09`09&0209`09FILEC_READ`7C\0B06EXPAND,
X`09`09`09fname)) == TRUE) `7B
X`09`09while ((actual = filec_expand()) != 0) `7B
X`09`09`09if ((bp = getfile2bp(actual, !clexec,FALSE)) == 0)
X`09`09&0209break;
X`09`09`09bp->b_flag `7C= BFARGS;`09/* treat this as an argument */
X`09`09`09if (firstbp == 0)
X`09`09&0209firstbp = bp;
X`09`09`7D
X`09`09if (firstbp != 0)
X`09`09`09s = bp2swbuffer(firstbp, FALSE, TRUE);
X`09`7D
X`09return s;
X`7D
X
X/* ARGSUSED */
Xint
Xviewfile(int f GCC_UNUSED, int n\120B)`09/* visit a file in VIEW mode */
X`7B
X`09char fname`5BNFILEN`5D;`09/* file user wishes to find */
X`09register int s;`09`09/* status return */
X`09char`09*actual;
X`09static`09TBUFF`09*last;
X
X`09if ((s = mlreply_file("View file: ", `26last, FILEC_READ`7C\0B06EXPAND,
X`09`09`09fname)) == TRUE) `7B
X`09`09while ((actual = filec_expand()) != 0) `7B
X`09`09`09if ((s = getfile(actual, FALSE)) != TRUE)
X`09`09&0209break;
X`09`09`09/* if we succeed, put it in view mode */
X`09`09`09make_local_b_val(curwp->w_bufp,MDVIEW);
X`09`09`09set_b_val(curwp->w_bufp,MDVIEW,TRUE);
X`09`09`09markWFMODE(curwp->w_bufp);
X`09`09`7D
X`09`7D
X`09return s;
X`7D
X
X/*
X * Insert a file into the current
X * buffer. This is really easy; all you do it
X * find the name of the file, and call the standard
X * "insert a file into the current buffer" code.
X */
X/* ARGSUSED */
Xint
Xinsfile(int f GCC_UNUSED, int n\120B)
X`7B
X        register int    s;
X`09char fname`5BNFILEN`5D;
X`09static`09TBUFF`09*last;
X
X`09if (!calledbefore) `7B
X`09        if ((s= mlreply_file("Insert file: ", `26last,
X`09`09&0209FILEC_READ`7C\0B06PROMPT, fname)) != TRUE)
X`09        \0808return s;
X`09`7D
X`09if (ukb == 0)
X`09        return ifile(fname, TRUE, (FILE *)0);
X`09else
X`09        return kifile(fname);
X`7D
X
XBUFFER *
Xgetfile2bp(
Xconst char *fname,`09`09/* file name to find */
Xint ok_to_ask,
Xint cmdline)
X`7B
X`09register BUFFER *bp = 0;
X        register int    s;
X`09char bname`5BNBUFN`5D;`09/* buffer name to put file */
X`09char nfname`5BNFILEN`5D;`09/* canonical form of 'fname' */
X
X`09/* user may have renamed buffer to look like filename */
X`09if (cmdline
X`09 `7C`7C (bp = find_b_name(fname)) == NULL
X`09 `7C`7C (strlen(fname) > (SIZE_T)NBUFN-1)) `7B
X
X`09`09/* It's not already here by that buffer name.
X`09`09 * Try to find it assuming we're given the file name.
X`09`09 */
X`09`09(void)lengthen_path(strcpy(nfname, fname));
X`09`09if (is_internalname(nfname)) `7B
X`09`09`09mlforce("`5BBuffer not found`5D");
X`09`09`09return 0;
X`09`09`7D
X`09        for_each_buffer(bp) `7B
X`09`09`09/* is it here by that filename? */
X`09        \0808if (same_fname(nfname, bp, FALSE)) `7B
X`09`09&0209return bp;
X`09        \0808`7D
X`09        `7D
X`09`09/* it's not here */
X`09        makename(bname, nfname);\2008    /* New buffer name.     */
X`09`09/* make sure the buffer name doesn't exist */
X`09`09while ((bp = find_b_name(bname)) != NULL) `7B
X`09`09`09if ( !b_is_changed(bp) `26`26 is_empty_buf\1407
X`09`09`09    &0209!ffexists(bp->b_fname)) `7B
X`09`09&0209/* empty and unmodified -- then it's okay
X`09`09&0209`09to re-use this buffer */
X`09`09&0209bp->b_active = FALSE;
X`09`09&0209ch_fname(bp, nfname);
X`09`09&0209return bp;
X`09`09`09`7D
X`09`09`09/* old buffer name conflict code */
X`09`09`09unqname(bname);
X`09`09`09if (!ok_to_ask `7C`7C !global_g_val(GMDWARNRENAME))
X`09`09&0209continue;
X`09`09`09hst_glue(' ');
X`09`09`09s = mlreply("Will use buffer name: ", bname, sizeof(bname));
X`09        \0808if (s == ABORT)
X`09        \0808\1008return 0;
X`09`09`09if (s == FALSE `7C`7C bname`5B0`5D == EOS)
X`09`09        \0808makename(bname, fname);
X`09        `7D
X`09`09/* okay, we've got a unique name -- create it */
X`09`09if (bp==NULL `26`26 (bp=bfind(bname, 0))\1E06) `7B
X`09`09`09mlwarn("`5BCannot create buffer`5D");
X`09        \0808return 0;
X`09        `7D
X`09`09/* switch and read it in. */
X`09`09ch_fname(bp, nfname);
X`09`7D
X`09return bp;
X`7D
X
Xstatic int
Xbp2swbuffer(BUFFER *bp, int ask_rerun\0F06lockfl)
X`7B
X`09register int s;
X
X`09if ((s = (bp != 0)) != FALSE) `7B
X`09`09if (bp->b_active) `7B
X`09`09`09if (ask_rerun) `7B
X`09`09&0209switch (mlyesno(
X`09`09&0209`09"Old command output -- rerun")) `7B
X`09`09&0209case TRUE:
X`09`09&0209`09bp->b_active = FALSE;
X`09`09&0209`09break;
X`09`09&0209case ABORT:
X`09`09&0209`09s = FALSE;
X`09`09&0209default:
X`09`09&0209`09mlerase();
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09`09`7D else `7B
X`09`09&0209mlwrite("`5BOld buffer`5D");
X`09`09`09`7D
X`09`09`7D
X
X#if BEFORE
X`09`09/*
X`09`09 * The 'swbuffer()' function will invoke 'readin()', but it
X`09`09 * doesn't accept the 'lockfl' parameter, so we call it here.
X`09`09 */
X/* added swbuffer_lfl() to take lockfl arg to get around this problem.  the
X * readin() was happening before a lot of the buffer info was set up, so a
X * user readhook couldn't use that info successfully.
X * if this change appears successful, the bp2readin routine (4 lines) can
X * be folded into swbuffer_lfl(), which is the only caller.  --pgf */
X`09`09if (!(bp->b_active))
X`09`09`09s = bp2readin(bp, lockfl);
X#endif
X`09`09if (s == TRUE)
X`09`09`09s = swbuffer_lfl(bp, lockfl);
X`09`09if (s == TRUE)
X`09`09`09curwp->w_flag `7C= WFMODE`7CWFHARD;
X`09`7D
X
X`09return s;
X`7D
X
Xint
Xgetfile(
Xchar *fname,`09`09/* file name to find */
Xint lockfl)`09`09/* check the file for locks? */
X`7B
X        register BUFFER *bp = 0;
X
X`09/* if there are no path delimiters in the name, the\0F06user
X`09`09is likely asking for an existing buffer -- try for that
X`09`09first */
X        if ((strlen(fname) > (SIZE_T)NBUFN-1)  /* too big to be a bname */
X`09 `7C`7C maybe_pathname(fname)  /* looks a lot like a filename */
X`09 `7C`7C (bp = find_b_name(fname)) == NULL) `7B
X`09`09/* oh well.  canonicalize the name, and try again */
X`09`09bp = getfile2bp(fname,!clexec,FALSE);
X`09`09if (!bp)
X`09`09`09return FALSE;
X`09`7D
X`09return bp2swbuffer(bp, isShellOrPipe(bp->b_fname), lockfl);
X`7D
X
X/*
X * Scan a buffer to see if it contains more lines terminated by CR-LF than by
V
X * LF alone.  If so, set the DOS-mode to true, otherwise false.
X */
X#if OPT_DOSFILES
X/*
X * If the given buffer is one that we're sourcing (e.g., with ":so"), or
X * specified in initialization, we require that _all_ of the lines end with
X * `5EM's before deciding that it is DOS-style.  That is to protect us from
X * accidentally trimming the `5EM's from a :map command.
X */
Xstatic void
Xapply_dosmode(BUFFER *bp, int doslines\0E06unixlines)
X`7B
X`09int result;
X
X`09if (bp->b_flag `26 BFEXEC) `7B
X`09`09if (doslines `26`26 !unixlines) `7B
X`09`09`09result = TRUE;
X`09`09`7D else `7B
X`09`09`09result = FALSE;
X`09`09`7D
X`09`7D else `7B
X`09`09result = (doslines MORETHAN unixlines);
X`09`7D
X`09set_b_val(bp, MDDOS, result);
X`7D
X
Xstatic void
Xguess_dosmode(BUFFER *bp)
X`7B
X`09int`09doslines = 0,
X`09`09unixlines = 0;
X`09register LINE *lp;
X
X`09make_local_b_val(bp, MDDOS);`09/* keep it local, if not */
X`09/* first count 'em */
X`09for_each_line(lp,bp) `7B
X`09`09if (llength(lp) > 0 `26`26
X`09`09&0209lgetc(lp, llength(lp)-1) == '`5Cr') `7B
X`09`09`09doslines++;
X`09`09`7D else `7B
X`09`09`09unixlines++;
X`09`09`7D
X`09`7D
X`09apply_dosmode(bp, doslines, unixlines);
X`09if (b_val(bp, MDDOS)) `7B
X`09`09/* then eliminate 'em if necessary */
X`09`09for_each_line(lp,bp) `7B
X`09`09`09if (llength(lp) > 0 `26`26
X`09`09&0209`09lgetc(lp, llength(lp)-1) == '`5Cr') `7B
X`09`09&0209llength(lp)--;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09bp->b_bytecount -= doslines;
X`09TRACE(("guess_dosmode %d`5Cn", b_val(bp, MDDOS)))
X`7D
X
X/*
X * Forces the current buffer to be in DOS-mode, stripping any trailing CR's.
X * ( any argument forces non-DOS mode, trailing CR's still stripped )
X */
X/*ARGSUSED*/
Xint
Xset_dosmode(int f, int n GCC_UNUSED)
X`7B
X`09make_local_b_val(curbp, MDDOS);
X
X`09guess_dosmode(curbp);
X
X`09/* force dos mode on the buffer, based\1508user argument */
X`09set_b_val(curbp, MDDOS, !f);
X
X`09curwp->w_flag `7C= WFMODE;
X`09return TRUE;
X`7D
X
X/* as above, but forces unix-mode instead */
X/*ARGSUSED*/
Xint
Xset_unixmode(int f, int n)
X`7B
X`09return set_dosmode(!f, n);
X`7D
X#endif
X
X#if OPT_LCKFILES
Xstatic void
Xgrab_lck_file(BUFFER *bp, char *fname)
X`7B
X`09/* Write the lock */
X`09if (global_g_val(GMDUSEFILELOCK)`09`26`26
X`09`09! isShellOrPipe(fname)&0209`26`26
X`09`09! b_val(bp,MDVIEW) )
X`09`7B
X`09`09char`09locker`5B100`5D;
X
X`09`09if ( ! set_lock(fname,locker,sizeof(\0E06)) ) `7B
X`09`09`09/* we didn't get it */
X`09`09`09make_local_b_val(bp,MDVIEW);
X`09`09`09set_b_val(bp,MDVIEW,TRUE);
X`09`09`09make_local_b_val(bp,MDLOCKED);
X`09`09`09set_b_val(bp,MDLOCKED,TRUE);
X`09`09`09make_local_b_val(bp,VAL_LOCKER);
X`09`09`09set_b_val_ptr(bp,VAL_LOCKER, strmalloc(locker));
X`09`09`09markWFMODE(bp);
X`09`09`7D
X`09`7D
X`7D
X#endif
X
X/*
X *`09Read file "fname" into a buffer, blowing away any text
X *`09found there.  Returns the final status of the read.
X */
X
X/* ARGSUSED */
Xint
Xreadin(
Xchar    *fname,`09`09/* name of file to read */
Xint`09lockfl,`09`09/* check for file locks? */
Xregister BUFFER *bp,`09/* read into this buffer */
+-+-+-+-+-+-+-+-  END  OF PART 52 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 53 -+-+-+-+-+-+-+-+
Xint`09mflg)`09`09/* print messages? */
X`7B
X        register WINDOW *wp;
X`09register int    s;
X        int    nline;
X
X`09if (bp == 0)`09`09&0209/* doesn't hurt to check */
X`09`09return FALSE;
X
X`09if (*fname == EOS) `7B
X`09`09mlwrite("BUG: readin called with NULL fname");
X`09`09return FALSE;
X`09`7D
X
X#if`09OPT_ENCRYPT
X`09if ((s = resetkey(bp, fname)) != TRUE)
X`09`09return s;
X#endif
X
X        if ((s=bclear(bp)) != TRUE) \2408    /* Might be old.\4008*/
X        \0808return s;
X
X#if`09OPT_ENCRYPT
X`09/* bclear() gets rid of local flags */
X`09if (bp->b_key`5B0`5D != EOS) `7B
X`09`09make_local_b_val(bp, MDCRYPT);
X`09`09set_b_val(bp, MDCRYPT, TRUE);
X`09`7D
X#endif
X
X`09b_clr_flags(bp, BFINVS`7CBFCHG);
X`09ch_fname(bp,fname);
X`09fname = bp->b_fname;`09`09/* this may have been b\2006! */
X#if OPT_DOSFILES
X`09make_local_b_val(bp, MDDOS);
X`09/* assume that if our OS wants it,\1906the buffer will have CRLF
X`09 * lines.  this may change when the file is read, based on actual
X`09 * line counts, below.  otherwise, if there's an error, or the
X`09 * file doesn't exist, we will keep this default.
X`09 */
X`09set_b_val(bp, MDDOS, CRLF_LINES);
X#endif
X`09make_local_b_val(bp,MDNEWLINE);
X`09set_b_val(bp, MDNEWLINE, TRUE);`09`09/* assume we've got it */
X
X        if ((s = ffropen(fname)) == FIOERR) `7B`09/* Hard file error.\4106*/
X`09`09`09/* do nothing -- error has been reported,
X`09`09&0209and it will appear as empty buffer */
X`09`09/*EMPTY*/;
X        `7D else if (s == FIOFNF) `7B`09`09/* File not found.\3506*/
X        \0808if (mflg)
X`09`09`09mlwrite("`5BNew file`5D");
X        `7D else `7B
X
X        `09if (mflg)
X`09`09`09mlforce("`5BReading %s `5D", fname);
X#if SYS_VMS
X`09`09if (!isInternalName(bp->b_fname))
X`09`09`09fname = resolve_filename(bp);
X#endif
X`09`09/* read the file in */
X        `09nline = 0;
X#if OPT_WORKING
X`09`09max_working = cur\0E0Bold\1C0B0;
X#endif
X#if ! (SYS_MSDOS`7C`7CSYS_WIN31)
X`09`09if (fileispipe `7C`7C (s = quickreadf(bp, `26nline)) == FIOMEM)
X#endif
X`09`09`09s = slowreadf(bp, `26nline);
X#if OPT_WORKING
X`09`09cur_working = 0;
X#endif
X`09`09if (s == FIOERR) `7B
X`09`09`09/*EMPTY*/;
X`09`09`7D else `7B
X
X`09`09`09if (s == FIOFUN)`09/* last line is incomplete */
X`09`09&0209set_b_val(bp, MDNEWLINE, FALSE);
X`09`09`09b_clr_changed(bp);
X#if OPT_FINDERR
X`09`09`09if (fileispipe == TRUE)
X`09`09&0209set_febuff(bp->b_bname);
X#endif
X        `09`09(void)ffclose();`09/* Ignore errors.\2C07*/
X`09`09`09if (mflg)
X`09`09&0209readlinesmsg(nline, s, fname, ffronly(fname));
X
X`09`09`09/* set view mode for read-only files */
X`09`09`09if ((global_g_val(GMDRONLYVIEW) `26`26 ffronly(fname) )) `7B
X`09`09&0209make_local_b_val(bp, MDVIEW);
X`09`09&0209set_b_val(bp, MDVIEW, TRUE);
X`09`09`09`7D
X`09`09`09/* set read-only mode for\130Bfiles */
X`09`09`09if (isShellOrPipe(fname) `7C`7C
X`09`09&0209(global_g_val(GMDRONLYRONLY) `26`26
X`09`09&0209&0209ffronly(fname) )) `7B
X`09`09&0209make_local_b_val(bp, MDREADONLY);
X`09`09&0209set_b_val(bp, MDREADONLY, TRUE);
X`09`09`09`7D
X
X`09`09`09bp->b_active = TRUE;
X`09`09`09bp->b_lines_on_disk = \160Acount;
X`09`09`7D
X
X`09`7D
X
X`09/*
X`09 * Set the majormode if the file's suffix matches.
X`09 */
X`09setm_by_suffix(bp);
X`09setm_by_preamble(bp);
X
X`09for_each_window(wp) `7B
X`09`09if (wp->w_bufp == bp) `7B
X`09`09`09wp->w_line.l = lforw(buf_head(bp));
X`09`09`09wp->w_dot.l  = lforw(buf_head(bp));
X`09`09`09wp->w_dot.o  = 0;
X#if WINMARK
X`09`09`09wp->w_mark = nullmark;
X#endif
X`09`09`09wp->w_lastdot = nullmark;
X`09`09`09wp->w_flag `7C= WFMODE`7CWFHARD;
X`09`09`7D
X`09`7D
X`09imply_alt(fname, FALSE, lockfl);
X`09updatelistbuffers();
X
X#if OPT_LCKFILES
X`09if (lockfl `26`26 s != FIOERR)
X`09`09grab_lck_file(bp,fname);
X#endif
X#if OPT_PROCEDURES
X`09if (s <= FIOEOF) `7B
X`09    static int readhooking;
X`09    if (!readhooking `26`26 *\1008 &0226 !b_is_temporary(bp)) `7B
X`09`09    readhooking = TRUE;
X`09`09    run_procedure(readhook);
X`09`09    readhooking = FALSE;
X`09    `7D
X`09`7D
X#endif
X`09b_match_attrs_dirty(bp);
X`09return (s != FIOERR);
X`7D
X
X/*
X * Read the file into a given buffer, setting dot to \2D06rst line.
X */
Xint
Xbp2readin(BUFFER *bp, int lockfl)
X`7B
X`09register int s = readin(bp->b_fname, lockfl, bp, TRUE);
X`09bp->b_dot.l  = lforw(buf_head(bp));
X`09bp->b_dot.o  = 0;
X`09bp->b_active = TRUE;
X`09return s;
X`7D
X
X#if ! (SYS_MSDOS `7C`7C SYS_WIN31)
Xstatic int
Xquickreadf(register BUFFER *bp, int *nlinep)
X`7B
X        register UCHAR *textp;
X        UCHAR *countp;
X`09L_NUM nlines;
X        int incomplete = FALSE;
X`09B_COUNT len, nbytes;
X
X`09if ((len = ffsize()) < 0) `7B
X`09    `09mlwarn("`5BCan't size file`5D");
X`09`09return FIOERR;
X`09`7D
X
X`09/* avoid malloc(0) problems down below; let slowreadf() do the work */
X`09if (len == 0)
X`09`09return FIOMEM;
X#if OPT_WORKING
X`09max_working = len;
X#endif
X`09/* leave an extra byte at the front, for the length of\1D06irst
X`09`09line.  after that, lengths go in place of the newline at
X`09`09the end of the previous line */
X`09bp->b_ltext = castalloc(UCHAR, (ALLOC_T)(len + 2));
X`09if (bp->b_ltext == NULL)
X`09`09return FIOMEM;
X
X`09if ((len = ffread((char *)`26bp->b_ltext`5B1`5D, len)) < 0) `7B
X`09`09FreeAndNull(bp->b_ltext);
X`09`09mlerror("reading");
X`09`09return FIOERR;
X`09`7D
X
X#if OPT_ENCRYPT
X`09if (b_val(bp, MDCRYPT)
X`09 `26`26 bp->b_key`5B0`5D) `7B`09/* decrypt the file */
X`09 `09char`09temp`5BNPAT`5D;
X`09`09(void)strcpy(temp, bp->b_key);
X`09`09ue_crypt((char *)0, 0);
X`09`09ue_crypt(temp, strlen(temp));
X`09`09ue_crypt((char *)`26bp->b_ltext`5B1`5D, (ALLOC_T)len);
X`09`7D
X#endif
X
X`09/* loop through the buffer, replacing all newlines with the
X`09`09length of the _following_ line */
X`09bp->b_ltext_end = \120B + len + 1;
X`09countp = bp->b_ltext;
X`09textp = countp + 1;
X`09nbytes = len;
X        nlines = 0;
X
X`09if (textp`5Blen-1`5D != '`5Cn') `7B
X`09`09textp`5Blen++`5D = '`5Cn';
X`09`09set_b_val(bp, MDNEWLINE, FALSE);
X`09`7D
X
X`09while (len--) `7B
X`09`09if (*textp == '`5Cn') `7B
X`09`09`09if (textp - countp >= 255) `7B
X`09`09&0209UCHAR *np;
X#if OPT_WORKING
X`09`09&0209max_working = bp->b_ltext_end - countp;
X#endif
X`09`09&0209len = (B_COUNT)(countp - bp->b_ltext);
X`09`09&0209incomplete = TRUE;
X`09`09&0209/* we'll re-read the rest later */
X`09`09&0209if (len)  `7B
X`09`09&0209`09ffseek(len);
X`09`09&0209`09np = castrealloc(UCHAR, bp->b_ltext, (ALLOC_T)len);
X`09`09&0209`7D else `7B
X`09`09&0209`09np = NULL;
X`09`09&0209`7D
X`09`09&0209if (np == NULL) `7B
X`09`09&0209`09ffrewind();
X`09`09&0209`09FreeAndNull(bp->b_ltext);
X`09`09&0209`09return FIOMEM;
X`09`09&0209`7D
X`09`09&0209bp->b_ltext = np;
X`09`09&0209bp->b_ltext_end = np + len + 1;
X`09`09&0209nbytes = len;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09*countp = textp - \1107- 1;
X`09`09`09countp = textp;
X`09`09`09nlines++;
X`09`09`7D
X`09`09++textp;
X`09`7D
X
X`09if (nlines == 0) `7B
X`09`09ffrewind();
X`09`09FreeAndNull(bp->b_ltext);
X`09`09incomplete = TRUE;
X`09`7D else `7B
X`09`09/* allocate all of the line structs we'll need */
X`09`09bp->b_LINEs = typeallocn(LINE,nlines);
X`09`09if (bp->b_LINEs == NULL) `7B
X`09`09`09FreeAndNull(bp->b_ltext);
X`09`09`09ffrewind();
X`09`09`09return FIOMEM;
X`09`09`7D
X`09`09bp->b_LINEs_end = \120B + nlines;
X`09`09bp->b_bytecount = nbytes;
X`09`09bp->b_linecount = nlines;
X`09`09b_set_counted(bp);
X
X`09`09/* loop through the buffer again, creating
X`09`09`09line data structure for each line */
X`09`09`7B
X`09`09`09register LINE *lp;
X#if !SMALLER
X`09`09`09L_NUM lineno = 0;
X#endif
X`09`09`09lp = bp->b_LINEs;
X`09`09`09textp = bp->b_ltext;
X`09`09`09while (lp != bp->b_LINEs_end) `7B
X#if !SMALLER
X`09`09&0209lp->l_number = ++lineno;
X#endif
X`09`09&0209lp->l_used = *textp;
X`09`09&0209lp->l_size = *textp + 1;
X`09`09&0209lp->l_text = (char *)textp + 1;
X`09`09&0209set_lforw(lp, lp + 1);
X`09`09&0209if (lp != bp->b_LINEs)
X`09`09&0209`09set_lback(lp, lp - 1);
X`09`09&0209lsetclear(lp);
X`09`09&0209lp->l_nxtundo = null_ptr;
X`09`09&0209lp++;
X`09`09&0209textp += *\0A07 1;
X`09`09`09`7D
X`09`09`09/*
X`09`09`09if (textp != bp->b_ltext_end - 1)
X`09`09&0209mlwrite("BUG: textp not equal to end %d %d",
X`09`09&0209`09textp,bp->b_ltext_end);
X`09`09`09*/
X`09`09`09lp--;  /* point at last line again */
X
X`09`09`09/* connect the end of the list */
X`09`09`09set_lforw(lp, buf_head(bp));
X`09`09`09set_lback(buf_head(bp), lp);
X
X`09`09`09/* connect the front of the list */
X`09`09`09set_lback(bp->b_LINEs, buf_head(bp));
X`09`09`09set_lforw(buf_head(bp), bp->b_LINEs);
X`09`09`7D
X`09`7D
X
X`09*nlinep = nlines;
X
X`09if (incomplete)
X`09`09return FIOMEM;
X#if OPT_DOSFILES
X`09if (global_b_val(MDDOS))
X`09`09guess_dosmode(bp);
X#endif
X`09return b_val(bp, MDNEWLINE) ? FIOSUC : FIOFUN;
X`7D
X
X#endif /* ! SYS_MSDOS */
X
Xint
Xslowreadf(register BUFFER *bp, int *nlinep)
X`7B
X`09int s;
X`09int len;
X#if OPT_DOSFILES
X`09int`09doslines = 0,
X`09`09unixlines = 0;
X#endif
X#if SYS_UNIX `7C`7C SYS_MSDOS\0D08WIN31\1A08OS2\180BNT`09/* i.e., we can read
V from a pipe */
X`09USHORT`09flag = 0;
X`09int`09done_update = FALSE;
X#endif
X#if SYS_UNIX `26`26 OPT_SHELL
X`09time_t`09last_updated = time((\1C06 *)0);
X#endif
X`09b_set_counted(bp);`09/* make 'addline()' do the counting */
X#if OPT_DOSFILES
X`09/*
X`09 * There might be some pre-existing lines if quickreadf
X`09 * read part of the file and then left the rest up to us.
X`09 */
X`09make_local_b_val(bp, MDDOS);`09/* keep it local, if not */
X`09if (global_b_val(MDDOS)) `7B
X`09`09register LINE   *lp;
X`09`09for_each_line(lp,bp) `7B
X`09`09`09if (llength(lp) > 0 `26`26
X`09`09&0209  lgetc(lp, llength(lp)-1) == '`5Cr') `7B
X`09`09&0209doslines++;
X`09`09`09`7D else `7B
X`09`09&0209unixlines++;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X#endif
X`09bp->b_lines_on_disk = 0;
X        while ((s = ffgetline(`26len)) <= FIOSUC) `7B
X`09`09bp->b_lines_on_disk += 1;
X#if OPT_DOSFILES
X`09`09/*
X`09`09 * Strip CR's if we are reading in DOS-mode.  Otherwise,
X`09`09 * keep any CR's that we read.
X`09`09 */
X`09`09if (global_b_val(MDDOS)) `7B
X`09`09`09if (len > 0 `26`26 fline`5Blen-1`5D == '`5Cr') `7B
X`09`09&0209doslines++;
X`09`09`09`7D else `7B
X`09`09&0209unixlines++;
X`09`09`09`7D
X`09`09`7D
X#endif
X`09`09if (addline(bp,fline,len) != TRUE) `7B
X        \0808\1008s = FIOMEM;\230D/* Keep message on the  */
X        \0808\1008break;\1E12/* display.\3B0D*/
X        \0808`7D
X#if SYS_UNIX `7C`7C SYS_MSDOS\0D08WIN31\1A08OS2\180BNT
X`09`09else `7B
X        \0808`09/* reading from a pipe, and internal? */
X`09`09`09if (slowtime(`26last_updated)) `7B
X`09`09&0209register WINDOW *wp;
X
X`09`09&0209flag `7C= (WFEDIT`7CWFFORCE);
X
X`09`09&0209if (!done_update `7C`7C bp->b_nwnd > 1)
X`09`09&0209`09flag `7C= WFHARD;
X`09`09&0209for_each_window(wp) `7B
X`09`09`09        \0808if (wp->w_bufp == bp) `7B
X`09`09`09        \0808\1008wp->w_line.l=
X`09`09&0209&0309lforw(buf_head(bp));
X`09`09`09        \0808\1008wp->w_dot.l =
X`09`09&0209&0309lback(buf_head(bp));
X`09`09`09        \0808\1008wp->w_dot.o = 0;
X`09`09&0209&0209wp->w_flag `7C= flag;
X`09`09&0209&0209wp->w_force = -1;
X`09`09`09        \0808`7D
X`09`09`09        `7D
X
X`09`09&0209/* track changes in dosfile as lines arrive */
X#if OPT_DOSFILES
X`09`09&0209if (global_b_val(MDDOS))
X`09`09&0209`09apply_dosmode(bp, doslines, unixlines);
X#endif
X`09`09&0209curwp->w_flag `7C= WFMODE`7CWFKILLS;
X`09`09&0209if (!update(TRUE)) `7B
X`09`09&0209`09s = FIOERR;
X`09`09&0209`09break;
X`09`09&0209`7D
X#if DISP_X11
X`09`09&0209/* to pick up intrc if it's been hit */
X`09`09&0209x_move_events();
X#endif
X`09`09&0209done_update = TRUE;
X`09`09&0209flag = 0;
X`09`09`09`7D else `7B
X`09`09&0209flag `7C= WFHARD;
X`09`09`09`7D
X
X`09`09`7D
X#endif
X        \0808++(*nlinep);
X`09`09if (s == FIOFUN) `7B
X`09`09`09set_b_val(bp, MDNEWLINE, FALSE);
X`09`09`09break;
X`09`09`7D
X        `7D
X#if OPT_DOSFILES
X`09if (global_b_val(MDDOS)) `7B
X`09`09apply_dosmode(bp, doslines, unixlines);
X`09`09if (b_val(bp, MDDOS)) `7B  /* if it _is_ a dos file, strip 'em */
X        `09`09register LINE   *lp;
X`09`09`09for_each_line(lp,bp) `7B
X`09`09&0209if (llength(lp) > 0 `26`26
X`09`09&0209`09  lgetc(lp, llength(lp)-1) == '`5Cr') `7B
X`09`09&0209`09llength(lp)--;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09bp->b_bytecount -= doslines;
X`09`09`7D
X`09`7D
X#endif
X`09return s;
X`7D
X
X/* utility routine for no. of lines read */
Xstatic void
Xreadlinesmsg(int n, int s, const char *f\1606rdo)
X`7B
X`09char fname`5BNFILEN`5D;
X`09const char *m;
X`09char *short_f = shorten_path(strcpy(fname,f),TRUE);
X`09switch(s) `7B
X`09`09case FIOFUN:`09m = "INCOMPLETE LINE, ";break;
X`09`09case FIOERR:`09m = "I/O ERROR, ";`09break;
X`09`09case FIOMEM:`09m = "OUT OF MEMORY, ";`09break;
X`09`09case FIOABRT:`09m = "ABORTED, ";`09break;
X`09`09default:`09m = "";&0209`09break;
X`09`7D
X`09if (!global_b_val(MDTERSE))
X`09`09mlwrite("`5B%sRead %d line%s from `5C"%s`5C"%s`5D", m,
X`09`09`09n, PLURAL(n), short_f, rdo ? "  (read-only)":"" );
X`09else
X`09`09mlforce("`5B%s%d lines`5D",m,n);
X`7D
X
X/*
X * Take a (null-terminated) file name, and from it
X * fabricate a buffer name. This routine knows
X * about the syntax of file names on the target system.
X * I suppose that this information could be put in
X * a better place than a line of code.
X */
X
Xvoid
Xmakename(char *bname, const char *fname)
X`7B
X`09register char *fcp;
X        register char *bcp;
X`09register int j;
X`09char`09temp`5BNFILEN`5D;
X
X`09fcp = skip_string(strcpy(temp, fname));
X#if OPT_VMS_PATH
X`09if (is_vms_pathname(temp, TRUE)) `7B
X`09`09(void)strcpy(bname, "NoName");
X`09`09return;
X`09`7D
X`09if (is_vms_pathname(temp, FALSE)) `7B
X`09`09for (;
X`09`09`09fcp > temp `26`26 !strchr(":`5D", fcp`5B-1`5D);
X`09`09&0209fcp--)
X`09`09&0209;
X`09`09(void)strncpy0(bname, fcp, NBUFN);
X`09`09strip_version (bname);
X`09`09(void)mklower(bname);
X`09`09return;
X`09`7D
X#endif
X`09/* trim trailing whitespace */
X`09while (fcp != temp `26`26 (isBlank(fcp`5B-1`5D)
X#if SYS_UNIX `7C`7C OPT_MSDOS_PATH`09/* trim trailing slashes as well */
X`09`09&0209`09 `7C`7C is_slashc(fcp`5B-1`5D)
X#endif
X`09`09&0209&0309) )
X        \0808*(--fcp) = EOS;
X`09fcp = temp;
X`09/* trim leading whitespace */
X`09while (isBlank(*fcp))
X`09`09fcp++;
X
X#if     SYS_UNIX `7C`7C SYS_MSDOS\0D08WIN31\1A08VMS\2508OS2\230BNT
X`09bcp = bname;
X`09if (isShellOrPipe(fcp)) `7B
X`09`09/* ...it's a shell command; bname is first word */
X`09`09*bcp++ = SCRTCH_LEFT`5B0`5D;
X`09`09*bcp++ = SHPIPE_LEFT`5B0`5D;
X`09`09do `7B
X`09`09`09++fcp;
X`09`09`7D while (isSpace(*fcp));
X`09`09(void)strncpy0(bcp, fcp, (SIZE_T)(NBUFN - (bcp - bname)));
X`09`09for (j = 4; (j < NBUFN) `26`26 isPrint(*bcp); j++) `7B
X`09`09`09bcp++;
X`09`09`7D
X`09`09(void) strcpy(bcp, SCRTCH_RIGHT);
X`09`09return;
X`09`7D
X
X`09(void)strncpy0(bcp, pathleaf(fcp), (SIZE_T)(NBUFN - (bcp - bname)));
X
X#if`09SYS_UNIX
X`09/* UNIX filenames can have any characters (other than EOS!).  Refuse
X`09 * (rightly) to deal with leading/trailing blanks, but allow embedded
X`09 * blanks.  For this special case, ensure that the buffer name has no
X`09 * blanks, otherwise it is difficult to reference from commands.
X`09 */
X`09for (j = 0; j < NBUFN; j++) `7B
X`09`09if (*bcp == EOS)
X`09`09`09break;
X`09`09if (isSpace(*bcp))
X`09`09`09*bcp = '-';
X`09`09bcp++;
X`09`7D
X#endif
X
X#else`09/* !(SYS_UNIX`7C`7CSYS_VMS\0906MSDOS) */
X
X`09bcp = skip_string(fcp);
X`09`7B
X`09`09register char *cp2 = bname;
X`09`09strcpy0(bname, bcp, NBUFN);
X`09`09cp2 = strchr(bname, ':');
X`09`09if (cp2) *cp2 = EOS;
X`09`7D
X#endif
X`7D
X
X
Xvoid
Xunqname(`09/* make sure a buffer name is unique */
Xchar *name)`09/* name to check on */
X`7B
X`09register SIZE_T`09j;
X`09char newname`5BNBUFN * 2`5D;
X`09char suffixbuf`5BNBUFN`5D;
X`09int suffixlen;
X`09int adjust;
X`09int i = 0;
X`09SIZE_T k;
X
X`09j = strlen(name);
X`09if (j == 0)
X`09`09j = strlen(strcpy(name, "NoName"));
X
X`09/* check to see if it is in the buffer list */
X`09strcpy(newname, name);
X`09adjust = is_scratchname(newname);
X`09while (find_b_name(newname) != NULL) `7B
X`09`09/* from "foo" create "foo-1" or\0B06a1b5" */
X`09`09/* from "thisisamuchlongernam" create
X`09`09`09"thisisamuchlongern-1" or
X`09`09`09"thisisamuchlong-a1b5" */
X`09`09/* that is, put suffix at end if it fits, or else
X`09`09`09overwrite some of the name to make it fit */
X`09`09/* the suffix is in "base 36" */
X`09`09suffixlen = (int)(lsprintf(\1B06buf,"-%r", 36, ++i) - \1C09);
X`09`09k = NBUFN - 1 - suffixlen;
X`09`09if (j < k)
X`09`09`09k = j;
X`09`09if (adjust) `7B
X`09`09`09strcpy(`26newname`5Bk-1`5D, suffixbuf);
X`09`09`09strcat(newname, SCRTCH_RIGHT);
X`09`09`7D else
X`09`09`09strcpy(`26newname`5Bk`5D, suffixbuf);
X`09`7D
X`09strncpy0(name, new\0906NBUFN);
X`7D
X
X/*
X * Ask for a file name, and write the
X * contents of the current buffer to that file.
X */
Xint
Xfilewrite(int f, int n)
X`7B
X        register int    s;
X        char\0C08    fname`5BNFILEN`5D;
X`09int `09`09forced = (f `26`26 n == SPECIAL_BANG_ARG);
X
X`09if (more_named_cmd()) `7B
X`09        if ((s= mlreply_file("Write to file: ", (TBUFF **)0,
X`09`09&0209FILEC_WRITE, fname)) != TRUE)
X`09        \0808return s;
X        `7D else
X`09`09(void) strcpy(fname, curbp->b_fname);
X
X        if ((s=writeout(fname,curbp,forced,TRUE)) == TRUE)
X`09`09unchg_buff(curbp, 0);
X        return s;
X`7D
X
X/*
X * Save the contents of\1006urrent
X * buffer in its associatd file.
X * Error if there is no remembered file
X * name for the buffer.
X */
X/* ARGSUSED */
Xint
Xfilesave(int f, int n)
X`7B
X        register int    s;
X`09int forced = (f `26`26 n == SPECIAL_BANG_ARG); /* then it was :w! */
X
X        if (curbp->b_fname`5B0`5D == EOS) `7B`09`09/* Must have a name.    */
V
X        \0808mlwarn("`5BNo file name`5D");
X        \0808return FALSE;
X        `7D
X
X        if ((s=writeout(curbp->b_fname,curbp,forced,TRUE)) == TRUE)
X`09`09unchg_buff(curbp, 0);
X        return s;
X`7D
X
Xstatic void
Xsetup_file_region(BUFFER *bp, REGION *rp)
X`7B
X`09(void)bsizes(bp);`09/* make sure we have current count */
X`09/* starting at the beginning of\1106uffer */
X`09rp->r_orig.l = lforw(buf_head(bp));
X        rp->r_orig.o = 0;
X        rp->r_size   = bp->b_bytecount;
X        rp->r_end    = bp->b_line;
X`7D
X
X/*
X * Write a whole file
X */
Xint
Xwriteout(const char *fn, BUFFER *bp, int forced\0C06msgf)
X`7B
X        REGION region;
X
X`09setup_file_region(bp, `26\0C06);
X
X`09return writereg(`26region, fn, msgf, bp, forced);
X`7D
X
X/*
X * Write the currently-selected region (i.e., the range of lines from DOT to
X * MK, inclusive).
X */
Xint
Xwriteregion(void)
X`7B
X        REGION region;
X`09int status;
X        char fname`5BNFILEN`5D;
X
X`09if (end_named_cmd()) `7B
X`09`09if (mlyesno("Okay to write `5Bpossible`5D partial range") != TRUE) `7B
X`09`09`09mlwrite("Range not written");
X`09`09`09return FALSE;
X`09`09`7D
X`09`09(void)strcpy(fname, curbp->b_fname);
X`09`7D else `7B
X`09        if ((status = mlreply_file("Write region to file: ",
X`09`09`09(TBUFF **)0, FILEC_WRITE`7C\0C06PROMPT, fname)) != TRUE)
X`09        \0808return status;
X        `7D
X        if ((status=getregion(`26\0806)) == TRUE)
X`09`09status = writereg(`26region, fname, TRUE, curbp, FALSE);
X`09return status;
X`7D
X
X
Xstatic int
Xwritereg(
XREGION`09*rp,
Xconst char  *given_fn,
Xint `09msgf,
XBUFFER`09*bp,
Xint`09forced)
X`7B
X        register int    s;
X        register LINE   *lp;
X        register int    nline;
X`09register int i;
X`09char`09fname`5BNFILEN`5D, *fn;
X`09B_COUNT`09nchar;
X`09const char * ending =
X#if OPT_DOSFILES
X`09`09`09b_val(bp, MDDOS) ? "`5Cr`5Cn" : "`5Cn"
X#else
X`09`09`09"`5Cn"
X#endif`09/* OPT_DOSFILES */
X`09`09;
X`09C_NUM`09offset = rp->r_orig.o;
X
X`09/* this is adequate as long as we cannot write parts of lines */
X`09int`09whole_file = (rp->r_orig.l == lforw(buf_head(bp)))
X`09`09`09  `26`26 (rp->r_end.l == buf_head(bp));
X
X`09if (is_internalname(given_fn)) `7B
X`09`09mlwarn("`5BNo filename`5D");
X`09`09return FALSE;
X`09`7D
X
X`09if (!forced `26`26 b_val(bp,MDREADONLY)) `7B
X`09`09mlwarn("`5BBuffer mode is `5C"readonly`5C"`5D");
X`09`09return FALSE;
X`09`7D
X
X`09if (isShellOrPipe(given_fn)
X`09 `26`26 bp->b_fname != 0
X`09 `26`26 !strcmp(given_fn, bp->b_fname)
X`09 `26`26 mlyesno("Are you sure (this was a pipe-read)") != TRUE) `7B
X`09`09mlwrite("File not written");
X`09`09return FALSE;
X`09`7D
X
X#if OPT_PROCEDURES
X`09`7B
X`09    static int writehooking;
X
X`09    if (!writehooking `26`26 *\1109) `7B
X`09`09    writehooking = TRUE;
X`09`09    run_procedure(writehook);
X`09`09    writehooking = FALSE;
X
X`09`09    /*
X`09`09     * The write-hook may have modified the buffer.  Assume
X`09`09     * the worst, and reconstruct the region.
X`09`09     */
X`09`09    (void)bsizes(bp);
X`09`09    if (whole_file
X`09`09     `7C`7C line_no(bp, rp->r_orig.l) > bp->b_linecount
X`09`09     `7C`7C line_no(bp, rp->r_end.l)  > bp->b_linecount) `7B
X`09`09`09setup_file_region(bp, rp);
X`09`09    `7D else `7B
X`09`09`09DOT = rp->r_orig;
X`09`09`09MK  = rp->r_end;
X`09`09`09(void)getregion(rp);
X`09`09    `7D
X`09`09    offset = rp->r_orig.o;
X`09    `7D
X`09`7D
X#endif
X
X`09fn = lengthen_path(strcpy(fname, given_fn));
X`09if (same_fname(fn, bp, FALSE) `26`26 b_val(bp,MDVIEW)) `7B
X`09`09mlwarn("`5BCan't write-back from view mode`5D");
X`09`09return FALSE;
X`09`7D
X
X#if`09OPT_ENCRYPT
X`09if ((s = resetkey(curbp, fn)) != TRUE)
X`09`09return s;
X#endif
X
X#ifdef MDCHK_MODTIME
X`09if ( ! inquire_modtime( bp, fn ) )
X`09`09return FALSE;
X#endif
X        if ((s=ffwopen(fn,forced)) != FIOSUC) \2E06/* Open writes message. */
V
X        \0808return FALSE;
X
X`09/* tell us we're writing */
X`09if (msgf == TRUE)
X`09`09mlwrite("`5BWriting...`5D");
X
X`09if (isShellOrPipe(given_fn)) `7B
X`09`09beginDisplay();
X`09`09CleanToPipe();
X`09`7D
X
X        lp = rp->r_orig.l;
X        nline = 0;\1208\1A08\100E/* Number of lines     */
X        nchar = 0;\1208\1A08\100E/* Number of chars     */
X
X`09/* first (maybe partial) line and succeeding whole lines */
X        while ((rp->r_size+offset) >= llength(lp)+1) `7B
X`09`09register C_NUM`09len = llength(lp) - offset;
X`09`09register char`09*text = lp->l_text + offset;
X
X`09`09/* If this is the last line (and no fragment will be written
X`09`09 * after the line), allow 'newline' mode to suppress the
X`09`09 * trailing newline.
X`09`09 */
X`09`09if ((rp->r_size -= (len + 1)) <= 0
X`09`09 `26`26 !b_val(bp,MDNEWLINE))
X`09`09`09ending = "";
X        \0808if ((s = ffputline(text, len, ending)) != FIOSUC)
X`09`09`09goto out;
X
X        \0808++nline;
X`09`09nchar += len + 1;
X`09`09offset = 0;
X        \0808lp = lforw(lp);
X        `7D
X
X`09/* last line (fragment) */
X`09if (rp->r_size > 0) `7B
X`09`09for (i = 0; i < rp->r_size; i++)
X`09`09        if ((s = ffputc(lgetc(lp,i))) != FIOSUC)
X`09`09        \0808goto out;
X`09`09nchar += rp->r_size;
X`09`09++nline;`09/* it _looks_ like a line */
X`09`7D
X
X out:
X        if (s == FIOSUC) `7B\1A08\2208\2A06/* No write error.\4206*/
X#if SYS_VMS
X`09`09if (same_fname(fn, bp, FALSE))
X`09`09`09fn = resolve_filename(bp);
X#endif
X        \0808s = ffclose();
X        \0808if (s == FIOSUC `26`26 msgf) `7B\2A06/* No close error.\4206*/
X`09`09`09if (!global_b_val(MDTERSE)) `7B
X`09`09&0209char *aname;
X`09`09&0209const char *action;
X`09`09&0209if ((aname = is_appendname(fn)) != 0) `7B
X`09`09&0209`09fn = aname;
X`09`09&0209`09action = "Appended";
X`09`09&0209`7D else `7B
X`09`09&0209`09action = "Wrote";
X`09`09&0209`7D
X`09`09&0209mlforce("`5B%s %d line%s %ld char%s to `5C"%s`5C"`5D",
X`09`09&0209`09action, nline, PLURAL(nline),
X`09`09&0209`09nchar, PLURAL(nchar), fn);
X`09`09`09`7D else `7B
X`09`09&0209mlforce("`5B%d lines`5D", nline);
X`09`09`09`7D
X        \0808`7D
X        `7D else `7B\1008\1808\1010/* Ignore close error   */
X        \0808(void)ffclose();\2010/* if a write error.    */
X`09`7D
X`09if (whole_file) `7B
X`09`09bp->b_linecount =
X`09`09`09bp->b_lines_on_disk = nline;
X`09`7D
X
X`09if (isShellOrPipe(given_fn)) `7B
X`09`09CleanAfterPipe(TRUE);
X`09`09endofDisplay();
X`09`7D
X
X        if (s != FIOSUC)\1808\2008\2808/* Some sort of error.  */
X        \0808return FALSE;
X
X#ifdef MDCHK_MODTIME
X`09set_modtime(bp, fn);
X#endif
X`09/*
X`09 * If we've written the unnamed-buffer, rename it according to the file.
X`09 * FIXME: maybe we should do this to all internal-names?
X`09 */
X`09if (whole_file
X`09 `26`26 eql_bname(bp, UNNAMED_BufName)
X`09 `26`26 find_b_file(fname) == 0) `7B
X`09  `09ch_fname(bp, fname);
X`09`09set_buffer_name(bp);
X`09`7D
X
X`09imply_alt(fn, whole_file, FALSE);
X        return TRUE;
X`7D
X
X/*
X * This function writes the kill register to a file
X * Uses the file management routines in the
X * "fileio.c" package. The number of lines written is
X * displayed.
X */
Xint
Xkwrite(char *fn, int msgf)
X`7B
X`09register KILL *kp;`09`09/* pointer into kill \2909*/
X`09register int`09nline;
X`09register int`09s;
X`09register int`09c;
X`09register int`09i;
X`09register char`09*sp;`09/* pointer into string to insert */
X
X`09/* make sure there is something to put */
X`09if (kbs`5Bukb`5D.kbufh == NULL) `7B
X`09`09if (msgf) mlforce("Nothing to write");
X`09`09return FALSE;&0209/* not an error, just nothing */
X`09`7D
X
X#if`09OPT_ENCRYPT
X`09if ((s = resetkey(curbp, fn)) != TRUE)
X`09`09return s;
X#endif
X`09if ((s=ffwopen(fn,FALSE)) != FIOSUC) `7B`09/* Open writes message. */
X`09`09return FALSE;
X`09`7D
X`09/* tell us we're writing */
X`09if (msgf == TRUE)
X`09`09mlwrite("`5BWriting...`5D");
X`09nline = 0;`09`09&0209/* Number of lines.`09*/
X
X`09kp = kbs`5Bukb`5D.kbufh;
X`09while (kp != NULL) `7B
X`09`09i = KbSize(ukb,kp);
X`09`09sp = (char *)kp->d_chunk;
X`09`09while (i--) `7B
X`09`09`09if ((c = *sp++) == '`5Cn')
X`09`09&0209nline++;
X`09`09`09if ((s = ffputc(c)) != FIOSUC)
X`09`09&0209break;
X`09`09`7D
X`09`09kp = kp->d_next;
X`09`7D
X`09if (s == FIOSUC) `7B`09`09`09/* No write error.`09*/
X`09`09s = ffclose();
X`09`09if (s == FIOSUC `26`26 msgf) `7B`09/* No close error.`09*/
X`09`09`09if (!global_b_val(MDTERSE))
X`09`09&0209mlwrite("`5BWrote %d line%s to %s `5D",
X`09`09&0209`09nline, PLURAL(nline), fn);
X`09`09`09else
X`09`09&0209mlforce("`5B%d lines`5D", nline);
X`09`09`7D
X`09`7D else`09`7B`09`09&0209/* Ignore close error`09*/
X`09`09(void)ffclose();&0209/* if a write error.`09*/
X`09`7D
X`09if (s != FIOSUC)`09`09`09/* Some sort of error.`09*/
X`09`09return FALSE;
X`09return TRUE;
X`7D
X
X
X/*
X * The command allows the user
X * to modify the file name associated with
X * the current buffer. It is like the "f" command
X * in UNIX "ed". The operation is simple; just zap
X * the name in the BUFFER structure, and mark the windows
X * as needing an update. You can type a blank line at the
X * prompt if you wish.
X */
X/* ARGSUSED */
Xint
Xfilename(int f GCC_UNUSED, int n\120B)
X`7B
X        register int    s;
X        char\0C08    fname`5BNFILEN`5D;
X
X`09if (end_named_cmd()) `7B
X`09`09return showcpos(FALSE,1);
X`09`7D
X
X        if ((s = mlreply_file("Name: ", (TBUFF **)0, FILEC_UNKNOWN, fname))
X`09`09&0209&0209== ABORT)
X        \0808return s;
X        if (s == FALSE)
X        \0808return s;
X`09make_global_b_val(curbp,MDVIEW); /* no longer read only mode */
X#if OPT_LCKFILES
X`09if ( global_g_val(GMDUSEFILELOCK) ) `7B
X`09`09if (!b_val(curbp,MDLOCKED) `26`26 \1A0FVIEW))
X`09`09`09release_lock(curbp->b_fname);
X`09`09ch_fname(curbp, fname);
X`09`09make_global_b_val(curbp,MDLOCKED);
X`09`09make_global_b_val(curbp,VAL_LOCKER);
X`09`09grab_lck_file(curbp, fname);
X`09`7D else
X#endif
X`09 ch_fname(curbp, fname);
X`09curwp->w_flag `7C= WFMODE;
X`09updatelistbuffers();
X        return TRUE;
X`7D
X
X/*
X * Insert file "fname" into the current
X * buffer, Called by insert file command. Return the final
X * status of the read.
X */
Xint
Xifile(char *fname, int belowthisline, FILE *haveffp)
X`7B
X`09register LINEPTR prevp;
X`09register LINEPTR newlp;
X`09register LINEPTR nextp;
X        register BUFFER *bp;
X        register int    s;
X        int    nbytes;
X        register int    nline;
X
X        bp = curbp;\1308\1B08\100D/* Cheap.\260F*/
X`09b_clr_flags(bp, BFINVS);`09`09/* we are not temporary*/
X`09if (!haveffp) `7B
X`09        if ((s=ffropen(fname)) == FIOERR) /* Hard file open.\3C06*/
X`09        \0808goto out;
X`09        if (s == FIOFNF)`09`09/* File not found.\2C06*/
X`09`09`09return no_such_file(fname);
X#if`09OPT_ENCRYPT
+-+-+-+-+-+-+-+-  END  OF PART 53 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 54 -+-+-+-+-+-+-+-+
X`09`09if ((s = resetkey(curbp, fname)) != TRUE)
X`09`09`09return s;
X#endif
X`09        mlwrite("`5BInserting...`5D");
X`09`09CleanToPipe();
X
X`09`7D else `7B /* we already have the file pointer */
X`09`09ffp = haveffp;
X`09`7D
X`09prevp = DOT.l;
X`09DOT.o = 0;
X`09MK = DOT;
X
X`09nline = 0;
X`09nextp = null_ptr;
X`09while ((s=ffgetline(`26nbytes)) <= FIOSUC) `7B
X#if OPT_DOSFILES
X`09`09if (b_val(curbp,MDDOS)
X`09`09 `26`26 (nbytes > 0)
X`09`09 `26`26 fline`5Bnbytes-1`5D == '`5Cr')
X`09`09`09nbytes--;
X#endif
X`09`09if (!belowthisline) `7B
X`09`09`09nextp = prevp;
X`09`09`09prevp = lback(prevp);
X`09`09`7D
X
X`09`09if (add_line_at(curbp, prevp, fline, nbytes) != TRUE) `7B
X`09`09`09s = FIOMEM;&0209/* Keep message on the`09*/
X`09`09`09break;&0309/* display.&0209*/
X`09`09`7D
X`09`09newlp = lforw(prevp);
X`09`09tag_for_undo(newlp);
X`09`09prevp = belowthisline ? newlp : nextp;
X`09`09++nline;
X`09`09if (s < FIOSUC)
X`09`09`09break;
X`09`7D
X`09if (!haveffp) `7B
X`09`09CleanAfterPipe(FALSE);
X`09`09(void)ffclose();&0209/* Ignore errors.`09*/
X`09`09readlinesmsg(nline,s,fname,FALSE);
X`09`7D
Xout:
X`09/* advance to the next line and mark the window for changes */
X`09DOT.l = lforw(DOT.l);
X
X`09/* copy window parameters back to the buffer structure */
X`09copy_traits(`26(curbp->b_w\1306), `26(curwp->w\2707));
X
X`09imply_alt(fname, FALSE\0707);
X`09chg_buff (curbp, WFHARD);
X
X`09return (s != FIOERR);
X`7D
X
X/*
X * Insert file "fname" into the kill register
X * Called by insert file command. Return the final
X * status of the read.
X */
Xstatic int
Xkifile(char *fname)
X`7B
X        register int    i;
X        register int    s;
X        register int    nline;
X        int    nbytes;
X
X`09ksetup();
X        if ((s=ffropen(fname)) == FIOERR) \2A06/* Hard file open.\4206*/
X        \0808goto out;
X        if (s == FIOFNF)`09`09`09/* File not found.\2D06*/
X`09`09return no_such_file(fname);
X
X        nline = 0;
X#if`09OPT_ENCRYPT
X`09if ((s = resetkey(curbp, fname)) == TRUE)
X#endif
X`09`7B
X        `09mlwrite("`5BReading...`5D");
X`09`09CleanToPipe();
X`09`09while ((s=ffgetline(`26nbytes)) <= FIOSUC) `7B
X`09`09`09for (i=0; i<nbytes; ++i)
X`09`09&0209if (!kinsert(fline`5Bi`5D))
X`09`09&0209`09return FIOMEM;
X`09`09`09if ((s == FIOSUC) `26`26 !kinsert('`5Cn'))
X`09`09&0209return FIOMEM;
X`09`09`09++nline;
X`09`09`09if (s < FIOSUC)
X`09`09&0209break;
X`09`09`7D
X`09`09CleanAfterPipe(FALSE);
X`09`7D
X`09kdone();
X        (void)ffclose();\1808\2008\2808/* Ignore errors.\4107*/
X`09readlinesmsg(nline,s,fname,FALSE);
X
Xout:
X`09return (s != FIOERR);
X`7D
X
X#if SYS_UNIX
Xstatic const char *mailcmds`5B`5D = `7B
X`09"/usr/lib/sendmail",
X`09"/sbin/sendmail",
X`09"/usr/sbin/sendmail",
X`09"/bin/mail",
X`090
X`7D;
X#endif
X
X/* called on hangups, interrupts, and quits */
X/* This code is definitely not production quality, or probably very
X`09robust, or probably very secure.  I whipped it up to save
X`09myself while debugging...`09`09pgf */
X/* on the other hand, it has limped along for well over six years now :-/ */
X
XSIGT
Ximdying(int ACTUAL_SIG_ARGS)
X`7B
X#if SYS_UNIX
X#if HAVE_MKDIR
X`09static char dirnam`5BNSTRING`5D = "/tmp/vileDXXXXXX";
X#else
X`09static char dirnam`5BNSTRING`5D = "/tmp";
X`09char temp`5BNFILEN`5D;
X#endif
X#else
X#if HAVE_MKDIR `26`26 !SYS_MSDOS\0E09OS2
X`09static char dirnam`5BNSTRING`5D = "vileDXXXXXX";
X#else
X`09static char dirnam`5BNSTRING`5D = "";
X`09char temp`5BNFILEN`5D;
X#endif
X#endif
X`09char filnam`5BNFILEN`5D;
X`09BUFFER *bp;
X#if SYS_UNIX
X`09char cmd`5B200`5D;
X`09char *np;
X#endif
X`09static int wrote = 0;
X#if HAVE_MKDIR `26`26 !SYS_MSDOS\0E09OS2
X`09static int created = FALSE;
X#endif
X
X#if SYS_APOLLO
X`09extern`09char`09*getlogin(void);
X`09static`09int`09i_am_dead;
X#endif`09/* SYS_APOLLO */
X
X#if OPT_WORKING `26`26 defined(SIGALRM)
X`09setup_handler(SIGALRM, SIG_IGN);
X#endif
X
X#if SYS_APOLLO
X`09if (i_am_dead++)`09/* prevent recursive faults */
X`09`09_exit(signo);
X`09(void)lsprintf(cmd,
X`09`09"(echo signal %d killed vile;/com/tb %d)`7C /bin/mail %s",
X`09`09signo, getpid(), getlogin());
X`09(void)system(cmd);
X#endif`09/* SYS_APOLLO */
X
X`09/* write all modified buffers to the temp directory */
X`09set_global_g_val(GMDIMPLYBUFF,FALSE);`09/* avoid side-effects! */
X`09for_each_buffer(bp) `7B
X`09`09if (!b_is_temporary(bp) `26`26
X`09`09`09bp->b_active == TRUE `26`26
X`09`09`09b_is_changed(bp)) `7B
X#if HAVE_MKDIR `26`26 !SYS_MSDOS\0E09OS2
X`09`09`09if (!created) `7B
X`09`09&0209(void)mktemp(dirnam);
X`09`09&0209if(mkdir(dirnam,0700) != 0) `7B
X`09`09&0209`09tidy_exit(BADEXIT);
X`09`09&0209`7D
X`09`09&0209created = TRUE;
X`09`09`09`7D
X`09`09`09(void)pathcat(filnam, dirnam, bp->b_bname);
X#else
X`09`09`09(void)pathcat(filnam, dirnam,
X`09`09&0209strcat(strcpy(temp, "V"), bp->b_bname));
X#endif
X`09`09`09set_b_val(bp,MDVIEW,FALSE);
X`09`09`09if (writeout(filnam,bp,TRUE,FALSE) != TRUE) `7B
X`09`09&0209tidy_exit(BADEXIT);
X`09`09`09`7D
X`09`09`09wrote++;
X`09`09`7D
X`09`7D
X#if SYS_UNIX
X`09if (wrote) `7B
X`09`09const char **mailcmdp;
X`09`09struct stat sb;
X`09`09/* choose the first mail sender we can find.
X`09`09   it used to be you could rely on /bin/mail being
X`09`09   a simple mailer, but no more.  and sendmail has
X`09`09   been moving around too. */
X`09`09for (mailcmdp = \0B07s; *\1609!= 0; \2508++) `7B
X`09`09`09if (stat(*mailcmdp, `26sb) == 0)
X`09`09&0209break;
X`09`09`7D
X`09`09if (*mailcmdp `26`26
X`09`09`09((np = getenv("LOGNAME")) != 0 `7C`7C
X`09`09&0209(np = getenv("USER")) != 0)) `7B
X#if HAVE_GETHOSTNAME
X`09`09`09char hostname`5B128`5D;
X`09`09`09if (gethostname(\0908, sizeof\1109)) < 0)
X`09`09&0209(void)strcpy(hostname, "unknown");
X`09`09`09hostname`5Bsizeof(\1008)-1`5D = EOS;
X#endif
X`09`09`09(void)lsprintf(cmd,
X`09`09`09 "( %s%s; %s; %s; %s%d; %s%\0C06\1206s%s ) `7C %s %s",
X`09`09`09"echo To: ", np,
X`09`09`09"echo Subject: vile died, files saved",
X`09`09`09"echo ",
X`09`09`09"echo vile died due to signal ", signo,
X#if HAVE_GETHOSTNAME
X`09`09`09"echo on host ", hostname,
X#else
X`09`09`09"echo ", "",
X#endif
X`09`09`09"echo the following files were saved in directory ",
X`09`09`09dirnam,
X#if HAVE_MKDIR
X`09`09`09/* reverse sort so '.' comes last, in case it
X`09`09`09 * terminates the mail message early */
X`09`09`09"ls -a ", dirnam, " `7C sort -r",
X#else
X`09`09`09"ls ", dirnam, "/V*",
X#endif
X`09`09`09*mailcmdp, np);
X`09`09`09(void)system(cmd);
X`09`09`7D
X`09`7D
X`09if (signo > 2) `7B
X`09`09ttclean(FALSE);
X`09`09abort();
X`09`7D
X#else
X`09if (wrote) `7B
X`09`09fprintf(stderr, "vile died: Files saved in directory %s`5Cn",
X        \0808`09dirnam);
X`09`7D
X#endif
X
X`09tidy_exit(wrote ? BADEXIT : GOODEXIT);
X`09/* NOTREACHED */
X`09SIGRET;
X`7D
X
Xvoid
XmarkWFMODE(BUFFER *bp)
X`7B
X`09register WINDOW *wp;`09/* scan for windows that need updating */
X        for_each_visible_window(wp) `7B
X        \0808if (wp->w_bufp == bp)
X        \0808\1008wp->w_flag `7C= WFMODE;
X        `7D
X`7D
X
X#if`09OPT_ENCRYPT
Xint
Xresetkey(`09`09/* reset the encryption key if needed */
XBUFFER`09*bp,
Xconst char *fname)
X`7B
X`09register int s;`09/* return status */
X
X`09/* turn off the encryption flag */
X`09cryptflag = FALSE;
X
X`09/* if we are in crypt mode */
X`09if (b_val(bp, MDCRYPT)) `7B
X`09`09char`09temp`5BNFILEN`5D;
X
X`09`09/* don't automatically inherit key from other buffers */
X`09`09if (bp->b_key`5B0`5D != EOS
X`09`09 `26`26 strcmp(lengthen_path(strcpy(temp, fname)), bp->b_\0F07 `7B
X`09`09`09char`09prompt`5B80`5D;
X`09`09`09(void)lsprintf(prompt,
X`09`09&0209"Use crypt-key from %s", bp->b_bname);
X`09`09`09s = mlyesno(prompt);
X`09`09`09if (s != TRUE)
X`09`09&0209return (s == FALSE);
X`09`09`7D
X
X`09`09/* make a key if we don't have one */
X`09`09if (bp->b_key`5B0`5D == EOS) `7B
X`09`09`09s = ue_makekey(bp->b_key, sizeof\120A));
X`09`09`09if (s != TRUE)
X`09`09&0209return (s == FALSE);
X`09`09`7D
X
X`09`09/* let others know... */
X`09`09cryptflag = TRUE;
X
X`09`09/* and set up the key to be used! */
X`09`09/* de-encrypt it */
X`09`09ue_crypt((char *)0, 0);
X`09`09ue_crypt(bp->b_key, strlen\120A));
X
X`09`09/* re-encrypt it...seeding it to start */
X`09`09ue_crypt((char *)0, 0);
X`09`09ue_crypt(bp->b_key, strlen\120A));
X`09`7D
X
X`09return TRUE;
X`7D
X#endif
$ call unpack [.VILE-8_0]FILE.C;1 -
 70325630 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 102 41 152
$!
$ create 'f'
X/*
X *`09filec.c
X *
X * Filename prompting and completion routines
X * Written by T.E.Dickey for vile (march 1993).
X *
X *
X * $Header: /usr/build/vile/vile/RCS/filec.c,v 1.81 1998/04/28 10:16:26 tom Ex
Vp $
X *
X */
X
X#ifdef _WIN32
X# include <windows.h>
X#endif
X
X#include "estruct.h"
X#include "edef.h"
X
X#undef USE_QSORT
X#if SYS_OS2
X# define USE_QSORT 0
X# define INCL_DOSFILEMGR
X# define INCL_ERRORS
X# include <os2.h>
X# define FoundDirectory(path) ((fb.attrFile `26 FILE_DIRECTORY) != 0)
X#endif
X
X#ifndef USE_QSORT
X#define USE_QSORT 1
X#endif
X
X/* Systems that can have leafnames beginning with '.' (this doesn't include
X * VMS, which does allow this as unlikely as that may seem, because the logic
V
X * that masks dots simply won't work in conjunction with the other translation
Vs
X * to/from hybrid form).
X */
X#if (SYS_UNIX `7C`7C SYS_WINNT) `26`26 ! OPT_VMS_PATH
X#define USE_DOTNAMES 1
X#else
X#define USE_DOTNAMES 0
X#endif
X
X#define isDotname(leaf) (!strcmp(leaf, ".") `7C`7C \1610."))
X
X#if (MISSING_EXTERN_ENVIRON `7C`7C __DJGPP__ >= 2)
Xextern char **environ;
X#endif
X
X#define`09SLASH (EOS+1) /* less than everything but EOS */
X
X#if OPT_VMS_PATH
X#define`09KBD_OPTIONS`09KBD_NORMAL`7CKBD_UPPERC
X#endif
X
X#ifndef`09KBD_OPTIONS
X#define`09KBD_OPTIONS`09KBD_NORMAL
X#endif
X
X#ifndef FoundDirectory
X# define FoundDirectory(path) is_d\130E
X#endif
X
Xstatic`09char`09**MyGlob;`09/* expanded list */
Xstatic`09int`09in_glob;`09/* index into MyGlob`5B`5D */
Xstatic`09int`09only_dir;`09/* can only match real directories */
X
Xstatic void
Xfree_expansion (void)
X`7B
X`09MyGlob = glob_free(\1306);
X`09in_glob = -1;
X`7D
X
X#if COMPLETE_DIRS `7C`7C\110AFILES
X
X#include "dirstuff.h"
X
X#if OPT_VMS_PATH
Xstatic`09void`09vms2hybrid(char *path);
X#endif
X
X/*--------\0808\1010\2020\400A*/
X
X/*
X * Test if the path has a trailing slash-delimiter (i.e., can be syntactically
V
X * distinguished from non-directory paths).
X */
Xstatic int
Xtrailing_slash(const char * path)
X`7B
X`09register int`09len = strlen(path);
X`09if (len > 0) `7B
X#if OPT_VMS_PATH
X`09`09if (is_vms_pathname(path, TRUE))
X`09`09`09return TRUE;
X#endif
X`09`09return (is_slashc(path`5Blen-1`5D));
X`09`7D
X`09return FALSE;
X`7D
X
X/*
X * Force a trailing slash on the end of the path, returns the length\2007
X * resulting path.
X */
Xstatic SIZE_T
Xforce_slash(char * path)
X`7B
X`09register SIZE_T`09len = strlen(path);
X
X#if OPT_VMS_PATH
X`09if (!is_vms_pathname(path, -TRUE))`09/* must be unix-style name */
X#endif
X`09if (!trailing_slash(path)) `7B
X`09`09path`5Blen++`5D = SLASHC;
X`09`09path`5Blen`5D = EOS;
X`09`7D
X`09return len;
X`7D
X
X/*
X * Compare two paths lexically.
X */
Xstatic int
Xpathcmp(LINE * lp, char * text)
X`7B
X    register char *l, *t;
X    register int lc, tc;
X
X    if (llength(lp) <= 0)`09/* (This happens on the first insertion) */
X`09return -1;
X
X    l = lp->l_text;
X    t = text;
X    for_ever `7B
X`09lc = *l++;
X`09tc = *t++;
X#if OPT_CASELESS
X`09if (isUpper(lc))
X`09    lc = toLower(lc);
X`09if (isUpper(tc))
X`09    tc = toLower(tc);
X#endif
X`09if (lc == tc) `7B
X`09    if (tc == EOS)
X`09`09return 0;
X`09`7D else `7B
X`09    if (is_slashc(lc)) `7B
X`09`09lc = (*l != EOS) ? SLASH : EOS;
X`09    `7D
X`09    if (is_slashc(tc)) `7B
X`09`09tc = (*t != EOS) ? SLASH : EOS;
X`09    `7D
X`09    return lc - tc;
X`09`7D
X    `7D
X`7D
X
X/*
X * Insert a pathname at the given line-pointer.
X * Allocate up to three extra bytes for possible trailing slash, EOS, and
X * directory scan indicator.  The latter is only used when there is a trailing
V
X * slash.
X */
Xstatic LINE *
XmakeString(BUFFER *bp, LINE * lp, char * text, SIZE_T len)
X`7B
X`09register LINE`09*np;
X`09int extra = (len != 0 `26`26 is_slashc(text`5Blen-1`5D)) ? 2 : 3;
X
X`09if ((np = lalloc((int)len+extra, bp)) == NULL) `7B
X`09`09lp = 0;
X`09`7D else `7B
X`09`09(void)strcpy(np->l_text, text);
X`09`09np->l_text`5Blen+extra-1`5D = 0; `09/* clear scan indicator */
X`09`09llength(np) -= extra;`09/* hide the null and scan indicator */
X
X
X`09`09set_lforw(lback(lp), np);
X`09`09set_lback(np, \0A06lp));
X`09`09set_lback(lp, np);
X`09`09set_lforw(np, lp);
X`09`09lp = np;
X`09`7D
X`09return lp;
X`7D
X
X/*
X * Create a buffer to store null-terminated strings.
X *
X * The file (or directory) completion buffer is initialized at the beginning o
Vf
X * each command.  Wildcard expansion causes entries to be read for a given pat
Vh
X * on demand.  Resetting the buffer in this fashion is a tradeoff between
X * efficiency (allows reuse of a pattern in NAMEC/TESTC operations) and speed
V
X * (directory scanning is slow).
X *
X * The tags buffer is initialized only once for a given tags-file.
X */
Xstatic BUFFER *
Xbs_init(const char * name)
X`7B
X`09register BUFFER *bp;
X
X`09if ((bp = bfind(name, BFINVS)) != 0) `7B
X`09`09b_clr_scratch(bp);`09/* make it nonvolatile */
X`09`09(void)bclear(bp);
X`09`09bp->b_active = TRUE;
X`09`7D
X`09return bp;
X`7D
X
X/*
X * Look for or insert a pathname string into the given buffer.  Start looking
V
X * at the given line if non-null.  The pathname is expected to be in
X * canonical form.
X */
Xstatic int
Xbs_find(
Xchar *`09fname,`09/* pathname to find */
XSIZE_T`09len,`09/* ...its length */
XBUFFER *bp,`09/* buffer to search */
XLINEPTR *lpp)`09/* in/out line pointer, for iteration */
X`7B
X`09register LINE`09*lp;
X`09int`09doit`09= FALSE;
X#if OPT_VMS_PATH
X`09char`09temp`5BNFILEN`5D;
X`09if (!is_slashc(*fname))
X`09`09vms2hybrid(fname = strcpy(temp, fname));
X#endif
X
X`09if (lpp == NULL `7C`7C (lp = *lpp)\1708)
X`09`09lp = buf_head(bp);
X`09lp = lforw(lp);
X
X`09for_ever `7B
X`09`09register int r = pathcmp(lp, fname);
X
X`09`09if (r == 0) `7B
X`09`09`09if (trailing_slash(fname)
X`09`09`09 `26`26 !trailing_slash(lp->l_text)) `7B
X`09`09&0209/* reinsert so it is sorted properly! */
X`09`09&0209lremove(bp, lp);
X`09`09&0209return bs_find(fname, len,  bp, lpp);
X`09`09`09`7D
X`09`09`09break;
X`09`09`7D else if (r > 0) `7B
X`09`09`09doit = TRUE;
X`09`09`09break;
X`09`09`7D
X
X`09`09lp = lforw(lp);
X`09`09if (lp == buf_head(bp)) `7B
X`09`09`09doit = TRUE;
X`09`09`09break;
X`09`09`7D
X`09`7D
X
X`09if (doit) `7B
X`09`09lp = makeString(bp, lp, fname, len);
X`09`09b_clr_counted(bp);
X`09`7D
X
X`09if (lpp)
X`09`09*lpp = lp;
X`09return TRUE;
X`7D
X#endif /* COMPLETE_DIRS `7C`7C\110AFILES */
X
X#if COMPLETE_DIRS `7C`7C\110AFILES
X
Xstatic`09BUFFER`09*MyBuff;`09/* the buffer containing pathnames */
Xstatic`09const char *MyName;`09/* name of buffer for name-completion */
Xstatic`09char`09**MyList;`09/* list, for name-completion code */
Xstatic`09ALLOC_T MySize;`09`09/* length of list, for (re)allocation */
X
X/*
X * Returns true if the string looks like an environment variable (i.e.,
X * a '$' followed by an optional name.
X */
Xstatic int
Xis_environ(const char *s)
X`7B
X`09if (*s++ == '$') `7B
X`09`09while (*s != EOS) `7B
X`09`09`09if (!isAlnum(*s) `26`26 (*s != '_'))
X`09`09&0209return FALSE;
X`09`09`09s++;
X`09`09`7D
X`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X
X/*
X * Tests if the given path has been scanned during this prompt/reply operation
V
X *
X * If there is anything else in the list that we can do completion with, retur
Vn
X * true.  This allows the case in which we scan a directory (for\0F0A
X * completion and then look at the subdirectories.  It should not permit
X * directories which have already been scanned to be re\1007.
X */
Xstatic int
Xalready_scanned(char * path)
X`7B
X`09register LINE`09*lp;
X`09register SIZE_T`09len;
X`09char`09fname`5BNFILEN`5D;
X`09LINEPTR slp;
X
X`09len = force_slash(strcpy(fname, path));
X
X`09for_each_line(lp,MyBuff) `7B
X#if OPT_CASELESS
X`09`09if (stricmp(fname, lp->l_text) == 0)
X#else
X`09`09if (strcmp(fname, lp->l_text) == 0)
X#endif
X`09`09`7B
X`09`09    if (lp->l_text`5Bllength(lp)+1`5D)
X`09`09`09return TRUE;
X`09`09    else
X`09`09`09break; `09/* name should not occur more than once */
X`09`09`7D
X`09`7D
X
X`09/* force the name in with a trailing slash */
X`09slp = buf_head(MyBuff);
X`09(void)bs_find(fname, len, MyBuff, `26slp);
X
X`09/*
X`09 * mark name as scanned (since that is what we're about to do after
X`09 * returning)
X`09 */
X`09lp = slp;
X`09lp->l_text`5Bllength(lp)+1`5D = 1;
X`09return FALSE;
X`7D
X
X#if USE_DOTNAMES
X/*
X * Before canonicalizing a pathname, check for a leaf consisting of trailing
X * dots.  Convert this to another form so that it won't be combined with
X * other leaves.  We do this because we don't want to prevent the user from
X * doing filename completion with leaves that begin\1706dots.
X */
Xstatic void mask_dots(char *path, SIZE_T *dots)
X`7B
X`09char *leaf = pathleaf(path);
X`09if (isDotname(leaf)) `7B
X`09`09*dots = strlen(leaf);
X`09`09memset(leaf, '?', *dots);
X`09`7D else
X`09`09*dots = 0;
X`7D
X
X/*
X * Restore the leaf to its original form.
X */
Xstatic void add_dots(char *path, SIZE_T dots)
X`7B
X`09if (dots != 0) `7B
X`09`09memset(pathleaf(path), '.', dots);
X`09`7D
X`7D
X
Xstatic void strip_dots(char *path, SIZE_T *dots)
X`7B
X`09char *leaf = pathleaf(path);
X`09if (isDotname(leaf)) `7B
X`09`09*dots = strlen(leaf);
X`09`09*leaf = EOS;
X`09`7D
X`7D
X#define if_dots(path, dots) if (!strncmp\1907".."\1F07)
X#else
X#define mask_dots(path, dots) /* nothing */
X#define add_dots(path, dots) /* nothing */
X#define strip_dots(path, dots) /* nothing */
X#define if_dots(path, dots) /* nothing */
X#endif /* USE_DOTNAMES */
X
X#if OPT_VMS_PATH
X/*
X * Convert a canonical VMS pathname to a hybrid form, in which the leaf (e.g.,
V
X * "name.type;ver") is left untouched, but the directory portion is in UNIX
X * form.  This alleviates a sticky problem with VMS's pathname delimiters by
X * making them all '/' characters.
X */
Xstatic void
Xvms2hybrid(char *path)
X`7B
X`09char`09leaf`5BNFILEN`5D;
X`09char`09head`5BNFILEN`5D;
X`09char`09*s = strcpy(head, path);
X`09char`09*t;
X
X`09TRACE(("vms2hybrid '%s'`5Cn", path))
X`09(void)strcpy(leaf, s = pathleaf(head));
X`09if ((t = is_vms_dirtype(leaf)) != 0)
X`09`09(void)strcpy(t, "/");
X`09*s = EOS;
X`09if (s == path)`09/* a non-canonical name got here somehow */
X`09`09(void) strcpy(head, current_directory(FALSE));
X`09pathcat(path, mkupper(vms2unix_path(head, head)), leaf);
X`09TRACE((" -> '%s' (vms2hybrid)`5Cn", path))
X`7D
X
Xstatic void
Xhybrid2vms(char *path)
X`7B
X`09char`09leaf`5BNFILEN`5D;
X`09char`09head`5BNFILEN`5D;
X`09char`09*s = strcpy(head, path);
X
X`09TRACE(("hybrid2vms '%s'`5Cn", path))
X`09(void)strcpy(leaf, s = pathleaf(head));
X`09*s = EOS;
X`09if (s == head)`09/* a non-canonical name got here somehow */
X`09`09(void) vms2unix_path(head, current_directory(FALSE));
X`09(void) pathcat(path, head, leaf);
X`09if (isDotname(leaf)) `7B
X`09`09force_slash(path);`09/* ...so we'll interpret as directory */
X`09`09lengthen_path(path);`09/* ...makes VMS-style absolute-path */
X`09`7D else `7B
X`09`09unix2vms_path(path, path);
X`09`7D
X`09TRACE((" -> '%s' hybrid2vms`5Cn", path))
X`7D
X
Xstatic void
Xhybrid2unix(char *path)
X`7B
X`09char`09leaf`5BNFILEN`5D;
X`09char`09head`5BNFILEN`5D;
X`09char`09*s = strcpy(head, path);
X
X`09TRACE(("hybrid2unix '%s'`5Cn", path))
X`09(void)strcpy(leaf, s = pathleaf(head));
X`09*s = EOS;
X`09if (s == path)`09/* a non-canonical name got here somehow */
X`09`09(void) vms2unix_path(head, current_directory(FALSE));
X`09pathcat(path, head, leaf);
X
X`09/* The semicolon that indicates the version is a little tricky.  When
X`09 * simulating via fakevms.c on UNIX, we've got to trim the version
X`09 * marker at this point.  Otherwise, it'll be changed to a dollar sign
X`09 * the next time the string is converted from UNIX to VMS form.  A
X`09 * side-effect is that the name-completion echos (for UNIX only!) the
X`09 * version, but doesn't store it in the buffer returned to the caller.
X`09 */
X`09if ((s = strrchr(path, ';')) != 0) `7B
X#if SYS_UNIX
X`09`09*s = EOS;`09/* ...we're only simulating */
X#else
X`09`09*s = '.';`09/* this'll be interpreted as version-mark */
X#endif
X`09`7D
X`09TRACE((" -> '%s' hybrid2unix`5Cn", path))
X`7D
X#endif /* OPT_VMS_PATH */
X
X#if USE_QSORT
X/*
X * Compare two lines (containing paths) for quicksort by callin\2006cmp().
X * If the paths compare equal force the one with the trailing slash to be
X * less than.  This'll make deleting the ones without slashes easier in
X * sortMyBuff().
X */
Xstatic int
Xqs_pathcmp(const void *lpp1, \120F2)
X`7B
X    int r = pathcmp(*(LINE *const*)lpp1, (* (\170D lpp2)->l_text);
X
X    if (r == 0) `7B
X`09const LINE *lp1 = *(\0E06const*)lpp1;
X
X`09if (llength(lp1) > 0 `26`26 is_slashc(lgetc(lp1, \290C-1)))
X`09    return -1;
X`09else`09`09/* Don't care if the other one has slash or not... */
X`09    return 1;`09/* ...\1006ing 1 for two equal elements won't do  */
X`09    `09`09/* any harm. */
X    `7D
X    else
X`09return r;
X`7D
X
Xstatic void
XsortMyBuff(void)
X`7B
X    L_NUM n;
X    LINE **sortvec;
X    register LINE *lp, *plp;
X    register LINE **slp;
X
X    b_clr_counted(MyBuff);
X    n = line_count(MyBuff);
X    if (n <= 0)
X`09return;`09`09`09/* Nothing to sort */
X
X    sortvec = typecallocn(LINE *, (ALLOC_T) n);
X    if (sortvec == NULL)
X`09return;`09`09`09/* Can't sort it .. have to get by unsorted */
X
X    slp = sortvec;
X    for_each_line(lp, MyBuff) `7B
X`09*slp++ = lp;
X    `7D
X    qsort((char *) sortvec, (SIZE_T)n, sizeof(LINE *), qs_pathcmp);
X
X    plp = buf_head(MyBuff);
X    slp = sortvec;
X    while (n-- > 0) `7B
X`09lp = *slp++;
X`09if (pathcmp(plp, lp->l_text) == 0) `7B
X`09    lfree(lp, MyBuff);
X`09`7D
X`09else `7B
X`09    set_lforw(plp, lp);
X`09    set_lback(lp, plp);
X`09    plp = lp;
X`09`7D
X    `7D
X    lp = buf_head(MyBuff);
X    set_lforw(plp, lp);
X    set_lback(lp, plp);
X    b_clr_counted(MyBuff);
X
X    free((char *)sortvec);
X`7D
X#endif`09/* USE_QSORT */
X
X/*
X * If the given path is not in the completion-buffer, expand it, and add the
X * expanded paths to the buffer.  Because the user may be trying to get an
X * intermediate directory-name, we must 'stat()' each \1C06so that we can
X * provide the trailing slash in the completion.  This is slow.
X */
Xstatic int
XfillMyBuff(char * name)
X`7B
X`09int count = 0;
X#if !OPT_VMS_PATH
X`09SIZE_T dots = 0;
X#endif
X`09register char`09*s;
X#if SYS_OS2
X`09FILEFINDBUF3 fb;
X`09ULONG entries;
X`09HDIR hdir;
X`09APIRET rc;
X`09int case_preserving = is_\150F(name);
X
X`09char`09path`5BNFILEN + 2`5D;
X#else`09/* UNIX, VMS or MSDOS */
X`09char`09*leaf;
X
X`09DIR`09*dp;
X`09DIRENT`09*de;
X
X`09char`09path`5BNFILEN`5D;
X#if OPT_VMS_PATH
X`09char`09temp`5BNFILEN`5D;
X#endif
X#endif
X
X`09TRACE(("fillMyBuff '%s'`5Cn", name))
X
X`09/********\0808\1010\2020\4006/
X`09if (is_environ(name)) `7B
X`09`09LINEPTR lp;
X`09`09int n;
X
X`09`09/*
X`09`09 * The presence of any environment variable in the list is
X`09`09 * sufficient indication that we've copied the environment.
X`09`09 */
X`09`09for_each_line(lp,MyBuff)
X`09`09`09if (is_environ(lp->l_text))
X`09`09&0209return 0;
X
X`09`09/*
X`09`09 * Copy all of the environment-variable names, prefixed with
X`09`09 * the '$' that indicates what they are.
X`09`09 */
X`09`09for (n = 0; environ`5Bn`5D != 0; n++) `7B
X`09`09`09char *d = path;
X
X`09`09`09s = environ`5Bn`5D;
X`09`09`09*d++ = name`5B0`5D;
X`09`09`09while (((*d = *s++) != '=') `26`26 (*d != EOS)) `7B
X`09`09&0209if ((size_t)(d++ - path) > sizeof(path)-2)
X`09`09&0209`09break;
X`09`09`09`7D
X`09`09`09*d = EOS;
X#if SYS_MSDOS `7C`7C SYS_OS2
X`09`09`09mklower(path);`09/* glob.c will uppercase for getenv */
X#endif
X#if USE_QSORT
X`09`09`09(void)makeString(MyBuff,
X`09`09`09        \0808 buf_head(MyBuff),
X`09`09&0209`09 path,
X`09`09&0209`09 (SIZE_T) strlen(path));
X#else`09/* !USE_QSORT */
X`09`09`09(void)bs_find(path, (SIZE_T)strlen(path),
X`09`09&0209`09MyBuff, (LINEPTR*)0);
X#endif`09/* USE_QSORT/!\0B09 */
X`09`09`09TRACE(("> '%s'`5Cn", path))
X`09`09`7D
X#if USE_QSORT
X`09`09sortMyBuff();
X#endif
X`09`09return 0;
X`09`7D
X
X`09(void)strcpy(path, name);
X#if OPT_MSDOS_PATH
X`09bsl_to_sl_inplace(path);
X#endif
X#if OPT_VMS_PATH
X`09(void)strcpy(temp, name);
X`09hybrid2vms(path);`09`09/* convert to canonical VMS name */
X#else
X`09strip_dots(path, `26dots);`09/* ignore trailing /. or /.. */
X#endif
X`09if (!is_environ(path) `26`26 !is_directory\1706) `7B
X`09`09*pathleaf(path) = EOS;
X`09`09if (!is_directory(path))
X`09`09`09return 1;
X#if OPT_VMS_PATH
X`09`09*pathleaf(temp) = EOS;
X#endif
X`09`7D
X
X#if OPT_VMS_PATH
X`09if (already_scanned(temp))`09/* we match the hybrid name */
X`09`09return 1;
X#else
X`09if (already_scanned(path)) `7B
X#if USE_DOTNAMES
X`09`09/*
X`09`09 * Handle the special cases where we're continuing a completion
X`09`09 * with ".." on the end of the path.  We have to distinguish
X`09`09 * the return value so that we can drive a second scan for the
X`09`09 * case where there's no dot-names found.
X`09`09 */
X`09`09if (dots) `7B
X`09`09`09char`09temp`5BNFILEN`5D;
X`09`09`09LINE`09*lp;
X`09`09`09SIZE_T`09need, want;
X`09`09`09int`09found = 0;
X
X`09`09`09while (dots--)
X`09`09&0209strcat(path, ".");
X`09`09`09(void)lengthen_path(strcpy(temp, path));
X`09`09`09need = strlen(temp);
X`09`09`09want = strlen(path);
X`09`09`09for_each_line(lp,MyBuff) `7B
X`09`09&0209SIZE_T have = llength(lp);
X`09`09&0209if (have == need
X`09`09&0209 `26`26 !memcmp(lp->l_text, temp, need))
X`09`09&0209 `09found = -1;
X`09`09&0209else if (have >= want
X`09`09&0209 `26`26 !memcmp(lp->l_text, path, want)) `7B
X`09`09&0209`09found = 1;
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09return found;
X`09`09`7D
X#endif
X`09`09return 0;
X`09`7D
X#endif
X
X`09/********\0808\1010\2020\4006/
X
X#if SYS_OS2
X`09s = path + force_slash(path);
X`09(void)strcat(path, "*.*");
X
X`09hdir = HDIR_CREATE;
X`09entries = 1;
X`09rc = DosFindFirst(SL_TO_BSL(path), `26hdir,
X`09`09`09FILE_DIRECTORY `7C FILE_READONLY,
X`09`09`09`26fb, sizeof(fb), `26entries, FIL_STANDARD);
X`09if (rc == NO_ERROR)
X`09`7B
X`09`09do
X`09`09`7B
X`09`09`09(void) strcpy(s, fb.achName);
X`09`09`09if (!case_preserving)
X`09`09&0209(void) mklower(s);
X
X`09`09`09if (isDotname(s))
X`09`09`09 `09continue;
X
X`09`09`09if (only_dir) `7B
X`09`09&0209if (!FoundDirectory(path))
X`09`09&0209`09continue;
X`09`09&0209(void) force_slash(path);
X`09`09`09`7D
X#if COMPLETE_DIRS
X`09`09`09else `7B
X`09`09&0209if (global_g_val(GMDDIRC) `26`26 FoundDirectory(path))
X`09`09&0209`09(void) force_slash(path);
X`09`09`09`7D
X#endif
X`09`09`09TRACE(("> '%s'`5Cn", path))
X`09`09`09if_dots(s,dots) count++;
X`09`09`09(void)bs_find(path, strlen(path), MyBuff, (LINEPTR*)0);
X
X`09`09`7D while (entries = 1,
X`09`09         DosFindNext(hdir, `26fb, sizeof(fb), `26entries) == NO_ERROR
X`09`09&0209 `26`26 entries == 1);
X
X`09`09DosFindClose(hdir);
X`09`7D
X#else /* UNIX, VMS or MSDOS */
X`09/* For MS-DOS pathnames, force the use of '`5C' instead of '/' in the
X`09 * open-directory operation to allow for runtime libraries that
X`09 * don't allow using UNIX-style '/' pathnames.
X`09 */
X`09if ((dp = opendir(SL_TO_BSL(path))) != 0) `7B
X`09`09s = path;
X#if !OPT_VMS_PATH
X`09`09s += force_slash(path);
X#endif
X
X`09`09leaf = s;
X`09`09while ((de = readdir(dp)) != 0) `7B
X#if SYS_UNIX `7C`7C SYS_VMS\0B08WINNT
X# if USE_D_NAMLEN
X`09`09`09(void)strncpy(leaf, de->d_name, (SIZE_T)(\1509len));
X`09`09`09leaf`5Bde->d_namlen`5D = EOS;
X# else
X`09`09`09(void)strcpy(leaf, de->d_name);
X# endif
X#else
X# if SYS_MSDOS
X`09`09`09(void)mklower(strcpy(leaf, de->d_name));
X# else
X`09`09`09huh??
X# endif
X#endif
X#if OPT_VMS_PATH
X`09`09`09vms_dir2path(path);
X#else
X# if SYS_UNIX `7C`7C SYS_MSDOS\0D08OS2\1808WINNT
X`09`09`09if (isDotname(leaf))
X`09`09`09 `09continue;
X# endif
X#endif
X`09`09`09if (only_dir) `7B
X`09`09&0209if (!FoundDirectory(path))
X`09`09&0209`09continue;
X`09`09&0209(void) force_slash(path);
X`09`09`09`7D
X#if COMPLETE_DIRS
X`09`09`09else `7B
X`09`09&0209if (global_g_val(GMDDIRC) `26`26 FoundDirectory(path))
+-+-+-+-+-+-+-+-  END  OF PART 54 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 55 -+-+-+-+-+-+-+-+
X`09`09&0209`09(void) force_slash(path);
X`09`09`09`7D
X#endif
X`09`09`09TRACE(("> '%s'`5Cn", path))
X`09`09`09if_dots(leaf,dots) count++;
X#if USE_QSORT
X#if OPT_VMS_PATH
X`09`09`09vms2hybrid(s = strcpy(temp, path));
X#else
X`09`09`09s = path;
X#endif
X`09`09`09(void)makeString(MyBuff,
X`09`09`09        \0808 buf_head(MyBuff),
X`09`09&0209`09 s,
X`09`09&0209`09 (SIZE_T) strlen(s));
X#else`09/* !USE_QSORT */
X`09`09`09(void)bs_find(path, (SIZE_T)strlen(path), MyBuff,
X`09`09&0209`09(LINEPTR*)0);
X#endif`09/* USE_QSORT/!\0B09 */
X`09`09`7D
X`09`09(void)closedir(dp);
X#if USE_QSORT
X`09`09sortMyBuff();
X#endif
X`09`7D
X#endif`09/* SYS_OS2/!\0907 */
X`09TRACE(("...fillMyBuff returns %d`5Cn", count))
X`09return count;
X`7D
X
X/*
X * Make the list of names needed for name-completion
X */
Xstatic void
XmakeMyList(char *name)
X`7B
X`09register ALLOC_T need;
X`09register int`09n;
X`09register LINE *`09lp;
X`09char *slashocc;
X`09int len = strlen(name);
X
X`09if (is_slashc(name`5Blen-1`5D))
X`09    len++;
X
X`09(void)bsizes(MyBuff);
X`09need = MyBuff->b_linecount + 2;
X`09if (MySize < need) `7B
X`09`09MySize = need * 2;
X`09`09if (MyList == 0)
X`09`09`09MyList = typeallocn(char *, MySize);
X`09`09else
X`09`09`09MyList = typereallocn(char *, \1E06, MySize);
X`09`7D
X
X`09n = 0;
X`09for_each_line(lp,MyBuff)
X`09`09/* exclude listings of subdirectories below
X`09`09   current directory */
X`09`09if (llength(lp) >= len
X`09`09 `26`26 ((slashocc = strchr(lp->l_text+len, SLASHC)) == NULL
X`09`09   `7C`7C slashocc`5B1`5D == EOS))
X`09`09`09MyList`5Bn++`5D = lp->l_text;
X`09MyList`5Bn`5D = 0;
X`7D
X
X#if NO_LEAKS
Xstatic void
XfreeMyList(void)
X`7B
X`09FreeAndNull(MyList);
X`09MySize = 0;
X`7D
X#else
X#define`09freeMyList()
X#endif
X
Xstatic void
Xforce_output(int c, char *buf, unsigned *pos)
X`7B
X`09kbd_putc(c);
X`09TTflush();
X`09buf`5B*pos`5D = (char)c;
X`09*pos += 1;
X`09buf`5B*pos`5D = EOS;
X`7D
X
X/*
X * Initialize the file-completion module.  We'll only do either\2E06 or
X * directory-completion during any given command, and they use different
X * buffers (and slightly different parsing).
X */
Xvoid
Xinit_filec(const char *buffer_name)
X`7B
X`09MyBuff = 0;
X`09MyName = buffer_name;
X`7D
X
X/*
X * Perform the name-completion/display.  Note that we must convert a copy of
X * the pathname to absolute form so that we can match against the strings that
V
X * are stored in the completion table.  However,\2006haracters that might be
X * added are always applicable to the original buffer.
X *
X * We only do name-completion if asked; if we did it when the user typed a
X * return it would be too slow.
X */
Xint
Xpath_completion(int c, char *buf, unsigned *pos)
X`7B
X`09int`09code`09= FALSE,
X`09`09action`09= (c == NAMEC `7C`7C c == TESTC),
X`09`09ignore`09= (*buf != EOS `26`26 isInternalName(buf));
X#if USE_DOTNAMES
X`09SIZE_T`09dots = 0;
X`09int`09count;
X#endif
X
X`09TRACE(("path_completion('%c' %d:`5C"%.*s`5C"`5Cn", c, *pos, (int)\0B06buf))
V
X#if OPT_VMS_PATH
X`09if (ignore `26`26 action) `7B`09`09/* resolve scratch-name conflict */
X`09`09if (is_vms_pathname(buf, -TRUE))
X`09`09`09ignore = FALSE;
X`09`7D
X#endif
X`09if (ignore) `7B
X`09`09if (action) `7B&0209/* completion-chars have no meaning */
X`09`09`09force_output(c, buf, pos);
X`09`09`7D
X`09`7D else if (action) `7B
X`09`09char`09*s;
X`09`09char`09path`5BNFILEN`5D;
X`09`09unsigned oldlen,
X`09`09`09newlen;
X
X`09`09/* initialize only on demand */
X`09`09if (MyBuff == 0) `7B
X`09`09`09if (MyName == 0
X`09`09`09 `7C`7C (MyBuff = bs_init(MyName)) == 0)
X`09`09`09 `09return FALSE;
X`09`09`7D
X
X`09`09/*
X`09`09 * Copy 'buf' into 'path', making it canonical-form.
X`09`09 */
X#if OPT_VMS_PATH
X`09`09if (*strcpy(path, buf) == EOS) `7B
X`09`09`09(void)strcpy(path, current_directory(FALSE));
X`09`09`7D else if (!is_environ(path)) `7B
X`09`09`09char`09frac`5BNFILEN`5D;
X
X`09`09`09if (is_vms_pathname(path, -TRUE)) `7B
X`09`09&0209s = vms_pathleaf(path);
X`09`09&0209(void)strcpy(frac, s);
X`09`09&0209*s = EOS;
X`09`09`09`7D else `7B
X`09`09&0209s = pathleaf(path);
X`09`09&0209if (strcmp(s, ".")
X`09`09&0209 `26`26 is_vms_pathname(s, -TRUE)) `7B
X`09`09&0209`09(void)strcpy(frac, s);
X`09`09&0209`09*s = EOS;
X`09`09&0209`7D else `7B`09/* e.g., path=".." */
X`09`09&0209`09*frac = EOS;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09if (*path == EOS)
X`09`09&0209(void)strcpy(path, current_directory(FALSE));
X`09`09`09else `7B
X`09`09&0209if (!is_vms_pathname(path, -TRUE)) `7B
X`09`09&0209`09unix2vms_path(path, path);
X`09`09&0209`09if (*path == EOS)
X`09`09&0209&0209(void)strcpy(path, current_directory(FALSE));
X`09`09&0209`7D
X`09`09&0209(void)lengthen_path(path);
X`09`09`09`7D
X`09`09`09(void)strcat(path, frac);
X`09`09`7D
X`09`09if (is_vms_pathname(path, -TRUE)) `7B
X`09`09`09int pad = is_vms_pathname(path, TRUE);
X
X`09`09`09vms2hybrid(path);
X`09`09`09/*
X`09`09`09 * FIXME: This compensates for the hack in canonpath
X`09`09`09 */
X`09`09`09if (!strcmp(buf, "/")) `7B
X`09`09&0209while ((size_t)*pos < strlen(path))
X`09`09&0209`09force_output(path`5B*pos`5D, buf, pos);
X`09`09`09`7D else if (pad `26`26 *buf != EOS &0226 !trailing_slash(buf)) `7B
X`09`09&0209force_output(SLASHC, buf, pos);
X`09`09`09`7D
X`09`09`7D
X#else
X`09`09if (is_environ(buf)) `7B
X`09`09`09(void)strcpy(path, buf);
X`09`09`7D else `7B
X# if SYS_UNIX `7C`7C OPT_MSDOS_PATH
X`09`09`09char`09**expand;
X
X`09`09`09/*
X`09`09`09 * Expand _unique_ wildcards and environment variables.
X`09`09`09 * Like 'doglob()', but without the prompt.
X`09`09`09 */
X`09`09`09expand = glob_string(strcpy(path, buf));
X`09`09`09switch (glob_length(expand)) `7B
X`09`09`09default:
X`09`09&0209(void)glob_free(expand);
X`09`09&0209kbd_alarm();
X`09`09&0209return FALSE;
X`09`09`09case 1:
X`09`09&0209(void)strcpy(path, expand`5B0`5D);
X`09`09&0209/*FALLTHRU*/
X`09`09`09case 0:
X`09`09&0209(void)glob_free(expand);
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09mask_dots(path, `26dots);
X`09`09`09(void)lengthen_path(path);
X`09`09`09add_dots(path, dots);
X#  if OPT_MSDOS_PATH
X`09`09`09/*
X`09`09`09 * Pick up slash (special case) when we've just expanded a
X`09`09`09 * device such as "c:" to "c:/".
X`09`09`09 */
X`09`09`09if ((newlen = strlen(path)) == 3
X`09`09`09 `26`26 (oldlen = strlen(buf)) == 2
X`09`09`09 `26`26 is_slashc(path`5Bnewlen-1`5D)
X`09`09`09 `26`26 path`5Bnewlen-2`5D == ':') `7B
X`09`09&0209force_output(SLASHC, buf, pos);
X`09`09`09`7D
X#  endif
X# endif
X`09`09`7D
X#endif
X
X`09`09if ((s = is_appendname(buf)) == 0)
X`09`09`09s = buf;
X`09`09if ((*s == EOS) `7C`7C trailing_slash(s)) `7B
X`09`09`09if (*path == EOS)
X`09`09&0209strcpy(path, ".");
X`09`09`09(void)force_slash(path);
X`09`09`7D
X
X`09`09if ((s = is_appendname(path)) != NULL) `7B
X`09`09`09register char *d;
X`09`09`09for (d = path; (*d++ = *s++) != EOS; )
X`09`09&0209;
X`09`09`7D
X#if OPT_MSDOS_PATH
X`09`09/* if the user typed a back-slash, we need to
X`09`09 * convert it, since it's stored as '/' in the file
X`09`09 * completion buffer to avoid conflicts with the use of
X`09`09 * backslash for escaping special characters.
X`09`09 */
X`09`09bsl_to_sl_inplace(path);
X#endif
X
X`09`09newlen =
X`09`09oldlen = strlen(path);
X
X#if USE_DOTNAMES
X`09`09/*
X`09`09 * If we're on a filesystem that allows names beginning with
X`09`09 * ".", try to handle the ambiguity between .name and ./ by
X`09`09 * preferring matches on the former.  If we get a zero return
X`09`09 * from the first scan, it means that we've only the latter
X`09`09 * case to consider.
X`09`09 */
X`09`09count = fillMyBuff(path);
X`09`09if (dots == 2) `7B
X`09`09`09if (count == 0) `7B
X`09`09&0209force_slash(path);
X`09`09&0209lengthen_path(path);
X`09`09&0209newlen =
X`09`09&0209oldlen = strlen(path);
X#if 0
X`09`09&0209if ((MyBuff = bs_init(MyName)) == 0)
X`09`09&0209`09return FALSE;
X#endif
X`09`09&0209(void) fillMyBuff(path);
X`09`09`09`7D else if (count < 0) `7B
X`09`09&0209lengthen_path(path);
X`09`09&0209newlen =
X`09`09&0209oldlen = strlen(path);
X`09`09`09`7D
X`09`09`7D else if (dots == 1) `7B
X`09`09`09if (count == 0) `7B
X`09`09&0209lengthen_path(path);
X`09`09&0209newlen =
X`09`09&0209oldlen = strlen(path);
X`09`09`09`7D
X`09`09`7D
X#else
X`09`09(void) fillMyBuff(path);
X#endif
X`09`09makeMyList(path);
X
X`09`09/* patch: should also force-dot to the matched line, as in history.c */
V
X`09`09/* patch: how can I force buffer-update to show? */
X
X#if OPT_CASELESS
X`09`09code = kbd_complete(TRUE, c, path, `26newlen, (char *)`26MyList`5B0`5D,
V sizeof(\1209));
X#if 0 /* case insensitive reply correction doesn't work reliably yet */
X`09`09(void)strcpy(buf, path);
X#else
X`09`09(void)strcat(buf, path+oldlen);
X#endif
X#else
X`09`09code = kbd_complete(FALSE, c, path, `26newlen, (char *)`26MyList`5B0`5D,
V sizeof(\1209));
X`09`09(void)strcat(buf, path+oldlen);
X#endif
X#if OPT_VMS_PATH
X`09`09if (*buf != EOS
X`09`09 `26`26 !is_vms_pathname(buf, -TRUE))
X`09`09`09hybrid2unix(buf);
X#endif
X`09`09*pos = strlen(buf);
X
X`09`09/* avoid accidentally picking up directory names for files */
X`09`09if ((code == TRUE)
X`09`09 `26`26 !only_dir
X`09`09 `26`26 !trailing_slash(path)
X`09`09 `26`26 is_directory(path)) `7B
X`09`09`09force_output(SLASHC, buf, pos);
X`09`09`09code = FALSE;
X`09`09`7D
X`09`7D
X`09TRACE((" -> '%s' path_completion`5Cn", buf))
X`09return code;
X`7D
X#else`09/* no filename-completion */
X#define`09freeMyList()
X#endif`09/* filename-completion */
X
X/********\0808\1010\2020\400E/
Xint
Xmlreply_file(
Xconst char * prompt,
XTBUFF **buffer,
Xint`09flag,`09`09/* +1 to read, -1 to write, 0 don't care */
Xchar *`09result)
X`7B
X`09register int`09s = FALSE;
X`09static`09TBUFF`09*last;
X`09char`09Reply`5BNFILEN`5D;
X`09int`09(*complete) (DONE_ARGS) = no_\1B07ion;
X`09int`09had_fname = (curbp != 0
X`09`09`09  `26`26 curbp->b_fname != 0
X`09`09`09  `26`26 curbp->b_fname`5B0`5D != EOS);
X`09int`09do_prompt = (clexec `7C`7C isnamedcmd &027C (flag `26 FILEC_PROMPT));
V
X`09int`09ok_expand = (flag `26 FILEC_EXPAND);
X
X`09flag `26= `7E (FILEC_PROMPT `7C \0F06EXPAND);
X
X#if COMPLETE_FILES
X`09if (do_prompt `26`26 !clexec) `7B
X`09`09complete = shell_\1108;
X`09`09init_filec(FILECOMPLETION_BufName);
X`09`7D
X#endif
X
X`09/* use the current filename if none given */
X`09if (buffer == 0) `7B
X`09`09(void)tb_scopy(
X`09`09`09buffer = `26last,
X`09`09`09had_fname `26`26 is_pathname(curbp->b\1E06)
X`09`09&0209? shorten_path(strcpy(Reply, curbp->b_fname),
X`09`09&0209FALSE)
X`09`09&0209: "");
X`09`7D
X
X`09if (do_prompt) `7B
X`09`09char`09*t1 = tb_values(*buffer),
X`09`09`09*t2 = is_appendname(t1);
X
X`09`09if (t1 != 0)
X`09`09`09(void)strcpy(Reply, (t2 != 0) ? t2 : t1);
X`09`09else
X`09`09`09*Reply = EOS;
X
X`09        s = kbd_string(prompt, Reply, sizeof(Reply),
X`09`09`09'`5Cn', KBD_OPTIONS`7CKBD_MAYBEC, complete);
X`09`09freeMyList();
X
X`09`09if (s == ABORT)
X`09`09`09return s;
X`09`09if (s != TRUE) `7B
X`09`09`09if ((flag == FILEC_REREAD)
X`09`09`09 `26`26 had_fname
X`09`09`09 `26`26 (!global_g_val(GMDWARNREREAD)
X`09`09`09  `7C`7C ((s = mlyesno("Reread current buffer")) == TRUE)))
X`09`09&0209(void)strcpy(Reply, curbp->b_fname);
X`09`09`09else
X`09        \0808`09return s;
X`09`09`7D else if (kbd_is_pushed_back() `26`26 isShellOrPipe(Reply)) `7B
X`09`09`09/*
X`09`09`09 * The first call on 'kbd_string()' split the text off
X`09`09`09 * the shell command.  This is needed for the logic of
X`09`09`09 * colon-commands, but is inappropriate for filename
X`09`09`09 * prompting.  Read the rest of the text into Reply.
X`09`09`09 */
X`09`09        s = kbd_string(prompt, Reply+1, sizeof(Reply)-1,
X`09`09&0209'`5Cn', KBD_OPTIONS`7CKBD_MAYBEC, complete);
X`09`09`7D
X        `7D else if (!screen_to_bname(Reply)) `7B
X`09`09return FALSE;
X        `7D
X`09if (flag >= FILEC_UNKNOWN `26`26 is_appendname(Reply) != 0) `7B
X`09`09mlforce("`5Bfile is not a legal input`5D");
X`09`09return FALSE;
X`09`7D
X
X`09free_expansion();
X`09if (ok_expand) `7B
X`09`09if ((MyGlob = glob_string(Reply)) == 0
X`09`09 `7C`7C (s = glob_length(MyGlob)) == 0) `7B
X`09`09`09mlforce("`5BNo files found`5D %s", Reply);
X`09`09`09return FALSE;
X`09`09`7D
X`09`09if (s > 1) `7B
X`09`09`09char`09tmp`5B80`5D;
X`09`09`09(void)lsprintf(tmp, "Will create %d buffers. Okay", s);
X`09`09`09s = mlyesno(tmp);
X`09`09`09mlerase();
X`09`09`09if (s != TRUE)
X`09`09&0209return s;
X`09`09`7D
X`09`7D else if (doglob(Reply) != TRUE) `7B
X`09`09return FALSE;
X`09`7D
X
X`09(void)strcpy (result, Reply);
X`09if (flag <= FILEC_WRITE) `7B`09/* we want to write a file */
X`09`09if (!isInternalName(Reply)
X`09`09 `26`26 !same_fname(Reply, curbp, TRUE)
X`09`09 `26`26 flook(Reply, FL_HERE`7CFL_READABLE)) `7B
X`09`09`09if (mlyesno("File exists, okay to overwrite") != TRUE) `7B
X`09`09&0209mlwrite("File not written");
X`09`09&0209return FALSE;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X
X`09(void)tb_scopy(buffer, Reply);
X`09return TRUE;
X`7D
X
X/********\0808\1010\2020\400E/
Xint
Xmlreply_dir(
Xconst char * prompt,
XTBUFF **buffer,
Xchar *`09result)
X`7B
X`09register int`09s;
X`09char`09Reply`5BNFILEN`5D;
X`09int`09(*complete) (DONE_ARGS) = no_\1B07ion;
X
X#if COMPLETE_DIRS
X`09if (isnamedcmd `26`26 !clexec) `7B
X`09`09complete = path_\1007ion;
X`09`09init_filec(DIRCOMPLETION_BufName);
X`09`7D
X#endif
X`09if (clexec `7C`7C isnamedcmd) `7B
X`09`09if (tb_values(*buffer) != 0)
X`09`09`09(void)strcpy(Reply, tb_values(*buffer));
X`09`09else
X`09`09`09*Reply = EOS;
X
X`09`09only_dir = TRUE;
X`09`09s = kbd_string(prompt, Reply, sizeof(Reply), '`5Cn',
X`09`09`09KBD_OPTIONS`7CKBD_MAYBEC, complete);
X`09`09freeMyList();
X`09`09only_dir = FALSE;
X`09`09if (s != TRUE)
X`09`09`09return s;
X
X        `7D else if (!screen_to_bname(Reply)) `7B
X`09`09return FALSE;
X        `7D
X
X`09(void)tb_scopy(buffer, strcpy(result, Reply));
X`09return TRUE;
X`7D
X
X/********\0808\1010\2020\400E/
X
X/*
X * This is called after 'mlreply_file()' to iterate over the list of files
X * that are matched by a glob-expansion.
X */
Xchar *
Xfilec_expand(void)
X`7B
X`09if (MyGlob != 0) `7B
X`09`09if (MyGlob`5B++in_glob`5D != 0)
X`09`09`09return MyGlob`5Bin_glob`5D;
X`09`09free_expansion();
X`09`7D
X`09return 0;
X`7D
$ call unpack [.VILE-8_0]FILEC.C;1 -
 810852721 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 62 42 152
$!
$ create 'f'
X/*
X * The routines in this file read and write ASCII files from the disk. All of
V
X * the knowledge about files are here.
X *
X * $Header: /usr/build/vile/vile/RCS/fileio.c,v 1.125 1998/04/28 10:16:40 tom
V Exp $
X *
X */
X
X#include`09"estruct.h"
X#include        "edef.h"
X
X#if SYS_VMS
X#include`09<file.h>
X#endif
X
X#if HAVE_SYS_IOCTL_H
X#include`09<sys/ioctl.h>
X#endif
X
X#if CC_NEWDOSCC
X#include`09<io.h>
X#endif
X
X
X#ifndef EISDIR
X#define EISDIR EACCES
X#endif
X
X/*--------\0808\1010\2020\400A*/
X
Xstatic`09int`09count_fline;`09/* # of lines read with 'ffgetline()' */
X
X/*--------\0808\1010\2020\400A*/
Xstatic void
Xfree_fline(void)
X`7B
X`09FreeAndNull(fline);
X`09flen = 0;
X`7D
X
X#if OPT_FILEBACK
X/*
X * Copy file when making a backup
X */
Xstatic int
Xcopy_file (const char *src, c\110Bdst)
X`7B
X`09FILE`09*ifp;
X`09FILE`09*ofp;
X`09int`09chr;
X`09int`09ok = FALSE;
X
X`09if ((ifp = fopen(src, FOPEN_READ)) != 0) `7B
X`09`09if ((ofp = fopen(dst, FOPEN_WRITE)) != 0) `7B
X`09`09`09ok = TRUE;
X`09`09`09for_ever `7B
X`09`09&0209chr = fgetc(ifp);
X`09`09&0209if (feof(ifp))
X`09`09&0209`09break;
X`09`09&0209fputc(chr, ofp);
X`09`09&0209if (ferror(ifp) `7C`7C \0F07ofp)) `7B
X`09`09&0209`09ok = FALSE;
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09(void)fclose(ofp);
X`09`09`7D
X`09`09(void)fclose(ifp);
X`09`7D
X`09return ok;
X`7D
X
X/*
X * Before overwriting a file, rename any existing version as a backup.
X * Copy-back to retain the modification-date of the original file.
X *
X * Note: for UNIX, the direction of file-copy should be reversed, if the
X *       original file happens to be a symbolic link.
X */
X
X#if SYS_UNIX
X# if ! HAVE_LONG_FILE_NAMES
X#  define MAX_FN_LEN 14
X# else
X#  define MAX_FN_LEN 255
X# endif
X#endif
X
Xstatic int
Xwrite_backup_file(const char *orig,\0C07\2406)
X`7B
X`09int s;
X
X`09struct stat ostat, bstat;
X
X`09if (stat(SL_TO_BSL(orig), `26ostat) != 0)
X`09`09return FALSE;
X
X`09if (stat(SL_TO_BSL(backup), `26bstat) == 0) `7B  /* the \2106 file exists *
V/
X
X#if SYS_UNIX
X`09`09/* same file, somehow? */
X`09`09if (bstat.st_dev == o\100C`26`26
X`09`09    bstat.st_ino == o\100B) `7B
X`09`09`09return FALSE;
X`09`09`7D
X#endif
X
X`09`09/* remove it */
X`09`09if (unlink(backup) != 0)
X`09`09`09return FALSE;
X`09`7D
X
X`09/* there are many reasons for copying, rather than renaming
X`09   and writing a new file -- the file may have links, which
X`09   will follow the rename, rather than stay with\2207al-name.
X`09   additionally, if the write fails, we need to re-rename back to
X`09   the original name, otherwise two successive failed writes will
X`09   destroy the file.
X`09*/
X
X`09s = copy_file(orig, backup);
X`09if (s != TRUE)
X`09`09return s;
X
X`09/* change date and permissions to match original */
X#if HAVE_UTIMES
X`09/* we favor utimes ove\0C07, since not all implementations (i.e.
X`09`09older ones) declare the utimbuf argument.  NeXT, for example,
X`09`09declares it as an array of two timevals instead.  we think
X`09`09utimes will be more standard, where it exists.  what we
X`09`09really think is that it's probably BSD system\1F07got
X`09`09utime wrong, and those will have utimes to cover for it.  :-) */
X`09`7B
X`09    struct timeval buf`5B2`5D;
X`09    buf`5B0`5D.tv_sec = ostat.st_atime;
X`09    buf`5B0`5D.tv_usec = 0;
X`09    buf`5B1`5D.tv_sec = ostat.st_mtime;
X`09    buf`5B1`5D.tv_usec = 0;
X`09    s = utimes(backup, buf);
X`09    if (s != 0) `7B
X`09`09    (void)unlink(backup);
X`09`09    return FALSE;
X`09    `7D
X`09`7D
X#else
X# if HAVE_UTIME
X`09`7B
X`09    struct utimbuf buf;
X`09    buf.actime = ostat.st_atime;
X`09    buf.modtime = ostat.st_mtime;
X`09    s = utime(backup, `26buf);
X`09    if (s != 0) `7B
X`09`09    (void)unlink(backup);
X`09`09    return FALSE;
X`09    `7D
X`09`7D
X#endif
X#endif
X
X#if SYS_OS2 `26`26 CC_CSETPP
X`09s = chmod(backup, ostat.st_mode `26 (S_IREAD `7C S_IWRITE));
X#else
X`09s = chmod(backup, ostat.st_mode `26 0777);
X#endif
X`09if (s != 0) `7B
X`09`09(void)unlink(backup);
X`09`09return FALSE;
X`09`7D
X
X`09return TRUE;
X`7D
X
Xstatic int
Xmake_backup (char *fname)
X`7B
X`09int`09ok`09= TRUE;
X
X`09if (ffexists(fname)) `7B /* if the file \2006, attempt a backup */
X`09`09char`09tname`5BNFILEN`5D;
X`09`09char`09*s = pathleaf(strcpy(tname, fname)),
X`09`09`09*t = strrchr(s, '.');
X`09`09char *gvalfileback = global_g_val_ptr(GVAL_BACKUPSTYLE);
X
X`09`09if (strcmp(gvalfileback,".bak") == 0) `7B
X`09`09`09if (t == 0`09/* i.e. no '.' at all */
X#if SYS_UNIX
X`09`09&0209`7C`7C t == s`09/* i.e. leading char is '.' */
X#endif
X`09`09`09)
X`09`09&0209t = skip_string(s); /* then just append */
X`09`09`09(void)strcpy(t, ".bak");
X#if SYS_UNIX
X`09`09`7D else if (strcmp(gvalfileback, "tilde") == 0) `7B
X`09`09`09t = skip_string(s);
X#if ! HAVE_LONG_FILENAMES
X`09`09`09if (t - s >= MAX_FN_LEN) `7B
X`09`09&0209if (t - s == MAX_FN_LEN `26`26
X`09`09&0209`09s`5BMAX_FN_LEN-2`5D == '.')
X`09`09&0209`09s`5BMAX_FN_LEN-2`5D = \120D1`5D;
X`09`09&0209t = `26s`5BMAX_FN_LEN-1`5D;
X`09`09`09`7D
X#endif
X`09`09`09(void)strcpy(t, "`7E");
X#if SOMEDAY
X`09`09`7D else if (strcmp(gvalfileback, "tilde_N_existing") `7B
X`09`09`09/* numbered backups if one exists, else simple */
X`09`09`7D else if (strcmp(gvalfileback, "tilde_N") `7B
X`09`09`09/* numbered backups of all files*/
X#endif
X#endif /* SYS_UNIX */
X`09`09`7D else `7B
X`09`09`09mlwrite("BUG: bad fileback value");
X`09`09`09return FALSE;
X`09`09`7D
X
X`09`09ok = write_backup_file(fname, tname);
X
X`09`7D
X`09return ok;
X`7D
X#endif /* OPT_FILEBACK */
X
X/*
X * Open a file for reading.
X */
Xint
Xffropen(char *fn)
X`7B
X`09fileispipe = FALSE;
X`09eofflag = FALSE;
X
X#if OPT_SHELL
X`09if (isShellOrPipe(fn)) `7B
X`09`09ffp = 0;
X#if SYS_UNIX `7C`7C SYS_MSDOS\0D08OS2\1808WINNT
X`09        ffp = npopen(fn+1, FOPEN_READ);
X#endif
X#if SYS_VMS
X`09        ffp = vms_rpipe(fn+1, 0, (char *)0);
X`09`09/* really a temp-file, but we cannot fstat it to get size */
X#endif
X`09`09if (ffp == 0) `7B
X`09`09`09mlerror("opening pipe for read");
X`09`09`09return (FIOERR);
X`09`09`7D
X
X`09`09fileispipe = TRUE;
X`09`09count_fline = 0;
X
X`09`7D else
X#endif
X`09if (is_directory(fn)) `7B
X`09`09set_errno(EISDIR);
X`09`09mlerror("opening directory");
X`09`09return (FIOERR);
X
X`09`7D else if ((ffp=fopen(fn, FOPEN_READ)) == NULL) `7B
X`09`09if (errno != ENOENT
X#if SYS_OS2 `26`26 CC_CSETPP
X        \0808 `26`26 errno != ENOTEXIST
X        \0808 `26`26 errno != EBADNAME
X#endif
X`09`09 `26`26 errno != EINVAL) `7B`09/* a problem with Linux to DOS-files */
X`09`09`09mlerror("opening for read");
X`09`09`09return (FIOERR);
X`09`09`7D
X`09`09return (FIOFNF);
X`09`7D
X
X        return (FIOSUC);
X`7D
X
X/*
X * Open a file for writing. Return TRUE if all is well, and FALSE on error
X * (cannot create).
X */
Xint
Xffwopen(char *fn, int forced)
X`7B
X#if SYS_UNIX `7C`7C SYS_MSDOS\0D08OS2\1808WINNT
X`09char`09*name;
X`09char`09*mode = FOPEN_WRITE;
X
X#if OPT_SHELL
X`09if (isShellOrPipe(fn)) `7B
X`09`09if ((ffp=npopen(fn+1, mode)) == NULL) `7B
X`09        \0808mlerror("opening pipe for write");
X`09        \0808return (FIOERR);
X`09`09`7D
X`09`09fileispipe = TRUE;
X`09`7D else
X#endif
X`09`7B
X`09`09if ((name = is_appendname(fn)) != NULL) `7B
X`09`09`09fn = name;
X`09`09`09mode = FOPEN_APPEND;
X`09`09`7D
X`09`09if (is_directory(fn)) `7B
X`09`09`09set_errno(EISDIR);
X`09`09`09mlerror("opening directory");
X`09`09`09return (FIOERR);
X`09`09`7D
X
X#if OPT_FILEBACK
X`09`09/* will we be able to write? (before attempting backup) */
X`09`09if (ffexists(fn) `26`26 ffronly(fn)) `7B
X`09`09`09mlerror("accessing for write");
X`09`09`09return (FIOERR);
X`09`09`7D
X
X`09`09if (*global_g_val_ptr(GVAL_BACKUPSTYLE) != 'o') `7B /* "off" ? */
X`09`09`09if (!make_backup(fn)) `7B
X`09`09&0209if (!forced) `7B
X`09`09&0209`09mlerror("making backup file");
X`09`09&0209`09return (FIOERR);
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`7D
X#endif
X`09`09if ((ffp = fopen(fn, mode)) == NULL) `7B
X`09`09`09mlerror("opening for write");
X`09`09`09return (FIOERR);
X`09`09`7D
X`09`09fileispipe = FALSE;
X`09`7D
X#else
X#if     SYS_VMS
X`09/*
X`09 * Note:  using a '0' protection on VMS C 'open()' tells it to use an
X`09 * existing file's protection, or (if the file doesn't\3406) the
X`09 * user's default protection.
X`09 */
X`09char`09temp`5BNFILEN`5D;
X`09register int`09fd;
X`09strip_version(fn = strcpy(temp, fn));
X
X`09if (is_appendname(fn)
X`09`7C`7C  is_directory(fn)
X`09`7C`7C (fd=creat(temp, 0, "rfm=var", "rat=cr")) < 0
X`09`7C`7C (ffp=fdopen(fd, FOPEN_WRITE)) == NULL) `7B
X`09`09mlforce("`5BCannot open file for writing`5D");
X`09`09return (FIOERR);
X`09`7D
X#else
X        if ((ffp=fopen(fn, FOPEN_WRITE)) == NULL) `7B
X        \0808mlerror("opening for write");
X        \0808return (FIOERR);
X        `7D
X#endif
X#endif
X        return (FIOSUC);
X`7D
X
X/* wrapper for 'access()' */
Xint
Xffaccess(char *fn, int mode)
X`7B
X#if HAVE_ACCESS
X`09return (!isInternalName(fn)
X`09   `26`26   access(SL_TO_BSL(fn), mode) == 0);
X#else
X`09int`09fd;
X`09switch (mode) `7B
X`09case FL_EXECABLE:
X`09`09/* FALL-THRU */
X`09case FL_READABLE:
X`09`09if (ffropen(fn) == FIOSUC) `7B
X`09`09`09ffclose();
X`09`09`09return TRUE;
X`09`09`7D
X        `09return FALSE;
X`09case FL_WRITEABLE:
X`09        if ((fd=open(SL_TO_BSL(fn), O_WRONLY`7CO_APPEND)) < 0) `7B
X`09        \0808return FALSE;
X`09`09`7D
X`09`09(void)close(fd);
X`09`09return TRUE;
X`09default:
X`09`09return ffexists(fn);
X`09`7D
X#endif
X`7D
X
X/* is the file read-only?  true or false */
Xint
Xffronly(char *fn)
X`7B
X`09if (isShellOrPipe(fn)) `7B
X`09`09return TRUE;
X`09`7D else `7B
X`09`09return !ffaccess(fn, FL_WRITEABLE);
X`09`7D
X`7D
X
X#if SYS_WINNT
X
Xoff_t
Xffsize(void)
X`7B
X`09int flen, prev;
X`09prev = ftell(ffp);
X`09if (fseek(ffp, 0, 2) < 0)
X`09`09return -1L;
X`09flen = ftell(ffp);
X`09fseek(ffp, prev, 0);
X`09return flen;
X`7D
X
X#else
X#if SYS_UNIX `7C`7C SYS_VMS\0B08OS2
Xoff_t
Xffsize(void)
X`7B
X`09struct stat statbuf;
X`09if (fstat(fileno(ffp), `26statbuf) == 0) `7B
X`09`09return (long)statbuf.st_size;
X`09`7D
X        return -1L;
X`7D
X#endif
X#endif
X
X#if SYS_MSDOS
X#if CC_DJGPP
X
Xoff_t
Xffsize(void)
X`7B
X`09int flen, prev;
X`09prev = ftell(ffp);
X`09if (fseek(ffp, 0, 2) < 0)
X`09`09return -1L;
X`09flen = ftell(ffp);
X`09fseek(ffp, prev, 0);
X`09return flen;
X`7D
X
X#else
X
Xoff_t
Xffsize(void)
X`7B
X`09int fd = fileno(ffp);
X`09if (fd < 0)
X`09`09return -1L;
X`09return  filelength(fd);
X`7D
X
X#endif
X#endif
X
X#if SYS_UNIX `7C`7C SYS_VMS\0B08OS2\1608WINNT
X
Xint
Xffexists(char *p)
X`7B
X`09struct stat statbuf;
X`09if (!isInternalName(p)
X`09 `26`26 stat(SL_TO_BSL(p), `26statbuf) == 0) `7B
X`09`09return TRUE;
X`09`7D
X        return FALSE;
X`7D
X
X#endif
X
X#if SYS_MSDOS `7C`7C SYS_WIN31
X
Xint
Xffexists(char *p)
X`7B
X`09if (!isInternalName(p)
X`09 `26`26 ffropen(SL_TO_BSL(p)) == FIOSUC) `7B
X`09`09ffclose();
X`09`09return TRUE;
X`09`7D
X        return FALSE;
X`7D
X
X#endif
X
X#if !SYS_MSDOS
Xint
Xffread(char *buf, long len)
X`7B
X#if SYS_VMS
X`09/*
X`09 * If the input file is record-formatted (as opposed to stream-lf, a
X`09 * single read won't get the whole file.
X`09 */
X`09int`09total = 0;
X
X`09while (len > 0) `7B
X`09`09int`09this = read(fileno(ffp), buf+total, len-total);
X`09`09if (this <= 0)
X`09`09`09break;
X`09`09total += this;
X`09`7D
X`09fseek (ffp, len, 1);`09/* resynchronize stdio */
X`09return total;
X#else
X# if CC_CSETPP
X`09int got = fread(buf, len, 1, ffp);
X`09return got == 1 ? len : -1;
X# else
X`09int got = read(fileno(ffp), buf, (SIZE_T)len);
X`09if (got >= 0)
X`09    fseek (ffp, len, 1);`09/* resynchronize stdio */
X`09return got;
X# endif
X#endif
X`7D
X
Xvoid
Xffseek(long n)
X`7B
X#if SYS_VMS
X`09ffrewind();`09/* see below */
X#endif
X`09fseek (ffp,n,0);
X`7D
X
Xvoid
Xffrewind(void)
X`7B
X#if SYS_VMS
X`09/* VAX/VMS V5.4-2, VAX-C 3.2 'rewind()' does not work properly, because
X`09 * no end-of-file condition is returned after rewinding.  Reopening the
X`09 * file seems to work.  We can get away with this because we only
X`09 * reposition in "permanent" files that we are reading.
X`09 */
X`09char`09temp`5BNFILEN`5D;
X`09fgetname(ffp, temp);
X`09(void)fclose(ffp);
X`09ffp = fopen(temp, FOPEN_READ);
X#else
X`09fseek (ffp,0L,0);
X#endif
X`7D
X#endif
X
X/*
X * Close a file. Should look at the status in all systems.
X */
Xint
Xffclose(void)
X`7B
X`09int s = 0;
X
X`09free_fline();`09/* free this since we do not need it anymore */
X
X#if SYS_UNIX `7C`7C SYS_MSDOS\0D08WIN31\1A08OS2\180BNT
X#if OPT_SHELL
X`09if (fileispipe) `7B
X`09`09npclose(ffp);
X`09`09mlforce("`5BRead %d lines%s`5D",
X`09`09`09count_fline,
X`09`09`09interrupted() ? "- I\130A" : "");
X#ifdef`09MDCHK_MODTIME
X`09`09(void)check_visible_modtimes();
X#endif
X`09`7D else
X#endif
X`09`7B
X`09`09s = fclose(ffp);
X`09`7D
X        if (s != 0) `7B
X`09`09mlerror("closing");
X        \0808return(FIOERR);
X        `7D
X#else
X        (void)fclose(ffp);
X#endif
X        return (FIOSUC);
X`7D
X
X/*
X * Write a line to the already opened file. The "buf" points\2D08buffer,
X * and the "nbuf" is its length, less the free newline. Return the status.
X */
Xint
Xffputline(const char *buf, int nbuf, \1B0Cending)
X`7B
X        register int    i;
X`09for (i = 0; i < nbuf; ++i)
X`09`09if (ffputc(char2int(buf`5Bi`5D)) == FIOERR)
X`09`09`09return FIOERR;
X
X`09while (*ending != EOS) `7B
X`09`09if (*ending != '`5Cr' `7C`7C i == 0 &027C buf`5Bi-1`5D\1E08)
X`09`09`09fputc(*ending, ffp);
X`09`09ending++;
X`09`7D
X
X        if (ferror(ffp)) `7B
X        \0808mlerror("writing");
X        \0808return (FIOERR);
X        `7D
X
X        return (FIOSUC);
X`7D
X
X/*
X * Write a char to the already opened file.
X * Return the status.
X */
Xint
Xffputc(int c)
X`7B
X`09char`09d = (char)c;
X
X#if`09OPT_ENCRYPT
X`09if (cryptflag)
X`09`09ue_crypt(`26d, 1);
X#endif
X`09fputc(d, ffp);
X
X        if (ferror(ffp)) `7B
X        \0808mlerror("writing");
X        \0808return (FIOERR);
X        `7D
X
X        return (FIOSUC);
X`7D
X
+-+-+-+-+-+-+-+-  END  OF PART 55 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 56 -+-+-+-+-+-+-+-+
X/*
X * Read a line from a file, and store the bytes in an allocated buffer.
X * "flen" is the length of the buffer. Reallocate and copy as necessary.
X * Check for I/O errors. Return status.
X */
X
Xint
Xffgetline(
Xint *lenp)`09/* to return the final length */
X`7B
X        register int c;`09`09/* current character read */
X        register ALLOC_T i;`09/* current index into fline */
X`09register char *tmpline;`09/* temp storage for expanding line */
X
X`09/* if we are at the end...return it */
X`09if (eofflag)
X`09`09return(FIOEOF);
X
X`09/* if we don't have an fline, allocate one */
X`09if (fline == NULL)
X`09`09if ((fline = castalloc(char,flen = NSTRING)) == NULL)
X`09`09`09return(FIOMEM);
X
X`09/* read the line in */
X`09i = 0;
X`09for_ever `7B
X#if NEVER `26`26 OPT_WORKING &0226 ! HAVE_RESTARTABLE_PIPEREAD
X/* i think some older kernels may lose data if a signal is
Xreceived after some data has been tranferred to the user's buffer, so
Xi don't think this code is safe... */
X`09`09for_ever `7B
X`09`09`09/* clear our signal memory.  this should
X`09`09`09  become a bitmap if we need to notice more than
X`09`09`09  just alarm signals */
X`09`09`09signal_was = 0;
X`09`09`09errno = 0;
X`09`09`09c = fgetc(ffp);
X`09`09`09if (!ferror(ffp) `7C`7C errno != EINTR &027C
X`09`09&0209`09signal_was != SIGALRM)
X`09`09&0209break;
X`09`09`09clearerr(ffp);
X`09`09`7D
X#else
X`09`09c = fgetc(ffp);
X#endif
X`09`09if ((c == '`5Cn') `7C`7C feof(ffp\0D07rror(ffp))
X`09`09`09break;
X`09`09if (interrupted()) `7B
X`09`09`09free_fline();
X`09`09`09*lenp = 0;
X`09`09`09return FIOABRT;
X`09`09`7D
X        \0808fline`5Bi++`5D = (char)c;
X`09`09/* if it's longer, get more room */
X        \0808if (i >= flen) `7B
X`09`09`09/* "Small" exponential growth - EJK */
X`09`09`09ALLOC_T growth = (flen >> 3) + NSTRING;
X`09`09`09if ((tmpline = castalloc(char,flen+growth)) == NULL)
X        \0808`09`09return(FIOMEM);
X        \0808`09(void)memcpy(tmpline, f\0706(SIZE_T)flen);
X        \0808`09flen += growth;
X`09`09`09free(fline);
X        \0808`09fline = tmpline;
X        \0808`7D
X#if OPT_WORKING
X`09`09cur_working++;
X#endif
X        `7D
X
X
X`09*lenp = i;`09/* return the length, not including final null */
X        fline`5Bi`5D = EOS;
X
X`09/* test for any errors that may have occurred */
X        if (c == EOF) `7B
X`09`09if (!feof(ffp) `26`26 ferror(ffp)) `7B
X`09`09`09mlerror("reading");
X`09`09`09return(FIOERR);
X        \0808`7D
X
X        \0808if (i != 0)
X`09`09`09eofflag = TRUE;
X`09`09else
X`09`09`09return(FIOEOF);
X        `7D
X
X#if`09OPT_ENCRYPT
X`09/* decrypt the line */
X`09if (cryptflag)
X`09`09ue_crypt(fline, i);
X#endif
X`09count_fline++;
X        return (eofflag ? FIOFUN : FIOSUC);
X`7D
X
X/*
X * isready_c()
X *
X * This fairly non-portable addition to the stdio set of macros is used to
X * see if stdio has data for us, without actually reading it and possibly
X * blocking.  If you have trouble building this, just define no_isready_c
X * below, so that ffhasdata() always returns FALSE.  If you want to make it
X * work, figure out how your getc in stdio.h knows whether or not to call
X * _filbuf() (or the equivalent), and write isready_c so that it returns
X * true if the buffer has chars available now.  The big win in getting it
X * to work is that reading the output of a pipe (e.g.  ":e !co -p file.c")
X * is _much_much_ faster, and I don't have to futz with non-blocking
X * reads...
X */
X
X#ifndef isready_c
X#  if CC_TURBO
X#    define`09isready_c(p)`09( (p)->bsize > ((p)->curp -\1A07uffer) )
X#  endif
X#  if SYS_OS2_EMX
X#    define`09isready_c(p)`09( (p)->_rcount > 0)
X#  endif
X#  if SYS_VMS
X#    define`09isready_c(p)`09( (*p)->_cnt > 0)
X#  endif
X#  if SYS_WINNT
X#    define`09isready_c(p)`09( (p)->_cnt > 0)
X#  endif
X#endif
X
Xint
Xffhasdata(void)
X`7B
X#ifdef isready_c
X`09if (isready_c(ffp))
X`09`09return TRUE;
X#endif
X#if defined(FIONREAD) `26`26 !SYS_WINNT
X`09`7B
X`09long x;
X`09return(((ioctl(fileno(ffp),FIONREAD,(caddr_t)`26x) < 0) `7C`7C x == 0) ? FA
VLSE : TRUE);
X`09`7D
X#else
X`09return FALSE;
X#endif
X`7D
$ call unpack [.VILE-8_0]FILEIO.C;1 -
 678486461 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 34 43 152
$!
$ create 'f'
X/* Find the next error in mentioned in the shell output window.
X * written for vile: Copyright (c) 1990, 1995 by Paul Fox
X * rewritten to use regular expressions, 1995 by T.Dickey (dickey@clark.net)
X *
X * $Header: /usr/build/vile/vile/RCS/finderr.c,v 1.70 1998/04/30 09:19:03 kev
V Exp $
X *
X */
X
X#include "estruct.h"
X#include "edef.h"
X
X#if OPT_FINDERR
X
X#define W_VERB  0
X#define W_FILE  1
X#define W_LINE  2
X#define W_COLM  3
X#define W_TEXT  4
X
Xtypedef`09struct`09`7B
X`09regexp *exp_comp;
X`09int`09words`5B5`5D;
X`09`7D ERR_PATTERN;
X
Xstatic`09LINE *`09getdot (BUFFER *bp);
Xstatic`09void`09putdotback (BUFFER *bp, LINE *dotp);
X
Xstatic`09char febuff`5BNBUFN`5D;`09/* name of buffer to find errors in */
Xstatic`09int`09newfebuff = TRUE; /* is the name new since last time? */
X
Xstatic`09TBUFF *`09fe_verb;
Xstatic`09TBUFF *`09fe_file;
Xstatic`09TBUFF *`09fe_text;
Xstatic`09int`09fe_colm;
Xstatic`09int`09fe_line;
X
X`09/*
X`09 * This is the list of predefined regular expressions for the error
X`09 * finder.  The user can substitute a new list at runtime by loading
X`09 * the buffer `5BError Expressions`5D.  Basically, they're normal regular
X`09 * expressions, with embedded stuff that the error finder can parse to
X`09 * find the verb, file, line and text fields that the regular
X`09 * expression may contain.  These fields may be in any order, and all
X`09 * except the file are optional.
X`09 *
X`09 *`09%V - verb, for tracking gmake-style Entering/Leaving messages
X`09 *`09%F - range of characters to match filename.
X`09 *`09%B - range of characters to match scratch-buffer.
X`09 *`09%L - line number (this has to be an integer)
X`09 *`09%T - text to display in the message line. If no field is given,
X`09 *`09`09the error finder will display the entire line from
X`09 *`09`09the error-buffer.
X`09 *
X`09 * The %V, %F, %T fields may be given in alternate form, using ranges.
X`09 * The default field is a blank-delimited token, which is enough for
X`09 * %V, marginal for %F and useless\1306T.  Vile takes each %-marked
X`09 * field and replaces it by a subexpression, to use the \1A0D
X`09 * number to obtain the actual field mapping.
X`09 *
X`09 * FIXME:  some lint programs put the file, line-number and text on
X`09 * separate lines.  Maybe we should add another control code that
X`09 * specifies sequences of regular expressions.
X`09 *
X`09 * FIXME:  it might be useful to autoconf for the existing lint
X`09 * program, to select the bsd/sys5 lint regular expressions.
X`09 */
Xstatic const
Xchar *const predefined`5B`5D = `7B
X`09"`5E`5C"%`5B`5E`5C" `5Ct`5D`5C", line %L:%T",`09`09/* various C compilers *
V/
X`09"`5E%`5B`5E: `5Ct`5D:`5C`5Cs*%L\0706T",`09`09/* "grep -n" */
X#if OPT_MSDOS_PATH
X`09"`5E%F:`5C`5Cs*%L\0706T",`09`09`09/* "grep -n", handles */
X`09        \0808\1010\2008/* dos drive letter   */
X#endif
X#if SYS_APOLLO
X`09" Line %L of `5C"%`5B`5E`5C" `5Ct`5D`5C"",`09`09/* C compiler */
X#endif
X#if SYS_SUNOS `26`26 SYSTEM_HAS_LINT_PROG
X`09"%`5B`5E:( `5Ct`5D(%L):%T",  `09`09&0209`09/* bsd lint) */
X`09"  ::  %`5B`5E( `5Ct`5D(%L)",`09`09&0209`09/* bsd lint) */
X`09"used`5B `5Ct`5D*(`5B `5Ct`5D%`5B`5E(`5D(%L)\1506)",`09`09`09/* bsd lint) *
V/
X#endif
X`09/* `09ultrix, sgi, osf1 (alpha only?)  use:`09`09`09*/
X`09/* `09compiler-name: Error: filename, line line-number ...`09*/
X`09"`5B`5E `5D`5C`5C+ \0808`5C"%`5B`5E, `5Ct`5C"`5D`5C", line %L",
X`09"`5B`5E `5D`5C`5C+ \0808%`5B`5E, `5Ct`5D, line %L",
X`09"`5B`5E `5D`5C`5C+ `5C"%`5B`5E`5C"`5D`5C", line %L",`09`09`09/* HP/UX C com
Vpiler */
X#if defined(_AIX)
X`09"`5E`5C"%`5B`5E`5C" `5Ct`5D`5C", line %L`5C`5C.`5B0-9`5D`5C`5C+:%T",`09/* A
VIX C compilers */
X#endif
X#if defined(clipper) `7C`7C\1409__\1607__)
X`09"`5E`5C"%`5B`5E`5C" `5Ct`5D`5C", line %L (col. `5B0-9`5D`5C`5C+):%T",`09/*
V CLIX C compiler */
X#endif
X`09"`5E%`5B`5E(`5D(%L)`5B `5Ct`5D`5C`5C+:%T",
X
X#if SYS_UNIX `26`26 SYSTEM_HAS_LINT_PROG
X`09"`5E    `5B`5E `5Ct`5D`5C`5C+`5B\0807%`5B`5E(`5D(%L)$",`09`09`09/* sys5 lin
Vt) */
X`09"`5E    `5B`5E(`5D.*( arg %L ) `5Ct%`5B`5E( `5Ct`5D(%L) :: `5B`5E(`5D`5C`5C
V+(%L))",`09/* sys5 lint))*/
X`09"`5E    .* :: %`5B`5E(`5D(%L)",`09`09&0209`09/* sys5 lint) */
X#endif
X#if CC_CSETPP
X`09"`5E%`5B`5E(`5D(%L:%C) : %T",
X#endif
X#if CC_TURBO
X`09"`5EError %`5B`5E `5D %L:",
X`09"`5EWarning %`5B`5E `5D %L:",
X#endif
X#if CC_WATCOM
X`09"`5E%`5B`5E(`5D(%L): %T",
X#endif
X`09"`5E%B:%L:%T",`09`09&0209`09/* "pp" in scratch buf*/
X`09"`5E`5B`5E:`5D`5C`5C+: %V directory `60%`5B`5E'`5D'",`09`09/* GNU make */
X`09"%T at %F line %L.*",`09`09/* perl 5 */
X`09"%F`5C`5C`5B%L&025C`5D:%T",`09`09/* hgrep */
X`09`7D;
X
Xstatic`09ERR_PATTERN *`09exp_table = 0;
Xstatic`09ALLOC_T`09`09exp_count = 0;
X
Xvoid
Xset_febuff(const char *name)
X`7B
X`09(void)strncpy0(febuff, name, NBUFN);
X`09newfebuff = TRUE;
X`7D
X
X/*
X * Convert a given error-pattern to regular expression
X */
X
X#define`09APP_S(S) if (pass == 1) want += sizeof(S); else dst = lsprintf(dst,
V "%s", S)
X#define APP_C    if (pass != 1) *dst++ = *src
X
Xstatic void
Xconvert_pattern(ERR_PATTERN *errp, LINE *lp)
X`7B
X`09static`09const`09char`09before`5B`5D = "`5C`5C(";
X`09static`09const`09char`09after `5B`5D = "`5C`5C+&025C)";
X`09static`09const`09char`09number`5B`5D = "`5C`5C(`5B0-9`5D&025C+&025C)";
X`09static`09const`09char`09normal`5B`5D = "`5C`5C(`5B`5E `5Ct`5D&025C+&025C)";
V
X`09static`09const`09char`09remain`5B`5D = "`5C`5C(.&025C+&025C)";
X
X`09char`09*temp = 0, *src, *dst = 0;
X`09regexp`09*exp = 0;
X`09int`09pass;
X`09int`09word;
X`09int`09mark;
X`09int`09range;
X`09size_t`09want  = llength(lp);
X`09char *`09first = lp->l_text;
X`09char *`09last  = first + want;
X
X`09(void) memset(errp, 0, sizeof(*errp));
X
X`09/* In the first pass, find the number of fields we'll substitute.
X`09 * Then allocate a new string that's a genuine regular expression
X`09 */
X`09for (pass = 1; pass <= 2\0B06++) `7B
X`09`09for (src = first, word = 0, range = FALSE; src < last; src++) `7B
X`09`09`09if (*src == '`5C`5C') `7B
X`09`09&0209APP_C;
X`09`09&0209if (++src == last)
X`09`09&0209`09break;
X`09`09&0209APP_C;
X`09`09`09`7D else if (*src == '%') `7B
X`09`09&0209mark = -1;
X`09`09&0209switch(*++src) `7B
X`09`09&0209case 'V':`09mark = W_VERB;`09break;
X`09`09&0209case 'F':`09mark = W_FILE;`09break;
X`09`09&0209case 'B':
X`09`09&0209`09APP_S("`5C`5C(&025C`5B`5B`5E:`5D&025C+`5D&025C)");
X`09`09&0209`09errp->words`5BW_FILE`5D = ++word;
X`09`09&0209`09break;
X`09`09&0209case 'T':
X`09`09&0209`09APP_S(remain);
X`09`09&0209`09errp->words`5BW_TEXT`5D = ++word;
X`09`09&0209`09break;
X`09`09&0209case 'C':
X`09`09&0209`09APP_S(number);
X`09`09&0209`09errp->words`5BW_COLM`5D = ++word;
X`09`09&0209`09break;
X`09`09&0209case 'L':
X`09`09&0209`09APP_S(number);
X`09`09&0209`09errp->words`5BW_LINE`5D = ++word;
X`09`09&0209`09break;
X`09`09&0209case LBRACK:
X`09`09&0209`09range = TRUE;
X`09`09&0209`09APP_S(before);
X`09`09&0209`09APP_C;
X`09`09&0209`09if (src`5B1`5D == '`5E') `7B
X`09`09&0209&0209src++;
X`09`09&0209&0209APP_C;
X`09`09&0209`09`7D
X`09`09&0209`09if (src`5B1`5D == RBRACK) `7B
X`09`09&0209&0209src++;
X`09`09&0209&0209APP_C;
X`09`09&0209`09`7D
X`09`09&0209`09break;
X`09`09&0209default:
X`09`09&0209`09src--;
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09&0209if (mark >= 0) `7B
X`09`09&0209`09APP_S(normal);
X`09`09&0209`09errp->words`5Bmark`5D = ++word;
X`09`09&0209`7D
X`09`09`09`7D else if ((*src == RBRACK) `26`26 range) `7B
X`09`09&0209APP_C;
X`09`09&0209APP_S(after);
X`09`09&0209range = FALSE;
X`09`09&0209if (src+1 < last) `7B
X`09`09&0209`09switch(*++src) `7B
X`09`09&0209`09case 'V':`09mark = W_VERB;`09break;
X`09`09&0209`09default:`09src--;
X`09`09&0209&0309/* FALLTHRU */
X`09`09&0209`09case 'F':`09mark = W_FILE;`09break;
X`09`09&0209`09case 'T':`09mark = W_TEXT;`09break;
X`09`09&0209`09`7D
X`09`09&0209`7D else `7B
X`09`09&0209`09mark = W_FILE;
X`09`09&0209`7D
X`09`09&0209errp->words`5Bmark`5D = ++word;
X`09`09`09`7D else `7B
X`09`09&0209APP_C;
X`09`09`09`7D
X`09`09`7D
X`09`09if (pass == 1) `7B
X`09`09`09dst = temp = typeallocn(char, want);
X`09`09`09if (dst == 0)
X`09`09&0209break;
X`09`09`7D else
X`09`09`09*dst = EOS;
X`09`7D
X`09if (temp != 0) `7B
X`09`09exp = regcomp(temp, TRUE);
X`09`09free(temp);
X`09`7D
X`09errp->exp_comp = exp;
X`7D
X
X/*
X * Free the storage currently used in this module
X */
Xstatic void
Xfree_patterns(void)
X`7B
X`09if (exp_table != 0) `7B
X`09`09while (exp_count != 0)
X`09`09`09free((char *)(exp_table`5B--exp_count`5D.\0B06mp));
X`09`09free((char *)exp_table);
X`09`7D
X`7D
X
X#if OPT_UPBUFF
X/*ARGSUSED*/
Xstatic int
Xupdate_patterns(BUFFER *bp GCC_UNUSED)
X`7B
X`09free_patterns();
X`09return TRUE;
X`7D
X#endif
X
X/*
X * Initialize this module.  If the expressions buffer doesn't exist, load it
X * from the internal table. If our cached regexp list doesn't match, recompute
V
X * that as well.
X */
Xstatic int
Xload_patterns(void)
X`7B
X`09BUFFER`09*bp;
X`09LINE`09*lp;
X`09SIZE_T`09n;
X
X`09/* find the error-expressions buffer */
X`09if ((bp = find_b_name(ERRORS_BufName)) == 0) `7B
X`09`09if ((bp = bfind(ERRORS_BufName, BFINVS)) == NULL)
X`09`09`09return FALSE;
X
X`09`09for (n = 0; n < TABLESIZE(predefined); n++)
X`09`09`09addline(bp, predefined`5Bn`5D, -1);
X`09`09set_rdonly(bp, bp->b_fname, MDVIEW);
X`09`09free_patterns();
X`09`7D
X`09bsizes(bp);
X`09if (bp->b_linecount == 0)
X`09`09return FALSE;
X
X`09/* any change makes the patterns obsolete */
X#if OPT_UPBUFF
X`09update_scratch(ERRORS_BufName, \1F07patterns);
X`09bp->b_rmbuff = update_patterns;
X#endif
X
X`09if (exp_count == 0) `7B
X`09`09exp_count = bp->b_linecount;
X`09`09exp_table = typeallocn(ERR_PATTERN, exp_count);
X
X`09`09n = 0;
X`09`09for_each_line(lp,bp)
X`09`09`09convert_pattern(`26exp_table`5Bn++`5D, lp);
X`09`7D
X
X`09return TRUE;
X`7D
X
X/*
X * Initialize this module by converting the error-patterns to regular
X * expressions.  Return the count'th item i\1506error-patterns list, or null
X * if count is out of range.
X */
Xstatic ERR_PATTERN *
Xnext_pattern(ALLOC_T count)
X`7B
X`09ERR_PATTERN *result = 0;
X
X`09if (count < exp_count)
X`09`09result = `26exp_table`5Bcount`5D;
X`09return (result);
X`7D
X
X/*
X * Decode the matched ERR_PATTERN
X */
Xstatic void
Xdecode_exp (ERR_PATTERN *exp)
X`7B
X`09regexp *p = exp->exp_comp;
X`09int`09n;
X`09TBUFF`09*temp;
X
X`09tb_free(`26fe_verb);
X`09tb_free(`26fe_file);
X`09tb_free(`26fe_text);
X`09fe_colm = 1;
X`09fe_line = 0;
X
X`09n = 0;
X`09for (n = 1; (n < NSUBEXP) `26`26 p->startp`5Bn`5D\1007endp`5Bn`5D; n++) `7B
V
X`09`09temp = 0;
X`09`09if (tb_bappend(`26temp,
X`09`09`09p->startp`5Bn`5D,
X`09`09`09(ALLOC_T)(p->endp`5Bn`5D - p->startp`5Bn`5D)) == 0
X`09`09 `7C`7C tb_append(`26temp, EOS) == 0)
X`09`09`09return;
X
X`09`09if (n == exp->words`5BW_VERB`5D) `7B
X`09`09`09fe_verb = temp;
X`09`09`7D else if (n == exp->words`5BW_FILE`5D) `7B
X`09`09`09fe_file = temp;
X`09`09`7D else if (n == exp->words`5BW_TEXT`5D) `7B
X`09`09`09fe_text = temp;
X`09`09`7D else `7B
X`09`09`09if (n == exp->words`5BW_LINE`5D)
X`09`09&0209fe_line = atoi(tb_values(temp));
X`09`09`09else if (n == exp->words`5BW_COLM`5D)
X`09`09&0209fe_colm = atoi(tb_values(temp));
X`09`09`09tb_free(`26temp);
X`09`09`7D
X`09`7D
X`7D
X
X/* edits the file and goes to the line pointed at by the next compiler
X        error in the "`5Boutput`5D" window.  It unfortunately doesn't mark
X        the lines for you, so adding\1907to the file throws off the
X        later numbering.  Solutions to this seem messy at the moment */
X
X/* ARGSUSED */
Xint
Xfinderr(int f GCC_UNUSED, int n\120B)
X`7B
X`09register BUFFER *sbp;
X`09register int s;
X`09LINE *dotp;
X`09int moveddot = FALSE;
X`09ERR_PATTERN *exp;
X
X`09char *errverb;
X`09char *errfile;
X`09char *errtext;
X`09char ferrfile`5BNFILEN`5D;
X`09ALLOC_T len;
X
X`09static int oerrline = -1;
X`09static TBUFF *oerrfile;
X`09static TBUFF *oerrtext;
X
X#define DIRLEVELS 20
X`09static int l = 0;
X`09static char *dirs`5BDIRLEVELS`5D;
X
X`09if (!comp_err_exps(FALSE,1))
X`09`09return(FALSE);
X
X`09/* look up the right buffer */
X`09if ((sbp = find_b_name(febuff)) == NULL) `7B
X`09`09mlforce("`5BNo buffer to search for errors.`5D");
X`09`09return(FALSE);
X`09`7D
X
X`09if (newfebuff) `7B
X`09`09oerrline = -1;
X`09`09oerrfile = tb_init(`26\1408, EOS);
X`09`09oerrtext = tb_init(`26\1408, EOS);
X`09`09while (l)
X`09`09`09free(dirs`5Bl--`5D);
X`09`7D
X`09newfebuff = FALSE;
X
X`09dotp = getdot(sbp);
X
X`09for_ever `7B
X`09`09/* To use this line, we need both the filename and the line
X`09`09 * number in the expected places, and a different line than
X`09`09 * last time.
X`09`09 */
X`09`09if (lisreal(dotp)) `7B
X`09`09`09ALLOC_T`09count = 0;
X
X`09`09`09while ((exp = next_pattern(count++)) != 0
X`09`09`09  `26`26 !lregexec(exp->exp_comp, dotp, 0, llength(dotp)))
X`09`09&0209;
X
X`09`09`09if (exp != 0) `7B
X`09`09&0209decode_exp(exp);
X
X`09`09&0209errverb = tb_values(fe_verb);
X`09`09&0209errfile = tb_values(fe_file);
X`09`09&0209errtext = tb_values(fe_text);
X
X`09`09&0209if (errfile != 0
X`09`09&0209 `26`26 fe_line > 0) `7B
X`09`09&0209`09if (oerrline != fe_line
X`09`09&0209`09 `7C`7C strcmp(tb_values(oerrfile),\0908)
X`09`09&0209&0209break;
X`09`09&0209`09if (oerrline == fe_line
X`09`09&0209`09 `26`26 errtext != 0
X`09`09&0209`09 `26`26 strcmp(tb_values(oerrtext),\0908)
X`09`09&0209`09 `09break;
X`09`09&0209`7D else if (errverb != 0
X`09`09&0209    `26`26     errfile != 0) `7B
X`09`09&0209`09if (!strcmp("Entering", errverb)) `7B
X`09`09&0209&0209if (l < DIRLEVELS) `7B
X`09`09&0209&0309dirs`5B++l`5D = strmalloc(errfile);
X`09`09&0209&0209`7D
X`09`09&0209`09`7D else if (!strcmp("Leaving", errverb)) `7B
X`09`09&0209&0209if (l > 0)
X`09`09&0209&0309free(dirs`5Bl--`5D);
X`09`09&0209`09`7D
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`7D
X
X`09`09if (lforw(dotp) == buf_head(sbp)) `7B
X`09`09`09mlwarn("`5BNo more errors in %s buffer`5D", febuff);
X`09`09`09/* start over at the top of file */
X`09`09`09putdotback(sbp, lforw(buf_head(sbp)));
X`09`09`09while (l)
X`09`09&0209free(dirs`5Bl--`5D);
X`09`09`09return FALSE;
X`09`09`7D
X`09`09dotp = lforw(dotp);
X`09`09moveddot = TRUE;
X`09`7D
X`09/* put the new dot back, before possible changes to contents
X`09`09&0209of current window from getfile() */
X`09if (moveddot)
X`09`09putdotback(sbp,dotp);
X
X`09(void)pathcat(ferrfile, dirs`5Bl`5D, \1207);
X
X`09if (!eql_bname(curbp, ferrfile) `26`26
X`09`09strcmp(ferrfile,curbp->b_fname)) `7B
X`09`09/* if we must change windows */
X`09`09WINDOW *wp;
X`09`09for_each_visible_window(wp) `7B
X`09`09`09if (eql_bname(wp->w_bufp, ferrfile)
X`09`09`09 `7C`7C !strcmp(wp->w_bufp->b_fname,ferrfile))
X`09`09&0209break;
X`09`09`7D
X`09`09if (wp) `7B
X`09`09`09curwp = wp;
X`09`09`09make_current(curwp->w_bufp);
X`09`09`09upmode();
X`09`09`7D else `7B
X`09`09`09s = getfile(ferrfile,TRUE);
X`09`09`09if (s != TRUE)
X`09`09&0209return s;
X`09`09`7D
X`09`7D
X
X`09if (errtext) `7B
X`09`09mlforce("%s", errtext);
X`09`09len = strlen(errtext);
X`09`7D else `7B
X`09`09mlforce("Error: %*S", dotp->l_used\0E0Atext);
X`09`09errtext = dotp->l_text;
X`09`09len = dotp->l_used;
X`09`7D
X`09if ((oerrtext = tb_init(`26\1408, EOS)) != 0) `7B
X`09`09tb_bappend(`26oerrtext, \0909len);
X`09`09tb_append(`26oerrtext, EOS);
X`09`7D
X
X`09/* it's an absolute move */
X`09curwp->w_lastdot = DOT;
X`09s = gotoline(TRUE, -(curbp->b_lines_on_disk - fe_line + 1));
X`09DOT.o = fe_colm ?\0A09- 1 : 0;
X
X`09oerrline = fe_line;
X`09(void)tb_scopy(`26oerrfile, \0907);
X
X`09return s;
X`7D
X
Xstatic LINE *
Xgetdot(BUFFER *bp)
X`7B
X`09register WINDOW *wp;
X`09if (bp->b_nwnd) `7B
X`09`09/* scan for windows holding that buffer,
X`09`09&0209`09pull dot from the first */
X`09`09for_each_visible_window(wp) `7B
X`09`09`09if (wp->w_bufp == bp) `7B
X`09`09&0209return wp->w_dot.l;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09return bp->b_dot.l;
X`7D
X
Xstatic void
Xputdotback(BUFFER *bp, LINE *dotp)
X`7B
X`09register WINDOW *wp;
X
X`09if (bp->b_nwnd) `7B
X`09`09for_each_visible_window(wp) `7B
X`09`09`09if (wp->w_bufp == bp) `7B
X`09`09&0209wp->w_dot.l = dotp;
X`09`09&0209wp->w_dot.o = 0;
X`09`09&0209wp->w_flag `7C= WFMOVE;
X`09`09`09`7D
X`09`09`7D
X`09`09return;
X`09`7D
X`09/* then the buffer isn't displayed */
X`09bp->b_dot.l = dotp;
X`09bp->b_dot.o = 0;
X`7D
X
X/*
X * Ask for a new finderr buffer name
X */
X/* ARGSUSED */
Xint
Xfinderrbuf(int f GCC_UNUSED, int n\120B)
X`7B
X`09register int    s;
X`09char name`5BNFILEN+1`5D;
X`09BUFFER *bp;
X
X`09(void)strcpy(name, febuff);
X`09if ((s = mlreply("Buffer to scan for `5C"errors`5C": ", name, sizeof(name))
V) == ABORT)
X`09`09return s;
X`09if (s == FALSE) `7B
X`09`09set_febuff(OUTPUT_BufName);
X`09`7D else `7B
X`09`09if ((bp = find_any_buffer(name)) == 0)
X`09`09`09return FALSE;
X`09`09set_febuff(bp->b_bname);
X`09`7D
X`09return TRUE;
X`7D
X
X/*
X * (Re)compile the error-expressions buffer.  This is needed as an entrypoint
V
X * so that macros can manipulate the set of expressions (including reading it
V
X * from a file).
X */
X/*ARGSUSED*/
Xint
Xcomp_err_exps(int f GCC_UNUSED, int n\120B)
X`7B
X`09if (!load_patterns()) `7B
X`09`09mlforce("`5BNo error-expressions are defined.`5D");
X`09`09return(FALSE);
X`09`7D
X`09return TRUE;
X`7D
X#endif
$ call unpack [.VILE-8_0]FINDERR.C;1 -
 175662246 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 30 44 152
$!
$ create 'f'
X/*
X *`09glob.c
X *
X * Performs wildcard-expansion for UNIX, VMS and MS-DOS systems.
X * Written by T.E.Dickey for vile (april 1993).
X *
X * (MS-DOS code was originally taken from the winc app example of the
X * zortech compiler - pjr)
X *
X * To do:
X *`09make the wildcard expansion know about escaped characters (e.g.,
X *`09with backslash a la UNIX.
X *
X *`09modify (ifdef-style) 'expand_leaf()' to allow ellipsis.
X *
X * $Header: /usr/build/vile/vile/RCS/glob.c,v 1.58 1998/04/28 10:16:32 tom Exp
V $
X *
X */
X
X#ifdef _WIN32
X# include <windows.h>
X#endif
X
X#include "estruct.h"`09/* global \1406ures and defines */
X#include "edef.h"`09/* defines 'slash' */
X#if SYS_OS2
X# define INCL_DOSFILEMGR
X# define INCL_ERRORS
X# include <os2.h>
X#else
X# include "dirstuff.h"`09/* directory-scanning interface `26 definitions */
X#endif
X
X#define BAKTIK '`60'`09/* used in UNIX shell for pipe */
X#define`09isname(c)`09(isAlnum(c) `7C`7C ((c) == '_'))
X#define`09isdelim(c)`09((c) == '(' `7C`7C \0F09`7B'))
X
X#if SYS_MSDOS `7C`7C SYS_WIN31\0D08OS2\180BNT
X# define UNIX_GLOBBING OPT_GLOB_ENVIRON
X# if UNIX_GLOBBING
X#  define DirEntryStr(p)`09`09p->d_name
X# else
X#  ifdef __ZTC__
X#   define DeclareFind(p)`09`09struct FIND *p
X#   define DirEntryStr(p)`09`09p->name
X#   define DirFindFirst(path,p)`09`09(p = findfi\1809 0))
X#   define DirFindNext(p)`09`09(p = findnext())
X#  else
X#   define DeclareFind(p)`09`09struct find_t p
X#   define DirEntryStr(p)`09`09p.name
X#   define DirFindFirst(path,p)`09`09(!_dos_findfi\1A09 0, `26p))
X#   define DirFindNext(p)`09`09(!_dos_findnext(`26p))
X#  endif
X# endif
X# define DirEntryLen(p)`09`09`09strlen(\1808Str(p))
X#endif`09/* SYS_MSDOS */
X
X/*
X * Make the default unix globbing code use 'echo' rather than our internal
X * globber if we do not configure the 'glob' string-mode.
X */
X#if SYS_UNIX `26`26 defined(GVAL_GLOB) &0226 !OPT_VMS_PATH
X# define UNIX_GLOBBING 1
X#endif
X
X#ifndef UNIX_GLOBBING
X# define UNIX_GLOBBING 0
X#endif
X
X/*
X * Verify that we don't have both boolean- and string-valued 'glob' modes.
X */
X#if defined(GMDGLOB) `26`26\140AVAL_GLOB)
X`09huh??
X#else
X# ifdef GMDGLOB`09`09/* boolean */
X#  define globbing_active() global_g_val(GMDGLOB)
X# endif
X# ifdef GVAL_GLOB`09/* string */
X#  define globbing_active() !is_falsem(global_g_val_ptr(GVAL_GLOB))
X# endif
X# ifndef globbing_active
X#  define globbing_active() TRUE
X# endif
X#endif
X
X/*
X * Some things simply don't work on VMS: pipes and $variables
X */
X#if OPT_VMS_PATH
X#
X# undef  UNIX_GLOBBING
X# define UNIX_GLOBBING 0
X#
X# undef  OPT_GLOB_ENVIRON
X# define OPT_GLOB_ENVIRON 0
X#
X# undef  OPT_GLOB_PIPE
X# define OPT_GLOB_PIPE 0
X#
X#endif
X
X/*--------\0808\1010\2020\400A*/
X
X/* the expanded list is defined outside of the functions because if we
X * handle ellipsis, the generating function must be recursive.
X */
Xstatic`09SIZE_T`09myMax, myLen;`09/* length and index of the expanded list */
V
Xstatic`09char **`09myVec;`09`09/* the expanded list */
X
X/*--------\0808\1010\2020\400A*/
Xstatic int
Xstring_has_wildcards (const char *item)
X`7B
X#if OPT_VMS_PATH `7C`7C SYS_UNIX &027C OPT_MSDO\1E06
X`09while (*item != EOS) `7B
X#if UNIX_GLOBBING
X`09`09if (iswild(*item))
X`09`09`09return TRUE;
X#endif
X`09`09if (*item == GLOB_SINGLE `7C`7C \180EMULTI)
X`09`09`09return TRUE;
X#if OPT_GLOB_ELLIPSIS `7C`7C SYS_VMS
X`09`09if (!strncmp(item, GLOB_ELLIPSIS, sizeof(\160D)-1))
X`09`09`09return TRUE;
X#endif
X#if !OPT_VMS_PATH
X#if OPT_GLOB_RANGE
X`09`09if (*item == GLOB_RANGE`5B0`5D)
X`09`09`09return TRUE;
X#endif
X#if OPT_GLOB_ENVIRON
X`09`09if (*item == '$' `26`26 (isname(item`5B1`5D) `7C`7C isdelim\1409))
X`09`09`09return TRUE;
X#endif
X#endif
X`09`09item++;
X`09`7D
X#endif
X`09return FALSE;
X`7D
X
X/*
X * Record a pattern-match in 'myVec`5B`5D', returning false if an error occurs
V
X */
Xstatic int
Xrecord_a_match(char *item)
X`7B
X`09if (item != 0 `26`26 *\0E08EOS) `7B
X`09`09if ((item = strmalloc(item)) == 0)
X`09`09`09return no_memory("glob-match");
X
X`09`09if (myLen + 2 >= myMax) `7B
X`09`09`09myMax = myLen + 2;
X`09`09`09if (myVec == 0)
X`09`09&0209myVec = typeallocn(char *, myMax);
X`09`09`09else
X`09`09&0209myVec = typereallocn(char *, myVec, myMax);
X`09`09`7D
X`09`09if (myVec == 0)
X`09`09`09return no_memory("glob-pointers");
X
X`09`09myVec`5BmyLen++`5D = item;
X`09`09myVec`5BmyLen`5D = 0;
X`09`7D
X`09return TRUE;
X`7D
X
X#if UNIX_GLOBBING
X/*
X * Point to the leaf following the given string (i.e., skip a slash), returns
V
X * null if none is found.
X */
Xstatic char *
Xnext_leaf (char *path)
X`7B
X`09if (path != 0) `7B
X`09`09while (*path != EOS) `7B
X`09`09`09if (is_slashc(*path))
X`09`09&0209return path+1;
X`09`09`09path++;
X`09`09`7D
X`09`7D
X`09return 0;
X`7D
X
X/*
X * Point to the beginning (after slash, if present) of the first leaf in
X * the given pattern argument that contains a wildcard.
X */
Xstatic char *
Xwild_leaf (char *pattern)
X`7B
X`09register int`09j, k, ok;
X`09register char`09c;
X
X`09/* skip leading slashes */
X`09for (j = 0; pattern`5Bj`5D != EOS `26`26 is_slashc(\1F0A); j++)
X`09`09;
X
X`09/* skip to the leaf with wildcards */
X`09while (pattern`5Bj`5D != EOS) `7B
X`09`09int`09skip = FALSE;
X`09`09for (k = j+1; (c = pattern`5Bk`5D) != EOS; k++) `7B
X`09`09`09if (is_slashc(c)) `7B
X`09`09&0209pattern`5Bk`5D = EOS;
X`09`09&0209ok = string_has_wildcards(pattern+j);
X`09`09&0209pattern`5Bk`5D = c;
X`09`09&0209if (ok)
X`09`09&0209`09return pattern+j;
X`09`09&0209skip = TRUE;`09/* skip this leaf */
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`09if (skip)
X`09`09`09j = k+1;`09/* point past slash */
X`09`09else if (c == EOS)
X`09`09`09break;
X`09`09else
X`09`09`09j++;&0209/* leaf is empty */
X`09`7D
X`09return string_has_wildcards(pattern+j) ? \0D09 : 0;
X`7D
X
X#if OPT_CASELESS
Xstatic int
Xcs_char(int ch)
X`7B
X`09return isUpper(ch) ? toLow\0E07: ch;
X`7D
X#else
X#define cs_char(ch) (ch)
X#endif
X
X/*
X * This is the heart of the wildcard matching.  We are given a directory
X * leaf and a pointer to the\1A06that contains wildcards that we must
X * match against the leaf.
X */
Xstatic int
Xmatch_leaf(char *leaf, \0C06pattern)
X`7B
X`09while (*leaf != EOS `26`26 *pattern\1307) `7B
X`09`09if (*pattern == GLOB_SINGLE) `7B
X`09`09`09leaf++;
X`09`09`09pattern++;
X`09`09`7D else if (*pattern == GLOB_MULTI) `7B
X`09`09`09int`09multi = FALSE;
X`09`09`09pattern++;
X`09`09`09while (*leaf != EOS) `7B
X`09`09&0209if (match_leaf(leaf, pattern)) `7B
X`09`09&0209`09multi = TRUE;
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09&0209leaf++;
X`09`09`09`7D
X`09`09`09if (!multi `26`26 *leaf != EOS)
X`09`09&0209return FALSE;
X#if OPT_GLOB_RANGE
X`09`09`7D else if (*pattern == GLOB_RANGE`5B0`5D) `7B
X`09`09`09int`09found`09= FALSE;
X`09`09`09char *`09first`09= ++pattern;
X`09`09`09int`09negate`09= 0;
X
X`09`09`09if (*first == GLOB_NEGATE`5B0`5D `7C`7C
X`09`09&0209(GLOB_NEGATE`5B1`5D `26`26 *first == \1C0E)) `7B
X`09`09&0209negate = 1;
+-+-+-+-+-+-+-+-  END  OF PART 56 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 57 -+-+-+-+-+-+-+-+
X`09`09&0209first = pattern++;
X`09`09`09`7D
X`09`09`09while (*pattern != EOS) `7B
X`09`09&0209if (*pattern == GLOB_RANGE`5B1`5D) `7B
X`09`09&0209`09pattern++;
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09&0209if (*pattern == '-' `26`26 \1208!= first) `7B
X`09`09&0209`09int`09lo = pattern`5B-1`5D;
X`09`09&0209`09int`09hi = pattern`5B1`5D;
X`09`09&0209`09if (hi == GLOB_RANGE`5B1`5D)
X`09`09&0209&0209hi = '`7E';
X`09`09&0209`09if (((cs_char(lo) <= \0F08*leaf)) `26`26 (\140E\260Chi))) != neg
Vate)
X`09`09&0209&0209found = TRUE;
X`09`09&0209`09if (pattern`5B1`5D != GLOB_RANGE`5B1`5D)
X`09`09&0209&0209pattern++;
X`09`09&0209`7D else if ((cs_char(*pattern++) == \1709leaf)) != negate)
X`09`09&0209`09found = TRUE;
X`09`09`09`7D
X`09`09`09if (!found)
X`09`09&0209return FALSE;
X`09`09`09leaf++;
X#endif
X`09`09`7D else if (cs_char(*pattern++) != \1709leaf++))
X`09`09`09return FALSE;
X`09`7D
X`09return (*leaf == EOS `26`26 *pattern \1306);
X`7D
X
X#if !SYS_OS2
X/*
X * Recursive procedure that allows any leaf (or all!) leaves in a path to
X * have wildcards.  Except for an ellipsis, each\2909 is completed
X * within a single leaf.
X *
X * Returns false if we ran out of memory (a problem on ms-dos), and true
X * if everything went well (e.g., matches).
X */
Xstatic int
Xexpand_leaf (
Xchar`09*path,`09`09/* built-up pathname, top-level */
Xchar`09*pattern)
X`7B
X`09DIR`09*dp;
X`09DIRENT`09*de;
X`09int`09result`09= TRUE;
X`09char`09save`09= 0; /* warning suppression */
X`09SIZE_T`09len;
X`09char`09*leaf;
X`09char`09*wild`09= wild_leaf(pattern);
X`09char`09*next`09= next_leaf(wild);
X`09register char`09*s;
X
X`09/* Fill-in 'path`5B`5D' with the non-wild leaves that we skipped to get
X`09 * to 'wild'.
X`09 */
X`09if (wild == pattern) `7B`09/* top-level, first leaf is wild */
X`09`09if (*path == EOS)
X`09`09`09(void)strcpy(path, ".");
X`09`09leaf = skip_string(path) + 1;
X`09`7D else `7B
X`09`09len = (int)(wild - pattern) - 1;
X`09`09if (*(s = path) != EOS) `7B
X`09`09`09s += strlen(s);
X`09`09`09*s++ = SLASHC;
X`09`09`7D
X`09`09if (len != 0) `7B
X`09`09`09(void)strncpy(s, pattern, len);
X`09`09`09s`5Blen`5D = EOS;
X`09`09`7D
X`09`09if (*path == EOS) `7B
X`09`09`09path`5B0`5D = SLASHC;
X`09`09`09path`5B1`5D = EOS;
X`09`09`09leaf = path + 1;
X`09`09`7D
X#if OPT_MSDOS_PATH
X`09`09/* Force the strncpy from 'pattern' to pick up a slash just
X`09`09 * after the ':' in a drive specification.
X`09`09 */
X`09`09else if ((s = is_msdos_drive(path)) != 0 `26`26 s`5B0`5D == EOS) `7B
X`09`09`09s`5B0`5D = SLASHC;
X`09`09`09s`5B1`5D = EOS;
X`09`09`09leaf = s + 1;
X`09`09`7D
X#endif
X`09`09else `7B
X`09`09`09leaf = skip_string(path) + 1;
X`09`09`7D
X`09`7D
X
X`09if (next != 0) `7B
X`09`09save = next`5B-1`5D;
X`09`09next`5B-1`5D = EOS;&0209/* restrict 'wild`5B`5D' to one leaf */
X`09`7D
X
X`09/* Scan the directory, looking for leaves that match the pattern.
X`09 */
X`09if ((dp = opendir(SL_TO_BSL(path))) != 0) `7B
X`09`09leaf`5B-1`5D = SLASHC;`09/* connect the path to the leaf */
X`09`09while ((de = readdir(dp)) != 0) `7B
X#if OPT_MSDOS_PATH
X`09`09`09(void)strcpy(leaf, de->d_name);
X#if !OPT_CASELESS
X`09`09`09(void)mklower(leaf);
X#endif
X`09`09`09if (strchr(pattern, '.') `26`26 !\1907leaf\1606)
X`09`09&0209(void)strcat(leaf, ".");
X#else
X#if USE_D_NAMLEN
X`09`09`09len = de->d_namlen;
X`09`09`09(void)strncpy(leaf, de->d_name, len);
X`09`09`09leaf`5Blen`5D = EOS;
X#else
X`09`09`09(void)strcpy(leaf, de->d_name);
X#endif
X#endif
X`09`09`09if (!strcmp(leaf, ".")
X`09`09`09 `7C`7C !strcmp(leaf, ".."))
X`09`09&0209continue;
X`09`09`09if (!match_leaf(leaf, wild))
X`09`09&0209continue;
X`09`09`09if (next != 0) `7B`09/* there are more leaves */
X`09`09&0209if (!string_has_wildcards(next)) `7B
X`09`09&0209`09s = skip_string(leaf);
X`09`09&0209`09*s++ = SLASHC;
X`09`09&0209`09(void)strcpy(s, next);
X`09`09&0209`09if (ffexists(path)
X`09`09&0209`09 `26`26 !record_a_match(path)) `7B
X`09`09&0209&0209result = FALSE;
X`09`09&0209&0209break;
X`09`09&0209`09`7D
X`09`09&0209`7D else if (is_directory(path)) `7B
X#if SYS_MSDOS `7C`7C SYS_WIN31
X`09`09&0209`09s = strrchr(path, '.');
X`09`09&0209`09if (s`5B1`5D == EOS)
X`09`09&0209&0209s`5B0`5D = EOS;
X#endif
X`09`09&0209`09if (!expand_leaf(path, next)) `7B
X`09`09&0209&0209result = FALSE;
X`09`09&0209&0209break;
X`09`09&0209`09`7D
X`09`09&0209`7D
X`09`09`09`7D else if (!record_a_match(path)) `7B
X`09`09&0209result = FALSE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`09(void)closedir(dp);
X`09`7D else
X`09`09result = SORTOFTRUE;`09/* at least we didn't run out of memory */
X
X`09if (next != 0)
X`09`09next`5B-1`5D = save;
X
X`09return result;
X`7D
X
X#else /* SYS_OS2 */
X
X/*
X * Recursive procedure that allows any leaf (or all!) leaves in a path to
X * have wildcards.  Except for an ellipsis, each\2909 is completed
X * within a single leaf.
X *
X * Returns false if we ran out of memory (a problem on ms-dos), and true
X * if everything went well (e.g., matches).
X */
Xstatic int
Xexpand_leaf (
Xchar`09*path,`09`09/* built-up pathname, top-level */
Xchar`09*pattern)
X`7B
X`09FILEFINDBUF3 fb;
X`09ULONG entries;
X`09HDIR hdir;
X`09APIRET rc;
X
X`09int`09result`09= TRUE;
X`09char`09save = 0; /* warning suppression */
X`09SIZE_T`09len;
X`09char`09*leaf;
X`09char`09*wild`09= wild_leaf(pattern);
X`09char`09*next`09= next_leaf(wild);
X`09register char`09*s;
X
X`09/* Fill-in 'path`5B`5D' with the non-wild leaves that we skipped to get
X`09 * to 'wild'.
X`09 */
X`09if (wild == pattern) `7B`09/* top-level, first leaf is wild */
X`09`09if (*path == EOS)
X`09`09`09(void)strcpy(path, ".");
X`09`7D else `7B
X`09`09len = wild - pattern - 1;
X`09`09if (*(s = path) != EOS) `7B
X`09`09`09s += strlen(s);
X`09`09`09*s++ = SLASHC;
X`09`09`7D
X`09`09if (len != 0)
X`09`09`09strncpy(s, pattern, len)`5Blen`5D = EOS;
X`09`7D
X`09leaf = skip_string(path) + 1;
X
X`09if (next != 0) `7B
X`09`09save = next`5B-1`5D;
X`09`09next`5B-1`5D = EOS;&0209/* restrict 'wild`5B`5D' to one leaf */
X`09`7D
X
X`09/* Scan the directory, looking for leaves that match the pattern.
X`09 */
X`09len = strlen(path);
X`09if (!is_slashc(path`5Blen - 1`5D))
X`09`09(void)strcat(path, "/*.*");
X`09else
X`09`09(void)strcat(path, "*.*");
X
X`09hdir = HDIR_CREATE;
X`09entries = 1;
X`09rc = DosFindFirst(SL_TO_BSL(path), `26hdir,
X`09`09`09FILE_DIRECTORY `7C FILE_READONLY,
X`09`09`09`26fb, sizeof(fb), `26entries, FIL_STANDARD);
X`09if (rc == NO_ERROR)
X`09`7B
X`09`09leaf`5B-1`5D = SLASHC;
X
X`09`09do
X`09`09`7B
X`09`09`09(void) mklower(strcpy(leaf, fb.achName));
X
X`09`09`09if (strcmp(leaf, ".") == 0 `7C`7C \1A0F\1B08)
X`09`09`09 `09continue;
X`09`09`09if (!match_leaf(leaf, wild))
X`09`09&0209continue;
X
X`09`09`09if (next != 0) `7B`09/* there are more leaves */
X`09`09&0209if (!string_has_wildcards(next)) `7B
X`09`09&0209`09s = skip_string(leaf);
X`09`09&0209`09*s++ = SLASHC;
X`09`09&0209`09(void)strcpy(s, next);
X`09`09&0209`09if (!record_a_match(path)) `7B
X`09`09&0209&0209result = FALSE;
X`09`09&0209&0209break;
X`09`09&0209`09`7D
X`09`09&0209`7D else if (is_directory(path)) `7B
X`09`09&0209`09s = strrchr(path, '.');
X`09`09&0209`09if (s`5B1`5D == EOS)
X`09`09&0209&0209s`5B0`5D = EOS;
X`09`09&0209`09if (!expand_leaf(path, next)) `7B
X`09`09&0209&0209result = FALSE;
X`09`09&0209&0209break;
X`09`09&0209`09`7D
X`09`09&0209`7D
X`09`09`09`7D else if (!record_a_match(path)) `7B
X`09`09&0209result = FALSE;
X`09`09&0209break;
X`09`09`09`7D
X
X`09`09`7D while (entries = 1,
X`09`09         DosFindNext(hdir, `26fb, sizeof(fb), `26entries) == NO_ERROR
X`09`09&0209 `26`26 entries == 1);
X
X`09`09DosFindClose(hdir);
X`09`7D
X`09else
X`09`7B
X`09`09result = SORTOFTRUE;`09/* at least we didn't run out of memory */
X`09`7D
X
X`09if (next != 0)
X`09`09next`5B-1`5D = save;
X
X`09return result;
X`7D
X#endif /* SYS_OS2 */
X
X#if ! ANSI_QSORT
Xstatic int
Xcompar(char **a, \0A07b)
X#else
Xstatic int compar (const void *a, co\0F0Ab)
X#endif
X`7B
X#if OPT_CASELESS
X`09return stricmp(*(char **)a, *\0D09b);
X#else
X`09return strcmp(*(char *const *)a, *\130Fb);
X#endif
X`7D
X#endif
X
X#if OPT_GLOB_PIPE
Xstatic int
Xglob_from_pipe(const char *pattern)
X`7B
X#ifdef GVAL_GLOB
X`09char`09*cmd = global_g_val_ptr(GVAL_GLOB);
X`09int`09single;
X#else
X`09static`09char`09cmd`5B`5D = "!echo %s";
X`09static`09int`09single`09= TRUE;
X#endif
X`09FILE`09*cf;
X`09char`09tmp`5BNFILEN`5D;
X`09int`09result = FALSE;
X`09register SIZE_T len;
X`09register char *s, *d;
X
X#ifdef GVAL_GLOB
X
X`09/*
X`09 * For now, assume that only 'echo' will supply the result all on one
X`09 * line.  Other programs (e.g., 'ls' and 'find' do the sensible thing
X`09 * and break up the output with newlines.
X`09 */
X`09if (!isShellOrPipe(cmd)) `7B
X`09`09cmd = "!echo %s";
X`09`09single = TRUE;
X`09`09d = cmd + 1;
X`09`7D else `7B
X`09`09char`09save = EOS;
X`09`09for (d = cmd+1; *d != EOS `26`26 isSpace(*d); d++)
X`09`09`09;
X`09`09for (s = d; *s != EOS; s++) `7B
X`09`09`09if (isSpace(*s)) `7B
X`09`09&0209save = *s;
X`09`09&0209*s = EOS;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`09single = !strcmp(pathleaf(d), "echo");
X`09`09if (save != EOS)
X`09`09`09*s = save;
X`09`7D
X#else
X`09d = cmd+1;
X#endif
X
X`09(void)lsprintf(tmp, d, pattern);
X`09if ((cf = npopen(tmp, "r")) != 0) `7B
X`09`09char`09old`5BNFILEN+1`5D;
X
X`09`09*(d = old) = EOS;
X
X`09`09while ((len = fread(tmp, sizeof(*tmp)\0E09\0D06cf)) > 0) `7B
X`09`09`09/*
X`09`09`09 * Split the buffer up.  If 'single', split on all
X`09`09`09 * whitespace, otherwise only on newlines.
X`09`09`09 */
X`09`09`09for (s = tmp; (SIZE_T)(s-tmp) < len; s++) `7B
X`09`09&0209if ((single `26`26 isSpace(*s))
X`09`09&0209 `7C`7C (!single `26`26 (*s == '`5Cn' &027C \0E06EOS))) `7B
X`09`09&0209`09*d = EOS;
X`09`09&0209`09result = record_a_match(d = old);
X`09`09&0209`09*d = EOS;
X`09`09&0209`09if (!result)
X`09`09&0209&0209break;
X`09`09&0209 `7D else `7B
X`09`09&0209 `09*d++ = *s;
X`09`09&0209 `7D
X`09`09`09`7D
X`09`09`7D
X`09`09if (*old != EOS)
X`09`09`09result = record_a_match(old);
X`09`09npclose(cf);
X`09`7D else
X`09`09result = FALSE;
X
X`09return result;
X`7D
X#endif
X
X#if OPT_GLOB_ENVIRON `26`26 UNIX_GLOBBING
X/*
X * Expand environment variables in 'pattern`5B`5D'
X * It allows names of the form
X *
X *`09$NAME
X *`09$(NAME)
X *`09$`7BNAME`7D
X */
Xstatic void
Xexpand_environ(char *pattern)
X`7B
X`09register int`09j, k;
X`09int`09delim,
X`09`09left,
X`09`09right;
X`09const char *s;
X`09char`09save`5BNFILEN`5D;
X
X`09for (j = 0; pattern`5Bj`5D != EOS; j++) `7B
X`09`09if (pattern`5Bj`5D == '$') `7B
X
X`09`09`09k = j+1;
X`09`09`09if (pattern`5Bk`5D == '(')&0209delim = ')';
X`09`09`09else if (pattern`5Bk`5D == '`7B')`09delim = '`7D';
X`09`09`09else&0309`09delim = EOS;
X
X`09`09`09if (delim != EOS)
X`09`09&0209k++;
X`09`09`09left`09=
X`09`09`09right`09= k;
X
X`09`09`09while (pattern`5Bk`5D != EOS) `7B
X`09`09&0209right = k;
X`09`09&0209if (delim != EOS) `7B
X`09`09&0209`09if (pattern`5Bk++`5D == delim)
X`09`09&0209&0209break;
X`09`09&0209`7D else if (isname(pattern`5Bk`5D)) `7B
X`09`09&0209`09k++;
X`09`09&0209`7D else `7B
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09if (delim == EOS)
X`09`09&0209right = k;
X
X`09`09`09(void)strcpy(save, pattern+k);
X`09`09`09if (right != left) `7B
X`09`09&0209pattern`5Bright`5D = EOS;
X#if SYS_MSDOS `7C`7C SYS_OS2
X`09`09&0209mkupper(pattern+left);
X#endif
X`09`09&0209if ((s = getenv(pattern+left)) == 0)
X`09`09&0209`09s = "";
X`09`09`09`7D else
X`09`09&0209s = "";
X
X`09`09`09(void)strcpy(pattern+j, s);
X`09`09`09(void)strcat(pattern, save);
X`09`09`09j += strlen(s) - 1;
X`09`09`7D
X`09`7D
X`7D
X#else
X#define`09expand_environ(pattern)
X#endif
X
X/*
X * Notes:
X *`09VMS's sys$search function (embedded in our fake 'readdir()') handles
X *`09all of the VMS wildcards.
X *
X *`09MS-DOS has non-UNIX functions that scan a directory and recognize DOS-sty
Vle
X *`09wildcards.  Use these to get the smallest executable.  However, DOS-
X *`09style wildcards are crude and clumsy compared to UNIX, so we provide them
V as
X *`09an option.  (For example, the DOS-wildcards won't match "..`5C*`5C*.bak")
V.
X */
Xstatic int
Xexpand_pattern (char *item)
X`7B
X`09int`09result = FALSE;
X#if OPT_VMS_PATH `26`26 !SYS_UNIX
X`09DIR`09*dp;
X`09DIRENT`09*de;
X
X`09if ((dp = opendir(SL_TO_BSL(item))) != 0) `7B
X`09`09result = TRUE;
X`09`09while ((de = readdir(dp)) != 0) `7B
X`09`09`09char`09temp`5BNFILEN`5D;
X`09`09`09size_t`09len = de->d_namlen;
X`09`09`09(void)strncpy(temp, de->d_name, len);
X`09`09`09temp`5Blen`5D = EOS;
X`09`09`09if (!record_a_match(temp)) `7B
X`09`09&0209result = FALSE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`09(void)closedir(dp);
X`09`7D
X
X#else`09/* UNIX or MSDOS, etc. */
X
X#if OPT_GLOB_PIPE
X# ifdef GVAL_GLOB
X`09/*
X`09 * The 'glob' mode value can be on/off or set to a pipe expression,
X`09 * e.g., "!echo %s".  This allows using the shell to expand the
X`09 * pattern, which is slower than vile's internal code, but may allow
X`09 * using specific features to which the user is accustomed.
X`09 *
X`09 * As a special case, we read from a pipe if the expression begins with
X`09 * a back-tick (e.g., `60which script`60).
X`09 */
X`09if (isShellOrPipe(global_g_val_ptr(GVAL_GLOB))
X`09 `7C`7C *item == BAKTIK) `7B
X`09`09result = glob_from_pipe(item);
X`09`7D else
X# else
X`09result = glob_from_pipe(item);
X#  if UNIX_GLOBBING
X`09huh ??`09`09/* thought I turned that off ... */
X#  endif
X# endif
X#endif
X#if UNIX_GLOBBING
X`09`7B
X`09char`09builtup`5BNFILEN`5D;
X`09char`09pattern`5BNFILEN`5D;
X`09SIZE_T`09first`09= myLen;
X
X`09(void)strcpy(pattern, item);
X`09*builtup = EOS;
X#if OPT_MSDOS_PATH
X#if !OPT_CASELESS
X`09(void)mklower(pattern);
X#endif
X#endif
X`09expand_environ(pattern);
X`09if (string_has_wildcards(pattern)) `7B
X`09`09if ((result = expand_leaf(builtup, pattern)) != FALSE
X`09`09 `26`26 (myLen-first > 1)) `7B
X`09`09`09qsort((char *)`26myVec`5Bfirst`5D, myLen-first,
X`09`09&0209&0209sizeof(*myVec), compar);
X`09`09`7D
X`09`7D else
X`09`09result = record_a_match(pattern);
X`09`7D
X#endif`09`09&0209/* UNIX-style globbing */
X#if (SYS_MSDOS `7C`7C SYS_WIN31\0D08OS2\180BNT) `26`26 !UNIX_GLOBBING
X`09/* native DOS-wildcards */
X`09DeclareFind(p);
X`09char`09temp`5BFILENAME_MAX + 1`5D;
X`09char    path`5BFILENAME_MAX + 1`5D;
X`09char *cp = pathleaf(
X`09`09`09strcpy(temp,
X`09`09&0209strcpy(path, item)));
X
X`09if (DirFindFirst(path,p)) `7B
X`09`09result = TRUE;
X`09`09do `7B
X`09`09`09(void)strcpy(cp, DirEntryStr(p));
X`09`09`09if (!record_a_match(temp)) `7B
X`09`09&0209result = FALSE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D while (DirFindNext(p));
X`09`7D
X#endif`09`09&0209/* native MS-DOS globbing */
X#endif`09/* OPT_VMS_PATH */
X`09return result;`09`09/* true iff no errors noticed */
X`7D
X
X/*--------\0808\1010\2020\400A*/
X
X/*
X * Tests a list of items to see if at least one of them needs to be globbed.
X */
X#if !SYS_UNIX
Xint
Xglob_needed (char **list_of_items)
X`7B
X`09register int `09n;
X
X`09for (n = 0; list_of_items`5Bn`5D != 0; n++)
X`09`09if (string_has_wildcards(list_of_items`5Bn`5D))
X`09`09`09return TRUE;
X`09return FALSE;
X`7D
X#endif
X
X/*
X * Expands the items in a list, returning an entirely new list (so it can be
X * freed without knowing where it came from originally).  This should only
X * return 0 if we run out of memory.
X */
Xstatic char **
Xglob_expand (char **list_of_items)
X`7B
X`09int`09len = glob_length(list_of_items);
X`09int`09i;
X
X`09myMax = 0;
X`09myLen = 0;
X`09myVec = 0;
X
X`09for (i = 0; i < len; ++i) `7B
X`09`09char *item = list_of_items`5Bi`5D;
X`09`09/*
X`09`09 * For UNIX, expand '`7E' expressions in case we've got a pattern
X`09`09 * like "`7E/test*.log".
X`09`09 */
X#if SYS_UNIX
X`09`09char`09temp`5BNFILEN`5D;
X`09`09item = home_path(strcpy(temp, item));
X#endif
X`09`09if (!isInternalName(item)
X`09`09 `26`26 globbing_active()
X`09`09 `26`26 string_has_wildcards(item)) `7B
X`09`09`09if (!expand_pattern(item))
X`09`09&0209return 0;
X`09`09`7D else if (!record_a_match(item)) `7B
X`09`09`09return 0;
X`09`09`7D
X`09`7D
X`09return myVec;
X`7D
X
X/*
X * A special case of 'glob_expand()', \0B06s a single string into a list.
X */
Xchar **
Xglob_string (char *item)
X`7B
X`09char *vec`5B2`5D;
X
X`09vec`5B0`5D = item;
X`09vec`5B1`5D = 0;
X
X`09return glob_expand(vec);
X`7D
X
X/*
X * Counts the number of items in a list of strings.  This is simpler (and
X * more useful) than returning the length and\0F06ist as arguments from
X * a procedure.  Note that since the standard argc/argv convention puts a
X * null pointer on the end, this function is applicable to the 'argv`5B`5D'
X * parameter of the main program as well.
X */
Xint
Xglob_length (char **list_of_items)
X`7B
X`09register int`09len;
X`09if (list_of_items != 0) `7B
X`09`09for (len = 0; list_of_items`5Blen`5D !\1906en++)
X`09`09`09;
X`09`7D else
X`09`09len = 0;
X`09return len;
X`7D
X
X/*
X * Frees the strings in a list, and the list itself.  Note that this should
X * not be used for the main program's original argv, because on some systems
X * it is a part of a larger data area, as are the command strings.
X */
Xchar **
Xglob_free (char **list_of_items)
X`7B
X`09register int`09len;
X`09if (list_of_items != 0) `7B
X`09`09for (len = 0; list_of_items`5Blen`5D !\1906en++)
X`09`09`09free(list_of_items`5Blen`5D);
X`09`09free ((char *)list_of_items);
X`09`7D
X`09return 0;
X`7D
X
X
X#if !SYS_UNIX
X/*
X * Expand wildcards for the main program a la UNIX shell.
X */
Xvoid
Xexpand_wild_args(int *argcp, char ***argvp)
X`7B
X#if SYS_VMS
X`09int`09j, k;
X`09int`09comma`09= 0;
X`09int`09option`09= 0;
X`09/*
X`09 * VMS command-line arguments may be a\2006-separated list of
X`09 * filenames, with an optional "/read_only" flag appended.
X`09 */
X`09for (j = 1; j < *argcp; j++) `7B
X`09`09char`09*s = (*argvp)`5Bj`5D;
X`09`09int`09c;
X`09`09while ((c = *s++) != EOS) `7B
X`09`09`09if (c == ',')
X`09`09&0209comma++;
X`09`09`09if (c == '/')
X`09`09&0209option++;
X`09`09`7D
X`09`7D
X`09if (comma `7C`7C option) `7B
X`09`09char`09**newvec = typeallocn(char *, comma + *argcp + 1);
X`09`09for (j = k = 0; j < *argcp; j++) `7B
X`09`09`09char`09*the_arg = strmalloc((*argvp)`5Bj`5D);
X`09`09`09char`09*item;
X
X`09`09`09/* strip off VMS options */
X`09`09`09while ((item = strrchr(the_arg, '/')) != 0) `7B
X`09`09&0209mkupper(item);
X`09`09&0209if (!strncmp(item, "/READ_ONLY", strlen(item))) `7B
X`09`09&0209`09set_global_b_val(MDVIEW,TRUE);
X`09`09&0209`7D
X`09`09&0209*item = EOS;
X`09`09`09`7D
X
X`09`09`09while (*the_arg != EOS) `7B
X`09`09&0209item = strchr(the_arg, ',');
X`09`09&0209if (item == 0)
X`09`09&0209`09item = skip_string(the_arg);
X`09`09&0209else
X`09`09&0209`09*item++ = EOS;
X`09`09&0209newvec`5Bk++`5D = the_arg;
X`09`09&0209the_arg = item;
X`09`09`09`7D
X`09`09`7D
X`09`09newvec`5Bk`5D = 0;
X`09`09*argcp = k;
X`09`09*argvp = newvec;
X`09`7D
X#endif
X`09if (glob_needed(*argvp)) `7B
X`09`09char`09**newargs = glob_expand(*argvp);
X`09`09if (newargs != 0) `7B
X`09`09`09*argvp = newargs;
X`09`09`09*argcp = glob_length(newargs);
X`09`09`7D
X`09`7D
X`7D
X#endif
X
X/*
X * Expand a string, permitting only one match.
X */
Xint
Xdoglob (char *path)
X`7B
X`09char`09**expand = glob_string(path);
X`09int`09len = glob_length(expand);
X
X`09if (len > 1) `7B
X`09`09if (mlyesno("Too many filenames.  Use first") != TRUE) `7B
X`09`09`09(void)glob_free(expand);
X`09`09`09return FALSE;
X`09`09`7D
X`09`7D
X`09if (len > 0) `7B
X`09`09(void)strcpy(path, expand`5B0`5D);
X`09`09(void)glob_free(expand);
X`09`7D
X`09return TRUE;
X`7D
$ call unpack [.VILE-8_0]GLOB.C;1 -
 236828604 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 47 45 152
$!
$ create 'f'
X/* ed/vi/ex style global commands, where first the file is scanned for
X *`09matching lines, then for each such line, an action is performed.
X *`09written for vile: Copyright (c) 1990, 1995 by Paul Fox
X *
X * $Header: /usr/build/vile/vile/RCS/globals.c,v 1.43 1998/05/21 00:37:16 bod
V Exp $
X *
X */
X
X#include`09"estruct.h"
X#include        "edef.h"
X#include`09"nefunc.h"
X
Xstatic`09int`09globber (CMD_ARGS, int g_or_v);
X
Xint
Xglobals(int f, int n)
X`7B
X`09return globber(f,n,'g');
X`7D
X
Xint
Xvglobals(int f, int n)
X`7B
X`09return globber(f,n,'v');
X`7D
X
X/* ARGSUSED */
Xstatic int
Xglobber(int f GCC_UNUSED, int n\1211g_or_v)
X`7B
X`09int c, s;
X`09register LINE *lp;
X`09register char *fnp;`09/* ptr to the name of the cmd to exec */
X`09char`09cmd`5BNLINE`5D;
X`09const CMDFUNC *cfp;
X`09int foundone;
X`09WINDOW *wp, *sw_wp;
X`09L_NUM`09before;
X`09int`09save_report;
X
X`09c = kbd_delimiter();
X`09if (readpattern("global \1007: ", `26pat`5B0`5D, `26gregexp, c, FALSE) != T
VRUE) `7B
X`09`09mlforce("`5BNo pattern.`5D");
X`09`09return FALSE;
X`09`7D
X
X`09/* in some sense, it would be nice to search first, before
X        \0808making the user answer the next question, but the
X        \0808searching delay is too long, and unexpected in the
X        \0808middle of a command.  */
X
X`09fnp = kbd_engl("action to perform on each matching line: ", cmd);
X`09/* get the name of, and then the function to execute */
X`09if (!fnp) `7B
X`09        mlforce("`5BNo function`5D");
X`09`09return FALSE;
X`09`7D else if ((cfp = engl2fnc(fnp)) == 0) `7B
X`09        return no_such_function(fnp);
X`09`7D else if ((cfp->c_flags `26 GLOBOK) == 0) `7B
X`09        mlforce("`5BFunction not allowed`5D");
X`09`09return FALSE;
X`09`7D
X
X
X`09/* call the searcher, telling it to do line marking */
X`09s = fsearch(FALSE,0,TRUE,FALSE);
X`09if (s != TRUE)
X`09`09return s;
X
X`09calledbefore = FALSE;
X
X`09if (g_or_v == 'v') `7B  /* invert the sense of all the matches */
X`09`09for_each_line(lp, curbp)
X`09`09`09lflipmark(lp);
X`09`7D
X`09/* loop through the buffer -- we must clear the marks no matter what */
X`09s = TRUE;
X`09lp = lforw(buf_head(curbp));
X`09wp = sw_wp = curwp;
X`09/* loop until there are no marked lines in the buffer */
X`09foundone = FALSE;
X`09before = line_count(curbp);
X`09save_report = global_g_val(GVAL_REPORT);
X`09for_ever `7B
X`09`09if (lp == win_head(wp)) `7B
X`09`09`09/* at the end -- only quit if we found no
X`09`09&0209marks on the last pass through. otherwise,
X`09`09&0209go through again */
X`09`09`09if (foundone)
X`09`09&0209foundone = FALSE;
X`09`09`09else
X`09`09&0209break;
X`09`09`09lsetnotmarked(lp); /* always unmark the header line */
X`09`09`7D
X`09`09if (lismarked(lp)) `7B
X`09`09`09foundone = TRUE;
X`09`09`09lsetnotmarked(lp);
X`09`09`09/* call the function, if there is one, and results
X`09`09&0209have been ok so far */
X`09`09`09if (cfp `26`26 s) `7B
X`09`09&0209if (!calledbefore `26`26 (cfp->c_flags `26 UNDO)) `7B
X`09`09&0209`09if (b_val(wp->w_bufp,MDVIEW))
X`09`09&0209&0209return(rdonly());
X`09`09&0209`09mayneedundo();
X`09`09&0209`09set_global_g_val(GVAL_REPORT,0);
X`09`09&0209`7D
X`09`09&0209havemotion = `26f_godotplus;
X`09`09&0209wp->w_dot.l = lp;
X`09`09&0209wp->w_dot.o = 0;
X`09`09&0209s = call_cmdfunc(cfp, FALSE, 1);
X`09`09&0209if (curwp != wp) `7B
X`09`09&0209    /* function may have switched on us */
X`09`09&0209    sw_wp = curwp;
X`09`09&0209    (void)set_curwp(wp);
X`09`09&0209`7D
X`09`09&0209lp = wp->w_dot.l;
X`09`09&0209havemotion = NULL;
X`09`09&0209calledbefore = TRUE;
X`09`09`09`7D
X`09`09`7D
X`09`09lp = lforw(lp);
X`09`7D
X`09set_global_g_val(GVAL_REPORT,save_report);
X`09(void)line_report(before);
X`09/* if it tried to switch, do it now */
X`09(void)set_curwp(sw_wp);
X
X`09return s;
X`7D
$ call unpack [.VILE-8_0]GLOBALS.C;1 -
 271844384 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 7 46 152
$!
$ create 'f'
X
X/* This file is properly part of the excellent DJGPP compiler/tools package
X`09put out by DJ Delorie for use under DOS.  Unfortunately, the module
X`09as distributed in many versions of the DJGPP is buggy -- this copy
X`09of gppconio.c fixes many of those bugs.  I understand that these
X`09changes have been sent back to the DJGPP maintainers -- hopefully
X`09vile will not need to include this file in the future.  -pgf 9/95
X*/
X
X
X#if __DJGPP__ < 2
X
X/********\0808\1010\2020\4006
X *
X *  NAME:           gppconio.c
X *
X *  DESCRIPTION:    simulate Borland text video funcs for GNU C++
X *
X *  copyright (c) 1991 J. Alan Eldridge
X *
X *  M O D I F I C A T I O N   H I S T O R Y
X *
X *  when        who\0B08\1308 what
X *  --------\0808\1010\2020---
X *  10/27/91    J. Alan Eldridge    created
X *  01/06/92    D. Buerssner        make it work with extended characters
X * (buers@dg1.chemie.uni-konstanz.de) speed-up of cputs
X *        \0808\1010  some missing brackets in VIDADDR
X *        \0808\1010  don't need scrollwindow anymore
X *  07/15/93    D. Buerssner        take care of cursor tracking
X *        \0808\1010    txinfo.curx and\100By
X *        \0808\1010  fill in missing functionality
X *        \0808\1010    - textmode
X *        \0808\1010    - cscanf
X *        \0808\1010    - cgets
X *        \0808\1010    - getch and ungetch
X *        \0808\1010    - _setcursortype
X *        \0808\1010    - kbhit
X *        \0808\1010  (hpefully) proper initialization of
X *        \0808\1010    txinfo.normattrib and\1608\1206ute
X *        \0808\1010  gotoxy(1,1) in clrscr (bug introduced
X *        \0808\1010    by my previous patches)
X *        \0808\1010  gotoxy(1,1) in window
X *        \0808\1010  take care of BELL and BACKSPACE
X *        \0808\1010    in putch and cputs
X *        \0808\1010  take care of blinking bit in textcolor
X *        \0808\1010    and textbackground
X *        \0808\1010  declare (and ignore) directvideo
X *  10/09/93    DJ Delorie          Switch to dosmem*() for DPMI
X *  05/01/94    DJ Delorie          Add _wscroll
X ********\0808\1010\2020*****/
X
X#include    <stdlib.h>
X#include    <stdio.h>
X#include    <stdarg.h>
X#include    <dos.h>
X#include    <pc.h>
X#include    <go32.h>
X#include    "gppconio.h"
X
Xint _wscroll = 1;
X
Xint directvideo = 1;  /* We ignore this */
X
Xstatic void setcursor(unsigned int shape);
Xstatic int getvideomode(void);
Xstatic void bell(void);
Xstatic int get_screenattrib(void);
Xstatic int isEGA(void);
Xstatic int _scan_getche(FILE *fp);
Xstatic int _scan_ungetch(int c, FILE *fp);
X
X#define DBGGTINFO   0
X
Xstatic unsigned ScreenAddress = 0xb8000UL; /* initialize just in case */
Xstatic struct text_info txinfo;
Xstatic int ungot_char;
Xstatic int char_avail = 0;
X
X#define VIDADDR(r,c) (ScreenAddress + 2*(((r) * txinfo.screenwidth) + (c)))
X
Xint puttext(int c, int r\0706c2\0F072, void *buf)
X`7B
X  short *cbuf = (\0F07)buf;
X  /* we should check for valid parameters, and maybe return 0 */
X  r--, r2--, c--, c2--;
X  for (; r <= r2; r++)
X  `7B
X    dosmemput(cbuf, (c2-c+1)*2, VIDADDR(r, c));
X    cbuf += c2-c+1;
X  `7D
X  return 1;
X`7D
X
Xint gettext(int c, int r\0706c2\0F072, void *buf)
X`7B
X  short *cbuf = (\0F07)buf;
X  /* we should check for valid parameters, and maybe return 0 */
X  r--, r2--, c--, c2--;
X  for (; r <= r2; r++)
X  `7B
X    dosmemget(VIDADDR(r, c), (c2-c+1)*2, cbuf);
X    cbuf += c2-c+1;
X  `7D
X  return 1;
X`7D
X
Xvoid gotoxy(int col, int row)
X`7B
X  ScreenSetCursor(row + txinfo.wintop - 2, col\190Dleft - 2);
X  txinfo.curx = col;
X  txinfo.cury = row;
X`7D
X
Xint wherex(void)
X`7B
X  int row, col;
X
X  ScreenGetCursor(`26row, `26col);
X
X  return col - txinfo.winleft + 2;
X`7D
X
Xint wherey(void)
X`7B
X  int row, col;
X
X  ScreenGetCursor(`26row, `26col);
X
X  return row - txinfo.wintop + 2;
X`7D
X
Xvoid textmode(int mode)
X`7B
X    union REGS regs;
X    int mode_to_set = mode;
X    if (mode == LASTMODE)
X        mode = mode_to_set = txinfo.currmode;
X    if (mode == C4350)
X        /*
X         * just set mode 3 and load 8x8 font, idea taken
X         * (and code translated from Assembler to C)
X         * form Csaba Biegels stdvga.asm
X         */
X        mode_to_set = 0x03;
X    regs.h.ah = 0x00; /* set mode */
X    regs.h.al = mode_to_set;
X    int86(0x10, `26regs\0707);
X    if (mode == C80 `7C`7C \0F08BW\100EC4350)
X    `7B
X        if (isEGA())
X        `7B
X            /*
X             * enable cursor size emulation, see Ralf Browns
X             * interrupt list
X             */
X            regs.h.ah = 0x12;
X            regs.h.bl = 0x34;
X            regs.h.al = 0x00; /* 0: enable (1: disable) */
X            int86(0x10, `26regs\0707);
X`09`7D
X    `7D
X    if (mode == C4350)
X    `7B
X        if (!isEGA())
X            return;
X        /* load 8x8 font */
X        regs.x.ax = 0x1112;
X        regs.x.bx = 0;
+-+-+-+-+-+-+-+-  END  OF PART 57 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 58 -+-+-+-+-+-+-+-+
X        int86(0x10, `26regs\0707);
X    `7D
X/*    _setcursortype(_NORMALCURSOR); */
X    /* reinitialize txinfo structure to take into account new mode */
X    gppconio_init();
X#if 0
X    /*
X     * For mode C4350 the screen is not cleared on my OAK-VGA.
X     * Should we clear it here? TURBOC doesn't so we don't bother either.
X     */
X    clrscr();
X#endif
X`7D
X
Xvoid textattr(int attr)
X`7B
X  txinfo.attribute = ScreenAttrib = (unsigned char)attr;
X`7D
X
Xvoid textcolor(int color)
X`7B
X  /* strip blinking (highest) bit and textcolor */
X  ScreenAttrib `26= 0x70; /* strip blinking (highest) bit and textcolor */
X  txinfo.attribute=(ScreenAttrib `7C= (color `26 0x8f));
X`7D
X
Xvoid textbackground(int color)
X`7B
X  /* strip background color, keep blinking bit */
X  ScreenAttrib `26= 0x8f;
X  /* high intensity background colors (>7) are not allowed
X     so we strip 0x08 bit (and higher bits) of color */
X  txinfo.attribute=(ScreenAttrib `7C= ((color `26 0x07) << 4));
X`7D
X
Xvoid highvideo(void)
X`7B
X  txinfo.attribute=(ScreenAttrib `7C= 0x08);
X`7D
X
Xvoid lowvideo(void)
X`7B
X  txinfo.attribute=(ScreenAttrib `26= 0x07);
X`7D
X
Xvoid normvideo(void)
X`7B
X  txinfo.attribute = ScreenAttrib = \2207normattr;
X`7D
X
Xvoid _setcursortype(int type)
X`7B
X    unsigned cursor_shape;
X    switch (type)
X    `7B
X        case _NOCURSOR:
X            cursor_shape = 0x0700;
X            break;
X        case _SOLIDCURSOR:
X            cursor_shape = 0x0007;
X            break;
X/*      case _NORMALCURSOR: */
X        default:
X            cursor_shape = 0x0607;
X            break;
X    `7D
X    setcursor(\0706_shape);
X`7D
X
Xstatic void setcursor(unsigned int \1406_shape)
X/* Sets the shape of the cursor */
X`7B
X    union REGS      reg;
X
X    reg.h.ah = 1;
X    reg.x.cx = cursor_shape;
X    int86(0x10, `26reg\0606);
X`7D`09`09&0209/* setcursor */
X
Xstatic void getwincursor(int *row, int *col)
X`7B
X  ScreenGetCursor(row, col);
X`7D
X
Xvoid clreol(void)
X`7B
X  short   image`5B 256 `5D;
X  short   val = ' ' `7C (ScreenAttrib << 8);
X  int     c, row, col, ncols;
X
X  getwincursor(`26row, `26col);
X  ncols = txinfo.winright - col;
X
X  for (c = 0; c < ncols; c++)
X    image`5B c `5D = val;
X
X  puttext(col + 1, row\0906txinfo.winright\1A0Bimage);
X`7D
X
Xstatic void fillrow(int row, int left\0A06righ\0B07fill)
X`7B
X  int col;
X  short filler`5Bright-left+1`5D;
X
X  for (col = left; col <= righ\0E06++)
X    filler`5Bcol-left`5D = fill;
X  dosmemput(filler, (right-left+1)*2, VIDADDR(row, left));
X`7D
X
Xvoid clrscr(void)
X`7B
X  short filler`5Btxinfo.winright - \120Aleft + 1`5D;
X  int row, col;
X  for (col=0; col < txinfo.winright -\120Bleft + 1; col++)
X    filler`5Bcol`5D = ' ' `7C (ScreenAttrib << 8);
X  for (row=txinfo.wintop-1; row < \170Abottom; row++)
X    dosmemput(filler, (txinfo.winright - \120Aleft + 1)*2,
X     VIDADDR(row, txinfo.winleft - 1));
X  gotoxy(1, 1);
X`7D
X
Xint putch(int c)
X`7B
X  int     row, col;
X
X  ScreenGetCursor(`26row, `26col);
X
X  /*  first, handle the character */
X  if (c == '`5Cn')
X    `7B
X      row++;
X    `7D
X  else if (c == '`5Cr')
X    `7B
X      col = txinfo.winleft - 1;
X    `7D
X  else if (c == '`5Cb')
X  `7B
X      if (col > txinfo.winleft - 1)
X          col--;
X      else if (row > txinfo.wintop -1)
X      `7B
X          /*
X           * Turbo-C ignores this case; we are smarter.
X           */
X          row--;
X          col = txinfo.winright-1;
X      `7D
X  `7D
X  else if (c == 0x07)
X    bell();
X  else `7B
X    /* short   val = c `7C (ScreenAttrib << 8); */
X    /* puttext(col + 1, row\0906\1212`26val); */
X    ScreenPutChar(c,\1107Attrib, col, row);
X    col++;
X  `7D
X
X  /* now, readjust the window     */
X
X  if (col >= txinfo.winright) `7B
X    col = txinfo.winleft - 1;
X    row++;
X  `7D
X
X  if (row >= txinfo.winbottom) `7B
X    /* scrollwin(0, txinfo.winbottom -\130Btop, 1); */
X    if (_wscroll)
X    `7B
X      ScreenSetCursor(txinfo.wintop-1,0);
X      delline();
X    `7D
X    row--;
X  `7D
X
X  ScreenSetCursor(row, col);
X  txinfo.cury = row -\1408wintop + 2;
X  txinfo.curx = col -\1408winleft + 2;
X  return c;
X`7D
X
Xint getche(void)
X`7B
X  if (char_avail)
X    /*
X     * We don't know, wether the ungot char was already echoed
X     * we assume yes (for example in cscanf, probably the only
X     * place where ungetch is ever called.
X     * There is no way to check for this really, because
X     * ungetch could have been called with a character that
X     * hasn't been got by a conio function.
X     * We don't echo again.
X     */
X    return(getch());
X  return (putch(getch()));
X`7D
X
Xint getch(void)
X`7B
X    union REGS regs;
X    int c;
X    if (char_avail)
X    `7B
X        c = ungot_char;
X        char_avail = 0;
X    `7D
X    else
X    `7B
X        regs.x.ax = 0x0700;
X        int86(0x21, `26regs\0707);
X        c = regs.h.al;
X    `7D
X    return(c);
X`7D
X
Xint ungetch(int c)
X`7B
X    if (char_avail)
X        return(EOF);
X    ungot_char = c;
X    char_avail = 1;
X    return(c);
X`7D
X
X/*
X * kbhit from libc in libsrc/c/dos/kbhit.s doesn't check
X * for ungotten chars, so we have to provide a new one
X * Don't call it kbhit, rather use a new name (_conio_kbhit)
X * and do a #define kbhit _conio_\0D06in gppconio.h.
X * The old kbhit still can be used if gppconio.h
X * is not included of after #undef kbhit
X * If you don't use ungetch (directly or in\0E09by cscanf)
X * both kbhit and _conio_\1107re the same.
X * So this shouldn't cause any trouble with previously written
X * source, because ungetch wasn't available.
X * The only problem might be, if anybody just included gppconio.h
X * and has not linked with libpc, (I can't think of a good reason
X * for this). This will result a link error (undefined symbol _conio_kbhit).
X */
X
X#undef kbhit  /* want to be able to call\2207from libc */
X
X/* The kbhit in libc doesn't work for the second byte of extended chars. */
Xint kbhit(void)
X`7B
X    union REGS regs;
X    regs.h.ah = 0x0b;
X    int86(0x21, `26regs\0707);
X    return regs.h.al ? -1 : 0;
X`7D
X
Xint _conio_kbhit(void)
X`7B
X    if (char_avail)
X        return(1);
X    else
X        return(kbhit());
X`7D
X
X/*
X * The next two functions are needed by cscanf
X */
Xstatic int _scan_getche(FILE *fp)
X`7B
X    return(getche());
X`7D
X
Xstatic int _scan_ungetch(int c, FILE *fp)
X`7B
X    return(ungetch(c));
X`7D
X
X
Xvoid insline(void)
X`7B
X  int row, col, left, right, nbytes, bot, fill;
X  ScreenGetCursor(`26row, `26col);
X  left = txinfo.winleft - 1;
X  right = txinfo.win\1206- 1;
X  nbytes = (right-left+1)*2;
X  bot = txinfo.winbottom-1;
X  fill = ' ' `7C (ScreenAttrib << 8);
X  while(bot > row)
X    `7B
X      movedata(_go32_conventional_mem_selector(), VIDADDR(bot-1, left),
X        \0807_go32_conventional_mem_selector(), VIDADDR(bot, left),
X        \0807nbytes);
X      bot--;
X    `7D
X  if (row <= bot)
X    `7B
X      fillrow(row,left,right,fill);
X    `7D
X`7D
X
X
Xvoid delline(void)
X`7B
X  int row, col, left, right, nbytes, bot, fill;
X  ScreenGetCursor(`26row, `26col);
X  left = txinfo.winleft - 1;
X  right = txinfo.win\1206- 1;
X  nbytes = (right-left+1)*2;
X  bot = txinfo.winbottom-1;
X  fill = ' ' `7C (ScreenAttrib << 8);
X  while(row < bot)
X    `7B
X      movedata(_go32_conventional_mem_selector(), VIDADDR(row+1, left),
X        \0807_go32_conventional_mem_selector(), VIDADDR(row, left),
X        \0807nbytes);
X      row++;
X    `7D
X  fillrow(bot,left,right,fill);
X`7D
X
X
Xvoid window(int left, int top\0906righ\1407bottom)
X`7B
X  if (top < 1 `7C`7C left\0C08right > txinfo.screenwidth &027C
X      bottom > txinfo.screenheight)
X    return;
X
X  txinfo.wintop = top;
X  txinfo.winleft = left;
X  txinfo.winright = right;
X  txinfo.winbottom = \0906;
X  gotoxy(1,1);
X`7D
X
X
Xint cputs(const char *s)
X`7B
X  int     row, col,c;
X  const unsigned char *ss = (\1B15)s;
X  short *viaddr;
X  short sa = ScreenAttrib << 8;
X  ScreenGetCursor(`26row, `26col);
X  viaddr = (short *)VIDADDR(row,col);
X  /*
X   * Instead of just calling putch; we do everything by hand here,
X   * This is much faster. We don't move the cursor after each character,
X   * only after the whole string is written, because ScreenSetCursor
X   * needs to long because of switching to real mode needed with djgpp.
X   * You won't recognize the difference.
X   */
X  while ((c = *ss++))
X    `7B
X      /*  first, handle the character */
X      if (c == '`5Cn')
X`09`7B
X`09  row++;
X`09  viaddr += txinfo.screenwidth;
X`09`7D
X      else if (c == '`5Cr')
X`09`7B
X`09  col = txinfo.winleft - 1;
X`09  viaddr = (short *)VIDADDR(row,col);
X`09`7D
X      else if (c == '`5Cb')
X        `7B
X          if (col > txinfo.winleft-1)
X          `7B
X        \0806col--;
X        \0806viaddr--;
X          `7D
X          else if (row > txinfo.wintop -1)
X          `7B
X        \0806/*
X        \0807* Turbo-C ignores this case. We want to be able to
X        \0807* edit strings with backspace in gets after
X        \0807* a linefeed, so we are smarter
X        \0807*/
X        \0806row--;
X        \0806col = txinfo.winright-1;
X        \0806viaddr = (short *)VIDADDR(row,col);
X          `7D
X        `7D
X      else if (c == 0x07)
X          bell();
X      else `7B
X        short q = c `7C sa;
X        dosmemput(`26q, 2, (int)viaddr);
X`09viaddr++;
X`09col++;
X      `7D
X
X      /* now, readjust the window     */
X
X      if (col >= txinfo.winright) `7B
X`09col = txinfo.winleft - 1;
X`09row++;
X`09viaddr = (short *)VIDADDR(row,col);
X      `7D
X
X      if (row >= txinfo.winbottom) `7B
X`09ScreenSetCursor(txinfo.wintop-1,0); /* goto first line in window */
X`09delline();        \0808\100A/* and delete it */
X`09row--;
X`09viaddr -= txinfo.screenwidth;
X      `7D
X    `7D
X
X  ScreenSetCursor(row, col);
X  txinfo.cury = row -\1408wintop + 2;
X  txinfo.curx = col -\1408winleft + 2;
X  return(*(--ss));
X`7D
X
X
Xint cprintf(const char *fmt, ...)
X`7B
X  int     cnt;
X  char    buf`5B 2048 `5D; /* this is buggy, because buffer might be too small
V. */
X  va_list ap;
X
X  va_start(ap, fmt);
X  cnt = vsprintf(buf, fmt, ap);
X  va_end(ap);
X
X  cputs(buf);
X  return cnt;
X`7D
X
Xchar *cgets(\0C06string)
X`7B
X    unsigned len = 0;
X    unsigned int maxlen_wanted;
X    char *sp;
X    int c;
X    /*
X     * Be smart and check for NULL pointer.
X     * Don't know wether TURBOC does this.
X     */
X    if (!string)
X        return(NULL);
X    maxlen_wanted = (unsigned int)(\0F0Achar)string`5B0`5D);
X    sp = `26(string`5B2`5D);
X    /*
X     * Should the string be shorter maxlen_wanted including or ex\0D07
X     * the trailing '`5C0' ? We don't take any risk.
X     */
X    while(len < maxlen_wanted-1)
X    `7B
X        c=getch();
X        /*
X         * shold we check for backspace here?
X         * TURBOC does (just checked) but doesn't in cscanf (thats harder
X         * or even impossible). We do the same.
X         */
X        if (c == '`5Cb')
X        `7B
X            if (len > 0)
X            `7B
X        \0807cputs("`5Cb `5Cb"); /* go back, clear char on screen with space
X        \0808\1010  and go back again */
X        \0807len--;
X        \0807sp`5Blen`5D = '`5C0'; /* clear the character in the string */
X            `7D
X        `7D
X        else if (c == '`5Cr')
X        `7B
X            sp`5Blen`5D = '`5C0';
X            break;
X        `7D
X        else if (c == 0)
X        `7B
X            /* special character ends input */
X            sp`5Blen`5D = '`5C0';
X            ungetch(c); /* keep the char for later processing */
X            break;
X        `7D
X        else
X        `7B
X           sp`5Blen`5D = putch(c);
X           len++;
X        `7D
X     `7D
X     sp`5Bmaxlen_wanted-1`5D = '`5C0';
X     string`5B1`5D = (char)((unsigned char)len);
X     return(sp);
X`7D
X
Xint cscanf(const char *fmt, ...)
X`7B
X    return(_doscan_low(NULL, _scan_getche\0E08ungetch,
X        \0808\1007fmt, (void **)((`26fmt)+1)));
X`7D
X
Xint movetext(int left, int top\0906righ\1407bottom\2006d\2B0Adtop)
X`7B
X  char    *buf = malloc((right - left + 1) * (bottom - top\15082);
X
X  if (!buf)
X    return 0;
X
X  gettext(left, top, right, bottom, buf);
X  puttext(dleft, dtop, dleft + right - \1C0A + bottom - top, buf);
X  free(buf);
X  return 1;
X`7D
X
Xstatic void _gettextinfo(struct text_info *t)
X`7B
X  int row, col;
X
X  t->winleft =\0D07top = 1;
X  t->winright = t->screenwidth = ScreenCols();
X  t->winbottom = t->screenheight = ScreenRows();
X  ScreenAttrib = t->attribute\0F06normattr = get_screen\2406();
X  t->currmode = getvideomode();
X  ScreenGetCursor(`26row, `26col);
X  t->curx = col+1;
X  t->cury = row+1;
X#if DBGGTINFO
X  printf("left=%2d,righ\0A06top=%2d,bottom=%2d`5Cn",t->winleft,
X`09 t->winright,\0C06top\0A07bottom);
X  printf("scrht=%2d,scrwid=%2d,norm=%2x,mode=%2d,x=%2d,y=%2d`5Cn",
X`09 t->screenheight,\110Awidth, t->normattr, t->currmode,
X`09 t->curx,\0907y);
X#endif
X`7D
X
Xvoid gettextinfo(struct text_info *t)
X`7B
X  *t = txinfo;
X#if DBGGTINFO
X  printf("left=%2d,righ\0A06top=%2d,bottom=%2d`5Cn",t->winleft,
X`09 t->winright,\0C06top\0A07bottom);
X  printf("scrht=%2d,scrwid=%2d,norm=%2x,mode=%2d,x=%2d,y=%2d`5Cn",
X`09 t->screenheight,\110Awidth, t->normattr, t->currmode,
X`09 t->curx,\0907y);
X#endif
X`7D
X
Xstatic int
Xgetvideomode(void)
X`7B
X    int mode = ScreenMode();
X    /*
X     * in mode C80 we might have loaded a different font
X     */
X    if (mode == C80)
X        if (ScreenRows() > 25)
X           mode = C4350;
X    return(mode);
X`7D
X
X
Xstatic void bell(void)
X`7B
X    union REGS regs;
X#if 0
X    /* use BIOS */
X    regs.h.ah = 0x0e; /* write */
X    regs.h.al = 0x07; /* bell */
X    int86(0x10, `26regs\0707);
X#else
X    /* use DOS */
X    regs.h.ah = 0x06; /* write */
X    regs.h.dl = 0x07; /* bell */
X    int86(0x21, `26regs\0707);
X#endif
X`7D
X
Xstatic int
Xget_screenattrib(void)
X`7B
X    union REGS regs;
X    regs.h.ah = 0x08; /* read character and attribute */
X    regs.h.bh = 0;    /* video page 0 */
X    int86(0x10, `26regs\0707);
X    return(regs.h.ah `26 0x7f); /* strip highest (BLINK) bit */
X`7D
X
X/* check if we have at least EGA (idea form Ralf Browns interrupt list) */
Xstatic int
XisEGA(void)
X`7B
X    union REGS regs;
X    regs.h.ah = 0x12;
X    regs.h.bl = 0x10;
X    regs.h.bh = 0xff;
X    int86(0x10, `26regs\0707);
X    return(regs.h.bh != 0xff);
X`7D
X
X
Xextern int _gppconio_init;
X
Xvoid gppconio_init(void)
X`7B
X    static int oldattrib =  -1;
X    if (oldattrib == -1)
X        oldattrib = get_screen\1306();
X    _gettextinfo(`26txinfo);
X    if (txinfo.currmode == 7)    /* MONO */
X        ScreenAddress = 0xb0000UL;
X    else
X`09ScreenAddress = 0xb8000UL;
X    ScreenAttrib = txinfo.normattr\120Aattribute = old\0F06;
X    _gppconio_init = 1;
X`7D
X
X#endif /* __DJGPP__ < 2 */
$ call unpack [.VILE-8_0]GPPCONIO.C;1 -
 221565656 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 41 47 152
$!
$ create 'f'
X/*
X *`09history.c
X *
X *`09Manage command-history buffer
X *
X * Notes:
X *`09This module manages an invisible, non-volatile buffer "`5BHistory`5D".
X *`09Each keyboard command to vile is logged in this buffer.  The leading
X *`09':' is not included, but all other characters are preserved so that the
X *`09command can be replayed.
X *
X *`09Each interactive call on 'kbd_reply()' logs the resulting string, and
X *`09the "glue" character (nominally, the end-of-line \2609), so that
X *`09successive calls can be spliced together. On completion of the command,
X *`09the composed command (in 'MyText') is flushed into the history-buffer.
X *
X *`09The procedure 'edithistory()' is invoked from 'kbd_reply()' to provide
X *`09access to the history.  In particular, it presents a scrollable list of
X *`09strings based on a match of the command to that point.  For example, if
X *`09the commands
X *
X *`09`09:set ts=8
X *`09`09:set ab
X *`09`09:set ai
X *
X *`09were entered, then in response to ":set", the user would see the
X *`09strings "ai", "ab" and "ts".
X *
X *`09Scrolling is accomplished by either arrow keys, or by an escaped set of
X *`09commands (a la 'ksh').
X *
X *`09Note that this implementation is a compromise.  Ideally, the command
X *`09interpreter for ':' would be able to scroll through the entire list of
X *`09commands from any point, moving forward and backward through its
X *`09internal state of range, command, arguments.  As implemented, it is not
X *`09so general.  The user can backspace from the command state into the
X *`09range state, but not from the arguments.  Also, the history scrolling
X *`09is not really useful in the range state, so it is disabled there.  If
X *`09the command interpreter were able to easily go back and forth in its
X *`09state, then it would be simple to implement an 'expert' mode, in which
X *`09prompting would be suppressed.
X *
X * To do:
X *`09Add logic to quote arguments that should be strings, to make them
X *`09easier to parse back for scrolling, etc.
X *
X *`09Integrate this with the "!!" response to the `5EX-! and !-commands.
X *
X *`09Modify the matching logic so that file commands (i.e., ":e", ":w",
X *`09etc.) are equivalent when matching for the argument.  Currently, the
X *`09history scrolling will show only arguments for identical command names.
X *
X *`09Modify the matching logic so that search commands (i.e., "/" and "?")
X *`09are equivalent when matching for the argument.  Note also that these do
X *`09not (yet) correspond to :-commands.  Before implementing, probably will
X *`09have to make TESTC a settable mode.
X *
X *`09Make the display updating work for more than simply erasing/printing
X *`09the entire response.  This is adequate for scrolling, but won't support
X *`09inline editing.
X *
X *`09Implement other ksh-style inline command editing.
X *
X *`09Allow left/right scrolling of input lines (when they get too long).
X *
X * $Header: /usr/build/vile/vile/RCS/history.c,v 1.48 1998/05/30 11:44:55 tom
V Exp $
X *
X */
X
X#include "estruct.h"
X#include "edef.h"
X
X#if`09OPT_HISTORY
X
X#define`09tb_args(p)`09tb_values(p), (int)tb_length(p)
X#define`09lp_args(p)`09p->l_text, llength(p)
X
Xtypedef`09struct`09`7B
X`09TBUFF **buffer;
X`09unsigned * position;
X`09int`09(*endfunc) (EOL_ARGS);
X`09int`09eolchar;
X`09UINT`09options;
X`09`7D HST;
X
X/*--------\0808\1010\2020\400A*/
Xstatic`09void`09stopMyBuff (void);
X
Xstatic`09const char *MyBuff = HISTORY_BufName;
Xstatic`09TBUFF`09*MyText;`09/* current command to display */
Xstatic`09int`09MyGlue,`09`09/* most recent eolchar */
X`09`09MyLevel;`09/* logging iff level is 1 */
X
X/*--------\0808\1010\2020\400A*/
X
Xstatic BUFFER *
XmakeMyBuff(void)
X`7B
X`09register BUFFER *bp;
X
X`09if (!global_g_val(GMDHISTORY)) `7B
X`09`09bp = 0;
X`09`7D else if ((bp = bfind(MyBuff, BFINVS)) != 0) `7B
X`09`09b_set_invisible(bp);
X`09`09b_clr_scratch(bp); /* make it nonvolatile */
X`09`09set_rdonly(bp, non_filename(), MDVIEW);
X`09`7D else `7B
X`09`09stopMyBuff();
X`09`7D
X`09return bp;
X`7D
X
Xstatic void
XstopMyBuff(void)
X`7B
X`09register BUFFER *bp;
X
X`09if ((bp = find_b_name(MyBuff)) != 0)
X`09`09(void)zotbuf(bp);
X
X`09tb_free(`26MyText);
X`7D
X
X/*
X * Returns 0 or 1 according to whether we will add the glue-character in the
X * next call on 'hst_append()'.
X */
Xstatic int
XwillGlue(void)
X`7B
X`09if ((tb_length(MyText) != 0) `26`26 (isPrint(MyGlue) `7C`7C \0B06 == '`5Cr'
V)) `7B
X`09`09register int c = tb_values(MyText)`5B0`5D;
X`09`09if ((c != SHPIPE_LEFT`5B0`5D) `7C`7C isRepeatable(c))
X`09`09`09return 1;
X`09`7D
X`09return 0;
X`7D
X
X/*
X * Returns true iff we display the complete, rather than the immediate portion
V
X * of the history line.  We do this for !-commands so that the user can see th
Ve
X * entire command when scrolling.
X *
X * The shift-commands also are a (similar) special case.
X */
Xstatic int
XwillExtend(const char * src, int srclen)
X`7B
X`09if ((tb_length(MyText) == 0)
X`09 `26`26 (srclen > 0)) `7B
X`09`09return (src`5B0`5D == SHPIPE_LEFT`5B0`5D) `7C`7C isRepeatable\2A07);
X`09`7D
X`09return FALSE;
X`7D
X
X/*
X * Returns a positive number if the length o\0E06given LINE is at least as
X * long as the given string in 'src' and if it matches to the length in
X * 'srclen'.
X */
Xstatic int
XsameLine(LINE * lp, char * src, int srclen)
X`7B
X`09if (srclen <= 0)
X`09`09return 0;
X`09else `7B
X`09`09register int`09dstlen = llength(lp);
X
X`09`09if (dstlen >= srclen) `7B
X`09`09`09if (!memcmp(lp->l_text, src, (SIZE_T)srclen)) `7B
X`09`09&0209if (isRepeatable(*src)
X`09`09&0209 `26`26 isRepeatable(lp->l_text`5B0`5D)
X`09`09&0209 `26`26 dstlen != srclen)
X`09`09&0209`09return -1;
X`09`09&0209return (dstlen - srclen);
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09return -1;
X`7D
X
X/*
X * Returns the length of the argument from the given line
X */
Xstatic int
XparseArg(HST * parm, LINE * lp)
X`7B
X`09int`09len = llength(lp);
X
X`09if (len > 0) `7B
X`09`09if (willExtend(lp_args(lp))) `7B
X`09`09`09return len;
X`09`09`7D else `7B
X`09`09`09register char`09*s = lp->l_text;
X`09`09`09register int`09n;
X
X`09`09`09for (n = willGlue()+tb_length(MyText); n < len; n++)
X`09`09&0209if ((*parm->endfunc)(s, n, s`5Bn`5D, \1B07olchar))
X`09`09&0209`09break;
X`09`09`09return n;
X`09`09`7D
X`09`7D
X`09return 0;
X`7D
X
X/********\0808\1010\2020\400E/
Xvoid
Xhst_init(int c)
X`7B
X`09if (++MyLevel == 1) `7B
X`09`09(void)tb_init(`26MyText, abortc);
X`09`09MyGlue = EOS;
X`09`09if (c != EOS)
X`09`09`09(void)tb_append(`26MyText, c);
X`09`7D
X`7D
X
Xvoid
Xhst_glue(int c)
X`7B
X`09/* ensure we don't repeat '/' delimiter */
X`09if (tb_length(MyText) == 0
X`09 `7C`7C tb_values(MyText)`5B0`5D != c)
X`09`09MyGlue = c;
X`7D
X
Xvoid
Xhst_append(TBUFF * cmd, int glue)
X`7B
X`09static`09int`09skip = 1;`09`09/* e.g., after "!" */
X
X`09if (clexec `7C`7C !disinp)`09`09`09/* non-interactive? */
X`09`09return;
X
X`09if (willExtend(tb_values(cmd), tb_length(cmd))
X`09 `26`26 tb_length(cmd) > (SIZE_T)skip) `7B
X`09`09kbd_pushback(cmd, skip);
X`09`7D
X
X`09if (willGlue())
X`09`09(void)tb_append(`26MyText, MyGlue);
X`09(void)tb_bappend(`26MyText, tb_values(cmd), tb_length(cmd));
X`09MyGlue = glue;
X`7D
X
Xvoid
Xhst_append_s(char *cmd, int glue)
X`7B
X`09TBUFF *p = tb_string(cmd);
X`09hst_append(p, glue);
X`09tb_free(`26p);
X`7D
X
Xvoid
Xhst_remove(const char * cmd)
X`7B
X`09if (MyLevel == 1) `7B
X`09`09TBUFF`09*temp`09= 0;
X`09`09unsigned len`09= tb_length(tb_scopy(`26temp, cmd)) - 1;
X
X`09`09while (*cmd++)
X`09`09`09tb_unput(MyText);
X`09`09kbd_kill_response(temp, `26len, killc);
X`09`09tb_free(`26temp);
X`09`7D
X`7D
X
Xvoid
Xhst_flush(void)
X`7B
X`09register BUFFER *bp = 0;
X`09register WINDOW *wp;
X`09register LINE`09*lp;
X
X`09if (MyLevel <= 0)
X`09`09return;
X`09if (MyLevel-- != 1)
X`09`09return;
X
X`09if ((tb_length(MyText) != 0)
X`09 `26`26 ((bp = makeMyBuff()) != 0)) `7B
X
X`09`09/* suppress if this is the same as previous line */
X`09`09if (((lp = lback(buf_head(bp))) != 0)
X`09`09 `26`26 (lp != buf_head(bp))
X`09`09 `26`26 (sameLine(lp, tb_args(MyText)) == 0)) `7B
X`09`09`09(void)tb_init(`26MyText, abortc);
X`09`09`09return;
X`09`09 `7D
X
X`09`09if (!addline(bp, tb_args(MyText))) `7B
X`09`09`09stopMyBuff();
X`09`09`09return;
X`09`09`7D
X
X`09`09/* patch: reuse logic from slowreadf()? */
X`09`09for_each_visible_window(wp) `7B
X`09`09`09if (wp->w_bufp == bp) `7B
X`09`09&0209wp->w_flag `7C= WFFORCE;
X`09`09&0209if (wp == curwp)
X`09`09&0209`09continue;
X`09`09&0209/* force dot to the beginning of last-line */
X`09`09&0209wp->w_force = -1;
X`09`09&0209if (wp->w_dot.l != lback(buf_head(bp))) `7B
X`09`09&0209`09wp->w_dot.l = lback(buf_head(bp));
X`09`09&0209`09wp->w_dot.o = 0;
X`09`09&0209`09wp->w_flag `7C= WFMOVE;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`7D
X`09`09updatelistbuffers();`09/* force it to show current sizes */
X`09`09(void)tb_init(`26MyText, abortc);
X`09 `7D
X`7D
X
X/*ARGSUSED*/
Xint
Xshowhistory(int f GCC_UNUSED, int n\120B)
X`7B
X`09register BUFFER *bp = makeMyBuff();
X
X`09if (!global_g_val(GMDHISTORY)) `7B
X`09`09mlforce("history mode is not set");
X`09`09return FALSE;
X`09`7D else if (bp == 0 `7C`7C popupbuff(bp) == FALSE) `7B
X`09`09return no_memory("show-history");
X`09`7D
X`09return TRUE;
X`7D
X
X/*
X * Find the last line in the history buffer that matches the portion of
X * the command that has been input to this point.  The substrings to the
X * right (up to eolchar) will form the set of history strings that the
X * user may scroll through.
X */
Xstatic LINE *
Xhst_find (
XHST *`09parm,
XBUFFER *bp,
XLINE *`09lp,
Xint`09direction)
X`7B
X`09LINE`09*base`09= buf_head(bp),
X`09`09*lp0`09= lp;
X
X`09if ((lp0 == 0)
X`09 `7C`7C ((lp == base) `26`26 (direction > 0))) `7B
X`09`09return 0;
X`09`7D
X
X`09for_ever `7B
X`09`09if (direction > 0) `7B
X`09`09`09if (lp == lback(base))`09/* cannot wrap-around */
X`09`09&0209return 0;
X`09`09`09lp = lforw(lp);
X`09`09`7D else
X`09`09`09lp = lback(lp);
X`09`09if (lp == base)
X`09`09`09return 0;&0209/* empty or no matches */
X
X`09`09if (!lisreal(lp)
X`09`09 `7C`7C ((ALLOC_T)llength(lp) <= tb_\1107MyText)+willGlue())
X`09`09 `7C`7C (sameLine(lp, tb_args(MyText)) < 0))
X`09`09`09continue;&0209/* prefix mismatches */
X
X`09`09if (willGlue()) `7B&0209/* avoid conflicts setall/set */
X`09`09`09register int len = tb_length(MyText);
X`09`09`09if (len > 0
X`09`09`09 `26`26 (len > 1 `7C`7C !isPunct(tb_values(MyText)`5B0`5D))
X`09`09`09 `26`26 llength(lp) > len
X`09`09`09 `26`26 lp->l_text`5Blen`5D != MyGlue)
X`09`09&0209continue;
X`09`09`7D
X
X`09`09/* avoid picking up lines with range-spec, since this is too
X`09`09 * cumbersome to splice in 'namedcmd()'.
X`09`09 */
X`09`09if (islinespecchar(lp->l_text`5B0`5D))
X`09`09`09continue;
X
X`09`09/* '/' and '?' are not (yet) :-commands.  Don't display them
X`09`09 * in the command-name scrolling.
X`09`09 */
X`09`09if (tb_length(MyText) == 0) `7B
X`09`09`09if (lp->l_text`5B0`5D == '/'
X`09`09`09 `7C`7C lp->l_text`5B0`5D == '?')
X`09`09&0209continue;
X`09`09`7D
X
X`09`09/* compare the argument that will be shown for the original
X`09`09 * and current lines.
X`09`09 */
X`09`09if (lisreal(lp0)) `7B
X`09`09`09int`09n0 = parseArg(parm, lp0),
X`09`09&0209n1 = parseArg(parm, lp);
X`09`09`09if (n0 != 0
X`09`09`09 `26`26 n1 != 0
X`09`09`09 `26`26 n0 == n1
X`09`09`09 `26`26 sameLine(lp, lp0->l_text, n0) >= 0)
X`09`09&0209continue;
X`09`09`7D
X
X`09`09return lp;
X`09`7D
X`7D
X
X/*
X * Update the display of the currently-scrollable buffer on the prompt-line.
X */
Xstatic void
Xhst_display(
XHST *`09parm,
Xchar *`09src,
Xint`09srclen)
X`7B
X`09/* kill the whole buffer */
X`09*(parm->position) = tb_length(\1E08buffer));
X`09wminip->w_dot.o = llength(\1A0El);
X`09kbd_kill_response(*(parm->buffer), \0F06position, killc);
X
X`09if (src != 0) `7B
X`09`09int`09keylen`09= tb_length(MyText) + willGlue();
X`09`09int`09uselen`09= srclen - keylen;
X`09`09register char`09*s = src + keylen;
X`09`09register int    n  = 0;
X
X`09`09if (willExtend(src,srclen)) `7B
X`09`09`09n = uselen;
X`09`09`7D else `7B
X`09`09`09while (uselen-- > 0) `7B
X`09`09&0209if ((*parm->endfunc)(s, n, s`5Bn`5D, \1B07olchar))
X`09`09&0209`09break;
X`09`09&0209n++;
X`09`09`09`7D
X`09`09`7D
X`09`09*parm->position = kbd_show_response(\2306buffer, s, n, \3706eolchar\0F08
Voptions);
X`09`7D
X`7D
X
X/*
X * Update the display using a LINE as source
X */
Xstatic void
Xdisplay_LINE(
XHST *`09parm,
XLINE *`09lp)
X`7B
X`09hst_display(parm, lp_args(lp));
X`7D
X
X/*
X * Update the display using a TBUFF as source
X */
Xstatic void
Xdisplay_TBUFF(HST * parm, TBUFF * tp)
X`7B
X`09hst_display(parm, tb_args(tp));
X`7D
X
X/*
X * Perform common scrolling functions for arrow-keys and ESC-mode.
X */
Xstatic`09TBUFF *`09original;`09/* save 'buffer' on first-scroll */
Xstatic`09int`09any_edit,`09/* true iff any edit happened */
X`09`09direction,`09/* current scrolling +/- */
X`09`09distance;`09/* \0D08 from original entry */
X
Xstatic LINE *
Xhst_scroll(LINE * lp1, HST * parm)
X`7B
X`09BUFFER`09*bp = makeMyBuff();
X`09LINE`09*lp0 = buf_head(bp),
X`09`09*lp2 = hst_find(parm, bp, lp1, direction);
X
X`09if (lp1 != lp2) `7B
X`09`09if (lp2 == 0) `7B
X`09`09`09if (direction+distance == 0) `7B
X`09`09&0209lp1 = lp0;
X`09`09&0209distance = 0;
X`09`09&0209display_TBUFF(parm, original);
X`09`09`09`7D else `7B
X`09`09&0209if (lp1 == lp0)`09/* nothing to scroll for */
X`09`09&0209`09distance = 0;
X`09`09&0209kbd_alarm();
+-+-+-+-+-+-+-+-  END  OF PART 58 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 59 -+-+-+-+-+-+-+-+
X`09`09`09`7D
X`09`09`09return lp1;
X`09`09`7D else `7B
X`09`09`09distance += direction;
X`09`09`09display_LINE(parm, lp2);
X`09`09`09any_edit++;
X`09`09`09return lp2;
X`09`09`7D
X`09`7D
X`09return 0;
X`7D
X
X#undef isgraph
X#define`09isgraph(c)`09(!isspecial(c) `26`26 !isSpace\0F07isPrint(c))
X
X/*
X * Invoked on an escape-character, this processes history-editing until anothe
Vr
X * escape-character is entered.
X */
Xint
Xedithistory (
XTBUFF **buffer,
Xunsigned * position,
Xint *`09given,
XUINT`09options,
Xint`09(*endfunc) (EOL_ARGS),
Xint`09eolchar)
X`7B
X`09HST`09param;
X`09BUFFER`09*bp;
X`09LINE`09*lp1, *lp2;
X`09int`09escaped`09= FALSE;
X
X`09register int`09c = *given;
X
X`09if (!isspecial(c)) `7B
X`09`09if (is_edit_char(c)
X`09`09 `7C`7C ABORTED(c)
X`09`09 `7C`7C (c == quotec)
X`09`09 `7C`7C isSpace(c)
X`09`09 `7C`7C !isCntrl(c))
X`09`09`09return FALSE;
X`09`7D
X
X`09if ((bp = makeMyBuff()) == 0)`09`09/* something is very wrong */
X`09`09return FALSE;
X
X`09if ((lp1 = buf_head(bp)) == 0)
X`09`09return FALSE;
X
X`09/* slightly better than global data... */
X`09param.buffer   = \0B06;
X`09param.position = \0B08;
X`09param.endfunc  = \0B07;
X`09param.eolchar  = \0B08== '`5Cn' ? '`5Cr' :\1908;
X`09param.options  = \0B07;
X
X`09any_edit = 0;
X`09distance = 0;
X
X`09/* save the original buffer, since we expect to scroll it */
X`09if (tb_copy(`26original, MyText)) `7B
X`09`09/* make 'original' look just like a complete command... */
X`09`09if (willGlue())
X`09`09`09(void)tb_append(`26original, MyGlue);
X`09`09(void)tb_sappend(`26original, tb_values(*buffer));
X`09`7D
X
X`09/* process char-commands */
X`09for_ever `7B
X`09`09register const CMDFUNC *p;
X
X`09`09/* If the character is bound to up/down scrolling,\0B07 the
X`09`09 * history.
X`09`09 */
X`09`09direction = 0;`09/* ...unless we find scrolling-command */
X`09`09if ((p = kcod2fnc(c)) != 0) `7B
X`09`09`09if (p->cu.c_func == backline)
X`09`09&0209direction = -1;
X`09`09`09else if (p->cu.c_func == forwline)
X`09`09&0209direction = 1;
X`09`09`7D
X`09`09if (ABORTED(c)) `7B
X`09`09`09*given = c;
X`09`09`09return FALSE;
X
X`09`09`7D else if ((direction != 0) `26`26 (escaped `7C`7C !isgraph(c))) `7B
X
X`09`09`09if ((lp2 = hst_scroll(lp1, `26param)) != 0)
X`09`09&0209lp1 = lp2;
X`09`09`09else`09/* cannot scroll */
X`09`09&0209kbd_alarm();
X`09`09`7D else if (!escaped) `7B
X`09`09`09*given = c;
X`09`09`09if (any_edit)
X`09`09&0209unkeystroke(c);
X`09`09`09return any_edit;
X
X`09`09`7D else
X`09`09`09kbd_alarm();
X
X`09`09c = keystroke();
X`09`7D
X`7D
X#endif`09/* OPT_HISTORY */
$ call unpack [.VILE-8_0]HISTORY.C;1 -
 610855102 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 29 48 152
$!
$ create 'f'
X/*
X * The routines in this file provide support for the IBM-PC family
X * of machines. It goes directly to the graphics RAM to do screen output.
X *
X * Supported monitor cards include
X *`09CGA, MONO, EGA, VGA.
X *
X * Modified by Pete Ruczynski (pjr) for auto-sensing and selection of
X * display type.
X *
X * $Header: /usr/build/vile/vile/RCS/ibmpc.c,v 1.88 1998/05/14 23:14:56 tom Ex
Vp $
X *
X */
X
X#define`09termdef`091`09`09`09/* don't define "term" external */
X
X#include        "estruct.h"
X#include        "edef.h"
X
X#if DISP_BORLAND `7C`7C !DISP_IBMPC
X#error misconfigured:  DISP_IBMPC should be defined if using ibmpc.c
X#error (and DISP_BORLAND should not be defined)
X#endif
X
X#if CC_DJGPP
X#include <pc.h>
X#define min(a,b) (((a) < (b)) ? (a) : (b))
X#define max(a,b) (((a) > (b)) ? (a) : (b))
X#define outp(p,v) outportb(p,v)
X#define inp(p) inportb(p)
X#define far
X#include <io.h> /* for setmode() */
X#include <fcntl.h> /* for O_BINARY */
X#include <dpmi.h> /* for the register struct */
X#include <go32.h>
X#endif
X
X#define NROW`0950`09`09`09/* Max Screen size.&0209*/
X#define NCOL    80`09`09`09/* Edit if you want to.         */
X#define`09MARGIN`098`09`09`09/* size of minimum margin and`09*/
X#define`09SCRSIZ`0964`09`09`09/* scroll size for extended lines */
X#define`09NPAUSE`09200`09`09`09/* # times thru update to pause */
X#define`09SPACE`0932`09`09`09/* space character&0209*/
X
X#if CC_WATCOM
X#define`09SCADC`09(0xb800 << 4)`09`09/* CGA address of screen RAM`09*/
X#define`09SCADM`09(0xb000 << 4)`09`09/* MONO address of screen RAM`09*/
X#define SCADE`09(0xb800 << 4)`09`09/* EGA address of screen RAM`09*/
X#endif
X
X#if CC_DJGPP
X#define FAR_POINTER(s,o) (0xe0000000 + s*16 + o)
X#define FP_SEG(a)`09((unsigned long)(a) >> 4L)
X#define FP_OFF(a)`09((unsigned long)(a) `26 0x0fL)
X#define`09SCADC`090xb800`09`09`09/* CGA address of screen RAM`09*/
X#define`09SCADM`090xb000`09`09`09/* MONO address of screen RAM`09*/
X#define SCADE`090xb800`09`09`09/* EGA address of screen RAM`09*/
X#endif
X
X#ifndef SCADC
X#define`09SCADC`090xb8000000L`09`09/* CGA address of screen RAM`09*/
X#define`09SCADM`090xb0000000L`09`09/* MONO address of screen RAM`09*/
X#define SCADE`090xb8000000L`09`09/* EGA address of screen RAM`09*/
X#endif
X
X#ifndef FAR_POINTER
X#define FAR_POINTER(s,o) (s)
X#endif
X
X#if CC_WATCOM
X#ifdef __386__
X#define`09INTX86(a,b,c)`09`09int386(a, b, c)
X#define`09INTX86X(a,b,c,d)`09int386x(a, b, c, d)
X#else
X#define`09INTX86(a,b,c)`09`09int86(a, b, c)
X#define`09INTX86X(a,b,c,d)`09int86x(a, b, c, d)
X#endif
X#define`09_AX_`09`09eax
X#define`09_BX_`09`09ebx
X#define`09_CX_`09`09ecx
X#define`09_DX_`09`09edx
X#define`09_DI_`09`09edi
X#else
X#define`09INTX86(a,b,c)`09int86(a, b, c)
X#define`09INTX86X(a,b,c,d)`09int86x(a, b, c, d)
X#define`09_AX_`09`09ax
X#define`09_BX_`09`09bx
X#define`09_CX_`09`09cx
X#define`09_DX_`09`09dx
X#define`09_DI_`09`09di
X#endif
X
X#define`09ColorDisplay()`09(dtype != CDMONO `26`26 !monochrome)
X#define`09AttrColor(b,f)`09(((ctrans`5Bb`5D `26 7) << 4) `7C \1808f`5D `26 15)
V)
X#define`09Black(n)`09((n) ? 0 : 7)
X#define`09White(n)`09((n) ? 7 : 0)
X#define`09AttrMono(f)`09(((Black(f) `26 7) << 4) `7C (White\170615))
X
X#if OPT_MS_MOUSE
X`09static`09int`09ms_crsr2inx  ( int, int );
X`09static`09void`09ms_deinstall (void);
X`09static`09void`09ms_hidecrsr  (void);
X`09static`09void`09ms_install   (void);
X`09static`09void`09ms_setvrange ( int, int );
X`09static`09void`09ms_showcrsr  (void);
X#else
X# define ms_deinstall()
X# define ms_install()
X#endif
X
Xstatic`09int`09dtype = -1;`09/* current display type`09`09*/
X#if CC_DJGPP
X#define PACKED __attribute__ ((packed))
X#else
X#define PACKED
X#endif
X
X`09/* mode-independent VGA-BIOS status information */
Xtypedef`09struct `7B
X`09UCHAR`09video_modes`5B3`5D PACKED;`09/* 00 Supported video-modes */
X`09UCHAR`09reserved`5B4`5D PACKED;`09/* 03 */
X`09UCHAR`09text_scanlines PACKED;`09/* 07 Number of pixel rows in text mode */
V
X`09UCHAR`09num_charsets PACKED;`09/* 08 Number of character sets that can be d
Visplayed */
X`09UCHAR`09num_loadable PACKED;`09/* 09 Number of character sets \3009into vid
Veo RAM */
X`09UCHAR`09capability PACKED;`09/* 0A VGA-BIOS \220Binfo */
X`09UCHAR`09more_info PACKED;`09/* 0B More VGA-BIOS capability info */
X`09UCHAR`09reserved2`5B4`5D PACKED;`09/* 0C */
X`09`7D static_VGA_info PACKED;
X
X`09/* mode-dependent VGA-BIOS status information */
Xtypedef`09struct `7B
X`09static_VGA_info *\1107info PACKED; /* 00 Address of table containing \4706
V \4306/
X`09UCHAR`09code_number PACKED;`09/* 04 Code \1A07of current video mode */
X`09USHORT`09num_columns PACKED;`09/* 05 Number of displayed screen or pixel co
Vls */
X`09USHORT`09page_length PACKED;`09/* 07 L\1506of display page in video RAM */
V
X`09USHORT`09curr_page PACKED;`09/* 09 Starting address of current display-page
V in video RAM */
X`09UCHAR`09crsr_pos`5B8`5D`5B2`5D PACKED;`09/* 0B Cursor positions in display-
Vpages in col/row order */
X`09UCHAR`09crsr_end PACKED;`09/* 1B Ending row of cursor (pixel) row */
X`09UCHAR`09crsr_start PACKED;`09/* 1C Starting row of cursor (pixel) row */
X`09UCHAR`09curr_page_num PACKED;`09/* 1D Number of current display page */
X`09USHORT`09port_crt PACKED;`09/* 1E Port address of the CRT controller\1E09re
Vgister */
X`09UCHAR`09curr_crtc PACKED;`09/* 20 Current contents of CRTC control register
Vs */
X`09UCHAR`09curr_color_sel PACKED;`09/* 21 Current color selection register con
Vtents */
X`09UCHAR`09num_rows PACKED;`09/* 22 Number of screen rows displayed */
X`09USHORT`09char_height PACKED;`09/* 23 H\1506of characters in pixel rows */
X`09UCHAR`09code_active PACKED;`09/* 25 Code number of \2407video adapter */
X`09UCHAR`09code_inactive PACKED;`09/* 26 Code number of \2609video adapter */
V
X`09USHORT`09num_colors PACKED;`09/* 27 Number of displayable \2B07(0=monochrom
Ve) */
X`09UCHAR`09num_pages PACKED;`09/* 29 Number of screen \2506*/
X`09UCHAR`09num_pixel_rows PACKED;`09/* 2A Number of displayed pixel rows (RES_
V200, etc.) */
X`09UCHAR`09num_cset0 PACKED;`09/* 2B Number of char-table used with chars whos
Ve 3rd attr bit is 0 */
X`09UCHAR`09num_cset1 PACKED;`09/* 2C Number of char-table used with chars whos
Ve 3rd attr bit is 1 */
X`09UCHAR`09misc_info PACKED;`09/* 2D Miscellaneous information */
X`09UCHAR`09reserved`5B3`5D PACKED;`09/* 2E */
X`09UCHAR`09size_of_ram PACKED;`09/* 31 Size of available video RAM (0=64k, 1=1
V28k, 2=192k, 3=256k) */
X`09UCHAR`09reserved2`5B14`5D PACKED;`09/* 32 */
X`09`7D dynamic_VGA_info PACKED;`09/* length == 64 bytes */
X
X`09/* scan-line resolution codes */
X#define`09RES_200`090
X#define`09RES_350`091
X#define`09RES_400`092
X#define RES_480 3
X
X`09/* character-size codes */
X#define`09C8x8`090x12
X#define`09C8x14`090x11
X#define`09C8x16`090x14
X
X`09/* character-size in pixels, for mouse-positioning */
Xstatic`09int`09chr_wide = 8;
Xstatic`09int`09chr_high = 8;
X
Xtypedef`09struct`09`7B
X`09char`09*name;
X`09UCHAR`09type;
X`09UCHAR`09mode;
X`09UCHAR`09vchr;`09/* code for setting character-height */
X`09UCHAR`09rows;
X`09UCHAR`09cols;
X`09UCHAR`09vres;`09/* required scan-lines, RES_200, ... */
X`09`7D DRIVERS;
X
X#define ORIGTYPE  0`09/* store original info in this slot.
X`09`09`09   (these values should all (?) get replaced
X`09`09`09   at open time) */
X
X/* order this table so that more higher resolution entries for the same
X *  name come first.  remember -- synonyms take only 10 bytes, plus the
X *  name itself.
X */
Xstatic`09DRIVERS drivers`5B`5D = `7B
X`09`09`7B"default",ORIGTYPE,    3,      C8x8,   25,  80, RES_200`7D,
X`09`09`7B"2",      CDVGA,`093,`09C8x16,`0925,  80, RES_400`7D,
X`09`09`7B"25",     CDVGA,`093,`09C8x16,`0925,  80, RES_400`7D,
X`09`09`7B"2",      CDCGA,`093,`09C8x8,`0925,  80, RES_200`7D,
X`09`09`7B"25",     CDCGA,`093,`09C8x8,`0925,  80, RES_200`7D,
X`09`09`7B"CGA",    CDCGA,`093,`09C8x8,`0925,  80, RES_200`7D,
X`09`09`7B"MONO",   CDMONO,`093,`09C8x8,`0925,  80, RES_200`7D,
X`09`09`7B"80x25",  CDVGA,`093,`09C8x16,`0925,  80, RES_400`7D,
X`09`09`7B"80x28",  CDVGA,`093,`09C8x14,  28,  80, RES_400`7D,
X`09`09`7B"EGA",    CDEGA,`093,`09C8x8,`0943,  80, RES_350`7D,
X`09`09`7B"4",      CDEGA,`093,`09C8x8,`0943,  80, RES_350`7D,
X`09`09`7B"43",     CDEGA,`093,`09C8x8,`0943,  80, RES_350`7D,
X`09`09`7B"80x43",  CDVGA,`093,`09C8x8,   43,  80, RES_350`7D,
X`09`09`7B"5",      CDVGA,`093,`09C8x8,`0950,  80, RES_400`7D,
X`09`09`7B"50",     CDVGA,`093,`09C8x8,`0950,  80, RES_400`7D,
X`09`09`7B"VGA",    CDVGA,`093,`09C8x8,`0950,  80, RES_400`7D,
X`09`09`7B"80x50",  CDVGA,`093,`09C8x8,`0950,  80, RES_400`7D,
X`09`09`7B"80x14",  CDVGA,`093,`09C8x14,  14,  80, RES_200`7D,
X`09`09`7B"40x12",  CDVGA,`091,`09C8x16,`0912,  40, RES_200`7D,
X`09`09`7B"40x21",  CDVGA,`091,`09C8x16,`0921,  40, RES_350`7D,
X`09`09`7B"40x25",  CDVGA,`091,`09C8x16,`0925,  40, RES_400`7D,
X`09`09`7B"40x28",  CDVGA,`091,`09C8x14,  28,  40, RES_400`7D,
X`09`09`7B"40x50",  CDVGA,`091,`09C8x8,   50,  40, RES_400`7D,
X
X`09`7D;
X
Xstatic`09const`09long`09ScreenAddress`5B`5D = `7B
X`09`09SCADC,`09/* CDCGA: Color graphics adapter */
X`09`09SCADM,`09/* CDMONO: Monochrome adapter */
X`09`09SCADE,`09/* CDEGA: Enhanced graphics adapter */
X`09`09SCADE`09/* CDVGA: VGA adapter */
X`09`7D;
X
X/*  the following should be sized dynamically, but it may not be worth it,
X`09if we come up in the biggest size anyway, since we never shrink
X`09but only grow */
XUSHORT *scptr`5BNROW`5D;`09`09`09/* pointer to screen lines`09*/
XUSHORT *s2ptr`5BNROW`5D;`09`09`09/* pointer to page-1 lines`09*/
XUSHORT sline`5BNCOL`5D;`09`09`09/* screen line image&0209*/
Xextern union REGS rg;`09`09`09/* cpu register for use of DOS calls */
X
Xstatic`09int`09ibm_opened,
X`09`09original_page,`09/* display-page (we use 0)`09*/
X`09`09allowed_vres,`09/* possible scan-lines, 1 bit per value */
X`09`09original_curs,`09/* start/stop scan lines`09*/
X`09`09monochrome`09= FALSE;
X
Xstatic`09int`09egaexist = FALSE;`09/* is an EGA card available?`09*/
X
X`09`09&0209`09/* Forward references.          */
Xextern  void`09ibmmove   (int,int);
Xextern  void`09ibmeeol   (void);
Xextern  void`09ibmeeop   (void);
Xextern  void`09ibmbeep   (void);
Xextern  void    ibmopen   (void);
Xextern`09void`09ibmrev    (UINT);
Xextern`09int`09ibmcres   (const char *);
Xextern`09void`09ibmclose  (void);
Xextern`09void`09ibmputc   (int);
Xextern`09void`09ibmkopen  (void);
Xextern`09void`09ibmkclose (void);
X
X#if`09OPT_COLOR
Xextern`09void`09ibmfcol   (int);
Xextern`09void`09ibmbcol   (int);
X
Xint`09cfcolor = -1;`09`09/* current forground color */
Xint`09cbcolor = -1;`09`09/* current background color */
Xstatic`09const char *initpalettestr = "0 4 2 6 1 5 3 7 8 12 10 14 9 13 11 15";
V
X/* black, red, green, yellow, blue, magenta, cyan, white   */
X#endif
Xextern`09void`09ibmscroll (int,int,int);
X
Xstatic`09int`09scinit    (int);
Xstatic`09int`09getboard  (void);
Xstatic`09int`09scblank   (void);
X
X#ifdef MUCK_WITH_KBD_RATE
Xstatic`09void`09maxkbdrate   (void);
X#endif
X
Xstatic`09const struct `7B
X`09char  *seq;
X`09int   code;
X`7D keyseqs`5B`5D = `7B`09/* use 'Z' in place of leading 0, so these can be C-
Vstrings */
X`09/* Arrow keys */
X`09`7B"Z`5C110",     KEY_Up`7D,
X`09`7B"Z`5C120",     KEY_Down`7D,
X`09`7B"Z`5C115",     KEY_Right`7D,
X`09`7B"Z`5C113",     KEY_Left`7D,
X`09/* page scroll */
X`09`7B"Z`5C121",     KEY_Next`7D,
X`09`7B"Z`5C111",     KEY_Prior`7D,
X`09`7B"Z`5C107",     KEY_Home`7D,
X`09`7B"Z`5C117",     KEY_End`7D,
X`09/* editing */
X        `7B"ZR",\0E08KEY_Insert`7D,
X`09`7B"Z`5C123",     KEY_Delete`7D,
X`09/* function keys */
X        `7B"Z;",\0E06KEY_F1`7D,
X`09`7B"Z<",      KEY_F2`7D,
X`09`7B"Z=",      KEY_F3`7D,
X`09`7B"Z>",      KEY_F4`7D,
X`09`7B"Z?",      KEY_F5`7D,
X`09`7B"Z@",      KEY_F6`7D,
X`09`7B"ZA",      KEY_F7`7D,
X`09`7B"ZB",      KEY_F8`7D,
X`09`7B"ZC",      KEY_F9`7D,
X        `7B"ZD",\0E06KEY_F10`7D,
X`7D;
X
Xstatic int current_ibmtype;
X
X/*
X * Standard terminal interface dispatch table. Most of the fields point into
X * "termio" code.
X */
XTERM    term    = `7B
X`09NROW,
X`09NROW,
X`09NCOL,
X`09NCOL,
X`09MARGIN,
X`09SCRSIZ,
X`09NPAUSE,
X`09ibmopen,
X`09ibmclose,
X`09ibmkopen,
X`09ibmkclose,
X`09ttgetc,
X`09ibmputc,
X`09tttypahead,
X`09ttflush,
X`09ibmmove,
X`09ibmeeol,
X`09ibmeeop,
X`09ibmbeep,
X`09ibmrev,
X`09ibmcres,
X#if`09OPT_COLOR
X`09ibmfcol,
X`09ibmbcol,
X`09set_ctrans,
X#else
X`09null_t_setfor,
X`09null_t_setback,
X`09null_t_setpal,
X#endif
X`09ibmscroll,
X`09null_t_pflush,
X`09null_t_icursor,
X`09null_t_title,
X`09null_t_watchfd,
X`09null_t_unwatchfd,
X`7D;
X
X#if CC_DJGPP
X_go32_dpmi_seginfo vgainfo;
X#endif
X
Xstatic int
Xget_vga_bios_info(dynamic_VGA_info *buffer)
X`7B
X# if CC_DJGPP
X`09_go32_dpmi_registers regs;
X`09vgainfo.size = (sizeof (dynamic_VGA_info)+15) / 16;
X`09if (_go32_dpmi_allocate_dos_memory(`26vgainfo) != 0) `7B
X`09`09fprintf(stderr,"Couldn't allocate vgainfo memory`5Cn");
X`09`09exit(BADEXIT);
X`09`7D
X
X`09regs.x.ax = 0x1b00;
X`09regs.x.bx = 0;
X`09regs.x.ss = \0C08p = 0;
X`09regs.x.es = vgainfo.rm_segment;
X`09regs.x.di = 0;
X`09_go32_dpmi_simulate_int(0x10, `26regs);
X
X`09dosmemget( vgainfo.rm_segment*16, sizeof (dynamic_VGA_info), buffer);
X
X`09_go32_dpmi_free_dos_memory(`26vgainfo);
X
X`09return (regs.h.al == 0x1b);
X#else
X`09struct SREGS segs;
X
X#if CC_WATCOM
X`09segread(`26segs);
X#else
X`09segs.es   = FP_SEG(buffer);
X#endif
X`09rg.x._DI_ = FP_OFF(buffer);
X`09rg.x._AX_ = 0x1b00;
X`09rg.x._BX_ = 0;
X`09INTX86X(0x10, `26rg, `26rg, `26segs); /* Get VGA-BIOS status */
X
X`09return (rg.h.al == 0x1b);
X#endif
X`7D
X
Xstatic void
Xset_display (int mode)
X`7B
X`09rg.h.ah = 0;
X`09rg.h.al = mode;
X`09INTX86(0x10, `26rg, `26rg);
X`7D
X
Xstatic void
Xset_page (int page)
X`7B
X`09rg.h.ah = 5;
X`09rg.h.al = page;
X`09INTX86(0x10, `26rg, `26rg);
X`7D
X
X#ifdef MUCK_WITH_KBD_RATE
X/*  set the keyboard rate to max */
Xstatic void
Xmaxkbdrate (void)
X`7B
X`09rg.h.ah = 0x3;
X`09rg.h.al = 0x5;
X`09rg.h.bh = 0x0;
X`09rg.h.bl = 0x0;
X`09INTX86(0x16, `26rg, `26rg);
X`7D
X#endif
X
Xstatic void
Xset_char_size(int code)
X`7B
X`09switch (code) `7B
X`09case C8x8:`09chr_wide = 8;`09chr_high\0E06break;
X`09case C8x14:`09chr_wide = 8;`09chr_high = 14;`09break;
X`09case C8x16:`09chr_wide = 8;`09chr_high = 16;`09break;
X`09default:`09return;`09`09/* cannot set this one! */
X`09`7D
X`09rg.h.ah = 0x11;`09`09/* set char. generator function code`09*/
X`09rg.h.al = code;`09`09/*  to specified ROM&0209`09*/
X`09rg.h.bl = 0;`09`09/* Character table 0&0209`09*/
X`09INTX86(0x10, `26rg, `26rg);`09/* VIDEO - TEXT-MODE CHARACTER GENERATOR FUNC
VTIONS */
X`7D
X
Xstatic void
Xset_cursor(int start_stop)
X`7B
X`09rg.h.ah = 1;`09`09/* set cursor size function code */
X`09rg.x._CX_ = (drivers`5BORIGTYPE`5D.mode <= 3) ?
X`09`09start_stop `26 0x707 : \150A;
X`09INTX86(0x10, `26rg, `26rg);`09/* VIDEO - SET TEXT-MODE CURSOR SHAPE */
X`7D
X
Xstatic int
Xget_cursor(void)
X`7B
X`09rg.h.ah = 3;
X`09rg.h.bh = 0;
X`09INTX86(0x10, `26rg, `26rg);`09/* VIDEO - GET CURSOR POSITION */
X`09return rg.x._CX_;
X`7D
X
Xstatic void
Xset_vertical_resolution(int code)
X`7B
X`09rg.h.ah = 0x12;
X`09rg.h.al = code;
X`09rg.h.bl = 0x30;
X`09INTX86(0x10, `26rg, `26rg);`09/* VIDEO - SELECT VERTICAL RESOLUTION */
X`09if (code == RES_200)
X`09`09delay(50);`09/* patch: timing problem? */
X`7D
X
X/*--------\0808\1010\2020\400A*/
X
X#if`09OPT_COLOR
Xvoid
Xibmfcol(`09`09/* set the current output color */
Xint color)`09`09/*\0B06 to set */
X`7B
X`09if (color < 0)
X`09`09color = C_WHITE;
X`09cfcolor = ctrans`5Bcolor`5D;
X`7D
X
Xvoid
Xibmbcol(`09`09/* set the current background color */
Xint color)`09`09/*\0B06 to set */
X`7B
X`09if (color < 0)
X`09`09color = C_BLACK;
X`09cbcolor = ctrans`5Bcolor`5D;
X`7D
X#endif
X
Xvoid
Xibmmove(int row, int col)
X`7B
X`09rg.h.ah = 2;`09`09/* set cursor position function code */
X`09rg.h.dl = col;
X`09rg.h.dh = row;
X`09rg.h.bh = 0;`09`09/* set screen page number */
X`09INTX86(0x10, `26rg, `26rg);
X`7D
X
X/* erase to the end of the line */
Xvoid
Xibmeeol(void)
X`7B
X`09int ccol,crow;`09/* current column,row for cursor */
X
X`09/* find the current cursor position */
X`09rg.h.ah = 3;`09`09/* read cursor position function code */
X`09rg.h.bh = 0;`09`09/* current video page */
X`09INTX86(0x10, `26rg, `26rg);
X
X`09ccol = rg.h.dl;`09`09/* record current column */
X`09crow = rg.h.dh;`09`09/* and row */
X
X`09scwrite(crow, ccol, term.t_ncol-\1206NULL\0606, gfcolor, gbcolor);
X
X`7D
X
X/* put a character at the current position in \180Ccolors */
Xvoid
Xibmputc(int ch)
X`7B
X`09rg.h.ah = 14;`09`09/* write char to screen with current attrs */
X`09rg.h.al = ch;
X#if`09OPT_COLOR
X`09if (ColorDisplay())
X`09`09rg.h.bl = cfcolor;
X`09else
X#endif
X`09rg.h.bl = White(TRUE);
X`09rg.h.bh = 0;`09`09/* current video page */
X`09INTX86(0x10, `26rg, `26rg);
X`7D
X
Xvoid
Xibmeeop(void)
X`7B
X`09rg.h.ah = 6;`09`09/* scroll page up function code */
X`09rg.h.al = 0;`09`09/* # lines to scroll (clear it) */
X`09rg.x._CX_ = 0;`09`09/* upper left corner of scroll */
X`09rg.h.dh = term.t_nrow - 1; /* lower right corner of scroll */
X`09rg.h.dl = term.t_ncol - 1;
X`09rg.h.bh = scblank();
X`09INTX86(0x10, `26rg, `26rg);
X`7D
X
Xvoid
Xibmrev(`09`09/* change reverse video state */
XUINT state)`09/* TRUE = reverse, FALSE = normal */
X`7B
X`09/* This never gets used under the IBM-PC driver */
X`7D
X
Xint
Xibmcres(`09/* change screen resolution */
Xconst char *res)`09/* resolution to change to */
X`7B
X`09register int i;`09`09/* index */
X`09int`09status = FALSE;
X
X`09if (!res `7C`7C !strcmp(res, "?")) `09/* find the default configuration */
V
X`09`09res = "default";
X
X`09/* try for a name match on all drivers, until we find it
X`09`09and succeed or fall off the bottom */
X`09for (i = 0; i < TABLESIZE(drivers); i++) `7B
X`09`09if (strcmp(res, drivers`5Bi`5D.name) == 0) `7B
X`09`09`09if ((status = scinit(i)) == TRUE) `7B
X`09`09&0209strcpy(current_res_name, res);
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09return status;
X`7D
X
X#if OPT_MS_MOUSE `7C`7C OPT_FLASH
Xextern VIDEO **vscreen;`09/* patch: edef.h */
X
Xstatic`09int`09vp2attr ( VIDEO *, int );
Xstatic`09void`09move2nd ( int, int );
Xstatic`09void`09copy2nd ( int );
X
Xstatic int
Xvp2attr(VIDEO *vp, int inverted)
X`7B
X`09int`09attr;
X#if`09OPT_COLOR
X`09if (ColorDisplay())
X`09`09attr = AttrColor(
X`09`09`09inverted ? ReqFcolor(vp) : ReqB\1009,
X`09`09`09inverted ? ReqBcolor(vp) : ReqF\1009);
X`09else
X#endif
X`09 attr = AttrMono(!inverted);
X`09return (attr << 8);
X`7D
X
Xstatic void
Xmove2nd(int row, int col)
X`7B
X`09rg.h.ah = 0x02;
X`09rg.h.bh = 1;
X`09rg.h.dh = row;
X`09rg.h.dl = col;
X`09INTX86(0x10, `26rg, `26rg);
X`7D
X
Xstatic void
Xcopy2nd(int inverted)
X`7B
X`09WINDOW`09*wp;
X`09VIDEO`09*vp;
X`09USHORT *lp;
X`09char *tt;
X`09register int`09row, col, attr;
X
X`09for_each_visible_window(wp) `7B
X`09`09for (row = wp->w_toprow; row <= mode_row(wp); row++) `7B
X`09`09`09vp = vscreen`5Brow`5D;
X`09`09`09lp = s2ptr`5Brow`5D;
X`09`09`09tt = vp->v_text;
X`09`09`09attr = vp2attr(vp, inverted `5E (row == mode_row(wp)));
X`09`09`09for (col = 0; col < term.t_ncol; col++) `7B
X`09`09&0209lp`5Bcol`5D = (attr `7C tt`5Bcol`5D);
X`09`09`09`7D
X`09`09`7D
X`09`7D
X
X`09/* fill in the message line */
X`09lp = s2ptr`5Bterm.t_nrow-1`5D;
X`09attr = scblank() << 8;
X`09for (col = 0; col < term.t_ncol; col++)
X`09`09lp`5Bcol`5D = attr `7C SPACE;
X`09move2nd(ttrow, ttcol);
X`7D
X#endif
X
X/*
X * Reading back from display memory does not work properly when using a mouse,
V
X * because the portion of the display line beginning with the mouse cursor is
V
X * altered (by the mouse driver, apparently).  Flash the display by building a
Vn
X * inverted copy of the screen in\0E06econd display-page and toggling
X * momentarily to that copy.
X *
X * Note: there's no window from which to copy the message line.
X */
X#if OPT_FLASH
Xvoid
Xflash_display (void)
X`7B
X`09copy2nd(TRUE);
X`09set_page(1);
X`09catnap(100,FALSE); /* if we don't wait, we cannot see the flash */
X`09set_page(0);
X`7D
X#endif`09/* OPT_FLASH */
X
Xvoid
Xibmbeep(void)
X`7B
X#if`09OPT_FLASH
X`09if (global_g_val(GMDFLASH) `26`26 ibm_opened) `7B
X`09`09flash_display();
X`09`09return;
X`09`7D
X#endif
X`09bdos(6, BEL, 0);`09/* annoying!! */
X`7D
X
Xvoid
Xibmopen(void)
X`7B
X`09register DRIVERS *driver = `26\0A06s`5BORIGTYPE`5D;
X`09int i;
X
X`09if (sizeof(dynamic_VGA_info) != 64) `7B
X`09`09printf("DOS vile build error -- dynamic_VGA_info struct"
X`09`09`09" must be packed (ibmpc.c)`5Cn");
X`09`09exit(BADEXIT);
X`09`7D
X
X`09rg.h.ah = 0xf;
X`09INTX86(0x10,`26rg, `26rg);`09/* VIDEO - GET DISPLAY MODE */
X
X`09driver->vchr  = C8x8;
X`09driver->vres  = RES_200;
X`09driver->rows  = 25;
X`09driver->cols  = rg.h.ah;
X`09driver->mode  = rg.h.al;
X`09original_page = rg.h.bh;
X`09driver->type  = getboard();
X`09allowed_vres  = (1<<RES_200);`09/* assume only 200 scan-lines */
X
X`09if (driver->type == CDVGA) `7B`09/* we can determine original rows */
X`09`09dynamic_VGA_info buffer;
X
X`09`09if (get_vga_bios_info(`26buffer)) `7B
X#undef TESTIT
X#ifdef TESTIT
X`09`09`09printf ("call succeeded`5Cn");
X`09`09`09printf ("static_info is 0x%x`5Cn", buffer.\1F0B);
X`09`09`09printf ("code_number is 0x%x`5Cn", buffer.\1F0B);
X`09`09`09printf ("num_columns is 0x%x`5Cn", buffer.\1F0B);
X`09`09`09printf ("page_length is 0x%x`5Cn", buffer.\1F0B);
X`09`09`09printf ("curr_page is 0x%x`5Cn", buffer.\1D09);
X`09`09`09printf ("num_rows is 0x%x`5Cn", buffer.\1C08);
X#endif
X`09`09`09switch (buffer.char_height) `7B
X`09`09`09case 8:&0209driver->vchr = C8x8;`09break;
X`09`09`09case 14:`09driver->vchr = C8x14;`09break;
X`09`09`09case 16:`09driver->vchr = C8x16;`09break;
X`09`09`09`7D
X`09`09`09driver->rows = buffer.num_rows;
X#if CC_DJGPP
X`09`09`09`7B u_long staticinfop;
X`09`09`09static_VGA_info \1007info;
X`09`09`09staticinfop = ((u_long)buffer.\1E06_info `26 0xffffL);
X`09`09`09staticinfop += (((u_long)buffer.\2006_info >> 12) `26
X`09`09&0209&02090xffff0L);
X`09`09`09dosmemget( staticinfop, sizeof(\1406_info),
X`09`09&0209`09`26static_info);
X`09`09`09allowed_vres = static_info.text_scanlines;
X`09`09`09`7D
X#elif CC_WATCOM
X`09`09`09`7B
X`09`09`09static_VGA_info __far *\1706infop;
X`09`09`09staticinfop = MK_FP (
X`09`09`09((unsigned long)(buffer.static_info) >> 16) `26 0xffffL,
X`09`09`09((unsigned long)(buffer.static_info)      ) `26 0xffffL
X`09`09&0209);
X`09`09`09allowed_vres = staticinfop->text_scanlines;
X`09`09`09`7D
X#else
X`09`09`09allowed_vres = buffer.static_info->text_scanlines;
X#endif
X`09`09`09driver->vres = buffer.num_pixel_rows;
X`09`09`7D
X`09`7D else if (driver->type == CDEGA) `7B
X`09`09allowed_vres `7C= (1<<RES_350);
X`09`7D
X
X`09original_curs = get_cursor();
X
X#ifdef PVGA
X`09set_display(10);`09/* set graphic 640x350 mode */
X`09rg.x._AX_ = 0x007F;
X`09rg.h.bh = 0x01;`09`09/* set non-VGA mode */
X`09INTX86(0x10,`26rg, `26rg);
X`09set_display(7);`09`09/* set Hercule mode */
X`09current_res_name = "25";
X#endif
X
X#if`09OPT_COLOR
X`09set_palette(init\0C07str);
X#endif
X`09if (!ibmcres(current_res_name))
X`09`09(void)scinit(ORIGTYPE);
X`09revexist = TRUE;
X`09ttopen();
X
X#ifdef MUCK_WITH_KBD_RATE
X`09maxkbdrate();   /* set the keyboard rate to max */
X#endif
X`09for (i = TABLESIZE(keyseqs); i--; ) `7B
X`09 `09int len = strlen(keyseqs`5Bi`5D.seq);
X`09`09if (keyseqs`5Bi`5D.seq`5B0`5D == 'Z') `7B
X`09`09`09keyseqs`5Bi`5D.seq`5B0`5D = '`5C0';
X`09`09`7D
X`09`09addtosysmap(keyseqs`5Bi`5D.seq, len, \150Bcode);
X`09`7D
X
X`09ibm_opened = TRUE;`09/* now safe to use 'flash', etc. */
X`7D
X
Xvoid
Xibmclose(void)
X`7B
X`09int`09ctype = current_ibmtype;
X
X`09if (current_ibmtype != ORIGTYPE)
X`09`09scinit(ORIGTYPE);
X`09if (original_page != 0)
X`09`09set_page(original_page);
X`09set_cursor(original_curs);
X
X`09current_ibmtype = ctype; /* ...so subsequent TTopen restores us */
X
X`09dtype = CDMONO;`09`09/* ...force monochrome */
X`09kbd_erase_to_end(0);`09/* ...force colors _off_ */
X`09kbd_flush();
X`7D
X
Xvoid
Xibmkopen(void)`09`09/* open the keyboard */
X`7B
X`09ms_install();
X#if CC_DJGPP
X`09setmode(0,O_BINARY);
X#endif
X`7D
X
Xvoid
Xibmkclose(void)`09`09/* close the keyboard */
X`7B
X#if CC_DJGPP
X`09setmode(0,O_TEXT);
X#endif
X`09ms_deinstall();
X`7D
X
Xstatic int
Xscinit(`09`09`09/* initialize the screen head pointers */
Xint newtype)`09`09/* type of adapter to init for */
X`7B
X`09dynamic_VGA_info buffer;
X`09union `7B
X`09`09long laddr;&0209/* long form of address */
X`09`09USHORT *paddr;&0209/* pointer form of address */
X`09`7D addr;
X`09long pagesize;
X`09register DRIVERS *driver;
X`09register int i;
X`09int`09     type, rows, cols;
X
X`09driver = `26\0A06s`5Bnewtype`5D;
X
X`09/* check to see if we're allow this many scan-lines */
X`09if ((allowed_vres `26 (1 << (driver->vres))) == 0)
X`09`09return FALSE;
X
X`09type = driver->type;
X`09rows = driver->rows;
X`09cols = driver->cols;
X
X`09/* and set up the various parameters as needed */
X`09set_vertical_resolution(driver->vres);
X
X`09set_display(driver->mode);
X`09set_vertical_resolution(driver->vres);
X`09set_char_size(driver->vchr);
X
X`09/* reset the original cursor -- it gets changed above somewhere */
X`09set_cursor(original_curs);
X
X`09/*
X`09 * Install an alternative hardcopy routine which prints as many lines
X`09 * as are displayed on the screen. The normal BIOS routine always
X`09 * prints 25 lines.
X`09 */
X`09if (rows > 25) `7B
X`09`09rg.h.ah = 0x12;&0209/* alternate select function code    */
X`09`09rg.h.bl = 0x20;&0209/* alt. print screen routine         */
X`09`09INTX86(0x10, `26rg, `26rg);`09/* VIDEO - SELECT ALTERNATE PRTSCRN  */
X`09`7D
X
X`09if (driver->type == CDEGA) `7B
X`09`09outp(0x3d4, 10);`09/* video bios bug patch */
X`09`09outp(0x3d5, 6);
X`09`7D
X
X`09/* reset the $sres environment variable */
X`09(void)strcpy(sres, driver->name);
X
X`09if ((type == CDMONO) != (d\150F)
X`09`09sgarbf = TRUE;
+-+-+-+-+-+-+-+-  END  OF PART 59 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 60 -+-+-+-+-+-+-+-+
X`09dtype = type;
X`09current_ibmtype = newtype;
X
X`09/* initialize the screen pointer array */
X`09if (monochrome)
X`09`09addr.laddr = FAR_POINTER(ScreenAddress`5BCDMONO`5D,0x0000);
X`09else if (type == CDMONO)
X`09`09addr.laddr = FAR_POINTER(ScreenAddress`5BCDCGA`5D,0x0000);
X`09else
X`09`09addr.laddr = FAR_POINTER(ScreenAddress`5Btype`5D,0x0000);
X
X`09for (i = 0; i < rows; i++)
X`09`09scptr`5Bi`5D = addr.paddr + (cols * i);
X
X#if OPT_FLASH `7C`7C OPT_MS_MOUSE
X`09/* Build row-indices for display page #1, to use it in screen flashing
X`09 * or for mouse highlighting.
X`09 */
X`09if ((type == CDVGA) `26`26 get_vga_bios_info(`26buffer)) `7B
X`09`09/*
X`09`09 * Setting page-1 seems to make Window 3.1 "aware" that we're
X`09`09 * going to write to that page.  Otherwise, the "flash" mode
X`09`09 * doesn't write to the correct address.
X`09`09 */
X`09`09set_page(1);
X`09`09get_vga_bios_info(`26buffer);
X`09`09pagesize = (long)buffer.page_length; /* also, page-1 offset */
X`09`09set_page(0);
X`09`7D else `7B
X`09`09/*
X`09`09 * This was tested for all of the VGA combinations running
X`09`09 * with MSDOS, but isn't general -- dickey@software.org
X`09`09 */
X`09`09pagesize = (rows * cols);
X`09`09switch (cols) `7B
X`09`09case 40:`09pagesize += ((4*cols) - 32);`09break;
X`09`09case 80:`09pagesize += ((2*cols) - 32);`09break;
X`09`09`7D
X`09`09pagesize <<= 1;
X`09`7D
X`09addr.laddr += pagesize;
X`09for (i = 0; i < rows; i++)
X`09`09s2ptr`5Bi`5D = addr.paddr + (cols * i);
X#endif
X`09/* changing the screen-size forces an update, so we do this last */
X`09newscreensize(rows, cols);
X#if OPT_MS_MOUSE
X`09if (ms_exists()) `7B
X`09`09ms_deinstall();
X`09`09ms_install();
X`09`7D
X#endif
X`09return(TRUE);
X`7D
X
X/* getboard:`09Determine which type of display board is attached.
X *`09`09Current known types include:
X *
X *`09`09CDMONO`09Monochrome graphics adapter
X *`09`09CDCGA`09Color Graphics Adapter
X *`09`09CDEGA`09Extended graphics Adapter
X *`09`09CDVGA`09VGA graphics Adapter
X */
X
Xint getboard(void)
X`7B
X`09monochrome = FALSE;
X`09egaexist = FALSE;
X
X`09/* check for VGA or MCGA */
X`09rg.x._AX_ = 0x1a00;
X`09rg.h.bl = 0x00;
X`09INTX86(0x10,`26rg, `26rg);`09/* VIDEO - GET DISPLAY COMBINATION CODE (PS,VG
VA,MCGA) */
X
X`09if (rg.h.al == 0x1a) `7B`09/* function succeeded */
X`09`09switch (rg.h.bl) `7B
X`09`09case 0x01:`09monochrome = TRUE;
X`09`09&0209return (CDMONO);
X
X`09`09case 0x02:`09return (CDCGA);
X
X`09`09case 0x05:`09monochrome = TRUE;
X`09`09case 0x04:`09egaexist = TRUE;
X`09`09&0209return (CDEGA);
X
X`09`09case 0x07:`09monochrome = TRUE;
X`09`09case 0x08:`09return (CDVGA);
X
X`09`09case 0x0b:`09monochrome = TRUE;
X`09`09case 0x0a:
X`09`09case 0x0c:`09return (CDCGA);`09/* MCGA */
X`09`09`7D
X`09`7D
X
X`09/*
X`09 * Check for MONO board
X`09 */
X`09INTX86(0x11, `26rg, `26rg);`09/* BIOS - GET EQUIPMENT LIST */
X
X`09/* Bits 4-5 in ax are:
X`09 *`0900 EGA, VGA or PGA
X`09 *`0901 40x25 color
X`09 *`0910 80x25 color
X`09 *`0911 80x25 monochrome
X`09 */
X`09if (((rg.x._AX_ `26 0x30) ==\0906) `7B
X`09`09monochrome = TRUE;
X`09`09return(CDMONO);
X`09`7D
X
X`09/*
X`09 * Test if EGA present
X`09 */
X`09rg.h.ah = 0x12;
X`09rg.h.bl = 0x10;
X`09INTX86(0x10,`26rg, `26rg);`09/* VIDEO - GET EGA INFO */
X
X`09if (rg.h.bl != 0x10) `7B`09/* function succeeded */
X`09`09egaexist = TRUE;
X`09`09return(CDEGA);
X`09`7D
X
X`09return (CDCGA);
X`7D
X
Xvoid
Xscwrite(`09`09/* write a line out*/
X`09int row,`09/* row of screen to place outstr on */
X`09int col,`09/* col of screen to place outstr on */
X`09int nchar,`09/* length of outstr */
X`09const char *outstr,  /* string to write out (must be term.t_ncol long) */
X`09VIDEO_ATTR *attrstr, /* attributes to write out (must be term.t_ncol long)
V */
X`09int forg,`09/* foreground color of string to write */
X`09int bacg)`09/* background color */
X`7B
X`09register USHORT *lnptr;`09/* pointer to the destination line */
X`09register int i;
X
X`09if (row > term.t_nrow-1)
X`09`09return;
X
X`09if (flickcode `26`26 (dtype == CDCGA))
X`09`09lnptr = sline;
X`09else
X`09`09lnptr = scptr`5Brow`5D+col;
X
X`09if (attrstr) `7B
X`09`09register USHORT attrnorm;
X`09`09register USHORT attrrev;
X#if`09OPT_COLOR
X`09`09if (ColorDisplay()) `7B
X`09`09`09attrnorm = AttrColor(bacg,forg) << 8;
X`09`09`09attrrev = AttrColor(forg,bacg) << 8;
X`09`09`7D else
X#endif
X`09`09`7B
X`09`09attrnorm = AttrMono(bacg<forg) << 8;
X`09`09attrrev = AttrMono(forg<bacg) << 8;
X`09`09`7D
X`09`09for (i = 0; i < nchar; i++) `7B
X`09`09`09*lnptr++ = ((outstr != 0)
X`09`09&0209? (outstr`5Bi+col`5D `26 0xff)
X`09`09&0209: SPACE) `7C ((attrstr`5Bi+col`5D `26 (VAREV`7CVASEL))
X`09`09&0209`09? attrrev
X`09`09&0209`09: attrnorm);
X`09`09`7D
X`09`7D else `7B
X`09`09register USHORT attr; /* attribute byte mask to place in RAM */
X`09`09/* build the attribute byte and setup the screen pointer */
X#if`09OPT_COLOR
X`09`09if (ColorDisplay())
X`09`09`09attr = AttrColor(bacg,forg);
X`09`09else
X#endif
X`09`09attr = AttrMono(bacg<forg);
X`09`09attr <<= 8;
X`09`09for (i = 0; i < nchar; i++) `7B
X`09`09`09*lnptr++ = ((outstr != 0)
X`09`09&0209? (outstr`5Bi+col`5D `26 0xff)
X`09`09&0209: SPACE) `7C attr;
X`09`09`7D
X`09`7D
X
X`09if (flickcode `26`26 (dtype == CDCGA)) `7B
X`09`09/* wait for vertical retrace to be off */
X`09`09while ((inp(0x3da) `26 8))
X`09`09`09;
X`09`09/* and to be back on */
X`09`09while ((inp(0x3da) `26 8) == 0)
X`09`09`09;
X`09`09/* and send the string out */
X`09`09movmem(sline, scptr`5Brow`5D+col, nchar*sizeof(short));
X`09`7D
X`7D
X
X/* reads back a line into a VIDEO struct, used in line-update computation */
XVIDEO *
Xscread(VIDEO *vp, int row)
X`7B
X`09register int`09i;
X
X`09if (row > term.t_nrow-1)
X`09`09return 0;
X
X`09if (vp == 0) `7B
X`09`09static`09VIDEO`09*mine;
X`09`09if (video_alloc(`26mine))
X`09`09`09vp = mine;
X`09`09else
X`09`09`09tidy_exit(BADEXIT);
X`09`7D
X`09movmem(scptr`5Brow`5D, `26sline`5B0`5D, term.t_ncol*sizeof(short));
X`09for (i = 0; i < term.t_ncol; i++)
X`09`09vp->v_text`5Bi`5D = sline`5Bi`5D;
X`09return vp;
X`7D
X
X/* returns attribute for blank/empty space */
Xstatic int
Xscblank(void)
X`7B
X`09register int attr;
X#if`09OPT_COLOR
X`09if (ColorDisplay())
X`09`09attr = AttrColor(gbcolor,gfcolor);
X`09else
X#endif
X`09 attr = AttrMono(TRUE);
X`09return attr;
X`7D
X
X/*
X * Move 'n' lines starting at 'from' to 'to'
X *
X * OPT_PRETTIER_SCROLL is prettier but slower -- it scrolls a line at a time
X *`09instead of all at once.
X */
Xvoid
Xibmscroll(int from, int to\0806n)
X`7B
X#if OPT_PRETTIER_SCROLL
X`09if (absol(from-to) > 1) `7B
X`09`09ibmscroll(from, (from < to) ? to-1 : to+1, n);
X`09`09if (from < to)
X`09`09`09from = to-1;
X`09`09else
X`09`09`09from = to+1;
X`09`7D
X#endif
X`09if (from > to) `7B
X`09`09rg.h.ah = 0x06;&0209/* scroll window up */
X`09`09rg.h.al = from - to;`09/* number of lines to scroll */
X`09`09rg.h.ch = to;&0209/* upper window row */
X`09`09rg.h.dh = from + n - 1;`09/* lower window row */
X`09`7D else `7B
X`09`09rg.h.ah = 0x07;&0209/* scroll window down */
X`09`09rg.h.al = to - from;`09/* number of lines to scroll */
X`09`09rg.h.ch = from;&0209/* upper window row */
X`09`09rg.h.dh = to + n - 1;`09/* lower window row */
X`09`7D
X`09rg.h.bh = scblank();`09/* attribute to use for line-fill */
X`09rg.h.cl = 0;`09`09/* left window column */
X`09rg.h.dl = term.t_ncol - 1; /* lower window column */
X`09INTX86(0x10, `26rg, `26rg);
X`7D
X
X
X/*--------\0808\1010\2020\400A*/
X
X#if OPT_MS_MOUSE
X
X/* Define translations between mouse (pixels) and chars (row/col).
X * patch: why does 8 by 8 work, not chr_high by chr_wide?
X */
X#define MS_CHAR_WIDE`09((term.t_ncol == 80) ? 8 : 16)
X#define MS_CHAR_HIGH    8
X
X#define`09pixels2col(x)   ((x)/MS_CHAR_WIDE)
X#define pixels2row(y)   ((y)/MS_CHAR_HIGH)
X
X#define col2pixels(x)   ((x)*MS_CHAR_WIDE)
X#define row2pixels(y)   ((y)*MS_CHAR_HIGH)
X
X/* Define a macro for calling mouse services */
X#define MouseCall INTX86(0x33, `26rg, `26rg)
X
X#define MS_MOVEMENT`09iBIT(0)`09/* mouse cursor movement */
X#define`09MS_BTN1_PRESS   iBIT(1)`09/* left button */
X#define MS_BTN1_RELEASE iBIT(2)
X#define MS_BTN2_PRESS   iBIT(3)`09/* right button */
X#define MS_BTN2_RELEASE iBIT(4)
X#define MS_BTN3_PRESS   iBIT(5)`09/* center button */
X#define MS_BTN3_RELEASE iBIT(6)
X
X#define BLINK 0x8000
X
X`09/* These have to be "far", otherwise TurboC doesn't force the
X`09 * segment register to be specified from 'ms_event_handler()'
X`09 */
Xint`09far`09button_pending;`09/* 0=none, 1=pressed, 2=released */
Xint`09far`09button_number;`09/* 1=left, 2=right, 3=center */
Xint`09far`09button_press_x;
Xint`09far`09button_press_y;
Xint`09far`09button_relsd_x;
Xint`09far`09button_relsd_y;
Xint`09`09rodent_exists;
Xint`09`09rodent_cursor_display;
X
X#if CC_TURBO
X#define`09MsButtonPending() button_p\1106
X#endif
X
X/*
X * If we're using a DPMI configuration, we'll not be able to use the mouse
X * event handler, since it relies on a call rather than an interrupt.  We can
V
X * do polling instead.
X */
X#if !CC_TURBO
Xstatic int
XMsButtonPending(void)
X`7B
X`09rg.x._AX_ = 3;`09/* query the mouse */
X`09MouseCall;
X
X`09if (rg.x._BX_ `26 7) `7B
X`09`09if (rg.x._BX_ `26 1)
X`09`09`09button_number = 1;
X`09`09else if (rg.x._BX_ `26 2)
X`09`09`09button_number = 2;
X`09`09else if (rg.x._BX_ `26 4)
X`09`09`09button_number = 3;
X
X`09`09button_press_x = \1107relsd_x = rg.x._CX_;
X`09`09button_press_y = \1107relsd_y = rg.x._DX_;
X`09`09button_pending = 1;
X
X`09`7D else `7B
X`09`09if (button_pending)
X`09`09`09button_pending = 2;
X`09`09button_relsd_x = rg.x._CX_;
X`09`09button_relsd_y = rg.x._DX_;
X`09`7D
X`09return button_pending;
X`7D
X#endif
X
Xint
Xms_exists (void)
X`7B
X`09return rodent_exists;
X`7D
X
Xvoid
Xms_processing (void)
X`7B
X`09WINDOW`09*wp;
X`09int`09copied = FALSE,
X`09`09invert, normal,
X`09`09first, first_x = ttcol\1108y = ttrow,
X`09`09last,  last_x  = ttcol\1208y = ttrow,
X`09`09that,  that_x\0908y,
X`09`09attr, delta;
X`09USHORT *s2page = s2ptr`5B0`5D;
X
X`09ms_showcrsr();
X`09while (MsButtonPending()) `7B
X`09`09if (button_pending == 2) `7B`09/* released? */
X`09`09`09button_pending = 0;
X`09`09`09break;
X`09`09`7D else `7B`09/* selection */
X
X#if CC_TURBO
X`09`09`09disable();
X`09`09`09that_x = button_relsd_x;
X`09`09`09that_y = button_relsd_y;
X`09`09`09enable();
X#else
X`09`09`09that_x = button_relsd_x;
X`09`09`09that_y = button_relsd_y;
X#endif
X
X`09`09`09if (!copied) `7B
X`09`09&0209int x = pixels2col(button_press_x);
X`09`09&0209int y = pixels2row(button_press_y);
X`09`09&0209wp = row2window(y);
X`09`09&0209/* Set the dot-location if button 1 was pressed
X`09`09&0209 * in a window.
X`09`09&0209 */
X`09`09&0209if (wp != 0
X`09`09&0209 `26`26 ttrow != term.t_nrow - 1
X`09`09&0209 `26`26 setcursor(y, x)) `7B
X`09`09&0209`09(void)update(TRUE);
X`09`09&0209`09ms_setvrange(wp->w_toprow,
X`09`09&0209&0209     mode_row(wp) - 1);
X`09`09&0209`7D else `7B`09/* cannot reposition */
X`09`09&0209`09kbd_alarm();
X`09`09&0209`09while (MsButtonPending() != 2)
X`09`09&0209&0209;
X`09`09&0209`09continue;
X`09`09&0209`7D
X`09`09&0209first_x = la\0907col2pixels(ttcol);
X`09`09&0209first_y = la\0907row2pixels(ttrow);
X`09`09&0209first = ms_crsr2inx(first_x, \0906y);
X
X`09`09&0209copy2nd(FALSE);
X`09`09&0209set_page(1);
X`09`09&0209copied = TRUE;
X
X`09`09&0209invert = vp2attr(vscreen`5Bttrow`5D,TRUE);
X`09`09&0209normal = vp2attr(vscreen`5Bttrow`5D,FALSE);
X`09`09`09`7D
X
X`09`09`09that  = ms_crsr2inx(that_x, that_y);
X`09`09`09last  = ms_crsr2inx(last_x, last_y);
X`09`09`09delta = (last < that) ? 1 : -1;
X
X`09`09`09if (that != last) `7B
X`09`09&0209register int j;
X`09`09&0209if (((last < that) `26`26 (\1106= first))
X`09`09&0209 `7C`7C ((last > that) `26`26 (\1106= first))) `7B
X`09`09&0209`09attr = normal;
X`09`09&0209`7D else `7B
X`09`09&0209`09attr = invert;
X`09`09&0209`7D
X#define HiLite(n,attr) s2page`5Bn`5D = attr `7C (\140A`26 0xff)
X
X`09`09&0209for (j = last; j != that; j += delta) `7B
X`09`09&0209`09if (j == first) `7B
X`09`09&0209&0209if (attr == normal) `7B
X`09`09&0209&0309attr = invert;
X`09`09&0209&0209`7D else `7B
X`09`09&0209&0309attr = normal;
X`09`09&0209&0209`7D
X`09`09&0209`09`7D
X`09`09&0209`09HiLite(j,attr);
X`09`09&0209`7D
X`09`09&0209HiLite(that,invert`7CBLINK);
X`09`09`09`7D
X`09`09`09last_x = that_x;
X`09`09`09last_y = that_y;
X`09`09`7D
X`09`7D
X
X`09/*
X`09 * If we've been highlighting the selection, finish it off.
X`09 */
X`09if (copied) `7B
X`09`09set_page(0);
X`09`09ms_setvrange(0, term.t_nrow-1);
X`09`09mlerase();
X`09`09setwmark(pixels2row(last_y), \1407col\1406x));
X`09`09if (DOT.l != MK.l
X`09`09 `7C`7C DOT.o != MK.o) `7B
X`09`09`09regionshape = EXACT;
X`09`09`09(void)yankregion();
X`09`09`09(void)update(TRUE);
X`09`09`7D
X`09`09movecursor(pixels2row(first_y), \1507col\1507x));
X`09`7D
X`7D
X
X/* translate cursor position (pixels) to array-index of the text-\2D09*/
Xstatic int
Xms_crsr2inx(int x, int y)
X`7B
X`09return pixels2col(x) + (\1107row(y) * term.t_ncol);
X`7D
X
Xstatic void
Xms_deinstall(void)
X`7B
X`09ms_hidecrsr();
X`09rg.x._AX_ = 0;`09/* reset the mouse */
X`09MouseCall;
X`09rodent_exists = FALSE;
X`7D
X
X`09/* This event-handler cannot do I/O; tracing it can be tricky...
X`09 */
X#if CC_TURBO
Xvoid far
Xms_event_handler (void)
X`7B
X`09UINT`09ms_event  = _AX;
X/*`09UINT`09ms_button = _BX;*/
X`09UINT`09ms_horz   = _CX;
X`09UINT`09ms_vert   = _DX;
X
X`09if (ms_event `26 MS_BTN1_PRESS) `7B
X`09`09button_pending = 1;
X`09`09button_number  = 1;
X`09`09button_press_x = \1107relsd_x = ms_horz;
X`09`09button_press_y = \1107relsd_y = ms_vert;
X`09`7D else `7B`09/* movement or release */
X`09`09if (ms_event `26 MS_BTN1_RELEASE)
X`09`09`09button_pending = 2;
X`09`09button_relsd_x = ms_horz;
X`09`09button_relsd_y = ms_vert;
X`09`7D
X`09return;
X`7D
X#endif
X
Xstatic void
Xms_hidecrsr(void)
X`7B
X`09/* Hides the mouse cursor if it is displayed */
X`09if (rodent_cursor_display) `7B
X`09`09rodent_cursor_display = FALSE;
X`09`09rg.x._AX_ = 0x02;
X`09`09MouseCall;
X`09`7D
X`7D /* End of ms_hidecrsr() */
X
Xstatic void
Xms_install(void)
X`7B
X`09if (rodent_exists)
X`09`09return;
X
X`09/* If a mouse is installed, initializes the \2406and
X`09 * sets rodent_exists to 1. If no mouse is installed,
X`09 * sets rodent_exists to 0.
X`09 */
X`09rg.x._AX_ = 0;
X`09MouseCall;
X`09rodent_exists = rg.x._AX_;
X`09rodent_cursor_display = FALSE; /* safest assumption */
X`09if (ms_exists()) `7B
X`09`09struct SREGS segs;
X
X`09`09memset(`26rg, 0, sizeof(rg));
X`09`09memset(`26segs, 0, sizeof(segs));
X
X`09`09rg.x._AX_ = 0x4;`09/* set mouse position */
X`09`09rg.x._CX_ = 0;
X`09`09rg.x._DX_ = 0;
X`09`09MouseCall;
X
X#if CC_TURBO
X`09`09rg.x._AX_ = 0xc;`09/* define event handler */
X`09`09rg.x._CX_ = MS_MOVEMENT `7C MS_BTN1_PRESS\100BRELEASE;
X`09`09rg.x._DX_ = FP_OFF(ms_event_handler);
X`09`09segs.es = FP_SEG(ms_event_handler);
X`09`09INTX86X(0x33, `26rg, `26rg, `26segs);
X#endif
X`09`7D
X`7D
X
Xstatic void
Xms_setvrange(int upperrow, int lowerrow)
X`7B
X`09/* Restricts vertical cursor movement to the screen region
X`09 * between upperrow and lowerrow.  If the cursor is outside the range,
X`09 * it is moved inside.
X`09 */
X`09rg.x._AX_ = 0x08;
X`09rg.x._CX_ = row2pixels(upperrow);
X`09rg.x._DX_ = row2pixels(lowerrow);
X`09MouseCall;
X`7D /* End of ms_setvrange() */
X
X
Xstatic void
Xms_showcrsr(void)
X`7B
X`09/* Displays the mouse cursor */
X`09int counter;
X
X`09/* Call Int 33H Function 2AH to get the value of the display counter */
X`09rg.x._AX_ = 0x2A;
X`09MouseCall;
X`09counter = rg.x._AX_;
X
X`09/* Call Int 33H Function 01H as many times as needed to display */
X`09/* the mouse cursor */
X`09while (counter-- > 0) `7B
X`09`09rg.x._AX_ = 0x01;
X`09`09MouseCall;
X`09`7D
X`09rodent_cursor_display = TRUE;
X`7D /* End of ms_showcrsr() */
X#endif /* OPT_MS_MOUSE */
$ call unpack [.VILE-8_0]IBMPC.C;1 -
 1396951799 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 75 49 152
$!
$ create 'f'
X/*`09INPUT:`09Various input routines for vile
X *`09`09written by Daniel Lawrence`095/9/86
X *`09`09variously munged/massaged/relayered/slashed/burned
X *`09`09`09since then. -pgf
X *
X *`09TTgetc()`09raw 8-bit key from terminal driver.
X *
X *`09sysmapped_c()`09single "keystroke" -- may have SPEC bit, if it was
X *`09`09`09a sytem-mapped function key.  calls TTgetc().  these
X *`09`09`09system-mapped keys will never map to a multi-char
X *`09`09`09sequence.  the routine does have storage, to hold
X *`09`09`09keystrokes gathered "in error".
X *
X *`09tgetc()`09`09fresh, pushed back, or recorded output of result of
X *`09`09`09sysmapped_c() (i.e. dotcmd and the keyboard macros
X *`09`09`09are recordedand played back at this level). \0E06is
X *`09`09`09only called from mapgetc() in map.c
X *
X *`09mapped_c()`09(map.c) worker routine which will return a \3606
X *`09`09`09or non-mapped character from the mapping engine.
X *`09`09`09determines correct map, and uses its own pushback
X *`09`09`09buffers on top of calls to tgetc() (see mapgetc/
X *`09`09`09mapungetc).
X *
X *`09mapped_keystroke() applies user-specified maps to user's input.
X *`09`09`09correct map used depending on mode (insert, command,
X *`09`09`09message-line).
X *
X *`09keystroke()`09returns pushback from mappings, the results of
X *`09`09`09previous calls to mapped_keystroke().
X *
X *`09keystroke8()`09as above, but masks off any "wideness", i.e. SPEC bits.
X *
X *`09keystroke_raw() as above, but recording is forced even if
X *`09`09`09sysmapped_c() returns intrc. (old "tgetc(TRUE)")
X *
X *`09kbd_seq()`09the vile prefix keys (`5EX,`5EA,#) are checked for, and
X *`09`09`09appropriate key pairs are turned into CTLA`7Cc, CTLX`7Cc,
X *`09`09`09SPEC`7Cc.
X *
X *
X *`09TTtypahead() `09  true if a key is avail from TTgetc().
X *`09sysmapped_c_avail() "  if a key is avail from \2E0B() or below.
X *`09tgetc_avail()     true if a key is avail from tgetc() or below.
X *`09keystroke_avail() true if a key is avail from key\2E06() or below.
X *
X * $Header: /usr/build/vile/vile/RCS/input.c,v 1.183 1998/05/12 23:33:03 kev E
Vxp $
X *
X */
X
X#include`09"estruct.h"
X#include`09"edef.h"
X#include`09"nefunc.h"
X
X#define`09DEFAULT_REG`09-1
X
X#define INFINITE_LOOP_COUNT 1200
X
Xtypedef`09struct`09_kstack`09`7B
X`09struct`09_kstack`09*m_link;
X`09int`09m_save;`09`09/* old value of 'kbdmode'&0209*/
X`09int`09m_indx;`09`09/* index identifying this macro&0209*/
X`09int`09m_rept;`09`09/* the number of times to execute the macro */
X`09ITBUFF  *m_kbdm;`09`09/* the macro-text to execute&0209*/
X`09ITBUFF  *m_dots;`09`09/* workspace for "." command&0209*/
X#ifdef GMDDOTMACRO
X`09ITBUFF  *m_DOTS;`09`09/* save-area for "." command&0209*/
X`09int`09m_RPT0;`09`09/* saves 'dotcmdcnt'&0209`09*/
X`09int`09m_RPT1;`09`09/* saves 'dotcmdrep'&0209`09*/
X#endif
X`09`7D KSTACK;
X
X/*--------\0808\1010\2020\400A*/
X
X/*
X * FIXME:
X * Special hacks to convert null-terminated string to/from TBUFF, for interfac
Ve
X * with functions that still expect these.
X */
X#define StrToBuff(buf) (buf)->tb_used = strlen(tb_values(buf))
X#define BuffToStr(buf) tb_values(buf)`5Btb_length(buf)`5D = EOS
X
X/*--------\0808\1010\2020\400A*/
Xstatic`09void`09finish_kbm (void);
X
Xstatic`09KSTACK *KbdStack;`09/* keyboard/@-macros that are replaying */
Xstatic`09ITBUFF  *KbdMacro;`09/* keyboard macro, recorded`09*/
Xstatic`09int`09last_eolchar;`09/* records last \1907-match in 'kbd_string' */
V
X
X/*--------\0808\1010\2020\400A*/
X
X/*
X * Returns a pointer to the buffer that we use for saving text to replay with
V
X * the "." command.
X */
Xstatic ITBUFF *
XTempDot(int init)
X`7B
X`09static`09ITBUFF  *tmpcmd;`09/* dot commands, 'til we're sure */
X
X`09if (kbdmode == PLAY) `7B
X`09`09if (init)
X`09`09`09(void)itb_init(`26(KbdStack->m_dots), abortc);
X`09`09return KbdStack->m_dots;
X`09`7D
X`09if (init `7C`7C (tmpcmd == 0))
X`09`09(void)itb_init(`26tmpcmd, abortc);
X`09return tmpcmd;
X`7D
X
X/*
X * Dummy function to use when 'kbd_string()' does not handle automatic complet
Vion
X */
X/*ARGSUSED*/
Xint
Xno_completion(int c GCC_UNUSED, char *buf\160Dunsigned *pos\300B)
X`7B
X`09return FALSE;
X`7D
X
X/*
X * Complete names in a shell command using the filename-completion.  We'll hav
Ve
X * to scan back to the beginning of the appropriate name since that module
X * expects only one name in a buffer.
X *
X * We only do shell-completion if filename\170Ds configured.
X */
X#if COMPLETE_FILES
Xint
Xshell_complete(
Xint`09c,
Xchar`09*buf,
Xunsigned *pos)
X`7B
X`09int status;
X`09unsigned len = *pos;
X`09int base;
X`09int first = 0;
X
X`09TRACE(("shell_complete %d:'%s'`5Cn", *pos, buf))
X`09if (isShellOrPipe(buf))
X`09`09first++;
X
X`09for (base = len; base > first; ) `7B
X`09`09base--;
X`09`09if (isSpace(buf`5Bbase`5D)) `7B
X`09`09`09base++;
X`09`09`09break;
X`09`09`7D else if (buf`5Bbase`5D == '$') `7B
X`09`09`09break;
X`09`09`7D
X`09`7D
X`09len -= base;
X`09status = path_completion(c, buf+base, `26len);
X`09*pos = len + base;
X
X`09return status;
X`7D
X#endif
X
X/*
X * Ask a yes or no question in the message line. Return either TRUE, FALSE, or
V
X * ABORT. The\0B06 status is returned if the user bumps out o\1606question
X * with an abortc. Used any time a confirmation is required.
X */
X
Xint
Xmlyesno(const char *prompt)
X`7B
X`09char c; `09`09/* input character */
X
X`09/* in case this is right after a shell escape */
X`09if (!update(TRUE))
X`09`09return (ABORT);
X
X`09for_ever `7B
X`09`09mlforce("%s `5By/n`5D? ",prompt);
X`09`09c = (char)keystroke();`09/* get the response */
X
X`09`09if (ABORTED(c))&0209/* Bail out! */
X`09`09`09return(ABORT);
X
X`09`09if (c=='y' `7C`7C c=='Y')
X`09`09`09return(TRUE);
X
X`09`09if (c=='n' `7C`7C c=='N')
X`09`09`09return(FALSE);
X`09`7D
X`7D
X
X/*
X * Ask a simple question in the message line. Retur\1906single char response,
V
X *  if it was one of the valid responses.
X */
X
Xint
Xmlquickask(const char *prompt, c\140Brespchars, int *cp)
X`7B
X`09if (!update(TRUE))
X`09`09return (ABORT);
X
X`09for_ever `7B
X`09`09mlforce("%s ",prompt);
X`09`09*cp = keystroke();`09/* get the response */
X
X`09`09if (ABORTED(*cp))`09/* Bail out! */
X`09`09`09return(ABORT);
X
X`09`09if (strchr(respchars,*cp))
X`09`09`09return TRUE;
X
X`09`09kbd_alarm();
X`09`7D
X`7D
X
X/*
X * Prompt for a named-buffer (i.e., "register")
X */
Xint
Xmlreply_reg(
Xconst char *prompt,
Xchar`09*cbuf,`09`09/* 2-char buffer for register+eol */
Xint`09*retp,`09`09/* => the register-name */
Xint`09at_dft)`09`09/* default-value (e.g., for "@@" command) */
X`7B
X`09register int status;
X`09register int c;
X
X`09if (clexec `7C`7C isnamedcmd) `7B
X`09`09if ((status = mlreply(prompt, cbuf, 2)) != TRUE)
X`09`09`09return status;
X`09`09c = cbuf`5B0`5D;
X`09`7D else `7B
X`09`09c = keystroke();
X`09`09if (ABORTED(c))
X`09`09`09return ABORT;
X`09`7D
X
X`09if (c == '@' `26`26 at_dft != -1) `7B
X`09`09c = at_dft;
X`09`7D else if (reg2index(c) < 0) `7B
X`09`09mlwarn("`5BInvalid register name`5D");
X`09`09return FALSE;
X`09`7D
X
X`09*retp = c;
X`09return TRUE;
X`7D
X
X/*
X * Prompt for a register-name and/or line-count (e.g., for the ":yank" and
X * ":put" commands).  The register-name, if given, is first.
X */
Xint
Xmlreply_reg_count(
Xint`09state,`09`09/* negative=register, positive=count, zero=either */
Xint`09*retp,`09`09/* returns the register-index or line-count */
Xint`09*next)`09`09/* returns 0/1=register, 2=count */
X`7B
X`09register int status;
X`09char`09prompt`5B80`5D;
X`09char`09expect`5B80`5D;
X`09char`09buffer`5B10`5D;
X`09int`09length;
X
X`09*expect = EOS;
X`09if (state <= 0)
X`09`09(void)strcat(expect, " register");
X`09if (state == 0)
X`09`09(void)strcat(expect, " or");
X`09if (state >= 0) `7B
X`09`09(void)strcat(expect, " line-count");
X`09`09length = sizeof(buffer);
X`09`7D else
X`09`09length = 2;
X
X`09(void)lsprintf(prompt, "Specify%s: ", expect);
X`09*buffer = EOS;
X`09status = kbd_string(prompt, buffer, length, ' ', 0, no_completion);
X
X`09if (status == TRUE) `7B
X`09`09if (state <= 0
X`09`09 `26`26 isAlpha(buffer`5B0`5D)
X`09`09 `26`26 buffer`5B1`5D == EOS
X`09`09 `26`26 (*retp = reg2index(*buffer)) >= 0) `7B
X`09`09`09*next = isUpper(*buffer) ? 1 : 0;
X`09`09`7D else if (state >= 0
X`09`09 `26`26 string_to_number(buffer, retp)
X`09`09 `26`26 *retp) `7B
X`09`09`09*next = 2;
X`09`09`7D else `7B
X`09`09`09mlforce("`5BExpected%s`5D", expect);
X`09`09`09kbd_alarm();
X`09`09`09status = ABORT;
X`09`09`7D
X`09`7D
X`09return status;
X`7D
X
X/*
X * Write a prompt into the message line, then read back a response. Keep
X * track of the physical position\1908cursor. If we are in a keyboard
X * macro throw the prompt away, and return the remembered response. This
X * lets macros run at full speed. The reply is always terminated by a carriage
V
X * return. Handle erase, kill, and abort keys.
X */
X
Xint
Xmlreply(const char *prompt,\0E07buf, int bufn)
X`7B
X`09return kbd_string(prompt, buf, bufn, '`5Cn', KBD_NORMAL, no_completion);
X`7D
X
X/* as above, but don't do anything to backslashes */
Xint
Xmlreply_no_bs(const char *prompt,\0E07buf, int bufn)
X`7B
X#if COMPLETE_FILES
X`09init_filec(FILECOMPLETION_BufName);
X#endif
X`09return kbd_string(prompt, buf, bufn, '`5Cn', KBD_EXPAND`7CKBD_SHPIPE, shell
V_complete);
X`7D
X
X/* as above, but neither expand nor do anything to backslashes */
Xint
Xmlreply_no_opts(const char *prompt,\0E07buf, int bufn)
X`7B
X`09return kbd_string(prompt, buf, bufn, '`5Cn', 0, no_completion);
X`7D
X
X
X/* the numbered buffer names increment each time they are referenced */
Xvoid
Xincr_dot_kregnum(void)
X`7B
X`09if (dotcmdmode == PLAY) `7B
X`09`09register int`09c = itb_peek(dotcmd);
X`09`09if (isDigit(c) `26`26 c < '9')
X`09`09`09itb_stuff(dotcmd, ++c);
X`09`7D
X`7D
X
X/*
X * Record a character for "." commands
X */
Xstatic void
Xrecord_dot_char(int c)
X`7B
X`09if (dotcmdmode == RECORD) `7B
X`09`09ITBUFF`09*tmp = TempDot(FALSE);
X`09`09(void)itb_append(`26tmp, c);
X`09`7D
X`7D
X
X/*
X * Record a character for kbd-macros
X */
Xstatic void
Xrecord_kbd_char(int c)
X`7B
X`09if (dotcmdmode != PLAY `26`26 kb\1306== RECORD)
X`09`09(void)itb_append(`26KbdMacro, c);
X`7D
X
X/* if we should preserve this input, do so */
Xstatic void
Xrecord_char(int c)
X`7B
X`09record_dot_char(c);
X`09record_kbd_char(c);
X`7D
X
X/* get the next character of a replayed '.' or macro */
Xint
Xget_recorded_char(
Xint eatit)  /* consume the character? */
X`7B
X`09register int`09c = -1;
X`09register ITBUFF`09*buffer;
X
X`09if (dotcmdmode == PLAY) `7B
X
X`09`09if (interrupted()) `7B
X`09`09`09dotcmdmode = STOP;
X`09`09`09return intrc;
X`09`09`7D else `7B
X
X`09`09`09if (!itb_more(buffer = dotcmd)) `7B
X`09`09&0209if (!eatit) `7B
X`09`09&0209`09if (dotcmdrep > 1)
X`09`09&0209&0209return itb_get(buffer, 0);
X`09`09&0209`7D else `7B /* at the end of last repetition?  */
X`09`09&0209`09if (--dotcmdrep < 1) `7B
X`09`09&0209&0209dotcmdmode = STOP;
X`09`09&0209&0209(void)dotcmdbegin();
X`09`09&0209&0209/* immediately start recording
X`09`09&0209&0209 * again, just in case.
X`09`09&0209&0209 */
X`09`09&0209`09`7D else `7B
X`09`09&0209&0209/* reset the macro to the
X`09`09&0209&0209 * beginning for the next rep.
X`09`09&0209&0209 */
X`09`09&0209&0209itb_first(buffer);
X`09`09&0209`09`7D
X`09`09&0209`7D
X`09`09`09`7D
X
X`09`09`09/* if there is some left... */
X`09`09`09if (itb_more(buffer)) `7B
X`09`09&0209if (eatit)
X`09`09&0209`09c = itb_next(buffer);
X`09`09&0209else
X`09`09&0209`09c = itb_peek(buffer);
X`09`09&0209return c;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X
X`09if (kbdmode == PLAY) `7B /* if we are playing a keyboard macro back, */
X
X`09`09if (interrupted()) `7B
X`09`09`09while (kbdmode == PLAY)
X`09`09&0209finish_kbm();
X`09`09`09return intrc;
X`09`09`7D else `7B
X
X`09`09`09if (!itb_more(buffer = KbdStack->m_kbdm)) `7B
X`09`09&0209if (--(KbdStack->m_rept) >= 1)
X`09`09&0209`09itb_first(buffer);
X`09`09&0209else
X`09`09&0209`09finish_kbm();
X`09`09`09`7D
X
X`09`09`09if (kbdmode == PLAY) `7B
X`09`09&0209buffer = KbdStack->m_kbdm;
X`09`09&0209if (eatit)
X`09`09&0209`09record_dot_char(c = itb_next(buffer));
X`09`09&0209else
X`09`09&0209`09c = itb_peek(buffer);
X`09`09`09`7D
X`09`09`7D
X`09`7D
X
X`09return c;
X`7D
X
Xvoid
Xunkeystroke(int c)
X`7B
X`09mapungetc(c`7CNOREMAP);
X`7D
X
Xint
Xmapped_keystroke(void)
X`7B
X`09return lastkey = mapped_c(DOMAP,NOQUOTED);
X`7D
X
Xint
Xkeystroke(void)
X`7B
X`09return lastkey = mapped_c(NODOMAP,NOQUOTED);
X`7D
X
Xint
Xkeystroke8(void)
X`7B
X`09int c;
X`09for_ever `7B
+-+-+-+-+-+-+-+-  END  OF PART 60 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 61 -+-+-+-+-+-+-+-+
X`09`09c = mapped_c(NODOMAP,NOQUOTED);
X`09`09if ((c `26 `7E0xff) == 0)
X`09`09`09return lastkey = c;
X`09`09kbd_alarm();
X`09`7D
X`7D
X
Xint
Xkeystroke_raw8(void)
X`7B
X`09int c;
X`09for_ever `7B
X`09`09c = mapped_c(NODOMAP,QUOTED);
X`09`09if ((c `26 `7E0xff) == 0)
X`09`09`09return lastkey = c;
X`09`09kbd_alarm();
X`09`7D
X`7D
X
Xstatic int
Xmapped_keystroke_raw(void)
X`7B
X`09return lastkey = mapped_c(DOMAP,QUOTED);
X`7D
X
X
Xint
Xkeystroke_avail(void)
X`7B
X`09return mapped_c_avail();
X`7D
X
Xstatic ITBUFF *tgetc_ungottenchars = NULL;
Xstatic int tgetc_ungotcnt = 0;
X
Xvoid
Xtungetc(int c)
X`7B
X`09(void)itb_append(`26tgetc_ungottenchars, c);
X`09tgetc_ungotcnt++;
X`7D
X
Xint
Xtgetc_avail(void)
X`7B
X`09return tgetc_ungotcnt > 0 `7C`7C
X`09`09get_recorded_char(FALSE) != -1 `7C`7C
X`09`09sysmapped_c_avail();
X`7D
X
Xint
Xtgetc(int quoted)
X`7B
X`09register int c;`09/* fetched character */
X
X`09if (tgetc_ungotcnt > 0) `7B
X`09    tgetc_ungotcnt--;
X`09    return itb_last(tgetc_ungottenchars);
X`09`7D
X
X`09if ((c = get_recorded_char(TRUE)) == -1) `7B
X`09`09/* fetch a character from the terminal driver */
X`09`09not_interrupted();
X`09`09if (setjmp(read_jmp_buf)) `7B
X`09`09`09c = kcod2key(intrc);
X    `09`09`09TRACE(("setjmp/getc:%c (%#x)`5Cn", c, c))
X#if defined(linux) `26`26\1209DISP_TERMCAP)
X`09`09`09/*
X`09`09`09 * Linux bug (observed with kernels 1.2.13 `26 2.0.0):
X`09`09`09 * when interrupted, the _next_ character that
X`09`09`09 * getchar() returns will be the same as the last
X`09`09`09 * character before the interrupt.  Eat it.
X`09`09`09 */
X`09`09`09(void)ttgetc();
X#endif
X`09`09`7D else `7B
X`09`09`09(void) im_waiting(TRUE);
X`09`09`09do `7B /* if it's sysV style signals,
X`09`09&0209 we want to try again, since this
X`09`09&0209 must not have been SIGINT, but
X`09`09&0209 was probably SIGWINCH */
X`09`09&0209c = sysmapped_c();
X`09`09`09`7D while (c == -1);
X`09`09`7D
X`09`09(void) im_waiting(FALSE);
X`09`09if (quoted `7C`7C ((UINT) c != kcod2key(intrc)))
X`09`09`09record_char(c);
X`09`7D
X
X`09/* and finally give the char back */
X`09return c;
X`7D
X
X
X/*`09KBD_SEQ:`09Get a command sequence (multiple keystrokes) from
X`09`09the keyboard.
X`09`09Process all applicable prefix keys.
X`09`09Set lastcmd for commands which want stuttering.
X*/
Xint
Xkbd_seq(void)
X`7B
X`09int c;`09`09/* fetched keystroke */
X
X`09int prefix = 0;`09/* accumulate\1A08*/
X
X`09c = mapped_keystroke();
X
X`09if (c == cntl_a) `7B
X`09`09prefix = CTLA;
X`09`09c = keystroke();
X`09`7D else if (c == cntl_x) `7B
X`09`09prefix = CTLX;
X`09`09c = keystroke();
X`09`7D else if (c == poundc) `7B
X`09`09prefix = SPEC;
X`09`09c = keystroke();
X`09`7D
X
X`09c `7C= prefix;
X
X`09/* otherwise, just return it */
X`09return (lastcmd = c);
X`7D
X
X/*
X * Get a command-key, suppressing the mapping
X */
Xint
Xkbd_seq_nomap(void)
X`7B
X`09unkeystroke(\0A0A));
X`09return kbd_seq();
X`7D
X
X/* get a string consisting of inclchartype characters from the current
X`09position.  if inclchartype is 0, return everything to eol */
Xint
Xscreen_string (char *buf, int bufn, CHARTYPE inclchartype)
X`7B
X`09register int i = 0;
X`09MARK mk;
X
X`09mk = DOT;
X
X`09/* if from gototag(), grab\1506the beginning of the string */
X`09if (b_val(curbp, MDTAGWORD)
X`09 `26`26 inclchartype == _ident
X`09 `26`26 DOT.o > 0
X`09 `26`26 istype(inclchartype, char_at(DOT))) `7B
X`09`09while ( DOT.o > 0 ) `7B
X`09`09`09DOT.o--;
X`09`09`09if ( !istype(inclchartype, char_at(DOT)) ) `7B
X`09`09&0209DOT.o++;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09while ( i < (bufn-1) `26`26 !is_at_end_of_line(DOT)) `7B
X`09`09buf`5Bi`5D = char_at(DOT);
X#if OPT_WIDE_CTYPES
X`09`09if (i == 0) `7B
X`09`09`09if (inclchartype `26 _scrtch) `7B
X`09`09&0209if (buf`5B0`5D != SCRTCH_LEFT`5B0`5D)
X`09`09&0209`09inclchartype `26= `7E_scrtch;
X`09`09`09`7D
X`09`09`09if (inclchartype `26 _shpipe) `7B
X`09`09&0209if (buf`5B0`5D != SHPIPE_LEFT`5B0`5D)
X`09`09&0209`09inclchartype `26= `7E_shpipe;
X`09`09`09`7D
X`09`09`7D
X
X`09`09/* allow "`5B!command`5D" */
X`09`09if ((inclchartype `26 _scrtch)
X`09`09 `26`26 (i == 1)
X`09`09 `26`26 (buf`5B1`5D == SHPIPE_LEFT`5B0`5D)) `7B
X`09`09`09/*EMPTY*/;
X`09`09/* guard against things like "`5BBuffer List`5D" on VMS */
X`09`09`7D else if ((inclchartype `26 _pathn)
X`09`09 `26`26 !ispath(buf`5Bi`5D)
X`09`09 `26`26 (inclchartype == _pathn)) `7B
X`09`09`09break;
X`09`09`7D else
X#endif
X`09`09if (inclchartype `26`26 !istype\180D, buf`5Bi`5D))
X`09`09`09break;
X`09`09DOT.o++;
X`09`09i++;
X#if OPT_WIDE_CTYPES
X`09`09if (inclchartype `26 _scrtch) `7B
X`09`09`09if ((i < bufn)
X`09`09`09 `26`26 (inclchartype `26 _pathn)
X`09`09`09 `26`26 ispath(char_at(DOT)))
X`09`09&0209continue;
X`09`09`09if (buf`5Bi-1`5D == SCRTCH_RIGHT`5B0`5D)
X`09`09&0209break;
X`09`09`7D
X#endif
X`09`7D
X
X#if OPT_WIDE_CTYPES
X#if OPT_VMS_PATH
X`09if (inclchartype `26 _pathn) `7B
X`09`09;`09/* override conflict with "`5B`5D" */
X`09`7D else
X#endif
X`09if (inclchartype `26 _scrtch) `7B
X`09`09if (buf`5Bi-1`5D != SCRTCH_RIGHT`5B0`5D)
X`09`09`09i = 0;
X`09`7D
X#endif
X
X`09buf`5Bi`5D = EOS;
X`09DOT = mk;
X
X`09return buf`5B0`5D != EOS;
X`7D
X
X/*
X * Returns the character that ended the last call on 'kbd_string()'
X */
Xint
Xend_string(void)
X`7B
X`09return last_eolchar;
X`7D
X
Xvoid
Xset_end_string(int c)
X`7B
X`09last_eolchar = c;
X`7D
X
X/*
X * Returns an appropriate delimiter for /-commands, based on the end of the
X * last reply.  That is, in a command such as
X *
X *`09:s/first/last/
X *
X * we will get prompts for
X *
X *`09:s/`09/-delimiter saved in 'end_string()'
X *`09first/
X *`09last/
X *
X * If a newline is used at any stage, subsequent delimiters are forced to a
X * newline.
X */
Xint
Xkbd_delimiter(void)
X`7B
X`09register int`09c = '`5Cn';
X
X`09if (isnamedcmd) `7B
X`09`09register int`09d = end_string();
X`09`09if (isPunct(d))
X`09`09`09c = d;
X`09`7D
X`09return c;
X`7D
X
X/*
X * Make sure that the buffer will have extra space when passing it to function
Vs
X * that don't know it's a TBUFF.
X */
Xstatic char *
Xtbreserve(TBUFF **buf)
X`7B
X`09char *result = tb_values(tb_alloc(buf, tb_length(*buf) + NSTRING));
X`09BuffToStr(*buf);
X`09return result;
X`7D
X
X#define BACKSLASH '`5C`5C'
X
X/* turn `5CX into X */
Xstatic void
Xremove_backslashes(TBUFF *buf)
X`7B
X`09register char *cp = tb_values(buf);
X`09register ALLOC_T s, d;
X
X`09for (s = d = 0; s < tb_length(buf); ) `7B
X`09`09if (cp`5Bs`5D == BACKSLASH)
X`09`09`09s++;
X`09`09cp`5Bd++`5D = cp`5Bs++`5D;
X`09`7D
X
X`09buf->tb_used = d;
X`7D
X
X/* count backslashes so we can tell at any point whether we have the current
X * position escaped by one.
X */
Xstatic UINT
XcountBackSlashes(TBUFF * buf, UINT len)
X`7B
X`09char *buffer = tb_values(buf);
X`09register UINT`09count;
X
X`09if (len `26`26 buffer`5Blen-1`5D == BACKSLASH) `7B
X`09`09count = 1;
X`09`09while (count+1 <= len `26`26
X`09`09`09buffer`5Blen-1-count`5D == BACKSLASH)
X`09`09`09count++;
X`09`7D else `7B
X`09`09count = 0;
X`09`7D
X`09return count;
X`7D
X
Xstatic void
XshowChar(int c)
X`7B
X`09if (disinp) `7B
X`09`09int`09save_expand = kbd\0D07;
X`09`09kbd_expand = 1;`09/* show all controls */
X`09`09kbd_putc(c);
X`09`09kbd_expand = save\0E07;
X`09`7D
X`7D
X
Xstatic void
Xshow1Char(int c)
X`7B
X`09if (disinp) `7B
X`09`09showChar(c);
X`09`09kbd_flush();
X`09`7D
X`7D
X
X/*
X * Macro result is true if the buffer is a normal :-command with a leading "!"
V,
X * or is invoked from one of the places that supplies an implicit "!" for shel
Vl
X * commands.
X */
X#define editingShellCmd(buf,options) `5C
X`09 (((options `26 KBD_EXPCMD) `26`26 isShellOrPipe(buf)) `5C
X`09`7C`7C (options `26 KBD_SHPIPE))
X
X/* expand a single character (only used on interactive input) */
Xstatic int
XexpandChar(
XTBUFF **buf,
Xunsigned * position,
Xint`09c,
XUINT`09options)
X`7B
X`09register int`09cpos = *position;
X`09register char *`09cp;
X`09register BUFFER *bp;
X`09char str`5BNFILEN`5D;
X`09char *buffer = tb_values(*buf);
X`09int  shell = editingShellCmd(buffer,options);
X`09int  expand = ((options `26 KBD_EXPAND) `7C`7C shell);
X`09int  exppat = (options `26 KBD_EXPPAT);
X
X`09/* Are we allowed to expand anything? */
X`09if (!(expand `7C`7C exppat &027C shell))
X`09 `09return FALSE;
X
X`09/* Is this a character that we know about? */
X`09if (strchr(global_g_val_ptr(GVAL_EXPAND_CHARS),c) == 0)
X`09`09return FALSE;
X
X`09switch (c)
X`09`7B
X`09case EXPC_THIS:
X`09case EXPC_THAT:
X`09`09if (!expand)
X`09`09`09return FALSE;
X
X`09`09bp = (c == EXPC_THIS) ? curbp : find_alt();
X`09`09if (bp == 0 `7C`7C b_is_invisible(bp)) `7B
X`09`09`09kbd_alarm();`09/* complain a little */
X`09`09`09return FALSE;`09/* ...and let the user type it as-is */
X`09`09`7D
X
X`09`09cp = bp->b_fname;
X`09`09if (isInternalName(cp)) `7B
X`09`09`09cp = bp->b_bname;
X`09`09`7D else if (!global_g_val(GMDEXPAND_PATH)) `7B
X`09`09`09cp = shorten_path(strcpy(str, cp), FALSE);
X#if OPT_MSDOS_PATH
X`09`09`09/* always use backslashes if invoking external prog */
X`09`09`09if (shell)
X`09`09&0209cp = SL_TO_BSL(cp);
X#endif
X`09`09`7D
X
X`09`09break;
X
X`09case EXPC_TOKEN:
X`09`09if (!expand)
X`09`09`09return FALSE;
X
X`09`09if (screen_string(str, sizeof(str), _pathn))
X`09`09`09cp = str;
X`09`09else
X`09`09`09cp = NULL;
X
X`09`09break;
X
X`09case EXPC_RPAT:
X`09`09if (!exppat)
X`09`09`09return FALSE;
X
X`09`09if (rpat`5B0`5D)
X`09`09`09cp = rpat;
X`09`09else
X`09`09`09cp = NULL;
X
X`09`09break;
X
X`09case EXPC_SHELL:
X`09`09if (!shell)
X`09`09`09return FALSE;
X
X#ifdef only_expand_first_bang
X`09`09/* without this check, do as vi does -- expand '!'
X`09`09   to previous command anywhere it's typed */
X`09`09if (cpos > (buffer`5B0`5D == '!'))
X`09`09`09return FALSE;
X#endif
X`09`09cp = tb_values(save_shell`5B!isShellOrPipe(buffer)`5D);
X`09`09if (cp != NULL `26`26 isShellOrPipe(cp))
X`09`09`09cp++;`09/* skip the '!' */
X`09`09break;
X
X`09default:
X`09`09return FALSE;
X`09`7D
X
X`09if (cp != NULL) `7B
X`09`09while ((c = *cp++) != EOS) `7B
X`09`09`09tb_insert(buf, cpos++, c);
X`09`09`09showChar(c);
X`09`09`7D
X`09`09kbd_flush();
X`09`7D
X`09*position = cpos;
X`09return TRUE;
X`7D
X
X/*
X * Returns true for the (presumably control-chars) that we us\2F06line edits
X */
Xint
Xis_edit_char(int c)
X`7B
X`09return (is\0A06(c)
X`09  `7C`7C`09isbackspace(c)
X`09  `7C`7C`09(c == wkillc)
X`09  `7C`7C`09(c == killc));
X`7D
X
X/*
X * Erases the response from the screen for 'kbd_string()'
X */
Xvoid
Xkbd_kill_response(TBUFF * buffer, unsigned * position, int c)
X`7B
X`09char *buf = tb_values(buffer);
X`09TBUFF`09*tmp = 0;
X`09int`09cpos = *position;
X`09UINT`09mark = cpos;
X
X`09tmp = tb_copy(`26tmp, buffer);
X`09while (cpos > 0) `7B
X`09`09cpos--;
X`09`09kbd_erase();
X`09`09if (c == wkillc) `7B
X`09`09`09if (!isSpace(buf`5Bcpos`5D)) `7B
X`09`09&0209if (cpos > 0 `26`26 isSpace(buf`5Bcpos-1`5D))
X`09`09&0209`09break;
X`09`09`09`7D
X`09`09`7D
X
X`09`09if (c != killc `26`26 c != wkillc)
X`09`09`09break;
X`09`7D
X`09if (disinp)
X`09`09kbd_flush();
X
X`09*position = cpos;
X`09buffer->tb_used = cpos;
X`09if (mark < tb_length(tmp)) `7B
X`09`09tb_bappend(`26buffer, tb_values(tmp)+mark, tb_length(tmp)-mark);
X`09`7D
X`09(void)tb_free(`26tmp);
X`7D
X
X/*
X * Display the default response for 'kbd_string()', escaping backslashes if
X * necessary.
X */
Xint
Xkbd_show_response(
XTBUFF`09**dst,`09`09/* string with escapes */
Xchar`09*src,`09`09/* string w/o escapes */
Xunsigned bufn,`09`09/* # of chars we read from 'src`5B`5D' */
Xint`09eolchar,
XUINT`09options)
X`7B
X`09register unsigned k;
X
X`09/* add backslash escapes in front of volatile characters */
X`09tb_init(dst, 0);
X
X`09for (k = 0; k < bufn; k++) `7B
X`09`09register int c = src`5Bk`5D;
X
X`09`09if ((c == BACKSLASH) `7C`7C (c == eolchar `26`26\0B09!= '`5Cn')) `7B
X`09`09`09if (options `26 KBD_QUOTES)
X`09`09&0209tb_append(dst, BACKSLASH); /* add extra */
X`09`09`7D else if (strchr(global_g_val_ptr(GVAL_EXPAND_CHARS),c) != 0) `7B
X`09`09`09if (c == EXPC_RPAT `26`26 !(options `26 KBD_EXPPAT))
X`09`09&0209/*EMPTY*/;
X`09`09`09else if (c == EXPC_SHELL `26`26 !(options `26 KBD_SHPIPE))
X`09`09&0209/*EMPTY*/;
X`09`09`09else if ((options `26 KBD_QUOTES)
X`09`09`09 `26`26 (options `26 KBD_EXPAND))
X`09`09&0209tb_append(dst, BACKSLASH); /* add extra */
X`09`09`7D
X`09`09tb_append(dst, c);
X`09`7D
X
X`09/* put out the default response, which is in the buffer */
X`09kbd_init();
X`09for (k = 0; k < tb_length(*dst); k++) `7B
X`09`09showChar(tb_values(*dst)`5Bk`5D);
X`09`7D
X`09if (disinp)
X`09`09kbd_flush();
X`09return tb_length(*dst);
X`7D
X
X/* default function for 'edithistory()' */
Xint
X/*ARGSUSED*/
Xeol_history(const char * buffer GCC_UNUSED, unsigned cpos\1A0Dint c\0706eolcha
Vr)
X`7B
X`09if (isPrint(eolchar) `7C`7C \0C07 == '`5Cr') `7B
X`09`09if (c == eolchar `7C`7C (\0C08== '`5Cr' `26`26 c == '`5Cn'))
X`09`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X
X/*
X * Store a one-level push-back of the shell command text. This allows simple
X * prompt/substitution of shell commands, while keeping the "!" and text
X * separate for the command decoder.
X */
Xstatic`09int`09pushed_back;
Xstatic`09int`09pushback_flg;
Xstatic`09const char * pushback_ptr;
X
Xvoid
Xkbd_pushback(TBUFF *buf, int skip)
X`7B
X`09static`09TBUFF`09*PushBack;
X`09char *buffer = tb_values(buf);`09/* FIXME */
X
X`09TRACE(("kbd_pushback(%s,%d)`5Cn", tb_visible(buf), skip))
X`09if (macroize(`26PushBack, buf, skip)) `7B
X`09`09pushed_back  = TRUE;
X`09`09pushback_flg = clexec;
X`09`09pushback_ptr = execstr;
X`09`09clexec       = TRUE;
X`09`09execstr      = tb_values(PushBack);
X`09`09buffer`5Bskip`5D = EOS;
X`09`09buf->tb_used = skip;
X`09`7D
X`7D
X
Xint
Xkbd_is_pushed_back(void)
X`7B
X`09return clexec `26`26 pushed_back;
X`7D
X
X/*`09A more generalized prompt/reply function allowing the caller
X`09to specify a terminator other than '`5Cn'.  Both are accepted.
X`09Assumes the buffer already contains a valid (possibly
X`09null) string to use as the default response.
X*/
Xint
Xkbd_string(
Xconst char *prompt,`09/* put this out first */
Xchar *extbuf,`09`09/* the caller's (possibly full) buffer */
Xunsigned bufn,`09`09/* the length of  " */
Xint eolchar,`09`09/* char we can terminate on, in addition to '`5Cn' */
XUINT options,`09`09/* KBD_EXPAND/KBD_QUOTES, etc. */
Xint (*complete)(DONE_ARGS)) /* handles \2107ion */
X`7B
X`09int code;
X`09static TBUFF *temp;
X`09tb_scopy(`26temp, extbuf);
X`09code = kbd_reply(prompt, `26temp, eol_history, eolchar, options, complete);
V
X`09if (bufn > tb_length(temp))
X`09`09bufn = tb_length(temp);
X`09if (bufn != 0)
X`09`09memcpy(extbuf, tb_values(temp), bufn);
X`09extbuf`5Bbufn`5D = EOS;
X`09return code;
X`7D
X
X/*
X * We use the editc character to toggle between insert/command mode in the
X * minibuffer.  This is normally bound to `5EG (the position command).
X */
Xstatic int
XisMiniEdit(int c)
X`7B
X`09if (c == editc)
X`09`09return TRUE;
X`09if (miniedit) `7B
X`09`09const CMDFUNC *cfp = kcod2fnc(c);
X`09`09if ((cfp != 0)
X`09`09 `26`26 (cfp->c_flags `26 MOTION) != 0)
X`09`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X
X/*
X * Shift the minibuffer left/right to keep the cursor visible, as well as the
V
X * prompt, if that's feasible.
X */
Xstatic void
XshiftMiniBuffer(int offs)
X`7B
X`09static const int slack = 5;
X`09int shift = w_val(wminip,WVAL_SIDEWAYS);
X`09int adjust;
X`09BUFFER *savebp;
X`09WINDOW *savewp;
X`09MARK savemk;
X
X`09beginDisplay();
X`09savebp = curbp;
X`09savewp = curwp;
X`09savemk = MK;
X
X`09curbp  = bminip;
X`09curwp  = wminip;
X
X`09adjust = offs - (shift + LastMsgCol - 1);
X`09if (adjust >= 0)
X`09`09mvrightwind(TRUE, 1+adjust);
X`09else if (shift > 0 `26`26 (slack + adjust) < 0)
X`09`09mvleftwind(TRUE, slack-adjust);
X
X`09curbp = savebp;
X`09curwp = savewp;
X`09MK = savemk;
X
X`09kbd_flush();
X`09endofDisplay();
X`7D
X
Xstatic int
XeditMinibuffer(TBUFF **buf, unsigned *cpos, int c\0706margin\1306quoted)
X`7B
X`09int edited = FALSE;
X`09const CMDFUNC *cfp = kcod2fnc(c);
X`09int savedexecmode = insertmode;
X`09BUFFER *savebp;
X`09WINDOW *savewp;
X`09MARK savemk;
X
X`09beginDisplay();
X`09savebp = curbp;
X`09savewp = curwp;
X`09curbp  = bminip;
X`09curwp  = wminip;
X`09savemk = MK;
X
X`09/* Use editc (normally `5EG) to toggle insert/command mode */
X`09if (c == editc `26`26 !quoted) `7B
X`09`09miniedit = !\0C08;
X`09`7D else if (isspecial(c)
X`09  `7C`7C  (miniedit `26`26 cfp != 0\0C07->c_flags `26 MOTION)) `7B
X
X`09`09/* If we're allowed to honor SPEC bindings, then see if it's
X`09`09 * bound to something, and execute it.
X`09`09 */
X`09`09if (cfp) `7B
X`09`09`09int first = *cpos + margin;
X`09`09`09int old_clexec = \0906;
X`09`09`09int old_named  = isnamedcmd;
X
X`09`09`09/*
X`09`09`09 * Reset flags that might cause a recursion into the
X`09`09`09 * prompt/reply code.
X`09`09`09 */
X`09`09`09clexec = 0;
X`09`09`09isnamedcmd = 0;
X
X`09`09`09/*
X`09`09`09 * Set limits so we don't edit the prompt, and allow us
X`09`09`09 * to move the cursor with the arrow keys just past the
X`09`09`09 * end of line.
X`09`09`09 */
X`09`09`09b_set_left_margin(bminip, \0F06);
X`09`09`09DOT.o = llength(DOT.l);
X`09`09`09linsert(1,' ');`09 /* pad the line so we can move */
X
X`09`09`09DOT.o = first;
X`09`09`09MK = DOT;
X`09`09`09curwp->w_line = DOT;
X`09`09`09(void)execute(cfp,FALSE,1);
X`09`09`09insertmode = savedexecmode;
X`09`09`09edited = TRUE;
X`09`09`09*cpos = DOT.o - margin;
X
X`09`09`09llength(DOT.l) -= 1;`09/* strip the padding */
X`09`09`09b_set_left_margin(bminip, 0);
X
X`09`09`09clexec = old_\0D06;
X`09`09`09isnamedcmd = old_named;
X
X`09`09`09/*
X`09`09`09 * Cheat a little, since we may have used an alias for
X`09`09`09 * '$', which can set the offset just past the end of
X`09`09`09 * line.
X`09`09`09 */
X`09`09`09if (DOT.o > llength(DOT.l))
X`09`09&0209DOT.o = llength(DOT.l);
X
X`09`09`09/* Do something reasonable if user tried to page up
X`09`09`09 * in the minibuffer
X`09`09`09 */
X`09`09`09if ((first == DOT.o)
X`09`09`09 `26`26 (cfp->c_flags `26 MOTION))
X`09`09&0209kbd_alarm();
X`09`09`7D else
X`09`09`09kbd_alarm();
X`09/* FIXME: Below are some hacks for making it appear that we're
X`09 * doing the right thing for certain non-motion commands...
X`09 */
X`09`7D else if (miniedit `26`26 cfp == `26f_insert) `7B
X`09    miniedit = FALSE;
X`09`7D else if (miniedit `26`26 cfp == `26f_insertbol) `7B
X`09    edited = editMinibuffer(buf, cpos, fnc2kcod(`26f_firstnonwhite),
X`09        \0808\100Cmargin, quoted);
X`09    miniedit = FALSE;
X`09`7D else if (miniedit `26`26 cfp == `26f_appendeol) `7B
X`09    edited = editMinibuffer(buf, cpos, fnc2kcod(`26f_gotoeol),
X`09        \0808\100Cmargin, quoted);
X`09    miniedit = FALSE;
X`09`7D else if (miniedit `26`26 cfp == `26f_append) `7B
X`09    edited = editMinibuffer(buf, cpos, fnc2kcod(`26f_forwchar_to_eol),
X`09        \0808\100Cmargin, quoted);
X`09    miniedit = FALSE;
X`09/* FIXME:  reject non-motion commands for now, since we haven't
X`09 * resolved what to do with the minibuffer if someone inserts a
X`09 * newline.
X`09 */
X`09`7D else if (miniedit `26`26 cfp != 0) `7B
X`09`09kbd_alarm();
X`09`7D else `7B
X`09`09miniedit = FALSE;
X`09`09if (disinp) `7B
X`09`09`09show1Char(c);
X`09`09`09tb_init(buf, EOS);
X`09`09`09tb_bappend(buf, DOT.l->l_text + margin,
X`09`09&0209   llength(DOT.l) - margin);
X`09`09`7D
X`09`09else `7B
X`09`09`09char tmp = c;
X`09`09`09tb_bappend(buf, `26tmp, 1);
X`09`09`7D
X`09`09*cpos += 1;
X`09`09edited = TRUE;
X`09`7D
X
X`09shiftMiniBuffer(DOT.o);
X
X`09curbp = savebp;
X`09curwp = savewp;
X`09MK = savemk;
X`09kbd_flush();
X`09endofDisplay();
X
X`09return edited;
X`7D
X
X/*
X * Same as 'kbd_string()', except for adding the 'endfunc' parameter.
X *
X * Returns:
X *`09ABORT - abort character given (usually ESC)
X *`09SORTOFTRUE - backspace from empty-buffer
X *`09TRUE - buffer is not empty
X *`09FALSE - buffer is empty
X */
Xint
Xkbd_reply(
Xconst char *prompt,`09`09/* put this out first */
XTBUFF **extbuf,`09`09`09/* the caller's (possibly full) buffer */
Xint (*endfunc)(EOL_ARGS),`09/* parsing with 'eolchar' delimiter */
Xint eolchar,`09`09`09/* char we can terminate on, in addition to '`5Cn' */
XUINT options,`09`09`09/* KBD_EXPAND/KBD_QUOTES */
Xint (*complete)(DONE_ARGS))`09/* handles \2107ion */
X`7B
X`09int`09c;
X`09int`09done;
X`09unsigned cpos;`09`09/* current character position in string */
X`09int`09status;
X`09int`09shell;
X`09int`09margin;
X`09ALLOC_T`09save_len;
X
X`09register int quotef;`09/* are we quoting the next char? */
X`09register UINT backslashes; /* are we quoting the next expandable char? */
X`09UINT dontmap = (options `26 KBD_NOMAP);
X`09int firstch = TRUE;
X`09int lastch;
X`09unsigned newpos;
X`09TBUFF *buf = 0;
X
X`09miniedit = FALSE;
X`09last_eolchar = EOS;`09/* ...in case we don't set it elsewhere */
X`09tb_unput(*extbuf);`09/* FIXME: trim null */
X
X`09if (clexec) `7B
X`09`09execstr = token(\1007, tbreserve(extbuf), eolchar);
X`09`09StrToBuff(*extbuf); /* FIXME: token should use TBUFF */
X`09`09status = (tb_length(*extbuf) != 0);
X`09`09if (status) `7B /* i.e. we got some input */
X#if !SMALLER
X`09`09`09/* FIXME: may have nulls */
X`09`09`09if ((options `26 KBD_LOWERC))
X`09`09&0209(void)mklower(tb_values(*extbuf));
X`09`09`09else if ((options `26 KBD_UPPERC))
X`09`09&0209(void)mkupper(tb_values(*extbuf));
X#endif
X`09`09`09if (!(options `26 KBD_NOEVAL)) `7B
X`09`09&0209buf = tb_copy(`26buf, *extbuf);
X`09`09&0209tb_append(`26buf, EOS); /* FIXME: for tokval() */
X`09`09&0209(void)tb_scopy(extbuf,
X`09`09&0209`09tokval(tb_values(buf)));
X`09`09&0209tb_free(`26buf);
X`09`09&0209tb_unput(*extbuf); /* trim the null */
X`09`09`09`7D
X`09`09`09if (complete != no_\0F07ion
X`09`09`09 `26`26 !editingShellCmd(tb_values(*extbuf),options)) `7B
X`09`09&0209cpos =
X`09`09&0209newpos = tb_length(*extbuf);
X`09`09&0209if ((*complete)(NAMEC, tbreserve(extbuf), `26newpos)) `7B
X`09`09&0209`09StrToBuff(*extbuf);
X`09`09&0209`7D else `7B
X`09`09&0209`09status = ABORT;
X`09`09&0209`09tb_put(extbuf, cpos, EOS);
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09/*
X`09`09`09 * Splice for multi-part command
X`09`09`09 */
X`09`09`09if ((last_eolchar = *execstr) != EOS)
X`09`09&0209last_eolchar = ' ';
X`09`09`7D
X`09`09if (pushed_back `26`26 (*execstr == EOS)) `7B
X`09`09`09pushed_back = FALSE;
X`09`09`09clexec  = pushback_flg;
X`09`09`09execstr = pushback_ptr;
X#if`09OPT_HISTORY
X`09`09`09if (!pushback_flg) `7B
X`09`09&0209hst_append(*extbuf, EOS);
X`09`09`09`7D
X#endif
X`09`09`7D
X`09`09tb_append(extbuf, EOS);`09/* FIXME */
X`09`09return status;
X`09`7D
X
X`09quotef = FALSE;
X`09reading_msg_line = TRUE;
X
X`09/* prompt the user for the input string */
X`09if (prompt != 0)
X`09`09mlprompt("%s", \0D06);
X
X`09/*
X`09 * Use the length of the prompt (plus whatever led up to it) as the
X`09 * left-margin for editing.  We'll automatically scroll the edited
X`09 * field left/right within the margins.
X`09 */
X`09margin = llength(wminip->w_dot.l);
X`09cpos = kbd_show_response(`26buf, tb_values(*extbuf), tb_length\140Beolchar,
V options);
X`09backslashes = 0; /* by definition, there is an even
X`09`09&0209`09number of backslashes */
X`09c = -1;`09`09`09/* initialize 'lastch' */
X
X`09for_ever `7B
X`09`09int`09EscOrQuo = (quotef `7C`7C
X`09`09&0209((backslashes `26 1) != 0));
X
X`09`09lastch = c;
X
X`09`09/*
X`09`09 * Get a character from the user. If not quoted, treat escape
X`09`09 * sequences as a single (16-bit) special character.
X`09`09 */
X`09`09if (quotef)
X`09`09`09c = keystroke_raw8();
X`09`09else if (dontmap)
X`09`09`09/* this looks wrong, but isn't.  no mapping will happen
X`09`09`09anyway, since we're on the command line.  we want SPEC
X`09`09`09keys to be expanded to #c, but no further.  this does
X`09`09`09that */
X`09`09`09c = mapped_keystroke_raw();
X`09`09else
X`09`09`09c = keystroke();
X
X`09`09/* Ignore nulls if the calling function is not prepared to
X`09`09 * process them.  We want to be able to search for nulls, but
X`09`09 * must not use them in filenames, for example.  (We don't
X`09`09 * support name-completion with embedded nulls, either).
X`09`09 */
X`09`09if (c == 0 `26`26 !(options `26 KBD_0CHAR))
X`09`09`09continue;
X
X`09`09/* if we echoed `5EV, erase it now */
X`09`09if (quotef) `7B
X`09`09`09firstch = FALSE;
X`09`09`09kbd_erase();
X`09`09`09kbd_flush();
X`09`09`7D
X
X`09`09/* If it is a <ret>, change it to a <NL> */
X`09`09if (c == '`5Cr' `26`26 !quotef)
X`09`09`09c = '`5Cn';
X
X`09`09/*
X`09`09 * If they hit the line terminate (i.e., newline or unescaped
X`09`09 * eolchar), wrap it up.
X`09`09 *
X`09`09 * Don't allow newlines in the string -- they cause real
X`09`09 * problems, especially when searching for patterns
X`09`09 * containing them -pgf
X`09`09 */
X`09`09done = FALSE;
X`09`09if (c == '`5Cn') `7B
X`09`09`09done = TRUE;
X`09`09`7D else if (!EscOrQuo
X`09`09    `26`26 !is_edit_char(c)
X`09`09    `26`26 !isMiniEdit(c)) `7B
X`09`09`09BuffToStr(buf);
X`09`09`09if ((*endfunc)(tb_values(buf),tb_length\0F06c,eolchar)) `7B
X`09`09&0209done = TRUE;
X`09`09`09`7D
X`09`09`7D
X
X`09`09if (complete != no_\0F07ion) `7B
X`09`09`09kbd_unquery();
X`09`09`09shell = editingShellCmd(tb_values(buf),options);
X`09`09`09if (done `26`26 (options `26 KBD_NULLOK) &0226 cpos == 0)
X`09`09&0209/*EMPTY*/;
X`09`09`09else if ((done `26`26 !(options `26 KBD_MAYBEC))
X`09`09`09 `7C`7C (!EscOrQuo
X`09`09`09  `26`26 !(shell &0226 isPrint(c))
X`09`09`09  `26`26 (c == TESTC `7C`7C c == NAMEC))) `7B
X`09`09&0209if (shell `26`26 isreturn(c)) `7B
X`09`09&0209`09/*EMPTY*/;
X`09`09&0209`7D else if ((*complete)(c, tbreserve(`26buf), `26cpos)) `7B
X`09`09&0209`09done = TRUE;
X`09`09&0209`09StrToBuff(buf); /* FIXME */
X`09`09&0209`09if (c != NAMEC) /* cancel the unget */
X`09`09&0209&0209(void)keystroke();
X`09`09&0209`7D else `7B
X`09`09&0209`09StrToBuff(buf); /* FIXME */
X`09`09&0209`09if (done) `7B`09/* stay til matched! */
X`09`09&0209&0209kbd_unquery();
X`09`09&0209&0209(void)((*complete)(TESTC, tbreserve(`26buf), `26cpos));
X`09`09&0209`09`7D
X`09`09&0209`09firstch = FALSE;
X`09`09&0209`09continue;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`7D
X
X`09`09if (done) `7B
X`09`09`09last_eolchar = c;
X`09`09`09if (options `26 KBD_QUOTES)
X`09`09&0209remove_backslashes(buf); /* take out quoters */
X
X`09`09`09save_len = tb_length(buf);
X`09`09`09hst_append(buf, eolchar);
X`09`09`09(void)tb_copy(extbuf, buf);
X`09`09`09status = (tb_length(*extbuf) != 0);
X
X`09`09`09/* If this is a shell command, push-back the actual
X`09`09`09 * text to separate the "!" from the command.  Note
X`09`09`09 * that the history command tries to do this already,
X`09`09`09 * but cannot for some special cases, e.g., the user
X`09`09`09 * types
X`09`09`09 *`09:execute-named-command !ls -l
X`09`09`09 * which is equivalent to
X`09`09`09 *`09:!ls -l
X`09`09`09 */
X`09`09`09if (status == TRUE`09/* ...we have some text */
X`09`09`09 `26`26 (options `26 KBD_EXPCMD)
X#if`09OPT_HISTORY
X`09`09`09 `26`26 (tb_length(buf) == save_len) /* history didn't split it */
X#endif
X`09`09`09 `26`26 isShellOrPipe(tb_values(buf))) `7B
X`09`09&0209kbd_pushback(*extbuf, 1);
X`09`09`09`7D
X`09`09`09break;
X`09`09`7D
X
X#if`09OPT_HISTORY
X`09`09if (!EscOrQuo
X`09`09 `26`26 edithistory(`26buf, `26cpos, `26c, options, endfunc, eolchar))`20
V`7B
X`09`09`09backslashes = countBackS\1306(buf, cpos);
X`09`09`09firstch = TRUE;
X`09`09`09continue;
X`09`09`7D else
X#endif
X`09`09/*
X`09`09 * If editc and abortc are the same, don't\1B06 unless the
X`09`09 * user presses it twice in a row.
X`09`09 */
X`09`09if ((c != editc `7C`7C c == lastch)
X`09`09  `26`26 ABORTED(c)
X`09`09  `26`26 !quotef
X`09`09  `26`26 !dontmap) `7B
X`09`09`09tb_init(`26buf, abortc);
X`09`09`09status = esc_func(FALSE, 1);
X`09`09`09break;
X`09`09`7D else if ((isbackspace(c) `7C`7C
X`09`09`09c == wkillc `7C`7C
X`09`09`09c == killc) `26`26 !quotef) `7B
X
X`09`09`09if (prompt == 0 `26`26 c == killc)
X`09`09&0209cpos = 0;
X
X`09`09`09if (cpos == 0) `7B
X`09`09&0209if (prompt)
X`09`09&0209`09mlerase();
X`09`09&0209if (isbackspace(c)) `7B`09/* splice calls */
X`09`09&0209`09unkeystroke(c);
X`09`09&0209`09status = SORTOFTRUE;
X`09`09&0209`7D else `7B
X`09`09&0209`09status = FALSE;
X`09`09&0209`7D
X`09`09&0209break;
X`09`09`09`7D
X
X`09`09`09kbd_kill_response(buf, `26cpos, c);
X
X`09`09`09/*
X`09`09`09 * If we backspaced to erase the buffer, it's ok to
X`09`09`09 * return to the caller, who would be the :-line
+-+-+-+-+-+-+-+-  END  OF PART 61 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 62 -+-+-+-+-+-+-+-+
X`09`09`09 * parser, so we can do something reasonable with the
X`09`09`09 * address specication.
X`09`09`09 */
X`09`09`09if (cpos == 0
X`09`09`09 `26`26 isbackspace(c)
X`09`09`09 `26`26 (options `26 KBD_STATED)) `7B
X`09`09&0209status = SORTOFTRUE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09backslashes = countBackS\1306(buf, cpos);
X
X`09`09`7D else if (firstch == TRUE
X`09`09  `26`26 !quotef
X`09`09  `26`26 !isMiniEdit(c)
X`09`09  `26`26 !isspecial(c)) `7B
X`09`09`09/* clean the buffer o\0E06first char typed */
X`09`09`09unkeystroke(c);
X`09`09`09kbd_kill_response(buf, `26cpos, killc);
X`09`09`09backslashes = countBackS\1306(buf, cpos);
X
X`09`09`7D else if (c == quotec `26`26 !quotef) `7B
X`09`09`09quotef = TRUE;
X`09`09`09show1Char(c);
X`09`09`09continue;`09/* keep firstch==TRUE */
X
X`09`09`7D else if (EscOrQuo `7C`7C !expandChar(`26buf, `26cpos, c, options))`20
V`7B
X`09`09`09if (c == BACKSLASH)
X`09`09&0209backslashes++;
X`09`09`09else
X`09`09&0209backslashes = 0;
X`09`09`09quotef = FALSE;
X
X#if !SMALLER
X`09`09`09if (!isspecial(c)) `7B
X`09`09&0209if ((options `26 KBD_LOWERC)
X`09`09&0209 `26`26 isUpper(c))
X`09`09&0209`09c = toLower(c);
X`09`09&0209else if ((options `26 KBD_UPPERC)
X`09`09&0209 `26`26 isLower(c))
X`09`09&0209`09c = toUpper(c);
X`09`09`09`7D
X#endif
X`09`09`09if (!editMinibuffer(`26buf, `26cpos, c, margin, EscOrQuo))
X`09`09&0209continue;`09/* keep firstch==TRUE */
X`09`09`7D
X`09`09firstch = FALSE;
X`09`7D
X#if OPT_POPUPCHOICE
X`09popdown_completions();
X#endif
X`09miniedit = FALSE;
X`09reading_msg_line = FALSE;
X`09tb_free(`26buf);
X`09shiftMiniBuffer(0);
X
X`09TRACE(("reply:%d:%d:%s`5Cn", status,
X`09`09(int) tb_length(*extbuf),
X`09`09tb_visible(*extbuf)))
X`09tb_append(extbuf, EOS);`09/* FIXME */
X`09return status;
X`7D
X
X/*
X * Make the "." replay the keyboard macro
X */
X#ifdef GMDDOTMACRO
Xstatic void
Xdot_replays_macro(int macnum)
X`7B
X`09extern`09const`09CMDFUNC`09f_kbd_mac_exec;
X`09char`09temp`5BNSTRING`5D;
X`09ITBUFF`09*tmp;
X`09int`09c;
X
X`09if (macnum == DEFAULT_REG) `7B
X`09`09if ((c = fnc2kcod(`26f_kbd_mac_exec)) == -1)
X`09`09`09return;
X`09`09(void)kcod2str(c, temp);
X`09`7D else `7B
X`09`09(void)lsprintf(temp, "@%c", index2reg(macnum));
X`09`7D
X`09dotcmdbegin();
X`09tmp = TempDot(FALSE);
X`09(void)itb_sappend(`26tmp, temp);
X`09dotcmdfinish();
X`09dotcmdbegin();
X`7D
X#endif
X
X/*
X * Begin recording the dot command macro.
X * Set up variables and return.
X * we use a temporary accumulator, in case this gets stopped prematurely
X */
Xint
Xdotcmdbegin(void)
X`7B
X`09/* never record a playback */
X`09if (dotcmdmode != PLAY) `7B
X`09`09(void)TempDot(TRUE);
X`09`09dotcmdmode = RECORD;
X`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X
X/*
X * Finish dot command, and copy it to the real holding area
X */
Xint
Xdotcmdfinish(void)
X`7B
X`09if (dotcmdmode == RECORD) `7B
X`09`09ITBUFF`09*tmp = TempDot(FALSE);
X`09`09if (itb_length(tmp) == 0`09/* keep the old value */
X`09`09 `7C`7C itb_copy(`26dotcmd, tmp) != 0) `7B
X`09`09`09itb_first(dotcmd);
X`09`09`09dotcmdmode = STOP;
X`09`09`09return TRUE;
X`09`09`7D
X`09`7D
X`09return FALSE;
X`7D
X
X
X/* stop recording a dot command,
X`09probably because the command is not re-doable */
Xvoid
Xdotcmdstop(void)
X`7B
X`09if (dotcmdmode == RECORD)
X`09`09dotcmdmode = STOP;
X`7D
X
X/*
X * Execute the '.' command, by putting us in PLAY mode.
X * The command argument is the number of times to loop. Quit as soon as a
X * command gets an error. Return TRUE if all ok, else FALSE.
X */
Xint
Xdotcmdplay(int f, int n)
X`7B
X`09if (!f)
X`09`09n = dotcmdarg ?\0C07cnt:1;
X`09else if (n < 0)
X`09`09return TRUE;
X
X`09if (f)`09/* we definitely have an argument */
X`09`09dotcmdarg = TRUE;
X`09/* else
X`09`09leave dotcmdarg alone; */
X
X`09if (dotcmdmode != STOP `7C`7C itb_length\2107) == 0) `7B
X`09`09dotcmdmode = STOP;
X`09`09dotcmdarg = FALSE;
X`09`09return FALSE;
X`09`7D
X
X`09if (n == 0) n = 1;
X
X`09dotcmdcnt = \0C06rep = n;  /* remember how many times to execute */
X`09dotcmdmode = PLAY;`09/* put us in play mode */
X`09itb_first(dotcmd);`09/*    at the beginning */
X
X`09if (ukb != 0) /* save our kreg, if one was specified */
X`09`09dotcmdkreg = ukb;
X`09else /* use our old one, if it wasn't */
X`09`09ukb = dotcmdkreg;
X
X`09return TRUE;
X`7D
X
X/*
X * Test if we are replaying either '.' command, or keyboard macro.
X */
Xint
Xkbd_replaying(int match)
X`7B
X`09if (dotcmdmode == PLAY) `7B
X`09`09/*
X`09`09 * Force a false-return if we are in insert-mode and have
X`09`09 * only one character to display.
X`09`09 */
X`09`09if (match
X`09`09 `26`26 insertmode == INSERT
X`09`09 `26`26 b_val(curbp, MDSHOWMAT)
X`09`09 `26`26 KbdStack == 0
X`09`09 `26`26 (dotcmd->itb_last+1 >= \160Cused)) `7B
X`09`09`09return FALSE;
X`09`09`7D
X`09`09return TRUE;
X`09`7D
X`09return (kbdmode == PLAY);
X`7D
X
X/*
X * Begin recording a keyboard macro.
X */
X/* ARGSUSED */
Xint
Xkbd_mac_begin(int f GCC_UNUSED, int n\120B)
X`7B
X`09if (kbdmode != STOP) `7B
X`09`09mlforce("`5BMacro already active`5D");
X`09`09return FALSE;
X`09`7D
X`09mlwrite("`5BStart macro`5D");
X
X`09kbdmode = RECORD;
X`09return (itb_init(`26KbdMacro, abortc) != 0);
X`7D
X
X/*
X * End keyboard macro. Check for the same limit conditions as the above
X * routine. Set up the variables and return to the caller.
X */
X/* ARGSUSED */
Xint
Xkbd_mac_end(int f GCC_UNUSED, int n\120B)
X`7B
X`09if (kbdmode == STOP) `7B
X`09`09mlforce("`5BMacro not active`5D");
X`09`09return FALSE;
X`09`7D
X`09if (kbdmode == RECORD) `7B
X`09`09mlwrite("`5BEnd macro`5D");
X`09`09kbdmode = STOP;
X#ifdef GMDDOTMACRO
X`09`09dot_replays_macro(DEFAULT_REG);
X#endif
X`09`7D
X`09/* note that if kbd_mode == PLAY, we do nothing --\2B06makes
X`09`09the '`5EX-)' at the of the recorded buffer a no-op during
X`09`09playback */
X`09return TRUE;
X`7D
X
X/*
X * Execute a macro.
X * The command argument is the number of times to loop. Quit as soon as a
X * command gets an error. Return TRUE if all ok, else FALSE.
X */
X/* ARGSUSED */
Xint
Xkbd_mac_exec(int f GCC_UNUSED, int n)
X`7B
X`09if (kbdmode != STOP) `7B
X`09`09mlforce("`5BCan't execute macro while recording`5D");
X`09`09return FALSE;
X`09`7D
X
X`09if (n <= 0)
X`09`09return TRUE;
X
X`09return start_kbm(n, DEFAULT_REG, KbdMacro);
X`7D
X
X/* ARGSUSED */
Xint
Xkbd_mac_save(int f GCC_UNUSED, int n\120B)
X`7B
X`09ksetup();
X`09itb_first(KbdMacro);
X`09while (itb_more(KbdMacro))
X`09`09if (!kinsert(itb_next(KbdMacro)))
X`09`09`09break;
X`09kdone();
X`09mlwrite("`5BKeyboard macro saved in register %c.`5D", index2reg(ukb));
X`09return TRUE;
X`7D
X
X/*
X * Test if the given macro has already been started.
X */
Xint
Xkbm_started(int macnum, int force)
X`7B
X`09if (force `7C`7C (kbdmode == PLAY)) `7B
X`09`09register KSTACK *sp;
X`09`09for (sp = KbdStack; sp != 0; sp = sp->m_link) `7B
X`09`09`09if (sp->m_indx == macnum) `7B
X`09`09&0209while (kbdmode == PLAY)
X`09`09&0209`09finish_kbm();
X`09`09&0209mlwarn("`5BError: currently executing %s%c`5D",
X`09`09&0209`09macnum == DEFAULT_REG
X`09`09&0209&0209? "macro" : "register ",
X`09`09&0209`09index2reg(macnum));
X`09`09&0209return TRUE;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09return FALSE;
X`7D
X
X/*
X * Start playback of the given keyboard command-string
X */
Xint
Xstart_kbm(
Xint`09n,`09`09`09/* # of times to repeat */
Xint`09macnum,`09`09`09/* register to execute */
XITBUFF *ptr)`09`09`09/* data to interpret */
X`7B
X`09register KSTACK *sp = 0;
X`09ITBUFF  *tp = 0;
X
X`09if (interrupted())
X`09`09return FALSE;
X
X`09if (kbdmode == RECORD `26`26 KbdStack != 0)
X`09`09return TRUE;
X
X`09if (itb_length(ptr)
X`09 `26`26 (sp = typealloc(KSTACK)) != 0
X`09 `26`26 itb_copy(`26tp, ptr) != 0) `7B
X
X`09`09/* make a copy of the macro in case recursion alters it */
X`09`09itb_first(tp);
X
X`09`09sp->m_save = kbdmode;
X`09`09sp->m_indx = macnum;
X`09`09sp->m_rept = n;
X`09`09sp->m_kbdm = tp;
X`09`09sp->m_link = KbdStack;
X
X`09`09KbdStack   = sp;
X`09`09kbdmode    = PLAY; `09/* start us in play mode */
X
X`09`09/* save data for "." on the same stack */
X`09`09sp->m_dots = 0;
X`09`09if (dotcmdmode == PLAY) `7B
X#ifdef GMDDOTMACRO
X`09`09`09sp->m_DOTS = dotcmd;
X`09`09`09sp->m_RPT0 = dotcmdcnt;
X`09`09`09sp->m_RPT1 = dotcmdrep;
X#endif
X`09`09`09dotcmd     = 0;
X`09`09`09dotcmdmode = RECORD;
X`09`09`7D
X#ifdef GMDDOTMACRO
X`09`09  else `7B
X`09`09`09sp->m_DOTS = 0;
X`09`09  `7D
X#endif
X`09`09return (itb_init(`26dotcmd, abortc) != 0
X`09`09  `26`26    itb_init(`26(sp->m_dots), abortc) != 0);
X`09`7D
X`09return FALSE;
X`7D
X
X/*
X * Finish a macro begun via 'start_kbm()'
X */
Xstatic void
Xfinish_kbm(void)
X`7B
X`09if (kbdmode == PLAY) `7B
X`09`09register KSTACK *sp = KbdStack;
X
X`09`09kbdmode = STOP;
X`09`09if (sp != 0) `7B
X`09`09`09kbdmode  = sp->m_save;
X`09`09`09KbdStack = sp->m_link;
X
X`09`09`09itb_free(`26(sp->m_kbdm));
X`09`09`09itb_free(`26(sp->m_dots));
X#ifdef GMDDOTMACRO
X`09`09`09itb_free(`26dotcmd);
X`09`09`09if (sp->m_DOTS != 0) `7B
X`09`09&0209dotcmd     = sp->m_DOTS;
X`09`09&0209dotcmdcnt  = sp->m_RPT0;
X`09`09&0209dotcmdrep  = sp->m_RPT1;
X`09`09&0209dotcmdmode = PLAY;
X`09`09`09`7D
X`09`09`09dot_replays_macro(sp->m_indx);
X#endif
X`09`09`09free((char *)sp);
X`09`09`7D
X`09`7D
X`7D
$ call unpack [.VILE-8_0]INPUT.C;1 -
 655482249 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 89 50 152
$!
$ create 'f'
X/*
X *
X *`09insert.c
X *
X * Do various types of character insertion, including most of \1D06 mode.
X *
X * Most code probably by Dan Lawrence or Dave Conroy for MicroEMACS
X * Extensions for vile by Paul Fox
X *
X * $Header: /usr/build/vile/vile/RCS/insert.c,v 1.109 1998/05/15 01:06:12 tom
V Exp $
X *
X */
X
X#include`09"estruct.h"
X#include`09"edef.h"
X
X#define`09DOT_ARGUMENT`09((dotcmdmode == PLAY) `26`26 \1706arg)
X
X#define`09BackspaceLimit() (b_val(curbp,MDBACKLIMIT) `26`26 autoindented <= 0)
V`5C
X`09`09`09? DOT.o`5C
X`09`09`09: w_left_margin(curwp)
X
Xstatic`09int`09backspace (void);
Xstatic`09int`09doindent(int ind);
Xstatic`09int`09indented_newline (void);
Xstatic`09int`09indented_newline_above (void);
Xstatic`09int`09ins_anytime(int playback, int cur_count\0F06max\0F0C*splice);
Xstatic`09int`09insbrace(int n, int c);
Xstatic`09int`09inspound (void);
Xstatic`09int`09nextindent(int *bracefp);
Xstatic`09int`09openlines(int n);
Xstatic`09int`09shiftwidth(int f, int n);
Xstatic`09int`09tab(int f, int n);
X#if !SMALLER
Xstatic`09int`09istring(int f, int n\0706mode);
X#endif
X
X/* value of insertmode maintained through subfuncs */
Xstatic`09int`09savedmode;
X
Xstatic int allow_aindent = TRUE;
Xstatic int skipindent;
X
X/*--------\0808\1010\2020\400A*/
X
X/* If the wrapmargin mode is active (i.e., nonzero), and if it's not wider tha
Vn
X * the screen, return the difference from the current position to the wrap
X * margin.  Otherwise, return negative.
X */
Xstatic int
Xpast_wrapmargin(int c)
X`7B
X`09register int`09n;
X
X`09if ((n = b_val(curbp, VAL_WRAPMARGIN)) > 0
X`09 `26`26 (n = (term.t_ncol - (nu_width(curwp) + n))) >= 0) `7B
X`09`09int list = w_val(curwp,WMDLIST);
X`09`09int used = getccol(list);
X
X`09`09/* compute the effective screen column after adding the
X`09`09 * latest character
X`09`09 */
X`09`09return NEXT_COLUMN(used, c, list, curtabval) - n;
X`09`7D
X`09return -1;
X`7D
X
X/* Returns true iff wrap-margin or\0F06words is active and we'll wrap at the
X * current column.
X */
Xstatic int
Xwrap_at_col(int c)
X`7B
X`09register int`09n;
X
X`09if (past_wrapmargin(c) >= 0)
X`09`09return TRUE;
X
X`09if (b_val(curbp, MDWRAP)
X`09 `26`26 (n = b_val(curbp, VAL_FILL)) > 0)
X`09 `09return (getccol(FALSE) > n);
X
X`09return FALSE;
X`7D
X
X/* advance one character past the current position, for 'append()' */
Xstatic void
Xadvance_one_char(void)
X`7B
X`09if (! is_header_line(DOT,curbp) `26`26 !is_at_end_of\2109))
X`09`09forwchar(TRUE,1); /* END OF LINE HACK */
X`7D
X
X/* common logic for i,I,a,A commands */
Xstatic int
Xins_n_times(int f, int n\0706advance)
X`7B
X`09register int status = TRUE;
X`09register int i;
X`09int`09flag`09= FALSE;
X
X`09if (!f `7C`7C n < 0)
X`09`09n = 1;
X
X`09for (i = 0; i < n; i++) `7B
X`09`09if ((status = ins_anytime((i != 0), i, n, `26flag)) != TRUE)
X`09`09`09break;
X`09`09if (advance `26`26 !flag)
X`09`09`09advance_one_char();
X`09`7D
X`09return status;
X`7D
X
X/* open lines up before this one */
Xint
Xopenup(int f, int n)
X`7B
X`09register int s;
X
X`09if (!f) n = 1;
X`09if (n < 0) return (FALSE);
X`09if (n == 0) return ins();
X
X`09(void)gotobol(TRUE,1);
X
X`09/* if we are in C mode and this is a default <NL> */
X`09if (allow_aindent `26`26 n == 1 &0226
X`09`09(is_c_mode(curbp) `7C`7C b_val\1006,MDAIND)) `26`26
X`09`09&0209    !is_header_line(DOT,curbp)) `7B
X`09`09s = indented_newline_above();
X`09`09if (s != TRUE) return (s);
X
X`09`09return(ins());
X`09`7D
X`09s = lnewline();
X`09if (s != TRUE) return s;
X
X`09(void)backline(TRUE,1);`09`09/* back to the blank line */
X
X`09if ( n > 1) `7B
X`09`09s = openlines(n-1);
X`09`09if (s != TRUE) return s;
X`09`09s = backline(TRUE, 1);`09/* backup over the first one */
X`09`09if (s != TRUE) return s;
X`09`7D
X
X`09return(ins());
X`7D
X
X/*
X * as above, but override all autoindenting and cmode-ing
X */
Xint
Xopenup_no_aindent(int f, int n)
X`7B
X    `09int s;
X`09int oallow = allow_aindent;
X`09allow_aindent = FALSE;
X`09s = openup(f,n);
X`09allow_aindent = oallow;
X`09return s;
X`7D
X
X/* open lines up after this one */
Xint
Xopendown(int f, int n)
X`7B
X`09register int`09s;
X
X`09if (!f) n = 1;
X`09if (n < 0) return (FALSE);
X`09if (n == 0) return ins();
X
X`09s = openlines(n);
X`09if (s != TRUE)
X`09`09return (s);
X
X`09return(ins());
X`7D
X
X/*
X * as above, but override all autoindenting and cmode-ing
X */
Xint
Xopendown_no_aindent(int f, int n)
X`7B
X    `09int s;
X`09int oallow = allow_aindent;
X`09allow_aindent = FALSE;
X`09s = opendown(f,n);
X`09allow_aindent = oallow;
X`09return s;
X`7D
X
X/*
X * Open up some blank space. The basic plan is to insert a bunch of newlines,
V
X * and then back up over them.
X *
X * This interprets the repeat-count for the 'o' and 'O' commands.  Unlike vi
X * (which does not use the repeat-count), this specifies the number of blank
X * lines to create before proceeding with inserting the string-argument of the
V
X * command.
X */
Xstatic int
Xopenlines(int n)
X`7B
X`09register int i = n;`09`09`09/* Insert newlines. */
X`09register int s = TRUE;
X`09while (i-- `26`26 s==TRUE) `7B
X`09`09(void)gotoeol(FALSE,1);
X`09`09s = newline(TRUE,1);
X`09`7D
X`09if (s == TRUE `26`26 n)`09`09`09/* Then back up over top */
X`09`09(void)backline(TRUE, n-1);`09/* of them all.&0209 */
X
X`09curgoal = -1;
X
X`09return s;
X`7D
X
X/*
X * Implements the vi 'i' command.
X */
Xint
Xinsert(int f, int n)
X`7B
X`09return ins_n_times(f,n,TRUE);
X`7D
X
X/*
X * as above, but override all autoindenting and cmode-ing
X */
Xint
Xinsert_no_aindent(int f, int n)
X`7B
X    `09int s;
X`09int oallow = allow_aindent;
X`09allow_aindent = FALSE;
X`09s = ins_n_times(f,n,TRUE);
X`09allow_aindent = oallow;
X`09return s;
X`7D
X
X/*
X * Implements the vi 'I' command.
X */
Xint
Xinsertbol(int f, int n)
X`7B
X`09if (!DOT_ARGUMENT `7C`7C (dotcmdrep == \0D06cnt))
X`09`09(void)firstnonwhite(FALSE,1);
X`09return ins_n_times(f,n,TRUE);
X`7D
X
X/*
X * Implements the vi 'a' command.
X */
Xint
Xappend(int f, int n)
X`7B
X`09advance_one_char();
X
X`09return ins_n_times(f,n, !DOT_ARGUMENT);
X`7D
X
X/*
X * Implements the vi 'A' command.
X */
Xint
Xappendeol(int f, int n)
X`7B
X`09if (!is_header_line(DOT,curbp))
X`09`09(void)gotoeol(FALSE,0);
X
X`09return ins_n_times(f,n,TRUE);
X`7D
X
X/*
X * Unlike most flags on the mode-line, we'll only show the insertion-mode on
X * the current window.
X */
Xstatic void
Xset_insertmode(int mode)
X`7B
X`09insertmode = mode;
X`09if (b_val(curbp, MDSHOWMODE))
X`09`09curwp->w_flag `7C= WFMODE;
X`7D
X
X/*
X * Function that returns the insertion mode if we're\1808ng into a given
X * window
X */
Xint
Xins_mode(WINDOW *wp)
X`7B
X`09return (wp == curwp) ? insertmode : FALSE;
X`7D
X
X/*
X * Implements the vi 'R' command.
X *
X * This takes an optional repeat-count and a string-argument.  The\290D
X * (default 1) specifies the number of times that the string argument is
X * inserted.  The length of the string-argument itself determines the number o
Vf
X * characters (beginning with the cursor position) to delete before be\3507
X * the insertion.
X */
Xint
Xoverwritechars(int f, int n)
X`7B
X`09set_insertmode(OVERWRITE);
X`09return ins_n_times(f,n, TRUE);
X`7D
X
X/*
X * Implements the vi 'r' command.
X *
X * This takes an optional repeat-count and a single-character argument.  The
X * repeat-count (default 1) specifies the number of characters beginning with
V
X * the cursor position that are replaced by the argument.  Newline is treated
V
X * differently from the other characters (only one newline is inserted).
X *
X * Unlike vi, the number of characters replaced can be longer than a line.
X * Also, vile allows quoted characters.
X */
Xint
Xreplacechar(int f, int n)
X`7B
X`09register int`09s = TRUE;
X`09register int`09t = FALSE;
X`09register int`09c;
X
X`09if (!f `26`26 is_empty_line(DOT))
X`09`09return FALSE;
X
X`09if (clexec `7C`7C isnamedcmd) `7B
X`09`09int status;
X`09`09static char cbuf`5BNLINE`5D;
X`09`09if ((status=mlreply("Replace with: ", cbuf, 2)) != TRUE)
X`09`09`09return status;
X`09`09c = cbuf`5B0`5D;
X`09`7D else `7B
X`09`09set_insertmode(REPLACECHAR);  /* need to fool SPEC prefix code */
X`09`09if (dotcmdmode != PLAY)
X`09`09`09(void)update(FALSE);
X`09`09c = keystroke();
X`09`09if (ABORTED(c)) `7B
X`09`09`09set_insertmode(FALSE);
X`09`09`09return ABORT;
X`09`09`7D
X
X`09`7D
X`09c = kcod2key(c);
X
X`09if (!f `7C`7C !n)
X`09`09n = 1;
X`09if (n < 0)
X`09`09s = FALSE;
X`09else `7B
X`09`09int`09vi_fix = (!DOT_ARGUMENT `7C`7C (dotcmdrep <= 1));
X
X`09`09(void)ldelete((B_COUNT)n, FALSE);
X`09`09if (c == quotec) `7B
X`09`09`09t = s = quote(f,n);
X`09`09`7D else `7B
X`09`09`09if (isreturn(c)) `7B
X`09`09&0209if (vi_fix)
X`09`09&0209`09s = lnewline();
X`09`09`09`7D else `7B
X`09`09&0209if (isbackspace(c)) `7B`09/* vi beeps here */
X`09`09&0209`09s = TRUE;`09/* replaced with nothing */
X`09`09&0209`7D else `7B
X`09`09&0209`09t = s = linsert(n, c);
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`7D
X`09`09if ((t == TRUE) `26`26 (DOT.o > w_left_margin(curwp)) &0226 vi_fix)
X`09`09`09s = backchar(FALSE,1);
X`09`7D
X`09set_insertmode(FALSE);
X`09return s;
X`7D
X
X/*
X * This routine performs the principal decoding for insert mode (i.e.., the
X * i,I,a,A,R commands).  It is invoked via 'ins_n_times()', which loops over
X * the repeat-count for direct commands.  One complicating factor is that
X * 'ins_n_times()' (actually its callers) i\0C07d once for each repetition in
V
X * a '.' command.  At this level we compute the effective loop counter (the '.
V'
X * and the direct commands), because we have to handle the vi-compatibilty cas
Ve
X * of inserting a newline.
X *
X * We stop repeating insert after the first newline in the \2606ion-string
X * (that's what vi does).  If a user types
X *
X *`093iABC<nl>foo<esc>
X *
X * then we want to insert
X *
X *`09ABCABCABC<nl>foo
X */
Xstatic int last_insert_char;
X
Xstatic int
Xins_anytime(int playback, int cur_count\0F06max\0F0C*splice)
X`7B
X#if OPT_MOUSE `7C`7C OPT_B_LIMITS
X`09WINDOW`09*wp0 = curwp;
X#endif
X`09register int status;
X`09int`09c;`09`09/* command character */
X`09int backsp_limit;
X`09static ITBUFF *insbuff;
X`09int osavedmode;
X
X`09if (DOT_ARGUMENT) `7B
X`09`09max_count = cur\0C07+ dotcmdcnt;
X`09`09cur_count += dotcmdcnt -\0C07rep;
X`09`7D
X
X`09if (playback `26`26 (insbuff != 0))
X`09`09itb_first(insbuff);
X`09else if (!itb_init(`26insbuff, abortc))
X`09`09return FALSE;
X
X`09if (insertmode == FALSE)
X`09`09set_insertmode(INSERT);
X`09osavedmode = \0C09;
X`09savedmode = insertmode;
X
X`09backsp_limit = BackspaceLimit();
X
X`09last_insert_char = EOS;
X
X`09for_ever `7B
X
X`09`09/*
X`09`09 * Read another character from the insertion-string.
X`09`09 */
X`09`09c = abortc;
X`09`09if (playback) `7B
X`09`09`09if (*splice `26`26 !itb_more(insbuff))
X`09`09&0209playback = FALSE;
X`09`09`09else
X`09`09&0209c = itb_next(insbuff);
X`09`09`7D
X`09`09if (!playback) `7B
X`09`09`09if (dotcmdmode != PLAY)
X`09`09&0209(void)update(FALSE);
X
X`09`09`09c = mapped_keystroke();
X
X#if OPT_MOUSE
X`09`09`09/*
X`09`09`09 * Prevent user from starting insertion into a
X`09`09`09 * modifiable buffer, then clicking on another
X`09`09`09 * buffer to continue inserting.  This assumes that
X`09`09`09 * 'setcursor()' handles entry into the other
X`09`09`09 * buffer.
X`09`09`09 */
X`09`09`09if (curwp != wp0) `7B
X`09`09`09    `09/* end insert mode for window we started in */
X`09`09`09    `09wp0->w_traits.insmode = FALSE;
X`09`09&0209if (b_val(wp0->w_bufp, MDSHOWMODE))
X`09`09&0209    wp0->w_flag `7C= WFMODE;
X`09`09&0209unkeystroke(c);
X`09`09&0209goto leave;
X`09`09`09`7D
X#endif
X`09`09`09if (!itb_append(`26insbuff, c)) `7B
X`09`09`09    status = FALSE;
X`09`09`09    break;
X`09`09`09`7D
X`09`09`7D
X
X
X`09`09if (isspecial(c)) `7B
X`09`09    `09/* if we're allowed to honor SPEC bindings,
X`09`09&0209then see if it's bound to something, and
X`09`09&0209execute it */
X`09`09`09const CMDFUNC *cfp = kcod2fnc(c);
X`09`09`09if (cfp) `7B
X`09`09&0209int savedexecmode = insertmode;
X
X`09`09&0209backsp_limit = w_left_margin(curwp);
X`09`09&0209if (curgoal < 0)
X`09`09&0209`09curgoal = getccol(FALSE);
X`09`09&0209(void)execute(cfp,FALSE,1);
X`09`09&0209insertmode = savedexecmode;
X`09`09`09`7D
X`09`09`09continue;
X`09`09`7D
X
X`09`09if (!isident(c))
X`09`09`09abbr_check(`26backsp_limit);
X
X`09`09if (isreturn(c)) `7B
X`09`09`09if ((cur_count+1) < max\0F06) `7B
X`09`09&0209if (DOT_ARGUMENT) `7B
X`09`09&0209`09while (itb_more(dotcmd))
X`09`09&0209&0209(void)mapped_keystroke();
X`09`09&0209`7D
X`09`09&0209*splice = TRUE;
X`09`09&0209status = TRUE;
X`09`09&0209break;
X`09`09`09`7D else if (DOT_ARGUMENT) `7B
X`09`09&0209*splice = TRUE;
X`09`09`09`7D
X`09`09`7D
X`09`09/*
X`09`09 * Decode the character
X`09`09 */
X`09`09if (ABORTED(c)) `7B
X#if OPT_MOUSE
X`09leave:
X#endif
X`09`09`09 /* an unfortunate Vi-ism that ensures one
X`09`09&0209can always type "ESC a" if you're not sure
X`09`09&0209you're in insert mode. */
X`09`09`09if (DOT.o > w_left_margin(wp0))
X`09`09&0209backchar(TRUE,1);
X`09`09`09if (autoindented >= 0) `7B
X`09`09&0209(void)trimline((void *)0,0,0);
X`09`09&0209autoindented = -1;
X`09`09`09`7D
X`09`09`09if (cur_count+1 == max\0F06)
X`09`09&0209*splice = TRUE;
X`09`09`09status = TRUE;
X`09`09`09break;
X`09`09`7D else if ((c `26 HIGHBIT) `26`26 b_val(curbp, MDMETAINSBIND)) `7B
X`09`09    `09/* if we're allowed to honor meta-character bindings,
X`09`09&0209then see if it's bound to something, and
X`09`09&0209insert it if not */
X`09`09`09const CMDFUNC *cfp = kcod2fnc(c);
X`09`09`09if (cfp) `7B
X`09`09&0209int savedexecmode = insertmode;
X
X`09`09&0209backsp_limit = w_left_margin(curwp);
X`09`09&0209if (curgoal < 0)
X`09`09&0209`09curgoal = getccol(FALSE);
X`09`09&0209(void)execute(cfp,FALSE,1);
X`09`09&0209insertmode = savedexecmode;
X`09`09&0209continue;
X`09`09`09`7D
X`09`09`7D
X
X`09`09if (c == startc `7C`7C \0F07opc) `7B  /* `5EQ and `5ES */
X`09`09`09continue;
X`09`09`7D
X#if OPT_SHELL `26`26 SYS_UNIX &0226 defined(SIGTSTP)`09/* job control, `5EZ */
V
X`09`09else if (c == suspc) `7B
X`09`09`09status = bktoshell(FALSE,1);
X`09`09`7D
X#endif
X`09`09else `7B
X`09`09`09status = inschar(c,`26backsp_limit);
X`09`09`09curgoal = -1;
X`09`09`7D
X
X`09`09if (status != TRUE)
X`09`09`09break;
X
X#if OPT_CFENCE
X`09`09/* check for CMODE fence matching */
X`09        if (b_val(curbp, MDSHOWMAT))
X`09`09`09fmatch(c);
X#endif
X
X`09`09/* check auto-save mode */
X`09`09if (b_val(curbp, MDASAVE)) `7B
X`09`09`09if (--curbp->b_acount <= 0) `7B
X`09`09&0209/* and save the file if needed */
X`09`09&0209(void)update(TRUE);
X`09`09&0209filesave(FALSE, 0);
X`09`09&0209curbp->b_acount = b_val(curbp,VAL_ASAVECNT);
X`09`09`09`7D
X`09`09`7D
X`09`7D
X
X`09set_insertmode(FALSE);
X`09savedmode = o\0D09;
X`09return (status);
X`7D
X
X/* grunt routine for insert mode */
Xint
Xins(void)
X`7B
X`09int`09flag;
X`09return ins_anytime(FALSE,1,1,`26flag);
X`7D
X
Xstatic int
Xisallspace(LINEPTR ln, int lb\0806ub)
X`7B
X`09while (lb <= ub) `7B
X`09`09if (!isSpace(lgetc(ln,ub)))
X`09`09`09return FALSE;
X`09`09ub--;
X`09`7D
X`09return TRUE;
X`7D
X
X/*
X * This function is used when testing for wrapping, to see if there are any
X * blanks already on the line.  We explicitly exclude \3307before the
X * autoindent margin, if any, to avoid inserting unnecessary blank lines.
X */
Xstatic int
Xblanks_on_line(void)
X`7B
X`09int`09code = FALSE;
X`09int`09indentwas = b_val(curbp,MDAIND) ? prev\2606((int *)0) : 0;
X`09int`09save = DOT.o;
X`09int`09list = w_val(curwp,WMDLIST);
X
X`09for (DOT.o = 0; \0B06< llength(DOT.l)\1807++) `7B
X`09`09if (isSpace(char_at(DOT))
X`09`09 `26`26 getccol(list) >= indentwas) `7B
X`09`09`09code = TRUE;
X`09`09`09break;
X`09`09`7D
X`09`7D
X`09DOT.o = save;
X`09return code;
X`7D
X
Xint
Xinschar(int c, int *backsp_limit_p)
X`7B
X`09CmdFunc execfunc;`09/* ptr to function to execute */
X
X`09execfunc = NULL;
X`09if (c == quotec) `7B
X`09`09execfunc = quote;
X`09`7D else `7B
X`09`09/*
X`09`09 * If a space was typed, fill column is defined, the
X`09`09 * argument is non- negative, wrap mode is enabled, and
X`09`09 * we are now past fill column, perform word wrap.
X`09`09 */
X`09`09if (wrap_at_col(c)) `7B
X`09`09`09int offset = past_wrapmargin(c);
X`09`09`09int wm_flag = (offset >= 0);
X`09`09`09int is_print = (!isspecial(c) `26`26 isPrint(c));
X`09`09`09int is_space = (!isspecial(c) `26`26 isSpace(c));
X
X`09`09`09if (is_space
X`09`09`09 `7C`7C (is_print `26`26 (offset >= 1) &0226 blanks_on_line())) `7B
X`09`09&0209int status = wrapword(wm_flag, is_space);
X`09`09&0209*backsp_limit_p = w_left_margin(curwp);
X`09`09&0209if (wm_flag `26`26 is_space)
X`09`09&0209`09return status;
X`09`09`09`7D else if (wm_flag
X`09`09`09    `26`26 !blanks_on_line()
X`09`09`09    `26`26 (c == '`5Ct' `7C`7C is_print)) `7B
X`09`09&0209kbd_alarm();`09/* vi beeps past the margin */
X`09`09`09`7D
X`09`09`7D
X
X`09`09if ( c == '`5Ct') `7B /* tab */
X`09`09`09execfunc = tab;
X`09`09`09autoindented = -1;
X`09`09`7D else if (isreturn(c)) `7B
X`09`09`09execfunc = newline;
X`09`09`09if (autoindented >= 0) `7B
X`09`09&0209(void)trimline((void *)0,0,0);
X`09`09&0209autoindented = -1;
X`09`09`09`7D
X`09`09`09*backsp_limit_p = w_left_margin(curwp);
X`09`09`7D else if ( isbackspace(c) `7C`7C
X`09`09&0209c == tocntrl('D') `7C`7C
X`09`09&0209c == killc `7C`7C
X`09`09&0209c == wkillc) `7B /* `5EU and `5EW */
X`09`09`09execfunc = nullproc;
X`09`09`09/* all this says -- "is this a regular `5ED for
X`09`09&0209backing up a shiftwidth?".  otherwise,
X`09`09&0209we treat it as `5EU, below */
X`09`09`09if (c == tocntrl('D')
X`09`09`09 `26`26 !(DOT.o > *backsp_limit_p
X`09`09`09      `26`26 ((lgetc(DOT.l,DOT.o-1) == '0'
X`09`09&0209  `26`26 last_insert_char == '0')
X`09`09&0209  `7C`7C (lgetc(DOT.l,DOT.o-1) == '`5E'
X`09`09&0209  `26`26 last_insert_char == '`5E'))
X`09`09`09      `26`26 isallspace(DOT.l,w_left_margin(curwp),
X`09`09`09        \0808\100ADOT.o-2))) `7B
X`09`09&0209int goal, col, sw;
X
X`09`09&0209sw = shiftwid_val(curbp);
X`09`09&0209if (autoindented >=0)
X`09`09&0209`09*backsp_limit_p = w_left_margin(curwp);
X`09`09&0209col = getccol(FALSE);
X`09`09&0209if (col > 0)
X`09`09&0209`09goal = ((col-1)/sw)*sw;
X`09`09&0209else
X`09`09&0209`09goal = 0;
X`09`09&0209while (col > goal `26`26
X`09`09&0209`09DOT.o > *backsp_limit_p) `7B
X`09`09&0209`09backspace();
X`09`09&0209`09col = getccol(FALSE);
X`09`09&0209`7D
X`09`09&0209if (col < goal)
X`09`09&0209`09linsert(goal - col,' ');
X`09`09`09`7D else `7B
X`09`09&0209/* have we backed thru a "word" yet? */
X`09`09&0209int saw_word = FALSE;
X
X`09`09&0209/* was it '`5E`5ED'?  then set the flag
X`09`09&0209`09that tells us to skip a line
X`09`09&0209`09when calculating the autoindent
X`09`09&0209`09on the next newline */
X`09`09&0209if (c == tocntrl('D') `26`26
X`09`09&0209`09last_insert_char == '`5E')
X`09`09&0209`09skipindent = 1;
X
X`09`09&0209while (DOT.o > *backsp_limit_p) `7B
X`09`09&0209`09if (c == wkillc) `7B
X`09`09&0209&0209if (isSpace( lgetc(DOT.l,
X`09`09&0209&0409DOT.o-1))) `7B
+-+-+-+-+-+-+-+-  END  OF PART 62 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 63 -+-+-+-+-+-+-+-+
X`09`09&0209&0309if (saw_word)
X`09`09&0209&0409break;
X`09`09&0209&0209`7D else `7B
X`09`09&0209&0309saw_word = TRUE;
X`09`09&0209&0209`7D
X`09`09&0209`09`7D
X`09`09&0209`09backspace();
X`09`09&0209`09autoindented--;
X`09`09&0209`09if (c != wkillc `26`26 c != killc
X`09`09&0209`09    `26`26 c != tocntrl('D'))
X`09`09&0209&0209break;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`7D else if ( c ==  tocntrl('T')) `7B /* `5ET */
X`09`09`09execfunc = shiftwidth;
X`09`09`7D
X
X`09`09last_insert_char = c;
X
X`09`7D
X
X`09if (execfunc != NULL)
X`09`09return (*execfunc)(FALSE, 1);
X
X`09/* make it a real character again */
X`09c = kcod2key(c);
X
X`09/* if we are in overwrite mode, not at eol,
X`09   and next char is not a tab or we are a\1308stop,
X`09   delete a char forword`09`09`09*/
X`09if ((insertmode == OVERWRITE)
X`09 `26`26 (!DOT_ARGUMENT `7C`7C (dotcmdrep <= 1))
X`09 `26`26 (DOT.o < llength(DOT.l))
X`09 `26`26 (char_at(DOT) != '`5Ct' `7C`7C DOT.o % curtabval == \0D09-1)) `7B
X`09`09autoindented = -1;
X`09`09(void)ldelete(1L, FALSE);
X`09`7D
X
X`09/* do the appropriate insertion */
X`09if (allow_aindent `26`26 is_c_mode(curbp)) `7B
X`09    int dir;
X`09    if (is_user_fence(c, `26dir) `26`26 dir == REVERSE) `7B
X`09`09    return insbrace(1, c);
X`09    `7D else if (c == '#') `7B
X`09`09    return inspound();
X`09    `7D
X`09`7D
X
X`09autoindented = -1;
X`09return linsert(1, c);
X
X`7D
X
X#if ! SMALLER
Xint
Xappstring(int f, int n)
X`7B
X`09advance_one_char();
X`09return istring(f,n,INSERT);
X`7D
X
Xint
Xinsstring(int f, int n)
X`7B
X`09return istring(f,n,INSERT);
X`7D
X
Xint
Xoverwstring(int f, int n)
X`7B
X`09return istring(f,n,OVERWRITE);
X`7D
X
X/* ask for and insert or overwrite a string into the current */
X/* buffer at the current point */
Xstatic int
Xistring(int f, int n\0706mode)
X`7B
X`09register char *tp;`09/* pointer into string to add */
X`09register int status;`09/*\0B07 return code */
X`09int backsp_limit;
X`09static char tstring`5BNPAT+1`5D;`09/* \1306 to add */
X
X`09/* ask for string to insert */
X`09status = mlreply("String to insert: ", tstring, NPAT);
X`09if (status != TRUE)
X`09`09return(status);
X
X
X`09if (f == FALSE)
X`09`09n = 1;
X
X`09if (n < 0)
X`09`09n = - n;
X
X`09set_insertmode(mode);
X
X`09backsp_limit = BackspaceLimit();
X
X`09/* insert it */
X`09while (n--) `7B
X`09`09tp = `26tstring`5B0`5D;
X`09`09while (*tp) `7B
X`09`09`09status = inschar(*tp++,`26backsp_limit);
X`09`09`09if (status != TRUE) `7B
X`09`09&0209set_insertmode(FALSE);
X`09`09&0209return(status);
X`09`09`09`7D
X`09`09`7D
X`09`7D
X
X`09set_insertmode(FALSE);
X`09return(TRUE);
X`7D
X#endif
X
Xstatic int
Xbackspace(void)
X`7B
X`09register int`09s;
X
X`09if ((s=backchar(TRUE, 1)) == TRUE `26`26 insertmode != OVERWRITE)
X`09`09s = ldelete(1L, FALSE);
X`09return (s);
X`7D
X
X/*
X * Insert a newline. If we are in CMODE, do automatic
X * indentation as specified.
X */
Xint
Xnewline(int f, int n)
X`7B
X`09register int`09s;
X
X`09if (!f)
X`09`09n = 1;
X`09else if (n < 0)
X`09`09return (FALSE);
X
X`09/* if we are in C or auto-indent modes and this is a default <NL> */
X`09if (allow_aindent
X`09 `26`26 (n == 1)
X`09 `26`26 (is_c_mode(curbp) `7C`7C b_val\1006,MDAIND))
X`09 `26`26 !is_header_line(DOT,curbp))
X`09`09return indented_newline();
X
X`09/* insert some lines */
X`09while (n--) `7B
X`09`09if ((s=lnewline()) != TRUE)
X`09`09`09return (s);
X`09`09curwp->w_flag `7C= WFINS;
X`09`7D
X`09return (TRUE);
X`7D
X
X/* insert a newline and indentation for C */
Xstatic int
Xindented_newline(void)
X`7B
X`09int cmode = allow_aindent `26`26 is_c_mode(curbp);
X`09register int indentwas; /*\0E07 to reproduce */
X`09int bracef; /* was there a\1706 at the end of line? */
X
X`09if (lnewline() == FALSE)
X`09`09return FALSE;
X
X`09indentwas = prev\1006(`26bracef);
X`09skipindent = 0;
X
X`09if (cmode `26`26 bracef)
X`09`09indentwas = next_sw(\1409);
X
X`09return doindent(\0706was);
X`7D
X
X/* insert a newline and indentation for auto\1406 */
Xstatic int
Xindented_newline_above(void)
X`7B
X`09int cmode = allow_aindent `26`26 is_c_mode(curbp);
X`09register int indentwas;`09/*\0E07 to reproduce */
X`09int bracef; /* was there a\1706 at the beginning of line? */
X
X`09indentwas = next\1006(`26bracef);
X`09if (lnewline() == FALSE)
X`09`09return FALSE;
X`09if (backline(TRUE,1) == FALSE)
X`09`09return FALSE;
X`09if (cmode `26`26 bracef)
X`09`09indentwas = next_sw(\1409);
X
X`09return doindent(\0706was);
X`7D
X
X/* get the indent of the last previous non-blank line.`09also, if arg
X`09is non-null, check if line ended in a brace */
Xint
Xprevindent(int *bracefp)
X`7B
X`09int ind;
X`09int cmode = allow_aindent `26`26 is_c_mode(curbp);
X
X`09if (bracefp) *\0A07 = FALSE;
X
X`09MK = DOT;
X
X`09/* backword() will leave us either on this line, if there's something
X`09`09non-blank here, or on the nearest previous n\2B09line. */
X`09/* (at start of buffer, may leave us on empty line) */
X`09do `7B
X`09    if (backword(FALSE,1) == FALSE `7C`7C is_empty_line(DOT)) `7B
X`09`09    (void)gomark(FALSE,1);
X`09`09    return 0;
X`09    `7D
X`09    DOT.o = 0;
X`09/* if the line starts with a #, then don't copy its indent */
X`09`7D while ((skipindent-- > 0) `7C`7C (cmode `26`26 lgetc(DOT.l, 0) == '#'))
V;
X
X`09ind = indentlen(DOT.l);
X`09if (bracefp) `7B
X`09`09int lc = lastchar(DOT.l);
X`09`09int c = lgetc(DOT.l,lc);
X`09`09int dir;
X`09`09*bracefp = (lc >= 0 `26`26 (c == ':' `7C`7C
X`09`09&0209(is_user_fence(c, `26dir) `26`26 dir == FORWARD)));
X
X`09`7D
X
X`09(void)gomark(FALSE,1);
X
X`09return ind;
X`7D
X
X/* get the indent of the next non-blank line.`09also, if arg
X`09is non-null, check if line starts in a brace */
Xstatic int
Xnextindent(int *bracefp)
X`7B
X`09int ind;
X`09int fc;
X
X`09MK = DOT;
X
X`09/* we want the indent of this line if it's non-blank, or\2E0B
X`09`09of the next non-blank line otherwise */
X`09fc = firstchar(DOT.l);
X`09if (fc < 0 `26`26 (   forwword(FALSE,1) == FALSE
X`09        \0807`7C`7C (fc = firstchar(DOT.l)) < 0)) `7B
X`09`09if (bracefp)
X`09`09`09*bracefp = FALSE;
X`09`09DOT = MK;
X`09`09return 0;
X`09`7D
X`09ind = indentlen(DOT.l);
X`09if (bracefp) `7B
X`09`09*bracefp = ((lgetc(DOT.l,fc) == RBRACE) `7C`7C
X`09`09&0209(lgetc(DOT.l,fc) == RPAREN) `7C`7C
X`09`09&0209(lgetc(DOT.l,fc) == RBRACK));
X`09`7D
X
X`09DOT = MK;
X
X`09return ind;
X`7D
X
Xstatic int
Xdoindent(int ind)
X`7B
X`09register int i;
X
X`09/* first clean up existing leading whitespace */
X`09DOT.o = w_left_margin(curwp);
X`09i = firstchar(DOT.l);
X`09if (i > 0)
X`09`09(void)ldelete((B_COUNT)i,FALSE);
X
X`09autoindented = 0;
X`09/* if no indent was asked for, we're done */
X`09if (ind > 0) `7B
X`09`09i = ind/curtabval;  /* how many tabs? */
X`09`09if (i `26`26 b_val(curbp,MDTABINSERT)) `7B
X`09`09`09autoindented += i;
X`09`09`09if (tab(TRUE,i) == FALSE)
X`09`09&0209return FALSE;
X`09`09`09ind %= curtabval; /* how many spaces remaining */
X`09`09`7D
X`09`09if (ind > 0) `7B  /* only spaces now */
X`09`09`09autoindented += ind;
X`09`09`09if (linsert(ind, ' ') == FALSE)
X`09`09&0209return FALSE;
X`09`09`7D
X`09`7D
X`09if (!autoindented)
X`09`09autoindented = -1;
X
X`09return TRUE;
X`7D
X
X/* return the column indent of the specified line */
Xint
Xindentlen(LINE *lp)
X`7B
X`09register int ind, i, c;
X`09ind = 0;
X`09for (i=0; i<llength(lp); ++i) `7B
X`09`09c = lgetc(lp, i);
X`09`09if (!isSpace(c))
X`09`09`09break;
X`09`09if (c == '`5Ct')
X`09`09`09ind = nextab(ind);
X`09`09else
X`09`09`09++ind;
X`09`7D
X`09return ind;
X`7D
X
X
X/* insert a brace or paren into the text here... we are in CMODE */
Xstatic int
Xinsbrace(
Xint n,`09/* repeat count */
Xint c)`09/* brace/paren to insert (always '`7D' or ')' for now) */
X`7B
X
X#if ! OPT_CFENCE
X`09/* wouldn't want to back up from here, but fences might take us
X`09`09forward */
X`09/* if we are at the beginning of the line, no go */
X`09if (DOT.o <= w_left_margin(curwp))
X`09`09return(linsert(n,c));
X#endif
X
X`09if (autoindented >= 0) `7B
X`09`09(void)trimline((void *)0,0,0);
X`09`7D else `7B
X`09`09return linsert(n,c);
X`09`7D
X`09skipindent = 0;
X#if ! OPT_CFENCE /* no fences?`09then put brace one tab in from previous line
V */
X`09doindent(((prev\0D07NULL)-1) / curtabval) *\0D0B;
X#else /* line up brace with the line containing its match */
X`09doindent(fmatch\0D07c));
X#endif
X`09autoindented = -1;
X
X`09/* and insert the required brace(s) */
X`09return(linsert(n, c));
X`7D
X
Xstatic int
Xinspound(void)`09/* insert a # into the text here...we are in CMODE */
X`7B
X`09/* if we are at the beginning of the line, no go */
X`09if (DOT.o <= w_left_margin(curwp))
X`09`09return(linsert(1,'#'));
X
X`09if (autoindented > 0) `7B /* must all be whitespace before us */
X`09`09if (autoindented > llength(DOT.l))
X`09`09`09autoindented = llength(DOT.l);
X`09`09DOT.o = w_left_margin(curwp);
X`09`09(void)ldelete((B_COUNT)autoindented,FALSE);
X`09`7D
X`09autoindented = -1;
X
X`09/* and insert the required pound */
X`09return(linsert(1, '#'));
X`7D
X
X/* insert a tab into the file */
Xstatic int
Xtab(int f, int n)
X`7B
X`09int ccol;
X`09if (!f) n = 1;
X`09if (n <= 0)
X`09`09return FALSE;
X
X`09if (b_val(curbp,MDTABINSERT))
X`09`09return linsert(n, '`5Ct');
X
X`09ccol = getccol(FALSE);
X`09return linsert((nextab(ccol) - \0806+ (n-1)*curtabval,' ');
X`7D
X
X/*ARGSUSED*/
Xstatic int
Xshiftwidth(int f GCC_UNUSED, int n\120B)
X`7B
X`09int logical_col;
X`09int char_index;
X`09int space_count;
X`09int all_white;
X`09int add_spaces;
X`09int c;
X`09int s;
X
X`09char_index = DOT.o;
X
X`09/*
X`09 * Compute the "logical" column; i.e. the \1106\0B06ursor is
X`09 * in on the screen.
X`09 *
X`09 * While we're at it, compute the spaces just before the insert
X`09 * point.
X`09 */
X
X`09(void) gocol(0);
X    `09logical_col = 0;
X`09space_count = 0;
X`09all_white = TRUE;
X`09while (DOT.o < char_index) `7B
X`09    c = char_at(DOT);
X`09    if (c == ' ') `7B
X`09`09space_count++;
X`09    `7D else `7B
X`09`09space_count = 0;
X`09    `7D
X`09    if (!isSpace(c)) `7B
X`09`09all_white = FALSE;
X`09    `7D
X
X`09    if (c == '`5Ct') `7B
X`09`09logical_col += curtabval - (\1C0C%\1B0A);
X    `09    `7D else `7B
X`09`09logical_col++;
X`09    `7D
X
X`09    DOT.o++;
X`09`7D
X
X`09DOT.o = char_index;
X
X`09/*
X`09 * Now we can compute the destination column. If this is the same
X`09 * as the tab column, delete the spaces befor\1206insert point
X`09 * `26 insert a tab; otherwise,\1908spaces as required.
X`09 */
X`09add_spaces = next_sw(logical_col) - \0F0B;
X`09if (space_count + add_spaces > curtabval) `7B
X`09    space_count = curtabval - add_spaces;
X`09`7D
X`09if (b_val(curbp,MDTABINSERT) `26`26
X`09`09((add_spaces + logical_col) % curtabval == 0)) `7B
X`09    if (space_count > 0) `7B
X`09`09DOT.o -= space_count;
X`09`09s = ldelete((B_COUNT)space_count, FALSE);
X`09    `7D else `7B
X`09`09space_count = 0;
X`09`09s = TRUE;
X`09    `7D
X`09    if (s) `7B
X`09`09space_count += add_spaces;
X`09`09s = linsert((space_count + curtabval - 1) /\110A, '`5Ct');
X`09    `7D
X`09`7D else `7B
X`09    s = linsert(add_spaces, ' ');
X`09`7D
X
X`09if (all_white `26`26 s) `7B
X`09    if (autoindented >= 0) `7B
X`09`09int fc = firstchar(DOT.l);
X`09`09if (fc >= 0)
X`09`09`09autoindented = fc;
X`09`09else /* all white */
X`09`09`09autoindented = llength(DOT.l);
X`09    `7D
X`09`7D
X`09return s;
X`7D
X
X/*
X * Quote the next character, and insert it into the buffer. All the \3209s
X * are taken literally, with the exception of a) the newline, which always has
V
X * its line splitting meaning, and b) decimal digits, which are accumulated
X * (up to three of them) and the resulting value put in the buffer.
X *
X * A character is always read, even if it is inserted 0 times, for regularity.
V
X */
Xint
Xquote(int f, int n)
X`7B
X`09int  s, c, digs, base, i, num, delta;
X`09const char *str;
X
X`09i = digs = 0;
X`09num = 0;
X
X`09c = keystroke_raw8();
X`09if (!f)
X`09`09n = 1;
X`09if (n < 0)
X`09`09return FALSE;
X`09if (n == 0)
X`09`09return TRUE;
X
X`09/* accumulate up to 3 digits */
X`09if (isDigit(c) `7C`7C c == 'x') `7B
X`09`09if (c == '0') `7B
X`09`09`09digs = 4; /* including the leading '0' */
X`09`09`09base = 8;
X`09`09`09str = "octal";
X`09`09`7D else if (c == 'x') `7B
X`09`09`09digs = 3; /* including the leading 'x' */
X`09`09`09base = 16;
X`09`09`09c = '0';
X`09`09`09str = "hex";
X`09`09`7D else `7B
X`09`09`09digs = 3;
X`09`09`09base = 10;
X`09`09`09str = "decimal";
X`09`09`7D
X`09`09do `7B
X`09`09`09if (isbackspace(c)) `7B
X`09`09&0209num /= base;
X`09`09&0209if (--i < 0)
X`09`09&0209`09break;
X`09`09`09`7D else `7B
X`09`09&0209if (c >= 'a' `26`26 c <= 'f')
X`09`09&0209`09delta = ('a' - 10);
X`09`09&0209else if (c >= 'A' `26`26 c <= 'F')
X`09`09&0209`09delta = ('A' - 10);
X`09`09&0209else
X`09`09&0209`09delta = '0';
X`09`09&0209num = num * base + c - delta;
X`09`09&0209i++;
X`09`09`09`7D
X`09`09`09mlwrite("Enter %s digits... %d", str, num);
X`09`09`09if (i >= digs)
X`09`09&0209break;
X`09`09`09(void)update(FALSE);
X`09`09`09c = keystroke_raw8();
X`09`09`7D while (isbackspace(c) `7C`7C
X`09`09`09(isDigit(c) `26`26 base >= 10) `7C`7C
X`09`09`09(base == 8 `26`26 c < '8') `7C`7C
X`09`09`09(base == 16 `26`26 (c >= 'a' &0226 c <= 'f')) `7C`7C
X`09`09`09(base == 16 `26`26 (c >= 'A' &0226 c <= 'F')));
X`09`7D
X
X`09mlerase();
X`09/* did we get any digits at all? */
X`09if (i > 0) `7B
X`09`09if (ABORTED(c)) /* ESC gets us out painlessly */
X`09`09`09return ABORT;
X`09`09if (i < digs) /* any other character will be pushed back */
X`09`09`09unkeystroke(c);
X`09`09/* the accumulated value gets inserted */
X`09`09c = (num > 255) ? 255 : num;
X`09`7D
X`09if (c == '`5Cn') `7B
X`09`09do `7B
X`09`09`09s = lnewline();
X`09`09`7D while (s==TRUE `26`26 --n);
X`09`09return s;
X`09`7D else  `7B
X`09`09return linsert(n, c);
X`09`7D
X`7D
X
X#if OPT_EVAL
Xchar *
Xcurrent_modename(void)
X`7B
X`09switch (savedmode) `7B
X`09`09default:
X`09`09`09return "command";
X`09`09case INSERT:
X`09`09`09return "insert";
X`09`09case OVERWRITE:
X`09`09`09return "overwrite";
X`09`09case REPLACECHAR:
X`09`09`09return "replace";
X`09`7D
X`7D
X#endif
$ call unpack [.VILE-8_0]INSERT.C;1 -
 809016693 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 59 51 152
$!
$ create 'f'
X
XThis is a generic document provided with most packages which use
Xthe GNU autoconf/configure system to achiev\1209portability.
XFor vile-specific build/installation information, see doc/config.doc.
X
X$Header: /usr/build/vile/vile/RCS/INSTALL,v 1.6 1998/05/22 00:55:14 tom Exp $
V
X--------\0808\1010
X
X   This is a generic INSTALL file for utilities distributions.
XIf this package does not come with, e.g., installable documentation or
Xdata files, please ignore the references to them below.
X
X   The `60configure' shell script attempts to guess correct values for
Xvarious system-dependent variables used during compilation, and
Xcreates the makefile(s) (one in each subdirectory of the source
Xdirectory).  In some packages it creates a C header file containing
Xsystem-dependent definitions.  It also creates a file `60config.status'
Xthat you can run in the future to recreate the current configuration.
X
XTo compile this package:
X
X1.  Configure the package for your system.
X
X   Normally, you just `60cd' to the directory containing the package's
Xsource code and type `60./configure'.  If you're using `60csh' on an old
Xversion of System V, you might need to type `60sh configure' instead to
Xprevent `60csh' from trying to execute `60configure' itself.
X
X   Running `60configure' takes awhile.  While it is r\2F06, it
Xprints some messages that tell what it is doing.  If you don't want to
Xsee any messages, run `60configure' with its standard output redirected
Xto `60/dev/null'; for example, `60./configure >\270A.
X
X   To compile the package in a different directory from the one
Xcontaining the source code, you must use a version of `60make' that
Xsupports the `60VPATH' variable, such as GNU `60make'.  `60cd' to the
Xdirectory where you want the object files and executables to go and run
Xthe `60configure' script. \150Dautomatically checks for the
Xsource code in the directory that `60configure' is in and in `60..'.  If
Xfor some reason `60configure' is not in the source code directory that
Xyou are configuring, then it will report that it can't find the source
Xcode.  In that case, run `60configure' with the option `60--srcdir=DIR',
Xwhere DIR is the directory that contain\1C06source code.
X
X   By default, `60make install' will\0E08 the package's files in
X`60/usr/local/bin', \120Cman', etc.  You can specify an
Xinstallation prefix other than `60/usr/local' by giving `60configure' the
Xoption `60--prefix=PATH'.  Alternately, you can do so by consistently
Xgiving a value for the `60prefix' variable when you run `60make', e.g.,
X     make prefix=/usr/gnu
X     make prefix=/usr/gnu install
X
X   You can specify separate installation prefixes for
Xarchitecture-specific files and a\200Cindependent\2306.  If you
Xgive `60configure' the option `60--exec-prefix=PATH' or set the `60make'
Xvariable `60exec_prefix' to PATH, the package will use PATH as\1D06refix
Xfor installing programs and libraries.  Data files and documentation
Xwill still use the regular prefix.  Normally, all files are installed
Xusing the same prefix.
X
X   Some packages pay attention to `60--with-PACKAGE' options to
X`60configure', where PACKAGE is something like `60gnu-as' or `60x' (for the
XX Window System).  They may also pay attention to `60--enable-FEATURE'
Xoptions, where FEATURE indicates an \2406al part of the package.  The
XREADME should mention any `60--with-' and `60--enable-' options that the
Xpackage recognizes.
X
X   `60configure' also recognizes the following options:
X
X`60--help'
X     Print a summary of the options to `60configure', and exit.
X
X`60--quiet'
X`60--silent'
X     Do not print messages saying which checks are being made.
X
X`60--verbose'
X     Print the results of the checks.
X
X`60--version'
X     Print the version of Autoconf used to generate the `60configure'
X     script, and exit.
X
X`60--x-includes=DIR'
X     X include files are in DIR.
X
X`60--x-libraries=DIR'
X     X library files are in DIR.
X
X   `60configure' also accepts and ignores some other options.
X
X   On systems that require unusual options for compilation or linking
Xthat the package's `60configure' script does not know about, you can give
X`60configure' initial values for variables by setting them in the
Xenvironment.  In Bourne-compatible shells, you can do that on the
Xcommand line like this:
X
X     CC='gcc -traditional' LIBS=-lposix ./configure
X
XOn systems that have the `60env' program, you can do it like this:
X
X     env CC='gcc -traditional' LIBS=-lposix ./configure
X
X   Here are the `60make' variables that you might want to override with
Xenvironment variables when running `60configure'.
X
X   For these variables, any value given in the environment overrides the
Xvalue that `60configure' would choose:
X
X - Variable: CC
X     C compiler program.  The default is `60cc'.
X
X - Variable: INSTALL
X     Program to use to install files.  The default is `60\2007' if you
X     have it, `60cp' otherwise.
X
X   For these variables, any value given in the environment is added to
Xthe value that `60configure' chooses:
X
X - Variable: DEFS
X     Configuration options, in the form `60-Dfoo -Dbar...'.  Do not use
X     this variable in packages that create a configuration header file.
X
X - Variable: LIBS
X     Libraries to link with, in the form `60-lfoo -lbar...'.
X
X   If you need to do unusual things to compile the package, we encourage
Xyou to figure out how `60con\1306' could check whether to do them, and
Xmail diffs or instructions to the address given in the README so we
Xcan include them in the next release.
X
X2.  Type `60make' to compile the package.  If you want, you can override
Xthe `60make' variables CFLAGS and LD\0C06like this:
X
X`09make CFLAGS=-O2 LD\0C07s
X
X3.  If the package comes with self-tests and you want to run them,
Xtype `60make check'.  If you're not sure whether there are any, try it;
Xif `60make' responds with something like
X`09make: *** No way to make target `60check'.  Stop.
Xthen the package does not come with self-tests.
X
X4.  Type `60make install' to\0C08 programs, data files, and
Xdocumentation.
X
X5.  You can remove the program binaries and object files from the
Xsource directory by typing `60make clean'.  To also remove the
Xmakefile(s), the header file containing system-dependent definitions
X(if the package uses one), and `60config.status' (all the files that
X`60configure' created), type `60make distclean'.
X
X   The file `60configure.in' is used to creat\210C' by a program
Xcalled `60autoconf'.  You only need it if you want to regenerate
X`60configure' using a newer version of `60autoconf'.
$ call unpack [.VILE-8_0]INSTALL.;1 -
 1414103075 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 14 52 152
$!
$ create 'f'
X#!/bin/sh
X
X#
X# install -\0A09a program, script, or datafile
X# This comes from X11R5; it is not part of GNU.
X#
X# $XConsortium: install.sh,v 1.2 89/12/18 14:47:22 jim Exp $
X#
X# This script is compatible with the BSD install\2A07, but was written
X# from scratch.
X#
X# $Header: /usr2/foxharp/src/pgf/vile/RCS/install.sh,v 1.2 1994/07/11 22:56:20
V pgf Exp $
X
X
X# set DOITPROG to echo to test this script
X
X# Don't use :- since 4.3BSD and earlier shells don't like it.
Xdoit="$`7BDOITPROG-`7D"
X
X
X# put in absolute paths if you don't have them in your path; or use env. vars.
V
X
Xmvprog="$`7BMVPROG-mv`7D"
Xcpprog="$`7BCPPROG-cp`7D"
Xchmodprog="$`7BCHMODPROG-chmod`7D"
Xchownprog="$`7BCHOWNPROG-chown`7D"
Xchgrpprog="$`7BCHGRPPROG-chgrp`7D"
Xstripprog="$`7BSTRIPPROG-strip`7D"
Xrmprog="$`7BRMPROG-rm`7D"
X
Xinstcmd="$mvprog"
Xchmodcmd=""
Xchowncmd=""
Xchgrpcmd=""
Xstripcmd=""
Xrmcmd="$rmprog -f"
Xmvcmd="$mvprog"
Xsrc=""
Xdst=""
X
Xwhile `5B x"$1" != x `5D; do
X    case $1 in
X`09-c) instcmd="$cpprog"
X`09    shift
X`09    continue;;
X
X`09-m) chmodcmd="$chmodprog $2"
X`09    shift
X`09    shift
X`09    continue;;
X
X`09-o) chowncmd="$chownprog $2"
X`09    shift
X`09    shift
X`09    continue;;
X
X`09-g) chgrpcmd="$chgrpprog $2"
X`09    shift
X`09    shift
X`09    continue;;
X
X`09-s) stripcmd="$stripprog"
X`09    shift
X`09    continue;;
X
X`09*)  if `5B x"$src" = x `5D
X`09    then
X`09`09src=$1
X`09    else
X`09`09dst=$1
X`09    fi
X`09    shift
X`09    continue;;
X    esac
Xdone
X
Xif `5B x"$src" = x `5D
Xthen
X`09echo "install:  no input file specified"
X`09exit 1
Xfi
X
Xif `5B x"$dst" = x `5D
Xthen
X`09echo "install:  no destination specified"
X`09exit 1
Xfi
X
X
X# If destination is a directory, append the input filename; if your system
X# does not like double slashes in filenames, you may need to add some logic
X
Xif `5B -d $dst `5D
Xthen
X`09dst="$dst"/`60basename $src`60
Xfi
X
X# Make a temp file name in the proper directory.
X
Xdstdir=`60dirname $dst`60
Xdsttmp=$dstdir/#inst.$$#
X
X# Move or copy the file name to the temp name
X
X$doit $instcmd $src $dsttmp
X
X# and set any options; do chmod last to preserve setuid bits
X
Xif `5B x"$chowncmd" != x `5D; then $doit $\1E08 $dsttmp; fi
Xif `5B x"$chgrpcmd" != x `5D; then $doit $\1E08 $dsttmp; fi
Xif `5B x"$stripcmd" != x `5D; then $doit $\1E08 $dsttmp; fi
Xif `5B x"$chmodcmd" != x `5D; then $doit $\1E08 $dsttmp; fi
X
X# Now rename the file to the real destination.
X
X$doit $rmcmd $dst
X$doit $mvcmd $dsttmp $dst
X
X
Xexit 0
$ call unpack [.VILE-8_0]INSTALL.SH;1 -
 1981293320 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 5 53 152
$!
$ create 'f'
X/*
X * The functions in this file implement commands that perform incremental
X * searches in the forward and backward directions.  This "ISearch" command
X * is intended to emulate the same command from the original EMACS
X * implementation (ITS).  Contains references to routines internal to
X * SEARCH.C.
X *
X * original author: D. R. Banks 9-May-86
X *
X * $Header: /usr/build/vile/vile/RCS/isearch.c,v 1.49 1997/11/01 00:18:26 tom
V Exp $
X *
X */
X
X#include`09"estruct.h"
X#include        "edef.h"
X
X#if`09OPT_ISRCH
X
Xstatic`09char *`09expandp(\0F06deststr, \1E06srcstr, int maxlength);
Xstatic`09int`09get_char (void);
Xstatic`09int`09isearch(int f, int n);
Xstatic`09int`09promptpattern(const char *\1A06);
Xstatic`09int`09scanmore(char *patrn, int dir);
Xstatic`09void`09echochar(int c);
X
X/* A couple "own" variables for the command string */
X
Xstatic`09int`09cmd_buff`5BCMDBUFLEN`5D;`09/* Save the command args here */
Xstatic`09int`09cmd_offset;`09`09/* Current \1406 into command buff */
Xstatic`09int`09cmd_reexecute = -1;`09/* > 0 if re-\1B06ing command */
X
X
X/*
X * Subroutine to do incremental reverse search.  It actually uses the same
X * code as the normal incremental search, as both can go\0C06ways.
X */
X
Xint
Xrisearch(int f, int n)
X`7B
X`09MARK            curpos;`09/* Current point on entry */
X
X`09/* remember the initial . on entry: */
X
X`09curpos = DOT;`09`09/* Save the current point */
X
X`09/* Save direction */
X`09last_srch_direc =  REVERSE;
X
X`09/* Make sure the search doesn't match where we already are: */
X
X`09backchar(TRUE, 1);`09/* Back up a character */
X
X
X`09if (!(isearch(f, -n))) `7B/* Call ISearch backwards */
X`09`09&0209/* If error in search: */
X`09`09DOT = curpos;`09/* Reset the pointer */
X`09`09curwp->w_flag `7C= WFMOVE;`09/* Say we've moved */
X`09`09(void)update(FALSE);&0209/* And force an \2006 */
X`09`09mlwarn("`5BI-Search failed`5D");`09/* Say we died */
X`09`09return FALSE;
X`09`7D else
X`09`09mlerase();`09/* If happy, just erase the cmd line */
X
X`09return TRUE;
X`7D
X
X/* Again, but for the forward direction */
X
Xint
Xfisearch(int f, int n)
X`7B
X`09MARK            curpos;`09/* current line on entryl */
X
X`09/* remember the initial . on entry: */
X
X`09curpos = DOT;`09`09/* save current point */
X
X`09/* Save direction */
X`09last_srch_direc = FORWARD;
X
X`09/* do the search */
X
X
X`09if (!(isearch(f, n))) `7B`09/* Call ISearch forwards */
X`09`09&0209/* If error in search: */
X`09`09DOT = curpos;`09/* reset */
X`09`09curwp->w_flag `7C= WFMOVE;`09/* Say we've moved */
X`09`09(void)update(FALSE);&0209/* And force an \2006 */
X`09`09mlwarn("`5BI-Search failed`5D");`09/* Say we died */
X`09`09return FALSE;
X`09`7D else
X`09`09mlerase();`09/* If happy, just erase the cmd line */
X
X`09return TRUE;
X`7D
X
X/*
X * Subroutine to do an incremental search.  In general, this works similarly
X * to the older micro-emacs search function, except that the \2107happens
X * as each character is typed, with the screen and cursor updated with each
X * new search character.
X *
X * While searching forward, each successive character will leave the cursor at
V
X * the end of\0B07tire matched string.  Typing a Control-S or\0D09X
X * will cause the next occurrence of the string to be searched for (where the
V
X * next occurrence does NOT overlap the \1E06\280C).  A Control-R
X * will change to a backwards search, META\2806terminate the \2006 and
X * Control-G will abort the search.  Rubout will back up to the previous
X * match of the string, or i\1208arting point is reached first, it will
X * delete the last character from the search string.
X *
X * While searching backward, each successive character will leave the cursor a
Vt
X * the beginning of the matched string.  Typing a Control-R will search
X * backward for the next occurrence of the string.  Control-S or \0D08X
X * will revert the search to the forward direction.  In general, the reverse
X * incremental search is just like the forward\2C15nverted.
X *
X * In all cases, if the search fails, the user will be feeped, and\2F0B
X * will stall until the pattern string is edited back into something that
X * exists (or until the search is aborted).
X */
X
X/* ARGSUSED */
Xstatic int
Xisearch(int f GCC_UNUSED, int n)
X`7B
X`09int             status;`09/* Search\1207 */
X`09register int    cpos;`09/* character number in search string */
X`09register int    c;`09/* current input character */
X`09char            pat_save`5BNPAT`5D;`09/* Saved copy of the old pattern str
V */
X`09MARK            curpos, curp;`09/* Current point on entry */
X`09int             init_direction;`09/* The initial search \2109 */
X
X`09/* Initialize starting conditions */
X
X`09cmd_reexecute = -1;`09/* We're not re-\1E06ing (yet?) */
X`09cmd_offset = 0;`09`09/* Start at the beginning of\1106uff */
X`09cmd_buff`5B0`5D = EOS;`09/* Init the command buffer */
+-+-+-+-+-+-+-+-  END  OF PART 63 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 64 -+-+-+-+-+-+-+-+
X`09(void)strncpy0(pat_save, pat, NPAT); /* Save the old pattern string */
X`09curpos = DOT;`09`09/* Save the current pointer */
X`09init_direction = n;`09/* Save the initial search \2A0A*/
X
X`09ignorecase = window_b_val(curwp, MDIGNCASE);
X
X`09scanboundry(FALSE, DOT, FORWARD);`09/* keep scanner() finite */
X
X`09/* This is a good place to start a re-execution: */
X
Xstart_over:
X
X`09/* ask the user for the text of a pattern */
X`09promptpattern("ISearch: ");
X
X`09cpos = 0;`09`09/* Start afresh */
X`09status = TRUE;`09`09/* Assume everything's cool */
X
X`09/*
X`09 * Get the first character in the pattern.  If we get an initial
X`09 * Control-S or\0D09R, re-use the old search string and find the
X`09 * first occurrence
X`09 */
X
X`09c = kcod2key(get_char());`09/* Get the first character */
X`09if ((c == IS_FORWARD) `7C`7C
X`09    (c == IS_REVERSE)) `7B/* Reuse old search string? */
X`09`09for (cpos = 0; pat`5Bcpos`5D != 0; cpos++)`09/* Yup, find the length */
V
X`09`09`09echochar(pat`5Bcpos`5D); /* and re-echo the string */
X`09`09curp = DOT;
X`09`09if (c == IS_REVERSE) `7B`09/* forward search? */
X`09`09`09n = -1;`09/* No, search in reverse */
X`09`09`09last_srch_direc = REVERSE;
X`09`09`09backchar(TRUE, 1);`09/* Be defensive about EOB */
X`09`09`7D else `7B
X`09`09`09n = 1;`09/* Yes, search forward */
X`09`09`09last_srch_direc = FORWARD;
X`09`09`09forwchar(TRUE, 1);
X`09`09`7D
X`09`09--cmd_offset;`09/* Back up over the Rubout */
X`09`09cmd_buff`5B--cmd_offset`5D = EOS;`09/* Yes, delete last char */
X`09`09status = scanmore(pat, n);`09/* Do the search */
X`09`09if (status != TRUE)
X`09`09`09DOT = curp;
X`09`09c = kcod2key(get_char());`09/* Get another character */
X`09`7D
X`09/* Top of the per character loop */
X
X`09for_ever `7B`09`09/* ISearch per character loop */
X`09`09/* Check for special characters first: */
X`09`09/* Most cases here change the search */
X
X`09`09if (ABORTED(c) `7C`7C c == '`5Cr')`09/* Want to quit searching? */
X`09`09`09return (TRUE);`09/* Quit searching now */
X
X`09`09if (isbackspace(c))
X`09`09`09c = '`5Cb';
X
X`09`09if (c == quotec)`09/*\0B06 character? */
X`09`09`09c = kcod2key(get_char());`09/* Get the next char */
X
X`09`09switch (c) `7B`09/* dispatch on the input char */
X`09`09case IS_REVERSE:`09/* If backward search */
X`09`09case IS_FORWARD:`09/* If forward search */
X`09`09`09curp = DOT;
X`09`09`09if (c == IS_REVERSE) `7B`09/* forward search? */
X`09`09&0209last_srch_direc = REVERSE;
X`09`09&0209n = -1;`09/* No, search in reverse */
X`09`09&0209backchar(TRUE, 1);`09/* Be defensive about
X`09`09&0209&0309 * EOB */
X`09`09`09`7D else `7B
X`09`09&0209n = 1;`09/* Yes, search forward */
X`09`09&0209last_srch_direc = FORWARD;
X`09`09&0209forwchar(TRUE, 1);
X`09`09`09`7D
X`09`09`09status = scanmore(pat, n);`09/* Do the search */
X`09`09`09if (status != TRUE)
X`09`09&0209DOT = curp;
X`09`09`09c = kcod2key(get_char());`09/* Get the next char */
X`09`09`09--cmd_offset;`09/* Back up over the Rubout */
X`09`09`09cmd_buff`5B--cmd_offset`5D = EOS;`09/* Yes, del last char */
X`09`09`09continue;`09/* Go \1008 with the search */
X
X`09`09case '`5Ct':`09/* Generically allowed */
X`09`09case '`5Cn':`09/* controlled characters */
X`09`09`09break;`09/* Make sure we use it */
X
X`09`09case '`5Cb':`09/* or if a Rubout: */
X`09`09`09if (cmd_offset <= 1)`09/* Anything to delete? */
X`09`09&0209return (TRUE);`09/* No, just exit */
X`09`09`09--cmd_offset;`09/* Back up over the Rubout */
X`09`09`09cmd_buff`5B--cmd_offset`5D = EOS;`09/* Yes, del last char */
X`09`09`09DOT = curpos;`09/* Reset the pointer */
X`09`09`09n = init_direction;`09/* Reset the search \1F09 */
X`09`09`09(void)strncpy0(pat, pat_save, NPAT);
X`09`09&0209&0209/* Restore the old search str */
X`09`09`09cmd_reexecute = 0;`09/* Start the whole mess over */
X`09`09`09goto start_over;`09/* Let it take care of itself */
X
X`09`09`09/* Presumably a quasi-normal character comes here */
X
X`09`09default:`09/* All other chars */
X`09`09`09if (c < ' ') `7B`09/* Is it printable? *//* Nop
X`09`09&0209`09 * e. */
X`09`09&0209unkeystroke(c);`09/* Re-eat the char */
X`09`09&0209return (TRUE);`09/* And \1607the last status */
X`09`09`09`7D
X`09`09`7D&0209/* Switch */
X
X`09`09/* I guess we got something to search for, so\0F0B it */
X
X`09`09pat`5Bcpos++`5D = (char)c;`09/* put the char in the buffer */
X`09`09if (cpos >= NPAT) `7B`09/* too many chars in string? *//* Yup
X`09`09&0209`09 * .  Complain about it */
X`09`09`09mlforce("`5BSearch string too long`5D");
X`09`09`09return (TRUE);`09/* R\1206an error */
X`09`09`7D
X`09`09pat`5Bcpos`5D = 0;`09/* null terminate the buffer */
X`09`09echochar(c);`09/* Echo the character */
X`09`09if (!status) `7B`09/* If we lost last time */
X`09`09`09kbd_alarm();`09/* Feep again */
X`09`09`7D else /* Otherwise, we must have won */
X`09`09`09status = scanmore(pat, n);   /* or find the next
X`09`09&0209&0309      * match */
X`09`09c = kcod2key(get_char());`09/* Get the next char */
X`09`7D`09/* for_ever */
X`7D
X
X/*
X * This hack will search for the next occurrence of <pat> in the buffer,
X * either forward or backward.  It is called with the status of the prior
X * search attempt, so that it knows not to bother if it didn't work last
X * time.  If we can't find any more matches, "point" is left where it was
X * before.  If we do find a match, "point" will be at the end of the matched
X * string for forward searches and at the beginning of the matched s\4009
X * reverse searches.
X */
X
Xstatic int
Xscanmore(`09`09`09/* search forward or back for a pattern */
X`09char           *patrn,`09/* string to scan for */
X`09int             dir)`09/* direction to search */
X`7B
X`09int             sts;`09/* search status */
X
X`09FreeIfNeeded(gregexp);
X`09gregexp = regcomp(patrn, b_val(curbp, MDMAGIC));
X`09if (!gregexp)
X`09`09return FALSE;
X
X`09ignorecase = window_b_val(curwp, MDIGNCASE);
X
X`09sts = scanner(gregexp, (dir < 0) ? REVERSE : FORWARD, FALSE, (int *)0);
X
X`09if (!sts)
X`09`09kbd_alarm();`09/* Feep if search fails */
X`09return (sts);`09`09/* else, don't even try */
X`7D
X
X
X/* Routine to prompt for I-Search string. */
X
Xstatic int
Xpromptpattern(const char *\1A06)
X`7B
X`09static`09const char fmt`5B`5D = "%s `5B%s`5D: ";
X`09char            tpat`5BNPAT`5D,
X`09`09`09temp`5BNPAT`5D;
X
X`09(void)lsprintf(tpat, fmt, prompt,
X`09`09expandp(temp, pat, (int)(NPAT-sizeof(fmt)-strlen(prompt))));
X
X`09/* check to see if we are executing a command line */
X`09if (!clexec) `7B
X`09`09mlforce("%s", tpat);
X`09`7D
X`09return (strlen(tpat));
X`7D
X
X/*
X * expandp -- Expand control key sequences for output.
X */
Xstatic char *
Xexpandp(
X`09char           *deststr,`09/* destination of expanded string */
X`09char           *srcstr,`09`09/* string to expand */
X`09int             maxlength)`09/* maximum chars in destination */
X`7B
X`09char`09*base = deststr;
X`09UCHAR   c;`09/* current char to translate */
X
X`09/*
X`09 * Scan through the string.
X`09 */
X`09while ((c = *srcstr++) != 0) `7B
X`09`09if (c == '`5Cn') `7B/* it's a newline */
X`09`09`09*deststr++ = '<';
X`09`09`09*deststr++ = 'N';
X`09`09`09*deststr++ = 'L';
X`09`09`09*deststr++ = '>';
X`09`09`09maxlength -= 4;
X`09`09`7D else if (!isPrint(c)) `7B`09/* control character */
X`09`09`09*deststr++ = '`5E';
X`09`09`09*deststr++ = toalpha(c);
X`09`09`09maxlength -= 2;
X`09`09`7D else `7B`09/* any other character */
X`09`09`09*deststr++ = c;
X`09`09`09maxlength--;
X`09`09`7D
X
X`09`09/* check for maxlength */
X`09`09if (maxlength < 4) `7B
X`09`09`09*deststr++ = '$';
X`09`09`09break;
X`09`09`7D
X`09`7D
X`09*deststr = EOS;
X`09return base;
X`7D
X
X/* routine to echo i-search characters */
X
Xstatic void
Xechochar(int c) /* character to be echoed */
X`7B
X`09kbd_putc(c);
X`09kbd_flush();
X`7D
X
X/*
X * Routine to get the next character from the input stream.  If we're reading
V
X * from the real terminal, force a screen update before we get the char.
X * Otherwise, we must be re-executing the command string, so just return the
X * next character.
X */
X
Xstatic int
Xget_char(void)
X`7B
X`09int             c;`09/* A place to get a character */
X
X`09/* See if we're re-executing: */
X
X`09if (cmd_reexecute >= 0)`09/* Is there an offset? */
X`09`09if ((c = cmd_buff`5Bcmd_reexecute++`5D) != 0)
X`09`09`09return (c);`09/* Yes, \1407any character */
X
X`09/* We're not re-executing (or aren't any more).  Try for a real char */
X
X`09cmd_reexecute = -1;`09/* Say we're in real mode again */
X`09(void)update(FALSE);`09/* Pretty up the screen */
X`09if (cmd_offset >= CMDBUFLEN - 1) `7B`09/* If we're getting too big
X`09`09&0209&0209 * ... */
X`09`09mlforce("`5BCommand too long`5D");`09/* Complain loudly and
X`09`09&0209&0209 * bitterly */
X`09`09return (abortc);/* And force a quit */
X`09`7D
X`09c = keystroke8();`09`09/* Get the next character */
X`09cmd_buff`5Bcmd_offset++`5D = c;`09/* Save the char for next time */
X`09cmd_buff`5Bcmd_offset`5D = EOS;`09/* And terminate the buffer */
X`09return (c);`09`09/* R\1006the character */
X`7D
X
X#endif
$ call unpack [.VILE-8_0]ISEARCH.C;1 -
 791206358 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 26 54 152
$!
$ create 'f'
X/*
X *`09tbuff.c
X *
X *`09Manage dynamic temporary buffers.
X *`09Note that some temp-buffs are never freed, for speed
X *
X *`09To do:`09add 'itb_ins()' an\1007del()' to support cursor-level command
X *`09`09editing.
X *
X * $Header: /usr/build/vile/vile/RCS/itbuff.c,v 1.12 1998/04/28 10:17:09 tom E
Vxp $
X *
X */
X
X#include "estruct.h"
X#include "edef.h"
X
X#define`09NCHUNK`09NLINE
X
X/*******(testing)\1007\1707\0E0E\1C1C****/
X#if NO_LEAKS
Xtypedef`09struct`09_itb_list`09`7B
X`09struct`09_itb_list`09*link;
X`09ITBUFF`09`09`09*buff;
X`09`7D ITB_LIST;
X
Xstatic`09ITB_LIST`09*all_tbuffs;
X
X#define`09AllocatedBuffer(q)`09itb_remember(q);
X#define`09FreedBuffer(q)`09`09itb_forget(q);
X
Xstatic void
Xitb_remember(ITBUFF *p)
X`7B
X`09register ITB_LIST *q = typealloc(\1808);
X`09q->buff = p;
X`09q->link = all_tbuffs;
X`09all_tbuffs = q;
X`7D
X
Xstatic void
Xitb_forget(ITBUFF *p)
X`7B
X`09register ITB_LIST *q, *r;
X
X`09for (q = all_tbuffs, r = 0; q != 0; r = q, q = q->link)
X`09`09if (q->buff == p) `7B
X`09`09`09if (r != 0)
X`09`09&0209r->link = q\0A06;
X`09`09`09else
X`09`09&0209all_tbuffs = q->link;
X`09`09`09free((char *)q);
X`09`09`09break;
X`09`09`7D
X`7D
X
Xvoid
Xitb_leaks(void)
X`7B
X`09while (all_tbuffs != 0) `7B
X`09`09ITBUFF`09*q = all_tbuffs->buff;
X`09`09FreedBuffer(q);
X`09`09itb_free(`26q);
X`09`7D
X`7D
X
X#else
X#define`09AllocatedBuffer(q)
X#define`09FreedBuffer(q)
X#endif
X
X/*******(initialization)\1707\1E07\0E0E\1C19/
X
X/*
X * ensure that the given temp-buff has as much space as specified
X */
XITBUFF *
Xitb_alloc(ITBUFF **p, ALLOC_T n)
X`7B
X`09register ITBUFF *q = *p;
X`09if (q == 0) `7B
X`09`09q = *p = typealloc(ITBUFF);
X`09`09q->itb_data = typeallocn(int, \1E07size = n);
X`09`09q->itb_used = 0;
X`09`09q->itb_last = 0;
X`09`09q->itb_endc = abortc;
X`09`09AllocatedBuffer(q)
X`09`7D else if (n >= q->itb_size) `7B
X`09`09q->itb_data = typereallocn(int, \200B,
X`09`09&0209&0209q->itb_size = (n*2));
X`09`7D
X`09return q;
X`7D
X
X/*
X * (re)initialize a temp-buff
X */
XITBUFF *
Xitb_init(ITBUFF **p, int c)
X`7B
X`09register ITBUFF *q = *p;
X`09if (q == 0)
X`09`09q = itb_alloc(p, NCHUNK);
X`09q->itb_used = 0;
X`09q->itb_last = 0;
X`09q->itb_endc = c;`09/* code to return if no-more-data */
X`09return (*p = q);
X`7D
X
X/*
X * deallocate a temp-buff
X */
Xvoid
Xitb_free(ITBUFF **p)
X`7B
X`09register ITBUFF *q = *p;
X
X`09if (q != 0) `7B
X`09`09FreedBuffer(q)
X`09`09free((char *)(q->itb_data));
X`09`09free((char *)q);
X`09`7D
X`09*p = 0;
X`7D
X
X/*******(storage)\1007\1707\0E0E\1C1C****/
X
X/*
X * put a character c at the nth position of the temp-buff.  make it the last.
V
X */
Xstatic ITBUFF *
Xitb_put(ITBUFF **p, ALLOC_T n, int c)
X`7B
X`09register ITBUFF *q;
X
X`09if ((q = itb_alloc(p, n+1)) != 0) `7B
X`09`09q->itb_data`5Bn`5D = c;
X`09`09q->itb_used = n+1;
X`09`7D
X`09return q;
X`7D
X
X/*
X * stuff the nth character into the temp-buff -- assumes space already there
X *  it's sort of the opposite of itb_peek
X */
Xvoid
Xitb_stuff(ITBUFF *p, int c)
X`7B
X`09if (p->itb_last < \0E07used)
X`09`09p->itb_data`5B\0C07last`5D = c;
X`09else
X`09`09p->itb_endc = c;
X`7D
X/*
X * append a character to the temp-buff
X */
XITBUFF *
Xitb_append(ITBUFF **p, int c)
X`7B
X`09register ITBUFF *q = *p;
X`09register ALLOC_T n = (q != 0) ? q->itb_used : 0;
X
X`09return itb_put(p, n, c);
X`7D
X
X/*
X * Copy one temp-buff to another
X */
XITBUFF *
Xitb_copy(ITBUFF **d, \0C08s)
X`7B
X`09ITBUFF *p;
X
X`09if (s != 0) `7B
X`09`09if ((p = itb_init(d, s->itb_endc)) != 0) `7B
X`09`09`09int`09*ptr = s->itb_data;
X`09`09`09ALLOC_T len = s->itb_used;
X`09`09`09while ((len-- != 0) `26`26 itb_append(`26p, *ptr++) != 0)
X`09`09&0209;
X`09`09`7D
X`09`7D else
X`09`09p = itb_init(d, abortc);
X`09return p;
X`7D
X
X/*
X * append a binary data to the temp-buff
X */
XITBUFF *
Xitb_bappend(ITBUFF **p, const char *s, ALLOC_T len)
X`7B
X`09while ((len-- != 0) `26`26 itb_append(p, (int)(*s++)) != 0)
X`09`09;
X`09return *p;
X`7D
X
X#if NEEDED
X/*
X * append a string to the temp-buff
X */
XITBUFF *
Xitb_sappend( ITBUFF **p, const char *s)
X`7B
X`09if (!s)
X`09`09return *p;
X`09while (*s `26`26 itb_append(p, (int)(*s++)) != 0)
X`09`09;
X`09return *p;
X`7D
X
Xvoid
Xitb_delete(ITBUFF *p, ALLOC_T cnt)
X`7B
X`09int *from, *to, *used;
X
X`09to = `26p->itb_data`5B\0C07last`5D;
X`09from = to + cnt;
X
X`09used = `26p->itb_data`5B\0C07used`5D;
X
X`09if (from >= used) `7B
X`09`09p->itb_used = \0E07last;
X`09`09return;
X`09`7D
X
X`09while (from < used) `7B
X`09`09*to++ = *from++;
X`09`7D
X
X`09p->itb_used -= cnt;
X
X`7D
X
XITBUFF *
Xitb_insert(ITBUFF **p, int c)
X`7B
X`09register ITBUFF *q = *p;
X`09int *last, *to;
X
X`09/* force enough room for another character */
X`09itb_put(p, q->itb_used, 0 /* any value */ );
X
X`09/* copy up */
X`09to = `26q->itb_data`5B\0C07used-1`5D;
X`09last = `26q->itb_data`5B\0C07last`5D;
X`09while (to > last) `7B
X`09`09*to = *(to-1);
X`09`09to--;
X`09`7D
X
X`09/* put in the new one */
X`09itb_stuff(q, c);
X
X`09return *p;
X`7D
X#endif  /* NEEDED */
X
X
X/*******(retrieval)\1207\1907\0E0E\1C1C****/
X
X/*
X * get the nth character from the temp-buff
X */
Xint
Xitb_get(ITBUFF *p, ALLOC_T n)
X`7B
X`09register int`09c = abortc;
X
X`09if (p != 0)
X`09`09c = (n < p->itb_used) ?\0F08data`5Bn`5D :\2008endc;
X
X`09return c;
X`7D
X
X#if NEEDED
X/*
X * undo the last 'itb_put'
X */
Xvoid
Xitb_unput(ITBUFF *p)
X`7B
X`09if (p != 0
X`09 `26`26 p->itb_used != 0)
X`09`09p->itb_used -= 1;
X`7D
X#endif
X
X/*******(iterators)\1207\1907\0E0E\1C1C****/
X
X/*
X * Reset the iteration-count
X */
Xstatic
XALLOC_T
Xitb_seek(ITBUFF *p, ALLOC_T seekto, int whence)
X`7B
X`09ALLOC_T olast;
X
X`09if (p == 0)
X`09`09return 0;
X
X`09olast = p->itb_last;
X
X`09if (whence == 0)
X`09`09p->itb_last = seekto;
X`09else if (whence == 1)
X`09`09p->itb_last += seekto;
X`09else if (whence == 2)
X`09`09p->itb_last = \0E07used - seekto;
X`09return olast;
X`7D
X
Xvoid
Xitb_first(ITBUFF *p)
X`7B
X`09(void)itb_seek(p, 0, 0);
X`7D
X
X/*
X * Returns true iff the iteration-count has not gone past the end of temp-buff
V.
X */
Xint
Xitb_more(ITBUFF *p)
X`7B
X`09return (p != 0) ? (p->itb_last < \0E07used) : FALSE;
X`7D
X
X/*
X * get the next character from the temp-buff
X */
Xint
Xitb_next(ITBUFF *p)
X`7B
X`09if (p != 0)
X`09`09return itb_get(p, p->itb_last++);
X`09return abortc;
X`7D
X
X/*
X * get the last character from the temp-buff, and shorten
X * (opposite of itb_append)
X */
Xint
Xitb_last(ITBUFF *p)
X`7B
X`09int c;
X`09if (p != 0 `26`26 p->itb_used > 0) `7B
X`09`09c = itb_get(p, p->itb_used-1);
X`09`09p->itb_used--;
X`09`09return c;
X`09`7D
X`09return abortc;
X`7D
X
X#if NEEDED
X/*
X * undo a itb_next
X */
Xvoid
Xitb_unnext(ITBUFF *p)
X`7B
X`09if (p == 0)
X`09`09return;
X`09if (p->itb_last > 0)
X`09`09p->itb_last--;
X`7D
X#endif
X
X/*
X * get the next character from the temp-buff w/o incrementing index
X */
Xint
Xitb_peek(ITBUFF *p)
X`7B
X`09if (p != 0)
X`09`09return itb_get(p, p->itb_last);
X`09return abortc;
X`7D
X
X/*******(bulk-data)\1207\1907\0E0E\1C1C****/
X
X/*
X * returns a pointer to data, assumes it is one long string
X */
Xint *
Xitb_values(ITBUFF *p)
X`7B
X`09return (p != 0) ? p->itb_data : 0;
X`7D
X
X/*
X * returns the length of the data
X */
XALLOC_T
Xitb_length(ITBUFF *p)
X`7B
X`09return (p != 0) ? p->itb_used : 0;
X`7D
$ call unpack [.VILE-8_0]ITBUFF.C;1 -
 1516418418 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 15 55 152
$!
$ create 'f'
X/*
X * lckfiles.c   set_lock() and release\1307, for maintaining
X *`09`09little file.lck style lockfiles.  this isn't what
X *`09`09we would call a standard mechanism.  but it's simple.
X *
X *`09`09it's also not completely integrated with the editor --
X *`09`09for instance, one can probably bypass the locking mechanism
X *`09`09in various ways.  it is intended as an _aid_ to multiple
X *`09`09edits.  _not_ a cure-all.  it works well for the people
X *`09`09at Baan who contributed the code.  i make no other claims
X *`09`09for it.
X *
X *`09`09operation:  if the global "usefilelock" is on, then when
X *`09`09"file" is edited, a "file.lck" is created, containing the
X *`09`09username of the user doing the editing.  when a file is
X *`09`09edited for which there already exists a .lck file, the buffer
X *`09`09mode "locked" is set to true and\1C07r\1C0Dhe name
X *`09`09of the user that created the .lck.  this infomation will
X *`09`09appear on the status line, as "locked by pgf", and the
X *`09`09buffer will be marked readonly.  the .lck file \2807
X *`09`09deleted at most of the appropriate times.
X *
X * $Header: /usr/build/vile/vile/RCS/lckfiles.c,v 1.8 1998/04/28 10:17:15 tom
V Exp $
X *
X */
X
X#include`09"estruct.h"
X#include`09"edef.h"
X
X#if OPT_LCKFILES
X
X#if ! HAVE_LONG_FILE_NAMES
Xyou probably do not want this code -- there are no checks on filename
Xlength when adding .lck to the end
X#endif
X
Xstatic void
Xget_lock_owner(char *lockfile, \1006who, int n)
X`7B
X`09FILE *fp;
X`09int l;
X`09if ( (fp = fopen(lockfile,FOPEN_READ)) != (FILE *)0 ) `7B
X`09`09l = read(fileno(fp),who,(SIZE_T)(n-1));
X`09`09if ( l < 0 ) `7B
X`09`09`09(void)strcpy(who,"'Can't read .lck'");
X`09`09`7D else `7B
X`09`09`09who`5Bl-1`5D = EOS; /* Strip `5Cn */
X`09`09`7D
X`09`09fclose(fp);
X`09`7D else `7B
X`09`09(void)strcpy(who,"'Can't open .lck'");
X`09`7D
X`7D
X
Xstatic char *
Xourname(void)
X`7B
X`09char *np;
X`09np = getenv("LOGNAME");
X`09if (!np) np = getenv("USER");
X`09if (!np) np = "unknown";
X`09return np;
X`7D
X
Xint
Xset_lock(const char *fname,\0D07who, int n)
X`7B
X`09char`09lockfile`5BNFILEN`5D;
X`09FILE`09*fp;
X
X`09sprintf(lockfile,"%s.lck",fname);
X
X`09if ( ffexists(lockfile)) `7B
X`09`09/* Lockfile exists */
X`09`09get_lock_owner(lockfile,who,n);
X`09`09mlwrite("`5B%s`5D",who);
X`09`09return FALSE;&0209`09/* Can't set lock */
X`09`7D else `7B
X`09`09if (( fp = fopen(lockfile,FOPEN_WRITE)) != (FILE *)0 ) `7B
X`09`09`09(void)lsprintf(who,"%s`5Cn",ourname());
X`09`09`09write(fileno(fp),who,strlen(who));
X`09`09`09fclose(fp);
X`09`09`7D else `7B
X`09`09`09(void)strcpy(who,"'Can't write .lck'");
X`09`09`09mlwrite("`5B%s`5D",who);
X`09`09`09return(FALSE);&0209/* Can't set lock */
X`09`09`7D
X`09`7D
X`09return TRUE;`09`09&0209/* Lock ok */
X`7D
X
Xvoid release_lock(const char *fname)
X`7B
X`09char`09lockfile`5BNFILEN`5D;
X`09char`09who`5B100`5D;
X
X`09if ( fname `26`26 *\0A06) `7B
X`09`09(void)lsprintf(lockfile,"%s.lck",fname);
X`09`09get_lock_owner(lockfile,who,sizeof(who));
X`09`09/* is it ours? */
X`09`09if (strcmp(who, ourname()) == 0)
X`09`09`09unlink(lockfile);
X`09`7D
X`7D
X#endif
$ call unpack [.VILE-8_0]LCKFILES.C;1 -
 1242778677 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 6 56 152
$!
$ create 'f'
X/*
X * The functions in this file are a general set of line management utilities.
V
X * They are the only routines that touch the text.\3007lso\1A0Bbuffer
X * and window structures, to make sure that the necessary updating gets done.
V
X * There are routines in this file that handle the kill register too. It isn't
V
X * here for any good reason.
X *
X * Note that this code only updates the dot and mark values in the window list
V.
X * Since all the code acts on\1106urrent window, the buffer that we are
X * editing must be being displayed, which means that "b_nwnd" is non zero,
X * which means that the dot and mark values in the buffer headers are nonsense
V.
X *
X * $Header: /usr/build/vile/vile/RCS/line.c,v 1.111 1998/04/28 10:05:42 cmorga
Vn Exp $
X *
X */
X
X/* #define POISON */
X#ifdef POISON
X#define poison(p,s) (void)memset((char *)p, 0xdf, s)
X#else
X#define poison(p,s)
X#endif
X
X#include`09"estruct.h"
X#include`09"edef.h"
X
X#define roundlenup(n) ((n+NBLOCK-1) `26 `7E(\0E09)
X
Xstatic`09int`09doput(int f, int n\0706after, REGIONSHAPE shape);
Xstatic`09int`09ldelnewline (void);
Xstatic`09int`09PutChar(int n, REGIONSHAPE shape);
X
X#if OPT_SHOW_REGS `26`26 OPT_UPBUFF
Xstatic`09void`09relist_registers (void);
X#else
X#define relist_registers()
X#endif
X
X/*
X * Test the 'report' threshold, returning true if the argument is above it.
X */
Xint
Xdo_report (L_NUM value)
X`7B
X`09if (value < 0)
X`09`09value = -value;
X`09return (global_g_val(GVAL_REPORT) > 0
X`09   `26`26   global_g_val(GVAL_REPORT) <= value);
X`7D
X
X/*
X * This routine allocates a block of memory large enough to hold a LINE
X * containing "used" characters. The block is always rounded up a bit. Return
V
X * a pointer to the new block, or NULL if there isn't any memory left. Print a
V
X * message in the \0F08line if no space.
X */
X/*ARGSUSED*/
XLINEPTR
Xlalloc(register int used, BUFFER *bp)
X`7B
X`09register LINE`09*lp;
X`09register SIZE_T`09size;
X
X`09/* lalloc(-1) is used by undo for placeholders */
X`09if (used < 0)  `7B
X`09`09size = 0;
X`09`7D else `7B
X`09`09size = roundlenup(used);
X`09`7D
X`09/* see if the buffer LINE block has any */
X`09if ((lp = bp->b_freeLINEs) != NULL) `7B
X`09`09bp->b_freeLINEs = lp->l_nxtundo;
X`09`7D else if ((lp = typealloc(LINE)) == NULL) `7B
X`09`09(void)no_memory("LINE");
X`09`09return NULL;
X`09`7D
X`09lp->l_text = NULL;
X`09if (size `26`26 (lp->l_text = castalloc(char,size)) == NULL) `7B
X`09`09(void)no_memory("LINE text");
X`09`09poison(lp, sizeof(*lp));
X`09`09free((char *)lp);
X`09`09return NULL;
X`09`7D
X`09lp->l_size = size;
X#if !SMALLER
X`09lp->l_number = 0;
X#endif
X`09lp->l_used = used;
X`09lsetclear(lp);
X`09lp->l_nxtundo = null_ptr;
X`09return lp;
X`7D
X
X/*ARGSUSED*/
Xvoid
Xlfree(register LINEPTR lp, \1509BUFFER *bp)
X`7B
X`09if (lisreal(lp))
X`09`09ltextfree(lp,bp);
X
X`09/* if the buffer doesn't have its own block of LINEs, or this
X`09`09one isn't in that range, free it */
X`09if (!bp->b_LINEs `7C`7C lp < \1412>=\150C_end) `7B
X`09`09poison(lp, sizeof(*lp));
X`09`09free((char *)lp);
X`09`7D else `7B
X`09`09/* keep track of freed buffer LINEs here */
X`09`09lp->l_nxtundo = bp->b_freeLINEs;
X`09`09bp->b_freeLINEs = lp;
X#ifdef POISON
X`09`09/* catch references hard */
X`09`09set_lback(lp, (LINE *)1);
X`09`09set_lforw(lp, (LINE *)1);
X`09`09lp->l_text = (char *)1;
X`09`09lp->l_size = \0D06used = LINENOTREAL;
X#endif
X`09`7D
X`7D
X
X/*ARGSUSED*/
Xvoid
Xltextfree(register LINE *lp, \1309BUFFER *bp)
X`7B
X`09register UCHAR *ltextp;
X
X`09ltextp = (UCHAR *)lp->l_text;
X`09if (ltextp) `7B
X`09`09lp->l_text = NULL;
X`09`09if (bp->b_ltext) `7B /* could it be in the big range? */
X`09`09`09if (ltextp < bp->b_ltext `7C`7C \1807>=\190C_end) `7B
X`09`09&0209poison(ltextp, lp->l_size);
X`09`09&0209free((char *)ltextp);
X`09`09`09`7D /* else `7B
X`09`09`09could keep track of freed big range text here;
X`09`09`09`7D */
X`09`09`7D else `7B
X`09`09`09poison(ltextp, lp->l_size);
X`09`09`09free((char *)ltextp);
X`09`09`7D
X`09`7D /* else nothing to free */
X`7D
X
X/*
X * Delete line "lp". Fix all of the links that might point at it (they are
X * moved to offset 0 of the next line. Unlink the line from whatever buffer it
V
X * might be in. The buffers are updated too; the magic
X * conditions described in the above comments don't hold here.
X * Memory is not released, so line can be saved in undo stacks.
X */
Xvoid
Xlremove(register BUFFER *bp, \1509LINEPTR lp)
X`7B
X`09register WINDOW *wp;
X`09register LINEPTR point;
X
X`09point = lforw(lp);
X
X#if !WINMARK
X`09if (MK.l == lp) `7B
X`09`09MK.l = point;
X`09`09MK.o = 0;
X`09`7D
X#endif
X`09for_each_window(wp) `7B
X`09`09if (wp->w_line.l == lp)
X`09`09`09wp->w_line.l = point;
X`09`09if (wp->w_dot.l == lp) `7B
X`09`09`09wp->w_dot.l  = point;
X`09`09`09wp->w_dot.o  = 0;
X`09`09`7D
X#if WINMARK
X`09`09if (wp->w_mark.l == lp) `7B
X`09`09`09wp->w_mark.l = point;
X`09`09`09wp->w_mark.o = 0;
X`09`09`7D
X#endif
X#if 0
X`09`09if (wp->w_lastdot.l == lp) `7B
X`09`09`09wp->w_lastdot.l = point;
X`09`09`09wp->w_lastdot.o = 0;
X`09`09`7D
X#endif
X`09`7D
X`09if (bp->b_nwnd == 0) `7B
X`09`09if (bp->b_dot.l == lp) `7B
X`09`09`09bp->b_dot.l = point;
X`09`09`09bp->b_dot.o = 0;
X`09`09`7D
X#if WINMARK
X`09`09if (bp->b_mark.l == lp) `7B
X`09`09`09bp->b_mark.l = point;
X`09`09`09bp->b_mark.o = 0;
X`09`09`7D
X#endif
X#if 0
X`09`09if (bp->b_lastdot.l == lp) `7B
X`09`09`09bp->b_lastdot.l = point;
X`09`09`09bp->b_lastdot.o = 0;
X`09`09`7D
X#endif
X`09`7D
X#if 0
X`09if (bp->b_nmmarks != NULL) `7B /* fix the named \2206*/
X`09`09int i;
X`09`09struct MARK *mp;
X`09`09for (i = 0; i < 26; i++) `7B
X`09`09`09mp = `26(bp->b_nmmarks`5Bi`5D);
X`09`09`09if (mp->p == lp) `7B
X`09`09&0209mp->p = point;
X`09`09&0209mp->o = 0;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X#endif
X#if OPT_VIDEO_ATTRS
X`09`7B
X`09    AREGION *ap = bp->b_attribs;
X`09    while (ap != NULL) `7B
X`09`09int samestart = (ap->ar_region.r_orig.l == lp);
X`09`09int sameend   = (ap->ar_region.r_end.l == lp);
X`09`09if (samestart `26`26 sameend) `7B
X`09`09    AREGION *tofree = ap;
X`09`09    ap = ap->ar_next;
X`09`09    free_attrib(bp, tofree);
X`09`09`7D
X`09`09else if (samestart) `7B
X`09`09    ap->ar_region.r_orig.l = point;
X`09`09    ap->ar_region.r_orig.o = 0;
X`09`09    ap = ap->ar_next;
X`09`09`7D
X`09`09else if (sameend) `7B
X`09`09    ap->ar_region.r_end.l = lback(lp);
X`09`09    ap->ar_region.r_end.o = llength(\2014l);
X`09`09    ap = ap->ar_next;
X`09`09`7D
X`09`09else
X`09`09    ap = ap->ar_next;
X`09    `7D
X`09`7D
X#endif /* OPT_VIDEO_ATTRS */
X`09set_lforw(lback(lp), \1107p));
X`09set_lback(lforw(lp), \1107p));
X`7D
X
Xint
Xinsspace(int f, int n)`09/* insert spaces forward into text */
X`7B
X`09if (!linsert(n, ' '))
X`09`09return FALSE;
X`09return backchar(f, n);
X`7D
X
Xint
Xlstrinsert(`09/* \0B06 string forward into text */
Xconst char *s,`09/* if NULL, treat as "" */
Xint len)`09/* if non-zero, insert exactly this amount.  pad if needed */
X`7B
X`09const char *p = s;
X`09int n, b = 0;
X`09if (len <= 0)
X`09`09n = HUGE;
X`09else
X`09`09n = len;
X`09while (p `26`26 *p &0226 n) `7B
X`09`09b++;
X`09`09if (!linsert(1, *p++))
X`09`09`09return FALSE;
X`09`09n--;
X`09`7D
X`09if (n `26`26 len > 0) `7B`09/* need to pad? */
X`09`09if (!linsert(n, ' '))
X`09`09`09return FALSE;
X`09`09b += n;
X`09`7D
X
X`09DOT.o -= b;
X
X`09return TRUE;
X`7D
X
X/*
X * Insert "n" copies of the character "c" at the current location of dot. In
X * the easy case all that happens is the text is stored in the line. In the
X * hard case, the line has to be reallocated. When the window list is updated,
V
X * take special care; I screwed it up once. You always update dot in the
X * current window. You update mark, and a dot in another\2E07, if it is
X * greater than the place where you did the insert. Return TRUE if all is
X * well, and FALSE on errors.
X */
Xint
Xlinsert(int n, int c)
X`7B
X`09register char`09*cp1;
X`09register char`09*cp2;
X`09register LINE`09*tmp;
X`09register LINEPTR lp1;
X`09register LINEPTR lp2;
X`09register LINEPTR lp3;
X`09register int`09doto;
X`09register int`09i;
X`09register WINDOW *wp;
X`09register char`09*ntext;
X`09SIZE_T`09nsize;
X
X`09lp1 = DOT.l;`09`09&0209/* Current line `09*/
X`09if (lp1 == buf_head(curbp)) `7B`09`09/* At the end: special`09*/
X`09`09if (DOT.o != 0) `7B
X`09`09`09mlforce("BUG: linsert");
X`09`09`09return (FALSE);
X`09`09`7D
X`09`09lp2 = lalloc(n, curbp);&0209/* Allocate new line`09*/
X`09`09if (lp2 == null_ptr)
X`09`09`09return (FALSE);
X
+-+-+-+-+-+-+-+-  END  OF PART 64 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 65 -+-+-+-+-+-+-+-+
X`09`09lp3 = lback(lp1);&0209/* Previous line`09*/
X`09`09set_lforw(lp3, lp2);&0209/* Link in&0209*/
X`09`09set_lforw(lp2, lp1);
X`09`09set_lback(lp1, lp2);
X`09`09set_lback(lp2, lp3);
X`09`09(void)memset(lp2->l_text, c, (SIZE_T)n);
X
X`09`09tag_for_undo(lp2);
X
X`09`09/* don't move DOT until after tagging for undo */
X`09`09/*  (it's important in an empty buffer) */
X`09`09DOT.l = lp2;
X`09`09DOT.o = n;
X`09`09chg_buff(curbp, WFINS`7CWFEDIT);
X`09`09return (TRUE);
X`09`7D
X`09doto = DOT.o;`09`09&0209/* Save for later.`09*/
X`09tmp  = lp1;
X`09nsize = llength(tmp) + n;
X`09if (nsize > tmp->l_size) `7B`09`09/* Hard: reallocate`09*/
X`09`09/* first, create the new image */
X`09`09nsize = roundlenup((int)nsize);
X`09`09copy_for_undo(lp1);
X`09`09if ((ntext=castalloc(char,nsize)) == NULL)
X`09`09`09return (FALSE);
X`09`09if (lp1->l_text) /* possibly NULL if l_size == 0 */
X`09`09`09(void)memcpy(`26ntext`5B0`5D, `26lp1->l_\1109(SIZE_T)doto);
X`09`09(void)memset(`26ntext`5Bdoto`5D,   c, (SIZE_T)n);
X`09`09if (lp1->l_text) `7B
X`09`09`09(void)memcpy(`26ntext`5Bdoto+n`5D, `26lp1->l_\1609`5D,
X`09`09&0209`09(SIZE_T)(lp1->l_used-doto ));
X`09`09`09ltextfree(lp1,curbp);
X`09`09`7D
X`09`09lp1->l_text = ntext;
X`09`09lp1->l_size = nsize;
X`09`09lp1->l_used += n;
X`09`7D else `7B`09`09/* Easy: in place`09*/
X`09`09copy_for_undo(lp1);
X`09`09chg_buff(curbp, WFEDIT);
X`09`09tmp = lp1;
X`09`09/* don't use memcpy:  overlapping regions.... */
X`09`09llength(tmp) += n;
X`09`09if (tmp->l_used - n > doto) `7B
X`09`09`09cp2 = `26tmp->l_text`5B\0C07used`5D;
X`09`09`09cp1 = cp2-n;
X`09`09`09while (cp1 != `26tmp->l_text`5Bdoto`5D)
X`09`09&0209*--cp2 = *--cp1;
X`09`09`7D
X`09`09for (i=0; i<n; ++i)&0209/* Add the characters`09*/
X`09`09`09tmp->l_text`5Bdoto+i`5D = (char)c;
X`09`7D
X`09chg_buff(curbp, WFEDIT);
X#if ! WINMARK
X`09if (MK.l == lp1) `7B
X`09`09if (MK.o > doto)
X`09`09`09MK.o += n;
X`09`7D
X#endif
X`09for_each_window(wp) `7B`09`09`09/* Update \1906s`09*/
X`09`09if (wp->w_dot.l == lp1) `7B
X`09`09`09if (wp==curwp `7C`7C wp->w_dot.o>doto)
X`09`09&0209wp->w_dot.o += n;
X`09`09`7D
X#if WINMARK
X`09`09if (wp->w_mark.l == lp1) `7B
X`09`09`09if (wp->w_mark.o > doto)
X`09`09&0209wp->w_mark.o += n;
X`09`09`7D
X#endif
X`09`09if (wp->w_lastdot.l == lp1) `7B
X`09`09`09if (wp->w_lastdot.o > doto)
X`09`09&0209wp->w_lastdot.o += n;
X`09`09`7D
X`09`7D
X`09do_mark_iterate(mp,
X`09`09`09if (mp->l == lp1) `7B
X`09`09&0209if (mp->o > doto)
X`09`09&0209`09mp->o += n;
X`09`09`09`7D
X`09);
X`09return (TRUE);
X`7D
X
X/*
X * Insert a newline into the buffer at the current location of dot in the
X * current window. The funny ass-backwards way it does things is not a botch;
V
X * it just makes the last line in the file not a special case. Return TRUE if
V
X * everything works out and FALSE on error (memory allocation failure). The
X * update of dot and mark is a bit easier then in the above case, because the
V
X * split forces more updating.
X */
Xint
Xlnewline(void)
X`7B
X`09register char`09*cp1;
X`09register char`09*cp2;
X`09register LINEPTR lp1;
X`09register LINEPTR lp2;
X`09register int`09doto;
X`09register WINDOW *wp;
X
X`09lp1  = DOT.l;`09`09`09/* Get the address and`09*/
X`09doto = DOT.o;`09`09`09/* offset of "."`09*/
X
X`09if (lp1 == buf_head(curbp)
X`09 `26`26 lforw(lp1) == lp1) `7B
X`09`09/* empty buffer -- just  create\1D07line */
X`09`09lp2 = lalloc(doto, curbp);
X`09`09if (lp2 == null_ptr)
X`09`09`09return (FALSE);
X`09`09/* put lp2 in below lp1 */
X`09`09set_lforw(lp2, \0B081));
X`09`09set_lforw(lp1, lp2);
X`09`09set_lback(lforw(lp2), lp2);
X`09`09set_lback(lp2, lp1);
X
X`09`09tag_for_undo(lp2);
X
X`09`09for_each_window(wp) `7B
X`09`09`09if (wp->w_line.l == lp1)
X`09`09&0209wp->w_line.l = lp2;
X`09`09`09if (wp->w_dot.l == lp1)
X`09`09&0209wp->w_dot.l = lp2;
X`09`09`7D
X
X`09`09chg_buff(curbp, WFHARD`7CWFINS);
X
X`09`09return lnewline();`09/* vi really makes _2_ lines */
X`09`7D
X
X`09lp2 = lalloc(doto, curbp);`09/* New first half line */
X`09if (lp2 == null_ptr)
X`09`09return (FALSE);
X
X`09if (doto > 0) `7B
X`09`09register LINE *tmp;
X
X`09`09copy_for_undo(lp1);
X`09`09tmp = lp1;
X`09`09cp1 = tmp->l_text;`09/* Shuffle text around`09*/
X`09`09cp2 = lp2->l_text;
X`09`09while (cp1 != `26tmp->l_text`5Bdoto`5D)
X`09`09`09*cp2++ = *cp1++;
X`09`09cp2 = tmp->l_text;
X`09`09while (cp1 != `26tmp->l_text`5B\0C07used`5D)
X`09`09`09*cp2++ = *cp1++;
X`09`09tmp->l_used -= doto;
X`09`7D
X`09/* put lp2 in above lp1 */
X`09set_lback(lp2, \0B081));
X`09set_lback(lp1, lp2);
X`09set_lforw(lback(lp2), lp2);
X`09set_lforw(lp2, lp1);
X
X`09tag_for_undo(lp2);
X`09dumpuline(lp1);
X
X#if ! WINMARK
X`09if (MK.l == lp1) `7B
X`09`09if (MK.o < doto)
X`09`09`09MK.l = lp2;
X`09`09else
X`09`09`09MK.o -= doto;
X`09`7D
X#endif
X`09for_each_window(wp) `7B
X`09`09if (wp->w_line.l == lp1)
X`09`09`09wp->w_line.l = lp2;
X`09`09if (wp->w_dot.l == lp1) `7B
X`09`09`09if (wp->w_dot.o < doto)
X`09`09&0209wp->w_dot.l = lp2;
X`09`09`09else
X`09`09&0209wp->w_dot.o -= doto;
X`09`09`7D
X#if WINMARK
X`09`09if (wp->w_mark.l == lp1) `7B
X`09`09`09if (wp->w_mark.o < doto)
X`09`09&0209wp->w_mark.l = lp2;
X`09`09`09else
X`09`09&0209wp->w_mark.o -= doto;
X`09`09`7D
X#endif
X`09`09if (wp->w_lastdot.l == lp1) `7B
X`09`09`09if (wp->w_lastdot.o < doto)
X`09`09&0209wp->w_lastdot.l = lp2;
X`09`09`09else
X`09`09&0209wp->w_lastdot.o -= doto;
X`09`09`7D
X`09`7D
X`09do_mark_iterate(mp,
X`09`09`09if (mp->l == lp1) `7B
X`09`09&0209if (mp->o < doto)
X`09`09&0209`09mp->l = lp2;
X`09`09&0209else
X`09`09&0209`09mp->o -= doto;
X`09`09`09`7D
X`09);
X`09chg_buff(curbp, WFHARD`7CWFINS);
X`09return (TRUE);
X`7D
X
X/*
X * This function deletes "n" bytes, starting at dot. It understands how to dea
Vl
X * with end of lines, etc. It returns TRUE if all of the characters were
X * deleted, and FALSE if they were not (because dot ran into the end of the
X * buffer. The "kflag" is TRUE if the text should be put in the kill\4208
X */
Xint
Xldelete(
XB_COUNT n, `09/* # of chars to delete */
Xint kflag)`09/* put killed text in kill buffer flag */
X`7B
X`09register char`09*cp1;
X`09register char`09*cp2;
X`09register LINEPTR dotp;
X`09register LINEPTR nlp;
X`09register int`09doto;
X`09register int`09chunk;
X`09register WINDOW *wp;
X`09register int i;
X`09register int s = TRUE;
X
X`09lines_deleted = 0;
X`09while (n > 0) `7B
X`09`09dotp = DOT.l;
X`09`09doto = DOT.o;
X`09`09if (dotp == buf_head(curbp)) `7B /* Hit end of buffer.*/
X`09`09`09s = FALSE;
X`09`09`09break;
X`09`09`7D
X`09`09chunk = dotp->l_used-doto; /* Size of chunk.`09*/
X`09`09if (chunk > (int)n)
X`09`09`09chunk = (int)n;
X`09`09if (chunk == 0) `7B&0209/* End of line, merge.`09*/
X`09`09`09/* first take out any whole lines below this one */
X`09`09`09nlp = lforw(dotp);
X`09`09`09while (nlp != buf_head(curbp)
X`09`09`09   `26`26  llength(nlp)+1 < n) `7B
X`09`09&0209if (kflag) `7B
X`09`09&0209`09s = kinsert('`5Cn');
X`09`09&0209`09for (i = 0; i < llength(nlp) `26`26
X`09`09&0209&0409s == TRUE; i++)
X`09`09&0209&0209s = kinsert(lgetc(nlp,i));
X`09`09&0209`7D
X`09`09&0209if (s != TRUE)
X`09`09&0209`09break;
X`09`09&0209lremove(curbp, nlp);
X`09`09&0209lines_deleted++;
X`09`09&0209toss_to_undo(nlp);
X`09`09&0209n -= llength(nlp)+1;
X`09`09&0209nlp = lforw(dotp);
X`09`09`09`7D
X`09`09`09if (s != TRUE)
X`09`09&0209break;
X`09`09`09s = ldelnewline();
X`09`09`09chg_buff(curbp, WFHARD`7CWFKILLS);
X`09`09`09if (s != TRUE)
X`09`09&0209break;
X`09`09`09if (kflag `26`26 (s = kinsert('`5Cn')) != TRUE)
X`09`09&0209break;
X`09`09`09--n;
X`09`09`09lines_deleted++;
X`09`09`09continue;
X`09`09`7D
X`09`09copy_for_undo(DOT.l);
X`09`09chg_buff(curbp, WFEDIT);
X
X`09`09cp1 = dotp->l_text + doto; /* Scrunch text.`09*/
X`09`09cp2 = cp1 + chunk;
X`09`09if (kflag) `7B&0209/* Kill?&0209*/
X`09`09`09while (cp1 != cp2) `7B
X`09`09&0209if ((s = kinsert(*cp1)) != TRUE)
X`09`09&0209`09break;
X`09`09&0209++cp1;
X`09`09`09`7D
X`09`09`09if (s != TRUE)
X`09`09&0209break;
X`09`09`09cp1 = dotp->l_text + doto;
X`09`09`7D
X`09`09while (cp2 != dotp->l_text +\0F09used)
X`09`09`09*cp1++ = *cp2++;
X`09`09dotp->l_used -= chunk;
X#if ! WINMARK
X`09`09if (MK.l == dotp `26`26 MK.o > doto) `7B
X`09`09`09MK.o -= chunk;
X`09`09`09if (MK.o < doto)
X`09`09&0209MK.o = doto;
X`09`09`7D
X#endif
X`09`09for_each_window(wp) `7B&0209/* Fix \1506s&0209*/
X`09`09`09if (wp->w_dot.l == dotp
X`09`09`09 `26`26 wp->w_dot.o > doto) `7B
X`09`09&0209wp->w_dot.o -= chunk;
X`09`09&0209if (wp->w_dot.o < doto)
X`09`09&0209`09wp->w_dot.o = doto;
X`09`09`09`7D
X#if WINMARK
X`09`09`09if (wp->w_mark.l == dotp
X`09`09`09 `26`26 wp->w_mark.o > doto) `7B
X`09`09&0209wp->w_mark.o -= chunk;
X`09`09&0209if (wp->w_mark.o < doto)
X`09`09&0209`09wp->w_mark.o = doto;
X`09`09`09`7D
X#endif
X`09`09`09if (wp->w_lastdot.l == dotp
X`09`09`09 `26`26 wp->w_lastdot.o > doto) `7B
X`09`09&0209wp->w_lastdot.o -= chunk;
X`09`09&0209if (wp->w_lastdot.o < doto)
X`09`09&0209`09wp->w_lastdot.o = doto;
X`09`09`09`7D
X`09`09`7D
X`09`09do_mark_iterate(mp,
X`09`09&0209if (mp->l == dotp
X`09`09&0209 `26`26 mp->o > doto) `7B
X`09`09&0209`09mp->o -= chunk;
X`09`09&0209`09if (mp->o < doto)
X`09`09&0209&0209mp->o = doto;
X`09`09&0209`7D
X`09`09);
X`09`09n -= chunk;
X`09`7D
X`09return (s);
X`7D
X
X/* getctext:`09grab and return a string with text from
X`09`09the current line, consisting of chars of type "type"
X*/
X#if OPT_EVAL
Xchar *
Xgetctext(CHARTYPE type)
X`7B
X`09static char rline`5BNSTRING`5D;`09/* line to return */
X
X`09(void)screen_string(rline, NSTRING, type);
X`09return rline;
X`7D
X#endif
X
X#if OPT_EVAL
X/* putctext:`09replace the current line with the passed in text`09*/
X
Xint
Xputctext(
Xconst char *iline)`09/* contents of new line */
X`7B
X`09register int status;
X
X`09/* delete the current line */
X`09DOT.o = w_left_margin(curwp); /* start at the beginning of the line */
X`09if ((status = deltoeol(TRUE, 1)) != TRUE)
X`09`09return(status);
X
X`09/* insert the new line */
X`09while (*iline) `7B
X`09`09if (*iline == '`5Cn') `7B
X`09`09`09if (lnewline() != TRUE)
X`09`09&0209return(FALSE);
X`09`09`7D else `7B
X`09`09`09if (linsert(1, *iline) != TRUE)
X`09`09&0209return(FALSE);
X`09`09`7D
X`09`09++iline;
X`09`7D
X`09status = lnewline();
X`09(void)backline(TRUE, 1);
X`09return(status);
X`7D
X#endif
X
X/*
X * Delete a newline. Join the current line with the nex\1306. If\120E
X * is the magic header line always return TRUE; merging the last\2A06with the
V
X * header line can be thought of as always being a successful operation, even
V
X * if nothing is done, and this makes the kill buffer work "right". Easy cases
V
X * can be done by shuffling data around. Hard cases require that lines be move
Vd
X * about in memory. Return FALSE on error and TRUE if all looks ok.
X */
Xstatic int
Xldelnewline(void)
X`7B
X`09register LINEPTR lp1;
X`09register LINEPTR lp2;
X`09register WINDOW *wp;
X`09size_t`09len, add;
X
X`09lp1 = DOT.l;
X`09len = llength(lp1);
X`09/* if the current line is empty, remove it */
X`09if (len == 0) `7B`09`09`09/* Blank line.&0209*/
X`09`09toss_to_undo(lp1);
X`09`09lremove(curbp, lp1);
X`09`09return (TRUE);
X`09`7D
X`09lp2 = lforw(lp1);
X`09/* if the next line is empty, that's "currline`5Cn`5Cn", so we
X`09`09remove the second `5Cn by deleting the next line */
X`09/* but never delete the newline on the last non-empty line */
X`09if (lp2 == buf_head(curbp))
X`09`09return (TRUE);
X`09else if ((add = llength(lp2)) == 0) `7B
X`09`09/* next line blank? */
X`09`09toss_to_undo(lp2);
X`09`09lremove(curbp, lp2);
X`09`09return (TRUE);
X`09`7D
X`09copy_for_undo(DOT.l);
X
X`09/* no room in line above, make room */
X`09if (add > lp1->l_size - len) `7B
X`09`09char *ntext;
X`09`09size_t nsize;
X`09`09/* first, create the new image */
X`09`09nsize = roundlenup(len + add);
X`09`09if ((ntext=castalloc(char, nsize)) == NULL)
X`09`09`09return (FALSE);
X`09`09if (lp1->l_text) `7B /* possibly NULL if l_size == 0 */
X`09`09`09(void)memcpy(`26ntext`5B0`5D, `26lp1->l_\1109len);
X`09`09`09ltextfree(lp1,curbp);
X`09`09`7D
X`09`09lp1->l_text = ntext;
X`09`09lp1->l_size = nsize;
X`09`7D
X`09(void)memcpy(lp1->l_text + len, lp2\1308, add);
X#if ! WINMARK
X`09if (MK.l == lp2) `7B
X`09`09MK.l  = lp1;
X`09`09MK.o += len;
X`09`7D
X#endif
X`09/* check all windows for references to the deleted line */
X`09for_each_window(wp) `7B
X`09`09if (wp->w_line.l == lp2)
X`09`09`09wp->w_line.l = lp1;
X`09`09if (wp->w_dot.l == lp2) `7B
X`09`09`09wp->w_dot.l  = lp1;
X`09`09`09wp->w_dot.o += len;
X`09`09`7D
X#if WINMARK
X`09`09if (wp->w_mark.l == lp2) `7B
X`09`09`09wp->w_mark.l  = lp1;
X`09`09`09wp->w_mark.o += len;
X`09`09`7D
X#endif
X`09`09if (wp->w_lastdot.l == lp2) `7B
X`09`09`09wp->w_lastdot.l  = lp1;
X`09`09`09wp->w_lastdot.o += len;
X`09`09`7D
X`09`7D
X`09do_mark_iterate(mp,
X`09`09`09if (mp->l == lp2) `7B
X`09`09&0209mp->l  = lp1;
X`09`09&0209mp->o += len;
X`09`09`09`7D
X`09);
X`09llength(lp1) += add;
X`09set_lforw(lp1, \0B082));
X`09set_lback(lforw(lp2), lp1);
X`09dumpuline(lp1);
X`09toss_to_undo(lp2);
X`09return (TRUE);
X`7D
X
X
Xstatic int kcharpending = -1;
X
X/*
X * Delete all of the text saved in the kill buffer. Called by commands when a
V
X * new kill context is being created. The\2306buffer array is released, just
X * in case the buffer has grown to immense size. No errors.
X */
Xvoid
Xksetup(void)
X`7B
X`09if ((kregflag `26 KAPPEND) != 0)
X`09`09kregflag = KAPPEND;
X`09else
X`09`09kregflag = KNEEDCLEAN;
X`09kchars = klines = 0;
X`09kregwidth = 0;
X`09kcharpending = -1;
X
X`7D
X
X/*
X * clean up the old contents of a kill register.
X * if called from other than kinsert, only does anything in the case where
X * nothing was yanked
X */
X
Xvoid
Xkdone(void)
X`7B
X`09if ((kregflag `26 KNEEDCLEAN) `26`26 kbs`5Bukb`5D.kbufh != NULL) `7B
X`09`09KILL *kp;`09/* ptr to scan kill buffer chunk list */
X
X`09`09/* first, delete all the chunks */
X`09`09kbs`5Bukb`5D.kbufp = \110Dh;
X`09`09while (kbs`5Bukb`5D.kbufp != NULL) `7B
X`09`09`09kp = kbs`5Bukb`5D.kbufp->d_next;
X`09`09`09free((char *)(kbs`5Bukb`5D.kbufp));
X`09`09`09kbs`5Bukb`5D.kbufp = kp;
X`09`09`7D
X
X`09`09/* and reset all the kill buffer pointers */
X`09`09kbs`5Bukb`5D.kbufh = \110Dp = NULL;
X`09`09kbs`5Bukb`5D.kused = 0;
X`09`09kbs`5Bukb`5D.kbwidth = kreg\0C080;
X`09`09kcharpending = -1;
X`09`7D
X`09kregflag `26= `7EKNEEDCLEAN;
X`09kbs`5Bukb`5D.kbflag = kregflag;
X`09relist_registers();
X`7D
X
Xint
Xkinsertlater(int c)
X`7B
X    `09int s = TRUE;
X`09if (kcharpending >= 0) `7B
X`09`09int oc = kcharpending;
X`09`09kcharpending = -1;
X`09`09s = kinsert(oc);
X`09`7D
X`09/* try to widen the rectangle, just in case */
X`09if (kregwidth > kbs`5Bukb`5D.kbwidth)
X`09`09kbs`5Bukb`5D.kbwidth = kregwidth;
X`09kcharpending = c;
X`09return s;
X`7D
X
X/*
X * Insert a character to the kill buffer, allocating new chunks as needed.
X * Return TRUE if all is well, and FALSE on errors.
X */
Xint
Xkinsert(
Xint c)`09`09/* character to insert in the kill buffer */
X`7B
X`09KILL *nchunk;`09/* ptr to newly malloced chunk */
X`09KILLREG *kbp = `26kbs`5Bukb`5D;
X
X`09if (kcharpending >= 0) `7B
X`09`09int oc = kcharpending;
X`09`09kcharpending = -1;
X`09`09kinsert(oc);
X`09`7D
X
X`09kdone(); /* clean up the (possible) old contents */
X
X`09/* check to see if we need a new chunk */
X`09if (kbp->kused >= KBLOCK `7C`7C \1806bufh == NULL) `7B
X`09`09if ((nchunk = typealloc(KILL)) == NULL)
X`09`09`09return(FALSE);
X`09`09if (kbp->kbufh == NULL)`09/* set head ptr if first time */
X`09`09`09kbp->kbufh = nchunk;
X`09`09/* point the current to this new one */
X`09`09if (kbp->kbufp != NULL)
X`09`09`09kbp->kbufp->d_next = nchunk;
X`09`09kbp->kbufp = nchunk;
X`09`09kbp->kbufp->d_next = NULL;
X`09`09kbp->kused = 0;
X`09`7D
X
X`09/* and now insert the character */
X`09kbp->kbufp->d_chunk`5B\1406used++`5D = (char)c;
X`09kchars++;
X`09if (c == '`5Cn') `7B
X`09`09klines++;
X`09`09if (kregwidth > kbp->kbwidth)
X`09`09`09kbp->kbwidth = kregwidth;
X`09`09kregwidth = 0;
X`09`7D else `7B
X`09`09kregwidth++;
X`09`7D
X`09return(TRUE);
X`7D
X
X/*
X * Translates the index of a register in kill-buffer list to its name.
X */
Xint
Xindex2reg(int c)
X`7B
X`09register int n;
X
X`09if (c >= 0 `26`26 c < 10)
X`09`09n = (c + '0');
X`09else if (c == KEYST_KREG)
X`09`09n = '<';
X#if OPT_SELECTIONS
X`09else if (c == SEL_KREG)
X`09`09n = '.';
X`09else if (c == CLIP_KREG)
X`09`09n = ';';
X#endif
X`09else if (c >= 10 `26`26 c < (int)TABLESIZE(kbs))
X`09`09n = (c - 10 + 'a');
X`09else
X`09`09n = '?';
X
X`09return n;
X`7D
X
X/*
X * Translates the name of a register into the index in kill-buffer list.
X */
Xint
Xreg2index(int c)
X`7B
X`09register int n;
X
X`09if (c < 0)
X`09`09n = -1;
X`09else if (isDigit(c))
X`09`09n = c - '0';
X`09else if (isLower(c))
X`09`09n = c - 'a' + 10;  /* named buffs are in 10 through 36 */
X`09else if (isUpper(c))
X`09`09n = c - 'A' + 10;
X#if OPT_SELECTIONS
X`09else if (c == '.')
X`09`09n = SEL_KREG;
X`09else if (c == ';')
X`09`09n = CLIP_KREG;
X#endif
X`09else if (c == '<')
X`09`09n = KEYST_KREG;
X`09else if (c == '"')
X`09`09n = 0;
X`09else
X`09`09n = -1;
X
X`09return n;
X`7D
X
X/*
X * Translates a kill-buffer index into the actual offset\170Akill \3206,
X * handling the translation of "1 .. "9
X */
Xint
Xindex2ukb(int inx)
X`7B
X`09if (inx >= 0 `26`26 inx < 10) `7B
X`09`09short save = ukb;
X`09`09ukb = (short)inx;
X`09`09kregcirculate(FALSE);
X`09`09inx = ukb;
X`09`09ukb = save;
X`09`7D
X`09return inx;
X`7D
X
X/* select one of the named registers for use with the following command */
X/*  this could actually be handled as a command prefix, in kbd_seq(), much
X`09the way `5EX-cmd and META\0D06re done, except that we need to be
X`09able to accept any of
X`09`09 3"adw`09"a3dw`09"ad3w
X`09to delete 3 words into register a.  So this routine gives us an
X`09easy way to handle the second case.  (The thir\1206 is\2C07d in
X`09operators(), the first in main())
X*/
Xint
Xusekreg(int f, int n)
X`7B
X`09int c, i, status;
X`09char tok`5BNSTRING`5D;`09`09/* command incoming */
X`09static`09char`09cbuf`5B2`5D;
X
X`09/* take care of incrementing the buffer number, if we're replaying
X`09`09a command via 'dot' */
X`09incr_dot_kregnum();
X
X`09if ((status = mlreply_reg("Use named register: ", cbuf, `26c, -1)) != TRUE)
V
X`09`09return status;
X
X`09i = reg2index(c);
X`09if (kbm_started(i,FALSE))
X`09`09return FALSE;
X
X`09/* if we're playing back dot, let its kreg override */
X`09if (dotcmdmode == PLAY `26`26 \1606kreg != 0)
X`09`09ukb = dotcmdkreg;
X`09else
X`09`09ukb = (short)i;
X
X`09if (isUpper(c))
X`09`09kregflag `7C= KAPPEND;
X
X`09if (clexec) `7B
X`09`09macarg(tok);`09/* get the next token */
X`09`09status = execute(engl2fnc(tok), f, n);
X`09`7D else if (isnamedcmd) `7B
X`09`09status = namedcmd(f,n);
X`09`7D else `7B
X`09`09/* get the next command from the keyboard */
X`09`09c = kbd_seq();
X
X`09`09/* allow second chance for entering counts */
X`09`09do_repeats(`26c,`26f,`26n);
X
X`09`09status = execute(kcod2fnc(c), f, n);
X`09`7D
X
X`09ukb = 0;
X`09kregflag = 0;
X
X`09return(status);
X`7D
X
X/* buffers 0 through 9 are circulated automatically for full-line deletes */
X/* we re-use one of them until the KLINES flag is on, then we advance */
X/* to the next */
Xvoid
Xkregcirculate(int killing)
X`7B
X`09static`09short`09lastkb;`09/* index of the real "0 */
X
X`09if (ukb >= 10) /* then the user specified a lettered buffer */
X`09`09return;
X
X`09/* we only allow killing into the real "0 */
X`09/* ignore any other buffer spec */
X`09if (killing) `7B
X`09`09if ((kbs`5Blastkb`5D.kbflag `26 (KLINES`7CKRECT`7CKAPPEND)) `26`26
X`09`09`09! (kbs`5Blastkb`5D.kbflag `26 KYANK)) `7B
X`09`09`09if (--lastkb < 0) \0C07= 9;
X`09`09`09kbs`5Blastkb`5D.kbflag = 0;
X`09`09`7D
X`09`09ukb = lastkb;
X`09`7D else `7B
X`09`09/* let 0 pass unmolested -- it is the default */
X`09`09if (ukb == 0) `7B
X`09`09`09ukb = lastkb;
X`09`09`7D else `7B
X`09`09/* for the others, if the current "0 has lines in it, it
X`09`09    must be `60"1', else "1 is `60"1'.  get it? */
X`09`09`09if (kbs`5Blastkb`5D.kbflag `26 (KLINES`7CKAPPEND))
X`09`09&0209ukb = (lastkb + ukb - 1) % 10;
X`09`09`09else
X`09`09&0209ukb = (lastkb + ukb) % 10;
X`09`09`7D
X`09`7D
X`7D
X
Xint
Xputbefore(int f, int n)
X`7B
X`09return doput(f, n, FALSE, EXACT);
X`7D
X
Xint
Xputafter(int f, int n)
X`7B
X`09return doput(f, n, TRUE, EXACT);
X`7D
X
Xint
Xlineputbefore(int f, int n)
X`7B
X`09return doput(f, n, FALSE, FULLLINE);
X`7D
X
Xint
Xlineputafter(int f, int n)
X`7B
X`09return doput(f, n, TRUE, FULLLINE);
X`7D
X
Xint
Xrectputbefore(int f, int n)
X`7B
X`09return doput(f, n, FALSE, RECTANGLE);
X`7D
X
Xint
Xrectputafter(int f, int n)
X`7B
X`09return doput(f, n, TRUE, RECTANGLE);
X`7D
X
Xstatic int
Xdoput(int f, int n\0706after, REGIONSHAPE shape)
X`7B
X`09int s, oukb;
X
X`09if (!f)
X`09`09n = 1;
X
X`09oukb = ukb;
X`09kregcirculate(FALSE);`09/* cf: 'index2ukb()' */
X`09if (kbs`5Bukb`5D.kbufh == NULL) `7B
X`09`09if (ukb != 0)
X`09`09`09mlwarn("`5BNothing in register %c`5D", index2reg(oukb));
X`09`09return(FALSE);
X`09`7D
X
X`09if (shape == EXACT) `7B
X`09`09if ((kbs`5Bukb`5D.kbflag `26 (KLINES`7CKAPPEND)))
X`09`09`09shape = FULLLINE;
X`09`09else if (kbs`5Bukb`5D.kbflag `26 KRECT)
X`09`09`09shape = RECTANGLE;
X`09`09else
X`09`09`09shape = EXACT;
X`09`7D
X
X`09if (shape == FULLLINE) `7B
X`09`09if (after `26`26 !is_header_line(DOT, curbp))
X`09`09`09DOT.l = lforw(DOT.l);
X`09`09DOT.o = 0;
X`09`7D else `7B
X`09`09if (after `26`26 !is_at_end_of_line(DOT))
X`09`09`09forwchar(TRUE,1);
X`09`7D
X
X`09(void)setmark();
X`09s = PutChar(n, shape);
X`09if (s == TRUE)
X`09`09swapmark();
X`09if (is_header_line(DOT, curbp))
X`09`09DOT.l = lback(DOT.l);
X`09if (shape == FULLLINE)
X`09`09(void)firstnonwhite(FALSE,1);
X`09ukb = 0;
X`09return (s);
X`7D
X
X/* designed to be used with the result of "getoff()", which returns
X *`09the offset of the character whose column is "close" to a goal.
X *`09it may be to the left if\0C06ine is too short, or\2908right
X *`09if the column is spanned by a tab character.
X */
Xstatic int
Xforce_text_at_col(C_NUM goalcol, \0F06reached)
X`7B
X`09int status = TRUE;
X`09if (reached < goalcol) `7B
X`09`09/* pad out to col */
X`09`09DOT.o = llength(DOT.l);
X`09`09status = linsert(goalcol-reached, ' ');
X`09`7D else if (reached > goalcol) `7B
X`09`09/* there must be a tab\1406. */
X`09`09/* pad to hit column we want */
X`09`09DOT.o--;
X`09`09status = linsert(goalcol%curtabval, ' ');
X`09`7D
X`09return status;
X`7D
X
Xstatic int
Xnext_line_at_col(C_NUM col, \0B06*reachedp)
X`7B
X`09int s = TRUE;
X`09if (is_last_line(DOT,curbp)) `7B
X`09`09DOT.o = llength(DOT.l);
X`09`09if (lnewline() != TRUE)
X`09`09`09return FALSE;
X`09`7D else `7B
X`09`09DOT.l = lforw(DOT.l);
X`09`7D
X`09DOT.o = getoff(col, reachedp);
X`09return s;
X`7D
X
X/*
X * Put text back from the kill register.
X */
Xstatic int
XPutChar(int n, REGIONSHAPE shape)
X`7B
X`09register int`09c;
X`09register int`09i;
X`09int status, wasnl, suppressnl;
X`09L_NUM before;
X`09C_NUM col = 0, width = 0;
X`09C_NUM reached = 0;
X`09int checkpad = FALSE;
X`09register char`09*sp;`09/* pointer into string to insert */
X`09KILL *kp;`09`09/* pointer into kill register */
X
X`09if (n < 0)
X`09`09return FALSE;
X
X`09/* make sure there is something to put */
X`09if (kbs`5Bukb`5D.kbufh == NULL)
X`09`09return TRUE;&0209/* not an error, just nothing */
X
X`09status = TRUE;
X`09before = line_count(curbp);
X`09suppressnl = FALSE;
X`09wasnl = FALSE;
X
X
X`09/* for each time.... */
X`09while (n--) `7B
X`09`09kp = kbs`5Bukb`5D.kbufh;
X`09`09if (shape == RECTANGLE) `7B
X`09`09`09width = kbs`5Bukb`5D.kbwidth;
X`09`09`09col = getcol(DOT, FALSE);
X`09`09`7D
X#define SLOWPUT 0
X#if SLOWPUT
X`09`09while (kp != NULL) `7B
X`09`09`09i = KbSize(ukb,kp);
X`09`09`09sp = (char *)kp->d_chunk;
X`09`09`09while (i--) `7B
X`09`09&0209c = *sp++;
X`09`09&0209if (shape == RECTANGLE) `7B
X`09`09&0209    if (width == 0 `7C`7C c == '`5Cn') `7B
X`09`09&0209`09    if (checkpad) `7B
X`09`09&0209&0209    status = force_text_at_col(
X`09`09&0209&0309    col, reached);
X`09`09&0209&0209    if (status != TRUE)
X`09`09&0209&0309    break;
X`09`09&0209&0209    checkpad = FALSE;
X`09`09&0209`09    `7D
X`09`09&0209`09    if (width `26`26 linsert\1106, ' ')
X`09`09&0209&0409!= TRUE) `7B
X`09`09&0209&0209    status = FALSE;
X`09`09&0209&0209    break;
X`09`09&0209`09    `7D
X`09`09&0209`09    if (next_line_at_col(col,`26reached)
X`09`09&0209&0309    != TRUE) `7B
X`09`09&0209&0209    status = FALSE;
X`09`09&0209&0209    break;
X`09`09&0209`09    `7D
X`09`09&0209`09    checkpad = TRUE;
X`09`09&0209`09    width = kbs`5Bukb`5D.kbwidth;
X`09`09&0209    `7D
X`09`09&0209    if (c == '`5Cn') `7B
X`09`09&0209`09    continue; /* did it already */
X`09`09&0209    `7D else `7B
X`09`09&0209`09    if (checkpad) `7B
X`09`09&0209&0209status = force_text_at_col(
X`09`09&0209&0409col, reached);
X`09`09&0209&0209if (status != TRUE)
X`09`09&0209&0309break;
X`09`09&0209&0209checkpad = FALSE;
X`09`09&0209`09    `7D
X`09`09&0209`09    width--;
X
X`09`09&0209`09    if (is_header_line(DOT,curbp))
X`09`09&0209&0209    suppressnl = TRUE;
X`09`09&0209`09    if (linsert(1, c) != TRUE) `7B
X`09`09&0209&0209    status = FALSE;
X`09`09&0209&0209    break;
X`09`09&0209`09    `7D
X`09`09&0209`09    wasnl = FALSE;
X`09`09&0209    `7D
X`09`09&0209`7D else `7B /* not rectangle */
X`09`09&0209    if (c == '`5Cn') `7B
X`09`09&0209`09    if (lnewline() != TRUE) `7B
X`09`09&0209&0209    status = FALSE;
X`09`09&0209&0209    break;
X`09`09&0209`09    `7D
X`09`09&0209`09    wasnl = TRUE;
X`09`09&0209    `7D else `7B
X`09`09&0209`09    if (is_header_line(DOT,curbp))
X`09`09&0209&0209    suppressnl = TRUE;
X`09`09&0209`09    if (linsert(1, c) != TRUE) `7B
X`09`09&0209&0209    status = FALSE;
X`09`09&0209&0209    break;
X`09`09&0209`09    `7D
X`09`09&0209`09    wasnl = FALSE;
X`09`09&0209    `7D
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09if (status != TRUE)
X`09`09&0209break;
X`09`09`09kp = kp->d_next;
X`09`09`7D
X#else /* SLOWPUT */
X`09`09while (kp != NULL) `7B
X`09`09`09i = KbSize(ukb,kp);
X`09`09`09sp = (char *)kp->d_chunk;
X`09`09`09if (shape == RECTANGLE) `7B
X`09`09&0209while (i--) `7B
X`09`09&0209    c = *sp++;
X`09`09&0209    if (width == 0 `7C`7C c == '`5Cn') `7B
X`09`09&0209`09    if (checkpad) `7B
X`09`09&0209&0209    status = force_text_at_col(
X`09`09&0209&0309    col, reached);
X`09`09&0209&0209    if (status != TRUE)
X`09`09&0209&0309    break;
X`09`09&0209&0209    checkpad = FALSE;
X`09`09&0209`09    `7D
X`09`09&0209`09    if (width `26`26 linsert\1106, ' ')
X`09`09&0209&0409!= TRUE) `7B
X`09`09&0209&0209    status = FALSE;
X`09`09&0209&0209    break;
X`09`09&0209`09    `7D
X`09`09&0209`09    if (next_line_at_col(col,`26reached)
X`09`09&0209&0309    != TRUE) `7B
X`09`09&0209&0209    status = FALSE;
X`09`09&0209&0209    break;
X`09`09&0209`09    `7D
X`09`09&0209`09    checkpad = TRUE;
X`09`09&0209`09    width = kbs`5Bukb`5D.kbwidth;
X`09`09&0209    `7D
X`09`09&0209    if (c == '`5Cn') `7B
X`09`09&0209`09    continue; /* did it already */
X`09`09&0209    `7D else `7B
X`09`09&0209`09    if (checkpad) `7B
X`09`09&0209&0209status = force_text_at_col(
X`09`09&0209&0409col, reached);
X`09`09&0209&0209if (status != TRUE)
X`09`09&0209&0309break;
X`09`09&0209&0209checkpad = FALSE;
X`09`09&0209`09    `7D
X`09`09&0209`09    width--;
X
X`09`09&0209`09    if (is_header_line(DOT,curbp))
X`09`09&0209&0209    suppressnl = TRUE;
X`09`09&0209`09    if (linsert(1, c) != TRUE) `7B
X`09`09&0209&0209    status = FALSE;
X`09`09&0209&0209    break;
X`09`09&0209`09    `7D
X`09`09&0209`09    wasnl = FALSE;
X`09`09&0209    `7D
X`09`09&0209`7D
X`09`09`09`7D else `7B /* not rectangle */
X`09`09`09    while (i-- > 0) `7B
X`09`09&0209if (*sp == '`5Cn') `7B
X`09`09&0209    sp++;
X`09`09&0209    if (lnewline() != TRUE) `7B
X`09`09&0209`09status = FALSE;
X`09`09&0209`09break;
X`09`09&0209    `7D
X`09`09&0209    wasnl = TRUE;
X`09`09&0209`7D else `7B
X`09`09&0209    register char *dp;
X`09`09&0209    register char *ep = sp+1;
X`09`09&0209    if (is_header_line(DOT,curbp))
X`09`09&0209`09suppressnl = TRUE;
X`09`09&0209    /* Find end of line or\0F08kill buffer */
X`09`09&0209    while (i > 0 `26`26 *ep != '`5Cn') `7B
X`09`09&0209`09i--;
X`09`09&0209`09ep++;
X`09`09&0209    `7D
X`09`09&0209    /* Open up space in current line */
X`09`09&0209    status = linsert((int)(ep - sp), ' ');
X`09`09&0209    if (status != TRUE)
X`09`09&0209`09break;
X`09`09&0209    dp = DOT.l->l_text
X`09`09&0209`09    + DOT.o - (int)(ep - sp);
X`09`09&0209    /* Copy killbuf portion to the line */
+-+-+-+-+-+-+-+-  END  OF PART 65 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 66 -+-+-+-+-+-+-+-+
X`09`09&0209    while (sp < ep) `7B
X`09`09&0209`09*dp++ = *sp++;
X`09`09&0209    `7D
X`09`09&0209    wasnl = FALSE;
X`09`09&0209`7D
X`09`09`09    `7D
X`09`09`09`7D
X`09`09`09if (status != TRUE)
X`09`09&0209break;
X`09`09`09kp = kp->d_next;
X`09`09`7D
X#endif /* SLOWPUT */
X`09`09if (status != TRUE)
X`09`09`09break;
X`09`09if (wasnl) `7B
X`09`09`09if (suppressnl) `7B
X`09`09&0209if (ldelnewline() != TRUE) `7B
X`09`09&0209`09status = FALSE;
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`7D else `7B
X`09`09`09if (shape == FULLLINE `26`26 !suppressnl) `7B
X`09`09&0209if (lnewline() != TRUE) `7B
X`09`09&0209`09status = FALSE;
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09curwp->w_flag `7C= WFHARD;
X`09(void)line_report(before);
X`09return status;
X`7D
X
Xstatic int`09lastreg = -1;
X
X/* ARGSUSED */
Xint
Xexeckreg(int f, int n)
X`7B
X`09int c, j, jj, status;
X`09KILL *kp;`09`09/* pointer into kill register */
X`09static`09char`09cbuf`5B2`5D;
X`09int kbcount, whichkb;
X`09int i;
X`09char *sp;
X`09KILL *tkp;
X
X`09if (!f)
X`09`09n = 1;
X`09else if (n <= 0)
X`09`09return TRUE;
X
X`09if ((status = mlreply_reg("Execute register: ", cbuf, `26c, lastreg)) != TR
VUE)
X`09`09return status;
X
X`09j = reg2index(c);
X`09if (kbm_started(j,TRUE))
X`09`09return FALSE;
X
X`09lastreg = c;
X`09relist_registers();
X
X`09/* make sure there is something to execute */
X`09jj = index2ukb(j);
X`09kp = kbs`5Bjj`5D.kbufh;
X`09if (kp == NULL)
X`09`09return TRUE;&0209/* not an error, just nothing */
X
X`09/* count the kchunks */
X`09kbcount = 0;
X`09tkp = kp;
X`09while (tkp != NULL) `7B
X`09`09kbcount++;
X`09`09tkp = tkp->d_next;
X`09`7D
X`09/* process them in reverse order */
X`09while (kbcount) `7B
X`09`09whichkb = kbcount;
X`09`09tkp = kp;
X`09`09while (--whichkb)
X`09`09`09tkp = tkp->d_next;
X`09`09i = KbSize(jj,tkp);
X`09`09sp = (char *)tkp->d_chunk+i-1;
X`09`09while (i--) `7B
X`09`09`09mapungetc((*sp--)`7CYESREMAP);
X`09`09`7D
X`09`09kbcount--;
X`09`7D
X`09return TRUE;
X`7D
X
X/* ARGSUSED */
Xint
Xloadkreg(int f, int n GCC_UNUSED)
X`7B
X`09int s;
X`09char respbuf`5BNFILEN`5D;
X
X`09ksetup();
X`09*respbuf = EOS;
X`09s = mlreply_no_opts("Load register with: ",
X`09`09&0209`09respbuf, sizeof(\1007));
X`09if (s != TRUE)
X`09`09return FALSE;
X`09if (f)
X`09`09kregflag `7C= KLINES;
X`09for (s = 0; s < NFILEN; s++) `7B
X`09`09if (!respbuf`5Bs`5D)
X`09`09`09break;
X`09`09if (!kinsert(respbuf`5Bs`5D))
X`09`09`09break;
X`09`7D
X`09kdone();
X`09return TRUE;
X`7D
X
X/* Show the contents of the kill-buffers */
X#if OPT_SHOW_REGS
X#define`09REGS_PREFIX`0912`09/* non-editable portion of the display */
X
X#if OPT_UPBUFF
Xstatic`09int`09show_all_chars;
X#endif
X
X/*ARGSUSED*/
Xstatic void
Xmakereglist(
Xint iflag,`09/* list nonprinting chars flag */
Xvoid *dummy GCC_UNUSED)
X`7B
X`09register KILL`09*kp;
X`09register int`09i, ii, j, c;
X`09register UCHAR`09*p;
X`09int`09any;
X
X#if OPT_UPBUFF
X`09show_all_chars = iflag;
X#endif
X`09b_set_left_margin(curbp, REGS_PREFIX);
X`09any = (reg2index(lastreg) >= 0);
X`09if (any)
X`09`09bprintf("last=%c", lastreg);
X
X`09for (i = 0; (size_t) i < TABLESIZE(kbs); i++) `7B
X`09`09short`09save = ukb;
X
X`09`09ii = index2ukb(i);
X`09`09if ((kp = kbs`5Bii`5D.kbufh) != 0) `7B
X`09`09`09int first = FALSE;
X`09`09`09if (any++) `7B
X`09`09&0209bputc('`5Cn');
X`09`09&0209lsettrimmed(lback(DOT.l));
X`09`09`09`7D
X`09`09`09if (i > 0) `7B
X`09`09&0209bprintf("%c:%*p",
X`09`09&0209`09index2reg(i),
X`09`09&0209`09REGS_PREFIX-2, ' ');
X`09`09`09`7D else `7B
X`09`09&0209bprintf("%*S",
X`09`09&0209`09REGS_PREFIX, "(unnamed)");
X`09`09`09`7D
X`09`09`09do `7B
X`09`09&0209j = KbSize(ii,kp);
X`09`09&0209p = kp->d_chunk;
X
X`09`09&0209while (j-- > 0) `7B
X`09`09&0209`09if (first) `7B
X`09`09&0209&0209first = FALSE;
X`09`09&0209&0209bprintf("%*p", REGS_PREFIX, ' ');
X`09`09&0209`09`7D
X`09`09&0209`09c = *p++;
X`09`09&0209`09if (isPrint(c) `7C`7C !iflag) `7B
X`09`09&0209&0209bputc(c);
X`09`09&0209`09`7D else if (c != '`5Cn') `7B
X`09`09&0209&0209bputc('`5E');
X`09`09&0209&0209bputc(toalpha(c));
X`09`09&0209`09`7D
X`09`09&0209`09if (c == '`5Cn') `7B
X`09`09&0209&0209first = TRUE;
X`09`09&0209&0209any = 0;
X`09`09&0209`09`7D else
X`09`09&0209&0209any = 1;
X`09`09&0209`7D
X`09`09`09`7D while ((kp = kp->d_next) != 0);
X`09`09`7D
X`09`09if (i < 10)
X`09`09`09ukb = save;
X`09`7D
X`09lsettrimmed(DOT.l);
X`7D
X
Xstatic int will_relist_regs;
X
X/*ARGSUSED*/
Xint
Xshowkreg(int f, int n GCC_UNUSED)
X`7B
X`09will_relist_regs = FALSE;
X`09return liststuff(REGISTERS_BufName, FALSE,
X`09`09&0209makereglist, f, (void *)0);
X`7D
X
X#if OPT_UPBUFF
X
X
Xstatic int
Xshow_Registers(BUFFER *bp)
X`7B
X`09b_clr_obsolete(bp);
X`09return showkreg(show_all_chars, 1);
X`7D
X
Xstatic void
Xrelist_registers(void)
X`7B
X
X`09if (will_relist_regs) `09/* have we already done this? */
X`09`09return;
X
X`09will_relist_regs = TRUE;
X
X`09update_scratch(REGISTERS_BufName, show_Registers);
X`7D
X#endif`09/* OPT_UPBUFF */
X
X#endif`09/* OPT_SHOW_REGS */
X
X/* For memory-leak testing (only!), releases all kill-buffer storage. */
X#if NO_LEAKS
Xvoid`09kbs_leaks(void)
X`7B
X`09for (ukb = 0; ukb < TABLESIZE(kbs); ukb++) `7B
X`09`09ksetup();
X`09`09kdone();
X`09`7D
X`7D
X#endif
$ call unpack [.VILE-8_0]LINE.C;1 -
 742546298 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 74 57 152
$!
$ create 'f'
X/*
X *`09This used to be MicroEMACS 3.9
X *`09`09`09written by Dave G. Conroy.
X *`09`09`09substantially modified by Daniel M. Lawrence
X *
X *`09Turned into "VI Like Emacs", a.k.a. vile, by Paul Fox
X *
X *`09(C)opyright 1987 by Daniel M. Lawrence
X *`09MicroEMACS 3.9 can be copied and distributed freely for any
X *`09non-commercial purposes. MicroEMACS 3.9 can only be incorporated
X *`09into commercial software with the permission of the current author.
X *
X *`09The same goes for vile.  -pgf, 1990-1995
X *
X *
X * $Header: /usr/build/vile/vile/RCS/main.c,v 1.325 1998/05/29 01:06:58 tom Ex
Vp $
X *
X */
X
X/* Make global definitions not external */
X#define realdef
X#include`09"estruct.h"`09/* global \1406ures and defines */
X#include`09"edef.h"`09/* global definitions */
X#include`09"nevars.h"
X#include`09"nefunc.h"
X
X#if OPT_LOCALE
X#include`09<locale.h>
X#include`09<ctype.h>
X#endif
X
X#if CC_NEWDOSCC
X#include <io.h>
X#if CC_DJGPP
X#include <dpmi.h>
X#include <go32.h>
X#endif
X#endif
X
X#ifdef VMS
X#include <processes.h>
X#endif
X
Xextern char *exec_pathname;
Xextern const char *\0C06pathname`5B`5D;`09/* startup file path/name array */
X
X/* for MSDOS, increase the default stack space */
X#if`09SYS_MSDOS `26`26 CC_TURBO
Xunsigned _stklen = 32768U;
X#endif
X
Xstatic`09void`09get_executable_dir (void);
Xstatic`09void`09global_val_init (void);
Xstatic`09void`09loop (void);
Xstatic`09void`09siginit (void);
Xstatic`09void`09start_debug_log(int ac, char **av);
Xstatic`09int`09cmd_mouse_motion(const CMDFUNC *cfp);
X
Xextern const int nametblsize;
X
X/*--------\0808\1010\2020\400A*/
X#define`09GetArgVal(param)`09if (!*(++\1006)`5C
X`09`09&0209`09param = argv`5B++carg`5D;`5C
X`09`09&0209if (param == 0)`5C
X`09`09&0209`09print_usage()
X
Xint
XMainProgram(int argc, char *argv`5B`5D)
X`7B
X`09int tt_opened;
X`09register BUFFER *bp;`09`09/* temp buffer pointer */
X`09register int`09carg;`09`09/* current arg to scan */
X`09char *vileinit = NULL;`09`09/* the startup file or VILEINIT var */
X`09int startstat = TRUE;`09`09/* result of running\2806up */
X`09BUFFER *firstbp = NULL; `09/* ptr to first buffer in cmd line */
X`09char *firstname = NULL;`09`09/* name of first buffer in cmd line */
X`09int gotoflag = FALSE;`09`09/* do we need to goto line at start? */
X`09int gline = FALSE;`09`09/* if so, what line? */
X`09int helpflag = FALSE;`09`09/* do we need help at start? */
X`09REGEXVAL *search_exp = 0;`09/* initial \1B06-pattern */
X`09const char *msg;
X#if DISP_X11 `26`26 !XTOOLKIT
X`09int do_newgroup = FALSE;`09/* do we spawn at start? */
X#endif
X#if OPT_TAGS
X`09int didtag = FALSE;`09`09/* look up a tag to start? */
X`09char *tname = NULL;
X#endif
X#if`09OPT_ENCRYPT
X`09char ekey`5BNPAT`5D;`09`09/* startup encryption key */
X`09*ekey = EOS;
X#endif
X
X#if OPT_LOCALE
X`09setlocale(LC_CTYPE, "");
X#endif
X
X#if OPT_NAMEBST
X`09build_namebst(nametbl, 0, \0C07size - 1);
X#endif
X`09global_val_init();`09/* \1606 buffer values */
X`09charinit();`09`09/* character types -- we need these early  */
X`09winit(FALSE);`09`09/* command-line */
X#if !SYS_UNIX
X`09expand_wild_args(`26argc, `26argv);
X#endif
X`09prog_arg = argv`5B0`5D;`09/* this contains our only clue to exec-path */
X
X`09start_debug_log(argc,argv);
X
X`09get_executable_dir();
X
X`09if (strcmp(pathleaf(prog_arg), "view") == 0)
X`09`09set_global_b_val(MDREADONLY,TRUE);
X
X#if DISP_X11
X`09if (argc != 2 `7C`7C strcmp(argv`5B1`5D, "-V") != 0)
X`09`09x_preparse_args(`26argc, `26argv);
X#endif
X`09/*
X`09 * Allow for I/O to the command-line before we initialize the screen
X`09 * driver.
X`09 *
X`09 * FIXME: we only know how to do this for displays that open the
X`09 * terminal in the same way for command-line and screen.
X`09 */
X`09siginit();
X#if OPT_DUMBTERM
X`09if (isatty(fileno(stdin))
X`09 `26`26 isatty(fileno(stdout))) `7B
X`09`09tt_opened = open_terminal(`26dumb_term);
X`09`7D else
X#endif
X`09 tt_opened = open_terminal(`26null_term);
X
X`09/* Parse the command line */
X`09for (carg = 1; carg < argc; ++carg) `7B
X`09`09register char *param = argv`5Bcarg`5D;
X#if DISP_X11 `26`26 !XTOOLKIT
X`09`09if (*param == '=') `7B
X`09`09`09x_set_geometry(param);
X`09`09`09continue;
X`09`09`7D
X#endif
X
X`09`09/* Process Switches */
X`09`09if (*param == '-') `7B
X`09`09`09++param;
X#if DISP_IBMPC `7C`7C\0E06BORLAND
X`09`09    `09/* if it's a digit,\0E06probably a screen
X`09`09&0209resolution */
X`09`09`09if (isDigit(*param)) `7B
X`09`09&0209current_res_name = param;
X`09`09&0209continue;
X`09`09`09`7D else
X#endif`09/* DISP_IBMPC */
X`09`09`09switch (*param) `7B
X#if DISP_X11 `26`26 !XTOOLKIT
X`09`09`09case 'd':
X`09`09&0209if ((param = argv`5B++carg`5D) != 0)
X`09`09&0209`09x_set_dpy(param);
X`09`09&0209else
X`09`09&0209`09print_usage();
X`09`09&0209break;
X`09`09`09case 'r':
X`09`09&0209x_set_rv();
X`09`09&0209break;
X`09`09`09case 'f':
X`09`09&0209if (argv`5B++carg`5D != 0) `7B
X`09`09&0209`09if (strcmp(param, "foreground") == 0
X`09`09&0209`09 `7C`7C strcmp(param, "fg") == 0)
X`09`09&0209&0209x_setforeground(argv`5Bcarg`5D);
X`09`09&0209`09else if (!strcmp(param, "fork"))
X`09`09&0209&0209do_newgroup = TRUE;
X`09`09&0209`09else
X`09`09&0209&0209x_setfont(argv`5Bcarg`5D);
X`09`09&0209`7D else
X`09`09&0209`09print_usage();
X`09`09&0209break;
X`09`09`09case 'b':
X`09`09&0209if (argv`5B++carg`5D != 0) `7B
X`09`09&0209`09if (strcmp(param, "background") == 0
X`09`09&0209`09 `7C`7C strcmp(param, "bg") == 0)
X`09`09&0209&0209x_setbackground(argv`5Bcarg`5D);
X`09`09&0209`7D else
X`09`09&0209`09print_usage();
X`09`09&0209break;
X`09`09`09case 'n':
X`09`09&0209if (strcmp(param, "name") == 0
X`09`09&0209 `26`26 argv`5B++carg`5D != 0)
X`09`09&0209`09x_setname(argv`5Bcarg`5D);
X`09`09&0209else
X`09`09&0209`09print_usage();
X`09`09&0209break;
X`09`09`09case 'w':
X`09`09&0209if (strcmp(param, "wm") == 0
X`09`09&0209 `26`26 argv`5B++carg`5D != 0)
X`09`09&0209`09x_set_wm_title(argv`5Bcarg`5D);
X`09`09&0209else
X`09`09&0209`09print_usage();
X`09`09&0209break;
X#endif /* DISP_X11 */
X`09`09`09case 'e':`09/* -e for Edit file */
X`09`09`09case 'E':
X`09`09&0209set_global_b_val(MDVIEW,FALSE);
X`09`09&0209break;
X`09`09`09case 'g':`09/* -g for initial goto */
X`09`09`09case 'G':
X`09`09&0209gotoflag = TRUE;
X`09`09&0209GetArgVal(param);
X`09`09&0209gline = atoi(param);
X`09`09&0209break;
X`09`09`09case 'h':`09/* -h for initial help */
X`09`09`09case 'H':
X`09`09&0209helpflag = TRUE;
X`09`09&0209break;
X#if`09OPT_ENCRYPT
X`09`09`09case 'k':`09/* -k<key> for code key */
X`09`09`09case 'K':
X`09`09&0209GetArgVal(param);
X`09`09&0209(void)strcpy(ekey, param);
X`09`09&0209(void)memset(param, '.', strlen\1306));
X`09`09&0209ue_crypt((char *)0, 0);
X`09`09&0209ue_crypt(ekey, strlen(ekey));
X`09`09&0209break;
X#endif
X`09`09`09case 's':  /* -s for initial search string */
X`09`09`09case 'S':
X`09`09dosearch:
X`09`09&0209GetArgVal(param);
X`09`09&0209search_exp = new_regexval(param, global_b_val(MDMAGIC));
X`09`09&0209break;
X#if OPT_TAGS
X`09`09`09case 't':  /* -t for initial tag lookup */
X`09`09`09case 'T':
X`09`09&0209GetArgVal(param);
X`09`09&0209tname = param;
X`09`09&0209break;
X#endif
X`09`09`09case 'v':`09/* -v is view mode */
X`09`09&0209set_global_b_val(MDVIEW,TRUE);
X`09`09&0209break;
X
X`09`09`09case 'R':`09/* -R is readonly mode (like "view") */
X`09`09&0209set_global_b_val(MDREADONLY,TRUE);
X`09`09&0209break;
X
X`09`09`09case 'V':
X`09`09&0209(void)printf("%s`5Cn", getversion());
X`09`09&0209tidy_exit(GOODEXIT);
X
X`09`09&0209/* FALLTHROUGH */
X
X`09`09`09case '?':
X`09`09`09default:`09/* unknown switch */
X`09`09&0209print_usage();
X`09`09`09`7D
X
X`09`09`7D else if (*param == '+') `7B /* alternate form of -g */
X`09`09`09if (*(++param) == '/') `7B
X`09`09&0209int len = strlen(param);
X`09`09&0209if (len > 0 `26`26 param`5Blen-1`5D == '/')
X`09`09&0209`09param`5B--len`5D = EOS;
X`09`09&0209if (len == 0)
X`09`09&0209`09print_usage();
X`09`09&0209goto dosearch;
X`09`09`09`7D
X`09`09`09gotoflag = TRUE;
X`09`09`09gline = atoi(param);
X`09`09`7D else if (*param == '@') `7B
X`09`09`09vileinit = ++param;
X`09`09`7D else if (*param != EOS) `7B
X
X`09`09`09/* Process an input file */
X#if OPT_ENCRYPT
X`09`09`09cryptkey = (*ekey != EOS) ? ekey : 0;
X#endif
X`09`09`09/* set up a buffer for this file */
X`09`09`09bp = getfile2bp(param,FALSE,TRUE);
X`09`09`09if (bp) `7B
X`09`09&0209bp->b_flag `7C= BFARGS;`09/* treat this as an argument */
X`09`09&0209make_current(bp); /* pull it to the front */
X`09`09&0209if (firstbp == 0) `7B
X`09`09&0209`09firstbp = bp;
X`09`09&0209`09firstname = param;
X`09`09&0209`7D
X`09`09`09`7D
X#if OPT_ENCRYPT
X`09`09`09cryptkey = 0;
X#endif
X`09`09`7D
X`09`7D
X
X
X`09/* if stdin isn't a terminal, assume the user is trying to pipe a
X`09 * file into a buffer.
X`09 */
X#if SYS_UNIX `7C`7C SYS_VMS\0B08MSDO\0D09WIN31\2508OS2 &027C DISP_NTCONS
X`09if (!isatty(fileno(stdin))) `7B
X#if !DISP_X11
X#if SYS_UNIX
X# if HAS_TTYNAME
X`09`09char`09*tty = ttyname(fileno(stderr));
X# else
X`09`09char`09*tty = "/dev/tty";
X# endif
X#else
X  `09`09FILE`09*in;
X  `09`09int`09fd;
X#endif /* SYS_UNIX */
X#endif /* DISP_X11 */
X`09`09BUFFER`09*lastbp = firstbp;
X`09`09int`09nline = 0;
X
X`09`09bp = bfind(STDIN_BufName, BFARGS);
X`09`09make_current(bp); /* pull it to the front */
X`09`09if (firstbp == 0)
X`09`09`09firstbp = bp;
X`09`09ffp = fdopen(dup(fileno(stdin)), "r");
X#if !DISP_X11
X# if SYS_UNIX
X`09`09/*
X`09`09 * Note: On Linux, the low-level close/dup operation
X`09`09 * doesn't work, since something hangs, apparently
X`09`09 * because substituting the file descriptor doesn't communicate
X`09`09 * properly up to the stdio routines.
X`09`09 */
X`09`09if ((freopen(tty, "r", stdin)) == 0
X`09`09 `7C`7C !isatty(fileno(stdin))) `7B
X`09`09`09fputs("cannot open a terminal`5Cn", stderr);
X`09`09`09tidy_exit(BADEXIT);
X`09`09`7D
X#else
X# if SYS_WINNT
X`09`09/*
X`09`09 * Win32 needs to reopen the console, not fd 0.  If\1B0C
X`09`09 * is not reopened, the nt console I/O routines die immediately
X`09`09 * when attempting to fetch a STDIN handle.
X`09`09 */
X`09`09freopen("con", "r", stdin);
X# else
X#  if SYS_VMS
X  `09`09fd = open("tt:", O_RDONLY, S_IREAD); /* or sys$command */
X#  else`09`09&0209`09/* e.g., DOS-based systems */
X  `09`09fd = fileno(stderr);`09/* this normally cannot be redirected */
X#  endif
X  `09`09if ((fd >= 0)
X  `09`09 `26`26 (close(0) >= 0)
X  `09`09 `26`26 (fd = dup(fd)) == 0
X  `09`09 `26`26 (in = fdopen(fd, "r")) != 0)
X  `09`09`09*stdin = *in;
X#  endif /* SYS_WINNT */
X# endif /* SYS_UNIX */
X#endif /* DISP_X11 */
X
X  `09`09(void)slowreadf(bp, `26nline);
X`09`09set_rdonly(bp, bp->b_fname, MDREADONLY);
X`09`09(void)ffclose();
X
X`09`09if (is_empty_buf(bp)) `7B
X`09`09`09(void)zotbuf(bp);
X`09`09`09curbp = firstbp = lastbp;
X`09`09`7D
X#if OPT_FINDERR
X`09`09  else `7B
X`09`09`09set_febuff(bp->b_bname);
X`09`09`7D
X#endif
X`09`7D
X#endif
X
X#if DISP_X11 `26`26 !XTOOLKIT
X`09if (do_newgroup)
X`09`09(void) newprocessgroup(TRUE,1);
X#endif
X`09/* initialize the editor */
X
X`09if (!tt_opened)
X`09`09siginit();
X`09(void)open_terminal((TERM *)0);
X`09TTkopen();`09`09/* open the keyboard */
X`09TTrev(FALSE);
X
X`09if (vtinit() != TRUE)`09/* allocate display memory */
X`09`09tidy_exit(BADEXIT);
X
X`09winit(TRUE);`09`09/* windows */
X
X`09/* this comes out to 70 on an 80 (or greater) column display */
X`09`7B`09register int fill;
X`09`09fill = (7 * term.t_ncol) / 8;  /* must be done after vtinit() */
X`09`09if (fill > 70) fill = 70;
X`09`09set_global_b_val(VAL_FILL, fill);
X`09`7D
X
X`09/* Create an unnamed buffer, so that the initialization-file will have
X`09 * something to work on.  We don't pull in any of the command-line
X`09 * filenames yet, because some of the initialization stuff has to be
X`09 * triggered by switching buffers after reading the .vilerc file.
X`09 *
X`09 * If nothing modifies it, this buffer will be automatically removed
X`09 * when we switch to the first file (e.g.,\1206bp), because it is
X`09 * empty (and presumably isn't named the same as an actual file).
X`09 */
X`09bp = bfind(UNNAMED_BufName, 0);
X`09bp->b_active = TRUE;
X#if OPT_DOSFILES
X`09/* an empty non-existent buffer defaults to line-style
X`09`09favored by the OS */
X`09make_local_b_val(bp, MDDOS);
X`09set_b_val(bp, MDDOS, CRLF_LINES);
X#endif
X`09fix_cmode(bp, FALSE);
X`09swbuffer(bp);
X
X`09/* run the specified, or\1206ystem startup file here.
X`09   if vileinit is set, it's the name of the user's
X`09   command-line startup file, i.e. 'vile @mycmds'
X`09 */
X`09if (vileinit `26`26 *\0D08) `7B
X`09`09if ((startstat = do_source(vileinit,1, FALSE)) != TRUE)
X`09`09`09goto begin;
X`09`09free(startup_file);
X`09`09startup_file = strmalloc(vileinit);
X`09`7D else `7B
X
X`09`09/* now vileinit is the contents of their VILEINIT variable */
X`09`09vileinit = getenv("VILEINIT");
X`09`09if (vileinit != NULL) `7B /* set... */
X`09`09`09int odiscmd;
X`09`09`09BUFFER *vbp, *obp;
X`09`09`09int oflags = 0;
X`09`09`09if (*vileinit) `7B /* ...and not null */
X`09`09&0209/* mark as modified, to prevent
X`09`09&0209 * undispbuff() from clobbering */
X`09`09&0209obp = curbp;
X`09`09&0209if (obp) `7B
X`09`09&0209`09oflags = obp->b_flag;
X`09`09&0209`09b_set_changed(obp);
X`09`09&0209`7D
X
X`09`09&0209if ((vbp=bfind(VILEINIT_BufName, BFEXEC)) == 0)
X`09`09&0209`09tidy_exit(BADEXIT);
X
X`09`09&0209/* don't want swbuffer to try to read it */
X`09`09&0209vbp->b_active = TRUE;
X`09`09&0209swbuffer(vbp);
X`09`09&0209b_set_scratch(vbp);
X`09`09&0209bprintf("%s", vileinit);
X`09`09&0209/* if we leave it scratch, swbuffer(obp)
X`09`09&0209`09may zot it, and we \130A again */
X`09`09&0209b_clr_scratch(vbp);
X`09`09&0209set_rdonly(vbp, vbp->b_fname, MDVIEW);
X
X`09`09&0209/* go execute it! */
X`09`09&0209odiscmd = \0906;
X`09`09&0209discmd = FALSE;
X`09`09&0209startstat = dobuf(vbp);
X`09`09&0209discmd = o\0A06;
X`09`09&0209if (startstat != TRUE)
X`09`09&0209`09goto begin;
X`09`09&0209if (obp) `7B
X`09`09&0209`09swbuffer(obp);
X`09`09&0209`09obp->b_flag = oflags;
X`09`09&0209`7D
X`09`09&0209/* remove the now unneeded buffer */
X`09`09&0209b_set_scratch(vbp);  /* make sure it will go */
X`09`09&0209(void)zotbuf(vbp);
X`09`09`09`7D
X`09`09`7D else `7B  /* find and run .vilerc */
X`09`09`09startstat = do_source(startup_file, 1, TRUE);
X`09`09`09if (startstat != TRUE)
X`09`09&0209goto begin;
X`09`09`7D
X`09`7D
X
X`09/* If there are any files to read, read the first one!  Double-check,
X`09 * however, since a startup-script may have removed the first buffer.
X`09 */
X`09if (firstbp != 0
X`09 `26`26 find_bp(firstbp)) `7B
X`09`09if (find_bp(bp) `26`26 is_empty_buf\1408!b_is_changed(bp))
X`09`09`09b_set_scratch(bp);`09/* remove the unnamed-buffer */
X`09`09startstat = swbuffer(firstbp);
X`09`09if (firstname)
X`09`09`09set_last_file_edited(firstname);
X`09`09if (bp2any_wp(bp) `26`26 \110Afirstbp))
X`09`09`09zotwp(bp);
X`09`7D
X#if OPT_TAGS
X`09else if (tname) `7B
X`09`09cmdlinetag(tname);
X`09`09didtag = TRUE;
X`09`7D
X#endif
X`09msg = s_NULL;
X`09if (helpflag) `7B
X`09`09if (help(TRUE,1) != TRUE) `7B
X`09`09`09msg =
X`09"`5BProblem with help information. Type `5C":quit`5C" to exit if you wish
V`5D";
X`09`09`7D
X`09`7D else `7B
X`09`09msg = "`5BUse `5EA-h, `5EX-h, or :help to get help`5D";
X`09`7D
X
X`09/* Deal with startup gotos and searches */
X`09if (gotoflag + (search_exp != 0)
X#if OPT_TAGS
X`09`09 + (tname?1:0)
X#endif
X`09`09> 1) `7B
X#if OPT_TAGS
X`09`09msg = "`5BSearch, goto and tag are used one at a time`5D";
X#else
X`09`09msg = "`5BCannot search and goto at the same time`5D";
X#endif
X`09`7D else if (gotoflag) `7B
X`09`09if (gotoline(gline != 0, gline) == FALSE) `7B
X`09`09`09msg = "`5BNot that many lines in buffer`5D";
X`09`09`09(void)gotoeob(FALSE,1);
X`09`09`7D
X`09`7D else if (search_exp) `7B
X`09`09FreeIfNeeded(gregexp);
X`09`09(void)strncpy0(pat, search_exp->pat, NPAT);
X`09`09gregexp = search_exp->reg;
X`09`09(void)forwhunt(FALSE, 0);
X#if OPT_TAGS
X`09`7D else if (tname `26`26 !didtag) `7B
X`09`09cmdlinetag(tname);
X#endif
X`09`7D
X
X#if OPT_POPUP_MSGS
X`09purge_msgs();
X#endif
X`09if (startstat == TRUE)  /* else there's probably an error message */
X`09`09mlforce(msg);
X
X begin:
X`09(void)update(FALSE);
X
X#if OPT_POPUP_MSGS
X`09if (global_g_val(GMDPOPUP_MSGS) `26`26 (startstat != TRUE)) `7B
X`09`09bp = bfind(MESSAGES_BufName, BFSCRTCH);
X`09`09bsizes(bp);
X`09`09if (bp->b_linecount > 1) `7B
X`09`09`09popup_msgs();
X`09`09`09*mlsave = EOS;
X`09`09`7D
X`09`7D
X`09if (global_g_val(GMDPOPUP_MSGS) == -TRUE)
X`09`09set_global_g_val(GMDPOPUP_MSGS, FALSE);
X#endif
X
X`09/* We won't always be able to show messages before the screen is
X`09 * initialized.  Give it one last chance.
X`09 */
X`09if ((startstat != TRUE) `26`26 *mlsave)
X`09`09mlforce("%s", mlsave);
X
X`09/* process commands */
X`09loop();
X
X`09/* NOTREACHED */
X`09return BADEXIT;
X`7D
X
X/* this is nothing but the main command loop */
Xstatic void
Xloop(void)
X`7B
X`09const CMDFUNC
X`09`09*cfp = NULL,
X`09`09*last_cfp = NULL,
X`09`09*last_failed_motion_cfp = NULL;
X`09int s,c,f,n;
X
X
X`09for_ever `7B
X
X`09`09/* vi doesn't let the cursor rest on the newline itself.  This
X`09`09`09takes care of that. */
X`09`09/* if we're inserting, or will b\160B again, then
X`09`09`09suppress.  this happens if we're using arrow keys
X`09`09`09during insert */
X`09`09if (is_at_end_of_line(DOT) `26`26 (DOT.o > w_left_margin(curwp)) &0226
X`09`09&0209!insertmode `26`26 !cmd_mouse_motion(cfp))
X`09`09`09backchar(TRUE,1);
X
X`09`09/* same goes for end-of-file -- I'm actually not sure if
X`09`09`09this can ever happen, but I _am_ sure that it's
X`09`09`09a lot safer not to let it... */
X`09`09if (is_header_line(DOT,curbp) `26`26 !is_empty_buf(\1806)
X`09`09`09(void)backline(TRUE,1);
X
X`09`09/* start recording for '.' command */
X`09`09dotcmdbegin();
X
X`09`09/* Fix up the screen`09*/
X`09`09s = update(FALSE);
X
X`09`09/* get the next command from the keyboard */
X`09`09c = kbd_seq();
X
X`09`09/* if there is something on the command line, clear it */
X`09`09if (kbd_length() > 0) `7B
X`09`09`09mlerase();
X`09`09`09if (s != SORTOFTRUE) /* did nothing due to typeahead */
X`09`09&0209(void)update(FALSE);
X`09`09`7D
X
X`09`09f = FALSE;
X`09`09n = 1;
X
X#if LATERMAYBE
X/* insertion is too complicated to pop in
X`09and out of so glibly...   -pgf */
X#ifdef insertmode
X`09`09/* FIXME: Paul and Tom should check this over. */
X`09`09if (insertmode != FALSE) `7B
X`09`09`09if (!kbd_replaying(FALSE))
X`09`09`09    mayneedundo();
X`09`09`09unkeystroke(c);
X`09`09`09insert(f,n);
X`09`09`09dotcmdfinish();
X`09`09`09continue;
X`09`09`7D
X#endif /* insertmode */
X#endif /* LATERMAYBE */
X
X`09`09do_repeats(`26c,`26f,`26n);
X
X`09`09kregflag = 0;
X
X`09`09/* flag the first time through for some commands -- e.g. subst
X`09`09`09must know to not prompt for strings again, and pregion
X`09`09`09must only restart the p-lines buffer once for each
X`09`09`09command. */
X`09`09calledbefore = FALSE;
X
X`09`09/* and execute the command */
X`09`09cfp = kcod2fnc(c);
X
X`09`09if (cfp == `26f_dotcmdplay `26`26
X`09`09`09(last_cfp == `26f_undo `7C`7C
X`09`09`09 last_cfp == `26f_forwredo `7C`7C
X`09`09`09 last_cfp == `26f_backundo `7C`7C
X`09`09`09 last_cfp == `26f_inf_undo))
X`09`09`09cfp = `26f_inf_undo;
X
X`09`09s = execute(cfp, f, n);
X
X`09`09last_cfp = cfp;
X
X`09`09/* stop recording for '.' command */
X`09`09dotcmdfinish();
X
X`09`09/* If this was a motion that failed, sound the alarm (like vi),
X`09`09 * but limit it to once, in case the user is holding down the
X`09`09 * autorepeat-key.
X`09`09 */
X`09`09if ( (cfp != NULL)
X`09`09 `26`26 ((cfp->c_flags `26 MOTION) != 0)
X`09`09 `26`26 (s == FALSE) ) `7B
X`09`09`09if (cfp != last_failed_motion_cfp `7C`7C
X`09`09&0209`09global_g_val(GMDMULTIBEEP)) `7B
X`09`09&0209last_failed_motion_cfp = cfp;
X`09`09&0209kbd_alarm();
X`09`09`09`7D
X`09`09`7D else `7B
X`09`09`09last_failed_motion_cfp = NULL; /* avoid noise! */
X`09`09`7D
X
X`09`09attrib_matches();
X
X`09`7D
X`7D
X
X/* attempt to locate the executable that contains our code.
X* leave its directory name in exec_pathname and shorten prog_arg
X* to the simple filename (no path).
X*/
Xstatic void
Xget_executable_dir(void)
X`7B
X#if SYS_UNIX `7C`7C SYS_VMS
X`09char`09temp`5BNFILEN`5D;
X`09char`09*s, *t;
X
X`09if (last_slash(prog_arg) == NULL) `7B
X`09`09/* If there are no slashes, we can guess where we came from,
X`09`09 */
X`09`09if ((s = flook(prog_arg, FL_PATH`7CFL_EXECABLE)) != 0)
X`09`09`09s = strmalloc(s);
X`09`7D else `7B
X`09`09/* if there _are_ slashes, then argv`5B0`5D was either
X`09`09 * absolute or relative. lengthen_path figures it out.
X`09`09 */
X`09`09s = strmalloc(lengthen_path(strcpy(temp, prog_arg)));
X`09`7D
X`09if (s == 0)
X`09`09return;
X
X`09t = pathleaf(s);
X`09if (t != s) `7B
X# if SYS_UNIX`09/* 't' points past slash */
X`09`09t`5B-1`5D = EOS;
X`09`09prog_arg = t;
X# else`09`09/* 't' points to '`5D' */
X`09`09*t = EOS;
X`09`09prog_arg = t+1;
X# endif
X`09`09exec_pathname = s;
X`09`7D else
X`09`09free(s);
X#endif
X`7D
X
Xvoid
Xtidy_exit(int code)
X`7B
X`09ttclean (TRUE);
X#if SYS_UNIX
X`09setup_handler(SIGHUP,SIG_IGN);
X#endif
X`09ExitProgram(code);
X`7D
X
X#ifndef strmalloc
Xchar *
Xstrmalloc(const char *s)
X`7B
X`09register char *ns = castalloc(char,strlen(s)+1);
X`09if (ns != 0)
X`09`09(void)strcpy(ns,s);
X`09return ns;
X`7D
X#endif
X
Xint
Xno_memory(const char *s)
X`7B
X`09mlforce("`5B%s`5D %s", out_of_mem, s);
X`09return FALSE;
X`7D
X
Xstatic void
Xglobal_val_init(void)
X`7B
X`09static const char expand_chars`5B`5D =
X`09`09`7B EXPC_THIS,\0B08AT\0B07SHELL\1708OKEN\2307RPAT, 0 `7D;
X`09register int i;
X`09char *s;
X
X`09/* set up so the global value pointers\0906 at \230A
X`09`09values.  we never actually use the global pointers
X`09`09directly, but when buffers get a copy of the
X`09`09global_b_values structure, the pointers will still point
X`09`09back at the global values, which is what we want */
X`09for (i = 0; i <= NUM_G_VALUES; i++)
X`09`09make_local_val(global_g_values.gv, i);
X
X`09for (i = 0; i <= NUM_B_VALUES; i++)
X`09`09make_local_val(global_b_values.bv, i);
X
X`09for (i = 0; i <= NUM_W_VALUES; i++)
X`09`09make_local_val(global_w_values.wv, i);
X
X#if OPT_MAJORMODE
X`09/*
X`09 * Built-in majormodes
X`09 */
X`09alloc_mode("c", TRUE);
X#endif
X
X`09/*
X`09 * Universal-mode defaults
X`09 */
X`09set_global_g_val(GMDABUFF,`09TRUE); `09/* auto-buffer */
X`09set_global_g_val(GMDALTTABPOS,`09FALSE); /* emacs-style tab
X`09`09&0209&0309positioning */
X#ifdef GMDDIRC
X`09set_global_g_val(GMDDIRC,`09FALSE); /* directory-completion */
X#endif
X`09set_global_g_val(GMDERRORBELLS, TRUE);`09/* alarms are noticeable */
X#if OPT_FLASH
X`09set_global_g_val(GMDFLASH,  `09FALSE);`09/* beeps beep by default */
X#endif
X#ifdef GMDW32PIPES
X`09set_global_g_val(GMDW32PIPES,  `09is_winnt()); /* use native pipes? */
X#endif
X#if SYS_WINNT `26`26 defined(DISP_NTWIN)
X`09/* Allocate console before spawning piped process? */
X    if (is_win95())
X    `7B
X#define WHACKED_SHELL  "command.com"
X#define WHACKED_LEN    (sizeof(\1708SHELL) - 1)
X
X        char *shell = get_shell();
+-+-+-+-+-+-+-+-  END  OF PART 66 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 67 -+-+-+-+-+-+-+-+
X        int  sh_len = strlen(shell);
X
X        if (sh_len >= WHACKED_LEN `26`26
X        \0808    stricmp(shell + sh_len - WHACKED_LEN,\0D09SHELL) == 0)
X        `7B
X            set_global_g_val(GMDFORCE_CONSOLE, 1);
X        `7D
X#undef  WHACKED_LEN
X#undef  WHACKED_SHELL
X    `7D
X#endif
X#ifdef GMDHISTORY
X`09set_global_g_val(GMDHISTORY,`09TRUE);
X#endif
X`09set_global_g_val(GMDMULTIBEEP,`09TRUE); /* multiple beeps for\1309
X`09`09&0209&0209motion failures */
X#if OPT_WORKING
X`09set_global_g_val(GMDWORKING,  `09TRUE);`09/* we put up "working..." */
X#endif
X`09/* which 8 bit chars are printable? */
X`09set_global_g_val(GVAL_PRINT_LOW, 0);
X`09set_global_g_val(GVAL_PRINT_HIGH, 0);
X
X
X`09/* catnap times: */
X`09/* how long to wait for ESC seq */
X`09set_global_g_val(GVAL_TIMEOUTVAL, 500);
X`09/* how long to wait for user seq */
X#if SYS_MSDOS`09/* actually, 16-bit ints */
X`09set_global_g_val(GVAL_TIMEOUTUSERVAL, 30000);
X#else
X`09set_global_g_val(GVAL_TIMEOUTUSERVAL, 60000);
X#endif
X
X#if SYS_WINNT
X`09set_global_g_val(GVAL_SCROLLPAUSE, 0);
X#endif
X
X`09/* allow remapping by default */
X`09set_global_g_val(GMDREMAP, TRUE);
X
X`09set_global_g_val(GVAL_MAPLENGTH, 1200);
X
X`09/* set noresolve-links by default in case we've got NFS problems */
X#ifdef GMDRESOLVE_LINKS
X`09set_global_g_val(GMDRESOLVE_LINKS, FALSE);
X#endif
X
X`09set_global_g_val_ptr(GVAL_EXPAND_CHARS, strmalloc(expand_chars));
X`09set_global_g_val(GMDEXPAND_PATH,FALSE);
X#ifdef GMDGLOB
X`09set_global_g_val(GMDGLOB, TRUE);
X#endif
X#ifdef GVAL_GLOB
X`09set_global_g_val_ptr(GVAL_GLOB, strmalloc("!echo %s"));
X#endif
X
X`09set_global_g_val(GMDIMPLYBUFF,`09FALSE); /* imply-buffer */
X#if`09OPT_POPUPCHOICE
X# if`09OPT_ENUM_MODES
X`09set_global_g_val(GVAL_POPUP_CHOICES, \0F0D_DELAYED);
X# else
X`09set_global_g_val(GMDPOPUP_CHOICES,TRUE);
X# endif
X#endif
X#if`09OPT_FILEBACK
X# if`09OPT_MSDOS_PATH
X`09set_global_g_val_ptr(GVAL_BACKUPSTYLE, strmalloc(".bak"));
X# else
X`09set_global_g_val_ptr(GVAL_BACKUPSTYLE, strmalloc("off"));
X# endif
X#endif
X#if`09OPT_POPUP_MSGS
X`09set_global_g_val(GMDPOPUP_MSGS,-TRUE);`09/* popup-msgs */
X#endif
X#ifdef GMDRAMSIZE
X`09set_global_g_val(GMDRAMSIZE,`09TRUE);`09/* show ram-usage */
X#endif
X`09set_global_g_val(GVAL_REPORT,`095);`09/* report changes */
X#if`09OPT_XTERM
X`09set_global_g_val(GMDXTERM_MOUSE,FALSE);`09/* mouse-clicking */
X#endif
X`09set_global_g_val(GMDWARNUNREAD,TRUE);`09/* warn if quitting without
X`09`09&0209&0209looking at all buffers */
X`09set_global_g_val(GMDWARNREREAD,TRUE);`09/* warn before rereading
X`09`09&0209&0209a buffer */
X`09set_global_g_val(GMDWARNRENAME,TRUE);`09/* warn before renaming
X`09`09&0209&0209a buffer */
X`09set_global_g_val(GMDSMOOTH_SCROLL, FALSE);
X`09set_global_g_val(GMDSPACESENT,  TRUE); /* add two spaces after each
X`09`09&0209&0209sentence */
X#if OPT_COLOR
X`09set_global_g_val(GVAL_FCOLOR,`09C_WHITE); /* foreground color */
X`09set_global_g_val(GVAL_BCOLOR,`09C_BLACK); /* background color */
X#endif
X
X`09/*
X`09 * Buffer-mode defaults
X`09 */
X`09set_global_b_val(MDAIND,`09FALSE); /* auto-indent */
X`09set_global_b_val(MDASAVE,`09FALSE);`09/* auto-save */
X`09set_global_b_val(MDBACKLIMIT,`09TRUE); `09/* limit backspacing to
X`09`09&0209&0309insert point */
X#ifdef`09MDCHK_MODTIME
X`09set_global_b_val(MDCHK_MODTIME,`09FALSE); /* modtime-check */
X#endif
X#if`09!OPT_MAJORMODE
X`09set_global_b_val(MDCMOD,`09FALSE); /* C mode */
X#endif
X#ifdef MDCRYPT
X`09set_global_b_val(MDCRYPT,`09FALSE);`09/* crypt */
X#endif
X`09set_global_b_val(MDIGNCASE,`09FALSE); /* exact matches */
X`09set_global_b_val(MDDOS, CRLF_LINES); /* on by default on DOS, off others */
V
X`09set_global_b_val(MDMAGIC,`09TRUE); `09/* magic searches */
X`09set_global_b_val( MDMETAINSBIND, TRUE); /* honor meta-bindings when
X`09`09&0209&0309in insert mode */
X`09set_global_b_val(MDNEWLINE,`09TRUE); `09/* trailing-newline */
X`09set_global_b_val(MDREADONLY,`09FALSE); /* readonly */
X`09set_global_b_val(MDSHOWMAT,`09FALSE);`09/* show-match */
X`09set_global_b_val(MDSHOWMODE,`09TRUE);`09/* show-mode */
X`09set_global_b_val(MDSWRAP,`09TRUE); `09/* scan wrap */
X`09set_global_b_val(MDTABINSERT,`09TRUE);`09/* allow tab insertion */
X`09set_global_b_val(MDTAGSRELTIV,`09FALSE);`09/* path relative tag lookups */
V
X`09set_global_b_val(MDTERSE,`09FALSE);`09/* terse messaging */
X#if`09OPT_HILITEMATCH
X`09set_global_b_val(VAL_HILITEMATCH, 0);`09/* no hilite */
X#endif
X`09set_global_g_val(GVAL_MINI_HILITE, VAREV); /* reverse hilite */
X#if`09OPT_UPBUFF
X`09set_global_b_val(MDUPBUFF,`09TRUE);`09/* animated */
X#endif
X`09set_global_b_val(MDVIEW,`09FALSE); /* view-only */
X`09set_global_b_val(MDWRAP,`09FALSE); /* wrap */
X#if OPT_LCKFILES
X`09/* locking defaults */
X`09set_global_g_val(GMDUSEFILELOCK,FALSE);`09/* Use filelocks */
X`09set_global_b_val(MDLOCKED,`09FALSE);`09/* \1306 */
X`09set_global_b_val_ptr(VAL_LOCKER, strmalloc("")); /* Name locker */
X#endif
X`09set_global_g_val(GMDRONLYVIEW,`09FALSE);`09/* Set view-on-readonly */
X`09set_global_g_val(GMDRONLYRONLY,`09FALSE);`09/* Set readonly-on-\0C08 */
X
X`09set_global_b_val(VAL_ASAVECNT,`09256);`09/* autosave count */
X#if OPT_MAJORMODE
X`09set_submode_val("c", VAL_SWIDTH, 8); `09/* C file shiftwidth */
X`09set_submode_val("c", VAL_TAB,`098); `09/* C file tab stop */
X#else
X`09set_global_b_val(VAL_C_SWIDTH,`098); `09/* C file shiftwidth */
X`09set_global_b_val(VAL_C_TAB,`098); `09/* C file tab stop */
X#endif
X`09set_global_b_val(VAL_SWIDTH,`098); `09/* shiftwidth */
X`09set_global_b_val(VAL_TAB,`098);`09/* tab stop */
X`09set_global_b_val(VAL_TAGLEN,`090);`09/* significant tag length */
X`09set_global_b_val(VAL_UNDOLIM,`0910);`09/* undo limit */
X
X`09set_global_b_val_ptr(VAL_TAGS, strmalloc("tags")); /* tags filename */
X`09set_global_b_val_ptr(VAL_FENCES, strmalloc("`7B`7D()`5B`5D")); /* fences */
V
X
X#if SYS_VMS
X#define`09DEFAULT_CSUFFIX`09"`5C`5C.&025C(&025C(`5BCHIS`5D&025C)&025C`7CCC
V&025C`7CCXX&025C`7CHXX&025C)&025C(;`5B0-9`5D*&025C)&025C?$"
X#endif
X#if SYS_MSDOS `7C`7C SYS_WIN31
X#define`09DEFAULT_CSUFFIX`09"`5C`5C.&025C(&025C(`5Bchis`5D&025C)&025C`7Ccc
V&025C`7Ccpp&025C`7Ccxx&025C`7Chxx&025C)$"
X#endif
X#ifndef DEFAULT_CSUFFIX`09/* UNIX or OS2/HPFS (mixed-case names) */
X#define`09DEFAULT_CSUFFIX`09"`5C`5C.&025C(&025C(`5BCchis`5D&025C)&025C`7CCC
V&025C`7Ccc&025C`7Ccpp&025C`7Ccxx&025C`7Chxx&025C`7Cscm&025C)$"
X#endif
X
X#if OPT_MAJORMODE
X`09set_majormode_rexp("c", MVAL_SUFFIXES, DEFAULT_C\1306);
X#else
X`09/* suffixes for C mode */
X`09set_global_g_val_rexp(GVAL_CSUFFIXES,
X`09`09new_regexval(
X`09`09`09DEFAULT_CSUFFIX,
X`09`09`09TRUE));
X#endif
X
X#define B_REGEXP(mode,value) `5C
X`09`09set_global_b_val_rexp(mode, new_regexval(value, TRUE));
X
X`09B_REGEXP( VAL_FENCE_BEGIN, "/`5C`5C*" );
X`09B_REGEXP( VAL_FENCE_END,   "`5C`5C*/" );
X
X`09B_REGEXP( VAL_FENCE_IF,    "`5E`5C`5Cs*#&025Cs*if" );
X`09B_REGEXP( VAL_FENCE_ELIF,  "`5E`5C`5Cs*#&025Cs*elif&025C>" );
X`09B_REGEXP( VAL_FENCE_ELSE,  "`5E`5C`5Cs*#&025Cs*else&025C>" );
X`09B_REGEXP( VAL_FENCE_FI,    "`5E`5C`5Cs*#&025Cs*endif&025C>" );
X
X`09`09/* where do paragraphs start? */
X`09B_REGEXP( VAL_PARAGRAPHS, "`5E`5C`5C.`5BILPQ`5DP&025C>&025C`7C`5E&025C.
V\0B07`5C
X`5E`5C`5C.LI&025C>&025C`7C`5E&025C.`5Bplinb`5Dp\120A&025C?&025Cs*$" );
X
X`09`09/* where do comments start and end, for formatting them */
X`09B_REGEXP( VAL_COMMENTS, "`5E`5C`5Cs*/&025C?&025C(&025Cs*`5B#*>`5D&025C)
V&025C+\1606s*$" );
X
X`09B_REGEXP( VAL_CMT_PREFIX, "`5E`5C`5Cs*&025C(&025Cs*`5B#*>`5D&025C)&025C+" )
V;
X
X`09`09/* where do sections start? */
X`09B_REGEXP( VAL_SECTIONS, "`5E`5B`7B`5C014`5D`5C`5C`7C`5E&025C.`5BNS`5DH&025C
V>\0F07HU&025C?\0F06`5C
X`5E`5C`5C.`5Bus`5Dh&025C>&025C`7C`5E+c&025C>" );`09/* `7Dvi */
X
X`09`09/* where do sentences start? */
X`09B_REGEXP( VAL_SENTENCES, "`5B.!?`5D`5B`5D)`5C"'`5D* `5C`5C?$&025C`7C\150E`20
V&025C`7C`5C
X`5E`5C`5C.`5BILPQ`5DP&025C>&025C`7C`5E&025C.\0B0BLI\170A`5Bplinb`5Dp\290A&025C
V?&025Cs*$" );
X
X`09/*
X`09 * Window-mode defaults
X`09 */
X#ifdef WMDLINEWRAP
X`09set_global_w_val(WMDLINEWRAP,`09FALSE); /* line-wrap */
X#endif
X`09set_global_w_val(WMDLIST,`09FALSE); /* list-mode */
X`09set_global_w_val(WMDNUMBER,`09FALSE);`09/* number */
X`09set_global_w_val(WMDHORSCROLL,`09TRUE);`09/* horizontal scrolling */
X#ifdef WMDTERSELECT
X`09set_global_w_val(WMDTERSELECT,`09TRUE);`09/* terse selections */
X#endif
X
X`09set_global_w_val(WVAL_SIDEWAYS,`090);`09/* list-mode */
X
X`09if ((s = getenv("VILE_HELP_FILE")) == 0)
X`09`09s = "vile.hlp";
X`09helpfile = strmalloc(s);
X
X`09if ((s = getenv("VILE_STARTUP_FILE")) == 0) `7B
X#if`09SYS_MSDOS `7C`7C SYS_WIN31\0D08OS2\180BNT\2508VMS
X`09`09s = "vile.rc";
X#else`09/* SYS_UNIX */
X`09`09s = ".vilerc";
X#endif
X`09`7D
X`09startup_file = strmalloc(s);
X
X`09if ((s = getenv("VILE_STARTUP_PATH")) == 0) `7B
X#if`09SYS_MSDOS `7C`7C SYS_WIN31\0D08OS2\180BNT
X`09`09s = "`5C`5Csys&025Cpublic&025C;&025Cusr&025Cbin&025C;&025C\0808";
X#else
X#if`09SYS_VMS
X`09`09s = "sys$login;sys$sysdevice:`5Bvmstools`5D;sys$library";
X#else`09/* SYS_UNIX */
X#if`09defined(VILE_STARTUP_PATH)
X`09`09s = VILE_STARTUP_PATH;
X#else
X`09`09s = "/usr/local/lib/:\100B\0C07ib/";
X#endif
X#endif
X#endif
X`09`7D
X`09startup_path = strmalloc(s);
X
X#ifdef`09HELP_LOC
X`09/*
X`09 * *NIX install will define this
X`09 */
X`09`7B
X`09`09char temp`5BNFILEN`5D;
X`09`09int found = FALSE;
X`09`09const char *t = startup_path;
X
X`09`09while ((t = parse_pathlist(t, temp)) != 0) `7B
X`09`09`09if (!strcmp(temp, HELP_LOC)) `7B
X`09`09&0209found = TRUE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`09if (!found) `7B
X`09`09`09s = typeallocn(char, strlen(HELP_LOC) + 2 + \1707startup_path));
X`09`09`09lsprintf(s, "%s%c%s", HELP_LOC, PATHCHR, startup_path);
X`09`09`09startup_path = s;
X`09`09`7D
X`09`7D
X#endif
X`7D
X
X#if SYS_UNIX `7C`7C SYS_MSDOS\0D08WIN31\1A08OS2\180BNT\3208VMS
X
X/* ARGSUSED */
XSIGT
Xcatchintr (int ACTUAL_SIG_ARGS)
X`7B
X`09am_interrupted = TRUE;
X#if SYS_MSDOS `7C`7C SYS_OS2\0B08WINNT
X`09sgarbf = TRUE;`09/* there's probably a `5EC on the screen. */
X#endif
X`09setup_handler(SIGINT,catchintr);
X`09if (im_waiting(-1))
X`09`09longjmp(read_jmp_buf, signo);
X`09SIGRET;
X`7D
X#endif
X
X#ifndef interrupted  /* i.e. unless it's a macro */
Xint
Xinterrupted(void)
X`7B
X#if SYS_MSDOS `26`26 CC_DJGPP
X
X`09if (_go32_was_ctrl_break_hit() != 0) `7B
X`09`09while(keystroke_avail())
X`09`09`09(void)keystroke();
X`09`09return TRUE;
X`09`7D
X`09if (was_ctrl_c_hit() != 0) `7B
X`09`09while(keystroke_avail())
X`09`09`09(void)keystroke();
X`09`09return TRUE;
X`09`7D
X
X`09if (am_interrupted)
X`09`09return TRUE;
X`09return FALSE;
X#endif
X`7D
X#endif
X
Xvoid
Xnot_interrupted(void)
X`7B
X    am_interrupted = FALSE;
X#if SYS_MSDOS
X# if CC_DJGPP
X    (void)_go32_was_ctrl_break_hit();  /* flush any pending kbd ctrl-breaks */
V
X    (void)was_ctrl_c_hit();  /* flush any pending kbd ctrl-breaks */
X# endif
X#endif
X`7D
X
X#if SYS_MSDOS
X# if CC_WATCOM
X    int  dos_crit_handler(unsigned deverror, \1309errcode\120B*devhdr)
X# else
X    void dos_crit_handler(void)
X# endif
X`7B
X# if CC_WATCOM
X`09_hardresume((int)_HARDERR_FAIL);
X`09return (int)_HARDERR_FAIL;
X# else
X#  if ! CC_DJGPP
X`09_hardresume(_HARDERR_FAIL);
X#  endif
X# endif
X`7D
X#endif
X
X
Xstatic void
Xsiginit(void)
X`7B
X#if SYS_UNIX
X`09setup_handler(SIGINT,catchintr);
X`09setup_handler(SIGHUP,imdying);
X#ifdef SIGBUS
X`09setup_handler(SIGBUS,imdying);
X#endif
X#ifdef SIGSYS
X`09setup_handler(SIGSYS,imdying);
X#endif
X`09setup_handler(SIGSEGV,imdying);
X`09setup_handler(SIGTERM,imdying);
X/* #define DEBUG 1 */
X#if DEBUG
X`09setup_handler(SIGQUIT,imdying);
X#else
X`09setup_handler(SIGQUIT,SIG_IGN);
X#endif
X`09setup_handler(SIGPIPE,SIG_IGN);
X#if defined(SIGWINCH) `26`26 ! DISP_X11
X`09setup_handler(SIGWINCH,sizesignal);
X#endif
X#else
X# if SYS_MSDOS
X`09setup_handler(SIGINT,catchintr);
X#  if CC_DJGPP
X`09_go32_want_ctrl_break(TRUE);
X`09setcbrk(FALSE);
X`09want_ctrl_c(TRUE);
X`09hard_error_catch_setup();
X#  else
X#   if CC_WATCOM
X`09`7B
X`09/* clean up Warning from Watcom C */
X`09void *ptrfunc = dos_crit_handler;
X`09_harderr(ptrfunc);
X`09`7D
X#   else`09/* CC_TURBO */
X`09_harderr(dos_crit_handler);
X#   endif
X#  endif
X# endif
X# if SYS_OS2 `7C`7C SYS_WINNT
X`09setup_handler(SIGINT,catchintr);
X#endif
X#endif
X
X`7D
X
Xstatic void
Xsiguninit(void)
X`7B
X#if SYS_MSDOS
X# if CC_DJGPP
X`09_go32_want_ctrl_break(FALSE);
X`09want_ctrl_c(FALSE);
X`09hard_error_teardown();
X`09setcbrk(TRUE);
X# endif
X#endif
X`7D
X
X/* do number processing if needed */
Xstatic void
Xdo_num_proc(int *cp, int *f\0908np)
X`7B
X`09register int c, f, n;
X`09register int`09mflag;
X`09register int oldn;
X
X`09c = *cp;
X
X`09if (isCntrl(c) `7C`7C isspecial(c))
X`09`09return;
X
X`09f = *fp;
X`09n = *np;
X`09if (f)
X`09`09oldn = n;
X`09else
X`09`09oldn = 1;
X`09n = 1;
X
X`09if ( isDigit(c) `26`26 c != '0' ) `7B
X`09`09n = 0;&0209/* start with a zero default */
X`09`09f = TRUE;`09/* there is a # arg */
X`09`09mflag = 1;&0209/* current minus flag */
X`09`09while ((isDigit(c) `26`26 !isspecial(c)) `7C`7C (c == '-')) `7B
X`09`09`09if (c == '-') `7B
X`09`09&0209/* already hit a minus or digit? */
X`09`09&0209if ((mflag == -1) `7C`7C (n != 0))
X`09`09&0209`09break;
X`09`09&0209mflag = -1;
X`09`09`09`7D else `7B
X`09`09&0209n = n * 10 + (c - '0');
X`09`09`09`7D
X`09`09`09if ((n == 0) `26`26 (mflag == -1))`09/* lonely - */
X`09`09&0209mlwrite("arg:");
X`09`09`09else
X`09`09&0209mlwrite("arg: %d",n * mflag);
X
X`09`09`09c = kbd_seq();`09/* get the next key */
X`09`09`7D
X`09`09n = n * mflag;`09/* figure in the sign */
X`09`7D
X`09*cp = c;
X`09*fp = f;
X`09*np = n * oldn;
X`7D
X
X/* do `5EU-style repeat argument processing -- vile binds this to 'K' */
Xstatic void
Xdo_rept_arg_proc(int *cp, int *f\0908np)
X`7B
X`09register int c, f, n;
X`09register int`09mflag;
X`09register int`09oldn;
X`09c = *cp;
X
X`09if (c != reptc)
X`09`09return;
X
X`09f = *fp;
X`09n = *np;
X
X`09if (f)
X`09`09oldn = n;
X`09else
X`09`09oldn = 1;
X
X`09n = 4;`09`09/* start with a 4 */
X`09f = TRUE;`09/* there is a # arg */
X`09mflag = 0;`09`09`09/* that can be discarded. */
X`09mlwrite("arg: %d",n);
X`09while ( (isDigit( c=kbd_seq() ) `26`26 !isspecial(c))
X`09`09`09`7C`7C c==reptc \0C06'-')`7B
X`09`09if (c == reptc) `7B
X`09`09`09/* wow.  what does this do?  -pgf */
X`09`09`09/* (i've been told it controls overflow...) */
X`09`09`09if ((n > 0) == ((n*4) > 0))
X`09`09&0209n = n*4;
X`09`09`09else
X`09`09&0209n = 1;
X`09`09`7D
X`09`09/*
X`09`09 * If dash, and start of argument string, set arg.
X`09`09 * to -1.  Otherwise, insert it.
X`09`09 */
X`09`09else if (c == '-') `7B
X`09`09`09if (mflag)
X`09`09&0209break;
X`09`09`09n = 0;
X`09`09`09mflag = -1;
X`09`09`7D
X`09`09/*
X`09`09 * If first digit entered, replace previous argument
X`09`09 * with digit and set sign.  Otherwise, append to arg.
X`09`09 */
X`09`09else `7B
X`09`09`09if (!mflag) `7B
X`09`09&0209n = 0;
X`09`09&0209mflag = 1;
X`09`09`09`7D
X`09`09`09n = 10*n + c - '0';
X`09`09`7D
X`09`09mlwrite("arg: %d", (mflag >=0) ? n : (n ? -n : -1));
X`09`7D
X`09/*
X`09 * Make arguments preceded by a minus sign negative and change
X`09 * the special argument "`5EU -" to an effective "`5EU -1".
X`09 */
X`09if (mflag == -1) `7B
X`09`09if (n == 0)
X`09`09`09n++;
X`09`09n = -n;
X`09`7D
X
X`09*cp = c;
X`09*fp = f;
X`09*np = n * oldn;
X`7D
X
X/* handle all repeat counts */
Xvoid
Xdo_repeats(int *cp, int *f\0908np)
X`7B
X`09do_num_proc(cp,fp,np);
X`09do_rept_arg_proc(cp,fp,np);
X`09if (dotcmdmode == PLAY) `7B
X`09`09if (dotcmdarg)`09/* then repeats are done by dotcmdcnt */
X`09`09`09*np = 1;
X`09`7D else `7B
X`09`09/* then we want to cancel any dotcmdcnt repeats */
X`09`09if (*fp) dotcmdarg = FALSE;
X`09`7D
X`7D
X
X/* the vi ZZ command -- write all, then quit */
Xint
Xzzquit(int f, int n)
X`7B
X`09int thiscmd;
X`09int cnt;
X`09BUFFER *bp;
X
X`09thiscmd = lastcmd;
X`09cnt = any_changed_buf(`26bp);
X`09if (cnt) `7B
X`09    `09if (cnt > 1) `7B
X`09`09    mlprompt("Will write %d buffers.  %s ", cnt,
X`09`09`09    clexec ? s_NULL : "Repeat command to continue.");
X`09`09`7D else `7B
X`09`09    mlprompt("Will write buffer `5C"%s`5C".  %s ",
X`09`09`09    bp->b_bname,
X`09`09`09    clexec ? s_NULL : "Repeat command to continue.");
X`09`09`7D
X`09`09if (!clexec `26`26 !isnamedcmd) `7B
X`09`09`09if (thiscmd != kbd_seq())
X`09`09&0209return FALSE;
X`09`09`7D
X
X`09`09if (writeall(f,n,FALSE,TRUE,FALSE) != TRUE) `7B
X`09`09`09return FALSE;
X`09`09`7D
X
X`09`7D else if (!clexec `26`26 !isnamedcmd) `7B
X`09`09/* consume the next char. anyway */
X`09`09if (thiscmd != kbd_seq())
X`09`09`09return FALSE;
X`09`7D
X`09return quit(f, n);
X`7D
X
X/*
X * Fancy quit command, as implemented by Norm. If the any buffer has
X * changed do a write on that buffer and exit, otherwise simply exit.
X */
Xint
Xquickexit(int f, int n)
X`7B
X`09register int status;
X`09if ((status = writeall(f,n,FALSE,TRUE,FALSE)) == TRUE)
X`09`09status = quithard(f, n);  /* conditionally quit`09*/
X`09return status;
X`7D
X
X/* Force quit by giving argument */
X/* ARGSUSED */
Xint
Xquithard(int f GCC_UNUSED, int n\120B)
X`7B
X`09return quit(TRUE,1);
X`7D
X
X/*
X * Quit command. If an argument, always quit. Otherwise confirm if a buffer
X * has been changed and not written out.
X */
X/* ARGSUSED */
Xint
Xquit(int f, int n GCC_UNUSED)
X`7B
X`09int cnt;
X`09BUFFER *bp;
X`09const char *sadj, *sverb;
X
X#if OPT_PROCEDURES
X`09`7B
X`09    static int exithooking;
X`09    if (!exithooking `26`26 *\1008) `7B
X`09`09    exithooking = TRUE;
X`09`09    run_procedure(exithook);
X`09`09    exithooking = FALSE;
X`09    `7D
X`09`7D
X#endif
X
X`09if (f == FALSE) `7B
X`09`09cnt = any_changed_buf(`26bp);
X`09`09sadj = "modified";
X`09`09sverb = "Write";
X`09`09if (cnt == 0 `26`26 global_g_val(GMDWARNUNREAD)) `7B
X`09`09`09cnt = any_unread_buf(`26bp);
X`09`09`09sadj = "unread";
X`09`09`09sverb = "Look at";
X`09`09`7D
X`09`09if (cnt != 0) `7B
X`09`09`09if (cnt == 1)
X`09`09&0209mlforce(
X`09`09&0209"Buffer `5C"%s`5C" is %s.  %s it, or use :q!",
X`09`09&0209`09bp->b_bname,sadj,sverb);
X`09`09`09else
X`09`09&0209mlforce(
X`09`09`09  "There are %d %s buffers.  %s them, or use :q!",
X`09`09&0209`09cnt,sadj,sverb);
X`09`09`09return FALSE;
X`09`09`7D
X`09`7D
X#if OPT_LCKFILES
X`09/* Release all placed locks */
X`09if ( global_g_val(GMDUSEFILELOCK) ) `7B
X`09`09for_each_buffer(bp) `7B
X`09`09`09if ( bp->b_active ) `7B
X`09`09&0209if (!b_val(curbp,MDLOCKED) `26`26
X`09`09&0209&0209!b_val(curbp,MDVIEW))
X`09`09&0209`09release_lock(bp->b_fname);
X`09`09`09`7D
X`09`09`7D
X`09`7D
X#endif
X`09siguninit();
X#if OPT_WORKING
X`09setup_handler(SIGALRM, SIG_IGN);
X#endif
X#if NO_LEAKS
X`09`7B
X`09`09beginDisplay();&0209/* ...this may take a while... */
X
X`09`09/* free all of the global data structures */
X`09`09onel_leaks();
X`09`09path_leaks();
X`09`09kbs_leaks();
X`09`09bind_leaks();
X`09`09map_leaks();
X`09`09tags_leaks();
X`09`09itb_leaks();
X`09`09tb_leaks();
X`09`09wp_leaks();
X`09`09bp_leaks();
X`09`09vt_leaks();
X`09`09ev_leaks();
X`09`09mode_leaks();
X#if DISP_X11
X`09`09x11_leaks();
X#endif
X
X`09`09free_local_vals(g_valnames, global_g_values.gv\1414);
X`09`09free_local_vals(b_valnames, global_b_values.bv\1414);
X`09`09free_local_vals(w_valnames, global_w_values.wv\1414);
X
X`09`09FreeAndNull(gregexp);
X`09`09FreeAndNull(patmatch);
X#if`09OPT_MLFORMAT
X    `09`09FreeAndNull(modeline_format);
X#endif
X
X#if SYS_UNIX
X`09`09if (strcmp(exec_pathname, "."))
X`09`09`09FreeAndNull(exec_pathname);
X#endif
X`09`09/* whatever is left over must be a leak */
X`09`09show_alloc();
X`09`7D
X#endif
X`09tidy_exit(GOODEXIT);
X`09/* NOTREACHED */
X`09return FALSE;
X`7D
X
X/* ARGSUSED */
Xint
Xwritequit(int f GCC_UNUSED, int n)
X`7B
X`09int s;
X`09s = filesave(FALSE,n);
X`09if (s != TRUE)
X`09`09return s;
X`09return quit(FALSE,n);
X`7D
X
X/*
X * Abort.
X * Beep the beeper. Kill off any keyboard macro, etc., that is in progress.
X * Sometimes called as a routine, to do general aborting of stuff.
X */
X/* ARGSUSED */
Xint
Xesc_func(int f GCC_UNUSED, int n\120B)
X`7B
X`09dotcmdmode = STOP;
X`09regionshape = EXACT;
X`09doingopcmd = FALSE;
X`09doingsweep = FALSE;
X`09sweephack = FALSE;
X`09opcmd = 0;
X`09mlwarn("`5BAborted`5D");
X`09return ABORT;
X`7D
X
X/* tell the user that this command is illegal while we are in
X   VIEW (read-only) mode`09`09&0209*/
X
Xint
Xrdonly(void)
X`7B
X`09mlwarn("`5BNo changes are allowed while in `5C"view`5C" mode`5D");
X`09return FALSE;
X`7D
X
X/* ARGSUSED */
Xint
Xunimpl(int f GCC_UNUSED, int n\120B)
X`7B
X`09mlwarn("`5BSorry, that vi command is unimplemented in vile `5D");
X`09return FALSE;
X`7D
X
Xint
Xopercopy(int f, int n)
X`7B
X`09return unimpl(f,n);
X`7D
X
Xint
Xopermove(int f, int n)
X`7B
X`09return unimpl(f,n);
X`7D
X
Xint
Xopertransf(int f, int n)
X`7B
X`09return unimpl(f,n);
X`7D
X
Xint
Xoperglobals(int f, int n)
X`7B
X`09return unimpl(f,n);
X`7D
X
Xint
Xopervglobals(int f, int n)
X`7B
X`09return unimpl(f,n);
X`7D
X
Xint
Xsource(int f, int n)
X`7B
X`09return unimpl(f,n);
X`7D
X
Xint
Xvisual(int f, int n)
X`7B
X`09return unimpl(f,n);
X`7D
X
Xint
Xex(int f, int n)
X`7B
X`09return unimpl(f,n);
X`7D
X
X/* ARGSUSED */
Xint
Xnullproc(int f GCC_UNUSED, int n\120B)`09/* user function that does (almost) N
VOTHING */
X`7B
X`09return TRUE;
X`7D
X
X/* ARGSUSED */
Xint
Xcntl_a_func(int f GCC_UNUSED, int n\120B)`09/* dummy function for binding to c
Vontrol-a prefix */
X`7B
X`09return TRUE;
X`7D
X
X/* ARGSUSED */
Xint
Xcntl_x_func(int f GCC_UNUSED, int n\120B)`09/* dummy function for binding to c
Vontrol-x prefix */
X`7B
X`09return TRUE;
X`7D
X
X/* ARGSUSED */
Xint
Xpoundc_func(int f GCC_UNUSED, int n\120B)`09/* dummy function for binding to p
Voundsign prefix */
X`7B
X`09return TRUE;
X`7D
X
X/* ARGSUSED */
Xint
Xunarg_func(int f GCC_UNUSED, int n\120B) /* dummy function for binding to univ
Versal-argument */
X`7B
X`09return TRUE;
X`7D
X
X/*--------\0808\1010\2020\400C*/
X
X#if OPT_SHOW_CTYPE
X
X/* list the current chrs into\160Dbuffer */
X/* ARGSUSED */
Xstatic void
Xmakectypelist(int dum1 GCC_UNUSED, void *ptr\160B)
X`7B
X`09static const struct `7B
X`09`09ULONG`09mask;
X`09`09const char *name;
X`09`7D table`5B`5D = `7B
X`09`09`7B _upper,`09"Upr" `7D,
X`09`09`7B _lower,`09"Lwr" `7D,
X`09`09`7B _digit,`09"Num" `7D,
X`09`09`7B _space,`09"Spc" `7D,
X`09`09`7B _bspace,`09"DEL" `7D,
X`09`09`7B _cntrl,`09"CTL" `7D,
X`09`09`7B _print,`09"Prn" `7D,
X`09`09`7B _punct,`09"Pun" `7D,
X`09`09`7B _ident,`09"id" `7D,
X`09`09`7B _pathn,`09"path" `7D,
X`09`09`7B _wild,`09"*" `7D,
X`09`09`7B _linespec,`09"arg" `7D,
X`09`09`7B _fence,`09"()" `7D,
X`09`09`7B _nonspace,`09"!S" `7D,
X`09`09`7B _qident,`09"qid" `7D,
X#if OPT_WIDE_CTYPES
X`09`09`7B _scrtch,`09"tmp" `7D,
X`09`09`7B _shpipe,`09"sh" `7D,
X#endif
X`09`09`7B 0,&02090 `7D
X`09`7D;
X`09register UINT i, j;
X
X`09bprintf("--- Printable Characters %*P`5Cn", term.t_ncol-1, '-');
X`09for (i = 0; i < N_chars; i++) `7B
X`09`09bprintf("`5Cn%d`5Ct", i);
X`09`09if ((i == '`5Cn') `7C`7C (\0F07t')) /* vtlistc() may not do these */
X`09`09`09bprintf("`5E%c", '@' `7C i);
X#if OPT_LOCALE
X`09`09else if (!isprint(i) `26`26 i > 127\0B06< 160) /* C1 controls? */
X`09`09`09bprintf(
X`09`09&0209global_w_val(WMDNONPRINTOCTAL)
X`09`09&0209? "`5C`5C%3o"
X`09`09&0209: "`5C`5Cx%2x",
X`09`09&0209i);
X#endif
X`09`09else
X`09`09`09bprintf("%c", i);
X`09`09bputc('`5Ct');
X`09`09for (j = 0; table`5Bj`5D.name != 0; j++) `7B
X`09`09`09if (j != 0)
X`09`09&0209bputc(' ');
X`09`09`09bprintf("%*s",
X`09`09&0209strlen(table`5Bj`5D.name),
X`09`09&0209(_chartypes_`5Bi`5D `26 table`5Bj`5D.mask)
X`09`09&0209`09? table`5Bj`5D.name
X`09`09&0209`09: "-");
X`09`09`7D
X`09`7D
X`7D
X
Xint
Xdesprint(int f GCC_UNUSED, int n\120B)
X`7B
X`09return liststuff(PRINTABLECHARS_BufName, FALSE, makectypelist, 0, (void *)0
V);
X`7D
X
X#endif /* OPT_SHOW_CTYPE */
X
X/*--------\0808\1010\2020\400C*/
X
X/* initialize our version of the "chartypes" stuff normally in ctypes.h */
X/* also called later, if charset-affecting modes change, for instance */
Xvoid
Xcharinit(void)
X`7B
X`09register int c;
X
X`09/* If we're using the locale functions, set our flags based on its
X`09 * tables.  Note that just because you have 'setlocale()' doesn't mean
X`09 * that the tables are present or correct.  But this is a start.
X`09 */
X#if OPT_LOCALE
X`09for (c = 0; c < N_chars; c++) `7B
X`09`09_chartypes_`5Bc`5D = 0;
X`09`09if (iscntrl(c))  _chartypes_`5Bc`5D `7C= _cntrl;
X`09`09if (isdigit(c))  _chartypes_`5Bc`5D `7C= _digit;
X`09`09if (islower(c))  _chartypes_`5Bc`5D `7C= _lower;
X`09`09if (isprint(c))  _chartypes_`5Bc`5D `7C= _print;
X`09`09if (ispunct(c))  _chartypes_`5Bc`5D `7C= _punct;
X`09`09if (isspace(c))  _chartypes_`5Bc`5D `7C= _space;
X`09`09if (isupper(c))  _chartypes_`5Bc`5D `7C= _upper;
X`09`7D
X#else /* ! OPT_LOCALE */
X`09(void)memset((char *)_chartypes_, 0, sizeof(\170B));
X
X`09/* control characters */
X`09for (c = 0; c < ' '; c++)
X`09`09_chartypes_`5Bc`5D `7C= _cntrl;
X`09_chartypes_`5B127`5D `7C= _cntrl;
X
X`09/* lowercase */
X`09for (c = 'a'; c <= 'z'; c++)
X`09`09_chartypes_`5Bc`5D `7C= _lower;
X#if OPT_ISO_8859
X`09for (c = 0xc0; c <= 0xd6; c++)
X`09`09_chartypes_`5Bc`5D `7C= _lower;
X`09for (c = 0xd8; c <= 0xde; c++)
X`09`09_chartypes_`5Bc`5D `7C= _lower;
X#endif
X`09/* uppercase */
X`09for (c = 'A'; c <= 'Z'; c++)
X`09`09_chartypes_`5Bc`5D `7C= _upper;
X#if OPT_ISO_8859
X`09for (c = 0xdf; c <= 0xf6; c++)
X`09`09_chartypes_`5Bc`5D `7C= _upper;
X`09for (c = 0xf8; c <= 0xff; c++)
X`09`09_chartypes_`5Bc`5D `7C= _upper;
X#endif
X
X`09/* digits */
X`09for (c = '0'; c <= '9'; c++)
X`09`09_chartypes_`5Bc`5D `7C= _digit;
X
X`09/* punctuation */
X`09for (c = '!'; c <= '/'; c++)
X`09`09_chartypes_`5Bc`5D `7C= _punct;
X`09for (c = ':'; c <= '@'; c++)
X`09`09_chartypes_`5Bc`5D `7C= _punct;
X`09for (c = '`5B'; c <= '`60'; c++)
X`09`09_chartypes_`5Bc`5D `7C= _punct;
X`09for (c = LBRACE; c <= '`7E'; c++)
X`09`09_chartypes_`5Bc`5D `7C= _punct;
X#if OPT_ISO_8859
X`09for (c = 0xa1; c <= 0xbf; c++)
X`09`09_chartypes_`5Bc`5D `7C= _punct;
X#endif
X
X`09/* printable */
X`09for (c = ' '; c <= '`7E'; c++)
X`09`09_chartypes_`5Bc`5D `7C= _print;
X
X`09/* whitespace */
X`09_chartypes_`5B' '`5D  `7C= _space;
X#if OPT_ISO_8859
X`09_chartypes_`5B0xa0`5D `7C= _space;
X#endif
X`09_chartypes_`5B'`5Ct'`5D `7C= _space;
X`09_chartypes_`5B'`5Cr'`5D `7C= _space;
X`09_chartypes_`5B'`5Cn'`5D `7C= _space;
X`09_chartypes_`5B'`5Cf'`5D `7C= _space;
X
X#endif /* OPT_LOCALE */
X
X`09/* legal in pathnames */
X`09_chartypes_`5B'.'`5D `7C= _pathn;
X`09_chartypes_`5B'_'`5D `7C= _pathn;
X`09_chartypes_`5B'`7E'`5D `7C= _pathn;
X`09_chartypes_`5B'-'`5D `7C= _pathn;
X`09_chartypes_`5B'*'`5D `7C= _pathn;
X`09_chartypes_`5B'/'`5D `7C= _pathn;
X
X`09/* legal in "identifiers" */
X`09_chartypes_`5B'_'`5D `7C= _ident`7C_qident;
X`09_chartypes_`5B':'`5D `7C= _qident;
X#if SYS_VMS
X`09_chartypes_`5B'$'`5D `7C= _ident`7C_qident;
X#endif
X
X`09c = global_g_val(GVAL_PRINT_LOW);
X`09if (c < HIGHBIT) c =\0D08;
X`09while ( c <= global_g_val(GVAL_PRINT_HIGH) `26`26 c < N_chars)
X`09`09_chartypes_`5Bc++`5D `7C= _print;
X
X`09/* backspacers: `5EH, rubout */
X`09_chartypes_`5B'`5Cb'`5D `7C= _bspace;
X`09_chartypes_`5B127`5D `7C= _bspace;
X
X`09/* wildcard chars for most shells */
X`09_chartypes_`5B'*'`5D `7C= _wild;
X`09_chartypes_`5B'?'`5D `7C= _wild;
X#if !OPT_VMS_PATH
X#if SYS_UNIX
X`09_chartypes_`5B'`7E'`5D `7C= _wild;
X#endif
X`09_chartypes_`5BLBRACK`5D `7C= _wild;
X`09_chartypes_`5BRBRACK`5D `7C= _wild;
X`09_chartypes_`5BLBRACE`5D `7C= _wild;
X`09_chartypes_`5BRBRACE`5D `7C= _wild;
X`09_chartypes_`5B'$'`5D `7C= _wild;
X`09_chartypes_`5B'`60'`5D `7C= _wild;
X#endif
X
X`09/* ex mode line specifiers */
X`09_chartypes_`5B','`5D `7C= _linespec;
X`09_chartypes_`5B'%'`5D `7C= _linespec;
X`09_chartypes_`5B'-'`5D `7C= _linespec;
X`09_chartypes_`5B'+'`5D `7C= _linespec;
X`09_chartypes_`5B';'`5D `7C= _linespec;
X`09_chartypes_`5B'.'`5D `7C= _linespec;
X`09_chartypes_`5B'$'`5D `7C= _linespec;
X`09_chartypes_`5B'`5C''`5D `7C= _linespec;
X
X`09/* fences */
X`09_chartypes_`5BLBRACE`5D `7C= _fence;
X`09_chartypes_`5BRBRACE`5D `7C= _fence;
X`09_chartypes_`5BLPAREN`5D `7C= _fence;
X`09_chartypes_`5BRPAREN`5D `7C= _fence;
X`09_chartypes_`5BLBRACK`5D `7C= _fence;
X`09_chartypes_`5BRBRACK`5D `7C= _fence;
X
X#if OPT_VMS_PATH
X`09_chartypes_`5BLBRACK`5D `7C= _pathn;`09/* actually, "<", ">" too */
X`09_chartypes_`5BRBRACK`5D `7C= _pathn;
+-+-+-+-+-+-+-+-  END  OF PART 67 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 68 -+-+-+-+-+-+-+-+
X`09_chartypes_`5B'$'`5D `7C= _pathn;
X`09_chartypes_`5B':'`5D `7C= _pathn;
X`09_chartypes_`5B';'`5D `7C= _pathn;
X#endif
X
X#if OPT_MSDOS_PATH
X`09_chartypes_`5B'`5C`5C'`5D `7C= _pathn;
X`09_chartypes_`5B':'`5D `7C= _pathn;
X#endif
X
X#if OPT_WIDE_CTYPES
X`09/* scratch-buffer-names (usually superset of _pathn) */
X`09_chartypes_`5B(unsigned)SCRTCH_LEFT`5B0`5D`5D  `7C= _scrtch;
X`09_chartypes_`5B(unsigned)SCRTCH_RIGHT`5B0`5D`5D `7C= _scrtch;
X`09_chartypes_`5B' '`5D `7C= _scrtch;`09/* ...to handle "`5BBuffer List`5D" */
V
X#endif
X
X`09for (c = 0; c < N_chars; c++) `7B
X`09`09if (!(isSpace(c)))
X`09`09`09_chartypes_`5Bc`5D `7C= _nonspace;
X`09`09if (isDigit(c))
X`09`09`09_chartypes_`5Bc`5D `7C= _linespec;
X`09`09if (isAlpha(c) `7C`7C isDigit(c))
X`09`09`09_chartypes_`5Bc`5D `7C= _ident`7C_pathn`7C_qident;
X#if OPT_WIDE_CTYPES
X`09`09if (isSpace(c) `7C`7C isPrint(c))
X`09`09`09_chartypes_`5Bc`5D `7C= _shpipe;
X`09`09if (ispath(c))
X`09`09`09_chartypes_`5Bc`5D `7C= _scrtch;
X#endif
X`09`7D
X
X`7D
X
X/*****`09`09Compiler specific Library functions`09****/
X
X
X#if`09OPT_RAMSIZE
X/*`09These routines will allow me to track memory usage by placing
X`09a layer on top of the standard system malloc() and free() calls.
X`09with this code defined, the environment variable, $RAM, will
X`09report on the number of bytes allocated via malloc.
X
X`09with SHOWRAM defined, the number is also posted on the
X`09end of the bottom mode line and is updated whenever it is changed.
X*/
X
X#undef`09realloc
X#undef`09malloc
X#undef`09free
X
Xtypedef`09struct `7B
X`09size_t`09length;
X`09unsigned magic;
X`7D RAMSIZE;
X
X#define MAGIC_RAM 0x12345678
X
X`09/* display the amount of RAM currently malloc'ed */
Xstatic void
Xdisplay_ram_usage (void)
X`7B
X`09beginDisplay();
X`09if (global_g_val(GMDRAMSIZE)) `7B
X`09`09char mbuf`5B20`5D;
X`09`09int`09saverow = ttrow;
X`09`09int`09savecol = ttcol;
X
X`09`09if (saverow >= 0 `26`26 \1008< term.t_nrow
X`09`09 `26`26 savecol >= 0\100C< term.t_ncol) `7B
X`09`09`09(void)lsprintf(mbuf, "`5B%ld`5D", envram);
X`09`09`09kbd_overlay(mbuf);
X`09`09`09kbd_flush();
X`09`09`09movecursor(saverow, savecol);
X`09`09`7D
X`09`7D
X`09endofDisplay();
X`7D
X
Xstatic char *old_ramsize(\1206mp)
X`7B
X`09RAMSIZE *p = (\0E09)(mp - sizeof\1708));
X
X`09if (p->magic == MAGIC_RAM) `7B
X`09`09mp = (char *)p;
X`09`09envram -= p->length;
X`09`7D
X`09return mp;
X`7D
X
Xstatic char *new_ramsize(\1206mp, unsigned nbytes)
X`7B
X`09RAMSIZE *p = (\0E09)mp;
X`09if (p != 0) `7B
X`09`09p->length = nbytes;
X`09`09p->magic  = MAGIC_RAM;
X`09`09envram += nbytes;
X`09`09mp = (char *)((long)p + sizeof(RAMSIZE));
X`09`7D
X`09return mp;
X`7D
X
X`09/* reallocate mp with nbytes and track */
Xchar *reallocate(\1106mp, unsigned nbytes)
X`7B
X`09if (mp != 0) `7B
X`09`09nbytes += sizeof(RAMSIZE);
X`09`09mp = new_ramsize(realloc(old\1409mp), nbytes\0909);
X`09`09display_ram_usage();
X`09`7D else
X`09`09mp = allocate(nbytes);
X`09return mp;
X`7D
X
X`09/* allocate nbytes and track */
Xchar *allocate(
Xunsigned nbytes)`09/* # of bytes to allocate */
X`7B
X`09char *mp;`09/* ptr returned from malloc */
X
X`09nbytes += sizeof(RAMSIZE);
X`09if ((mp = malloc(nbytes)) != 0) `7B
X`09`09(void)memset(mp, 0, nbytes);`09/* so we can use for calloc */
X`09`09mp = new_ramsize(mp, nbytes);
X`09`09display_ram_usage();
X`09`7D
X
X`09return mp;
X`7D
X
X`09/* release malloced memory and track */
Xvoid
Xrelease(char *mp)`09/* chunk of RAM to \2507 */
X`7B
X`09if (mp) `7B
X`09`09free(old_ramsize(mp));
X`09`09display_ram_usage();
X`09`7D
X`7D
X#endif`09/* OPT_RAMSIZE */
X
X#if MALLOCDEBUG
Xmallocdbg(int f, int n)
X`7B
X`09int lvl;
X`09lvl = malloc_debug(n);
X`09mlwrite("malloc debug level was %d",lvl);
X`09if (!f) `7B
X`09`09malloc_debug(lvl);
X`09`7D else if (n > 2) `7B
X`09`09malloc_verify();
X`09`7D
X`09return TRUE;
X`7D
X#endif
X
X
X/*
X *`09the log file is left open, unbuffered.  thus any code can do
X *
X * `09extern FILE *FF;
X *`09fprintf(FF, "...", ...);
X *
X *`09to log events without disturbing the screen
X */
X
X#ifdef DEBUGLOG
X/* suppress the declaration so that the link will fail if someone uses it */
XFILE *FF;
X#endif
X
X/*ARGSUSED*/
Xstatic void
Xstart_debug_log(int ac GCC_UNUSED, char **av\160B)
X`7B
X#ifdef DEBUGLOG
X`09int i;
X`09FF = fopen("vilelog", "w");
X`09setbuf(FF,NULL);
X`09for (i = 0; i < ac; i++)
X`09`09(void)fprintf(FF,"arg %d: %s`5Cn",i,av`5Bi`5D);
X#endif
X`7D
X
X#if SYS_MSDOS
X
X#if CC_TURBO
Xint
Xshowmemory(int f, int n)
X`7B
X`09extern`09long`09coreleft(void);
X`09mlforce("Memory left: %D bytes", coreleft());
X`09return TRUE;
X`7D
X#endif
X
X#if CC_WATCOM
Xint
Xshowmemory(int f, int n)
X`7B
X`09mlforce("Watcom C doesn't provide a very useful 'memory-left' call.");
X`09return TRUE;
X`7D
X#endif
X
X#if CC_DJGPP
Xint
Xshowmemory(int f, int n)
X`7B
X`09mlforce("Memory left: %D Kb virtual,\0F07physical",
X`09`09`09_go32_dpmi_remaining_virtual_memory()/1024,
X`09`09`09_go32_dpmi_remaining_physical_memory()/1024);
X`09return TRUE;
X`7D
X#endif
X#endif /* SYS_MSDOS */
X
Xchar *
Xstrncpy0(char *t, const char *f, SIZE_T l)
X`7B
X    (void)strncpy(t, f, l);
X    if (l)
X`09t`5Bl-1`5D = EOS;
X    return t;
X`7D
X
X#if defined(SA_RESTART)
X/* several systems (SCO, SunOS) have sigaction without SA_RESTART */
X/*
X * Redefine signal in terms of sigaction for systems which have the
X * SA_RESTART flag defined through <signal.h>
X *
X * This definition of signal will cause system calls to get restarted for a
X * more BSD-ish behavior.  This will allow us to use the OPT_WORKING feature
X * for such systems.
X */
X
Xvoid
Xsetup_handler(int sig, void (*disp) (int ACTUAL_SIG_ARGS))
X`7B
X    struct sigaction act, oact;
X
X    act.sa_handler = disp;
X    sigemptyset(`26act.sa_mask);
X#ifdef SA_NODEFER`09/* don't rely on it.  if it's not there, signals
X    `09`09&0209probably aren't deferred anyway. */
X    act.sa_flags = SA_RESTART`7CSA_NODEFER ;
X#else
X    act.sa_flags = SA_RESTART;
X#endif
X
X    (void)sigaction(sig, `26act, `26oact);
X
X`7D
X#else
Xvoid
Xsetup_handler(int sig, void (*disp) (int ACTUAL_SIG_ARGS))
X`7B
X    (void)signal(sig, disp);
X`7D
X#endif
X
X
X/* put us in a new process group, on command.  we don't do this all the
X* time since it interferes with suspending xvile on some system\2608ome
X* shells.  but we _want_ it other times, to better isolate us from signals,
X* and isolate those around us (like buggy window/display managers) from
X* _our_ signals.  so we punt, and leave it up to the user.
X*/
X/* ARGSUSED */
Xint
Xnewprocessgroup(int f GCC_UNUSED, int n\120B)
X`7B
X#if DISP_X11
X
X    int pid;
X
X    if (f) `7B
X#ifndef VMS
X`09    pid = fork();
X#else
X            pid = vfork();
X#endif
X
X`09    if (pid > 0)
X`09`09tidy_exit(GOODEXIT);
X`09    else if (pid < 0) `7B
X`09`09fputs("cannot fork`5Cn", stderr);
X`09`09tidy_exit(BADEXIT);
X`09    `7D
X    `7D
X# ifndef VMS
X#  ifdef HAVE_SETSID
X     (void)setsid();
X#  else
X#   ifdef HAVE_BSD_SETPGRP
X     (void) setpgrp(0, 0);
X#   else
X     (void)setpgrp();
X#   endif /* HAVE_BSD_SETPGRP */
X#  endif /* HAVE_SETSID */
X# endif /* VMS */
X#endif /* DISP_X11 */
X    return TRUE;
X`7D
X
X
Xstatic int
Xcmd_mouse_motion(const CMDFUNC *cfp)
X`7B
X#if (OPT_XTERM `7C`7C DISP_X11)
X`09return cfp `26`26 cfp->cu.c_func == mouse_motion;
X#else
X`09return FALSE;
X#endif
X`7D
$ call unpack [.VILE-8_0]MAIN.C;1 -
 1293341412 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 106 58 152
$!
$ create 'f'
X#
X# makefile for vile on WIN32 using Borland C++
X#
X# $Header: /usr/build/vile/vile/RCS/makefile.blc,v 1.7 1997/11/26 16:16:03 tom
V Exp $
X#
X#
X
XCC = bcc32
XCFLAGS = -v -WC -w-par -DWIN32_LEAN_AND_MEAN -Dscrn_chosen`20
XLDFLAGS = -v -WC
X
X# these are normal editable headers
XHDRS = estruct.h edef.h proto.h dirstuff.h
X
X# these headers are built by the mktbls program from the information in cmdtbl
V
X# and in modetbl
XBUILTHDRS = nebind.h neproto.h nefunc.h nemode.h nenam\0906vars\2406key\0A07sm
Vs.h
X
XSRC = `09main.c ntconio.c basic.c bind.c btree.c buffer.c crypt.c `5C
X`09csrch.c display.c eval.c exec.c externs.c `5C
X`09fences.c file\0707c.c `5C
X`09fileio.c finderr.c glob\0707als.c history.c `5C
X`09input.c insert.c itbuff.c isearch.c `5C
X`09line.c modes.c msgs.c npopen.c oneliner.c opers.c `5C
X`09path.c random.c regexp.c `5C
X`09region.c search.c select.c spawn.c `5C
X`09tags.c tbuff.c termio.c undo.c `5C
X`09version.c window.c word\0707mov.c map.c`20
X
XOBJ = `09main.obj ntconio.obj basic\0A06ind\1306tree\1D06uffer.obj crypt.obj`20
V`5C
X      `09csrch.obj display.obj eval\0906xec\0907terns.obj `5C
X`09fences.obj file\0909c.obj `5C
X`09fileio.obj finderr.obj glob\0909als.obj history.obj `5C
X`09input.obj inser\0B07tbuff\1606search.obj `5C
X`09line.obj modes\0A06sg\0906npopen.obj oneliner\0D06per\2B06`5C
X`09path.obj random\0B06egexp.obj `5C
X`09region.obj search\0B07lect\1606paw\2006`5C
X`09tags.obj tbuff\0A06ermio.obj und\0906`5C
X`09version.obj window\0B06ord\0909mov.obj map.obj`20
X
X.c.obj:`09
X`09$(CC) $(CFLAGS) -c $<
X
Xvile.exe: `09$(BUILTHDRS) $(OBJ)
X`09$(CC) $(LDFLAGS) -evile.exe @`26`26!
X$(OBJ)
X!
X
X$(OBJ):`09estruct.h
X
Xnebind.h `5C
Xnefunc.h `5C
Xnename.h :`09cmdtbl mktbls.exe
X`09mktbls.exe cmdtbl
X
Xnevars.h `5C
Xnefsms.h `5C
Xnemode.h:`09modetbl mktbls.exe
X`09mktbls.exe modetbl
X
Xmktbls.exe:  \0D07c
X`09$(CC) $(CFLAGS) mktbls.c
X
Xclean:
X`09del mktbls.exe
X`09del *.obj
X`09del ne*.h
X
Xbind.obj:`09nefunc.h
Xeval.obj:`09nevars.h
Xexec.obj:`09nefunc.h
Xexterns.obj:`09nebind.h nename.h neproto.h nefunc.h
Xfilec.obj:`09dirstuff.h
Xglob.obj:`09dirstuff.h
Xglobals.obj:`09nefunc.h
Xmain.obj:`09chgdfunc.h nevars.h
Xmodes.obj:`09chgdfunc.h
Xopers.obj:`09nefunc.h
Xpath.obj:`09dirstuff.h
Xrandom.obj:`09nefunc.h
Xselect.obj:`09nefunc.h
Xspawn.obj:`09nefunc.h
Xtermio.obj:`09nefunc.h
Xversion.obj:`09patchlev.h
Xword.obj:`09nefunc.h
$ call unpack [.VILE-8_0]MAKEFILE.BLC;1 -
 608855783 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 5 59 152
$!
$ create 'f'
X#
X# makefile for vile using DJGCC 1.09 and  GNU's MAKE 3.58
X#
X# T.DANG (dang@cogit.ign.fr)
X#
X# $Header: /usr/build/vile/vile/RCS/makefile.djg,v 1.25 1998/05/22 00:18:52 to
Vm Exp $
X#
X#
X
XCC = gcc
XLONGARGS = gcc
X
XDEBUG = -g
X#OPTIM =
X
X#DEBUG =
XOPTIM = -O2
X
X# Use these two lines for the IBM/PC display (not DPMI compatible).
X#CFLAGS= -Wall $(DEBUG) $(OPTIM) -DDISP_IBMPC -Dscrn_chosen
X#DISP_SRC = ibmpc.c
X
X# Use these two lines for the Borland/CONIO display (DPMI compatible).
XCFLAGS= -Wall $(DEBUG) $(OPTIM) -DDISP_BORLAND -Dscrn_chosen
XDISP_SRC = borland.c gppconio.c
X
X# these are normal editable headers
XHDRS = estruct.h edef.h proto.h dirstuff.h
X
X# these headers are built by the mktbls program from the information in cmdtbl
V
X# and in modetbl
XBUILTHDRS = nebind.h neproto.h nefunc.h nemode.h nenam\0906vars\2406key\0A07sm
Vs.h
X
XSRC = `09main.c $(DISP_SRC) basic.c bind.c btree.c buffer.c crypt.c `5C
X`09csrch.c display.c eval.c exec.c externs.c fences.c file\0707c.c `5C
X`09fileio.c finderr.c glob\0707als.c history.c `5C
X`09input.c insert.c itbuff.c isearch.c `5C
X`09line.c modes.c msgs.c npopen.c oneliner.c opers.c `5C
X`09path.c random.c regexp.c `5C
X`09region.c search.c select.c spawn.c `5C
X`09tags.c tbuff.c termio.c undo.c `5C
X`09version.c window.c word\0707mov.c map.c djhandl.c
X
XOBJ =`09$(SRC:.c=.o)
X
X%.o:`09%.c estruct.h nemode.h edef.h proto.h
X`09$(CC) $(CFLAGS) -c $< -o $@
X
Xvile : `09$(BUILTHDRS) $(OBJ)
X`09$(CC) $(CFLAGS) -o $@ $(OBJ) -lpc
X`09coff2exe $@
X`09-stubedit vile.exe globbing=no
X
Xc-filt : \0906.o
X`09$(CC) $(CFLAGS) -o $@ c-filt.o -lpc
X`09coff2exe $@
X`09-stubedit $@.exe globbing=no
X
Xdist :`09vile
X`09strip vile
X`09coff2exe vile
X`09-stubedit vile.exe globbing=no
X`09pkzip pcvile.zip readme.pc\0A07 vile.ex\0907hlp`20
X`09cd macros
X`09pkzip pcvile.zip pictmode.rc digraphs.rc`20
X`09cd ..
X`09pkzip pcvile.zip `5C`5Cdjgpp&025Cbin&025Cgo32.exe
X
X# for my poor slow omnibook, i do incremental linking when working on
X# just a couple of modules...
XNOBJ = $(OBJ)
XNOBJ := $(filter-out ibmpc.o, $(NOBJ))
XNOBJ := $(filter-out filec.o, $(NOBJ))
XNOBJ := $(filter-out glob.o, $(NOBJ))
XXOBJ =  ibmpc.o filec.o glob.o
X
Xrvile.o: $(NOBJ)
X`09ld -r -o rvile.o $(NOBJ) -L/djgpp/lib -lpc -lc -lgcc
X
Xivile: $(XOBJ) rvile.o
X`09ld -o vile /djgpp/lib/crt0.o rvile.o $(XOBJ) -L\240A -lpc -lc -lgcc
X`09coff2exe vile
X
Xnebind.h `5C
Xnefunc.h `5C
Xnename.h :`09cmdtbl mktbls.exe
X`09mktbls.exe cmdtbl
X
Xnevars.h `5C
Xnefsms.h `5C
Xnemode.h:`09modetbl mktbls.exe
X`09mktbls.exe modetbl
X
Xmktbls.exe:  \0D07c
X`09$(CC) mktbls.c -o\0C07
X`09coff2exe mktbls
X`09rm mktbls
X
Xclean:
X`09rm mktbls.exe
X`09rm *.o
X`09rm ne*.h
X
Xbind.o:`09`09nefunc.h
Xeval.o:`09`09nevars.h
Xexec.o:`09`09nefunc.h
Xexterns.o:`09nebind.h nename.h neproto.h nefunc.h
Xfilec.o:`09dirstuff.h
Xglob.o:`09`09dirstuff.h
Xglobals.o:`09nefunc.h
Xmain.o:`09`09chgdfunc.h nevars.h
Xmodes.o:`09chgdfunc.h
Xopers.o:`09nefunc.h
Xpath.o:`09`09dirstuff.h
Xrandom.o:`09nefunc.h
Xselect.o:`09nefunc.h
Xspawn.o:`09nefunc.h
Xtermio.o:`09nefunc.h
Xversion.o:`09patchlev.h
Xword.o:`09`09nefunc.h
$ call unpack [.VILE-8_0]MAKEFILE.DJG;1 -
 1461561158 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 7 60 152
$!
$ create 'f'
X#
X# 'vile' and 'mktbls' makefile for EMX using GNU make (OS/2)
X# $Header: /usr/build/vile/vile/RCS/makefile.emx,v 1.2 1998/04/12 17:47:14 tom
V Exp $
X#
X
X#`20
X# Compiler flags:
X#
XCC = gcc
X
X# Debug options:
XDEBUG_FLAGS = -Wall
X
X# Production options:
XPROD_FLAGS  = -O
X
X#
XCFLAGS = $(DEBUG_FLAGS) -I. -DHAVE_CONFIG_H
X
X# File extension for object files:
XO = .o
X
X# File extension for executable files:
XE = .exe
X
X# What source file should be built for display support?  (.c suffix assumed)
XSCREEN = tcap
X
XMKTBLS = mktbls$E
XTARGET = vile$E
X
XBUILTHDRS = nebind.h neproto.h nefunc.h nemode.h nenam\0906vars\2406key\0A07sm
Vs.h
X
Xall:`09$(TARGET)
X
Xclean:
X`09-del *$O
X`09-del config.h
X`09-del *.bak
X`09-del ne*.h
X`09-del $(MKTBLS)
X
Xclobber:`09clean
X`09-del $(TARGET)
X
X#`09`09*List Macros*
X
X
XMKTBLS_DEPS =`5C
Xmktbls$O
X
X#`09`09*Explicit Rules*
X$(MKTBLS): \0B08_DEPS)
X`09$(CC) $(CFLAGS) $(MKTBLS_DEPS) -o $@
X
X#`09`09*Individual File Dependencies*
Xmktbls$O: \0A06.c`20
X
XVILE_DEPS =  `5C
X basic$O `5C
X bind$O `5C
X btree$O `5C
X buffer$O `5C
X crypt$O `5C
X csrch$O `5C
X display$O `5C
X dumbterm$O `5C
X eval$O `5C
X exec$O `5C
X externs$O `5C
X fences$O `5C
X file$O `5C
X filec$O `5C
X fileio$O `5C
X finderr$O `5C
X glob$O `5C
X globals$O `5C
X history$O `5C
X input$O `5C
X insert$O `5C
X itbuff$O `5C
X isearch$O `5C
X line$O `5C
X map$O `5C
X modes$O `5C
X msgs$O `5C
X npopen$O `5C
X oneliner$O `5C
X opers$O `5C
X path$O `5C
X random$O `5C
X regexp$O `5C
X region$O `5C
X search$O `5C
X select$O `5C
X spawn$O `5C
X tags$O `5C
X tbuff$O `5C
X termio$O `5C
X undo$O `5C
X version$O `5C
X window$O `5C
X word$O `5C
X wordmov$O `5C
X main$O `5C
X $(SCREEN)$O
X
X#`09`09*Explicit Rules*
X
Xversion:
X`09@-del version$O
X
X$(TARGET): version $(VILE_DEPS)
X`09$(CC) $(CFLAGS) $(VILE_DEPS) -o $@ -ltermcap
X
XFILT_DEPS = c-filt$O
X
Xvile-c-filt$E : $(FILT_DEPS)
X`09$(CC) $(CFLAGS) -o $@ $(FILT_DEPS)
X
X#`09`09*Individual File Dependencies*
Xconfig.h:`09\0A07emx
X`09copy config.emx\0B08h
X
XVILE_CFG=`09config.h estruct.h nefkeys.h nemode.h edef.h proto.h
X
Xbasic$O:`09$(VILE_CFG) basic.c`20
X
Xbind$O:`09`09$(VILE_CFG) bind.c`09nefunc.h`09btree.h
X
Xbtree$O:`09$(VILE_CFG) btree.c `09\0906h
X
Xbuffer$O:`09$(VILE_CFG) \1606.c`20
X
Xcrypt$O:`09$(VILE_CFG) crypt.c`20
X
Xcsrch$O:`09$(VILE_CFG) csrch.c`20
X
Xdisplay$O:`09$(VILE_CFG) \1707.c`20
X
Xdumbterm$O:`09$(VILE_CFG) \1808.c`20
X
Xeval$O:`09`09$(VILE_CFG) eval.c`09nevars.h
X
Xexec$O:`09`09$(VILE_CFG) exec.c `09nefunc.h
X
Xexterns$O:`09$(VILE_CFG) \1707.c`09nebind.h nename.h nefunc.h
X
Xfences$O:`09$(VILE_CFG) \1606.c`20
X
Xfile$O:`09`09$(VILE_CFG) file.c`20
X
Xfilec$O:`09$(VILE_CFG) filec.c`09dirstuff.h
X
Xfileio$O:`09$(VILE_CFG) \1606.c`20
X
Xfinderr$O:`09$(VILE_CFG) \1707.c`20
X
Xglob$O:`09`09$(VILE_CFG) glob.c`09dirstuff.h
X
Xglobals$O:`09$(VILE_CFG) \1707.c `09nefunc.h
X
Xhistory$O:`09$(VILE_CFG) \1707.c`20
X
Xinput$O:`09$(VILE_CFG) input.c`20
X
Xinsert$O:`09$(VILE_CFG) \1606.c`20
X
Xisearch$O:`09$(VILE_CFG) \1707.c`20
X
Xitbuff$O:`09$(VILE_CFG) \1606.c`20
X
Xline$O:`09`09$(VILE_CFG) line.c`20
X
Xmap$O:`09`09$(VILE_CFG) map.c`20
X
Xmodes$O:`09$(VILE_CFG) modes.c`20
X
Xmsgs$O:`09`09$(VILE_CFG) msgs.c`20
X
Xnpopen$O:`09$(VILE_CFG) \1606.c`20
X
Xoneliner$O:`09$(VILE_CFG) \1808.c`20
X
Xopers$O:`09$(VILE_CFG) opers.c `09nefunc.h
X
Xpath$O:`09`09$(VILE_CFG) path.c`09dirstuff.h
X
Xrandom$O:`09$(VILE_CFG) \1606.c`09nefunc.h
X
Xregexp$O:`09$(VILE_CFG) \1606.c`20
X
Xregion$O:`09$(VILE_CFG) \1606.c`20
X
Xsearch$O:`09$(VILE_CFG) \1606.c`20
X
Xselect$O:`09$(VILE_CFG) \1606.c `09nefunc.h
X
Xspawn$O:`09$(VILE_CFG) spawn.c `09nefunc.h
X
Xtags$O:`09`09$(VILE_CFG) tags.c `09btree.h
X
Xtbuff$O:`09$(VILE_CFG) tbuff.c`20
X
Xtermio$O:`09$(VILE_CFG) \1606.c `09nefunc.h
X
Xtrace$O:`09$(VILE_CFG) trace.c
X
Xundo$O:`09`09$(VILE_CFG) undo.c`20
X
Xversion$O:`09$(VILE_CFG) \1707.c `09patchlev.h
X
Xwindow$O:`09$(VILE_CFG) \1606.c`20
X
Xword$O:`09`09$(VILE_CFG) word.c `09nefunc.h
X
Xwordmov$O:`09$(VILE_CFG) \1707.c`20
X
Xmain$O:`09`09$(VILE_CFG) main.c`09nevars.h
X
X$(SCREEN)$O:`09$(VILE_CFG) \1909.c`20
X
Xnebind.h `5C
Xnefunc.h `5C
Xnefkeys.h `5C
Xnename.h :`09cmdtbl $(MKTBLS)
X`09@echo making $@
X`09$(MKTBLS) cmdtbl
X
Xnevars.h `5C
Xnefsms.h `5C
Xnemode.h:`09modetbl $(MKTBLS)
X`09@echo making $@
X`09$(MKTBLS) modetbl
$ call unpack [.VILE-8_0]MAKEFILE.EMX;1 -
 458156052 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 9 61 152
$!
$ create 'f'
X#
X# 'vile' and 'mktbls' makefile for IBM C Set ++ 2.x (OS/2)
X# $Header: /usr/build/vile/vile/RCS/makefile.icc,v 1.10 1998/04/12 20:39:51 to
Vm Exp $
X#
X
X#
X# Compiler flags:
X#
XCC = icc
X
X# Debug options:
X#DEBUG_FLAGS = /Ti+ /Wpor /Wext /Wuse /Wini /Wuni /Wgot
X#DEBUG_FLAGS = /Ti+ /Wpor /Wext /Wuse /Wini /Wgot
X
X# Production options:
XPROD_FLAGS  = /O+
X
X#
XCFLAGS = /Q /Wpro $(DEBUG_FLAGS) /Dscrn_chosen /DDISP_VIO=1
X
X# File extension for object files:
XO = .obj
X
X# File extension for executable files:
XE = .exe
X
X# What source file should be built for display support?  (.c suffix assumed)
XSCREEN = os2vio
X
XMKTBLS = .`5Cmktbls$E
XTARGET = vile$E
X
XBUILTHDRS = nebind.h neproto.h nefunc.h nemode.h nenam\0906vars\2406key\0A07sm
Vs.h
X
Xall:`09$(TARGET)
X
Xclean:
X`09-del *$O
X`09-del *.bak
X`09-del ne*.h
X`09-del $(MKTBLS)
X
Xclobber:`09clean
X`09-del *$E
X
X#`09`09*List Macros*
X
X
XMKTBLS_DEPS =`5C
Xmktbls$O
X
X#`09`09*Explicit Rules*
X$(MKTBLS): \0B08_DEPS)
X`09$(CC) $(CFLAGS) $(MKTBLS_DEPS) /Fe$@
X
X#`09`09*Individual File Dependencies*
Xmktbls$O: \0A06.c
X
XVILE_DEPS =  `5C
X version$O `5C
X basic$O `5C
X bind$O `5C
X btree$O `5C
X buffer$O `5C
X crypt$O `5C
X csrch$O `5C
X display$O `5C
X eval$O `5C
X exec$O `5C
X externs$O `5C
X fences$O `5C
X file$O `5C
X filec$O `5C
X fileio$O `5C
X finderr$O `5C
X glob$O `5C
X globals$O `5C
X history$O `5C
X input$O `5C
X insert$O `5C
X itbuff$O `5C
X isearch$O `5C
X line$O `5C
X map$O `5C
X modes$O `5C
X msgs$O `5C
X npopen$O `5C
X oneliner$O `5C
X opers$O `5C
X os2pipe$O `5C
X path$O `5C
X random$O `5C
X regexp$O `5C
X region$O `5C
X search$O `5C
X select$O `5C
X spawn$O `5C
X tags$O `5C
X tbuff$O `5C
X termio$O `5C
X undo$O `5C
X window$O `5C
X word$O `5C
X wordmov$O `5C
X main$O `5C
X $(SCREEN)$O
X
X#`09`09*Explicit Rules*
X
Xversion:
X`09@-del version$O
X
X$(TARGET) : version $(VILE_DEPS)
X  $(CC) $(CFLAGS) $(VILE_DEPS) /Fe$@
X
XFILT_DEPS = c-filt$O
X
Xvile-c-filt$E : $(FILT_DEPS)
X  $(CC) $(CFLAGS) $(FILT_DEPS) /Fe$@
X
X#`09`09*Individual File Dependencies*
XVILE_CFG=`09estruct.h nefkeys.h nemode.h edef.h proto.h
X
Xbasic$O:`09$(VILE_CFG) basic.c
X
Xbind$O:`09`09$(VILE_CFG) bind.c`09nefunc.h`09btree.h
X
Xbtree$O:`09$(VILE_CFG) btree.c `09\0906h
X
Xbuffer$O:`09$(VILE_CFG) \1606.c
X
Xcrypt$O:`09$(VILE_CFG) crypt.c
X
Xc-filt$O:`09\0A06.c
X
Xcsrch$O:`09$(VILE_CFG) csrch.c
X
Xdisplay$O:`09$(VILE_CFG) \1707.c
X
Xeval$O:`09`09$(VILE_CFG) eval.c`09nevars.h
X
Xexec$O:`09`09$(VILE_CFG) exec.c `09nefunc.h
X
Xexterns$O:`09$(VILE_CFG) \1707.c`09nebind.h nename.h nefunc.h
X
Xfences$O:`09$(VILE_CFG) \1606.c
X
Xfile$O:`09`09$(VILE_CFG) file.c
X
Xfilec$O:`09$(VILE_CFG) filec.c`09dirstuff.h
X
Xfileio$O:`09$(VILE_CFG) \1606.c
X
Xfinderr$O:`09$(VILE_CFG) \1707.c
X
Xglob$O:`09`09$(VILE_CFG) glob.c`09dirstuff.h
X
Xglobals$O:`09$(VILE_CFG) \1707.c `09nefunc.h
X
Xhistory$O:`09$(VILE_CFG) \1707.c
X
Xinput$O:`09$(VILE_CFG) input.c
X
Xinsert$O:`09$(VILE_CFG) \1606.c
X
Xisearch$O:`09$(VILE_CFG) \1707.c
X
Xitbuff$O:`09$(VILE_CFG) \1606.c
X
Xline$O:`09`09$(VILE_CFG) line.c
X
Xmap$O:`09`09$(VILE_CFG) map.c
X
Xmodes$O:`09$(VILE_CFG) modes.c
X
Xmsgs$O:`09`09$(VILE_CFG) msgs.c
X
Xnpopen$O:`09$(VILE_CFG) \1606.c
X
Xoneliner$O:`09$(VILE_CFG) \1808.c
X
Xopers$O:`09$(VILE_CFG) opers.c `09nefunc.h
X
Xos2pipe$O:`09$(VILE_CFG) \1707.c
X
Xpath$O:`09`09$(VILE_CFG) path.c`09dirstuff.h
X
Xrandom$O:`09$(VILE_CFG) \1606.c`09nefunc.h
X
Xregexp$O:`09$(VILE_CFG) \1606.c
X
Xregion$O:`09$(VILE_CFG) \1606.c
X
Xsearch$O:`09$(VILE_CFG) \1606.c
X
Xselect$O:`09$(VILE_CFG) \1606.c `09nefunc.h
X
Xspawn$O:`09$(VILE_CFG) spawn.c `09nefunc.h
X
Xtags$O:`09`09$(VILE_CFG) tags.c `09btree.h
X
Xtbuff$O:`09$(VILE_CFG) tbuff.c
X
Xtermio$O:`09$(VILE_CFG) \1606.c `09nefunc.h
X
Xundo$O:`09`09$(VILE_CFG) undo.c
X
Xversion$O:`09$(VILE_CFG) \1707.c `09patchlev.h
X
Xwindow$O:`09$(VILE_CFG) \1606.c
X
Xword$O:`09`09$(VILE_CFG) word.c `09nefunc.h
X
Xwordmov$O:`09$(VILE_CFG) \1707.c
X
Xmain$O:`09`09$(VILE_CFG) main.c`09nevars.h
X
X$(SCREEN)$O:`09$(VILE_CFG) \1909.c
X
Xnebind.h `5C
Xnefunc.h `5C
Xnefkeys.h `5C
Xnename.h :`09cmdtbl $(MKTBLS)
X`09@echo making $@
X`09$(MKTBLS) cmdtbl
X
Xnevars.h `5C
Xnefsms.h `5C
Xnemode.h:`09modetbl $(MKTBLS)
X`09@echo making $@
X`09$(MKTBLS) modetbl
$ call unpack [.VILE-8_0]MAKEFILE.ICC;1 -
 612347079 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 9 62 152
$!
$ create 'f'
X# makefile.in is the\1309 template for vile on unix systems.
X# makefile is generated from\1B09.in by running configure.
X#
X# If you edit makefile, your changes will be lost when you run configure
X# again.  See the file INSTALL from instructions on how to configure, make,
X# and install vile/xvile.
X#
X# The command/name/key/function bindings are defined in the file "cmdtbl".
X# The mktbls program parses this to produce nebind.h, nename\0A06proto.h and
X# nefunc.h, which are used by the rest of the build.
X#
X# Buffer/window modes are defined in the file "modetbl".
X# The mktbls program parses this to produce nemode.h, which is included in
X# 'estruct.h'.
X#
X# The version number is found near the top of edef.h, and is displayed with
X# the ":version" command, or by invoking vile with "-V".
X#
X# Paul Fox
X#
X# gnu autoconf support by kevin buettner, 5/94
X# original makefile for uemacs: Adam Fritz July 30,1987  (do you recognize it?
V)
X#
X# $Header: /usr/build/vile/vile/RCS/makefile.in,v 1.111 1998/05/27 00:54:37 ke
Vv Exp $
X#
X
X#### Start of system configuration section. ####
X
Xsrcdir = @\0A06@
Xsrcdir_sl = @\0D06@/
XVPATH  = @srcdir@
X
XCC`09`09= @CC@
XCPP`09`09= @CPP@
XLINK`09`09= @LINK_PREFIX@ $(CC) $(CFLAGS)
XINSTALL`09`09= @\0C07@
XINSTALL_PROGRAM`09= @\130F@
XINSTALL_DATA`09= @\100C@
X
XEXTRA_CFLAGS`09= @\100C@
XCFLAGS`09`09= @\0B06@ $(EXTRA_\1B06)
XLIBS`09`09= @LIBS@
XLINT`09`09= @LINT@
X
Xx`09`09= @PROG_EXT@
X
XX_CFLAGS`09= @\0C08@
XX_LIBS`09`09= @\0B06@
X
XSCREEN`09`09= @\0B06@
XTARGET`09`09= @\0B06@$x
X
XPERL`09`09= @perl_bin_path@
XPERLLIB`09`09= @perl_lib_path@
X
Xprefix`09`09= @\0B06@
Xexec_prefix`09= @\0F0B@
X
Xmanext`09`09= 1
Xbindir`09`09= @\0B06@
Xdatadir`09`09= @\0C07@/vile
Xperldir`09`09= $(datadir)/perl
Xmandir`09`09= @\0B06@/man$(manext)
X
X#### End of system configuration section. ####
X
XSHELL`09`09= /bin/sh
XRM        \0806= rm -f
X
XCPPFLAGS`09= -I. -I$(srcdir) $(X_CFLAGS) `5C
X`09`09-DVILE_STARTUP_PATH=`5C"@\1511@`5C" `5C
X`09`09-DHAVE_CONFIG_H @CPPFLAGS@
X
XLDFLAGS`09`09= @IMAKE_LOA\1406@
X
XINSTALL_DIRS    = $(bindir) $(data\0B07perl\1607mandir)
X
X.SUFFIXES: .c .i .o
X
X.c.i:
X@RULE_CC@
X`09@ECHO_CC@$(CPP) -C $(CPPFLAGS) $< >$@
X.c.o:
X@RULE_CC@
X`09@ECHO_CC@$(CC) -c $(CPPFLAGS) $(C\0A07-DHELP_LOC=`5C"$(datadir)/`5C" $<
X
X# All of the makefiles which should be preserved and distributed
XUNIXMAKIN = makefile.in`09`09&0209# for use with configure
XVMSMAK =   descrip.mms vmsbuild.com`09`09# on VMS
XTURBOMAK = makefile.tbc`09`09&0209# on DOS or OS/2, TURBO C or Borland C
XWATMAK =   makefile.wat`09`09&0209# on DOS, using Watcom C/386
XMSCMAK =`09# still waiting for this one`09# on DOS, using Microsoft C
XDJGPPMAK = makefile.djg`09`09&0209# on DOS, DJGCC v1.09
XNTMAK = makefile.wnt`09`09&0209# on Windows/NT
XBCCNTMAK = makefile.blc`09`09&0209# Borland C on Windows/NT
XOS2MAK = makefile.icc`09`09&0209# OS/2, (IBM C Set ++ 2.x)
XEMXMAK = makefile.emx config.emx`09`09# OS/2, (EMX with gcc)
X
XMAKFILES = `5C
X`09$(UNIXMAKIN) `5C
X`09$(VMSMAK) `5C
X`09$(TURBOMAK) `5C
X`09$(WATMAK) `5C
X`09$(DJGPPMAK) `5C
X`09$(MSCMAK) `5C
X`09$(BORMAK) `5C
X`09$(NTMAK) `5C
X`09$(BCCNTMAK) `5C
X`09$(OS2MAK) `5C
X`09$(EMXMAK)
X
XALLTOOLS = $(MAKFILES) mktbls.c cmdtbl modetbl `5C
X`09configure \0A06_h.in `5C
X`09install.sh mkdirs.sh `5C
X`09configure.in aclocal.m4
X
X# these are normal editable headers
XHDRS = `5C
X`09api.h `5C
X`09btree.h `5C
X`09chgdfunc.h `5C
X`09dirstuff.h `5C
X`09edef.h `5C
X`09estruct.h `5C
X`09os2keys.h `5C
X`09proto.h `5C
X`09pscreen.h `5C
X`09tcap.h `5C
X`09trace.h
X
XSCREENS = `5C
X`09ansi.c `5C
X`09borland.c `5C
X`09ibmpc.c `5C
X`09ntconio.c `5C
X`09ntwinio.c `5C
X`09os2vio.c `5C
X`09tcap.c `5C
X`09vmsvt.c `5C
X`09x11.c
X
X# other source code, some used in\2007makefiles\1E0Aful tools,
X#  some possibly obsolete
XPERL_SRC = `5C
X`09$(srcdir)/perl/glob2re.pl `5C
X`09$(srcdir)/perl/hgrep.pl `5C
X`09$(srcdir)/perl/manfilt.pl `5C
X`09$(srcdir)/perl/search.pl `5C
X`09$(srcdir)/perl/shell.pl `5C
X`09$(srcdir)/perl/tailf.pl `5C
X`09$(srcdir)/perl/visit.pl
X
XMACRO_SRC = `5C
X`09$(srcdir)/macros/manpage.rc `5C
X`09$(srcdir)/macros/pictmode.rc `5C
X`09$(srcdir)/macros/digraphs.rc
X
XOTHERSRC = `5C
X`09c-filt.c `5C
X`09c-filt.flx `5C
X`09djhandl.c `5C
X`09gppconio.c `5C
X`09manfilt.c `5C
X`09os2pipe.c `5C
X`09pas-filt.c `5C
X`09vms2unix.c `5C
X`09vmspipe.c
X
X# documentation, such as it is
XDOCS =`09`5C
X`09doc/config.doc `5C
X`09doc/macros.doc `5C
X`09doc/modes.doc `5C
X`09doc/menus.doc `5C
X`09doc/perl-api.doc `5C
X`09vile.1 `5C
X`09vile.hlp
X
X# miscellaneous text files
XTEXTFILES = README\0707.PC `5C
X`09INSTALL CHANGES\0808.R5\0B0A4\160A3 `5C
X`09buglist revlist patchlev.h COPYING
X
XVILESRC = main.c api.c basic.c bind.c btree.c buffer.c crypt.c csrch.c `5C
X`09display.c dumbterm.c eval.c exec.c externs.c fences.c file.c `5C
X`09filec.c fileio.c finderr.c glob\0707als.c `5C
X`09history.c input.c insert.c isearch.c itbuff.c lckfiles.c line.c map.c `5C
X`09modes.c msgs.c npopen.c oneliner.c opers.c path.c random.c `5C
X`09regexp.c region.c search.c select.c spawn.c tags.c `5C
X`09tbuff.c termio.c undo.c version.c `5C
X`09watch.c window.c word\0707mov.c
X
XALLSRC = $(VILESRC) $(SCREENS) $(OTHER\1707HDRS)
X
X# this is for work-in-progress files being shared among developers
X#  which don't need to go into general releases yet.
XDEVELOPER_ONLY = NOTES.X11 empty.rc mktbls.bat `5C
X`09trace.c \0806h `5C
X`09fakevms.c \0A08h
X
X# these are the files that go to everyone
XDISTFILES = $(ALLTOOLS)\0C06SRC) $(DOCS) $(TEX\2C06)
X
X# these are the files that go to coders
XDEV_DISTFILES = $(\0E09) $(DEVELOPER_ONLY)
X
XSRC = $(SCREEN).c $(VILESRC)
X
XMKTBLS = ./mktbls$x
X
X# these headers are built by the mktbls program from the information in cmdtbl
V
X# and in modetbl
XBUILTHDRS = nebind.h neproto.h neexec.h nefun\0906mode.h nenam\0906vars\2406ke
Vy\0A07sms.h
X
X# built from perl.xs
XBUILTSRCS = perl.c
X
X# The following are optional (non-core):
X#`09btree.o
X#`09crypt.o
X#`09npopen.o
X#`09spawn.o
+-+-+-+-+-+-+-+-  END  OF PART 68 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 69 -+-+-+-+-+-+-+-+
XOBJ = $(SCREEN).o `5C
X`09main.o api.o basic.o bind.o buffer.o csrch.o `5C
X`09display.o dumbterm.o eval.o exec.o externs.o fences.o file.o `5C
X`09filec.o fileio.o finderr.o glob\0707als.o `5C
X`09history.o input.o insert.o isearch.o itbuff.o lckfiles.o line.o map.o `5C
X`09modes.o msgs.o oneliner.o opers.o path.o random.o `5C
X`09regexp.o region.o search.o select.o tags.o `5C
X`09tbuff.o termio.o undo.o version.o `5C
X`09watch.o window.o word\0707mov.o @EXTRAOBJS@
X
XALL =`09$(TARGET) vile-manfilt$x\0F06c-\0E0Cpas\100Dcrypt$x
Xall:`09$(ALL)
X
X$(TARGET): $(BUILTHDRS) $(OBJ)
X`09-mv $(TARGET) o\0B09
X`09@ECHO_LD@$(LINK) $(LDFLAGS) -o $@ $(OBJ) $(X_LIBS) $(LIBS)
X
Xvile.man: vile.1
X`09nroff -man vile.1 `7C col -b >vile.man
X
Xvile-manfilt$x : \0C07.o
X`09@ECHO_LD@$(LINK) $(LDFLAGS) -o $@ manfilt.o
X
Xvile-c-filt$x : \0B06.o
X`09@ECHO_LD@$(LINK) $(LDFLAGS) -o $@ c-filt.o
X
Xvile-pas-filt$x : \0D08.o
X`09@ECHO_LD@$(LINK) $(LDFLAGS) -o $@ pas-filt.o
X
Xvile-crypt$x : $(srcdir)/crypt.c
X`09@ECHO_LD@$(CC) -DSTANDALONE $(CPPFLAGS) $(C\0A09LD\1507`5C
X`09    -o $@ $(srcdir)/crypt.c
X
Xvile-perl-api.pod: perl.xs
X`09perl -lne 'print if s/`5E`5Cs`7B1,2`7D#`5Cs`7B0,1`7D//' $(srcdir)/perl.xs >
V $@
X
Xvile-perl-api.doc: \130Epod
X`09pod2text vile-perl-api.pod > $@
X
Xvile-perl-api.html: \140Epod
X`09pod2html vile-perl-api.pod > $@
X
Xvile-perl-api.man: \130Epod
X`09pod2man vile-perl-api.pod > $@
X
Xnebind.h `5C
Xnefkeys.h `5C
Xneexec.h `5C
Xnefunc.h `5C
Xneproto.h `5C
Xnename.h :`09cmdtbl $(MKTBLS)
X`09$(MKTBLS) $(srcdir)/cmdtbl
X
Xnefsms.h `5C
Xnevars.h `5C
Xnemode.h:`09modetbl $(MKTBLS)
X`09$(MKTBLS) $(srcdir)/modetbl
X
X$(MKTBLS):  $(srcdir)/mktbls.c
X`09@ECHO_LD@$(CC) $(CPPFLAGS) $(C\0A09LD\1507`5C
X`09    -o $(MKTBLS)  $(srcdir)/mktbls.c
X
Xcheck: $(TARGET)
X`09@echo Sorry, no batch tests available.
X
XINSTALL_PERL = `5C
X`09$(perldir)/glob2re.pl `5C
X`09$(perldir)/hgrep.pl `5C
X`09$(perldir)/manfilt.pl `5C
X`09$(perldir)/search.pl `5C
X`09$(perldir)/shell.pl `5C
X`09$(perldir)/tailf.pl `5C
X`09$(perldir)/visit.pl
X
XINSTALL_FILES = `5C
X`09$(bindir)/$(TARGET) `5C
X`09$(bindir)/vile-manfilt$x `5C
X`09$(bindir)/vile-c-filt$x `5C
X`09$(bindir)/vile-pas-filt$x `5C
X`09$(bindir)/vile-crypt$x `5C
X`09$(mandir)/$(TARGET).$(manext) `5C
X`09$(datadir)/vile.hlp @EXTRA_INSTALL@
X
Xinstall: $(INSTALL_DIRS) `5C
X`09$(INSTALL_FILES)
X`09@echo 'Completed installation.'
X
Xinstall-perl : $(INSTALL_PERL)
X
Xinstalldirs: $(INSTALL_DIRS)
X
Xuninstall:
X`09-$(RM) $(INSTALL_FILES)
X
X# The makefile is technically dependent upon the config.status file, but
X# gmake gets overly ambitious and remakes the makefile too often.
Xmakefile: \0A08.in
X`09if test ! -f config.status; then $(SHELL) ./\1F06ure; fi
X`09$(SHELL) ./config.status
X
X# defining this target, though technically (i think) correct, causes
X#  the make to fail on machines which don't have autoconf, i.e. most of them.
V
X#configure: \0B09.in aclocal.m4
X#`09autoconf
X
Xconfig.status: \0F06ure
X`09$(SHELL) ./config.status --recheck
X
Xmostlyclean:
X`09-$(RM) *.`5Boi`5D o$(TARGET) $(BUILTHDRS\0D09SRCS) $(MKTBLS) `5C
X`09    core *`7E *.BAK
X
Xclean: mostlyclean
X`09-$(RM) $(ALL)
X
Xdistclean: clean
X`09-$(RM) makefile config.status\0E08cach\1B09log\2608h
X
Xrealclean: distclean
X`09-$(RM) tags TAGS vile-perl-api.* pod2html-*
X
Xlint: $(BUILTHDRS)
X`09$(LINT) $(CPPFLAGS) $(SRC) $(LIBS)
X`09$(LINT) $(CPPFLAGS) mktbls.c
X`09$(LINT) $(CPPFLAGS) c-filt.c
X`09$(LINT) $(CPPFLAGS) pas-filt.c
X`09$(LINT) $(CPPFLAGS) manfilt.c
X
Xtags:
X`09ctags $(SRC) $(HDRS)
X
XTAGS:
X`09etags $(SRC) $(HDRS)
X
Xdotags:
X`09dotags $(SRC) $(HDRS)
X
X#`09 this builds vile-N.Ndev.tar.gz, including all development files
Xdevtarball:`09$(DEV_DISTFILES) /tmp/vilevers release_warnings
X`09echo vile-`60cat /tmp/vilevers`60 > .fname
X`09rm -rf `60cat .fname`60
X`09mkdir `60cat .fname`60
X`09SRCDIR=. ;`5C
X`09test $(srcdir) = "`5C@\0D06`5C@" `26`26 SRCDIR=\230A;`5C
X`09for file in $(DEV_DISTFILES); do `5C
X`09  ln $$SRCDIR/$$file `60cat .fname`60 `5C
X`09    `7C`7C `7B echo copying $$file instead; cp -p \1607`60cat .fname`60;`20
V`7D; `5C
X`09done
X#`09tar -cf - `60cat .fname`60 `7C gzip >\150Cdev.tar.gz
X`09gtar -czf `60cat .fname`60dev.tar.gz\170D
X`09@echo Created `60cat .fname`60dev.tar.gz
X`09rm -rf `60cat .fname`60\0807
X
X#`09 this builds vile-N.N.tar.gz, for general release
Xtarball:`09$(DISTFILES) /tmp/vilevers release_warnings
X`09echo vile-`60cat /tmp/vilevers`60 > .fname
X`09rm -rf `60cat .fname`60
X`09mkdir `60cat .fname`60
X`09SRCDIR=. ;`5C
X`09test $(srcdir) = "`5C@\0D06`5C@" `26`26 SRCDIR=\230A;`5C
X`09for file in $(DISTFILES); do `5C
X`09  ln $$SRCDIR/$$file `60cat .fname`60 `5C
X`09    `7C`7C `7B echo copying $$file instead; cp -p \1607`60cat .fname`60;`20
V`7D; `5C
X`09done
X`09gtar -czf `60cat .fname`60.tar.gz\140D
X`09@echo Created `60cat .fname`60.tar.gz
X`09rm -rf `60cat .fname`60\0807
X
X#`09 this builds vileN.Nshar, for general release
Xbigsharball: $(DISTFILES) /tmp/vilevers release_warnings
X`09vilevers=`60cat /tmp/\1308`60; `5C
X`09shar -spgf@foxharp.boston.ma.us -nvile$$`7Bvilevers`7D `5C
X`09    -o vile$$`7Bvilevers`7Dshar README `60ls $(DISTFILES) `7C `5C
X`09    sed '/`5EREADME$$/d'`60 ; `5C
X`09mv vile$$`7Bvilevers`7Dshar.01\1815`09; `5C
X`09echo Created vile$$`7Bvilevers`7Dshar
X
X
X# shar args: add -a for archive headers,\1C06s pgf@site.net for "submitted-by"
V
Xmultisharball: $(DISTFILES) /tmp/vilevers
X`09`5B -d shardir `5D `7C`7C mkdir \1307
X`09vilevers=`60cat /tmp/\1308`60; `5C
X`09shar -x -a -spgf@foxharp.boston.ma.us -nvile$$`7Bvilevers`7D -L60 `5C
X`09`09`09-o shardir/vileshar `60ls $(DISTFILES)`60
X
Xmulticsharball: $(DISTFILES) /tmp/vilevers
X`09`5B -d cshardir `5D `7C`7C mkdir \1408
X`09vilevers=`60cat /tmp/\1308`60; `5C
X`09shar -p -nvile$$`7Bvilevers`7D -L60 -o cshardir/vileshar `5C
X`09`09-C `60ls $(DISTFILES)`60
X
Xzipfile: $(DISTFILES) /tmp/vilevers
X`09vilevers=`60cat /tmp/\1308 `7C sed 's/`5C.//'`60; `5C
X`09zip -k vile$$`7Bvilevers`7Ds.zip $(DISTFILES) ;`5C
X`09echo Created vile$$`7Bvilevers`7Ds.zip
X
X# DOS builds...
XDOSBINARIES = README\0707.PC vile.hlp\0906exe
X
Xbinzip_djg: $(DOSBINARIES) go32.exe /tmp/vilevers
X`09vilevers=`60cat /tmp/\1308 `7C sed 's/`5C.//'`60; `5C
X`09zip -k vile$$`7Bvilevers`7Db.zip $(DOSBINARIES) go32.exe ;`5C
X`09echo Created vile$$`7Bvilevers`7Db.zip
X
Xbinzip_wat: $(DOSBINARIES) dos4gw.exe /tmp/vilevers
X`09vilevers=`60cat /tmp/\1308 `7C sed 's/`5C.//'`60; `5C
X`09zip -k vile$$`7Bvilevers`7Db.zip $(DOSBINARIES) dos4gw.exe ;`5C
X`09echo Created vile$$`7Bvilevers`7Db.zip
X
Xpatch:`09/tmp/vilevers
X`09@orevlistrev=`60rlog -h \1407 `7C egrep head: `7C cut -f2 -d'.'`60`09;`5C
X`09orevlistrev=1.`60expr $$\160B - 1`60`09`09&0209;`5C
X`09ovilevers=`60cat /tmp/\1308 `7C cut -f2 -d'.'`60`09`09`09;`5C
X`09ovilemajor=`60cat /tmp/vilevers `7C cut -f1 -d'.'`60`09`09`09;`5C
X`09ovilevers=$$ovilemajor.`60expr \1307vers - 1`60`09`09`09;`5C
X`09echo Previous version is $$ovilevers`09`09&0209;`5C
X`09vilevers=`60cat /tmp/\1308`60`09`09&0209`09;`5C
X`09co -p$$orevlistrev \0B07 `7C`09`09&0209`09 `5C
X`09while read file filerev`09`09&0209&0209;`5C
X`09do`09`09&0209&0409 `5C
X`09  rcsdiff -c -u -r$$filerev \0A06 2>/dev/null `7C`7C true`09`09;`5C
X`09done  >patch$$ovilevers-$$\0B08 `09`09&0209;`5C
X`09echo Created patch$$ovilevers-$$\0B08
X
Xdpatch:
X`09co -p$(PATCH_AGAINST) revlist `7C`09`09`09 &0209 `5C
X`09while read file filerev`09`09&0209&0209;`5C
X`09do`09`09&0209&0409 `5C
X`09  rcsdiff -c -u -r$$filerev \0A06 2>/dev/null `7C`7C true`09`09;`5C
X`09done  >patchREL-CUR `09`09&0209&0209;`5C
X`09echo Created patchREL-CUR
X
X/tmp/vilevers: ALWAYS
X`09@expr "`60egrep 'version`5C`5B`5C`5D.*' edef.h`60" : `5C
X`09`09'.* `5C(`5B0-9`5D`5B0-9`5D*`5C.`5B0-9`5D.*`5C)".*' >/tmp/vilevers
X`09@echo Current version is `60cat /tmp/vilevers`60
X
Xrelease_warnings:
X`09@echo
X`09@echo 'Do you need to rebuild the revlist????  top comment is:'
X`09@rlog revlist `7C sed -n -e '/date/,/---------/p' `7C `5C
X`09`09sed -n '/date`5C`7C------------/!p' `7C sed -e 's/`5E/`09/' -e 1q
X`09@echo 'or maybe date the CHANGES file?  it says:'
X`09@sed -n -e '/Changes/s/`5E/`09/p' -e '2q' CHANGES
X`09@echo 'or maybe update the version info in edef.h?  it contains:'
X`09@sed -n -e '/.*decl_init.*version.*,/s//`09/p' edef.h
X`09@echo 'how about the README?  it contains:'
X`09@sed -n -e '/version/s/`5E/`09/p' -e '3q' README
X`09@echo 'or in vile.hlp?  it has:'
X`09@sed -n -e '/.*Getting along with vile`09*/s//`09/p' -e '5q' vile.hlp
X`09@echo 'or in vmsbuild.com?  it has:'
X`09@sed -n -e '/Identification=/s/`5E.*Vile `5C(`5B`5E"`5D*`5C)`5B"`5D*/`09`5C
V1/p' vmsbuild.com
X`09@echo 'did you reset patchlev.h?'
X`09@sed -n -e 's/`5E/`09/' -e '/PATCH/p' patchlev.h
X`09@echo -n "Hit return to continue..."
X`09@read a
X
Xrcsdiffrw:
X`09@-for x in `60$(MAKE) -f makefile.in rw`60`09;`5C
X`09do`09`5C
X`09`09echo &0209;`5C
X`09`09echo $$x`09;`5C
X`09`09echo =========`09;`5C
X`09`09rcsdiff -u $$x`09;`5C
X`09done 2>`261`09`09;`5C
X`09echo`09`09`09;`5C
X`09echo all done
X
X# dump a list of the important files
Xlist:
X`09@ls $(DEV_DISTFILES)
X
Xdevonlylist:
X`09@ls $(DEVELOPER_ONLY)
X
X# make a list of RCS revisions.  don't include the revlist itself
Xnrevlist:
X`09for f in `60$(MAKE) -f makefile.in list  `7C egrep -v revlist`60`09;`5C
X`09do`09`09&0209&0409`5C
X`09`09rev=`60rlog -h $$f `7C egrep head: `7C cut -f2 -d' '`60&0209;`5C
X`09`09echo "$$f`09$$rev"&0209&0209`09;`5C
X`09done >/tmp/vile_revlist
X`09mv /tmp/vile_revlist n\0907
X
X# dump a list of files that may have changed since last backup
Xrw:
X`09@ls -l $(DEV_DISTFILES) `7C`5C
X`09`09egrep '`5E`5B`5El`5D.w' `7C `5C
X`09`09sed 's;.* ;;'   # strip to last space
X
Xpopulate:
X`09for file in $(DEV_DISTFILES); do `5C
X`09test -f $$file `7C`7C co\0D08;`5C
X`09done
X
Xperl.c: $(srcdir)/perl.xs\120Ctypemap
X`09$(PERL) \0806LIB)/ExtUtils/xsubpp `5C
X`09`09-typemap $(PERLLIB)/ExtUtils/\1C08`5C
X`09`09-typemap p\0908`5C
X`09`09$(srcdir)/perl.xs > $@
X
X$(OBJ): estruct.h nemode.h edef.h neproto.h \0808config.h
X
Xapi.o:`09`09api.h
Xbind.o:`09`09nefunc.h btree.h
Xbtree.o:`09\0906h
Xeval.o:`09`09nevars.h
Xexec.o:`09`09neexec.h nefunc.h
Xexterns.o:`09nebind.h nename.h neproto.h nefunc.h
Xfilec.o:`09dirstuff.h
Xglob.o:`09`09dirstuff.h
Xglobals.o:`09nefunc.h
Xmain.o:`09`09chgdfunc.h nevars.h
Xmodes.o:`09chgdfunc.h nefsms.h
Xopers.o:`09nefunc.h
Xpath.o:`09`09dirstuff.h
Xperl.o:`09`09api.h
Xrandom.o:`09nefunc.h
Xselect.o:`09nefunc.h
Xspawn.o:`09nefunc.h
Xtags.o:`09`09btree.h
Xtcap.o:`09`09tcap.h
Xtermio.o:`09nefunc.h
Xversion.o:`09patchlev.h
Xword.o:`09`09nefunc.h
Xx11.o:`09`09nefunc.h
X
X# dependency-rules for install/\0807dirs
X$(bindir)/$(TARGET):       \1109
X`09$(INSTALL_PROGRAM) $(TARGET) $@
X$(bindir)/vile-manfilt$x : \110E
X`09$(INSTALL_PROGRAM) vile-manfilt$x $@
X$(bindir)/vile-c-filt$x :  \110D
X`09$(INSTALL_PROGRAM) vile-c-filt$x $@
X$(bindir)/vile-pas-filt$x : \120F
X`09$(INSTALL_PROGRAM) vile-pas-filt$x $@
X$(bindir)/vile-crypt$x :   \110C
X`09$(INSTALL_PROGRAM) vile-crypt$x $@
X
X$(mandir)/vile.$(manext):  $(src\1B0A1
X`09$(INSTALL_DATA)    $(srcdir)/vile.1 $@
X$(mandir)/xvile.$(manext): $(srcdir)/vile.1
X`09$(INSTALL_DATA)    $(srcdir)/vile.1 $@
X
X$(datadir)/vile.hlp:       $(src\1A0D
X`09$(INSTALL_DATA)    $(srcdir)/vile.hlp $@
X
X$(perldir)/glob2re.pl:     $(srcdir)/perl\1F0B
X`09$(INSTALL_DATA)    $(srcdir)/perl/glob2re.pl $@
X$(perldir)/hgrep.pl:       $(srcdir)/perl\1F09
X`09$(INSTALL_DATA)    $(srcdir)/perl/hgrep.pl $@
X$(perldir)/manfilt.pl:     $(srcdir)/perl\1F0B
X`09$(INSTALL_DATA)    $(srcdir)/perl/manfilt.pl $@
X$(perldir)/search.pl:      $(srcdir)/perl\1F0A
X`09$(INSTALL_DATA)    $(srcdir)/perl/search.pl $@
X$(perldir)/shell.pl:       $(srcdir)/perl\1F09
X`09$(INSTALL_DATA)    $(srcdir)/perl/shell.pl $@
X$(perldir)/tailf.pl:       $(srcdir)/perl\1F09
X`09$(INSTALL_DATA)    $(srcdir)/perl/tailf.pl $@
X$(perldir)/visit.pl:       $(srcdir)/perl\1F09
X`09$(INSTALL_DATA)    $(srcdir)/perl/visit.pl $@
X
X$(INSTALL_DIRS):
X`09$(SHELL) $`7Bsrcdir`7D/mkdirs.sh $@
X
XALWAYS:
X
$ call unpack [.VILE-8_0]MAKEFILE.IN;1 -
 1012252106 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 34 63 152
$!
$ create 'f'
X# This is a makefile for mktbls and vile under Turbo-C
X# $Header: /usr/build/vile/vile/RCS/makefile.tbc,v 1.22 1997/11/26 16:15:58 to
Vm Exp $
X
X.AUTODEPEND
X
X#`09`09*Translator Definitions*
X#for Turbo C
XCC = tcc +vile.cfg
X#for Borland C+:
X#CC = bcc +vile.cfg
X
X#to use the faster direct video driver:
XSCREEN=ibmpc
X#to use the "console i/o" driver:
X# (also need to change to "#define DISP_BORLAND 1" in estruct.h)
X#SCREEN=borland
X
X# where are the libs?
XLIBPATH = C:`5Ctc`5CLIB
XINCLUDEPATH = C:`5Ctc`5C\1407
X#LIBPATH = C:`5Cbc4`5CLIB
X#INCLUDEPATH = C:`5Cbc4`5C\1507
X
XTASM = TASM
XTLIB = tlib
XTLINK = tlink
X
XLINKOPTS = /x/c/L$(LIBPATH) # use /v option to get debug-info
X
XTHIS = makefile.tbc
XMKTBLS = .`5Cmktbls.exe
XTARGET = vile.exe
X
XBUILTHDRS = nebind.h neproto.h nefunc.h nemode.h nenam\0906vars\2406key\0A07sm
Vs.h
X
Xall:`09$(TARGET)
X
Xclean:
X`09-del *.obj
X`09-del vile.cfg
X`09-del *.bak
X`09-del ne*.h
X`09-del $(MKTBLS)
X
Xclobber:`09clean
X`09-del $(TARGET)
X
X#`09`09*Implicit Rules*
X.c.obj:
X  $(CC) -c `7B$< `7D
X
X.cpp.obj:
X  $(CC) -c `7B$< `7D
X
X#`09`09*List Macros*
X
X
XMKTBLS_DEPS =  `5C
X mktbls.obj
X
X#`09`09*Explicit Rules*
X$(MKTBLS): vile.cfg \1408_DEPS)
X  $(TLINK) $(LINKOPTS) @`26`26`7C
Xc0l.obj+
Xmktbls.obj
Xmktbls
X`09`09# no map file
Xemu.lib+
Xmathl.lib+
Xcl.lib
X`7C
X
X# for Borland on OS/2
X#$(MKTBLS): vile.cfg \1408_DEPS)
X#  $(TLINK) $(LINKOPTS) @`26`26`7C
X#c02.obj+
X#mktbls.obj
X#mktbls
X#`09`09# no map file
X#c2.lib+
X#os2.lib+
X#`7C
X
X
X#`09`09*Individual File Dependencies*
Xmktbls.obj: vile.cfg \1507c`20
X
X
XVILE_DEPS =  `5C
X basic.obj `5C
X bind.obj `5C
X btree.obj `5C
X buffer.obj `5C
X crypt.obj `5C
X csrch.obj `5C
X display.obj `5C
X eval.obj `5C
X exec.obj `5C
X externs.obj `5C
X fences.obj `5C
X file.obj `5C
X filec.obj `5C
X fileio.obj `5C
X finderr.obj `5C
X glob.obj `5C
X globals.obj `5C
X history.obj `5C
X input.obj `5C
X insert.obj `5C
X itbuff.obj `5C
X isearch.obj `5C
X line.obj `5C
X map.obj `5C
X modes.obj `5C
X msgs.obj `5C
X npopen.obj `5C
X oneliner.obj `5C
X opers.obj `5C
X path.obj `5C
X random.obj `5C
X regexp.obj `5C
X region.obj `5C
X search.obj `5C
X select.obj `5C
X spawn.obj `5C
X tags.obj `5C
X tbuff.obj `5C
X termio.obj `5C
X undo.obj `5C
X version.obj `5C
X window.obj `5C
X word.obj `5C
X wordmov.obj `5C
X main.obj `5C
X $(SCREEN).obj
X
X#`09`09*Explicit Rules*
X# Use /v option of tlink to get debugging info
X# Change c0l.obj to c02.obj for Borland on OS/2
X
X$(TARGET): vile.cfg $(VILE_DEPS)
X  $(CC) -c version.c
X  $(TLINK) $(LINKOPTS) @`26`26`7C
Xc0l.obj+
Xbasic.obj+
Xbind.obj+
Xbtree.obj+
Xbuffer.obj+
Xcrypt.obj+
Xcsrch.obj+
Xdisplay.obj+
Xeval.obj+
Xexec.obj+
Xexterns.obj+
Xfences.obj+
Xfile.obj+
Xfilec.obj+
Xfileio.obj+
Xfinderr.obj+
Xglob.obj+
Xglobals.obj+
Xhistory.obj+
Xinput.obj+
Xinsert.obj+
Xisearch.obj+
Xitbuff.obj+
Xline.obj+
Xmap.obj+
Xmodes.obj+
Xmsgs.obj+
Xnpopen.obj+
Xoneliner.obj+
Xopers.obj+
Xpath.obj+
Xrandom.obj+
Xregexp.obj+
Xregion.obj+
Xsearch.obj+
Xselect.obj+
Xspawn.obj+
Xtags.obj+
Xtbuff.obj+
Xtermio.obj+
Xundo.obj+
Xversion.obj+
Xwindow.obj+
Xword.obj+
Xwordmov.obj+
Xmain.obj+
X$(SCREEN).obj
Xvile
X`09`09# no map file
Xemu.lib+
Xmathl.lib+
Xcl.lib
X`7C
X
X# change above three libs to the following for Borland on OS/2
X# c2.lib+
X# os2.lib+
X
X
X#`09`09*Individual File Dependencies*
XVILE_CFG=`09vile.cfg estruct.h nefkeys.h nemode.h edef.h proto.h
X
Xbasic.obj:`09$(VILE_CFG) \1706c`20
X
Xbind.obj:`09$(VILE_CFG) bind.c`09nefunc.h
X
Xbtree.obj:`09$(VILE_CFG) \1706c`20
X
Xbuffer.obj:`09$(VILE_CFG) \1807c`20
X
Xcrypt.obj:`09$(VILE_CFG) \1706c`20
X
Xcsrch.obj:`09$(VILE_CFG) \1706c`20
X
Xdisplay.obj:`09$(VILE_CFG) \1908c`20
X
Xeval.obj:`09$(VILE_CFG) eval.c`09nevars.h
X
Xexec.obj:`09$(VILE_CFG) exec.c `09nefunc.h
X
Xexterns.obj:`09$(VILE_CFG) \1908c`09nebind.h nename.h nefunc.h
X
Xfences.obj:`09$(VILE_CFG) \1807c`20
X
Xfile.obj:`09$(VILE_CFG) file.c`20
X
Xfilec.obj:`09$(VILE_CFG) \1706c`09dirstuff.h
X
Xfileio.obj:`09$(VILE_CFG) \1807c`20
X
Xfinderr.obj:`09$(VILE_CFG) \1908c`20
X
Xglob.obj:`09$(VILE_CFG) glob.c`09dirstuff.h
X
Xglobals.obj:`09$(VILE_CFG) \1908c `09nefunc.h
X
Xhistory.obj:`09$(VILE_CFG) \1908c`20
X
Xinput.obj:`09$(VILE_CFG) \1706c`20
X
Xinsert.obj:`09$(VILE_CFG) \1807c`20
X
Xisearch.obj:`09$(VILE_CFG) \1908c`20
X
Xitbuff.obj:`09$(VILE_CFG) \1807c`20
X
Xline.obj:`09$(VILE_CFG) line.c`20
X
Xmap.obj:`09$(VILE_CFG) map.c`20
X
Xmodes.obj:`09$(VILE_CFG) \1706c`20
X
Xmsgs.obj:`09$(VILE_CFG) msgs.c`20
X
Xnpopen.obj:`09$(VILE_CFG) \1807c`20
X
Xoneliner.obj:`09$(VILE_CFG) \1A09c`20
X
Xopers.obj:`09$(VILE_CFG) \1706c `09nefunc.h
X
Xpath.obj:`09$(VILE_CFG) path.c`09dirstuff.h
X
Xrandom.obj:`09$(VILE_CFG) \1807c`09nefunc.h
X
Xregexp.obj:`09$(VILE_CFG) \1807c`20
X
Xregion.obj:`09$(VILE_CFG) \1807c`20
X
Xsearch.obj:`09$(VILE_CFG) \1807c`20
X
Xselect.obj:`09$(VILE_CFG) \1807c `09nefunc.h
X
Xspawn.obj:`09$(VILE_CFG) \1706c `09nefunc.h
X
Xtags.obj:`09$(VILE_CFG) tags.c`20
X
Xtbuff.obj:`09$(VILE_CFG) \1706c`20
X
Xtermio.obj:`09$(VILE_CFG) \1807c `09nefunc.h
X
Xundo.obj:`09$(VILE_CFG) undo.c`20
X
Xversion.obj:`09$(VILE_CFG) \1908c   patchlev.h
X
Xwindow.obj:`09$(VILE_CFG) \1807c`20
X
Xword.obj:`09$(VILE_CFG) word.c `09nefunc.h
X
Xwordmov.obj:`09$(VILE_CFG) \1908c`20
X
Xmain.obj:`09$(VILE_CFG) main.c`09nevars.h
X
X$(SCREEN).obj:`09$(VILE_CFG) \1B0Ac`20
X
Xnebind.h `5C
Xnefunc.h `5C
Xnefkeys.h `5C
Xnename.h :`09cmdtbl $(MKTBLS)
X`09@echo making $@
X`09$(MKTBLS) cmdtbl
X
Xnevars.h `5C
Xnefsms.h `5C
Xnemode.h:`09modetbl $(MKTBLS)
X`09@echo making $@
X`09$(MKTBLS) modetbl
X
X#`09`09*Compiler Configuration File*
X# Except for unused-parameters, this turns on all applicable warning messages.
V
Xvile.cfg: $(THIS)
X  copy `26`26`7C
X-ml
X-d
X-v
X-vi-
X-wamb
X-wamp
X-wasm
X-waus
X-wbbf
X-wbig
X-wccc
X-wcln
X-wcpt
X-wdef
X-wdpu
X-wdup
X-weas
X-weff
X-wext
X-will
X-wnod
X-w-par
X-wpia
X-wpin
X-wpro
X-wrch
X-wret
X-wrvl
X-wsig
X-wstu
X-wstv
X-wsus
X-wucp
X-wuse
X-wvoi
X-wzdi
X-w-nci
X-w-inl
X-w-ibc
X-w-pre
X-w-nst
X-I$(INCLUDEPATH)
X-L$(LIBPATH)
X`7C vile.cfg
X
$ call unpack [.VILE-8_0]MAKEFILE.TBC;1 -
 285793193 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 12 64 152
$!
$ create 'f'
X#
X# makefile for Watcom C using\0F08MAKE`20
X# based on the original makefile of vile 3.46 (see \2815)
X# T.DANG (dang@cogit.ign.fr)
X#
X# $Header: /usr/build/vile/vile/RCS/makefile.wat,v 1.24 1997/11/26 16:17:33 to
Vm Exp $
X#
X# if you use the watcom version of vile, you may want to "set DOS4G=quiet"
X# to suppress the DOS 4G/W banner that comes up from the Rational Systems
X# DOS extender otherwise.
X#
X# Tested with Watcom 10.0a (95/9/26)
X
XSCREENDEF = DISP_IBMPC
XSCREEN= ibmpc`20
X#SCREEN= ansi`20
X#SCREENDEF = DISP_ANSI
X
X# for regular compiler (and for version 10.x?)
X#CC=wcl386
X# for protected mode compiler (and for version 9.x?)
XCC=wcl386/p
X
X#define PVGA for Paradise VGA (because there are some problems with this card)
V
X#To fix it, use /dPVGA=1
X#CFLAGS= /d$(SCREENDEF)=1 /dscrn_chosen=1 /dPVGA=1`20
X
X# debugging
X#CFLAGS= /d$(SCREENDEF)=1 /dscrn_chosen=1 /d2
X# normal
XCFLAGS= /d$(SCREENDEF)=1 /dscrn_chosen=1 /ols`20
X
X# these are normal editable headers
XHDRS = estruct.h edef.h proto.h dirstuff.h
X
X# these headers are built by the mktbls program from the information in cmdtbl
V
X# and in modetbl
XBUILTHDRS = nebind.h neproto.h nefunc.h nemode.h nenam\0906vars\2406key\0A07sm
Vs.h
X
XSRC = `09main.c $(SCREEN).c `26
X`09basic.c bind.c btree.c buffer.c crypt.c `26
X`09csrch.c display.c eval.c exec.c externs.c `26
X`09fences.c file\0707c.c `26
X`09fileio.c finderr.c glob\0707als.c history.c `26
X`09input.c insert.c itbuff.c isearch.c `26
X`09line.c map.c modes.c msgs.c npopen.c `26
X`09oneliner.c opers.c path.c random.c regexp.c `26
X`09region.c search.c select.c spawn.c `26
X`09tags.c tbuff.c termio.c undo.c `26
X`09version.c window.c word\0707mov.c
X
XOBJ = `09main.obj $(SCREEN).obj `26
X`09basic.obj bind\0906tree\1306uffer.obj crypt.obj `26
X      `09csrch.obj display.obj eval\0906xec\0907terns.obj `26
X`09fences.obj file\0909c.obj `26
X`09fileio.obj finderr.obj glob\0909als.obj history.obj `26
X`09input.obj inser\0B07tbuff\1606search.obj `26
X`09line.obj map\0806odes\1206sg\0906npopen.obj `26
X`09oneliner.obj opers.obj path.obj random\0B06egexp.obj `26
X`09region.obj search\0B07lect\1606paw\2006`26
X`09tags.obj tbuff\0A06ermio.obj und\0906`26
X`09version.obj window\0B06ord\0909mov.obj
X
X
Xvile.exe: $(BUILTHDRS) $(OBJ) vile.lnk
X`09wlink @vile`20
X
Xvile.lnk: makefile.wat
X`09echo DEBUG ALL >$`5E@
X        echo NAME vile >>$`5E@
X        echo OPTION MAP >>$`5E@
X        echo OPTION STACK=16384 >>$`5E@
X`09for %i in ($(OBJ)) do echo FILE %i >>$`5E@
X
X$(OBJ):`09estruct.h nemode.h edef.h neproto.h \0808config.h
X.c.obj:`09.AUTODEPEND
X`09$(CC) $`5B* /c $(CFLAGS)`20
X
Xnebind.h `26
Xnefkeys.h `26
Xnefunc.h `26
Xneproto.h `26
Xnename.h :`09cmdtbl MKTBLS.EXE
X`09MKTBLS.EXE cmdtbl
X
Xnevars.h `26
Xnefsms.h `26
Xnemode.h:`09modetbl MKTBLS.EXE
X`09MKTBLS.EXE modetbl
X
XMKTBLS.EXE:  mktbls.c
X`09$(CC) mktbls.c
X`09del mktbls.obj
X
Xclean:`09.SYMBOLIC
X`09-del *.err
X`09-del *.obj
X`09-del vile.lnk
X`09-del ne*.h
X`09-del MKTBLS.EXE
X
Xbind.obj:`09nefunc.h
Xeval.obj:`09nevars.h
Xexec.obj:`09nefunc.h
Xexterns.obj:`09nebind.h nename.h neproto.h nefunc.h
Xfilec.obj:`09dirstuff.h
Xglob.obj:`09dirstuff.h
Xglobals.obj:`09nefunc.h
Xmain.obj:`09chgdfunc.h nevars.h
Xmodes.obj:`09chgdfunc.h
Xopers.obj:`09nefunc.h
Xpath.obj:`09dirstuff.h
Xrandom.obj:`09nefunc.h
Xselect.obj:`09nefunc.h
Xspawn.obj:`09nefunc.h
Xtermio.obj:`09nefunc.h
Xversion.obj:`09patchlev.h
Xword.obj:`09nefunc.h
$ call unpack [.VILE-8_0]MAKEFILE.WAT;1 -
 1518236151 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 7 65 152
$!
$ create 'f'
X#
X# makefile for vile on WIN32 using Microsoft Visual C++
X#
X# $Header: /usr/build/vile/vile/RCS/makefile.wnt,v 1.27 1998/05/27 23:02:34 cm
Vorgan Exp $
X#
X#
X!include <ntwin32.mak>
X
X!IF "$(CFG)" == ""
XCFG=vile
X!MESSAGE No configuration (CFG) specified.  Defaulting to vile (console)
X!ENDIF
X
X!IF "$(CFG)" != "vile" `26`26\160Ewin\1906 &0226 `5C
X    "$(CFG)" != "vile-with-perl" `26`26\200Ewin\230F
X!MESSAGE Invalid configuration "$(CFG)" specified.
X!MESSAGE You can specify a configuration when running NMAKE on this makefile
X!MESSAGE by defining the macro CFG on the command line.  For example:
X!MESSAGE
X!MESSAGE NMAKE /f "makefile.wnt" CFG="winvile"
X!MESSAGE
X!MESSAGE Possible choices for configuration are:
X!MESSAGE
X!MESSAGE vile        \0806- console
X!MESSAGE vile-with-perl    - console and embedded perl
X!MESSAGE winvile           - gui
X!MESSAGE winvile-with-perl - gui and embedded perl
X!MESSAGE
X!MESSAGE The 'with-perl' configurations have two preconditions which must be
X!MESSAGE met prior to initiating the build.  Refer to the file "mkprlenv.wnt"
V
X!MESSAGE for more details.
X!MESSAGE
X!ERROR An invalid configuration is specified.
X!ENDIF
X
X# remove the "#" to get debugging info (and a larger executable)
XCC_DEBUG     = #$(cdebug)
XLD_DEBUG     = #$(ldebug)
X
X# Other vars
XCON_LDFLAGS  = -nologo -pdb:none
XDEVNULL      = nul
XPERLCFG      = $(DEVNULL)
XTHE_PERLCFG  = perl_env.inc
X
X!IF EXIST("$(THE_PERLCFG)")
X!INCLUDE "$(THE_PERLCFG)"
X!ENDIF
X
X!IF  "$(CFG)" == "vile" `7C`7C\1612-with-perl"
XTARGET   = vile.exe
XUTILS    = vile-c-filt.exe
XCFLAGS   = $(cvarsmt) $(CC_DEBUG) -nologo -DWIN32_LEAN_AND_MEAN -G4 `5C
X           -Dscrn_chosen -DDISP_NTCONS $(PERLOPTS)
XLDFLAGS  = -nologo -pdb:none
XSCREEN   = ntconio
XLIBS     = $(LD_DEBUG) $(conlflags\0D08ibsmt) user32.lib $(VILE_PERL_LIB)
X!endif
X
X!IF  "$(CFG)" == "winvile" `7C`7C\1915-with-perl"
XTARGET   = winvile.exe
XUTILS    = vile-c-filt.exe
XCFLAGS   = $(cvarsmt) $(CC_DEBUG) -nologo -DWIN32_LEAN_AND_MEAN -G4 `5C
X           -Dscrn_chosen -DDISP_NTWIN $(PERLOPTS)
XLDFLAGS  = -nologo /\0808subsystem:windows /incremental:no -pdb:none
XSCREEN   = ntwinio
XLIBS     = $(LD_DEBUG) $(guilflags\0D08ibsmt) $(VILE_PERL_LIB)
X!endif
X
X!IF "$(CFG)" == "winvile-with-perl" `7C`7C\230E\200F
XPERLOPTS = -DOPT_PERL=1 -I$(VILE_PERL_INC)
XPERLOBJS = api.obj perl.obj watch.obj
XPERLSRCS = api.c perl.c watch.c
XPERLCFG  = $(THE_\1107)
X#
X# The following perl scripts, stored in the subdirectory .`5Cperl, are
X# known to work under win32:
X#
XPERL_SCRIPTS = glob2re.pl visit.pl hgrep.pl search.pl
X!ENDIF
X
X# these are normal editable headers
XHDRS = estruct.h edef.h proto.h dirstuff.h
X
X# these headers are built by the mktbls program from the information in cmdtbl
V
X# and in modetbl
XBUILTHDRS = nebind.h neproto.h nefunc.h nemode.h nenam\0906vars.h `5C
X            nefkeys.h nefsms.h
X
XSRC = `09main.c $(SCREEN).c `5C
X`09basic.c bind.c btree.c buffer.c crypt.c `5C
X`09csrch.c display.c eval.c exec.c externs.c `5C
X`09fences.c file\0707c.c `5C
X`09fileio.c finderr.c glob\0707als.c history.c `5C
X`09input.c insert.c itbuff.c isearch.c `5C
X`09line.c modes.c msgs.c npopen.c oneliner.c opers.c `5C
X`09path.c random.c regexp.c `5C
X`09region.c search.c select.c spawn.c `5C
X`09tags.c tbuff.c termio.c undo.c `5C
X`09version.c window.c word\0707mov.c map.c `5C
X`09w32cbrd.c w32misc\0A06pipe.c $(PERLSRCS)
X
XOBJ = `09main.obj $(SCREEN).obj `5C
X`09basic.obj bind\0906tree\1306uffer.obj crypt.obj `5C
X`09csrch.obj display.obj eval\0906xec\0907terns.obj `5C
X`09fences.obj file\0909c.obj `5C
X`09fileio.obj finderr.obj glob\0909als.obj history.obj `5C
X`09input.obj inser\0B07tbuff\1606search.obj `5C
X`09line.obj modes\0A06sg\0906npopen.obj oneliner\0D06per\2B06`5C
X`09path.obj random\0B06egexp.obj `5C
X`09region.obj search\0B07lect\1606paw\2006`5C
X`09tags.obj tbuff\0A06ermio.obj und\0906`5C
X`09version.obj window\0B06ord\0909mov.obj map.obj `5C
X`09w32cbrd.obj w32misc\0C08pipe.obj $(PERLOBJS)
X
X.c.obj:
X`09$(cc) $(CFLAGS) -c $< -Fo$@
X
Xall: $(PERLCFG) $(TARGET) $(UTILS)
X
X$(TARGET): `09$(BUILTHDRS) $(OBJ)
X`09$(link) $(LDFLAGS) $(OBJ) $(LIBS) -out:$(TARGET)
X
X# collect some perl environment info
X$(PERLCFG): mkprlenv.wnt
X!INCLUDE "mkprlenv.wnt"
X
X$(OBJ):`09estruct.h
X
Xneproto.h `5C
Xnebind.h `5C
Xnefunc.h `5C
Xnefkeys.h `5C
Xnename.h :`09cmdtbl mktbls.exe
X`09mktbls.exe cmdtbl
X
Xnevars.h `5C
Xnefsms.h `5C
Xnemode.h:`09modetbl mktbls.exe
X`09mktbls.exe modetbl
X
Xperl.c: perl.xs ptypemap
X    perl $(VILE_PERL_UTILS)`5Cxsubpp -typemap \2313\1B08`5C
X        -typemap p\0909erl.xs > $@
X
Xmktbls.exe:  \0D07c
X`09$(cc) $(CFLAGS) mktbls.c -Fo\0C06 -link $(CON_LD\2806
X
Xvile-c-filt.exe: \0C07c
X`09$(cc) $(CFLAGS) c-filt.c `5C
X    -Fovile-c-filt -link $(CON_LDFLAGS)
X
Xclean:
X    del *.exe
X    del *.obj
X    del ne*.h
X    -del $(THE_PERLCFG)
X    -del perl.c
X
Xbind.obj:`09nefunc.h
Xeval.obj:`09nevars.h
Xexec.obj:`09nefunc.h
Xexterns.obj:`09nebind.h nename.h neproto.h nefunc.h
Xfilec.obj:`09dirstuff.h
Xglob.obj:`09dirstuff.h
Xglobals.obj:`09nefunc.h
Xmain.obj:`09chgdfunc.h nevars.h
Xmodes.obj:`09chgdfunc.h
Xopers.obj:`09nefunc.h
Xpath.obj:`09dirstuff.h
Xrandom.obj:`09nefunc.h
Xselect.obj:`09nefunc.h
Xspawn.obj:`09nefunc.h
Xtermio.obj:`09nefunc.h
Xversion.obj:`09patchlev.h
Xword.obj:`09nefunc.h
$ call unpack [.VILE-8_0]MAKEFILE.WNT;1 -
 1413763130 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 11 66 152
$!
$ create 'f'
X/*
X * manfilt.c`09`09-- replace backspace sequences with attribute
X *`09`09`09   information for vile
X *
X * Author: Kevin A. Buettner
X * Creation: 4/17/94
X *
X * This program filters backspace sequences often found in manual pages
X * for vile/xvile.  Backspace sequences representing italicized or bold
X * text are fixed up by removing the backspaces, underlines, and duplicate
X * characters (leaving just the text as it should appear on the screen).
X * Attributed text is so indicated by inserting a Cntrl-A sequence in front
X * of the text to be attributed.  These Cntrl-A sequences take the following
X * form:
X *   `09`5EA<Count><Attr>:
X *
X * <Count> is a sequence of digits representing the number of characters
X * following the ':' to be attributed.
X *
X * <Attr> is a sequence of characters which indicates how to attribute the
X * characters following the ':'.  The \180A\2D0Bare presently
X * recognized by vile:
X *
X *`09'I'`09-- italic
X *`09'B'`09-- bold
+-+-+-+-+-+-+-+-  END  OF PART 69 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 70 -+-+-+-+-+-+-+-+
X *`09'U'`09-- underline
X *`09'R'`09-- reverse video
X *
X * Examples:
X *`09Before`09`09&0209`09After
X *`09------`09`09&0209\0B06
X *`09_`5EHi_`5EHt_`5EHa_`5EHl\1007c`09`09`5EA6I:italic
X *
X *`09b`5EHbo`5EHol`5EHld`5EHd`09`09`09`5EA4B:bold
X *
X *`09_`5EHB`5EHB_`5EHo`5EHo_`5EHt`5EHt_`5EHh`5EHh`09`09`5EA4IB:Both
X *
X * On many system, bold sequences are actually quite a bit longer.  On
X * some systems, the repeated character is\160Aas many as four times.
X * Thus the letter "B" would be represented as B`5EHB`5EHB`5EHB.
X *
X * For comparison, see the description of the BSD 'col' program (for
X * information about the types of escape sequences that might be emitted by
X * nroff).
X *
X * vile will choose some appropriate fallback (such as underlining) if
X * italics are not available.
X *
X * $Header: /usr/build/vile/vile/RCS/manfilt.c,v 1.22 1998/04/28 10:17:23 tom
V Exp $
X *
X */
X
X#ifdef HAVE_CONFIG_H
X#include "config.h"
X#else
X/* assume ANSI C */
X#define HAVE_STDLIB_H 1
X#endif
X
X#include <sys/types.h>`09`09/* sometimes needed to get size_t */
X
X#if HAVE_STDLIB_H
X#include <stdlib.h>
X#else
X# if !defined(HAVE_CONFIG_H) `7C`7C MISSING_EXTERN_CALLOC
Xextern`09char *`09calloc`09( size_t nmemb,\0E08size );
X# endif
X# if !defined(HAVE_CONFIG_H) `7C`7C MISSING_EXTERN_REALLOC
Xextern`09char *`09realloc`09( \1106ptr, size_t size );
X# endif
X#endif
X
X#ifdef HAVE_UNISTD_H
X#include <unistd.h>
X#endif
X
X#include <stdio.h>
X
X#if OPT_LOCALE
X#include <locale.h>
X#endif
X#include <ctype.h>
X
X#if MISSING_EXTERN__FILBUF
Xextern`09int`09_filbuf`09( FILE *fp );
X#endif
X
X#ifdef lint
X#define`09typecallocn(cast,ntypes)`09(((cast *)0)+(\1607)
X#define`09typereallocn(cast,ptr,ntypes)`09((ptr)+(\1007)
X#else
X#define`09typecallocn(cast,ntypes)`09(cast *)\1D06(sizeof(cast)\2408
X#define`09typereallocn(cast,ptr,ntypes)`09(cast *)\2207((char *)(ptr),`5C
X`09`09&0209&0309(ntypes)*sizeof(cast))
X#endif
X
X#define backspace() `5C
X`09`09if (cur_line != 0 `5C
X`09`09 `26`26 cur_line->l_this > 0) `5C
X`09`09    cur_line->l_this -= 1;
X
X#define MAX_LINES 200
X
X`09/* SGR codes that we also use as mask values */
X#define ATR_NORMAL 0
X#define ATR_BOLD   1
X#define ATR_UNDER  4
X
X`09/* character names */
X#define ESCAPE    '`5C033'
X#define CNTL_A    '`5C001'
X#define SHIFT_OUT '`5C016'
X#define SHIFT_IN  '`5C017'
X
X#define SPACE     ' '
X#define UNDERLINE '_'
X
X#define CS_NORMAL    0
X#define CS_ALTERNATE 1
X/*
X * Each column of a line is represented by\1906ked list of the characters that
V
X * are printed to that position.  When storing items in this list, we keep a
X * canonical order to simplify analysis when dumping the line.
X */
Xtypedef`09struct`09CharCell `7B
X`09struct`09CharCell *link;
X`09char`09c_ident;`09/* CS_NORMAL/CS_ALTERNATE */
X`09char`09c_level;`09/* 0=base, 1=up halfline, -1=down\1209 */
X`09char`09c_value;`09/* the actual value */
X`09`7D CHARCELL;
X
Xtypedef struct`09LineData `7B
X`09struct`09LineData *l_next;
X`09struct`09LineData *l_prev;
X`09size_t`09l_last;`09`09/* the number of cells allocated in l_cells`5B`5D */
V
X`09size_t`09l_used;`09`09/* the number of cells used in l_cells`5B`5D */
X`09size_t`09l_this;`09`09/* the current cell within the line */
X`09CHARCELL *l_cell;
X`09`7D LINEDATA;
X
Xextern int main ( int argc, char **argv );
X
Xstatic CHARCELL * allocate_cell ( void );
Xstatic LINEDATA * allocate_line ( void );
Xstatic int ansi_escape ( FILE *ifp );
Xstatic int cell_code ( LINEDATA *line, size_t col);
Xstatic int half_down ( int level );
Xstatic int half_up ( int level );
Xstatic void ManFilter ( FILE *ifp );
Xstatic void extend_line (\1306);
Xstatic void failed ( const char *s );
Xstatic void flush_line (\1206);
Xstatic void next_line (\1106);
Xstatic void prev_line (\1106);
Xstatic void put_cell ( int c, int level\0B06ident );
X
Xstatic LINEDATA *all_lines;
Xstatic LINEDATA *cur_line;
Xstatic long`09total_lines;
X
Xstatic void
Xfailed(const char *s)
X`7B
X`09perror(s);
X`09exit(1);
X`7D
X
X/*
X * Allocate a CHARCELL struct
X */
Xstatic CHARCELL *
Xallocate_cell(void)
X`7B
X`09CHARCELL *p = typecallocn(\1A08,1);
X`09if (p == 0)
X`09`09failed("allocate_cell");
X`09return p;
X`7D
X
X/*
X * Allocate a LINEDATA struct
X */
Xstatic LINEDATA *
Xallocate_line(void)
X`7B
X`09LINEDATA *p = typecallocn(\1A08,1);
X`09if (p == 0)
X`09`09failed("allocate_line");
X
X`09if (all_lines == 0)
X`09`09all_lines = p;
X
X`09if (total_lines++ > MAX_LINES)
X`09`09flush_line();
X
X`09return p;
X`7D
X
X/*
X * (Re)allocate the l_cell`5B`5D array for the current line
X */
Xstatic void
Xextend_line(void)
X`7B
X`09size_t have = cur_line->l_last;
X`09size_t want = cur_line->l_this;
X`09if (want >= have) `7B
X`09`09CHARCELL *c = cur_line->l_cell;
X`09`09want += 80;
X`09`09if (c == 0) `7B
X`09`09`09c = typecallocn(CHARCELL,want);
X`09`09`7D else `7B
X`09`09`09c = typereallocn(CHARCELL,c,want);
X`09`09`7D
X`09`09if (c == 0)
X`09`09`09failed("extend_line");
X`09`09while (have < want) `7B
X`09`09`09c`5Bhave`5D.link    = 0;
X`09`09`09c`5Bhave`5D.c_value = SPACE;
X`09`09`09c`5Bhave`5D.c_level = 0;
X`09`09`09c`5Bhave`5D.c_ident = CS_NORMAL;
X`09`09`09have++;
X`09`09`7D
X`09`09cur_line->l_last = want;
X`09`09cur_line->l_cell = c;
X`09`7D
X`7D
X
X/*
X * Store a character at the current position, updating\1F15.
X * We expect (but do not require) that an underscore precedes a nonblank
X * character that will overstrike it.  (Some programs produce the underscore
X * second, rather than first).
X */
Xstatic void
Xput_cell(int c, int level\0B06ident)
X`7B
X`09int`09col;
X`09int`09len;
X`09CHARCELL *p, *q;
X
X`09if (cur_line == 0)
X`09`09cur_line = allocate_line();
X
X`09len = cur_line->l_used;
X`09col = cur_line->l_this++;
X`09extend_line();
X
X`09p = `26(cur_line->l_cell`5Bcol`5D);
X
X`09if (len > col) `7B`09/* some type of overstrike */
X`09`09if (c == UNDERLINE) `7B
X`09`09`09while ((q = p->link) != 0)
X`09`09&0209p = q;
X`09`09`09q = allocate_cell();
X`09`09`09p->link = q;
X`09`09`09p = q;
X`09`09`7D else `7B
X`09`09`09if ((c != SPACE)
X`09`09`09 `7C`7C (p->c_value == UNDERLINE)) `7B
X`09`09&0209q = allocate_cell();
X`09`09&0209*q = *p;
X`09`09&0209p->link = q;
X`09`09`09`7D else if (c == SPACE)
X`09`09&0209return;
X`09`09`7D
X`09`7D
X
X`09p->c_value = c;
X`09p->c_level = level;
X`09p->c_ident = ident;
X
X`09if (cur_line->l_used < \130Cthis)
X`09`09cur_line->l_used = \130Cthis;
X`7D
X
X/*
X * Interpret equivalent overstrike/underline for an ANSI escape sequence.
X */
Xstatic int
Xansi_escape(FILE *ifp)
X`7B
X`09int`09code = ATR_NORMAL;
X`09int`09c;
X
X`09while ((c = fgetc(ifp)) != EOF) `7B
X`09`09if (isalpha(c))
X`09`09`09break;
X`09`09else if (isdigit(c))
X`09`09`09code = (code * 10) + (c - '0');
X`09`09else
X`09`09`09code = 0;
X`09`7D
X
X`09if (c == 'm') `7B
X`09`09if (code != ATR_BOLD `26`26 \140CUNDER)
X`09`09`09code = ATR_NORMAL;
X`09`7D else `7B
X`09`09code = ATR_NORMAL;
X`09`7D
X`09return code;
X`7D
X
X/*
X * Set the current pointer to the previous line, allocating it if necessary
X */
Xstatic void
Xprev_line(void)
X`7B
X`09LINEDATA *old_line;
X
X`09if (cur_line == 0)
X`09`09cur_line = allocate_line();
X
X`09if (cur_line->l_prev == 0) `7B
X`09`09cur_line->l_prev = allocate_line();
X`09`09if (cur_line == all_lines)
X`09`09`09all_lines = cur_line->l_prev;
X`09`7D
X`09old_line = cur_line;
X`09cur_line = \0B08->l_prev;
X`09cur_line->l_next = old_line;
X`09cur_line->l_this = old\130D;
X`7D
X
X/*
X * Set the current pointer to the next line, allocating it if necessary
X */
Xstatic void
Xnext_line(void)
X`7B
X`09LINEDATA *old_line;
X
X`09if (cur_line == 0)
X`09`09cur_line = allocate_line();
X
X`09if (cur_line->l_next == 0)
X`09`09cur_line->l_next = allocate_line();
X
X`09old_line = cur_line;
X`09cur_line = \0B08->l_next;
X`09cur_line->l_prev = old_line;
X`09cur_line->l_this = old\130D;
X`7D
X
X/*
X * If we've got a blank line to write onto, fake half-lines that way.
X * Otherwise, eat them.  We assume that half-line controls occur in pairs.
X */
Xstatic int
Xhalf_up(int level)
X`7B
X`09prev_line();
X`09if (cur_line->l_this < \130Cused) `7B
X`09`09next_line();
X`09`09return level+1;
X`09`7D
X`09return 0;
X`7D
X
Xstatic int
Xhalf_down(int level)
X`7B
X`09if (level == 0) `7B
X`09`09next_line();
X`09`09return 0;
X`09`7D
X`09return level-1;
X`7D
X
Xstatic int
Xcell_code(LINEDATA *line, size_t col)
X`7B
X`09CHARCELL *p = `26(line->l_cell`5Bcol`5D);
X`09CHARCELL *q;
X`09int code = ATR_NORMAL;
X`09while ((q = p->link) != 0) `7B
X`09`09if (q->c_value == UNDERLINE
X`09`09 `26`26 q->c_value != p\0E09) `7B
X`09`09`09code `7C= ATR_UNDER;
X`09`09`7D else
X`09`09`09code `7C= ATR_BOLD;
X`09`09p = q;
X`09`7D
X`09return code;
X`7D
X
X/*
X * Write the oldest line from memory to standard output and deallocate its
X * storage.
X */
Xstatic void
Xflush_line(void)
X`7B
X`09size_t`09col;
X`09int`09ref_code;
X`09int`09tst_code;
X`09int`09counter;
X`09LINEDATA *l = all_lines;
X`09CHARCELL *p;
X
X`09if (l != 0) `7B
X`09`09all_lines = l->l_next;
X`09`09if (cur_line == l)
X`09`09`09cur_line = all_lines;
X
X`09`09ref_code = ATR_NORMAL;
X`09`09counter  = 0;
X`09`09for (col = 0; col < l->l_used; col++) `7B
X`09`09`09if (--counter <= 0) `7B
X`09`09&0209tst_code = cell_code(l,col);
X`09`09&0209if (tst_code != ref_code) `7B
X`09`09&0209`09ref_code = tst_code;
X`09`09&0209`09for (counter = 1; \0D07+col < l->l_used\190A+) `7B
X`09`09&0209&0209tst_code = cell_code(l, col+counter);
X`09`09&0209&0209if (tst_code != ref_code)
X`09`09&0209&0309break;
X`09`09&0209`09`7D
X`09`09&0209`09if (ref_code != ATR_NORMAL) `7B
X`09`09&0209&0209printf("%c%d", CNTL_A, counter);
X`09`09&0209&0209if (ref_code `26 ATR_BOLD)
X`09`09&0209&0309putchar('B');
X`09`09&0209&0209if (ref_code `26 ATR_UNDER)
X`09`09&0209&0309putchar('I');
X`09`09&0209&0209putchar(':');
X`09`09&0209`09`7D
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09putchar(l->l_cell`5Bcol`5D.c_value);
X
X`09`09`09while ((p = l->l_cell`5Bcol`5D.link) != 0) `7B
X`09`09&0209l->l_cell`5Bcol`5D.link = p->link;
X`09`09&0209free((char *)p);
X`09`09`09`7D
X`09`09`7D
X`09`09putchar('`5Cn');
X
X`09`09if (l != 0) `7B
X`09`09`09if (l->l_cell != 0)
X`09`09&0209free((char *)l->l_cell);
X`09`09`09free((char *)l);
X`09`09`7D
X`09`7D
X`7D
X
X/*
X * Filter an entire file, writing the result to the standard output.
X */
Xstatic void
XManFilter(FILE *ifp)
X`7B
X`09int`09c;
X`09int`09level = 0;
X`09int`09ident = CS_NORMAL;
X`09int`09esc_mode = ATR_NORMAL;
X
X`09while ((c = fgetc(ifp)) != EOF) `7B
X`09`09switch (c) `7B
X`09`09case '`5Cb':
X`09`09`09backspace();
X`09`09`09break;
X
X`09`09case '`5Cr':
X`09`09`09if (cur_line != 0)
X`09`09&0209cur_line->l_this = 0;
X`09`09`09break;
X
X`09`09case '`5Cn':
X`09`09`09next_line();
X`09`09`09cur_line->l_this = 0;
X`09`09`09break;
X
X`09`09case '`5Ct':
X`09`09`09do `7B
X`09`09&0209put_cell(SPACE, level, ident);
X`09`09`09`7D while (cur_line->l_this `26 7);
X`09`09`09break;
X
X`09`09case '`5Cv':
X`09`09`09prev_line();
X`09`09`09break;
X
X`09`09case SHIFT_IN:
X`09`09`09ident = CS_NORMAL;
X`09`09`09break;
X
X`09`09case SHIFT_OUT:
X`09`09`09ident = CS_ALTERNATE;
X`09`09`09break;
X
X`09`09case ESCAPE:
X`09`09`09switch (fgetc(ifp)) `7B
X`09`09`09case '`5B':
X`09`09&0209esc_mode = ansi_escape(ifp);
X`09`09&0209break;
X`09`09`09case '`5C007':
X`09`09`09case '7':
X`09`09&0209prev_line();
X`09`09&0209break;
X`09`09`09case '`5C010':
X`09`09`09case '8':
X`09`09&0209level = half_up(level);
X`09`09&0209break;
X`09`09`09case '`5C011':
X`09`09`09case '9':
X`09`09&0209level = half_down(level);
X`09`09&0209break;
X`09`09`09default: /* ignore everything else */
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09break;
X
X`09`09default: /* ignore other nonprinting characters */
X`09`09`09if (isprint(c)) `7B
X`09`09&0209put_cell(c, level, ident);
X`09`09&0209if (c != SPACE) `7B
X`09`09&0209`09if (esc_mode `26 ATR_BOLD) `7B
X`09`09&0209&0209backspace();
X`09`09&0209&0209put_cell(c, level, ident);
X`09`09&0209`09`7D
X`09`09&0209`09if (esc_mode `26 ATR_UNDER) `7B
X`09`09&0209&0209backspace();
X`09`09&0209&0209put_cell('_', level, ident);
X`09`09&0209`09`7D
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09break;
X`09`09`7D
X`09`7D
X
X`09while (all_lines != 0)
X`09`09flush_line();
X
X`09total_lines = 0;
X`7D
X
Xint
Xmain(int argc, char **argv)
X`7B
X`09int n;
X
X#if OPT_LOCALE
X`09setlocale(LC_CTYPE, "");
X#endif
X
X`09if (argc > 1) `7B
X`09`09for (n = 1; n < argc; n++) `7B
X`09`09`09FILE *fp = fopen(argv`5Bn`5D, "r");
X`09`09`09if (fp == 0)
X`09`09&0209failed(argv`5Bn`5D);
X`09`09`09ManFilter(fp);
X`09`09`09(void)fclose(fp);
X`09`09`7D
X`09`7D else `7B
X`09`09ManFilter(stdin);
X`09`7D
X`09exit(0);`09/* successful exit */
X`09/*NOTREACHED*/
X`7D
$ call unpack [.VILE-8_0]MANFILT.C;1 -
 1128450479 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 25 67 152
$!
$ create 'f'
XMANIFEST for vile-8.0, version v8_0
X--------\0808\1010\2020\4010
XMANIFEST        \0808\1008this file
XCHANGES        \0808\1009Change-log for VILE
XCHANGES.R3        \0808\1006Vile 3.0 change-log
XCHANGES.R4        \0808\1006VILE 4.0 change-log
XCHANGES.R5        \0808\1006Vile 5.0 change log
XCHANGES.R6        \0808\1006Vile 6.0 change-log
XCOPYING        \0808\1009GPL copyright (for 'configure')
XINSTALL        \0808\1009installation instructions for VILE
XREADME        \0808\100Aoverview of VILE (read first)
XREADME.PC        \0808\1007instructions for PC's (MS-DOS, etc.)
Xaclocal.m4        \0808\1006VILE-specific autoconf macros
Xansi.c        \0808\100AANSI terminal driver
Xapi.c        \0808\100Bnvi-like api to perl and tcl
Xapi.h        \0808\100Binterface of api.c
Xbasic.c        \0808\1009basic cursor-movement
Xbind.c        \0808\100Akey-bindings `26 low-level command-completion
Xborland.c        \0808\1007BORLAND terminal driver
Xbtree.c        \0808\1009balanced-binary (AVL) tree functions
Xbtree.h        \0808\1009interface of \2D06c
Xbuffer.c        \0808\1008\2006-management
Xbuglist        \0808\1009bug-list
Xc-filt.c        \0808\1008VILE attribute-filter for C files
Xc-filt.flx        \0808\1006FLEX filter for C programs
Xchgdfunc.h        \0808\1006prototypes for mode-functions with side-effects
Xcmdtbl        \0808\100Aused by 'mktbls' to generate VILE's command-tables
Xconfig.emx        \0808\1006\2006ure-ifdefs for EMX (OS/2)
Xconfig.guess        \0808    \2006ure utility-script
Xconfig.sub        \0808\1006\2006ure utility-script
Xconfig_h.in        \0808     template for \2D06.h
Xconfigure.in        \0808    used by 'autoconf' to generate '\4009'
Xconfigure        \0808\1007C\2007ation script for UNIX
Xcrypt.c        \0808\1009encryption (from uEmacs)
Xcsrch.c        \0808\1009current-line character-scanning commands
Xdescrip.mms        \0808     VAX/VMS MMS build-script
Xdirstuff.h        \0808\1006interfaces for UNIX-like directory functions
Xdisplay.c        \0808\1007message `26 screen formatting `26 \3E07
Xdjhandl.c        \0808\1007CTL/C `26 interrupt handling for DJGCC
Xdumbterm.c        \0808\1006DUMB terminal driver
Xedef.h        \0808\100Aglobal variable definitions
Xestruct.h        \0808\1007master include/\2E06 definitions
Xeval.c        \0808\100Aexpression-evaluation
Xexec.c        \0808\100Acommand (':', macros) execution
Xexterns.c        \0808\1007\2006al data (via edef.h)
Xfences.c        \0808\1008functions for parenthesis/ifdef balancing
Xfile.c        \0808\100Aread/write/lookup disk files (high-level)
Xfilec.c        \0808\1009filename-completion functions
Xfileio.c        \0808\1008low-level file I/O functions
Xfinderr.c        \0808\1007error-\2606
Xglob.c        \0808\100Aglobbing (wildcard `26 environment-variable substituti
Von)
Xglobals.c        \0808\1007ed/vi/ex style \2F06 commands
Xgppconio.c        \0808\1006patched console I/O support for DJGCC
Xhistory.c        \0808\1007command-\2807
Xibmpc.c        \0808\1009IBM PC terminal driver (direct I/O)
Xinput.c        \0808\1009various input-routines
Xinsert.c        \0808\1008functions for character-\3806ion
Xinstall.sh        \0808\1006\2007-script, needed for configure
Xisearch.c        \0808\1007incremental-\2B06 commands
Xitbuff.c        \0808\1008support functions for wide-character strings
Xlckfiles.c        \0808\1006locked-files support
Xline.c        \0808\100Aline-management functions
Xmain.c        \0808\100Amain program of VILE
Xmakefile.blc        \0808    \2008 for Win32 with Borland C++
Xmakefile.djg        \0808    \2008 for DJGCC
Xmakefile.emx        \0808    \2008 for EMX (OS/2) with gcc and gmake
Xmakefile.icc        \0808    \2008 for C Set++ 2.x (OS/2)
Xmakefile.in        \0808     used by 'configure' to generate a \4208
Xmakefile.tbc        \0808    \2008 for TurboC (MS-DOS)
Xmakefile.wat        \0808    \2008 for Watcom (MS-DOS) with wmake
Xmakefile.wnt        \0808    \2008 for Win32 with Microsoft Visual C++
Xmanfilt.c        \0808\1007VILE attribute-filter for man-page (nroff-output)
Xmap.c        \0808\100Bmap and map! commands
Xmenu.c        \0808\100Amenu-support for xvile
Xmkdirs.sh        \0808\1007script to make directory-hierarchy
Xmkprlenv.wnt        \0808    vile-7.4h
Xmktbls.c        \0808\1008utility for constructing VILE's command `26 mode tab
Vles
Xmodes.c        \0808\1009mode-command support
Xmodetbl        \0808\1009used by 'mktbls' to generate mode tables
Xmsgs.c        \0808\100Apop-up message support
Xnpopen.c        \0808\1008pipe-command support
Xntconio.c        \0808\1007Win32 console terminal driver
Xntwinio.c        \0808\1007GUI terminal driver for WinNT
Xoneliner.c        \0808\1006commands that operate upon single lines
Xopers.c        \0808\1009operator-commands (that use motions)
Xos2keys.h        \0808\1007function-key definitions for OS/2
Xos2pipe.c        \0808\1007OS/2 pipe support
Xos2vio.c        \0808\1008OS/2 video terminal driver
Xpas-filt.c        \0808\1006Pascal syntax-highlighting filter
Xpatchlev.h        \0808\1006patch-level
Xpath.c        \0808\100Afunctions that manipulate pathnames
Xperl.xs        \0808\1009Perl/C interface wrapper
Xproto.h        \0808\1009function prototypes
Xpscreen.h        \0808\1007interface for PSCREEN struct
Xptypemap        \0808\1008perl-interface type map
Xrandom.c        \0808\1008miscellaneous functions
Xregexp.c        \0808\1008regular expression functions
Xregion.c        \0808\1008\2006-manipulation
Xrevlist        \0808\1009revision-list for VILE
Xsearch.c        \0808\1008functions for \2E06-commands
Xselect.c        \0808\1008\2006ion-handling functions
Xspawn.c        \0808\1009functions for spawning subprocesses
Xtags.c        \0808\100Asupport for vi-style "tags"
Xtbuff.c        \0808\1009temporary-buffer management functions
Xtcap.c        \0808\100ATERMCAP terminal driver
Xtcap.h        \0808\100Ainterface of tcap.c
Xtermio.c        \0808\1008low-level terminal I/O support
Xtrace.c        \0808\1009development: trace to logfile
Xtrace.h        \0808\1009development: trace to logfile
Xundo.c        \0808\100Asupport for "undo"
Xversion.c        \0808\1007\2007 `26 usage messages
Xvile.1        \0808\100Aman-page for VILE
Xvile.hlp        \0808\1008help-file
Xvms2unix.c        \0808\1006VMS/UNIX compatibility support functions
Xvmsbuild.com        \0808    VAX/VMS DCL build script
Xvmspipe.c        \0808\1007pipe-filter support for VMS
Xvmsvt.c        \0808\1009VMS terminal driver
Xw32cbrd.c        \0808\1007Win32 clipboard support
Xw32misc.c        \0808\1007vile-7.4h
Xw32pipe.c        \0808\1007Win32 native pipe support
Xwatch.c        \0808\1009watch file-descriptors `26 timers
Xwindow.c        \0808\1008\2006-management functions
Xword.c        \0808\100Acommands that operate upon words or paragraphs
Xwordmov.c        \0808\1007cursor-movement commands (e.g., word, spaces)
Xx11.c        \0808\100BX11 (Xt, Motif or Openlook) terminal driver
Xxshell.sh        \0808\1007wrapper/sample script for xvile
Xdoc        \0808\100Dsubdirectory
Xdoc/config.doc        \0808  \1C06uration-instructions for VILE
Xdoc/macros.doc        \0808  documentation for VILE \3306
Xdoc/menus.doc        \0808   description of xvile (Xm and Xaw) menus
Xdoc/modes.doc        \0808   overview of modes/majormodes
Xdoc/perl.doc        \0808    notes about perl interface to vile
Xmacros        \0808\100Asubdirectory
Xmacros/digraphs.rc        \0806\2006 for inserting \2E08
Xmacros/manpage.rc        \0807\2006 for man-page filtering/display
Xmacros/pictmode.rc        \0806\2006 to support "picture-mode" editing
Xmacros/vile-pager        \0807use vile as a pager
Xperl        \0808\100Csubdirectory
Xperl/glob2re.pl        \0808 utility-script for vile's hypertext
Xperl/hgrep.pl        \0808   utility-script for vile's hypertext
Xperl/manfilt.pl        \0808 Perl filter for man-pages
Xperl/search.pl        \0808  perl lookalike for vile's \3506 commands
Xperl/shell.pl        \0808   spawn a shell via a pty
Xperl/tailf.pl        \0808   do a "tail -f"
Xperl/visit.pl        \0808   utility-script for vile's hypertext
$ call unpack [.VILE-8_0]MANIFEST.;1 -
 1176582773 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 18 68 152
$!
$ create 'f'
X/*
X * map.c`09-- map and map! interface routines
X *`09Original interface by Otto Lind, 6/3/93
X *`09Additional map and map! support by Kevin Buettner, 9/17/94
X *
X * $Header: /usr/build/vile/vile/RCS/map.c,v 1.81 1998/04/28 10:17:31 tom Exp
V $
X *
X */
X
X#include "estruct.h"
X#include "edef.h"
X
X/*
X * Picture for struct maprec
X * --------\0808\1009
X *
X * Assume the following mappings...
X *
X * map za abc
X * map zb def
X * map q  quit
X *
X * These may be represented by the following picture...
X *
X *   `7C
X *   v
X * +---+------\0906+---+  \1917
X * `7C z `7C  NULL  `7C o `7C o-+-->`7C q `7C "quit" `7C 0 `7C 0 `7C
X * +---+--------+-`7C-+---+  \1910\2606+
X *        \0808`7C
X *`09`09  v
X *        \0806+---+------\0906+---+\1919
X *        \0806`7C a `7C "abc"  `7C 0 `7C o-+-->`7C b `7C "def\19090 `7C
X *        \0806+---+------\0906+---+\1919
X *
X * where the pertinent fields are as follows:
X *
X * +----+----\0606\0E09--+
X * `7C ch `7C srv `7C dlink `7C f\0806
X * +----+----\0606\0E09--+
X *
X * When matching a character sequence, we follow dlink when we've found a
X * matching character.  We change the cha\1A06 to be matched to the next
X * character in the sequence.  If the \230Adoesn't match, we stay at
X * the same level (with\150Acharacter) and follow flink.
X *
X */
X
Xstruct maprec `7B
X`09int`09`09ch;&0209/* character to match&0209*/
X`09UINT`09`09flags;&0209/* flags word&0209`09*/
X`09struct maprec *`09dlink;`09`09/* Where to go to match the`09*/
X`09`09&0209`09/*   next character in a multi-`09*/
X`09`09&0209`09/*   character sequence.`09*/
X`09struct maprec *`09flink;`09`09/* Where to try next if match`09*/
X`09`09&0209`09/*   against current character `09*/
X`09`09&0209`09/*   is unsuccessful&0209*/
X`09int`09`09irv;&0209/* system defined mapping: The`09*/
X`09`09&0209`09/*   (wide) character code to`09*/
X`09`09&0209`09/*   replace a matched sequence by */
X`09char          *`09srv;`09`09/* user defined mapping: This`09*/
X`09`09&0209`09/*   is the string to replace a`09*/
X`09`09&0209`09/*   matched sequence by`09*/
X`7D;
X
X#define MAPF_SYSTIMER`090x01
X#define MAPF_USERTIMER`090x02
X#define MAPF_TIMERS`090x03
X#define MAPF_NOREMAP`090x04
X
Xstatic int suppress_sysmap;
X
Xstatic struct maprec *map_command = NULL;
Xstatic struct maprec *map_insert = NULL;
Xstatic struct maprec *map_syskey = NULL;
Xstatic struct maprec *abbr_map = NULL;
X
Xstatic`09int`09map_common(struct maprec **mpp, const char *bufname, UINT remap
Vflag);
Xstatic`09int`09unmap_common(struct maprec **mpp, const char *bufname);
Xstatic`09void`09addtomap(struct maprec **mpp, const char * ks, int kslen, UINT
V flag\1707irv, c\2B06srv);
Xstatic`09int`09delfrommap(struct maprec **mpp, const char * ks);
X
Xstatic`09int`09abbr_getc (void);
Xstatic`09int`09abbr_c_avail (void);
X
Xstatic`09int`09mapgetc (void);
X
Xtypedef`09int (*AvailFunc) (void);
Xtypedef`09int (*GetFunc) (void);
Xtypedef`09int (*StartFunc) (void);
X
Xstatic`09int`09maplookup(int c, ITBUFF **outp, struct maprec *mp, GetFunc get,
V AvailFunc avail, Star\2006start, int suffix);
X
X#if !OPT_UPBUFF
X#define relist_mappings(name)
X#endif
X
X#if OPT_SHOW_MAPS
X#define MAPS_PREFIX 12
X
X/*ARGSUSED*/
Xstatic void
Xmakemaplist(int dummy GCC_UNUSED, void *mapp)
X`7B
X    TBUFF *lhsstr = 0;
X    struct maprec **lhsstack = 0;
X    struct maprec *mp = (\150F) mapp;
X    int footnote = 0;
X    ALLOC_T depth = 0;
X    ALLOC_T maxdepth;
X    ALLOC_T i;
X
X    lhsstr = tb_init(`26\1206, 0);
X    lhsstack = typeallocn(struct maprec *, maxdepth = NSTRING);
X    for_ever `7B
X`09if (mp) `7B
X`09    const char *remapnote;
X`09    char *mapstr;
X`09    char esc_seq`5B10`5D;`09/* FIXME */
X`09    tb_put(`26lhsstr, depth, mp->ch);
X`09    if (depth+1 >= maxdepth)
X`09`09lhsstack = typereallocn(struct maprec *, \2908, maxdepth *= 2);
X`09    lhsstack`5Bdepth++`5D = mp->flink;
X
X`09    mapstr = (char *)0;
X`09    if (mp->srv) `7B
X`09`09mapstr = mp->srv;
X`09    `7D else if (mp->irv != -1) `7B
X`09`09(void)kcod2escape_seq(mp->irv, esc_seq);
X`09`09mapstr = esc_seq;
X`09    `7D
X`09    if (mapstr) `7B
X    `09`09    if (mapp `26`26 (struct maprec *)mapp == abbr_map) `7B
X`09`09`09    /* the abbr map is stored inverted */
X`09`09`09    for (i = depth; i != 0; )
X`09`09&0209bputc(tb_values(lhsstr)`5B--i`5D);
X`09`09    `7D else `7B
X`09`09`09    if (mp->flags `26 MAPF_NOREMAP) `7B
X`09`09&0209remapnote = "(n)";
X`09`09&0209footnote++;
X`09`09`09    `7D else `7B
X`09`09&0209remapnote = "   ";
X`09`09`09    `7D
X`09`09`09    bprintf("%s ", remapnote);
X`09`09`09    for (i = 0; i < depth; i++)
X`09`09&0209bputc(tb_values(lhsstr)`5Bi`5D);
X`09`09    `7D
X`09`09    bprintf("`5Ct%s`5Cn", mapstr);
X`09    `7D
X`09    mp = mp->dlink;
X`09`7D
X`09else if (depth != 0)
X`09    mp = lhsstack`5B--depth`5D;
X`09else
X`09    break;
X    `7D
X    if (footnote) `7B
X`09bprintf("`5B(n) means never remap`5D`5Cn");
X    `7D
X    tb_free(`26lhsstr);
X    free((char *)lhsstack);
X`7D
X
Xstatic int
Xshow_mapped_chars(const char *bname)
X`7B
X`09struct maprec *mp;
X`09if (strcmp(bname, MAP_BufName) == 0)
X`09`09mp = map_command;
X`09else if (strcmp(bname, MAPBANG_BufName) == 0)
X`09`09mp = map_insert;
X`09else if (strcmp(bname, ABBR_BufName) == 0)
X`09`09mp = abbr_map;
X`09else if (strcmp(bname, SYSMAP_BufName) == 0)
X`09`09mp = map_syskey;
X`09else
X`09`09return FALSE;
X`09return liststuff(bname, FALSE, makemaplist, 0, (void *)mp);
X`7D
X
X#if OPT_UPBUFF
Xstatic int
Xshow_Mappings(BUFFER *bp)
X`7B
X`09b_clr_obsolete(bp);
X`09return show_mapped_chars(bp->b_bname);
X`7D
X
X#undef relist_mappings
X
Xstatic void
Xrelist_mappings(const char * bufname)
X`7B
X    update_scratch(bufname, show_Mappings);
X`7D
X#endif`09/* OPT_UPBUFF */
X
X#endif`09/* OPT_SHOW_MAPS */
X
X/*
X** set a map for the character/string combo
X*/
X/* ARGSUSED */
Xint
Xmap(int f GCC_UNUSED, int n\120B)
X`7B
X    return map_common(`26\0C08and, MAP_BufName, 0);
X`7D
X
X/* ARGSUSED */
Xint
Xmap_bang(int f GCC_UNUSED, int n\120B)
X`7B
X    return map_common(`26map_insert, MAPBANG_BufName, 0);
X`7D
X
X/* ARGSUSED */
Xint
Xnoremap(int f GCC_UNUSED, int n\120B)
X`7B
X    return map_common(`26\0C08and, MAP_BufName, MAPF_NOREMAP);
X`7D
X
X/* ARGSUSED */
Xint
Xnoremap_bang(int f GCC_UNUSED, int n\120B)
X`7B
X    return map_common(`26map_insert, MAPBANG_BufName, MAPF_NOREMAP);
X`7D
X
X/* ARGSUSED */
Xint
Xabbrev(int f GCC_UNUSED, int n\120B)
X`7B
X    return map_common(`26abbr_map, ABBR_BufName, MAPF_NOREMAP);
X`7D
X
X#if OPT_SHOW_MAPS
X/* ARGSUSED */
Xint
Xsysmap(int f GCC_UNUSED, int n\120B)
X`7B
X`09return show_mapped_chars(SYSMAP_BufName);
X`7D
X#endif
X
Xstatic int
Xmap_common(struct maprec **mpp, const char *bufname, UINT remapflag)
X`7B
X    int`09 status;
X    static TBUFF *kbuf;
X    static TBUFF *val;
X    int len;
X
X#if OPT_SHOW_MAPS
X    if (end_named_cmd()) `7B
X`09return show_mapped_chars(bufname);
X    `7D
X#endif
X    tb_scopy(`26kbuf, "");
X    status = kbd_reply("change this string: ", `26kbuf, eol_history,
X`09`09`09' ', KBD_NOMAP`7C\0A06EVAL, no_completion);
X    if (status != TRUE)
X`09return status;
X
X    hst_glue(' ');
X    tb_scopy(`26val, "");
X    if (!clexec) `7B
X`09    status = kbd_reply("to this new string: ", `26val, eol_history,
X`09`09`09'`5Cn', KBD_NOMAP, no_completion);
X    `7D else `7B
X`09    (void)macliteralarg(`26val); /* consume to end of line */
X`09    status = tb_length(val) > 1;
X    `7D
X    if (status != TRUE)
X`09return status;
X
X    len = tb_length(kbuf) - 1;
X    if ((*mpp `26`26 *mpp == abbr_map) `7C`7C (strcmp(bufname, ABBR_BufName)`20
+-+-+-+-+-+-+-+-  END  OF PART 70 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 71 -+-+-+-+-+-+-+-+
V== 0)) `7B
X`09/* reverse the lhs */
X`09int i;
X`09char t;
X`09char *s = tb_values(kbuf);
X`09for (i = 0; i < len/2; i++) `7B
X`09    t = s`5Blen-i-1`5D;
X`09    s`5Blen-i-1`5D = s`5Bi`5D;
X`09    s`5Bi`5D = t;
X`09`7D
X    `7D
X
X    addtomap(mpp, tb_values(kbuf), len, MAPF_USERTIMER`7Cremapflag, -1\340Cval
V));
X    relist_mappings(bufname);
X    return TRUE;
X`7D
X
X/*
X** remove map entry, restore saved CMDFUNC for key
X*/
X/* ARGSUSED */
Xint
Xunmap(int f GCC_UNUSED, int n\120B)
X`7B
X    return unmap_common(`26\0C08and, MAP_BufName);
X`7D
X
X/* ARGSUSED */
Xint
Xunmap_bang(int f GCC_UNUSED, int n\120B)
X`7B
X    return unmap_common(`26map_insert, MAPBANG_BufName);
X`7D
X
X/* ARGSUSED */
Xint
Xunmap_system(int f GCC_UNUSED, int n\120B)
X`7B
X    return unmap_common(`26map_syskey, SYSMAP_BufName);
X`7D
X
X/* ARGSUSED */
Xint
Xunabbr(int f GCC_UNUSED, int n\120B)
X`7B
X    return unmap_common(`26abbr_map, ABBR_BufName);
X`7D
X
Xstatic int
Xunmap_common(struct maprec **mpp, const char *bufname)
X`7B
X    int`09 status;
X    static TBUFF *kbuf;
X
X    /* otherwise it'll be mapped, and not found when looked up */
X    if (mpp `26`26 mpp == `26map_syskey)
X    `09suppress_sysmap = TRUE;
X
X    tb_scopy(`26kbuf, "");
X    status = kbd_reply("unmap string: ", `26kbuf, eol_history,
X`09`09`09' ', KBD_NOMAP, no_completion);
X    suppress_sysmap = FALSE;
X    if (status != TRUE)
X`09return status;
X
X    if ((*mpp `26`26 *mpp == abbr_map) `7C`7C (strcmp(bufname, ABBR_BufName)`20
V== 0)) `7B
X`09/* reverse the lhs */
X`09int i;
X`09char t;
X    `09int len = tb_length(kbuf) - 1;
X`09char *s = tb_values(kbuf);
X`09for (i = 0; i < len/2; i++) `7B
X`09    t = s`5Blen-i-1`5D;
X`09    s`5Blen-i-1`5D = s`5Bi`5D;
X`09    s`5Bi`5D = t;
X`09`7D
X    `7D
X
X    if (delfrommap(mpp, tb_values(kbuf)) != TRUE) `7B
X`09mlforce("`5BSequence not mapped`5D");
X`09return FALSE;
X    `7D
X    relist_mappings(bufname);
X    return TRUE;
X`7D
X
X/* addtosysmap is used to initialize the system default function key map
X*/
Xvoid
Xaddtosysmap(const char * seq, int seqlen\0C06code)
X`7B
X    addtomap(`26map_syskey, seq, seqlen, MAPF_SYSTIMER,
X    `09`09`09code, (char *)0);
X`7D
X
Xstatic void
Xaddtomap(
X    struct maprec **mpp,
X    const char * ks,
X    int         kslen,
X    UINT        flags,
X    int`09`09irv,
X    char *`09srv)
X`7B
X    struct maprec *mp = NULL;
X
X    if (ks == 0 `7C`7C kslen == 0)
X`09return;
X
X    while (*mpp `26`26 kslen) `7B
X`09mp = *mpp;
X`09mp->flags `7C= flags;
X`09if (char2int(*ks) == mp->ch) `7B
X`09    mpp = `26mp->dlink;
X`09    ks++;
X`09    kslen--;
X`09`7D
X`09else
X`09    mpp = `26mp->flink;
X    `7D
X
X    while (kslen) `7B
X`09mp = typealloc(struct maprec);
X`09if (mp == 0)
X`09    break;
X`09*mpp = mp;
X`09mp->dlink = mp->f\0C07NULL;
X`09mp->ch = char2int(*ks++);
X`09mp->srv = NULL;
X`09mp->flags = flags;
X`09mp->irv = -1;
X`09mpp = `26mp->dlink;
X`09kslen--;
X    `7D
X
X    if (irv != -1)
X`09mp->irv = irv;
X    if (srv) `7B
X`09if (mp->srv)
X`09    free(mp->srv);
X`09mp->srv = strmalloc(srv);
X    `7D
X    mp->flags = flags;
X`7D
X
Xstatic int
Xdelfrommap(struct maprec **mpp, const char * ks)
X`7B
X    struct maprec **save_m = mpp;
X    struct maprec ***mstk = 0;
X    const char *save_k = ks;
X    int depth = 0;
X    int pass;
X
X    if (ks == 0 `7C`7C *\0C07)
X`09return FALSE;
X
X    for (pass = 0; pass < 2\0A06++) `7B
X`09mpp   = save_m;
X`09ks    = save_k;
X`09depth = 0;
X`09while (*mpp `26`26 *ks) `7B
X`09    if (pass)
X`09`09mstk`5Bdepth`5D = mpp;
X`09    if ((*mpp)->ch == char2int(*ks)) `7B
X`09`09mpp = `26(*mpp)->dlink;
X`09`09ks++;
X`09`09depth++;
X`09    `7D
X`09    else
X`09`09mpp = `26(*mpp)->flink;
X`09`7D
X
X`09if (*ks)
X`09    return FALSE;`09`09/* not in map */
X`09if (!pass)
X`09    mstk = typecallocn(struct maprec **, depth+1);
X    `7D
X
X    depth--;
X    if ((*mstk`5Bdepth`5D)->srv) `7B
X`09free((*mstk`5Bdepth`5D)->srv);
X`09(*mstk`5Bdepth`5D)->srv = NULL;
X    `7D else if ((*mstk`5Bdepth`5D)->irv != -1) `7B
X`09(*mstk`5Bdepth`5D)->irv = -1;
X    `7D else `7B
X`09free((char *)mstk);
X`09return FALSE;
X    `7D
X
X    for (; depth >= 0\0C07--) `7B
X`09struct maprec *mp = *mstk`5Bdepth`5D;
X`09if (mp->irv == -1 `26`26 mp->dlink == NULL\1508s\2606NULL) `7B
X`09    *mstk`5Bdepth`5D = mp->flink;
X`09    if (depth > 0 `26`26 (*mstk`5Bdepth-1`5D)->dlink == mp)
X`09`09(*mstk`5Bdepth-1`5D)->dlink = NULL;
X`09    free((char *)mp);
X`09`7D
X`09else
X`09    break;
X    `7D
X    free((char *)mstk);
X    return TRUE;
X`7D
X
X
X#define INPUT_FROM_TTGET 1
X#define INPUT_FROM_MAPGETC 2
X
Xstatic ITBUFF *sysmappedchars = NULL;
X
X/* these two wrappers are provided because at least one pcc-based
X`09compiler balks at passing TTgetc or TTtypahead as a function pointer */
X
Xstatic int
Xnormal_getc(void)
X`7B
X`09int c = TTgetc();
X`09TRACE(("normal/getc:%c (%#x)`5Cn", c, c))
X`09return c;
X`7D
X
Xstatic int
Xnormal_typeahead(void)
X`7B
X`09return(TTtypahead());
X`7D
X
Xstatic int
Xnormal_start(void)
X`7B
X`09return TRUE;
X`7D
X
X#define NUMKEYSTR (KBLOCK / 2)
X
Xstatic void
Xsave_keystroke(int c)
X`7B
X`09KILL *kp;
X`09KILLREG *kr = `26kbs`5BKEYST_KREG`5D;
X
X`09if (kr->kbufh == NULL) `7B
X`09`09kr->kbufh = typealloc(KILL);
X`09`09kr->kused = 0;
X`09`7D
X`09if (kr->kbufh == NULL)
X`09`09return;
X
X`09kp = kr->kbuf\0C0Ch;
X`09kp->d_next = NULL;
X
X`09kp->d_chunk`5Bkr->kused++`5D = (UCHAR)c;
X`09if (kr->kused >= NUMKEYSTR * 2) `7B /* time to dump the oldest half */
X`09`09(void)memcpy(
X`09`09`09(char *)(kp->d_chunk),
X`09`09`09(char *)(`26kp->d_chunk`5BNUMKEYSTR / 2`5D),
X`09`09`09NUMKEYSTR / 2);
X`09`09kr->kused = NUMKEYSTR / 2;
X`09`7D
X
X
X`7D
X
X#if DOKEYLOG
Xint do_keylog = 1;
X#endif
X
Xint
Xsysmapped_c(void)
X`7B
X    int c;
X
X    /* still some left? */
X    if (itb_more(sysmappedchars))
X`09return itb_last(sysmappedchars);
X
X    c = TTgetc();
X    TRACE(("mapped/getc:%c (%#x)`5Cn", c, c))
X
X#if DOKEYLOG
X    if (do_keylog) `7B
X`09static int keyfd = -1;
X`09static char *tfilenam;
X`09if (!tfilenam)
X`09`09tfilenam = tempnam("/tmp/vilekeylogs", "vilek");
X`09if (tfilenam) `7B
X`09`09if (keyfd < 0)
X`09`09`09keyfd = open(tfilenam, O_CREAT`7CO_WRONLY, 0600);
X`09`09if (keyfd >= 0)
X`09`09`09write(keyfd, `26c, 1);
X`09`7D
X    `7D
X#endif
X    save_keystroke(c);
X
X    if (suppress_sysmap)
X    `09return c;
X
X    /* will push back on sysmappedchars successful, or not */
X    (void)maplookup(c, `26sysmappedchars, map_syskey,
X    `09`09normal_getc, \0D07typeahead\1209start, TRUE);
X
X    return itb_last(sysmappedchars);
X`7D
X
Xint
Xsysmapped_c_avail(void)
X`7B
X    return itb_more(sysmappedchars) `7C`7C TTtypahead();
X`7D
X
X
Xstatic ITBUFF *mapgetc_ungottenchars = NULL;
Xstatic int mapgetc_ungotcnt = 0;
X
X/* make the assumption that no input will magically appear
X * (un)available to tgetc in between a mapungetc and the next mapgetc.
X * Hence characters can't be ungotten onto the wrong buffer (exception
X * is the last tgot char might be mapungot onto the map buffer.  This
X * is OK (if assumption holds) because the next character will be
X * gotten from this buffer.
X */
X
Xvoid
Xmapungetc(int c)
X`7B
X    if (tgetc_avail()) `7B
X`09tungetc(c);
X    `7D else `7B
X`09(void)itb_append(`26mapgetc_ungottenchars, c);
X`09mapgetc_ungotcnt++;
X    `7D
X`7D
X
Xstatic int infloopcount;
Xstatic int mapgetc_raw_flag;
X
Xstatic int
Xmapgetc(void)
X`7B
X    UINT remapflag;
X    if (global_g_val(GMDREMAP))
X    `09remapflag = 0;
X    else
X    `09remapflag = NOREMAP;
X
X    if (!tgetc_avail() `26`26 mapgetc_ungotcnt > 0) `7B
X`09    if (infloopcount++ > global_g_val(GVAL_MAPLENGTH)) `7B
X`09`09(void)itb_init(`26mapgetc_ungottenchars, abortc);
X`09`09mapgetc_ungotcnt = 0;
X`09`09mlforce("`5BInfinite loop detected in %s sequence`5D",
X`09`09`09    (insertmode) ? "map!" : "map");
X`09`09catnap(1000,FALSE);  /* FIXX: be sure message gets out */
X`09`09return abortc`7CNOREMAP;
X`09    `7D
X`09    mapgetc_ungotcnt--;
X`09    return itb_last(mapgetc_ungottenchars) `7C remapflag;
X    `7D
X    infloopcount = 0;
X    return tgetc(mapgetc_raw_flag);
X`7D
X
Xint
Xmapped_c_avail(void)
X`7B
X    return mapgetc_ungotcnt > 0 `7C`7C tgetc_avail();
X`7D
X
Xint
Xmapped_ungotc_avail(void)
X`7B
X    return mapgetc_ungotcnt > 0;
X`7D
X
Xstatic int
Xmapped_c_start(void)
X`7B
X    return TRUE;
X`7D
X
Xint
Xmapped_c(int remap, int raw)
X`7B
X    int c;
X    int matched;
X    struct maprec *mp;
X    int speckey = FALSE;
X    static ITBUFF *mappedchars = NULL;
X
X    /* still some pushback left? */
X    mapgetc_raw_flag = raw;
X    c = mapgetc();
X
X    if ((c `26 YESREMAP) == 0 `26`26 (!remap `7C`7C (c `26 NO\2106))
X`09return (c `26 `7EREMAPFLAGS);
X
X    c `26= `7EREMAPFLAGS;
X
X    if (reading_msg_line)
X    `09mp = 0;
X    else if (insertmode)
X    `09mp = map_insert;
X    else
X    `09mp = map_command;
X
X    /* if we got a function key from the lower layers, turn it into '#c'
X    `09and see if the user remapped that */
X    if (c `26 SPEC) `7B
X`09mapungetc(kcod2key(c));
X`09c = poundc;
X`09speckey = TRUE;
X    `7D
X
X    do `7B
X`09(void)itb_init(`26mappedchars, abortc);
X
X`09matched = maplookup(c, `26mappedchars, mp, mapgetc, mapped_c_avail\100Bstar
Vt, TRUE);
X
X
X`09while(itb_more(mappedchars))
X`09    mapungetc(itb_next(mappedchars));
X
X`09/* if the user has not mapped '#c', we return the wide code we got
X`09    in the first place.  unless they wanted it quoted.  then we
X`09    leave it as is */
X`09if (!raw `26`26 speckey &0226 !matched) `7B
X`09    c = mapgetc() `26 `7EREMAPFLAGS;
X`09    if (c != poundc)
X`09`09    dbgwrite("BUG: # problem in mapped_c");
X`09    return (mapgetc() `26 `7EREMAPFLAGS) `7C SPEC;
X`09`7D
X
X`09c = mapgetc();
X
X`09if (!global_g_val(GMDREMAPFIRST))
X`09`09matched = FALSE;
X
X`09speckey = FALSE;
X
X    `7D while (matched `26`26
X    `09((remap `26`26 !(c `26 NOREMAP)) `7C`7C (c `26 YES\1308);
X
X    return c `26 `7EREMAPFLAGS;
X
X`7D
X
Xstatic int abbr_curr_off;
Xstatic int abbr_search_lim;
X
Xstatic int
Xabbr_getc(void)
X`7B
X    if (abbr_curr_off <= abbr_search_lim)
X    `09return -1; /* won't match anything in the tree */
X    return lgetc(DOT.l, --abbr_curr_off) `26 0xff;
X`7D
X
Xstatic int
Xabbr_c_avail(void)
X`7B
X    return TRUE;
X`7D
X
Xstatic int
Xabbr_c_start(void)
X`7B
X    if (abbr_curr_off > abbr_search_lim) `7B
X`09/* we need to check the char in front of the match.
X`09   if it's a similar type to the first char of the match,
X`09   i.e. both idents, or\1006non-\1408we do nothing.
X`09   if whitespace precedes either ident or non-ident, the
X`09   match is good.
X`09 */
X`09char first, prev;
X`09first = lgetc(DOT.l,abbr_curr_off);
X`09prev = lgetc(DOT.l,abbr_curr_off-1);
X`09if ((isident(first) `26`26 \1208prev)) `7C`7C
X`09    (!isident(first) `26`26 !(\1408prev) `7C`7C isSpace\1106))) `7B
X`09`09return FALSE;
X`09`7D
X    `7D
X    return TRUE;
X`7D
X
Xvoid
Xabbr_check(int *backsp_limit_p)
X`7B
X    int matched;
X    ITBUFF *abbr_chars = NULL;
X    int status = TRUE;
X
X    if (llength(DOT.l) < 1)
X    `09return;
X    abbr_curr_off = DOT.o;
X    abbr_search_lim = *backsp_limit_p;
X    (void)itb_init(`26abbr_chars, abortc);
X    matched = maplookup(abbr_getc(), `26abbr_chars, abbr_map,
X    `09abbr_getc, abbr_c_avail\0E09start, FALSE);
X
X
X    if (matched) `7B
X`09    /* there are still some conditions that have to be met by
X`09       the preceding chars, if any */
X`09    if (!abbr_c_start()) `7B
X`09`09itb_free(`26abbr_chars);
X`09    `09return;
X`09    `7D
X`09    DOT.o -= matched;
X`09    ldelete((B_COUNT)matched, FALSE);
X`09    while(status `26`26 itb_more(abbr_chars))
X`09`09status = inschar(itb_last(abbr_chars), backsp_limit_p);
X    `7D
X    itb_free(`26abbr_chars);
X    return;
X`7D
X
X/* do map tranlations.
X`09C is first char to begin mapping on
X`09OUTP is an ITBUFF in which to put the result
X`09MP is the map in which to look
X`09GET is a routine to use to get the next character
X`09AVAIL is the routine that tells if GET can return something now
X  returns number of characters matched
X*/
Xstatic int
Xmaplookup(
X    int c,
X    ITBUFF **outp,
X    struct maprec *mp,
X    GetFunc get,
X    AvailFunc avail,
X    StartFunc start,
X    int suffix)
X`7B
X    struct maprec *rmp = NULL;
X    ITBUFF *unmatched = 0;
X    int matchedcnt;
X    int use_sys_timing;
X    int had_start = FALSE;
X    register int count = 0;`09/* index into 'unmatched`5B`5D' */
X
X    /*
X     * we don't want to delay for a user-specified :map!  starting with
X     * poundc since it's likely that the mapping is happening on behalf of
X     * a function key.  (it's so the user can ":map! #1 foobar" but still be
X     * able to insert a '#' character normally.)  if they've changed poundc
X     * so it's not something one normally inserts, then\2E06okay to delay
X     * on it.
X     */
X    use_sys_timing = (insertmode `26`26 c == poundc &0226
X    `09`09&0209(isPrint(poundc) `7C`7C isSpace\1308));
X
X    unmatched = itb_init(`26\1609, 0);
X    itb_append(`26unmatched, c);
X    count++;
X
X    matchedcnt = 0;
X    while (mp != 0) `7B
X`09if (c == mp->ch) `7B
X`09    if (mp->irv != -1 `7C`7C mp->s\1106NULL) `7B
X`09`09rmp = mp;
X`09`09matchedcnt += count;
X`09`09unmatched = itb_init(`26\1609, 0);
X`09`09count = 0;
X
X`09`09/* our code supports matching the longer of two maps one of
X`09`09 * which is a subset of the other.  vi matches the shorter
X`09`09 * one.
X`09`09 */
X`09        if ((*start)()) `7B
X`09`09    had_start = TRUE;
X`09`09    if (!global_g_val(GMDMAPLONGER)) `7B
X`09`09`09break;
X`09`09    `7D
X`09`09`7D
X`09    `7D
X
X`09    mp = mp->dlink;
X
X`09    if (!mp)
X`09`09break;
X
X`09    /* if there's no recorded input, and no user typeahead */
X`09    if (!(*avail)()) `7B
X
X`09`09/* give it a little extra time... */
X`09`09int timer = 0;
X
X`09`09/* we want to use the longer of the two timers */
X
X`09`09/* get the user timer.  it may be zero */
X`09`09if (!use_sys_timing `26`26 (mp->flags `26 MAPF_USERTIMER) != 0)
X`09`09`09timer = global_g_val(GVAL_TIMEOUTUSERVAL);
X
X`09`09/* if there was no user timer, or this is a system
X`09`09`09sequence, use the system timer if it's bigger */
X`09`09if (timer == 0 `7C`7C (mp->flags `26 MAPF_SYSTIMER) != 0) `7B
X`09`09`09if (timer < global_g_val(GVAL_TIMEOUTVAL))
X`09`09&0209timer = global_g_val(GVAL_TIMEOUTVAL);
X`09`09`7D
X
X`09`09catnap(timer,TRUE);
X
X`09`09if (!(*avail)())
X`09`09    break;
X`09    `7D
X
X`09    if ((c = (*get)()) < 0)
X`09`09break;
X
X`09    itb_append(`26unmatched, c `26 `7EREMAPFLAGS);
X`09    count++;
X
X`09`7D
X`09else
X`09    mp = mp->flink;
X    `7D
X
X    if (had_start `26`26 (rmp != 0)) `7B
X`09/* unget the unmatched suffix */
X`09while (suffix `26`26 (count > 0))
X`09    (void)itb_append(outp, itb_values(unmatched)`5B--count`5D);
X`09/* unget the mapping and elide correct number of recorded chars */
X`09if (rmp->srv) `7B
X`09    UINT remapflag;
X`09    char *cp;
X`09    /* cp = rmp->srv + cnt; */
X`09    for (cp = rmp->srv; *cp; cp++)
X`09    `09;
X`09    if (rmp->flags `26 MAPF_NOREMAP)
X`09`09remapflag = NOREMAP;
X`09    else
X`09`09remapflag = 0;
X`09    while (cp > rmp->srv)
X`09`09(void)itb_append(outp, char2int(*--cp)`7Cremapflag);
X`09`7D
X`09else `7B
X`09    (void)itb_append(outp, rmp->irv);
X`09`7D
X    `7D
X    else `7B`09/* didn't find a match */
X`09while (count > 0)
X`09    (void)itb_append(outp, itb_values(unmatched)`5B--count`5D);
X`09matchedcnt = 0;
X    `7D
X    itb_free(`26unmatched);
X    return matchedcnt;
X`7D
X
X#if NO_LEAKS
Xstatic void
Xfree_maprec(struct \0E06 **p)
X`7B
X`09struct`09maprec *q;
X`09if ((q = *p) != 0) `7B
X`09`09free_maprec(`26(q->flink));
X`09`09free_maprec(`26(q->dlink));
X`09`09FreeAndNull(q->srv);
X`09`09*p = 0;
X`09`09free((char *)q);
X`09`7D
X`7D
X
Xvoid
Xmap_leaks(void)
X`7B
X`09free_maprec(`26map_command);
X`09free_maprec(`26map_insert);
X`09free_maprec(`26map_syskey);
X`09free_maprec(`26abbr_map);
X`7D
X#endif`09/* NO_LEAKS */
$ call unpack [.VILE-8_0]MAP.C;1 -
 1093393834 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 45 69 152
$!
$ create 'f'
X/********\0808\1010\2020\4008/
X/*  File        : menu.c\1008\1808\1010\2010*/
X/*  Description : Implement a Motif MenuBar into Mxvile        \0808 */
X/*        \0808Parse a File (environment variable XVILE_MENU)\3E08*/
X/*        \0808and create it at the top of the window\3610*/
X/*  Auteur      : Philippe CHASSANY\1906\1F06\0C0C\180D*/
X/*  Date        : 20/02/97\1208\1A08\1010\200E*/
X/********\0808\1010\2020\4008/
X
X/*
X * $Header: /usr/build/vile/vile/RCS/menu.c,v 1.20 1998/05/30 12:23:16 tom Exp
V $
X */
X
X#define NEED_X_INCLUDES 1
X
X/* Vile includes */
X#include "estruct.h"
X#include "edef.h"
X
X#if DISP_X11
X
X#if MOTIF_WIDGETS
X#include <Xm/MainW.h>
X#include <Xm/CascadeB.h>
X#include <Xm/SeparatoG.h>
X#include <Xm/PushBG.h>
X#include <Xm/ToggleB.h>
X#endif
X
X#if ATHENA_WIDGETS
X#include <X11/Xaw/Form.h>
X#include <X11/Xaw/SimpleMenu.h>
X#include <X11/Xaw/MenuButton.h>
X#include <X11/Xaw/SmeLine.h>
X#include <X11/Xaw/SmeBSB.h>
X#endif
X
X/* Locals */
X#define MAX_ITEM_MENU_LIST  50
Xstatic int nb_item_menu_list = 0;
Xstatic Widget pm_buffer `5BMAX_ITEM_MENU_LIST`5D;
Xstatic Widget cascade;
X
X/* Tokens of the rc file */
X#define MAX_TOKEN   200
Xstruct  _tok_
X`7B
X    char    type;
X    int     idx_cascade;
X    char    libelle `5BNSTRING`5D;
X    char    action  `5BNSTRING`5D;
X    int     macro;
X`7D Token `5BMAX_TOKEN`5D;
Xint Nb_Token;
X
X/* Actions of the rc file */
Xtypedef void (*ActionFunc) ( char * );
X
Xtypedef struct
X`7B
X    char        \0808name `5B30`5D;
X    const   ActionFunc  fact;
X
X`7D TAct;
X
X/* Common Actions = User defined\1709*/
X/* Why not use dynamic link library to get functions ? */
Xstatic void common_action ( char *\0F07);
Xstatic TAct Actions `5B`5D = `7B
X    `7B "nop",            0 `7D,
X    `7B "new_xvile",      common_action `7D,
X    `7B "edit_rc",        common_action `7D,
X    `7B "parse_rc",       common_action `7D,
X    `7B "edit_mrc",       common_action `7D,
X`7D;
Xint Nb_Actions = sizeof(\1107)/\1007TAct);
X
X
Xstatic char *
Xmenu_filename(void)
X`7B
X        static char default_menu`5B`5D = ".vilemenu";
X        char *menurc = getenv ("XVILE_MENU");
X
X        if (menurc == NULL `7C`7C *\130AEOS)
X        \0808menurc = default_menu;
X
X        return flook(menurc, FL_ANYWHERE`7CFL_READABLE);
X`7D
X
Xstatic char *
Xstartup_filename(void)
X`7B
X        return flook(startup_file, FL_ANYWHERE`7CFL_READABLE);
X`7D
X
X/********\0808\1010\2020\4008/
X/* All the Common Action are pointed to this fun\1D06       \0808   */
X/********\0808\1010\2020\4008/
Xstatic void common_action ( char *\0F07)
X`7B
X    TRACE(("Action=%s`5Cn", action));
X
X    if (!strcmp(action, "new_xvile"))
X    `7B
X        int pid;
X        int status;
X        char path`5BNFILEN`5D;
X
X        lsprintf(path, "%s/%s", exec_pathname, prog_arg);
X
X        if ((pid = fork()) > 0) `7B
X            while (wait(`26status) >= 0)
X        \0808;
X        `7D else if (pid == 0) `7B
X            if ((pid = fork()) > 0) `7B
X        \0808_exit(0);\1907/* abandon exec'ing process */
X            `7D else if (pid == 0) `7B
X        \0808newprocessgroup(FALSE, 1);
X        \0808execl (path, "xvile", NULL, 0);
X        \0808_exit(errno);   /* just in case exec-failed */
X            `7D
X        `7D
X    `7D
X    else
X    if (!strcmp(action, "edit_rc"))
X    `7B
X        splitwind(FALSE, 1);
X        getfile (startup_filename(), TRUE);
X    `7D
X    else
X    if (!strcmp(action, "parse_rc"))
X    `7B
X        dofile (startup_filename());
X    `7D
X    else
X    if (!strcmp(action, "edit_mrc"))
X    `7B
X        splitwind(FALSE, 1);
X
X        getfile (menu_filename(), TRUE);
X    `7D
X`7D
X
X/********\0808\1010\2020\4008/
X/* Test if the action name is part o\1B06Actions \0F07rc file        */
X/********\0808\1010\2020\4008/
Xstatic int
Xis_action ( char *\0F07)
X`7B
X    int i;
X
X    for (i=0; i<Nb_Actions; i++)
X    `7B
X        if (!strcmp(Actions`5Bi`5D.name, action))
X            return 1;
X    `7D
X
X    return 0;
X`7D
X
X/********\0808\1010\2020\4008/
X/* Return the function pointer associated with the a\2306name          */
X/********\0808\1010\2020\4008/
Xstatic ActionFunc
Xget_action_fonc ( char *\1406 )
X`7B
X    int i;
X
X    for (i=0; i<Nb_Actions; i++)
X    `7B
X        if (!strcmp(Actions`5Bi`5D.name, action))
X            return Actions`5Bi`5D.fact;
X    `7D
X
X    return 0;
X`7D
X
X/********\0808\1010\2020\4008/
X/* Test if the action name is a bind (inspired from vile sources        */
X/********\0808\1010\2020\4008/
Xstatic int
Xis_bind ( char *action )
X`7B
X    char tok`5BNSTRING`5D;
X    (void) token(action, tok, EOS);
X    if (engl2fnc(tok) != NULL)
X        return 1;
X
X    return 0;
X`7D
X
X/********\0808\1010\2020\4008/
X/* Test if the action name begins with the keyword "cmd",        \0807*/
X/********\0808\1010\2020\4008/
Xstatic char *
Xis_cmd ( char *action )
X`7B
X    char tok`5BNSTRING`5D;
X    char *result = (\1006)token(action, tok, EOS);
X    if (!strcmp(tok, "cmd"))
X        return result;
X
X    return 0;
X`7D
X
X/********\0808\1010\2020\4008/
X/* Main function to parse the rc file        \0808\1010   */
X/********\0808\1010\2020\4008/
Xint parse_menu ( const char *rc_filename )
X`7B
X    FILE    *fp;
X    char    line `5B1000`5D;
X    char    *ptr_tok;
X    int     n, tmp;
X    int     cascade_token = 0;
X    int     nlig = 0;
X
X    if ((fp = fopen(rc_filename, "r")) == NULL)
X        return FALSE;
X
X    Nb_Token = 0;
X    while (fgets (line, sizeof(line), fp) != NULL)
X    `7B
X        nlig++;
X
X        /* Let a tab begin inline comment */
X        if ((ptr_tok = strchr(line, '`5Ct')) != 0)
X        \0808*ptr_tok = EOS;
X
X        ptr_tok = strtok(line, ":");
X        if (ptr_tok == NULL)
X            continue;
X
X        switch (*ptr_tok)
X        `7B
X        case ';': /* FALLTHRU */
X        case '#':
X        \0808continue;
X
X        case 'C':
X        \0808Token`5BNb_Token`5D.type = *ptr_tok;
X        \0808if ((ptr_tok = strtok(NULL, ":`5Cn")) != NULL)
X        \0808`7B
X        \0808    strcpy(Token`5BNb_Token`5D.libelle, ptr_tok);
X        \0808    cascade_token = Nb_Token;
X        \0808    if ((ptr_tok = strtok(NULL, ":`5Cn")) != NULL)
X        \0808    `7B
X        \0808\1008Token`5BNb_Token`5D.type = 'H';
X        \0808    `7D
X        \0808    Nb_Token++;
X        \0808`7D
X        \0808else
X        \0808`7B
X        \0808    fclose (fp);
X        \0808    return FAILED;
X        \0808`7D
X        \0808break;
X
X        case 'S':
X        \0808Token`5BNb_Token`5D.type = *ptr_tok;
X        \0808Token`5BNb_Token`5D.idx_cascade = \0A07_token;
X        \0808Nb_Token++;
X        \0808break;
X
X        case 'L':
X        \0808Token`5BNb_Token`5D.type = 'S';
X        \0808Token`5BNb_Token`5D.idx_cascade = \0A07_token;
X        \0808Nb_Token++;
X        \0808Token`5BNb_Token`5D.type = *ptr_tok;
X        \0808Token`5BNb_Token`5D.idx_cascade = \0A07_token;
X        \0808if ((ptr_tok = strtok(NULL, ":`5Cn")) != NULL)
X        \0808`7B
X        \0808    strcpy(Token`5BNb_Token`5D.action, ptr_tok);
X        \0808    cascade_token = Nb_Token;
X        \0808`7D
X        \0808Nb_Token++;
X        \0808break;
X
X        case 'B':
X        \0808Token`5BNb_Token`5D.type = *ptr_tok;
X        \0808Token`5BNb_Token`5D.idx_cascade = \0A07_token;
X        \0808n = 0;
X        \0808while ((ptr_tok = strtok(NULL, ":`5Cn")) != NULL)
X        \0808`7B
X        \0808    switch (n)
X        \0808    `7B
X        \0808    case 0:
X        \0808\1008strcpy(Token`5BNb_Token`5D.libelle, ptr_tok);
X        \0808\1008break;
X        \0808    case 1:
X        \0808\1008if (isDigit((int)*ptr_tok))
X        \0808\1008`7B
X        \0808\100Ctmp = (int)atoi(ptr_tok);
X        \0808\100CToken`5BNb_Token`5D.macro = tmp;
X        \0808\1008`7D
X        \0808\1008else
X        \0808\1008`7B
X        \0808\100Cif (is_action(ptr_tok)
X        \0808\100D`7C`7C is_bind(ptr_tok)
X        \0808\100D`7C`7C is_cmd(ptr_tok))
X        \0808\100C`7B
X        \0808\1010strcpy(Token`5BNb_Token`5D.action, ptr_tok);
X        \0808\100C`7D
X        \0808\100Celse
X        \0808\100C`7B
X        \0808\1010printf("Error in line %d : '%s' is not an action`5Cn",
X        \0808\1010\200Cnlig, ptr_tok);
X        \0808\1010strcpy(Token`5BNb_Token`5D.action, "beep");
X        \0808\100C`7D
X        \0808\1008`7D
X        \0808\1008break;
X        \0808    `7D
X        \0808    n++;
X        \0808`7D
X        \0808if (n != 2)
X        \0808`7B
X        \0808    fclose (fp);
X        \0808    return FAILED;
X        \0808`7D
X        \0808Nb_Token++;
X        \0808break;
X        `7D
X    `7D
X    fclose (fp);
X
X    return TRUE;
X`7D
X
X/********\0808\1010\2020\4008/
X/* Debug function to print the  tokens of the rc file        \0808   */
X/********\0808\1010\2020\4008/
X#if OPT_TRACE
Xstatic void
Xprint_token (void)
X`7B
X    int     i;
X
X    for (i=0; i<Nb_Token; i++)
X    `7B
X        switch (Token`5Bi`5D.type)
X        `7B
X        case 'C':
X        case 'H':
X            Trace("%c %s`5Cn",
X        \0808\1008Token`5Bi`5D.type,
X        \0808\1008Token`5Bi`5D.libelle);
X            break;
X        case 'S':
X            Trace("`5Ct%c (%s)`5Cn",
X        \0808\1008Token`5Bi`5D.type,
X        \0808\1008Token`5B\0606i`5D.idx_cascade`5D.libelle);
X            break;
X        case 'L':
X            Trace("`5Ct%c %s`5Cn",
X        \0808\1008Token`5Bi`5D.type,
X        \0808\1008Token`5Bi`5D.action);
X            break;
X        case 'B':
X            if (Token`5Bi`5D.macro > 0)
X        \0808Trace("`5Ct%c %s(%s) -> Macro-%d`5Cn",
X        \0808\1008Token`5Bi`5D.type,
X        \0808\1008Token`5Bi`5D.libelle,
X        \0808\1008Token`5B\0606i`5D.idx_cascade`5D.libelle,
X        \0808\1008Token`5Bi`5D.macro);
X            else
X        \0808Trace("`5Ct%c %s(%s) -> Action-%s`5Cn",
X        \0808\1008Token`5Bi`5D.type,
X        \0808\1008Token`5Bi`5D.libelle,
X        \0808\1008Token`5B\0606i`5D.idx_cascade`5D.libelle,
X        \0808\1008Token`5Bi`5D.action);
X        `7D
X    `7D
X`7D
X#endif
X
X/********\0808\1010\2020\4008/
X/* Motif function to make a cascade button into a menubar        \0807*/
X/********\0808\1010\2020\4008/
Xstatic Widget do_cascade (\1408menub, char *nom, int the_class )
X`7B
X#if MOTIF_WIDGETS
X    Widget      pm;
X    XmString    xms;
X    char        str `5B50`5D;
X
X    sprintf(str, "%sMenu", nom);
X    pm = (Widget) XmCreatePulldownMenu (menub, str, NULL, 0);
X
X    xms = XmStringCreateSimple (nom);
X
X    cascade = XtVaCreateManagedWidget ("menuHeader",
X        \0808xmCascadeButtonWidgetClass,     menub,
X        \0808XmNlabelString,\1F09xms,
X        \0808XmNsubMenuId,\1D0Bpm,
X        \0808NULL);
X    XmStringFree (xms);
X
X    if (the_class == 'H')
X    `7B
X        XtVaSetValues (menub,
X            XmNmenuHelpWidget,  cascade,
X            NULL);
X    `7D
X    return pm;
X#endif /* MOTIF_WIDGETS */
X#if ATHENA_WIDGETS
X    static      Widget last;
X    Widget      pm;
X    String      str = XtMalloc(strlen(nom) + 10);
X
X    sprintf(str, "%sMenu", nom);
X    pm = XtVaCreatePopupShell (str,
X        simpleMenuWidgetClass,
X        menub,
X        XtNgeometry,\1408\1C08    NULL,
X        NULL);
X
X    cascade = XtVaCreateManagedWidget ("menuHeader",
X        menuButtonWidgetClass,
X        menub,
X        XtNheight,\1208\1A08\2206x_menu_\2406(),
X        XtNlabel,\1108\1908\2107nom,
X        XtNfromHoriz,\1508\1D08   last,
X        XtNmenuName,\1408\1C08    str,
X        NULL);
X    last = cascade;
X
X    return pm;
X#endif /* ATHENA_WIDGETS */
X`7D
X
X/********\0808\1010\2020\4008/
X/* Motif function to make a button into a cascade (with accelarator)    */
X/********\0808\1010\2020\4008/
Xstatic Widget do_button (\1308pm, char *no\0B09accel, int the_class )
X`7B
X#if MOTIF_WIDGETS
X    Widget      w;
X    XmString    xms_accl;
X    XmString    xms_name;
X    WidgetClass wc;
X
X    switch (the_class) `7B
X        case 'S':
X            wc = xmSeparatorGadgetClass;
X            break;
X        case 'B':
X            wc = xmPushButtonGadgetClass;
X            break;
X    `7D
X
X    if (accel != NULL)
X        xms_accl = XmStringCreateSimple (accel);
+-+-+-+-+-+-+-+-  END  OF PART 71 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 72 -+-+-+-+-+-+-+-+
X    else
X        xms_accl = XmStringCreateSimple ("");
X
X    xms_name = XmStringCreateSimple (nom);
X    w = XtVaCreateManagedWidget ("menuEntry",
X        \0808wc,
X        \0808pm,
X        \0808XmNacceleratorText,     xms_accl,
X        \0808XmNlabelString,\1F09xms_name,
X        \0808NULL);
X
X    XmStringFree (xms_accl);
X    XmStringFree (xms_name);
X
X    return w;
X#endif /* MOTIF_WIDGETS */
X#if ATHENA_WIDGETS
X    Widget      w;
X
X    w = XtVaCreateManagedWidget ("menuEntry",
X        \0808(the_class == 'B') ? smeBSBObjectClass : smeLine\150B,
X        \0808pm,
X        \0808XtNlabel,\190Fnom,
X        \0808NULL);
X
X    return w;
X#endif /* ATHENA_WIDGETS */
X`7D
X
X/********\0808\1010\2020\4008/
X/* Function called when a button is clicked into the menu        \0807*/
X/* Bind and Action are tested        \0808\1010\200B*/
X/********\0808\1010\2020\4008/
Xstatic void proc_back ( Widget w GCC_UNUSED, XtPointer arg\0F0Ccall \2B0B)
X`7B
X    char    *macro_action = (char *)arg;
X    ActionFunc fact;
X    int     oldflag = im_waiting(-1);
X    int     exec_flag = TRUE;
X    char    *s;
X
X    TRACE(("Macro/Action=%s`5Cn", macro_action));
X
X    if ((s = is_cmd(macro_action)) != 0)
X    `7B
X        macro_action = s;
X        exec_flag = FALSE;
X    `7D
X
X    if (is_bind (macro_action))
X    `7B
X        docmd (macro_action, exec_flag, FALSE, 1);
X    `7D
X    else
X    `7B
X        /* Action predefined */
X        fact = get_action_fonc (macro\1307);
X        if (fact == NULL)
X            return;
X        fact(macro_action);
X    `7D
X
X    (void)im_waiting(oldflag);
X    (void)update(TRUE);
X`7D
X
X/********\0808\1010\2020\4008/
X/* Function called when a buffer button is clicked into the menu        */
X/* A buffer button takes part from the list tokens (L)        \0808  */
X/********\0808\1010\2020\4008/
Xstatic void list_proc_back ( Widget w, XtPointer bname\110Ccall GCC_UNUSED )
X`7B
X    int     num_buff;
X    int     oldflag = im_waiting(-1);
X
X#if MOTIF_WIDGETS
X    char *accel;
X    XmString xms;
X    XtVaGetValues (w, XmNacceleratorText, `26xms, NULL);
X#ifndef XmFONTLIST_DEFAULT_TAG
X#define XmFONTLIST_DEFAULT_TAG "\1816_STRING"
X#endif
X    XmStringGetLtoR (xms,  XmFONTLIST_DEFAULT_TAG, `26accel);
X    num_buff = atoi(`26accel`5B1`5D);
X#endif
X#if ATHENA_WIDGETS
X    num_buff = (int)bname;
X#endif
X
X    (void)histbuff(TRUE, num_buff);
X    (void)im_waiting(oldflag);
X    (void)update(TRUE);
X`7D
X
Xstatic void add_callback(Widget w, XtC\1507Proc function, XtPointer closure)
X`7B
X#if MOTIF_WIDGETS
X    XtAddCallback (w, XmNactivate\1808, function, closure);
X#endif
X#if ATHENA_WIDGETS
X    XtAddCallback (w, XtNc\1007, function, closure);
X#endif /* ATHENA_WIDGETS */
X`7D
X
X/********\0808\1010\2020\4008/
X/* Function called when the cascade containing the List (buffers)       */
X/* is clicked => Post the PullDown associated        \0808\100B*/
X/* It's dirty ...        \0808\1010\2017*/
X/********\0808\1010\2020\4008/
Xstatic void post_buffer_list ( Widget w GCC_UNUSED, XtPointer client\1D0EEvent
V *ev\340DBoolean *ok \4D0B)
X`7B
X    int     i, n=nb_item_menu_list;
X    BUFFER  *bp;
X    char    string`5BNBUFN+2+NFILEN`5D, temp`5B1\100A*p;
X    Widget  pm = (\0E06) client;
X
X    TRACE(("post_buffer_list`5Cn"));
X    nb_item_menu_list = 0;
X
X    for_each_buffer(bp)
X    `7B
X        if (b_is_temporary(bp)) /* cf: hist_show() */
X            continue;
X
X        p = shorten_path(strcpy(temp, bp->b_fname), FALSE);
X        sprintf(string, "%-*.*s %s", NBUFN-1\0909,
X        \0808bp->b_bname, p);
X
X        sprintf(temp, "_%d", nb_item_menu_list);
X        TRACE(("ACCEL(%s) = %s`5Cn", temp, string));
X
X        if (pm_buffer `5Bnb_item_menu_list`5D == NULL)
X        `7B
X            pm_buffer `5Bnb_item_menu_list`5D = do_button (pm, string, temp, '
VB');
X        `7D
X        else
X        `7B
X#if MOTIF_WIDGETS
X            XmString xms =\0F09CreateSimple (string);
X            XtVaSetValues (pm_buffer `5Bnb_item_menu_list`5D,
X        \0808\1008XmNlabelString, xms, NULL);
X            XmStringFree (xms);
X            XtRemoveCallback (pm_buffer`5Bnb_item_menu_list`5D,
X        \0808\100EXmNactivateCallback, list_proc_\1006NULL);
X#endif
X#if ATHENA_WIDGETS
X            XtVaSetValues (pm_buffer `5Bnb_item_menu_list`5D,
X        \0808\1008XtNlabel, string, NULL);
X            XtRemoveAllCallbacks (pm_buffer`5Bnb_item_menu_list`5D,
X        \0808\1008XtNcallback);
X#endif
X        `7D
X
X#if MOTIF_WIDGETS
X        XtAddCallback (pm_buffer`5Bnb_item_menu_list`5D,
X        \0808\1008XmNactivateCallback,
X        \0808\1008list_proc_back,
X        \0808\1008NULL);
X#endif
X#if ATHENA_WIDGETS
X        XtAddCallback (pm_buffer`5Bnb_item_menu_list`5D,
X        \0808\1008XtNcallback,
X        \0808\1008list_proc_back,
X        \0808\1008(XtPointer)nb_item_menu_list);
X#endif
X        nb_item_menu_list++;
X    `7D
X    for (i=nb_item_menu_list; i<n; i++)
X    `7B
X        XtDestroyWidget (pm_buffer`5Bi`5D);
X        pm_buffer`5Bi`5D = NULL;
X    `7D
X
X#if MOTIF_WIDGETS
X    XmUpdateDisplay(pm);
X#endif
X`7D
X
X/********\0808\1010\2020\4008/
X/* Main function : Take the MotifBar as argument and create all the     */
X/* Cascades, PullDowns Menus and Buttons read from the rc file          */
X/********\0808\1010\2020\4008/
Xvoid do_menu ( Widget menub )
X`7B
X    int     i, n = 0;
X    char    *arg, *accel, *macro;
X    Widget  pm = 0;
X    Widget  pm_w `5B50`5D;
X    int     rc;
X    char   *menurc = menu_filename();
X
X    if ((rc = parse_menu (menurc)) != TRUE)
X    `7B
X        if (rc == FAILED)
X            puts ("Error parsing menu-file");
X        return;
X    `7D
X#if OPT_TRACE
X    print_token();
X#endif
X
X    for (i=0; i<Nb_Token; i++)
X    `7B
X        switch (Token`5Bi`5D.type)
X        `7B
X        /* HELP CASCADE */
X        case 'C':
X        case 'H':
X            pm = do_cascade (menub, Token`5Bi`5D.libelle\120Btype);
X            n = 0;
X            break;
X
X        /* SEPARATOR WIDGET */
X        case 'S':
X            do_button (pm, "sep", NULL, Token`5Bi`5D.type);
X            break;
X
X        /* LIST (BUFFER LIST) */
X        case 'L':
X            if (!strcmp(Token`5Bi`5D.action, "list_buff")
X             `26`26 cascade != 0)
X            `7B
X        \0808XtAddEventHandler (cascade,
X        \0808\1008ButtonPressMask, False, post_buffer_list, pm);
X            `7D
X            break;
X
X        /* BUTTON WIDGET */
X        case 'B':
X            if (Token`5Bi`5D.macro > 0)
X            `7B
X        \0808macro = castalloc(char,50);
X        \0808sprintf(macro, "execute-macro-%d", Token`5Bi`5D.macro);
X        \0808accel = give_accelerator (macro);
X        \0808pm_w`5Bn`5D = do_button (pm, Token`5Bi`5D.libelle, accel\190Btype
V);
X
X        \0808arg = castalloc(char,10);
X        \0808sprintf(arg, "%d", Token`5Bi`5D.macro);
X        \0808add_callback (pm_w`5Bn`5D, proc_back, macro);
X            `7D
X            else
X            `7B
X        \0808accel = give_accelerator (Token`5Bi`5D.action);
X        \0808pm_w`5Bn`5D = do_button (pm, Token`5Bi`5D.libelle, accel\190Btype
V);
X        \0808add_callback (pm_w`5Bn`5D, proc_back, Token`5Bi`5D.action);
X            `7D
X            n++;
X            break;
X        `7D
X    `7D
X
X    for (i=0; i<MAX_ITEM_MENU_LIST; i++)
X        pm_buffer`5Bi`5D = NULL;
X`7D
X/********\0808\1010\2020\4008/
X
X#endif /* DISP_X11 */
$ call unpack [.VILE-8_0]MENU.C;1 -
 907440560 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 44 70 152
$!
$ create 'f'
X#!/bin/sh
X# mkinstalldirs --- make directory hierarchy
X# Author: Noah Friedman <f\0A07@prep.ai.mit.edu>
X# Created: 1993-05-16
X# Last modified: 1994-03-25
X# Public domain
X#
X# $Header: /usr2/foxharp/src/pgf/vile/RCS/mkdirs.sh,v 1.2 1994/07/11 22:56:20
V pgf Exp $
X#
X
Xerrstatus=0
X
Xfor file in $`7B1+"$@"`7D ; do`20
X   set fnord `60echo ":$file" `7C sed -ne 's/`5E:`5C//#/;s/`5E://;s/`5C// /g;s
V/`5E#/`5C//;p'`60
X   shift
X
X   pathcomp=
X   for d in $`7B1+"$@"`7D ; do
X     pathcomp="$\0B08$d"
X     case "$pathcomp" in
X       -* ) pathcomp=./$\0C08 ;;
X     esac
X
X     if test ! -d "$pathcomp"; then
X        echo "mkdir $pathcomp" 1>`262
X        mkdir "$pathcomp" `7C`7C errstatus=$?
X     fi
X
X     pathcomp="$\0B08/"
X   done
Xdone
X
Xexit $errstatus
X
X# mkinstalldirs ends here
$ call unpack [.VILE-8_0]MKDIRS.SH;1 -
 3100708 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 2 71 152
$!
$ create 'f'
X# mkprlenv.wnt`20
X#
X# Purpose
X# =======
X# A makefile included by\1509.wnt when embedding perl in `5Bwin`5Dvile.exe .
X# This particular makefile determines where perl has been installed in the
X# user's Win32 environment and copies win32-compat scripts to a directory
X# "known" to vile.  Scripts are copied from this directory:
X#
X#     .`5Cperl
X#
X# to this directory:
X#
X#     %VILE_LIBRARY_PATH%`5Cperl
X#
X# Preconditions:
X# ========\0806
X# 1) Installation of the `5Bbinary`5D perl Win32 port located at this URL:
X#
X#         http://www.perl.com/CPAN-local/ports/win32/Standard/x86/
X#
X# 2) The environment variable VILE_LIBRARY_PATH points to a writable
X#    "root" directory where vile's perl scripts will be installed.
X#
X# Supported Vile-Based Perl Scripts
X# ========\0808\1010=
X# Consult the macro $(PERL_SCRIPTS) in the file makefile.wnt to ascerta\2306
X# current list of vile-based perl scripts known to work in a Win32 environment
V.
X#
X# $Header: /usr/build/vile/vile/RCS/mkprlenv.wnt,v 1.2 1998/05/23 21:21:00 cmo
Vrgan Exp $
X#
X    perl <<
X        foreach $$dir (@INC)
X        `7B
X            $$lib="$$dir`5C`5CCORE&025Cperl.lib";
X            last if (-f $$lib);
X           `20
X        `7D
X        if (! $$lib)
X        `7B
X            print "error: cannot determine location of perl.lib`5Cn";
X#
X#           Force nmake to abort.
X#
X            exit(1);
X        `7D
X        foreach $$dir (@INC)
X        `7B
X            $$inc="$$dir`5C`5CCORE";
X            last if (-f "$$inc`5C`5Cperl.h");
X           `20
X        `7D
X        if (! $$inc)
X        `7B
X            print "error: cannot determine location of perl.h`5Cn";
X            exit(1);
X        `7D
X        foreach $$dir (@INC)
X        `7B
X            $$utils="$$dir`5C`5CExtUtils";
X            last if (-d $$utils);
X        `7D
X        if (! $$utils)
X        `7B
X            print`20
X        \0807"error: cannot determine location of perl external utilities`5Cn"
V;
X            exit(1);
X        `7D
X        print`20
X "Checking existence of directory specified by VILE_LIBRARY_PATH env var...`5C
Vn";
X        $$root_dir=$$ENV`7B"VILE_LIBRARY_PATH"`7D;
X        if (! $$root_dir)
X        `7B
X            print "error: Environment var VILE_LIBRARY_PATH does not exist`5Cn
V";
X            print "error: Refer to the file 'mkprlenv.wnt' for further info`5C
Vn";
X            exit(1);
X        `7D
X        else
X        `7B
X            if (-f $$root_dir)
X            `7B
X        \0808print "error: $$root_dir is a file!`5Cn";
X        \0808exit(1);
X            `7D
X            elsif (! -d $$root_dir)
X            `7B
X        \0808print "error: `5C"$$root_dir`5C" is not a directory`5Cn";
X        \0808exit(1);
X            `7D
X            else
X            `7B
X#        \0807User specified a directory that exists.  First, strip`20
X#        \0807trailing dos/unix path delimiters from dir.
X#
X        \0808$$root_dir =`7E s!`5C`5C$$!!;
X        \0808$$root_dir =`7E s!/$$!!;
X#
X#        \0807Warp unix path delimiters to backslash (to be compatible
X#        \0807with the DOS COPY command).
X#
X        \0808$$root_dir =`7E s@/@`5C`5C@g;
X#
X#        \0807The user's writable directory must have a sub\1909
X#        \0807called "perl".  Create if it doesn't exist.
X        \0808$$script_dir = $$roo\0D06. "`5C`5Cperl";
X        \0808if (-f $$script_dir)
X        \0808`7B
X        \0808    print`20
X        \0808"error: script destination directory $$\1F06_dir is a file!`5Cn";
V
X        \0808    exit(1);
X        \0808`7D
X        \0808if (! -d $$script_dir `26`26 ! mkdir(\180C, 0755))
X        \0808`7B
X        \0808    print "error: can't create `5C"$$script_dir`5C": $$!`5Cn";
X        \0808    exit(1);
X        \0808`7D
X#
X#        \0807And is this a writable directory?  The Win32 file
X#        \0807semantics are so odd that we'll ignore stat() and simply
X#        \0807attempt to create a junk file in this directory as a test
X#        \0807of its accessibility.
X#
X        \0808$$test_file = "$$script_dir`5C`5Cvile_perl_tst.txt";
X        \0808if (open(TEST_FD, "> $$test_file") == 0)
X        \0808`7B
X        \0808    print`20
X        \0808\1009"error: directory `5C"$$script_dir`5C" is not writable!`5Cn"
V;
X        \0808    exit(1);
X        \0808`7D
X        \0808close TEST_FD;
X        \0808unlink "$$test_file";
X#
X#        \0807Write out results.
X#
X        \0808if (open(SOME_FD, "> $(PERLCFG)") == 0)
X        \0808`7B
X        \0808    print "error: creating $(PERLCFG): $$!`5Cn";
X        \0808    exit(1);
X        \0808`7D
X        \0808print SOME_FD "VILE_PERL_LIB=$$lib`5Cn";
X        \0808print SOME_FD "VILE_PERL_INC=$$inc`5Cn";
X        \0808print SOME_FD "VILE_PERL_UTILS=$$utils`5Cn";
X        \0808close SOME_FD;
X#
X#        \0807copy win32-compatible perl scripts to user-specified directory
X#
X        \0808@scripts = split ' ', "$(PERL_SCRIPTS)";
X        \0808foreach $$file (@scripts)
X        \0808`7B
X        \0808    $$src  = "perl`5C`5C" . $$file;
X        \0808    $$dest = "$$script_dir`5C`5C$$file";
X        \0808    printf "copying $$src -> $$dest...`5Cn";
X        \0808    `60copy $$src $$dest`60;
X        \0808`7D
X            `7D
X        `7D
X<<
X# Change previous line to "<<KEEP" to inspect inline file contents.
X#
X# Delete things that are affected by the perl configuration before
X# going any further.
X    -del $(TARGET)
X    -del perl.c
X# Look ma, a recursive make
X    $(MAKE) -f makefile.wnt CFG=$(CFG)
$ call unpack [.VILE-8_0]MKPRLENV.WNT;1 -
 1393181534 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 12 72 152
$!
$ create 'f'
X/* This standalone utility program constructs the function, key and command
X *`09binding tables for vile.  The input is a data file containing the
X *`09desired default relationships among the three entities.  Output
X *`09is nebind.h, neproto\0B06func.h, and nename.h, all of which are then
X *`09included in main.c
X *
X *`09Copyright (c) 1990 by Paul Fox
X *`09Copyright (c) 1990, 1995 by Paul Fox and Tom Dickey
X *
X *`09See the file "cmdtbls" for input data formats, and "estruct.h" for
X *`09the output structures.
X *
X * Heavily modified/enhanced to also generate the table of mode and variable
X * names and their #define "bindings", based on input from the file modetbl,
X * by Tom Dickey, 1993.    -pgf
X *
X *
X * $Header: /usr/build/vile/vile/RCS/mktbls.c,v 1.87 1998/05/20 23:55:51 tom E
Vxp $
X *
X */
X
X#define`09OPT_IFDEF_MODES`091`09/* true iff we can ifdef modes */
X
X/* stuff borrowed/adapted from estruct.h */
X
X#ifdef HAVE_CONFIG_H
X#include "config.h"
X#undef DOALLOC`09/* since we're not linking with trace.c */
X#else`09/* !defined(HAVE_CONFIG_H) */
X
X#ifndef SYS_VMS
X#define SYS_VMS 0
X#endif
X
X/* Note: VAX-C doesn't recognize continuation-line in ifdef lines */
X# ifdef vms
X#  define HAVE_STDLIB_H 1
X# endif
X
X`09/* pc-stuff */
X# if defined(__TURBOC__) `7C`7C\170BWATCOM\1812GO32\2D11IBMC__)
X#  define HAVE_STDLIB_H 1
X# endif
X
X`09/* unix-stuff */
X# if (defined(__GNUC__) `26`26\160Aapollo) `7C`7C \2908sun\100D__hpux\230Dlinu
Vx)))
X#  define HAVE_STDLIB_H 1
X# endif
X#endif`09/* !defined(HAVE_CONFIG_H) */
X
X#ifndef HAVE_STDLIB_H
X# define HAVE_STDLIB_H 0
X#endif
X
X#if HAVE_STDLIB_H
X#include <stdlib.h>
X#else
X# if !defined(HAVE_CONFIG_H) `7C`7C MISSING_EXTERN_MALLOC
Xextern`09char *`09malloc`09( unsigned int len );
X# endif
X# if !defined(HAVE_CONFIG_H) `7C`7C MISSING_EXTERN_FREE
Xextern`09void`09free`09( char *ptr );
X# endif
X#endif
X
X/*--------\0808\1010\2020\400C*/
X#ifdef`09main`09/* we're trying to intercept it, e.g., for Windows wrapper */
V
X#define`09ReturnFromMain return
X#endif
X
X#ifndef`09ReturnFromMain
X#define ReturnFromMain exit
X#endif
X
X/*--------\0808\1010\2020\400C*/
X#ifndef DOALLOC
X#define DOALLOC 0
X#endif
X
X#if DOALLOC
X#include "trace.h"
X#endif
X
X#ifndef NO_LEAKS
X#define NO_LEAKS 0
X#endif
X
X#include <stdio.h>
X#include <string.h>
X#include <setjmp.h>
X
X/* argument for 'exit()' or '_\0D08*/
X#if`09SYS_VMS
X#include`09<stsdef.h>
X#define GOODEXIT`09(STS$M_INHIB_MSG `7C STS$K_SUCCESS)
X#define BADEXIT`09`09(STS$M_INHIB_MSG `7C STS$K_ERROR)
X#else
X#define GOODEXIT`090
X#define BADEXIT`09`091
X#endif
X
X#define`09TABLESIZE(v)`09(sizeof(v)/\0A08`5B0`5D))
X
X#ifndef OPT_EXEC_MACROS
X#define OPT_EXEC_MACROS 40
X#endif
X
X/*--------\0808\1010\2020\400A*/
X
X#define MAX_BIND        4`09/* maximum # of key-binding types */
X#define`09MAX_PARSE`095`09/* maximum # of tokens on line */
X#define`09LEN_BUFFER`0960`09/* nominal buffer-length */
X#define`09MAX_BUFFER`09(LEN\0C07*10)
X#define`09LEN_CHRSET`09256`09/* total # of chars in set (ascii) */
X
X`09/* patch: why not use <ctype.h> ? */
X#define`09DIFCNTRL`090x40
X#define tocntrl(c)`09((c)`5EDIFCNTRL)
X#define toalpha(c)`09((c)`5EDIFCNTRL)
X#define`09DIFCASE`09`090x20
X#define`09isUpper(c)`09((c) >= 'A' `26`26 (c) <= 'Z')
X#define`09isLower(c)`09((c) >= 'a' `26`26 (c) <= 'z')
X#define toUpper(c)`09((c)`5EDIFCASE)
X#define toLower(c)`09((c)`5EDIFCASE)
X#define isboolean(c)`09((c) == 'b' `7C`7C \0E08M')
X
X#ifndef`09TRUE
X#define`09TRUE`09(1)
X#define`09FALSE`09(0)
X#endif
X
X#define EOS     '`5C0'
X
X#define`09L_CURL`09'`7B'
X#define`09R_CURL`09'`7D'
X
X#define`09Fprintf`09(void)f\0E06
X#define`09Sprintf`09(void)s\0E06
X
X#if MISSING_EXTERN_FPRINTF
Xextern`09int`09fprintf`09( FILE *fp, const char *fmt, ... );
X#endif
X
X#define`09SaveEndif(head)`09InsertOnEnd(`26head, "#endif")
X
X#define`09FreeIfNeeded(p) if (p != 0) `7B free(p); p = 0; `7D
X
X/*--------\0808\1010\2020\400A*/
X
Xtypedef`09struct stringl `7B
X`09char *Name;`09/* stores primary-data */
X`09char *Func;`09/* stores secondary-data */
X`09char *Data;`09/* associated data, if any */
X`09char *Cond;`09/* stores ifdef-flags */
X`09char *Note;`09/* stores comment, if any */
X`09struct stringl *nst;
X`7D LIST;
X
Xstatic`09char`09*Blank = "";
X
Xstatic`09LIST`09*all_names,
X`09`09*all_kbind,`09/* data for kbindtbl`5B`5D */
X`09`09*all_funcs,`09/* data for extern-lines in neproto.h */
X`09`09*all__FUNCs,`09/* data for `7B`7D-lines in nefunc.h */
X`09`09*all__CMDFs,`09/* data for extern-lines in nefunc.h */
X`09`09*all_envars,
X`09`09*all_ufuncs,
X`09`09*all_fsms,`09/* FSM tables */
X`09`09*all_majors,`09/* list of predefined major modes */
X`09`09*all_modes,`09/* data for name-completion of modes */
X`09`09*all_submodes,`09/* data for name-completion of \2908 */
X`09`09*all_gmodes,`09/* data for GLOBAL modes */
X`09`09*all_mmodes,`09/* data for MAJOR modes */
X`09`09*all_bmodes,`09/* data for BUFFER modes */
X`09`09*all_wmodes;`09/* data for WINDOW modes */
X
X`09int`09main ( int argc, char **argv );
X
Xstatic`09void`09badfmt (const char *s);
Xstatic`09void`09FlushIf (FILE *fp);
Xstatic`09void`09save_all_modes (const char *type,\0C07normal, c\200Babbrev
V\2208cond);
Xstatic`09void`09save_all_submodes (const char *type,\0C07normal, c\200Babbrev
V\2208cond);
Xstatic`09void`09free_LIST (LIST **p);
X
X`09/* definitions for sec\0D06of cmdtbl */
X#define`09SECT_CMDS 0
X#define`09SECT_FUNC 1
X#define`09SECT_VARS 2
X#define`09SECT_GBLS 3
X#define`09SECT_MAJR 4
X#define`09SECT_BUFF 5
X#define`09SECT_WIND 6
X#define`09SECT_FSMS 7
X
X`09/* definitions for indices to 'asciitbl`5B`5D' vs 'kbind\1007*/
X#define ASCIIBIND 0
X#define CTLXBIND 1
X#define CTLABIND 2
X#define SPECBIND 3
X
Xstatic`09char *bindings  `5BLEN_CHRSET`5D;
Xstatic`09char *conditions`5BLEN_CHRSET`5D;
Xstatic`09const char *tblname   `5BMAX_BIND`5D = `7B"asciitbl", "ctlx\0B07metat
V\1606spectbl" `7D;
Xstatic`09const char *prefname  `5BMAX_BIND`5D = `7B"",         "CTLX`7C",   "C
VTLA\0B07SPEC`7C" `7D;
X
Xstatic`09char *fsm_name;
Xstatic`09char *inputfile;
Xstatic`09int l = 0;
Xstatic`09FILE *cmdtbl;
Xstatic`09FILE *nebind, *neexec, *neprot, *nefun\1206name;
Xstatic`09FILE *nevars, *nemode, *nefkey\1306fsms;
Xstatic`09jmp_buf my_top;
X
X/********\0808\1010\2020\400E/
Xstatic int
XisSpace(int c)
X`7B
X`09return c == ' ' `7C`7C\0C07`5Ct\0D0Cn';
X`7D
X
Xstatic int
XisPrint(int c)
X`7B
X`09return c >= ' ' `26`26 c < 0x7f;
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic char *
XAlloc(unsigned len)
X`7B
X`09char`09*pointer = (char *)malloc(len);
X`09if (pointer == 0)
X`09`09badfmt("bug: not enough memory");
X        return pointer;
X`7D
X
Xstatic char *
XStrAlloc(const char *s)
X`7B
X`09return strcpy(Alloc((unsigned)strlen(s)+1), s);
X`7D
X
Xstatic LIST *
XListAlloc(void)
X`7B
X`09return (LIST *)Alloc(sizeof(LIST));
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic void
Xbadfmt(const char *s)
X`7B
X`09Fprintf(stderr,"`5C"%s`5C", line %d: bad format:", inputfile, l);
X`09Fprintf(stderr,"`5Ct%s`5Cn",s);
X`09longjmp(my_top,1);
X`7D
X
Xstatic void
Xbadfmt2(const char *s, int col)
X`7B
X`09char`09temp`5BMAX_BUFFER`5D;
X`09Sprintf(temp, "%s (column %d)", s, col);
X`09badfmt(temp);
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic void
XWriteLines(
XFILE`09*fp,
Xconst char *\0C06*list,
Xint`09count)
X`7B
X`09while (count-- > 0)
X`09`09Fprintf(fp, "%s`5Cn", *list++);
X`7D
X#define`09write_lines(fp,list) WriteL\1408 list, (int)TABLESIZE(list))
X
X/********\0808\1010\2020\400E/
Xstatic FILE *
XOpenHeader(
Xconst char *name,
Xchar`09**argv)
X`7B
X`09register FILE *fp;
X`09static const char *progcreat =
X"/* %s: this header file was produced automatically by`5Cn`5C
X * the %s program, based on input from the file %s`5Cn */`5Cn";
X
X`09if ((fp = fopen(name, "w")) == 0) `7B
X`09`09Fprintf(stderr,"mktbls: couldn't open header file %s`5Cn", name);
X`09`09longjmp(my_top,1);
X`09`7D
X`09Fprintf(fp, progcreat, name, argv`5B0`5D\09071`5D);
X`09return fp;
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic void
XInsertSorted(
XLIST`09**headp,
Xconst char *name,
Xconst char *func,
Xconst char *data,
Xconst char *cond,
Xconst char *note)
X`7B
X`09register LIST *n, *p, *q;
X`09register int  r;
X
X`09n = ListAlloc();
X`09n->Name = StrAlloc(name);
X`09n->Func = StrAlloc(func);
X`09n->Data = StrAlloc(data);
X`09n->Cond = StrAlloc(cond);
X`09n->Note = StrAlloc(note);
X
X`09for (p = *headp, q = 0; p != 0; q = p, p = p->nst) `7B
X`09`09if ((r = strcmp(n->Name, p\0906)) < 0)
X`09`09`09break;
X`09`09else if (r == 0 `26`26 !strcmp(n->Cond, p\0906))
X`09`09`7B
X`09`09`09printf("name=%s`5Cn", n->Name);`09/* FIXME */
X`09`09`09badfmt("duplicate name");
X`09`09`7D
X`09`7D
X`09n->nst = p;
X`09if (q == 0)
X`09`09*headp = n;
X`09else
X`09`09q->nst = n;
X`7D
X
Xstatic void
XInsertOnEnd(
XLIST`09**headp,
Xconst char *name)
X`7B
X`09register LIST *n, *p, *q;
X
X`09n = ListAlloc();
X`09n->Name = StrAlloc(name);
X`09n->Func = Blank;
X`09n->Data = Blank;
X`09n->Cond = Blank;
X`09n->Note = Blank;
X
X`09for (p = *headp, q = 0; p != 0; q = p, p = p->nst)
X`09`09;
X
X`09n->nst = 0;
X`09if (q == 0)
X`09`09*headp = n;
X`09else
X`09`09q->nst = n;
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic char *
Xappend(
Xchar`09*dst,
Xconst char *src)
X`7B
X`09(void)strcat(dst, src);
X`09return (dst + strlen(dst));
X`7D
X
Xstatic char *
Xformcond(const char *c1, c\100C2)
X`7B
X`09static char cond`5BMAX_BUFFER`5D;
X`09if (c1`5B0`5D `26`26 c2`5B0`5D)
X`09`09Sprintf(cond, "(%s) `26 (%s)", c1, c2);
X`09else if (c1`5B0`5D `7C`7C c2`5B0`5D)
X`09`09Sprintf(cond, "(%s%s)", c1, c2);
X`09else
X`09`09cond`5B0`5D = EOS;
X`09return cond;
X`7D
X
Xstatic int
XLastCol(char *buffer)
X`7B
X`09register int`09col = 0,
X`09`09`09c;
X`09while ((c = *buffer++) != 0) `7B
X`09`09if (isPrint(c))
X`09`09`09col++;
X`09`09else if (c == '`5Ct')
X`09`09`09col = (col `7C 7) + 1;
X`09`7D
X`09return col;
X`7D
X
Xstatic char *
XPadTo(int col, char *buffer)
X`7B
X`09int`09any`09= 0,
X`09`09len`09= strlen(buffer),
X`09`09now;
X`09char`09with;
X
X`09for (;;) `7B
X`09`09if ((now = LastCol(buffer)) >= col) `7B
X`09`09`09if (any)
X`09`09&0209break;
X`09`09`09else
X`09`09&0209with = ' ';
X`09`09`7D else if (col-now > 1)
X`09`09`09with = '`5Ct';
X`09`09else
X`09`09`09with = ' ';
X
X`09`09buffer`5Blen++`5D = with;
X`09`09buffer`5Blen`5D   = EOS;
X`09`09any++;
X`09`7D
X`09return buffer;
X`7D
X
Xstatic int
Xtwo_conds(int c, char *cond)
X`7B
X`09/* return true if both bindings have different
X`09 conditions associated with them */
X`09return (cond`5B0`5D != '`5C0' `26`26
X`09`09conditions`5Bc`5D != NULL `26`26
X`09`09strcmp(cond, conditions`5Bc`5D) != '`5C0');
X`7D
X
Xstatic void
Xset_binding (
Xint`09btype,
Xint`09c,
Xchar *`09cond,
Xchar *`09func)
X`7B
X`09char`09name`5BMAX_BUFFER`5D;
X
X`09if (btype != ASCIIBIND) `7B
X`09`09if (c < ' ') `7B
X`09`09`09Sprintf(name, "%stocntrl('%c')",
X`09`09&0209prefname`5Bbtype`5D,
X`09`09&0209toalpha(c));
X`09`09`7D else if (c >= 0x80) `7B
X`09`09`09Sprintf(name, "%s0x%x",
X`09`09&0209prefname`5Bbtype`5D, c);
X`09`09`7D else `7B
X`09`09`09Sprintf(name, "%s'%s%c'",
X`09`09&0209prefname`5Bbtype`5D,
X`09`09&0209(c == '`5C'' `7C`7C \0D07`5C') ? "&025C" : "",
X`09`09&0209c);
X`09`09`7D
X`09`09InsertSorted(`26all_kbind, name, func, "", cond, "");
X`09`7D else `7B
X`09`09if (bindings`5Bc`5D != NULL) `7B
X`09`09`09if (!two_conds(c,cond))
X`09`09&0209badfmt("duplicate key binding");
X`09`09`09free(bindings`5Bc`5D);
X`09`09`7D
X`09`09bindings`5Bc`5D = StrAlloc(func);
X`09`09if (cond`5B0`5D) `7B
X`09`09`09FreeIfNeeded(conditions`5Bc`5D);
X`09`09`09conditions`5Bc`5D = StrAlloc(cond);
X`09`09`7D else `7B
X`09`09`09conditions`5Bc`5D = NULL;
X`09`09`7D
X`09`7D
X`7D
X
X/********\0808\1010\2020\400E/
X`09/* returns the number of non-comment tokens parsed, with a list of
X`09 * tokens (0=comment) as a side-effect.  Note that quotes are removed
X`09 * from the token, so we have to\0807hem only in the first\3106! */
Xstatic int
XParse(
Xchar`09*input,
Xchar`09**vec)
X`7B
X`09register int`09expecting = TRUE,
X`09`09`09count = 0,
X`09`09`09quote = 0,
X`09`09`09n,
X`09`09`09c;
X
X`09for (c = 0; c < MAX_PARSE; c++)
X`09`09vec`5Bc`5D = "";
X`09for (c = strlen(input); c > 0 `26`26 isSpace\1906`5Bc-1`5D); c--)
X`09`09input`5Bc-1`5D = EOS;
X
X`09for (n = 0; (c = input`5Bn++`5D) != EOS; ) `7B
X`09`09if (quote) `7B
X`09`09`09if (c == quote) `7B
X`09`09&0209quote = 0;
X`09`09&0209if (input`5Bn`5D `26`26 !isSpace\1509))
X`09`09&0209`09badfmt2("expected blank", n);
X`09`09&0209input`5Bn-1`5D = EOS;
X`09`09`09`7D
X`09`09`7D else `7B
X`09`09`09if ((c == '"') `7C`7C (\0E06`5C'')) `7B
X`09`09&0209quote = c;
X`09`09`09`7D else if (c == '<') `7B
X`09`09&0209c = quote = '>';
X`09`09`09`7D else if (isSpace(c)) `7B
X`09`09&0209input`5Bn-1`5D = EOS;
X`09`09&0209expecting = TRUE;
X`09`09`09`7D else if (c == '#') `7B
X`09`09&0209while (isSpace(input`5Bn`5D))
X`09`09&0209`09n++;
X`09`09&0209vec`5B0`5D = input+n;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09if (expecting `26`26 !isSpace(c)) `7B
X`09`09&0209if (count+1 >= MAX_PARSE)
X`09`09&0209`09break;
X`09`09&0209vec`5B++count`5D = input + n - ((c != quote)?1:0);
X`09`09&0209expecting = FALSE;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09return count;
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic const char *lastIfdef;
X
Xstatic void
XBeginIf(void)
X`7B
X`09lastIfdef = 0;
X`7D
X
Xstatic void
XWriteIf(
XFILE`09*fp,
Xconst char *cond)
X`7B
X`09if (cond == 0)
X`09`09cond = "";
X`09if (cond`5B0`5D != EOS) `7B
X`09`09if (lastIfdef != 0) `7B
X`09`09`09if (!strcmp(lastIfdef, cond))
X`09`09&0209return;
X`09`09`09FlushIf(fp);
X`09`09`7D
X`09`09Fprintf(fp, "#if %s`5Cn", lastIfdef = cond);
X`09`7D else
X`09`09FlushIf(fp);
X`7D
X
Xstatic void
XFlushIf(FILE *fp)
X`7B
X`09if (lastIfdef != 0) `7B
X`09`09Fprintf(fp, "#endif`5Cn");
X`09`09lastIfdef = 0;
X`09`7D
X`7D
X
X/********\0808\1010\2020\400E/
X/* get abbreviation by taking the uppercase chars only */
Xstatic char *
XAbbrevMode(char *src)
X`7B
X`09char *dst = StrAlloc(src);
X`09register char`09*s = src,
X`09`09`09*d = dst;
X`09while (*s) `7B
X`09`09if (isUpper(*s))
X`09`09`09*d++ = (char)toLower(*s);
X`09`09s++;
X`09`7D
X`09*d = EOS;
X`09return dst;
X`7D
X
X/* get name, converted to lowercase */
Xstatic char *
XNormalMode(char *src)
X`7B
X`09char *dst = StrAlloc(src);
+-+-+-+-+-+-+-+-  END  OF PART 72 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 73 -+-+-+-+-+-+-+-+
X`09register char *s = dst;
X`09while (*s) `7B
X`09`09if (isUpper(*s))
X`09`09`09*s = (char)toLower(*s);
X`09`09s++;
X`09`7D
X`09return dst;
X`7D
X
X/* given single-char type-key (cf: Mode2Key), return define-string */
Xstatic const char *
Xc2TYPE(int c)
X`7B
X`09const char *value;
X`09switch (c) `7B
X`09case 'b':`09value`09= "BOOL";`09break;
X`09case 'e':`09value`09= "ENUM";`09break;
X`09case 'i':`09value`09= "INT";`09break;
X`09case 's':`09value`09= "STRING";`09break;
X`09case 'x':`09value`09= "REGEX";`09break;
X`09default:`09value`09= "?";
X`09`7D
X`09return value;
X`7D
X
Xstatic int
Xis_majormode(const char *name)
X`7B
X`09LIST *p;
X`09for (p = all_mmodes; p != 0; p = p->nst) `7B
X`09`09if (!strcmp(name, p->Name))
X`09`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X
X/* check that the mode-name won't be illegal */
Xstatic void
XCheckModes(char *name)
X`7B
X`09if (!strncmp(name, "no", 2))
X`09`09badfmt("illegal mode-name");
X`7D
X
X/* make a sort-key for mode-name */
Xstatic char *
XMode2Key(char *type, \0C06nam\0C09cond, int submode)
X`7B
X`09int`09c;
X`09char`09*abbrev = AbbrevMode(name),
X`09`09*normal = NormalMode(name),
X`09`09*tmp = Alloc((unsigned)(4 + strlen(normal)\110Aabbrev)));
X
X`09CheckModes(normal);
X`09CheckModes(abbrev);
X
X`09switch (c = *type) `7B
X`09case 'b':
X`09case 'e':
X`09case 'i':
X`09case 's':`09break;
X`09case 'r':`09c = 'x';`09/* make this sort after strings */
X`09`7D
X
X`09save_all_modes(type, normal, abbrev, cond);
X`09if (submode)
X`09`09save_all_submodes(type, normal, abbrev, cond);
X
X`09Sprintf(tmp, "%s`5Cn%c`5Cn%s", normal, c, abbrev);
X#if NO_LEAKS
X`09free(normal);
X`09free(abbrev);
X#endif
X`09return tmp;
X`7D
X
X/* converts a mode-name to a legal (hopefully unique!) symbol */
Xstatic char *
XName2Symbol(char *name)
X`7B
X`09char`09*base, *dst;
X`09register char c;
X
X`09/* allocate enough for adjustment in 'Name2Address()' */
X`09/*   "+ 10" for comfort */
X`09base = dst = Alloc((unsigned)(strlen(name) + 10));
X
X`09*dst++ = 's';
X`09*dst++ = '_';
X`09while ((c = *name++) != EOS) `7B
X`09`09if (c == '-')
X`09`09`09c = '_';
X`09`09*dst++ = c;
X`09`7D
X`09*dst++ = '_';
X`09*dst++ = '_';
X`09*dst = EOS;
X`09return base;
X`7D
X
X/* converts a mode-name `26 type to a reference to string-value */
Xstatic char *
XName2Address(
Xchar`09*name,
Xchar`09*type)
X`7B
X`09/*  "+ 10" for comfort */
X        unsigned len = strlen(name) + 10;
X`09char`09*base = Alloc(len);
X`09char`09*temp;
X
X`09temp = Name2Symbol(name);
X`09if (strlen(temp) + 1 + (isboolean(*type) ? 4 : 0) > len)
X        `09badfmt("bug: buffer overflow in Name2Address");
X
X`09(void)strcpy(base, temp);
X`09if (isboolean(*type))
X`09`09(void)strcat(\0707strcpy(base+2, "no"), temp+2), "+2");
X`09free(temp);
X`09return base;
X`7D
X
X/* define Member_Offset macro, used in index-definitions */
Xstatic void
XDefineOffset(FILE *fp)
X`7B
X#if`09OPT_IFDEF_MODES
X`09Fprintf(fp,
X"#ifndef`5CtMember_Offset`5Cn`5C
X#define`5CtMember_Offset(T, M)`5Ct(((int)`26(((T*)0)->M))/`5C`5C`5Cn`5C
X`5Ct`5Ct`5Ct`5Ct ((int)`26(((T*)0)->Q1) - (\160Fs_MAX)))`5Cn`5C
X#endif`5Cn");
X#endif
X`7D
X
X/* generate the index-struct (used for deriving ifdef-abl\2B07 definitions) */
V
Xstatic void
XWriteIndexStruct(
XFILE`09*fp,
XLIST`09*p,
Xconst char *ppref)
X`7B
X#if`09OPT_IFDEF_MODES
X`09char`09*s,
X`09`09temp`5BMAX_BUFFER`5D,
X`09`09line`5BMAX_BUFFER`5D,
X`09`09*vec`5BMAX_PARSE`5D;
X
X`09BeginIf();
X`09Fprintf(fp, "typedef`5Ctstruct`5Ct%c`5Cn", L_CURL);
X`09while (p != 0) `7B
X`09`09WriteIf(fp, p->Cond);
X`09`09(void)Parse(strcpy(line, p->Name), vec);
X`09`09Sprintf(temp, "`5Ctchar`5Ct%s;", s = Name2Symbol(vec`5B1`5D));
X`09`09free(s);
X`09`09if (p->Note`5B0`5D) `7B
X`09`09`09(void)PadTo(32, temp);
X`09`09`09Sprintf(temp+strlen(temp), "/* %s */", p->Note);
X`09`09`7D
X`09`09Fprintf(fp, "%s`5Cn", temp);
X`09`09p = p->nst;
X`09`7D
X
X`09FlushIf(fp);
X`09Fprintf(fp, "`5Ctchar`5Cts_MAX;`5Cn");
X`09Fprintf(fp, "`5Ctchar`5CtQ1;`5Cn");
X`09Fprintf(fp, "`5Ct%c Index%s;`5Cn`5Cn", R_CURL, ppref);
X#endif`09/* OPT_IFDEF_MODES */
X`7D
X
X/* generate the index-definitions */
Xstatic void
XWriteModeDefines(
XLIST`09*p,
Xconst char *ppref)
X`7B
X`09char`09temp`5BMAX_BUFFER`5D,
X`09`09line`5BMAX_BUFFER`5D,
X`09`09*vec`5BMAX_PARSE`5D;
X`09int`09count`09= 0;
X#if OPT_IFDEF_MODES
X`09char`09*s;
X`09BeginIf();
X#endif
X
X`09for (; p != 0; p = p->nst, count++) `7B
X`09`09(void)Parse(strcpy(line, p->Name), vec);
X`09`09Sprintf(temp, "#define %.1s%s%s ",
X`09`09`09(*ppref == 'B') ? "" : ppref,
X`09`09`09(*vec`5B2`5D == 'b') ? "MD" : "VAL_",
X`09`09`09p->Func);
X`09`09(void)PadTo(24, temp);
X#if OPT_IFDEF_MODES
X`09`09WriteIf(nemode, p->Cond);
X`09`09Sprintf(temp+strlen(temp), "Member_Offset(Index%s, %s)",
X`09`09`09ppref, s = Name2Symbol(vec`5B1`5D));
X`09`09free(s);
X#else
X`09`09Sprintf(temp+strlen(temp), "%d", count);
X`09`09if (p->Note`5B0`5D) `7B
X`09`09`09(void)PadTo(32, temp);
X`09`09`09Sprintf(temp+strlen(temp), "/* %s */", p->Note);
X`09`09`7D
X#endif /* OPT_IFDEF_MODES */
X`09`09Fprintf(nemode, "%s`5Cn", temp);
X`09`7D
X
X`09Fprintf(nemode, "`5Cn");
X#if OPT_IFDEF_MODES
X`09FlushIf(nemode);
X`09Sprintf(temp, "#define NUM_%c_VALUES`5CtMember_Offset(Index%s, s_MAX)",
X`09`09*ppref, ppref);
X#else
X`09Sprintf(temp, "#define NUM_%c_VALUES`5Ct%d", *ppref, count);
X#endif /* OPT_IFDEF_MODES */
X
X`09(void)PadTo(32, temp);
X`09Sprintf(temp+strlen(temp), "/* TABLESIZE(%c_valnames) -- %s */`5Cn",
X`09`09toLower(*ppref), \0806;
X`09Fprintf(nemode, "%s", temp);
X`09Fprintf(nemode, "#define MAX_%c_VALUES`5Ct%d`5Cn`5Cn", *ppref, count);
X`7D
X
Xstatic void
XWriteModeSymbols(LIST *p)
X`7B
X`09char`09temp`5BMAX_BUFFER`5D,
X`09`09line`5BMAX_BUFFER`5D;
X`09char`09*vec`5BMAX_PARSE`5D,
X`09`09*s;
X
X`09/* generate the symbol-table */
X`09BeginIf();
X`09while (p != 0) `7B
X#if OPT_IFDEF_MODES
X`09`09WriteIf(nemode, p->Cond);
X#endif
X`09`09(void)Parse(strcpy(line, p->Name), vec);
X`09`09Sprintf(temp, "`5Ct%c %s,",
X`09`09`09L_CURL, s = Name2Address(vec`5B1`5D, vec`5B2`5D));
X`09`09(void)PadTo(32, temp);
X`09`09free(s);
X`09`09s = 0;
X
X`09`09Sprintf(temp+strlen(temp), "%s,",
X`09`09`09*vec`5B3`5D ? (s = Name2Address(\1B06, vec`5B2`5D)) : "`5C"X`5C"");
X`09`09(void)PadTo(48, temp);
X`09`09if (s != 0)
X`09`09`09free(s);
X
X`09`09Sprintf(temp+strlen(temp), "VALTYPE_%s,", c2TYPE(*vec`5B2`5D));
X`09`09(void)PadTo(64, temp);
X`09`09if (!strcmp(p->Data, "0"))
X`09`09`09(void)strcat(temp, "(ChgdFunc)0 `7D,");
X`09`09else
X`09`09`09Sprintf(temp+strlen(temp), "%s `7D,", p->Data);
X`09`09Fprintf(nemode, "%s`5Cn", temp);
X`09`09p = p->nst;
X`09`7D
X`09FlushIf(nemode);
X
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic void
Xsave_all_modes(
X`09const char *type,
X`09char *normal,
X`09const char *abbrev,
X`09char *cond)
X`7B
X`09if (isboolean(*type)) `7B
X`09`09char`09t_normal`5BLEN_BUFFER`5D,
X`09`09`09t_abbrev`5BLEN_BUFFER`5D;
X`09`09save_all_modes("Bool",
X`09`09`09strcat(strcpy(t_normal, "no"), \0F06),
X`09`09`09*abbrev
X`09`09&0209? strcat(strcpy(t_abbrev, "no"), \0F06)
X`09`09&0209: "",
X`09`09`09cond);
X`09`7D
X`09InsertSorted(`26all_modes, normal, type, "", cond, "");
X`09if (*abbrev)
X`09`09InsertSorted(`26all_modes, abbrev, type, "", cond, "");
X`7D
X
Xstatic void
Xdump_all_modes(void)
X`7B
X`09static const char *\0C06top`5B`5D = `7B
X`09`09"",
X`09`09"#ifdef realdef",
X`09`09"/*",
X`09`09" * List of strings shared between all_modes, b_valnames and w\0F09",
X`09`09" */",
X`09`09"static const char",
X`09`09`7D;
X`09static const char *\0C06middle`5B`5D = `7B
X`09`09"`5Cts_NULL`5B`5D = `5C"`5C";",
X`09`09"#endif /* realdef */",
X`09`09"",
X`09`09"#ifdef realdef",
X`09`09"EXTERN_CONST char *const all_modes`5B`5D = `7B",
X`09`09`7D;
X`09static const char *\0C06bottom`5B`5D = `7B
X`09`09"`5CtNULL`5Ct/* ends table */",
X`09`09"`7D;",
X`09`09"#else",
X`09`09"extern const char *\0C06all_modes`5B`5D;",
X`09`09"#endif /* realdef */",
X`09`09`7D;
X`09char`09temp`5BMAX_BUFFER`5D, *s;
X`09register LIST *p, *q;
X
X`09InsertSorted(`26all_modes, "all", "?", "", "", "");
X`09write_lines(nemode, top);
X`09BeginIf();
X`09for (p = all_modes; p; p = p->nst) `7B
X`09`09if (!isboolean(p->Func`5B0`5D)) `7B
X`09`09`09for (q = p->nst; q != 0; q = q->nst)
X`09`09&0209if (!isboolean(q->Func`5B0`5D))
X`09`09&0209`09break;
X#if OPT_IFDEF_MODES
X`09`09`09WriteIf(nemode, p->Cond);
X#endif
X`09`09`09Sprintf(temp, "`5Ct%s`5B`5D",`09s = Name2Symbol(p->Name));
X`09`09`09(void)PadTo(32, temp);
X`09`09`09free(s);
X`09`09`09Sprintf(temp+strlen(temp), "= `5C"%s`5C",", p->Name);
X`09`09`09(void)PadTo(64, temp);
X`09`09`09Fprintf(nemode, "%s/* %s */`5Cn", temp, p->Func);
X`09`09`7D
X`09`7D
X`09FlushIf(nemode);
X
X`09write_lines(nemode, middle);
X`09for (p = all_modes; p; p = p->nst) `7B
X`09`09if (is_majormode(p->Name))
X`09`09`09continue;
X#if OPT_IFDEF_MODES
X`09`09WriteIf(nemode, p->Cond);
X#endif
X`09`09Fprintf(nemode, "`5Ct%s,`5Cn", s = Name2Address(p->Name, p->Func));
X`09`09free(s);
X`09`7D
X`09FlushIf(nemode);
X
X`09write_lines(nemode, bottom);
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic void
Xsave_bindings(char *s, \0906func\0C08cond)
X`7B
X`09int btype, c, highbit;
X
X`09btype = ASCIIBIND;
X
X`09if (*s == '`5E' `26`26 *(s+1) == 'A'\10072\1006-') `7B
X`09`09btype = CTLABIND;
X`09`09s += 3;
X`09`7D else if (*s == 'F' `26`26 *(s+1) == 'N\11092\1106-') `7B
X`09`09btype = SPECBIND;
X`09`09s += 3;
X`09`7D else if (*s == '`5E' `26`26 *(s+1) == 'X'\10072\1006-') `7B
X`09`09btype = CTLXBIND;
X`09`09s += 3;
X`09`7D
X`09if (*s == 'M' `26`26 *(s+1) == '-') `7B
X`09`09highbit = 0x80;
X`09`09s += 2;
X`09`7D else `7B
X`09`09highbit = 0;
X`09`7D
X
X`09if (*s == '`5C`5C') `7B /* try for an octal value */
X`09`09c = 0;
X`09`09while (*++s < '8' `26`26 *s >= '0')
X`09`09`09c = (c*8) + *s - '0';
X`09`09if (c >= LEN_CHRSET)
X`09`09`09badfmt("octal character too big");
X`09`09c `7C= highbit;
X`09`09set_binding(btype, c, cond, func);
X`09`7D else if (*s == '`5E' `26`26 (c = *(s+1)) != EOS) `7B /* a control char?
V */
X`09`09if (c > 'a' `26`26  c < 'z')
X`09`09`09c = toUpper(c);
X`09`09c = tocntrl(c);
X`09`09c `7C= highbit;
X`09`09set_binding(btype, c, cond, func);
X`09`09s += 2;
X`09`7D else if ((c = *s) != 0) `7B
X`09`09c `7C= highbit;
X`09`09set_binding(btype, c, cond, func);
X`09`09s++;
X`09`7D else `7B
X`09`09badfmt("getting binding");
X`09`7D
X
X`09if (*s != EOS)
X`09`09badfmt("got extra characters");
X`7D
X
Xstatic void
Xdump_bindings(void)
X`7B
X`09char`09temp`5BMAX_BUFFER`5D;
X`09const char *sctl, *meta;
X`09int i, c, btype;
X`09register LIST *p;
X
X`09btype = ASCIIBIND;
X
X`09Fprintf(nebind,"`5Cnconst CMDFUNC *%s`5B%d`5D = %c`5Cn",
X`09`09tblname`5Bbtype`5D, LEN_CHRSET, L_CURL);
X
X`09BeginIf();
X`09for (i = 0; i < LEN_CHRSET; i++) `7B
X`09`09WriteIf(nebind, conditions`5Bi`5D);
X
X`09`09sctl = "";
X`09`09if (i `26 0x80)
X`09`09    meta = "meta-";
X`09`09else
X`09`09    meta = "";
X`09`09c = i `26 0x7f;
X`09`09if (c < ' ' `7C`7C c > '`7E') `7B
X`09`09`09sctl = "ctrl-";
X`09`09`09c = toalpha(c);
X`09`09`7D
X
X`09`09if (bindings`5Bi`5D)
X`09`09`09Sprintf(temp, "`5Ct`26f_%s,", bindings`5Bi`5D);
X`09`09else
X`09`09`09Sprintf(temp, "`5CtNULL,");
X
X`09`09Fprintf(nebind, "%s/* %s%s%c */`5Cn", PadTo(32, temp),
X`09`09&0209&0309meta, sctl, c);
X`09`09if (conditions`5Bi`5D != 0)
X`09`09`09Fprintf(nebind,"#else`5Cn`5CtNULL,`5Cn");
X`09`09FlushIf(nebind);
X
X`09`7D
X`09Fprintf(nebind, "%c;`5Cn", R_CURL);
X
X`09Fprintf(nebind,"`5CnKBIND kbindtbl`5B`5D = %c`5Cn", L_CURL);
X`09BeginIf();
X`09for (p = all_kbind; p; p = p->nst) `7B
X`09`09WriteIf(nebind, p->Cond);
X`09`09Sprintf(temp, "`5Ct%c %s,", L_CURL, p->Name);
X`09`09Fprintf(nebind, "%s`26f_%s %c,`5Cn",
X`09`09`09PadTo(32, temp), p->Func, R_CURL);
X`09`7D
X`09FlushIf(nebind);
X
X`09Fprintf(nebind,"`5Ct`7B 0, NULL `7D`5Cn");
X`09Fprintf(nebind,"%c;`5Cn", R_CURL);
X`7D
X
X/********\0808\1010\2020\400E/
X/*
X * Construct submode names for the given predefined majormodes
X */
Xstatic void
Xdump_majors(void)
X`7B
X`09register LIST *p, *q;
X`09char`09norm`5BLEN_BUFFER`5D,
X`09`09abbr`5BLEN_BUFFER`5D,
X`09`09type`5BLEN_BUFFER`5D;
X`09char`09normal`5BLEN_BUFFER`5D,
X`09`09abbrev`5BLEN_BUFFER`5D;
X`09char `09*my_cond = "OPT_MAJORMODE";
X
X`09for (q = all_majors; q; q = q->nst) `7B
X`09`09Sprintf(normal, "%smode", q->Name);`09/* FIXME */
X`09`09save_all_modes ("Major", normal, "", my_cond);
X`09`7D
X`09for (p = all_mmodes; p; p = p->nst) `7B
X`09`09if (sscanf(p->Name, "%s`5Cn%s`5Cn%s", norm, type, abbr) != 3)
X`09`09`09continue;
X`09`09for (q = all_majors; q; q = q->nst) `7B
X`09`09`09Sprintf(normal, "%s-%s", q->Name, norm);
X`09`09`09Sprintf(abbrev, "%s%s", q->Name, abbr);
X`09`09`09save_all_modes (c2TYPE(*type), normal, abbrev, my_cond);
X`09`09`7D
X`09`7D
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic void
Xsave_all_submodes (
X`09const char *type,
X`09char *normal,
X`09const char *abbrev,
X`09char *cond)
X`7B
X`09if (isboolean(*type)) `7B
X`09`09char`09t_normal`5BLEN_BUFFER`5D,
X`09`09`09t_abbrev`5BLEN_BUFFER`5D;
X`09`09save_all_submodes("Bool",
X`09`09`09strcat(strcpy(t_normal, "no"), \0F06),
X`09`09`09*abbrev
X`09`09&0209? strcat(strcpy(t_abbrev, "no"), \0F06)
X`09`09&0209: "",
X`09`09`09cond);
X`09`7D
X`09InsertSorted(`26all_submodes, normal, type, "", cond, "");
X`09if (*abbrev)
X`09`09InsertSorted(`26all_submodes, abbrev, type, "", cond, "");
X`7D
X
Xstatic void
Xsave_mmodes(
Xchar`09*type,
Xchar`09**vec)
X`7B
X`09char *key = Mode2Key(type, vec`5B1`5D\08064`5D, TRUE);
X`09InsertSorted(`26all_mmodes, key, vec`5B2`5D\08063\08074\10070`5D);
X#if NO_LEAKS
X`09free(key);
X#endif
X`7D
X
Xstatic void
Xdump_mmodes(void)
X`7B
X`09static const char *\0C06top`5B`5D = `7B
X`09`09"",
X`09`09"#if OPT_MAJORMODE",
X`09`09"/* major mode flags`5Ct*/",
X`09`09"/* the indices of M_VALUES.v`5B`5D */",
X`09`09`7D;
X`09static const char *\0C06middle`5B`5D = `7B
X`09`09"",
X`09`09"typedef struct M_VALUES `7B",
X`09`09"`5Ct/* each entry is a val, and a ptr to\1406 */",
X`09`09"`5Ctstruct VAL mv`5BMAX_M_VALUES+1`5D;",
X`09`09"`7D M_VALUES;",
X`09`09"",
X`09`09"#ifdef realdef",
X`09`09"EXTERN_CONST struct VALNAMES m_valnames`5BMAX_M_VALUES+1`5D = `7B",
X`09`09`7D;
X`09static const char *\0C06bottom`5B`5D = `7B
X`09`09"",
X`09`09"`5Ct`7B NULL,`5Ct\0707VALTYPE_INT, 0 `7D",
X`09`09"`7D;",
X`09`09"#else",
X`09`09"extern const struct VALNAMES m_valnames`5BMAX_M_VALUES+1`5D;",
X`09`09"#endif",
X`09`09"#endif /* OPT_MAJORMODE */",
X`09`09`7D;
X
X`09write_lines(nemode, top);
X`09WriteIndexStruct(nemode, all_mmodes, "Major");
X`09WriteModeDefines(all_mmodes, "Major");
X`09write_lines(nemode, middle);
X`09WriteModeSymbols(all_mmodes);
X`09write_lines(nemode, bottom);
X`7D
X
Xstatic void
Xdump_all_submodes(void)
X`7B
X`09static const char *\0C06top`5B`5D = `7B
X`09`09"",
X`09`09"#if OPT_MAJORMODE",
X`09`09"#ifdef realdef",
X`09`09"EXTERN_CONST char *const all_submodes`5B`5D = `7B",
X`09`09`7D;
X`09static const char *\0C06bottom`5B`5D = `7B
X`09`09"`5CtNULL`5Ct/* ends table */",
X`09`09"`7D;",
X`09`09"#else",
X`09`09"extern const char *\0C06all_submodes`5B`5D;",
X`09`09"#endif /* realdef */",
X`09`09"#endif /* OPT_MAJORMODE */",
X`09`09`7D;
X`09char`09*s;
X`09register LIST *p;
X
X`09write_lines(nemode, top);
X`09for (p = all_submodes; p; p = p->nst) `7B
X`09`09if (is_majormode(p->Name))
X`09`09`09continue;
X#if OPT_IFDEF_MODES
X`09`09WriteIf(nemode, p->Cond);
X#endif
X`09`09Fprintf(nemode, "`5Ct%s,`5Cn", s = Name2Address(p->Name, p->Func));
X`09`09free(s);
X`09`7D
X`09FlushIf(nemode);
X
X`09write_lines(nemode, bottom);
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic void
Xpredefine_submodes(char **vec, int len)
X`7B
X`09register LIST *p;
X`09int`09found;
X`09char`09norm`5BLEN_BUFFER`5D,
X`09`09type`5BLEN_BUFFER`5D,
X`09`09abbr`5BLEN_BUFFER`5D,
X`09`09temp`5BLEN_BUFFER`5D;
X
X`09if (len > 1) `7B
X`09`09for (p = all_majors, found = FALSE; p; p = p->nst) `7B
X`09`09`09if (!strcmp(p->Name, vec`5B2`5D)) `7B
X`09`09&0209found = TRUE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`09if (!found)
X`09`09`09InsertSorted(`26all_majors, vec`5B2`5D, "", ""\0808);
X`09`09if (len > 2) `7B
X`09`09`09for (p = all_bmodes, found = FALSE; p; p = p->nst) `7B
X`09`09&0209if (sscanf(p->Name, "%s`5Cn%s`5Cn%s",
X`09`09&0209`09norm, type, abbr) == 3
X`09`09&0209 `26`26 (!strcmp(norm, vec`5B3`5D)
X`09`09&0209  `7C`7C !strcmp(abbr, vec`5B3`5D))) `7B
X`09`09&0209`09found = TRUE;
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09if (found) `7B
X`09`09&0209sprintf(temp, "%s-%s", vec`5B2`5D, norm);
X`09`09&0209strcpy(norm, temp);
X`09`09&0209sprintf(temp, "%s%s", vec`5B2`5D, abbr);
X`09`09&0209strcpy(abbr, temp);
X`09`09&0209save_all_modes(c2TYPE(*type), norm, abbr,
X`09`09&0209`09formcond(p->Cond, "OPT_MAJORMODE"));
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic void
Xsave_bmodes(
Xchar`09*type,
Xchar`09**vec)
X`7B
X`09char *key = Mode2Key(type, vec`5B1`5D\08064`5D, TRUE);
X`09InsertSorted(`26all_bmodes, key, vec`5B2`5D\08063\08074\10070`5D);
X#if NO_LEAKS
X`09free(key);
X#endif
X`7D
X
Xstatic void
Xdump_bmodes(void)
X`7B
X`09static const char *\0C06top`5B`5D = `7B
X`09`09"",
X`09`09"/* buffer mode flags`5Ct*/",
X`09`09"/* the indices of B_VALUES.v`5B`5D */",
X`09`09`7D;
X`09static const char *\0C06middle`5B`5D = `7B
X`09`09"",
X`09`09"typedef struct B_VALUES `7B",
X`09`09"`5Ct/* each entry is a val, and a ptr to\1406 */",
X`09`09"`5Ctstruct VAL bv`5BMAX_B_VALUES+1`5D;",
X`09`09"`7D B_VALUES;",
X`09`09"",
X`09`09"#ifdef realdef",
X`09`09"EXTERN_CONST struct VALNAMES b_valnames`5B`5D = `7B",
X`09`09`7D;
X`09static const char *\0C06bottom`5B`5D = `7B
X`09`09"",
X`09`09"`5Ct`7B NULL,`5Ct\0707VALTYPE_INT, 0 `7D",
X`09`09"`7D;",
X`09`09"#else",
X`09`09"extern const struct VALNAMES b_valnames`5B`5D;",
X`09`09"#endif",
X`09`09`7D;
X
X`09write_lines(nemode, top);
X`09WriteIndexStruct(nemode, all_bmodes, "Buffers");
X`09WriteModeDefines(all_bmodes, "Buffers");
X`09write_lines(nemode, middle);
X`09WriteModeSymbols(all_bmodes);
X`09write_lines(nemode, bottom);
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic void
Xstart_vars_h(char **argv)
X`7B
X`09static const char *\0C06head`5B`5D = `7B
X`09`09"",
X`09`09"#if OPT_EVAL",
X`09`09"",
X`09`09"/*`5Ctstructure to hold user variables and their definitions`5Ct*/",
X`09`09"",
X`09`09"typedef struct UVAR `7B",
X`09`09"`5Ctstruct UVAR *next;",
X`09`09"`5Ctchar *u_name;`5Ct`5Ct/* name of user variable */",
X`09`09"`5Ctchar *u_value;`5Ct`5Ct`5Ct`5Ct/* value (string) */",
X`09`09"`7D UVAR;",
X`09`09"",
X`09`09"decl_uninit( UVAR *user_vars );`5Ct/* user variables */",
X`09`09"",
X`09`09`7D;
X
X`09if (!nevars) `7B
X`09`09nevars = OpenHeader("\1506.h", argv);
X`09`09write_lines(nevars, head);
X`09`7D
X`7D
X
Xstatic void
Xfinish_vars_h(void)
X`7B
X`09if (nevars)
X`09`09Fprintf(nevars, "`5Cn#endif /* OPT_EVAL */`5Cn");
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic void
Xinit_envars(void)
X`7B
X`09static const char *\0C06head`5B`5D = `7B
X`09`09"",
X`09`09"/*`5Ctlist of recognized environment variables`5Ct*/",
X`09`09"",
X`09`09"#ifdef realdef",
X`09`09"EXTERN_CONST char *const envars`5B`5D = `7B"
X`09`09`7D;
X`09static`09int`09done;
X
X`09if (!done++)
X`09`09write_lines(nevars, head);
X`7D
X
Xstatic void
Xsave_envars(char **vec)
X`7B
X`09/* insert into 'all_modes' to provide for common name-completion
X`09 * table, and into 'all_envars' to get name/index correspondence.
X`09 */
X`09InsertSorted(`26all_modes,  vec`5B1`5D, "env",  "", formcond("OPT_EVAL", ve
Vc`5B3`5D), "");
X`09InsertSorted(`26all_envars, vec`5B1`5D\08062`5D, ""\14063\14070`5D);
X`7D
X
Xstatic void
Xdump_envars(void)
X`7B
X`09static const char *\0C06middle`5B`5D = `7B
X`09`09"`5CtNULL`5Ct/* ends table for name-completion */",
X`09`09"`7D;",
X`09`09"#else",
X`09`09"extern const char *\0C06envars`5B`5D;",
X`09`09"#endif",
X`09`09"",
X`09`09"/* `5Ctand its preprocesor definitions`5Ct`5Ct*/",
X`09`09""
X`09`09`7D;
X`09char`09temp`5BMAX_BUFFER`5D;
X`09register LIST *p;
X`09register int count;
X#if OPT_IFDEF_MODES
X`09char`09*s;
X#endif
X
X`09BeginIf();
X`09for (p = all_envars, count = 0; p !\0807= p->nst) `7B
X`09`09if (!count++)
X`09`09`09init_envars();
X#if OPT_IFDEF_MODES
X`09`09WriteIf(nevars, p->Cond);
X#endif
X`09`09Fprintf(nevars, "`5Ct%s,`5Cn", s = Name2Symbol(p->Name));
X`09`09free(s);
X`09`7D
X`09FlushIf(nevars);
X
X`09for (p = all_envars, count = 0; p !\0807= p->nst) `7B
X`09`09if (!count++) `7B
X`09`09`09write_lines(nevars, middle);
X`09`09`09BeginIf();
X`09`09`09WriteIndexStruct(nevars, all_en\0C06"Vars");
X`09`09`7D
X#if OPT_IFDEF_MODES
X`09`09WriteIf(nevars, p->Cond);
X`09`09Sprintf(temp, "#define`5CtEV%s", p->Func);
X`09`09(void)PadTo(24, temp);
X`09`09Sprintf(temp + strlen(temp), "Member_Offset(IndexVars, %s)",
X`09`09`09s = Name2Symbol(p->Name));
X`09`09free(s);
X`09`09Fprintf(nevars, "%s`5Cn", temp);
X#else
X`09`09Sprintf(temp, "#define`5CtEV%s", p->Func);
X`09`09Fprintf(nevars, "%s%d`5Cn", PadTo(24, temp), count-1);
X#endif
X`09`7D
X`09FlushIf(nevars);
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic void
Xsave_fsms(char **vec)
X`7B
X`09InsertSorted(`26all_fsms, vec`5B1`5D, ""\0C062`5D, vec`5B3\08070`5D);
X`7D
X
Xstatic void
Xinit_fsms(void)
X`7B
X`09char name`5BBUFSIZ`5D;
X`09int n;
X
X`09if (fsm_name == 0)
X`09`09badfmt("Missing table name");
X
X`09(void)strcpy(name, fsm_name);
X`09for (n = 0; fsm_name`5Bn`5D != '`5C0'; n++)
X`09`09fsm_name`5Bn`5D = toUpper(\160B);
X`09fprintf(nefsms, "`5Cn");
X`09fprintf(nefsms, "#if OPT_%s_CHOICES`5Cn", fsm_name);
X`09fprintf(nefsms, "static const`5Cn");
X`09fprintf(nefsms, "FSM_CHOICES fsm_%s_choices`5B`5D = %c`5Cn", name, L_CURL);
V
X`7D
X
Xstatic void
Xdump_fsms(void)
X`7B
X`09static const char *\0C06middle`5B`5D = `7B
X`09`09"`5CtEND_CHOICES`5Ct/* ends table for name-completion */",
X`09`09"`7D;",
X`09`09`7D;
X`09char`09temp`5BMAX_BUFFER`5D;
X`09register LIST *p;
X`09register int count;
X
X`09if (all_fsms != 0) `7B
X`09`09BeginIf();
X`09`09for (p = all_fsms, count = 0; p !\0807= p->nst) `7B
X`09`09`09if (!count++)
X`09`09&0209init_fsms();
X#if OPT_IFDEF_MODES
X`09`09`09WriteIf(nefsms, p->Cond);
X#endif
X`09`09`09Sprintf(temp, "`5Ct`7B `5C"%s`5C",", p->Name);
X`09`09`09Fprintf(nefsms, "%s%s `7D,`5Cn", PadTo(40, temp), p->Data);
X`09`09`7D
X`09`09FlushIf(nefsms);
X
X`09`09write_lines(nefsms, middle);
X`09`09Fprintf(nefsms, "#endif /* OPT_%s_CHOICES */`5Cn", fsm_name);
X
X`09`09free_LIST(`26all_fsms);
X
X`09`09free(fsm_name);
X`09`09fsm_name = 0;
X`09`7D
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic void
Xstart_fsms_h(char **argv, \0D06name)
X`7B
X`09static const char *\0C06head`5B`5D = `7B
X`09`09"#if OPT_ENUM_MODES",
X`09`09"",
X`09`09"#define ENUM_ILLEGAL   (-2)",
X`09`09"#define ENUM_UNKNOWN   (-1)",
X`09`09"#define END_CHOICES    `7B (char *)0, ENUM_ILLEGAL `7D",
X`09`09"",
X`09`09"typedef struct `7B",
X`09`09"`5Ctconst char * choice_name;",
X`09`09"`5Ctint    choice_code;",
X`09`09"`7D FSM_CHOICES;",
X`09`09"",
X`09`09"struct FSM `7B",
X`09`09"`5Ctconst char * mode_name;",
X`09`09"`5Ctconst FSM_CHOICES * choices;",
X`09`09"`7D;"
X`09`09`7D;
X
X`09if (!nefsms) `7B
X`09`09nefsms = OpenHeader("\1506.h", argv);
X`09`09write_lines(nefsms, head);
X`09`7D
X`09dump_fsms();
X`09fsm_name = StrAlloc(name);
X`7D
X
Xstatic void
Xfinish_fsms_h(void)
X`7B
X`09if (nefsms)
X`09`09Fprintf(nefsms, "`5Cn#endif /* OPT_ENUM_MODES */`5Cn");
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic void
Xdump_execs(FILE *fp, int count)
X`7B
X`09int n;
X`09for (n = 1; n <= count; n++) `7B
X`09`09Fprintf(fp, "#if OPT_EXEC_MACROS>%d`5Cn", n-1);
X`09`09Fprintf(fp, "int`5Cn");
X`09`09Fprintf(fp, "cbuf%d(int f, int n)`5Cn", n);
X`09`09Fprintf(fp, "`7B`5Cn`5Ctreturn cbuf(f, n, %d);`5Cn`7D`5Cn", n);
X`09`09Fprintf(fp, "#endif`5Cn");
X`09`7D
X`09fclose(fp);
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic void
Xsave_funcs(
Xchar`09*func,
Xchar`09*flags,
Xchar`09*cond,
Xchar`09*old_cond,
Xchar`09*help)
X`7B
X`09char`09temp`5BMAX_BUFFER`5D;
X`09register char`09*s;
X
X`09if (strcmp(cond, old_cond)) `7B
X`09`09if (*old_cond) `7B
X`09`09`09SaveEndif(all_funcs);
X`09`09`09SaveEndif(all__FUNCs);
X`09`09`09SaveEndif(all__CMDFs);
X`09`09`7D
X`09`09if (*cond) `7B
X`09`09`09Sprintf(temp, "#if %s", cond);
X`09`09`09InsertOnEnd(`26all_funcs, temp);
X`09`09`09InsertOnEnd(`26all__FUNCs, temp);
X`09`09`09InsertOnEnd(`26all__CMDFs, temp);
X`09`09`7D
X`09`09(void)strcpy(old_cond, cond);
X`09`7D
X`09Sprintf(temp, "extern int %s ( int f, int n );", func);
X`09InsertOnEnd(`26all_funcs, temp);
X
X`09s = append(strcpy(temp, "`5CtEXTERN_CONST CMDFUNC f_"), func);
X`09(void)PadTo(32, temp);
X`09s = append(s, "= `7B `7B");
X`09s = append(s, func);
X`09s = append(s, "`7D,");
X`09(void)PadTo(56, temp);
X`09s = append(s, flags);
X`09s = append(s, "`5Cn#if OPT_ONLINEHELP`5Cn`5Ct`5Ct,`5C"");
X`09s = append(s, help);
X`09(void)append(s, "`5C"`5Cn#endif`5Cn `7D;");
X`09InsertOnEnd(`26all__FUNCs, temp);
X
X`09s = append(strcpy(temp, "extern const CMDFUNC f_"), func);
X`09(void)append(s, ";");
X`09InsertOnEnd(`26all__CMDFs, temp);
X`7D
X
Xstatic void
Xdump_funcs(
XFILE`09*fp,
XLIST`09*head)
X`7B
X`09register LIST *p;
X`09for (p = head; p != 0; p = p->nst)
X`09`09Fprintf(fp, "%s`5Cn", p->Name);
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic void
Xsave_gmodes(
Xchar`09*type,
Xchar`09**vec)
X`7B
X`09char *key = Mode2Key(type, vec`5B1`5D\08064`5D, FALSE);
X`09InsertSorted(`26all_gmodes, key, vec`5B2`5D\08063\08074\10070`5D);
X#if NO_LEAKS
X`09free(key);
X#endif
X`7D
X
Xstatic void
Xdump_gmodes(void)
X`7B
X`09static const char *\0C06top`5B`5D = `7B
X`09`09"",
X`09`09"/* global mode flags`5Ct*/",
X`09`09"/* the indices of G_VALUES.v`5B`5D */",
X`09`09`7D;
X`09static const char *\0C06middle`5B`5D = `7B
X`09`09"",
X`09`09"typedef struct G_VALUES `7B",
X`09`09"`5Ct/* each entry is a val, and a ptr to\1406 */",
X`09`09"`5Ctstruct VAL gv`5BMAX_G_VALUES+1`5D;",
X`09`09"`7D G_VALUES;",
X`09`09"",
X`09`09"#ifdef realdef",
X`09`09"EXTERN_CONST struct VALNAMES g_valnames`5B`5D = `7B",
X`09`09`7D;
X`09static const char *\0C06bottom`5B`5D = `7B
X`09`09"",
X`09`09"`5Ct`7B NULL,`5Ct\0707VALTYPE_INT, 0 `7D",
X`09`09"`7D;",
X`09`09"#else",
X`09`09"extern const struct VALNAMES g_valnames`5B`5D;",
X`09`09"#endif",
X`09`09`7D;
X
X`09write_lines(nemode, top);
X`09WriteIndexStruct(nemode, all_gmodes, "Globals");
X`09WriteModeDefines(all_gmodes, "Globals");
X`09write_lines(nemode, middle);
X`09WriteModeSymbols(all_gmodes);
X`09write_lines(nemode, bottom);
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic void
Xsave_names(char *name, \0C06func\0C08cond)
X`7B
X`09InsertSorted(`26all_names, name, func, "", cond, "");
X`7D
X
Xstatic void
Xdump_names(void)
X`7B
X`09register LIST *m;
X`09char`09temp`5BMAX_BUFFER`5D;
X
X`09Fprintf(nename,"`5Cn/* if you maintain this by hand, keep it in */`5Cn");
X`09Fprintf(nename,"/* alphabetical order!!!! */`5Cn`5Cn");
X`09Fprintf(nename,"EXTERN_CONST NTAB nametbl`5B`5D = `7B`5Cn");
X
X`09BeginIf();
X`09for (m = all_names; m != NULL; m = m->nst) `7B
X`09`09WriteIf(nename, m->Cond);
X`09`09Sprintf(temp, "`5Ct`7B `5C"%s`5C",", m->Name);
X`09`09Fprintf(nename, "%s`26f_%s `7D,`5Cn", PadTo(40, temp), m->Func);
X`09`7D
X`09FlushIf(nename);
X`09Fprintf(nename,"`5Ct`7B NULL, NULL `7D`5Cn`7D;`5Cn");
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic void
Xinit_ufuncs(void)
X`7B
X`09static const char *\0C06head`5B`5D = `7B
X`09`09"",
X`09`09"/*`5Ctlist of recognized user functions`5Ct*/",
X`09`09"",
X`09`09"typedef struct UFUNC `7B",
X`09`09"`5Ctconst char *f_name;`5Ct/* name of function */",
X`09`09"`5Ctint f_type;`5Ct/* 1 = monamic, 2 = dynamic */",
X`09`09"`7D UFUNC;",
X`09`09"",
X`09`09"#define`5CtNILNAMIC`5Ct0",
X`09`09"#define`5CtMONAMIC`5Ct`5Ct1",
X`09`09"#define`5CtDYNAMIC`5Ct`5Ct2",
X`09`09"#define`5CtTRINAMIC`5Ct3",
X`09`09"",
X`09`09"#ifdef realdef",
X`09`09"EXTERN_CONST UFUNC funcs`5B`5D = `7B",
X`09`09`7D;
X`09static`09int`09done;
X
X`09if (!done++)
X`09`09write_lines(nevars, head);
X`7D
X
Xstatic void
Xsave_ufuncs(char **vec)
X`7B
X`09InsertSorted(`26all_ufuncs, vec`5B1`5D\08062\08073`5D, ""\1C060`5D);
X`7D
X
Xstatic void
Xdump_ufuncs(void)
X`7B
X`09static`09const char`09*\0C06middle`5B`5D = `7B
X`09`09"`7D;",
X`09`09"#else",
X`09`09"extern const UFUNC funcs`5B`5D;",
X`09`09"#endif",
X`09`09"",
X`09`09"/* `5Ctand its preprocesor definitions`5Ct`5Ct*/",
X`09`09"",
X`09`09`7D;
X`09char`09temp`5BMAX_BUFFER`5D;
X`09register LIST *p;
X`09register int`09count;
X
+-+-+-+-+-+-+-+-  END  OF PART 73 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 74 -+-+-+-+-+-+-+-+
X`09for (p = all_ufuncs, count = 0; p !\0807= p->nst) `7B
X`09`09if (!count++)
X`09`09`09init_ufuncs();
X`09`09Sprintf(temp, "`5Ct`7B`5C"%s`5C",", p->Name);
X`09`09(void)PadTo(15, temp);
X`09`09Sprintf(temp+strlen(temp), "%s`7D,", p->Data);
X`09`09if (p->Note`5B0`5D) `7B
X`09`09`09(void)PadTo(32, temp);
X`09`09`09Sprintf(temp+strlen(temp), "/* %s */", p->Note);
X`09`09`7D
X`09`09Fprintf(nevars, "%s`5Cn", temp);
X`09`7D
X`09for (p = all_ufuncs, count = 0; p !\0807= p->nst) `7B
X`09`09if (!count)
X`09`09`09write_lines(nevars, middle);
X`09`09Sprintf(temp, "#define`5CtUF%s", p->Func);
X`09`09Fprintf(nevars, "%s%d`5Cn", PadTo(24, temp), count++);
X`09`7D
X`09Fprintf(nevars, "`5Cn#define`5CtNFUNCS`5Ct`5Ct%d`5Cn", count);
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic void
Xsave_wmodes(
Xchar`09*type,
Xchar`09**vec)
X`7B
X`09char *key = Mode2Key(type, vec`5B1`5D\08064`5D, FALSE);
X`09InsertSorted(`26all_wmodes, key, vec`5B2`5D\08063\08074\10070`5D);
X#if NO_LEAKS
X`09free(key);
X#endif
X`7D
X
Xstatic void
Xdump_wmodes(void)
X`7B
X`09static const char *top`5B`5D = `7B
X`09`09"",
X`09`09"/* these are the boolean, integer, and pointer value'd settings that ar
Ve",
X`09`09"`5Ctassociated with a window, and usually settable by a user.  There",
V
X`09`09"`5Ctis a global set that is inherited into a buffer, and its windows",
V
X`09`09"`5Ctin turn are inherit the buffer's set. */",
X`09`09`7D;
X`09static const char *middle`5B`5D = `7B
X`09`09"",
X`09`09"typedef struct W_VALUES `7B",
X`09`09"`5Ct/* each entry is a val, and a ptr to\1406 */",
X`09`09"`5Ctstruct VAL wv`5BMAX_W_VALUES+1`5D;",
X`09`09"`7D W_VALUES;",
X`09`09"",
X`09`09"#ifdef realdef",
X`09`09"EXTERN_CONST struct VALNAMES w_valnames`5B`5D = `7B",
X`09`09`7D;
X`09static const char *bottom`5B`5D = `7B
X`09`09"",
X`09`09"`5Ct`7B NULL,`5Ct\0707VALTYPE_INT, 0 `7D",
X`09`09"`7D;",
X`09`09"#else",
X`09`09"extern const struct VALNAMES w_valnames`5B`5D;",
X`09`09"#endif",
X`09`09`7D;
X
X`09write_lines(nemode, top);
X`09WriteIndexStruct(nemode, all_wmodes, "Windows");
X`09WriteModeDefines(all_wmodes, "Windows");
X`09write_lines(nemode, middle);
X`09WriteModeSymbols(all_wmodes);
X`09write_lines(nemode, bottom);
X`7D
X
X/********\0808\1010\2020\400E/
Xstatic void
Xfree_LIST (LIST **p)
X`7B
X`09LIST`09*q;
X
X`09while ((q = *p) != 0) `7B
X`09`09*p = q->nst;
X`09`09if (q->Name != Blank) FreeIfNeeded\1F08);
X`09`09if (q->Func != Blank) FreeIfNeeded\1F08);
X`09`09if (q->Data != Blank) FreeIfNeeded\1F08);
X`09`09if (q->Cond != Blank) FreeIfNeeded\1F08);
X`09`09if (q->Note != Blank) FreeIfNeeded\1F08);
X`09`09free((char *)q);
X`09`7D
X`7D
X
X#if NO_LEAKS
X/*
X * Free all memory allocated within 'mktbls'. This is used both for debugging
V
X * as well as for allowing 'mktbls' to be an application procedure that is
X * repeatedly invoked from a GUI.
X */
Xstatic void
Xfree_mktbls (void)
X`7B
X`09register int k;
X
X`09free_LIST(`26all_names);
X`09free_LIST(`26all_funcs);
X`09free_LIST(`26all__FUNCs);
X`09free_LIST(`26all__CMDFs);
X`09free_LIST(`26all_envars);
X`09free_LIST(`26all_ufuncs);
X`09free_LIST(`26all_modes);
X`09free_LIST(`26all_submodes);
X`09free_LIST(`26all_kbind);
X`09free_LIST(`26all_gmodes);
X`09free_LIST(`26all_mmodes);
X`09free_LIST(`26all_bmodes);
X`09free_LIST(`26all_wmodes);
X
X`09for (k = 0; k < LEN_CHRSET; k++) `7B
X`09`09FreeIfNeeded(bindings`5Bk`5D);
X`09`09FreeIfNeeded(conditions`5Bk`5D);
X`09`7D
X#if DOALLOC
X`09show_alloc();
X#endif
X`7D
X#else
X#define free_mktbls()
X#endif`09/* NO_LEAKS */
X
X/********\0808\1010\2020\400E/
Xint
Xmain(int argc, char *argv`5B`5D)
X`7B
X`09char *vec`5BMAX_PARSE`5D;
X`09char line`5BMAX_BUFFER`5D;
X`09char func`5BLEN_BUFFER`5D;
X`09char flags`5BLEN_BUFFER`5D;
X`09char funchelp`5BMAX_BUFFER`5D;
X`09char old_fcond`5BLEN_BUFFER`5D,`09\1311;
X`09char modetype`5BLEN_BUFFER`5D;
X`09int section;
X`09int r;
X
X`09func`5B0`5D = flags\0B07cond\1606old_\0F0Bmodetype\3306EOS;
X
X`09if (setjmp(my_top))
X`09`09ReturnFromMain(BADEXIT);
X
X`09if (argc != 2) `7B
X`09`09Fprintf(stderr, "usage: mktbls cmd-file`5Cn");
X`09`09longjmp(my_top,1);
X`09`7D
X
X`09if ((cmdtbl = fopen(inputfile = argv`5B1`5D,"r")) == NULL ) `7B
X`09`09Fprintf(stderr,"mktbls: couldn't open cmd-file`5Cn");
X`09`09longjmp(my_top,1);
X`09`7D
X
X`09*old_fcond = EOS;
X`09section = SECT_CMDS;
X
X`09/* process each input line */
X`09while (fgets(line, sizeof(line), cmdtbl) != NULL) `7B
X`09`09char`09col0`09= line`5B0`5D,
X`09`09`09col1`09= line`5B1`5D;
X
X`09`09l++;
X`09`09r = Parse(line, vec);
X
X`09`09switch (col0) `7B
X`09`09case '#':&0209/* comment */
X`09`09case '`5Cn':&0209/* empty-list */
X`09`09`09break;
X
X`09`09case '.':&0209/* a new section */
X`09`09`09switch (col1) `7B
X`09`09`09case 'c':
X`09`09&0209section = SECT_CMDS;
X`09`09&0209break;
X`09`09`09case 'e':
X`09`09&0209section = SECT_VARS;
X`09`09&0209start_vars_h(argv);
X`09`09&0209break;
X`09`09`09case 'f':
X`09`09&0209section = SECT_FUNC;
X`09`09&0209start_vars_h(argv);
X`09`09&0209break;
X`09`09`09case 'g':
X`09`09&0209section = SECT_GBLS;
X`09`09&0209break;
X`09`09`09case 'm':
X`09`09&0209section = SECT_MAJR;
X`09`09&0209predefine_submodes(vec, r);
X`09`09&0209break;
X`09`09`09case 'b':
X`09`09&0209section = SECT_BUFF;
X`09`09&0209break;
X`09`09`09case 't':
X`09`09&0209section = SECT_FSMS;
X`09`09&0209start_fsms_h(argv, vec`5B2`5D);
X`09`09&0209break;
X`09`09`09case 'w':
X`09`09&0209section = SECT_WIND;
X`09`09&0209break;
X`09`09`09default:
X`09`09&0209badfmt("unknown section");
X`09`09`09`7D
X`09`09`09break;
X
X`09`09case '`5Ct':&0209/* a new function */
X`09`09`09switch (section) `7B
X`09`09`09case SECT_CMDS:
X`09`09&0209switch (col1) `7B
X`09`09&0209case '"':`09/* then it's an english name */
X`09`09&0209`09if (r < 1 `7C`7C r > 2)
X`09`09&0209&0209badfmt("looking for english name");
X
X`09`09&0209`09save_names(vec`5B1`5D, func, formcond(fcond,vec`5B2`5D));
X`09`09&0209`09break;
X
X`09`09&0209case '`5C'':`09/* then it's a key */
X`09`09&0209`09if (r < 1 `7C`7C r > 3)
X`09`09&0209&0209badfmt("looking for key binding");
X
X`09`09&0209`09if (strncmp("KEY_",vec`5B2`5D,4) == 0) `7B
X`09`09&0209&0209if (strncmp("FN-",vec`5B1`5D,3) != 0)
X`09`09&0209&0309badfmt("KEY_xxx definition must for FN- binding");
X`09`09&0209&0209if (!nefkeys)
X`09`09&0209&0409nefkeys = OpenHeader("\1607.h", argv);
X`09`09&0209&0209Fprintf(nefkeys, "#define %16s (SPEC`7C'%s')`5Cn",
X`09`09&0209&0409vec`5B2`5D,vec`5B1`5D+3);
X`09`09&0209&0209vec`5B2`5D = vec`5B3`5D;
X`09`09&0209`09`7D
X`09`09&0209`09save_bindings(vec`5B1`5D, func, formcond(fcond,vec`5B2`5D));
X`09`09&0209`09break;
X
X`09`09&0209case '<':`09/* then it's a help string */
X`09`09&0209`09/* put code here. */
X`09`09&0209`09(void)strcpy(funchelp, vec`5B1`5D);
X`09`09&0209`09break;
X
X`09`09&0209default:
X`09`09&0209`09badfmt("bad line");
X`09`09&0209`7D
X`09`09&0209break;
X
X`09`09`09case SECT_GBLS:
X`09`09&0209if (r < 2 `7C`7C r > 4)
X`09`09&0209`09badfmt("looking for GLOBAL modes");
X`09`09&0209save_gmodes(modetype, vec);
X`09`09&0209break;
X
X`09`09`09case SECT_MAJR:
X`09`09&0209if (r < 2 `7C`7C r > 4)
X`09`09&0209`09badfmt("looking for MAJOR modes");
X`09`09&0209save_mmodes(modetype, vec);
X`09`09&0209break;
X
X`09`09`09case SECT_BUFF:
X`09`09&0209if (r < 2 `7C`7C r > 4)
X`09`09&0209`09badfmt("looking for BUFFER modes");
X`09`09&0209save_bmodes(modetype, vec);
X`09`09&0209break;
X
X`09`09`09case SECT_WIND:
X`09`09&0209if (r < 2 `7C`7C r > 4)
X`09`09&0209`09badfmt("looking for WINDOW modes");
X`09`09&0209save_wmodes(modetype, vec);
X`09`09&0209break;
X
X`09`09`09default:
X`09`09&0209badfmt("did not expect a tab");
X`09`09`09`7D
X`09`09`09break;
X
X`09`09default:&0209/* cache information about funcs */
X`09`09`09switch (section) `7B
X`09`09`09case SECT_CMDS:
X`09`09&0209if (r < 2 `7C`7C r > 3)
X`09`09&0209`09badfmt("looking for new function");
X
X`09`09&0209/* don't save this yet -- we may get a
X`09`09&0209`09a help line for it.  save the previous
X`09`09&0209`09one now, and hang onto this one */
X`09`09&0209if (func`5B0`5D) `7B /* flush the old one */
X`09`09&0209`09save_funcs( func, flags, fcond,
X`09`09&0209&0209old_fcond, funchelp);
X`09`09&0209`09funchelp`5B0`5D = EOS;
X`09`09&0209`7D
X`09`09&0209(void)strcpy(func,  vec`5B1`5D);
X`09`09&0209(void)strcpy(flags, vec`5B2`5D);
X`09`09&0209(void)strcpy(fcond, vec`5B3`5D);
X`09`09&0209break;
X
X`09`09`09case SECT_FSMS:
X`09`09&0209save_fsms(vec);
X`09`09&0209break;
X
X`09`09`09case SECT_VARS:
X`09`09&0209if (r < 2 `7C`7C r > 3)
X`09`09&0209`09badfmt("looking for char *envars`5B`5D");
X`09`09&0209save_envars(vec);
X`09`09&0209break;
X
X`09`09`09case SECT_FUNC:
X`09`09&0209if (r < 2 `7C`7C r > 3)
X`09`09&0209`09badfmt("looking for UFUNC func`5B`5D");
X`09`09&0209save_ufuncs(vec);
X`09`09&0209break;
X
X`09`09`09case SECT_GBLS:
X`09`09`09case SECT_MAJR:
X`09`09`09case SECT_BUFF:
X`09`09`09case SECT_WIND:
X`09`09&0209if (r != 1
X`09`09&0209 `7C`7C (!strcmp(vec`5B1`5D, "bool")
X`09`09&0209  `26`26 !strcmp(vec`5B1`5D, "enum")
X`09`09&0209  `26`26 !strcmp(vec`5B1`5D, "int")
X`09`09&0209  `26`26 !strcmp(vec`5B1`5D, "string")
X`09`09&0209  `26`26 !strcmp(vec`5B1`5D, "regex")))
X`09`09&0209`09badfmt("looking for mode datatype");
X`09`09&0209(void)strcpy(modetype, vec`5B1`5D);
X`09`09&0209break;
X
X`09`09`09default:
X`09`09&0209badfmt("section not implemented");
X`09`09`09`7D
X`09`09`7D
X`09`7D
X
X`09if (func`5B0`5D) `7B /* flush the old one */
X`09`09save_funcs( func, flags, fcond, old_f\0B06funchelp);
X`09`09funchelp`5B0`5D = EOS;
X`09`7D
X`09if (*old_fcond) `7B
X`09`09SaveEndif(all_funcs);
X`09`09SaveEndif(all__FUNCs);
X`09`09SaveEndif(all__CMDFs);
X`09`7D
X
X`09if (all_names) `7B
X`09`09nebind = OpenHeader("\1506.h", argv);
X`09`09neexec = OpenHeader("\1506.h", argv);
X`09`09nefunc = OpenHeader("\1506.h", argv);
X`09`09neprot = OpenHeader("\1506o.h", argv);
X`09`09nename = OpenHeader("\1506.h", argv);
X`09`09dump_names();
X`09`09dump_bindings();
X`09`09dump_execs(neexec, OPT_EXEC_MACROS);
X`09`09dump_funcs(neprot, all\1206);
X
X`09`09Fprintf(nefunc, "`5Cn#ifdef real_CMDFUNCS`5Cn`5Cn");
X`09`09dump_funcs(nefunc, all__FUNCs);
X`09`09Fprintf(nefunc, "`5Cn#else`5Cn`5Cn");
X`09`09dump_funcs(nefunc, all__CMDFs);
X`09`09Fprintf(nefunc, "`5Cn#endif`5Cn");
X`09`7D
X
X`09if (all_envars) `7B
X`09`09dump_envars();
X`09`09dump_ufuncs();
X`09`09finish_vars_h();
X`09`7D
X
X`09dump_fsms();
X`09finish_fsms_h();
X
X`09if (all_wmodes `7C`7C all_bmodes) `7B
X`09`09nemode = OpenHeader("\1506.h", argv);
X`09`09DefineOffset(nemode);
X`09`09dump_majors();
X`09`09dump_all_modes();
X`09`09dump_all_submodes();
X`09`09dump_gmodes();
X`09`09dump_mmodes();
X`09`09dump_bmodes();
X`09`09dump_wmodes();
X`09`7D
X
X`09free_mktbls();
X`09ReturnFromMain(GOODEXIT);
X`09/*NOTREACHED*/
X`7D
$ call unpack [.VILE-8_0]MKTBLS.C;1 -
 712723441 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 97 73 152
$!
$ create 'f'
X`0C
XMKTBLS.EXE        \0808\1010\201611-SEP-1998 17:21\4708Linker A11-20\5C14Page
V    1
X
X        \0808\1010\200D+--------\0808\1008+
X        \0808\1010\200D! Object Module Synopsis !
X        \0808\1010\200D+--------\0808\1008+
X
XModule Name     Ident              Bytes\1306File \1E0E\0F0F  Creation Dat
V\2D07Creator
X-----------     \0A0A     \130F\1E13\2C0E\4208\540D\1308
XMKTBLS          V1.0\0E0A\180633893 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11
V-SEP-1998 17:20  DEC C V5.5-002
XDECC$SHR        T06.2-05\1008\18080 SYS$COMMON:`5BSYSLIB`5D\3D08.EXE;2     6-J
VAN-1997 16:33  Linker A11-12
XLIBRTL          X01-001\110A\1B070 SYS$COMMON:`5BSYSLIB`5D\3D06.EXE;2\430624-J
VUL-1996 21:28  Linker A11-12
XLIBOTS          \1007V1.3-012\19090 SYS$COMMON:`5BSYSLIB`5D\3D06.EXE;1\43074-M
VAY-1995 22:30  Linker A11-12
XSYS$PUBLIC_VECTORS            `20
X        \0808X-33\1410    0 `5BSYSLIB`5DSYS$PUBLIC_VECTORS.EXE;1\4A064-MAY-199
V5 22:29  Linker A11-12
X
X        \0808\1010\200C+--------\0808\100A+
X        \0808\1010\200C! Program Section Synopsis !
X        \0808\1010\200C+--------\0808\100A+
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
X$LINK$        \0808\100A00010000\0906EDF 00000EE0 (\36073808.) OCTA  4 NOPIC,C
VON,REL,LCL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MKTBLS\160A00010000\0906EDF 00000EE0 (\3C073808.) OCTA  4
X$LITERAL$        \0808\100700010EE0 000126F0 00001811 (\33076161.) OCTA  4   P
VIC,CON,REL,LCL,  SHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MKTBLS\160A00010EE0 000126F0 00001811 (\3C076161.) OCTA  4
X$READONLY_ADDR$        \0808 00012700\090693F 00000240 (\2D08576.) OCTA  4   P
VIC,CON,REL,LCL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MKTBLS\160A00012700\090693F 00000240 (\3C08576.) OCTA  4
X$DATA$        \0808\100A00020000\090777 00000078 (\3608120.) OCTA  4 NOPIC,CON
V,REL,LCL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MKTBLS\160A00020000\090777 00000078 (\3C08120.) OCTA  4
X$CODE$        \0808\100A00030000 00034DBB 00004DBC (\360619900.) OCTA  4   PIC
V,CON,REL,LCL,  SHR,  EXE,NOWRT,NOVEC,  MOD`20
X        \0808MKTBLS\160A00030000 00034DBB 00004DBC (\3C0619900.) OCTA  4
X$BSS$        \0808\100B00040000\0906CFF 00000D00 (\37073328.) 2 **  5 NOPIC,CO
VN,REL,LCL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MKTBLS\160A00040000\0906CFF 00000D00 (\3C073328.) 2 **  5
X
X        \0808\1010\200D+--------\0808\1008+
X        \0808\1010\200D! Symbol Cross Reference !
X        \0808\1010\200D+--------\0808\1008+
X
XSymbol        \0808\1007Value\1C0BDefined By\310EReferenc\1B06...
X------        \0808\1007\1C10\2D06\3112\180A\2207
XDECC$$SHELL_HANDLER          00003A20-RX\1507DECC$SH\240B\2E07MKTBLS\170D
XDECC$EXIT        \0808    00002000-RX\1F07DECC$SHR\2E11MKTBLS\450D
XDECC$FCLOSE        \0808  00001580-RX\1D07DECC$SHR\2C11MKTBLS\430D
XDECC$FGETS        \0808   000015E0-RX\1E07DECC$SHR\2D11MKTBL\440E
XDECC$FOPEN        \0808   00001600-RX\1E07DECC$SHR\2D11MKTBLS\440D
XDECC$FREE        \0808    00002020-RX\1F07DECC$SHR\2E11MKTBLS\450D
XDECC$GA_STDERR        \0807000004F0-RX\1A07DECC$SH\2910  MKTBLS\400D
XDECC$GXFPRINTF        \0807000046D0-RX\1A07DECC$SHR\290F  MKTBLS\400D
XDECC$GXPRINTF        \0808000046E0-RX\1B07DECC$SHR\2A10 MKTBLS\410D
XDECC$GXSPRINTF        \0807000046F0-RX\1A07DECC$SHR\290F  MKTBLS\400D
XDECC$GXSSCANF        \0808000047B0-RX\1B07DECC$SHR\2A10 MKTBLS\410D
XDECC$LONGJMP        \0808 00001370-RX\1C07DECC$SHR\2B11MKTBLS\420D
XDECC$MAIN        \0808    000007B0-RX\1F07DECC$SHR\2E11MKTBLS\450D
XDECC$MALLOC        \0808  00002040-RX\1D07DECC$SHR\2C11MKTBLS\430D
XDECC$STRCAT        \0808  000026A0-RX\1D07\2F06HR\2C11MKTBLS\430D
XDECC$STRCMP        \0808  000026C0-RX\1D07\2F06HR\2C11MKTBLS\430D
XDECC$STRCPY        \0808  000026E0-RX\1D07\2F06HR\2C11MKTBLS\430D
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DMKTBLS.EXE;1        \080711-SEP-1998
V 17:2\2009Linker A11-20\350F     Page    2
X
X
XSymbol        \0808\1007Value\1C0BDefined By\310EReferenc\1B06...
X------        \0808\1007\1C10\2D06\3112\180A\2207
XDECC$STRLEN        \0808  00002710-RX\1D07\2F06HR\2C11MKTBLS\430D
XDECC$STRNCMP        \0808 00002730-RX\1C07\2F06HR\2B11MKTBLS\420D
XLIB$GET_CURRENT_INVO_CONTEXT 00001440-RX       LIBRTL\0D07\1407     MKTBLS
V\190D
XMAIN        \0808\100900010DE0-R\2308MKTBLS\310D
XOTS$INSV_VOL        \0808 000005A0-RX\1C07LIBOTS\2911  MKTBL\190E
XSYS$IMGSTA        \0808   00000340-RX\1E07SYS$PUBLIC_VECTORS`20
X__MAIN        \0808\100700010EA0-R\2108MKTBLS\2F0D
X
X
X
X`09  Key for special characters above:
X`09`09+--------\0808----+
X`09`09! *  - Undefined     !
X`09`09! A  - Alias Name    !
X`09`09! I  - Internal Name !
X`09`09! U  - Universal     !
X`09`09! R  - Relocatable   !
X`09`09! X  - External      !
X`09`09! WK - Weak          !
X`09`09+--------\0808----+
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DMKTBLS.EXE;1        \080711-SEP-1998
V 17:2\2009Linker A11-20\350F     Page    3
X
X        \0808\1010\2011+--------\0808+
X        \0808\1010\2011! Image Synopsis !
X        \0808\1010\2011+--------\0808+
X
XVirtual memory allocated:        \0808\100900010000 0005FFFF 00050000 (327680.
V bytes, 640. pages)
XStack size:        \0808\1010\200D20. pages
XImage header virtual block limits:        \0808\10071.\19082. (\0807blocks)
XImage binary virtual block limits:        \0808\10073.\190765. (   63. blocks)
V
XImage name and identification:        \0808    MKTBLS V1.0
XNumber of files:        \0808\1010\20097.
XNumber of modules:        \0808\1010\20075.
XNumber of program sections:        \0808\100D12.
XNumber of global symbols:        \0808\100D1879.
XNumber of cross references:        \0808\100D47.
XNumber of image sections:        \0808\100F27.
XUser transfer address:        \0808\100C00010EA0
XDebugger transfer address:        \0808\100800000340
XNumber of code references to shareable images:          22.
XImage type:        \0808\1010\2007EXECUTABLE.
XMap format:        \0808\1010\2007DEFAULT WITH CROSS REFERENCE in file DISK$CO
VMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DMKTBLS.M
XEstimated map length:        \0808\100D139. blocks
X        \0808\1010\200E+--------\0808-----+
X        \0808\1010\200E! Link Run Statistics !
X        \0808\1010\200E+--------\0808-----+
X
XPerformance Indicators        \0808\100CPage Faults`09CPU Time`09Elapsed Time
V
X--------\0808\1006        \0808\100C\320B`09\0909\470C
X    Command processing:        \0808\1010    23`0900:00:00.02\0C0B7
X    Pass 1:        \0808\1010\200F109`0900:00:00.23\0C081.04
X    Allocation/Re\0B08:        \0808\1010  6`0900:00:00.01\0C0B2
X    Pass 2:        \0808\1010\201016`0900:00:00.05\0C0A27
X    Map data after object module synopsis:        \0808  3`0900:00:00.01\0C0B4
V
X    Symbol table output:        \0808\1010    0`0900:00:00.00\0C0B4
XTotal run values:        \0808\1010\2009157`0900:00:00.32\0C081.51
X
XUsing a working set limited to 6304 pages and 1820\0F07of data storage (exclud
Ving image)
X
XTotal number object records read (both passes):   796
X    of which 0 were in libraries and 238\1A06DEBUG data records containing 201
V61 bytes
X9893 bytes of DEBUG data were written,starting at VBN 66 with 20 blocks alloca
Vted
X
XNumber of modules extracted explicitly             = 0
X    with 0 extracted to resolve undefined symbols
X
X1 library searches were for symbols not in the\2D10d
X
XA total of 0 global symbol table records was written
X
XLINK/MAP=MKTBLS/CROSS_REFERENCE/EXEC\1C07.EXE \0B07OBJ
$ call unpack [.VILE-8_0]MKTBLS.MAP;4 1728138943 "" 19 74 152
$!
$ create 'f'
X/*
X *`09modes.c
X *
X * Maintain and list the editor modes and value sets.
X *
X * Original code probably by Dan Lawrence or Dave Conroy for MicroEMACS.
X * Major extensions for vile by Paul Fox, 1991
X * Majormode extensions for vile by T.E.Dickey, 1997
X *
X * $Header: /usr/build/vile/vile/RCS/modes.c,v 1.118 1998/05/30 11:31:24 tom E
Vxp $
X *
X */
X
X#include`09"estruct.h"
X#include`09"edef.h"
X#include`09"chgdfunc.h"
X
X#define`09NonNull(s)`09((s == 0) ? "" : s)
X#define`09ONE_COL`09(80/3)
X
X#define isLocalVal(valptr)          (\1308->vp == `26\120C))
X#define makeLocalVal(valptr)        (\1108->vp = `26\110C))
X
X/* FIXME */
X#define OPT_COLOR_CHOICES`09\1209
X#define OPT_BOOL_CHOICES`091
X#define OPT_POPUP_CHOICES`09\1209\1106
X#define OPT_BACKUP_CHOICES`09OPT_FILEBACK
X#define OPT_HILITE_CHOICES`09\130AMATCH
X
X#include "nefsms.h"
X
X/*--------\0808\1010\2020\400A*/
X
X#if OPT_UPBUFF
Xstatic`09void`09relist_settings (void);
X#else
X#define relist_settings() /* nothing */
X#endif
X
X#if OPT_ENUM_MODES
Xstatic`09const char * choice_to_name (\1D06FSM_CHOICES *\2306s, int code);
Xstatic`09const FSM_CHOICES * name_to_choices (\2506struct VALNAMES *names);
X#endif
X
X/*--------\0808\1010\2020\400A*/
X
X#if OPT_EVAL `7C`7C OPT_MAJORMODE
Xstatic`09const char **my_varmodes;`09/* list for modename-completion */
X#endif
X
X#if OPT_MAJORMODE
Xtypedef struct `7B
X`09char *name;`09`09/* copy of MAJORMODE.name */
X`09MAJORMODE *data;`09/* pointer to actual data */
X`09int init;`09`09/* predefined during initialization */
X`09int flag;`09`09/* true when majormode is active/usable */
X`09struct VALNAMES qual`5BMAX_M_VALUES+1`5D; /* qualifier names */
X`09struct VALNAMES used`5BMAX_B_VALUES+1`5D; /* submode names */
X`7D MAJORMODE_LIST;
X
Xstatic MAJORMODE_LIST *my_majormodes;
Xstatic struct VALNAMES *major_valnames;
Xstatic struct VAL *major_g_vals;`09/* on/off values of major modes */
Xstatic struct VAL *major_l_vals;`09/* dummy, for convenience */
X
Xstatic const char **my_mode_list;`09/* copy of 'all_modes`5B`5D' */
X#define MODE_CLASSES 5
X#define is_bool_type(type) (\0807== VALTYPE_BOOL `7C`7C (\1A11MAJOR)
X
Xstatic MAJORMODE * lookup_mm_data(const char *name);
Xstatic MAJORMODE_LIST * lookup_mm_list(const char *name);
Xstatic char * majorname(\1106dst, const\2207majr, int flag);
Xstatic const char *ModeName(\150Cname);
Xstatic int attach_mmode(BUFFER *bp, const char *name);
Xstatic int detach_mmode(BUFFER *bp, const char *name);
Xstatic int enable_mmode(const char *name, int flag);
Xstatic void init_my_mode_list(void);
X
X#if OPT_UPBUFF
Xstatic void relist_majormodes(void);
X#endif
X
X#else
X
X#define MODE_CLASSES 3
X#define ModeName(s) s
X#define init_my_mode_list() /* nothing */
X#define is_bool_type(type) (\0807== VALTYPE_BOOL)
X#define my_mode_list all_modes
X#define relist_majormodes() /* nothing */
X
X#endif /* OPT_MAJORMODE */
X
X/*--------\0808\1010\2020\400A*/
X
Xstatic void
Xset_winflags(int glob_vals, USHORT flags)
X`7B
X`09if (glob_vals) `7B
X`09`09register WINDOW *wp;
X`09`09for_each_visible_window(wp) `7B
X`09`09`09if ((wp->w_bufp == NULL)
X`09`09`09 `7C`7C !b_is_scratch(wp->w_bufp)
X`09`09`09 `7C`7C !(flags `26 WFMODE))
X`09`09&0209wp->w_flag `7C= flags;
X`09`09`7D
X`09`7D else `7B
X`09`09curwp->w_flag `7C= flags;
X`09`7D
X`7D
X
Xstatic int
Xsame_val(const struct VALNAMES *names,\180B *tst\110Eref)
X`7B
X`09if (ref == 0)`09/* can't test, not really true */
X`09`09return -TRUE;
X
X`09switch (names->type) `7B
X#if OPT_MAJORMODE
X`09case VALTYPE_MAJOR:
X`09`09/*FALLTHRU*/
X#endif
X`09case VALTYPE_BOOL:
X`09case VALTYPE_ENUM:
X`09case VALTYPE_INT:
X`09`09return`09(tst->vp->i == ref\0E07);
X`09case VALTYPE_STRING:
X`09`09return`09(tst->vp->p != 0)
X`09`09  `26`26`09(ref->vp->p != 0)
X`09`09  `26`26`09!strcmp(tst->vp->p, ref\0C07);
X`09case VALTYPE_REGEX:
X`09`09return`09(tst->vp->r->pat != 0)
X`09`09  `26`26`09(ref->vp->r->pat != 0)
X`09`09  `26`26`09!strcmp(tst->vp->r->pat, ref\110C);
X`09default:
X`09`09mlforce("BUG: bad type %s %d", ModeName(names->name), \0E07type);
X`09`7D
X
X`09return FALSE;
X`7D
X
X/*
X * Returns the value if it is a string, null otherwise.
X */
Xstatic const char *
Xstring_val(const struct VALNAMES *names,\180B *values)
X`7B
X`09const char *s = 0;
X
X`09switch (names->type) `7B
X#if`09OPT_ENUM_MODES`09`09/* will show the enum name too */
X`09case VALTYPE_ENUM:
X`09`09s = choice_to_name(name_to_\1706s(names), values->vp->i);
X`09`09break;
X#endif
X`09case VALTYPE_STRING:
X`09`09s = values->vp->p;
X`09`09break;
X`09case VALTYPE_REGEX:
X`09`09s = values->vp->r->pat;
X`09`09break;
X`09`7D
X
X`09return (s != 0 `26`26 *s == EOS) ? 0 : s;
X`7D
X
X/*
X * Returns the formatted length of a string value.
X */
Xstatic int
Xsize_val(const struct VALNAMES *names,\180B *values)
X`7B
X`09return strlen(ModeName(names->name))
X`09`09+ 3
X`09`09+ strlen(NonNull(string_val(names, values)));
X`7D
X
X/*
X * Returns a mode-value formatted as a string
X */
Xchar *
Xstring_mode_val(VALARGS *args)
X`7B
X`09register const struct VALNAMES *names = args->names;
X`09register struct VAL     *values = args->local;
X`09switch(names->type) `7B
X#if OPT_MAJORMODE
X`09case VALTYPE_MAJOR:
X#endif
X`09case VALTYPE_BOOL:
X`09`09return values->vp->i ? truem : falsem;
X`09case VALTYPE_ENUM:
X#if OPT_ENUM_MODES
X`09`09`7B
X`09`09static`09char`09temp`5B20`5D;`09/* FIXME: const workaround */
X`09`09(void)strcpy(temp,
X`09`09`09choice_to_name(name_to_\1706s(names), values->vp->i));
X`09`09return temp;
X`09`09`7D
X#endif`09`09&0209/* else, fall-thru to use int-code */
X`09case VALTYPE_INT:
X`09`09return l_itoa(values->vp->i);
X`09case VALTYPE_STRING:
X`09`09return NonNull(values->vp->p);
X`09case VALTYPE_REGEX:
X`09`09return NonNull(values->vp->r->pat);
X`09`7D
X`09return errorm;
X`7D
X
X/* listvalueset:  print each value in the array according to type, along with
V
X * its name, until a NULL name is encountered.  If not local, only print if th
Ve value in the
X * two arrays differs, or the second\1E06 is nil.  If local, print only the
X * values in the first array that are local.
X */
Xstatic int
Xlistvalueset(
Xconst char *which,
Xint nflag,
Xint local,
Xconst struct VALNAMES *names,
Xstruct VAL *values,
Xstruct VAL *globvalues)
X`7B
X`09int`09show`5BMAX_G_VALUES+MAX_B\0D0CW\1A07`5D;
X`09int`09any`09= 0,
X`09`09passes`09= 1,
X`09`09ncols`09= term.t_ncol / ONE_COL,
X`09`09padded,
X`09`09perline,
X`09`09percol,
X`09`09total;
X`09register int j, pass;
X
X`09if (ncols > MAXCOLS)
X`09`09ncols = MAXCOLS;
X
X`09/*
X`09 * First, make a list of values we want to show.
X`09 * Store:
X`09 *`090 - don't show
X`09 *`091 - show in first pass
X`09 *`092 - show in second pass (too long)
X`09 */
X`09for (j = 0; names`5Bj`5D.name != 0; j++) `7B
X`09`09int ok = FALSE;
X`09`09show`5Bj`5D = 0;
X`09`09if (local) `7B
X`09`09`09ok = is_local_val(values,j);
X`09`09`7D else `7B
X`09`09`09ok = (same_val(names+j, valu\0A06glob\0E06 ?\0D0B+j : 0) != TRUE);
X`09`09`7D
X`09`09if (ok) `7B
X`09`09`09switch (names`5Bj`5D.type) `7B
X`09`09`09case VALTYPE_STRING:
X`09`09`09case VALTYPE_REGEX:
X`09`09&0209if (string_val(names+j, values+j) == 0) `7B
X`09`09&0209`09ok = FALSE;
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09&0209if (size_val(names+j, values+j) > ONE_COL) `7B
X`09`09&0209`09show`5Bj`5D += 1;
X`09`09&0209`09passes = 2;
X`09`09&0209`7D
X`09`09&0209/* fall-thru */
X`09`09`09default:
X`09`09&0209show`5Bj`5D += 1;
X`09`09`09`7D
X`09`09`7D
X`09`09if (ok `26`26 !any++) `7B
X`09`09`09if (nflag)
X`09`09&0209bputc('`5Cn');
X`09`09`09bprintf("%s:`5Cn", which);
X`09`09`7D
X`09`7D
X`09total = j;
X
X`09if (any) `7B
X`09`09if (!passes)
X`09`09`09passes = 1;
X`09`7D else
X`09`09return nflag;
X
X`09/*
X`09 * Now, go back and display the values
X`09 */
X`09for (pass = 1; pass <= passes\1006++) `7B
X`09`09register int`09line, col, k;
X`09`09int`09offsets`5BMAXCOLS+1`5D;
X
X`09`09offsets`5B0`5D = 0;
X`09`09if (pass == 1) `7B
X`09`09`09for (j = percol = 0; j < total; j++) `7B
X`09`09&0209if (show`5Bj`5D == pass)
X`09`09&0209`09percol++;
X`09`09`09`7D
X`09`09`09for (j = 1; j < ncols; j++) `7B
X`09`09&0209offsets`5Bj`5D
X`09`09&0209`09= (percol + ncols - j) /\0D06
X`09`09&0209`09+ offsets`5Bj-1`5D;
X`09`09`09`7D
X`09`09`09perline = ncols;
X`09`09`7D else `7B`09/* these are too wide for ONE_COL */
X`09`09`09offsets`5B1`5D = total;
X`09`09`09perline = 1;
X`09`09`7D
X`09`09offsets`5Bncols`5D = total;
X
X`09`09line = 0;
X`09`09col  = 0;
X`09`09for_ever `7B
X`09`09`09k = line + offsets`5Bcol`5D;
X`09`09`09for (j = 0; j < total; j++) `7B
X`09`09&0209if (show`5Bj`5D == pass) `7B
X`09`09&0209`09if (k-- <= 0)
X`09`09&0209&0209break;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09if (k >= 0)`09/* no more cells to display */
X`09`09&0209break;
X
X`09`09`09if (col == 0)
X`09`09&0209bputc(' ');
X`09`09`09padded = (col+1) < perline ? ONE_COL : 1;
X`09`09`09if (is_bool_type(names`5Bj`5D.type)) `7B
X`09`09&0209bprintf("%s%s%*P",
X`09`09&0209`09values`5Bj`5D.vp->i ? "  " : "no",
X`09`09&0209`09ModeName(names`5Bj`5D.name),
X`09`09&0209`09padded, ' ');
X`09`09`09`7D else `7B
X`09`09&0209VALARGS args;`09/* patch */
X`09`09&0209args.names  = names+j;
X`09`09&0209args.local  = values+j;
X`09`09&0209args.global = 0;
X`09`09&0209bprintf("  %s=%s%*P",
X`09`09&0209`09ModeName(names`5Bj`5D.name),
X`09`09&0209`09string_mode_val(`26args),
X`09`09&0209`09padded, ' ');
X`09`09`09`7D
X`09`09`09if (++col >= perline) `7B
X`09`09&0209col = 0;
X`09`09&0209bputc('`5Cn');
X`09`09&0209if (++line >= offsets`5B1`5D)
X`09`09&0209`09break;
X`09`09`09`7D else if (line+offsets`5Bcol`5D >= \100B+1`5D)
X`09`09&0209break;
X`09`09`7D
X`09`09if ((col != 0) `7C`7C (pass != passes)) `7B
X`09`09`09if (pass != passes)
X`09`09&0209bputc('`5Cn');
X`09`09`09bputc('`5Cn');
X`09`09`7D
X`09`7D
X`09return TRUE;
X`7D
X
X#ifdef lint
Xstatic`09/*ARGSUSED*/ WINDOW *ptr2\0C06(void *p) `7B return 0; `7D
X#else
X#define`09ptr2WINDOW(p)`09(\0B06 *)p
X#endif
X
X/* list the current modes into\170Dbuffer */
X/* ARGSUSED */
Xstatic
Xvoid
Xmakemodelist(int local, void *ptr)
X`7B
X`09static
X`09const`09char`09gg`5B`5D = "Universal",
X`09`09`09bb`5B`5D = "Buffer",
X`09`09`09ww`5B`5D = "Window";
X`09int`09nflag, nflg2;
X
X`09register WINDOW *localwp = ptr2\1606(ptr);  /* alignment okay */
+-+-+-+-+-+-+-+-  END  OF PART 74 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 75 -+-+-+-+-+-+-+-+
X`09register BUFFER *localbp = localwp->w_bufp;
X`09struct VAL`09*local_b_vals = localbp->b_values.bv;
X`09struct VAL`09*local_w_vals = localwp->w_values.wv;
X`09struct VAL`09*globl_b_vals = global\1006ues.bv;
X
X#if OPT_UPBUFF
X`09if (relisting_b_vals != 0)
X`09`09local_b_vals = relisting\1307;
X`09if (relisting_w_vals != 0)
X`09`09local_w_vals = relisting\1307;
X#endif
X
X#if OPT_MAJORMODE
X`09if (local `26`26\0A07bp->majr != 0)) `7B
X`09`09bprintf("--- `5C"%s`5C" settings, if different than\2308majormode %*P`5C
Vn",
X`09`09`09localbp->b_bname,
X`09`09`09localbp->majr->name,
X`09`09`09term.t_ncol-1, '-');
X`09`09globl_b_vals = localbp->majr->mb.bv;
X`09`7D else
X#endif
X`09bprintf("--- `5C"%s`5C" settings, if different than globals %*P`5Cn",
X`09`09localbp->b_bname, term.t_ncol-1, '-');
X
X`09nflag = listvalueset(bb, FALSE\0707, b_valnames, local_b_vals, glob\0E08);
V
X`09nflg2 = listvalueset(ww, nflag, FALSE, w_valnames, local_w_vals, glob\0F08u
Ves.wv);
X`09if (!(nflag `7C`7C nflg2))
X`09 `09bputc('`5Cn');
X`09bputc('`5Cn');
X
X`09bprintf("--- %s settings %*P`5Cn",
X`09`09local ? "Local" : "Global", term.t_ncol-1, '-');
X
X#if OPT_MAJORMODE
X`09if (!local) `7B
X`09`09int n;
X`09`09for (n = 0; major_valnames`5Bn`5D.name != 0; n++) `7B
X`09`09`09make_local_val(major_g_vals, n);
X`09`09`09major_g_vals`5Bn`5D.vp->i = my_majormodes`5Bn`5D.flag;
X`09`09`7D
X`09`09nflag = listvalueset("Majormodes", nflag, local, major_valnames\1008g_va
Vls, (struct VAL *)0);
X`09`7D
X#endif
X`09if (local) `7B
X`09`09nflag = listvalueset(bb, nflag, local, b_valnames\1307_b_vals, (struct V
VAL *)0);
X`09`09(void)  listvalueset(ww, nflag, local, w_valnames\1307_w_vals, (struct V
VAL *)0);
X`09`7D else `7B
X`09`09nflag = listvalueset(gg, nflag, local, g_valnames, global_g_values.gv, (
Vstruct VAL *)0);
X`09`09nflag = listvalueset(bb, nflag, local, b_valnames, globl_b_vals, (struct
V VAL *)0);
X`09`09(void)  listvalueset(ww, nflag, local, w_valnames, global_w_values.wv, (
Vstruct VAL *)0);
X`09`7D
X`7D
X
X/*
X * Set tab size
X */
Xint
Xsettab(int f, int n)
X`7B
X`09register WINDOW *wp;
X#if OPT_MAJORMODE
X`09int val = VAL_TAB;
X`09const char *whichtabs = "T";
X#else
X`09int val;
X`09const char *whichtabs;
X`09if (is_c_mode(curbp)) `7B
X`09`09val = VAL_C_TAB;
X`09`09whichtabs = "C-t";
X`09`7D else `7B
X`09`09val = VAL_TAB;
X`09`09whichtabs = "T";
X`09`7D
X#endif
X`09if (f `26`26 n >= 1) `7B
X`09`09make_local_b_val(curbp,val);
X`09`09set_b_val(curbp,val,n);
X`09`09curtabval = n;
X`09`09for_each_visible_window(wp)
X`09`09`09if (wp->w_bufp == curbp) \1506flag `7C= WFHARD;
X`09`7D else if (f) `7B
X`09`09mlwarn("`5BIllegal tabstop value`5D");
X`09`09return FALSE;
X`09`7D
X`09if (!global_b_val(MDTERSE) `7C`7C !f)
X`09`09mlwrite("`5B%sabs are %d columns apart, using %s value.`5D", whichtabs,
V
X`09`09`09curtabval,
X`09`09`09is_local_b_val(curbp,val) ? "local" : "global" );
X`09return TRUE;
X`7D
X
X/*
X * Set fill column to n.
X */
Xint
Xsetfillcol(int f, int n)
X`7B
X`09if (f `26`26 n >= 1) `7B
X`09`09make_local_b_val(curbp,VAL_FILL);
X`09`09set_b_val(curbp,VAL_FILL,n);
X`09`7D else if (f) `7B
X`09`09mlwarn("`5BIllegal fill-column value`5D");
X`09`09return FALSE;
X`09`7D
X`09if (!global_b_val(MDTERSE) `7C`7C !f)
X`09`09mlwrite("`5BFill column is %d, and is %s`5D",
X`09`09`09b_val(curbp,VAL_FILL),
X`09`09`09is_local_b_val(curbp,VAL_FILL) ? "local" : "global" );
X`09return(TRUE);
X`7D
X
X/*
X * Release storage of a REGEXVAL struct
X */
Xstatic REGEXVAL *
Xfree_regexval(register REGEXVAL *rp)
X`7B
X`09if (rp != 0) `7B
X`09`09FreeAndNull(rp->pat);
X`09`09FreeAndNull(rp->reg);
X`09`09free((char *)rp);
X`09`7D
X`09return 0;
X`7D
X
X/*
X * Allocate/set a new REGEXVAL struct
X */
XREGEXVAL *
Xnew_regexval(const char *pattern, int magic)
X`7B
X`09register REGEXVAL *rp;
X
X`09if ((rp = typealloc(REGEXVAL)) != 0) `7B
X`09`09rp->pat = strmalloc(pattern);
X`09`09if ((rp->reg = regcomp(rp->pat, magic)) == 0)
X`09`09`09rp = free_regexval(rp);
X`09`7D
X`09return rp;
X`7D
X
X/*
X * Release storage of a VAL struct
X */
Xstatic void
Xfree_val(const struct VALNAMES *names,\180B *values)
X`7B
X`09switch (names->type) `7B
X`09case VALTYPE_STRING:
X`09`09FreeAndNull(values->v.p);
X`09`09break;
X`09case VALTYPE_REGEX:
X`09`09values->v.r = free_regexval(\1C0B);
X`09`09break;
X`09default:`09/* nothing to free */
X`09`09break;
X`09`7D
X`7D
X
X/*
X * Copy a VAL-struct, preserving the sense of local/global.
X */
Xstatic int
Xcopy_val(struct VAL *dst, \110Csrc)
X`7B
X`09register int local = isLocalVal(src);
X
X`09*dst = *src;
X`09if (local)
X`09`09makeLocalVal(dst);
X`09return local;
X`7D
X
Xvoid
Xcopy_mvals(
Xint maximum,
Xstruct VAL *dst,
Xstruct VAL *src)
X`7B
X`09register int`09n;
X`09for (n = 0; n < maximum; n++)
X`09`09(void)copy_val(`26dst`5Bn`5D, `26src`5Bn`5D);
X`7D
X
X/*
X * This is a special routine designed to save the values of local modes and to
V
X * restore them.  The 'recompute_buffer()' procedure assumes that global modes
V
X * do not change during the recomputation process (so there is no point in
X * trying to convert any of those values to local ones).
X */
X#if OPT_UPBUFF
Xvoid
Xsave_vals(
Xint maximum,
Xstruct VAL *gbl,
Xstruct VAL *dst,
Xstruct VAL *src)
X`7B
X`09register int`09n;
X`09for (n = 0; n < maximum; n++)
X`09`09if (copy_val(`26dst`5Bn`5D, `26src`5Bn`5D))
X`09`09`09make_global_val(src, gbl, n);
X`7D
X#endif
X
X/*
X * free storage used by local mode-values, called only when we are freeing
X * all other storage associated with a buffer or window.
X */
Xvoid
Xfree_local_vals(
Xconst struct VALNAMES *names,
Xstruct VAL *gbl,
Xstruct VAL *val)
X`7B
X`09register int`09j;
X
X`09for (j = 0; names`5Bj`5D.name != 0; j++) `7B
X`09`09if (is_local_val(val,j)) `7B
X`09`09`09make_global_val(val, gbl, j);
X`09`09`09free_val(names+j, val+j);
X`09`09`7D
X`09`7D
X`7D
X
X/*
X * Convert a string to boolean, checking for errors
X */
Xstatic int
Xstring_to_bool(const char *base, int *np)
X`7B
X`09if (is_truem(base))
X`09`09*np = TRUE;
X`09else if (is_falsem(base))
X`09`09*np = FALSE;
X`09else `7B
X`09`09mlforce("`5BNot a boolean: '%s'`5D", base);
X`09`09return FALSE;
X`09`7D
X`09return TRUE;
X`7D
X
X/*
X * Convert a string to number, checking for errors
X */
Xint
Xstring_to_number(const char *from, int *np)
X`7B
X`09long n;
X`09char *p;
X
X`09/* accept decimal, octal, or hex */
X`09n = strtol(from, `26p, 0);
X`09if (p == from `7C`7C *p != EOS) `7B
X`09`09mlforce("`5BNot a number: '%s'`5D", from);
X`09`09return FALSE;
X`09`7D
X`09*np = (int)n;
X`09return TRUE;
X`7D
X
X/*
X * Validate a 'glob' mode-value.  It is either a boolean, or it must be a
X * pipe-expression with exactly one "%s" embedded (no other % characters,
X * unless escaped).  That way, we can use the string to format the pipe
X * command.
X */
X#if defined(GMD_GLOB) `7C`7C\150AVAL\1606
Xstatic int
Xlegal_glob_mode(const char *base)
X`7B
X#ifdef GVAL_GLOB`09/* string */
X`09if (isShellOrPipe(base)) `7B
X`09`09register const char *s = base;
X`09`09int`09count = 0;
X`09`09while (*s != EOS) `7B
X`09`09`09if (*s == '%') `7B
X`09`09&0209if (*++s != '%') `7B
X`09`09&0209`09if (*s == 's')
X`09`09&0209&0209count++;
X`09`09&0209`09else
X`09`09&0209&0209count = 2;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09if (*s != EOS)
X`09`09&0209s++;
X`09`09`7D
X`09`09if (count == 1)
X`09`09`09return TRUE;
X`09`7D
X#endif
X`09if (!strcmp(base, "off")
X`09 `7C`7C !strcmp(base, "on"))
X`09 `09return TRUE;
X
X`09mlforce("`5BIllegal value for glob: '%s'`5D", base);
X`09return FALSE;
X`7D
X#endif
X
X/*
X * FSM stands for fixed string mode, so called because the \2306s which the
X * user is permitted to enter are non-arbitrary (fixed).
X *
X * It is meant to handle the following sorts of things:
X *
X * `09:set popup-choices off
X * `09:set popup-choices immediate
X * `09:set popup-choices delayed
X *
X * `09:set error quiet
X * `09:set error beep
X * `09:set error flash
X */
X#if OPT_ENUM_MODES
X
X#if NEVER
XFSM_CHOICES fsm_error`5B`5D = `7B
X`09`7B "beep",      1`7D,
X`09`7B "flash",     2`7D,
X`09`7B "quiet",     0`7D,
X`09END_CHOICES
X`7D;
X#endif
X
Xstatic
Xstruct FSM fsm_tbl`5B`5D = `7B
X`09`7B "*bool",           fsm_bool_choices  `7D,
X#if OPT_COLOR_CHOICES
X`09`7B "fcolor",          fsm_color_choices `7D,
X`09`7B "bcolor",          fsm_color_choices `7D,
X#endif
X#if OPT_POPUP_CHOICES
X`09`7B "popup-choices",   fsm_popup_\1607 `7D,
X#endif
X#if NEVER
X`09`7B "error",           fsm_error `7D,
X#endif
X#if OPT_BACKUP_CHOICES
X`09`7B "backup-style",    fsm_\1606_choices `7D,
X#endif
X#if OPT_HILITE_CHOICES
X`09`7B "visual-matches",  fsm_hilite_choices `7D,
X#endif
X`09`7B "mini-hilite",     fsm_\1106_choices `7D,
X`7D;
X
Xstatic int fsm_idx;
X
Xstatic int
Xchoice_to_code (const FSM_CHOICES *\2306s, \1C06char *name)
X`7B
X`09int code = ENUM_ILLEGAL;
X`09register int i;
X`09char`09temp`5B64`5D;
X`09(void)mklower(strncpy0(temp, name, sizeof(temp)));
X
X`09for (i = 0; choices`5Bi`5D.\0B06_name != 0; i++) `7B
X`09`09if (strcmp(temp, choices`5Bi`5D.\0B06_name) == 0) `7B
X`09`09`09code = choices`5Bi`5D.\0B06_code;
X`09`09`09break;
X`09`09`7D
X`09`7D
X`09return code;
X`7D
X
Xstatic const char *
Xchoice_to_name (const FSM_CHOICES *\2306s, int code)
X`7B
X`09const char *name = 0;
X`09register int i;
X
X`09for (i = 0; choices`5Bi`5D.\0B06_name != 0; i++) `7B
X`09`09if (choices`5Bi`5D.\0B06_code == code) `7B
X`09`09`09name = choices`5Bi`5D.\0B06_name;
X`09`09`09break;
X`09`09`7D
X`09`7D
X`09return name;
X`7D
X
Xstatic const FSM_CHOICES *
Xname_to_choices (const struct VALNAMES *names)
X`7B
X`09register SIZE_T i;
X
X`09for (i = 1; i < TABLESIZE(fsm_tbl); i++)
X`09`09if (strcmp(fsm_tbl`5Bi`5D.mode_name, names->name) == 0)
X`09`09`09return fsm_tbl`5Bi`5D.choices;
X
X`09return 0;
X`7D
X
Xstatic int
Xis_fsm(const struct VALNAMES *names)
X`7B
X`09register SIZE_T i;
X
X`09if (names->type == VALTYPE_ENUM
X`09 `7C`7C names->type == VALTYPE_STRING) `7B
X`09`09for (i = 1; i < TABLESIZE(fsm_tbl); i++) `7B
X`09`09`09if (strcmp(fsm_tbl`5Bi`5D.mode_name, names->name) == 0) `7B
X`09`09&0209fsm_idx = (int)i;
X`09`09&0209return TRUE;
X`09`09`09`7D
X`09`09`7D
X`09`7D else if (is_bool_type(names->type)) `7B
X`09`09fsm_idx = 0;
X`09`09return TRUE;
X`09`7D
X`09fsm_idx = -1;
X`09return FALSE;
X`7D
X
X/*
X * Test if we're processing an enum-valued mode.  If so, lookup the mode value
V.
X * We'll allow a numeric index also (e.g., for colors).  Note that we're
X * returning the table-value in that case, so we'll have to ensure that we
X * don't corrupt the table.
X */
Xstatic const char *
Xlegal_fsm(const char *val)
X`7B
X`09if (fsm_idx >= 0) `7B
X`09`09int i;
X`09`09int idx = fsm_idx;
X`09`09const FSM_CHOICES *p = fsm_tbl`5Bidx`5D.choices;
X`09`09const char *s;
X
X`09`09if (isDigit(*val)) `7B
X`09`09`09if (!string_to_number(val, `26i))
X`09`09&0209return 0;
X`09`09`09if ((s = choice_to_name(p, i)) != 0)
X`09`09&0209return s;
X`09`09`7D else `7B
X`09`09`09if (choice_to_code(p, val) != ENUM_ILLEGAL)
X`09`09&0209return val;
X`09`09`7D
X`09`09mlforce("`5BIllegal value for %s: '%s'`5D",
X`09`09`09fsm_tbl`5Bidx`5D.mode_name,
X`09`09`09val);
X`09`09return 0;
X`09`7D
X`09return val;
X`7D
X
Xstatic int
Xfsm_complete(int c, char *buf, unsigned *pos)
X`7B
X    if (isDigit(*buf)) `7B`09`09/* allow numbers for colors */
X`09if (c != NAMEC)  `09`09/* put it back (cf: kbd_complete) */
X`09    unkeystroke(c);
X`09return isSpace(c);
X    `7D
X    return kbd_complete(FALSE, c, buf, pos,
X        \0808\1008(const char *)(fsm_tbl`5Bfsm_idx`5D.choices),
X`09`09`09sizeof (FSM_CHOICES) );
X`7D
X#endif`09/* OPT_ENUM_MODES */
X
X/*
X * Lookup the mode named with 'cp`5B`5D' and adjust its value.
X */
Xint
Xadjvalueset(
Xconst char *cp,`09`09`09/* name of the mode we are changing */
Xint setting,`09`09`09/* true if\1609 false if un\2A07 */
Xint global,
XVALARGS *args)`09`09`09/* symbol-table entry for the mode */
X`7B
X`09const struct VALNAMES *names = args->names;
X`09struct VAL     *values = args->local;
X`09struct VAL     *globls = args->global;
X
X`09char prompt`5BNLINE`5D;
X`09char respbuf`5BNFILEN`5D;
X`09int no = !strncmp(cp, "no", 2);
X`09const char *rp = NULL;
X`09int status = TRUE;
X`09int unsetting = !\0B08`26`26 !global;
X
X`09if (no `26`26 !is_bool_type(names->type))
X`09`09return FALSE;&0209/* this shouldn't happen */
X
X`09/*
X`09 * Check if we're allowed to change this mode in the current context.
X`09 */
X`09if ((names->side_effect != 0)
X`09 `26`26 !(*(names->side_effect))(args, (values==globls), TRUE)) `7B
X`09`09return FALSE;
X`09 `7D
X
X`09/* get a value if we need one */
X`09if ((end_string() == '=')
X`09 `7C`7C (!is_bool_type(names->type) `26`26 !unsetting)) `7B
X`09`09int`09regex = (names->type == VALTYPE_REGEX);
X`09`09int`09opts = regex ? 0 : KBD_NORMAL;
X`09`09int`09eolchar = (names->type == VALTYPE_REGEX
X`09`09&0209`7C`7C names->type == VALTYPE_STRING) ? '`5Cn' : ' ';
X`09`09int`09(*complete) (DONE_ARGS) = no_\1B07ion;
X
X`09`09respbuf`5B0`5D = EOS;
X`09`09(void)lsprintf(prompt, "New %s %s: ",
X`09`09`09cp,
X`09`09`09regex ? "pattern" : "value");
X
X#if OPT_ENUM_MODES
X`09`09if (is_fsm(names))
X`09`09`09complete = fsm_\0F08;
X#endif
X
X`09`09status = kbd_string(prompt, respbuf, sizeof(\1007), eolchar,
X`09`09        \0807opts, complete);
X`09`09if (status != TRUE)
X`09`09`09return status;
X`09`09if (!strlen(rp = respbuf))
X`09`09`09return FALSE;
X`09`7D
X#if OPT_HISTORY
X`09else
X`09`09hst_glue(' ');
X#endif
X`09status = set_mode_value(cp, setting, global, args, rp);
X
X`09return status;
X`7D
X
Xint
Xset_mode_value(const char *cp, int setting\0D06global, VALARGS *args, \380Crp)
V
X`7B
X`09const struct VALNAMES *names = args->names;
X`09struct VAL     *values = args->local;
X`09struct VAL     *globls = args->global;
X`09REGEXVAL *r;
X
X`09struct VAL oldvalue;
X`09int no = !strncmp(cp, "no", 2);
X`09int nval, status = TRUE;
X`09int unsetting = !\0B08`26`26 !global;
X`09int changed = FALSE;
X
X`09if (rp == NULL) `7B
X`09`09rp = no ? cp+2 : cp;
X`09`7D
X`09else `7B
X`09`09if (no `26`26 !is_bool_type(names->type))
X`09`09`09return FALSE;&0209/* this shouldn't happen */
X
X`09`09/*
X`09`09 * Check if we're allowed to change this mode in the current context.
X`09`09 */
X`09`09if ((names->side_effect != 0)
X`09`09 `26`26 !(*(names->side_effect))(args, (values==globls), TRUE)) `7B
X`09`09`09return FALSE;
X`09`09`7D
X
X#if defined(GMD_GLOB) `7C`7C\150AVAL\1606
X`09`09if (!strcmp(names->name, "glob")
X`09`09 `26`26 !legal_glob_mode(rp))
X`09`09`09return FALSE;
X#endif
X#if OPT_ENUM_MODES
X`09`09(void) is_fsm(names);&0209/* evaluated for its side effects */
X`09`09if ((rp = legal_fsm(rp)) == 0)
X`09`09`09return FALSE;
X#endif
X`09`09/* Test after fsm, to allow translation */
X`09`09if (is_bool_type(names->type)) `7B
X`09`09`09if (!string_to_bool(rp, `26setting))
X`09`09&0209return FALSE;
X`09`09`7D
X`09`7D
X
X`09/* save, to simplify no-change testing */
X`09(void)copy_val(`26oldvalue, values);
X
X`09if (unsetting) `7B
X`09`09make_global_val(values, globls, 0);
X#if OPT_MAJORMODE
X`09`09switch(names->type) `7B
X`09`09case VALTYPE_MAJOR:
X`09`09`09if (values == globls)
X`09`09&0209changed = enable_mmode(names->shortname, FALSE);
X`09`09`09else
X`09`09&0209changed = detach_mmode(curbp, names->shortname);
X`09`09`09break;
X`09`09`7D
X#endif
X`09`7D else `7B
X`09`09makeLocalVal(values);`09/* make sure we point to result! */
X
X`09`09/* we matched a name -- set the value */
X`09`09switch(names->type) `7B
X#if OPT_MAJORMODE
X`09`09case VALTYPE_MAJOR:
X`09`09`09values->vp->i = no ? !setting : \0A07;
X`09`09`09if (values == globls) `7B
X`09`09&0209changed = enable_mmode(names->shortname, values->vp->i);
X`09`09`09`7D else `7B
X`09`09&0209changed = no
X`09`09&0209`09? detach_mmode(curbp, names->shortname)
X`09`09&0209`09: attach_mmode(curbp, names->shortname);
X`09`09`09`7D
X`09`09`09break;
X#endif
X`09`09case VALTYPE_BOOL:
X`09`09`09values->vp->i = no ? !setting : \0A07;
X`09`09`09break;
X
X`09`09case VALTYPE_ENUM:
X#if OPT_ENUM_MODES
X`09`09`09`7B
X`09`09&0209const FSM_CHOICES *fp = name_to_choices(names);
X
X`09`09&0209if (isDigit(*rp)) `7B
X`09`09&0209`09if (!string_to_number(rp, `26nval))
X`09`09&0209&0209return FALSE;
X`09`09&0209`09if (choice_to_name(fp, nval) == 0)
X`09`09&0209&0209nval = ENUM_ILLEGAL;
X`09`09&0209`7D else `7B
X`09`09&0209`09nval = choice_to_code(fp, rp);
X`09`09&0209`7D
X`09`09&0209if (nval == ENUM_ILLEGAL) `7B
X`09`09&0209`09mlforce("`5BNot a legal enum-index: %s`5D",
X`09`09&0209&0209rp);
X`09`09&0209`09return FALSE;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09values->vp->i = nval;
X`09`09`09break;
X#endif /* OPT_ENUM_MODES */
X
X`09`09case VALTYPE_INT:
X`09`09`09if (!string_to_number(rp, `26nval))
X`09`09&0209return FALSE;
X`09`09`09values->vp->i = nval;
X`09`09`09break;
X
X`09`09case VALTYPE_STRING:
X`09`09`09values->vp->p = strmalloc(rp);
X`09`09`09break;
X
X`09`09case VALTYPE_REGEX:
X`09`09`09if ((r = new_regexval(rp, TRUE)) == 0)
X`09`09&0209return FALSE;
X`09`09`09values->vp->r = r;
X`09`09`09break;
X
X`09`09default:
X`09`09`09mlforce("BUG: bad type %s %d", names->name\0D09type);
X`09`09`09return FALSE;
X`09`09`7D
X`09`7D
X
X`09/*
X`09 * Set window flags (to force the redisplay as needed), and apply
X`09 * side-effects.
X`09 */
X`09status = TRUE;
X`09if (!same_val(names, values, `26oldvalue))
X`09`09changed = TRUE;
X
X`09if (changed
X`09 `26`26 (names->side_effect != 0)
X`09 `26`26 !(*(names->side_effect))(args, (values==globls), FALSE))
X`09`09status = FALSE;
X
X`09if (isLocalVal(`26oldvalue)
X`09 `26`26 (values != globls))
X`09`09free_val(names, `26oldvalue);
X
X`09return status;
X`7D
X
X/* ARGSUSED */
Xint
Xlistmodes(int f, int n GCC_UNUSED)
X`7B
X`09register WINDOW *wp = curwp;
X`09register int s;
X
X`09s = liststuff(SETTINGS_BufName, FALSE, makemodelist,f,(void *)wp);
X`09/* back to the buffer whose modes we just listed */
X`09if (swbuffer(wp->w_bufp))
X`09`09curwp = wp;
X`09return s;
X`7D
X
X/*
X * The 'mode_complete()' and\1607eol()' functions are invoked from
X * 'kbd_reply()' to setup the mode-name completion and query displays.
X */
Xstatic int
Xmode_complete(DONE_ARGS)
X`7B
X`09init_my_mode_list();
X
X`09return kbd_complete(FALSE, c, buf, pos,
X`09`09(const char *)`26my_mode_list`5B0`5D, sizeof(\180F));
X`7D
X
Xint
X/*ARGSUSED*/
Xmode_eol(const char * buffer GCC_UNUSED, unsigned cpos\1A0Dint c\0706eolchar)
V
X`7B
X`09return (c == ' ' `7C`7C c == eolchar);
X`7D
X
Xstatic int
Xlookup_valnames(const char *rp, const struct VALNAMES *table)
X`7B
X`09register int j;
X
X`09for (j = 0; table`5Bj`5D.name != 0; j++) `7B
X`09`09if (!strcmp(rp, table`5Bj`5D.name)
X`09`09 `7C`7C !strcmp(rp, table`5Bj`5D.shortname)) `7B
X`09`09`09return j;
X`09`09`7D
X`09`7D
X`09return -1;
X`7D
X
Xint
Xfind_mode(const char *mode, int global, VALARGS *args)
X`7B
X`09register const char *rp = !strncmp(mode, "no", 2) ? mode+2 : mode;
X`09register int`09mode_class;
X`09register int`09j;
X
X`09TRACE(("find_mode(%s) %s`5Cn", mode, global ? "\0A06" : "local"))
X
X`09for (mode_class = 0; \100B< MODE_CLASSES\1B0C++) `7B
X`09`09memset(args, 0, sizeof(*args));
X`09`09switch (mode_class) `7B
X`09`09default: /* universal modes */
X`09`09`09args->names  = g_valnames;
X`09`09`09args->global = \0906_g_values.gv;
X`09`09`09args->local  = (global != FALSE)
X`09`09&0209? args->global
X`09`09&0209: (struct VAL *)0;
X`09`09`09break;
X`09`09case 1:`09/* buffer modes */
X`09`09`09args->names  = b_valnames;
X`09`09`09args->global = \0906_b_values.bv;
X`09`09`09args->local  = (global == TRUE)
X`09`09&0209? args->global
X`09`09&0209: ((curbp != 0)
X`09`09&0209`09? curbp->b_values.bv
X`09`09&0209`09: (struct VAL *)0);
X`09`09`09break;
X`09`09case 2:`09/* window modes */
X`09`09`09args->names  = w_valnames;
X`09`09`09args->global = \0906_w_values.wv;
X`09`09`09args->local  = (global == TRUE)
X`09`09&0209? args->global
X`09`09&0209: ((curwp != 0)
X`09`09&0209`09? curwp->w_values.wv
X`09`09&0209`09: (struct VAL *)0);
X`09`09`09break;
X#if OPT_MAJORMODE
X`09`09case 3: /* major modes */
X`09`09`09args->names  = major_valnames;
X`09`09`09args->global = major_g_vals;
X`09`09`09args->local  = (global == TRUE)
X`09`09&0209? args->global
X`09`09&0209: ((curbp != 0)
X`09`09&0209`09? major_l_vals
X`09`09&0209`09: (struct VAL *)0);
X`09`09`09break;
X`09`09case 4: /* major submodes (qualifiers) */
X`09`09`09if (my_majormodes != 0) `7B
X`09`09&0209size_t n = strlen(rp);
X
X`09`09&0209for (j = 0; my_majormodes`5Bj`5D.name; j++) `7B
X`09`09&0209`09MAJORMODE_LIST *p = my_majormodes+j;
X`09`09&0209`09size_t len = strlen(p->name);
X
X`09`09&0209`09if (n >= len
X`09`09&0209`09 `26`26 !strncmp(rp, p->name, len)
X`09`09&0209`09 `26`26 (lookup_valnames(rp, p->qual)) >= 0) `7B
X`09`09&0209&0209args->names  = p->qual;
X`09`09&0209&0209args->global = p->data->mm.mv;
X`09`09&0209&0209args->local  = (global != FALSE)
X`09`09&0209&0309? args->global
X`09`09&0209&0309: (struct VAL *)0;
X`09`09&0209&0209break;
X`09`09&0209`09`7D
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09break;
X#endif
X`09`09`7D
X`09`09if (args->names != 0
X`09`09 `26`26 args->local != 0) `7B
X`09`09`09if ((j = lookup_valnames(rp, args->names)) >= 0) `7B
X`09`09&0209args->names  += j;
X`09`09&0209args->local  += j;
X`09`09&0209args->global += j;
X`09`09&0209TRACE(("...found class %d %s`5Cn", mode_class, rp))
X#if OPT_MAJORMODE
X`09`09&0209if (mode_class == 3) `7B
X`09`09&0209`09char *it = (curbp->majr != 0)
X`09`09&0209&0209? curbp->majr->name
X`09`09&0209&0209: "?";
X`09`09&0209`09make_global_val(args->local,\0C06\1D06,0);
X`09`09&0209`09if (global) `7B
X`09`09&0209&0209MAJORMODE_LIST *ptr =
X`09`09&0209&0309lookup_mm_list(it);
X`09`09&0209&0209args->local`5B0`5D.v.i =
X`09`09&0209&0309(ptr != 0 `26`26 ptr->flag);
X`09`09&0209&0209;
X`09`09&0209`09`7D else `7B
X`09`09&0209&0209char temp`5BNSTRING`5D;
X`09`09&0209&0209majorname(temp, it, TRUE);
X`09`09&0209&0209make_local_val(args->local,0);
X`09`09&0209&0209args->local`5B0`5D.v.i = !strcmp(temp, rp);
X`09`09&0209`09`7D
X`09`09&0209`7D
X#endif
X`09`09&0209return TRUE;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X#if OPT_MAJORMODE
X`09/* major submodes (buffers) */
X`09if (my_majormodes != 0) `7B
X`09`09int k = 0;
X`09`09size_t n = strlen(rp);
X
X`09`09for (j = 0; my_majormodes`5Bj`5D.name; j++) `7B
X`09`09`09MAJORMODE_LIST *p = my_majormodes+j;
X`09`09`09size_t len = strlen(p->name);
X
X`09`09`09if (n >= len
X`09`09`09 `26`26 !strncmp(rp, p->name, len)
X`09`09`09 `26`26 (k = lookup_valnames(rp+len+(rp`5Blen`5D=='-'), b\2209)) >= 0
V
X`09`09`09 `26`26 is_local_val(p->data->mb.bv,k)) `7B
X`09`09&0209TRACE(("...found submode %s`5Cn", b_valnames`5Bk`5D.name))
X`09`09&0209if (global == FALSE) `7B
X`09`09&0209`09if (curbp != 0
X`09`09&0209`09 `26`26 (curbp->majr == 0
X`09`09&0209`09  `7C`7C strcmp(curbp->majr->name, p->name))) `7B
X`09`09&0209&0209TRACE(("...not applicable`5Cn"))
X`09`09&0209&0209return FALSE;
X`09`09&0209`09`7D
X`09`09&0209`09args->names  = b_val\0E06+ k;
X`09`09&0209`09args->global = p->data->mb.bv + k;
X`09`09&0209`09args->local  = ((curbp != 0)
X`09`09&0209&0309? curbp->b_values.bv + k
X`09`09&0209&0309: (struct VAL *)0);
X`09`09&0209`7D else `7B
X`09`09&0209`09args->names  = b_val\0E06+ k;
X`09`09&0209`09args->global = p->data->mb.bv + k;
X`09`09&0209`09args->local  = \0F06global;
X`09`09&0209`7D
X`09`09&0209return TRUE;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X#endif
X`09TRACE(("...not found`5Cn"))
X`09return FALSE;
X`7D
X
X/*
X * Process a single mode-setting
X */
Xstatic int
Xdo_a_mode(int kind, int global)
X`7B
X`09VALARGS`09args;
X`09register int`09s;
X`09static TBUFF *cbuf; `09/* buffer to receive mode name into */
X
X`09/* prompt the user and get an answer */
X`09tb_scopy(`26cbuf, "");
X`09if ((s = kbd_reply(
X`09`09global`09? "Global value: "
X`09`09`09: "Local value: ",
X`09`09`26cbuf,
X`09`09mode_eol, '=', KBD_NORMAL, mode_complete)) != TRUE)
X`09`09return ((s == FALSE) ? SORTOFTRUE : s);
X
X`09if (!strcmp(tb_values(cbuf), "all")) `7B
X`09`09hst_glue(' ');
X`09`09return listmodes(FALSE,1);
X`09`7D
X
X`09if ((s = find_mode(tb_values(cbuf), global, `26args)) != TRUE) `7B
X#if OPT_EVAL
X`09`09if (!global `26`26 (s = find_mode(tb_values(cbuf), TRUE, `26args)) == TR
VUE) `7B
X`09`09`09mlforce("`5BNot a local mode: `5C"%s`5C"`5D", tb_values(cbuf));
X`09`09`09return FALSE;
X`09`09`7D
X`09`09return set_variable(tb_values(cbuf));
X#else
X`09`09mlforce("`5BNot a legal set option: `5C"%s`5C"`5D", tb_values(cbuf));
X#endif
X`09`7D else if ((s = adjvalueset(tb_\0C06(cbuf), kind, global, `26args)) != 0)
V `7B
X`09`09if (s == TRUE)
X`09`09`09mlerase();`09/* erase the junk */
X`09`09return s;
X`09`7D
X
X`09return FALSE;
X`7D
X
X/*
X * Process the list of mode-settings
X */
Xstatic int
Xadjustmode(`09/* change the editor mode status */
Xint kind,`09/* true = set,`09`09false = delete */
Xint global)`09/* true =\1207 flag,`09false = current buffer flag */
X`7B
X`09int s;
X`09int anything = 0;
X
X`09if (kind `26`26 global &0226 isreturn(end_string()))
X`09`09return listmodes(TRUE,1);
X
X`09while (((s = do_a_mode(kind, global)) == TRUE) `26`26 (end_string() == ' '
V))
X`09`09anything++;
X`09if ((s == SORTOFTRUE) `26`26 anything) /* fix for trailing whitespace */
X`09`09return TRUE;
X
X`09/* if the settings are up, redisplay them */
X`09relist_settings();
X`09relist_majormodes();
X
X`09if (curbp) `7B
X`09`09curtabval = tabstop_val(curbp);
X`09`7D
X
X`09return s;
X`7D
X
X/*
X * Buffer-animation for `5BSettings`5D
X */
X#if OPT_UPBUFF
Xstatic int
Xshow_Settings(BUFFER *bp)
X`7B
X`09b_clr_obsolete(bp);
X`09return listmodes(FALSE, 1);
X`7D
X
Xstatic void
Xrelist_settings(void)
X`7B
X`09update_scratch(SETTINGS_BufName, show_Settings);
X`7D
X#endif`09/* OPT_UPBUFF */
X
X/* ARGSUSED */
Xint
Xsetlocmode(int f GCC_UNUSED, int n\120B)`09/* prompt and set an editor mode */
V
X`7B
X`09return adjustmode(TRUE, FALSE);
X`7D
X
X/* ARGSUSED */
Xint
Xdellocmode(int f GCC_UNUSED, int n\120B)`09/* prompt and delete an editor mode
V */
X`7B
X`09return adjustmode(FALSE, FALSE);
X`7D
X
X/* ARGSUSED */
Xint
Xsetglobmode(int f GCC_UNUSED, int n\120B)`09/* prompt and set a global editor
V mode */
X`7B
X`09return adjustmode(TRUE, TRUE);
X`7D
X
X/* ARGSUSED */
Xint
Xdelglobmode(int f GCC_UNUSED, int n\120B)`09/* prompt and delete a global edit
Vor mode */
X`7B
X`09return adjustmode(FALSE, TRUE);
X`7D
X
X/*
X * The following functions are invoked to carry out side effects of changing
X * modes.
X */
X/*ARGSUSED*/
Xint
Xchgd_autobuf(VALARGS *args GCC_UNUSED, int glob_vals\0F06testing\270B)
X`7B
X`09if (glob_vals)
X`09`09sortlistbuffers();
X`09return TRUE;
X`7D
X
X/*ARGSUSED*/
Xint
Xchgd_buffer(VALARGS *args GCC_UNUSED, int glob_vals\0F06testing\270B)
X`7B
X`09if (!glob_vals) `7B`09/* i.e., ":setl" */
X`09`09if (curbp == 0)
X`09`09`09return FALSE;
X`09`09b_clr_counted(curbp);
X`09`09(void)bsizes(curbp);
X`09`7D
X`09return TRUE;
X`7D
X
Xint
Xchgd_charset(VALARGS *args, int glob_val\0F07testing)
X`7B
X`09if (!testing) `7B
X`09`09charinit();
X`09`7D
X`09return chgd_window(args, glob_vals, testing);
X`7D
X
X#if OPT_COLOR
Xint
Xchgd_color(VALARGS *args, int glob_val\0F07testing)
X`7B
X`09if (!testing) `7B
X`09`09if (`26args->local->vp->i == `26gfcolor)
X`09`09`09TTforg(gfcolor);
X`09`09else if (`26args->local->vp->i == `26gbcolor)
X`09`09`09TTbacg(gbcolor);
X`09`09set_winflags(glob_vals, WFHARD`7CWFCOLR);
X`09`09vile_refresh(FALSE,0);
X`09`7D
X`09return TRUE;
X`7D
X
X#if OPT_EVAL
Xstatic void
Xset_fsm_choice(const char *name, const FSM_CHOICES *\2C06s)
X`7B
X`09size_t n;
X`09for (n = 0; n < TABLESIZE(fsm_tbl); n++) `7B
X`09`09if (!strcmp(name, fsm_tbl`5Bn`5D.mode_name)) `7B
X`09`09`09fsm_tbl`5Bn`5D.choices = \0A07;
X`09`09`09break;
X`09`09`7D
X`09`7D
X`7D
X#endif`09/* OPT_EVAL */
X
Xstatic int
Xreset_color(int n)
X`7B
X`09if (global_g_val(n) > ncolors) `7B
X`09`09set_global_g_val(n, \100E) % ncolors);
X`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X
X#if OPT_ENUM_MODES
Xstatic FSM_CHOICES *my_colors;
Xstatic FSM_CHOICES *my_hilite;
X#endif
X
X/*
X * Set the number of colors to a subset of that which is configured.  The main
V
X * use for this is to switch between 16-colors and 8\0D07, though it should
X * work for setting any power of 2 up to the NCOLORS value.
X */
Xint set_ncolors(int n)
X`7B
X`09static int initialized;
X#if OPT_ENUM_MODES
X`09const FSM_CHOICES *the_colors,\0D06hilite;
X`09size_t s, d;
X#endif
X
X`09if (n > NCOLORS `7C`7C n < 2)
X`09`09return FALSE;
X`09if (!initialized)
+-+-+-+-+-+-+-+-  END  OF PART 75 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 76 -+-+-+-+-+-+-+-+
X`09`09initialized = n;
X`09if (n > initialized)
X`09`09return FALSE;
X`09ncolors = n;
X`09if (reset_color(GVAL_FCOLOR)
X`09 `7C`7C reset_color(GVAL_BCOLOR)) `7B
X`09`09vile_refresh(FALSE,0);
X`09`7D
X
X#if OPT_ENUM_MODES
X`09if (ncolors == NCOLORS) `7B
X`09`09the_colors = fsm\0D06_choices;
X`09`09the_hilite = fsm\0D07_choices;
X`09`7D else `7B
X`09`09my_colors = typecallocn(FSM_CHOICES,TABLESIZE(fsm\2F06_choices));
X`09`09my_hilite = typecallocn(FSM_CHOICES,TABLESIZE(fsm\2F07_choices));
X`09`09the_colors = my\0C07;
X`09`09the_hilite = my\0C07;
X`09`09for (s = d = 0; s < TABLESIZE(fsm_color_choices)-1; s++) `7B
X`09`09`09my_colors`5Bd`5D = fsm\1006_choices`5Bs`5D;
X`09`09`09if (my_colors`5Bd`5D.choice_code > 0) `7B
X`09`09&0209if (!(my_colors`5Bd`5D.choice_code %= n\1A06))
X`09`09&0209`09continue;
X`09`09`09`7D
X`09`09`09if (strncmp(my_colors`5Bd`5D.choice_name, "bright", 6))
X`09`09&0209d++;
X`09`09`7D
X`09`09my_colors`5Bd`5D.choice_name = 0;
X
X`09`09for (s = d = 0; s < TABLESIZE(fsm_hilite_choices)-1; s++) `7B
X`09`09`09my_hilite`5Bd`5D = fsm\1007_choices`5Bs`5D;
X`09`09`09if (my_hilite`5Bd`5D.choice_code `26 VASPCOL) `7B
X`09`09&0209unsigned code = my_hilite`5Bd`5D.choice_code % NCOLORS;
X`09`09&0209if (code != 0) `7B
X`09`09&0209`09if ((code %= ncolors) == 0)
X`09`09&0209&0209continue;
X`09`09&0209`09my_hilite`5Bd`5D.choice_code = VASPCOL `7C code;
X`09`09&0209`7D
X`09`09&0209if (strncmp(my_hilite`5Bd`5D.choice_name, "bright", 6))
X`09`09&0209`09d++;
X`09`09`09`7D else `7B
X`09`09&0209d++;
X`09`09`09`7D
X`09`09`7D
X`09`09my_hilite`5Bd`5D.choice_name = 0;
X`09`7D
X`09set_fsm_choice("fcolor", the_colors);
X`09set_fsm_choice("bcolor", the_colors);
X`09set_fsm_choice("visual-matches", the_hilite);
X`09set_fsm_choice("mini-hilite", the_\0D06);
X#endif /* OPT_ENUM_MODES */
X`09return TRUE;
X`7D
X#endif`09/* OPT_COLOR */
X
X`09/* Report mode that cannot be changed */
X/*ARGSUSED*/
Xint
Xchgd_disabled(VALARGS *args, int glob_vals GCC_UNUSED\1A06testing\180B)
X`7B
X`09mlforce("`5BCannot change `5C"%s`5C" `5D", args->name\0707);
X`09return FALSE;
X`7D
X
X`09/* Change "fences" mode */
X/*ARGSUSED*/
Xint
Xchgd_fences(VALARGS *args, int glob_vals GCC_UNUSED\1A06testing)
X`7B
X`09if (!testing) `7B
X`09`09/* was even number of fence pairs specified? */
X`09`09char *value = args->local->v.p;
X`09`09size_t len = strlen(value);
X
X`09`09if (len `26 1) `7B
X`09`09`09value`5Blen-1`5D = EOS;
X`09`09`09mlwrite(
X`09`09`09"`5BFence-pairs not in pairs:  truncating to `5C"%s`5C"",
X`09`09&0209value);
X`09`09`09return FALSE;
X`09`09`7D
X`09`7D
X`09return TRUE;
X`7D
X
X`09/* Change a "major" mode */
Xint
Xchgd_major(VALARGS *args, int glob_val\0F07testing)
X`7B
X`09/* prevent major-mode changes for scratch-buffers */
X`09if (testing) `7B
X`09`09if (!glob_vals) `7B
X`09`09`09if (b_is_scratch(curbp))
X`09`09&0209return chgd_disabled(args, glob_vals, testing);
X`09`09`7D
X`09`7D else `7B
X`09`09set_winflags(glob_vals, WFMODE);
X`09`7D
X`09return TRUE;
X`7D
X
X`09/* Change a major mode that affects the windows on the buffer */
Xint
Xchgd_major_w(VALARGS *args, int glob_val\0F07testing)
X`7B
X`09if (testing) `7B
X`09`09if (!chgd_major(args, glob_vals, testing))
X`09`09`09return FALSE;
X`09`09return chgd_window(args, glob_vals, testing);
X`09`7D
X
X`09set_winflags(glob_vals, WFHARD`7CWFMODE);
X`09return TRUE;
X`7D
X
X`09/* Change something on the mode/status line */
X/*ARGSUSED*/
Xint
Xchgd_status(VALARGS *args GCC_UNUSED, int glob_vals\0F06testing)
X`7B
X`09if (!testing) `7B
X`09`09set_winflags(glob_vals, WFSTAT);
X`09`7D
X`09return TRUE;
X`7D
X
X`09/* Change a mode that affects the windows on the buffer */
X/*ARGSUSED*/
Xint
Xchgd_window(VALARGS *args GCC_UNUSED, int glob_vals\0F06testing)
X`7B
X`09if (!testing) `7B
X`09`09set_winflags(glob_vals, WFHARD);
X`09`7D
X`09return TRUE;
X`7D
X
X`09/* Change the working mode */
X#if OPT_WORKING
X/*ARGSUSED*/
Xint
Xchgd_working(VALARGS *args GCC_UNUSED, int glob_vals\0F06testing\270B)
X`7B
X`09if (glob_vals)
X`09`09imworking(0);
X`09return TRUE;
X`7D
X#endif
X
X`09/* Change the xterm-mouse mode */
X/*ARGSUSED*/
Xint
Xchgd_xterm(VALARGS *args GCC_UNUSED, int glob_vals\0F06testing\270B)
X`7B
X#if`09OPT_XTERM
X`09if (glob_vals) `7B
X`09`09int`09new_state = global_g_val(GMDXTERM_MOUSE);
X`09`09set_global_g_val(GMDXTERM_MOUSE,TRUE);
X`09`09if (!new_state)`09TTkclose();
X`09`09else&0209TTkopen();
X`09`09set_global_g_val(GMDXTERM_MOUSE,new_state);
X`09`7D
X#endif
X`09return TRUE;
X`7D
X
X`09/* Change a mode that affects the search-string highlighting */
X/*ARGSUSED*/
Xint
Xchgd_hilite(VALARGS *args GCC_UNUSED, int glob_val\1A12testing)
X`7B
X`09if (!testing)
X`09`09attrib_matches();
X`09return TRUE;
X`7D
X
X/*--------\0808\1010\2020\400A*/
X
X#if OPT_EVAL `7C`7C OPT_MAJORMODE
X/*
X * Test for mode-names that we'll not show in the variable name-completion.
X */
Xint
Xis_varmode (const char *name)
X`7B
X`09return (strncmp(name, "no", 2)
X`09   `26`26   strcmp(name, "all"));
X`7D
X
Xstatic int
Xis_identifier (const char *name)
X`7B
X`09int first = TRUE;;
X
X`09while (*name != EOS) `7B
X`09`09if (first) `7B
X`09`09`09if (!isAlpha(*name))
X`09`09&0209return FALSE;
X`09`09`09first = FALSE;
X`09`09`7D else if (!isident(*name))
X`09`09`09return FALSE;
X`09`09name++;
X`09`7D
X`09return TRUE;
X`7D
X
X/*
X * Returns the current number of items in the list of modes
X */
Xstatic size_t
Xcount_modes (void)
X`7B
X`09size_t n;
X
X`09init_my_mode_list();
X
X`09for (n = 0; my_mode_list`5Bn`5D != 0; n++)
X`09`09;
X`09return n;
X`7D
X
X/*
X * Return a list of only the modes that can be set with ":setv", ignoring
X * artifacts such as "all".
X */
Xconst char *\0C06*
Xlist_of_modes (void)
X`7B
X`09if (my_varmodes == 0) `7B
X`09`09const char *\0C06*s;
X`09`09const char **d;
X`09`09size_t n = count_modes();
X`09`09my_varmodes = typeallocn(const char *, n + 1);
X`09`09for (s = my_mode_list, d\1206varmodes; (*d = *s) != 0; s++) `7B
X`09`09`09if (is_varmode(*d)) `7B
X`09`09&0209d++;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09return my_varmodes;
X`7D
X#endif /* OPT_EVAL `7C`7C OPT_MAJORMODE */
X
X/*--------\0808\1010\2020\400A*/
X
X#if OPT_MAJORMODE
Xstatic int
Xok_submode(const char *name)
X`7B
X`09/* like is_varmode, but allow "no" prefix */
X`09return strcmp(name, "all") != 0 ? TRUE : FALSE;
X`7D
X
X/* format the name of a majormode's qualifier */
Xstatic char *
Xper_major(char *dst, const char *majr, int code\0A06brief)
X`7B
X`09if (brief) `7B
X`09`09(void) lsprintf(dst, "%s%s", majr, m_valnames`5Bcode`5D.shortname);
X`09`7D else `7B
X`09`09(void) lsprintf(dst, "%s-%s", majr, m_valnames`5Bcode`5D.name);
X`09`7D
X`09return dst;
X`7D
X
X/* format the name of a majormode's submode */
Xstatic char *
Xper_submode(char *dst, const char *majr, int code\0A06brief)
X`7B
X`09if (brief) `7B
X`09`09if (!strcmp(b_valnames`5Bcode`5D.shortname, "X")) `7B
X`09`09`09*dst = EOS;
X`09`09`09return 0;
X`09`09`7D
X`09`09(void) lsprintf(dst, "%s%s", majr, b_valnames`5Bcode`5D.shortname);
X`09`7D else `7B
X`09`09(void) lsprintf(dst, "%s-%s", majr, b_valnames`5Bcode`5D.name);
X`09`7D
X`09return dst;
X`7D
X
Xstatic char *TheMajor;
X
Xstatic const char *
XModeName(const char *name)
X`7B
X`09if (TheMajor != 0) `7B
X`09`09static char *dst;
X`09`09if (dst != 0)
X`09`09`09free(dst);
X`09`09dst = typeallocn(char, strlen(TheMajor) +\1308name) + 3);
X`09`09(void) lsprintf(dst, "%s-%s", TheMajor, name);
X`09`09return dst;
X`09`7D
X`09return name;
X`7D
X
X/* format the name of a majormode */
Xstatic char *
Xmajorname(char *dst, const char *majr, int flag)
X`7B
X`09(void) lsprintf(dst, "%s%smode", flag ? "" : "no", majr);
X`09return dst;
X`7D
X
X/*
X * Returns the current number of items in the list of modes
X */
Xstatic size_t
Xcount_majormodes (void)
X`7B
X`09size_t n = 0;
X
X`09if (my_majormodes != 0) `7B
X`09`09for (n = 0; my_majormodes`5Bn`5D.name != 0; n++)
X`09`09`09;
X`09`7D
X`09return n;
X`7D
X
Xstatic int
Xfound_per_submode(const char *majr, int code)
X`7B
X`09size_t n;
X`09char temp`5BNSTRING`5D;
X
X`09init_my_mode_list();
X
X`09(void) per_submode(temp, majr, code, TRUE);
X`09for (n = 0; my_mode_list`5Bn`5D != 0; n++) `7B
X`09`09if (!strcmp(my_mode_list`5Bn`5D, temp))
X`09`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X
X/*
X * Insert 'name' into 'my_mode_list`5B`5D', which has 'count' entries.
X */
Xstatic size_t
Xinsert_per_major(size_t count, const char *name)
X`7B
X`09if (name != 0) `7B
X`09`09size_t j, k;
X
X`09`09TRACE(("insert_per_major %ld %s`5Cn", (long) count, name))
X
X`09`09for (j = 0; j < count; j++) `7B
X`09`09`09if (strcmp(my_mode_list`5Bj`5D, name) > 0)
X`09`09&0209break;
X`09`09`7D
X`09`09for (k = ++count; k != j; k--)
X`09`09`09my_mode_list`5Bk`5D = \120E-1`5D;
X`09`09my_mode_list`5Bj`5D = strmalloc(name);
X`09`7D
X`09return count;
X`7D
X
X/*
X * Remove 'name' from 'my_mode_list`5B`5D', which has 'count' entries.
X */
Xstatic size_t
Xremove_per_major(size_t count, const char *name)
X`7B
X`09if (name != 0) `7B
X`09`09size_t j, k;
X
X`09`09for (j = 0; j < count; j++) `7B
X`09`09`09if (strcmp(my_mode_list`5Bj`5D, name) == 0) `7B
X`09`09&0209free(TYPECAST(char,my_mode_list`5Bj`5D));
X`09`09&0209count--;
X`09`09&0209for (k = j; k <= count; k++)
X`09`09&0209`09my_mode_list`5Bk`5D = \120E+1`5D;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09return count;
X`7D
X
X/*
X * Lookup a majormode's data area, given its short name, e.g., "c" vs "cmode".
V
X * We store the majormodes in an array to simplify name completion, though thi
Vs
X * complicates definition and removal.
X */
Xstatic MAJORMODE *
Xlookup_mm_data(const char *name)
X`7B
X`09size_t n;
X`09if (my_majormodes != 0) `7B
X`09`09for (n = 0; my_majormodes`5Bn`5D.name != 0; n++) `7B
X`09`09`09if (!strcmp(name, my_majormodes`5Bn`5D.name))
X`09`09&0209return my_majormodes`5Bn`5D.data;
X`09`09`7D
X`09`7D
X`09return 0;
X`7D
X
X/*
X * Lookup a majormode's data area, given its short name, e.g., "c" vs "cmode".
V
X * We store the majormodes in an array to simplify name completion, though thi
Vs
X * complicates definition and removal.
X */
Xstatic MAJORMODE_LIST *
Xlookup_mm_list(const char *name)
X`7B
X`09size_t n;
X`09if (my_majormodes != 0) `7B
X`09`09for (n = 0; my_majormodes`5Bn`5D.name != 0; n++) `7B
X`09`09`09if (!strcmp(name, my_majormodes`5Bn`5D.name))
X`09`09&0209return my_majormodes+n;
X`09`09`7D
X`09`7D
X`09return 0;
X`7D
X
X/* Check if a majormode is predefined.  There are some things we don't want to
V
X * do to them (such as remove them).
X */
Xstatic int predef_majormode(const char *name)
X`7B
X`09size_t n;
X`09int status = FALSE;
X
X`09if (my_majormodes != 0) `7B
X`09`09for (n = 0; my_majormodes`5Bn`5D.name != 0; n++) `7B
X`09`09`09if (!strcmp(name, my_majormodes`5Bn`5D.name)) `7B
X`09`09&0209status = my_majormodes`5Bn`5D.init;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09return status;
X`7D
X
Xstatic int
Xmajor_complete(int c, char *buf, unsigned *pos)
X`7B
X`09return kbd_complete(FALSE, c, buf, pos, (const char *)`26my_majormodes`5B0
V`5D,
X`09`09sizeof(my_majormodes`5B0`5D));
X`7D
X
Xstatic int
Xprompt_majormode(char **result, int defining)
X`7B
X`09static TBUFF *cbuf; `09/* buffer to receive mode name into */
X`09int status;
X
X`09/* prompt the user and get an answer */
X`09tb_scopy(`26cbuf, "");
X`09if ((status = kbd_reply("majormode: ",
X`09`09`26cbuf,
X`09`09eol_history, ' ',
X`09`09KBD_NORMAL,`09/* FIXME: KBD_MAYBEC if !defining */
X`09`09(defining `7C`7C clexec)
X`09`09`09? no_completion
X`09`09`09: major_complete)) == TRUE) `7B
X`09`09/* check for legal name (alphanumeric) */
X`09`09if ((status = is_identifier(tb_values(cbuf))) != TRUE) `7B
X`09`09`09mlwarn("`5BNot an identifier: %s`5D", tb_values(cbuf));
X`09`09`09return status;
X`09`09`7D
X`09`09if ((status = is_varmode(tb_values(cbuf))) == TRUE) `7B
X`09`09`09*result = tb_values(cbuf);
X`09`09`09if (defining `26`26 lookup_mm_data(*result) != 0) `7B
X`09`09&0209TRACE(("Mode already exists`5Cn"))
X`09`09&0209return SORTOFTRUE;
X`09`09`09`7D else if (!defining `26`26 lookup_mm_data(*result) == 0) `7B
X`09`09&0209TRACE(("Mode does not exist`5Cn"))
X`09`09&0209return SORTOFTRUE;
X`09`09`09`7D
X`09`09`09return TRUE;
X`09`09`7D
X`09`7D
X`09if (status != FALSE)
X`09`09mlwarn("`5BIllegal name %s`5D", tb_values(cbuf));
X`09return status;
X`7D
X
Xstatic int
Xsubmode_complete(int c, char *buf, unsigned *pos)
X`7B
X`09return kbd_complete(FALSE, c, buf, pos, (const char *)`26all_submodes`5B0
V`5D,
X`09`09sizeof(all_submodes`5B0`5D));
X`7D
X
Xstatic int
Xprompt_submode(char **result, int defining)
X`7B
X`09static TBUFF *cbuf; `09/* buffer to receive mode name into */
X`09register const char *rp;
X`09int status;
X
X`09/* prompt the user and get an answer */
X`09tb_scopy(`26cbuf, "");
X`09if ((status = kbd_reply("submode: ",
X`09`09`26cbuf,
X`09`09eol_history, '=',
X`09`09KBD_NORMAL,
X`09`09submode_complete)) == TRUE) `7B
X`09`09if ((status = ok_submode(tb_values(cbuf))) == TRUE) `7B
X`09`09`09*result = tb_values(cbuf);
X`09`09`09rp = !strncmp(*result, "no", 2) ? \1407+2 :\0C08;
X`09`09`09if (defining `26`26 lookup_mm_data(rp) != 0) `7B
X`09`09&0209TRACE(("Mode already exists`5Cn"))
X`09`09&0209return SORTOFTRUE;
X`09`09`09`7D else if (!defining `26`26 lookup_mm_data(rp) == 0) `7B
X`09`09&0209TRACE(("Mode does not exist`5Cn"))
X`09`09&0209return SORTOFTRUE;
X`09`09`09`7D
X`09`09`09return TRUE;
X`09`09`7D
X`09`7D
X`09mlwarn("`5BIllegal name %s`5D", tb_values(cbuf));
X`09return status;
X`7D
X
X/*
X * Attach a buffer to the given majormode.  Adjust all of the non-local\3C07
X * modes to point to the majormode's values where those in turn are local.
X */
Xstatic int
Xattach_mmode(BUFFER *bp, const char *name)
X`7B
X`09int n;
X
X`09if (bp != 0) `7B
X`09`09if (bp->majr != 0
X`09`09 `26`26 strcmp(bp->majr->name, name) != 0)
X`09`09`09(void) detach_mmode(bp, bp->majr->name);
X
X`09`09TRACE(("attach_mmode '%s' to '%s'`5Cn", name, bp->b_bname))
X`09`09if ((bp->majr = lookup_mm_data(name)) != 0) `7B
X`09`09`09struct VAL *mm = bp->majr->mb.bv;
X
X`09`09`09/* adjust buffer modes */
X`09`09`09for (n = 0; n < MAX_B_VALUES; n++) `7B
X`09`09&0209if (!is_local_b_val(bp,n)
X`09`09&0209 `26`26 is_local_val(mm,n)) `7B
X`09`09&0209`09make_global_val(bp->b_values.bv, mm, n);
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09return TRUE;
X`09`09`7D
X`09`09return (bp->majr != 0);
X`09`7D
X
X`09return FALSE;
X`7D
X
X/*
X * Detach a buffer from the given majormode.  Modify the \2D06's minor modes
X * to point to global modes where they've been\2906ed to the majormode's data.
V
X */
Xstatic int
Xdetach_mmode(BUFFER *bp, const char *name)
X`7B
X`09size_t n;
X`09MAJORMODE *mp = 0;
X
X`09if (bp != 0
X`09 `26`26 (mp = bp->majr) != 0
X`09 `26`26 !strcmp(mp->name, name)) `7B
X`09`09TRACE(("detach_mmode '%s', given '%s'`5Cn", name, mp->name))
X`09`09/* readjust the buffer's modes */
X`09`09for (n = 0; n < MAX_B_VALUES; n++) `7B
X`09`09`09if (!is_local_b_val(bp,n)
X`09`09`09 `26`26 is_local_val(mp->mb.bv,n)) `7B
X`09`09&0209make_global_b_val(bp,n);
X`09`09`09`7D
X`09`09`7D
X`09`09relist_settings();
X`09`09bp->majr = 0;
X`09`09return TRUE;
X`09`7D
X
X`09return FALSE;
X`7D
X
Xstatic int
Xenable_mmode(const char *name, int flag)
X`7B
X`09MAJORMODE_LIST *ptr = lookup_mm_list(name);
X`09if (ptr != 0
X`09 `26`26 ptr->flag != flag) `7B
X`09`09ptr->flag = flag;
X`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X
Xstatic int
Xfree_majormode(const char *name)
X`7B
X`09MAJORMODE *ptr = lookup_mm_data(name);
X`09size_t j, k;
X`09int n;
X`09char temp`5BNSTRING`5D;
X`09BUFFER *bp;
X
X`09if (ptr != 0) `7B
X`09`09int init = TRUE;
X`09`09for (j = 0; my_majormodes`5Bj`5D.name != 0; j++) `7B
X`09`09`09if (my_majormodes`5Bj`5D.data == ptr) `7B
X`09`09&0209init = my_majormodes`5Bj`5D.init;
X`09`09&0209for_each_buffer(bp) `7B
X`09`09&0209`09if (detach_mmode(bp, my_majormodes`5Bj`5D.name)) `7B
X`09`09&0209&0209set_winflags(TRUE, WFHARD`7CWFMODE);
X`09`09&0209`09`7D
X`09`09&0209`7D
X`09`09&0209free_local_vals(m_valnames, major_g_vals, ptr->mm.mv);
X`09`09&0209free_local_vals(b_valnames, global_b_values.bv, ptr->mb.bv);
X`09`09&0209for (k = 0; k < MAX_M_VALUES; k++) `7B
X`09`09&0209`09free(TYPECAST(char,my_majormodes`5Bj`5D.qual`5Bk`5D.name));
X`09`09&0209`09free(TYPECAST(char,my_majormodes`5Bj`5D.qual`5Bk`5D.shortname));
V
X`09`09&0209`7D
X`09`09&0209free(ptr->name);
X`09`09&0209free(ptr);
X`09`09&0209do `7B
X`09`09&0209`09my_majormodes`5Bj`5D = \130F+1`5D;
X`09`09&0209`7D while (my_majormodes`5Bj++`5D.name != 0);
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`09if (my_mode_list != all_modes `26`26 !init) `7B
X`09`09`09j = count_modes();
X`09`09`09j = remove_per_major(j, majorname(temp, name, FALSE));
X`09`09`09j = remove_per_major(j, majorname(temp, name, TRUE));
X`09`09`09for (n = 0; n < MAX_M_VALUES; n++) `7B
X`09`09&0209j = remove_per_major(j,
X`09`09&0209`09per_major(temp, name, n, TRUE));
X`09`09&0209j = remove_per_major(j,
X`09`09&0209`09per_major(temp, name, n, FALSE));
X`09`09`09`7D
X`09`09`7D
X`09`09if (major_valnames != 0) `7B
X`09`09`09for (n = 0; major_valnames`5Bn`5D.name != 0; n++) `7B
X`09`09&0209if (!strcmp(name, major_valnames`5Bn`5D.shortname)) `7B
X`09`09&0209`09free(TYPECAST(char,major_valnames`5Bn`5D.name));
X`09`09&0209`09free(TYPECAST(char,major_valnames`5Bn`5D.shortname));
X`09`09&0209`09while (major_valnames`5Bn`5D.name != 0) `7B
X`09`09&0209&0209major_valnames`5Bn`5D =
X`09`09&0209&0209major_valnames`5Bn+1`5D;
X`09`09&0209&0209n++;
X`09`09&0209`09`7D
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`7D
X`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X
Xstatic void
Xinit_my_mode_list(void)
X`7B
X`09if (my_mode_list == 0)
X`09`09my_mode_list = TYPECAST(const char *,all_modes);
X`7D
X
Xstatic int
Xextend_mode_list(int increment)
X`7B
X`09int j = count_modes();
X`09int k = increment + j + 1;
X
X`09TRACE(("extend_mode_list from %d by %d`5Cn", j, increment))
X
X`09if (my_mode_list == all_modes) `7B
X`09`09my_mode_list = typeallocn(const char *, k);
X`09`09memcpy((char *)my_mode_list, all_modes, (j+1) * sizeof(*\290C));
X`09`7D else `7B
X`09`09my_mode_list = typereallocn(const char *, \2A0C, k);
X`09`7D
X`09return j;
X`7D
X
Xstatic struct VAL *
Xextend_VAL_array(struct VAL *ptr, size_t item\0D09len)
X`7B
X`09size_t j, k;
X
X`09TRACE(("extend_VAL_array %p item %ld of %ld`5Cn", ptr, (long)item\0C08len))
V
X
X`09if (ptr == 0) `7B
X`09`09ptr = typeallocn(struct VAL, len + 1);
X`09`7D else `7B
X`09`09ptr = typereallocn(struct VAL, ptr, len + 1);
X`09`09for (j = k = 0; j < len; j++) `7B
X`09`09`09k = (j >= item) ? j+1 : j;
X`09`09`09ptr`5Bk`5D = ptr`5Bj`5D;
X`09`09`09make_local_val(ptr, k);
X`09`09`7D
X`09`7D
X`09make_local_val(ptr, item);
X`09make_local_val(ptr, len);
X`09ptr`5Bitem`5D.v.i = FALSE;
X`09return ptr;
X`7D
X
Xstatic void
Xset_qualifier(const struct VALNAMES *names,\180B *values, \3206char *s)
X`7B
X`09switch (names->type) `7B
X`09case VALTYPE_STRING:
X`09`09if (values->v.p)
X`09`09`09free(values->v.p);
X`09`09values->v.p = strmalloc(s);
X`09`09break;
X`09case VALTYPE_REGEX:
X`09`09free_regexval(values->v.r);
X`09`09values->v.r = new_regexval(s, TRUE);
X`09`09break;
X`09`7D
X`09make_local_val(values, 0);
X`7D
X
Xstatic void
Xreset_qualifier(const struct VALNAMES *names,\180B *values)
X`7B
X`09set_qualifier(names, values, "");
X`7D
X
X/*
X * Buffer-animation for `5BMajor Modes`5D
X */
X#if OPT_UPBUFF
Xstatic int
Xshow_majormodes(BUFFER *bp)
X`7B
X`09b_clr_obsolete(bp);
X`09return list_majormodes(FALSE, 1);
X`7D
X
Xstatic void
Xrelist_majormodes(void)
X`7B
X`09update_scratch(MAJORMODES_BufName, show_majormodes);
X`7D
X#endif`09/* OPT_UPBUFF */
X
X/* list the current modes into\170Dbuffer */
X/* ARGSUSED */
Xstatic void
Xmakemajorlist(int local, void *ptr GCC_UNUSED)
X`7B
X`09int j;
X`09int nflag;
X`09MAJORMODE *data;
X
X`09if (my_majormodes != 0) `7B
X`09`09for (j = 0; my_majormodes`5Bj`5D.name != 0; j++) `7B
X`09`09`09if (local)
X`09`09&0209TheMajor = my_majormodes`5Bj`5D.name;
X`09`09`09nflag = 0;
X`09`09`09data = my_majormodes`5Bj`5D.data;
X`09`09`09bprintf("--- `5C"%s`5C" majormode settings %*P`5Cn",
X`09`09&0209my_majormodes`5Bj`5D.name,
X`09`09&0209term.t_ncol-1, '-');
X`09`09`09nflag = listvalueset("Qualifier", FALSE, TRUE,
X`09`09&0209m_valnames,
X`09`09&0209data->mm.mv,
X`09`09&0209data->mm.mv);
X`09`09`09nflag = listvalueset("Buffer",    nflag, TRUE,
X`09`09&0209b_valnames,
X`09`09&0209data->mb.bv,
X`09`09&0209global_b_values.bv);
X`09`09`09if (my_majormodes`5Bj+1`5D.data)
X`09`09&0209bputc('`5Cn');
X`09`09`7D
X`09`7D
X`09TheMajor = 0;
X`7D
X
X/* ARGSUSED */
Xint
Xlist_majormodes(int f, int n GCC_UNUSED)
X`7B
X`09register WINDOW *wp = curwp;
X`09register int s;
X
X`09s = liststuff(MAJORMODES_BufName, FALSE, makemajorlist,f,(void *)wp);
X`09/* back to the buffer whose modes we just listed */
X`09if (swbuffer(wp->w_bufp))
X`09`09curwp = wp;
X
X`09return s;
X`7D
X
Xint
Xalloc_mode(const char *name, int predef)
X`7B
X`09size_t j, k;
X`09int n;
X`09char temp`5BNSTRING`5D;
X
X`09if (major_valnames == 0) `7B
X`09`09major_valnames = typecallocn(struct VALNAMES, 2);
X`09`09j = 0;
X`09`09k = 1;
X`09`7D else `7B
X`09`09k = count_majormodes();
X`09`09major_valnames = typereallocn(struct VALNAMES, \2F0E, k+2);
X`09`09for (j = k++; j != 0; j--) `7B
X`09`09`09major_valnames`5Bj`5D = \1410-1`5D;
X`09`09`09if (strcmp(major_valnames`5Bj-1`5D.shortname, name) < 0) `7B
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X
X`09(void) majorname(temp, name, TRUE);
X`09major_valnames`5Bj`5D.name        = strmalloc(temp);
X`09major_valnames`5Bj`5D.shortname   = strmalloc(name);
X`09major_valnames`5Bj`5D.type        = VALTYPE_MAJOR;
X`09major_valnames`5Bj`5D.side_effect = chgd_\2506w;
X
X`09memset(major_valnames+k, 0, sizeof(*\1D0E));
X
X`09/* build arrays needed for 'find_mode()' bookkeeping */
X`09major_g_vals = extend_VAL_array(\200C, j, k);
X`09major_l_vals = extend_VAL_array(\200C, j, k);
X
X`09if (my_majormodes == 0) `7B
X`09`09my_majormodes = typecallocn(MAJORMODE_LIST, 2);
X`09`09j = 0;
X`09`09k = 1;
X`09`7D else `7B
X`09`09k = count_majormodes();
X`09`09my_majormodes = typereallocn(MAJORMODE_LIST, \2D0D, k+2);
X`09`09for (j = k++; j != 0; j--) `7B
X`09`09`09my_majormodes`5Bj`5D = \130F-1`5D;
X`09`09`09if (strcmp(my_majormodes`5Bj-1`5D.name, name) < 0) `7B
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X
X`09my_majormodes`5Bj`5D.data = typecalloc(MAJORMODE);
X`09my_majormodes`5Bj`5D.name = \1811data->\1E07strmalloc(name);
X`09my_majormodes`5Bj`5D.init = predef;
X`09my_majormodes`5Bj`5D.flag = TRUE;
X`09memset(my_majormodes+k, 0, sizeof(*\1C0D));
X
X`09for (k = 0; k < MAX_B_VALUES; k++) `7B
X`09`09make_global_val(my_majormodes`5Bj`5D.data->mb.bv, \2907b_values.bv, k);
V
X`09`7D
X
X`09/* copy array to get types, then overwrite the name-pointers */
X`09memcpy(my_majormodes`5Bj`5D.qual, m_valnames, sizeof(m\1309));
X`09for (k = 0; k < MAX_M_VALUES; k++) `7B
X`09`09reset_qualifier(m_valnames+k, my_majormodes`5Bj`5D.data->mm.mv+k);
X`09`09my_majormodes`5Bj`5D.qual`5Bk`5D.name =
X`09`09&0209strmalloc(per_major(temp, name, k, TRUE));
X`09`09my_majormodes`5Bj`5D.qual`5Bk`5D.shortname =
X`09`09&0209strmalloc(per_major(temp, name, k, FALSE));
X`09`7D
X
X`09/*
X`09 * Create the majormode-specific names.  If this is predefined, we
X`09 * already had mktbls do this.
X`09 */
X`09if (!predef) `7B
X`09`09j = extend_mode_list((MAX_M_VALUES + 2) * 2);
X`09`09j = insert_per_major(j, majorname(temp, name, FALSE));
X`09`09j = insert_per_major(j, majorname(temp, name, TRUE));
X`09`09for (n = 0; n < MAX_M_VALUES; n++) `7B
X`09`09`09j = insert_per_major(j, \0D0Atemp, name, n, TRUE));
X`09`09`09j = insert_per_major(j, \0D0Atemp, name, n, FALSE));
X`09`09`7D
X`09`7D
X
X`09return TRUE;
X`7D
X
X/* ARGSUSED */
Xint
Xdefine_mode(int f GCC_UNUSED, int n\120B)
X`7B
X`09char *name;
X`09int status;
X
X`09if ((status = prompt_majormode(`26name, TRUE)) == TRUE) `7B
X`09`09TRACE(("define majormode:%s`5Cn", name))
X`09`09status = alloc_mode(name, FALSE);
X`09`09relist_settings();
X`09`09relist_majormodes();
X`09`7D else if (status == SORTOFTRUE) `7B
X`09`09status = TRUE;`09/* don't complain if it's already true */
X`09`7D
X`09return status;
X`7D
X
Xstatic int
Xdo_a_submode(int defining)
X`7B
X`09char *name;
X`09char *subname;
X`09int status;
X`09MAJORMODE *ptr;
X`09VALARGS args;
X`09int j, k;
X`09int qualifier = FALSE;
X`09char temp`5BNSTRING`5D;
X`09char *rp;
X
X`09if ((status = prompt_majormode(`26name, FALSE)) != TRUE)
X`09`09return status;
X
X`09if ((status = prompt_submode(`26subname, TRUE)) != TRUE)
X`09`09return status;
X
X`09ptr = lookup_mm_data(name);
X`09rp = !strncmp(subname, "no", 2) ? \1407+2 :\0C08;
X`09if ((j = lookup_valnames(rp, m\0F09)) >= 0) `7B
X`09`09qualifier   = TRUE;
X`09`09args.names  = m_valnames;
X`09`09args.global = ptr->mm.mv;
X`09`09args.local  = ptr->mm.mv;
X`09`7D else if ((j = lookup_valnames(rp, b\0F09)) >= 0) `7B
X`09`09args.names  = b_valnames;
X`09`09args.global = defining ? ptr->mb.bv :\2006_b_values.bv;
X`09`09args.local  = ptr->mb.bv;
X`09`7D else `7B
X`09`09mlwarn("`5BBUG: no such submode %s`5D", rp);
X`09`09return FALSE;
X`09`7D
X
X`09args.names  += j;
X`09args.global += j;
X`09args.local  += j;
X
X`09/*
X`09 * We store submodes in the majormode as local values.
X`09 */
X`09status = adjvalueset(subname, defining, FALSE, `26args);
X
X`09/*
X`09 * Check if we deleted one of the qualifiers, since there's no global
X`09 * value to inherit back to, we'll have to ensure there's valid data.
X`09 */
X`09if (status == TRUE
X`09 `26`26 qualifier
X`09 `26`26 !defining) `7B
X`09`09reset_qualifier(args.names, args.global);
X`09`7D
X
X`09if (status == TRUE
X`09 `26`26 !qualifier) `7B
X`09`09if (defining `26`26 found_per_submode(name, j)) `7B
X`09`09`09TRACE(("submode names for %d present`5Cn", j))
X`09`09`7D else if (defining) `7B
X`09`09`09TRACE(("construct submode names for %d`5Cn", j))
X`09`09`09k = extend_mode_list(2);
X`09`09`09k = insert_per_major(k,
X`09`09&0209per_submode(temp, name, j, TRUE));
X`09`09`09k = insert_per_major(k,
X`09`09&0209per_submode(temp, name, j, FALSE));
X`09`09`7D else `7B
X`09`09`09TRACE(("destroy submode names for %d`5Cn", j))
X`09`09`09k = count_modes();
X`09`09`09k = remove_per_major(k,
X`09`09&0209per_submode(temp, name, j, TRUE));
X`09`09`09k = remove_per_major(k,
X`09`09&0209per_submode(temp, name, j, FALSE));
X`09`09`7D
X`09`7D
X
X`09/* FIXME: remember to adjust all buffers that used this mode, in
X`09 * case we make a minor mode part-of or removed from the maj\2707.
X`09 */
X`09relist_settings();
X`09relist_majormodes();
X`09return TRUE;
X`7D
X
X/* ARGSUSED */
Xint
Xdefine_submode(int f GCC_UNUSED, int n\120B)
X`7B
X`09return do_a_submode(TRUE);
X`7D
X
X/* ARGSUSED */
Xint
Xremove_submode(int f GCC_UNUSED, int n\120B)
X`7B
X`09return do_a_submode(FALSE);
X`7D
X
X/* ARGSUSED */
Xint
Xremove_mode(int f GCC_UNUSED, int n\120B)
X`7B
X`09char *name;
X`09int status;
X
X`09if ((status = prompt_majormode(`26name, FALSE)) == TRUE) `7B
X`09`09if ((status = !predef_majormode(name)) == TRUE) `7B
X`09`09`09TRACE(("remove majormode:%s`5Cn", name))
X`09`09`09free_majormode(name);
X`09`09`09relist_settings();
X`09`09`09relist_majormodes();
X`09`09`7D else `7B
X`09`09`09mlwarn("`5BThis is a predefined mode: %s`5D", name);
X`09`09`7D
X`09`7D else if (status == SORTOFTRUE) `7B
X`09`09status = TRUE;
X`09`7D
X`09return status;
X`7D
X
X/*
X * Returns the regular expression for the given indices, checking that the
X * pattern is non-null.
X */
Xstatic regexp *
Xget_mm_rexp(int n, int m)
X`7B
X`09struct VAL *mv = my_majormodes`5Bn`5D.data->mm.mv;
X
X`09if (mv`5Bm`5D.vp->r != 0
X`09 `26`26 mv`5Bm`5D.vp->r->pat != 0
X`09 `26`26 mv`5Bm`5D.vp->r->pat`5B0`5D != 0
X`09 `26`26 mv`5Bm`5D.vp->r->reg != 0) `7B
X`09`09TRACE(("get_mm_rexp(%s) %s`5Cn",
X`09`09`09my_majormodes`5Bn`5D.name,
X`09`09`09mv`5Bm`5D.vp->r->pat))
X`09`09return mv`5Bm`5D.vp->r->reg;
X`09`7D
X`09return 0;
X`7D
X
X/*
X * Use a regular expression (normally a suffix, such as ".c") to match the
X * buffer's filename.  If found, set the first matching majormode.
X */
Xvoid
Xsetm_by_suffix(register BUFFER *bp)
X`7B
X`09if (my_majormodes != 0) `7B
X`09`09size_t n = 0;
X`09`09int savecase = ignorecase;
X#if OPT_CASELESS
X`09`09ignorecase = TRUE;
X#else
X`09`09ignorecase = FALSE;
X#endif
X
X`09`09for (n = 0; my_majormodes`5Bn`5D.name != 0; n++) `7B
X`09`09`09if (my_majormodes`5Bn`5D.flag) `7B
X`09`09&0209regexp *exp = get_mm_rexp(n, MVAL_SUFFIXES);
X`09`09&0209if (exp != 0
+-+-+-+-+-+-+-+-  END  OF PART 76 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 77 -+-+-+-+-+-+-+-+
X`09`09&0209 `26`26 regexec(exp, bp->b_fname, (char *)0, 0, -1)) `7B
X`09`09&0209`09attach_mmode(bp, my_majormodes`5Bn`5D.name);
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`7D
X`09`09ignorecase = savecase;
X`09`7D
X`7D
X
Xstatic LINE *
Xget_preamble(register BUFFER *bp)
X`7B
X`09if (!is_empty_buf(bp)) `7B
X`09`09LINE *lp = lforw(buf_head(bp));
X`09`09if (lisreal(lp))
X`09`09`09return lp;
X`09`7D
X`09return 0;
X`7D
X
X/*
X * Match the first line of the buffer against a regular expression, setting
X * the first matching majormode, if any.
X */
Xvoid
Xsetm_by_preamble(register BUFFER *bp)
X`7B
X`09LINE *lp = get_preamble(bp);
X
X`09if (lp != 0
X`09 `26`26 my_majormodes != 0) `7B
X`09`09size_t n = 0;
X`09`09int savecase = ignorecase;
X#if OPT_CASELESS
X`09`09ignorecase = TRUE;
X#else
X`09`09ignorecase = FALSE;
X#endif
X
X`09`09for (n = 0; my_majormodes`5Bn`5D.name != 0; n++) `7B
X`09`09`09if (my_majormodes`5Bn`5D.flag) `7B
X`09`09&0209regexp *exp = get_mm_rexp(n, MVAL_PREAMBLE);
X`09`09&0209if (exp != 0
X`09`09&0209 `26`26 lregexec(exp, lp, 0, llength(lp))) `7B
X`09`09&0209`09attach_mmode(bp, my_majormodes`5Bn`5D.name);
X`09`09&0209`09break;
X`09`09&0209 `7D
X`09`09`09`7D
X`09`09`7D
X`09`09ignorecase = savecase;
X`09`7D
X`7D
X
Xvoid
Xset_submode_val(const char *name, int n\0706value)
X`7B
X`09MAJORMODE *p;
X`09TRACE(("set_majormode_val(%s, %d, %d)`5Cn", name, n, value))
X`09if ((p = lookup_mm_data(name)) != 0) `7B
X`09`09p->mb.bv`5Bn`5D.v.i = value;
X`09`09make_local_val(p->mb.bv, n);
X`09`7D
X`7D
X
Xvoid
Xset_majormode_rexp(const char *name, int n, \190Cr)
X`7B
X`09MAJORMODE *p;
X`09TRACE(("set_majormode_rexp(%s, %d, %s)`5Cn", name, n, r))
X`09if ((p = lookup_mm_data(name)) != 0)
X`09`09set_qualifier(m_valnames+n, p->mm.mv + n, r);
X`7D
X#endif /* OPT_MAJORMODE */
X
X/*--------\0808\1010\2020\400A*/
X
X#if NO_LEAKS
Xvoid
Xmode_leaks(void)
X`7B
X#if OPT_ENUM_MODES `26`26 OPT_COLOR
X`09FreeAndNull(my_colors);
X`09FreeAndNull(my_hilite);
X#endif
X
X#if OPT_EVAL `7C`7C OPT_MAJORMODE
X`09FreeAndNull(my_varmodes);
X#endif
X#if OPT_MAJORMODE
X`09while (my_majormodes != 0 `26`26 \160D->name != 0) `7B
X`09`09char temp`5BNSTRING`5D;
X`09`09free_majormode(strcpy(temp, my\1A0As->name));
X`09`7D
X`09FreeAndNull(my_majormodes);
X
X`09FreeAndNull(major_g_vals);
X`09FreeAndNull(major_l_vals);
X`09FreeAndNull(my_mode_list);
X`09FreeAndNull(major_valnames);
X#endif
X`7D
X#endif /* NO_LEAKS */
$ call unpack [.VILE-8_0]MODES.C;1 -
 1577832381 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 125 75 152
$!
$ create 'f'
X# This file contains all of the editor's buffer and window modes
X#
X# It should be processed by the "mktbls" program, which produces the
X#  headers #included by main.c
X#
X# All that is necessary to add a new mode to the editor is \2306
X#  an entry to this file, write the supporting code, and rebuild.
X#
X# If you want to know which modes are already taken, look
X#  at nemode.h, after you build it.
X#
X# The modes are table entries in the BUFFER and WINDOW structures.
X#
X# $Header: /usr/build/vile/vile/RCS/modetbl,v 1.98 1998/05/20 10:17:40 cmorgan
V Exp $
X#
X#
X# Mode-table entries.  Capitalized letters are used for abbreviations.
X# The second column is the root of the index-definition.
X# The third column is flags used to control updates after a mode is changed.
X# The fourth column (if present) controls conditional compilation of the mode.
V
X.globals
Xbool`09`09&0209&0309# GMD prefix
X`09"AutoBuffer"`09ABUFF `09`09chgd_autobuf`09# auto-buffer (lru)
X`09"dirc"`09`09DIRC&02090&0209COMPLETE_DIRS # directory-completion (slow!)
X`09"Alt-TabPos"`09ALTTABPOS`090`09`09# emacs-style cursor positioning
X`09"expand-path"`09EXPAND_PATH`090`09`09# true iff %/# don't substitute shorte
Vne\3F06
X`09"ErrorBells"`09ERRORBELLS`090`09`09# audible/visible-bells
X`09"flash"`09`09FLASH&02090&0209OPT_FLASH # visible-bell (flash)
X`09"force-console"`09FORCE_CONSOLE`090`09`09SYS_WINNT`26`26defined(DISP_NTWIN)
V
X`09"glob"`09`09GLOB&02090&0209!OPT_GLOB_PIPE # enable/disable filename globbin
Vg
X`09"HIstory"`09HISTORY`09`090&0209OPT_\1007 # command-history
X`09"ImplyBuffer"`09IMPLYBUFF `090`09`09# imply-buffer (vi-like)
X`09"multibeep"`09MULTIBEEP`090`09`09# multiple successive identical failed mot
Vions all beep
X`09"maplonger"`09MAPLONGER`090`09`09# favor \1D06 maps
X`09"Popup-Choices"`09POPUP_CHOICES`090`09`09OPT_POPUP\1406`26`26!OPT_ENUM_MODE
VS # popup buffer showing file-completion c\6206
X`09"Popup-Msgs"`09POPUP_MSGS`090`09`09OPT_\120B# popup buffer when multiple me
Vssages emitted
X`09"ReadOnly-on-\0C08" RONLYRONLY`090`09# set readonly mode for\120Afiles
X`09"remap"`09`09REMAP&02090&0209# should mappings be reapplied
X`09"remapfirst"`09REMAPFIRST`090`09`09# should 1st char of a map be remapped?
V
X`09"resolve-links"`09RESOLVE_LINKS`090`09`09HAVE_SYMLINK # cache/\3507 directo
Vry names (can be slow if NFS times-out)
X`09"ShowRam"`09RAMSIZE`09`090&0209OPT_\1008# show ram-usage
X`09"SameBangs"`09SAMEBANGS`090`09`09# use same "!!" data for `5EX-!
X`09"working"`09WORKING`09`09chgd_\1707`09OPT_\1A07 # \2E09 message
X`09"usefilelock"`09USEFILELOCK`090`09`09OPT_LCKFILES # okay use \3108s
X`09"VIEW-on-ReadOnly" RONLYVIEW`090`09`09# set view mode for readonly files
X`09"w32pipes"`09W32PIPES`090`09`09OPT_\1008
X`09"warn-unread"`09WARNUNREAD`090`09`09# warn if quitting with \2E06 buffers
X`09"warn-reread"`09WARNREREAD`090`09`09# warn before \2406ing a buffer
X`09"warn-rename"`09WARNRENAME`090`09`09# warn before renaming a buffer
X`09"xterm-mouse"`09XTERM_MOUSE`09chgd_xterm`09# mode to control whether we all
Vow mouse-clicking
X`09"SmoothScroll"`09SMOOTH_SCROLL`090`09`09# should we update even if there is
V typeahead?
X`09"Spaces-After-Sentence" SPACESENT`090`09# add two spaces after a
Xenum
X`09"fcolor"`09FCOLOR`09`09chgd_color`09OPT_\1606# foreground color
X`09"bcolor"`09BCOLOR`09`09chgd_color`09OPT_\1606# background color
X`09"Mini-Hilite"   MINI_HILITE`090`09`09# highlight minibuffer when using vi-c
Vommands
X`09"Popup-Choices"`09POPUP_CHOICES`090`09`09OPT_POPUP\1406`26`26OPT_ENUM_MODES
V # popup buffer showing file-completion c\6106
Xint`09`09&0209&0309# VAL_ prefix
X`09"maplength"`09MAPLENGTH`090`09`09# maximum \1F06 of :map string
X`09"printing-low"`09PRINT_LOW`09chgd_charset`09# low end of high-bit-set print
Vable range
X`09"printing-high"`09PRINT_HIGH`09chgd_charset`09# high end of high-bit-set pr
Vintable range
X`09"report"`09REPORT`09`090&0209# threshold for \2306ing changes
X`09"timeoutlen"`09TIMEOUTVAL`090`09`09# how long to catnap for more input
X`09"timeoutlen-user" TIMEOUTUSERVAL 0`09`09# how long to catnap for more input
V
X`09"scroll-pause"`09SCROLLPAUSE`090`09`09SYS_WINNT`09# how long to catnap afte
Vr \4206ing
Xregex`09`09&0209&0309# VAL_ prefix
X`09"C-SUFfixes"`09CSUFFIXES`090`09`09!OPT_MAJORMODE # match against filenames
V to turn on c-mode
Xstring`09`09&0209&0309# VAL_ prefix
X`09"backup-style"  BACKUPSTYLE`090`09`09OPT_FILEBACK # file \3206 style
X`09"expand-chars"`09EXPAND_CHARS`090`09`09# list of chars we can \3506 (%,#,:)
V
X`09"glob"`09`09GLOB&02090&0209OPT_GLOB_PIPE # select filename globbing style
X
X.buffers
Xbool`09`09&0209&0309# MD prefix
X`09"animated"`09UPBUFF`09`090&0209OPT_\0F06 # update scratch-buffers
X`09"AutoIndent"`09AIND`09`090&0209# auto-indent
X`09"AutoSave"`09ASAVE`09`090&0209# auto-save mode
X`09"AutoWrite"`09AUTOWRITE`090`09`09# auto-write when shelling out
X`09"BackspaceLimit" BACKLIMIT`090`09`09# b\1F08 limited in insert mode
X`09"check-modtime" CHK_MODTIME`090`09`09!SMALLER # check buffer\3008
X`09"cmode"`09`09CMOD&0209chgd_major_w`09!OPT_MAJORMODE # C indentation and fen
Vce match
X`09"crypt"`09`09CRYPT&0209chgd_major`09OPT_EN\1806# encrytion mode active
X`09"dos"`09`09DOS&0209chgd_major_w`09# "dos" mode -- lines end in crlf
X`09"IgnoreCase"`09IGNCASE`09`09chgd_hilite`09# Exact matching for searches
X`09"locked"`09LOCKED`09`09chgd_disabled`09OPT_LCKFILES # mode \3206
X`09"magic"`09`09MAGIC&0209chgd_hilite`09# regular expressions in search
X`09"Meta-Insert-Bindings" METAINSBIND 0`09`09# honor meta b\2607 in insert mod
Ve
X`09"NewLine"`09NEWLINE`09`09chgd_buffer`09# trailing newline (vi-style)
X`09"ReadOnly"`09READONLY`09chgd_major`09# allow writing the buffer
X`09"ShowMatch"`09SHOWMAT`09`090&0209# show matching braces during insert
X`09"ShowMoDe"`09SHOWMODE`09chgd_major`09# show insert/replace/command mode
X`09"TabInsert"`09TABINSERT`090`09`09# okay to insert tab chars
X`09"TagignoreCase"`09TAGIGNORECASE`090`09`09!SMALLER # \2806 upper/lower case
V in tags
X`09"TagRelative"`09TAGSRELTIV`090`09`09# tags are re\2306 to tagsfile path
X`09"TagWord"`09TAGWORD`09`090&0209# apply tag to whole word, not only string a
Vt cursor
X`09"terse"`09`09TERSE&02090&0209# be terse -- suppress messages
X`09"view"`09`09VIEW&0209chgd_major`09# read-only buffer
X`09"WrapScan"`09SWRAP `09`090&0209# wrap-around search mode
X`09"WrapWords"`09WRAP`09`090&0209# word wrap
Xenum
X`09"visual-matches"  HILITEMATCH`09chgd_hilite`09OPT_\1C0B # highlight all sea
Vrch \4907
Xint`09`09&0209&0309# VAL_ prefix
X`09"AutoSaveCNT"`09ASAVECNT`090`09`09# how often auto-saves occur
X`09"C-ShiftWidth"`09C_SWIDTH`090`09`09!OPT_MAJORMODE # shift-width for C buffe
Vrs
X`09"C-TabStop"`09C_TAB`09`09chgd_major_w`09!OPT_MAJORMODE # tab spacing for C
V buffers
X`09"FillCol"`09FILL`09`090&0209# column for paragraph reformat, and line break
V
X`09"ShiftWidth"`09SWIDTH`09`090&0209# shiftwidth for `5ET/`5ED/<</>>
X`09"TabStop"`09TAB`09`09chgd_major_w`09# tab spacing for most buffers
X`09"TagLength"`09TAGLEN`09`090&0209# required significant length for tag looku
Vps
X`09"UndoLimit"`09UNDOLIM`09`090&0209# how much undo stack is saved
X`09"WrapMargin"`09WRAPMARGIN`090`09`09# width of right margin for autowrap
Xstring`09`09&0209&0309# VAL_ prefix
X`09"fence-pairs"`09FENCES`09`09chgd_fences`09# pairs of \1206 `7B,`7D; (,); et
Vc.
X`09"locker"`09LOCKER`09`09chgd_disabled`09OPT_LCKFILES  # Name of \3606
X`09"tags"`09`09TAGS&02090&0209# list of tags files
Xregex`09`09&0209&0309# VAL_ prefix
X`09"comments"`09COMMENTS`090`09`09# matches leading \2807 for\0C09reformatting
V
X`09"comment-prefix" CMT_PREFIX`090`09`09# \1806 to ignore/preserve when format
Vting \4A07
X`09"fence-begin"`09FENCE_BEGIN`090`09`09# begin a simple (character, non-nesta
Vble) fence
X`09"fence-end"`09FENCE_END`090`09`09# end a simple fence
X`09"fence-if"`09FENCE_IF`090`09`09# begin a complex (line, nestable) fence
X`09"fence-elif"`09FENCE_ELIF`090`09`09# next complex fence
X`09"fence-else"`09FENCE_ELSE`090`09`09# final complex fence
X`09"fence-fi"`09FENCE_FI`090`09`09# end a complex fence
X`09"paragraphs"`09PARAGRAPHS`090`09`09# delimits a \2709
X`09"sections"`09SECTIONS`090`09`09# delimits a \2307
X`09"sentences"`09SENTENCES`090`09`09# delimits a \2508
X
X.windows
Xbool`09`09&0209&0309# WMD prefix
X`09"LIst"`09`09LIST&0209chgd_window`09# "list" mode -- show tabs and EOL
X`09"NUmber"`09NUMBER`09`09chgd_window`09# line-numbers shown
X`09"HorizScroll"`09HORSCROLL`090`09`09# scroll whole screen
X`09"LineWrap"`09LINEWRAP`09chgd_window`09OPT_\1908 # wrap lines wider than scr
Veen
X`09"ruler"`09`09RULER&0209chgd_status`09!SMALLER # display line+col in modelin
Ve
X`09"Unprintable-as-Octal" NONPRINTOCTAL  chgd_window # print non-printing char
Vs in octal
X`09"Terse-SELections" TERSELECT`090`09`09OPT_\0E06IONS # don't display extent
V of sel\4207 on message line
Xint`09`09&0209&0309# VAL_ prefix
X`09"SIDEways"`09SIDEWAYS`09chgd_window`09# sideways offset for display
X
X# Put the majormode definitions after buffers to simplify logic in mktbls.
X# The arguments of .majormode are the predefined \1D09s and submodes.
X
X.majormode c`09tabstop
X.majormode c`09shiftwidth
Xregex`09`09&0209&0309# MVAL_ prefix
X`09"PREamble"`09PREAMBLE`090`09`09# match against file header to turn on mode
V
X`09"SUFfixes"`09SUFFIXES`090`09`09# match against filenames to turn on mode
X
X#
X# The "environment" variables are similar to modes, but are not so neatly
X# organized into groups of universal/buffer/window.
X.environment
X"abufname"`09ABUFNAME`09`09# alternate buffer name (i.e. '#')
X"cbufname"`09CBUFNAME`09`09# current buffer name
X"buffer-hook"`09BUFHOOK`09`09OPT_PROCEDURES`09# procedure to run when entering
V buf
X"cd-hook"`09CDHOOK`09`09OPT_PROCEDURES`09# procedure to run when cd'ing
X"cfilname"`09CFNAME`09`09`09# current file name
X"char"`09`09CURCHAR&0209`09# current character under the cursor
X"cryptkey"`09CRYPTKEY`09OPT_ENCRYPT # write-only encryption-key
X"curcol"`09CURCOL`09`09`09# current column pos of cursor
X"curline"`09CURLINE`09`09`09# current line in file
X"cwd"`09`09CWD&0209OPT_SHELL # current directory
X"cwline"`09CWLINE`09`09`09# current screen line in window
X"debug"`09`09DEBUG&0209`09# macro debugging
X"directory"`09DIRECTORY`09OPT_SHELL # controls location of temp-files
X"discmd"`09DISCMD`09`09`09# display commands on\0C08 line
X"disinp"`09DISINP`09`09`09# display command line input characters
X"end-of-cmd"`09EOC`09`09`09# true if they ended the cmd with <CR>
X"exit-hook"`09EXITHOOK`09OPT_PROCEDURES`09# procedure to run when quitting
X"flicker"`09FLICKER`09`09`09# \1507 suppression
X"font"`09`09FONT&0209DISP_X11`09# current font
X"forward-search" FWD_SEARCH`09`09# \1606-direction (true if \3807)
X"helpfile"`09HELPFILE`09`09# \1608 (vile.hlp)
X"iconname"`09ICONNAM`09`09DISP_X11`09# current font
X"identifier"`09IDENTIF`09`09`09# current \200A
X"kill"`09`09KILL&0209`09# kill buffer (read only)
X"lastkey"`09LASTKEY`09`09`09# last keyboard char struck
X"line"`09`09LINE&0209`09# text of current line
X"llength"`09LLENGTH`09`09`09# \1406 of current line
X"majormode"`09MAJORMODE`09OPT_\0E09 # current \2D09, if any
X"match"`09`09MATCH&0209`09# last matched magic pattern
X"mode"`09`09MODE&0209`09# are we inserting/overwriting/command
X"modeline-format" MLFORMAT`09OPT_\0D08 # \2908 \2906 string
X"modified"`09MODIFIED`09`09# is current buffer \2808?
X"ncolors"`09NCOLORS`09`09`09# number of \1E06 displayed
X"ntildes"`09NTILDES`09`09`09# number of \1E06 displayed at eob
X"ocwd"`09`09OCWD&0209OPT_SHELL # previous directory
X"os"`09`09OS&0209`09# what os are we on?
X"pagelen"`09PAGELEN`09`09`09# number of lines used by editor
X"pagewid"`09CURWIDTH`09`09# current screen width
X"palette"`09PALETTE`09`09`09# current \1D07 string
X"patchlevel"`09PATCHLEVEL`09`09# current patch-level of vile (empty for releas
Ve)
X"pathname"`09PATHNAME`09`09# current path-like word
X"pending"`09PENDING`09`09`09# type ahead \2007 flag
X"pid"`09`09PROCESSID&0209# vile's process-id
X"progname"`09PROGNAME`09`09# returns current prog name - "vile"
X"qidentifier"`09QIDENTIF`09`09# current qualified \2A0A
X"ram"`09`09RAM&0209OPT_RAMSIZE`09# ram in use by malloc
X"read-hook"`09RDHOOK`09`09OPT_PROCEDURES`09# procedure to run when reading
X"replace"`09REPLACE`09`09`09# \1507ment pattern
X"search"`09SEARCH`09`09`09# \1306 pattern
X"seed"`09`09SEED&0209`09# current random number seed
X"shell"`09`09SHELL&0209OPT_\0B06# shell-environment variable
X"sres"`09`09SRES&0209`09# current screen resolution
X"startup-file"`09STARTUP_FILE`09`09# the name of the \2E0C (e.g., .vilerc)
X"startup-path"`09STARTUP_PATH`09`09# where to find the \3008file (e.g., .)
X"status"`09STATUS`09`09`09# returns the \1F06 of the last command
X"tpause"`09TPAUSE`09`09`09# length to pause for paren matching
X"title"`09`09TITLE&0209DISP_X11`09# window title
X"version"`09VERSION`09`09`09# current \1D07 number
X"wline"`09`09WLINE&0209`09# # of lines in current window
X"word"`09`09WORD&0209`09# current word
X"write-hook"`09WRHOOK`09`09OPT_PROCEDURES`09# procedure to run when writing
X"xdisplay"`09XDISPLAY`09DISP_X11`09# X Windows \2707, etc.
X"xshell"`09XSHELL`09`09DISP_X11`09# xterm emulator, etc.
X
X.functions
X"abs"`09ABS`09`09MONAMIC&0209# absolute value of a number
X"add"`09ADD`09`09DYNAMIC&0209# add two numbers together
X"and"`09AND`09`09DYNAMIC&0209# logical and
X"asc"`09ASCII`09`09MONAMIC&0209# char to integer conversion
X"bin"`09BIND`09`09MONAMIC&0209# lookup what function name is bound to a key
X"cat"`09CAT`09`09DYNAMIC&0209# concatenate string
X"chr"`09CHR`09`09MONAMIC&0209# integer to char conversion
X"div"`09DIV`09`09DYNAMIC&0209# division
X"env"`09ENV`09`09MONAMIC&0209# retrieve a system environment var
X"equ"`09EQUAL`09`09DYNAMIC&0209# logical equality check
X"glo"`09GLOBMODE`09MONAMIC`09`09# retrieve global setting
X"gre"`09GREATER`09`09DYNAMIC&0209# logical greater than
X"gtk"`09GTKEY`09`09NILNAMIC`09# get 1 character
X"gts"`09GTSEQ`09`09NILNAMIC`09# get keyboard-sequence (characters)
X"ind"`09IND`09`09MONAMIC&0209# evaluate indirect value
X"lef"`09LEFT`09`09DYNAMIC&0209# left string(\0706, len)
X"len"`09LENGTH`09`09MONAMIC&0209# string length
X"les"`09LESS`09`09DYNAMIC&0209# logical less than
X"loc"`09LOCMODE`09`09MONAMIC&0209# retrieve local setting
X"low"`09LOWER`09`09MONAMIC&0209# lower case string
X"mid"`09MID`09`09TRINAMIC`09# mid string(\0706, pos, len)
X"mod"`09MOD`09`09DYNAMIC&0209# modulo
X"neg"`09NEG`09`09MONAMIC&0209# negate
X"not"`09NOT`09`09MONAMIC&0209# logical not
X"or"`09OR`09`09DYNAMIC&0209# logical or
X"rd"`09READABLE`09MONAMIC`09`09# is a file readable?
X"rig"`09RIGHT`09`09DYNAMIC&0209# right string(\0706, pos)
X"rnd"`09RND`09`09MONAMIC&0209# get a random number
X"seq"`09SEQUAL`09`09DYNAMIC&0209# string logical equality check
X"sgr"`09SGREAT`09`09DYNAMIC&0209# string logical greater than
X"sin"`09SINDEX`09`09DYNAMIC&0209# find the index of one string in another
X"sle"`09SLESS`09`09DYNAMIC&0209# string logical less than
X"sub"`09SUB`09`09DYNAMIC&0209# subtraction
X"tim"`09TIMES`09`09DYNAMIC&0209# multiplication
X"tri"`09TRIM`09`09MONAMIC&0209# trims leading/trailing/repeated whitespace
X"tru"`09TRUTH`09`09MONAMIC&0209# Truth of the universe logical test
X"upp"`09UPPER`09`09MONAMIC&0209# uppercase string
X"wr"`09WRITABLE`09MONAMIC`09`09# is a file writeable?
X
X.table color
X"default"`09ENUM_UNKNOWN`09DISP_TERMCAP`7C`7CDISP_IBMPC # FIXME: implement thi
Vs for all drivers
X"black"`09`090
X"red"`09`091
X"green"`09`092
X"yellow"`093`09`09!OPT_16_COLOR
X"brown"`09`093&0209OPT_16_COLOR
X"blue"`09`094
X"magenta"`095
X"cyan"`09`096
X"white"`09`097&0209!OPT_16_COLOR
X"lightgray"`097`09`09OPT_16_COLOR
X"gray"`09`098&0209OPT_16_COLOR
X"brightred"`099`09`09OPT_16_COLOR
X"brightgreen"`0910`09`09OPT_16_COLOR
X"yellow"`0911`09`09OPT_16_COLOR
X"brightblue"`0912`09`09OPT_16_COLOR
X"brightmagenta"`0913`09`09OPT_16_COLOR
X"brightcyan"`0914`09`09OPT_16_COLOR
X"white"`09`0915&0209OPT_16_COLOR
X
X.table bool
X"false"`09`09FALSE
X"true"`09`09TRUE
X
X.table popup
X"delayed"`09POPUP_CHOICES_DELAYED
X"immediate"`09POPUP_CHOICES_IMMED
X"off"`09`09POPUP_CHOICES_OFF
X
X.table backup
X"off"`09`090
X".bak"`09`091
X"tilde"`09`092&0209SYS_UNIX
X# "tilde_N_existing", */
X# "tilde_N", */
X
X.table hilite
X"bold"`09`09VABOLD
X"color"`09`09VACOLOR
X"italic"`09VAITAL
X"none"`09`090
X"reverse"`09VAREV
X"underline"`09VAUL
X"black"`09`09VACOL_0&0209OPT_COLOR
X"red"`09`09VACOL_1&0209OPT_COLOR
X"green"`09`09VACOL_2&0209OPT_COLOR
X"yellow"`09VACOL_3`09`09OPT_COLOR`26`26!OPT_16\0F06
X"brown"`09`09VACOL_3&0209OPT_COLOR`26`26OPT_16\0E06
X"blue"`09`09VACOL_4&0209OPT_COLOR
X"magenta"`09VACOL_5`09`09OPT_COLOR
X"cyan"`09`09VACOL_6&0209OPT_COLOR
X"white"`09`09VACOL_7&0209OPT_COLOR`26`26!OPT_16\0F06
X"lightgray"`09VACOL_7`09`09OPT_COLOR`26`26OPT_16\0E06
X"gray"`09`09VACOL_8&0209OPT_COLOR`26`26OPT_16\0E06
X"brightred"`09VACOL_9`09`09OPT_COLOR`26`26OPT_16\0E06
X"brightgreen"`09VACOL_A`09`09OPT_COLOR`26`26OPT_16\0E06
X"yellow"`09VACOL_B`09`09OPT_COLOR`26`26OPT_16\0E06
X"brightblue"`09VACOL_C`09`09OPT_COLOR`26`26OPT_16\0E06
X"brightmagenta"`09VACOL_D`09`09OPT_COLOR`26`26OPT_16\0E06
X"brightcyan"`09VACOL_E`09`09OPT_COLOR`26`26OPT_16\0E06
X"white"`09`09VACOL_F&0209OPT_COLOR`26`26OPT_16\0E06
$ call unpack [.VILE-8_0]MODETBL.;1 -
 2016175973 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 31 76 152
$!
$ create 'f'
X/*
X * msgs.c
X *
X * Support functions for "popup-msgs" mode.
X * Written by T.E.Dickey for vile (august 1994).
X *
X * $Header: /usr/build/vile/vile/RCS/msgs.c,v 1.17 1998/04/28 10:18:19 tom Exp
V $
X */
X#include "estruct.h"
X
X#if`09OPT_POPUP_MSGS
X
X#include "edef.h"
X
X/*
X * Create the message-buffer if it doesn't already exist
X */
Xstatic BUFFER *
Xcreate_msgs(void)
X`7B
X`09BUFFER`09*bp = bfind(MESSAGES_BufName, BFSCRTCH);
X
X`09if (bp != NULL) `7B
X`09`09b_set_scratch(bp);
X `09`09b_set_invisible(bp);
X `09`09bp->b_active = TRUE;
X`09`7D
X`09return bp;
X`7D
X
X/*
X * This is invoked as a wrapper for 'kbd_putc()'.  It writes to the Messages
X * scratch buffer, and also to the message line.  If the M\1606s\3707 isn't
X * visible, it is automatically popped up when a new message line is begun.
X * Since it's a scratch buffer, popping it down destroys it.
X */
Xvoid
Xmsg_putc(int c)
X`7B
X`09BUFFER`09*savebp = curbp;
X`09WINDOW`09*savewp = curwp;
X`09MARK`09savemk;
X`09int`09saverow = ttrow;
X`09int`09savecol = ttcol;
X`09register BUFFER *bp;
X`09register WINDOW *wp;
X
X`09if (savewp)
X`09    savemk  = DOT;
X
X`09if ((bp = create_msgs()) == 0)
X`09`09return;
X
X`09beginDisplay();
X`09/*
X`09 * Modify the current-buffer state as unobtrusively as possible (i.e.,
X`09 * don't modify the buffer order, and\2308ake \210Bvisible if
X`09 * it isn't already!).  To use the 'bputc()' logic, though, we've got
X`09 * to have a window, even if it's not real.
X`09 */
X`09curbp = bp;
X`09if ((wp = bp2any_wp(bp)) == NULL) `7B
X`09`09static WINDOW dummy;
X`09`09wp = `26dummy;
X`09`09wp->w_bufp = bp;
X`09`7D
X`09curwp = wp;
X`09DOT.l = lback(buf_head(bp));
X`09DOT.o = llength(DOT.l);
X
X`09/*
X`09 * Write into the `5BMessages`5D-buffer
X`09 */
X#if OPT_TRACE
X`09if (c == '`5Cn') `7B
X`09`09static TBUFF *ss;
X`09`09int len = (DOT.o > 0) ? \0D06: 1;
X`09`09if (tb_init(`26ss, EOS) != 0
X`09`09 `26`26 tb_bappend(`26ss,
X`09`09`09(DOT.o > 0) ? DOT.l->l_text : "?",
X`09`09`09(ALLOC_T)len) != 0
X`09`09 `26`26 tb_append(`26ss, EOS) != 0) `7B
X`09`09`09TRACE(("msg:%.*s`5Cn", len, tb_values(ss)));
X`09`09`7D
X`09`7D
X#endif
X`09if ((c != '`5Cn') `7C`7C (DOT.o > 0)) `7B
X`09`09bputc(c);
X`09`09b_clr_changed(bp);
X`09`7D
X
X`09/* Finally, restore the original current-buffer and writ\2606character
X`09 * to the message line.
X`09 */
X`09curbp = savebp;
X`09curwp = savewp;
X`09if (savewp)
X`09    DOT   = savemk;
X`09movecursor(saverow, savecol);
X`09if (c != '`5Cn') `7B
X`09`09if (sgarbf) `7B
X`09`09`09mlsavec(c);
X`09`09`7D else `7B
X`09`09`09kbd_putc(c);
X`09`09`7D
X`09`7D
X`09endofDisplay();
X`7D
X
Xvoid
Xpopup_msgs(void)
X`7B
X`09BUFFER`09*savebp = curbp;
X`09WINDOW`09*savewp = curwp;
X`09MARK`09savemk;
X`09register BUFFER *bp;
X`09WINDOW  *wp;
X
X`09if (savewp)
X`09    savemk = DOT;
X
X`09if ((bp = create_msgs()) == 0)
X`09`09return;
X
X`09if (!is_empty_buf(bp)) `7B
X`09`09if ((curwp == 0) `7C`7C sgarbf) `7B
X`09`09`09return;&0209/* CAN'T popup yet */
X`09`09`7D
X`09`09if (popupbuff(bp) == FALSE) `7B
X`09`09`09(void)zotbuf(bp);
X`09`09`09return;
X`09`09`7D
X
X`09`09if ((wp = bp2any_wp(bp)) != NULL) `7B
X`09`09`09make_local_w_val(wp,WMDNUMBER);
X`09`09`09set_w_val(wp,WMDNUMBER,FALSE);
X`09`09`7D
X`09`09set_rdonly(bp, non_filename(), MDVIEW);
X`09`09curbp = savebp;
X`09`09curwp = savewp;
X`09`09if (savewp)
X`09`09    DOT   = savemk;
X`09`7D
X`7D
X
X/*
X * If no warning messages were encountered during startup, and the popup-msgs
V
X * mode wasn't enabled, discard the informational messages that are there
X * already.
X */
Xvoid
Xpurge_msgs(void)
X`7B
X`09TRACE(("purge_msgs mode:%d, warnings:%d`5Cn",
X`09`09global_g_val(GMDPOPUP_MSGS), warnings))
X
X`09if ((global_g_val(GMDPOPUP_MSGS) == -TRUE)
X`09 `26`26 (warnings == 0)) `7B
X`09`09BUFFER`09*bp = find_b_name(MESSAGES_BufName);
X`09`09if (bp != 0
X`09`09 `26`26 bp->b_nwnd == 0) `7B
X`09`09`09(void)zotbuf(bp);
X`09`09`7D
X`09`09set_global_g_val(GMDPOPUP_MSGS, FALSE);
X`09`7D
X`7D
X#endif
$ call unpack [.VILE-8_0]MSGS.C;1 -
 1179365279 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 8 77 152
$!
$ create 'f'
X/* nebind.h: this header file was produced automatically by
X * the dsa10:`5Bcompcent.`5D`5Budaa055.temp.vile-8_0`5Dmktbls.exe;1 program, b
Vased on input from the file cmdtbl
X */
X
Xconst CMDFUNC *asciitbl`5B256`5D = `7B
X`09NULL,`09`09`09/* ctrl-@ */
X`09`26f_cntl_a_func,`09`09/* ctrl-A */
X`09`26f_backpage,`09`09/* ctrl-B */
X`09NULL,`09`09`09/* ctrl-C */
X`09`26f_forwhpage,`09`09/* ctrl-D */
X`09`26f_mvdnwind,`09`09/* ctrl-E */
X`09`26f_forwpage,`09`09/* ctrl-F */
X`09`26f_showcpos,`09`09/* ctrl-G */
X`09`26f_backchar_to_bol,`09/* ctrl-H */
X`09NULL,`09`09`09/* ctrl-I */
X`09`26f_forwline,`09`09/* ctrl-J */
X`09`26f_delwind,`09`09/* ctrl-K */
X`09`26f_vile_refresh,`09/* ctrl-L */
X`09`26f_forwbline,`09`09/* ctrl-M */
X`09`26f_forwline,`09`09/* ctrl-N */
X`09`26f_onlywind,`09`09/* ctrl-O */
X`09`26f_backline,`09`09/* ctrl-P */
X`09`26f_nullproc,`09`09/* ctrl-Q */
X`09`26f_insfile,`09`09/* ctrl-R */
X#if (OPT_SELECTIONS)
X`09`26f_sel_motion,`09`09/* ctrl-S */
X#else
X`09NULL,
X#endif
X#if (OPT_TAGS)
X`09`26f_untagpop,`09`09/* ctrl-T */
X#else
X`09NULL,
X#endif
X`09`26f_backhpage,`09`09/* ctrl-U */
X`09NULL,`09`09`09/* ctrl-V */
X`09`26f_operwrite,`09`09/* ctrl-W */
X`09`26f_cntl_x_func,`09`09/* ctrl-X */
X`09`26f_mvupwind,`09`09/* ctrl-Y */
X#if (OPT_SHELL)
X`09`26f_bktoshell,`09`09/* ctrl-Z */
X#else
X`09NULL,
X#endif
X`09`26f_esc_func,`09`09/* ctrl-`5B */
X`09NULL,`09`09`09/* ctrl-`5C */
X#if (OPT_TAGS)
X`09`26f_gototag,`09`09/* ctrl-`5D */
X#else
X`09NULL,
X#endif
X`09`26f_altbuff,`09`09/* ctrl-`5E */
X`09NULL,`09`09`09/* ctrl-_ */
X`09`26f_forwchar_to_eol,`09/*   */
X#if (OPT_SHELL)
X`09`26f_operfilter,`09`09/* ! */
X#else
X`09NULL,
X#endif
X`09`26f_usekreg,`09`09/* " */
X`09`26f_poundc_func,`09`09/* # */
X`09`26f_gotoeol,`09`09/* $ */
X#if (OPT_CFENCE)
X`09`26f_matchfence,`09`09/* % */
X#else
X`09NULL,
X#endif
X`09`26f_subst_again,`09`09/* `26 */
X`09`26f_golinenmmark,`09/* ' */
X`09`26f_gotobosent,`09`09/* ( */
X`09`26f_gotoeosent,`09`09/* ) */
X`09`26f_togglelistbuffers,`09/* * */
X`09`26f_forwbline,`09`09/* + */
X`09`26f_rev_csrch,`09`09/* , */
X`09`26f_backbline,`09`09/* - */
X`09`26f_dotcmdplay,`09`09/* . */
X`09`26f_forwsearch,`09`09/* / */
X`09`26f_gotobol,`09`09/* 0 */
X`09NULL,`09`09`09/* 1 */
X`09NULL,`09`09`09/* 2 */
X`09NULL,`09`09`09/* 3 */
X`09NULL,`09`09`09/* 4 */
X`09NULL,`09`09`09/* 5 */
X`09NULL,`09`09`09/* 6 */
X`09NULL,`09`09`09/* 7 */
X`09NULL,`09`09`09/* 8 */
X`09NULL,`09`09`09/* 9 */
X`09`26f_namedcmd,`09`09/* : */
X`09`26f_rep_csrch,`09`09/* ; */
X`09`26f_operlshift,`09`09/* < */
X#if (OPT_HILITEMATCH)
X`09`26f_clear_match_attrs,`09/* = */
X#else
X`09NULL,
X#endif
X`09`26f_operrshift,`09`09/* > */
X`09`26f_backsearch,`09`09/* ? */
X`09`26f_execkreg,`09`09/* @ */
X`09`26f_appendeol,`09`09/* A */
X`09`26f_backword,`09`09/* B */
X`09`26f_chgtoeol,`09`09/* C */
X`09`26f_deltoeol,`09`09/* D */
X`09`26f_forwendw,`09`09/* E */
X`09`26f_bcsrch,`09`09/* F */
X`09`26f_gotoline,`09`09/* G */
X`09`26f_gotobos,`09`09/* H */
X`09`26f_insertbol,`09`09/* I */
X`09`26f_joinlines,`09`09/* J */
X`09`26f_unarg_func,`09`09/* K */
X`09`26f_gotoeos,`09`09/* L */
X`09`26f_gotomos,`09`09/* M */
X`09`26f_revsearch,`09`09/* N */
X`09`26f_openup,`09`09/* O */
X`09`26f_putbefore,`09`09/* P */
X`09`26f_quit,`09`09/* Q */
X`09`26f_overwritechars,`09/* R */
X`09`26f_chgline,`09`09/* S */
X`09`26f_bcsrch_to,`09`09/* T */
X`09`26f_lineundo,`09`09/* U */
X`09`26f_enlargewind,`09`09/* V */
X`09`26f_forwword,`09`09/* W */
X`09`26f_backdelchar,`09`09/* X */
X`09`26f_yankline,`09`09/* Y */
X`09`26f_zzquit,`09`09/* Z */
X`09`26f_gotobosec,`09`09/* `5B */
X`09`26f_gorectnmmark,`09/* `5C */
X`09`26f_gotoeosec,`09`09/* `5D */
X`09`26f_firstnonwhite,`09/* `5E */
X`09`26f_histbuff,`09`09/* _ */
X`09`26f_goexactnmmark,`09/* `60 */
X`09`26f_append,`09`09/* a */
X`09`26f_backviword,`09`09/* b */
X`09`26f_operchg,`09`09/* c */
X`09`26f_operdel,`09`09/* d */
X`09`26f_forwviendw,`09`09/* e */
X`09`26f_fcsrch,`09`09/* f */
X`09NULL,`09`09`09/* g */
X`09`26f_backchar_to_bol,`09/* h */
X`09`26f_insert,`09`09/* i */
X`09`26f_forwline,`09`09/* j */
X`09`26f_backline,`09`09/* k */
X`09`26f_forwchar_to_eol,`09/* l */
X`09`26f_setnmmark,`09`09/* m */
X`09`26f_consearch,`09`09/* n */
X`09`26f_opendown,`09`09/* o */
X`09`26f_putafter,`09`09/* p */
X#if (OPT_SELECTIONS)
X`09`26f_multimotion,`09`09/* q */
X#else
X`09NULL,
X#endif
X`09`26f_replacechar,`09`09/* r */
X`09`26f_chgchar,`09`09/* s */
X`09`26f_fcsrch_to,`09`09/* t */
X`09`26f_undo,`09`09/* u */
X`09`26f_shrinkwind,`09`09/* v */
X`09`26f_forwviword,`09`09/* w */
X`09`26f_forwdelchar,`09`09/* x */
X`09`26f_operyank,`09`09/* y */
X`09`26f_poswind,`09`09/* z */
X`09`26f_gotobop,`09`09/* `7B */
X`09`26f_gotocol,`09`09/* `7C */
X`09`26f_gotoeop,`09`09/* `7D */
X`09`26f_flipchar,`09`09/* `7E */
X`09`26f_backchar_to_bol,`09/* ctrl-? */
X`09NULL,`09`09`09/* meta-ctrl-@ */
X`09NULL,`09`09`09/* meta-ctrl-A */
+-+-+-+-+-+-+-+-  END  OF PART 77 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 78 -+-+-+-+-+-+-+-+
X`09NULL,`09`09`09/* meta-ctrl-B */
X`09NULL,`09`09`09/* meta-ctrl-C */
X`09NULL,`09`09`09/* meta-ctrl-D */
X`09NULL,`09`09`09/* meta-ctrl-E */
X`09NULL,`09`09`09/* meta-ctrl-F */
X`09NULL,`09`09`09/* meta-ctrl-G */
X`09NULL,`09`09`09/* meta-ctrl-H */
X`09NULL,`09`09`09/* meta-ctrl-I */
X`09NULL,`09`09`09/* meta-ctrl-J */
X`09NULL,`09`09`09/* meta-ctrl-K */
X`09NULL,`09`09`09/* meta-ctrl-L */
X`09NULL,`09`09`09/* meta-ctrl-M */
X`09NULL,`09`09`09/* meta-ctrl-N */
X`09NULL,`09`09`09/* meta-ctrl-O */
X`09NULL,`09`09`09/* meta-ctrl-P */
X`09NULL,`09`09`09/* meta-ctrl-Q */
X`09NULL,`09`09`09/* meta-ctrl-R */
X`09NULL,`09`09`09/* meta-ctrl-S */
X`09NULL,`09`09`09/* meta-ctrl-T */
X`09NULL,`09`09`09/* meta-ctrl-U */
X`09NULL,`09`09`09/* meta-ctrl-V */
X`09NULL,`09`09`09/* meta-ctrl-W */
X`09NULL,`09`09`09/* meta-ctrl-X */
X`09NULL,`09`09`09/* meta-ctrl-Y */
X`09NULL,`09`09`09/* meta-ctrl-Z */
X`09NULL,`09`09`09/* meta-ctrl-`5B */
X`09NULL,`09`09`09/* meta-ctrl-`5C */
X`09NULL,`09`09`09/* meta-ctrl-`5D */
X`09NULL,`09`09`09/* meta-ctrl-`5E */
X`09NULL,`09`09`09/* meta-ctrl-_ */
X`09NULL,`09`09`09/* meta-  */
X`09NULL,`09`09`09/* meta-! */
X`09NULL,`09`09`09/* meta-" */
X`09NULL,`09`09`09/* meta-# */
X`09NULL,`09`09`09/* meta-$ */
X`09NULL,`09`09`09/* meta-% */
X`09NULL,`09`09`09/* meta-`26 */
X`09NULL,`09`09`09/* meta-' */
X`09NULL,`09`09`09/* meta-( */
X`09NULL,`09`09`09/* meta-) */
X`09NULL,`09`09`09/* meta-* */
X`09NULL,`09`09`09/* meta-+ */
X`09NULL,`09`09`09/* meta-, */
X`09NULL,`09`09`09/* meta-- */
X`09NULL,`09`09`09/* meta-. */
X`09NULL,`09`09`09/* meta-/ */
X`09NULL,`09`09`09/* meta-0 */
X`09NULL,`09`09`09/* meta-1 */
X`09NULL,`09`09`09/* meta-2 */
X`09NULL,`09`09`09/* meta-3 */
X`09NULL,`09`09`09/* meta-4 */
X`09NULL,`09`09`09/* meta-5 */
X`09NULL,`09`09`09/* meta-6 */
X`09NULL,`09`09`09/* meta-7 */
X`09NULL,`09`09`09/* meta-8 */
X`09NULL,`09`09`09/* meta-9 */
X`09NULL,`09`09`09/* meta-: */
X`09NULL,`09`09`09/* meta-; */
X`09NULL,`09`09`09/* meta-< */
X`09NULL,`09`09`09/* meta-= */
X`09NULL,`09`09`09/* meta-> */
X`09NULL,`09`09`09/* meta-? */
X`09NULL,`09`09`09/* meta-@ */
X`09NULL,`09`09`09/* meta-A */
X`09NULL,`09`09`09/* meta-B */
X`09NULL,`09`09`09/* meta-C */
X`09NULL,`09`09`09/* meta-D */
X`09NULL,`09`09`09/* meta-E */
X`09NULL,`09`09`09/* meta-F */
X`09NULL,`09`09`09/* meta-G */
X`09NULL,`09`09`09/* meta-H */
X`09NULL,`09`09`09/* meta-I */
X`09NULL,`09`09`09/* meta-J */
X`09NULL,`09`09`09/* meta-K */
X`09NULL,`09`09`09/* meta-L */
X`09NULL,`09`09`09/* meta-M */
X`09NULL,`09`09`09/* meta-N */
X`09NULL,`09`09`09/* meta-O */
X`09NULL,`09`09`09/* meta-P */
X`09NULL,`09`09`09/* meta-Q */
X`09NULL,`09`09`09/* meta-R */
X`09NULL,`09`09`09/* meta-S */
X`09NULL,`09`09`09/* meta-T */
X`09NULL,`09`09`09/* meta-U */
X`09NULL,`09`09`09/* meta-V */
X`09NULL,`09`09`09/* meta-W */
X`09NULL,`09`09`09/* meta-X */
X`09NULL,`09`09`09/* meta-Y */
X`09NULL,`09`09`09/* meta-Z */
X`09NULL,`09`09`09/* meta-`5B */
X`09NULL,`09`09`09/* meta-`5C */
X`09NULL,`09`09`09/* meta-`5D */
X`09NULL,`09`09`09/* meta-`5E */
X`09NULL,`09`09`09/* meta-_ */
X`09NULL,`09`09`09/* meta-`60 */
X`09NULL,`09`09`09/* meta-a */
X`09NULL,`09`09`09/* meta-b */
X`09NULL,`09`09`09/* meta-c */
X`09NULL,`09`09`09/* meta-d */
X`09NULL,`09`09`09/* meta-e */
X`09NULL,`09`09`09/* meta-f */
X`09NULL,`09`09`09/* meta-g */
X`09NULL,`09`09`09/* meta-h */
X`09NULL,`09`09`09/* meta-i */
X`09NULL,`09`09`09/* meta-j */
X`09NULL,`09`09`09/* meta-k */
X`09NULL,`09`09`09/* meta-l */
X`09NULL,`09`09`09/* meta-m */
X`09NULL,`09`09`09/* meta-n */
X`09NULL,`09`09`09/* meta-o */
X`09NULL,`09`09`09/* meta-p */
X`09NULL,`09`09`09/* meta-q */
X`09NULL,`09`09`09/* meta-r */
X`09NULL,`09`09`09/* meta-s */
X`09NULL,`09`09`09/* meta-t */
X`09NULL,`09`09`09/* meta-u */
X`09NULL,`09`09`09/* meta-v */
X`09NULL,`09`09`09/* meta-w */
X`09NULL,`09`09`09/* meta-x */
X`09NULL,`09`09`09/* meta-y */
X`09NULL,`09`09`09/* meta-z */
X`09NULL,`09`09`09/* meta-`7B */
X`09NULL,`09`09`09/* meta-`7C */
X`09NULL,`09`09`09/* meta-`7D */
X`09NULL,`09`09`09/* meta-`7E */
X`09NULL,`09`09`09/* meta-ctrl-? */
X`7D;
X
XKBIND kbindtbl`5B`5D = `7B
X#if (OPT_AEDIT)
X`09`7B CTLA`7C' ',`09`09`26f_operdetab `7D,
X#endif
X`09`7B CTLA`7C'`26',`09`09`26f_opersubstagain `7D,
X`09`7B CTLA`7C'*',`09`09`26f_listbuffers `7D,
X`09`7B CTLA`7C'/',`09`09`26f_scrsearchpat `7D,
X#if (OPT_SELECTIONS)
X`09`7B CTLA`7C'A',`09`09`26f_operattrcaseq `7D,
X`09`7B CTLA`7C'B',`09`09`26f_operattrbold `7D,
X#endif
X#if (OPT_HYPERTEXT)
X`09`7B CTLA`7C'H',`09`09`26f_operattrhc `7D,
X#endif
X#if (OPT_SELECTIONS)
X`09`7B CTLA`7C'I',`09`09`26f_operattrital `7D,
X`09`7B CTLA`7C'N',`09`09`26f_operattrno `7D,
X#endif
X`09`7B CTLA`7C'O',`09`09`26f_openup_no_aindent `7D,
X`09`7B CTLA`7C'P',`09`09`26f_rectputbefore `7D,
X#if (OPT_SELECTIONS)
X`09`7B CTLA`7C'R',`09`09`26f_operattrrev `7D,
X`09`7B CTLA`7C'S',`09`09`26f_sel_motion `7D,
X`09`7B CTLA`7C'U',`09`09`26f_operattrul `7D,
X#endif
X#if (OPT_AEDIT)
X`09`7B CTLA`7C'b',`09`09`26f_operblank `7D,
X`09`7B CTLA`7C'd',`09`09`26f_forceblank `7D,
X#endif
X#if (OPT_FORMAT)
X`09`7B CTLA`7C'f',`09`09`26f_operformat `7D,
X#endif
X`09`7B CTLA`7C'h',`09`09`26f_help `7D,
X`09`7B CTLA`7C'i',`09`09`26f_insert_no_aindent `7D,
X#if (OPT_FORMAT)
X`09`7B CTLA`7C'j',`09`09`26f_operformat `7D,
X#endif
X`09`7B CTLA`7C'l',`09`09`26f_operlower `7D,
X`09`7B CTLA`7C'o',`09`09`26f_opendown_no_aindent `7D,
X`09`7B CTLA`7C'p',`09`09`26f_rectputafter `7D,
X#if (OPT_SELECTIONS)
X`09`7B CTLA`7C'q',`09`09`26f_multimotionrectangle `7D,
X#endif
X`09`7B CTLA`7C'r',`09`09`26f_operopenrect `7D,
X#if (OPT_SELECTIONS)
X`09`7B CTLA`7C's',`09`09`26f_operselect `7D,
X#endif
X#if (OPT_AEDIT)
X`09`7B CTLA`7C't',`09`09`26f_opertrim `7D,
X#endif
X`09`7B CTLA`7C'u',`09`09`26f_operupper `7D,
X`09`7B CTLA`7C'`7E',`09`09`26f_operflip `7D,
X`09`7B CTLA`7Ctocntrl('D'),`09`26f_scrnextdw `7D,
X`09`7B CTLA`7Ctocntrl('E'),`09`26f_mvdnnxtwind `7D,
X#if (OPT_AEDIT)
X`09`7B CTLA`7Ctocntrl('I'),`09`26f_operentab `7D,
X#endif
X`09`7B CTLA`7Ctocntrl('U'),`09`26f_scrnextup `7D,
X`09`7B CTLA`7Ctocntrl('Y'),`09`26f_mvupnxtwind `7D,
X#if (OPT_TAGS)
X`09`7B CTLA`7Ctocntrl('`5D'),`09`26f_nexttag `7D,
X#endif
X#if (OPT_SHELL)
X`09`7B CTLX`7C'!',`09`09`26f_pipecmd `7D,
X#endif
X#if (OPT_CFENCE)
X`09`7B CTLX`7C'%',`09`09`26f_matchfenceback `7D,
X#endif
X`09`7B CTLX`7C'`26',`09`09`26f_kbd_mac_exec `7D,
X`09`7B CTLX`7C'(',`09`09`26f_kbd_mac_begin `7D,
X`09`7B CTLX`7C')',`09`09`26f_kbd_mac_end `7D,
X`09`7B CTLX`7C'/',`09`09`26f_scrforwsearch `7D,
X`09`7B CTLX`7C'0',`09`09`26f_delwind `7D,
X`09`7B CTLX`7C'1',`09`09`26f_onlywind `7D,
X`09`7B CTLX`7C'2',`09`09`26f_splitwind `7D,
X`09`7B CTLX`7C'=',`09`09`26f_showcpos `7D,
X`09`7B CTLX`7C'?',`09`09`26f_scrbacksearch `7D,
X#if (OPT_ENCRYPT)
X`09`7B CTLX`7C'C',`09`09`26f_opercrypt `7D,
X#endif
X`09`7B CTLX`7C'O',`09`09`26f_prevwind `7D,
X`09`7B CTLX`7C'P',`09`09`26f_lineputbefore `7D,
X#if (OPT_ISRCH)
X`09`7B CTLX`7C'R',`09`09`26f_risearch `7D,
X`09`7B CTLX`7C'S',`09`09`26f_fisearch `7D,
X#endif
X#if (OPT_ENCRYPT)
X`09`7B CTLX`7C'X',`09`09`26f_ue_setkey `7D,
X#endif
X`09`7B CTLX`7C'`5E',`09`09`26f_kbd_mac_save `7D,
X`09`7B CTLX`7C'c',`09`09`26f_operlinechg `7D,
X`09`7B CTLX`7C'd',`09`09`26f_operlinedel `7D,
X`09`7B CTLX`7C'e',`09`09`26f_filefind `7D,
X`09`7B CTLX`7C'f',`09`09`26f_setfillcol `7D,
X`09`7B CTLX`7C'h',`09`09`26f_help `7D,
X`09`7B CTLX`7C'k',`09`09`26f_killbuffer `7D,
X`09`7B CTLX`7C'o',`09`09`26f_nextwind `7D,
X`09`7B CTLX`7C'p',`09`09`26f_lineputafter `7D,
X`09`7B CTLX`7C'r',`09`09`26f_forwredo `7D,
X`09`7B CTLX`7C's',`09`09`26f_opersubst `7D,
X`09`7B CTLX`7C't',`09`09`26f_settab `7D,
X`09`7B CTLX`7C'u',`09`09`26f_backundo `7D,
X`09`7B CTLX`7C'y',`09`09`26f_operlineyank `7D,
X`09`7B CTLX`7Ctocntrl('C'),`09`26f_quit `7D,
X`09`7B CTLX`7Ctocntrl('L'),`09`26f_mvleftwind `7D,
X`09`7B CTLX`7Ctocntrl('R'),`09`26f_mvrightwind `7D,
X#if (OPT_FINDERR)
X`09`7B CTLX`7Ctocntrl('X'),`09`26f_finderr `7D,
X#endif
X#if (OPT_TAGS)
X`09`7B CTLX`7Ctocntrl('`5D'),`09`26f_untagpop `7D,
X#endif
X#if (OPT_EXEC_MACROS>10)
X`09`7B SPEC`7C'!',`09`09`26f_cbuf11 `7D,
X#endif
X#if (OPT_EXEC_MACROS>12)
X`09`7B SPEC`7C'#',`09`09`26f_cbuf13 `7D,
X#endif
X#if (OPT_EXEC_MACROS>13)
X`09`7B SPEC`7C'$',`09`09`26f_cbuf14 `7D,
X#endif
X#if (OPT_EXEC_MACROS>14)
X`09`7B SPEC`7C'%',`09`09`26f_cbuf15 `7D,
X#endif
X#if (OPT_EXEC_MACROS>16)
X`09`7B SPEC`7C'`26',`09`09`26f_cbuf17 `7D,
X#endif
X#if (OPT_EXEC_MACROS>18)
X`09`7B SPEC`7C'(',`09`09`26f_cbuf19 `7D,
X#endif
X#if (OPT_EXEC_MACROS>19)
X`09`7B SPEC`7C')',`09`09`26f_cbuf20 `7D,
X#endif
X#if (OPT_EXEC_MACROS>17)
X`09`7B SPEC`7C'*',`09`09`26f_cbuf18 `7D,
X#endif
X#if (OPT_EXEC_MACROS>9)
X`09`7B SPEC`7C'0',`09`09`26f_cbuf10 `7D,
X#endif
X#if (OPT_EXEC_MACROS>0)
X`09`7B SPEC`7C'1',`09`09`26f_cbuf1 `7D,
X#endif
X#if (OPT_EXEC_MACROS>1)
X`09`7B SPEC`7C'2',`09`09`26f_cbuf2 `7D,
X#endif
X#if (OPT_EXEC_MACROS>2)
X`09`7B SPEC`7C'3',`09`09`26f_cbuf3 `7D,
X#endif
X#if (OPT_EXEC_MACROS>3)
X`09`7B SPEC`7C'4',`09`09`26f_cbuf4 `7D,
X#endif
X#if (OPT_EXEC_MACROS>4)
X`09`7B SPEC`7C'5',`09`09`26f_cbuf5 `7D,
X#endif
X#if (OPT_EXEC_MACROS>5)
X`09`7B SPEC`7C'6',`09`09`26f_cbuf6 `7D,
X#endif
X#if (OPT_EXEC_MACROS>6)
X`09`7B SPEC`7C'7',`09`09`26f_cbuf7 `7D,
X#endif
X#if (OPT_EXEC_MACROS>7)
X`09`7B SPEC`7C'8',`09`09`26f_cbuf8 `7D,
X#endif
X#if (OPT_EXEC_MACROS>8)
X`09`7B SPEC`7C'9',`09`09`26f_cbuf9 `7D,
X#endif
X`09`7B SPEC`7C'?',`09`09`26f_help `7D,
X#if (OPT_EXEC_MACROS>11)
X`09`7B SPEC`7C'@',`09`09`26f_cbuf12 `7D,
X#endif
X`09`7B SPEC`7C'A',`09`09`26f_backline `7D,
X`09`7B SPEC`7C'B',`09`09`26f_forwline `7D,
X`09`7B SPEC`7C'C',`09`09`26f_forwchar_to_eol `7D,
X`09`7B SPEC`7C'D',`09`09`26f_backchar_to_bol `7D,
X#if (!SMALLER)
X`09`7B SPEC`7C'E',`09`09`26f_gotoeob `7D,
X`09`7B SPEC`7C'H',`09`09`26f_gotobob `7D,
X#endif
X#if (OPT_XTERM`7C`7CDISP_X11)
X`09`7B SPEC`7C'M',`09`09`26f_mouse_motion `7D,
X#endif
X#if (OPT_EXEC_MACROS>0)
X`09`7B SPEC`7C'P',`09`09`26f_cbuf1 `7D,
X#endif
X#if (OPT_EXEC_MACROS>1)
X`09`7B SPEC`7C'Q',`09`09`26f_cbuf2 `7D,
X#endif
X#if (OPT_EXEC_MACROS>2)
X`09`7B SPEC`7C'R',`09`09`26f_cbuf3 `7D,
X#endif
X#if (OPT_EXEC_MACROS>3)
X`09`7B SPEC`7C'S',`09`09`26f_cbuf4 `7D,
X#endif
X#if ((OPT_XTERM>=3))
X`09`7B SPEC`7C'T',`09`09`26f_xterm_mouse_T `7D,
X#endif
X#if (OPT_EXEC_MACROS>15)
X`09`7B SPEC`7C'`5E',`09`09`26f_cbuf16 `7D,
X#endif
X`09`7B SPEC`7C'd',`09`09`26f_forwdelchar `7D,
X`09`7B SPEC`7C'f',`09`09`26f_forwsearch `7D,
X`09`7B SPEC`7C'i',`09`09`26f_insert `7D,
X`09`7B SPEC`7C'm',`09`09`26f_help `7D,
X`09`7B SPEC`7C'n',`09`09`26f_forwpage `7D,
X`09`7B SPEC`7C'p',`09`09`26f_backpage `7D,
X#if (OPT_SELECTIONS)
X`09`7B SPEC`7C's',`09`09`26f_multimotion `7D,
X#endif
X#if ((OPT_XTERM>=3))
X`09`7B SPEC`7C't',`09`09`26f_xterm_mouse_t `7D,
X#endif
X#if (OPT_EXEC_MACROS>20)
X`09`7B SPEC`7C0xa1,`09`09`26f_cbuf21 `7D,
X#endif
X#if (OPT_EXEC_MACROS>21)
X`09`7B SPEC`7C0xa2,`09`09`26f_cbuf22 `7D,
X#endif
X#if (OPT_EXEC_MACROS>22)
X`09`7B SPEC`7C0xa3,`09`09`26f_cbuf23 `7D,
X#endif
X#if (OPT_EXEC_MACROS>23)
X`09`7B SPEC`7C0xa4,`09`09`26f_cbuf24 `7D,
X#endif
X#if (OPT_EXEC_MACROS>24)
X`09`7B SPEC`7C0xa5,`09`09`26f_cbuf25 `7D,
X#endif
X#if (OPT_EXEC_MACROS>25)
X`09`7B SPEC`7C0xa6,`09`09`26f_cbuf26 `7D,
X#endif
X#if (OPT_EXEC_MACROS>26)
X`09`7B SPEC`7C0xa7,`09`09`26f_cbuf27 `7D,
X#endif
X#if (OPT_EXEC_MACROS>27)
X`09`7B SPEC`7C0xa8,`09`09`26f_cbuf28 `7D,
X#endif
X#if (OPT_EXEC_MACROS>28)
X`09`7B SPEC`7C0xa9,`09`09`26f_cbuf29 `7D,
X#endif
X#if (OPT_EXEC_MACROS>29)
X`09`7B SPEC`7C0xaa,`09`09`26f_cbuf30 `7D,
X#endif
X#if (OPT_EXEC_MACROS>30)
X`09`7B SPEC`7C0xab,`09`09`26f_cbuf31 `7D,
X#endif
X#if (OPT_EXEC_MACROS>31)
X`09`7B SPEC`7C0xac,`09`09`26f_cbuf32 `7D,
X#endif
X#if (SYS_WINNT)
X`09`7B SPEC`7C0xad,`09`09`26f_cbrdcpy_unnamed `7D,
X#endif
X#if ((OPT_EXEC_MACROS>32`26`26(!SYS_WINNT)))
X`09`7B SPEC`7C0xad,`09`09`26f_cbuf33 `7D,
X#endif
X#if (SYS_WINNT)
X`09`7B SPEC`7C0xae,`09`09`26f_opercbrdcpy `7D,
X#endif
X#if ((OPT_EXEC_MACROS>33`26`26(!SYS_WINNT)))
X`09`7B SPEC`7C0xae,`09`09`26f_cbuf34 `7D,
X#endif
X#if (SYS_WINNT)
X`09`7B SPEC`7C0xaf,`09`09`26f_cbrdpaste `7D,
X#endif
X#if ((OPT_EXEC_MACROS>34`26`26(!SYS_WINNT)))
X`09`7B SPEC`7C0xaf,`09`09`26f_cbuf35 `7D,
X#endif
X`09`7B 0, NULL `7D
X`7D;
$ call unpack [.VILE-8_0]NEBIND.H;4 -
 1309000327 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 27 78 152
$!
$ create 'f'
X/* neexec.h: this header file was produced automatically by
X * the dsa10:`5Bcompcent.`5D`5Budaa055.temp.vile-8_0`5Dmktbls.exe;1 program, b
Vased on input from the file cmdtbl
X */
X#if OPT_EXEC_MACROS>0
Xint
Xcbuf1(int f, int n)
X`7B
X`09return cbuf(f, n, 1);
X`7D
X#endif
X#if OPT_EXEC_MACROS>1
Xint
Xcbuf2(int f, int n)
X`7B
X`09return cbuf(f, n, 2);
X`7D
X#endif
X#if OPT_EXEC_MACROS>2
Xint
Xcbuf3(int f, int n)
X`7B
X`09return cbuf(f, n, 3);
X`7D
X#endif
X#if OPT_EXEC_MACROS>3
Xint
Xcbuf4(int f, int n)
X`7B
X`09return cbuf(f, n, 4);
X`7D
X#endif
X#if OPT_EXEC_MACROS>4
Xint
Xcbuf5(int f, int n)
X`7B
X`09return cbuf(f, n, 5);
X`7D
X#endif
X#if OPT_EXEC_MACROS>5
Xint
Xcbuf6(int f, int n)
X`7B
X`09return cbuf(f, n, 6);
X`7D
X#endif
X#if OPT_EXEC_MACROS>6
Xint
Xcbuf7(int f, int n)
X`7B
X`09return cbuf(f, n, 7);
X`7D
X#endif
X#if OPT_EXEC_MACROS>7
Xint
Xcbuf8(int f, int n)
X`7B
X`09return cbuf(f, n, 8);
X`7D
X#endif
X#if OPT_EXEC_MACROS>8
Xint
Xcbuf9(int f, int n)
X`7B
X`09return cbuf(f, n, 9);
X`7D
X#endif
X#if OPT_EXEC_MACROS>9
Xint
Xcbuf10(int f, int n)
X`7B
X`09return cbuf(f, n, 10);
X`7D
X#endif
X#if OPT_EXEC_MACROS>10
Xint
Xcbuf11(int f, int n)
X`7B
X`09return cbuf(f, n, 11);
X`7D
X#endif
X#if OPT_EXEC_MACROS>11
Xint
Xcbuf12(int f, int n)
X`7B
X`09return cbuf(f, n, 12);
X`7D
X#endif
X#if OPT_EXEC_MACROS>12
Xint
Xcbuf13(int f, int n)
X`7B
X`09return cbuf(f, n, 13);
X`7D
X#endif
X#if OPT_EXEC_MACROS>13
Xint
Xcbuf14(int f, int n)
X`7B
X`09return cbuf(f, n, 14);
X`7D
X#endif
X#if OPT_EXEC_MACROS>14
Xint
Xcbuf15(int f, int n)
X`7B
X`09return cbuf(f, n, 15);
X`7D
X#endif
X#if OPT_EXEC_MACROS>15
Xint
Xcbuf16(int f, int n)
X`7B
X`09return cbuf(f, n, 16);
X`7D
X#endif
X#if OPT_EXEC_MACROS>16
Xint
Xcbuf17(int f, int n)
X`7B
X`09return cbuf(f, n, 17);
X`7D
X#endif
X#if OPT_EXEC_MACROS>17
Xint
Xcbuf18(int f, int n)
X`7B
X`09return cbuf(f, n, 18);
X`7D
X#endif
X#if OPT_EXEC_MACROS>18
Xint
Xcbuf19(int f, int n)
X`7B
X`09return cbuf(f, n, 19);
X`7D
X#endif
X#if OPT_EXEC_MACROS>19
Xint
Xcbuf20(int f, int n)
X`7B
X`09return cbuf(f, n, 20);
X`7D
X#endif
X#if OPT_EXEC_MACROS>20
Xint
Xcbuf21(int f, int n)
X`7B
X`09return cbuf(f, n, 21);
X`7D
X#endif
X#if OPT_EXEC_MACROS>21
Xint
Xcbuf22(int f, int n)
X`7B
X`09return cbuf(f, n, 22);
X`7D
X#endif
X#if OPT_EXEC_MACROS>22
Xint
Xcbuf23(int f, int n)
X`7B
X`09return cbuf(f, n, 23);
X`7D
X#endif
X#if OPT_EXEC_MACROS>23
Xint
Xcbuf24(int f, int n)
X`7B
X`09return cbuf(f, n, 24);
X`7D
X#endif
X#if OPT_EXEC_MACROS>24
Xint
Xcbuf25(int f, int n)
X`7B
X`09return cbuf(f, n, 25);
X`7D
X#endif
X#if OPT_EXEC_MACROS>25
Xint
Xcbuf26(int f, int n)
X`7B
X`09return cbuf(f, n, 26);
X`7D
X#endif
X#if OPT_EXEC_MACROS>26
Xint
Xcbuf27(int f, int n)
X`7B
X`09return cbuf(f, n, 27);
X`7D
X#endif
X#if OPT_EXEC_MACROS>27
Xint
Xcbuf28(int f, int n)
X`7B
X`09return cbuf(f, n, 28);
X`7D
X#endif
X#if OPT_EXEC_MACROS>28
Xint
Xcbuf29(int f, int n)
X`7B
X`09return cbuf(f, n, 29);
X`7D
X#endif
X#if OPT_EXEC_MACROS>29
Xint
Xcbuf30(int f, int n)
X`7B
X`09return cbuf(f, n, 30);
X`7D
X#endif
X#if OPT_EXEC_MACROS>30
Xint
Xcbuf31(int f, int n)
X`7B
X`09return cbuf(f, n, 31);
X`7D
X#endif
X#if OPT_EXEC_MACROS>31
Xint
Xcbuf32(int f, int n)
X`7B
X`09return cbuf(f, n, 32);
X`7D
X#endif
X#if OPT_EXEC_MACROS>32
Xint
Xcbuf33(int f, int n)
X`7B
X`09return cbuf(f, n, 33);
X`7D
X#endif
X#if OPT_EXEC_MACROS>33
Xint
Xcbuf34(int f, int n)
X`7B
X`09return cbuf(f, n, 34);
X`7D
X#endif
X#if OPT_EXEC_MACROS>34
Xint
Xcbuf35(int f, int n)
X`7B
X`09return cbuf(f, n, 35);
X`7D
X#endif
X#if OPT_EXEC_MACROS>35
Xint
Xcbuf36(int f, int n)
X`7B
X`09return cbuf(f, n, 36);
X`7D
X#endif
X#if OPT_EXEC_MACROS>36
Xint
Xcbuf37(int f, int n)
X`7B
X`09return cbuf(f, n, 37);
X`7D
X#endif
X#if OPT_EXEC_MACROS>37
Xint
Xcbuf38(int f, int n)
X`7B
X`09return cbuf(f, n, 38);
X`7D
X#endif
X#if OPT_EXEC_MACROS>38
Xint
Xcbuf39(int f, int n)
X`7B
X`09return cbuf(f, n, 39);
X`7D
X#endif
X#if OPT_EXEC_MACROS>39
Xint
Xcbuf40(int f, int n)
X`7B
X`09return cbuf(f, n, 40);
X`7D
X#endif
$ call unpack [.VILE-8_0]NEEXEC.H;4 -
 71380465 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 8 79 152
$!
$ create 'f'
X/* nefkeys.h: this header file was produced automatically by
X * the dsa10:`5Bcompcent.`5D`5Budaa055.temp.vile-8_0`5Dmktbls.exe;1 program, b
Vased on input from the file cmdtbl
X */
X#define         KEY_Left (SPEC`7C'D')
X#define           KEY_Up (SPEC`7C'A')
X#define        KEY_Prior (SPEC`7C'p')
X#define          KEY_F33 (SPEC`7C'`5C255')
X#define          KEY_F35 (SPEC`7C'`5C257')
X#define          KEY_F34 (SPEC`7C'`5C256')
X#define           KEY_F1 (SPEC`7C'1')
X#define        KEY_KP_F1 (SPEC`7C'P')
X#define           KEY_F2 (SPEC`7C'2')
X#define        KEY_KP_F2 (SPEC`7C'Q')
X#define           KEY_F3 (SPEC`7C'3')
X#define        KEY_KP_F3 (SPEC`7C'R')
X#define           KEY_F4 (SPEC`7C'4')
X#define        KEY_KP_F4 (SPEC`7C'S')
X#define           KEY_F5 (SPEC`7C'5')
X#define           KEY_F6 (SPEC`7C'6')
X#define           KEY_F7 (SPEC`7C'7')
X#define           KEY_F8 (SPEC`7C'8')
X#define           KEY_F9 (SPEC`7C'9')
X#define          KEY_F10 (SPEC`7C'0')
X#define          KEY_F11 (SPEC`7C'!')
X#define          KEY_F12 (SPEC`7C'@')
X#define          KEY_F13 (SPEC`7C'#')
X#define          KEY_F14 (SPEC`7C'$')
X#define          KEY_F15 (SPEC`7C'%')
X#define          KEY_F16 (SPEC`7C'`5E')
X#define          KEY_F17 (SPEC`7C'`26')
X#define          KEY_F18 (SPEC`7C'*')
X#define          KEY_F19 (SPEC`7C'(')
X#define          KEY_F20 (SPEC`7C')')
X#define          KEY_F21 (SPEC`7C'`5C241')
X#define          KEY_F22 (SPEC`7C'`5C242')
X#define          KEY_F23 (SPEC`7C'`5C243')
X#define          KEY_F24 (SPEC`7C'`5C244')
X#define          KEY_F25 (SPEC`7C'`5C245')
X#define          KEY_F26 (SPEC`7C'`5C246')
X#define          KEY_F27 (SPEC`7C'`5C247')
X#define          KEY_F28 (SPEC`7C'`5C250')
X#define          KEY_F29 (SPEC`7C'`5C251')
X#define          KEY_F30 (SPEC`7C'`5C252')
X#define          KEY_F31 (SPEC`7C'`5C253')
X#define          KEY_F32 (SPEC`7C'`5C254')
X#define          KEY_F33 (SPEC`7C'`5C255')
X#define          KEY_F34 (SPEC`7C'`5C256')
X#define          KEY_F35 (SPEC`7C'`5C257')
X#define       KEY_Delete (SPEC`7C'd')
X#define        KEY_Right (SPEC`7C'C')
X#define         KEY_Next (SPEC`7C'n')
X#define         KEY_Down (SPEC`7C'B')
X#define         KEY_Find (SPEC`7C'f')
X#define         KEY_Home (SPEC`7C'H')
X#define          KEY_End (SPEC`7C'E')
X#define         KEY_Help (SPEC`7C'?')
X#define         KEY_Menu (SPEC`7C'm')
X#define       KEY_Insert (SPEC`7C'i')
X#define       KEY_Select (SPEC`7C's')
X#define        KEY_Mouse (SPEC`7C'M')
X#define         KEY_text (SPEC`7C't')
X#define  KEY_textInvalid (SPEC`7C'T')
$ call unpack [.VILE-8_0]NEFKEYS.H;4 -
 926629054 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 5 80 152
$!
$ create 'f'
X/* nefsms.h: this header file was produced automatically by
X * the dsa10:`5Bcompcent.`5D`5Budaa055.temp.vile-8_0`5Dmktbls.exe;1 program, b
Vased on input from the file modetbl
X */
X#if OPT_ENUM_MODES
X
X#define ENUM_ILLEGAL   (-2)
X#define ENUM_UNKNOWN   (-1)
X#define END_CHOICES    `7B (char *)0, ENUM_ILLEGAL `7D
X
Xtypedef struct `7B
X`09const char * choice_name;
X`09int    choice_code;
X`7D FSM_CHOICES;
X
Xstruct FSM `7B
X`09const char * mode_name;
X`09const FSM_CHOICES * choices;
X`7D;
X
X#if OPT_COLOR_CHOICES
Xstatic const
XFSM_CHOICES fsm_color_choices`5B`5D = `7B
X`09`7B "black",`09`09`090 `7D,
X`09`7B "blue",`09`09`094 `7D,
X#if OPT_16_COLOR
X`09`7B "brightblue",`09`09`0912 `7D,
X`09`7B "brightcyan",`09`09`0914 `7D,
X`09`7B "brightgreen",`09`0910 `7D,
X`09`7B "brightmagenta",`09`0913 `7D,
X`09`7B "brightred",`09`09`099 `7D,
X`09`7B "brown",`09`09`093 `7D,
X#endif
X`09`7B "cyan",`09`09`096 `7D,
X#if DISP_TERMCAP`7C`7CDISP_IBMPC
X`09`7B "default",`09`09`09ENUM_UNKNOWN `7D,
X#endif
X#if OPT_16_COLOR
X`09`7B "gray",`09`09`098 `7D,
X#endif
X`09`7B "green",`09`09`092 `7D,
X#if OPT_16_COLOR
X`09`7B "lightgray",`09`09`097 `7D,
X#endif
X`09`7B "magenta",`09`09`095 `7D,
X`09`7B "red",`09`09`091 `7D,
X#if !OPT_16_COLOR
X`09`7B "white",`09`09`097 `7D,
X#endif
X#if OPT_16_COLOR
X`09`7B "white",`09`09`0915 `7D,
X#endif
X#if !OPT_16_COLOR
X`09`7B "yellow",`09`09`093 `7D,
X#endif
X#if OPT_16_COLOR
X`09`7B "yellow",`09`09`0911 `7D,
X#endif
X`09END_CHOICES`09/* ends table for name-completion */
X`7D;
X#endif /* OPT_COLOR_CHOICES */
X
X#if OPT_BOOL_CHOICES
Xstatic const
XFSM_CHOICES fsm_bool_choices`5B`5D = `7B
X`09`7B "false",`09`09`09FALSE `7D,
X`09`7B "true",`09`09`09TRUE `7D,
X`09END_CHOICES`09/* ends table for name-completion */
X`7D;
X#endif /* OPT_BOOL_CHOICES */
X
X#if OPT_POPUP_CHOICES
Xstatic const
XFSM_CHOICES fsm_popup_choices`5B`5D = `7B
X`09`7B "delayed",`09`09`09POPUP_CHOICES_DELAYED `7D,
X`09`7B "immediate",`09`09`09POPUP_CHOICES_IMMED `7D,
X`09`7B "off",`09`09`09POPUP_CHOICES_OFF `7D,
X`09END_CHOICES`09/* ends table for name-completion */
X`7D;
X#endif /* OPT_POPUP_CHOICES */
X
X#if OPT_BACKUP_CHOICES
Xstatic const
XFSM_CHOICES fsm_backup_choices`5B`5D = `7B
X`09`7B ".bak",`09`09`091 `7D,
X`09`7B "off",`09`09`090 `7D,
X#if SYS_UNIX
X`09`7B "tilde",`09`09`092 `7D,
X#endif
X`09END_CHOICES`09/* ends table for name-completion */
X`7D;
X#endif /* OPT_BACKUP_CHOICES */
X
X#if OPT_HILITE_CHOICES
Xstatic const
XFSM_CHOICES fsm_hilite_choices`5B`5D = `7B
X#if OPT_COLOR
X`09`7B "black",`09`09`09VACOL_0 `7D,
X`09`7B "blue",`09`09`09VACOL_4 `7D,
X#endif
X`09`7B "bold",`09`09`09VABOLD `7D,
X#if OPT_COLOR`26`26OPT_16\0E06
X`09`7B "brightblue",`09`09`09VACOL_C `7D,
X`09`7B "brightcyan",`09`09`09VACOL_E `7D,
X`09`7B "brightgreen",`09`09VACOL_A `7D,
X`09`7B "brightmagenta",`09`09VACOL_D `7D,
X`09`7B "brightred",`09`09`09VACOL_9 `7D,
X`09`7B "brown",`09`09`09VACOL_3 `7D,
X#endif
X`09`7B "color",`09`09`09VACOLOR `7D,
X#if OPT_COLOR
X`09`7B "cyan",`09`09`09VACOL_6 `7D,
X#endif
X#if OPT_COLOR`26`26OPT_16\0E06
X`09`7B "gray",`09`09`09VACOL_8 `7D,
X#endif
X#if OPT_COLOR
X`09`7B "green",`09`09`09VACOL_2 `7D,
X#endif
X`09`7B "italic",`09`09`09VAITAL `7D,
X#if OPT_COLOR`26`26OPT_16\0E06
X`09`7B "lightgray",`09`09`09VACOL_7 `7D,
X#endif
X#if OPT_COLOR
X`09`7B "magenta",`09`09`09VACOL_5 `7D,
X#endif
X`09`7B "none",`09`09`090 `7D,
X#if OPT_COLOR
X`09`7B "red",`09`09`09VACOL_1 `7D,
X#endif
X`09`7B "reverse",`09`09`09VAREV `7D,
X`09`7B "underline",`09`09`09VAUL `7D,
X#if OPT_COLOR`26`26!OPT_16\0F06
X`09`7B "white",`09`09`09VACOL_7 `7D,
X#endif
X#if OPT_COLOR`26`26OPT_16\0E06
X`09`7B "white",`09`09`09VACOL_F `7D,
X#endif
X#if OPT_COLOR`26`26!OPT_16\0F06
X`09`7B "yellow",`09`09`09VACOL_3 `7D,
X#endif
X#if OPT_COLOR`26`26OPT_16\0E06
X`09`7B "yellow",`09`09`09VACOL_B `7D,
X#endif
X`09END_CHOICES`09/* ends table for name-completion */
X`7D;
X#endif /* OPT_HILITE_CHOICES */
X
X#endif /* OPT_ENUM_MODES */
$ call unpack [.VILE-8_0]NEFSMS.H;4 -
 561151925 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 7 81 152
$!
$ create 'f'
X/* nefunc.h: this header file was produced automatically by
X * the dsa10:`5Bcompcent.`5D`5Budaa055.temp.vile-8_0`5Dmktbls.exe;1 program, b
Vased on input from the file cmdtbl
X */
X
X#ifdef real_CMDFUNCS
X
X`09EXTERN_CONST CMDFUNC f_abbrev = `7B `7B\0C06`7D,`09NONE`7C(EXRCOK`7CEXTRA)
V
X#if OPT_ONLINEHELP
X`09`09,"establish shorthand for another string, or show all abbreviations"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_altbuff = `7B `7B\0D07`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"switch to previous buffer"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_append = `7B `7B\0C06`7D,`09REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"insert (CNT copies of) text after the cursor"
X#endif
X `7D;
X#if !SMALLER
X`09EXTERN_CONST CMDFUNC f_appstring = `7B `7B\0F09`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"append the given string after the cursor"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_appendeol = `7B `7B\0F09`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"insert (CNT copies of) text after the end of line"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_backchar = `7B `7B\0E08`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"move CNT characters left, wrapping to previous line"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_backchar_to_bol = `7B `7B\150F`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"move CNT characters left, stopping at beginning of line"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_backdelchar = `7B `7B\110B`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"delete CNT characters to the left"
X#endif
X `7D;
X#if !SMALLER
X`09EXTERN_CONST CMDFUNC f_backhunt = `7B `7B\0E08`7D, ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"search backward for previously entered pattern"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_backhpage = `7B `7B\0F09`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"move up CNT half screens"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_backline = `7B `7B\0E08`7D, GOAL`7CMOTION`7CFL
X#if OPT_ONLINEHELP
X`09`09,"move up CNT lines"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_backbline = `7B `7B\0F09`7D, MOTION`7CFL
X#if OPT_ONLINEHELP
X`09`09,"move up CNT lines, to first non-white character"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_backpage = `7B `7B\0E08`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"move up CNT full screens"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_backword = `7B `7B\0E08`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"move left by CNT `5C"big`5C" words"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_backviword = `7B `7B\100A`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"move left by CNT `5C"small`5C" words"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_backsearch = `7B `7B\100A`7D, ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"search backwards for fresh pattern"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_bcsrch = `7B `7B\0C06`7D,`09MOTION
X#if OPT_ONLINEHELP
X`09`09,"scan left on the line for the given character"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_bcsrch_to = `7B `7B\0F09`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"scan left on the line up to but not including the given character"
X#endif
X `7D;
X#if OPT_REBIND
X`09EXTERN_CONST CMDFUNC f_bindkey = `7B `7B\0D07`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"bind a keystroke to a function"
X#endif
X `7D;
X#endif
X#if OPT_SHELL
X`09EXTERN_CONST CMDFUNC f_bktoshell = `7B `7B\0F09`7D, NONE`7C(BANG)
X#if OPT_ONLINEHELP
X`09`09,"suspend the editor"
X#endif
X `7D;
X#endif
X#if SYS_WINNT
X`09EXTERN_CONST CMDFUNC f_cbrdcpy_unnamed = `7B `7B\150F`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"copies the unnamed register selection to the windows clipboard"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_cbrdpaste = `7B `7B\0F09`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"paste the windows clipboard contents"
X#endif
X `7D;
X#endif
X#if OPT_SHELL
X`09EXTERN_CONST CMDFUNC f_cd = `7B `7Bcd`7D,`09`09NONE
X#if OPT_ONLINEHELP
X`09`09,"move to a new directory, `5C"-`5C" is previous, `5C"`7E\1306$HOME"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_cntl_x_func = `7B `7B\110B`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"the `5C"Control-X`5C" prefix, used when typing extended commands"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_chgchar = `7B `7B\0D07`7D,`09REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"insert text to replace CNT characters"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_chgline = `7B `7B\0D07`7D,`09REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"insert text to replace the current line"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_chgtoeol = `7B `7B\0E08`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"insert text to replace the rest of the line"
X#endif
X `7D;
X#if OPT_HILITEMATCH
X`09EXTERN_CONST CMDFUNC f_clear_match_attrs = `7B `7B\1711`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"clear highlighting caused by searches when `5C"visual-matches`5C" is s
Vet"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_clrmes = `7B `7B\0C06`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"erase text on the bottom line of screen"
X#endif
X `7D;
X#if OPT_FINDERR
X`09EXTERN_CONST CMDFUNC f_comp_err_exps = `7B `7B\130D`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"(re)compile the `5BError Expressions`5D buffer"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_consearch = `7B `7B\0F09`7D, ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"search for previous pattern in same direction as before"
+-+-+-+-+-+-+-+-  END  OF PART 78 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 79 -+-+-+-+-+-+-+-+
X#endif
X `7D;
X#if OPT_WORDCOUNT
X`09EXTERN_CONST CMDFUNC f_wordcount = `7B `7B\0F09`7D, RANGE
X#if OPT_ONLINEHELP
X`09`09,"count words, lines, and chars in the region"
X#endif
X `7D;
X#endif
X#if SYS_WINNT
X`09EXTERN_CONST CMDFUNC f_opercbrdcpy = `7B `7B\110B`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"copies the specified region to the windows clipboard"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_opercopy = `7B `7B\0E08`7D, OPER`7C(RANGE`7CEXTRA)
X#if OPT_ONLINEHELP
X`09`09,"copy text in the region"
X#endif
X `7D;
X#if OPT_ENCRYPT
X`09EXTERN_CONST CMDFUNC f_opercrypt = `7B `7B\0F09`7D, OPER`7CREDO`7CUNDO`7CGL
VOBOK`7C(RANGE)
X#if OPT_ONLINEHELP
X`09`09,"encrypt/decrypt text in the region"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_kbd_mac_begin = `7B `7B\130D`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"begin recording a macro of keystrokes"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_kbd_mac_end = `7B `7B\110B`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"end recording a macro of keystrokes"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_kbd_mac_exec = `7B `7B\120C`7D, REDO`7CUNDO`7CVIEWOK
V
X#if OPT_ONLINEHELP
X`09`09,"execute a previously recorded macro of keystrokes"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_kbd_mac_save = `7B `7B\120C`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"save a previously recorded macro of keystrokes to a named register"
X#endif
X `7D;
X#if OPT_EXEC_MACROS>0
X`09EXTERN_CONST CMDFUNC f_cbuf1 = `7B `7Bcbuf1`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 1`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>1
X`09EXTERN_CONST CMDFUNC f_cbuf2 = `7B `7Bcbuf2`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 2`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>2
X`09EXTERN_CONST CMDFUNC f_cbuf3 = `7B `7Bcbuf3`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 3`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>3
X`09EXTERN_CONST CMDFUNC f_cbuf4 = `7B `7Bcbuf4`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 4`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>4
X`09EXTERN_CONST CMDFUNC f_cbuf5 = `7B `7Bcbuf5`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 5`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>5
X`09EXTERN_CONST CMDFUNC f_cbuf6 = `7B `7Bcbuf6`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 6`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>6
X`09EXTERN_CONST CMDFUNC f_cbuf7 = `7B `7Bcbuf7`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 7`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>7
X`09EXTERN_CONST CMDFUNC f_cbuf8 = `7B `7Bcbuf8`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 8`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>8
X`09EXTERN_CONST CMDFUNC f_cbuf9 = `7B `7Bcbuf9`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 9`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>9
X`09EXTERN_CONST CMDFUNC f_cbuf10 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 10`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>10
X`09EXTERN_CONST CMDFUNC f_cbuf11 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 11`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>11
X`09EXTERN_CONST CMDFUNC f_cbuf12 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 12`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>12
X`09EXTERN_CONST CMDFUNC f_cbuf13 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 13`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>13
X`09EXTERN_CONST CMDFUNC f_cbuf14 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 14`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>14
X`09EXTERN_CONST CMDFUNC f_cbuf15 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 15`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>15
X`09EXTERN_CONST CMDFUNC f_cbuf16 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 16`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>16
X`09EXTERN_CONST CMDFUNC f_cbuf17 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 17`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>17
X`09EXTERN_CONST CMDFUNC f_cbuf18 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 18`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>18
X`09EXTERN_CONST CMDFUNC f_cbuf19 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 19`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>19
X`09EXTERN_CONST CMDFUNC f_cbuf20 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 20`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>20
X`09EXTERN_CONST CMDFUNC f_cbuf21 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 21`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>21
X`09EXTERN_CONST CMDFUNC f_cbuf22 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 22`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>22
X`09EXTERN_CONST CMDFUNC f_cbuf23 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 23`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>23
X`09EXTERN_CONST CMDFUNC f_cbuf24 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 24`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>24
X`09EXTERN_CONST CMDFUNC f_cbuf25 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 25`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>25
X`09EXTERN_CONST CMDFUNC f_cbuf26 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 26`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>26
X`09EXTERN_CONST CMDFUNC f_cbuf27 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 27`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>27
X`09EXTERN_CONST CMDFUNC f_cbuf28 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 28`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>28
X`09EXTERN_CONST CMDFUNC f_cbuf29 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 29`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>29
X`09EXTERN_CONST CMDFUNC f_cbuf30 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 30`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>30
X`09EXTERN_CONST CMDFUNC f_cbuf31 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 31`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>31
X`09EXTERN_CONST CMDFUNC f_cbuf32 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 32`5D"
X#endif
X `7D;
X#endif
X#if (OPT_EXEC_MACROS>32`26`26(!SYS_WINNT))
X`09EXTERN_CONST CMDFUNC f_cbuf33 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 33`5D"
X#endif
X `7D;
X#endif
X#if (OPT_EXEC_MACROS>33`26`26(!SYS_WINNT))
X`09EXTERN_CONST CMDFUNC f_cbuf34 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 34`5D"
X#endif
X `7D;
X#endif
X#if (OPT_EXEC_MACROS>34`26`26(!SYS_WINNT))
X`09EXTERN_CONST CMDFUNC f_cbuf35 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 35`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>35
X`09EXTERN_CONST CMDFUNC f_cbuf36 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 36`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>36
X`09EXTERN_CONST CMDFUNC f_cbuf37 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 37`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>37
X`09EXTERN_CONST CMDFUNC f_cbuf38 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 38`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>38
X`09EXTERN_CONST CMDFUNC f_cbuf39 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 39`5D"
X#endif
X `7D;
X#endif
X#if OPT_EXEC_MACROS>39
X`09EXTERN_CONST CMDFUNC f_cbuf40 = `7B `7B\0C06`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"execute `5BMacro 40`5D"
X#endif
X `7D;
X#endif
X#if OPT_MAJORMODE
X`09EXTERN_CONST CMDFUNC f_define_mode = `7B `7B\110B`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"define a major mode, i.e., a collection of buffe\2306s"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_define_submode = `7B `7B\140E`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"define a submode within a major mode"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_delwind = `7B `7B\0D07`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"destroy the current window, unless it is the last one"
X#endif
X `7D;
X#if OPT_AEDIT
X`09EXTERN_CONST CMDFUNC f_forceblank = `7B `7B\100A`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"delete blank lines (or force some if CNT specified)"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_delglobmode = `7B `7B\110B`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"turn off the global value of a mode setting"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_dellocmode = `7B `7B\100A`7D, NONE`7C(EXRCOK`7CEXTRA
V)
X#if OPT_ONLINEHELP
X`09`09,"turn off the current buffer's local value of a mode setting"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_deltoeol = `7B `7B\0E08`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"delete text from cursor to the end of line"
X#endif
X `7D;
X#if OPT_REBIND
X`09EXTERN_CONST CMDFUNC f_desbind = `7B `7B\0D07`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"show a list of all commands"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_desmotions = `7B `7B\100A`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"show a list of all motion commands"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_desopers = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"show a list of all operator commands"
X#endif
X `7D;
X#endif
X#if OPT_SHOW_CTYPE
X`09EXTERN_CONST CMDFUNC f_desprint = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"show the printable characters, with types"
X#endif
X `7D;
X#endif
X#if OPT_REBIND
X`09EXTERN_CONST CMDFUNC f_desapro = `7B `7B\0D07`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"look up command names containing a string"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_desfunc = `7B `7B\0D07`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"show a description and current bindings for a function"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_deskey = `7B `7B\0C06`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"show the function bound to a given key"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_dotcmdplay = `7B `7B\100A`7D, UNDO
X#if OPT_ONLINEHELP
X`09`09,"repeat the last text-changing command"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_ex = `7B `7Bex`7D,`09`09NONE`7C(BANG`7CFILE1)
X#if OPT_ONLINEHELP
X`09`09,"entry point to the `5C"exile`5C" editor.  unimplemented"
X#endif
X `7D;
X#if !SMALLER
X`09EXTERN_CONST CMDFUNC f_execbuf = `7B `7B\0D07`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"run the given buffer as a script"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_execfile = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"run the given file as a script"
X#endif
X `7D;
X#endif
X#if OPT_HYPERTEXT
X`09EXTERN_CONST CMDFUNC f_exechypercmd = `7B `7B\120C`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"run the hypertext command attached to the region under the cursor"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_showhypercmd = `7B `7B\120C`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"show the hypertext command attached to the region under the cursor"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_execkreg = `7B `7B\0E08`7D, REDO`7CUNDO`7CVIEWOK
X#if OPT_ONLINEHELP
X`09`09,"execute the keystroke macro stored in the given named register"
X#endif
X `7D;
X#if OPT_PROCEDURES
X`09EXTERN_CONST CMDFUNC f_execproc = `7B `7B\0E08`7D, REDO
X#if OPT_ONLINEHELP
X`09`09,"run the given named stored-procedure as a script"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_enlargewind = `7B `7B\110B`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"increase the size of the current window by CNT lines"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_esc_func = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"the abort key, normally bound to ESC; it terminates lots of things"
X#endif
X `7D;
X#if SYS_UNIX
X`09EXTERN_CONST CMDFUNC f_flow_control_enable = `7B `7B\1913`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"enable software flow-control (disable with arg)"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_fcsrch = `7B `7B\0C06`7D,`09MOTION
X#if OPT_ONLINEHELP
X`09`09,"scan right on the line for the given character"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_fcsrch_to = `7B `7B\0F09`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"scan right on the line up to but not including the given character"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_filefind = `7B `7B\0E08`7D, NONE`7C(BANG`7CFILE1`7CP
VLUS)
X#if OPT_ONLINEHELP
X`09`09,"bring given (or under-cursor) file or existing buffer into window"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_fileread = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"replace the contents of\1006urrent buffer with the given file"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_filename = `7B `7B\0E08`7D, NONE`7C(NAMEDF)
X#if OPT_ONLINEHELP
X`09`09,"change the filename associated with the current buffer"
X#endif
X `7D;
X#if !SMALLER
X`09EXTERN_CONST CMDFUNC f_filesave = `7B `7B\0E08`7D, NONE`7CBANG
X#if OPT_ONLINEHELP
X`09`09,"save the contents of\1006urrent buffer to its associated filename"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_filewrite = `7B `7B\0F09`7D, NONE`7CBANG
X#if OPT_ONLINEHELP
X`09`09,"write the entire contents of the current buffer to its filename"
X#endif
X `7D;
X#if OPT_SHELL
X`09EXTERN_CONST CMDFUNC f_vile_filter = `7B `7B\110B`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"pipe the entire buffer through an external filter command"
X#endif
X `7D;
X#endif
X#if OPT_FINDERR
X`09EXTERN_CONST CMDFUNC f_finderr = `7B `7B\0D07`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"move to the next `5C"error`5C" in the error-buffer"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_finderrbuf = `7B `7B\100A`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"set the name of the buffer used as the error-\1906"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_firstbuffer = `7B `7B\110B`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"go to first buffer in\0A08list.  (does nothing if `5C"auto\2F06`5C" se
Vt"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_firstnonwhite = `7B `7B\130D`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"move to the first non-whitespace character on line"
X#endif
X `7D;
X#if OPT_ISRCH
X`09EXTERN_CONST CMDFUNC f_fisearch = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"search forwards for a pattern entered character by\0D0A"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_flipchar = `7B `7B\0E08`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"exchange upper and lowercase for the current character"
X#endif
X `7D;
X#if DISP_HP150
X`09EXTERN_CONST CMDFUNC f_fnclabel = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"label the given function key"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_forwdelchar = `7B `7B\110B`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"delete CNT characters to the right"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_forwhpage = `7B `7B\0F09`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"move down CNT half screens"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_forwchar = `7B `7B\0E08`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"move CNT characters right, wrapping to next line"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_forwchar_to_eol = `7B `7B\150F`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"move CNT characters right, stopping at end of line"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_forwpage = `7B `7B\0E08`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"move down CNT full screens"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_forwline = `7B `7B\0E08`7D, GOAL`7CMOTION`7CFL
X#if OPT_ONLINEHELP
X`09`09,"move down CNT lines"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_forwbline = `7B `7B\0F09`7D, MOTION`7CFL
X#if OPT_ONLINEHELP
X`09`09,"move down CNT lines, to first non-white character"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_forwword = `7B `7B\0E08`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"move right by CNT `5C"big`5C" words"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_forwviword = `7B `7B\100A`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"move right by CNT `5C"small`5C" words"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_forwendw = `7B `7B\0E08`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"move right to the end of CNT `5C"big`5C" words"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_forwviendw = `7B `7B\100A`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"move right to the end of CNT `5C"small`5C" words"
X#endif
X `7D;
X#if !SMALLER
X`09EXTERN_CONST CMDFUNC f_forwhunt = `7B `7B\0E08`7D, ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"search forward for previously entered pattern"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_forwsearch = `7B `7B\100A`7D, ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"search forwards for fresh pattern"
X#endif
X `7D;
X#if OPT_CFENCE
X`09EXTERN_CONST CMDFUNC f_matchfence = `7B `7B\100A`7D, ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"find partner for next (,),`5B,`5D,`7B,`7D,#if,#else,#endif,/*,*/"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_matchfenceback = `7B `7B\140E`7D, ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"find partner for previous (,),`5B,`5D,`7B,`7D on line"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_globals = `7B `7B\0D07`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,""
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_godotplus = `7B `7B\0F09`7D, MOTION`7CFL
X#if OPT_ONLINEHELP
X`09`09,"move CNT whole lines.  same as `5C"stuttering`5C" most operators"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_gomark = `7B `7B\0C06`7D,`09MOTION`7CFL`7C(RANGE`7CZ
VERO)
X#if OPT_ONLINEHELP
X`09`09,""
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_gotobop = `7B `7B\0D07`7D,`09ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"move to the start of a paragraph"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_gotoeop = `7B `7B\0D07`7D,`09ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"move to the end of a paragraph"
X#endif
X `7D;
X#if !SMALLER
X`09EXTERN_CONST CMDFUNC f_gotobob = `7B `7B\0D07`7D,`09ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"move to the top of the buffer"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_gotoeob = `7B `7B\0D07`7D,`09ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"move to the end of the buffer"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_gotobol = `7B `7B\0D07`7D,`09MOTION
X#if OPT_ONLINEHELP
X`09`09,"move to the very beginning of the line"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_gotoeol = `7B `7B\0D07`7D,`09MOTION`7CGOAL
X#if OPT_ONLINEHELP
X`09`09,"move to the very end of the line"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_gotobos = `7B `7B\0D07`7D,`09ABSM`7CMOTION`7CFL
X#if OPT_ONLINEHELP
X`09`09,"move to the CNT'th line on the screen"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_gotomos = `7B `7B\0D07`7D,`09ABSM`7CMOTION`7CFL
X#if OPT_ONLINEHELP
X`09`09,"move to the line in the middle of the screen"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_gotoeos = `7B `7B\0D07`7D,`09ABSM`7CMOTION`7CFL
X#if OPT_ONLINEHELP
X`09`09,"move to the CNT'th line from the bottom of the screen"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_gotobosec = `7B `7B\0F09`7D, ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"move to the previous start of a `5C"section`5C""
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_gotoeosec = `7B `7B\0F09`7D, ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"move to the next start of a `5C"section`5C""
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_gotobosent = `7B `7B\100A`7D, ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"move to the previous start of a `5C"sentence`5C""
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_gotoeosent = `7B `7B\100A`7D, ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"move to the next start of a `5C"sentence`5C""
X#endif
X `7D;
X#if OPT_TAGS
X`09EXTERN_CONST CMDFUNC f_gototag = `7B `7B\0D07`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"look up the given (or under-cursor) name as a `5C"tag`5C""
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_gotocol = `7B `7B\0D07`7D,`09MOTION
X#if OPT_ONLINEHELP
X`09`09,"go to the CNT'th column on the line"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_gotoline = `7B `7B\0E08`7D, ABSM`7CMOTION`7CFL`7C(RA
VNGE)
X#if OPT_ONLINEHELP
X`09`09,"go to the CNT'th line.  unspecified CNT means end of buffer"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_golinenmmark = `7B `7B\120C`7D, MOTION`7CFL
X#if OPT_ONLINEHELP
X`09`09,"move to line containing the mark, at first non-white character"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_goexactnmmark = `7B `7B\130D`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"move to the given mark"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_gorectnmmark = `7B `7B\120C`7D, MOTION`7CRECT
X#if OPT_ONLINEHELP
X`09`09,"move to the mark, implying a rectangle if used with an operator"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_help = `7B `7Bhelp`7D,`09`09NONE
X#if OPT_ONLINEHELP
X`09`09,"bring up a buffer containing lots of barely sorted information"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_histbuff = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"visit the CNT'th previous buffer"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_insert = `7B `7B\0C06`7D,`09REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"insert (CNT copies of) text before the cursor"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_insert_no_aindent = `7B `7B\1711`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"insert (CNT copies of) text before the cursor, suppressing autoindent"
V
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_insertbol = `7B `7B\0F09`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"insert (CNT copies of) text before the first non-white char on line"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_insfile = `7B `7B\0D07`7D,`09REDO`7CUNDO`7CGLOBOK`7C
V(FROM`7CZERO`7CNAMEDF)
X#if OPT_ONLINEHELP
X`09`09,"read the given file into the current buffer at \160Cline"
X#endif
X `7D;
X#if !SMALLER
X`09EXTERN_CONST CMDFUNC f_insspace = `7B `7B\0E08`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"insert a space character at the cursor"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_insstring = `7B `7B\0F09`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"insert the given string a\1406cursor"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_joinlines = `7B `7B\0F09`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"join CNT lines together with the current one"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_killbuffer = `7B `7B\100A`7D, GOAL
X#if OPT_ONLINEHELP
X`09`09,"eliminate the given or under-cursor buffer"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_showlength = `7B `7B\100A`7D, DFLALL`7CFROM`7CTO`7CN
VOMOVE
X#if OPT_ONLINEHELP
X`09`09,"report number of lines in current buffer"
X#endif
X `7D;
X#if !SMALLER
X`09EXTERN_CONST CMDFUNC f_lastnonwhite = `7B `7B\120C`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"move to the last non-whitespace character on line"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_listbuffers = `7B `7B\110B`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"show the current list of buffers.  give CNT to force showing all"
X#endif
X `7D;
X#if OPT_HISTORY
X`09EXTERN_CONST CMDFUNC f_showhistory = `7B `7B\110B`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"show the command history"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_lineputafter = `7B `7B\120C`7D, REDO`7CUNDO`7CGLOBOK
V`7C(FROM`7CZERO`7COPTREG)
X#if OPT_ONLINEHELP
X`09`09,"insert from (un)named register, as whole lines, after current line"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_lineputbefore = `7B `7B\130D`7D, REDO`7CUNDO`7CGLOBO
VK`7C(FROM`7COPTREG)
X#if OPT_ONLINEHELP
X`09`09,"insert from (un)named register, as whole lines, before current line"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_rectputafter = `7B `7B\120C`7D, REDO`7CUNDO`7CGLOBOK
V`7C(FROM`7CZERO`7COPTREG)
X#if OPT_ONLINEHELP
X`09`09,"insert from (un)named register, as a rectangle, after cursor"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_rectputbefore = `7B `7B\130D`7D, REDO`7CUNDO`7CGLOBO
VK`7C(FROM`7COPTREG)
X#if OPT_ONLINEHELP
X`09`09,"insert from (un)named register, as a rectangle, in front of cursor"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_lineundo = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"undo all changes made to most recently altered line"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_loadkreg = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"load the given string into\160Bnamed register"
X#endif
X `7D;
X#if OPT_SHOW_REGS
X`09EXTERN_CONST CMDFUNC f_showkreg = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"show the contents of all of the named and un\0C06registers"
X#endif
X `7D;
X#endif
X#if OPT_SHOW_MAPS
X`09EXTERN_CONST CMDFUNC f_sysmap = `7B `7B\0C06`7D,`09NONE`7C(EXRCOK`7CEXTRA)
V
X#if OPT_ONLINEHELP
X`09`09,"list the system function-key maps"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_map = `7B `7Bmap`7D,`09`09NONE`7C(EXRCOK`7CEXTRA)
X#if OPT_ONLINEHELP
X`09`09,"create a new map, or show list of the current command-mode maps"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_map_bang = `7B `7B\0E08`7D, NONE`7C(EXRCOK`7CEXTRA)
V
X#if OPT_ONLINEHELP
X`09`09,"create a new map, or show list of the current insert-mode maps"
X#endif
X `7D;
X#if OPT_TAGS
X`09EXTERN_CONST CMDFUNC f_nexttag = `7B `7B\0D07`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"search the tags file(s) for another location for the last tag"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_newprocessgroup = `7B `7B\150F`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"put editor into its own process group (X11 version only)"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_noremap = `7B `7B\0D07`7D,`09NONE`7C(EXRCOK`7CEXTRA)
V
X#if OPT_ONLINEHELP
X`09`09,"create a new unremappable command-mode map"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_noremap_bang = `7B `7B\120C`7D, NONE`7C(EXRCOK`7CEXT
VRA)
X#if OPT_ONLINEHELP
X`09`09,"create a new unremappable insert-mode map"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_cntl_a_func = `7B `7B\110B`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"the `5C"Control-A`5C" prefix, used when typing extended commands"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_mvdnnxtwind = `7B `7B\110B`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"move next window down (or buffer up) by CNT lines"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_mvupnxtwind = `7B `7B\110B`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"move next window up (or buffer down) by CNT lines"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_mvdnwind = `7B `7B\0E08`7D, GOAL
X#if OPT_ONLINEHELP
X`09`09,"move window down (or buffer up) by CNT lines"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_mvupwind = `7B `7B\0E08`7D, GOAL
X#if OPT_ONLINEHELP
X`09`09,"move window up (or buffer down) by CNT lines"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_mvrightwind = `7B `7B\110B`7D, GOAL
X#if OPT_ONLINEHELP
X`09`09,"scroll window to right by CNT columns, half screen if CNT unspecified"
V
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_mvleftwind = `7B `7B\100A`7D, GOAL
X#if OPT_ONLINEHELP
X`09`09,"scroll window to left by CNT columns, half screen if CNT unspecified"
V
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_nextbuffer = `7B `7B\100A`7D, NONE`7C(BANG`7CNAMEDFS
V)
X#if OPT_ONLINEHELP
X`09`09,"switch to next buffer (or the least-recently-visited, if `5C"auto\3006
V`5C" on"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_namebuffer = `7B `7B\100A`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"give the current buffer a new name"
X#endif
X `7D;
X#if !SMALLER
X`09EXTERN_CONST CMDFUNC f_newline = `7B `7B\0D07`7D,`09REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"insert a newline at the cursor"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_newlength = `7B `7B\0F09`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"tell the editor the screen has CNT rows"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_newwidth = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"tell the editor the screen has CNT columns"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_nextwind = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"move to the next window"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_nullproc = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"do nothing"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_namedcmd = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"execute the given function, by name"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_openup = `7B `7B\0C06`7D,`09REDO`7CUNDO`7C(FROM)
X#if OPT_ONLINEHELP
X`09`09,"insert text in CNT fresh blank line(s), before current line"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_openup_no_aindent = `7B `7B\1711`7D, REDO`7CUNDO`7C(
VFROM`7CZERO)
X#if OPT_ONLINEHELP
X`09`09,"insert text in CNT fresh blank line(s), before current, no autoindent"
V
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_opendown = `7B `7B\0E08`7D, REDO`7CUNDO`7C(FROM`7CZE
VRO)
X#if OPT_ONLINEHELP
X`09`09,"insert text in CNT fresh blank line(s), after current line"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_opendown_no_aindent = `7B `7B\1913`7D, REDO`7CUNDO
V`7C(FROM`7CZERO)
X#if OPT_ONLINEHELP
X`09`09,"insert text in CNT fresh blank line(s), after current, no autoindent"
V
X#endif
X `7D;
+-+-+-+-+-+-+-+-  END  OF PART 79 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 80 -+-+-+-+-+-+-+-+
X`09EXTERN_CONST CMDFUNC f_operopenrect = `7B `7B\120C`7D, OPER`7CREDO`7CUNDO
V`7CGLOBOK\0C06(RANGE)
X#if OPT_ONLINEHELP
X`09`09,"open blank rectangular area specified by given motion"
X#endif
X `7D;
X#if OPT_SELECTIONS
X`09EXTERN_CONST CMDFUNC f_operattrbold = `7B `7B\120C`7D, OPER`7CGLOBOK`7CRANG
VE
X#if OPT_ONLINEHELP
X`09`09,"display text as bold in the region"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_operattrcaseq = `7B `7B\130D`7D, REDO`7CUNDO`7COPER
V`7CGLOBOK`7CRANGE
X#if OPT_ONLINEHELP
X`09`09,"display text as given by `5EA sequences in the region"
X#endif
X `7D;
X#endif
X#if OPT_HYPERTEXT
X`09EXTERN_CONST CMDFUNC f_operattrhc = `7B `7B\100A`7D, OPER`7CGLOBOK`7CRANGE
V
X#if OPT_ONLINEHELP
X`09`09,"attach hypertext command to region"
X#endif
X `7D;
X#endif
X#if OPT_SELECTIONS
X`09EXTERN_CONST CMDFUNC f_operattrital = `7B `7B\120C`7D, OPER`7CGLOBOK`7CRANG
VE
X#if OPT_ONLINEHELP
X`09`09,"display text in italics in the region"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_operattrno = `7B `7B\100A`7D, OPER`7CGLOBOK`7CRANGE
V
X#if OPT_ONLINEHELP
X`09`09,"display text normally in the region"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_operattrrev = `7B `7B\110B`7D, OPER`7CGLOBOK`7CRANGE
V
X#if OPT_ONLINEHELP
X`09`09,"display text reversed in the region"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_operattrul = `7B `7B\100A`7D, OPER`7CGLOBOK`7CRANGE
V
X#if OPT_ONLINEHELP
X`09`09,"display text underlined in the region"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_operchg = `7B `7B\0D07`7D,`09OPER`7CREDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"insert text, replacing that in the region"
X#endif
X `7D;
X#if OPT_AEDIT
X`09EXTERN_CONST CMDFUNC f_operdetab = `7B `7B\0F09`7D, OPER`7CREDO`7CUNDO`7CGL
VOBOK`7C(RANGE)
X#if OPT_ONLINEHELP
X`09`09,"convert tabs to spaces in the region"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_operentab = `7B `7B\0F09`7D, OPER`7CREDO`7CUNDO`7CGL
VOBOK`7C(RANGE)
X#if OPT_ONLINEHELP
X`09`09,"convert spaces to tabs where possible in the region"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_opermove = `7B `7B\0E08`7D, OPER`7C(RANGE`7CEXTRA)
X#if OPT_ONLINEHELP
X`09`09,"move text in the region to the given line"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_operlinechg = `7B `7B\110B`7D, OPER`7CREDO`7CUNDO`7C
V(RANGE)
X#if OPT_ONLINEHELP
X`09`09,"insert text, replacing that on the lines covered by the region"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_operdel = `7B `7B\0D07`7D,`09OPER`7CREDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"delete text in the region"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_operjoin = `7B `7B\0E08`7D, OPER`7CREDO`7CUNDO`7CGLO
VBOK`7CRANGE
X#if OPT_ONLINEHELP
X`09`09,"join together lines in the region"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_operlinedel = `7B `7B\110B`7D, OPER`7CREDO`7CUNDO`7C
VGLOBOK`7C(RANGE`7COPTREG)
X#if OPT_ONLINEHELP
X`09`09,"delete lines covered by the region"
X#endif
X `7D;
X#if OPT_SHELL
X`09EXTERN_CONST CMDFUNC f_operfilter = `7B `7B\100A`7D, OPER`7CREDO`7CUNDO`7C(
VEXRCOK`7CRANGE`7CNAMEDFS`7CDFLNONE`7CVI_NL)
X#if OPT_ONLINEHELP
X`09`09,"pipe the text in the region through an external filter command"
X#endif
X `7D;
X#endif
X#if OPT_FORMAT
X`09EXTERN_CONST CMDFUNC f_operformat = `7B `7B\100A`7D, OPER`7CREDO`7CUNDO`7C(
VRANGE)
X#if OPT_ONLINEHELP
X`09`09,"format (rejustify) the text in the region"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_operflip = `7B `7B\0E08`7D, OPER`7CREDO`7CUNDO`7CGLO
VBOK`7C(RANGE)
X#if OPT_ONLINEHELP
X`09`09,"exchange upper and lowercase on characters in the region"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_operglobals = `7B `7B\110B`7D, (/*RANGE`7C*/BANG`7CE
VXTRA`7CDFLALL)
X#if OPT_ONLINEHELP
X`09`09,"perform command on all lines containing the given pattern"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_opervglobals = `7B `7B\120C`7D, (/*RANGE`7C*/BANG`7C
VEXTRA`7CDFLALL)
X#if OPT_ONLINEHELP
X`09`09,"perform command on all lines not containing the given pattern"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_operlower = `7B `7B\0F09`7D, OPER`7CREDO`7CUNDO`7CGL
VOBOK`7C(RANGE)
X#if OPT_ONLINEHELP
X`09`09,"convert to lowercase all characters in the region"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_operlist = `7B `7B\0E08`7D, OPER`7CGLOBOK`7C(RANGE)
V
X#if OPT_ONLINEHELP
X`09`09,"show lines, making tabs and newlines visible"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_operprint = `7B `7B\0F09`7D, OPER`7CGLOBOK`7C(RANGE)
V
X#if OPT_ONLINEHELP
X`09`09,"show lines"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_operpprint = `7B `7B\100A`7D, OPER`7CGLOBOK`7C(RANGE
V)
X#if OPT_ONLINEHELP
X`09`09,"show lines with line numbers"
X#endif
X `7D;
X#if OPT_SELECTIONS
X`09EXTERN_CONST CMDFUNC f_operselect = `7B `7B\100A`7D, OPER`7CGLOBOK`7C(RANGE
V)
X#if OPT_ONLINEHELP
X`09`09,"select (and yank) the text in the region"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_operupper = `7B `7B\0F09`7D, OPER`7CREDO`7CUNDO`7CGL
VOBOK`7C(RANGE)
X#if OPT_ONLINEHELP
X`09`09,"convert to uppercase all characters in the region"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_operlshift = `7B `7B\100A`7D, OPER`7CREDO`7CUNDO`7CG
VLOBOK`7C(RANGE)
X#if OPT_ONLINEHELP
X`09`09,"shift lines in the region left by one `5C\2806width`5C""
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_operrshift = `7B `7B\100A`7D, OPER`7CREDO`7CUNDO`7CG
VLOBOK`7C(RANGE)
X#if OPT_ONLINEHELP
X`09`09,"shift lines in the region right by one `5C\2906width`5C""
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_opersubst = `7B `7B\0F09`7D, OPER`7CREDO`7CUNDO`7CGL
VOBOK`7C(RANGE`7CEXTRA)
X#if OPT_ONLINEHELP
X`09`09,"perform a text substitution over the region"
X#endif
X `7D;
X#if OPT_AEDIT
X`09EXTERN_CONST CMDFUNC f_opertrim = `7B `7B\0E08`7D, REDO`7CUNDO`7CGLOBOK
V\0C06(RANGE)
X#if OPT_ONLINEHELP
X`09`09,"trim trailing whitespace from lines in the region"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_operblank = `7B `7B\0F09`7D, REDO`7CUNDO`7CGLOBOK
V\0C06(RANGE)
X#if OPT_ONLINEHELP
X`09`09,"replace the region with whitespace"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_operyank = `7B `7B\0E08`7D, OPER
X#if OPT_ONLINEHELP
X`09`09,"get the region into the given named or un\0B06register"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_operlineyank = `7B `7B\120C`7D, OPER`7C(RANGE`7COPTR
VEG`7CNOMOVE)
X#if OPT_ONLINEHELP
X`09`09,"get lines covered by region into given named or un\0B06register"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_opersubstagain = `7B `7B\140E`7D, OPER`7CREDO`7CUNDO
V`7CGLOBOK`7C(RANGE`7CEXTRA)
X#if OPT_ONLINEHELP
X`09`09,"redo the previous text substitution over the region"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_opertransf = `7B `7B\100A`7D, OPER`7C(RANGE`7CEXTRA)
V
X#if OPT_ONLINEHELP
X`09`09,"copy text in the region"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_operwrite = `7B `7B\0F09`7D, OPER`7C(RANGE`7CBANG`7C
VFILE1`7CDFLALL`7CNOMOVE)
X#if OPT_ONLINEHELP
X`09`09,"write from region to the given file.  whole buffer by default"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_overwritechars = `7B `7B\140E`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"replace text while inserting, character by\0D0A"
X#endif
X `7D;
X#if !SMALLER
X`09EXTERN_CONST CMDFUNC f_overwstring = `7B `7B\110B`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"replace text at the cursor by the given string"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_onlywind = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"eliminate all windows except the current"
X#endif
X `7D;
X#if OPT_PERL
X`09EXTERN_CONST CMDFUNC f_perl = `7B `7Bperl`7D,`09`09OPER`7CREDO`7CUNDO`7CGLO
VBOK`7CRANGE`7CDFLNONE`7CVIEWOK
X#if OPT_ONLINEHELP
X`09`09,"run a perl command"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_perldo = `7B `7B\0C06`7D,`09OPER`7CREDO`7CUNDO`7CGLO
VBOK`7CRANGE`7CEXTRA
X#if OPT_ONLINEHELP
X`09`09,"run a perl command on each line in a range"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_poswind = `7B `7B\0D07`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"reframe with cursor at center (.,M,m), top (CR,H,t), or bottom (-,L,b)
V"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_prevwind = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"move to the previous window"
X#endif
X `7D;
X#if OPT_SHELL
X`09EXTERN_CONST CMDFUNC f_pipecmd = `7B `7B\0D07`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"run a command, capturing its output in the `5BOutput`5D buffer"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_putafter = `7B `7B\0E08`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"insert CNT copies of (un)named register, after cursor"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_putbefore = `7B `7B\0F09`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"insert CNT copies of (un)named register, before cursor"
X#endif
X `7D;
X#if OPT_SHELL
X`09EXTERN_CONST CMDFUNC f_pwd = `7B `7Bpwd`7D,`09`09NONE
X#if OPT_ONLINEHELP
X`09`09,"show current directory name"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_quit = `7B `7Bquit`7D,`09`09NONE`7C(BANG)
X#if OPT_ONLINEHELP
X`09`09,"leave the editor, if there are no modified buffers"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_quithard = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"leave the editor, regardless of modified buffers"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_quickexit = `7B `7B\0F09`7D, NONE`7C(BANG`7CVI_NL)
X#if OPT_ONLINEHELP
X`09`09,"leave the editor, writing modified buffers as needed"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_quote = `7B `7Bquote`7D,`09REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"insert the next character literally, CNT times"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_vile_refresh = `7B `7B\120C`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"redraw the screen"
X#endif
X `7D;
X#if OPT_MAJORMODE
X`09EXTERN_CONST CMDFUNC f_remove_mode = `7B `7B\110B`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"delete the definition of a major mode"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_remove_submode = `7B `7B\140E`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"delete the special definition of a submode from a major mode"
X#endif
X `7D;
X#endif
X#if !SMALLER
X`09EXTERN_CONST CMDFUNC f_reposition = `7B `7B\100A`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"redraw, cursor at center, or CNT'th line\100Cfrom end if neg"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_rep_csrch = `7B `7B\0F09`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"repeat the last forward character scan"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_replacechar = `7B `7B\110B`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"replace CNT characters at the cursor with the given\280A"
X#endif
X `7D;
X#if OPT_SHELL
X`09EXTERN_CONST CMDFUNC f_respawn = `7B `7B\0D07`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"rerun the previously entered shell command"
X#endif
X `7D;
X#endif
X#if !SMALLER
X`09EXTERN_CONST CMDFUNC f_resize = `7B `7B\0C06`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"change the current window to CNT lines"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_restwnd = `7B `7B\0D07`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"return to window saved with `5C"save-\1906`5C""
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_rev_csrch = `7B `7B\0F09`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"repeat the last backward character scan"
X#endif
X `7D;
X#if OPT_ISRCH
X`09EXTERN_CONST CMDFUNC f_risearch = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"search backwards for a pattern entered character by\0D0A"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_revsearch = `7B `7B\0F09`7D, ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"search for previous pattern in opposite direction from before"
X#endif
X `7D;
X#if OPT_SELECTIONS
X`09EXTERN_CONST CMDFUNC f_sel_motion = `7B `7B\100A`7D, ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"move to selection.  if used with operator, region is the \3109"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_scrforwsearch = `7B `7B\130D`7D, ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"search forwards for pattern (word) under cursor"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_scrbacksearch = `7B `7B\130D`7D, ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"search backwards for pattern (word) under cursor"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_scrsearchpat = `7B `7B\120C`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"set search pattern to word under cursor"
X#endif
X `7D;
X#if OPT_DOSFILES
X`09EXTERN_CONST CMDFUNC f_set_dosmode = `7B `7B\110B`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"force a `5C"dos`5C"-style buffer: trim CR characters, and set\3206-mod
Ve`5C""
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_set_unixmode = `7B `7B\120C`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"force a `5C"unix`5C"-style buffer: trim CR characters, and unset `5C"d
Vos-mode`5C""
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_settab = `7B `7B\0C06`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"set the tabstop setting to CNT.  same as `5C\2B06\2706=NN`5C""
X#endif
X `7D;
X#if OPT_REBIND`26`26OPT_TERMCHRS
X`09EXTERN_CONST CMDFUNC f_set_termchrs = `7B `7B\120C`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"change the value of a terminal special character"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_show_termchrs = `7B `7B\130D`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"show the values of the terminal special characters"
X#endif
X `7D;
X#endif
X#if OPT_SHELL
X`09EXTERN_CONST CMDFUNC f_spawncli = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"start a sub-shell in which to run commands"
X#endif
X `7D;
X#endif
X#if !SMALLER
X`09EXTERN_CONST CMDFUNC f_savewnd = `7B `7B\0D07`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"mark a window for later return with `5C"restore-\2706`5C""
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_scrnextup = `7B `7B\0F09`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"move next window up by CNT half screens"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_scrnextdw = `7B `7B\0F09`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"move next window down by CNT half screens"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_setfillcol = `7B `7B\100A`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"set the fillcol setting to CNT.  same as `5C"set \2707=NN`5C""
X#endif
X `7D;
X#if OPT_SELECTIONS
X`09EXTERN_CONST CMDFUNC f_multimotion = `7B `7B\110B`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"start (and end) a selection using multiple motions, CNT is type (1) "
V
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_multimotionfullline = `7B `7B\1913`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"start (and end) a full-line selection using multiple motions (2) "
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_multimotionrectangle = `7B `7B\1A14`7D, MOTION
X#if OPT_ONLINEHELP
X`09`09,"start (and end) a rectangular selection using multiple motions (3) "
X#endif
X `7D;
X#endif
X#if OPT_ENCRYPT
X`09EXTERN_CONST CMDFUNC f_ue_setkey = `7B `7B\0F09`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"set the encryption key on the current buffer"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_setlocmode = `7B `7B\100A`7D, NONE`7C(EXRCOK`7CEXTRA
V)
X#if OPT_ONLINEHELP
X`09`09,"change the current buffer's local value of a mode setting"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_setglobmode = `7B `7B\110B`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"change the global value of a mode setting"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_setnmmark = `7B `7B\0F09`7D, NONE`7C(FROM`7CEXTRA`7C
VNOMOVE)
X#if OPT_ONLINEHELP
X`09`09,"set the given named mark to the current cursor location"
X#endif
X `7D;
X#if OPT_EVAL
X`09EXTERN_CONST CMDFUNC f_setvar = `7B `7B\0C06`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"set the given vile variable to a value"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_showcpos = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"report information about current buffer and character"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_listmodes = `7B `7B\0F09`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"report values of all mode settings"
X#endif
X `7D;
X#if OPT_MAJORMODE
X`09EXTERN_CONST CMDFUNC f_list_majormodes = `7B `7B\150F`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"report values of all majormode settings (use CNT for verbose listing)"
V
X#endif
X `7D;
X#endif
X#if OPT_SHOW_EVAL
X`09EXTERN_CONST CMDFUNC f_listvars = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"report values of all variables, built-in and user"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_showversion = `7B `7B\110B`7D, NONE`7C(EXRCOK)
X#if OPT_ONLINEHELP
X`09`09,"report version information for the editor"
X#endif
X `7D;
X#if SYS_MSDOS`26`26(CC_TURBO`7C`7CCC_WATCOM&027CCC_DJGPP)
X`09EXTERN_CONST CMDFUNC f_showmemory = `7B `7B\100A`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"report on available memory"
X#endif
X `7D;
X#endif
X#if OPT_SHOW_TAGS
X`09EXTERN_CONST CMDFUNC f_showtagstack = `7B `7B\120C`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"show the stack of successive tag references"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_shrinkwind = `7B `7B\100A`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"decrease the size of the current window by CNT lines"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_source = `7B `7B\0C06`7D,`09NONE`7C(EXRCOK`7CNAMEDF)
V
X#if OPT_ONLINEHELP
X`09`09,"source a file of ex commands"
X#endif
X `7D;
X#if OPT_SHELL
X`09EXTERN_CONST CMDFUNC f_spawn = `7B `7Bspawn`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"run a shell command"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_poundc_func = `7B `7B\110B`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"prefix used to represent commands normally bound to function keys"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_splitwind = `7B `7B\0F09`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"split the window in half; CNT of 1 or 2 chooses which becomes current"
V
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_storemac = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"store script text into CNT'th macro, up to line starting with `7Eendm"
V
X#endif
X `7D;
X#if OPT_PROCEDURES
X`09EXTERN_CONST CMDFUNC f_storeproc = `7B `7B\0F09`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"store script text into given named stored-procedure"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_subst_again = `7B `7B\110B`7D, REDO`7CUNDO`7CGLOBOK
V
X#if OPT_ONLINEHELP
X`09`09,"redo the previous text substitution"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_togglelistbuffers = `7B `7B\1711`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"show or hide the buffer list. give CNT to force showing all"
X#endif
X `7D;
X#if !SMALLER
X`09EXTERN_CONST CMDFUNC f_twiddle = `7B `7B\0D07`7D,`09REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"exchange the two characters under and to the left of the cursor"
X#endif
X `7D;
X#endif
X#if OPT_REBIND
X`09EXTERN_CONST CMDFUNC f_unbindkey = `7B `7B\0F09`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"break the binding between a keystroke and a function"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_undo = `7B `7Bundo`7D,`09`09NONE
X#if OPT_ONLINEHELP
X`09`09,"undo the last change made to a buffer;  repeat to reapply the \3006"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_inf_undo = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"undo/redo more changes, continuing in `5C"direction`5C" of last \3C09"
V
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_backundo = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"undo changes made to a buffer;  repeat to undo previous \3307"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_forwredo = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"redo changes made to a buffer, after they have been undone"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_unabbr = `7B `7B\0C06`7D,`09NONE`7C(EXRCOK`7CBANG`7C
VEXTRA)
X#if OPT_ONLINEHELP
X`09`09,"delete an abbreviation"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_unarg_func = `7B `7B\100A`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"supply a numeric CNT to a command. sets\17084, 16, 64, 256, etc."
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_unimpl = `7B `7B\0C06`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"place holder for the todo list"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_unmark = `7B `7B\0C06`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"clear the `5C"modified`5C" status of a buffer"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_unmap = `7B `7Bunmap`7D,`09NONE`7C(EXRCOK`7CBANG`7CE
VXTRA)
X#if OPT_ONLINEHELP
X`09`09,"delete a command-mode mapping"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_unmap_bang = `7B `7B\100A`7D, NONE`7C(EXRCOK`7CEXTRA
V)
X#if OPT_ONLINEHELP
X`09`09,"delete an insert-mode mapping"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_unmap_system = `7B `7B\120C`7D, NONE`7C(EXRCOK`7CEXT
VRA)
X#if OPT_ONLINEHELP
X`09`09,"delete a system function-key mapping"
X#endif
X `7D;
X#if OPT_TAGS
X`09EXTERN_CONST CMDFUNC f_untagpop = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"restore cursor and buffer to location before last tag lookup"
X#endif
X `7D;
X#endif
X#if !SMALLER
X`09EXTERN_CONST CMDFUNC f_upscreen = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"force the screen to be updated; flushes all pending output"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_usebuffer = `7B `7B\0F09`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"switch to the given buffer; will not look for a file by that name"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_usekreg = `7B `7B\0D07`7D,`09REDO
X#if OPT_ONLINEHELP
X`09`09,"name a register, for use with a following command which references it"
V
X#endif
X `7D;
X#if !SMALLER
X`09EXTERN_CONST CMDFUNC f_userbeep = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"force the terminal to ring (or flash, if `5C"set\1006`5C" is active)"
V
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_visual = `7B `7B\0C06`7D,`09NONE
X#if OPT_ONLINEHELP
X`09`09,"switch from non-existent exile mode back to visual mode.  unimplemente
Vd"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_vglobals = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,""
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_viewfile = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"bring given file or existing buffer into window, mark it `5C"view-only
V`5C""
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_writeallchanged = `7B `7B\150F`7D, NONE`7C(VI_NL)
X#if OPT_ONLINEHELP
X`09`09,"attempt to write any buffers which are marked `5C"modified`5C""
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_writequit = `7B `7B\0F09`7D, NONE`7C(VI_NL)
X#if OPT_ONLINEHELP
X`09`09,"write the current buffer, and quit if no other\1D07s are modified"
X#endif
X `7D;
X#if !SMALLER
X`09EXTERN_CONST CMDFUNC f_wrapword = `7B `7B\0E08`7D, REDO`7CUNDO
X#if OPT_ONLINEHELP
X`09`09,"split line in two at first preceding word break"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_writemsg = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"put a message on the \0F08line"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_yankline = `7B `7B\0E08`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"get the current line into the given named or un\0B06register"
X#endif
X `7D;
X#if OPT_XTERM`7C`7CDISP_X11
X`09EXTERN_CONST CMDFUNC f_mouse_motion = `7B `7B\120C`7D, ABSM`7CMOTION
X#if OPT_ONLINEHELP
X`09`09,"dummy command to support mouse movements internally"
X#endif
X `7D;
X#endif
X#if DISP_X11
X`09EXTERN_CONST CMDFUNC f_copy_to_clipboard = `7B `7B\1711`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"copies the currently highlighted selection to\2707t buffer"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_paste_from_clipboard = `7B `7B\1A14`7D, REDO`7CUNDO
V
X#if OPT_ONLINEHELP
X`09`09,"pastes the contents of\1006ut buffer"
X#endif
X `7D;
X#endif
X#if (OPT_XTERM>=3)
X`09EXTERN_CONST CMDFUNC f_xterm_mouse_t = `7B `7B\130D`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"dummy command to support xterm mouse operation"
X#endif
X `7D;
X`09EXTERN_CONST CMDFUNC f_xterm_mouse_T = `7B `7B\130D`7D, NONE
X#if OPT_ONLINEHELP
X`09`09,"dummy command to support xterm mouse operation"
X#endif
X `7D;
X#endif
X`09EXTERN_CONST CMDFUNC f_zzquit = `7B `7B\0C06`7D,`09NONE`7C(BANG`7CVI_NL)
X#if OPT_ONLINEHELP
X`09`09,"if repeated, leave the editor, writing modified buffers as needed"
X#endif
X `7D;
X
X#else
X
Xextern const CMDFUNC f_abbrev;
Xextern const CMDFUNC f_altbuff;
Xextern const CMDFUNC f_append;
X#if !SMALLER
Xextern const CMDFUNC f_appstring;
X#endif
Xextern const CMDFUNC f_appendeol;
Xextern const CMDFUNC f_backchar;
Xextern const CMDFUNC f_backchar_to_bol;
Xextern const CMDFUNC f_backdelchar;
X#if !SMALLER
Xextern const CMDFUNC f_backhunt;
X#endif
Xextern const CMDFUNC f_backhpage;
Xextern const CMDFUNC f_backline;
Xextern const CMDFUNC f_backbline;
Xextern const CMDFUNC f_backpage;
Xextern const CMDFUNC f_backword;
Xextern const CMDFUNC f_backviword;
Xextern const CMDFUNC f_backsearch;
Xextern const CMDFUNC f_bcsrch;
Xextern const CMDFUNC f_bcsrch_to;
X#if OPT_REBIND
Xextern const CMDFUNC f_bindkey;
X#endif
X#if OPT_SHELL
Xextern const CMDFUNC f_bktoshell;
X#endif
X#if SYS_WINNT
Xextern const CMDFUNC f_cbrdcpy_unnamed;
Xextern const CMDFUNC f_cbrdpaste;
X#endif
X#if OPT_SHELL
Xextern const CMDFUNC f_cd;
X#endif
Xextern const CMDFUNC f_cntl_x_func;
Xextern const CMDFUNC f_chgchar;
Xextern const CMDFUNC f_chgline;
Xextern const CMDFUNC f_chgtoeol;
X#if OPT_HILITEMATCH
Xextern const CMDFUNC f_clear_match_attrs;
X#endif
Xextern const CMDFUNC f_clrmes;
X#if OPT_FINDERR
Xextern const CMDFUNC f_comp_err_exps;
X#endif
Xextern const CMDFUNC f_consearch;
X#if OPT_WORDCOUNT
Xextern const CMDFUNC f_wordcount;
X#endif
X#if SYS_WINNT
Xextern const CMDFUNC f_opercbrdcpy;
X#endif
Xextern const CMDFUNC f_opercopy;
X#if OPT_ENCRYPT
Xextern const CMDFUNC f_opercrypt;
X#endif
Xextern const CMDFUNC f_kbd_mac_begin;
Xextern const CMDFUNC f_kbd_mac_end;
Xextern const CMDFUNC f_kbd_mac_exec;
Xextern const CMDFUNC f_kbd_mac_save;
X#if OPT_EXEC_MACROS>0
Xextern const CMDFUNC f_cbuf1;
X#endif
X#if OPT_EXEC_MACROS>1
Xextern const CMDFUNC f_cbuf2;
X#endif
X#if OPT_EXEC_MACROS>2
Xextern const CMDFUNC f_cbuf3;
X#endif
X#if OPT_EXEC_MACROS>3
Xextern const CMDFUNC f_cbuf4;
X#endif
X#if OPT_EXEC_MACROS>4
Xextern const CMDFUNC f_cbuf5;
X#endif
X#if OPT_EXEC_MACROS>5
Xextern const CMDFUNC f_cbuf6;
X#endif
X#if OPT_EXEC_MACROS>6
Xextern const CMDFUNC f_cbuf7;
X#endif
X#if OPT_EXEC_MACROS>7
Xextern const CMDFUNC f_cbuf8;
X#endif
X#if OPT_EXEC_MACROS>8
Xextern const CMDFUNC f_cbuf9;
X#endif
X#if OPT_EXEC_MACROS>9
Xextern const CMDFUNC f_cbuf10;
X#endif
X#if OPT_EXEC_MACROS>10
Xextern const CMDFUNC f_cbuf11;
X#endif
X#if OPT_EXEC_MACROS>11
Xextern const CMDFUNC f_cbuf12;
X#endif
X#if OPT_EXEC_MACROS>12
Xextern const CMDFUNC f_cbuf13;
X#endif
X#if OPT_EXEC_MACROS>13
Xextern const CMDFUNC f_cbuf14;
X#endif
X#if OPT_EXEC_MACROS>14
Xextern const CMDFUNC f_cbuf15;
X#endif
X#if OPT_EXEC_MACROS>15
Xextern const CMDFUNC f_cbuf16;
X#endif
X#if OPT_EXEC_MACROS>16
Xextern const CMDFUNC f_cbuf17;
X#endif
X#if OPT_EXEC_MACROS>17
Xextern const CMDFUNC f_cbuf18;
X#endif
X#if OPT_EXEC_MACROS>18
Xextern const CMDFUNC f_cbuf19;
X#endif
X#if OPT_EXEC_MACROS>19
Xextern const CMDFUNC f_cbuf20;
X#endif
X#if OPT_EXEC_MACROS>20
Xextern const CMDFUNC f_cbuf21;
X#endif
X#if OPT_EXEC_MACROS>21
Xextern const CMDFUNC f_cbuf22;
X#endif
X#if OPT_EXEC_MACROS>22
Xextern const CMDFUNC f_cbuf23;
X#endif
X#if OPT_EXEC_MACROS>23
Xextern const CMDFUNC f_cbuf24;
X#endif
X#if OPT_EXEC_MACROS>24
Xextern const CMDFUNC f_cbuf25;
X#endif
X#if OPT_EXEC_MACROS>25
Xextern const CMDFUNC f_cbuf26;
X#endif
X#if OPT_EXEC_MACROS>26
Xextern const CMDFUNC f_cbuf27;
X#endif
X#if OPT_EXEC_MACROS>27
Xextern const CMDFUNC f_cbuf28;
X#endif
X#if OPT_EXEC_MACROS>28
Xextern const CMDFUNC f_cbuf29;
X#endif
X#if OPT_EXEC_MACROS>29
Xextern const CMDFUNC f_cbuf30;
X#endif
X#if OPT_EXEC_MACROS>30
Xextern const CMDFUNC f_cbuf31;
X#endif
X#if OPT_EXEC_MACROS>31
Xextern const CMDFUNC f_cbuf32;
X#endif
X#if (OPT_EXEC_MACROS>32`26`26(!SYS_WINNT))
Xextern const CMDFUNC f_cbuf33;
X#endif
X#if (OPT_EXEC_MACROS>33`26`26(!SYS_WINNT))
Xextern const CMDFUNC f_cbuf34;
X#endif
X#if (OPT_EXEC_MACROS>34`26`26(!SYS_WINNT))
Xextern const CMDFUNC f_cbuf35;
X#endif
X#if OPT_EXEC_MACROS>35
Xextern const CMDFUNC f_cbuf36;
X#endif
X#if OPT_EXEC_MACROS>36
Xextern const CMDFUNC f_cbuf37;
X#endif
X#if OPT_EXEC_MACROS>37
Xextern const CMDFUNC f_cbuf38;
X#endif
X#if OPT_EXEC_MACROS>38
Xextern const CMDFUNC f_cbuf39;
X#endif
X#if OPT_EXEC_MACROS>39
Xextern const CMDFUNC f_cbuf40;
X#endif
X#if OPT_MAJORMODE
Xextern const CMDFUNC f_define_mode;
Xextern const CMDFUNC f_define_submode;
X#endif
Xextern const CMDFUNC f_delwind;
X#if OPT_AEDIT
Xextern const CMDFUNC f_forceblank;
X#endif
Xextern const CMDFUNC f_delglobmode;
Xextern const CMDFUNC f_dellocmode;
Xextern const CMDFUNC f_deltoeol;
X#if OPT_REBIND
Xextern const CMDFUNC f_desbind;
Xextern const CMDFUNC f_desmotions;
Xextern const CMDFUNC f_desopers;
X#endif
X#if OPT_SHOW_CTYPE
Xextern const CMDFUNC f_desprint;
X#endif
X#if OPT_REBIND
Xextern const CMDFUNC f_desapro;
Xextern const CMDFUNC f_desfunc;
Xextern const CMDFUNC f_deskey;
X#endif
Xextern const CMDFUNC f_dotcmdplay;
Xextern const CMDFUNC f_ex;
X#if !SMALLER
Xextern const CMDFUNC f_execbuf;
Xextern const CMDFUNC f_execfile;
X#endif
X#if OPT_HYPERTEXT
+-+-+-+-+-+-+-+-  END  OF PART 80 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 81 -+-+-+-+-+-+-+-+
Xextern const CMDFUNC f_exechypercmd;
Xextern const CMDFUNC f_showhypercmd;
X#endif
Xextern const CMDFUNC f_execkreg;
X#if OPT_PROCEDURES
Xextern const CMDFUNC f_execproc;
X#endif
Xextern const CMDFUNC f_enlargewind;
Xextern const CMDFUNC f_esc_func;
X#if SYS_UNIX
Xextern const CMDFUNC f_flow_control_enable;
X#endif
Xextern const CMDFUNC f_fcsrch;
Xextern const CMDFUNC f_fcsrch_to;
Xextern const CMDFUNC f_filefind;
Xextern const CMDFUNC f_fileread;
Xextern const CMDFUNC f_filename;
X#if !SMALLER
Xextern const CMDFUNC f_filesave;
X#endif
Xextern const CMDFUNC f_filewrite;
X#if OPT_SHELL
Xextern const CMDFUNC f_vile_filter;
X#endif
X#if OPT_FINDERR
Xextern const CMDFUNC f_finderr;
Xextern const CMDFUNC f_finderrbuf;
X#endif
Xextern const CMDFUNC f_firstbuffer;
Xextern const CMDFUNC f_firstnonwhite;
X#if OPT_ISRCH
Xextern const CMDFUNC f_fisearch;
X#endif
Xextern const CMDFUNC f_flipchar;
X#if DISP_HP150
Xextern const CMDFUNC f_fnclabel;
X#endif
Xextern const CMDFUNC f_forwdelchar;
Xextern const CMDFUNC f_forwhpage;
Xextern const CMDFUNC f_forwchar;
Xextern const CMDFUNC f_forwchar_to_eol;
Xextern const CMDFUNC f_forwpage;
Xextern const CMDFUNC f_forwline;
Xextern const CMDFUNC f_forwbline;
Xextern const CMDFUNC f_forwword;
Xextern const CMDFUNC f_forwviword;
Xextern const CMDFUNC f_forwendw;
Xextern const CMDFUNC f_forwviendw;
X#if !SMALLER
Xextern const CMDFUNC f_forwhunt;
X#endif
Xextern const CMDFUNC f_forwsearch;
X#if OPT_CFENCE
Xextern const CMDFUNC f_matchfence;
Xextern const CMDFUNC f_matchfenceback;
X#endif
Xextern const CMDFUNC f_globals;
Xextern const CMDFUNC f_godotplus;
Xextern const CMDFUNC f_gomark;
Xextern const CMDFUNC f_gotobop;
Xextern const CMDFUNC f_gotoeop;
X#if !SMALLER
Xextern const CMDFUNC f_gotobob;
Xextern const CMDFUNC f_gotoeob;
X#endif
Xextern const CMDFUNC f_gotobol;
Xextern const CMDFUNC f_gotoeol;
Xextern const CMDFUNC f_gotobos;
Xextern const CMDFUNC f_gotomos;
Xextern const CMDFUNC f_gotoeos;
Xextern const CMDFUNC f_gotobosec;
Xextern const CMDFUNC f_gotoeosec;
Xextern const CMDFUNC f_gotobosent;
Xextern const CMDFUNC f_gotoeosent;
X#if OPT_TAGS
Xextern const CMDFUNC f_gototag;
X#endif
Xextern const CMDFUNC f_gotocol;
Xextern const CMDFUNC f_gotoline;
Xextern const CMDFUNC f_golinenmmark;
Xextern const CMDFUNC f_goexactnmmark;
Xextern const CMDFUNC f_gorectnmmark;
Xextern const CMDFUNC f_help;
Xextern const CMDFUNC f_histbuff;
Xextern const CMDFUNC f_insert;
Xextern const CMDFUNC f_insert_no_aindent;
Xextern const CMDFUNC f_insertbol;
Xextern const CMDFUNC f_insfile;
X#if !SMALLER
Xextern const CMDFUNC f_insspace;
Xextern const CMDFUNC f_insstring;
X#endif
Xextern const CMDFUNC f_joinlines;
Xextern const CMDFUNC f_killbuffer;
Xextern const CMDFUNC f_showlength;
X#if !SMALLER
Xextern const CMDFUNC f_lastnonwhite;
X#endif
Xextern const CMDFUNC f_listbuffers;
X#if OPT_HISTORY
Xextern const CMDFUNC f_showhistory;
X#endif
Xextern const CMDFUNC f_lineputafter;
Xextern const CMDFUNC f_lineputbefore;
Xextern const CMDFUNC f_rectputafter;
Xextern const CMDFUNC f_rectputbefore;
Xextern const CMDFUNC f_lineundo;
Xextern const CMDFUNC f_loadkreg;
X#if OPT_SHOW_REGS
Xextern const CMDFUNC f_showkreg;
X#endif
X#if OPT_SHOW_MAPS
Xextern const CMDFUNC f_sysmap;
X#endif
Xextern const CMDFUNC f_map;
Xextern const CMDFUNC f_map_bang;
X#if OPT_TAGS
Xextern const CMDFUNC f_nexttag;
X#endif
Xextern const CMDFUNC f_newprocessgroup;
Xextern const CMDFUNC f_noremap;
Xextern const CMDFUNC f_noremap_bang;
Xextern const CMDFUNC f_cntl_a_func;
Xextern const CMDFUNC f_mvdnnxtwind;
Xextern const CMDFUNC f_mvupnxtwind;
Xextern const CMDFUNC f_mvdnwind;
Xextern const CMDFUNC f_mvupwind;
Xextern const CMDFUNC f_mvrightwind;
Xextern const CMDFUNC f_mvleftwind;
Xextern const CMDFUNC f_nextbuffer;
Xextern const CMDFUNC f_namebuffer;
X#if !SMALLER
Xextern const CMDFUNC f_newline;
X#endif
Xextern const CMDFUNC f_newlength;
Xextern const CMDFUNC f_newwidth;
Xextern const CMDFUNC f_nextwind;
Xextern const CMDFUNC f_nullproc;
Xextern const CMDFUNC f_namedcmd;
Xextern const CMDFUNC f_openup;
Xextern const CMDFUNC f_openup_no_aindent;
Xextern const CMDFUNC f_opendown;
Xextern const CMDFUNC f_opendown_no_aindent;
Xextern const CMDFUNC f_operopenrect;
X#if OPT_SELECTIONS
Xextern const CMDFUNC f_operattrbold;
Xextern const CMDFUNC f_operattrcaseq;
X#endif
X#if OPT_HYPERTEXT
Xextern const CMDFUNC f_operattrhc;
X#endif
X#if OPT_SELECTIONS
Xextern const CMDFUNC f_operattrital;
Xextern const CMDFUNC f_operattrno;
Xextern const CMDFUNC f_operattrrev;
Xextern const CMDFUNC f_operattrul;
X#endif
Xextern const CMDFUNC f_operchg;
X#if OPT_AEDIT
Xextern const CMDFUNC f_operdetab;
Xextern const CMDFUNC f_operentab;
X#endif
Xextern const CMDFUNC f_opermove;
Xextern const CMDFUNC f_operlinechg;
Xextern const CMDFUNC f_operdel;
Xextern const CMDFUNC f_operjoin;
Xextern const CMDFUNC f_operlinedel;
X#if OPT_SHELL
Xextern const CMDFUNC f_operfilter;
X#endif
X#if OPT_FORMAT
Xextern const CMDFUNC f_operformat;
X#endif
Xextern const CMDFUNC f_operflip;
Xextern const CMDFUNC f_operglobals;
Xextern const CMDFUNC f_opervglobals;
Xextern const CMDFUNC f_operlower;
Xextern const CMDFUNC f_operlist;
Xextern const CMDFUNC f_operprint;
Xextern const CMDFUNC f_operpprint;
X#if OPT_SELECTIONS
Xextern const CMDFUNC f_operselect;
X#endif
Xextern const CMDFUNC f_operupper;
Xextern const CMDFUNC f_operlshift;
Xextern const CMDFUNC f_operrshift;
Xextern const CMDFUNC f_opersubst;
X#if OPT_AEDIT
Xextern const CMDFUNC f_opertrim;
Xextern const CMDFUNC f_operblank;
X#endif
Xextern const CMDFUNC f_operyank;
Xextern const CMDFUNC f_operlineyank;
Xextern const CMDFUNC f_opersubstagain;
Xextern const CMDFUNC f_opertransf;
Xextern const CMDFUNC f_operwrite;
Xextern const CMDFUNC f_overwritechars;
X#if !SMALLER
Xextern const CMDFUNC f_overwstring;
X#endif
Xextern const CMDFUNC f_onlywind;
X#if OPT_PERL
Xextern const CMDFUNC f_perl;
Xextern const CMDFUNC f_perldo;
X#endif
Xextern const CMDFUNC f_poswind;
Xextern const CMDFUNC f_prevwind;
X#if OPT_SHELL
Xextern const CMDFUNC f_pipecmd;
X#endif
Xextern const CMDFUNC f_putafter;
Xextern const CMDFUNC f_putbefore;
X#if OPT_SHELL
Xextern const CMDFUNC f_pwd;
X#endif
Xextern const CMDFUNC f_quit;
Xextern const CMDFUNC f_quithard;
Xextern const CMDFUNC f_quickexit;
Xextern const CMDFUNC f_quote;
Xextern const CMDFUNC f_vile_refresh;
X#if OPT_MAJORMODE
Xextern const CMDFUNC f_remove_mode;
Xextern const CMDFUNC f_remove_submode;
X#endif
X#if !SMALLER
Xextern const CMDFUNC f_reposition;
X#endif
Xextern const CMDFUNC f_rep_csrch;
Xextern const CMDFUNC f_replacechar;
X#if OPT_SHELL
Xextern const CMDFUNC f_respawn;
X#endif
X#if !SMALLER
Xextern const CMDFUNC f_resize;
Xextern const CMDFUNC f_restwnd;
X#endif
Xextern const CMDFUNC f_rev_csrch;
X#if OPT_ISRCH
Xextern const CMDFUNC f_risearch;
X#endif
Xextern const CMDFUNC f_revsearch;
X#if OPT_SELECTIONS
Xextern const CMDFUNC f_sel_motion;
X#endif
Xextern const CMDFUNC f_scrforwsearch;
Xextern const CMDFUNC f_scrbacksearch;
Xextern const CMDFUNC f_scrsearchpat;
X#if OPT_DOSFILES
Xextern const CMDFUNC f_set_dosmode;
Xextern const CMDFUNC f_set_unixmode;
X#endif
Xextern const CMDFUNC f_settab;
X#if OPT_REBIND`26`26OPT_TERMCHRS
Xextern const CMDFUNC f_set_termchrs;
Xextern const CMDFUNC f_show_termchrs;
X#endif
X#if OPT_SHELL
Xextern const CMDFUNC f_spawncli;
X#endif
X#if !SMALLER
Xextern const CMDFUNC f_savewnd;
X#endif
Xextern const CMDFUNC f_scrnextup;
Xextern const CMDFUNC f_scrnextdw;
Xextern const CMDFUNC f_setfillcol;
X#if OPT_SELECTIONS
Xextern const CMDFUNC f_multimotion;
Xextern const CMDFUNC f_multimotionfullline;
Xextern const CMDFUNC f_multimotionrectangle;
X#endif
X#if OPT_ENCRYPT
Xextern const CMDFUNC f_ue_setkey;
X#endif
Xextern const CMDFUNC f_setlocmode;
Xextern const CMDFUNC f_setglobmode;
Xextern const CMDFUNC f_setnmmark;
X#if OPT_EVAL
Xextern const CMDFUNC f_setvar;
X#endif
Xextern const CMDFUNC f_showcpos;
Xextern const CMDFUNC f_listmodes;
X#if OPT_MAJORMODE
Xextern const CMDFUNC f_list_majormodes;
X#endif
X#if OPT_SHOW_EVAL
Xextern const CMDFUNC f_listvars;
X#endif
Xextern const CMDFUNC f_showversion;
X#if SYS_MSDOS`26`26(CC_TURBO`7C`7CCC_WATCOM&027CCC_DJGPP)
Xextern const CMDFUNC f_showmemory;
X#endif
X#if OPT_SHOW_TAGS
Xextern const CMDFUNC f_showtagstack;
X#endif
Xextern const CMDFUNC f_shrinkwind;
Xextern const CMDFUNC f_source;
X#if OPT_SHELL
Xextern const CMDFUNC f_spawn;
X#endif
Xextern const CMDFUNC f_poundc_func;
Xextern const CMDFUNC f_splitwind;
Xextern const CMDFUNC f_storemac;
X#if OPT_PROCEDURES
Xextern const CMDFUNC f_storeproc;
X#endif
Xextern const CMDFUNC f_subst_again;
Xextern const CMDFUNC f_togglelistbuffers;
X#if !SMALLER
Xextern const CMDFUNC f_twiddle;
X#endif
X#if OPT_REBIND
Xextern const CMDFUNC f_unbindkey;
X#endif
Xextern const CMDFUNC f_undo;
Xextern const CMDFUNC f_inf_undo;
Xextern const CMDFUNC f_backundo;
Xextern const CMDFUNC f_forwredo;
Xextern const CMDFUNC f_unabbr;
Xextern const CMDFUNC f_unarg_func;
Xextern const CMDFUNC f_unimpl;
Xextern const CMDFUNC f_unmark;
Xextern const CMDFUNC f_unmap;
Xextern const CMDFUNC f_unmap_bang;
Xextern const CMDFUNC f_unmap_system;
X#if OPT_TAGS
Xextern const CMDFUNC f_untagpop;
X#endif
X#if !SMALLER
Xextern const CMDFUNC f_upscreen;
X#endif
Xextern const CMDFUNC f_usebuffer;
Xextern const CMDFUNC f_usekreg;
X#if !SMALLER
Xextern const CMDFUNC f_userbeep;
X#endif
Xextern const CMDFUNC f_visual;
Xextern const CMDFUNC f_vglobals;
Xextern const CMDFUNC f_viewfile;
Xextern const CMDFUNC f_writeallchanged;
Xextern const CMDFUNC f_writequit;
X#if !SMALLER
Xextern const CMDFUNC f_wrapword;
Xextern const CMDFUNC f_writemsg;
X#endif
Xextern const CMDFUNC f_yankline;
X#if OPT_XTERM`7C`7CDISP_X11
Xextern const CMDFUNC f_mouse_motion;
X#endif
X#if DISP_X11
Xextern const CMDFUNC f_copy_to_clipboard;
Xextern const CMDFUNC f_paste_from_clipboard;
X#endif
X#if (OPT_XTERM>=3)
Xextern const CMDFUNC f_xterm_mouse_t;
Xextern const CMDFUNC f_xterm_mouse_T;
X#endif
Xextern const CMDFUNC f_zzquit;
X
X#endif
$ call unpack [.VILE-8_0]NEFUNC.H;4 -
 708857522 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 137 82 152
$!
$ create 'f'
X/* nemode.h: this header file was produced automatically by
X * the dsa10:`5Bcompcent.`5D`5Budaa055.temp.vile-8_0`5Dmktbls.exe;1 program, b
Vased on input from the file modetbl
X */
X#ifndef`09Member_Offset
X#define`09Member_Offset(T, M)`09(((int)`26(((T*)0)->M))/`5C
X`09`09&0209 ((int)`26(((T*)0)->Q1) - (\160Fs_MAX)))
X#endif
X
X#ifdef realdef
X/*
X * List of strings shared between all_modes, b_valnames and w\0F09
X */
Xstatic const char
X#if (OPT_EVAL)
X`09s_abufname__`5B`5D`09`09= "\1108",&0209`09/* env */
X#endif
X`09s_all__`5B`5D`09`09= "all",&0209`09/* ? */
X`09s_ascnt__`5B`5D`09`09= "ascnt",&0209`09/* int */
X`09s_autosavecnt__`5B`5D`09= "\130B",`09`09/* int */
X#if OPT_FILEBACK
X`09s_backup_style__`5B`5D`09= "\1406-style",`09`09/* string */
X#endif
X#if OPT_COLOR
X`09s_bcolor__`5B`5D`09`09= "\0F06",&0209`09/* enum */
X#endif
X#if (OPT_EVAL) `26\0D06PROCEDURES)
X`09s_buffer_hook__`5B`5D`09= "\1306-hook",`09`09/* env */
X#endif
X#if OPT_MAJORMODE
X`09s_c_preamble__`5B`5D`09= "c-\1208",`09`09`09/* REGEX */
X#endif
X#if !OPT_MAJORMODE
X`09s_c_shiftwidth__`5B`5D`09= "c-\140A",`09`09/* int */
X#endif
X#if (OPT_MAJORMODE)
X`09s_c_shiftwidth__`5B`5D`09= "c-\140A",`09`09/* INT */
X#endif
X#if !OPT_MAJORMODE
X`09s_c_suffixes__`5B`5D`09= "c-\1208",`09`09`09/* regex */
X#endif
X#if OPT_MAJORMODE
X`09s_c_suffixes__`5B`5D`09= "c-\1208",`09`09`09/* REGEX */
X#endif
X#if !OPT_MAJORMODE
X`09s_c_tabstop__`5B`5D`09`09= "c-\1207",&0209`09/* int */
X#endif
X#if (OPT_MAJORMODE)
X`09s_c_tabstop__`5B`5D`09`09= "c-\1207",&0209`09/* INT */
X#endif
X#if (OPT_EVAL)
X`09s_cbufname__`5B`5D`09`09= "\1108",&0209`09/* env */
X#endif
X#if (OPT_EVAL) `26\0D06PROCEDURES)
X`09s_cd_hook__`5B`5D`09`09= "cd-hook",&0209`09/* env */
X#endif
X#if (OPT_EVAL)
X`09s_cfilname__`5B`5D`09`09= "\1108",&0209`09/* env */
X`09s_char__`5B`5D`09`09= "char",&0209`09/* env */
X#endif
X`09s_comment_prefix__`5B`5D`09= "\1607-\1606",`09`09/* regex */
X`09s_comments__`5B`5D`09`09= "\1108",&0209`09/* regex */
X#if OPT_MAJORMODE
X`09s_cpre__`5B`5D`09`09= "cpre",&0209`09/* REGEX */
X#endif
X#if (OPT_EVAL) `26\0D07NCRYPT)
X`09s_cryptkey__`5B`5D`09`09= "\1108",&0209`09/* env */
X#endif
X#if !OPT_MAJORMODE
X`09s_csuf__`5B`5D`09`09= "csuf",&0209`09/* regex */
X#endif
X#if OPT_MAJORMODE
X`09s_csuf__`5B`5D`09`09= "csuf",&0209`09/* REGEX */
X#endif
X#if !OPT_MAJORMODE
X`09s_csw__`5B`5D`09`09= "csw",&0209`09/* int */
X#endif
X#if (OPT_MAJORMODE)
X`09s_csw__`5B`5D`09`09= "csw",&0209`09/* INT */
X#endif
X#if !OPT_MAJORMODE
X`09s_cts__`5B`5D`09`09= "cts",&0209`09/* int */
X#endif
X#if (OPT_MAJORMODE)
X`09s_cts__`5B`5D`09`09= "cts",&0209`09/* INT */
X#endif
X#if (OPT_EVAL)
X`09s_curcol__`5B`5D`09`09= "\0F06",&0209`09/* env */
X`09s_curline__`5B`5D`09`09= "\1007",&0209`09/* env */
X#endif
X#if (OPT_EVAL) `26\0D06SHELL)
X`09s_cwd__`5B`5D`09`09= "cwd",&0209`09/* env */
X#endif
X#if (OPT_EVAL)
X`09s_cwline__`5B`5D`09`09= "\0F06",&0209`09/* env */
X`09s_debug__`5B`5D`09`09= "debug",&0209`09/* env */
X#endif
X#if (OPT_EVAL) `26\0D06SHELL)
X`09s_directory__`5B`5D`09`09= "\1209",&0209`09/* env */
X#endif
X#if (OPT_EVAL)
X`09s_discmd__`5B`5D`09`09= "\0F06",&0209`09/* env */
X`09s_disinp__`5B`5D`09`09= "\0F06",&0209`09/* env */
X`09s_end_of_cmd__`5B`5D`09= "end-of-cmd",`09`09`09/* env */
X#endif
X#if (OPT_EVAL) `26\0D06PROCEDURES)
X`09s_exit_hook__`5B`5D`09`09= "exit-hook",&0209`09/* env */
X#endif
X`09s_expand_chars__`5B`5D`09= "\1406-chars",`09`09/* string */
X`09s_fc__`5B`5D`09`09= "fc",&0209&0209/* int */
X#if OPT_COLOR
X`09s_fcolor__`5B`5D`09`09= "\0F06",&0209`09/* enum */
X#endif
X`09s_fence_begin__`5B`5D`09= "fence-begin",`09`09/* regex */
X`09s_fence_elif__`5B`5D`09= "fence-elif",`09`09`09/* regex */
X`09s_fence_else__`5B`5D`09= "fence-else",`09`09`09/* regex */
X`09s_fence_end__`5B`5D`09`09= "fence-end",&0209`09/* regex */
X`09s_fence_fi__`5B`5D`09`09= "fence-fi",&0209`09/* regex */
X`09s_fence_if__`5B`5D`09`09= "fence-if",&0209`09/* regex */
X`09s_fence_pairs__`5B`5D`09= "fence-pairs",`09`09/* string */
X`09s_fillcol__`5B`5D`09`09= "\1007",&0209`09/* int */
X#if (OPT_EVAL)
X`09s_flicker__`5B`5D`09`09= "\1007",&0209`09/* env */
X#endif
X#if (OPT_EVAL) `26 (DISP_X11)
X`09s_font__`5B`5D`09`09= "font",&0209`09/* env */
X#endif
X#if (OPT_EVAL)
X`09s_forward_search__`5B`5D`09= "\1607-\1606",`09`09/* env */
X#endif
X#if OPT_GLOB_PIPE
X`09s_glob__`5B`5D`09`09= "glob",&0209`09/* string */
X#endif
X#if (OPT_EVAL)
X`09s_helpfile__`5B`5D`09`09= "\1108",&0209`09/* env */
X#endif
X#if (OPT_EVAL) `26 (DISP_X11)
X`09s_iconname__`5B`5D`09`09= "\1108",&0209`09/* env */
X#endif
X#if (OPT_EVAL)
X`09s_identifier__`5B`5D`09= "\120A",`09`09`09/* env */
X`09s_kill__`5B`5D`09`09= "kill",&0209`09/* env */
X`09s_lastkey__`5B`5D`09`09= "\1007",&0209`09/* env */
X`09s_line__`5B`5D`09`09= "line",&0209`09/* env */
X`09s_llength__`5B`5D`09`09= "\1007",&0209`09/* env */
X#endif
X#if OPT_LCKFILES
X`09s_locker__`5B`5D`09`09= "\0F06",&0209`09/* string */
X#endif
X#if (OPT_EVAL) `26\0D06MAJORMODE)
X`09s_majormode__`5B`5D`09`09= "\1209",&0209`09/* env */
X#endif
X`09s_maplength__`5B`5D`09`09= "\1209",&0209`09/* int */
X#if (OPT_EVAL)
X`09s_match__`5B`5D`09`09= "match",&0209`09/* env */
X#endif
X`09s_mh__`5B`5D`09`09= "mh",&0209&0209/* enum */
X`09s_mini_hilite__`5B`5D`09= "mini-\1306",`09`09/* enum */
X#if (OPT_EVAL)
X`09s_mode__`5B`5D`09`09= "mode",&0209`09/* env */
X#endif
X#if (OPT_EVAL) `26\0D06MLFORMAT)
X`09s_modeline_format__`5B`5D`09= "\1708-\1706",`09`09/* env */
X#endif
X#if (OPT_EVAL)
X`09s_modified__`5B`5D`09`09= "\1108",&0209`09/* env */
X`09s_ncolors__`5B`5D`09`09= "\1007",&0209`09/* env */
X#endif
X`09s_noab__`5B`5D`09`09= "noab",&0209`09/* Bool */
X`09s_noai__`5B`5D`09`09= "noai",&0209`09/* Bool */
X`09s_noalt_tabpos__`5B`5D`09= "noalt-\1406",`09`09/* Bool */
X#if OPT_UPBUFF
X`09s_noanimated__`5B`5D`09= "\120A",`09`09`09/* Bool */
X#endif
X`09s_noas__`5B`5D`09`09= "noas",&0209`09/* Bool */
X`09s_noatp__`5B`5D`09`09= "noatp",&0209`09/* Bool */
X`09s_noautobuffer__`5B`5D`09= "\140C",`09`09/* Bool */
X`09s_noautoindent__`5B`5D`09= "\140C",`09`09/* Bool */
X`09s_noautosave__`5B`5D`09= "\120A",`09`09`09/* Bool */
X`09s_noautowrite__`5B`5D`09= "\130B",`09`09/* Bool */
X`09s_noaw__`5B`5D`09`09= "noaw",&0209`09/* Bool */
X`09s_nobackspacelimit__`5B`5D`09= "\1810",`09`09/* Bool */
X`09s_nobl__`5B`5D`09`09= "nobl",&0209`09/* Bool */
X#if !SMALLER
X`09s_nocheck_modtime__`5B`5D`09= "\1707-\1707",`09`09/* Bool */
X#endif
X#if !OPT_MAJORMODE
X`09s_nocmode__`5B`5D`09`09= "\1007",&0209`09/* Bool */
X#endif
X#if OPT_MAJORMODE
X`09s_nocmode__`5B`5D`09`09= "\1007",&0209`09/* Bool */
X#endif
X#if OPT_ENCRYPT
X`09s_nocrypt__`5B`5D`09`09= "\1007",&0209`09/* Bool */
X#endif
X#if COMPLETE_DIRS
X`09s_nodirc__`5B`5D`09`09= "\0F06",&0209`09/* Bool */
X#endif
X`09s_nodos__`5B`5D`09`09= "nodos",&0209`09/* Bool */
X`09s_noeb__`5B`5D`09`09= "noeb",&0209`09/* Bool */
X`09s_noerrorbells__`5B`5D`09= "\140C",`09`09/* Bool */
X`09s_noexpand_path__`5B`5D`09= "\1508-path",`09`09/* Bool */
X#if OPT_FLASH
X`09s_noflash__`5B`5D`09`09= "\1007",&0209`09/* Bool */
X#endif
X#if SYS_WINNT`26`26defined(DISP_NTWIN)
X`09s_noforce_console__`5B`5D`09= "\1707-\1707",`09`09/* Bool */
X#endif
X#if !OPT_GLOB_PIPE
X`09s_noglob__`5B`5D`09`09= "\0F06",&0209`09/* Bool */
X#endif
X#if OPT_HISTORY
X`09s_nohi__`5B`5D`09`09= "nohi",&0209`09/* Bool */
X`09s_nohistory__`5B`5D`09`09= "\1209",&0209`09/* Bool */
X#endif
X`09s_nohorizscroll__`5B`5D`09= "\150D",`09`09/* Bool */
X`09s_nohs__`5B`5D`09`09= "nohs",&0209`09/* Bool */
X`09s_noib__`5B`5D`09`09= "noib",&0209`09/* Bool */
X`09s_noic__`5B`5D`09`09= "noic",&0209`09/* Bool */
X`09s_noignorecase__`5B`5D`09= "\140C",`09`09/* Bool */
X`09s_noimplybuffer__`5B`5D`09= "\150D",`09`09/* Bool */
X`09s_noli__`5B`5D`09`09= "noli",&0209`09/* Bool */
X#if OPT_LINEWRAP
X`09s_nolinewrap__`5B`5D`09= "\120A",`09`09`09/* Bool */
X#endif
X`09s_nolist__`5B`5D`09`09= "\0F06",&0209`09/* Bool */
X#if OPT_LCKFILES
X`09s_nolocked__`5B`5D`09`09= "\1108",&0209`09/* Bool */
X#endif
X#if OPT_LINEWRAP
X`09s_nolw__`5B`5D`09`09= "nolw",&0209`09/* Bool */
X#endif
X`09s_nomagic__`5B`5D`09`09= "\1007",&0209`09/* Bool */
X`09s_nomaplonger__`5B`5D`09= "\130B",`09`09/* Bool */
X`09s_nometa_insert_bindings__`5B`5D = "\1E06-\1E06-\1E08", /* Bool */
X`09s_nomib__`5B`5D`09`09= "nomib",&0209`09/* Bool */
X`09s_nomultibeep__`5B`5D`09= "\130B",`09`09/* Bool */
X`09s_nonewline__`5B`5D`09`09= "\1209",&0209`09/* Bool */
X`09s_nonl__`5B`5D`09`09= "nonl",&0209`09/* Bool */
X`09s_nonu__`5B`5D`09`09= "nonu",&0209`09/* Bool */
X`09s_nonumber__`5B`5D`09`09= "\1108",&0209`09/* Bool */
X#if OPT_POPUPCHOICE`26`26!OPT_ENUM_MODES
X`09s_nopc__`5B`5D`09`09= "nopc",&0209`09/* Bool */
X#endif
X#if OPT_POPUP_MSGS
X`09s_nopm__`5B`5D`09`09= "nopm",&0209`09/* Bool */
X#endif
X#if OPT_POPUPCHOICE`26`26!OPT_ENUM_MODES
X`09s_nopopup_choices__`5B`5D`09= "\1707-\1707",`09`09/* Bool */
X#endif
X#if OPT_POPUP_MSGS
X`09s_nopopup_msgs__`5B`5D`09= "\1407-msgs",`09`09/* Bool */
X#endif
X`09s_noreadonly__`5B`5D`09= "\120A",`09`09`09/* Bool */
X`09s_noreadonly_on_\0C09_`5B`5D = "\1E0A-on-\2A08", /* Bool */
X`09s_noremap__`5B`5D`09`09= "\1007",&0209`09/* Bool */
X`09s_noremapfirst__`5B`5D`09= "\140C",`09`09/* Bool */
X#if HAVE_SYMLINK
X`09s_noresolve_links__`5B`5D`09= "\1709-links",`09`09/* Bool */
X#endif
X`09s_noro__`5B`5D`09`09= "noro",&0209`09/* Bool */
X`09s_nororo__`5B`5D`09`09= "\0F06",&0209`09/* Bool */
X#if !SMALLER
X`09s_noruler__`5B`5D`09`09= "\1007",&0209`09/* Bool */
X#endif
X`09s_nosamebangs__`5B`5D`09= "\130B",`09`09/* Bool */
X`09s_nosas__`5B`5D`09`09= "nosas",&0209`09/* Bool */
X`09s_nosb__`5B`5D`09`09= "nosb",&0209`09/* Bool */
X`09s_noshowmatch__`5B`5D`09= "\130B",`09`09/* Bool */
X`09s_noshowmode__`5B`5D`09= "\120A",`09`09`09/* Bool */
X#if OPT_RAMSIZE
X`09s_noshowram__`5B`5D`09`09= "\1209",&0209`09/* Bool */
X#endif
X`09s_nosm__`5B`5D`09`09= "nosm",&0209`09/* Bool */
X`09s_nosmd__`5B`5D`09`09= "nosmd",&0209`09/* Bool */
X`09s_nosmoothscroll__`5B`5D`09= "\160E",`09`09/* Bool */
X`09s_nospaces_after_sentence__`5B`5D = "\1F08-after-\1F08", /* Bool */
X#if OPT_RAMSIZE
X`09s_nosr__`5B`5D`09`09= "nosr",&0209`09/* Bool */
X#endif
X`09s_noss__`5B`5D`09`09= "noss",&0209`09/* Bool */
X`09s_notabinsert__`5B`5D`09= "\130B",`09`09/* Bool */
X#if !SMALLER
X`09s_notagignorecase__`5B`5D`09= "\170F",`09`09/* Bool */
X#endif
X`09s_notagrelative__`5B`5D`09= "\150D",`09`09/* Bool */
X`09s_notagword__`5B`5D`09`09= "\1209",&0209`09/* Bool */
X#if !SMALLER
X`09s_notc__`5B`5D`09`09= "notc",&0209`09/* Bool */
X#endif
X`09s_noterse__`5B`5D`09`09= "\1007",&0209`09/* Bool */
X#if OPT_SELECTIONS
X`09s_noterse_selections__`5B`5D = "\1A07-\1A0A",`09/* Bool */
X#endif
X`09s_noti__`5B`5D`09`09= "noti",&0209`09/* Bool */
X`09s_notr__`5B`5D`09`09= "notr",&0209`09/* Bool */
X#if OPT_SELECTIONS
X`09s_notsel__`5B`5D`09`09= "\0F06",&0209`09/* Bool */
X#endif
X`09s_notw__`5B`5D`09`09= "notw",&0209`09/* Bool */
X`09s_nounprintable_as_octal__`5B`5D = "\1E0D-as-octal", /* Bool */
X`09s_nouo__`5B`5D`09`09= "nouo",&0209`09/* Bool */
X#if OPT_LCKFILES
X`09s_nousefilelock__`5B`5D`09= "\150D",`09`09/* Bool */
X#endif
X`09s_noview__`5B`5D`09`09= "\0F06",&0209`09/* Bool */
X`09s_noview_on_readonly__`5B`5D = "\1A06-on-\1A08",`09/* Bool */
X`09s_noviewro__`5B`5D`09`09= "\1108",&0209`09/* Bool */
X#if OPT_W32PIPES
X`09s_now32pipes__`5B`5D`09= "\120A",`09`09`09/* Bool */
X#endif
X`09s_nowarn_rename__`5B`5D`09= "\1506-\1506",`09`09/* Bool */
X`09s_nowarn_reread__`5B`5D`09= "\1506-\1506",`09`09/* Bool */
X`09s_nowarn_unread__`5B`5D`09= "\1506-\1506",`09`09/* Bool */
X#if OPT_WORKING
X`09s_noworking__`5B`5D`09`09= "\1209",&0209`09/* Bool */
X#endif
X`09s_nowrapscan__`5B`5D`09= "\120A",`09`09`09/* Bool */
X`09s_nowrapwords__`5B`5D`09= "\130B",`09`09/* Bool */
X`09s_nows__`5B`5D`09`09= "nows",&0209`09/* Bool */
X`09s_noww__`5B`5D`09`09= "noww",&0209`09/* Bool */
X`09s_noxterm_mouse__`5B`5D`09= "\1507-mouse",`09`09/* Bool */
X#if (OPT_EVAL)
X`09s_ntildes__`5B`5D`09`09= "\1007",&0209`09/* env */
X#endif
X#if (OPT_EVAL) `26\0D06SHELL)
X`09s_ocwd__`5B`5D`09`09= "ocwd",&0209`09/* env */
X#endif
X#if (OPT_EVAL)
X`09s_os__`5B`5D`09`09= "os",&0209&0209/* env */
X`09s_pagelen__`5B`5D`09`09= "\1007",&0209`09/* env */
X`09s_pagewid__`5B`5D`09`09= "\1007",&0209`09/* env */
X`09s_palette__`5B`5D`09`09= "\1007",&0209`09/* env */
X#endif
X`09s_paragraphs__`5B`5D`09= "\120A",`09`09`09/* regex */
X#if (OPT_EVAL)
X`09s_patchlevel__`5B`5D`09= "\120A",`09`09`09/* env */
X`09s_pathname__`5B`5D`09`09= "\1108",&0209`09/* env */
X#endif
X#if OPT_POPUPCHOICE`26`26OPT_ENUM_MODES
X`09s_pc__`5B`5D`09`09= "pc",&0209&0209/* enum */
X#endif
X#if (OPT_EVAL)
X`09s_pending__`5B`5D`09`09= "\1007",&0209`09/* env */
X`09s_pid__`5B`5D`09`09= "pid",&0209`09/* env */
X#endif
X#if OPT_POPUPCHOICE`26`26OPT_ENUM_MODES
X`09s_popup_choices__`5B`5D`09= "popup-\1507",`09`09/* enum */
X#endif
X`09s_pre__`5B`5D`09`09= "pre",&0209`09/* regex */
X`09s_preamble__`5B`5D`09`09= "\1108",&0209`09/* regex */
X`09s_printing_high__`5B`5D`09= "\1508-high",`09`09/* int */
X`09s_printing_low__`5B`5D`09= "\1408-low",`09`09/* int */
X#if (OPT_EVAL)
X`09s_progname__`5B`5D`09`09= "\1108",&0209`09/* env */
X`09s_qidentifier__`5B`5D`09= "\130B",`09`09/* env */
X#endif
X#if (OPT_EVAL) `26\0D06RAMSIZE)
X`09s_ram__`5B`5D`09`09= "ram",&0209`09/* env */
X#endif
X#if (OPT_EVAL) `26\0D06PROCEDURES)
X`09s_read_hook__`5B`5D`09`09= "read-hook",&0209`09/* env */
X#endif
X#if (OPT_EVAL)
X`09s_replace__`5B`5D`09`09= "\1007",&0209`09/* env */
X#endif
X`09s_report__`5B`5D`09`09= "\0F06",&0209`09/* int */
X#if SYS_WINNT
X`09s_scroll_pause__`5B`5D`09= "\1406-pause",`09`09/* int */
X#endif
X#if (OPT_EVAL)
X`09s_search__`5B`5D`09`09= "\0F06",&0209`09/* env */
X#endif
X`09s_sections__`5B`5D`09`09= "\1108",&0209`09/* regex */
X#if (OPT_EVAL)
X`09s_seed__`5B`5D`09`09= "seed",&0209`09/* env */
X#endif
X`09s_sentences__`5B`5D`09`09= "\1209",&0209`09/* regex */
X#if (OPT_EVAL) `26\0D06SHELL)
X`09s_shell__`5B`5D`09`09= "shell",&0209`09/* env */
X#endif
X`09s_shiftwidth__`5B`5D`09= "\120A",`09`09`09/* int */
X`09s_side__`5B`5D`09`09= "side",&0209`09/* int */
X`09s_sideways__`5B`5D`09`09= "\1108",&0209`09/* int */
X#if (OPT_EVAL)
X`09s_sres__`5B`5D`09`09= "sres",&0209`09/* env */
X`09s_startup_file__`5B`5D`09= "\1407-file",`09`09/* env */
X`09s_startup_path__`5B`5D`09= "\1407-path",`09`09/* env */
X`09s_status__`5B`5D`09`09= "\0F06",&0209`09/* env */
X#endif
X`09s_suf__`5B`5D`09`09= "suf",&0209`09/* regex */
X`09s_suffixes__`5B`5D`09`09= "\1108",&0209`09/* regex */
X`09s_sw__`5B`5D`09`09= "sw",&0209&0209/* int */
X`09s_tabstop__`5B`5D`09`09= "\1007",&0209`09/* int */
X`09s_taglength__`5B`5D`09`09= "\1209",&0209`09/* int */
X`09s_tags__`5B`5D`09`09= "tags",&0209`09/* string */
X`09s_timeoutlen__`5B`5D`09= "\120A",`09`09`09/* int */
X`09s_timeoutlen_user__`5B`5D`09= "\170A-user",`09`09/* int */
X#if (OPT_EVAL) `26 (DISP_X11)
X`09s_title__`5B`5D`09`09= "title",&0209`09/* env */
X#endif
X`09s_tl__`5B`5D`09`09= "tl",&0209&0209/* int */
X#if (OPT_EVAL)
X`09s_tpause__`5B`5D`09`09= "\0F06",&0209`09/* env */
X#endif
X`09s_ts__`5B`5D`09`09= "ts",&0209&0209/* int */
X`09s_ul__`5B`5D`09`09= "ul",&0209&0209/* int */
X`09s_undolimit__`5B`5D`09`09= "\1209",&0209`09/* int */
X#if (OPT_EVAL)
X`09s_version__`5B`5D`09`09= "\1007",&0209`09/* env */
X#endif
X#if OPT_HILITEMATCH
X`09s_visual_matches__`5B`5D`09= "\1606-\1607",`09`09/* enum */
X#endif
X#if (OPT_EVAL)
X`09s_wline__`5B`5D`09`09= "wline",&0209`09/* env */
X#endif
X`09s_wm__`5B`5D`09`09= "wm",&0209&0209/* int */
X#if (OPT_EVAL)
X`09s_word__`5B`5D`09`09= "word",&0209`09/* env */
X#endif
X`09s_wrapmargin__`5B`5D`09= "\120A",`09`09`09/* int */
X#if (OPT_EVAL) `26\0D06PROCEDURES)
X`09s_write_hook__`5B`5D`09= "write-hook",`09`09`09/* env */
X#endif
X#if (OPT_EVAL) `26 (DISP_X11)
X`09s_xdisplay__`5B`5D`09`09= "\1108",&0209`09/* env */
X`09s_xshell__`5B`5D`09`09= "\0F06",&0209`09/* env */
X#endif
X`09s_NULL`5B`5D = "";
X#endif /* realdef */
X
X#ifdef realdef
XEXTERN_CONST char *const all_modes`5B`5D = `7B
X`09s_noab__+2,
X#if (OPT_EVAL)
X`09s_abufname__,
X#endif
X`09s_noai__+2,
X`09s_all__,
X`09s_noalt_tabpos__+2,
X#if OPT_UPBUFF
X`09s_noanimated__+2,
X#endif
X`09s_noas__+2,
X`09s_ascnt__,
X`09s_noatp__+2,
X`09s_noautobuffer__+2,
X`09s_noautoindent__+2,
X`09s_noautosave__+2,
X`09s_autosavecnt__,
X`09s_noautowrite__+2,
X`09s_noaw__+2,
X`09s_nobackspacelimit__+2,
X#if OPT_FILEBACK
X`09s_backup_style__,
X#endif
X#if OPT_COLOR
X`09s_bcolor__,
X#endif
X`09s_nobl__+2,
X#if (OPT_EVAL) `26\0D06PROCEDURES)
X`09s_buffer_hook__,
X#endif
X#if OPT_MAJORMODE
X`09s_c_preamble__,
X#endif
X#if !OPT_MAJORMODE
X`09s_c_shiftwidth__,
X#endif
X#if (OPT_MAJORMODE)
X`09s_c_shiftwidth__,
X#endif
X#if !OPT_MAJORMODE
X`09s_c_suffixes__,
X#endif
X#if OPT_MAJORMODE
X`09s_c_suffixes__,
X#endif
X#if !OPT_MAJORMODE
X`09s_c_tabstop__,
X#endif
X#if (OPT_MAJORMODE)
X`09s_c_tabstop__,
X#endif
X#if (OPT_EVAL)
X`09s_cbufname__,
X#endif
X#if (OPT_EVAL) `26\0D06PROCEDURES)
X`09s_cd_hook__,
X#endif
X#if (OPT_EVAL)
X`09s_cfilname__,
X`09s_char__,
X#endif
X#if !SMALLER
X`09s_nocheck_modtime__+2,
X#endif
X#if !OPT_MAJORMODE
X`09s_nocmode__+2,
X#endif
X#if OPT_MAJORMODE
X`09s_nocmode__+2,
X#endif
X`09s_comment_prefix__,
X`09s_comments__,
X#if OPT_MAJORMODE
X`09s_cpre__,
X#endif
X#if OPT_ENCRYPT
X`09s_nocrypt__+2,
X#endif
X#if (OPT_EVAL) `26\0D07NCRYPT)
X`09s_cryptkey__,
X#endif
X#if !OPT_MAJORMODE
X`09s_csuf__,
X#endif
X#if OPT_MAJORMODE
X`09s_csuf__,
X#endif
X#if !OPT_MAJORMODE
X`09s_csw__,
X#endif
X#if (OPT_MAJORMODE)
X`09s_csw__,
X#endif
X#if !OPT_MAJORMODE
X`09s_cts__,
X#endif
X#if (OPT_MAJORMODE)
X`09s_cts__,
X#endif
X#if (OPT_EVAL)
X`09s_curcol__,
X`09s_curline__,
X#endif
X#if (OPT_EVAL) `26\0D06SHELL)
X`09s_cwd__,
X#endif
X#if (OPT_EVAL)
X`09s_cwline__,
X`09s_debug__,
X#endif
X#if COMPLETE_DIRS
X`09s_nodirc__+2,
X#endif
X#if (OPT_EVAL) `26\0D06SHELL)
X`09s_directory__,
X#endif
X#if (OPT_EVAL)
X`09s_discmd__,
X`09s_disinp__,
X#endif
X`09s_nodos__+2,
X`09s_noeb__+2,
X#if (OPT_EVAL)
X`09s_end_of_cmd__,
X#endif
X`09s_noerrorbells__+2,
X#if (OPT_EVAL) `26\0D06PROCEDURES)
X`09s_exit_hook__,
X#endif
X`09s_expand_chars__,
X`09s_noexpand_path__+2,
X`09s_fc__,
X#if OPT_COLOR
X`09s_fcolor__,
X#endif
X`09s_fence_begin__,
X`09s_fence_elif__,
X`09s_fence_else__,
X`09s_fence_end__,
X`09s_fence_fi__,
X`09s_fence_if__,
X`09s_fence_pairs__,
X`09s_fillcol__,
X#if OPT_FLASH
X`09s_noflash__+2,
X#endif
X#if (OPT_EVAL)
X`09s_flicker__,
X#endif
X#if (OPT_EVAL) `26 (DISP_X11)
X`09s_font__,
X#endif
X#if SYS_WINNT`26`26defined(DISP_NTWIN)
X`09s_noforce_console__+2,
+-+-+-+-+-+-+-+-  END  OF PART 81 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 82 -+-+-+-+-+-+-+-+
X#endif
X#if (OPT_EVAL)
X`09s_forward_search__,
X#endif
X#if !OPT_GLOB_PIPE
X`09s_noglob__+2,
X#endif
X#if OPT_GLOB_PIPE
X`09s_glob__,
X#endif
X#if (OPT_EVAL)
X`09s_helpfile__,
X#endif
X#if OPT_HISTORY
X`09s_nohi__+2,
X`09s_nohistory__+2,
X#endif
X`09s_nohorizscroll__+2,
X`09s_nohs__+2,
X`09s_noib__+2,
X`09s_noic__+2,
X#if (OPT_EVAL) `26 (DISP_X11)
X`09s_iconname__,
X#endif
X#if (OPT_EVAL)
X`09s_identifier__,
X#endif
X`09s_noignorecase__+2,
X`09s_noimplybuffer__+2,
X#if (OPT_EVAL)
X`09s_kill__,
X`09s_lastkey__,
X#endif
X`09s_noli__+2,
X#if (OPT_EVAL)
X`09s_line__,
X#endif
X#if OPT_LINEWRAP
X`09s_nolinewrap__+2,
X#endif
X`09s_nolist__+2,
X#if (OPT_EVAL)
X`09s_llength__,
X#endif
X#if OPT_LCKFILES
X`09s_nolocked__+2,
X`09s_locker__,
X#endif
X#if OPT_LINEWRAP
X`09s_nolw__+2,
X#endif
X`09s_nomagic__+2,
X#if (OPT_EVAL) `26\0D06MAJORMODE)
X`09s_majormode__,
X#endif
X`09s_maplength__,
X`09s_nomaplonger__+2,
X#if (OPT_EVAL)
X`09s_match__,
X#endif
X`09s_nometa_insert_bindings__+2,
X`09s_mh__,
X`09s_nomib__+2,
X`09s_mini_hilite__,
X#if (OPT_EVAL)
X`09s_mode__,
X#endif
X#if (OPT_EVAL) `26\0D06MLFORMAT)
X`09s_modeline_format__,
X#endif
X#if (OPT_EVAL)
X`09s_modified__,
X#endif
X`09s_nomultibeep__+2,
X#if (OPT_EVAL)
X`09s_ncolors__,
X#endif
X`09s_nonewline__+2,
X`09s_nonl__+2,
X`09s_noab__,
X`09s_noai__,
X`09s_noalt_tabpos__,
X#if OPT_UPBUFF
X`09s_noanimated__,
X#endif
X`09s_noas__,
X`09s_noatp__,
X`09s_noautobuffer__,
X`09s_noautoindent__,
X`09s_noautosave__,
X`09s_noautowrite__,
X`09s_noaw__,
X`09s_nobackspacelimit__,
X`09s_nobl__,
X#if !SMALLER
X`09s_nocheck_modtime__,
X#endif
X#if !OPT_MAJORMODE
X`09s_nocmode__,
X#endif
X#if OPT_MAJORMODE
X`09s_nocmode__,
X#endif
X#if OPT_ENCRYPT
X`09s_nocrypt__,
X#endif
X#if COMPLETE_DIRS
X`09s_nodirc__,
X#endif
X`09s_nodos__,
X`09s_noeb__,
X`09s_noerrorbells__,
X`09s_noexpand_path__,
X#if OPT_FLASH
X`09s_noflash__,
X#endif
X#if SYS_WINNT`26`26defined(DISP_NTWIN)
X`09s_noforce_console__,
X#endif
X#if !OPT_GLOB_PIPE
X`09s_noglob__,
X#endif
X#if OPT_HISTORY
X`09s_nohi__,
X`09s_nohistory__,
X#endif
X`09s_nohorizscroll__,
X`09s_nohs__,
X`09s_noib__,
X`09s_noic__,
X`09s_noignorecase__,
X`09s_noimplybuffer__,
X`09s_noli__,
X#if OPT_LINEWRAP
X`09s_nolinewrap__,
X#endif
X`09s_nolist__,
X#if OPT_LCKFILES
X`09s_nolocked__,
X#endif
X#if OPT_LINEWRAP
X`09s_nolw__,
X#endif
X`09s_nomagic__,
X`09s_nomaplonger__,
X`09s_nometa_insert_bindings__,
X`09s_nomib__,
X`09s_nomultibeep__,
X`09s_nonewline__,
X`09s_nonl__,
X`09s_nonu__,
X`09s_nonumber__,
X#if OPT_POPUPCHOICE`26`26!OPT_ENUM_MODES
X`09s_nopc__,
X#endif
X#if OPT_POPUP_MSGS
X`09s_nopm__,
X#endif
X#if OPT_POPUPCHOICE`26`26!OPT_ENUM_MODES
X`09s_nopopup_choices__,
X#endif
X#if OPT_POPUP_MSGS
X`09s_nopopup_msgs__,
X#endif
X`09s_noreadonly__,
X`09s_noreadonly_on_\0C09_,
X`09s_noremap__,
X`09s_noremapfirst__,
X#if HAVE_SYMLINK
X`09s_noresolve_links__,
X#endif
X`09s_noro__,
X`09s_nororo__,
X#if !SMALLER
X`09s_noruler__,
X#endif
X`09s_nosamebangs__,
X`09s_nosas__,
X`09s_nosb__,
X`09s_noshowmatch__,
X`09s_noshowmode__,
X#if OPT_RAMSIZE
X`09s_noshowram__,
X#endif
X`09s_nosm__,
X`09s_nosmd__,
X`09s_nosmoothscroll__,
X`09s_nospaces_after_sentence__,
X#if OPT_RAMSIZE
X`09s_nosr__,
X#endif
X`09s_noss__,
X`09s_notabinsert__,
X#if !SMALLER
X`09s_notagignorecase__,
X#endif
X`09s_notagrelative__,
X`09s_notagword__,
X#if !SMALLER
X`09s_notc__,
X#endif
X`09s_noterse__,
X#if OPT_SELECTIONS
X`09s_noterse_selections__,
X#endif
X`09s_noti__,
X`09s_notr__,
X#if OPT_SELECTIONS
X`09s_notsel__,
X#endif
X`09s_notw__,
X`09s_nounprintable_as_octal__,
X`09s_nouo__,
X#if OPT_LCKFILES
X`09s_nousefilelock__,
X#endif
X`09s_noview__,
X`09s_noview_on_readonly__,
X`09s_noviewro__,
X#if OPT_W32PIPES
X`09s_now32pipes__,
X#endif
X`09s_nowarn_rename__,
X`09s_nowarn_reread__,
X`09s_nowarn_unread__,
X#if OPT_WORKING
X`09s_noworking__,
X#endif
X`09s_nowrapscan__,
X`09s_nowrapwords__,
X`09s_nows__,
X`09s_noww__,
X`09s_noxterm_mouse__,
X#if (OPT_EVAL)
X`09s_ntildes__,
X#endif
X`09s_nonu__+2,
X`09s_nonumber__+2,
X#if (OPT_EVAL) `26\0D06SHELL)
X`09s_ocwd__,
X#endif
X#if (OPT_EVAL)
X`09s_os__,
X`09s_pagelen__,
X`09s_pagewid__,
X`09s_palette__,
X#endif
X`09s_paragraphs__,
X#if (OPT_EVAL)
X`09s_patchlevel__,
X`09s_pathname__,
X#endif
X#if OPT_POPUPCHOICE`26`26!OPT_ENUM_MODES
X`09s_nopc__+2,
X#endif
X#if OPT_POPUPCHOICE`26`26OPT_ENUM_MODES
X`09s_pc__,
X#endif
X#if (OPT_EVAL)
X`09s_pending__,
X`09s_pid__,
X#endif
X#if OPT_POPUP_MSGS
X`09s_nopm__+2,
X#endif
X#if OPT_POPUPCHOICE`26`26!OPT_ENUM_MODES
X`09s_nopopup_choices__+2,
X#endif
X#if OPT_POPUPCHOICE`26`26OPT_ENUM_MODES
X`09s_popup_choices__,
X#endif
X#if OPT_POPUP_MSGS
X`09s_nopopup_msgs__+2,
X#endif
X`09s_pre__,
X`09s_preamble__,
X`09s_printing_high__,
X`09s_printing_low__,
X#if (OPT_EVAL)
X`09s_progname__,
X`09s_qidentifier__,
X#endif
X#if (OPT_EVAL) `26\0D06RAMSIZE)
X`09s_ram__,
X#endif
X#if (OPT_EVAL) `26\0D06PROCEDURES)
X`09s_read_hook__,
X#endif
X`09s_noreadonly__+2,
X`09s_noreadonly_on_\0C09_+2,
X`09s_noremap__+2,
X`09s_noremapfirst__+2,
X#if (OPT_EVAL)
X`09s_replace__,
X#endif
X`09s_report__,
X#if HAVE_SYMLINK
X`09s_noresolve_links__+2,
X#endif
X`09s_noro__+2,
X`09s_nororo__+2,
X#if !SMALLER
X`09s_noruler__+2,
X#endif
X`09s_nosamebangs__+2,
X`09s_nosas__+2,
X`09s_nosb__+2,
X#if SYS_WINNT
X`09s_scroll_pause__,
X#endif
X#if (OPT_EVAL)
X`09s_search__,
X#endif
X`09s_sections__,
X#if (OPT_EVAL)
X`09s_seed__,
X#endif
X`09s_sentences__,
X#if (OPT_EVAL) `26\0D06SHELL)
X`09s_shell__,
X#endif
X`09s_shiftwidth__,
X`09s_noshowmatch__+2,
X`09s_noshowmode__+2,
X#if OPT_RAMSIZE
X`09s_noshowram__+2,
X#endif
X`09s_side__,
X`09s_sideways__,
X`09s_nosm__+2,
X`09s_nosmd__+2,
X`09s_nosmoothscroll__+2,
X`09s_nospaces_after_sentence__+2,
X#if OPT_RAMSIZE
X`09s_nosr__+2,
X#endif
X#if (OPT_EVAL)
X`09s_sres__,
X#endif
X`09s_noss__+2,
X#if (OPT_EVAL)
X`09s_startup_file__,
X`09s_startup_path__,
X`09s_status__,
X#endif
X`09s_suf__,
X`09s_suffixes__,
X`09s_sw__,
X`09s_notabinsert__+2,
X`09s_tabstop__,
X#if !SMALLER
X`09s_notagignorecase__+2,
X#endif
X`09s_taglength__,
X`09s_notagrelative__+2,
X`09s_tags__,
X`09s_notagword__+2,
X#if !SMALLER
X`09s_notc__+2,
X#endif
X`09s_noterse__+2,
X#if OPT_SELECTIONS
X`09s_noterse_selections__+2,
X#endif
X`09s_noti__+2,
X`09s_timeoutlen__,
X`09s_timeoutlen_user__,
X#if (OPT_EVAL) `26 (DISP_X11)
X`09s_title__,
X#endif
X`09s_tl__,
X#if (OPT_EVAL)
X`09s_tpause__,
X#endif
X`09s_notr__+2,
X`09s_ts__,
X#if OPT_SELECTIONS
X`09s_notsel__+2,
X#endif
X`09s_notw__+2,
X`09s_ul__,
X`09s_undolimit__,
X`09s_nounprintable_as_octal__+2,
X`09s_nouo__+2,
X#if OPT_LCKFILES
X`09s_nousefilelock__+2,
X#endif
X#if (OPT_EVAL)
X`09s_version__,
X#endif
X`09s_noview__+2,
X`09s_noview_on_readonly__+2,
X`09s_noviewro__+2,
X#if OPT_HILITEMATCH
X`09s_visual_matches__,
X#endif
X#if OPT_W32PIPES
X`09s_now32pipes__+2,
X#endif
X`09s_nowarn_rename__+2,
X`09s_nowarn_reread__+2,
X`09s_nowarn_unread__+2,
X#if (OPT_EVAL)
X`09s_wline__,
X#endif
X`09s_wm__,
X#if (OPT_EVAL)
X`09s_word__,
X#endif
X#if OPT_WORKING
X`09s_noworking__+2,
X#endif
X`09s_wrapmargin__,
X`09s_nowrapscan__+2,
X`09s_nowrapwords__+2,
X#if (OPT_EVAL) `26\0D06PROCEDURES)
X`09s_write_hook__,
X#endif
X`09s_nows__+2,
X`09s_noww__+2,
X#if (OPT_EVAL) `26 (DISP_X11)
X`09s_xdisplay__,
X`09s_xshell__,
X#endif
X`09s_noxterm_mouse__+2,
X`09NULL`09/* ends table */
X`7D;
X#else
Xextern const char *\0C06all_modes`5B`5D;
X#endif /* realdef */
X
X#if OPT_MAJORMODE
X#ifdef realdef
XEXTERN_CONST char *const all_submodes`5B`5D = `7B
X`09s_noai__+2,
X#if OPT_UPBUFF
X`09s_noanimated__+2,
X#endif
X`09s_noas__+2,
X`09s_ascnt__,
X`09s_noautoindent__+2,
X`09s_noautosave__+2,
X`09s_autosavecnt__,
X`09s_noautowrite__+2,
X`09s_noaw__+2,
X`09s_nobackspacelimit__+2,
X`09s_nobl__+2,
X#if !OPT_MAJORMODE
X`09s_c_shiftwidth__,
X`09s_c_tabstop__,
X#endif
X#if !SMALLER
X`09s_nocheck_modtime__+2,
X#endif
X#if !OPT_MAJORMODE
X`09s_nocmode__+2,
X#endif
X`09s_comment_prefix__,
X`09s_comments__,
X#if OPT_ENCRYPT
X`09s_nocrypt__+2,
X#endif
X#if !OPT_MAJORMODE
X`09s_csw__,
X`09s_cts__,
X#endif
X`09s_nodos__+2,
X`09s_fc__,
X`09s_fence_begin__,
X`09s_fence_elif__,
X`09s_fence_else__,
X`09s_fence_end__,
X`09s_fence_fi__,
X`09s_fence_if__,
X`09s_fence_pairs__,
X`09s_fillcol__,
X`09s_noic__+2,
X`09s_noignorecase__+2,
X#if OPT_LCKFILES
X`09s_nolocked__+2,
X`09s_locker__,
X#endif
X`09s_nomagic__+2,
X`09s_nometa_insert_bindings__+2,
X`09s_nomib__+2,
X`09s_nonewline__+2,
X`09s_nonl__+2,
X`09s_noai__,
X#if OPT_UPBUFF
X`09s_noanimated__,
X#endif
X`09s_noas__,
X`09s_noautoindent__,
X`09s_noautosave__,
X`09s_noautowrite__,
X`09s_noaw__,
X`09s_nobackspacelimit__,
X`09s_nobl__,
X#if !SMALLER
X`09s_nocheck_modtime__,
X#endif
X#if !OPT_MAJORMODE
X`09s_nocmode__,
X#endif
X#if OPT_ENCRYPT
X`09s_nocrypt__,
X#endif
X`09s_nodos__,
X`09s_noic__,
X`09s_noignorecase__,
X#if OPT_LCKFILES
X`09s_nolocked__,
X#endif
X`09s_nomagic__,
X`09s_nometa_insert_bindings__,
X`09s_nomib__,
X`09s_nonewline__,
X`09s_nonl__,
X`09s_noreadonly__,
X`09s_noro__,
X`09s_noshowmatch__,
X`09s_noshowmode__,
X`09s_nosm__,
X`09s_nosmd__,
X`09s_notabinsert__,
X#if !SMALLER
X`09s_notagignorecase__,
X#endif
X`09s_notagrelative__,
X`09s_notagword__,
X#if !SMALLER
X`09s_notc__,
X#endif
X`09s_noterse__,
X`09s_noti__,
X`09s_notr__,
X`09s_notw__,
X`09s_noview__,
X`09s_nowrapscan__,
X`09s_nowrapwords__,
X`09s_nows__,
X`09s_noww__,
X`09s_paragraphs__,
X`09s_pre__,
X`09s_preamble__,
X`09s_noreadonly__+2,
X`09s_noro__+2,
X`09s_sections__,
X`09s_sentences__,
X`09s_shiftwidth__,
X`09s_noshowmatch__+2,
X`09s_noshowmode__+2,
X`09s_nosm__+2,
X`09s_nosmd__+2,
X`09s_suf__,
X`09s_suffixes__,
X`09s_sw__,
X`09s_notabinsert__+2,
X`09s_tabstop__,
X#if !SMALLER
X`09s_notagignorecase__+2,
X#endif
X`09s_taglength__,
X`09s_notagrelative__+2,
X`09s_tags__,
X`09s_notagword__+2,
X#if !SMALLER
X`09s_notc__+2,
X#endif
X`09s_noterse__+2,
X`09s_noti__+2,
X`09s_tl__,
X`09s_notr__+2,
X`09s_ts__,
X`09s_notw__+2,
X`09s_ul__,
X`09s_undolimit__,
X`09s_noview__+2,
X#if OPT_HILITEMATCH
X`09s_visual_matches__,
X#endif
X`09s_wm__,
X`09s_wrapmargin__,
X`09s_nowrapscan__+2,
X`09s_nowrapwords__+2,
X`09s_nows__+2,
X`09s_noww__+2,
X`09NULL`09/* ends table */
X`7D;
X#else
Xextern const char *\0C06all_submodes`5B`5D;
X#endif /* realdef */
X#endif /* OPT_MAJORMODE */
X
X/* global mode flags`09*/
X/* the indices of G_VALUES.v`5B`5D */
Xtypedef`09struct`09`7B
X`09char`09s_alt_tabpos__; /* emacs-style cursor positioning */
X`09char`09s_autobuffer__; /* auto-\1206 (lru) */
X#if OPT_FILEBACK
X`09char`09s_backup_style__; /* file \1806 style */
X#endif
X#if OPT_COLOR
X`09char`09s_bcolor__;`09/* background color */
X#endif
X#if !OPT_MAJORMODE
X`09char`09s_c_suffixes__; /* match against filenames to turn on c-mode */
X#endif
X#if COMPLETE_DIRS
X`09char`09s_dirc__;`09/* directory-completion (slow!) */
X#endif
X`09char`09s_errorbells__; /* audible/visible-bells */
X`09char`09s_expand_chars__; /* list of chars we can \2806 (%,#,:) */
X`09char`09s_expand_path__; /* true iff %/# don't substitute shortened-path */
V
X#if OPT_COLOR
X`09char`09s_fcolor__;`09/* foreground color */
X#endif
X#if OPT_FLASH
X`09char`09s_flash__;`09/* visible-bell (flash) */
X#endif
X#if SYS_WINNT`26`26defined(DISP_NTWIN)
X`09char`09s_force_console__;
X#endif
X#if !OPT_GLOB_PIPE
X`09char`09s_glob__;`09/* enable/disable filename globbing */
X#endif
X#if OPT_GLOB_PIPE
X`09char`09s_glob__;`09/* select filename globbing style */
X#endif
X#if OPT_HISTORY
X`09char`09s_history__;`09/* command-\1607 */
X#endif
X`09char`09s_implybuffer__; /* imply-\1306 (vi-like) */
X`09char`09s_maplength__;`09/* maximum \1506 of :map string */
X`09char`09s_maplonger__;`09/* favor \1306 maps */
X`09char`09s_mini_hilite__; /* highlight minibuffer when using vi-commands */
X`09char`09s_multibeep__;`09/* multiple successive identical failed motions all
V beep */
X#if OPT_POPUPCHOICE`26`26!OPT_ENUM_MODES
X`09char`09s_popup_choices__; /* popup buffer showing file-completion \3307 */
V
X#endif
X#if OPT_POPUPCHOICE`26`26OPT_ENUM_MODES
X`09char`09s_popup_choices__; /* popup buffer showing file-completion \3307 */
V
X#endif
X#if OPT_POPUP_MSGS
X`09char`09s_popup_msgs__; /* popup buffer when multiple messages emitted */
X#endif
X`09char`09s_printing_high__; /* high end of high-bit-set printable range */
X`09char`09s_printing_low__; /* low end of high-bit-set printable range */
X`09char`09s_readonly_on\0C0A_; /* set \1F08 mode for\120Afiles */
X`09char`09s_remap__;`09/* should mappings be reapplied */
X`09char`09s_remapfirst__; /* should 1st char of a map be remapped? */
X`09char`09s_report__;`09/* threshold for \1B06ing changes */
X#if HAVE_SYMLINK
X`09char`09s_resolve_links__; /* cache/\1A07 directory names (can be slow if NF
VS times-out) */
X#endif
X`09char`09s_samebangs__;`09/* use same "!!" data for `5EX-! */
X#if SYS_WINNT
X`09char`09s_scroll_pause__; /* how long to catnap after \2C06ing */
X#endif
X#if OPT_RAMSIZE
X`09char`09s_showram__;`09/* show ram-usage */
X#endif
X`09char`09s_smoothscroll__; /* should we update even if there is typeahead? */
V
X`09char`09s_spaces_after_sentence__; /* add two \2406 after a */
X`09char`09s_timeoutlen__; /* how long to catnap for more input */
X`09char`09s_timeoutlen_user__; /* how long to catnap for more input */
X#if OPT_LCKFILES
X`09char`09s_usefilelock__; /* okay use \1808s */
X#endif
X`09char`09s_view_on_readonly__; /* set view mode for \2108 files */
X#if OPT_W32PIPES
X`09char`09s_w32pipes__;
X#endif
X`09char`09s_warn_rename__; /* warn before renaming a buffer */
X`09char`09s_warn_reread__; /* warn before \1906ing a buffer */
X`09char`09s_warn_unread__; /* warn if quitting with \2306 buffers */
X#if OPT_WORKING
X`09char`09s_working__;`09/* "\0F07" message */
X#endif
X`09char`09s_xterm_mouse__; /* mode to control whether we allow mouse-clicking
V */
X`09char`09s_MAX;
X`09char`09Q1;
X`09`7D IndexGlobals;
X
X#define GMDALTTABPOS `09Member_Offset(IndexGlobals, s_alt_tabpos__)
X#define GMDABUFF `09Member_Offset(IndexGlobals, s_autobuffer__)
X#if OPT_FILEBACK
X#define GVAL_BACKUPSTYLE  Member_Offset(IndexGlobals, s_backup_style__)
X#endif
X#if OPT_COLOR
X#define GVAL_BCOLOR `09Member_Offset(IndexGlobals, s_bcolor__)
X#endif
X#if !OPT_MAJORMODE
X#define GVAL_CSUFFIXES  Member_Offset(IndexGlobals, s_c_suffixes__)
X#endif
X#if COMPLETE_DIRS
X#define GMDDIRC `09Member_Offset(IndexGlobals, s_dirc__)
X#endif
X#define GMDERRORBELLS `09Member_Offset(IndexGlobals, s_errorbells__)
X#define GVAL_EXPAND_CHARS  Member_Offset(IndexGlobals, s_expand_chars__)
X#define GMDEXPAND_PATH  Member_Offset(IndexGlobals, s_expand_path__)
X#if OPT_COLOR
X#define GVAL_FCOLOR `09Member_Offset(IndexGlobals, s_fcolor__)
X#endif
X#if OPT_FLASH
X#define GMDFLASH `09Member_Offset(IndexGlobals, s_flash__)
X#endif
X#if SYS_WINNT`26`26defined(DISP_NTWIN)
X#define GMDFORCE_CONSOLE  Member_Offset(IndexGlobals, s_force_console__)
X#endif
X#if !OPT_GLOB_PIPE
X#define GMDGLOB `09Member_Offset(IndexGlobals, s_glob__)
X#endif
X#if OPT_GLOB_PIPE
X#define GVAL_GLOB `09Member_Offset(IndexGlobals, s_glob__)
X#endif
X#if OPT_HISTORY
X#define GMDHISTORY `09Member_Offset(IndexGlobals, s_history__)
X#endif
X#define GMDIMPLYBUFF `09Member_Offset(IndexGlobals, s_implybuffer__)
X#define GVAL_MAPLENGTH  Member_Offset(IndexGlobals, s_maplength__)
X#define GMDMAPLONGER `09Member_Offset(IndexGlobals, s_maplonger__)
X#define GVAL_MINI_HILITE  Member_Offset(IndexGlobals, s_mini_hilite__)
X#define GMDMULTIBEEP `09Member_Offset(IndexGlobals, s_multibeep__)
X#if OPT_POPUPCHOICE`26`26!OPT_ENUM_MODES
X#define GMDPOPUP_CHOICES  Member_Offset(IndexGlobals, s_popup_choices__)
X#endif
X#if OPT_POPUPCHOICE`26`26OPT_ENUM_MODES
X#define GVAL_POPUP_CHOICES  Member_Offset(IndexGlobals, s_popup_choices__)
X#endif
X#if OPT_POPUP_MSGS
X#define GMDPOPUP_MSGS `09Member_Offset(IndexGlobals, s_popup_msgs__)
X#endif
X#define GVAL_PRINT_HIGH  Member_Offset(IndexGlobals, s_printing_high__)
X#define GVAL_PRINT_LOW  Member_Offset(IndexGlobals, s_printing_low__)
X#define GMDRONLYRONLY `09Member_Offset(IndexGlobals, s_readonly_on\0C0A_)
X#define GMDREMAP `09Member_Offset(IndexGlobals, s_remap__)
X#define GMDREMAPFIRST `09Member_Offset(IndexGlobals, s_remapfirst__)
X#define GVAL_REPORT `09Member_Offset(IndexGlobals, s_report__)
X#if HAVE_SYMLINK
X#define GMDRESOLVE_LINKS  Member_Offset(IndexGlobals, s_resolve_links__)
X#endif
X#define GMDSAMEBANGS `09Member_Offset(IndexGlobals, s_samebangs__)
X#if SYS_WINNT
X#define GVAL_SCROLLPAUSE  Member_Offset(IndexGlobals, s_scroll_pause__)
X#endif
X#if OPT_RAMSIZE
X#define GMDRAMSIZE `09Member_Offset(IndexGlobals, s_showram__)
X#endif
X#define GMDSMOOTH_SCROLL  Member_Offset(IndexGlobals, s_smoothscroll__)
X#define GMDSPACESENT `09Member_Offset(IndexGlobals, s_spaces_after_sentence__)
V
X#define GVAL_TIMEOUTVAL  Member_Offset(IndexGlobals, s_timeoutlen__)
X#define GVAL_TIMEOUTUSERVAL  Member_Offset(IndexGlobals, s_timeoutlen_user__)
V
X#if OPT_LCKFILES
X#define GMDUSEFILELOCK  Member_Offset(IndexGlobals, s_usefilelock__)
X#endif
X#define GMDRONLYVIEW `09Member_Offset(IndexGlobals, s_view_on_readonly__)
X#if OPT_W32PIPES
X#define GMDW32PIPES `09Member_Offset(IndexGlobals, s_w32pipes__)
X#endif
X#define GMDWARNRENAME `09Member_Offset(IndexGlobals, s_warn_rename__)
X#define GMDWARNREREAD `09Member_Offset(IndexGlobals, s_warn_reread__)
X#define GMDWARNUNREAD `09Member_Offset(IndexGlobals, s_warn_unread__)
X#if OPT_WORKING
X#define GMDWORKING `09Member_Offset(IndexGlobals, s_working__)
X#endif
X#define GMDXTERM_MOUSE  Member_Offset(IndexGlobals, s_xterm_mouse__)
X
X#define NUM_G_VALUES`09Member_Offset(IndexGlobals, s_MAX) /* TABLESIZE(g_valna
Vmes) -- \2C07 */
X#define MAX_G_VALUES`0945
X
X
Xtypedef struct G_VALUES `7B
X`09/* each entry is a val, and a ptr to\1406 */
X`09struct VAL gv`5BMAX_G_VALUES+1`5D;
X`7D G_VALUES;
X
X#ifdef realdef
XEXTERN_CONST struct VALNAMES g_valnames`5B`5D = `7B
X`09`7B s_noalt_tabpos__+2,`09s_noatp\0D06VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X`09`7B s_noautobuffer__+2,`09s_noab\0C06VALTYPE_BOOL,`09chgd_\2F07 `7D,
X#if OPT_FILEBACK
X`09`7B s_backup_style__,`09"X",`09`09VALTYPE_STRING, (ChgdFunc)0 `7D,
X#endif
X#if OPT_COLOR
X`09`7B s_bcolor__,`09`09"X",&0209VALTYPE_ENUM,`09chgd_color `7D,
X#endif
X#if !OPT_MAJORMODE
X`09`7B s_c_suffixes__,`09s_csuf__,`09VALTYPE_REGEX,`09(ChgdFunc)0 `7D,
X#endif
X#if COMPLETE_DIRS
X`09`7B s_nodirc__+2,`09`09"X",&0209VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#endif
X`09`7B s_noerrorbells__+2,`09s_noeb\0C06VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X`09`7B s_expand_chars__,`09"X",`09`09VALTYPE_STRING, (ChgdFunc)0 `7D,
X`09`7B s_noexpand_path__+2,`09"X",`09`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#if OPT_COLOR
X`09`7B s_fcolor__,`09`09"X",&0209VALTYPE_ENUM,`09chgd_color `7D,
X#endif
X#if OPT_FLASH
X`09`7B s_noflash__+2,`09"X",`09`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#endif
X#if SYS_WINNT`26`26defined(DISP_NTWIN)
X`09`7B s_noforce_console__+2, "X",`09`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#endif
X#if !OPT_GLOB_PIPE
X`09`7B s_noglob__+2,`09`09"X",&0209VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#endif
X#if OPT_GLOB_PIPE
X`09`7B s_glob__,`09`09"X",&0209VALTYPE_STRING, (ChgdFunc)0 `7D,
X#endif
X#if OPT_HISTORY
X`09`7B s_nohistory__+2,`09\1106\0C06VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#endif
X`09`7B s_noimplybuffer__+2,`09s_noib\0C06VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X`09`7B s_maplength__,`09"X",`09`09VALTYPE_INT,`09(ChgdFunc)0 `7D,
X`09`7B s_nomaplonger__+2,`09"X",`09`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X`09`7B s_mini_hilite__,`09s_mh__,`09`09VALTYPE_ENUM,`09(ChgdFunc)0 `7D,
X`09`7B s_nomultibeep__+2,`09"X",`09`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#if OPT_POPUPCHOICE`26`26!OPT_ENUM_MODES
X`09`7B s_nopopup_choices__+2,\1706c__+2,`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#endif
X#if OPT_POPUPCHOICE`26`26OPT_ENUM_MODES
X`09`7B s_popup_choices__,`09s_pc__,`09`09VALTYPE_ENUM,`09(ChgdFunc)0 `7D,
X#endif
X#if OPT_POPUP_MSGS
X`09`7B s_nopopup_msgs__+2,`09s_nopm\0C06VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#endif
X`09`7B s_printing_high__,`09"X",`09`09VALTYPE_INT,`09chgd_charset `7D,
X`09`7B s_printing_low__,`09"X",`09`09VALTYPE_INT,`09chgd_charset `7D,
X`09`7B s_noreadonly_on_\0C09_+2,\1E06oro\0E06VALTYPE_BOOL, (ChgdFunc)0 `7D,
X`09`7B s_noremap__+2,`09"X",`09`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X`09`7B s_noremapfirst__+2,`09"X",`09`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X`09`7B s_report__,`09`09"X",&0209VALTYPE_INT,`09(ChgdFunc)0 `7D,
X#if HAVE_SYMLINK
X`09`7B s_noresolve_links__+2, "X",`09`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#endif
X`09`7B s_nosamebangs__+2,`09s_nosb\0C06VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#if SYS_WINNT
X`09`7B s_scroll_pause__,`09"X",`09`09VALTYPE_INT,`09(ChgdFunc)0 `7D,
X#endif
X#if OPT_RAMSIZE
X`09`7B s_noshowram__+2,`09s_nosr\0C06VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#endif
X`09`7B s_nosmoothscroll__+2,\1606s__+2,`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X`09`7B s_nospaces_after_sentence__+2,\1F06as__+2, VALTYPE_BOOL, (ChgdFunc)0`20
V`7D,
X`09`7B s_timeoutlen__,`09"X",`09`09VALTYPE_INT,`09(ChgdFunc)0 `7D,
X`09`7B s_timeoutlen_user__,`09"X",`09`09VALTYPE_INT,`09(ChgdFunc)0 `7D,
X#if OPT_LCKFILES
X`09`7B s_nousefilelock__+2,`09"X",`09`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#endif
X`09`7B s_noview_on_readonly__+2,\1A09ro\1006VALTYPE_BOOL, (ChgdFunc)0 `7D,
X#if OPT_W32PIPES
X`09`7B s_now32pipes__+2,`09"X",`09`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#endif
X`09`7B s_nowarn_rename__+2,`09"X",`09`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X`09`7B s_nowarn_reread__+2,`09"X",`09`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X`09`7B s_nowarn_unread__+2,`09"X",`09`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#if OPT_WORKING
X`09`7B s_noworking__+2,`09"X",`09`09VALTYPE_BOOL,`09chgd_\2607 `7D,
X#endif
X`09`7B s_noxterm_mouse__+2,`09"X",`09`09VALTYPE_BOOL,`09chgd_xterm `7D,
X
X`09`7B NULL,`09\0606VALTYPE_INT, 0 `7D
X`7D;
X#else
Xextern const struct VALNAMES g_valnames`5B`5D;
X#endif
X
X#if OPT_MAJORMODE
X/* major mode flags`09*/
X/* the indices of M_VALUES.v`5B`5D */
Xtypedef`09struct`09`7B
X`09char`09s_preamble__;`09/* match against file header to turn on mode */
X`09char`09s_suffixes__;`09/* match against filenames to turn on mode */
X`09char`09s_MAX;
X`09char`09Q1;
X`09`7D IndexMajor;
X
X#define MVAL_PREAMBLE `09Member_Offset(IndexMajor, s_preamble__)
X#define MVAL_SUFFIXES `09Member_Offset(IndexMajor, s_suffixes__)
X
X#define NUM_M_VALUES`09Member_Offset(IndexMajor, s_MAX) /* TABLESIZE(m_valname
Vs) -- Major */
X#define MAX_M_VALUES`092
X
X
Xtypedef struct M_VALUES `7B
X`09/* each entry is a val, and a ptr to\1406 */
X`09struct VAL mv`5BMAX_M_VALUES+1`5D;
X`7D M_VALUES;
X
X#ifdef realdef
XEXTERN_CONST struct VALNAMES m_valnames`5BMAX_M_VALUES+1`5D = `7B
X`09`7B s_preamble__,`09`09s_pre__,`09VALTYPE_REGEX,`09(ChgdFunc)0 `7D,
X`09`7B s_suffixes__,`09`09s_suf__,`09VALTYPE_REGEX,`09(ChgdFunc)0 `7D,
X
X`09`7B NULL,`09\0606VALTYPE_INT, 0 `7D
X`7D;
X#else
Xextern const struct VALNAMES m_valnames`5BMAX_M_VALUES+1`5D;
X#endif
X#endif /* OPT_MAJORMODE */
X
X/* buffer mode flags`09*/
X/* the indices of B_VALUES.v`5B`5D */
Xtypedef`09struct`09`7B
X#if OPT_UPBUFF
X`09char`09s_animated__;`09/* update scratch-buffers */
X#endif
X`09char`09s_autoindent__; /* auto-\1206 */
X`09char`09s_autosave__;`09/* auto-save mode */
X`09char`09s_autosavecnt__; /* how often auto-saves occur */
X`09char`09s_autowrite__;`09/* auto-write when shelling out */
X`09char`09s_backspacelimit__; /* \1509 limited in insert mode */
X#if !OPT_MAJORMODE
X`09char`09s_c_shiftwidth__; /* shift-width for C buffers */
X`09char`09s_c_tabstop__;`09/* tab spacing for C buffers */
X#endif
X#if !SMALLER
X`09char`09s_check_modtime__; /* check buffer-\1B07 */
X#endif
X#if !OPT_MAJORMODE
X`09char`09s_cmode__;`09/* C indentation and fence match */
X#endif
X`09char`09s_comment_prefix__; /* \0D06 to ignore/preserve when formatting`20
V\3F07 */
X`09char`09s_comments__;`09/* matches leading \1F07 for\0C09reformatting */
X#if OPT_ENCRYPT
X`09char`09s_crypt__;`09/* encrytion mode active */
X#endif
X`09char`09s_dos__;`09/* "dos" mode -- lines end in crlf */
X`09char`09s_fence_begin__; /* begin a simple (character, non-nestable) fence *
V/
X`09char`09s_fence_elif__; /* next complex fence */
X`09char`09s_fence_else__; /* final complex fence */
X`09char`09s_fence_end__;`09/* end a simple fence */
X`09char`09s_fence_fi__;`09/* end a complex fence */
X`09char`09s_fence_if__;`09/* begin a complex (line, nestable) fence */
X`09char`09s_fence_pairs__; /* pairs of fences `7B,`7D; (,); etc. */
X`09char`09s_fillcol__;`09/* column for paragraph reformat, and line break */
X`09char`09s_ignorecase__; /* Exact matching for searches */
X#if OPT_LCKFILES
X`09char`09s_locked__;`09/* mode \1206 */
X`09char`09s_locker__;`09/* Name of \1506 */
X#endif
X`09char`09s_magic__;`09/* regular expressions in search */
X`09char`09s_meta_insert_bindings__; /* honor meta \1A08 in insert mode */
X`09char`09s_newline__;`09/* trailing \1707 (vi-style) */
X`09char`09s_paragraphs__; /* delimits a \1C09 */
X`09char`09s_readonly__;`09/* allow writing the buffer */
X`09char`09s_sections__;`09/* delimits a \1A07 */
X`09char`09s_sentences__;`09/* delimits a \1B08 */
X`09char`09s_shiftwidth__; /* \110A for `5ET/`5ED/<</>> */
X`09char`09s_showmatch__;`09/* show matching braces during insert */
X`09char`09s_showmode__;`09/* show insert/replace/command mode */
X`09char`09s_tabinsert__;`09/* okay to \1506 tab chars */
X`09char`09s_tabstop__;`09/* tab spacing for most buffers */
X#if !SMALLER
X`09char`09s_tagignorecase__; /* \1106 upper/lower case in tags */
X#endif
X`09char`09s_taglength__;`09/* required significant \2206 for tag lookups */
X`09char`09s_tagrelative__; /* tags are \1808 to tagsfile path */
X`09char`09s_tags__;`09/* list of tags files */
X`09char`09s_tagword__;`09/* apply tag to whole word, not only string at cursor
V */
X`09char`09s_terse__;`09/* be terse -- suppress messages */
X`09char`09s_undolimit__;`09/* how much undo stack is saved */
X`09char`09s_view__;`09/* read-only buffer */
X#if OPT_HILITEMATCH
X`09char`09s_visual_matches__; /* highlight all search \2307 */
X#endif
X`09char`09s_wrapmargin__; /* width of right \1C06 for autowrap */
X`09char`09s_wrapscan__;`09/* wrap-around search mode */
X`09char`09s_wrapwords__;`09/* word wrap */
X`09char`09s_MAX;
X`09char`09Q1;
X`09`7D IndexBuffers;
X
X#if OPT_UPBUFF
X#define MDUPBUFF `09Member_Offset(IndexBuffers, s_animated__)
X#endif
X#define MDAIND `09`09Member_Offset(IndexBuffers, s_autoindent__)
X#define MDASAVE `09Member_Offset(IndexBuffers, s_autosave__)
X#define VAL_ASAVECNT `09Member_Offset(IndexBuffers, s_autosavecnt__)
X#define MDAUTOWRITE `09Member_Offset(IndexBuffers, s_autowrite__)
X#define MDBACKLIMIT `09Member_Offset(IndexBuffers, s_backspacelimit__)
X#if !OPT_MAJORMODE
X#define VAL_C_SWIDTH `09Member_Offset(IndexBuffers, s_c_shiftwidth__)
X#define VAL_C_TAB `09Member_Offset(IndexBuffers, s_c_tabstop__)
X#endif
X#if !SMALLER
X#define MDCHK_MODTIME `09Member_Offset(IndexBuffers, s_check_modtime__)
X#endif
X#if !OPT_MAJORMODE
X#define MDCMOD `09`09Member_Offset(IndexBuffers, s_cmode__)
X#endif
X#define VAL_CMT_PREFIX  Member_Offset(IndexBuffers, s_comment_prefix__)
X#define VAL_COMMENTS `09Member_Offset(IndexBuffers, s_comments__)
X#if OPT_ENCRYPT
X#define MDCRYPT `09Member_Offset(IndexBuffers, s_crypt__)
X#endif
X#define MDDOS `09`09Member_Offset(IndexBuffers, s_dos__)
X#define VAL_FENCE_BEGIN  Member_Offset(IndexBuffers, s_fence_begin__)
X#define VAL_FENCE_ELIF  Member_Offset(IndexBuffers, s_fence_elif__)
X#define VAL_FENCE_ELSE  Member_Offset(IndexBuffers, s_fence_else__)
X#define VAL_FENCE_END `09Member_Offset(IndexBuffers, s_fence_end__)
X#define VAL_FENCE_FI `09Member_Offset(IndexBuffers, s_fence_fi__)
X#define VAL_FENCE_IF `09Member_Offset(IndexBuffers, s_fence_if__)
X#define VAL_FENCES `09Member_Offset(IndexBuffers, s_fence_pairs__)
X#define VAL_FILL `09Member_Offset(IndexBuffers, s_fillcol__)
X#define MDIGNCASE `09Member_Offset(IndexBuffers, s_ignorecase__)
X#if OPT_LCKFILES
X#define MDLOCKED `09Member_Offset(IndexBuffers, s_locked__)
X#define VAL_LOCKER `09Member_Offset(IndexBuffers, s_locker__)
X#endif
X#define MDMAGIC `09Member_Offset(IndexBuffers, s_magic__)
X#define MDMETAINSBIND `09Member_Offset(IndexBuffers, s_meta_insert_bindings__)
V
X#define MDNEWLINE `09Member_Offset(IndexBuffers, s_newline__)
X#define VAL_PARAGRAPHS  Member_Offset(IndexBuffers, s_paragraphs__)
X#define MDREADONLY `09Member_Offset(IndexBuffers, s_readonly__)
X#define VAL_SECTIONS `09Member_Offset(IndexBuffers, s_sections__)
X#define VAL_SENTENCES `09Member_Offset(IndexBuffers, s_sentences__)
X#define VAL_SWIDTH `09Member_Offset(IndexBuffers, s_shiftwidth__)
X#define MDSHOWMAT `09Member_Offset(IndexBuffers, s_showmatch__)
+-+-+-+-+-+-+-+-  END  OF PART 82 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 83 -+-+-+-+-+-+-+-+
X#define MDSHOWMODE `09Member_Offset(IndexBuffers, s_showmode__)
X#define MDTABINSERT `09Member_Offset(IndexBuffers, s_tabinsert__)
X#define VAL_TAB `09Member_Offset(IndexBuffers, s_tabstop__)
X#if !SMALLER
X#define MDTAGIGNORECASE  Member_Offset(IndexBuffers, s_tagignorecase__)
X#endif
X#define VAL_TAGLEN `09Member_Offset(IndexBuffers, s_taglength__)
X#define MDTAGSRELTIV `09Member_Offset(IndexBuffers, s_tagrelative__)
X#define VAL_TAGS `09Member_Offset(IndexBuffers, s_tags__)
X#define MDTAGWORD `09Member_Offset(IndexBuffers, s_tagword__)
X#define MDTERSE `09Member_Offset(IndexBuffers, s_terse__)
X#define VAL_UNDOLIM `09Member_Offset(IndexBuffers, s_undolimit__)
X#define MDVIEW `09`09Member_Offset(IndexBuffers, s_view__)
X#if OPT_HILITEMATCH
X#define VAL_HILITEMATCH  Member_Offset(IndexBuffers, s_visual_matches__)
X#endif
X#define VAL_WRAPMARGIN  Member_Offset(IndexBuffers, s_wrapmargin__)
X#define MDSWRAP `09Member_Offset(IndexBuffers, s_wrapscan__)
X#define MDWRAP `09`09Member_Offset(IndexBuffers, s_wrapwords__)
X
X#define NUM_B_VALUES`09Member_Offset(IndexBuffers, s_MAX) /* TABLESIZE(b_valna
Vmes) -- \2C07 */
X#define MAX_B_VALUES`0949
X
X
Xtypedef struct B_VALUES `7B
X`09/* each entry is a val, and a ptr to\1406 */
X`09struct VAL bv`5BMAX_B_VALUES+1`5D;
X`7D B_VALUES;
X
X#ifdef realdef
XEXTERN_CONST struct VALNAMES b_valnames`5B`5D = `7B
X#if OPT_UPBUFF
X`09`7B s_noanimated__+2,`09"X",`09`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#endif
X`09`7B s_noautoindent__+2,`09s_noai\0C06VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X`09`7B s_noautosave__+2,`09s_noas__+2,`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X`09`7B s_autosavecnt__,`09s_as\0B07VALTYPE_INT,`09(ChgdFunc)0 `7D,
X`09`7B s_noautowrite__+2,`09s_noaw\0C06VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X`09`7B s_nobackspacelimit__+2,\1806l__+2,`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#if !OPT_MAJORMODE
X`09`7B s_c_shiftwidth__,`09s_csw__,`09VALTYPE_INT,`09(ChgdFunc)0 `7D,
X`09`7B s_c_tabstop__,`09s_cts__,`09VALTYPE_INT,`09chgd_major_w `7D,
X#endif
X#if !SMALLER
X`09`7B s_nocheck_modtime__+2, "X",`09`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#endif
X#if !OPT_MAJORMODE
X`09`7B s_nocmode__+2,`09"X",`09`09VALTYPE_BOOL,`09chgd_major_w `7D,
X#endif
X`09`7B s_comment_prefix__,`09"X",`09`09VALTYPE_REGEX,`09(ChgdFunc)0 `7D,
X`09`7B s_comments__,`09`09"X",&0209VALTYPE_REGEX,`09(ChgdFunc)0 `7D,
X#if OPT_ENCRYPT
X`09`7B s_nocrypt__+2,`09"X",`09`09VALTYPE_BOOL,`09chgd_major `7D,
X#endif
X`09`7B s_nodos__+2,`09`09"X",&0209VALTYPE_BOOL,`09chgd_major_w `7D,
X`09`7B s_fence_begin__,`09"X",`09`09VALTYPE_REGEX,`09(ChgdFunc)0 `7D,
X`09`7B s_fence_elif__,`09"X",`09`09VALTYPE_REGEX,`09(ChgdFunc)0 `7D,
X`09`7B s_fence_else__,`09"X",`09`09VALTYPE_REGEX,`09(ChgdFunc)0 `7D,
X`09`7B s_fence_end__,`09"X",`09`09VALTYPE_REGEX,`09(ChgdFunc)0 `7D,
X`09`7B s_fence_fi__,`09`09"X",&0209VALTYPE_REGEX,`09(ChgdFunc)0 `7D,
X`09`7B s_fence_if__,`09`09"X",&0209VALTYPE_REGEX,`09(ChgdFunc)0 `7D,
X`09`7B s_fence_pairs__,`09"X",`09`09VALTYPE_STRING, chgd\2A06s `7D,
X`09`7B s_fillcol__,`09`09s_fc__,&0209VALTYPE_INT,`09(ChgdFunc)0 `7D,
X`09`7B s_noignorecase__+2,`09s_noic\0C06VALTYPE_BOOL,`09chgd_hilite `7D,
X#if OPT_LCKFILES
X`09`7B s_nolocked__+2,`09"X",`09`09VALTYPE_BOOL,`09chgd_disabled `7D,
X`09`7B s_locker__,`09`09"X",&0209VALTYPE_STRING, chgd_disabled `7D,
X#endif
X`09`7B s_nomagic__+2,`09"X",`09`09VALTYPE_BOOL,`09chgd_hilite `7D,
X`09`7B s_nometa_insert_bindings__+2,\1E06ib\0D06VALTYPE_BOOL, (ChgdFunc)0 `7D,
V
X`09`7B s_nonewline__+2,`09s_nonl\0C06VALTYPE_BOOL,`09chgd_buffer `7D,
X`09`7B s_paragraphs__,`09"X",`09`09VALTYPE_REGEX,`09(ChgdFunc)0 `7D,
X`09`7B s_noreadonly__+2,`09s_noro\0C06VALTYPE_BOOL,`09chgd_major `7D,
X`09`7B s_sections__,`09`09"X",&0209VALTYPE_REGEX,`09(ChgdFunc)0 `7D,
X`09`7B s_sentences__,`09"X",`09`09VALTYPE_REGEX,`09(ChgdFunc)0 `7D,
X`09`7B s_shiftwidth__,`09s_sw__,`09`09VALTYPE_INT,`09(ChgdFunc)0 `7D,
X`09`7B s_noshowmatch__+2,`09s_nosm\0C06VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X`09`7B s_noshowmode__+2,`09s_nosmd\0D06VALTYPE_BOOL,`09chgd_major `7D,
X`09`7B s_notabinsert__+2,`09s_noti\0C06VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X`09`7B s_tabstop__,`09`09s_ts__,&0209VALTYPE_INT,`09chgd_major_w `7D,
X#if !SMALLER
X`09`7B s_notagignorecase__+2,\1706c__+2,`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#endif
X`09`7B s_taglength__,`09s_tl__,`09`09VALTYPE_INT,`09(ChgdFunc)0 `7D,
X`09`7B s_notagrelative__+2,`09s_notr\0C06VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X`09`7B s_tags__,`09`09"X",&0209VALTYPE_STRING, (ChgdFunc)0 `7D,
X`09`7B s_notagword__+2,`09s_notw\0C06VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X`09`7B s_noterse__+2,`09"X",`09`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X`09`7B s_undolimit__,`09s_ul__,`09`09VALTYPE_INT,`09(ChgdFunc)0 `7D,
X`09`7B s_noview__+2,`09`09"X",&0209VALTYPE_BOOL,`09chgd_major `7D,
X#if OPT_HILITEMATCH
X`09`7B s_visual_matches__,`09"X",`09`09VALTYPE_ENUM,`09chgd_hilite `7D,
X#endif
X`09`7B s_wrapmargin__,`09s_wm__,`09`09VALTYPE_INT,`09(ChgdFunc)0 `7D,
X`09`7B s_nowrapscan__+2,`09s_nows__+2,`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X`09`7B s_nowrapwords__+2,`09s_noww\0C06VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X
X`09`7B NULL,`09\0606VALTYPE_INT, 0 `7D
X`7D;
X#else
Xextern const struct VALNAMES b_valnames`5B`5D;
X#endif
X
X/* these are the boolean, integer, and pointer value'd settings that are
X`09associated with a window, and usually settable by a user.  There
X`09is a global set that is inherited into a buffer, and its windows
X`09in turn are inherit the buffer's set. */
Xtypedef`09struct`09`7B
X`09char`09s_horizscroll__; /* \0D06 whole screen */
X#if OPT_LINEWRAP
X`09char`09s_linewrap__;`09/* wrap lines wider than screen */
X#endif
X`09char`09s_list__;`09/* "list" mode -- show tabs and EOL */
X`09char`09s_number__;`09/* line-\1206s shown */
X#if !SMALLER
X`09char`09s_ruler__;`09/* display line+col in modeline */
X#endif
X`09char`09s_sideways__;`09/* \0F08 offset for display */
X#if OPT_SELECTIONS
X`09char`09s_terse_selections__; /* don't display extent of \290A on message li
Vne */
X#endif
X`09char`09s_unprintable_as_octal__; /* print non-printing chars in octal */
X`09char`09s_MAX;
X`09char`09Q1;
X`09`7D IndexWindows;
X
X#define WMDHORSCROLL `09Member_Offset(IndexWindows, s_horizscroll__)
X#if OPT_LINEWRAP
X#define WMDLINEWRAP `09Member_Offset(IndexWindows, s_linewrap__)
X#endif
X#define WMDLIST `09Member_Offset(IndexWindows, s_list__)
X#define WMDNUMBER `09Member_Offset(IndexWindows, s_number__)
X#if !SMALLER
X#define WMDRULER `09Member_Offset(IndexWindows, s_ruler__)
X#endif
X#define WVAL_SIDEWAYS `09Member_Offset(IndexWindows, s_sideways__)
X#if OPT_SELECTIONS
X#define WMDTERSELECT `09Member_Offset(IndexWindows, s_terse_selections__)
X#endif
X#define WMDNONPRINTOCTAL  Member_Offset(IndexWindows, s_unprintable_as_octal__
V)
X
X#define NUM_W_VALUES`09Member_Offset(IndexWindows, s_MAX) /* TABLESIZE(w_valna
Vmes) -- \2C07 */
X#define MAX_W_VALUES`098
X
X
Xtypedef struct W_VALUES `7B
X`09/* each entry is a val, and a ptr to\1406 */
X`09struct VAL wv`5BMAX_W_VALUES+1`5D;
X`7D W_VALUES;
X
X#ifdef realdef
XEXTERN_CONST struct VALNAMES w_valnames`5B`5D = `7B
X`09`7B s_nohorizscroll__+2,`09s_nohs__+2,`09VALTYPE_BOOL,`09(ChgdFunc)0 `7D,
X#if OPT_LINEWRAP
X`09`7B s_nolinewrap__+2,`09s_nolw\0C06VALTYPE_BOOL,`09chgd_window `7D,
X#endif
X`09`7B s_nolist__+2,`09`09\0F06\0D06VALTYPE_BOOL,`09chgd_window `7D,
X`09`7B s_nonumber__+2,`09\1006\0C06VALTYPE_BOOL,`09chgd_window `7D,
X#if !SMALLER
X`09`7B s_noruler__+2,`09"X",`09`09VALTYPE_BOOL,`09chgd_status `7D,
X#endif
X`09`7B s_sideways__,`09`09\0F06__,`09VALTYPE_INT,`09chgd_window `7D,
X#if OPT_SELECTIONS
X`09`7B s_noterse_selections__+2,\1A06sel\0E06VALTYPE_BOOL, (ChgdFunc)0 `7D,
X#endif
X`09`7B s_nounprintable_as_octal__+2,\1E06o\0C06VALTYPE_BOOL, chgd_window `7D,
V
X
X`09`7B NULL,`09\0606VALTYPE_INT, 0 `7D
X`7D;
X#else
Xextern const struct VALNAMES w_valnames`5B`5D;
X#endif
$ call unpack [.VILE-8_0]NEMODE.H;4 -
 1462276510 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 100 83 152
$!
$ create 'f'
X/* nename.h: this header file was produced automatically by
X * the dsa10:`5Bcompcent.`5D`5Budaa055.temp.vile-8_0`5Dmktbls.exe;1 program, b
Vased on input from the file cmdtbl
X */
X
X/* if you maintain this by hand, keep it in */
X/* alphabetical order!!!! */
X
XEXTERN_CONST NTAB nametbl`5B`5D = `7B
X#if (OPT_SHELL)
X`09`7B "!",`09`09&0209`26f_operfilter `7D,
X`09`7B "!!",`09`09&0209`26f_respawn `7D,
X#endif
X`09`7B "`26",`09`09&0209`26f_opersubstagain `7D,
X`09`7B "*",`09`09&0209`26f_togglelistbuffers `7D,
X`09`7B ":",`09`09&0209`26f_namedcmd `7D,
X`09`7B "<",`09`09&0209`26f_operlshift `7D,
X`09`7B "=",`09`09&0209`26f_showlength `7D,
X`09`7B ">",`09`09&0209`26f_operrshift `7D,
X`09`7B "E",`09`09&0209`26f_filefind `7D,
X`09`7B "L",`09`09&0209`26f_operlower `7D,
X`09`7B "Put",`09`09`09`26f_lineputbefore `7D,
X`09`7B "Q",`09`09&0209`26f_quit `7D,
X`09`7B "Q!",`09`09&0209`26f_quithard `7D,
X`09`7B "U",`09`09&0209`26f_operupper `7D,
X`09`7B "W",`09`09&0209`26f_operwrite `7D,
X`09`7B "WQ",`09`09&0209`26f_writequit `7D,
X`09`7B "Wq",`09`09&0209`26f_writequit `7D,
X`09`7B "_",`09`09&0209`26f_histbuff `7D,
X`09`7B "a",`09`09&0209`26f_opendown `7D,
X`09`7B "abbreviate",`09`09`09`26f_\1206 `7D,
X#if (!FEWNAMES)
X`09`7B "abort-command",`09`09`26f_esc_func `7D,
X`09`7B "alternate-buffer",`09`09`26f_altbuff `7D,
X`09`7B "append-chars",`09`09`26f_\1306 `7D,
X`09`7B "append-chars-at-eol",`09`26f_\1906eol `7D,
X#endif
X#if (!SMALLER)
X`09`7B "append-string",`09`09`26f_app\1006 `7D,
X#endif
X#if (OPT_REBIND)
X`09`7B "apropos",`09`09`09`26f_desapro `7D,
X#endif
X`09`7B "args",`09`09`09`26f_listbuffers `7D,
X#if (OPT_SELECTIONS) `26 (!FEWNAMES)
X`09`7B "attribute-bold-til",`09`09`26f_operattrbold `7D,
X`09`7B "attribute-cntl_a-sequences-til", `26f_operattrcaseq `7D,
X#endif
X#if (OPT_HYPERTEXT) `26 (!FEWNAMES)
X`09`7B "attribute-hypertext-til",`09`26f_operattrhc `7D,
X#endif
X#if (OPT_SELECTIONS) `26 (!FEWNAMES)
X`09`7B "attribute-italic-til",`09`26f_operattrital `7D,
X`09`7B "attribute-normal-til",`09`26f_operattrno `7D,
X`09`7B "attribute-reverse-til",`09`26f_operattrrev `7D,
X`09`7B "attribute-underline-til",`09`26f_operattrul `7D,
X#endif
X`09`7B "b",`09`09&0209`26f_usebuffer `7D,
X#if (!FEWNAMES)
X`09`7B "back-half-page",`09`09`26f_backhpage `7D,
X`09`7B "back-line",`09`09`09`26f_backline `7D,
X`09`7B "back-line-at-bol",`09`09`26f_backbline `7D,
X`09`7B "back-page",`09`09`09`26f_backpage `7D,
X`09`7B "back-paragraph",`09`09`26f_gotobop `7D,
X`09`7B "back-punctuated-word",`09`26f_backviword `7D,
X`09`7B "back-section",`09`09`26f_gotobosec `7D,
X`09`7B "back-sentence",`09`09`26f_gotobosent `7D,
X`09`7B "back-word",`09`09`09`26f_backword `7D,
X`09`7B "backward-char-scan",`09`09`26f_bcsrch `7D,
X`09`7B "backward-char-scan-to",`09`26f_bcsrch_to `7D,
X`09`7B "backward-character",`09`09`26f_backchar `7D,
X`09`7B "backward-character-to-bol",`09`26f_backchar_to_bol `7D,
X#endif
X#if (!SMALLER)
X`09`7B "beep",`09`09`09`26f_userbeep `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "begin-keyboard-macro",`09`26f_kbd_mac_begin `7D,
X#endif
X#if (!SMALLER) `26 (!FEWNAMES)
X`09`7B "beginning-of-file",`09`09`26f_gotobob `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "beginning-of-line",`09`09`26f_gotobol `7D,
X`09`7B "beginning-of-screen",`09`26f_gotobos `7D,
X#endif
X#if (OPT_REBIND)
X`09`7B "bind-key",`09`09`09`26f_bindkey `7D,
X#endif
X#if (OPT_AEDIT)
X`09`7B "blank",`09`09`09`26f_operblank `7D,
X`09`7B "blank-region",`09`09`26f_operblank `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "bol",`09`09`09`26f_gotobol `7D,
X#endif
X`09`7B "buffer",`09`09`09`26f_use\1106 `7D,
X#if (!FEWNAMES)
X`09`7B "buffer-length",`09`09`26f_show\1106 `7D,
X#endif
X`09`7B "c",`09`09&0209`26f_opercopy `7D,
X#if (OPT_SHELL) `26 (!FEWNAMES)
X`09`7B "capture-command",`09`09`26f_pipecmd `7D,
X#endif
X#if (OPT_SHELL)
X`09`7B "cd",`09`09&0209`26f_cd `7D,
X#endif
X`09`7B "ch",`09`09&0209`26f_operlinechg `7D,
X#if (!FEWNAMES)
X`09`7B "change-char",`09`09`26f_chgchar `7D,
X#endif
X#if (OPT_SHELL)
X`09`7B "change-directory",`09`09`26f_cd `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "change-file-name",`09`09`26f_filename `7D,
X`09`7B "change-line",`09`09`26f_chgline `7D,
X`09`7B "change-lines-til",`09`09`26f_operlinechg `7D,
X`09`7B "change-til",`09`09`09`26f_operchg `7D,
X`09`7B "change-to-eol",`09`09`26f_chgtoeol `7D,
X`09`7B "clear-and-redraw",`09`09`26f_vile_refresh `7D,
X`09`7B "clear-message-line",`09`09`26f_clrmes `7D,
X#endif
X#if (OPT_HILITEMATCH)
X`09`7B "clear-visual-matches",`09`26f_clear_match_attrs `7D,
X#endif
X`09`7B "cntl_a-prefix",`09`09`26f_\1406_func `7D,
X`09`7B "cntl_x-prefix",`09`09`26f_\1406_func `7D,
X#if (OPT_FINDERR)
X`09`7B "compile-error-expressions",`09`26f_comp_err_exps `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "continue-search",`09`09`26f_con\1006 `7D,
X#endif
X`09`7B "copy-til",`09`09`09`26f_opercopy `7D,
X#if (SYS_WINNT)
X`09`7B "copy-to-clipboard",`09`09`26f_opercbrdcpy `7D,
X#endif
X#if (DISP_X11)
X`09`7B "copy-to-clipboard",`09`09`26f_copy_to_c\1808 `7D,
X#endif
X#if (SYS_WINNT)
X`09`7B "copy-unnamed-reg-to-clipboard", `26f_cbrdcpy_\2607 `7D,
X#endif
X#if (OPT_WORDCOUNT)
X`09`7B "count-words",`09`09`26f_wordcount `7D,
X#endif
X#if (OPT_ENCRYPT)
X`09`7B "crypt-til",`09`09`09`26f_opercrypt `7D,
X#endif
X`09`7B "d",`09`09&0209`26f_operlinedel `7D,
X#if (OPT_MAJORMODE)
X`09`7B "define-majormode",`09`09`26f_\1706_mode `7D,
X`09`7B "define-mode",`09`09`26f_\1206_mode `7D,
X`09`7B "define-submode",`09`09`26f_\1506_\1507 `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "delete-and-insert-chars-til", `26f_operchg `7D,
X#endif
X#if (OPT_AEDIT) `26 (!FEWNAMES)
X`09`7B "delete-blank-lines",`09`09`26f_forceblank `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "delete-buffer",`09`09`26f_kill\1106 `7D,
X`09`7B "delete-char-and-insert-chars", `26f_chgchar `7D,
X`09`7B "delete-global-mode",`09`09`26f_delglobmode `7D,
X`09`7B "delete-line-and-insert-chars", `26f_chgline `7D,
X`09`7B "delete-lines-and-insert-chars-til", `26f_operlinechg `7D,
X`09`7B "delete-lines-til",`09`09`26f_operlinedel `7D,
X`09`7B "delete-mode",`09`09`26f_dellocmode `7D,
X`09`7B "delete-next-character",`09`26f_forwdelchar `7D,
X`09`7B "delete-other-windows",`09`26f_onlywind `7D,
X`09`7B "delete-previous-character",`09`26f_backdelchar `7D,
X`09`7B "delete-til",`09`09`09`26f_operdel `7D,
X`09`7B "delete-to-eol",`09`09`26f_deltoeol `7D,
X`09`7B "delete-to-eol-and-insert-chars", `26f_chgtoeol `7D,
X`09`7B "delete-window",`09`09`26f_delwind `7D,
X#endif
X#if (OPT_REBIND)
X`09`7B "describe-bindings",`09`09`26f_desbind `7D,
X`09`7B "describe-function",`09`09`26f_desfunc `7D,
X`09`7B "describe-key",`09`09`26f_deskey `7D,
X`09`7B "describe-motions",`09`09`26f_des\1107 `7D,
X`09`7B "describe-operators",`09`09`26f_desopers `7D,
X#endif
X#if (OPT_AEDIT) `26 (!FEWNAMES)
X`09`7B "detab-lines-til",`09`09`26f_operdetab `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "do-nothing",`09`09`09`26f_nullproc `7D,
X`09`7B "down-arrow",`09`09`09`26f_forwline `7D,
X`09`7B "down-half-page",`09`09`26f_forwhpage `7D,
X`09`7B "down-line",`09`09`09`26f_forwline `7D,
X`09`7B "down-line-at-bol",`09`09`26f_forwbline `7D,
X`09`7B "down-page",`09`09`09`26f_forwpage `7D,
X`09`7B "down-paragraph",`09`09`26f_gotoeop `7D,
X`09`7B "down-section",`09`09`26f_gotoeosec `7D,
X`09`7B "down-sentence",`09`09`26f_gotoeosent `7D,
X#endif
X`09`7B "e",`09`09&0209`26f_filefind `7D,
X`09`7B "e!",`09`09&0209`26f_fileread `7D,
X#if (!FEWNAMES)
X`09`7B "edit-file",`09`09`09`26f_filefind `7D,
X`09`7B "end-keyboard-macro",`09`09`26f_kbd_mac_end `7D,
X#endif
X#if (!SMALLER) `26 (!FEWNAMES)
X`09`7B "end-of-file",`09`09`26f_gotoeob `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "end-of-line",`09`09`26f_gotoeol `7D,
X`09`7B "end-of-screen",`09`09`26f_gotoeos `7D,
X#endif
X#if (OPT_AEDIT) `26 (!FEWNAMES)
X`09`7B "entab-lines-til",`09`09`26f_operentab `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "eol",`09`09`09`26f_gotoeol `7D,
X#endif
X#if (OPT_FINDERR)
X`09`7B "error-buffer",`09`09`26f_finderrbuf `7D,
X#endif
X`09`7B "ex",`09`09&0209`26f_ex `7D,
X#if (!SMALLER) `26 (!FEWNAMES)
X`09`7B "execute-buffer",`09`09`26f_execbuf `7D,
X`09`7B "execute-file",`09`09`26f_execfile `7D,
X#endif
X#if (OPT_HYPERTEXT) `26 (!FEWNAMES)
X`09`7B "execute-hypertext-command",`09`26f_exechypercmd `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "execute-keyboard-macro",`09`26f_kbd_mac_exec `7D,
X#endif
X#if (OPT_EXEC_MACROS>0) `26 (!FEWNAMES)
X`09`7B "execute-macro-1",`09`09`26f_cbuf1 `7D,
X#endif
X#if (OPT_EXEC_MACROS>9) `26 (!FEWNAMES)
X`09`7B "execute-macro-10",`09`09`26f_cbuf10 `7D,
X#endif
X#if (OPT_EXEC_MACROS>10) `26 (!FEWNAMES)
X`09`7B "execute-macro-11",`09`09`26f_cbuf11 `7D,
X#endif
X#if (OPT_EXEC_MACROS>11) `26 (!FEWNAMES)
X`09`7B "execute-macro-12",`09`09`26f_cbuf12 `7D,
X#endif
X#if (OPT_EXEC_MACROS>12) `26 (!FEWNAMES)
X`09`7B "execute-macro-13",`09`09`26f_cbuf13 `7D,
X#endif
X#if (OPT_EXEC_MACROS>13) `26 (!FEWNAMES)
X`09`7B "execute-macro-14",`09`09`26f_cbuf14 `7D,
X#endif
X#if (OPT_EXEC_MACROS>14) `26 (!FEWNAMES)
X`09`7B "execute-macro-15",`09`09`26f_cbuf15 `7D,
X#endif
X#if (OPT_EXEC_MACROS>15) `26 (!FEWNAMES)
X`09`7B "execute-macro-16",`09`09`26f_cbuf16 `7D,
X#endif
X#if (OPT_EXEC_MACROS>16) `26 (!FEWNAMES)
X`09`7B "execute-macro-17",`09`09`26f_cbuf17 `7D,
X#endif
X#if (OPT_EXEC_MACROS>17) `26 (!FEWNAMES)
X`09`7B "execute-macro-18",`09`09`26f_cbuf18 `7D,
X#endif
X#if (OPT_EXEC_MACROS>18) `26 (!FEWNAMES)
X`09`7B "execute-macro-19",`09`09`26f_cbuf19 `7D,
X#endif
X#if (OPT_EXEC_MACROS>1) `26 (!FEWNAMES)
X`09`7B "execute-macro-2",`09`09`26f_cbuf2 `7D,
X#endif
X#if (OPT_EXEC_MACROS>19) `26 (!FEWNAMES)
X`09`7B "execute-macro-20",`09`09`26f_cbuf20 `7D,
X#endif
X#if (OPT_EXEC_MACROS>20) `26 (!FEWNAMES)
X`09`7B "execute-macro-21",`09`09`26f_cbuf21 `7D,
X#endif
X#if (OPT_EXEC_MACROS>21) `26 (!FEWNAMES)
X`09`7B "execute-macro-22",`09`09`26f_cbuf22 `7D,
X#endif
X#if (OPT_EXEC_MACROS>22) `26 (!FEWNAMES)
X`09`7B "execute-macro-23",`09`09`26f_cbuf23 `7D,
X#endif
X#if (OPT_EXEC_MACROS>23) `26 (!FEWNAMES)
X`09`7B "execute-macro-24",`09`09`26f_cbuf24 `7D,
X#endif
X#if (OPT_EXEC_MACROS>24) `26 (!FEWNAMES)
X`09`7B "execute-macro-25",`09`09`26f_cbuf25 `7D,
X#endif
X#if (OPT_EXEC_MACROS>25) `26 (!FEWNAMES)
X`09`7B "execute-macro-26",`09`09`26f_cbuf26 `7D,
X#endif
X#if (OPT_EXEC_MACROS>26) `26 (!FEWNAMES)
X`09`7B "execute-macro-27",`09`09`26f_cbuf27 `7D,
X#endif
X#if (OPT_EXEC_MACROS>27) `26 (!FEWNAMES)
X`09`7B "execute-macro-28",`09`09`26f_cbuf28 `7D,
X#endif
X#if (OPT_EXEC_MACROS>28) `26 (!FEWNAMES)
X`09`7B "execute-macro-29",`09`09`26f_cbuf29 `7D,
X#endif
X#if (OPT_EXEC_MACROS>2) `26 (!FEWNAMES)
X`09`7B "execute-macro-3",`09`09`26f_cbuf3 `7D,
X#endif
X#if (OPT_EXEC_MACROS>29) `26 (!FEWNAMES)
X`09`7B "execute-macro-30",`09`09`26f_cbuf30 `7D,
X#endif
X#if (OPT_EXEC_MACROS>30) `26 (!FEWNAMES)
X`09`7B "execute-macro-31",`09`09`26f_cbuf31 `7D,
X#endif
X#if (OPT_EXEC_MACROS>31) `26 (!FEWNAMES)
X`09`7B "execute-macro-32",`09`09`26f_cbuf32 `7D,
X#endif
X#if ((OPT_EXEC_MACROS>32`26`26(!SYS_WINNT))) `26 (!FEWNAMES)
X`09`7B "execute-macro-33",`09`09`26f_cbuf33 `7D,
X#endif
X#if ((OPT_EXEC_MACROS>33`26`26(!SYS_WINNT))) `26 (!FEWNAMES)
X`09`7B "execute-macro-34",`09`09`26f_cbuf34 `7D,
X#endif
X#if ((OPT_EXEC_MACROS>34`26`26(!SYS_WINNT))) `26 (!FEWNAMES)
X`09`7B "execute-macro-35",`09`09`26f_cbuf35 `7D,
X#endif
X#if (OPT_EXEC_MACROS>35) `26 (!FEWNAMES)
X`09`7B "execute-macro-36",`09`09`26f_cbuf36 `7D,
X#endif
X#if (OPT_EXEC_MACROS>36) `26 (!FEWNAMES)
X`09`7B "execute-macro-37",`09`09`26f_cbuf37 `7D,
X#endif
X#if (OPT_EXEC_MACROS>37) `26 (!FEWNAMES)
X`09`7B "execute-macro-38",`09`09`26f_cbuf38 `7D,
X#endif
X#if (OPT_EXEC_MACROS>38) `26 (!FEWNAMES)
X`09`7B "execute-macro-39",`09`09`26f_cbuf39 `7D,
X#endif
X#if (OPT_EXEC_MACROS>3) `26 (!FEWNAMES)
X`09`7B "execute-macro-4",`09`09`26f_cbuf4 `7D,
X#endif
X#if (OPT_EXEC_MACROS>39) `26 (!FEWNAMES)
X`09`7B "execute-macro-40",`09`09`26f_cbuf40 `7D,
X#endif
X#if (OPT_EXEC_MACROS>4) `26 (!FEWNAMES)
X`09`7B "execute-macro-5",`09`09`26f_cbuf5 `7D,
X#endif
X#if (OPT_EXEC_MACROS>5) `26 (!FEWNAMES)
X`09`7B "execute-macro-6",`09`09`26f_cbuf6 `7D,
X#endif
X#if (OPT_EXEC_MACROS>6) `26 (!FEWNAMES)
X`09`7B "execute-macro-7",`09`09`26f_cbuf7 `7D,
X#endif
X#if (OPT_EXEC_MACROS>7) `26 (!FEWNAMES)
X`09`7B "execute-macro-8",`09`09`26f_cbuf8 `7D,
X#endif
X#if (OPT_EXEC_MACROS>8) `26 (!FEWNAMES)
X`09`7B "execute-macro-9",`09`09`26f_cbuf9 `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "execute-named-command",`09`26f_namedcmd `7D,
X#endif
X#if (OPT_PROCEDURES) `26 (!FEWNAMES)
X`09`7B "execute-procedure",`09`09`26f_execproc `7D,
X#endif
X`09`7B "execute-register",`09`09`26f_execkreg `7D,
X`09`7B "exit",`09`09`09`26f_quit `7D,
X`09`7B "exsource",`09`09`09`26f_\0E06 `7D,
X`09`7B "f",`09`09&0209`26f_filename `7D,
X`09`7B "file",`09`09`09`26f_filename `7D,
X`09`7B "filename",`09`09`09`26f_\1008 `7D,
X#if (OPT_SHELL) `26 (!FEWNAMES)
X`09`7B "filter-buffer",`09`09`26f_vile_\1906 `7D,
X`09`7B "filter-til",`09`09`09`26f_oper\1606 `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "find-file",`09`09`09`26f_filefind `7D,
X#endif
X#if (OPT_FINDERR) `26 (!FEWNAMES)
X`09`7B "find-next-error",`09`09`26f_finderr `7D,
X#endif
X#if (OPT_FINDERR)
X`09`7B "find-next-error-buffer-name", `26f_finderrbuf `7D,
X#endif
X#if (OPT_TAGS) `26 (!FEWNAMES)
X`09`7B "find-tag",`09`09`09`26f_gototag `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "first-nonwhite",`09`09`26f_first\1408 `7D,
X`09`7B "flip-character",`09`09`26f_flipchar `7D,
X`09`7B "flip-til",`09`09`09`26f_operflip `7D,
X#endif
X#if (SYS_UNIX)
X`09`7B "flow-control-enable",`09`26f_flow_\1907_\1906 `7D,
X#endif
X#if (OPT_AEDIT) `26 (!FEWNAMES)
X`09`7B "force-blank-lines",`09`09`26f_forceblank `7D,
X#endif
X#if (OPT_FORMAT) `26 (!FEWNAMES)
X`09`7B "format-til",`09`09`09`26f_oper\1606 `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "forward-char-scan",`09`09`26f_fcsrch `7D,
X`09`7B "forward-char-scan-up-to",`09`26f_fcsrch_to `7D,
X`09`7B "forward-character",`09`09`26f_forwchar `7D,
X`09`7B "forward-character-to-eol",`09`26f_forwchar_to_eol `7D,
X`09`7B "forward-half-page",`09`09`26f_forwhpage `7D,
X`09`7B "forward-line",`09`09`26f_forwline `7D,
X`09`7B "forward-line-at-bol",`09`26f_forwbline `7D,
X`09`7B "forward-page",`09`09`26f_forwpage `7D,
X`09`7B "forward-paragraph",`09`09`26f_gotoeop `7D,
X`09`7B "forward-punctuated-word",`09`26f_forwviword `7D,
X`09`7B "forward-punctuated-word-end", `26f_forwviendw `7D,
X`09`7B "forward-section",`09`09`26f_gotoeosec `7D,
X`09`7B "forward-sentence",`09`09`26f_gotoeosent `7D,
X`09`7B "forward-word",`09`09`26f_forwword `7D,
X`09`7B "forward-word-end",`09`09`26f_forwendw `7D,
X#endif
X`09`7B "function-prefix",`09`09`26f_poundc_func `7D,
X`09`7B "g",`09`09&0209`26f_operglobals `7D,
X`09`7B "global",`09`09`09`26f_oper\1206s `7D,
X`09`7B "gmodes",`09`09`09`26f_listmodes `7D,
X#if (!SMALLER) `26 (!FEWNAMES)
X`09`7B "goto-beginning-of-file",`09`26f_gotobob `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "goto-beginning-of-screen",`09`26f_gotobos `7D,
X`09`7B "goto-bol",`09`09`09`26f_gotobol `7D,
X`09`7B "goto-column",`09`09`26f_gotocol `7D,
X#endif
X#if (!SMALLER) `26 (!FEWNAMES)
X`09`7B "goto-end-of-file",`09`09`26f_gotoeob `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "goto-end-of-screen",`09`09`26f_gotoeos `7D,
X`09`7B "goto-eol",`09`09`09`26f_gotoeol `7D,
X`09`7B "goto-line",`09`09`09`26f_gotoline `7D,
X#endif
X#if (OPT_CFENCE) `26 (!FEWNAMES)
X`09`7B "goto-matching-fence",`09`26f_matchfence `7D,
X`09`7B "goto-matching-fence-behind", `26f_matchfenceback `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "goto-middle-of-screen",`09`26f_gotomos `7D,
X`09`7B "goto-named-mark",`09`09`26f_golinenmmark `7D,
X`09`7B "goto-named-mark-exact",`09`26f_goexactnmmark `7D,
X`09`7B "goto-named-mark-rectangular", `26f_gorectnmmark `7D,
X`09`7B "grow-window",`09`09`26f_enlargewind `7D,
X#endif
X`09`7B "h",`09`09&0209`26f_help `7D,
X#if (!FEWNAMES)
X`09`7B "handle-tab",`09`09`09`26f_settab `7D,
X#endif
X`09`7B "help",`09`09`09`26f_help `7D,
X#if (!FEWNAMES)
X`09`7B "historical-buffer",`09`09`26f_histbuff `7D,
X#endif
X#if (!SMALLER)
X`09`7B "hunt-backward",`09`09`26f_backhunt `7D,
X#endif
X#if (!SMALLER) `26 (!FEWNAMES)
X`09`7B "hunt-forward",`09`09`26f_forwhunt `7D,
X#endif
X`09`7B "i",`09`09&0209`26f_openup `7D,
X#if (OPT_ISRCH) `26 (!FEWNAMES)
X`09`7B "incremental-search",`09`09`26f_fi\0F06 `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "insert-chars",`09`09`26f_\1306 `7D,
X`09`7B "insert-chars-at-bol",`09`26f_\1906bol `7D,
X`09`7B "insert-chars-no-autoindent", `26f_\2006_no_a\1706 `7D,
X`09`7B "insert-file",`09`09`26f_insfile `7D,
X#endif
X#if (!SMALLER) `26 (!FEWNAMES)
X`09`7B "insert-space",`09`09`26f_insspace `7D,
X#endif
X#if (!SMALLER)
X`09`7B "insert-string",`09`09`26f_ins\1006 `7D,
X#endif
X#if (OPT_SHELL) `26 (!FEWNAMES)
X`09`7B "interactive-shell",`09`09`26f_spawncli `7D,
X#endif
X`09`7B "inverse-global",`09`09`26f_operv\1206s `7D,
X`09`7B "j",`09`09&0209`26f_operjoin `7D,
X#if (!FEWNAMES)
X`09`7B "join-lines",`09`09`09`26f_joinlines `7D,
X`09`7B "join-lines-til",`09`09`26f_operjoin `7D,
X#endif
X`09`7B "k",`09`09&0209`26f_setnmmark `7D,
X`09`7B "ki",`09`09&0209`26f_killbuffer `7D,
X#if (!FEWNAMES)
X`09`7B "kill-buffer",`09`09`26f_kill\1106 `7D,
X#endif
X`09`7B "l",`09`09&0209`26f_operlist `7D,
X#if (DISP_HP150)
X`09`7B "label-fkey",`09`09`09`26f_fnclabel `7D,
X#endif
X#if (DISP_HP150) `26 (!FEWNAMES)
X`09`7B "label-function-key",`09`09`26f_fnclabel `7D,
X#endif
X#if (!SMALLER) `26 (!FEWNAMES)
X`09`7B "last-nonwhite",`09`09`26f_last\1308 `7D,
X#endif
X`09`7B "left-arrow",`09`09`09`26f_backchar_to_bol `7D,
X#if (!FEWNAMES)
X`09`7B "list-buffers",`09`09`26f_list\1207 `7D,
X#endif
X#if (OPT_REBIND)
X`09`7B "list-commands",`09`09`26f_desbind `7D,
X`09`7B "list-commands-apropos-to",`09`26f_desapro `7D,
X#endif
X`09`7B "list-help",`09`09`09`26f_help `7D,
X#if (!FEWNAMES)
X`09`7B "list-lines-til",`09`09`26f_operlist `7D,
X#endif
X#if (OPT_MAJORMODE) `26 (!FEWNAMES)
X`09`7B "list-majormodes",`09`09`26f_list_\160A `7D,
X#endif
X`09`7B "list-modes",`09`09`09`26f_listmodes `7D,
X#if (OPT_REBIND)
X`09`7B "list-motions",`09`09`26f_des\1107 `7D,
X`09`7B "list-operators",`09`09`26f_desopers `7D,
X#endif
X#if (OPT_SHOW_REGS) `26 (!FEWNAMES)
X`09`7B "list-registers",`09`09`26f_showkreg `7D,
X#endif
X#if (OPT_SHOW_EVAL) `26 (!FEWNAMES)
X`09`7B "list-variables",`09`09`26f_listvars `7D,
X#endif
X`09`7B "load-register",`09`09`26f_loadkreg `7D,
X#if (!FEWNAMES)
X`09`7B "lower-til",`09`09`09`26f_operlower `7D,
X#endif
X`09`7B "m",`09`09&0209`26f_opermove `7D,
X`09`7B "map",`09`09`09`26f_map `7D,
X`09`7B "map!",`09`09`09`26f_map_bang `7D,
X#if (SYS_MSDOS`26`26(CC_TURBO`7C`7CCC_WATCOM&027CCC_DJGPP))
X`09`7B "memory",`09`09`09`26f_show\1206 `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "middle-of-screen",`09`09`26f_gotomos `7D,
X#endif
X`09`7B "modes",`09`09`09`26f_listmodes `7D,
X#if (!FEWNAMES)
X`09`7B "move-next-window-down",`09`26f_mvdnnxtwind `7D,
X`09`7B "move-next-window-up",`09`26f_mvupnxtwind `7D,
X#endif
X`09`7B "move-til",`09`09`09`26f_opermove `7D,
X#if (!FEWNAMES)
X`09`7B "move-window-down",`09`09`26f_mvdnwind `7D,
X`09`7B "move-window-left",`09`09`26f_mvleftwind `7D,
X`09`7B "move-window-right",`09`09`26f_mvrightwind `7D,
X`09`7B "move-window-up",`09`09`26f_mvupwind `7D,
X#endif
X`09`7B "n",`09`09&0209`26f_nextbuffer `7D,
X`09`7B "n!",`09`09&0209`26f_nextbuffer `7D,
X`09`7B "new-process-group",`09`09`26f_new\1707group `7D,
X#if (!SMALLER)
X`09`7B "newline",`09`09`09`26f_\0F07 `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "next-buffer",`09`09`26f_next\1106 `7D,
X`09`7B "next-character",`09`09`26f_forwchar `7D,
X`09`7B "next-character-to-eol",`09`26f_forwchar_to_eol `7D,
X`09`7B "next-half-page",`09`09`26f_forwhpage `7D,
X`09`7B "next-line",`09`09`09`26f_forwline `7D,
X`09`7B "next-line-at-bol",`09`09`26f_forwbline `7D,
X`09`7B "next-page",`09`09`09`26f_forwpage `7D,
X`09`7B "next-paragraph",`09`09`26f_gotoeop `7D,
X`09`7B "next-punctuated-word",`09`26f_forwviword `7D,
X`09`7B "next-punctuated-word-end",`09`26f_forwviendw `7D,
X`09`7B "next-section",`09`09`26f_gotoeosec `7D,
X`09`7B "next-sentence",`09`09`26f_gotoeosent `7D,
X#endif
X#if (OPT_TAGS) `26 (!FEWNAMES)
X`09`7B "next-tag",`09`09`09`26f_nexttag `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "next-window",`09`09`26f_nextwind `7D,
X`09`7B "next-word",`09`09`09`26f_forwword `7D,
X`09`7B "next-word-end",`09`09`26f_forwendw `7D,
X`09`7B "nop",`09`09`09`26f_nullproc `7D,
X#endif
X`09`7B "noremap",`09`09`09`26f_\0F07 `7D,
X`09`7B "noremap!",`09`09`09`26f_\1007_bang `7D,
X#if (NEVER)
X`09`7B "oglobals",`09`09`09`26f_\0F07 `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "open-line-above-and-insert-chars", `26f_openup `7D,
X`09`7B "open-line-above-no-autoindent", `26f_openup_no_a\1706 `7D,
X`09`7B "open-line-below-and-append-chars", `26f_opendown `7D,
X`09`7B "open-line-below-no-autoindent", `26f_opendown_no_a\1906 `7D,
X#endif
X`09`7B "open-rectangle",`09`09`26f_operopenrect `7D,
X#if (!FEWNAMES)
X`09`7B "overwrite-chars",`09`09`26f_\1609chars `7D,
X#endif
X#if (!SMALLER)
X`09`7B "overwrite-string",`09`09`26f_overw\1206 `7D,
X#endif
X#if (NEVER)
X`09`7B "ovglobals",`09`09`09`26f_\1008 `7D,
X#endif
X`09`7B "p",`09`09&0209`26f_operprint `7D,
X#if (SYS_WINNT)
+-+-+-+-+-+-+-+-  END  OF PART 83 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 84 -+-+-+-+-+-+-+-+
X`09`7B "paste-from-clipboard",`09`26f_cbrdpaste `7D,
X#endif
X#if (DISP_X11)
X`09`7B "paste-from-clipboard",`09`26f_paste_from_\1A09 `7D,
X#endif
X#if (OPT_PERL)
X`09`7B "perl",`09`09`09`26f_perl `7D,
X`09`7B "perldo",`09`09`09`26f_\0E06 `7D,
X#endif
X#if (OPT_SHELL) `26 (!FEWNAMES)
X`09`7B "pipe-command",`09`09`26f_pipecmd `7D,
X#endif
X#if (OPT_TAGS)
X`09`7B "pop",`09`09`09`26f_untagpop `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "position",`09`09`09`26f_showcpos `7D,
X`09`7B "position-window",`09`09`26f_poswind `7D,
X#endif
X`09`7B "pp",`09`09&0209`26f_operpprint `7D,
X#if (!FEWNAMES)
X`09`7B "previous-half-page",`09`09`26f_backhpage `7D,
X`09`7B "previous-line",`09`09`26f_backline `7D,
X`09`7B "previous-line-at-bol",`09`26f_backbline `7D,
X`09`7B "previous-page",`09`09`26f_backpage `7D,
X`09`7B "previous-paragraph",`09`09`26f_gotobop `7D,
X`09`7B "previous-punctuated-word",`09`26f_backviword `7D,
X`09`7B "previous-section",`09`09`26f_gotobosec `7D,
X`09`7B "previous-sentence",`09`09`26f_gotobosent `7D,
X`09`7B "previous-window",`09`09`26f_prevwind `7D,
X`09`7B "previous-word",`09`09`26f_backword `7D,
X#endif
X#if (OPT_SHELL)
X`09`7B "print-directory",`09`09`26f_pwd `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "print-lines-til",`09`09`26f_operprint `7D,
X`09`7B "print-prefixed-lines-til",`09`26f_operpprint `7D,
X#endif
X`09`7B "put",`09`09`09`26f_lineputafter `7D,
X#if (!FEWNAMES)
X`09`7B "put-after",`09`09`09`26f_putafter `7D,
X`09`7B "put-as-lines-after",`09`09`26f_lineputafter `7D,
X`09`7B "put-as-lines-before",`09`26f_lineput\1306 `7D,
X`09`7B "put-as-rectangle-after",`09`26f_rectputafter `7D,
X`09`7B "put-as-rectangle-before",`09`26f_rectput\1306 `7D,
X`09`7B "put-before",`09`09`09`26f_put\1106 `7D,
X#endif
X#if (OPT_SHELL)
X`09`7B "pwd",`09`09`09`26f_pwd `7D,
X#endif
X`09`7B "q",`09`09&0209`26f_quit `7D,
X`09`7B "q!",`09`09&0209`26f_quithard `7D,
X#if (!FEWNAMES)
X`09`7B "quick-exit",`09`09`09`26f_quickexit `7D,
X#endif
X`09`7B "quit",`09`09`09`26f_quit `7D,
X`09`7B "quit-without-save",`09`09`26f_quithard `7D,
X#if (!FEWNAMES)
X`09`7B "quote-next-character",`09`26f_quote `7D,
X#endif
X#if (OPT_SELECTIONS) `26 (!FEWNAMES)
X`09`7B "quoted-fullline-motion",`09`26f_multi\1106\2008 `7D,
X`09`7B "quoted-motion",`09`09`26f_multi\1206 `7D,
X`09`7B "quoted-rectangular-motion",`09`26f_multi\1106\2307le `7D,
X#endif
X`09`7B "r",`09`09&0209`26f_insfile `7D,
X`09`7B "rPut",`09`09`09`26f_rectputbefore `7D,
X#if (!FEWNAMES)
X`09`7B "read-file",`09`09`09`26f_insfile `7D,
X#endif
X#if (OPT_REBIND)
X`09`7B "rebind-key",`09`09`09`26f_bindkey `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "redo-changes-forward",`09`26f_forwredo `7D,
X#endif
X#if (!SMALLER)
X`09`7B "redraw-display",`09`09`26f_reposition `7D,
X#endif
X#if (OPT_MAJORMODE)
X`09`7B "remove-majormode",`09`09`26f_\1706_mode `7D,
X`09`7B "remove-mode",`09`09`26f_\1206_mode `7D,
X`09`7B "remove-submode",`09`09`26f_\1506_\1507 `7D,
X#endif
X`09`7B "rename-buffer",`09`09`26f_name\1106 `7D,
X#if (!FEWNAMES)
X`09`7B "repeat-char-scan",`09`09`26f_rep_csrch `7D,
X`09`7B "repeat-last-cmd",`09`09`26f_dotcmdplay `7D,
X`09`7B "repeat-undo-change",`09`09`26f_inf_undo `7D,
X`09`7B "replace-character",`09`09`26f_\1807char `7D,
X`09`7B "replace-with-file",`09`09`26f_fileread `7D,
X#endif
X#if (OPT_SHELL) `26 (!FEWNAMES)
X`09`7B "rerun-shell-command",`09`26f_respawn `7D,
X#endif
X#if (!SMALLER)
X`09`7B "resize-window",`09`09`26f_\1406 `7D,
X`09`7B "restore-window",`09`09`26f_restwnd `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "reverse-char-scan",`09`09`26f_rev_csrch `7D,
X#endif
X#if (OPT_ISRCH) `26 (!FEWNAMES)
X`09`7B "reverse-incremental-search", `26f_ri\0E06 `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "reverse-search",`09`09`26f_rev\1006 `7D,
X#endif
X`09`7B "rewind",`09`09`09`26f_firstbuffer `7D,
X`09`7B "right-arrow",`09`09`26f_forwchar_to_eol `7D,
X`09`7B "rput",`09`09`09`26f_rectputafter `7D,
X#if (OPT_PROCEDURES)
X`09`7B "run",`09`09`09`26f_execproc `7D,
X#endif
X`09`7B "s",`09`09&0209`26f_opersubst `7D,
X#if (!SMALLER)
X`09`7B "save-file",`09`09`09`26f_filesave `7D,
X`09`7B "save-file!",`09`09`09`26f_filesave `7D,
X#endif
X`09`7B "save-keyboard-macro",`09`26f_kbd_mac_save `7D,
X#if (!SMALLER)
X`09`7B "save-window",`09`09`26f_savewnd `7D,
X#endif
X`09`7B "screen-columns",`09`09`26f_newwidth `7D,
X`09`7B "screen-rows",`09`09`26f_newlength `7D,
X#if (!FEWNAMES)
X`09`7B "screen-search-forward",`09`26f_scrforw\1B06 `7D,
X`09`7B "screen-search-pattern-grab", `26f_scr\1C06pat `7D,
X`09`7B "screen-search-reverse",`09`26f_scrback\1B06 `7D,
X`09`7B "scroll-next-window-down",`09`26f_scrnextdw `7D,
X`09`7B "scroll-next-window-up",`09`26f_scrnextup `7D,
X#endif
X`09`7B "se",`09`09&0209`26f_setglobmode `7D,
X#if (!FEWNAMES)
X`09`7B "search-forward",`09`09`26f_forw\1906 `7D,
X`09`7B "search-reverse",`09`09`26f_back\1906 `7D,
X`09`7B "select-buffer",`09`09`26f_use\1006 `7D,
X#endif
X#if (OPT_SELECTIONS) `26 (!FEWNAMES)
X`09`7B "select-til",`09`09`09`26f_oper\1606 `7D,
X#endif
X#if (OPT_SELECTIONS)
X`09`7B "selection",`09`09`09`26f_sel_motion `7D,
X#endif
X`09`7B "set",`09`09`09`26f_setglobmode `7D,
X#if (OPT_ENCRYPT)
X`09`7B "set-crypt-key",`09`09`26f_ue_setkey `7D,
X#endif
X#if (OPT_DOSFILES)
X`09`7B "set-dos-mode",`09`09`26f_set_dosmode `7D,
X#endif
X`09`7B "set-fill-column",`09`09`26f_setfillcol `7D,
X`09`7B "set-global-mode",`09`09`26f_setglobmode `7D,
X#if (!FEWNAMES)
X`09`7B "set-mode",`09`09`09`26f_setlocmode `7D,
X`09`7B "set-named-mark",`09`09`26f_setnmmark `7D,
X#endif
X`09`7B "set-tab",`09`09`09`26f_settab `7D,
X#if (OPT_REBIND`26`26OPT_TERMCHRS)
X`09`7B "set-terminal",`09`09`26f_set_termchrs `7D,
X#endif
X#if (OPT_DOSFILES)
X`09`7B "set-unix-mode",`09`09`26f_set_unixmode `7D,
X#endif
X#if (OPT_EVAL)
X`09`7B "set-variable",`09`09`26f_setvar `7D,
X#endif
X`09`7B "setall",`09`09`09`26f_listmodes `7D,
X`09`7B "setg",`09`09`09`26f_setglobmode `7D,
X`09`7B "setgall",`09`09`09`26f_listmodes `7D,
X`09`7B "setgno",`09`09`09`26f_delglobmode `7D,
X`09`7B "setl",`09`09`09`26f_setlocmode `7D,
X`09`7B "setlno",`09`09`09`26f_dellocmode `7D,
X`09`7B "setno",`09`09`09`26f_delglobmode `7D,
X#if (OPT_EVAL)
X`09`7B "setv",`09`09`09`26f_setvar `7D,
X#endif
X#if (OPT_SHELL)
X`09`7B "sh",`09`09&0209`26f_spawncli `7D,
X`09`7B "shell",`09`09`09`26f_spawncli `7D,
X#endif
X#if (OPT_SHELL) `26 (!FEWNAMES)
X`09`7B "shell-command",`09`09`26f_spawn `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "shift-left-til",`09`09`26f_operlshift `7D,
X`09`7B "shift-right-til",`09`09`26f_operrshift `7D,
X#endif
X`09`7B "show-abbreviations",`09`09`26f_\1406 `7D,
X#if (OPT_REBIND)
X`09`7B "show-bindings",`09`09`26f_desbind `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "show-buffers",`09`09`26f_list\1207 `7D,
X#endif
X#if (OPT_REBIND)
X`09`7B "show-commands",`09`09`26f_desbind `7D,
X`09`7B "show-function",`09`09`26f_desfunc `7D,
X#endif
X`09`7B "show-global-modes",`09`09`26f_listmodes `7D,
X`09`7B "show-help",`09`09`09`26f_help `7D,
X#if (OPT_HISTORY)
X`09`7B "show-history",`09`09`26f_show\1207 `7D,
X#endif
X#if (OPT_HYPERTEXT) `26 (!FEWNAMES)
X`09`7B "show-hypertext-command",`09`26f_showhypercmd `7D,
X#endif
X#if (OPT_MAJORMODE)
X`09`7B "show-majormodes",`09`09`26f_list_\160A `7D,
X#endif
X`09`7B "show-mapped!-chars",`09`09`26f_map_bang `7D,
X`09`7B "show-mapped-chars",`09`09`26f_map `7D,
X`09`7B "show-modes",`09`09`09`26f_listmodes `7D,
X#if (OPT_REBIND)
X`09`7B "show-motions",`09`09`26f_des\1107 `7D,
X`09`7B "show-operators",`09`09`26f_desopers `7D,
X#endif
X#if (OPT_SHOW_CTYPE)
X`09`7B "show-printable",`09`09`26f_desprint `7D,
X#endif
X#if (OPT_SHOW_REGS)
X`09`7B "show-registers",`09`09`26f_showkreg `7D,
X#endif
X#if (OPT_SHOW_MAPS)
X`09`7B "show-system-mapped-chars",`09`26f_sysmap `7D,
X#endif
X#if (OPT_SHOW_TAGS)
X`09`7B "show-tagstack",`09`09`26f_show\1308 `7D,
X#endif
X#if (OPT_REBIND`26`26OPT_TERMCHRS)
X`09`7B "show-terminal-chars",`09`26f_show_termchrs `7D,
X#endif
X#if (OPT_SHOW_EVAL)
X`09`7B "show-variables",`09`09`26f_listvars `7D,
X#endif
X`09`7B "showgmodes",`09`09`09`26f_listmodes `7D,
X`09`7B "showmodes",`09`09`09`26f_listmodes `7D,
X#if (OPT_SHOW_REGS) `26 (!FEWNAMES)
X`09`7B "showregisters",`09`09`26f_showkreg `7D,
X#endif
X#if (OPT_SHOW_EVAL) `26 (!FEWNAMES)
X`09`7B "showvars",`09`09`09`26f_listvars `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "shrink-window",`09`09`26f_\1406wind `7D,
X#endif
X#if (!SMALLER)
X`09`7B "source",`09`09`09`26f_execfile `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "split-current-window",`09`26f_splitwind `7D,
X#endif
X#if (OPT_SHELL)
X`09`7B "stop",`09`09`09`26f_bktoshell `7D,
X`09`7B "stop!",`09`09`09`26f_bktoshell `7D,
X#endif
X`09`7B "store-macro",`09`09`26f_storemac `7D,
X#if (OPT_PROCEDURES)
X`09`7B "store-procedure",`09`09`26f_storeproc `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "stuttered-write-all-and-quit", `26f_zzquit `7D,
X`09`7B "substitute-again",`09`09`26f_subst_again `7D,
X`09`7B "substitute-again-til",`09`26f_opersubstagain `7D,
X`09`7B "substitute-til",`09`09`26f_opersubst `7D,
X#endif
X#if (OPT_SHELL)
X`09`7B "suspend",`09`09`09`26f_bktoshell `7D,
X`09`7B "suspend!",`09`09`09`26f_bktoshell `7D,
X#endif
X`09`7B "t",`09`09&0209`26f_opertransf `7D,
X#if (OPT_TAGS)
X`09`7B "ta",`09`09&0209`26f_gototag `7D,
X`09`7B "tag",`09`09`09`26f_gototag `7D,
X#endif
X#if (OPT_TAGS) `26 (!FEWNAMES)
X`09`7B "tag-pop",`09`09`09`26f_untagpop `7D,
X#endif
X#if (OPT_SHOW_TAGS) `26 (!FEWNAMES)
X`09`7B "tags",`09`09`09`26f_showtagstack `7D,
X#endif
X#if (OPT_SHOW_TAGS)
X`09`7B "tagstack",`09`09`09`26f_show\1408 `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "toggle-buffer-list",`09`09`26f_\1906list\1C06s `7D,
X#endif
X`09`7B "transfer-til",`09`09`26f_oper\1706 `7D,
X#if (!SMALLER) `26 (!FEWNAMES)
X`09`7B "transpose-characters",`09`26f_twiddle `7D,
X#endif
X#if (OPT_AEDIT)
X`09`7B "trim",`09`09`09`26f_opertrim `7D,
X#endif
X#if (OPT_AEDIT) `26 (!FEWNAMES)
X`09`7B "trim-lines-til",`09`09`26f_opertrim `7D,
X#endif
X`09`7B "unabbreviate",`09`09`26f_\1306 `7D,
X#if (OPT_REBIND)
X`09`7B "unbind-key",`09`09`09`26f_\1206key `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "undo-change",`09`09`26f_undo `7D,
X`09`7B "undo-changes-backward",`09`26f_backundo `7D,
X`09`7B "undo-line-changes",`09`09`26f_lineundo `7D,
X`09`7B "unimplemented-command",`09`26f_\1B06 `7D,
X`09`7B "universal-argument",`09`09`26f_unarg_func `7D,
X#endif
X`09`7B "unmap",`09`09`09`26f_unmap `7D,
X`09`7B "unmap!",`09`09`09`26f_unmap_bang `7D,
X`09`7B "unmap-system-chars",`09`09`26f_unmap_\1906 `7D,
X`09`7B "unmark-buffer",`09`09`26f_\1406 `7D,
X`09`7B "unset",`09`09`09`26f_delglobmode `7D,
X`09`7B "unsetg",`09`09`09`26f_delglobmode `7D,
X`09`7B "unsetl",`09`09`09`26f_dellocmode `7D,
X#if (!FEWNAMES)
X`09`7B "up-arrow",`09`09`09`26f_backline `7D,
X`09`7B "up-half-page",`09`09`26f_backhpage `7D,
X`09`7B "up-line",`09`09`09`26f_backline `7D,
X`09`7B "up-line-at-bol",`09`09`26f_backbline `7D,
X`09`7B "up-paragraph",`09`09`26f_gotobop `7D,
X`09`7B "up-section",`09`09`09`26f_gotobosec `7D,
X`09`7B "up-sentence",`09`09`26f_gotobosent `7D,
X#endif
X#if (!SMALLER)
X`09`7B "update-screen",`09`09`26f_up\0F06 `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "upper-til",`09`09`09`26f_operupper `7D,
X`09`7B "use-register",`09`09`26f_usekreg `7D,
X#endif
X`09`7B "v",`09`09&0209`26f_opervglobals `7D,
X`09`7B "version",`09`09`09`26f_show\1307 `7D,
X`09`7B "vglobal",`09`09`09`26f_oper\1307s `7D,
X`09`7B "view-file",`09`09`09`26f_viewfile `7D,
X`09`7B "visual",`09`09`09`26f_\0E06 `7D,
X`09`7B "w",`09`09&0209`26f_operwrite `7D,
X`09`7B "w!",`09`09&0209`26f_operwrite `7D,
X`09`7B "whole-lines",`09`09`26f_godotplus `7D,
X`09`7B "wq",`09`09&0209`26f_writequit `7D,
X#if (!SMALLER)
X`09`7B "wrap-word",`09`09`09`26f_wrapword `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "write-changed-buffers",`09`26f_writeall\1D07 `7D,
X`09`7B "write-changed-buffers-and-quit", `26f_quickexit `7D,
X`09`7B "write-file",`09`09`09`26f_filewrite `7D,
X`09`7B "write-file!",`09`09`26f_filewrite `7D,
X`09`7B "write-file-and-quit",`09`26f_writequit `7D,
X#endif
X#if (!SMALLER)
X`09`7B "write-message",`09`09`26f_writemsg `7D,
X#endif
X#if (!FEWNAMES)
X`09`7B "write-til",`09`09`09`26f_operwrite `7D,
X#endif
X`09`7B "ww",`09`09&0209`26f_writeallchanged `7D,
X`09`7B "wwq",`09`09`09`26f_quickexit `7D,
X`09`7B "x",`09`09&0209`26f_quickexit `7D,
X`09`7B "x!",`09`09&0209`26f_quickexit `7D,
X`09`7B "xit",`09`09`09`26f_quickexit `7D,
X`09`7B "y",`09`09&0209`26f_operlineyank `7D,
X#if (!FEWNAMES)
X`09`7B "yank-line",`09`09`09`26f_yankline `7D,
X`09`7B "yank-lines-til",`09`09`26f_operlineyank `7D,
X`09`7B "yank-til",`09`09`09`26f_operyank `7D,
X#endif
X#if (OPT_SHELL)
X`09`7B "`7C",`09`09&0209`26f_vile_filter `7D,
X#endif
X`09`7B "`7E",`09`09&0209`26f_operflip `7D,
X`09`7B NULL, NULL `7D
X`7D;
$ call unpack [.VILE-8_0]NENAME.H;4 -
 811609262 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 56 84 152
$!
$ create 'f'
X/* neproto.h: this header file was produced automatically by
X * the dsa10:`5Bcompcent.`5D`5Budaa055.temp.vile-8_0`5Dmktbls.exe;1 program, b
Vased on input from the file cmdtbl
X */
Xextern int abbrev ( int f, int n );
Xextern int altbuff ( int f, int n );
Xextern int append ( int f, int n );
X#if !SMALLER
Xextern int appstring ( int f, int n );
X#endif
Xextern int appendeol ( int f, int n );
Xextern int backchar ( int f, int n );
Xextern int backchar_to_bol ( int f, int n );
Xextern int backdelchar ( int f, int n );
X#if !SMALLER
Xextern int backhunt ( int f, int n );
X#endif
Xextern int backhpage ( int f, int n );
Xextern int backline ( int f, int n );
Xextern int backbline ( int f, int n );
Xextern int backpage ( int f, int n );
Xextern int backword ( int f, int n );
Xextern int backviword ( int f, int n );
Xextern int backsearch ( int f, int n );
Xextern int bcsrch ( int f, int n );
Xextern int bcsrch_to ( int f, int n );
X#if OPT_REBIND
Xextern int bindkey ( int f, int n );
X#endif
X#if OPT_SHELL
Xextern int bktoshell ( int f, int n );
X#endif
X#if SYS_WINNT
Xextern int cbrdcpy_unnamed ( int f, int n );
Xextern int cbrdpaste ( int f, int n );
X#endif
X#if OPT_SHELL
Xextern int cd ( int f, int n );
X#endif
Xextern int cntl_x_func ( int f, int n );
Xextern int chgchar ( int f, int n );
Xextern int chgline ( int f, int n );
Xextern int chgtoeol ( int f, int n );
X#if OPT_HILITEMATCH
Xextern int clear_match_attrs ( int f, int n );
X#endif
Xextern int clrmes ( int f, int n );
X#if OPT_FINDERR
Xextern int comp_err_exps ( int f, int n );
X#endif
Xextern int consearch ( int f, int n );
X#if OPT_WORDCOUNT
Xextern int wordcount ( int f, int n );
X#endif
X#if SYS_WINNT
Xextern int opercbrdcpy ( int f, int n );
X#endif
Xextern int opercopy ( int f, int n );
X#if OPT_ENCRYPT
Xextern int opercrypt ( int f, int n );
X#endif
Xextern int kbd_mac_begin ( int f, int n );
Xextern int kbd_mac_end ( int f, int n );
Xextern int kbd_mac_exec ( int f, int n );
Xextern int kbd_mac_save ( int f, int n );
X#if OPT_EXEC_MACROS>0
Xextern int cbuf1 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>1
Xextern int cbuf2 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>2
Xextern int cbuf3 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>3
Xextern int cbuf4 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>4
Xextern int cbuf5 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>5
Xextern int cbuf6 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>6
Xextern int cbuf7 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>7
Xextern int cbuf8 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>8
Xextern int cbuf9 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>9
Xextern int cbuf10 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>10
Xextern int cbuf11 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>11
Xextern int cbuf12 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>12
Xextern int cbuf13 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>13
Xextern int cbuf14 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>14
Xextern int cbuf15 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>15
Xextern int cbuf16 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>16
Xextern int cbuf17 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>17
Xextern int cbuf18 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>18
Xextern int cbuf19 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>19
Xextern int cbuf20 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>20
Xextern int cbuf21 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>21
Xextern int cbuf22 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>22
Xextern int cbuf23 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>23
Xextern int cbuf24 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>24
Xextern int cbuf25 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>25
Xextern int cbuf26 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>26
Xextern int cbuf27 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>27
Xextern int cbuf28 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>28
Xextern int cbuf29 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>29
Xextern int cbuf30 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>30
Xextern int cbuf31 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>31
Xextern int cbuf32 ( int f, int n );
X#endif
X#if (OPT_EXEC_MACROS>32`26`26(!SYS_WINNT))
Xextern int cbuf33 ( int f, int n );
X#endif
X#if (OPT_EXEC_MACROS>33`26`26(!SYS_WINNT))
Xextern int cbuf34 ( int f, int n );
X#endif
X#if (OPT_EXEC_MACROS>34`26`26(!SYS_WINNT))
Xextern int cbuf35 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>35
Xextern int cbuf36 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>36
Xextern int cbuf37 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>37
Xextern int cbuf38 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>38
Xextern int cbuf39 ( int f, int n );
X#endif
X#if OPT_EXEC_MACROS>39
Xextern int cbuf40 ( int f, int n );
X#endif
X#if OPT_MAJORMODE
Xextern int define_mode ( int f, int n );
Xextern int define_submode ( int f, int n );
X#endif
Xextern int delwind ( int f, int n );
X#if OPT_AEDIT
Xextern int forceblank (\1106, int n );
X#endif
Xextern int delglobmode ( int f, int n );
Xextern int dellocmode ( int f, int n );
Xextern int deltoeol ( int f, int n );
X#if OPT_REBIND
Xextern int desbind ( int f, int n );
Xextern int desmotions ( int f, int n );
Xextern int desopers ( int f, int n );
X#endif
X#if OPT_SHOW_CTYPE
Xextern int desprint ( int f, int n );
X#endif
X#if OPT_REBIND
Xextern int desapro ( int f, int n );
Xextern int desfunc ( int f, int n );
Xextern int deskey ( int f, int n );
X#endif
Xextern int dotcmdplay ( int f, int n );
Xextern int ex ( int f, int n );
X#if !SMALLER
Xextern int execbuf ( int f, int n );
Xextern int execfile ( int f, int n );
X#endif
X#if OPT_HYPERTEXT
Xextern int exechypercmd ( int f, int n );
Xextern int showhypercmd ( int f, int n );
X#endif
Xextern int execkreg ( int f, int n );
X#if OPT_PROCEDURES
Xextern int execproc ( int f, int n );
X#endif
Xextern int enlargewind ( int f, int n );
Xextern int esc_func ( int f, int n );
X#if SYS_UNIX
Xextern int flow_control_enable (\1A06, int n );
X#endif
Xextern int fcsrch (\0D06, int n );
Xextern int fcsrch_to (\1006, int n );
Xextern int filefind (\0F06, int n );
Xextern int fileread (\0F06, int n );
Xextern int filename (\0F06, int n );
X#if !SMALLER
Xextern int filesave (\0F06, int n );
X#endif
Xextern int filewrite (\1006, int n );
X#if OPT_SHELL
Xextern int vile_filter ( int f, int n );
X#endif
X#if OPT_FINDERR
Xextern int finderr (\0E06, int n );
Xextern int finderrbuf (\1106, int n );
X#endif
Xextern int firstbuffer (\1206, int n );
Xextern int firstnonwhite (\1406, int n );
X#if OPT_ISRCH
Xextern int fisearch (\0F06, int n );
X#endif
Xextern int flipchar (\0F06, int n );
X#if DISP_HP150
Xextern int fnclabel (\0F06, int n );
X#endif
Xextern int forwdelchar (\1206, int n );
Xextern int forwhpage (\1006, int n );
Xextern int forwchar (\0F06, int n );
Xextern int forwchar_to_eol (\1606, int n );
Xextern int forwpage (\0F06, int n );
Xextern int forwline (\0F06, int n );
Xextern int forwbline (\1006, int n );
Xextern int forwword (\0F06, int n );
Xextern int forwviword (\1106, int n );
Xextern int forwendw (\0F06, int n );
Xextern int forwviendw (\1106, int n );
X#if !SMALLER
Xextern int forwhunt (\0F06, int n );
X#endif
Xextern int forwsearch (\1106, int n );
X#if OPT_CFENCE
Xextern int matchfence ( int f, int n );
Xextern int matchfenceback ( int f, int n );
X#endif
Xextern int globals ( int f, int n );
Xextern int godotplus ( int f, int n );
Xextern int gomark ( int f, int n );
Xextern int gotobop ( int f, int n );
Xextern int gotoeop ( int f, int n );
X#if !SMALLER
Xextern int gotobob ( int f, int n );
Xextern int gotoeob ( int f, int n );
X#endif
Xextern int gotobol ( int f, int n );
Xextern int gotoeol ( int f, int n );
Xextern int gotobos ( int f, int n );
Xextern int gotomos ( int f, int n );
Xextern int gotoeos ( int f, int n );
Xextern int gotobosec ( int f, int n );
Xextern int gotoeosec ( int f, int n );
Xextern int gotobosent ( int f, int n );
Xextern int gotoeosent ( int f, int n );
X#if OPT_TAGS
Xextern int gototag ( int f, int n );
X#endif
Xextern int gotocol ( int f, int n );
Xextern int gotoline ( int f, int n );
Xextern int golinenmmark ( int f, int n );
Xextern int goexactnmmark ( int f, int n );
Xextern int gorectnmmark ( int f, int n );
Xextern int help ( int f, int n );
Xextern int histbuff ( int f, int n );
Xextern int insert ( int f, int n );
Xextern int insert_no_aindent ( int f, int n );
Xextern int insertbol ( int f, int n );
Xextern int insfile ( int f, int n );
X#if !SMALLER
Xextern int insspace ( int f, int n );
Xextern int insstring ( int f, int n );
X#endif
Xextern int joinlines ( int f, int n );
Xextern int killbuffer ( int f, int n );
Xextern int showlength ( int f, int n );
X#if !SMALLER
Xextern int lastnonwhite ( int f, int n );
X#endif
Xextern int listbuffers ( int f, int n );
X#if OPT_HISTORY
Xextern int showhistory ( int f, int n );
X#endif
Xextern int lineputafter ( int f, int n );
Xextern int lineputbefore ( int f, int n );
Xextern int rectputafter ( int f, int n );
Xextern int rectputbefore ( int f, int n );
Xextern int lineundo ( int f, int n );
Xextern int loadkreg ( int f, int n );
X#if OPT_SHOW_REGS
Xextern int showkreg ( int f, int n );
X#endif
X#if OPT_SHOW_MAPS
Xextern int sysmap ( int f, int n );
X#endif
Xextern int map ( int f, int n );
Xextern int map_bang ( int f, int n );
X#if OPT_TAGS
Xextern int nexttag ( int f,\1506 );
X#endif
Xextern int newprocessgroup ( int f,\1D06 );
Xextern int noremap ( int f,\1506 );
Xextern int noremap_bang ( int f,\1A06 );
Xextern int cntl_a_func ( int f, int n );
Xextern int mvdnnxtwind ( int f, int n );
Xextern int mvupnxtwind ( int f, int n );
Xextern int mvdnwind ( int f, int n );
Xextern int mvupwind ( int f, int n );
Xextern int mvrightwind ( int f, int n );
Xextern int mvleftwind ( int f, int n );
Xextern int nextbuffer ( int f,\1806 );
Xextern int namebuffer ( int f,\1806 );
X#if !SMALLER
Xextern int newline ( int f,\1506 );
X#endif
Xextern int newlength ( int f,\1706 );
Xextern int newwidth ( int f,\1606 );
Xextern int nextwind ( int f,\1606 );
Xextern int nullproc ( int f,\1606 );
Xextern int namedcmd ( int f,\1606 );
Xextern int openup ( int f, int n );
Xextern int openup_no_aindent ( int f, int n );
Xextern int opendown ( int f, int n );
Xextern int opendown_no_aindent ( int f, int n );
Xextern int operopenrect ( int f, int n );
X#if OPT_SELECTIONS
Xextern int operattrbold ( int f, int n );
Xextern int operattrcaseq ( int f, int n );
X#endif
X#if OPT_HYPERTEXT
Xextern int operattrhc ( int f, int n );
X#endif
X#if OPT_SELECTIONS
Xextern int operattrital ( int f, int n );
Xextern int operattrno ( int f, int n );
Xextern int operattrrev ( int f, int n );
Xextern int operattrul ( int f, int n );
X#endif
Xextern int operchg ( int f, int n );
X#if OPT_AEDIT
Xextern int operdetab ( int f, int n );
Xextern int operentab ( int f, int n );
X#endif
Xextern int opermove ( int f, int n );
Xextern int operlinechg ( int f, int n );
Xextern int operdel ( int f, int n );
Xextern int operjoin ( int f, int n );
Xextern int operlinedel ( int f, int n );
X#if OPT_SHELL
Xextern int operfilter ( int f, int n );
X#endif
X#if OPT_FORMAT
Xextern int operformat ( int f, int n );
X#endif
Xextern int operflip ( int f, int n );
Xextern int operglobals ( int f, int n );
Xextern int opervglobals ( int f, int n );
Xextern int operlower ( int f, int n );
Xextern int operlist ( int f, int n );
Xextern int operprint ( int f, int n );
Xextern int operpprint ( int f, int n );
X#if OPT_SELECTIONS
Xextern int operselect ( int f, int n );
X#endif
Xextern int operupper ( int f, int n );
Xextern int operlshift ( int f, int n );
Xextern int operrshift ( int f, int n );
Xextern int opersubst ( int f, int n );
X#if OPT_AEDIT
Xextern int opertrim ( int f, int n );
Xextern int operblank ( int f, int n );
X#endif
Xextern int operyank ( int f, int n );
Xextern int operlineyank ( int f, int n );
Xextern int opersubstagain ( int f, int n );
Xextern int opertransf ( int f, int n );
Xextern int operwrite ( int f, int n );
Xextern int overwritechars ( int f, int n );
X#if !SMALLER
Xextern int overwstring ( int f, int n );
X#endif
Xextern int onlywind ( int f, int n );
X#if OPT_PERL
Xextern int perl ( int f, int n );
Xextern int perldo ( int f, int n );
X#endif
Xextern int poswind ( int f, int n );
Xextern int prevwind ( int f, int n );
X#if OPT_SHELL
Xextern int pipecmd ( int f, int n );
X#endif
Xextern int putafter ( int f, int n );
Xextern int putbefore ( int f, int n );
X#if OPT_SHELL
Xextern int pwd ( int f, int n );
X#endif
Xextern int quit ( int f, int n );
Xextern int quithard ( int f, int n );
Xextern int quickexit ( int f, int n );
Xextern int quote ( int f, int n );
Xextern int vile_refresh ( int f, int n );
X#if OPT_MAJORMODE
Xextern int remove_mode ( int f, int n );
Xextern int remove_submode ( int f, int n );
X#endif
X#if !SMALLER
Xextern int reposition ( int f, int n );
X#endif
Xextern int rep_csrch ( int f, int n );
Xextern int replacechar ( int f, int n );
X#if OPT_SHELL
Xextern int respawn ( int f, int n );
X#endif
X#if !SMALLER
Xextern int resize ( int f, int n );
Xextern int restwnd ( int f, int n );
X#endif
Xextern int rev_csrch ( int f, int n );
X#if OPT_ISRCH
Xextern int risearch ( int f, int n );
X#endif
Xextern int revsearch ( int f, int n );
X#if OPT_SELECTIONS
Xextern int sel_motion ( int f, int n );
X#endif
Xextern int scrforwsearch ( int f, int n );
Xextern int scrbacksearch ( int f, int n );
Xextern int scrsearchpat ( int f, int n );
X#if OPT_DOSFILES
Xextern int set_dosmode ( int f, int n );
Xextern int set_unixmode ( int f, int n );
X#endif
Xextern int settab ( int f, int n );
X#if OPT_REBIND`26`26OPT_TERMCHRS
Xextern int set_termchrs ( int f, int n );
Xextern int show_termchrs ( int f, int n );
X#endif
X#if OPT_SHELL
Xextern int spawncli ( int f, int n );
X#endif
X#if !SMALLER
Xextern int savewnd ( int f, int n );
X#endif
Xextern int scrnextup ( int f, int n );
Xextern int scrnextdw ( int f, int n );
Xextern int setfillcol ( int f, int n );
X#if OPT_SELECTIONS
Xextern int multimotion ( int f, int n );
Xextern int multimotionfullline ( int f, int n );
Xextern int multimotionrectangle ( int f, int n );
X#endif
X#if OPT_ENCRYPT
Xextern int ue_setkey ( int f, int n );
X#endif
Xextern int setlocmode ( int f, int n );
Xextern int setglobmode ( int f, int n );
Xextern int setnmmark ( int f, int n );
X#if OPT_EVAL
Xextern int setvar ( int f, int n );
X#endif
Xextern int showcpos ( int f, int n );
Xextern int listmodes ( int f, int n );
X#if OPT_MAJORMODE
Xextern int list_majormodes ( int f, int n );
X#endif
X#if OPT_SHOW_EVAL
Xextern int listvars ( int f, int n );
X#endif
Xextern int showversion ( int f, int n );
X#if SYS_MSDOS`26`26(CC_TURBO`7C`7CCC_WATCOM&027CCC_DJGPP)
Xextern int showmemory ( int f, int n );
X#endif
X#if OPT_SHOW_TAGS
Xextern int showtagstack ( int f, int n );
X#endif
Xextern int shrinkwind ( int f, int n );
Xextern int source ( int f, int n );
X#if OPT_SHELL
Xextern int spawn ( int f, int n );
X#endif
Xextern int poundc_func ( int f, int n );
Xextern int splitwind ( int f, int n );
Xextern int storemac ( int f, int n );
X#if OPT_PROCEDURES
Xextern int storeproc ( int f, int n );
X#endif
Xextern int subst_again ( int f, int n );
Xextern int togglelistbuffers ( int f, int n );
X#if !SMALLER
Xextern int twiddle ( int f, int n );
X#endif
X#if OPT_REBIND
Xextern int unbindkey ( int f, int n );
X#endif
Xextern int undo ( int f, int n );
Xextern int inf_undo ( int f, int n );
Xextern int backundo ( int f, int n );
Xextern int forwredo (\0F06, int n );
Xextern int unabbr ( int f, int n );
Xextern int unarg_func ( int f, int n );
Xextern int unimpl ( int f, int n );
Xextern int unmark ( int f, int n );
Xextern int unmap ( int f, int n );
Xextern int unmap_bang ( int f, int n );
Xextern int unmap_system ( int f, int n );
X#if OPT_TAGS
Xextern int untagpop ( int f, int n );
X#endif
X#if !SMALLER
+-+-+-+-+-+-+-+-  END  OF PART 84 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 85 -+-+-+-+-+-+-+-+
Xextern int upscreen ( int f, int n );
X#endif
Xextern int usebuffer ( int f, int n );
Xextern int usekreg ( int f, int n );
X#if !SMALLER
Xextern int userbeep ( int f, int n );
X#endif
Xextern int visual ( int f, int n );
Xextern int vglobals ( int f, int n );
Xextern int viewfile ( int f, int n );
Xextern int writeallchanged ( int f, int n );
Xextern int writequit ( int f, int n );
X#if !SMALLER
Xextern int wrapword ( int f, int n );
Xextern int writemsg ( int f, int n );
X#endif
Xextern int yankline ( int f, int n );
X#if OPT_XTERM`7C`7CDISP_X11
Xextern int mouse_motion ( int f, int n );
X#endif
X#if DISP_X11
Xextern int copy_to_clipboard ( int f, int n );
Xextern int paste_from_clipboard ( int f, int n );
X#endif
X#if (OPT_XTERM>=3)
Xextern int xterm_mouse_t ( int f, int n );
Xextern int xterm_mouse_T ( int f, int n );
X#endif
Xextern int zzquit ( int f, int n );
$ call unpack [.VILE-8_0]NEPROTO.H;4 -
 1310131063 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 35 85 152
$!
$ create 'f'
X/* nevars.h: this header file was produced automatically by
X * the dsa10:`5Bcompcent.`5D`5Budaa055.temp.vile-8_0`5Dmktbls.exe;1 program, b
Vased on input from the file modetbl
X */
X
X#if OPT_EVAL
X
X/*`09structure to hold user variables and their definitions`09*/
X
Xtypedef struct UVAR `7B
X`09struct UVAR *next;
X`09char *u_name;`09`09/* name of user variable */
X`09char *u_value;`09`09&0209/* value (string) */
X`7D UVAR;
X
Xdecl_uninit( UVAR *user_vars );`09/* user variables */
X
X
X/*`09list of recognized environment variables`09*/
X
X#ifdef realdef
XEXTERN_CONST char *const envars`5B`5D = `7B
X`09s_abufname__,
X#if OPT_PROCEDURES
X`09s_buffer_hook__,
X#endif
X`09s_cbufname__,
X#if OPT_PROCEDURES
X`09s_cd_hook__,
X#endif
X`09s_cfilname__,
X`09s_char__,
X#if OPT_ENCRYPT
X`09s_cryptkey__,
X#endif
X`09s_curcol__,
X`09s_curline__,
X#if OPT_SHELL
X`09s_cwd__,
X#endif
X`09s_cwline__,
X`09s_debug__,
X#if OPT_SHELL
X`09s_directory__,
X#endif
X`09s_discmd__,
X`09s_disinp__,
X`09s_end_of_cmd__,
X#if OPT_PROCEDURES
X`09s_exit_hook__,
X#endif
X`09s_flicker__,
X#if DISP_X11
X`09s_font__,
X#endif
X`09s_forward_search__,
X`09s_helpfile__,
X#if DISP_X11
X`09s_iconname__,
X#endif
X`09s_identifier__,
X`09s_kill__,
X`09s_lastkey__,
X`09s_line__,
X`09s_llength__,
X#if OPT_MAJORMODE
X`09s_majormode__,
X#endif
X`09s_match__,
X`09s_mode__,
X#if OPT_MLFORMAT
X`09s_modeline_format__,
X#endif
X`09s_modified__,
X`09s_ncolors__,
X`09s_ntildes__,
X#if OPT_SHELL
X`09s_ocwd__,
X#endif
X`09s_os__,
X`09s_pagelen__,
X`09s_pagewid__,
X`09s_palette__,
X`09s_patchlevel__,
X`09s_pathname__,
X`09s_pending__,
X`09s_pid__,
X`09s_progname__,
X`09s_qidentifier__,
X#if OPT_RAMSIZE
X`09s_ram__,
X#endif
X#if OPT_PROCEDURES
X`09s_read_hook__,
X#endif
X`09s_replace__,
X`09s_search__,
X`09s_seed__,
X#if OPT_SHELL
X`09s_shell__,
X#endif
X`09s_sres__,
X`09s_startup_file__,
X`09s_startup_path__,
X`09s_status__,
X#if DISP_X11
X`09s_title__,
X#endif
X`09s_tpause__,
X`09s_version__,
X`09s_wline__,
X`09s_word__,
X#if OPT_PROCEDURES
X`09s_write_hook__,
X#endif
X#if DISP_X11
X`09s_xdisplay__,
X`09s_xshell__,
X#endif
X`09NULL`09/* ends table for name-completion */
X`7D;
X#else
Xextern const char *\0C06envars`5B`5D;
X#endif
X
X/* `09and its preprocesor definitions`09`09*/
X
Xtypedef`09struct`09`7B
X`09char`09s_abufname__;`09/* alternate buffer name (i.e. '#') */
X#if OPT_PROCEDURES
X`09char`09s_buffer_hook__; /* procedure to run when entering buf */
X#endif
X`09char`09s_cbufname__;`09/* current buffer name */
X#if OPT_PROCEDURES
X`09char`09s_cd_hook__;`09/* procedure to run when cd'ing */
X#endif
X`09char`09s_cfilname__;`09/* current file name */
X`09char`09s_char__;`09/* current character under the cursor */
X#if OPT_ENCRYPT
X`09char`09s_cryptkey__;`09/* write-only encryption-key */
X#endif
X`09char`09s_curcol__;`09/* current column pos of cursor */
X`09char`09s_curline__;`09/* current line in file */
X#if OPT_SHELL
X`09char`09s_cwd__;`09/* current directory */
X#endif
X`09char`09s_cwline__;`09/* current screen line in window */
X`09char`09s_debug__;`09/* macro debugging */
X#if OPT_SHELL
X`09char`09s_directory__;`09/* controls location of temp-files */
X#endif
X`09char`09s_discmd__;`09/* display commands on\0C08 line */
X`09char`09s_disinp__;`09/* display command line input characters */
X`09char`09s_end_of_cmd__; /* true if they ended the cmd with <CR> */
X#if OPT_PROCEDURES
X`09char`09s_exit_hook__;`09/* procedure to run when quitting */
X#endif
X`09char`09s_flicker__;`09/* \0E07 suppression */
X#if DISP_X11
X`09char`09s_font__;`09/* current font */
X#endif
X`09char`09s_forward_search__; /* \0D06-direction (true if \2F07) */
X`09char`09s_helpfile__;`09/* \0F08 (vile.hlp) */
X#if DISP_X11
X`09char`09s_iconname__;`09/* current font */
X#endif
X`09char`09s_identifier__; /* current \190A */
X`09char`09s_kill__;`09/* kill buffer (read only) */
X`09char`09s_lastkey__;`09/* last keyboard char struck */
X`09char`09s_line__;`09/* text of current line */
X`09char`09s_llength__;`09/* \0D06 of current line */
X#if OPT_MAJORMODE
X`09char`09s_majormode__;`09/* current \1809, if any */
X#endif
X`09char`09s_match__;`09/* last matched magic pattern */
X`09char`09s_mode__;`09/* are we inserting/overwriting/command */
X#if OPT_MLFORMAT
X`09char`09s_modeline_format__; /* \1608 \1606 string */
X#endif
X`09char`09s_modified__;`09/* is current buffer \2108? */
X`09char`09s_ncolors__;`09/* number of \1706 displayed */
X`09char`09s_ntildes__;`09/* number of \1706 displayed at eob */
X#if OPT_SHELL
X`09char`09s_ocwd__;`09/* previous directory */
X#endif
X`09char`09s_os__;`09`09/* what os are we on? */
X`09char`09s_pagelen__;`09/* number of lines used by editor */
X`09char`09s_pagewid__;`09/* current screen width */
X`09char`09s_palette__;`09/* current \1607 string */
X`09char`09s_patchlevel__; /* current patch-level of vile (empty for release) *
V/
X`09char`09s_pathname__;`09/* current path-like word */
X`09char`09s_pending__;`09/* type ahead \1907 flag */
X`09char`09s_pid__;`09/* vile's process-id */
X`09char`09s_progname__;`09/* returns current prog name - "vile" */
X`09char`09s_qidentifier__; /* current qualified \230A */
X#if OPT_RAMSIZE
X`09char`09s_ram__;`09/* ram in use by malloc */
X#endif
X#if OPT_PROCEDURES
X`09char`09s_read_hook__;`09/* procedure to run when reading */
X#endif
X`09char`09s_replace__;`09/* \0E07ment pattern */
X`09char`09s_search__;`09/* \0D06 pattern */
X`09char`09s_seed__;`09/* current random number seed */
X#if OPT_SHELL
X`09char`09s_shell__;`09/* shell-environment variable */
X#endif
X`09char`09s_sres__;`09/* current screen resolution */
X`09char`09s_startup_file__; /* the name of the \2307-file (e.g., .vilerc) */
X`09char`09s_startup_path__; /* where to find the \2507-file (e.g., .) */
X`09char`09s_status__;`09/* returns the \1906 of the last command */
X#if DISP_X11
X`09char`09s_title__;`09/* window title */
X#endif
X`09char`09s_tpause__;`09/* length to pause for paren matching */
X`09char`09s_version__;`09/* current \1607 number */
X`09char`09s_wline__;`09/* # of lines in current window */
X`09char`09s_word__;`09/* current word */
X#if OPT_PROCEDURES
X`09char`09s_write_hook__; /* procedure to run when writing */
X#endif
X#if DISP_X11
X`09char`09s_xdisplay__;`09/* X Windows \1807, etc. */
X`09char`09s_xshell__;`09/* xterm emulator, etc. */
X#endif
X`09char`09s_MAX;
X`09char`09Q1;
X`09`7D IndexVars;
X
X#define`09EVABUFNAME`09Member_Offset(IndexVars, s_abufname__)
X#if OPT_PROCEDURES
X#define`09EVBUFHOOK`09Member_Offset(IndexVars, s_buffer_hook__)
X#endif
X#define`09EVCBUFNAME`09Member_Offset(IndexVars, s_cbufname__)
X#if OPT_PROCEDURES
X#define`09EVCDHOOK`09Member_Offset(IndexVars, s_cd_hook__)
X#endif
X#define`09EVCFNAME`09Member_Offset(IndexVars, s_cfilname__)
X#define`09EVCURCHAR`09Member_Offset(IndexVars, s_char__)
X#if OPT_ENCRYPT
X#define`09EVCRYPTKEY`09Member_Offset(IndexVars, s_cryptkey__)
X#endif
X#define`09EVCURCOL`09Member_Offset(IndexVars, s_curcol__)
X#define`09EVCURLINE`09Member_Offset(IndexVars, s_curline__)
X#if OPT_SHELL
X#define`09EVCWD`09`09Member_Offset(IndexVars, s_cwd__)
X#endif
X#define`09EVCWLINE`09Member_Offset(IndexVars, s_cwline__)
X#define`09EVDEBUG`09`09Member_Offset(IndexVars, s_debug__)
X#if OPT_SHELL
X#define`09EVDIRECTORY`09Member_Offset(IndexVars, s_directory__)
X#endif
X#define`09EVDISCMD`09Member_Offset(IndexVars, s_discmd__)
X#define`09EVDISINP`09Member_Offset(IndexVars, s_disinp__)
X#define`09EVEOC`09`09Member_Offset(IndexVars, s_end_of_cmd__)
X#if OPT_PROCEDURES
X#define`09EVEXITHOOK`09Member_Offset(IndexVars, s_exit_hook__)
X#endif
X#define`09EVFLICKER`09Member_Offset(IndexVars, s_flicker__)
X#if DISP_X11
X#define`09EVFONT`09`09Member_Offset(IndexVars, s_font__)
X#endif
X#define`09EVFWD_SEARCH`09Member_Offset(IndexVars, s_forward_search__)
X#define`09EVHELPFILE`09Member_Offset(IndexVars, s_helpfile__)
X#if DISP_X11
X#define`09EVICONNAM`09Member_Offset(IndexVars, s_iconname__)
X#endif
X#define`09EVIDENTIF`09Member_Offset(IndexVars, s_identifier__)
X#define`09EVKILL`09`09Member_Offset(IndexVars, s_kill__)
X#define`09EVLASTKEY`09Member_Offset(IndexVars, s_lastkey__)
X#define`09EVLINE`09`09Member_Offset(IndexVars, s_line__)
X#define`09EVLLENGTH`09Member_Offset(IndexVars, s_llength__)
X#if OPT_MAJORMODE
X#define`09EVMAJORMODE`09Member_Offset(IndexVars, s_majormode__)
X#endif
X#define`09EVMATCH`09`09Member_Offset(IndexVars, s_match__)
X#define`09EVMODE`09`09Member_Offset(IndexVars, s_mode__)
X#if OPT_MLFORMAT
X#define`09EVMLFORMAT`09Member_Offset(IndexVars, s_modeline_format__)
X#endif
X#define`09EVMODIFIED`09Member_Offset(IndexVars, s_modified__)
X#define`09EVNCOLORS`09Member_Offset(IndexVars, s_ncolors__)
X#define`09EVNTILDES`09Member_Offset(IndexVars, s_ntildes__)
X#if OPT_SHELL
X#define`09EVOCWD`09`09Member_Offset(IndexVars, s_ocwd__)
X#endif
X#define`09EVOS`09`09Member_Offset(IndexVars, s_os__)
X#define`09EVPAGELEN`09Member_Offset(IndexVars, s_pagelen__)
X#define`09EVCURWIDTH`09Member_Offset(IndexVars, s_pagewid__)
X#define`09EVPALETTE`09Member_Offset(IndexVars, s_palette__)
X#define`09EVPATCHLEVEL`09Member_Offset(IndexVars, s_patchlevel__)
X#define`09EVPATHNAME`09Member_Offset(IndexVars, s_pathname__)
X#define`09EVPENDING`09Member_Offset(IndexVars, s_pending__)
X#define`09EVPROCESSID`09Member_Offset(IndexVars, s_pid__)
X#define`09EVPROGNAME`09Member_Offset(IndexVars, s_progname__)
X#define`09EVQIDENTIF`09Member_Offset(IndexVars, s_qidentifier__)
X#if OPT_RAMSIZE
X#define`09EVRAM`09`09Member_Offset(IndexVars, s_ram__)
X#endif
X#if OPT_PROCEDURES
X#define`09EVRDHOOK`09Member_Offset(IndexVars, s_read_hook__)
X#endif
X#define`09EVREPLACE`09Member_Offset(IndexVars, s_replace__)
X#define`09EVSEARCH`09Member_Offset(IndexVars, s_search__)
X#define`09EVSEED`09`09Member_Offset(IndexVars, s_seed__)
X#if OPT_SHELL
X#define`09EVSHELL`09`09Member_Offset(IndexVars, s_shell__)
X#endif
X#define`09EVSRES`09`09Member_Offset(IndexVars, s_sres__)
X#define`09EVSTARTUP_FILE`09Member_Offset(IndexVars, s_startup_file__)
X#define`09EVSTARTUP_PATH`09Member_Offset(IndexVars, s_startup_path__)
X#define`09EVSTATUS`09Member_Offset(IndexVars, s_status__)
X#if DISP_X11
X#define`09EVTITLE`09`09Member_Offset(IndexVars, s_title__)
X#endif
X#define`09EVTPAUSE`09Member_Offset(IndexVars, s_tpause__)
X#define`09EVVERSION`09Member_Offset(IndexVars, s_version__)
X#define`09EVWLINE`09`09Member_Offset(IndexVars, s_wline__)
X#define`09EVWORD`09`09Member_Offset(IndexVars, s_word__)
X#if OPT_PROCEDURES
X#define`09EVWRHOOK`09Member_Offset(IndexVars, s_write_hook__)
X#endif
X#if DISP_X11
X#define`09EVXDISPLAY`09Member_Offset(IndexVars, s_xdisplay__)
X#define`09EVXSHELL`09Member_Offset(IndexVars, s_xshell__)
X#endif
X
X/*`09list of recognized user functions`09*/
X
Xtypedef struct UFUNC `7B
X`09const char *f_name;`09/* name of function */
X`09int f_type;`09/* 1 = monamic, 2 = dynamic */
X`7D UFUNC;
X
X#define`09NILNAMIC`090
X#define`09MONAMIC`09`091
X#define`09DYNAMIC`09`092
X#define`09TRINAMIC`093
X
X#ifdef realdef
XEXTERN_CONST UFUNC funcs`5B`5D = `7B
X`09`7B"abs", MONAMIC`7D,`09/* absolute value of a number */
X`09`7B"add", DYNAMIC`7D,`09/* add two numbers together */
X`09`7B"and", DYNAMIC`7D,`09/* logical and */
X`09`7B"asc", MONAMIC`7D,`09/* char to integer conversion */
X`09`7B"bin", MONAMIC`7D,`09/* lookup what function name is bound to a key */
X`09`7B"cat", DYNAMIC`7D,`09/* concatenate string */
X`09`7B"chr", MONAMIC`7D,`09/* integer to char conversion */
X`09`7B"div", DYNAMIC`7D,`09/* division */
X`09`7B"env", MONAMIC`7D,`09/* retrieve a system environment var */
X`09`7B"equ", DYNAMIC`7D,`09/* logical equality check */
X`09`7B"glo", MONAMIC`7D,`09/* retrieve global setting */
X`09`7B"gre", DYNAMIC`7D,`09/* logical greater than */
X`09`7B"gtk", NILNAMIC`7D,`09/* get 1 character */
X`09`7B"gts", NILNAMIC`7D,`09/* get keyboard-sequence (characters) */
X`09`7B"ind", MONAMIC`7D,`09/* evaluate indirect value */
X`09`7B"lef", DYNAMIC`7D,`09/* left string(\0706, len) */
X`09`7B"len", MONAMIC`7D,`09/* string length */
X`09`7B"les", DYNAMIC`7D,`09/* logical less than */
X`09`7B"loc", MONAMIC`7D,`09/* retrieve local setting */
X`09`7B"low", MONAMIC`7D,`09/* lower case string */
X`09`7B"mid", TRINAMIC`7D,`09/* mid string(\0706, pos, len) */
X`09`7B"mod", DYNAMIC`7D,`09/* modulo */
X`09`7B"neg", MONAMIC`7D,`09/* negate */
X`09`7B"not", MONAMIC`7D,`09/* logical not */
X`09`7B"or", DYNAMIC`7D,`09/* logical or */
X`09`7B"rd", MONAMIC`7D,`09/* is a file readable? */
X`09`7B"rig", DYNAMIC`7D,`09/* right string(\0706, pos) */
X`09`7B"rnd", MONAMIC`7D,`09/* get a random number */
X`09`7B"seq", DYNAMIC`7D,`09/* string logical equality check */
X`09`7B"sgr", DYNAMIC`7D,`09/* string logical greater than */
X`09`7B"sin", DYNAMIC`7D,`09/* find the index of one string in another */
X`09`7B"sle", DYNAMIC`7D,`09/* string logical less than */
X`09`7B"sub", DYNAMIC`7D,`09/* subtraction */
X`09`7B"tim", DYNAMIC`7D,`09/* multiplication */
X`09`7B"tri", MONAMIC`7D,`09/* trims leading/trailing/repeated whitespace */
X`09`7B"tru", MONAMIC`7D,`09/* Truth of the universe logical test */
X`09`7B"upp", MONAMIC`7D,`09/* uppercase string */
X`09`7B"wr", MONAMIC`7D,`09/* is a file writeable? */
X`7D;
X#else
Xextern const UFUNC funcs`5B`5D;
X#endif
X
X/* `09and its preprocesor definitions`09`09*/
X
X#define`09UFABS`09`090
X#define`09UFADD`09`091
X#define`09UFAND`09`092
X#define`09UFASCII`09`093
X#define`09UFBIND`09`094
X#define`09UFCAT`09`095
X#define`09UFCHR`09`096
X#define`09UFDIV`09`097
X#define`09UFENV`09`098
X#define`09UFEQUAL`09`099
X#define`09UFGLOBMODE`0910
X#define`09UFGREATER`0911
X#define`09UFGTKEY`09`0912
X#define`09UFGTSEQ`09`0913
X#define`09UFIND`09`0914
X#define`09UFLEFT`09`0915
X#define`09UFLENGTH`0916
X#define`09UFLESS`09`0917
X#define`09UFLOCMODE`0918
X#define`09UFLOWER`09`0919
X#define`09UFMID`09`0920
X#define`09UFMOD`09`0921
X#define`09UFNEG`09`0922
X#define`09UFNOT`09`0923
X#define`09UFOR`09`0924
X#define`09UFREADABLE`0925
X#define`09UFRIGHT`09`0926
X#define`09UFRND`09`0927
X#define`09UFSEQUAL`0928
X#define`09UFSGREAT`0929
X#define`09UFSINDEX`0930
X#define`09UFSLESS`09`0931
X#define`09UFSUB`09`0932
X#define`09UFTIMES`09`0933
X#define`09UFTRIM`09`0934
X#define`09UFTRUTH`09`0935
X#define`09UFUPPER`09`0936
X#define`09UFWRITABLE`0937
X
X#define`09NFUNCS`09`0938
X
X#endif /* OPT_EVAL */
$ call unpack [.VILE-8_0]NEVARS.H;4 -
 1618859497 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 27 86 152
$!
$ create 'f'
X/*`09npopen:  like popen, but grabs stderr, too
X *`09`09written by John Hutchinson, heavily modified by Paul Fox
X *
X * $Header: /usr/build/vile/vile/RCS/npopen.c,v 1.64 1998/05/19 11:04:47 cmorg
Van Exp $
X *
X */
X
X#include "estruct.h"
X#include "edef.h"
X
X#if ! TEST_DOS_PIPES
X
X#if SYS_UNIX `7C`7C SYS_OS2
X
X/*
X * For OS/2 implementations of inout_popen(), npflush(), and npclose(),
X * see "os2pipe.c".
X */
X
X#if SYS_OS2
X#include <process.h>
X#endif
X
X#if OPT_EVAL
X#define`09user_SHELL()`09gtenv("shell")
X#else
X#define`09user_SHELL()`09getenv("SHELL")
X#endif
X
X#if SYS_OS2_EMX
X#define SHELL_C "/c"
X#else
X#define SHELL_C "-c"
X#endif
X
X#define R 0
X#define W 1
X
X#if SYS_UNIX
Xstatic int pipe_pid;
X#endif
X
Xstatic void exec_sh_c(char *cmd);
X
XFILE *
Xnpopen (char *cmd, const char *type)
X`7B
X`09FILE *ff;
X
X`09if (*type != 'r' `26`26 \100Aw')
X`09`09return NULL;
X
X`09if (*type == 'r') `7B
X  `09`09if (inout_popen(`26ff, (FILE **)0, cmd) != TRUE)
X`09`09`09return NULL;
X`09`09return ff;
X`09`7D else `7B
X`09`09if (inout_popen((FILE **)0, `26ff, cmd) != TRUE)
X`09`09`09return NULL;
X`09`09return ff;
X`09`7D
X`7D
X#endif /* SYS_UNIX `7C`7C SYS_OS2 */
X
X#if SYS_UNIX
X
Xint
Xinout_popen(FILE **fr, \0B08w, char *cmd)
X`7B
X`09int rp`5B2`5D;
X`09int wp`5B2`5D;
X
X`09if (pipe(rp))
X`09`09return FALSE;
X`09if (pipe(wp))
X`09`09return FALSE;
X
X`09pipe_pid = softfork();
X`09if (pipe_pid < 0)
X`09`09return FALSE;
X
X`09if (pipe_pid) `7B /* parent */
X
X`09`09if (fr) `7B
X`09`09`09*fr = fdopen (rp`5B0`5D, "r");
X`09`09`09if (*fr == NULL) `7B
X`09`09&0209(void)fprintf(stderr,"fdopen r failed`5Cn");
X`09`09&0209abort();
X`09`09`09`7D
X`09`09`7D else `7B
X`09`09`09(void)close(rp`5B0`5D);
X`09`09`7D
X`09`09(void) close (rp`5B1`5D);
X
X`09`09if (fw) `7B
X`09`09`09*fw = fdopen (wp`5B1`5D, "w");
X`09`09`09if (*fw == NULL) `7B
X`09`09&0209(void)fprintf(stderr,"fdopen w failed`5Cn");
X`09`09&0209abort();
X`09`09`09`7D
X`09`09`7D else `7B
X`09`09`09(void)close(wp`5B1`5D);
X`09`09`7D
X`09`09(void) close (wp`5B0`5D);
X`09`09return TRUE;
X
X`09`7D else `7B`09`09`09/* child */
X
X`09`09if (fw) `7B
X`09`09`09(void)close (0);
X`09`09`09if (dup (wp`5B0`5D) != 0) `7B
X`09`09&0209(void)write(2,"dup 0 failed`5Cr`5Cn",15);
X`09`09&0209exit(-1);
X`09`09`09`7D
X`09`09`7D
X`09`09(void) close (wp`5B1`5D);
X`09`09if (fr) `7B
X`09`09`09(void)close (1);
X`09`09`09if (dup (rp`5B1`5D) != 1) `7B
X`09`09&0209(void)write(2,"dup 1 failed`5Cr`5Cn",15);
X`09`09&0209exit(-1);
X`09`09`09`7D
X`09`09`09(void)close (2);
X`09`09`09if (dup (rp`5B1`5D) != 2) `7B
X`09`09&0209(void)write(1,"dup 2 failed`5Cr`5Cn",15);
X`09`09&0209exit(-1);
X`09`09`09`7D
X`09`09`7D else `7B
X`09`09`09(void) close (rp`5B1`5D);
X`09`09`7D
X`09`09(void) close (rp`5B0`5D);
X`09`09exec_sh_c(cmd);
X
X`09`7D
X`09return TRUE;
X`7D
X
Xvoid
Xnpclose (FILE *fp)
X`7B
X`09int child;
X`09(void)fflush(fp);
X`09(void)fclose(fp);
X`09while ((child = wait ((int *)0)) != pipe_pid) `7B
X`09`09if (child < 0 `26`26 errno == EINTR) `7B
X`09`09`09(void) kill (SIGKILL, pipe_pid);
X`09`09`7D
X`09`7D
X`7D
X
Xstatic void
Xexec_sh_c(char *cmd)
X`7B
X`09static char bin_sh`5B`5D = "/bin/sh";
X`09char *sh, *shname;
X`09int i;
X
X#ifndef NOFILE
X# define NOFILE 20
X#endif
X`09/* Make sure there are no upper inherited file descriptors */
X`09for (i = 3; i < NOFILE; i++)
X`09`09(void) close (i);
X
X`09if ((sh = user_SHELL()) == NULL `7C`7C *sh == EOS) `7B
X`09`09sh = bin_sh;
X`09`09shname = pathleaf(sh);
X`09`7D else `7B
X`09`09shname = last_slash(sh);
X`09`09if (shname == NULL) `7B
X`09`09`09shname = sh;
X`09`09`7D else `7B
X`09`09`09shname++;
X`09`09`09if (*shname == EOS)
X`09`09&0209shname = sh;
X`09`09`7D
X`09`7D
X
X`09if (cmd)
X`09`09(void) execlp (sh, shname, SHELL_C, cmd, 0);
X`09else
X`09`09(void) execlp (sh, shname, 0);
X`09(void)write(2,"exec failed`5Cr`5Cn",14);
X`09exit (-1);
X`7D
X
X
X#if LATER
X
Xint shellstatus;
X
Xstatic int
Xprocess_exit_status(int \0B06)
X`7B
X    if (WIFSIGNALED(status))
X`09return (128 + WTERMSIG(status));
X    else if (!WIFSTOPPED(status))
X`09return (WEXITSTATUS(status));
X    else
X`09return (EXECUTION_SUCCESS);
X`7D
X
X#endif /* LATER */
X
X
Xint
Xsystem_SHELL(char *cmd)
X`7B
X`09int cpid;
X
X`09cpid = softfork();
X`09if (cpid < 0) `7B
X`09`09(void)write(2,"cannot fork`5Cn",13);
X`09`09return cpid;
X`09`7D
X
X`09if (cpid) `7B /* parent */
X`09`09int child;
X`09`09int status;
X`09`09beginDisplay();
X`09`09while ((child = wait (`26status)) != cpid) `7B
X`09`09`09if (child < 0 `26`26 errno == EINTR) `7B
X`09`09&0209(void) kill (SIGKILL, cpid);
X`09`09`09`7D
X`09`09`7D
X`09`09endofDisplay();
X#if LATER
X`09`09shellstatus = process_exit_\1606(\1D06);
X#endif
X`09`09return 0;
X`09`7D else `7B
X`09`09exec_sh_c(cmd);
X`09`09(void)write(2,"cannot exec`5Cn",13);
X`09`09return -1;
X`09`7D
X
X`7D
X
Xint
Xsoftfork(void)
X`7B
X`09/* Try `26 fork 5 times, backing off 1, 2, 4 .. seconds each try */
X`09int fpid;
X`09int tries = 5;
X`09unsigned slp = 1;
X
X`09while ((fpid = fork ()) < 0) `7B
X`09`09if (--tries == 0)
X`09`09`09return -1;
X`09`09(void) sleep (slp);
X`09`09slp <<= 1;
X`09`7D
X`09return fpid;
X`7D
X
X#endif  /* SYS_UNIX */
X#endif `09/* TEST_DOS_PIPES */
X
X#if SYS_MSDOS `7C`7C SYS_WIN31\0D0BNT &027C TEST_DOS_PIPES
X#include <fcntl.h>`09`09/* defines O_RDWR */
X#if ! TEST_DOS_PIPES
X#include <io.h>`09`09`09/* defines 'dup2()', etc. */
X#endif
X
X#if SYS_WIN31
X/* FIXME: is it possible to execute a DOS program from Windows? */
Xint`09system(const char *command) `7B return (-1); `7D
X#endif
X
Xstatic`09void`09deleteTemp (void);
X
Xstatic`09FILE **`09myPipe;`09`09/* current pipe-file pointer */
Xstatic`09FILE **`09myWrtr;`09`09/* write-pipe pointer */
Xstatic`09char *`09myName`5B2`5D;`09/* name of temporary file for pipe */
Xstatic`09char *`09myCmds;`09`09/* command to execute on read-pipe */
Xstatic`09int`09myRval;`09`09/* return-value of 'system()' */
X
Xstatic int
XcreateTemp (char *type)
X`7B
X`09register int n = (*type == 'r');
X`09register int fd;
X
X#if CC_WATCOM `7C`7C CC_TURBO
X`09myName`5Bn`5D = tmpnam((char *)0);
X#else
X`09myName`5Bn`5D = tempnam(TMPDIR, type);
X#endif
X`09if (myName`5Bn`5D == 0)
X`09`09return -1;
X`09(void)close(creat(myName`5Bn`5D, 0666));
X`09if ((fd = open(myName`5Bn`5D, O_RDWR)) < 0) `7B
X`09`09deleteTemp();
X`09`09return -1;
X`09`7D
X`09return fd;
X`7D
X
Xstatic void
XdeleteTemp (void)
X`7B
X`09register int n;
X
X`09for (n = 0; n < 2; n++) `7B
X`09`09if (myName`5Bn`5D != 0) `7B
X`09`09`09(void)unlink(myName`5Bn`5D);
X`09`09`09FreeAndNull(myName`5Bn`5D);
X`09`09`7D
X`09`7D
X`7D
X
Xstatic void
XclosePipe(FILE ***pp)
X`7B
X`09if (*pp != 0) `7B
X`09`09if (**pp != 0) `7B
X`09`09`09(void)fclose(**pp);
X`09`09`09**pp = 0;
X`09`09`7D
X`09`09*pp = 0;
X`09`7D
X`7D
X
Xstatic FILE *
XreadPipe(const char *cmd, int in\0806out)
X`7B
X`09int old0, old1, old2;
X
X`09TRACE(("readPipe(cmd='%s', in=%d, out=%d)`5Cn", cmd, in, out))
X
X`09TTkclose();`09/* close the keyboard in case of error */
X
X`09/* save and redirect stdin, stdout, and stderr */
X`09old1 = dup(1);
X`09old2 = dup(2);
X
X`09if (in >= 0)
X`09`7B
X`09`09old0 = dup(0);
X`09`09dup2(in, 0);
X`09`7D
X`09dup2(out, 1);
X`09dup2(out, 2);
X
X#if SYS_WINNT
X`09myRval = w32_system(cmd);
X#else
X`09myRval = system(cmd);
X#endif
X
X`09/* restore old std... */
X`09if (in >= 0)
X`09`7B
X`09`09dup2(old0, 0); close(old0);
X`09`7D
X`09dup2(old1, 1); close(old1);
X`09dup2(old2, 2); close(old2);
X
X`09TTkopen();`09/* reopen the keyboard */
X
X`09/* rewind command output */
X`09lseek(out, 0L, 0);
X`09return fdopen(out, "r");
X`7D
X
X#if SYS_MSDOS
Xstatic void
XwritePipe(const char *cmd)
X`7B
X`09int old0;
X
X`09TRACE(("writePipe(cmd='%s')`5Cn", cmd))
X
X`09TTkclose();`09/* close the keyboard in case of error */
X
X`09(void)fclose(*myWrtr);
X`09*myWrtr = fopen(myName`5B0`5D, "r");
X
X`09old0 = dup(0);
X`09dup2(fileno(*myWrtr), 0);
X
X`09myRval = system(cmd);
X
X`09/* restore old std... */
X`09dup2(old0, 0); close(old0);
X
X`09TTkopen();`09/* reopen the keyboard */
X`7D
X#endif
X
XFILE *
Xnpopen (char *cmd, const char *type)
X`7B
X`09FILE *ff = 0;
X
X`09if (*type == 'r') `7B
X`09`09(void)inout_popen(`26ff, (FILE **)0, cmd);
X`09`7D else if (*type == 'w') `7B
X`09`09(void)inout_popen((FILE **)0, `26ff, cmd);
X`09`7D
X`09return ff;
X`7D
X
X/*
X * Create pipe with either write- _or_ read-semantics.  Fortunately for us,
X * on SYS_MSDOS, we don't need both at the same instant.
X */
Xint
Xinout_popen(FILE **fr, \0B08w, char *cmd)
X`7B
X`09char`09`09*type = (fw != 0) ? "w" : "r";
X`09static FILE`09*pp = 0;
X`09int`09`09fd;
X
X`09TRACE(("inout_popen(fr=%p, fw=%p, cmd='%s')`5Cn", fr, fw, cmd))
X#ifdef GMDW32PIPES
X`09if (global_g_val(GMDW32PIPES))
X`09    return (w32_inout_popen(fr, fw, cmd));
X#endif
X
X`09/* Create the file that will hold the pipe's content */
X`09if ((fd = createTemp(type)) >= 0) `7B
X`09`09if (fw == 0) `7B
X`09`09`09*fr = pp = readPipe(cmd, -1, fd);
X`09`09`09myWrtr = 0;
X`09`09`09myPipe = `26pp;  /* Can't assign "fr", may be stack-based. */
X`09`09`09myCmds = 0;
X`09`09`7D else `7B
X`09`09`09*fw = pp = fdopen(fd, type);
X`09`09`09myPipe = fr;
X`09`09`09myWrtr = `26pp;  /* Can't assign "fw", may be stack-based. */
X`09`09`09myCmds = strmalloc(cmd);
X`09`09`7D
X`09`7D
X`09return (pp != 0);
X`7D
X
X/*
X * If we were writing to a pipe, invoke the read-process with stdin set to the
V
X * temporary-file.  This is used in the filter-buffer code, which needs both
X * read- and write-pipes.
X */
Xvoid
Xnpflush (void)
X`7B
X#ifdef GMDW32PIPES
X`09if (global_g_val(GMDW32PIPES))
X`09    return;
X#endif
X`09if (myCmds != 0) `7B
X`09`09if (myWrtr != 0) `7B
X`09`09`09(void)fflush(*myWrtr);
X#if UNUSED
X`09`09`09(void)fclose(*myWrtr);
X`09`09`09*myWrtr = fopen(myName`5B0`5D, "r");
X#endif
X`09`09`09rewind(*myWrtr);
X`09`09`09*myPipe = readPipe(myCmds, fileno(*myWrtr), createTemp("r"));
X`09`09`7D
X`09`09FreeAndNull(myCmds);
X`09`7D
X`7D
X
Xvoid
Xnpclose (FILE *fp)
X`7B
X#ifdef GMDW32PIPES
X`09if (global_g_val(GMDW32PIPES))
X`09`7B
X`09    w32_npclose(fp);
X`09    return;
X`09`7D
X#endif
X#if SYS_MSDOS
X`09if (myWrtr != 0 `26`26 myPipe == 0)
X`09`09writePipe(myCmds);
X#endif
X`09closePipe(`26myWrtr);
X`09closePipe(`26myPipe);
X`09deleteTemp();
X`7D
X
Xint
Xsoftfork(void)`09/* dummy function to make filter-region work */
X`7B
X`09return 0;
X`7D
X
X#if TEST_DOS_PIPES
Xint
Xsystem_SHELL(char *cmd)`09/* dummy function */
X`7B
X`09return 0;
X`7D
X#endif /* TEST_DOS_PIPES */
X#endif /* SYS_MSDOS */
$ call unpack [.VILE-8_0]NPOPEN.C;1 -
 105433282 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 19 87 152
$!
$ create 'f'
X/*
X * Uses the Win32 console API.
X *
X * $Header: /usr/build/vile/vile/RCS/ntconio.c,v 1.34 1998/05/19 11:04:47 cmor
Vgan Exp $
X *
X */
X
X#include <windows.h>
X
X#define`09termdef`091`09`09`09/* don't define "term" external */
X
X#include        "estruct.h"
X#include        "edef.h"
X
X#define NROW`09128`09`09`09/* Max Screen size.&0209*/
X#define NCOL    256`09`09`09/* Edit if you want to.         */
X#define`09MARGIN`098`09`09`09/* size of minimum margin and`09*/
X#define`09SCRSIZ`0964`09`09`09/* scroll size for extended lines */
X#define`09NPAUSE`09200`09`09`09/* # times thru update to pause */
X#define NOKYMAP (-1)
X
X#define`09AttrColor(b,f)`09((WORD)(((ctrans`5Bb`5D `26 15) << 4) `7C \1908f
V\1907))
X
Xstatic`09int`09ntgetch`09`09(void);
Xstatic`09void`09ntmove`09`09(int, int);
Xstatic`09void`09nteeol`09`09(void);
Xstatic`09void`09nteeop`09`09(void);
Xstatic`09void`09ntbeep`09`09(void);
Xstatic`09void`09ntopen`09`09(void);
Xstatic`09void`09ntrev`09`09(UINT);
Xstatic`09int`09ntcres`09`09(const char *);
Xstatic`09void`09ntclose`09`09(void);
Xstatic`09void`09ntputc`09`09(int);
Xstatic`09int`09nttypahead`09(void);
Xstatic`09void`09ntkopen`09`09(void);
Xstatic`09void`09ntkclose`09(void);
X#if OPT_COLOR
Xstatic`09void`09ntfcol`09`09(int);
Xstatic`09void`09ntbcol`09`09(int);
X#endif
Xstatic`09void`09ntflush`09`09(void);
Xstatic`09void`09ntscroll`09(int, int, int);
X#if OPT_ICURSOR
Xstatic`09void`09nticursor`09(int);
X#endif
X#if OPT_TITLE
Xstatic`09void`09nttitle`09`09(char *);
X#endif
X
Xstatic HANDLE hConsoleOutput;`09`09/* handle to the c\2106 display */
Xstatic HANDLE hOldConsoleOutput;`09/* handle to the old c\2406 display */
Xstatic HANDLE hConsoleInput;
Xstatic CONSOLE_SCREEN_BUFFER_INFO csbi;
Xstatic WORD originalAttribute;
X
Xstatic int`09cfcolor = -1;`09`09/* current forground color */
Xstatic int`09cbcolor = -1;`09`09/* current background color */
Xstatic int`09nfcolor = -1;`09`09/* normal foreground \2206*/
Xstatic int`09nbcolor = -1;`09`09/* normal background \2206*/
Xstatic int`09crow = -1;`09`09/* current row */
Xstatic int`09ccol = -1;`09`09/* current col */
Xstatic int`09keyboard_open = FALSE;`09/* \1A08 is open */
Xstatic int`09keyboard_was_closed = TRUE;
X
X/* ansi to ibm color translation table */
Xstatic`09const char *initpalettestr = "0 4 2 6 1 5 3 7 8 12 10 14 9 13 11 15";
V
X/* black, red, green, yellow, blue, magenta, cyan, white   */
X
Xstatic`09char`09linebuf`5BNCOL`5D;
Xstatic`09int`09bufpos = 0;
X
+-+-+-+-+-+-+-+-  END  OF PART 85 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 86 -+-+-+-+-+-+-+-+
Xstatic  void`09scflush  (void);
X
X/*
X * Standard terminal interface dispatch table. None of the fields point into
X * "termio" code.
X */
X
XTERM    term    = `7B
X`09NROW,
X`09NROW,
X`09NCOL,
X`09NCOL,
X`09MARGIN,
X`09SCRSIZ,
X`09NPAUSE,
X`09ntopen,
X`09ntclose,
X`09ntkopen,
X`09ntkclose,
X`09ntgetch,
X`09ntputc,
X`09nttypahead,
X`09ntflush,
X`09ntmove,
X`09nteeol,
X`09nteeop,
X`09ntbeep,
X`09ntrev,
X`09ntcres,
X#if OPT_COLOR
X`09ntfcol,
X`09ntbcol,
X`09set_ctrans,
X#else
X`09null_t_setfor,
X`09null_t_setback,
X`09null_t_setpal,
X#endif
X`09ntscroll,
X`09null_t_pflush,
X#if OPT_ICURSOR
X`09nticursor,
X#else
X`09null_t_icursor,
X#endif
X#if OPT_TITLE
X`09nttitle,
X#else
X`09null_t_title,
X#endif
X`09null_t_watchfd,
X`09null_t_unwatchfd,
X`7D;
X
X
X
X#if OPT_ICURSOR
Xstatic void
Xnticursor(int cmode)
X`7B
X`09CONSOLE_CURSOR_INFO cci;
X
X`09switch (cmode) `7B
X`09case -1:
X`09`09cci.dwSize = 0;
X`09`09cci.bVisible = FALSE;
X`09`09break;
X`09case 0:
X`09`09cci.dwSize = 1;
X`09`09cci.bVisible = TRUE;
X`09`09break;
X`09case 1:
X`09`09cci.dwSize = 100;
X`09`09cci.bVisible = TRUE;
X`09`09break;
X`09`7D
X`09SetConsoleCursorInfo(h\1307Output, `26cci);
X`7D
X#endif
X
X#if OPT_TITLE
Xstatic void
Xnttitle(char *title)`09`09/* set the current window title */
X`7B
X`09SetConsoleTitle(title);
X`7D
X#endif
X
X#if OPT_COLOR
Xstatic void
Xntfcol(int color)`09`09/* set the current output\2206 */
X`7B
X`09scflush();
X`09nfcolor = c\0A0Aolor;
X`7D
X
Xstatic void
Xntbcol(int color)`09`09/* set the current background\2606 */
X`7B
X`09scflush();
X`09nbcolor = c\0A0Aolor;
X`7D
X#endif
X
Xstatic void
Xscflush(void)
X`7B
X`09if (bufpos) `7B
X`09`09COORD coordCursor;
X`09`09DWORD written;
X
X`09`09coordCursor.X = ccol;
X`09`09coordCursor.Y = crow;
X`09`09WriteConsoleOutputCharacter(
X`09`09`09hConsoleOutput, linebuf, bufpos, coordCursor, `26written
X`09`09);
X`09`09FillConsoleOutputAttribute(
X`09`09`09hConsoleOutput, AttrColor(cbcolor, cfcolor),
X`09`09`09bufpos, coordCursor, `26written
X`09`09);
X`09`09ccol += bufpos;
X`09`09bufpos = 0;
X`09`7D
X`7D
X
Xstatic void
Xntflush(void)
X`7B
X        COORD coordCursor;
X
X`09scflush();
X        coordCursor.X = ccol;
X        coordCursor.Y = crow;
X`09SetConsoleCursorPosition(h\1707Output, coord\2406);
X`7D
X
Xstatic void
Xntmove(int row, int col)
X`7B
X`09scflush();
X`09crow = row;
X`09ccol = col;
X`7D
X
X/* erase to the end of the line */
Xstatic void
Xnteeol(void)
X`7B
X`09DWORD written;
X        COORD coordCursor;
X
X`09scflush();
X        coordCursor.X = ccol;
X        coordCursor.Y = crow;
X`09FillConsoleOutputCharacter(
X`09`09hConsoleOutput, ' ', csbi.dwMaximumWindowSize.X - ccol,
X`09`09coordCursor, `26written
X`09);
X`09FillConsoleOutputAttribute(
X`09`09hConsoleOutput, AttrColor(cbcolor, cfcolor),
X`09`09csbi.dwMaximumWindowSize.X - ccol, coordCursor, `26written
X`09);
X`7D
X
X/*
X * vile very rarely generates any of the ASCII printing control characters
X * except for a few hand coded routines but we have to support them anyway.
X */
X
X/* put a character at the current position in \180Ccolors */
Xstatic void
Xntputc(int ch)
X`7B
X`09/* This is an optimization for the most common case. */
X`09if (ch >= ' ') `7B
X`09`09linebuf`5Bbufpos++`5D = ch;
X`09`09return;
X`09`7D
X
X`09switch (ch) `7B
X
X`09case '`5Cb':
X`09`09scflush();
X`09`09if (ccol)
X`09`09`09ccol--;
X`09`09break;
X
X`09case '`5Ca':
X`09`09ntbeep();
X`09`09break;
X
X`09case '`5Ct':
X`09`09scflush();
X`09`09do
X`09`09`09linebuf`5Bbufpos++`5D = ' ';
X`09`09while ((ccol + bufpos) % 8 != 0);
X`09`09break;
X
X`09case '`5Cr':
X`09`09scflush();
X`09`09ccol = 0;
X`09`09break;
X
X`09case '`5Cn':
X`09`09scflush();
X`09`09if (crow < csbi.dwMaximumWindowSize.Y - 1)
X`09`09`09crow++;
X`09`09else
X`09`09`09ntscroll(1, 0, csbi.dwMaximumWindowSize.Y - 1);
X`09`09break;
X
X`09default:
X`09`09linebuf`5Bbufpos++`5D = ch;
X`09`09break;
X`09`7D
X`7D
X
Xstatic void
Xnteeop(void)
X`7B
X`09DWORD cnt;
X`09DWORD written;
X        COORD coordCursor;
X
X`09scflush();
X        coordCursor.X = ccol;
X        coordCursor.Y = crow;
X`09cnt = csbi.dwMaximumWindowSize.X - ccol
X`09`09+ (csbi.dwMaximumWindowSize.Y - crow - 1)
X`09`09* csbi.dwMaximumWindowSize.X;
X`09FillConsoleOutputCharacter(
X`09`09hConsoleOutput, ' ', cnt, coordCursor, `26written
X`09);
X`09FillConsoleOutputAttribute(
X`09`09hConsoleOutput, AttrColor(cbcolor, cfcolor), cnt,
X`09`09coordCursor, `26written
X`09);
X`7D
X
Xstatic void
Xntrev(UINT reverse)`09`09/* change\1408 video state */
X`7B
X`09scflush();
X`09if (reverse) `7B
X`09`09if (reverse == VABOLD)
X`09`09`09cfcolor `7C= FOREGROUND_INTENSITY;
X`09`09else if (reverse == VAITAL)
X`09`09`09cbcolor `7C= BACKGROUND_INTENSITY;
X`09`09else if (reverse `26 VACOLOR)
X`09`09`09cfcolor = ((VCOLORNUM(reverse)) `26 (NCOLORS - 1));
X`09`09else if (reverse `26 VASPCOL)
X`09`09`09cfcolor = (reverse `26 (NCOLORS - 1));
X`09`09else `7B  /* all other states == reverse video */
X`09`09`09cbcolor = nfcolor;
X`09`09`09cfcolor = nbcolor;
X`09`09`7D
X`09`7D
X`09else `7B
X`09`09cbcolor = n\0A06;
X`09`09cfcolor = n\0A06;
X`09`7D
X`7D
X
Xstatic int
Xntcres(const char *res)`09/* change screen resolution */
X`7B
X`09scflush();
X`09return 0;
X`7D
X
X#if`09OPT_FLASH
Xstatic void
Xflash_display()
X`7B
X`09DWORD length = term.t_ncol *\0E09row;
X`09DWORD got;
X`09WORD *buf1 = malloc(sizeof(*buf1)*length);
X`09WORD *buf2 = malloc(sizeof(*buf2)*length);
X`09static COORD origin;
X`09ReadConsoleOutputAttribute(h\180D, buf1, length, origin, `26got);
X`09ReadConsoleOutputAttribute(h\180D, buf2, length, origin, `26got);
X`09for (got = 0; got < length; got++) `7B
X`09`09buf2`5Bgot`5D `5E= (FOREGROUND_INTENSITY`7CBACK\1510);
X`09`7D
X`09WriteConsoleOutputAttribute(h\180D, buf2, length, origin, `26got);
X`09Sleep(200);
X`09WriteConsoleOutputAttribute(h\180D, buf1, length, origin, `26got);
X`09free(buf1);
X`09free(buf2);
X`7D
X#endif
X
Xstatic void
Xntbeep(void)
X`7B
X#if`09OPT_FLASH
X`09if (global_g_val(GMDFLASH)) `7B
X`09`09flash_display();
X`09`09return;
X`09`7D
X#endif
X`09MessageBeep(0xffffffff);
X`7D
X
Xstatic BOOL WINAPI
Xnthandler(DWORD ctrl_type)
X`7B
X`09switch (ctrl_type) `7B
X`09case CTRL_CLOSE_EVENT:
X`09case CTRL_LOGOFF_EVENT:
X`09case CTRL_SHUTDOWN_EVENT:
X`09`09imdying(1);
X`09`09break;
X`09`7D
X`09return TRUE;
X`7D
X
Xstatic void
Xntopen(void)
X`7B
X`09TRACE(("ntopen`5Cn"))
X`09set_palette(init\0C07str);
X`09hOldConsoleOutput = 0;
X`09hConsoleOutput = GetStdHandle(STD_OUTPUT_HANDLE);
X`09GetConsoleScreenBufferInfo(h\1907Output, `26csbi);
X`09if (csbi.dwMaximumWindowSize.Y !=
X`09    csbi.srWindow.Bottom -\170FTop + 1
X`09    `7C`7C csbi.dwMaximumWindowSize.X !=
X`09    csbi.srWindow.Right -\160FLeft + 1) `7B
X`09`09hOldConsoleOutput = h\110D;
X`09`09hConsoleOutput = Create\1607ScreenBuffer(GENERIC_READ`7C\0D08WRITE,
X`09`09`090, NULL, CONSOLE_TEXTMODE_BUFFER\1F06);
X`09`09SetConsoleActiveScreenBuffer(h\1B07Output);
X`09`09GetConsoleScreenBufferInfo(h\1907Output, `26csbi);
X`09`7D
X`09originalAttribute = csbi.w\1209s;
X`09crow = csbi.dwCursorPosition.Y;
X`09ccol = csbi.dwCursorPosition.X;
X`09nfcolor = c\0A09g\1406;
X`09nbcolor = c\0A09g\1406;
X`09newscreensize(csbi.dwMaximumWindowSize.Y, \1C19X);
X`09hConsoleInput = GetStdHandle(STD_INPUT_HANDLE);
X`09SetConsoleCtrlHandler(nth\0A06, TRUE);
X`7D
X
Xstatic void
Xntclose(void)
X`7B
X`09TRACE(("ntclose`5Cn"))
X`09scflush();
X`09ntmove(term.t_nrow - 1, 0);
X`09nteeol();
X`09ntflush();
X`09SetConsoleTextAttribute(h\1607Output, original\2209);
X`09if (hOldConsoleOutput) `7B
X`09`09SetConsoleActiveScreenBuffer(hOld\1E07Output);
X`09`09CloseHandle(hConsoleOutput);
X`09`7D
X`09SetConsoleCtrlHandler(nth\0A06, FALSE);
X`09SetConsoleMode(h\0D07Input, ENABLE_LINE_INPUT`7C\1207ECHO\120EPROCESSED
V\2906);
X`09keyboard_open = FALSE;
X`7D
X
Xstatic void
Xntkopen(void)`09/* open the keyboard */
X`7B
X`09TRACE(("ntkopen (open:%d, was-closed:%d)`5Cn", keyboard_open\0F0Bwas_\2B06)
V)
X`09if (keyboard_open)
X`09`09return;
X`09if (hConsoleOutput)
X`09`09SetConsoleActiveScreenBuffer(h\1B07Output);
X`09keyboard_open = TRUE;
X#ifdef YOU_WANT_TO_KERNEL_FAULT_WIN95_WHEN_CTRL_BRK_IS_PRESSED
X`09SetConsoleCtrlHandler(NULL, TRUE);
X#endif
X`09SetConsoleMode(h\0D07Input, ENABLE_MOUSE_INPUT`7C\1307WINDOW\1406);
X`7D
X
Xstatic void
Xntkclose(void)`09/* close the keyboard */
X`7B
X`09TRACE(("ntkclose`5Cn"))
X`09if (!keyboard_open)
X`09`09return;
X`09keyboard_open = FALSE;
X`09keyboard_was_closed = TRUE;
X`09if (hOldConsoleOutput)
X`09`09SetConsoleActiveScreenBuffer(hOld\1E07Output);
X#ifdef YOU_WANT_TO_KERNEL_FAULT_WIN95_WHEN_CTRL_BRK_IS_PRESSED
X`09SetConsoleCtrlHandler(NULL, FALSE);
X#endif
X`7D
X
Xstatic struct `7B
X`09int`09windows;
X`09int`09vile;
X`09int`09shift;
X`7D keyxlate`5B`5D = `7B
X`09VK_NEXT,`09KEY_Next,`090,
X`09VK_PRIOR,`09KEY_Prior,`090,
X`09VK_END,`09`09KEY_End,`090,
X`09VK_HOME,`09KEY_Home,`090,
X`09VK_LEFT,`09KEY_Left,`090,
X`09VK_RIGHT,`09KEY_Right,`090,
X`09VK_UP,`09`09KEY_Up,&02090,
X`09VK_DOWN,`09KEY_Down,`090,
X`09VK_INSERT,`09KEY_F33,   `09LEFT_ALT_PRESSED`7CRIGH\120D,
X`09VK_INSERT,`09KEY_F34,   `09LEFT_CTRL_PRESSED`7CRIGH\130E,
X`09VK_INSERT,`09KEY_F35,   `09SHIFT_PRESSED,
X`09VK_INSERT,`09KEY_Insert,`090,
X`09VK_DELETE,`09KEY_Delete,`090,
X`09VK_HELP,`09KEY_Help,`090,
X`09VK_SELECT,`09KEY_Select,`090,
X#if 0
X`09/* Merely pressing the Alt key generates a VK_MENU key event. */
X`09VK_MENU,`09KEY_Menu,`090,
X#endif
X`09VK_F1,`09`09KEY\09060,
X`09VK_F2,`09`09KEY\09060,
X`09VK_F3,`09`09KEY\09060,
X`09VK_F4,`09`09KEY\09060,
X`09VK_F5,`09`09KEY\09060,
X`09VK_F6,`09`09KEY\09060,
X`09VK_F7,`09`09KEY\09060,
X`09VK_F8,`09`09KEY\09060,
X`09VK_F9,`09`09KEY\09060,
X`09VK_F10,`09`09KEY\0A060,
X`09VK_F11,`09`09KEY\0A060,
X`09VK_F12,`09`09KEY\0A060,
X`09VK_F13,`09`09KEY\0A060,
X`09VK_F14,`09`09KEY\0A060,
X`09VK_F15,`09`09KEY\0A060,
X`09VK_F16,`09`09KEY\0A060,
X`09VK_F17,`09`09KEY\0A060,
X`09VK_F18,`09`09KEY\0A060,
X`09VK_F19,`09`09KEY\0A060,
X`09VK_F20,`09`09KEY\0A060,
X`09/* Manually translate Ctrl-6 into\0C06`5E. */
X`09'6',`09`09'`5E'-'@',`09LEFT_CTRL_PRESSED`7CRIGH\130E,
X`090,`09`090,
X`7D;
X
Xstatic int savedChar;
Xstatic int saveCount = 0;
X
Xstatic int
Xdecode_key_event(INPUT_RECORD *irp)
X`7B
X    int key;
X    int i;
X
X    if (!irp->Event.Key\0906bKeyDown)
X        return (NOKYMAP);
X
X    key = (unsigned char) irp->Event.Key\0906uChar.AsciiChar;
X    if (key != 0)
X        return key;
X
X    for (i = 0; keyxlate`5Bi`5D.windows; i++)
X    `7B
X        if (keyxlate`5Bi`5D.windows == irp->Event.Key\0906wVirtualKeyCode)
X        `7B
X            if (keyxlate`5Bi`5D.shift != 0 `26`26
X        \0808  !(keyxlate`5Bi`5D.shift `26 irp->Event.Key\0906dwControlKeyStat
Ve))
X            `7B
X        \0808continue;
X            `7D
X            key = keyxlate`5Bi`5D.vile;
X            break;
X        `7D
X    `7D
X    if (key == 0)
X        return (NOKYMAP);
X
X    return key;
X`7D
X
Xstatic void
Xhandle_mouse_event(MOUSE_EVENT_RECORD mer)
X`7B
X`09int buttondown = FALSE;
X`09COORD first, current, last;
X`09int state;
X
X`09for_ever `7B
X`09`09switch (mer.dwEventFlags) `7B
X`09`09case 0:
X`09`09`09state = mer.dwButtonState;
X`09`09`09if (state == 0) `7B
X`09`09&0209if (!buttondown)
X`09`09&0209`09return;
X`09`09&0209buttondown = FALSE;
X`09`09&0209sel_yank(0);
X`09`09&0209return;
X`09`09`09`7D
X`09`09`09if (state `26 FROM_LEFT_1ST_BUTTON_PRESSED) `7B
X`09`09&0209if (buttondown) `7B
X`09`09&0209`09if (state `26 RIGHTMOST_BUTTON_PRESSED) `7B
X`09`09&0209&0209sel_release();
X`09`09&0209&0209(void)update(TRUE);
X`09`09&0209&0209return;
X`09`09&0209`09`7D
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09&0209buttondown = TRUE;
X`09`09&0209first = mer.dwMousePosition;
X`09`09&0209if (!setcursor(first.Y, \0906X))
X`09`09&0209`09return;
X`09`09&0209(void)sel_begin();
X`09`09&0209(void)update(TRUE);
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09break;
X
X`09`09case MOUSE_MOVED:
X`09`09`09if (!buttondown)
X`09`09&0209return;
X`09`09`09current = mer.dwMousePosition;
X`09`09`09if (!setcursor(current.Y, \0B08X))
X`09`09&0209break;
X`09`09`09last = current;
X`09`09`09if (!sel_extend(TRUE, TRUE))
X`09`09&0209break;
X`09`09`09(void)update(TRUE);
X`09`09`09break;
X`09`09`7D
X
X`09`09for_ever `7B
X`09`09`09INPUT_RECORD ir;
X`09`09`09DWORD nr;
X`09`09`09int key;
X
X`09`09`09if (!ReadConsoleInput(h\0E0C, `26ir, 1, `26nr))
X`09`09&0209imdying(0);
X`09`09`09switch (ir.EventType) `7B
X`09`09`09case KEY_EVENT:
X`09`09&0209key = decode_key_event(`26ir);
X`09`09&0209if (key == ESC) `7B
X`09`09&0209`09sel_release();
X`09`09&0209`09(void)update(TRUE);
X`09`09&0209`09return;
X`09`09&0209`7D
X`09`09&0209continue;
X
X`09`09`09case MOUSE_EVENT:
X`09`09&0209mer = ir.Event.MouseEvent;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09break;
X`09`09`7D
X`09`7D
X`7D
X
Xstatic int
Xntgetch(void)
X`7B
X`09INPUT_RECORD ir;
X`09DWORD nr;
X`09int key;
X
X`09if (saveCount > 0) `7B
X`09`09saveCount--;
X`09`09return savedChar;
X`09`7D
X
X`09for_ever `7B
X`09`09if (!ReadConsoleInput(h\0E0C, `26ir, 1, `26nr))
X`09`09`09imdying(0);
X`09`09switch(ir.EventType) `7B
X
X`09`09case KEY_EVENT:
X`09`09`09key = decode_key_event(`26ir);
X`09`09`09if (key == NOKYMAP)
X`09`09&0209continue;
X`09`09`09if (ir.Event.Key\0906wRepeatCount > 1) `7B
X`09`09&0209saveCount = ir.Event.Key\0906wRepeat\2106- 1;
X`09`09&0209savedChar = key;
X`09`09`09`7D
X`09`09`09return key;
X
X`09`09case WINDOW_BUFFER_SIZE_EVENT:
X`09`09`09newscreensize(
X`09`09&0209ir.Event.WindowBufferSize\1606dwSize.Y,
X`09`09&0209ir.Event.WindowBufferSize\1606dwSize.X
X`09`09`09);
X`09`09`09GetConsoleScreenBufferInfo(h\1907Output, `26csbi);
X`09`09`09continue;
X
X`09`09case MOUSE_EVENT:
X`09`09`09handle_mouse_event(ir.Event.MouseEvent);
X`09`09`09continue;
X
X`09`09`7D
X`09`7D
X`7D
X
X/*
X * The function `60kbhit' returns true if there are *any* input records
X * available.  We need to define our own type ahead routine because
X * otherwise events which we will discard (like pressing or releasing
X * the Shift key) can block screen updates because `60ntgetch' won't
X * return until a ordinary key event occurs.
X */
X
Xstatic int
Xnttypahead()
X`7B
X`09INPUT_RECORD ir;
X`09DWORD nr;
X`09int key;
X
X`09if (!keyboard_open)
X`09`09return 0;
X
X`09if (saveCount > 0)
X`09`09return 1;
X
X`09for (;;) `7B
X`09`09if (!PeekConsoleInput(h\0E0C, `26ir, 1, `26nr))
X`09`09`09return 0;
X
X`09`09if (nr == 0)
X`09`09`09break;
X
X`09`09switch(ir.EventType) `7B
X
X`09`09case KEY_EVENT:
X`09`09`09key = decode_key_event(`26ir);
X`09`09`09if (key < 0) `7B
X`09`09&0209ReadConsoleInput(h\0E0C, `26ir, 1, `26nr);
X`09`09&0209continue;
X`09`09`09`7D
X`09`09`09return 1;
X
X`09`09default:
X`09`09`09/* Ignore type-ahead for non-keyboard events. */
X`09`09`09return 0;
X`09`09`7D
X`09`7D
X
X`09return 0;
X`7D
X
X/*
X * Move 'n' lines starting at 'from' to 'to'
X *
X * OPT_PRETTIER_SCROLL is prettier but slower -- it scrolls a line at a time
X *`09instead of all at once.
X */
X
X/* move howmany lines starting at from to to */
Xstatic void
Xntscroll(int from, int to\0806n)
X`7B
X`09SMALL_RECT sRect;
X`09COORD dest;
X`09CHAR_INFO fill;
X`09int       scroll_pause;
X
X`09scflush();
X`09if (to == from)
X`09`09return;
X#if OPT_PRETTIER_SCROLL
X`09if (absol(from-to) > 1) `7B
X`09`09ntscroll(from, (from<to) ? to-1:to+1, n);
X`09`09if (from < to)
X`09`09`09from = to-1;
X`09`09else
X`09`09`09from = to+1;
X`09`7D
X#endif
X`09fill.Char.AsciiChar = ' ';
X`09fill.Attributes = AttrColor(cbcolor, cfcolor);
X
X`09sRect.Left = 0;
X`09sRect.Top = from;
X`09sRect.Right = csbi.dwMaximumWindowSize.X - 1;
X`09sRect.Bottom = from + n - 1;
X
X`09dest.X = 0;
X`09dest.Y = to;
X
X`09ScrollConsoleScreenBuffer(h\1507Output, `26sRect, NULL, dest, `26fill);
X`09if ((scroll_pause = global_g_val(GVAL_SCROLLPAUSE)) > 0)
X`09`7B
X`09`09/*
X`09`09 * If the user has cheap video HW (1 MB or less) and
X`09`09 * there's a busy background app (say, dev studio), then
X`09`09 * the console version of vile can exhibit serious repaint
X`09`09 * problems when the display is rapidly scrolled.  By
X`09`09 * inserting a user-defined sleep after the scroll, the
X`09`09 * video HW has a chance to properly paint before the
X`09`09 * next scroll operation.
X`09`09 */
X
X`09`09Sleep(scroll_pause);
X`09`7D
X
X#if !OPT_PRETTIER_SCROLL
X`09if (absol(from - to) > n) `7B
X`09`09DWORD cnt;
X`09`09DWORD written;
X`09`09COORD coordCursor;
X
X`09`09coordCursor.X = 0;
X`09`09if (to > from) `7B
X`09`09`09coordCursor.Y = from + n;
X`09`09`09cnt = to - from - n;
X`09`09`7D
X`09`09else `7B
X`09`09`09coordCursor.Y = to + n;
X`09`09`09cnt = from - to - n;
X`09`09`7D
X`09`09cnt *= csbi.dwMaximumWindowSize.X;
X`09`09FillConsoleOutputCharacter(
X`09`09`09hConsoleOutput, ' ', cnt, coordCursor, `26written
X`09`09);
X`09`09FillConsoleOutputAttribute(
X`09`09`09hConsoleOutput, AttrColor(cbcolor, cfcolor), cnt,
X`09`09`09coordCursor, `26written
X`09`09);
X`09`7D
X#endif
X`7D
X
Xvoid
Xntcons_reopen(void)
X`7B
X`09/* If we are coming back from a shell command, pick up the current window
X`09 * size, since that may have changed due to a 'mode con' command.  Run
X`09 * this after the 'pressreturn()' call, since otherwise that gets lost
X`09 * by side-effects of this code.
X`09 */
X`09if (keyboard_was_closed) `7B
X`09`09CONSOLE_SCREEN_BUFFER_INFO temp;
X`09`09keyboard_was_closed = FALSE;
X`09`09GetConsoleScreenBufferInfo(h\1907Output, `26temp);
X`09`09newscreensize(temp.dwMaximumWindowSize.Y, \1C19X);
X`09`7D
X`7D
$ call unpack [.VILE-8_0]NTCONIO.C;1 -
 74065937 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 36 88 152
$!
$ create 'f'
X/*
X * Uses the Win32 screen API.
X *
X * $Header: /usr/build/vile/vile/RCS/ntwinio.c,v 1.10 1998/05/27 10:22:41 tom
V Exp $
X * Written by T.E.Dickey for vile (october 1997).
X * -- improvements by Clark Morgan (see w32cbrd.c, w32pipe.c).
X */
X
X#include <windows.h>
X#include <commdlg.h>
X
X#define`09termdef`091`09`09`09/* don't define "term" external */
X
X#include        "estruct.h"
X#include        "edef.h"
X#include        "pscreen.h"
X
X#undef RECT`09/* FIXME: symbol conflict */
X
X#if OPT_TRACE
X#define IGN_PROC(tag,name) `5C
X `09case name: `5C
X`09`09TRACE((tag #name " (ignored)`5Cn")); `5C
X`09`09break;
X
X#define DEF_PROC(tag,name) `5C
X `09case name: `5C
X`09`09TRACE((tag #name "`5Cn")); `5C
X`09`09return (DefWindowProc(hWnd, message, wParam, lParam))
X#else
X#define IGN_PROC(tag,name) case name: break;
X#define DEF_PROC(tag,name) /*nothing*/
X#endif
X
X#define MY_FONT  SYSTEM_FIXED_FONT`09/* or ANSI\160C`09*/
X#define MY_CLASS "VileWClass"
X#define MY_APPLE "Vile Application"
X
X#define GetMyFont() vile_font
X
X#define MM_FILE 1
X#define MM_FONT 2
X
X#define NROW`09128`09`09`09/* Max Screen size.&0209*/
X#define NCOL    256`09`09`09/* Edit if you want to.         */
X#define`09MARGIN`098`09`09`09/* size of minimum margin and`09*/
X#define`09SCRSIZ`0964`09`09`09/* scroll size for extended lines */
X#define`09NPAUSE`09200`09`09`09/* # times thru update to pause */
X#define NOKYMAP (-1)
X
X#define`09AttrColor(b,f)`09((WORD)(((ctrans`5Bb`5D `26 15) << 4) `7C \1908f
V\1907))
X#define Row(n) ((n) * nLineHeight)
X#define Col(n) ((n) * nCharWidth)
X
X#define RowToY(n) ((n) / nLineHeight)
X#define ColToX(n) ((n) / nCharWidth)
X
Xstatic`09int`09ntgetch`09`09(void);
Xstatic`09void`09ntmove`09`09(int, int);
Xstatic`09void`09nteeol`09`09(void);
Xstatic`09void`09nteeop`09`09(void);
Xstatic`09void`09ntbeep`09`09(void);
Xstatic`09void`09ntopen`09`09(void);
Xstatic`09void`09ntrev`09`09(UINT);
Xstatic`09int`09ntcres`09`09(const char *);
Xstatic`09void`09ntclose`09`09(void);
Xstatic`09void`09ntputc`09`09(int);
Xstatic`09int`09nttypahead`09(void);
Xstatic`09void`09ntkopen`09`09(void);
Xstatic`09void`09ntkclose`09(void);
X#if OPT_COLOR
Xstatic`09void`09ntfcol`09`09(int);
Xstatic`09void`09ntbcol`09`09(int);
X#endif
Xstatic`09void`09ntflush`09`09(void);
Xstatic`09void`09ntscroll`09(int, int, int);
X#if OPT_ICURSOR
Xstatic`09void`09nticursor`09(int);
X#endif
X#if OPT_TITLE
Xstatic`09void`09nttitle`09`09(char *);
X#endif
X
Xstatic`09HANDLE`09vile_hinstance;
Xstatic`09HWND`09vile_hwnd;
Xstatic`09HMENU`09vile_menu;
Xstatic`09HFONT`09vile_font;
Xstatic`09LOGFONT`09vile_logfont;
Xstatic`09HANDLE`09hAccTable;   /* handle to accelerator table */
Xstatic`09HCURSOR`09hglass_cursor;
Xstatic`09HCURSOR`09arrow_cursor;
Xstatic`09int`09nLineHeight = 10;
Xstatic`09int`09nCharWidth = 8;
Xstatic`09int`09caret_visible = 0;
Xstatic`09int`09caret_exists = 0;
Xstatic`09int`09vile_in_getfkey = 0;
Xstatic`09int`09vile_resizing = FALSE;`09/* rely on repaint_window if true */
Xstatic`09DWORD`09default_fcolor;
Xstatic`09DWORD`09default_bcolor;
X
Xstatic int`09nfcolor = -1;`09`09/* normal foreground \2206*/
Xstatic int`09nbcolor = -1;`09`09/* normal background \2206*/
Xstatic int`09ninvert = FALSE;`09/* normal colors inverted? */
Xstatic int`09crow = -1;`09`09/* current row */
Xstatic int`09ccol = -1;`09`09/* current col */
X
X/* ansi to ibm color translation table */
Xstatic`09const char *initpalettestr = "0 4 2 6 1 5 3 7 8 12 10 14 9 13 11 15";
V
X/* black, red, green, yellow, blue, magenta, cyan, white   */
X
Xstatic`09int`09cur_pos = 0;
Xstatic`09VIDEO_ATTR cur_atr = 0;
X
Xstatic`09void`09repaint_window(HWND hWnd);
Xstatic  void`09scflush  (void);
X
X/*
X * Standard terminal interface dispatch table. None of the fields point into
X * "termio" code.
X */
X
XTERM    term    = `7B
X`09NROW,
X`09NROW,
X`09NCOL,
X`09NCOL,
X`09MARGIN,
X`09SCRSIZ,
X`09NPAUSE,
X`09ntopen,
X`09ntclose,
X`09ntkopen,
X`09ntkclose,
X`09ntgetch,
X`09ntputc,
X`09nttypahead,
X`09ntflush,
X`09ntmove,
X`09nteeol,
X`09nteeop,
X`09ntbeep,
X`09ntrev,
X`09ntcres,
X#if OPT_COLOR
X`09ntfcol,
X`09ntbcol,
X`09set_ctrans,
X#else
X`09null_t_setfor,
X`09null_t_setback,
X`09null_t_setpal,
X#endif
X`09ntscroll,
X`09null_t_pflush,
X#if OPT_ICURSOR
X`09nticursor,
X#else
X`09null_t_icursor,
X#endif
X#if OPT_TITLE
X`09nttitle,
X#else
X`09null_t_title,
X#endif
X`09null_t_watchfd,
X`09null_t_unwatchfd,
X`7D;
X
Xstatic HBRUSH
XBackground(HDC hdc)
X`7B
X`09TRACE(("Background`5Cn"));
X`09return CreateSolidBrush(GetBkColor(hdc));
X`7D
X
Xstatic void
XAdjustWindowSize(int h, int w)
X`7B
X`09RECT crect;
X`09RECT wrect;
X
X`09GetClientRect(vile_hwnd, `26crect);
X`09GetWindowRect(vile_hwnd, `26wrect);
X
X`09wrect.right  += (nCharWidth  * w) - c\240A;
X`09wrect.bottom += (nLineHeight * h) - c\240B;
X
X`09MoveWindow(vile_hwnd,
X`09`09wrect.left,
X`09`09wrect.top,
X`09`09wrect.right - \0E06left,
X`09`09wrect.bottom - \0F06top,
X`09`09TRUE);
X`7D
X
Xstatic void
XResizeClient()
X`7B
X`09int h, w;
X`09RECT crect;
X
X`09GetClientRect(vile_hwnd, `26crect);
X
X`09h = (crect.bottom - \0F06top) / nLineHeight;
X`09w = (crect.right - \0E06left) / nCharWidth;
X
X`09if ((h > 1 `26`26 h != term.t_nrow) `7C`7C (w\1F08w \1F0Bcol)) `7B
X`09`09TRACE(("ResizeClient %dx%d`5Cn", h, w));
X`09`09vile_resizing = TRUE;
X`09`09newscreensize(h, w);
X`09`09vile_resizing = FALSE;
X`09`09TRACE(("...ResizeClient %dx%d`5Cn", h, w));
X`09`7D
X
X`09AdjustWindowSize(h, w);
X`7D
X
X#define NORMAL_COLOR 180
X#define BRIGHT_COLOR 255
X
Xstatic COLORREF
Xcolor_of (int code)
X`7B
X`09int red = 0, green\0B06blue = 0;
X`09COLORREF result = 0;
X`09if (code `26 1)
X`09`09red = NORMAL_COLOR;
X`09if (code `26 2)
X`09`09green = NORMAL_COLOR;
X`09if (code `26 4)
X`09`09blue = NORMAL_COLOR;
X`09if (code `26 8) `7B
X`09`09if (red)   red   = BRIGHT_COLOR;
X`09`09if (green) green = BRIGHT_COLOR;
X`09`09if (blue)  blue  = BRIGHT_COLOR;
X`09`7D
X`09return PALETTERGB(red, green, blue);
X`7D
X
Xstatic void
Xattr_to_colors(VIDEO_ATTR attr, int *fcolor\0D07bcolor)
X`7B
X`09*fcolor = n\0A06;
X`09*bcolor = n\0A06;
X`09ninvert = FALSE;
X
X`09if (attr) `7B
X`09`09if (attr == VABOLD)
X`09`09`09*fcolor `7C= FOREGROUND_INTENSITY;
X`09`09else if (attr == VAITAL)
X`09`09`09*bcolor `7C= BACKGROUND_INTENSITY;
X`09`09else if (attr `26 VACOLOR)
X`09`09`09*fcolor = ((VCOLORNUM(attr)) `26 (NCOLORS - 1));
X`09`09else if (attr `26 VASPCOL)
X`09`09`09*fcolor = (attr `26 (NCOLORS - 1));
X`09`09else `7B  /* all other states == reverse video */
X`09`09`09*bcolor = nfcolor;
X`09`09`09*fcolor = nbcolor;
X`09`09`09ninvert = TRUE;
X`09`09`7D
X`09`7D
X`7D
X
Xstatic void
Xset_colors (HDC hdc, VIDEO_ATTR attr)
X`7B
X`09int fcolor;
X`09int bcolor;
X
X`09attr_to_colors(attr, `26fcolor, `26bcolor);
X
X`09if (fcolor < 0)
X`09`09fcolor = ninvert
X`09`09`09? default_bcolor
X`09`09`09: default_fcolor;
X`09else
X`09`09fcolor = color_of(\1206);
X
X`09if (bcolor < 0)
X`09`09bcolor = ninvert
X`09`09`09? default_fcolor
X`09`09`09: default_bcolor;
X`09else
X`09`09bcolor = color_of(\1206);
X
X`09SetTextColor(hdc, fcolor);
X`09SetBkColor(hdc,   bcolor);
X`7D
X
X#if OPT_ICURSOR
Xstatic void nticursor(int cmode)
X`7B
X`7D
X#endif
X
Xstatic int fhide_cursor(void)
X`7B
X`09TRACE(("fhide_cursor`5Cn"));
X`09if(caret_visible) `7B
X`09`09HideCaret(vile_hwnd);
X`09`09caret_visible = 0;
X`09`7D
X`09if(caret_exists) `7B
X`09`09DestroyCaret();
X`09`09caret_exists = 0;
X`09`7D
X`09return 0;
X`7D
X
Xstatic int fshow_cursor(void)
X`7B
X`09int x, y;
X`09fhide_cursor();
X
X`09TRACE(("fshow_cursor`5Cn"));
X`09if (!caret_exists) `7B
X`09`09CreateCaret(vile_hwnd, (HBITMAP) 0, nCharWidth, nLineHeight);
X`09`09caret_exists = 1;
X`09`7D
X`09x = Col(ttcol) + 1;
X`09y = Row(ttrow) + 1;
X`09SetCaretPos(x, y);
X`09ShowCaret(vile_hwnd);
X`09caret_visible = 1;
X`09return 0;
X`7D
X
X/* Notes: lpntm is a pointer to a TEXTMETRIC struct if FontType does not
X * have TRUETYPE_FONTTYPE set, but we only need the tmPitchAndFamily member,
X * which has the same alignment as in NEWTEXTMETRIC.
X */
Xstatic int CALLBACK
Xenumerate_fonts(
X`09ENUMLOGFONT *lpelf,
X`09NEWTEXTMETRIC *lpntm,
X`09int FontType,
X`09LPARAM lParam)
X`7B
X`09int code = 2;
X`09LOGFONT *src = `26(lpelf->elfLogFont);
X`09LOGFONT *dst = ((\1109)lParam);
X
X`09if ((src->lfPitchAndFamily `26 3) != FIXED_PITCH) `7B
X`09`09code = 1;
X`09`7D else `7B
X`09`09*dst = *src;
X`09`09if (src->lfCharSet == ANSI_CHARSET) `7B
X`09`09`09code = 0;
X`09`09`09TRACE(("Found good font:%s`5Cn", lpelf->elfFullName))
X`09`09`7D
X`09`09TRACE(("Found ok font:%s`5Cn", lpelf->elfFullName))
X`09`09TRACE(("Pitch/Family:   %#x`5Cn", dst->lfPitchAnd\2106))
X`09`7D
X
X`09return code;
X`7D
X
Xstatic int is_fixed_pitch(HFONT font)
X`7B
X`09BOOL`09`09ok;
X`09HDC             hDC;
X`09TEXTMETRIC      metrics;
X
X`09hDC = GetDC(vile_hwnd);
X`09SelectObject(hDC, font);
X`09ok = GetTextMetrics(hDC, `26m\0E06);
X`09ReleaseDC(vile_hwnd, hDC);
X
X`09if (ok)
X`09`09ok = ((metrics.tmPitchAndFamily `26 TMPF_FIXED_PITCH) == 0);
X
X`09TRACE(("is_fixed_pitch: %d`5Cn",  ok))
X`09TRACE(("Ave Text width: %d`5Cn",  metrics.tmAveCharWidth))
X`09TRACE(("Max Text width: %d`5Cn",  metrics.tmMaxCharWidth))
X`09TRACE(("Pitch/Family:   %#x`5Cn", metrics.tmPitchAnd\2406))
X
X`09return (ok);
X`7D
X
Xstatic int new_font(LOGFONT *lf)
X`7B
X`09HFONT *font = CreateFontIndirect(lf);
X
X`09if (font != 0) `7B
X`09`09if (is_fixed_pitch(font)) `7B
X`09`09`09DeleteObject(vile_font);
X`09`09`09vile_font = font;
X`09`09`09TRACE(("created new font`5Cn"))
X`09`09`09return TRUE;
X`09`09`7D
X`09`7D
X`09return FALSE;
X`7D
X
Xstatic void get_font(LOGFONT *lf)
X`7B
X`09HDC             hDC;
X
X`09vile_font = GetStockObject(MY_FONT);
X`09hDC = GetDC(vile_hwnd);
X`09if (EnumFontFamilies(hDC, NULL, enumerate_fonts, (LPARAM) lf) <= 0)
X`09`7B
X`09`09TRACE(("Creating Pitch/Family: %#x`5Cn", lf->lfPitchAnd\1E06))
X`09`09new_font(lf);
X`09`7D
X`09ReleaseDC(vile_hwnd, hDC);
X`7D
X
Xstatic void use_font(HFONT my_font, BOOL resizable)
X`7B
X`09HDC             hDC;
X`09TEXTMETRIC      textmetric;
X`09RECT`09`09wrect, crect;
X
X`09hDC = GetDC(vile_hwnd);
X`09SelectObject(hDC, my_font);
X`09GetTextMetrics(hDC, `26textmetric);
X`09ReleaseDC(vile_hwnd, hDC);
X
X`09TRACE(("Text height:    %d`5Cn",  textmetric.tmHeight))
X`09TRACE(("Ave Text width: %d`5Cn",  textmetric.tmAveCharWidth))
X`09TRACE(("Max Text width: %d`5Cn",  textmetric.tmMaxCharWidth))
X`09TRACE(("Pitch/Family:   %#x`5Cn", textmetric.tmPitchAnd\2706))
X
X`09/*
X`09 * We'll use the average text-width, since some fonts (e.g., Courier
X`09 * New) have a bogus max text-width.
X`09 */
X`09nLineHeight = textmetric.tmExternalLeading +\1F0E\3506;
X`09nCharWidth  = textmetric.tmAve\1D09;
X
X`09if (resizable) `7B
+-+-+-+-+-+-+-+-  END  OF PART 86 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 87 -+-+-+-+-+-+-+-+
X`09`09GetClientRect(vile_hwnd, `26crect);
X`09`09GetWindowRect(vile_hwnd, `26wrect);
X
X`09`09term.t_ncol = (crect.right - \0E06left) / nCharWidth;
X`09`09term.t_nrow = (crect.bottom - \0F06top) / nLineHeight;
X`09`7D
X
X`09AdjustWindowSize(term.t_nrow, \0D08col);
X`7D
X
Xstatic void set_font(void)
X`7B
X`09HDC`09`09hDC;
X`09CHOOSEFONT`09choose;
X
X`09memset(`26choose, 0, sizeof(\1206));
X`09choose.lStructSize = sizeof(\1C06);
X`09choose.hwndOwner   = vile_hwnd;
X`09choose.Flags       = CF_SCREENFONTS
X`09`09`09   `7C CF_FIXEDPITCHONLY
X`09`09`09   `7C CF_FORCEFONTEXIST
X`09`09`09   `7C CF_NOSCRIPTSEL
X`09`09`09   `7C CF_INITTOLOGFONTSTRUCT;
X`09choose.lpLogFont   = `26vile_logfont;
X
X`09SelectObject(hDC, GetMyFont());
X`09GetTextFace(hDC, sizeof(vile_logfont.lfFaceName), \1A18;
X`09ReleaseDC(vile_hwnd, hDC);
X
X`09vile_logfont.lfPitchAndFamily = FIXED_PITCH `7C FF_MODERN;
X`09vile_logfont.lfCharSet = ANSI_CHARSET;
X`09TRACE(("LOGFONT Facename:%s`5Cn", vile_logfont.lfFaceName))
X
X`09if (ChooseFont(`26choose)) `7B
X`09`09TRACE(("ChooseFont '%s'`5Cn", vile_logfont.lfFaceName))
X`09`09if (new_font(`26vile_logfont)) `7B
X`09`09`09mlwrite("`5BSet font to %s`5D", vile_logfont.lfFaceName);
X`09`09`09use_font(vil\0A06, FALSE);
X`09`09`09vile_refresh(FALSE,0);
X`09`09`7D else `7B
X`09`09`09mlforce("`5BCannot create font`5D");
X`09`09`7D
X`09`7D else `7B
X`09`09mlforce("`5BNo font selected`5D");
X`09`7D
X
X`09TRACE(("LOGFONT Facename:%s`5Cn", vile_logfont.lfFaceName))
X`7D
X
X#if OPT_TITLE
Xstatic void
Xnttitle(char *title)`09`09/* set the current window title */
X`7B
X`09SetWindowText(vile_hwnd, title);
X`7D
X#endif
X
X#if OPT_COLOR
Xstatic void
Xntfcol(int color)`09`09/* set the current output\2206 */
X`7B
X`09scflush();
X`09nfcolor = color;
X`7D
X
Xstatic void
Xntbcol(int color)`09`09/* set the current background\2606 */
X`7B
X`09scflush();
X`09nbcolor = color;
X`7D
X#endif
X
Xstatic void
Xscflush(void)
X`7B
X`09if (cur_pos `26`26 !vile_resizing) `7B
X`09`09HDC hdc;
X
X`09`09TRACE(("PUTC:flush %2d (%2d,%2d) (%.*s)`5Cn", cur_pos, crow,ccol\140B`26
VCELL_TEXT(\1F09)))
X
X`09`09hdc = GetDC(vile_hwnd);
X`09`09SelectObject(hdc, GetMyFont());
X`09`09set_colors(hdc, cur_atr);
X
X`09`09TextOut(hdc,
X`09`09`09Col(ccol),
X`09`09`09Row(crow),
X`09`09`09`26CELL_TEXT(crow,ccol), cur_pos);
X
X`09`09ReleaseDC(vile_hwnd, hdc);
X`09`7D
X`09ccol = ccol + cur_pos;
X`09cur_pos = 0;
X`7D
X
Xstatic void
Xntflush(void)
X`7B
X`09scflush();
X`09SetCaretPos(Col(ccol), Row(crow));
X`7D
X
Xstatic void
Xntmove(int row, int col)
X`7B
X`09scflush();
X`09crow = (short) row;
X`09ccol = (short) col;
X`7D
X
X/* erase to the end of the line */
Xstatic void
Xnteeol(void)
X`7B
X`09HDC`09hDC;
X`09HBRUSH`09brush;
X`09RECT`09rect;
X`09int`09x;
X
X`09scflush();
X
X`09TRACE(("NTEEOL %d,%d, atr %#x`5Cn", crow, ccol, cur_atr));
X`09for (x = ccol; x < term.t_n\1106++) `7B
X`09`09CELL_TEXT(crow,x) = ' ';
X`09`09CELL_ATTR(crow,x) = cur_atr;
X`09`7D
X
X`09GetClientRect(vile_hwnd, `26rect);
X`09rect.left   = Col(ccol);
X`09rect.top    = Row(crow);
X`09rect.right  = Col(term.t_ncol);
X`09rect.bottom = Row(crow+1);
X
X`09hDC = GetDC(vile_hwnd);
X`09set_colors(hDC, cur_atr);
X`09brush = Background(hDC);
X`09FillRect(hDC, `26rect, brush);
X`09DeleteObject(brush);
X`09ReleaseDC(vile_hwnd, hDC);
X`7D
X
X/*
X * vile very rarely generates any of the ASCII printing control characters
X * except for a few hand coded routines but we have to support them anyway.
X */
X
X/* put a character at the current position in \180Ccolors */
Xstatic void
Xntputc(int ch)
X`7B
X`09/* This is an optimization for the most common case. */
X`09if (ch >= ' ') `7B
X`09`09CELL_TEXT(crow,ccol+cur_pos) = (char) ch;
X`09`09CELL_ATTR(crow,ccol+cur_pos) = cur_atr;
X`09`09cur_pos++;
X`09`7D else `7B
X
X`09`09switch (ch) `7B
X
X`09`09case '`5Cb':
X`09`09`09scflush();
X`09`09`09if (ccol)
X`09`09&0209ccol--;
X`09`09`09break;
X
X`09`09case '`5Ca':
X`09`09`09ntbeep();
X`09`09`09break;
X
X`09`09case '`5Ct':
X`09`09`09scflush();
X`09`09`09do `7B
X`09`09&0209CELL_TEXT(crow,ccol+cur_pos) = ' ';
X`09`09&0209CELL_ATTR(crow,ccol+cur_pos) = cur_atr;
X`09`09&0209cur_pos++;
X`09`09`09`7D while ((ccol + cur_pos) % 8 != 0);
X`09`09`09break;
X
X`09`09case '`5Cr':
X`09`09`09scflush();
X`09`09`09ccol = 0;
X`09`09`09break;
X
X`09`09case '`5Cn':
X`09`09`09scflush();
X`09`09`09if (crow < term.t_nrow - 1)
X`09`09&0209crow++;
X`09`09`09else
X`09`09&0209ntscroll(1, 0, term.t_nrow - 1);
X`09`09`09break;
X
X`09`09default:
X`09`09`09CELL_TEXT(crow,ccol+cur_pos) = (char) ch;
X`09`09`09CELL_ATTR(crow,ccol+cur_pos) = cur_atr;
X`09`09`09cur_pos++;
X`09`09`09break;
X`09`09`7D
X`09`7D
X`7D
X
Xstatic void
Xnteeop(void)
X`7B
X`09HDC`09hDC;
X`09HBRUSH`09brush;
X`09RECT`09rect;
X`09int`09y, x, x0;
X
X`09scflush();
X
X`09x0 = ccol;
X`09TRACE(("NTEEOP %d,%d, atr %#x`5Cn", crow, ccol, cur_atr));
X`09for (y = crow; y < term.t_n\1106++) `7B
X`09`09for (x = 0; x < term.t_ncol; x++) `7B
X`09`09`09CELL_TEXT(y,x) = ' ';
X`09`09`09CELL_ATTR(y,x) = cur_atr;
X`09`09`7D
X`09`09x0 = 0;
X`09`7D
X
X`09rect.left   = Col(ccol);
X`09rect.top    = Row(crow);
X`09rect.right  = Col(term.t_ncol);
X`09rect.bottom = Row(term.t_nrow);
X
X`09if (!vile_resizing) `7B
X`09`09hDC = GetDC(vile_hwnd);
X`09`09set_colors(hDC, cur_atr);
X`09`09brush = Background(hDC);
X`09`09FillRect(hDC, `26rect, brush);
X`09`09DeleteObject(brush);
X`09`09ReleaseDC(vile_hwnd, hDC);
X`09`7D
X`7D
X
Xstatic void
Xntrev(UINT reverse)`09`09/* change\1408 video state */
X`7B
X`09scflush();
X`09cur_atr = (VIDEO_ATTR) reverse;
X`7D
X
Xstatic int
Xntcres(const char *res)`09`09/* change screen resolution */
X`7B
X`09scflush();
X`09return 0;
X`7D
X
X#if`09OPT_FLASH
Xstatic void
Xflash_display()
X`7B
X`09RECT`09rect;
X`09HDC`09hDC;
X
X`09GetClientRect(vile_hwnd, `26rect);
X`09hDC = GetDC(vile_hwnd);
X`09InvertRect(hDC, `26rect);
X`09Sleep(100);
X`09InvertRect(hDC, `26rect);
X`09ReleaseDC(vile_hwnd, hDC);
X`7D
X#endif
X
Xstatic void
Xntbeep(void)
X`7B
X#if`09OPT_FLASH
X`09if (global_g_val(GMDFLASH)) `7B
X`09`09flash_display();
X`09`09return;
X`09`7D
X#endif
X`09MessageBeep(0xffffffff);
X`7D
X
Xstatic void
Xntopen(void)
X`7B
X`09TRACE(("ntopen`5Cn"))
X
X`09set_palette(init\0C07str);
X`7D
X
Xstatic int old_title_set = 0;
Xstatic char old_title`5B256`5D;
Xstatic int orig_title_set = 0;
Xstatic char orig_title`5B256`5D;
X
Xstatic void
Xntclose(void)
X`7B
X`09TRACE(("ntclose`5Cn"))
X
X`09scflush();
X`09ntmove(term.t_nrow - 1, 0);
X`09nteeol();
X`09ntflush();
X`7D
X
Xstatic void
Xntkopen(void)`09/* open the keyboard */
X`7B
X`7D
X
Xstatic void
Xntkclose(void)`09/* close the keyboard */
X`7B
X`7D
X
Xstatic const struct `7B
X`09int`09windows;
X`09int`09vile;
X`09int`09shift;
X`7D keyxlate`5B`5D = `7B
X`09`7B VK_NEXT,`09KEY_Next,`090 `7D,
X`09`7B VK_PRIOR,`09KEY_Prior,`090 `7D,
X`09`7B VK_END,`09KEY_End,`090 `7D,
X`09`7B VK_HOME,`09KEY_Home,`090 `7D,
X`09`7B VK_LEFT,`09KEY_Left,`090 `7D,
X`09`7B VK_RIGHT,`09KEY_Right,`090 `7D,
X`09`7B VK_UP,`09KEY_Up,`09`090 `7D,
X`09`7B VK_DOWN,`09KEY_Down,`090 `7D,
X`09`7B VK_INSERT,`09KEY_F33,   `09LEFT_ALT_PRESSED`7CRIGH\120D `7D,
X`09`7B VK_INSERT,`09KEY_F34,   `09LEFT_CTRL_PRESSED`7CRIGH\130E `7D,
X`09`7B VK_INSERT,`09KEY_F35,   `09SHIFT_PRESSED `7D,
X`09`7B VK_INSERT,`09KEY_Insert,`090 `7D,
X`09`7B VK_DELETE,`09KEY_Delete,`090 `7D,
X`09`7B VK_HELP,`09KEY_Help,`090 `7D,
X`09`7B VK_SELECT,`09KEY_Select,`090 `7D,
X`09`7B VK_TAB,`09'`5Ct',`09`090 `7D,
X#if FIXME
X`09`7B VK_TAB,`09'`5Ct',`09`09SHIFT_PRESSED `7D,
X`09/* Merely pressing the Alt key generates a VK_MENU key event. */
X`09`7B VK_MENU,`09KEY_Menu,`090 `7D,
X#endif
X`09`7B VK_F1,`09KEY_F1,`09`090 `7D,
X`09`7B VK_F2,`09KEY_F2,`09`090 `7D,
X`09`7B VK_F3,`09KEY_F3,`09`090 `7D,
X`09`7B VK_F4,`09KEY_F4,`09`090 `7D,
X`09`7B VK_F5,`09KEY_F5,`09`090 `7D,
X`09`7B VK_F6,`09KEY_F6,`09`090 `7D,
X`09`7B VK_F7,`09KEY_F7,`09`090 `7D,
X`09`7B VK_F8,`09KEY_F8,`09`090 `7D,
X`09`7B VK_F9,`09KEY_F9,`09`090 `7D,
X`09`7B VK_F10,`09KEY\09060 `7D,
X`09`7B VK_F11,`09KEY\09060 `7D,
X`09`7B VK_F12,`09KEY\09060 `7D,
X`09`7B VK_F13,`09KEY\09060 `7D,
X`09`7B VK_F14,`09KEY\09060 `7D,
X`09`7B VK_F15,`09KEY\09060 `7D,
X`09`7B VK_F16,`09KEY\09060 `7D,
X`09`7B VK_F17,`09KEY\09060 `7D,
X`09`7B VK_F18,`09KEY\09060 `7D,
X`09`7B VK_F19,`09KEY\09060 `7D,
X`09`7B VK_F20,`09KEY\09060 `7D,
X`09/* Manually translate Ctrl-6 into\0C06`5E. */
X`09`7B '6',`09`09'`5E'-'@',`09LEFT_CTRL_PRESSED`7CRIGH\130E `7D,
X`7D;
X
Xstatic int savedChar;
Xstatic int saveCount = 0;
X
Xstatic int
Xdecode_key_event(KEY_EVENT_RECORD *irp)
X`7B
X    int key;
X    int i;
X
X    key = (unsigned char) irp->uChar.AsciiChar;
X    if (key != 0) `7B
X        return key;
X    `7D
X
X    for (i = 0; i < TABLESIZE(keyxlate); i++)
X    `7B
X        if (keyxlate`5Bi`5D.windows == irp->wVirtualKeyCode)
X        `7B
X            if (keyxlate`5Bi`5D.shift != 0 `26`26
X        \0808    !(keyxlate`5Bi`5D.shift `26 irp->dwControlKeyState))
X            `7B
X        \0808continue;
X            `7D
X            key = keyxlate`5Bi`5D.vile;
X            TRACE(("... %#x -> %#x`5Cn", irp->wVirtualKeyCode, key))
X            break;
X        `7D
X    `7D
X    if (key == 0)
X        return (NOKYMAP);
X
X    return key;
X`7D
X
Xstatic int
Xget_keyboard_state(void)
X`7B
X`09int result = 0;
X
X    if (GetKeyState(VK_CONTROL) < 0)
X        result `7C= (LEFT_CTRL_PRESSED`7CRIGH\130E);
X    if (GetKeyState(VK_MENU) < 0)
X        result `7C= (LEFT_ALT_PRESSED`7CRIGH\120D);
X    if (GetKeyState(VK_SHIFT) < 0)
X        result `7C= SHIFT_PRESSED;
X`09return result;
X`7D
X
Xstatic int
Xntgetch(void)
X`7B
X`09int buttondown = FALSE;
X`09MSG msg;
X`09POINTS points;
X`09POINT first;
X`09int have_focus = 0;
X`09int result = 0;
X`09DWORD dword;
X`09KEY_EVENT_RECORD ker;
X
X`09if (saveCount > 0) `7B
X`09`09saveCount--;
X`09`09return savedChar;
X`09`7D
X
X`09vile_in_getfkey = 1;
X`09while(! result) `7B
X`09`09if(GetFocus() == vile_hwnd) `7B
X`09`09`09SetCursor(arrow_cursor);
X`09`09`09if(! have_focus) `7B
X`09`09&0209have_focus = 1;
X`09`09&0209fshow_cursor();
X`09`09`09`7D
X`09`09`7D else `7B
X`09`09`09if(have_focus) `7B
X`09`09&0209have_focus = 0;
X`09`09&0209fhide_cursor();
X`09`09`09`7D
X`09`09`7D
X`09`09if(GetMessage(`26msg, (HWND)0, 0, 0) != TRUE) `7B
X`09`09`09PostQuitMessage(1);
X`09`09`09TRACE(("GETC:no message`5Cn"));
X`09`09`09quit(TRUE,1);
X`09`09`7D
X
X`09`09if (TranslateAccelerator(vile_hwnd, hAccTable, `26msg))
X`09`09`09continue;
X
X`09`09TranslateMessage(`26msg);
X
X`09`09switch(msg.message) `7B
X`09`09case WM_DESTROY:
X`09`09`09TRACE(("GETC:DESTROY`5Cn"))
X`09`09`09PostQuitMessage(0);
X`09`09`09continue;
X
X`09`09case WM_COMMAND:
X`09`09`09TRACE(("GETC:COMMAND`5Cn"))
X`09`09`09DispatchMessage(`26msg);
X`09`09`09break;
X
X`09`09case WM_CHAR:
X`09`09`09TRACE(("GETC:CHAR:%#x`5Cn", msg.wParam))
X`09`09`09result = msg.wParam;
X`09`09`09if (result == ESC) `7B
X`09`09&0209sel_release();
X`09`09&0209(void)update(TRUE);
X`09`09`09`7D
X`09`09`09break;
X
X`09`09case WM_KEYDOWN:
X`09`09case WM_SYSKEYDOWN:
X`09`09`09ker.uChar.AsciiChar = 0;
X`09`09`09ker.wVirtualKeyCode = (SHORT) msg.wParam;
X`09`09`09ker.dwControlKeyState = get_keyboard_state();
X`09`09`09result = decode_key_event(`26ker);
X`09`09`09TRACE(("GETC:KEYDOWN:%#x ->%#x`5Cn", msg.wParam, result))
X`09`09`09if (result == NOKYMAP) `7B
X`09`09&0209DispatchMessage(`26msg);
X`09`09&0209result = 0;
X`09`09`09`7D else if (result == (int) msg.wParam) `7B
X`09`09&0209result = 0; /* we'll get a WM_CHAR next */
X`09`09`09`7D
X`09`09`09break;
X
X`09`09case WM_LBUTTONDOWN:
X`09`09`09TRACE(("GETC:LBUTTONDOWN`5Cn"))
X`09`09`09dword = GetMessagePos();
X`09`09`09points = MAKEPOINTS(dword);
X`09`09`09POINTSTOPOINT(first, points);
X`09`09`09ScreenToClient(vile_hwnd, `26first);
X`09`09`09first.x /= nCharWidth;
X`09`09`09first.y /= nLineHeight;
X`09`09`09if (setcursor(first.y, \0906x)) `7B
X`09`09&0209(void)sel_begin();
X`09`09&0209(void)update(TRUE);
X`09`09&0209buttondown = TRUE;
X`09`09`09`7D
X`09`09`09break;
X
X`09`09case WM_RBUTTONDOWN:
X`09`09`09if (buttondown) `7B
X`09`09&0209(void)sel_release();
X`09`09&0209(void)update(TRUE);
X`09`09`09`7D
X`09`09`09break;
X
X`09`09case WM_MOUSEMOVE:
X`09`09`09if (buttondown) `7B
X`09`09&0209int x = ColToX(LOWORD(msg.lParam));
X`09`09&0209int y = RowToY(HIWORD(msg.lParam));
X
X`09`09&0209TRACE(("GETC:MOUSEMOVE (%d,%d)%s`5Cn",
X`09`09&0209`09x, y, buttondown ? " selecting" : ""));
X
X`09`09&0209fhide_cursor();
X`09`09&0209if (!setcursor(y, x))
X`09`09&0209`09break;
X`09`09&0209if (get_keyboard_state()
X`09`09&0209 `26 (LEFT_CTRL_PRESSED`7CRIGH\130E))
X`09`09&0209`09(void)sel_setshape(RECTANGLE);
X`09`09&0209if (!sel_extend(TRUE, TRUE))
X`09`09&0209`09break;
X`09`09&0209(void)update(TRUE);
X`09`09`09`7D
X`09`09`09break;
X
X`09`09case WM_LBUTTONUP:
X`09`09`09TRACE(("GETC:LBUTTONUP`5Cn"))
X`09`09`09if (buttondown) `7B
X`09`09&0209sel_yank(0);
X`09`09&0209buttondown = FALSE;
X`09`09`09`7D
X`09`09`09fshow_cursor();
X`09`09`09break;
X
X`09`09default:
X`09`09`09TRACE(("GETC:default(%#lx)`5Cn", msg.message))
X`09`09case WM_NCHITTEST:
X`09`09case WM_NCMOUSEMOVE:
X`09`09case WM_NCLBUTTONDOWN:
X`09`09case WM_PAINT:
X`09`09case WM_NCACTIVATE:
X`09`09case WM_SETCURSOR:
X`09`09case 0x118:
X`09`09`09DispatchMessage(`26msg);
X`09`09`09break;
X`09`09`7D
X`09`7D
X`09if(GetFocus() == vile_hwnd) `7B
X`09`09SetCursor(hglass_cursor);
X`09`7D
X`09fhide_cursor();
X`09vile_in_getfkey = 0;
X
X`09TRACE(("...ntgetch %#x`5Cn", result));
X`09return result;
X`7D
X
X/*
X * The function `60kbhit' returns true if there are *any* input records
X * available.  We need to define our own type ahead routine because
X * otherwise events which we will discard (like pressing or releasing
X * the Shift key) can block screen updates because `60ntgetch' won't
X * return until a ordinary key event occurs.
X */
X
Xstatic int
Xnttypahead()
X`7B
X#if FIXME
X#endif
X`09return 0;
X`7D
X
X/*
X * Move 'n' lines starting at 'from' to 'to'
X *
X * OPT_PRETTIER_SCROLL is prettier but slower -- it scrolls a line at a time
X *`09instead of all at once.
X */
X
X/* move howmany lines starting at from to to */
Xstatic void
Xntscroll(int from, int to\0806n)
X`7B
X`09HDC     hDC;
X`09HBRUSH`09brush;
X`09RECT region;
X`09RECT tofill;
X
X`09scflush();
X`09if (to == from)
X`09`09return;
X#if OPT_PRETTIER_SCROLL
X`09if (absol(from-to) > 1) `7B
X`09`09ntscroll(from, (from<to) ? to-1:to+1, n);
X`09`09if (from < to)
X`09`09`09from = to-1;
X`09`09else
X`09`09`09from = to+1;
X`09`7D
X#endif
X
X`09region.left   = 0;
X`09region.right  = (SHORT) Col(term.t_ncol);
X
X`09if (from > to) `7B
X`09`09region.top    = (SHORT) Row(to);
X`09`09region.bottom = (SHORT) Row(from + n);
X`09`7D else `7B
X`09`09region.top    = (SHORT) Row(from);
X`09`09region.bottom = (SHORT) Row(to + n);
X`09`7D
X
X`09TRACE(("ScrollWindowEx from=%d, to=%d, n=%d  (%d,%d)/\0807`5Cn",
X`09`09from, to, n,
X`09`09region.left, \0D07top,
X`09`09region.right, \0E07bottom));
X
X`09ScrollWindowEx(
X`09`09vile_hwnd,`09/* handle of window to scroll */
X`09`090,&0209/* amount of horizontal scrolling */
X`09`09Row(to-from),`09/* amount of vertical scrolling */
X`09`09`26region,`09/* address of structure with scroll rectangle */
X`09`09`26region,`09/* address of structure with clip rectangle */
X`09`09(HRGN)0,`09/* handle of update region */
X`09`09`26tofill,`09/* address of structure for update rectangle */
X`09`09SW_ERASE `09/* scrolling flags */
X`09`09);
X`09TRACE(("fill: (%d,%d)/\0807`5Cn",
X`09`09tofill.left, \0D07top,
X`09`09tofill.right, \0E07bottom));
X
X`09hDC = GetDC(vile_hwnd);
X`09set_colors(hDC, cur_atr);
X`09brush = Background(hDC);
X`09FillRect(hDC, `26tofill, brush);
X`09DeleteObject(brush);
X`09ReleaseDC(vile_hwnd, hDC);
X`7D
X
Xstatic void repaint_window(HWND hWnd)
X`7B
X`09PAINTSTRUCT ps;
X`09HBRUSH brush;
X`09int x0, y0, x1, y1;
X`09int row, col;
X
X`09BeginPaint(hWnd, `26ps);
X`09TRACE(("repaint_window (erase:%d)`5Cn", ps.fErase))
X`09SelectObject(ps.hdc, GetMyFont());
X`09set_colors(ps.hdc, cur_atr);
X`09brush = Background(ps.hdc);
X
X`09TRACE(("...painting (%d,%d)\0808`5Cn",
X`09`09ps.rcPaint.top,
X`09`09ps.rcPaint.left,
X`09`09ps.rcPaint.bottom,
X`09`09ps.rcPaint.right));
X
X`09y0 = (ps.rcPaint.top) / nLineHeight;
X`09x0 = (ps.rcPaint.left) / nCharWidth;
X`09y1 = (ps.rcPaint.bottom + nLineHeight) /\0F0C;
X`09x1 = (ps.rcPaint.right  + nCharWidth)  /\0F0B;
X
X`09if (y0 < 0)
X`09`09y0 = 0;
X`09if (x0 < 0)
X`09`09x0 = 0;
X
X`09TRACE(("...erase %d`5Cn", ps.fErase));
X`09TRACE(("...cells (%d,%d) -\0A08`5Cn", y0,x0, y1,x1));
X`09TRACE(("...top:    %d`5Cn", Row(y0) - ps.rcPaint.top));
X`09TRACE(("...left:   %d`5Cn", Col(x0) - ps.rcPaint.left));
X`09TRACE(("...bottom: %d`5Cn", Row(y1) - ps.rcPaint\2407));
X`09TRACE(("...right:  %d`5Cn", Col(x1) - ps.rcPaint\2406));
X
X`09for (row = y0; row < y1; row++) `7B
X`09`09if (pscreen != 0
X`09`09 `26`26 pscreen`5Brow`5D->v_text != 0
X`09`09 `26`26 pscreen`5Brow`5D->v_attrs != 0) `7B
X`09`09`09for (col = x0; col < x1; col++) `7B
X`09`09&0209set_colors(ps.hdc, CELL_ATTR(row,col));
X`09`09&0209TextOut(ps.hdc,
X`09`09&0209`09Col(col),
X`09`09&0209`09Row(row),
X`09`09&0209`09`26CELL_TEXT(row,col), 1);
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09DeleteObject(brush);
X
X`09TRACE(("...repaint_window`5Cn"))
X`09EndPaint(hWnd, `26ps);
X`7D
X
Xstatic khit=0;
X
Xint kbhit(void)
X`7B
X`09MSG msg;
X`09int hit;
X
X`09if(PeekMessage(`26msg, (HWND)0, (UINT\0909)0, PM_REMOVE))`7B
X`09`09TranslateMessage(`26msg);
X`09`09DispatchMessage(`26msg);
X`09`7D
X
X`09hit = khit;
X`09khit = 0;
X`09return hit;
X`7D
X
XLONG FAR PASCAL MainWndProc(
X`09`09`09HWND hWnd,
X`09`09`09UINT message,
X`09`09`09WPARAM wParam,
X`09`09`09LONG lParam)
X`7B
X#if FIXME
X`09FARPROC lpProcAbout;
X#endif
X
X`09switch (message) `7B
X`09case WM_MOUSEMOVE:
X`09`09TRACE(("MAIN:MOUSEMOVE`5Cn"))
X`09`09if(GetFocus() == vile_hwnd) `7B
X`09`09`09if(vile_in_getfkey) `7B
X`09`09&0209SetCursor(arrow_cursor);
X`09`09`09`7D else `7B
X`09`09&0209SetCursor(hglass_cursor);
X`09`09`09`7D
X`09`09`7D
X`09`09break;
X`09case WM_COMMAND:
X`09`09TRACE(("MAIN:COMMAND`5Cn"))
X#if FIXME
X`09`09switch (wParam) `7B
X`09`09case IDC_button:
X`09`09`09khit = 1;
X`09`09`09wParam = IDC_button_x;
X`09`09`09PostMessage(hWnd, m\0E06, wParam, lParam);
X`09`09`09break;
X`09`09case IDM_ABOUT:
X`09`09`09lpProcAbout = MakeProcInstance(About, vile_hi\1607);
X`09`09`09DialogBox(vile_hinstance, "AboutBox", hWnd, lpProcAbout);
X`09`09`09FreeProcInstance(lpProcAbout);
X`09`09`09break;
X
X`09`09/* file menu commands */
X
X`09`09case IDM_PRINT:
X`09`09`09MessageBox (
X`09`09&0209GetFocus(),
X`09`09&0209"Command not implemented",
X`09`09&0209MY_APPLE,
X`09`09&0209MB_ICONASTERISK `7C MB_OK);
X`09`09`09break;
X
X`09`09case IDM_EXIT:
X`09`09`09DestroyWindow(hWnd);
X`09`09`09break;
X`09`09`7D
X#endif
X`09`09break;
X
X/*
X`09case WM_SETFOCUS:
X`09`09fshow_cursor();
X`09`09break;
X
X`09case WM_SIZE:
X`09`09MoveWindow(vile_hwnd, 0, 0, LOWORD(lParam), HI\100ETRUE);
X`09`09break;
X*/
X`09case WM_KILLFOCUS:
X`09`09fhide_cursor();
X`09`09break;
X
X`09case WM_DESTROY:
X`09`09TRACE(("MAIN:DESTROY`5Cn"))
X`09`09PostQuitMessage(0);
X`09`09break;
X
X`09case WM_PAINT:
X`09`09TRACE(("MAIN:PAINT %d/%d`5Cn",
X`09`09`09GetUpdateRect(hWnd, (LPRECT)0, FALSE),
X`09`09`09(hWnd == vile_hwnd)));
X`09`09if (GetUpdateRect(hWnd, (LPRECT)0, FALSE)) `7B
X`09`09`09repaint_window(hWnd);
X`09`09`7D else `7B
X`09`09`09TRACE(("FIXME:WM_PAINT`5Cn"));
X`09`09`09return (DefWindowProc(hWnd, message, wParam, lParam));
X`09`09`7D
X`09`09break;
X
X`09case WM_WINDOWPOSCHANGED:`09/* FIXME:FALLTHRU for now */
X`09`09ResizeClient();
X`09`09return (DefWindowProc(hWnd, message, wParam, lParam));
X
X`09case WM_EXITSIZEMOVE:
X`09`09ResizeClient();
X`09`09return (DefWindowProc(hWnd, message, wParam, lParam));
X
X`09case WM_SYSCOMMAND:
X`09`09switch(LOWORD(wParam))
X`09`09`7B
X`09`09case MM_FONT:
X`09`09`09set_font();
X`09`09`09break;
X`09`09`7D
X`09`09return (DefWindowProc(hWnd, message, wParam, lParam));
X
X`09case WM_KEYDOWN:
X`09case WM_LBUTTONDOWN:
X`09case WM_RBUTTONDOWN:
X`09case WM_SYSKEYDOWN:
X`09`09khit = 1;
X`09`09/* FALLTHRU */
X`09default:
X`09`09TRACE(("MAIN:default %#x`5Cn", message))
X`09`09return (DefWindowProc(hWnd, message, wParam, lParam));
X
X`09IGN_PROC("MAIN:", WM_ERASEBKGND);
X`09DEF_PROC("MAIN:", WM_KEYUP);
X`09DEF_PROC("MAIN:", WM_NCPAINT);
X`09DEF_PROC("MAIN:", WM_SETCURSOR);
X`09DEF_PROC("MAIN:", WM_NCCALCSIZE);
X`09DEF_PROC("MAIN:", WM_NCHITTEST);
X`09DEF_PROC("MAIN:", WM_NCMOUSEMOVE);
X`09DEF_PROC("MAIN:", WM_SIZING);
X`09DEF_PROC("MAIN:", WM_WINDOWPOSCHANGING);
X`09DEF_PROC("MAIN:", WM_GETMINMAXINFO);
X`09`7D
X`09return (0);
X`7D
X
XBOOL InitInstance(
X`09HANDLE          hInstance,
X`09int             nCmdShow)
X`7B
X`09vile_hinstance = hI\0C07;
X
X`09hAccTable = LoadAccelerators(vile_hinstance, "VileAcc");
X
X`09vile_hwnd = CreateWindow(
X`09`09MY_CLASS,
X`09`09MY_APPLE,
X`09`09WS_OVERLAPPEDWINDOW,
X`09`09CW_USEDEFAULT,
X`09`09CW_USEDEFAULT,
X`09`09CW_USEDEFAULT,
X`09`09CW_USEDEFAULT,
X`09`09(HWND)0,
X`09`09(HMENU)0,
X`09`09hInstance,
X`09`09(LPVOID)0
X`09);
X
X`09/*
X`09 * Insert "File" and "Font" before "Close" in the system menu.
X`09 */
X`09vile_menu = GetSystemMenu(vile_hwnd, FALSE);
X`09AppendMenu(vile_menu, MF_SEPARATOR, 0, NULL);
X#if 0`09/* FIXME: later */
X`09AppendMenu(vile_menu, MF_STRING, MM_FILE, "File");
X#endif
X`09AppendMenu(vile_menu, MF_STRING, MM_FONT, "`26Font");
X
X`09if (!vile_hwnd)
X`09`09return (FALSE);
X
X`09SetCursor(hglass_cursor);
X
X`09term.t_ncol = 80;
X`09term.t_nrow = 24;
X
X`09get_font(`26vile_logfont);
X`09use_font(vil\0A06, FALSE);
X
X`09ShowWindow(vile_hwnd, nCmdShow);
X`09UpdateWindow(vile_hwnd);
X`09return (TRUE);
X`7D
X
XBOOL InitApplication (HANDLE hInstance)
X`7B
X`09WNDCLASS  wc;
X
X`09ZeroMemory(`26wc, sizeof(`26wc));
X`09hglass_cursor    = LoadCursor((HINSTANCE)0, IDC_WAIT);
X`09arrow_cursor     = LoadCursor((HINSTANCE)0, IDC_ARROW);
X`09wc.style         = CS_VREDRAW `7C CS_H\0D06;
X`09wc.lpfnWndProc   = (WNDPROC) Mai\1A08;
X`09wc.cbClsExtra    = 0;
X`09wc.cbWndExtra    = 0;
X`09wc.hInstance     = \1009;
X`09wc.hIcon         = LoadIcon(hInstance, "VilewIcon");
X`09wc.hCursor       = (HCURSOR) 0;
X`09wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
X`09wc.lpszMenuName  = "VileMenu";
X`09wc.lpszClassName = MY_CLASS;
X
X`09default_bcolor = GetSysColor(COLOR_WINDOWTEXT+1);
X`09default_fcolor = GetSysColor(COLOR_WINDOW+1);
X
X`09if(! RegisterClass(`26wc))
X`09`09return FALSE;
X
X`09return TRUE;
X`7D
X
X
Xint PASCAL
XWinMain(
X`09HANDLE hInstance,
X`09HANDLE hPrevInstance,
X`09LPSTR lpCmdLine,
X`09int nCmdShow)
X`7B
X#define MAXARGS 10
X`09int argc = 0;
X`09char *argv`5BMAXARGS`5D;
X`09char *ptr;
X
X`09TRACE(("Starting ntvile`5Cn"));
X
X`09if (!hPrevInstance) `7B
X`09`09if (!InitApplication(hInstance))
X`09`09`09return (FALSE);
X`09`7D
X
X`09if (!InitInstance(h\0A08, nCmdShow))
X`09`09return (FALSE);
X
X`09argv`5Bargc++`5D = "VILE";
X
X`09for(ptr = lpCmdLine; *ptr != '`5C0';) `7B
X`09`09char delim = ' ';
X
X`09`09while (*ptr == ' ')
X`09`09`09ptr++;
X
X`09`09if (*ptr == '`5C''
X`09`09 `7C`7C *ptr == '"'
X`09`09 `7C`7C *ptr == ' ') `7B
X`09`09`09delim = *ptr++;
X`09`09`7D
X`09`09TRACE(("argv%d:%s`5Cn", argc, ptr));
X`09`09argv`5Bargc++`5D = ptr;
X`09`09if (argc+1 >= MAXARGS) `7B
X`09`09`09break;
X`09`09`7D
X`09`09while (*ptr != delim `26`26 \1108'`5C0')
X`09`09`09ptr++;
X`09`09if (*ptr == delim)
X`09`09`09*ptr++ = '`5C0';
X`09`7D
X`09argv`5Bargc`5D = 0;
X
X`09return MainProgram(argc, argv);
X`7D
$ call unpack [.VILE-8_0]NTWINIO.C;1 -
 1498456709 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 62 89 152
$!
$ create 'f'
X/*
X *`09A few functions that used to operate on single whole lines, mostly
X *`09here to support the globals() function.  They now work on regions.
X *`09Copyright (c) 1990, 1995 by Paul Fox, except for delins(), which is
X *`09Copyright (c) 1986 by University of Toronto, as noted below.
X *
X * $Header: /usr/build/vile/vile/RCS/oneliner.c,v 1.89 1998/04/28 10:17:39 tom
V Exp $
X */
X
X#include`09"estruct.h"
X#include`09"edef.h"
X
X#define PLIST`090x01
X#define PNUMS`090x02
X
Xstatic`09int`09delins(regexp *exp, char *sourc);
Xstatic`09int`09substline(regexp *exp, int nth_occur\0F06printit\1C06globally
V\2A06*confirmp);
Xstatic`09int`09substreg1(int needpats, int use_opts);
X
Xstatic`09int`09lines_changed,
X`09`09total_changes;
X
X/*
X * put lines in a popup window
X */
Xstatic int
Xpregion(UINT flag)
X`7B
X`09register WINDOW *wp;
X`09register BUFFER *bp;
X`09register int`09status;
X`09REGION`09`09region;
X`09register LINEPTR linep;
X`09BUFFER *oldbp = curbp;
X
X`09if ((status = get_fl_region(`26\0806)) != TRUE) `7B
X`09`09return (status);
X`09`7D
X
X`09linep = region.r_orig.l;`09`09 /* Current line.`09 */
X
X`09/* first check if we are already here */
X`09bp = bfind(P_LINES_BufName, 0);
X`09if (bp == NULL) `7B
X`09`09return FALSE;
X`09`7D
X
X`09if (bp == curbp) `7B
X`09`09mlforce("`5BCan't do that from this buffer.`5D");
X`09`09return FALSE;
X`09`7D
X
X`09if (!calledbefore) `7B`09`09/* fresh start */
X`09`09/* bring p-lines up */
X`09`09if (popupbuff(bp) != TRUE
X`09`09 `7C`7C bclear(bp) != TRUE) `7B
X`09`09`09return FALSE;
X`09`09`7D
X
X`09`09calledbefore = TRUE;
X`09`7D
X
X`09do `7B
X`09`09if (!addline(bp, linep->l_text, llength(linep)))
X`09`09`09break;`09/* out of memory */
X`09`09if (flag `26 PNUMS) `7B
X`09`09`09BUFFER *savebp = curbp;
X`09`09`09WINDOW *savewp = curwp;
X`09`09`09curbp = bp;
X`09`09`09curwp = bp2any_wp(bp);
X`09`09`09DOT.l = lback(buf_head(bp));
X`09`09`09DOT.o = 0;
X`09`09`09bprintf("%s:%d:", oldbp->b_bname, line_no(oldbp\0F06p));
X`09`09`09DOT.o = 0;
X`09`09`09curbp = savebp;
X`09`09`09curwp = savewp;
X`09`09`7D
X`09`09linep = lforw(linep);
X`09`7D while (linep != region.r_end.l);
X
X`09set_bname(bp, P_LINES_BufName);
X`09set_rdonly(bp, non_filename(), MDVIEW);
X`09set_b_val(bp,VAL_TAB,tabstop_val(curbp));
X
X`09for_each_visible_window(wp) `7B
X`09`09if (wp->w_bufp == bp) `7B
X`09`09`09make_local_w_val(wp,WMDLIST);
X`09`09`09set_w_val(wp, WMDLIST, ((flag `26 PLIST) != 0) );
X`09`09`09wp->w_flag `7C= WFMODE`7CWFFORCE;
X`09`09`7D
X`09`7D
X`09return TRUE;
X`7D
X
Xint
Xllineregion(void)
X`7B
X`09return pregion(PLIST);
X`7D
X
Xint
Xpplineregion(void)
X`7B
X`09return pregion(PNUMS);
X`7D
X
Xint
Xplineregion(void)
X`7B
X`09return pregion(0);
X`7D
X
Xstatic regexp *substexp;
X
Xint
Xsubstregion(void)
X`7B
X`09return substreg1(TRUE,TRUE);
X`7D
X
Xint
Xsubst_again_region(void)
X`7B
X`09return substreg1(FALSE,TRUE);
X`7D
X
X/* traditional vi `26 command */
X/* ARGSUSED */
Xint
Xsubst_again(int f GCC_UNUSED, int n\120B)
X`7B
X`09int s;
X`09MARK curpos;
X
X`09curpos = DOT;
X
X`09/* the region spans just the line */
X`09MK.l = DOT.l;
X`09DOT.o = 0;
X`09MK.o = llength(MK.l);
X`09s = substreg1(FALSE,FALSE);
X`09if (s != TRUE) `7B
X`09`09mlforce("`5BNo match.`5D");
X`09`09DOT = curpos;
X`09`09return s;
X`09`7D
X`09swapmark();
X`09return TRUE;
X`7D
X
Xstatic int
Xsubstreg1(int needpats, int use_opts)
X`7B
X`09int c, status;
X`09static int printit, globally, nth_occur, confirm;
X`09REGION region;
X`09LINEPTR oline;
X`09int`09getopts = FALSE;
X`09char    tpat`5BNPAT`5D;
X
X`09if ((status = get_fl_region(`26\0806)) != TRUE) `7B
X`09`09return (status);
X`09`7D
X
X`09if (calledbefore == FALSE `26`26 needpats) `7B
X`09`09c = kbd_delimiter();
X`09`09if ((status = readpattern("substitute \1407: ", `26pat`5B0`5D,
X`09`09&0209`09`26gregexp, c, FALSE)) != TRUE) `7B
X`09`09`09if (status != ABORT)
X`09`09&0209mlforce("`5BNo pattern.`5D");
X`09`09`09return FALSE;
X`09`09`7D
X
X`09`09if (gregexp) `7B
X`09`09`09FreeIfNeeded(substexp);
X`09`09`09substexp = castalloc(regexp,(ALLOC_T)(g\1206->size));
X`09`09`09(void)memcpy((char *)substexp, \1208gregexp,
X`09`09&0209&0309(SIZE_T)gregexp->size);
X`09`09`7D
X
X`09`09tpat`5B0`5D = 0;
X`09`09status = readpattern("replacement string: ",
X`09`09&0209     `26tpat`5B0`5D, (regexp **)0, c, FALSE);
X
X`09`09(void)strcpy(rpat, tpat);
X`09`09if (status == ABORT)
X`09`09`09/* if false, the pattern is null, which is okay... */
X`09`09`09return FALSE;
X
X`09`09nth_occur = -1;
X`09`09confirm = printit = globally = FALSE;
X`09`09getopts = (lastkey == c); /* the user may have
X`09`09&0209&0209something to add */
X
X`09`7D else `7B
X`09`09if (!use_opts) `7B
+-+-+-+-+-+-+-+-  END  OF PART 87 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 88 -+-+-+-+-+-+-+-+
X`09`09`09nth_occur = -1;
X`09`09`09printit = globally = FALSE;
X`09`09`7D else `7B
X`09`09`09if (more_named_cmd()) `7B
X`09`09&0209unkeystroke(lastkey);
X`09`09&0209nth_occur = -1;
X`09`09&0209printit = globally = FALSE;
X`09`09&0209getopts = TRUE;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X
X`09if (getopts) `7B
X`09`09char buf`5B4`5D;
X`09`09char *bp = buf;
X
X`09`09buf`5B0`5D = EOS;
X`09`09status = mlreply(
X"(g)lobally, (`5B1-9`5D)th occurrence on line, (c)onfirm, and/or (p)rint resul
Vt: ",
X`09`09`09buf, sizeof buf);
X`09`09if (status == ABORT) `7B
X`09`09`09return FALSE;
X`09`09`7D
X`09`09nth_occur = 0;
X`09`09while (*bp) `7B
X`09`09`09if (*bp == 'p' `26`26 !printit) `7B
X`09`09&0209printit = TRUE;
X`09`09`09`7D else if (*bp == 'g' `26`26
X`09`09&0209`09!globally `26`26 !nth_occur) `7B
X`09`09&0209globally = TRUE;
X`09`09`09`7D else if (isDigit(*bp) `26`26
X`09`09&0209`09!nth_occur `26`26 !globally) `7B
X`09`09&0209nth_occur = *bp - '0';
X`09`09&0209globally = TRUE;
X`09`09`09`7D else if (*bp == 'c' `26`26 !confirm) `7B
X`09`09&0209confirm = TRUE;
X`09`09`09`7D else if (!isSpace(*bp)) `7B
X`09`09&0209mlforce("`5BUnknown action %s`5D",buf);
X`09`09&0209return FALSE;
X`09`09`09`7D
X`09`09`09bp++;
X`09`09`7D
X`09`09if (!nth_occur)
X`09`09`09nth_occur = -1;
X`09`7D
X
X`09lines_changed =
X`09total_changes = 0;
X`09DOT.l = region.r_orig.l;`09    /* Current line.`09    */
X`09do `7B
X`09`09oline = DOT.l;
X`09`09if ((status = substline(substexp, nth_occur, printit,
X`09`09&0209&0209globally, `26confirm)) != TRUE) `7B
X`09`09`09return status;
X`09`09`7D
X`09`09DOT.l = lforw(oline);
X`09`7D while (!sameline(DOT, region.r_end));
X`09calledbefore = TRUE;
X
X`09if (do_report(total_changes)) `7B
X`09`09mlforce("`5B%d change%s on %d line%s`5D",
X`09`09`09total_changes, PLURAL(\160D),
X`09`09`09lines_changed, PLURAL(\160D));
X`09`7D
X`09return TRUE;
X`7D
X
X/* show the pattern we've matched (at least one space, even for empty-string)
V */
Xstatic void
Xshowpat(regexp *rp, int on)
X`7B
X`09register LINEPTR`09lp;
X`09int`09row;
X
X`09for (lp = curwp->w_line.l, row\170Ctoprow;
X`09`09lp != DOT.l;
X`09`09`09lp = lforw(lp))
X`09`09row += line_height(curwp,lp);
X
X`09hilite(row,
X`09`09offs2col(curwp, lp, DOT.o),
X`09`09offs2col(curwp, lp, (C_NUM)(DOT.o + rp->mlen)) + (\0E08 == 0),
X`09`09on);
X`7D
X
Xstatic int
Xsubstline(regexp *exp, int nth_occur\0F06printit\1C06globally\2A06*confirmp)
X`7B
X`09int foundit;
X`09int again = 0;
X`09register int s;
X`09register int which_occur = 0;
X`09int matched_at_eol = FALSE;
X`09int yes, c, skipped;
X
X`09/* if the "magic number" hasn't been set yet... */
X`09if (!exp `7C`7C UCHAR_AT(exp->program) != REGEXP_MAGIC) `7B
X`09`09mlforce("`5BNo pattern set yet`5D");
X`09`09return FALSE;
X`09`7D
X
X`09ignorecase = window_b_val(curwp, MDIGNCASE);
X
X`09foundit = FALSE;
X`09scanboundpos.l = DOT.l;
X`09scanbound_is_header = FALSE;
X`09DOT.o = 0;
X`09do `7B
X`09`09scanboundpos.o = llength(DOT.l);
X`09`09s = scanner(exp, FORWARD, FALSE, (int *)0);
X`09`09if (s != TRUE)
X`09`09`09break;
X
X`09`09/* found the pattern */
X`09`09foundit = TRUE;
X`09`09which_occur++;
X`09`09if (nth_occur == -1 `7C`7C whic\150B\2209) `7B
X`09`09`09(void)setmark();
X`09`09`09/* only allow one match at the end of line, to
X`09`09&0209prevent loop with s/$/x/g  */
X`09`09`09if (MK.o == llength(DOT.l)) `7B
X`09`09&0209if (matched_at_eol)
X`09`09&0209`09break;
X`09`09&0209matched_at_eol = TRUE;
X`09`09`09`7D
X
X`09`09`09/* if we need confirmation, get it */
X`09`09`09skipped = FALSE;
X`09`09`09if (*confirmp) `7B
X
X`09`09&0209/* force the pattern onto the screen */
X`09`09&0209(void)gomark(FALSE, 0);
X`09`09&0209if (update(TRUE) == TRUE)
X`09`09&0209`09showpat(exp, TRUE);
X`09`09&0209s = mlquickask("Make change `5By/n/q/a`5D?",
X`09`09&0209`09"ynqa`5Cr",`26c);
X
X`09`09&0209showpat(exp, FALSE);
X
X`09`09&0209if (s != TRUE)
X`09`09&0209`09c = 'q';
X
X`09`09&0209switch(c) `7B
X`09`09&0209case 'y' :
X`09`09&0209`09yes = TRUE;
X`09`09&0209`09break;
X`09`09&0209default:
X`09`09&0209case 'n' :
X`09`09&0209`09yes = FALSE;
X`09`09&0209`09(void)update(TRUE);
X`09`09&0209`09skipped = TRUE;
X`09`09&0209`09/* so we don't match this again */
X`09`09&0209`09DOT.o += exp->mlen;
X`09`09&0209`09break;
X`09`09&0209case 'q' :
X`09`09&0209`09mlerase();
X`09`09&0209`09return(FALSE);
X`09`09&0209case 'a' :
X`09`09&0209`09yes = TRUE;
X`09`09&0209`09*confirmp = FALSE;
X`09`09&0209`09mlerase();
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09`09`7D else `7B
X`09`09&0209yes = TRUE;
X`09`09`09`7D
X`09`09`09if (yes) `7B
X`09`09&0209s = delins(exp, `26rpat`5B0`5D);
X`09`09&0209if (s != TRUE)
X`09`09&0209`09return s;
X`09`09&0209if (!again++)
X`09`09&0209`09lines_changed++;
X`09`09&0209total_changes++;
X`09`09`09`7D
X`09`09`09if (*confirmp `26`26 !skipped) /* force a screen update */
X`09`09&0209(void)update(TRUE);
X
X`09`09`09if (exp->mlen == 0 `26`26 forwchar(TRUE,1) == FALSE)
X`09`09&0209break;
X`09`09`09if (nth_occur > 0)
X`09`09&0209break;
X`09`09`7D else `7B /* non-overlapping matches */
X`09`09`09s = forwchar(TRUE, (int)(exp->mlen));
X`09`09`09if (s != TRUE)
X`09`09&0209return s;
X`09`09`7D
X`09`7D while (globally `26`26 sameline(scanboundpos,DOT));
X`09if (foundit `26`26 printit) `7B
X`09`09register WINDOW *wp = curwp;
X`09`09(void)setmark();
X`09`09s = plineregion();
X`09`09if (s != TRUE) return s;
X`09`09/* back to our buffer */
X`09`09swbuffer(wp->w_bufp);
X`09`7D
X`09if (*confirmp)
X`09`09mlerase();
X`09return TRUE;
X`7D
X
X/*
X * delins, modified by pgf from regsub
X *
X *`09Copyright (c) 1986 by University of Toronto.
X *`09Written by Henry Spencer.  Not derived from licensed software.
X *
X *`09Permission is granted to anyone to use this software for any
X *`09purpose on any computer system, and to redistribute it freely,
X *`09subject to the following restrictions:
X *
X *`091. The author is not responsible for the consequences of use of
X *`09`09this software, no matter how awful, even if they arise
X *`09`09from defects in it.
X *
X *`092. The origin of this software must not be misrepresented, either
X *`09`09by explicit claim or by omission.
X *
X *`093. Altered versions must be plainly marked as such, and must not
X *`09`09be misrepresented as being the original software.
X */
X
Xstatic`09char`09*buf_delins;
Xstatic`09UINT`09len_delins;
X
X/*
X - delins - perform substitutions after a regexp match
X */
Xstatic int
Xdelins(regexp *exp, char *sourc)
X`7B
X`09register char *src;
X`09register ALLOC_T dlength;
X`09register char c;
X`09register int no;
X`09int s;
X#define NO_CASE`090
X#define UPPER_CASE 1
X#define LOWER_CASE 2
X`09int case_next,\0B06all;
X
X`09if (exp == NULL `7C`7C sourc\1108) `7B
X`09`09mlforce("BUG: NULL parm to delins");
X`09`09return FALSE;
X`09`7D
X`09if (UCHAR_AT(exp->program) != REGEXP_MAGIC) `7B
X`09`09regerror("damaged regexp fed to delins");
X`09`09return FALSE;
X`09`7D
X
X`09dlength = exp->mlen;
X
X`09if (buf_delins == NULL `7C`7C dlength + 1 > len\2407) `7B
X`09`09if (buf_delins)
X`09`09`09free(buf_delins);
X`09`09if ((buf_delins = castalloc(char,dlength+1)) == NULL) `7B
X`09`09`09mlforce("`5BOut of memory in delins`5D");
X`09`09`09return FALSE;
X`09`09`7D
X`09`09len_delins = dlength + 1;
X`09`7D
X
X`09(void)memcpy(buf_delins, exp->startp`5B0`5D, (SIZE_T)dlength);
X`09buf_delins`5Bdlength`5D = EOS;
X
X`09if (ldelete((long) dlength, FALSE) != TRUE) `7B
X`09`09mlforce("`5BError while deleting`5D");
X`09`09return FALSE;
X`09`7D
X`09src = sourc;
X`09case_next = case_all = NO_CASE;
X`09while ((c = *src++) != EOS) `7B
X`09    no = 0;
X`09    s = TRUE;
X`09    switch(c) `7B
X`09    case '`5C`5C':
X`09`09    c = *src++;
X`09`09    if (c == EOS)
X`09`09`09return TRUE;
X`09`09    if (!isDigit(c)) `7B
X`09`09`09    /* here's where the `5CU `5CE `5Cu `5Cl `5Ct etc.
X`09`09`09    special escapes should be implemented */
X`09`09`09    switch (c) `7B
X`09`09`09    case 'U':
X`09`09&0209    case_all = UPPER_CASE;
X`09`09&0209    break;
X`09`09`09    case 'L':
X`09`09&0209    case_all = LOWER_CASE;
X`09`09&0209    break;
X`09`09`09    case 'u':
X`09`09&0209    case_next = UPPER_CASE;
X`09`09&0209    break;
X`09`09`09    case 'l':
X`09`09&0209    case_next = LOWER_CASE;
X`09`09&0209    break;
X`09`09`09    case 'E':
X`09`09`09    case 'e':
X`09`09&0209    case_all = NO_CASE;
X`09`09&0209    break;
X`09`09`09    case 'b':
X`09`09&0209    s = linsert(1,'`5Cb');
X`09`09&0209    break;
X`09`09`09    case 'f':
X`09`09&0209    s = linsert(1,'`5Cf');
X`09`09&0209    break;
X`09`09`09    case 'r':
X`09`09&0209    s = linsert(1,'`5Cr');
X`09`09&0209    break;
X`09`09`09    case 't':
X`09`09&0209    s = linsert(1,'`5Ct');
X`09`09&0209    break;
X`09`09`09    case 'n':
X`09`09&0209    s = lnewline();
X`09`09&0209    break;
X`09`09`09    default:
X`09`09&0209    s = linsert(1,c);
X`09`09&0209    break;
X`09`09`09    `7D
X`09`09`09    break;
X`09`09    `7D
X`09`09    /* else it's a digit --
X`09`09    `09get pattern number, and fall through */
X`09`09    no = c - '0';
X`09`09    /* FALLTHROUGH */
X`09    case '`26':
X`09`09    if (exp->startp`5Bno`5D != NULL `26`26 exp->end\190D) `7B
X`09`09`09    char *cp = buf_delins;
X`09`09`09    long len = exp->endp`5Bno`5D -\1006startp`5Bno`5D;
X`09`09`09    long adj = exp->startp`5Bno`5D -\120D0`5D;
X`09`09`09    cp += (size_t)adj;
X`09`09`09    while ((s == TRUE) `26`26 len--) `7B
X`09`09&0209    c = *cp++;
X`09`09&0209    if (c == EOS) `7B
X`09`09&0209`09    mlforce( "BUG: mangled replace");
X`09`09&0209`09    return FALSE;
X`09`09&0209    `7D
X`09`09&0209    if (c == '`5Cn')
X`09`09&0209`09    s = lnewline();
X`09`09&0209    else if (case_next == NO_CASE `26`26 case_all\170B)
X`09`09&0209`09    s = linsert(1,c);
X`09`09&0209    else `7B
X`09`09&0209`09    int direction = case_next != NO_CASE ?\170B:\2306all;
X`09`09&0209`09    case_next = NO_CASE;
X`09`09&0209`09    /* Somewhat convoluted to handle
X`09`09&0209`09       `5Cu`5CL correctly (upper case first
X`09`09&0209`09       char, lower case remainder).
X`09`09&0209`09       This is the perl model, not the vi\1206. */
X`09`09&0209`09    if (isUpper(c) `26`26 (direction == LOWER_CASE))
X`09`09&0209&0209    c = toLower(c);
X`09`09&0209`09    if (isLower(c) `26`26 (direction == UPPER_CASE))
X`09`09&0209&0209    c = toUpper(c);
X`09`09&0209`09    s = linsert(1,c);
X`09`09&0209    `7D
X`09`09`09    `7D
X`09`09    `7D
X`09`09    break;
X
X`09    case '`5Cn':
X`09    case '`5Cr':
X`09`09    s = lnewline();
X`09`09    break;
X
X`09    default:
X`09`09    if (case_next `7C`7C case_all) `7B
X`09`09`09    int direction = case_next != NO_CASE ?\170B:\2306all;
X`09`09`09    case_next = NO_CASE;
X`09`09`09    /* Somewhat convoluted to handle
X`09`09`09       `5Cu`5CL correctly (upper case first
X`09`09`09       char, lower case remainder).
X`09`09`09       This is the perl model, not the vi\1206. */
X`09`09`09    if (isUpper(c) `26`26 (direction == LOWER_CASE))
X`09`09&0209    c = toLower(c);
X`09`09`09    if (isLower(c) `26`26 (direction == UPPER_CASE))
X`09`09&0209    c = toUpper(c);
X`09`09    `7D
X`09`09    s = linsert(1,c);
X`09`09    break;
X`09    `7D
X`09    if (s != TRUE) `7B
X`09`09    mlforce("`5BOut of memory while inserting`5D");
X`09`09    return FALSE;
X`09    `7D
X`09`7D
X`09return TRUE;
X`7D
X
X#if NO_LEAKS
Xvoid
Xonel_leaks(void)
X`7B
X`09FreeIfNeeded(substexp);
X`09FreeIfNeeded(buf_delins);
X`7D
X#endif
$ call unpack [.VILE-8_0]ONELINER.C;1 -
 1378047212 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 28 90 152
$!
$ create 'f'
X/*
X * This file contains the command processing functions for\250Cs
X * that take motion operators.
X * written for vile: Copyright (c) 1990, 1995 by Paul Fox
X *
X * $Header: /usr/build/vile/vile/RCS/opers.c,v 1.62 1998/04/28 10:17:44 tom Ex
Vp $
X *
X */
X
X#include`09"estruct.h"
X#include        "edef.h"
X#include        "nefunc.h"
X
Xextern REGION *haveregion;
X
X/* For the "operator" commands -- the following\1A08 is a motion, or
X *  the operator itself is repeated.  All\2207e on regions.
X */
Xint
Xvile_op(int f, int n, OpsFunc fn, const char *str)
X`7B
X`09int c;
X`09int thiskey;
X`09int status;
X`09const CMDFUNC *cfp;`09`09/* function to execute */
X`09char tok`5BNSTRING`5D;`09`09/* command incoming */
X`09BUFFER *ourbp;
X#if OPT_MOUSE
X`09WINDOW`09*wp0 = curwp;
X#endif
X
X`09doingopcmd = TRUE;
X
X`09pre_op_dot = DOT;
X`09ourbp = curbp;
X
X`09if (havemotion != NULL) `7B
X`09`09cfp = havemotion;
X`09`09havemotion = NULL;
X`09`7D else `7B
X`09`09mlwrite("%s operation pending...",str);
X`09`09(void)update(FALSE);
X
X`09`09/* get the next command from the keyboard */
X`09`09/* or a command line, as approp. */
X`09`09if (clexec) `7B
X`09`09`09macarg(tok);`09/* get the next token */
X`09`09`09if (!strcmp(tok,"lines"))
X`09`09&0209cfp = `26f_godotplus;
X`09`09`09else
X`09`09&0209cfp = engl2fnc(tok);
X`09`09`7D else `7B
X`09`09`09thiskey = lastkey;
X`09`09`09c = kbd_seq();
X
X#if OPT_MOUSE
X`09`09`09if (curwp != wp0) `7B
X`09`09&0209unkeystroke(c);
X`09`09`09    `09doingopcmd = FALSE;
X`09`09&0209return FALSE;
X`09`09`09`7D
X#endif
X`09`09`09/* allow second chance for entering counts */
X`09`09`09do_repeats(`26c,`26f,`26n);
X
X`09`09`09if (thiskey == lastkey)
X`09`09&0209cfp = `26f_godotplus;
X`09`09`09else
X`09`09&0209cfp = kcod2fnc(c);
X
X`09`09`7D
X`09`09if (cfp)
X`09`09`09mlerase();
X`09`09else `7B
X`09`09`09if (!clexec)
X`09`09&0209lsprintf(tok, "(%d)", c);
X`09`09`09no_such_function(tok);
X`09`09`7D
X`09`7D
X`09if (!cfp) `7B
X`09`09doingopcmd = FALSE;
X`09`09return FALSE;
X`09`7D
X
X`09if ((cfp->c_flags `26 MOTION) == 0) `7B
X`09`09kbd_alarm();
X`09`09doingopcmd = FALSE;
X`09`09return(ABORT);
X`09`7D
X
X`09/* motion is interpreted as affecting full lines */
X`09if (regionshape == EXACT) `7B
X`09    if (cfp->c_flags `26 FL)
X`09`09    regionshape = FULLLINE;
X`09    if (cfp->c_flags `26 RECT)
X`09`09    regionshape = RECTANGLE;
X`09`7D
X
X`09/* and execute the motion */
X`09status = execute(cfp, f,n);
X
X`09if (status != TRUE) `7B
X`09`09doingopcmd = FALSE;
X`09`09regionshape = EXACT;
X`09`09mlforce("`5BMotion failed`5D");
X`09`09return FALSE;
X`09`7D
X
X`09opcmd = 0;
X
X`09MK = pre_op_dot;
X
X`09/* we've successfully set up a region */
X`09if (!fn) `7B /* be defensive */
X`09`09mlforce("BUG -- null func pointer in operator");
X`09`09status = FALSE;
X`09`7D else `7B
X`09`09status = (fn)();
X`09`7D
X
X`09if (ourbp == curbp) /* in case the func switched buffers on us */
X`09`09swapmark();
X
X`09if (regionshape == FULLLINE)
X`09`09(void)firstnonwhite(FALSE,1);
X
X`09regionshape = EXACT;
X
X`09doingopcmd = FALSE;
X
X`09haveregion = FALSE;
X
X`09return status;
X`7D
X
Xint
Xoperdel(int f, int n)
X`7B
X`09int`09status;
X
X`09opcmd = OPDEL;
X`09lines_deleted = 0;
X`09status = vile_op(f, n, killregion,
X`09`09regionshape == FULLLINE
X`09`09`09? "Delete of full lines"
X`09`09`09: "Delete");
X`09if (do_report(lines_deleted))
X`09`09mlforce("`5B%d lines deleted`5D",\1106_\1107);
X`09return status;
X`7D
X
Xint
Xoperlinedel(int f, int n)
X`7B
X`09regionshape = FULLLINE;
X`09return operdel(f,n);
X`7D
X
Xstatic int
Xchgreg(void)
X`7B
X`09if (regionshape == RECTANGLE) `7B
X`09`09return stringrect();
X`09`7D else `7B
X`09`09killregion();
X`09`09if (regionshape == FULLLINE) `7B
X`09`09`09if (backline(FALSE,1) == TRUE)
X`09`09&0209/* backline returns FALSE at top of buf */
X`09`09&0209return opendown(TRUE,1);
X`09`09`09else
X`09`09&0209return openup(TRUE,1);
X`09`09`7D
X`09`09return ins();
X`09`7D
X`7D
X
Xint
Xoperchg(int f, int n)
X`7B
X`09int s;
X
X`09opcmd = OPOTHER;
X`09s = vile_op(f,n,chgreg,"Change");
X`09if (s == TRUE) swapmark();
X`09return s;
X`7D
X
Xint
Xoperlinechg(int f, int n)
X`7B
X`09int s;
X
X`09regionshape = FULLLINE;
X`09opcmd = OPOTHER;
X`09s = vile_op(f,n,chgreg,"Change of full lines");
X`09if (s == TRUE) swapmark();
X`09return s;
X`7D
X
Xint
Xoperjoin(int f, int n)
X`7B
X`09opcmd = OPOTHER;
X`09return vile_op(f,n,joinregion,"Join");
X`7D
X
Xint
Xoperyank(int f, int n)
X`7B
X`09MARK savedot;
X`09int s;
X`09savedot = DOT;
X`09opcmd = OPDEL;
X`09s = vile_op(f,n,yankregion,"Yank");
X`09DOT = savedot;
X`09return s;
X`7D
X
Xint
Xoperlineyank(int f, int n)
X`7B
X`09MARK savedot;
X`09int s;
X`09savedot = DOT;
X`09regionshape = FULLLINE;
X`09opcmd = OPOTHER;
X`09s = vile_op(f,n,yankregion,"Yank of full lines");
X`09DOT = savedot;
X`09return s;
X`7D
X
Xint
Xoperflip(int f, int n)
X`7B
X`09opcmd = OPOTHER;
X`09return vile_op(f,n,flipregion,"Flip case");
X`7D
X
Xint
Xoperupper(int f, int n)
X`7B
X`09opcmd = OPOTHER;
X`09return vile_op(f,n,upperregion,"Upper case");
X`7D
X
Xint
Xoperlower(int f, int n)
X`7B
X`09opcmd = OPOTHER;
X`09return vile_op(f,n,lowerregion,"Lower case");
X`7D
X
X/*
X * The shift commands are special, because vi allows an implicit repeat-count
V
X * to be specified by repeating the '<' or '>' operators.
X */
Xstatic int
Xshift_n_times(int f, int n, OpsFunc func, const char *msg)
X`7B
X`09register int status = FALSE;
X
X`09regionshape = FULLLINE;
X`09opcmd = OPOTHER;
X
X`09if (havemotion != NULL) `7B
X`09`09const CMDFUNC *cfp = havemotion;
X`09`09while (n-- > 0) `7B
X`09`09`09havemotion = cfp;
X`09`09`09if ((status = vile_op(FALSE,1, func, msg)) != TRUE)
X`09`09&0209break;
X`09`09`7D
X`09`7D else
X`09`09status = vile_op(f,n, func, msg);
X`09return status;
X`7D
X
Xint
Xoperlshift(int f, int n)
X`7B
X`09return shift_n_times(f,n,shiftlregion,"Left\2506");
X`7D
X
Xint
Xoperrshift(int f, int n)
X`7B
X`09return shift_n_times(f,n,shiftrregion,"Right\2606");
X`7D
X
Xint
Xoperwrite(int f, int n)
X`7B
X        register int    s;
X        char fname`5BNFILEN`5D;
X
X`09if (ukb != 0) `7B
X`09        if ((s=mlreply_file("Write to file: ", (TBUFF **)0,
X`09`09&0209FILEC_WRITE`7C\0C06PROMPT, fname)) != TRUE)
X`09        \0808return s;
X`09`09return kwrite(fname,TRUE);
X`09`7D else `7B
X`09`09opcmd = OPOTHER;
X`09`09return vile_op(f,n,writeregion,"File write");
X`09`7D
X`7D
X
X#if OPT_FORMAT
Xint
Xoperformat(int f, int n)
X`7B
X`09regionshape = FULLLINE;
X`09opcmd = OPOTHER;
X`09return vile_op(f,n,formatregion,"Format");
X`7D
X#endif
X
X#if OPT_SHELL
Xint
Xoperfilter(int f, int n)
X`7B
X`09regionshape = FULLLINE;
X`09opcmd = OPOTHER;
X`09return vile_op(f,n,filterregion,"Filter");
X`7D
X#endif
X
X
Xint
Xoperprint(int f, int n)
X`7B
X`09regionshape = FULLLINE;
X`09opcmd = OPOTHER;
X`09return vile_op(f,n,plineregion,"Line print");
X`7D
X
Xint
Xoperpprint(int f, int n)
X`7B
X`09regionshape = FULLLINE;
X`09opcmd = OPOTHER;
X`09return vile_op(f,n,pplineregion,"Line-number print");
X`7D
X
Xint
Xoperlist(int f, int n)
X`7B
X`09regionshape = FULLLINE;
X`09opcmd = OPOTHER;
X`09return vile_op(f,n,llineregion,"Line list");
X`7D
X
Xint
Xopersubst(int f, int n)
X`7B
X`09regionshape = FULLLINE;
X`09opcmd = OPOTHER;
X`09return vile_op(f,n,substregion,"Substitute");
X`7D
X
Xint
Xopersubstagain(int f, int n)
X`7B
X`09regionshape = FULLLINE;
X`09opcmd = OPOTHER;
X`09return vile_op(f,n,subst_again_region,"Substitute-again");
X`7D
X
X#if OPT_AEDIT
Xint
Xoperentab(int f, int n)
X`7B
X`09regionshape = FULLLINE;
X`09opcmd = OPOTHER;
X`09return vile_op(f,n,entab_region,"Spaces-->Tabs");
X`7D
X#endif
X
X#if OPT_AEDIT
Xint
Xoperdetab(int f, int n)
X`7B
X`09regionshape = FULLLINE;
X`09opcmd = OPOTHER;
X`09return vile_op(f,n,detab_region,"Tabs-->Spaces");
X`7D
X#endif
X
X#if OPT_AEDIT
Xint
Xopertrim(int f, int n)
X`7B
X`09regionshape = FULLLINE;
X`09opcmd = OPOTHER;
X`09return vile_op(f,n,trim_region,"Trim whitespace");
X`7D
X#endif
X
X#if OPT_AEDIT
Xint
Xoperblank(int f, int n)
X`7B
X`09opcmd = OPOTHER;
X`09return vile_op(f,n,blank_region,"Blanking");
X`7D
X#endif
X
X#if OPT_ENCRYPT
Xint
Xopercrypt(int f, int n)
X`7B
X`09opcmd = OPOTHER;
X`09return vile_op(f,n,cryptregion,"Encrypt/decrypt");
X`7D
X#endif
X
Xint
Xoperopenrect(int f, int n)
X`7B
X`09opcmd = OPOTHER;
X`09regionshape = RECTANGLE;
X`09return vile_op(f,n,openregion,"Opening");
X`7D
X
$ call unpack [.VILE-8_0]OPERS.C;1 -
 1237255468 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 16 91 152
$!
$ create 'f'
X/*
X * $Header: /usr/build/vile/vile/RCS/os2keys.h,v 1.1 1997/11/30 23:51:25 tom E
Vxp $
X *
X * Function-key definitions used for OS/2 VIO driver, as well as OS/2 EMX
X * driver.
X */
X
X/* Extended key prefix macros. */
X#define`09KE0(code)`09`09`7B 0xe0, code `7D
X#define`09K00(code)`09`09`7B 0x00, code `7D
X
Xstatic struct
X`7B
X`09char seq`5B2`5D;
X`09int code;
X`7D
XVIO_KeyMap`5B`5D =
X`7B
X`09`7B KE0('H'), KEY_Up `7D,
X`09`7B KE0('P'), KEY_Down `7D,
X`09`7B KE0('K'), KEY_Left `7D,
X`09`7B KE0('M'), KEY_Right `7D,
X`09`7B KE0('R'), KEY_Insert `7D,
X`09`7B KE0('S'), KEY_Delete `7D,
X`09`7B KE0('G'), KEY_Home `7D,
X`09`7B KE0('O'), KEY_End `7D,
X`09`7B KE0('I'), KEY_Prior `7D,
X`09`7B KE0('Q'), KEY_Next `7D,
X
X`09/*
X`09 * Unshifted function keys.  The VIO console driver generates
X`09 * different scan codes when these keys are pressed with Shift,
X`09 * Ctrl, and Alt; those codes are presently unsupported.
X`09 */
X`09`7B K00(';'), KEY_F1 `7D,
X`09`7B K00('<'), KEY_F2 `7D,
X`09`7B K00('='), KEY_F3 `7D,
X`09`7B K00('>'), KEY_F4 `7D,
X`09`7B K00('?'), KEY_F5 `7D,
X`09`7B K00('@'), KEY_F6 `7D,
X`09`7B K00('A'), KEY_F7 `7D,
X`09`7B K00('B'), KEY_F8 `7D,
X`09`7B K00('C'), KEY_F9 `7D,
X`09`7B K00('D'), KEY_F10 `7D,
X`09`7B K00(133), KEY_F11 `7D,
X`09`7B K00(134), KEY_F12 `7D,
X
X`09/* Keypad codes (with Num Lock off): */
X`09`7B K00('G'), KEY_Home `7D,
X`09`7B K00('H'), KEY_Up `7D,
X`09`7B K00('I'), KEY_Prior `7D,
X`09`7B K00('K'), KEY_Left `7D,
X`09`7B K00('L'), KEY_Select `7D,
X`09`7B K00('M'), KEY_Right `7D,
X`09`7B K00('O'), KEY_End `7D,
X`09`7B K00('P'), KEY_Down `7D,
X`09`7B K00('Q'), KEY_Next `7D,
X`09`7B K00('R'), KEY_Insert `7D,
X`09`7B K00('S'), KEY_Delete `7D
X`7D;
$ call unpack [.VILE-8_0]OS2KEYS.H;1 -
 578646536 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 3 92 152
$!
$ create 'f'
X
X/* pipe routines for OS/2
X *  lee johnson, spring 1995
X */
X#define INCL_DOSFILEMGR
X#define INCL_DOSQUEUES
X#define INCL_DOSERRORS
X#define INCL_NOPMAPI
X#include <os2.h>
X
X#include "estruct.h"
X
X#include <process.h>
X
X#ifndef EOS2ERR
X#define EOS2ERR EINVAL
X#endif
X
X#ifndef EOUTOFMEM
X#define EOUTOFMEM ENOMEM
X#endif
X
X#if CC_WATCOM
X#define _fdopen \0706
X#define _cwait  cwait
X#endif
X
X/* We have one pipe running from the parent to the child... */
Xstatic HFILE pipe_p_to_c = NULLHANDLE,\1A06c_from_p\1C0D;
X
X/* ...and another running from the child to the parent. */
Xstatic HFILE pipe_c_to_p = NULLHANDLE,\1A06p_from_c\1C0D;
X
Xstatic FILE *vile_in  = NULL;`09/* stream attached to pipe_p_from_c */
Xstatic FILE *vile_out = NULL;`09/* stream attached to pipe_p_to_c */
X
Xstatic int pid = -1;
X
Xstatic void
XDupError(APIRET rc)
X`7B
X`09switch(rc)
X`09`7B
X`09case ERROR_TOO_MANY_OPEN_FILES:
X`09`09errno = EMFILE;
X`09`09break;
X
X`09case ERROR_INVALID_HANDLE:
X`09case ERROR_INVALID_TARGET_HANDLE:
X`09`09errno = EBADF;
X`09`09break;
X
X`09default:
X`09`09errno = EOS2ERR;
X`09`09break;
X`09`7D
X`7D
X
Xint
X_os2_command(char *\0E07)
X`7B
X`09char buffer`5B1024`5D;
X`09char *shell;
X
X`09if ((shell = getenv("COMSPEC")) != NULL)
X`09`7B
X`09`09sprintf(buffer, "/C %s", command);
X`09`09return spawnlp(P_NOWAIT, shell\0707, buffer, NULL);
X`09`7D
X`09else
X`09`7B
X`09`09return -1;
X`09`7D
X`7D
X
Xstatic void
Xclose_pipes(void)
X`7B
X`09if (vile_in != NULL)
X`09`7B
X`09`09TRACE(("close_pipes, vile_in #%d`5Cn", fileno(\1707)))
X`09`09fclose(vile_in);
X`09`09vile_in = NULL;
X`09`09pipe_p_from_c = NULLHANDLE;
X`09`7D
X`09else if (pipe_p_from_c != NULLHANDLE)
X`09`7B
X`09`09TRACE(("close_pipes, pipe_p_from_c #%d`5Cn"\160F))
X`09`09DosClose(pipe_p_from_c);
X`09`09pipe_p_from_c = NULLHANDLE;
X`09`7D
X
X`09if (vile_out != NULL)
X`09`7B
X`09`09TRACE(("close_pipes, vile_out #%d`5Cn", fileno(\1808)))
X`09`09fclose(vile_out);
X`09`09vile_out = NULL;
X`09`09pipe_p_to_c = NULLHANDLE;
X`09`7D
X`09else if (pipe_p_to_c != NULLHANDLE)
X`09`7B
X`09`09TRACE(("close_pipes, pipe_p_to_c #%d`5Cn"\140D))
X`09`09DosClose(pipe_p_to_c);
X`09`09pipe_p_to_c = NULLHANDLE;
X`09`7D
X
X`09if (pipe_c_to_p != NULLHANDLE)
X`09`7B
X`09`09TRACE(("close_pipes, pipe_c_to_p #%d`5Cn"\140D))
X`09`09DosClose(pipe_c_to_p);
X`09`09pipe_c_to_p = NULLHANDLE;
X`09`7D
X`09if (pipe_c_from_p != NULLHANDLE)
X`09`7B
X`09`09TRACE(("close_pipes, pipe_c_from_p #%d`5Cn"\160F))
X`09`09DosClose(pipe_c_from_p);
X`09`09pipe_c_from_p = NULLHANDLE;
X`09`7D
X`7D
X
Xint
Xinout_popen(FILE **infile, \0F07out\1006char *command)
X`7B
X`09HFILE save_in,\0906out\0A07err;
X`09HFILE fd;
X`09APIRET rc;
X
X`09save_in = save_out\0B08err = NULLHANDLE;
X
X`09/* We have one pipe running from the parent to the child... */
X`09pipe_p_to_c = pipe_c_from_p = NULLHANDLE;
X
X`09/* ...and another running from the child to the parent. */
X`09pipe_c_to_p = pipe_p_from_c = NULLHANDLE;
X
X`09vile_in = vile_out = NULL;
X
X`09/* Create the pipes we'll use for IPC. */
X`09rc = DosCreatePipe(`26pipe_p_from_c, \1006c_to_p, 4096);
X`09if (rc != NO_ERROR)
X`09`7B
X`09`09errno = EOUTOFMEM;
X`09`09goto Error;
X`09`7D
X`09rc = DosCreatePipe(`26pipe_c_from_p, \1006p_to_c, 4096);
X`09if (rc != NO_ERROR)
X`09`7B
X`09`09errno = EOUTOFMEM;
X`09`09goto Error;
X`09`7D
X
X`09/*
X`09 * Save standard I/O handles.
X`09 */
X`09save_in = `7E0;
X`09if (DosDupHandle(0, `26save_in) != NO_ERROR)
X`09`7B
X`09`09DupError(rc);
X`09`09goto Error;
X`09`7D
X
X`09save_out = `7E0;
X`09if (DosDupHandle(1, `26save_out) != NO_ERROR)
X`09`7B
X`09`09DupError(rc);
X`09`09goto Error;
X`09`7D
X
X`09save_err = `7E0;
X`09if (DosDupHandle(2, `26save_err) != NO_ERROR)
X`09`7B
X`09`09DupError(rc);
X`09`09goto Error;
X`09`7D
X
X`09/*
X`09 * Redirect standard file handles for the CHILD PROCESS.
X`09 */
X
X`09/* Get standard input from the read end of the p_to_c pipe. */
X`09fd = 0;
X`09if (DosDupHandle(pipe_c_from_p, `26fd) != NO_ERROR)
X`09`7B
X`09`09DupError(rc);
X`09`09goto Error;
X`09`7D
X
X`09/* Send standard output to the write end of the c_to_p pipe. */
X`09fd = 1;
X`09if (DosDupHandle(pipe_c_to_p, `26fd) != NO_ERROR)
X`09`7B
X`09`09DupError(rc);
X`09`09goto Error;
X`09`7D
X
X`09/* Send error output to the write end of the c_to_p pipe. */
X`09fd = 2;
X`09if (DosDupHandle(pipe_c_to_p, `26fd) != NO_ERROR)
X`09`7B
X`09`09DupError(rc);
X`09`09goto Error;
X`09`7D
X
X`09/*
X`09 * Ensure that the p_to_c pipe will close cleanly when\2806arent
X`09 * process (vile) is done with it.
X`09 */
X`09if (DosSetFHState(pipe_p_to_c, OPEN_FLAGS_NOINHERIT) != NO_ERROR)
X`09`09goto Error;
X
X`09/* Launch the command. */
X`09if ((pid = _os2_command((char *)\1007)) < 0)
X`09`09goto Error;
X
X`09/*
X`09 * Ensure that the c_to_p pipe will close cleanly when\2806hild
X`09 * process is done with it.
X`09 */
X`09DosClose(pipe_c_to_p);
X`09pipe_c_to_p = NULLHANDLE;
X
X`09/* Connect the read end of the c_to_p pipe to a stream. */
X`09if (infile != NULL
X`09`09`26`26 (vile_in = *infile = _fdopen(pipe_p_from_c, "r")) == NULL)
X`09`09goto Error;
X`09TRACE(("inout_popen, vile_in #%d`5Cn", fileno(\1707)))
X
X`09/* Connect the write end of the p_to_c pipe to a stream. */
X`09if (outfile != NULL
X`09`09`26`26 (vile_out = *outfile = _fdopen(pipe_p_to_c, "w")) == NULL)
X`09`09goto Error;
X`09TRACE(("inout_popen, vile_out #%d`5Cn", fileno(\1808)))
X
X`09/* Restore redirected file handles. */
X`09if (save_in != NULLHANDLE)
X`09`7B
X`09`09fd = 0;
X`09`09DosDupHandle(save_in, `26fd);
X`09`09DosClose(save_in);
X`09`09TRACE(("inout_popen, dup 0: #%d, #%d`5Cn", save_in, fd))
X`09`7D
X`09if (save_out != NULLHANDLE)
X`09`7B
X`09`09fd = 1;
X`09`09DosDupHandle(save_out, `26fd);
X`09`09DosClose(save_out);
X`09`09TRACE(("inout_popen, dup 1: #%d, #%d`5Cn", save_out, fd))
X`09`7D
X`09if (save_err != NULLHANDLE)
X`09`7B
X`09`09fd = 2;
X`09`09DosDupHandle(save_err, `26fd);
X`09`09DosClose(save_err);
X`09`09TRACE(("inout_popen, dup 2: #%d, #%d`5Cn", save_err, fd))
X`09`7D
X
X`09return TRUE;
X
XError:
X`09TRACE(("inout_popen, Error`5Cn"))
X`09/* Restore redirected file handles. */
X`09if (save_in != NULLHANDLE)
X`09`7B
X`09`09fd = 0;
X`09`09DosDupHandle(save_in, `26fd);
X`09`7D
X`09if (save_out != NULLHANDLE)
X`09`7B
X`09`09fd = 1;
X`09`09DosDupHandle(save_out, `26fd);
X`09`7D
X`09if (save_err != NULLHANDLE)
X`09`7B
X`09`09fd = 2;
X`09`09DosDupHandle(save_err, `26fd);
X`09`7D
X
+-+-+-+-+-+-+-+-  END  OF PART 88 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 89 -+-+-+-+-+-+-+-+
X`09close_pipes();
X`09return FALSE;
X`7D
X
Xint
Xsoftfork(void)
X`7B
X`09return FALSE;
X`7D
X
Xvoid
Xnpflush(void)
X`7B
X`09if (vile_out != NULL)
X`09`7B
X`09`09TRACE(("npflush, vile_out #%d`5Cn", fileno(\1808)))
X`09`09fflush(vile_out);
X`09`09fclose(vile_out);
X`09`09vile_out = NULL;
X`09`09pipe_p_to_c = NULLHANDLE;
X`09`7D
X`7D
X
Xvoid
Xnpclose(FILE *pipe_file)
X`7B
X`09int wait_status;
X
X`09npflush();
X`09_cwait(`26wait_status, pid, WAIT_CHILD);
X`09close_pipes();
X`7D
$ call unpack [.VILE-8_0]OS2PIPE.C;1 -
 2032374785 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 13 93 152
$!
$ create 'f'
X/*
X * OS/2 VIO (character-mode) console routines.
X * Modified from a really old version of "borland.c" (before the VIO
X * stuff went in there.)
X *
X * $Header: /usr/build/vile/vile/RCS/os2vio.c,v 1.19 1998/05/14 23:18:12 tom E
Vxp $
X */
X
X#include "estruct.h"
X#include "edef.h"
X
X#if !SYS_OS2
X#error Configuration error:  OS/2 is required for VIO support.
X#endif
X
X#define INCL_WIN
X#define INCL_BASE
X#define INCL_MOU
X#define INCL_VIO
X#define INCL_DOSPROCESS
X#define INCL_NOPMAPI
X#include <os2.h>
X
X#include <conio.h>
X
X#if DISP_VIO
X
X#define SCROLLCODE        1
X
X/* The code to control the cursor shape isn't complete.  No big loss. */
X#define CURSOR_SHAPE 0
X
X#define NROW`0960`09`09`09/* Max Screen size.&0209*/
X#define NCOL    80`09`09`09/* Edit if you want to.         */
X#define`09MARGIN`098`09`09`09/* size of minimum margin and`09*/
X#define`09SCRSIZ`0964`09`09`09/* scroll size for extended lines */
X#define`09NPAUSE`09200`09`09`09/* # times thru update to pause */
X#define`09SPACE`0932`09`09`09/* space character&0209*/
X
X#define`09AttrColor(b, f)`09((((UINT)ctrans`5Bb`5D `26 15) << 4) `7C \1F0Ef
V\1F07)
X
Xstatic`09void`09vio_move   (int,int);
Xstatic`09void`09vio_eeol   (void);
Xstatic`09void`09vio_eeop   (void);
Xstatic`09void`09vio_beep   (void);
Xstatic`09void    vio_open   (void);
X#if OPT_VIDEO_ATTRS
Xstatic`09void`09vio_attr   (UINT);
X#else
Xstatic`09void`09vio_rev    (UINT);
X#endif`09/* OPT_VIDEO_ATTRS */
Xstatic`09int`09vio_cres   (const char *);
Xstatic`09void`09vio_close  (void);
Xstatic`09int`09vio_getc   (void);
Xstatic`09void`09vio_putc   (int);
Xstatic`09void`09vio_kopen  (void);
Xstatic`09void`09vio_kclose (void);
Xstatic`09void`09vio_flush  (void);
X
X#if OPT_COLOR
Xstatic`09void`09vio_fcol   (int);
Xstatic`09void`09vio_bcol   (int);
X#define vio_spal   set_ctrans
X#else
X#define`09vio_fcol   null_t_setfor
X#define`09vio_bcol   null_t_setback
X#define vio_spal   null_t_setpal
X#endif
X
X#if`09SCROLLCODE
Xstatic`09void`09vio_scroll (int,int,int);
X#else
X#define`09vio_scroll null_t\0E07
X#endif
X
X#if`09OPT_TITLE
Xstatic`09void`09vio_title (char *);
X#endif
X
Xstatic`09int`09scinit     (int);
X
Xint`09cfcolor = -1;`09`09/* current foreground color */
Xint`09cbcolor = -1;`09`09/* current background color */
X
Xstatic`09const char *initpalettestr = "0 4 2 6 1 5 3 7 8 12 10 14 9 13 11 15";
V
X
X/*
X * Standard terminal interface dispatch table. Most of the fields point into
X * "termio" code.
X */
XTERM term = `7B
X`09NROW - 1,
X`09NROW - 1,
X`09NCOL,
X`09NCOL,
X`09MARGIN,
X`09SCRSIZ,
X`09NPAUSE,
X`09vio_open,
X`09vio_close,
X`09vio_kopen,
X`09vio_kclose,
X`09vio_getc,
X`09vio_putc,
X`09tttypahead,
X`09vio_flush,
X`09vio_move,
X`09vio_eeol,
X`09vio_eeop,
X`09vio_beep,
X#if OPT_VIDEO_ATTRS
X`09vio_attr,
X#else
X`09vio_rev,
X#endif`09/* OPT_VIDEO_ATTRS */
X`09vio_cres,
X`09vio_fcol,
X`09vio_bcol,
X`09set_ctrans,
X`09vio_scroll,
X`09null_t_pflush,
X`09null_t_icursor,
X#if OPT_TITLE
X`09vio_title,
X#else
X`09null_t_title,
X#endif
X`09null_t_watchfd,
X`09null_t_unwatchfd,
X`7D;
X
X#include "os2keys.h"
X
X#define`09TEXT_BUFFER_SIZE`09`09256
X
Xstatic char  TextBuf`5BTEXT_BUFFER_SIZE`5D;
Xstatic int   TextFree;
Xstatic char *TextOut;
Xstatic int   TextRow, TextColumn;
Xstatic BYTE  TextAttr;
Xstatic int   MaxRows, MaxColumns;
Xstatic int   CursorRow,\0B07Column;
Xstatic BYTE  BlankCell`5B2`5D = `7B SPACE, 0 `7D;
Xstatic HMOU  hmou;
X
X#define blank_cell()`09( BlankCell`5B1`5D = TextAttr,\190A )
X
X#define flush_if_necessary() `5C
X`09`7B if (TextOut > TextBuf) vio_flush(); `7D
X
X#if CURSOR_SHAPE
Xstatic void
Xset_cursor(int cmode)
X`7B
X`09VIOCURSORINFO cinfo;
X
X`09cinfo.cx = 0;`09`09`09/* Width of character cell */
X`09cinfo.cEnd = -100;`09`09/* Cursor ends at bottom of cell */
X`09cinfo.attr = 0;`09`09`09/* Visible cursor */
X
X`09switch (cmode) `7B
X`09case 0:
X`09`09/* Hidden cursor. */
X`09`09cinfo.attr = -1;
X`09`09break;
X
X`09case 1:
X`09`09/* Block cursor. */
X`09`09cinfo.yStart = 0;
X`09`09break;
X
X`09case 2:
X`09`09/* 'Normal' cursor. */
X`09`09cinfo.yStart = -75;
X`09`09break;
X`09`7D
X
X`09(void) VioSetCurType(`26cinfo, 0);
X`7D
X#endif /* CURSOR_SHAPE */
X
X#if OPT_COLOR
X/*
X * Set the current foreground colour.  'color' specifies an ANSI\2307
X * index.
X */
Xstatic void
Xvio_fcol(int color)
X`7B
X`09/* Flush any old text that needs to be written using the old colour. */
X`09flush_if_necessary();
X
X`09cfcolor  = color;
X`09TextAttr = AttrColor(cbcolor, cfcolor);
X`7D
X
X/*
X * Set the current background colour.  'color' specifies an ANSI\2307
X * index.
X */
Xstatic void
Xvio_bcol(int color)
X`7B
X`09/* Flush any old text that needs to be written using the old colour. */
X`09flush_if_necessary();
X
X`09cbcolor  = color;
X`09TextAttr = AttrColor(cbcolor, cfcolor);
X`7D
X#endif
X
Xstatic void
Xvio_move(int row, int col)
X`7B
X`09flush_if_necessary();
X
X`09TextRow    = row;
X`09TextColumn = col;
X`7D
X
X/* erase to the end of the line */
Xstatic void
Xvio_eeol(void)
X`7B
X`09int length;
X
X`09flush_if_necessary();
X
X`09if ((length = MaxColumns - Text\0E06) > 0)
X`09`7B
X`09`09(void) VioWrtNCell(blank_cell(), length, TextRow\0906Column, 0);
X`09`7D
X`7D
X
Xstatic int
Xdecode_mouse_state(USHORT state)
X`7B
X`09int button = 0;
X`09if (state `26 MOUSE_MOTION_WITH_BN1_DOWN
X`09 `7C`7C state `26 MOUSE_BN1_DOWN) `7B
X`09`09button = 1;
X`09`7D
X`09if (state `26 MOUSE_MOTION_WITH_BN2_DOWN
X`09 `7C`7C state `26 MOUSE_BN2_DOWN) `7B
X`09`09button = 2;
X`09`7D
X`09if (state `26 MOUSE_MOTION_WITH_BN3_DOWN
X`09 `7C`7C state `26 MOUSE_BN3_DOWN) `7B
X`09`09button = 3;
X`09`7D
X`09return button;
X`7D
X
X/* If we have a mouse event, process it.  Otherwise, read a character. */
Xstatic int
Xvio_getc(void)
X`7B
X`09MOUEVENTINFO mouev;
X`09USHORT`09nowait = MOU_NOWAIT;
X`09USHORT`09rc;
X`09int`09button = 0;
X
X`09do `7B
X`09`09rc = MouReadEventQue(`26mouev, `26nowait, hmou);
X`09`09if (rc == 0 `26`26 mouev.fs != 0) `7B
X`09`09`09if (button) `7B
X`09`09&0209int last = button;
X`09`09&0209button = decode_mouse_state(mouev.fs);
X`09`09&0209if (button) `7B
X`09`09&0209`09if (last == button) `7B
X`09`09&0209&0209if (!setcursor(mouev.row, \0B06col))
X`09`09&0209&0309continue;
X`09`09&0209&0209if (!sel_extend(TRUE, TRUE))
X`09`09&0209&0309continue;
X`09`09&0209`09`7D else `7B
X`09`09&0209&0209sel_release();
X`09`09&0209`09`7D
X`09`09&0209`09(void)update(TRUE);
X`09`09&0209`7D else `7B
X`09`09&0209`09sel_yank(0);
X`09`09&0209`7D
X`09`09`09`7D else `7B
X`09`09&0209button = decode_mouse_state(mouev.fs);
X`09`09&0209if (button == 1) `7B
X`09`09&0209`09if (!setcursor(mouev.row, \0B06col))
X`09`09&0209&0209continue;
X`09`09&0209`09(void)sel_begin();
X`09`09&0209`09(void)update(TRUE);
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`7D
X`09`7D while (!kbhit());
X
X`09return getch();
X`7D
X
X/* put a character at the current position in \180Ccolors */
Xstatic void
Xvio_putc(int ch)
X`7B
X`09BYTE b;
X
X`09if (TextFree <= 0)
X`09`09vio_flush();
X
X`09/*
X`09 * Control character kludges.  Sigh.
X`09 */
X`09switch (ch)
X`09`7B
X`09`09case '`5Cb':
X`09`09`09flush_if_necessary();
X`09`09`09TextColumn--;
X`09`09`09break;
X
X`09`09case '`5Cn':
X`09`09case '`5Cr':
X`09`09`09flush_if_necessary();
X`09`09`09b = ch;
X`09`09`09VioWrtTTY(`26b, 1, 0);
X`09`09`09break;
X
X`09`09default:
X`09`09`09*TextOut++ = ch;
X`09`09`09TextFree--;
X`09`09`09break;
X`09`7D
X`7D
X
Xstatic void
Xvio_flush(void)
X`7B
X`09int length = TextOut - TextBuf;
X
X`09if (length > 0)
X`09`7B
X`09`09(void) VioWrtCharStrAtt(TextBuf, length, TextRow\0906Column,
X`09`09`09`26TextAttr, 0);
X`09`09TextColumn += length;
X`09`7D
X`09TextOut  = TextBuf;
X`09TextFree = TEXT_BUFFER_SIZE;
X
X`09/* Make the cursor 'catch up', if necessary. */
X`09if (CursorColumn != Text\0E07`7C`7C \1E06Row\1B08Row)
X`09`7B
X`09`09(void) VioSetCurPos(TextRow, TextColumn, 0);
X`09`09CursorRow = TextRow;
X`09`09CursorColumn = Text\0D06;
X`09`7D
X`7D
X
Xstatic void
Xvio_eeop(void)
X`7B
X`09int length;
X
X`09flush_if_necessary();
X
X`09length = (MaxRows * MaxColumns)
X`09`09   - (TextRow * MaxColumns + Text\0E06);
X`09if (length > 0)
X`09`09(void) VioWrtNCell(blank_cell(), length, TextRow\0906Column, 0);
X`7D
X
X#if OPT_VIDEO_ATTRS
Xstatic void
Xvio_attr(UINT attr)
X`7B
X`09attr = VATTRIB(attr);
X`09attr `26= `7E(VAML`7CVAMLFOC);
X
X`09flush_if_necessary();
X
X#if OPT_COLOR
X`09if (attr `26 VACOLOR)
X`09`09vio_fcol(VCOLORNUM(attr));
X`09else
X`09`09vio_fcol(gfcolor);
X#endif
X`09if (attr `26 (VAREV`7CVASEL))
X`09`09TextAttr = AttrColor(cfcolor, cbcolor);
X`09else
X`09`09TextAttr = AttrColor(cbcolor, cfcolor);
X
X`09if (attr `26 VABOLD)
X`09`09TextAttr `7C= 0x8;
X`7D
X
X#else`09/* highlighting is a minimum attribute */
X
X/*
X * Choose the text attributes for reverse or normal video.  R\1A07video
X * is selected if 'reverse' is TRUE, and normal video otherwise.
X */
Xstatic void
Xvio_rev(UINT reverse)
X`7B
X`09flush_if_necessary();
X
X`09if (reverse)
X`09`09TextAttr = AttrColor(cfcolor, cbcolor);
X`09else
X`09`09TextAttr = AttrColor(cbcolor, cfcolor);
X`7D
X#endif`09/* OPT_VIDEO_ATTRS */
X
Xstatic int
Xvio_cres(const char *res) /* change screen resolution */
X`09`09`09/* resolution to change to */
X`7B
X`09return scinit(-1);
X`7D
X
X#if`09OPT_FLASH
Xstatic void
Xflash_display(void)
X`7B
X`09VIOMODEINFO data;
X`09UINT cellsize;
X`09BYTE *buf1;
X`09BYTE *buf2;
X`09USHORT got, length;
X
X`09data.cb = sizeof(data);
X`09VioGetMode(`26data, 0);
X`09cellsize = 1 + data.attrib;
X
X`09buf1 = malloc(data.full_length);
X`09buf2 = malloc(data.full_length);
X
X`09length = data.full_\1306;
X`09VioReadCellStr(buf1, `26length, 0, 0, 0);
X
X`09length = data.full_\1306;
X`09VioReadCellStr(buf2, `26length, 0, 0, 0);
X
X`09for (got = 0; got < data.full_length\1806+= cellsize) `7B
X`09`09buf2`5Bgot + 1`5D `5E= 8;
X`09`7D
X`09VioWrtCellStr(buf2, data.full_length, 0, 0, 0);
X`09DosSleep(200);
X`09VioWrtCellStr(buf1, data.full_length, 0, 0, 0);
X
X`09free(buf1);
X`09free(buf2);
X`7D
X#endif
X
Xstatic void
Xvio_beep()
X`7B
X#if`09OPT_FLASH
X`09if (global_g_val(GMDFLASH)) `7B
X`09`09flash_display();
X`09`09return;
X`09`7D
X#endif
X`09/* A nice, brief beep. */
X`09DosBeep(440, 50);
X`7D
X
Xstatic void
Xvio_open(void)
X`7B
X`09int i;
X
X`09/* Initialize output buffer. */
X`09TextRow = 0;
X`09TextColumn = 0;
X`09TextOut = TextBuf;
X`09TextFree = TEXT_BUFFER_SIZE;
X
X`09for (i = 0; i < sizeof(VIO_KeyMap) /\1512`5B0`5D); i++)
X`09`7B
X`09`09addtosysmap(VIO_KeyMap`5Bi`5D.seq, 2, \160Ecode);
X`09`7D
X
X#if OPT_COLOR
X`09set_palette(init\0C07str);
X`09vio_fcol(gfcolor);
X`09vio_bcol(gbcolor);
X#endif
X
X#if CURSOR_SHAPE
X`09set_cursor(1);
X#endif
X
X`09if (!vio_cres(current_res_name))
X`09`09(void) scinit(-1);
X`7D
X
Xstatic void
Xvio_close(void)
X`7B
X#if CURSOR_SHAPE
X`09set_cursor(2);
X#endif
X`09vio_move(MaxRows-1, 0);
X`09TTeeop();
X`7D
X
Xstatic void
Xvio_kopen()`09/* open the keyboard */
X`7B
X`09MouOpen(NULL, `26hmou);
X`09MouDrawPtr(hmou);
X`09return;
X`7D
X
Xstatic void
Xvio_kclose()`09/* close the keyboard */
X`7B
X`09MouClose(hmou);
X`09return;
X`7D
X
Xstatic int
Xscinit(int rows)`09/* initialize the screen head pointers */
X`7B
X`09VIOMODEINFO vinfo;
X
X`09vinfo.cb = sizeof(vinfo);
X`09(void) VioGetMode(`26vinfo, 0);
X
X`09MaxRows = vinfo.row;
X`09MaxColumns = vinfo.col;
X`09newscreensize(MaxRows, MaxColumns);
X
X`09return TRUE;
X`7D
X
X#if SCROLLCODE
X/*
X * Move 'n' lines starting at 'from' to 'to'
X *
X * OPT_PRETTIER_SCROLL is prettier but slower -- it scrolls a line at a time
X * instead of all at once.
X */
X
Xstatic void
Xvio_scroll(int from, int to\0806n)
X`7B
X`09/* Ignore single-line scrolling regions. */
X`09if (to == from)
X`09`09return;
X
X#if OPT_PRETTIER_SCROLL
X`09/* Easier for the eye to follow, but slower. */
X`09if (absol(from-to) > 1) `7B
X`09`09vio_scroll(from, (from < to) ? to - 1 : to + 1, n);
X`09`09if (from < to)
X`09`09`09from = to-1;
X`09`09else
X`09`09`09from = to+1;
X`09`7D
X#endif
X
X`09if (to < from)
X`09`7B
X`09`09(void) VioScrollUp(to, 0, from + n - 1, MaxColumns - 1,
X`09`09`09from - to, blank_cell(), 0);
X/*
X`09`09vio_move(to + n, 0);
X*/
X`09`7D
X`09else
X`09`7B
X`09`09(void) VioScrollDn(from, 0, to + n - 1, MaxColumns - 1,
X`09`09`09to - from, blank_cell(), 0);
X/*
X`09`09vio_move(to + n, 0);
X*/
X`09`7D
X`7D
X#endif`09/* SCROLLCODE */
X
X#if OPT_TITLE
X/*
X * This sets the title in the window-list, but doesn't work for the
X * actual window title.  It's adapted from a standalone code example
X * that uses
X *`09WinSetWindowText(hwndActive, swcntrl.szSwtitle);
X * before
X *`09WinChangeSwitchEntry(h\0D06, `26swcntrl);
X *
X * The standalone example is linked for PM versus this program's VIO mode.
X */
Xstatic void
Xvio_title(char *title)`09`09/* set the current window title */
X`7B
X      HAB  hab = WinInitialize( 0 );
X      HMQ  hmq = WinCreateMsgQueue( hab, 0 );
X      HWND hwndActive = WinQuery\1106Window(HWND_DESKTOP);
X      HWND hwndFrame = WinQueryWindow(hwndActive, QW_PARENT);
X      char temp`5B24`5D;
X      BOOL ok;
X      LONG nn;
X
X      WinQuerySessionTitle(hab, 0, temp, sizeof(temp));
X
X      if (strlen(title))
X      `7B
X         HSWITCH hSwitch;
X         SWCNTRL swcntrl;
X
X         if (hSwitch = WinQuery\1106Handle(hwndActive, (PID)0L))
X         `7B
X            if (!WinQuerySwitchEntry(h\0D06, `26swcntrl))
X            `7B
X        \0807strncpy(swcntrl.szSwtitle, \0707MAXNAMEL);
X        \0807swcntrl.szSwtitle`5BMAXNAMEL`5D = '`5C0';
X#if 0
X        \0807WinSetWindowText(hwndActive, swcntrl.szSwtitle);
X#endif
X        \0807WinChangeSwitchEntry(h\0D06, `26swcntrl);
X            `7D
X         `7D
X      `7D
X
X      WinDestroyMsgQueue( hmq );
X      WinTerminate( hab );
X`7D
X#endif /* OPT_TITLE */
X
X#endif /* DISP_VIO */
$ call unpack [.VILE-8_0]OS2VIO.C;1 -
 1380366423 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 26 94 152
$!
$ create 'f'
X/*
X * Program: A simple comment and keyword attributer for vile
X * Author : Jukka Keto, jketo@cs.joensuu.fi
X * Date   : 30.12.1994
X * Modifications:  kevin buettner and paul fox  2/95
X * `09`09string literal ("L\0A06") support --  ben stoltz
X *
X * $Header: /usr/build/vile/vile/RCS/pas-filt.c,v 1.2 1998/05/19 19:24:11 tom
V Exp $
X *
X * Features:
X * `09- Reads the keyword file ".vile.\1407s" from the home directory.
X *`09  Keyword file consists lines "k\1D06:attribute" where
X *`09  keyword is any alphanumeric string `5B#a-zA-Z0-9_`5D followed
X *`09  by colon ":" and attribute character; "I" for italic,
X *`09  "U" for underline, "B\1306bold, "R\2106reverse or
X *`09  "C#" for color (where # is a single hexadecimal digit representing
X *`09  one of 16 colors).
X *`09- Attributes the file read from stdin using vile a\2F08 sequences
X *`09  and outputs the file to stdout with keywords and comments
X *`09  attributed.
X *`09- Comments are handled by the pseudo-keyword "\2C08".
X *`09- "String literals" are handled by the pseudo-keyword "L\2D08.
X *`09- Here is a macro one might use to invoke the colorizer:
X *`09    30 store-macro
X *`09`09    write-message "`5BAttaching Pascal attributes...`5D"
X *`09`09    set-variable %savcol $curcol
X *`09`09    set-variable %savline $curline
X *`09`09    set-variable %modified $\0A08
X *`09`09    goto-beginning-of-file
X *`09`09    filter-til end-of-file "pas-filt"
X *`09`09    goto-beginning-of-file
X *`09`09    attribute-cntl_a-sequences-til end-of-file
X *`09`09    `7Eif `26not %modified
X *`09`09`09    unmark-buffer
X *`09`09    `7Eendif
X *`09`09    %savline goto-line
X *`09`09    %savcol goto-column
X *`09`09    write-message "`5BAttaching Pascal attributes...done `5D"
X *`09    `7Eendm
X *`09    bind-key execute-macro-30 `5EX-q
X *
X * Here's the .vile.keywords file which I used to test:
XComments:C2
XLiteral:U
Xgoto:C2
Xand:B
Xbegin:B
Xcase:B
Xcase:B
Xconstructor:B
Xdo:B
Xelse:B
Xend:B
Xfunction:B
Xif:B
Xnot:B
Xof:B
Xor:B
Xprocedure:B
Xprogram:B
Xrecord:B
Xrepeat:B
Xthen:B
Xtype:B
Xunit:B
Xuntil:B
Xuses:B
Xwhile:B
Xwith:B
Xarray:C4
Xarray:C4
Xboolean:C4
Xbyte:C4
Xchar:C4
Xconst:C4
Xconst:C4
Xfile:C4
Xinteger:C4
Xpacked:C4
Xpointer:C4
Xreal:C4
Xset:C4
Xvar:C4
Xword:C4
X */
X
X#ifdef HAVE_CONFIG_H
X#include "config.h"
X#else
X/* assume ANSI C */
X# define HAVE_STDLIB_H 1
X# define HAVE_STRING_H 1
X#endif
X
X#include <sys/types.h>`09`09/* sometimes needed to get size_t */
X
X#if HAVE_STDLIB_H
X#include <stdlib.h>
X#else
X# if !defined(HAVE_CONFIG_H) `7C`7C MISSING_EXTERN_MALLOC
Xextern`09char *`09malloc`09( size_t len );
X# endif
X#endif
X
X#ifdef HAVE_UNISTD_H
X#include <unistd.h>
X#endif
X
X#include <stdio.h>
X
X#ifdef HAVE_STRING_H
X#include <string.h>
X#endif
X
X#if MISSING_EXTERN__FILBUF
Xextern`09int`09_filbuf`09( FILE *fp );
X#endif
X
X#if MISSING_EXTERN__FLSBUF
Xextern`09int`09_flsbuf`09( int len, FILE *fp );
X#endif
X
X#if MISSING_EXTERN_FCLOSE
Xextern`09int`09fclose`09( FILE *fp );
X#endif
X
X#if MISSING_EXTERN_FPRINTF
Xextern`09int`09fprintf`09( FILE *fp, const char *fmt, ... );
X#endif
X
X#if MISSING_EXTERN_PRINTF
Xextern`09int`09printf`09( const char *fmt, ... );
X#endif
X
X#if MISSING_EXTERN_SSCANF
Xextern`09int`09sscanf`09( const char *src,\110Dfmt, ... );
X#endif
X
X#if OPT_LOCALE
X#include <locale.h>
X#endif
X#include <ctype.h>
X
X#define MAX_KEYWORD_LENGTH 80
X#define HASH_LENGTH 256
X#define MAX_LINELENGTH 256
X#define MAX_ATTR_LENGTH 3
X
X#ifdef _WIN32
Xstatic char *keyword_file="vile.\1307s";
X#define PATHSEP '`5C`5C'
X#else
X# if __GO32__
X#define PATHSEP '`5C`5C'
Xstatic char *keyword_file="vile.key";
X# else
X#define PATHSEP '/'
Xstatic char *keyword_file=".vile.\1407s";
X# endif
X#endif
X
X#define isNameBegin(c)   (isalpha(c) `7C`7C (c) == '_')
X#define isNameExtra(c)   (isalnum(c) `7C`7C (c) == '_')
X#define isBlank(c)  ((c) == ' ' `7C`7C (\0E07`5Ct')
X
X#define L_CURL '`7B'
X#define R_CURL '`7D'
X#define QUOTE  '`5C''
X
Xtypedef struct _keyword KEYWORD;
X
Xstruct _keyword `7B
X    char kw`5BMAX_KEYWORD_LENGTH+1`5D;`09/* stores lowercase keyword */
X    char ow`5BMAX_KEYWORD_LENGTH+1`5D;`09/* stores original keyword */
X    char attribute`5BMAX_ATTR_LENGTH+1`5D;
X    int  length;
X    KEYWORD *next;
X`7D;
X
Xstatic KEYWORD *hashtable`5BHASH_LENGTH`5D;
Xstatic KEYWORD identifier;
Xstatic char comment_attr`5BMAX_ATTR_LENGTH+1`5D = "C1"; /* color 1 */
Xstatic char literal_attr`5BMAX_ATTR_LENGTH+1`5D = "C2"; /* color 1 */
X
Xstatic void
Xinithash(void)
X`7B
X    int i;
X    for (i=0;i<HASH_LENGTH;i++) hashtable`5Bi`5D = NULL;
X`7D
X
Xstatic void
Xremovelist(KEYWORD *k)
X`7B
X    if (k != NULL) `7B
X`09if (k->next != NULL) removelist\1C08);
X`09free((char *)k);
X    `7D
X`7D
X
Xstatic void
Xclosehash(void)
X`7B
X    int i;
X    for (i=0;i<HASH_LENGTH;i++) `7B
X`09removelist(hashtable`5Bi`5D);
X`09hashtable`5Bi`5D = NULL; /* For unseen future i do this */
X    `7D
X`7D
X
Xstatic int
Xhash_function(char *id)
X`7B
X    /*
X     * Build more elaborate hashing scheme. If you want one.
X     */
X    return ( (int) *id );
X`7D
X
Xstatic void
Xinsert_keyword(
X    char *ident,
X    char *attribute)
X`7B
X    KEYWORD *first;
X    KEYWORD *nxt;
X    int Index;
X    if (!strcmp(ident,"Comments")) `7B
X`09(void)strcpy(comment_attr,attribute);
X`09return;
X    `7D
X    if (!strcmp(ident,"Literal")) `7B
X`09strcpy(literal_attr,attribute);
X`09return;
X    `7D
X    nxt = first = NULL;
X    Index = hash_function(ident);
X    first = hashtable`5BIndex`5D;
X    if ((nxt = (KEYWORD *)malloc(sizeof(struct _keyword))) != NULL) `7B
X`09(void)strcpy(nxt->kw,ident);
X`09nxt->length = strlen(nxt->kw);
X`09(void)strcpy(nxt->attribute,\0A09);
X`09nxt->next = first;
X`09hashtable`5BIndex`5D = nxt;
X#ifdef DEBUG
X    fprintf(stderr,"insert_keyword: new %li, new->kw %s\0C07length %\1C08attri
Vbute %c\2F07next %li`5Cn", new,
X    `09`09&0209    nxt->kw,\0906length\0D07attribute,nxt->next);
X#endif
X    `7D
X`7D
X
X
Xstatic void
Xmatch_identifier(void)
X`7B
X    KEYWORD *hash_id;
X    int Index, match = 0;
X
X    Index = hash_function(identifier.kw);
X    hash_id = hashtable`5BIndex`5D;
X
X    while (hash_id != NULL) `7B
X`09if (hash_id->length == identifier.\1506) `7B /* Possible match */
X`09    if (strcmp(hash_id->kw,identifier.kw) == 0) `7B
X`09`09match = 1;
X`09`09break;
X`09    `7D
X`09`7D
X`09hash_id = \0A07->next;
X    `7D
X    if (match)
X`09printf("`5C001%i%s:", identifier.length, hash_id->attribute);
X    printf("%s",identifier.ow);
X`7D
X
X
Xstatic char *
Xextract_identifier(char *s)
X`7B
X    register char *kwp = identifier.kw;
X    register char *owp = identifier.ow;
X
X    identifier.length = 0;
X
X    while ((isNameExtra(*s)) `26`26
X           identifier.length < MAX_KEYWORD_LENGTH) `7B
X`09identifier.length += 1;
X`09if (isalpha(*s) `26`26 isupper(*s))
X`09    *kwp++ = tolower(*s);
X`09else
X`09    *kwp++ = *s;
X`09*owp++ = *s++;
X    `7D
X    *kwp = '`5C0';
X    *owp = '`5C0';
X    return(s);
X`7D
X
Xstatic FILE *
Xopen_keywords(char *filename)
X`7B
X    char *home = getenv("HOME");
X    char fullname`5B1024`5D;
X
X    if (home == 0)
X    `09home = "";
X    sprintf(fullname, "%s%c%s", home, PATHSEP, filename);
X    return fopen(fullname, "r");
X`7D
X
Xstatic void
Xread_keywords(char *filename)
X`7B
X    char ident`5BMAX_KEYWORD_LENGTH+1`5D;
X    char line`5BMAX_LINELENGTH+1`5D;
X    char attribute`5BMAX_ATTR_LENGTH+1`5D;
X    int  items;
X    FILE *kwfile;
X
X    if ((kwfile = open_keywords(filename)) != NULL) `7B
X`09fgets(line,MAX_LINELENGTH,kwfile);
X`09items = sscanf(line,"%`5B#a-zA-Z0-9_`5D:%`5BIUBR`5D",ident,attribute);
X`09if (items != 2)
X`09    items = sscanf(line,"%`5B#a-zA-Z0-9_`5D:%`5BC0-9ABCDEF`5D",ident,attrib
Vute);
X`09while (! feof(kwfile) ) `7B
X#ifdef DEBUG
X`09    fprintf(stderr,"read_keywords: Items %i, kw = %s, attr = %s`5Cn",items,
Vident,attribute);
X#endif
X`09    if (items == 2)
X`09`09insert_keyword(ident,attribute);
X`09    fgets(line,MAX_LINELENGTH,kwfile);
X`09    items = sscanf(line,"%`5B#a-zA-Z0-9_`5D:%`5BIUBR`5D",ident,attribute);
V
X`09    if (items != 2)
X`09`09items = sscanf(line,"%`5B#a-zA-Z0-9_`5D:%`5BC0-9ABCDEF`5D",ident,attribu
Vte);
X`09`7D
X`09fclose(kwfile);
X    `7D
X`7D
X
Xstatic int
Xhas_endofcomment(char *s)
X`7B
X    int i=0;
X    while (*s) `7B
X`09if (*s == R_CURL) `7B
X`09    return(i+1);
X`09`7D
X`09i += 1;
X`09s += 1;
X    `7D
X    return(0);
X`7D
X
Xstatic int
Xhas_endofliteral(char *s)`09/* points past beginning QUOTE */
X`7B
X    int i = 0;
X
X    while (s`5Bi`5D) `7B
X`09if (s`5Bi`5D == QUOTE) `7B
X`09    if (s`5Bi+1`5D == QUOTE) `7B
X`09`09i += 2;
X`09    `7D else `7B
X`09        return (i);`09/* points before ending QUOTE */
X`09    `7D
X`09`7D
X`09++i;
X    `7D
X    return(0);
X`7D
X
Xstatic char *
Xskip_white(char *s)
X`7B
X    while(*s `26`26 isBlank(*s))
X    `09putchar(*s++);
X    return s;
X`7D
X
Xstatic char *
Xwrite_literal(char *s)
X`7B
X    int c_length = has_endofliteral(s);
X    if (c_length == 0)
X`09c_length = strlen(s);
X    printf("`5C001%i%s:%.*s", c_length, literal_attr\180Cs);
X    s += c_length;
X    if (*s == QUOTE)
X    `09putchar(*s++);
X    return s;
X`7D
X
Xint
Xmain(int argc, char **argv)
X`7B
X    char line`5BMAX_LINELENGTH+1`5D;
X    char *s;
X    int comment,c_length;
X
X#if OPT_LOCALE
X    setlocale(LC_CTYPE, "");
X#endif
X
X    comment = 0;
X    inithash();
X
X    if (argc > 1) `7B
X`09int n;
X`09for (n = 1; n < argc; n++)
X`09    read_keywords(argv`5Bn`5D);
X    `7D else `7B
X`09read_keywords(\0907_file);
X    `7D
X
X    while (fgets(line,MAX_LINELENGTH,stdin) != NULL) `7B
X`09s = line;
X`09s = skip_white(s);
X`09while (*s) `7B
X`09    if (!comment `26`26 *s == L_CURL) `7B
X`09`09c_length = has_endofcomment(s);
X`09`09if (c_length == 0) `7B /* Comment continues to the next line */
X`09`09    c_length = strlen(s);
X`09`09    comment = 1;
X`09`09`7D
X`09`09printf("`5C001%i%s:%.*s",c_length,comment_attr\160As);
X`09`09s = s + c_length ;
X`09    `7D
X`09    if (comment `26`26 *s) `7B
X`09`09if ((c_length = has_endofcomment(s)) > 0) `7B
X`09`09    printf("`5C001%i%s:%.*s",c_length,comment_attr\160As);
X`09`09    s = s + c_length ;
X`09`09    comment = 0;
X`09`09`7D else `7B /* Whole line belongs to comment */
X`09`09    c_length = strlen(s);
X`09`09    printf("`5C001%i%s:%.*s",c_length,comment_attr\160As);
X`09`09    s = s + c_length;
X`09`09`7D
X`09    `7D else if (*s == QUOTE)  `7B
X`09`09putchar(*s++);
X`09`09s = write_literal(s);
X`09    `7D else if (*s) `7B
X`09`09if ( isNameBegin(*s) ) `7B
X`09`09    s = extract_identifier(s);
X`09`09    match_identifier();
X`09`09`7D else `7B
X`09`09    putchar(*s++);
X`09`09`7D
X`09    `7D
X`09`7D
X    `7D
X    closehash();
X
X    exit(0);
X`7D
$ call unpack [.VILE-8_0]PAS-FILT.C;1 -
 1283101493 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 21 95 152
$!
$ create 'f'
X/* set to "" for no patches */
X#define PATCHLEVEL ""
$ call unpack [.VILE-8_0]PATCHLEV.H;1 -
 1158953379 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 1 96 152
$!
$ create 'f'
X/*`09PATH.C
X *`09`09The routines in this file handle the conversion of pathname
X *`09`09strings.
X *
X * $Header: /usr/build/vile/vile/RCS/path.c,v 1.84 1998/05/14 00:18:13 tom Exp
V $
X *
X *
X */
X
X#ifdef _WIN32
X# include <windows.h>
X#endif
X
X#include`09"estruct.h"
X#include        "edef.h"
X
X#if SYS_UNIX
X#include <sys/types.h>
X#include <pwd.h>
X#endif
X
X#if SYS_VMS
X#include <starlet.h>
X#include <file.h>
X#endif
X
X#if SYS_OS2
X# define INCL_DOSFILEMGR
X# define INCL_ERRORS
X# include <os2.h>
X#endif
X
X#include "dirstuff.h"
X
X#if !defined(S_ISDIR) `26`26 \140BFMT\1311DIR)
X# define S_ISDIR(m)  (((m) `26 S_IFMT) == S_IFDIR)
X#endif
X
X#if (SYS_WIN31 `26`26 CC_TURBO) `7C`7C \1A07NT
X# include <direct.h>
X# define curdrive() (_get\0D08+ ('A' - 1))
X# define curr_dir_on_drive(d) _getdcwd(toUpper(d) - ('A' - 1), temp, sizeof(te
Vmp))
X#endif
X
X#if SYS_OS2_EMX
X# define curdrive() _get\0C07
Xstatic char *
Xcurr_dir_on_drive(int d)
X`7B
X`09static char buffer`5BNFILEN`5D;
X`09char *s;
X`09if (_getcwd1(buffer, d) < 0)
X`09`09return 0;
X`09/* EMX 0.9b documents _getcwd1 fixes slashes, but it doesn't work */
X`09for (s = buffer; *s; s++)
X`09`09if (*s == '`5C`5C') *s = '/';
X`09return buffer;
X`7D
X#endif
X
X#ifdef GMDRESOLVE_LINKS
X#if HAVE_SYS_ITIMER_H `26`26 SYSTEM_LOOKS_LIKE_SCO
X#include <sys/itimer.h>
X#endif
Xstatic`09char * resolve_directory ( \1B06path_name,\1107*file_namep );
X#endif
X
Xstatic`09char * canonpath ( char *ss );
Xstatic`09int is_absolute_pathname( char *path );
Xstatic`09int is_relative_pathname( const char *path );
X
X#if OPT_CASELESS
Xstatic`09int case_correct_path ( char *old_file,\1007new_file );
X#endif
X
X/*
X * Fake directory-routines for system where we cannot otherwise figure out how
V
X * to read the directory-file.
X */
X#if USE_LS_FOR_DIRS
XDIR *
Xopendir (char *path)
X`7B
X`09static`09const char fmt`5B`5D = "/bin/ls %s";
X`09char`09lscmd`5BNFILEN+sizeof(fmt)`5D;
X
X`09(void)lsprintf(lscmd, fmt, path);
X`09return npopen(lscmd, "r");
X`7D
X
XDIRENT *
Xreaddir (DIR *dp)
X`7B
X`09static`09DIRENT`09dummy;
X
X`09if ((fgets(dummy.d_name, NFILEN, dp)) != NULL) `7B
X`09`09/* zap the newline */
X`09`09dummy.d_name`5Bstrlen(\140C)-1`5D = EOS;
X`09`09return `26dummy;
X`09`7D
X`09return 0;
X`7D
X
Xint
Xclosedir (DIR *dp)
X`7B
X`09(void)npclose(dp);
X`09return 0;
X`7D
X#endif
X
X/*
X * Use this routine to fake compatibility with unix directory \3207s.
X */
X#if OLD_STYLE_DIRS
XDIRENT *
Xreaddir(DIR *dp)
X`7B
X`09static`09DIRENT`09dbfr;
+-+-+-+-+-+-+-+-  END  OF PART 89 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 90 -+-+-+-+-+-+-+-+
X`09return (fread(`26dbfr, sizeof(dbfr), 1, dp)
X`09`09&0209? `26dbfr
X`09`09&0209: (DIRENT *)0);
X`7D
X#endif
X
X#if OPT_MSDOS_PATH
X/*
X * If the pathname begins with an MSDOS-drive, return the pointer past it.
X * Otherwise, return null.
X */
Xchar *
Xis_msdos_drive(char *path)
X`7B
X#if OPT_UNC_PATH
X`09if (is_slashc(path`5B0`5D) `26`26 \160F1`5D))
X`09`09return (path+1);
X#endif
X`09if (isAlpha(path`5B0`5D) `26`26 path`5B1`5D == ':')
X`09`09return (path+2);
X`09return 0;
X`7D
X#endif
X
X#if OPT_VMS_PATH
X#define VMSPATH_END_NODE   1
X#define VMSPATH_END_DEV    2
X#define VMSPATH_BEGIN_DIR  3
X#define VMSPATH_NEXT_DIR   4
X#define VMSPATH_END_DIR    5
X#define`09VMSPATH_BEGIN_FILE 6
X#define VMSPATH_BEGIN_TYP  7
X#define VMSPATH_BEGIN_VER  8
X
X/*
X * Returns true if the string is delimited in a manner compatible with VMS
X * pathnames.  To be consistent with the use of 'is_\3108()', insist that
X * at least the "`5B`5D" characters be given.
X *
X * Complete syntax:
X *`09node::device:`5Bdir1.dir2`5Dfilename.type;version
X *`09    `5E1     `5E2`5E3   `5E4  `5E5`5E6      `5E7   `5E8
X */
Xint
Xis_vms_pathname(
Xconst char *path,
Xint`09option)`09`09/* true:directory, false:file, -\1D06on't care */
X`7B
X`09const char *base = path;
X`09int`09this`09= 0,
X`09`09next`09= -1;
X
X`09if (*path == EOS)`09/* this can happen with null buffer-name */
X`09`09return FALSE;
X
X`09while (ispath(*path)) `7B
X`09`09switch (*path) `7B
X`09`09case '`5B':
X`09`09`09if (this >= VMSPATH_BEGIN_FILE)
X`09`09&0209return FALSE;
X`09`09`09next = VMSPATH_BEGIN_DIR;
X`09`09`09break;
X`09`09case '`5D':
X`09`09`09if (this < VMSPATH_BEGIN_DIR)
X`09`09&0209return FALSE;
X`09`09`09if (path != base`09/* rooted logical? */
X`09`09`09 `26`26 path`5B1`5D == '`5B'
X`09`09`09 `26`26 path`5B-1`5D == '.')
X`09`09&0209path++;
X`09`09`09else
X`09`09&0209next = VMSPATH_END_DIR;
X`09`09`09break;
X`09`09case '.':
X`09`09`09if (this >= VMSPATH_BEGIN_TYP)
X`09`09&0209return FALSE;
X`09`09`09next = (this >= VMSPATH_END_DIR)
X`09`09&0209? VMSPATH_BEGIN_TYP
X`09`09&0209: (this >= VMSPATH_BEGIN_DIR
X`09`09&0209`09? VMSPATH_NEXT_DIR
X`09`09&0209`09: VMSPATH_BEGIN_TYP);
X`09`09`09break;
X`09`09case ';':
X`09`09`09next = VMSPATH_BEGIN_VER;
X`09`09`09break;
X`09`09case ':':
X`09`09`09if (path`5B1`5D == ':') `7B
X`09`09&0209path++;`09/* eat "::" */
X`09`09&0209if (this >= VMSPATH_END_NODE)
X`09`09&0209`09return FALSE;
X`09`09&0209next = VMSPATH_END_NODE;
X`09`09`09`7D else
X`09`09&0209next = VMSPATH_END_DEV;
X`09`09`09break;
X`09`09case '!':
X`09`09case '/':
X`09`09case '`7E':
X`09`09`09return FALSE;`09/* a DEC-shell name */
X`09`09default:
X`09`09`09if (!ispath(*path))
X`09`09&0209return FALSE;
X`09`09`09next = (this == VMSPATH_END_DIR)
X`09`09&0209? VMSPATH_BEGIN_FILE
X`09`09&0209: this;
X`09`09`09break;
X`09`09`7D
X`09`09if (next < this)
X`09`09`09break;
X`09`09this = next;
X`09`09path++;
X`09`7D
X
X`09if ((*path != EOS)
X`09 `7C`7C (this  <  next))
X`09`09return FALSE;
X
X`09if (this == 0)
X`09`09this = VMSPATH_BEGIN_FILE;
X
X`09return (option == TRUE  `26`26 (this == VMSPATH_END_DIR))`09/* dir? */
X`09  `7C`7C   (option == TRUE  `26`26 (this == VMSPATH_END_DEV))`09/* dev? */
V
X`09  `7C`7C   (option == FALSE `26`26 (this >= VMSPATH_BEGIN_FILE))/* file? */
V
X`09  `7C`7C   (option == -TRUE `26`26 (this >= VMSPATH_END_DIR`09/* anything?
V */
X`09`09&0209 `7C`7C this <  VMSPATH_BEGIN_DIR));
X`7D
X#endif
X
X#if OPT_VMS_PATH
X/*
X * Returns a pointer to the argument's last path-leaf (i.e., filename).
X */
Xchar *
Xvms_pathleaf(char *path)
X`7B
X`09register char`09*s;
X`09for (s = skip_string(path);
X`09`09s > path `26`26 !strchr(":`5D", s`5B-1`5D);
X`09`09`09s--)
X`09`09;
X`09return s;
X`7D
X#endif
X
X/*
X * Returns a pointer to the argument's last path-leaf (i.e., filename).
X */
X
X#if !OPT_VMS_PATH
X#define`09unix_pathleaf`09\0908
X#endif
X
Xchar *
Xunix_pathleaf(char *path)
X`7B
X`09register char *s = last_slash(path);
X`09if (s == 0) `7B
X#if OPT_MSDOS_PATH
X`09`09if (!(s = is_msdos_drive(path)))
X#endif
X`09`09s = path;
X`09`7D else
X`09`09s++;
X`09return s;
X`7D
X
X#if OPT_VMS_PATH
Xchar *
Xpathleaf(char *path)
X`7B
X`09if (is_vms_pathname(path, -TRUE))
X`09`09return vms_pathleaf(path);
X`09return unix_pathleaf(path);
X`7D
X#endif
X
X/*
X * Concatenates a directory and leaf name to form a full pathname
X */
Xchar *
Xpathcat (char *dst, const char *path, char *leaf)
X`7B
X`09char`09save_path`5BNFILEN`5D;
X`09char`09save_leaf`5BNFILEN`5D;
X`09register char`09*s = dst;
X
X`09if (path == 0
X`09 `7C`7C *path == EOS
X`09 `7C`7C is_absolute_pathname(leaf))
X`09`09return strcpy(dst, leaf);
X
X`09path = strcpy(save_path, path);`09`09/* in case path is in dst */
X`09leaf = strcpy(save_leaf, leaf);`09`09/* in case leaf is in dst */
X
X`09(void)strcpy(s, path);
X`09s += strlen(s) - 1;
X
X#if OPT_VMS_PATH
X`09if (!is_vms_pathname(dst, TRUE))`09/* could be DecShell */
X#endif
X`09if (!is_slashc(*s)) `7B
X`09`09*(++s) = SLASHC;
X`09`7D
X
X`09(void)strcpy(s+1, leaf);
X
X#if OPT_VMS_PATH
X`09if (is_vms_pathname(path, -TRUE)
X`09 `26`26 is_vms_pathname(leaf, -TRUE)
X`09 `26`26 !is_vms_pathname(dst, -TRUE))
X`09`09(void)strcpy(dst, leaf);
X#endif
X`09return dst;
X`7D
X
X/*
X * Tests to see if the string contains a slash-delimiter.  If so, return the
X * last one (so we can locate the path-leaf).
X */
Xchar *
Xlast_slash(char *fn)
X`7B
X`09register char *s;
X
X`09if (*fn != EOS)
X`09`09for (s = skip_string(fn); s > fn; s--)
X`09`09`09if (is_slashc(s`5B-1`5D))
X`09`09&0209return s - 1;
X`09return 0;
X`7D
X
X/*
X * If a pathname begins with "`7E", lookup the name in the password-file.  Cac
Vhe
X * the names that we lookup, because searching the password-file can be slow,
V
X * and users really don't move that often.
X */
X#if SYS_UNIX
Xtypedef`09struct`09_upath `7B
X`09struct`09_upath *next;
X`09char`09*name;
X`09char`09*path;
X`09`7D UPATH;
X
Xstatic`09UPATH`09*user_paths;
X
Xstatic char *
Xsave_user(const char *name, c\120Bpath)
X`7B
X`09register UPATH *q;
X
X`09if (name != NULL
X`09 `26`26 path != NULL
X`09 `26`26 (q = typealloc(UPATH)) != NULL) `7B
X`09`09if ((q->name = strmalloc(name)) != NULL
X`09`09 `26`26 (q->path = strmalloc(path)) != NULL) `7B
X`09`09`09q->next = user_paths;
X`09`09`09user_paths = q;
X`09`09`09return q->path;
X`09`09`7D else `7B
X`09`09`09FreeIfNeeded(q->name);
X`09`09`09FreeIfNeeded(q->path);
X`09`09`09free((char *)q);
X`09`09`7D
X`09`7D
X`09return NULL;
X`7D
X
Xstatic char *
Xfind_user(const char *name)
X`7B
X`09register struct`09passwd *p;
X`09register UPATH`09*q;
X
X`09if (name != NULL) `7B
X`09`09for (q = user_paths; q != NULL; q = q->next) `7B
X`09`09`09if (!strcmp(q->name, name)) `7B
X`09`09&0209return q->path;
X`09`09`09`7D
X`09`09`7D
X
X`09`09/* not-found, do a lookup */
X`09`09if (*name != EOS)
X`09`09`09p = getpwnam(name);
X`09`09else `7B
X`09`09`09p = getpwuid((int)getuid());
X`09`09`09if (p == 0) `7B
X`09`09&0209char *env = getenv("HOME");
X`09`09&0209if (env != 0)
X`09`09&0209`09return save_user(name, env);
X`09`09`09`7D
X`09`09`7D
X
X`09`09if (p != NULL)
X`09`09`09return save_user(name, p->pw_dir);
X#if NEEDED
X`09`7D else `7B`09/* lookup all users (for globbing) */
X`09`09(void)setpwent();
X`09`09while ((p = getpwent()) != NULL)
X`09`09`09(void)save_user(p->pw_name, \0C06dir);
X`09`09(void)endpwent();
X#endif
X`09`7D
X`09return NULL;
X`7D
X
Xchar *
Xhome_path(char *path)
X`7B
X`09if (*path == '`7E') `7B
X`09`09char`09temp`5BNFILEN`5D;
X`09`09char *s;
X`09`09char *d;
X
X`09`09/* parse out the user-name portion */
X`09`09for (s = path+1, d = temp; (*d = *s) != EOS; d++, s++) `7B
X`09`09`09if (is_slashc(*d)) `7B
X`09`09&0209*d = EOS;
X`09`09&0209s++;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X
X#if OPT_VMS_PATH
X`09`09(void)mklower(temp);
X#endif
X`09`09if ((d = find_user(temp)) != NULL)
X`09`09`09(void)pathcat(path, d, s);
X`09`7D
X`09return path;
X`7D
X#endif
X
X#ifdef GMDRESOLVE_LINKS
X/*
X * Some of this code was "borrowed" from the GNU C library (getcwd.c).  It has
V
X * been largely rewritten and bears little resemblance to what it started out
V
X * as.
X *
X * The purpose of this code is to generalize getcwd.  The idea\2307pass it as
V
X * input some path name.  This pathname can be relative, absolute, whatever.
X * It may have elements which reference symbolic links.  The output from this
V
X * function will be the absolute pathname representing the same file.
X * Actually, it only returns the directory.  If the thing you pass it is a
X * directory, you'll get that \1B09 back (canonicalized).  If you pass it a
X * path to an ordinary file, you'll get back the canonicalized directory which
V
X * contains that file.
X *
X * The way that this code works is similar to the classic implementation of
X * getcwd (or getwd).  The difference is that once it finds a directory, it
X * will cache it.  If that directory is referenced again, finding it\4206be
X * very fast.  The callee of this function should not free up the pointer whic
Vh
X * is returned.  This will be done automatically by the caching code.  The
X * value returned will exist at least up until the next call It should not be
V
X * relied on any longer than this.  Care should be taken not to corrupt the
X * value returned.
X *
X * FIXME: there should be some way to reset the cache in case directories are
V
X * renamed.
X */
X
X#define CPN_CACHE_SIZE 64
X#define CPN_CACHE_MASK (\100ASIZE-1)
X
X#if !defined(HAVE_SETITIMER) `7C`7C\1C10IGACTION)
X#define TimedStat stat
X#else /* !defined(HAVE_SETITIMER) */
X
X#define TimedStat stat_with_timeout
X
Xstatic`09jmp_buf stat_\0D07;`09`09/* for setjmp/longjmp on timeout */
X
Xstatic SIGT
XStatHandler(int ACTUAL_SIG_ARGS)
X`7B
X`09longjmp(stat_jmp_buf, signo);
X`09SIGRET;
X`7D
X
Xstatic int
Xstat_with_timeout(
X`09const char *path,
X`09struct stat *statbuf)
X`7B
X`09struct sigaction newact;
X`09struct sigaction oldact;
X`09sigset_t newset;
X`09sigset_t oldset;
X`09struct itimerval timeout;
X`09struct itimerval old\0C08;
X`09int retval, stat_errno;
X
X`09newact.sa_handler = StatH\0E06;
X`09newact.sa_flags = 0;
X`09if (sigemptyset(`26newact.sa_mask) < 0
X`09 `7C`7C sigfillset(`26newset) < 0
X`09 `7C`7C sigdelset(`26newset, SIGPROF) < 0
X`09 `7C`7C sigprocmask(SIG_BLOCK, `26newset, `26oldset) < 0)
X`09`09return -1;
X
X`09if (sigaction(SIGPROF, `26newact, `26oldact) < 0) `7B
X`09`09sigprocmask(SIG_SETMASK, `26oldset, (sigset_t *)0);
X`09`09return -1;
X`09`7D
X
X`09timeout.it_interval.tv_sec  = 0;
X`09timeout.it_interval.tv_usec = 0;
X`09timeout.it_value.tv_sec     = 0;
X`09timeout.it_value.tv_usec    = 75000;
X
X`09(void)setitimer(ITIMER_PROF, `26timeout, `26oldtimerval);
X
X`09/*
X`09 * POSIX says that 'stat()' won't return an error if it's interrupted,
X`09 * so we force an error by making a longjmp from the timeout handler,
X`09 * and forcing the error return status.
X`09 */
X`09if (setjmp(stat_jmp_buf)) `7B
X`09`09retval = -1;
X`09`09stat_errno = EINTR;
X`09`7D else `7B
X`09`09retval = stat(path, statbuf);
X`09`09stat_errno = errno;
X`09`7D
X
X`09timeout.it_value.tv_usec = 0;
X`09(void)setitimer(ITIMER_PROF, `26timeout, (struct \2606val *)0);
X
X`09(void)sigaction(SIGPROF, `26oldact, (struct \2409 *)0);
X`09(void)sigprocmask(SIG_SETMASK, `26oldset, (sigset_t *)0);
X`09(void)setitimer(ITIMER_PROF, `26oldtimerval, (struct \2A06val *)0);
X
X`09errno = stat_errno;
X`09return retval;
X`7D
X#endif /* !defined(HAVE_SETITIMER) */
X
Xstatic char *
Xresolve_directory(
X`09char *path_name,
X`09char **file_namep)
X`7B
X`09dev_t rootdev, thisdev;
X`09ino_t rootino, thisino;
X`09struct stat  st;
X
X`09static const char rootdir`5B`5D = `7B SLASHC, EOS `7D;
X
X`09static TBUFF *last_leaf;
X`09static TBUFF *last_path;
X`09static TBUFF *last_temp;
X
X`09char         *temp_name;
X`09char         *tnp;`09/* temp name pointer */
X`09char         *temp_path; /* the path that we've determined */
X
X`09ALLOC_T       len;`09/* temporary for length computations */
X
X`09static struct cpn_cache `7B
X`09`09dev_t ce_dev;
X`09`09ino_t ce_ino;
X`09`09TBUFF *ce_dirname;
X`09`7D cache_entries`5BCPN_CACHE_SIZE`5D;
X
X`09struct cpn_cache *cachep;
X
X`09tb_free(`26last_leaf);
X`09*file_namep = NULL;
X`09len = strlen(path_name);
X
X`09if (!tb_alloc(`26last_temp, len + 1))
X`09`09return NULL;
X`09tnp = (temp_name = tb_values(last_temp)) + len;
X
X`09if (!tb_alloc(`26last_path, len + 1))
X`09`09return NULL;
X`09*(temp_path = tb_values(last_path)) = EOS;
X
X`09(void)strcpy(temp_name, path_name);
X
X`09/*
X`09 * Test if the given pathname is an actual directory, or not.  If it's
X`09 * a symbolic link, we'll have to determine if it points to a directory
X`09 * before deciding how to split it.
X`09 */
X`09if (lstat(temp_name, `26st) < 0)
X`09`09st.st_mode = S_IFREG;`09/* assume we're making a file... */
X
X`09if (!S_ISDIR(st.st_mode)) `7B
X`09`09int levels = 0;
X`09`09char target`5BNFILEN`5D;
X
X`09`09/* loop until no more links */
X`09`09while ((st.st_mode `26 S_IFMT) == S_IFLNK) `7B
X`09`09`09int got = 0;
X
X`09`09`09if (levels++ > 4`09/* FIXME */
X`09`09`09 `7C`7C (got = readlink(temp_name,
X`09`09`09 &0209target, sizeof(\0F06)-1)) < 0) `7B
X`09`09&0209return NULL;
X`09`09`09`7D
X`09`09`09target`5Bgot`5D = EOS;
X
X`09`09`09if (tb_alloc(`26last_temp, (ALLOC_T)(strlen(temp_name)+got+1)) == 0)
V
X`09`09&0209return NULL;
X
X`09`09`09temp_name = tb_values(last_temp);
X
X`09`09`09if (!is_slashc(target`5B0`5D)) `7B
X`09`09&0209tnp = pathleaf(temp_name);
X`09`09&0209if (tnp != temp_name `26`26 !is_slashc(tnp`5B-1`5D))
X`09`09&0209`09*tnp++ = SLASHC;
X`09`09&0209(void)strcpy(tnp, target);
X`09`09`09`7D else `7B
X`09`09&0209(void)strcpy(temp_name, target);
X`09`09`09`7D
X`09`09`09if (lstat(temp_name, `26st) < 0)
X`09`09&0209break;
X`09`09`7D
X
X`09`09/*
X`09`09 * If we didn't resolve any symbolic links, we can find the
X`09`09 * filename leaf in the original 'path_name' argument.
X`09`09 */
X`09`09tnp = last_slash(temp_name);
X`09`09if (tnp == NULL) `7B
X`09`09`09tnp = temp_name;
X`09`09`09if (tb_scopy(`26last_leaf, tnp) == 0)
X`09`09&0209return NULL;
X`09`09`09*tnp++ = '.';
X`09`09`09*tnp = EOS;
X`09`09`7D else if (tb_scopy(`26last_leaf, tnp + 1) == 0) `7B
X`09`09`09return NULL;
X`09`09`7D
X`09`09if (tnp == temp_name `26`26 is_slashc(*tnp)) /* initial slash */
X`09`09`09tnp++;
X`09`09*tnp = EOS;
X
X`09`09/*
X`09`09 * If the parent o\0E06given path_name isn't a directory, give
X`09`09 * up...
X`09`09 */
X`09`09if (TimedStat(temp_name, `26st) < 0 `7C`7C !S_ISDIR(st.st_mode))
X`09`09`09return NULL;
X`09`7D
X
X`09/*
X`09 * Now, 'temp_name`5B`5D' contains a null-terminated directory-path, and
X`09 * 'tnp' points to the null.  If we've set file_namep,\1607allocated
X`09 * a pointer since it may be pointing within the temp_name string --
X`09 * which may be overwritten.
X`09 */
X`09*file_namep = tb_values(last_leaf);
X
X`09thisdev = st.st_dev;
X`09thisino = st.st_ino;
X
X`09cachep =  `26cache_entries`5B(thisdev `5E thisino) `26 CPN_CACHE_MASK`5D;
X`09if (tb_values(cachep->ce_dirname) != 0
X`09 `26`26 cachep->ce_ino == thisino
X`09 `26`26 cachep->ce_dev == thisdev) `7B
X`09`09return tb_values(cachep->ce_dirname);
X`09`7D else `7B
X`09`09cachep->ce_ino = thisino;
X`09`09cachep->ce_dev = thisdev;
X`09`09tb_free(`26(cachep->ce_dirname));`09/* will reset iff ok */
X`09`7D
X
X`09if (TimedStat(rootdir, `26st) < 0)
X`09`09return NULL;
X
X`09rootdev = st.st_dev;
X`09rootino = st.st_ino;
X
X`09while ((thisdev != rootdev)
X`09   `7C`7C  (thisino != rootino)) `7B
X`09`09register DIR *dp;
X`09`09register DIRENT *de;
X`09`09dev_t dotdev;
X`09`09ino_t dotino;
X`09`09char  mount_point;
X`09`09SIZE_T namelen = 0;
X
X`09`09len = tnp - temp_name;
X`09`09if (tb_alloc(`26last_temp, 4 + len) == 0)
X`09`09`09return NULL;
X
X`09`09tnp = (temp_name = tb_values(last_temp)) + len;
X`09`09*tnp++ = SLASHC;
X`09`09*tnp++ = '.';
X`09`09*tnp++ = '.';
X`09`09*tnp   = EOS;
X
X`09`09/* Figure out if this directory is a mount point.  */
X`09`09if (TimedStat(temp_name, `26st) < 0)
X`09`09`09return NULL;
X
X`09`09dotdev = st.st_dev;
X`09`09dotino = st.st_ino;
X`09`09mount_point = (dotdev != thisdev);
X
X`09`09/* Search for the last directory.  */
X`09`09if ((dp = opendir(temp_name)) != 0) `7B
X`09`09`09int`09found = FALSE;
X
X`09`09`09while ((de = readdir(dp)) != NULL) `7B
X#if USE_D_NAMLEN
X`09`09&0209namelen = de->d_namlen;
X#else
X`09`09&0209namelen = strlen(de->d_name);
X#endif
X`09`09&0209/* Ignore "." and ".." */
X`09`09&0209if (de->d_name`5B0`5D == '.'
X`09`09&0209 `26`26 (namelen == 1
X`09`09&0209  `7C`7C (namelen == 2 `26`26 de->d_name`5B1`5D == '.')))
X`09`09&0209`09continue;
X
X`09`09&0209if (mount_point `7C`7C (de->d_ino == thisino)) `7B
X`09`09&0209`09len = tnp - temp_name;
X`09`09&0209`09if (tb_alloc(`26last_temp, len + name\0A061) == 0)
X`09`09&0209&0209break;
X
X`09`09&0209`09temp_name = tb_values(last_temp);
X`09`09&0209`09tnp = temp_name + len;
X
X`09`09&0209`09*tnp = SLASHC;
X`09`09&0209`09(void)strncpy(tnp+1, de->d_name, namelen);
X`09`09&0209`09tnp`5Bnamelen+1`5D = EOS;
X
X`09`09&0209`09if (TimedStat(temp_name, `26st) == 0
X`09`09&0209`09 `26`26 st.st_dev == thisdev
X`09`09&0209`09 `26`26 st.st_ino == thisino) `7B
X`09`09&0209&0209found = TRUE;
X`09`09&0209&0209break;
X`09`09&0209`09`7D
X`09`09&0209`7D
X`09`09`09`7D
X
X`09`09`09if (found) `7B
X`09`09&0209/*
X`09`09&0209 * Push the latest directory-leaf before the
X`09`09&0209 * string already in 'temp_path`5B`5D'.
X`09`09&0209 */
X`09`09&0209len = strlen(temp_path) + 1;
X`09`09&0209if (tb_alloc(`26last_path, len + name\0A061) == 0) `7B
X`09`09&0209`09(void) closedir(dp);
X`09`09&0209`09return NULL;
X`09`09&0209`7D
X`09`09&0209temp_path = tb_values(last_path);
X`09`09&0209while (len-- != 0)
X`09`09&0209`09temp_path`5Bnamelen+1+len`5D = \1B0Alen`5D;
X`09`09&0209temp_path`5B0`5D = SLASHC;
X`09`09&0209(void)memcpy(temp_path+1, de->d_name, namelen);
X`09`09`09`7D
X`09`09`09(void) closedir(dp);
X`09`09`09if (!found)
X`09`09&0209return NULL;
X`09`09`7D
X`09`09else`09/* could't open directory */
X`09`09`09return NULL;
X
X`09`09thisdev = dotdev;
X`09`09thisino = dotino;
X`09`7D
X
X`09if (tb_scopy(`26(cachep->ce_dirname),
X`09`09*temp_path ? \0C0A: rootdir) == 0)
X`09`09return NULL;
X
X`09return tb_values(cachep->ce_dirname);
X`7D
X#endif`09/* defined(GMDRESOLVE_LINKS) */
X
X#if OPT_CASELESS
X
X/*
X * The function case_correct_path is intended to determine the true
X * case of all pathname components of a syntactically canonicalized
X * pathname for operating systems on which OPT_CASELESS applies.
X */
X
X#if SYS_WINNT
X
Xstatic int
Xcase_correct_path(char *old_file, \1006new_file)
X`7B
X`09WIN32_FIND_DATA fd;
X`09HANDLE h;
X`09int len;
X`09char *next, *current, *end, *sofar;
X`09char tmp_file`5BMAX_PATH`5D;
X
X`09/* Handle old_file == new\0C06safely. */
X`09(void)strcpy(tmp_file, old_file);
X`09old_file = tmp_file;
X
X`09if (is_slashc(old_file`5B0`5D) `26`26 \1A131`5D)) `7B
X
X`09`09/* Handle UNC filenames. */
X`09`09current = old_file + 2;
X`09`09next = strchr(current, SLASHC);
X`09`09if (next)
X`09`09`09next = strchr(next + 1, SLASHC);
X
X`09`09/* Canonicalize the system name and share name. */
X`09`09if (next)
X`09`09`09len = next - old_file + 1;
X`09`09else
X`09`09`09len = strlen(old_file);
X`09`09(void)memcpy(new_file, old\0A07len);
X`09`09new_file`5Blen`5D = EOS;
X`09`09(void)mklower(new_file);
X`09`09if (!next)
X`09`09`09return 0;
X`09`09sofar = new_file + len;
X`09`09current = next + 1;
X`09`7D
X`09else `7B
X
X`09`09/* Canonicalize a leading drive letter, if any. */
X`09`09if (old_file`5B0`5D `26`26 \0F091`5D == ':') `7B
X`09`09`09new_file`5B0`5D = old\0E08;
X`09`09`09new_file`5B1`5D = old\0E08;
X`09`09`09if (isLower(new_file`5B0`5D))
X`09`09&0209new_file`5B0`5D = toUpper(\160B);
X`09`09`09current = old_file + 2;
X`09`09`09sofar = new_file + 2;
X`09`09`7D
X`09`09else `7B
X`09`09`09current = old_file;
X`09`09`09sofar = new_file;
X`09`09`7D
X
X`09`09/* Skip a leading slash, if any. */
X`09`09if (is_slashc(*current)) `7B
X`09`09`09current++;
X`09`09`09*sofar++ = SLASHC;
X`09`09`7D
X`09`7D
X
X`09/* Canonicalize each pathname prefix. */
X`09end = skip_string(old_file);
X`09while (current < end) `7B
X`09`09next = strchr(current, SLASHC);
X`09`09if (!next)
X`09`09`09next = end;
X`09`09len = next - current;
X`09`09(void)memcpy(sofar, current, len);
X`09`09sofar`5Blen`5D = EOS;
X`09`09h = FindFirstFile(new_file, `26fd);
X`09`09if (h != INVALID_HANDLE_VALUE) `7B
X`09`09`09FindClose(h);
X`09`09`09(void)strcpy(sofar, fd.cFileName);
X`09`09`09sofar += strlen(sofar);
X`09`09`7D
X`09`09else
X`09`09`09sofar += len;
X`09`09if (next != end)
X`09`09`09*sofar++ = SLASHC;
X`09`09current = next + 1;
X`09`7D
X`09return 0;
X`7D
X
X#else /* !SYS_WINNT */
X
X#if SYS_OS2
X
Xint
Xis_case_preserving(const char *name)
X`7B
X`09int case_preserving = 1;
X
X`09/* Determine if the filesystem is case-preserving. */
X`09if (name`5B0`5D `26`26 name`5B1`5D == ':') `7B
X`09`09char drive_name`5B3`5D;
X`09`09char buffer`5Bsizeof(FSQBUFFER2) + 3*CCHMAXPATH`5D;
X`09`09FSQBUFFER2 *pbuffer = (\170C) \1806;
X`09`09ULONG len = sizeof(buffer);
X`09`09APIRET rc;
X
X`09`09drive_name`5B0`5D = \0A07;
X`09`09drive_name`5B1`5D = \0A07;
X`09`09drive_name`5B2`5D = EOS;
X`09`09rc = DosQueryFSAttach(drive_name, 0, FSAIL_QUERYNAME,
X`09`09`09pbuffer, `26len);
X`09`09if (rc == NO_ERROR) `7B
X`09`09`09char *name = pbuffer->szName +\120Acb\12071;
X
X`09`09`09if (strcmp(name, "FAT") == 0)
X`09`09&0209case_preserving = 0;
X`09`09`7D
X`09`7D
X`09return case_preserving;
X`7D
X
Xstatic int
Xcase_correct_path(char *old_file, \1006new_file)
X`7B
X`09FILEFINDBUF3 fb;
X`09ULONG entries;
X`09HDIR hdir;
X`09APIRET rc;
X`09char *next, *current, *end, *sofar;
X`09char tmp_file`5BNFILEN + 2`5D;
X`09ULONG len;
X`09int case_preserving = is_\150F(old_file);
X
X`09/* Handle old_file == new\0C06safely. */
X`09(void)strcpy(tmp_file, old_file);
X`09old_file = tmp_file;
X
X`09/* If it isn't case-preserving then just down-case it. */
X`09if (!case_preserving) `7B
X`09`09(void) mklower(strcpy(new_file, old_file));
X`09`09return 0;
X`09`7D
X
X`09/* Canonicalize a leading drive letter, if any. */
X`09if (old_file`5B0`5D `26`26 \0F091`5D == ':') `7B
X`09`09new_file`5B0`5D = old\0E08;
X`09`09new_file`5B1`5D = old\0E08;
X`09`09if (isLower(new_file`5B0`5D))
X`09`09`09new_file`5B0`5D = toUpper(\160B);
X`09`09current = old_file + 2;
X`09`09sofar = new_file + 2;
X`09`7D
X`09else `7B
X`09`09current = old_file;
X`09`09sofar = new_file;
X`09`7D
X
X`09/* Skip a leading slash, if any. */
X`09if (is_slashc(*current)) `7B
X`09`09current++;
X`09`09*sofar++ = SLASHC;
X`09`7D
X
X`09/* Canonicalize each pathname prefix. */
X`09end = skip_string(old_file);
X`09while (current < end) `7B
X`09`09next = strchr(current, SLASHC);
X`09`09if (!next)
X`09`09`09next = end;
X`09`09len = next - current;
X`09`09(void)memcpy(sofar, current, len);
X`09`09sofar`5Blen`5D = EOS;
X`09`09hdir = HDIR_CREATE;
X`09`09entries = 1;
X`09`09rc = DosFindFirst(new_file, `26hdir,
X`09`09`09FILE_DIRECTORY `7C FILE_READONLY, `26fb, sizeof(fb),
X`09`09`09`26entries, FIL_STANDARD);
X`09`09if (rc == NO_ERROR) `7B
X`09`09`09DosFindClose(hdir);
X`09`09`09(void)strcpy(sofar, fb.achName);
X`09`09`09sofar += strlen(sofar);
X`09`09`7D
X`09`09else
X`09`09`09sofar += len;
X`09`09if (next != end)
X`09`09`09*sofar++ = SLASHC;
X`09`09current = next + 1;
X`09`7D
X`09return 0;
X`7D
X
X#else /* !SYS_OS2 */
X
Xstatic int
Xcase_correct_path(char *old_file, \1006new_file)
X`7B
X`09if (old_file != new_file)
X`09`09(void)strcpy(new_file, old_file);
X`09return 0;
X`7D
X
X#endif /* !SYS_OS2 */
X
X#endif /* !SYS_WINNT */
X
X#endif /* OPT_CASELESS */
X
X/* canonicalize a pathname, to eliminate extraneous /./, /../, and ////
X`09sequences.  only guaranteed to work for absolute pathnames */
Xstatic char *
Xcanonpath(char *ss)
X`7B
X`09char *p, *pp;
X`09char *s;
X
X`09TRACE(("canonpath '%s'`5Cn", ss))
X`09if ((s = is_appendname(ss)) != 0)
X`09`09return (canonpath(s) != 0) ? ss : 0;
X
X`09s = ss;
X
X`09if (!*s)
X`09`09return s;
X
X#if OPT_MSDOS_PATH
X#if !OPT_CASELESS
X`09(void)mklower(ss);`09/* MS-DOS is case-independent */
X#endif
X`09if (is_slashc(*ss))
X`09`09*ss = SLASHC;
X`09/* pretend the drive designator isn't there */
X`09if ((s = is_msdos_drive(ss)) == 0)
X`09`09s = ss;
X#endif
X
X#if SYS_UNIX
X`09(void)home_path(s);
X#endif
X
X#if OPT_VMS_PATH
X`09/*
X`09 * If the code in 'lengthen_path()', as well as the scattered calls on
X`09 * 'fgetname()' are correct, the path given to this procedure should
X`09 * be a fully-resolved VMS pathname.  The logic in filec.c will allow a
X`09 * unix-style name, so we'll fall-thru if we find one.
X`09 */
X`09if (is_vms_pathname(s, -TRUE)) `7B
X`09`09return mkupper(ss);
X`09`7D
X#endif
X
X#if SYS_UNIX `7C`7C OPT_MSDOS_PATH\1208VMS_PATH
X`09if (!is_slashc(*s)) `7B
X`09`09mlforce("BUG: canonpath '%s'", s);
X`09`09return ss;
X`09`7D
X`09*s = SLASHC;
X
X`09/*
X`09 * If the system supports symbolic links (most UNIX\2A07s do), we
X`09 * cannot do dead reckoning to resolve the pathname.  We've made this a
X`09 * user-mode because some systems have problems with NFS timeouts which
X`09 * can make running vile _slow_.
X`09 */
X#ifdef GMDRESOLVE_LINKS
X`09if (global_g_val(GMDRESOLVE_LINKS))
X`09`7B
X`09`09char temp`5BNFILEN`5D;
X`09`09char *leaf;
X`09`09char *head = resolve_directory(s, `26leaf);
X`09`09if (head != 0) `7B
X`09`09`09if (leaf != 0)
X`09`09&0209(void)strcpy(s, pathcat(temp, head, leaf));
X`09`09`09else
X`09`09&0209(void)strcpy(s, head);
X`09`09`7D
X`09`7D
X`09else
X#endif
X`09`7B
X`09p = pp = s;
X
X#if SYS_APOLLO
X`09if (!is_slashc(p`5B1`5D)) `7B`09/* could be something like "/usr" */
X`09`09char`09*cwd = current_directory(FALSE);
X`09`09char`09temp`5BNFILEN`5D;
X`09`09if (!strncmp(cwd, "//", 2)
X`09`09 `26`26 strlen(cwd) > 2
X`09`09 `26`26 (p = strchr(cwd+2, '/')) != 0) `7B
X`09`09`09(void)strcpy(\0707temp, cwd) + (p+1-cwd), s);
X`09`09`09(void)strcpy(s, temp);
X`09`09`7D
X`09`7D
X`09p = s + 1;`09/* allow for leading "//" */
X#endif
X
X`09p++; pp++;`09/* leave the leading slash */
X`09while (*pp) `7B
X`09`09if (is_slashc(*pp)) `7B
X`09`09`09pp++;
X`09`09`09continue;
X`09`09`7D
X`09`09if (*pp == '.' `26`26 is_slashc(*(pp+1))) `7B
X`09`09`09pp += 2;
X`09`09`09continue;
X`09`09`7D
X`09`09break;
X`09`7D
X`09while (*pp) `7B
X`09`09if (is_slashc(*pp)) `7B
X`09`09`09while (is_slashc(*(pp+1)))
X`09`09&0209pp++;
X`09`09`09if (p > s `26`26 !is_slashc(*(p-1)))
X`09`09&0209*p++ = SLASHC;
X`09`09`09if (*(pp+1) == '.') `7B
X`09`09&0209if (*(pp+2) == EOS) `7B
X`09`09&0209`09/* change "/." at end to "" */
X`09`09&0209`09*(p-1) = EOS;`09/* and we're done */
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09&0209if (is_slashc(*(pp+2))) `7B
X`09`09&0209`09pp += 2;
X`09`09&0209`09continue;
X`09`09&0209`7D else if (*(pp+2) == '.' `26`26 (is_slashc\1D063))
X`09`09&0209&0309`7C`7C *(pp+3) == EOS)) `7B
X`09`09&0209`09while (p-1 > s `26`26 is_slashc(*(p-1)))
X`09`09&0209&0209p--;
X`09`09&0209`09while (p > s `26`26 !is_slashc(*(p-1)))
X`09`09&0209&0209p--;
X`09`09&0209`09if (p == s)
X`09`09&0209&0209*p++ = SLASHC;
X`09`09&0209`09pp += 3;
X`09`09&0209`09continue;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09pp++;
X`09`09`09continue;
X`09`09`7D else `7B
X`09`09`09*p++ = *pp++;
X`09`09`7D
X`09`7D
X`09if (p > s `26`26 is_slashc(*(p-1)))
X`09`09p--;
X`09if (p == s)
X`09`09*p++ = SLASHC;
X`09*p = EOS;
X`09`7D
X#endif`09/* SYS_UNIX `7C`7C SYS_MSDOS */
X
X#if OPT_VMS_PATH
X`09if (!is_vms_pathname(ss, -TRUE)) `7B
X`09`09char *tt = skip_string(ss);
X
X`09`09/*
X`09`09 * If we're not looking at "/" or some other path that ends
X`09`09 * with a slash, see if we can match the path to a directory
X`09`09 * file.  If so, force a slash on the end so that the unix2vms
X`09`09 * conversion will show a directory.
X`09`09 */
X`09`09if (tt`5B-1`5D != SLASHC) `7B
X`09`09`09struct stat sb;
X#if SYS_VMS
X`09`09`09(void)strcpy(tt, ".DIR");
X#else
X`09`09`09(void)mklower(ss);
X#endif
X`09`09`09if ((stat(SL_TO_BSL(ss), `26sb) >= 0)
X`09`09`09 `26`26 S_ISDIR(sb.st_mode))
X`09`09&0209(void)strcpy(tt, "/");
X`09`09`09else
X`09`09&0209*tt = EOS;
X`09`09`7D
X
X`09`09/* FIXME: this is a hack to prevent\1A06function from
X`09`09 * returning device-level strings, since (at the moment) I
X`09`09 * don't have anything that returns a list of the mounted
X`09`09 * devices on a VMS system.
X`09`09 */
X`09`09if (!strcmp(ss, "/")) `7B
X`09`09`09(void)strcpy(ss, current_directory(FALSE));
X`09`09`09if ((tt = strchr(ss, ':')) != 0)
+-+-+-+-+-+-+-+-  END  OF PART 90 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 91 -+-+-+-+-+-+-+-+
X`09`09&0209(void)strcpy(tt+1, "`5B000000`5D");
X`09`09`09else
X`09`09&0209(void)strcat(ss, ":");
X`09`09`09(void)mkupper(ss);
X`09`09`7D else `7B
X`09`09`09unix2vms_path(ss, ss);
X`09`09`7D
X`09`7D
X#endif
X
X#if OPT_CASELESS
X`09case_correct_path(ss, ss);
X#endif
X
X`09TRACE((" -> '%s' canonpath`5Cn", ss))
X`09return ss;
X`7D
X
Xchar *
Xshorten_path(char *path, int keep_cwd)
X`7B
X`09char`09temp`5BNFILEN`5D;
X`09char *cwd;
X`09char *ff;
X`09char *slp;
X`09char *f;
X#if OPT_VMS_PATH
X`09char *dot;
X#endif
X
X`09if (!path `7C`7C *path == EOS)
X`09`09return path;
X
X`09if (isInternalName(path))
X`09`09return path;
X
X`09TRACE(("shorten '%s'`5Cn", path))
X`09if ((f = is_appendname(path)) != 0)
X`09`09return (shorten_path(f, keep_cwd) != 0) ? path : 0;
X
X#if OPT_VMS_PATH
X`09/*
X`09 * This assumes that 'path' is in canonical form.
X`09 */
X`09cwd = current_directory(FALSE);
X`09ff  = path;
X`09dot = 0;
X`09TRACE(("current '%s'`5Cn", cwd))
X
X`09if ((slp = strchr(cwd, '`5B')) != 0
X`09 `26`26 (slp == cwd
X`09  `7C`7C !strncmp(cwd, path, (SIZE_T)(slp-cwd)))) `7B /* same device? */
X`09  `09ff += (slp-cwd);
X`09`09cwd = slp;
X`09`09(void)strcpy(temp, "`5B");`09/* hoping for relative-path */
X`09`09while (*cwd `26`26 *ff) `7B
X`09`09`09if (*cwd != *ff) `7B
X`09`09&0209if (*cwd == '`5D' `26`26 *ff == '.') `7B
X`09`09&0209`09/* "`5B.DIRNAME`5DFILENAME.TYP;1" */
X`09`09&0209`09;
X`09`09&0209`7D else if (*cwd == '.' `26`26 *ff == '`5D') `7B
X`09`09&0209`09/* "`5B-`5DFILENAME.TYP;1" */
X`09`09&0209`09while (*cwd != EOS) `7B
X`09`09&0209&0209if (*cwd++ == '.')
X`09`09&0209&0309(void)strcat(temp, "-");
X`09`09&0209`09`7D
X`09`09&0209`09(void)strcat(temp, "`5D");
X`09`09&0209`09ff++;
X`09`09&0209`7D else if (dot != 0) `7B
X`09`09&0209`09int diff = (ff - dot);
X
X`09`09&0209`09/* "`5B-.DIRNAME`5DFILENAME.TYP;1" */
X`09`09&0209`09while (*cwd != EOS) `7B
X`09`09&0209&0209if (*cwd++ == '.')
X`09`09&0209&0309(void)strcat(temp, "-");
X`09`09&0209`09`7D
X`09`09&0209`09while (dot != ff) `7B
X`09`09&0209&0209if (*dot++ == '.')
X`09`09&0209&0309(void)strcat(temp, "-");
X`09`09&0209`09`7D
X`09`09&0209`09(void)strcat(temp, ".");
X`09`09&0209`09ff -= (diff - 1);
X`09`09&0209`7D
X`09`09&0209break;
X`09`09`09`7D else if (*cwd == '`5D') `7B
X`09`09&0209(void)strcat(temp, cwd);
X`09`09&0209ff++;`09/* path-leaf, if any */
X`09`09&0209break;
X`09`09`09`7D
X
X`09`09`09if (*ff == '.')
X`09`09&0209dot = ff;
X`09`09`09cwd++;
X`09`09`09ff++;
X`09`09`7D
X`09`7D else `7B
X`09`09*temp = EOS;&0209/* different device, cannot relate */
X`09`7D
X
X`09if (!strcmp(temp, "`5B`5D")`09`09/* "`5B`5DFILENAME.TYP;1" */
X`09 `26`26 !keep_cwd)
X`09`09*temp = EOS;
X
X`09(void) strcpy(path, strcat(temp, ff));
X`09TRACE(("     -> '%s' shorten`5Cn", path))
X#else
X# if SYS_UNIX `7C`7C OPT_MSDOS_PATH
X`09cwd = current_directory(FALSE);
X`09slp = ff = path;
X`09while (*cwd `26`26 *ff &0226 *cwd == *ff) `7B
X`09`09if (is_slashc(*ff))
X`09`09`09slp = ff;
X`09`09cwd++;
X`09`09ff++;
X`09`7D
X
X`09/* if we reached the end of cwd, and we're at a path boundary,
X`09`09then the file must be under '.' */
X`09if (*cwd == EOS) `7B
X`09`09if (keep_cwd) `7B
X`09`09`09temp`5B0`5D = '.';
X`09`09`09temp`5B1`5D = SLASHC;
X`09`09`09temp`5B2`5D = EOS;
X`09`09`7D else
X`09`09`09*temp = EOS;
X`09`09if (is_slashc(*ff))
X`09`09`09return strcpy(path, strcat(temp, ff+1));
X`09`09if (slp == ff - 1)
X`09`09`09return strcpy(path, strcat(temp, ff));
X`09`7D
X
X`09/* if we mismatched during the first path component, we're done */
X`09if (slp == path)
X`09`09return path;
X
X`09/* if we mismatched in the last component of cwd, the\2006file
X`09`09is under '..' */
X`09if (last_slash(cwd) == 0)
X`09`09return strcpy(path, strcat(\1407temp, ".."), slp));
X
X`09/* we're off by more than just '..', so use absolute path */
X# endif`09/* SYS_UNIX `7C`7C SYS_MSDOS */
X#endif`09/* OPT_VMS_PATH */
X
X`09return path;
X`7D
X
X#if OPT_VMS_PATH
Xstatic int
Xmixed_case(const char *path)
X`7B
X`09register int c;
X`09int`09had_upper = FALSE;
X`09int`09had_lower = FALSE;
X`09while ((c = *path++) != EOS) `7B
X`09`09if (isLower(c))`09had_lower = TRUE;
X`09`09if (isUpper(c))`09had_upper = TRUE;
X`09`7D
X`09return (had_upper `26`26 had_lower);
X`7D
X#endif
X
X/*
X * Undo nominal effect of 'shorten_path()'
X */
Xchar *
Xlengthen_path(char *path)
X`7B
X#if SYS_VMS
X`09struct`09FAB`09my_fab;
X`09struct`09NAM`09my_nam;
X`09char`09`09my_esa`5BNAM$C_MAXRSS`5D;`09/* expanded: sys$parse */
X`09char`09`09my_rsa`5BNAM$C_MAXRSS`5D;`09/* result: sys$search */
X#endif
X`09register int len;
X`09const char *cwd;
X`09char`09*f;
X`09char`09temp`5BNFILEN`5D;
X#if OPT_MSDOS_PATH
X`09char`09drive;
X#endif
X
X`09if ((f = is_appendname(path)) != 0)
X`09`09return (lengthen_path(f) != 0) ? path : 0;
X
X`09if ((f = path) == 0)
X`09`09return path;
X
X`09if (*path != EOS `26`26 isInternalName(path)) `7B
X#if OPT_VMS_PATH
X`09    /*
X`09     * The conflict between VMS pathnames (e.g., "`5B-`5D") and Vile's
X`09     * scratch-buffer names is a little ambiguous.  On VMS, though,
X`09     * we'll have to give VMS pathnames the edge.  We cheat a little,
X`09     * by exploiting the fact (?) that the system calls return paths
X`09     * in uppercase only.
X`09     */
X`09    if (!is_vms_pathname(path, TRUE) `26`26 !mixed_cas\1B06))
X#endif
X`09`09return path;
X`09`7D
X
X#if SYS_UNIX
X`09(void)home_path(f);
X#endif
X
X#if SYS_VMS
X`09/*
X`09 * If the file exists, we can ask VMS to tell\2806ull pathname.
X`09 */
X`09if ((*path != EOS) `26`26 maybe_pathname(path)) `7B
X`09`09int`09fd;
X`09`09long`09status;
X`09`09char`09temp`5BNFILEN`5D,
X`09`09`09leaf`5BNFILEN`5D;
X`09`09register char`09*s;
X
X`09`09if (!strchr(path, '*') `26`26 \160F?')) `7B
X`09`09`09if ((fd = open(SL_TO_BSL(path), O_RDONLY, 0)) >= 0) `7B
X`09`09&0209getname(fd, temp);
X`09`09&0209(void)close(fd);
X`09`09&0209return strcpy(path, temp);
X`09`09`09`7D
X`09`09`7D
X
X`09`09/*
X`09`09 * Path either contains a wildcard, or the file does
X`09`09 * not already exist.  Use the system parser to expand
X`09`09 * the pathname components.
X`09`09 */
X`09`09my_fab = cc$rms_fab;
X`09`09my_fab.fab$l_fop = FAB$M_NAM;
X`09`09my_fab.fab$l_nam = `26my_nam;`09/* FAB => NAM block`09*/
X`09`09my_fab.fab$l_dna = "";&0209/* Default-selection`09*/
X`09`09my_fab.fab$b_dns = strlen(\1A0Bl_dna);
X
X`09`09my_fab.fab$l_fna = path;
X`09`09my_fab.fab$b_fns = strlen(path);
X
X`09`09my_nam = cc$rms_nam;
X`09`09my_nam.nam$b_ess = NAM$C_MAXRSS;
X`09`09my_nam.nam$l_esa = my_esa;
X`09`09my_nam.nam$b_rss = NAM$C_MAXRSS;
X`09`09my_nam.nam$l_rsa = my_rsa;
X
X`09`09if ((status = sys$parse(`26my_fab)) == RMS$_NORMAL) `7B
X`09`09`09char *s = my_esa;
X`09`09`09int len = my_nam.nam$b_esl;
X`09`09`09s`5Blen`5D = EOS;
X`09`09`09if (len > 2) `7B
X`09`09&0209s = pathleaf(s);
X`09`09&0209if (!strcmp(s, ".;"))
X`09`09&0209`09*s = EOS;
X`09`09`09`7D
X`09`09`09return strcpy(path, my_esa);
X`09`09`7D else `7B
X`09`09`09/* FIXME: try to expand partial directory specs, etc. */
X`09`09`7D
X`09`7D
X#else
X# if OPT_VMS_PATH
X`09/* this is only for testing! */
X`09if (fakevms_filename(path))
X`09`09return path;
X# endif
X#endif
X
X#if SYS_UNIX `7C`7C OPT_MSDOS_PATH\1208VMS_PATH
X#if OPT_MSDOS_PATH
X`09if ((f = is_msdos_drive(path)) != 0)
X`09`09drive = *path;
X`09else `7B
X`09`09drive = EOS;
X`09`09f = path;
X`09`7D
X#endif
X`09if (!is_slashc(f`5B0`5D)) `7B
X#if OPT_MSDOS_PATH
X
X#if OPT_UNC_PATH
X`09`09if ( drive == EOS ) `7B
X`09`09`09GetCurrentDirectory(sizeof(temp), temp);
X`09`09`09cwd = temp;
X`09`09`7D
X`09`09else
X#endif
X`09`09 cwd = curr_dir_on_drive(drive != EOS
X`09`09 &0209? drive
X`09`09&0209: curdrive());
X
X`09`09if (!cwd) `7B
X`09`09`09/* Drive will be unspecified with UNC Paths */
X`09`09`09if ( (temp`5B0`5D = drive) != EOS ) `7B
X#if SYS_OS2_EMX
X`09`09&0209(void)strcpy(temp + 1, ":/");
X#else
X`09`09&0209(void)strcpy(temp + 1, ":`5C`5C");
X#endif
X`09`09`09`7D
X`09`09`09cwd = temp;
X`09`09`7D
X#else
X`09`09cwd = current_directory(FALSE);
X`09`09if (!is_slashc(*cwd))
X`09`09`09return path;
X#endif
X#if OPT_VMS_PATH
X`09`09vms2unix_path(temp, cwd);
X#else
X`09`09(void)strcpy(temp, cwd);
X#endif
X`09`09len = strlen(temp);
X`09`09temp`5Blen++`5D = SLASHC;
X`09`09(void)strcpy(temp + len, f);
X`09`09(void)strcpy(path, temp);
X`09`7D
X#if OPT_MSDOS_PATH
X`09if (is_msdos_drive(path) == 0) `7B /* ensure that we have drive too */
X`09`09/* UNC paths have no drive */
X`09`09if ( curdrive() != 0 ) `7B
X`09`09`09temp`5B0`5D = curdrive();
X`09`09`09temp`5B1`5D = ':';
X`09`09`09(void)strcpy(temp+2, path);
X`09`09`09(void)strcpy(path, temp);
X`09`09`7D
X`09`7D
X#endif
X#endif`09/* SYS_UNIX `7C`7C SYS_MSDOS */
X
X`09return canonpath(path);
X`7D
X
X/*
X * Returns true if the argument looks like an absolute pathname (e.g., on
X * unix, begins with a '/').
X */
Xstatic int
Xis_absolute_pathname(char *path)
X`7B
X`09char`09*f;
X`09if ((f = is_appendname(path)) != 0)
X`09`09return is_pathname(f);
X
X#if OPT_VMS_PATH
X`09if (is_vms_pathname(path, -TRUE)
X`09 `26`26 (strchr(path, LBRACK) != 0
X`09  `7C`7C strchr(path, ':') != 0))
X`09`09return TRUE;
X#endif
X
X#if OPT_MSDOS_PATH
X`09if ((f = is_msdos_drive(path)) != 0)
X`09`09return is_absolute_pathname(f);
X#endif
X
X#if SYS_UNIX `7C`7C OPT_MSDOS_PATH &027C SYS_VMS
X#if SYS_UNIX
X`09if (path`5B0`5D == '`7E')
X`09`09return TRUE;
X#endif
X`09if (is_slashc(path`5B0`5D))
X`09`09return TRUE;
X#endif`09/* SYS_UNIX `7C`7C OPT_MSDOS_PATH &027C SYS_VMS */
X
X`09return FALSE;
X`7D
X
X/*
X * Returns true if the argument looks like a relative pathname (e.g., on
X * unix, begins with "./" or "../")
X */
Xstatic int
Xis_relative_pathname(const char *path)
X`7B
X`09int`09n;
X#if OPT_VMS_PATH
X`09if (is_vms_pathname(path, -TRUE)
X`09 `26`26 !strncmp(path, "`5B-", 2))
X`09`09return TRUE;
X#endif
X#if SYS_UNIX `7C`7C OPT_MSDOS_PATH &027C SYS_VMS
X`09n = 0;
X`09if (path`5Bn++`5D == '.') `7B
X`09`09if (path`5Bn`5D == '.')
X`09`09`09n++;
X`09`09if (is_slashc(path`5Bn`5D))
X`09`09`09return TRUE;
X`09`7D
X#endif`09/* SYS_UNIX `7C`7C OPT_MSDOS_PATH &027C SYS_VMS */
X
X`09return FALSE;
X`7D
X
X/*
X * Returns true if the argument looks more like a pathname than anything else.
V
X *
X * Notes:
X *`09This makes a syntax-only test (e.g., at the beginning of the string).
X *`09VMS can accept UNIX-style /-delimited pathnames.
X */
Xint
Xis_pathname(char *path)
X`7B
X`09return is_relative_pathname(path)
X`09   `7C`7C  is_absolute_pathname(path);
X`7D
X
X/*
X * A bit weaker than 'is_pathname()', checks to see if the string contains
X * path delimiters.
X */
Xint
Xmaybe_pathname(char *fn)
X`7B
X`09if (is_pathname(fn))`09/* test the obvious stuff */
X`09`09return TRUE;
X#if OPT_MSDOS_PATH
X`09if (is_msdos_drive(fn))
X`09`09return TRUE;
X#endif
X`09if (last_slash(fn) != 0)
X`09`09return TRUE;
X#if OPT_VMS_PATH
X`09while (*fn != EOS) `7B
X`09`09if (ispath(*fn) `26`26 !isident(*fn))
X`09`09`09return TRUE;
X`09`09fn++;
X`09`7D
X#endif
X`09return FALSE;
X`7D
X
X/*
X * Returns the filename portion if the argument is an append-name (and not an
V
X * internal name!), otherwise null.
X */
Xchar *
Xis_appendname(char *fn)
X`7B
X`09if (fn != 0) `7B
X`09`09if (isAppendToName(fn)) `7B
X`09`09`09fn += 2;`09/* skip the ">>" prefix */
X`09`09`09fn = skip_blanks(fn);
X`09`09`09if (!isInternalName(fn))
X`09`09&0209return fn;
X`09`09`7D
X`09`7D
X`09return 0;
X`7D
X
X/*
X * Returns true if the filename is either a scratch-name, or is the string tha
Vt
X * we generate for the filename-field of `5BHelp`5D and `5BBuffer List`5D.  Us
Ve this
X * function rather than simple tests of '`5B' to mak\1508for VMS filenames
X * unambiguous.
X */
Xint
Xis_internalname(const char *fn)
X`7B
X#if OPT_VMS_PATH
X`09if (is_vms_pathname(fn, FALSE))
X`09`09return FALSE;
X#endif
X`09if (!strcmp(fn, non_filename()))
X`09`09return TRUE;
X`09return (*fn == EOS) `7C`7C is_scratchname(fn);
X`7D
X
X/*
X * Make the simple test only for bracketed name.  We only use this when we're
V
X * certain it's a buffer name.
X */
Xint
Xis_scratchname(const char *fn)
X`7B
X`09return ((*fn == SCRTCH_LEFT`5B0`5D) `26`26 (fn`5Bstrlen(fn)-1`5D\280BRIGHT
V`5B0`5D));
X`7D
X
X/*
X * Test if the given path is a directory
X */
Xint
Xis_directory(char * path)
X`7B
X#if OPT_VMS_PATH
X`09register char *s;
X#endif
X`09struct`09stat`09sb;
X
X`09if (path == NULL `7C`7C *\1108EOS)
X`09`09return FALSE;
X
X#if OPT_VMS_PATH
X`09if (is_vms_pathname(path, TRUE)) `7B
X`09`09return TRUE;
X`09`7D
X
X`09/* If the name doesn't look like a directory, there's no point in
X`09 * wasting time doing a 'stat()' call.
X`09 */
X`09s = vms_pathleaf(path);
X`09if ((s = strchr(s, '.')) != 0) `7B
X`09`09char`09ftype`5BNFILEN`5D;
X`09`09(void)mkupper(strcpy(ftype, s));
X`09`09if (strcmp(ftype, ".DIR")
X`09`09 `26`26 strcmp(ftype, ".DIR;1"))
X`09`09`09return FALSE;
X`09`7D
X#endif
X#if OPT_UNC_PATH
X`09/*
X`09 * WARNING: kludge alert!
X`09 *
X`09 * The problem here is that `5C`5Csystem`5Cshare, if it exists,
X`09 * must be a directory.  However, due to a bug in the win32
X`09 * stat function, it may be reported to exist (stat succeeds)
X`09 * but that it is a file, not a directory.  So we special case
X`09 * a stand-alone `5C`5Csystem`5Cshare name and force it to be reported
X`09 * as a dir.
X`09 */
X`09if (is_slashc(path`5B0`5D) `26`26 \160F1`5D)) `7B
X`09`09char *end = skip_string(path);
X`09`09int slashes = 0;
X`09`09if (end > path `26`26 is_slashc(end`5B-1`5D))
X`09`09`09end--;
X`09`09while (--end >= path) `7B
X`09`09`09if (is_slashc(*end))
X`09`09&0209slashes++;
X`09`09`7D
X`09`09if (slashes == 3)
X`09`09`09return 1;
X`09`7D
X#endif
X`09return ( (stat(SL_TO_BSL(path), `26sb) >= 0)
X#if SYS_OS2 `26`26 CC_CSETPP
X`09`09`26`26 ((sb.st_mode `26 S_IFDIR) != 0)
X#else
X`09`09`26`26 S_ISDIR(sb.st_mode)
X#endif
X`09  );
X
X`7D
X
X#if (SYS_UNIX`7C`7CSYS_VMS&027COPT_MSDOS_PATH) `26`26 OPT_PATHLOOKUP
X/*
X * Parse the next entry in a list of pathnames, returning null only when no
X * more entries can be parsed.
X */
Xconst char *
Xparse_pathlist(const char *list,\0C07result)
X`7B
X`09if (list != NULL `26`26 *\1108EOS) `7B
X`09`09register int`09len = 0;
X
X`09`09while (*list `26`26\0A08!= PATHCHR)) `7B
X`09`09`09if (len < NFILEN-1)
X`09`09&0209result`5Blen++`5D = *list;
X`09`09`09list++;
X`09`09`7D
X`09`09if (len == 0)`09/* avoid returning an empty-string */
X`09`09`09result`5Blen++`5D = '.';
X`09`09result`5Blen`5D = EOS;
X
X`09`09if (*list == PATHCHR)
X`09`09`09++list;
X`09`7D else
X`09`09list = NULL;
X`09return list;
X`7D
X#endif`09/* OPT_PATHLOOKUP */
X
X#if SYS_WINNT `26`26 !CC_TURBO
X/********        \0808\1010\200F`5C`5C  opendir  //
X *        \0808\1010\2018===========
X * opendir
X *
X * Description:
X *      Prepares to scan the file name entries in a directory.
X *
X * Arguments:   filename in NT format
X *
X * Returns:     pointer to a (malloc-ed) DIR structure.
X *
X * Joseph E. Greer      July 22 1992
X *
X ********/
X
XDIR *
Xopendir(char * fname)
X`7B
X`09char buf`5BMAX_PATH`5D;
X`09DIR *od;
X
X`09(void)strcpy(buf, fname);
X
X`09if (!strcmp(buf, ".")) /* if its just a '.', replace with '*.*' */
X`09`09(void)strcpy(buf, "*.*");
X`09else `7B
X`09`09/* If the name ends with a slash, append '*.*' otherwise '`5C*.*' */
X`09`09if (is_slashc(buf`5Bstrlen(buf)-1`5D))
X`09`09`09(void)strcat(buf, "*.*");
X`09`09else
X`09`09`09(void)strcat(buf, "`5C`5C*.*");
X`09`7D
X
X`09/* allocate the structure to maintain currency */
X`09if ((od = typealloc(DIR)) == NULL)
X`09`09return NULL;
X
X`09/* Let's try to find a file matching the given name */
X`09if ((od->hFindFile = \0B06rstFile(buf, `26od->ffd))
X`09    == INVALID_HANDLE_VALUE) `7B
X`09`09free(od);
X`09`09return NULL;
X`09`7D
X`09od->first = 1;
X`09return od;
X`7D
X
X/********        \0808\1010\200F`5C`5C  readdir  //
X *        \0808\1010\2018===========
X * readdir
X *
X * Description:
X *      Read a directory entry.
X *
X * Arguments:   a DIR pointer
X *
X * Returns:     A struct direct
X *
X * Joseph E. Greer      July 22 1992
X *
X ********/
XDIRENT *
Xreaddir(DIR *dirp)
X`7B
X`09if (dirp->first)
X`09`09dirp->first = 0;
X`09else if (!FindNextFile(dirp->hFindFile, `26\1206ffd))
X`09`09return NULL;
X`09dirp->de.d_name = \1206ffd.cFileName;
X`09return `26dirp->de;
X`7D
X
X/********        \0808\1010\200F`5C`5C  closedir  //
X *        \0808\1010\2018===========
X * closedir
X *
X * Description:
X *      Close a directory entry.
X *
X * Arguments:   a DIR pointer
X *
X * Returns:     A struct direct
X *
X * Joseph E. Greer      July 22 1992
X *
X ********/
Xint
Xclosedir(DIR *dirp)
X`7B
X`09FindClose(dirp->hFindFile);
X`09free(dirp);
X`09return 0;
X`7D
X
X#endif /* SYS_WINNT */
X
X#if OPT_MSDOS_PATH `26`26 !SYS_OS2_EMX
Xstatic char *slconv ( const\1507f,\1E07t\0907oc\1207nc );
Xstatic char slconvpath`5BNFILEN * 2`5D;
X
X/*
X * Use this function to filter our internal '/' format pathnames to '`5C'
X * when invoking system calls (e.g., opendir, chdir).
X */
Xchar *
Xsl_to_bsl(const char *p)
X`7B
X`09size_t len;
X`09char *s = slconv(p,\0A07path, '/', '`5C`5C');
X`09if ((s = is_msdos_drive(s)) == 0)
X`09`09s = slconvpath;
X`09/* Trim trailing slash if it's not the first */
X`09if ((len = strlen(s)) > 1
X`09 `26`26 is_slashc(s`5Blen-1`5D))
X`09`09s`5B--len`5D = EOS;
X`09return slconvpath;
X`7D
X
X/*
X * Use this function to tidy up and put the path-slashes into internal form.
X */
X#ifndef bsl_to_sl_inplace
Xvoid
Xbsl_to_sl_inplace(char *p)
X`7B
X`09(void)slconv(p, p, '`5C`5C', '/');
X`7D
X#endif
X
Xstatic char *
Xslconv(const char *f,\0907t\0907oc\1207nc)
X`7B
X`09char *retp = t;
X`09while (*f) `7B
X`09`09if (*f == oc)
X`09`09`09*t = nc;
X`09`09else
X`09`09`09*t = *f;
X`09`09f++;
X`09`09t++;
X`09`7D
X`09*t-- = EOS;
X
X`09return retp;
X`7D
X#endif
X
X#if OPT_VMS_PATH
X/*
X * Strip the VMS version number, so the resulting path implicitly applies to
X * the current version.
X */
Xchar *
Xstrip_version(char *path)
X`7B
X`09char *verp = strrchr(path, ';');
X`09if (verp != 0)
X`09`09*verp = EOS;
X`09return path;
X`7D
X#endif
X
X#if NO_LEAKS
Xvoid
Xpath_leaks(void)
X`7B
X#if SYS_UNIX
X`09while (user_paths != NULL) `7B
X`09`09register UPATH *paths = user_paths;
X`09`09user_paths = paths->next;
X`09`09free(paths->name);
X`09`09free(paths->path);
X`09`09free((char *)paths);
X`09`7D
X#endif
X`7D
X#endif`09/* NO_LEAKS */
$ call unpack [.VILE-8_0]PATH.C;1 -
 1399661668 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 88 97 152
$!
$ create 'f'
X/*
X * perl.xs`09`09-- perl interface for vile.
X *
X * Author: Kevin Buettner, Brendan O'Dea
X *
X * (with acknowledgments to the authors of the nvi perl interface as
X * Sean Ahern who has contributed snippets of code here and t\0A08
X * many valuable suggestions.)
X *
X * Created: Fall, 1997
X *
X * Description: The following code provides an interface to Perl from
X * vile.  The file api.c (sometimes) provides a middle layer between
X * this interface and the rest of vile.
X *
X * $Header: /usr/build/vile/vile/RCS/perl.xs,v 1.24 1998/05/27 10:52:16 tom Ex
Vp $
X */
X
X/*#
X  #
X  # Note: This embedded documentation may be retrieved for formatting
X  # with one of the pod transformers as follows.  To make the
X  # pod file, do
X  #
X  #     perl -lne 'print if s/`5E`5Cs`7B1,2`7D#`5Cs`7B0,1`7D//' perl.xs
X  #
X  # To transform the pod file into something nicely formatted, do
X  # one or more of the following:
X  #
X  #     pod2text vile-perl-api.pod >\130Edoc
X  #
X  #     pod2html vile-perl-api.pod >\130Ehtml
X  #
X  #     pod2man  vile-perl-api.pod >\130Eman
X  #
X  #     pod2latex vile-perl-api.pod >\130Elatex
X  #
X  # I experimented with different formatting layouts.  I found that I
X  # was unable to dispense with the initial transformation because
X  # xsubpp doesn't like it when some of my pod documentation started
X  # in the left-most column.  I've also found that placing the # in
X  # the left-most column will sometimes screw up xsubpp wrt to
X  # preprocessor statements.  It does not get confused when when there
X  # are one or more spaces preceding the pound sign.  I usually like
X  # to indent things by four spaces, and yet I wanted to use `5EA-f in
X  # vile to reformat things, so I settled on two spaces, followed by
X  # a pound sign, followed by a single space\1C0Ewhatever
X  # as the most pleasing layout.
X  #
X  #
X  # =pod
X  #
X  # =head1 NAME
X  #
X  # vile-perl-api       -- Vile/Perl interface reference
X  #
X  # =head1 DESCRIPTION
X  #
X  # This document describes the interface by which by Perl scripts may
X  # access the I<vile> editor's internals when run from an \2406 in which
X  # Perl has been embedded.
X  #
X  # There are presently two packages which comprise this interface.  They
X  # are:
X  #
X  # =over 4
X  #
X  # =item Vile
X  #
X  # Subroutines for accessing and controlling vile in general.
X  #
X  # =item Vile::Buffer
X  #
X  # Subroutines and methods for accessing individual buffers.
X  #
X  # =back
X  #
X  # A Vile::Window package is being contemplated, but has not been
X  # written yet.
X  #
X  # =head2 Calling Perl from Vile
X  #
X  # The perl interpreter may be invoked from I<vile> using either
X  # the I<perl> or\0B07do> commands.
X  #
X  # =over 4
X  #
X */
X
X/* contortions to avoid typedef conflicts */
X#define main perl_main
X#define regexp perl_\0C06
X
X/* for perl */
X#include <EXTERN.h>
X#include <perl.h>
X#include <XSUB.h>
X
X#undef main
X#undef regexp
X#undef HUGE
X
X/* Some earlier versions of perl don't have GIMME_V or G_VOID. We must
X   be careful of the order in which we check things if these defines
X   are activated. */
X#ifndef GIMME_V
X#define GIMME_V\0806
X#endif
X
X#ifndef G_VOID
X#define G_VOID G_SCALAR
X#endif
X
X
X/* for vile */
X#include "estruct.h"
X#include "edef.h"
X
X#include "api.h"
X
Xextern REGION *haveregion;
X
Xstatic PerlInterpreter *perl_interp;
Xstatic int use_ml_as_prompt;
Xstatic SV *svcurbuf;`09`09/* $Vile::current_buffer in perl */
Xstatic int svcurbuf_set(SV *, MAGIC *);
Xstatic MGVTBL svcurbuf_accessors = `7B
X`09/* Virtual table for svcurbuf magic. */
X`09NULL, svcurbuf_set, \1406\1A06NULL
X`7D;
X
Xstatic SV *svrs;`09`09/* The input record separator, or $/
X        \0808\1010 * Normally, this is available via the
X`09`09&0209 * rs macro, but apparently perl5.00402
X`09`09&0209 * on win32 systems don't export the
X`09`09&0209 * necessary symbol from the DLL.  So
X`09`09&0209 * we have our own...
X`09`09&0209 */
X
Xstatic int perl_init(void);
Xstatic void xs_init(void);
Xstatic int  perl_prompt(void);
Xstatic int  perldo_prompt(void);
X
X/* write each line to message line */
Xstatic int
Xwrite_message(SV *sv)
X`7B
X    int count = 0;
X    char *text = SvPV(sv, na);
X    char *nl;
X
X    while (text)
X    `7B
X`09if ((nl = strchr(text, '`5Cn')))
X`09`7B
X`09    *nl = 0;
X`09    while (*++nl == '`5Cn')
X`09`09;
X
X`09    if (!*nl)
X`09`09nl = 0;
X`09`7D
X
X`09mlforce("%s", text);
X`09text = nl;
X`09count++;
X    `7D
X
X    return count;
X`7D
X
X/* require a file, `60optional' indicates that it is OK for the file not
X   to exist */
Xstatic int
Xrequire(char *file, int optional)
X`7B
X    /* require the file */
X    perl_require_pv(file);
X
X    /* OK */
X    if (!SvTRUE(GvSV(errgv)))
X`09return TRUE;
X
X    if (optional)
X    `7B
X`09/* this error is OK for optional files */
X`09SV *tmp = newSVpv("Can't locate ", 0);
X`09char const *check;
X`09int sz;
X`09int not_found;
X
X`09sv_catpv(tmp, file);
X`09sv_catpv(tmp, " ");
X`09check = SvPV(tmp, sz);
X`09not_found = !strncmp(SvPV(GvSV(errgv), na), check, sz);
X`09SvREFCNT_dec(tmp);
X
X`09if (not_found)
X`09    return SORTOFTRUE;
X    `7D
X
X    write_message(GvSV(errgv));
X    return FALSE;
X`7D
X
X/* When no region is specified, this will cause the entire buffer to
X   be selected without moving DOT. */
Xvoid
Xperl_default_region(void)
X`7B
X    static REGION region;
X    MARK save_DOT = DOT;
X    DOT.l = lforw(buf_head(curbp));
X    DOT.o = 0;
X    MK.l  = lback(buf_head(curbp));
X    MK.o  = 0;
X    regionshape = FULLLINE;
X    haveregion = NULL;
X    if (getregion(`26\0806))
X`09haveregion = `26\0A06;
X    DOT = save_DOT;
X`7D
X
X/*
X * Create a VB buffer handle object.  Thes\0F08s are both
X * blessed into the Vile::Buffer class as well as made magical
X * so that they may also be used as filehandles.
X */
Xstatic SV *
XnewVBrv(SV *rv, VileBuf *sp)
X`7B
X    if (sp->perl_handle == 0) `7B
X`09sp->perl_handle = newGVgen("Vile::Buffer");
X`09GvSV((GV*)sp->perl_handle) = newSV(0);
X`09sv_setiv(GvSV((GV*)sp->perl_handle), (IV) sp);
X`09SvREFCNT_inc(sp->perl_handle);
X`09sv_magic(sp->perl_handle, rv, 'q', Nullch, 0);
X    `7D
X    else
X`09SvREFCNT_inc(sp->perl_handle);
X
X    sv_upgrade(rv, SVt_RV);
X    SvRV(rv) = sp->perl_handle;
X
X    SvROK_on(rv);
X    return sv_bless(rv, gv_stashpv("Vile::Buffer", TRUE));
X`7D
X
Xstatic VileBuf *
XgetVB(SV *sv, char **croakmessage_ptr)
X`7B
X    VileBuf *vbp = 0;
X    if (sv_isa(sv, "Vile::Buffer")) `7B
X`09vbp = (VileBuf *)SvIV((SV*)GvSV((GV*)SvRV(sv)));
X`09if (vbp == 0) `7B
X`09    *croakmessage_ptr = "buffer no longer exists";
X`09`7D
X    `7D
X    else `7B
X`09*croakmessage_ptr = "buffer of wrong type";
X    `7D
X    return vbp;
X`7D
X
Xvoid
Xperl_free_handle(void *\0D06)
X`7B
X    /*
X     * Zero out perl's handle to the VileBuf structure
X     */
X    sv_setiv(GvSV((GV*)handle), 0);
X
X    /*
X     * Decrement the reference count to indicate the fact that
X     * we are no longer referencing it from the api private structure.
X     * If there aren't any other references from within perl either,
X     * then this scalar will be collected.
X     */
X    SvREFCNT_dec(handle);
X`7D
X
Xstatic int recursecount = 0;
X
Xstatic int
Xdo_perl_cmd(SV *cmd, int inplace)
X`7B
X    int old_discmd;
X    int old_isnamedcmd;
X
X    use_ml_as_prompt = 0;
X
X    if (perl_interp `7C`7C \0F07it()) `7B
X`09REGION region;
X`09VileBuf *curvbp;
X
X`09if (recursecount == 0) `7B
X`09    curvbp = api_bp2vbp(curbp);
X
X`09    if (getregion(`26\0806) != TRUE) `7B
X`09`09/* shouldn't ever get here. But just in case... */
X`09`09perl_default_region();
X`09`09if (getregion(`26\0806) != TRUE) `7B
X`09`09    mlforce("BUG: getregion won't return TRUE in perl.xs.");
X`09`09`7D
X`09    `7D
X
X`09    /* Initialize some of the fields in curvbp */
X`09    curvbp->region = \0906;
X`09    curvbp->regionshape = \0E0B;
X`09    curvbp->inplace_edit = \0F07;
X
X`09    sv_setsv(svcurbuf, newVBrv(sv_2mortal(newSV(0)), curvbp));
X`09`7D
X
X`09/* We set the following stuff up in the event that we call
X`09   one of the mlreply methods.  If they are not set up this
X`09   way, we won't always be prompted... */
X        clexec = FALSE;
X        old_discmd = \0906;
X        discmd = TRUE;
X`09old_isnamedcmd = \0D0A;`09/* for mlreply_dir */
X`09isnamedcmd = TRUE;
X`09recursecount++;
X
X#define PDEBUG 0
X#if PDEBUG
X`09printf("`5Cnbefore eval`5Cn");
X        sv_dump(svcurbuf);
X#endif
X`09sv_setpv(GvSV(errgv),"");
X`09if (SvROK(cmd) `26`26 SvTYPE(SvRV(cmd)) == SVt_PVCV)
X`09`7B
X `09    dSP;
X `09    PUSHMARK(sp);
X `09    PUTBACK;
X `09    perl_call_sv(cmd, G_EVAL`7CG_VOID`7CG_DISCARD);
X`09`7D
X`09else
X`09    perl_eval_sv(cmd, G_DISCARD`7CG_NOARGS`7CG_KEEPERR);
X#if PDEBUG
X`09printf("after eval`5Cn");
X        sv_dump(svcurbuf);
X#endif
X
X`09recursecount--;
X        discmd = old_\0D06;
X`09isnamedcmd = old_\110A;
X
X`09if (recursecount == 0) `7B
X`09    SvREFCNT_dec(SvRV(svcurbuf));
X`09    api_command_cleanup();
X`09`7D
X
X`09if (!SvTRUE(GvSV(errgv)))
X`09    return TRUE;
X
X`09write_message(GvSV(errgv));
X    `7D
X
X    return FALSE;
X`7D
X
X/*
X * procedures for bindable callbacks: see Vile::register*
X */
X
Xstatic SV *opsv;
X
Xstatic int
Xperl_oper(void)
X`7B
X    return do_perl_cmd(opsv, FALSE);
X`7D
X
Xint
Xperl_call_sub(void *data, int oper\0A06f\1106n)
X`7B
X    AV *av = data;`09/* callback is an array containing: */
X    SV **name;`09`09/* the registered name, */
X    SV **sub;`09`09/* a sub name or coderef to call, */
X    SV **req;`09`09/* and an `5Boptional`5D file to require */
X
X    switch (av_len(av))
X    `7B
X`09case 2: /* (name, sub, require) */
X`09    if ((req = av_fetch(av, 2, 0)) `26`26 SvTRUE(*req))
X`09`09if (!require(SvPV(*req, na), FALSE))
X`09`09    return FALSE;
X
X`09    /* FALLTHRU */
X
X`09case 1: /* (name, sub) */
+-+-+-+-+-+-+-+-  END  OF PART 91 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 92 -+-+-+-+-+-+-+-+
X`09    if (!(name = av_fetch(av, 0, 0)) `7C`7C !SvTRUE(*name))
X`09`09croak("BUG: can't fetch name SV");
X
X`09    if (!(sub = av_fetch(av, 1, 0)) `7C`7C !SvTRUE(*sub))
X`09`09croak("BUG: can't fetch subroutine SV");
X
X`09    break;
X
X`09default:
X`09    croak("BUG: array contains %d elements", av_len(av) + 1);
X    `7D
X
X    /* call the subroutine */
X    if (oper)
X    `7B
X`09opcmd = OPOTHER;
X`09opsv = *sub;
X`09f = vile_op(f, n, perl_oper, SvPV(*name, na));
X    `7D
X    else
X    `7B
X`09if (!f)
X`09    n = 1;
X
X`09while (n-- `26`26 (f = do_perl_cmd(*sub, FALSE)))
X`09    ;
X    `7D
X
X    return f;
X`7D
X
Xvoid
Xperl_free_sub(void *data)
X`7B
X    AV *av = data;
X    av_undef(av);
X`7D
X
X/*
X * Prompt for and execute a perl command.
X *
X * This function is actually only a wrapper for perl_prompt below to make
X * the history management easier.
X *
X  #
X  # =item :perl STMTS
X  #
X  # The I<perl> command will cause perl to execute one or more
X  # perl statements.  The user is usually prompted for the statments
X  # to execute immediately after ":perl " is entered.  The user is
X  # expected to enter legal perl statements or expressions.  These
X  # statements must all fit on one line.  (Vile's :-line will scroll
X  # horizontally though, so don't worry about running out of space.)
X  #
X  # The perl command may also appear in macros in vile's internal
X  # macro language, in which case the perl statements to execute must
X  # appear as a double quoted string to the perl command.  The user
X  # is not prompted in this case.
X  #
X  # Regardless, prior to execution, the global variable,
X  # C<$Vile::>C<current_buffer> is set to an object of type C<\3706B\2C06
X  # which represents the current buffer.  The statem\2406o be executed
X  # may choose to act either directly or in\0E0An the current
X  # buffer via this variable or a suitable alias.
X  #
X  # Normally, the cursor's current position, also referred to as I<dot>,
X  # is left unchanged upon return from perl.  It can be propagated
X  # back to a viewable window by explicitly setting via the
X  # C<Vile::Buffer::>C<dot> method.
X  #
X  # For purposes of reading from the buffer, there is always a region
X  # associated with the buffer object.  By default, this region is the
X  # entire buffer.  (Which means that potentially, the \330D
X  # may be acted upon.) This range \1F07restricted by the user in
X  # the normal way through the use of a range specification which
X  # precedes the perl command.   E.g,
X  #
X  #     30,40perl @l = <$Vile::current_buffer>
X  #
X  # will cause lines 30 thru 40 to be placed into the @l array.
X  #
X */
X
Xint
Xperl(int f GCC_UNUSED, int n\120B)
X`7B
X    int status;
X
X#if OPT_HISTORY
X    if (recursecount == 0)
X`09hst_init(EOS);
X#endif
X
X    status = perl_prompt();
X
X#if OPT_HISTORY
X    if (recursecount == 0)
X`09hst_flush();
X#endif
X
X    return status;
X`7D
X
Xstatic int
Xperl_prompt(void)
X`7B
X    register int status;
X    char buf`5BNLINE`5D;`09/* buffer to receive command into */
X    SV *cmd;
X
X    buf`5B0`5D = EOS;
X    if ((status = mlreply_no_opts("Perl command: ", buf, sizeof(buf))) != TRUE
V)
X`09    return status;
X
X    status = do_perl_cmd(cmd = newSVpv(buf, 0), FALSE);
X    SvREFCNT_dec(cmd);
X    return status;
X`7D
X
X#define isoctal(c) ((c) >= '0' `26`26 (c) <= '7')
Xstatic int octal(char **s)
X`7B
X    int oct = 0;
X    int i = (**s > '3') ? 2 : 3;
X
X    while (i-- `26`26 isoctal(**s))
X    `7B
X`09oct *= 8;
X`09oct += *((*s)++) - '0';
X    `7D
X
X    return oct;
X`7D
X
X/*#
X  #
X  # =item :perldo STMTS E<lt>EnterE<gt> OPTIONS
X  #
X  # The I<perldo> command is like the perl\1908, but it takes
X  # various options making it possible to write "one liners" to
X  # operate on the current buffer in much the same way that you might
X  # write a one line perl command at the prompt of your favorite shell
X  # to operate on a file.  The options even mimic those provided by
X  # the perl interpreter, so if you are familiar with one, you'll be
X  # familiar with the other.
X  #
X  # After entering the perldo command (preceded by an optional range
X  # specification) on the :-line, the user will be prompted for some
X  # perl statements to execute.  These should usually be written to
X  # operate on the $_ variable and leave the result in $_.
X  #
X  # After pressing the B<Enter> key, you'll be prompted for a set
X  # of options.  The default\1608 are -lpi and will even be displayed
X  # as such.  The B<-i> switch causes the buffer to be edited in place.
X  # The B<-p> switch causes the user supplied statements to be placed
X  # in a loop which fetches lines one by one place them in $_ for each
X  # iteration of the loop along with a trailing C<print> which'll cause
X  # whatever's left in $_ to be put back into the buffer.  The B<-l> switch
X  # causes an initial chomp to be done on each line after it is read.
X  # It will also cause the output record separator to be set so that
X  # when $_ is written back to the buffer, it will end up on a line of
X  # its own.
X  #
X  # For example, the command:
X  #
X  #     :25,30perldo $_ = sprintf("%4d",$lnum++) . $_
X  #        \0808  -lpi
X  #
X  # will cause each line in between 20 and 30 inclusive to be prefixed
X  # with a the number given by $lnum, which is also incremented for
X  # each line processed.  You'll probably want to initialize $lnum to
X  # some appropriate value via the I<perl> command first, perhaps
X  # like this:
X  #
X  #     :perl $lnum = 142;
X  #
X  # `5BI include this example, becaus\1607is something that I've
X  # wanted to do from time to time, when citing snippets of code
X  # which I want to discuss in an email message.`5D
X  #
X  # =item perldo options
X  #
X  # =over 4
X  #
X  # =item -n
X  #
X  # Enclose the perl statement(s) in a loop which iterates of the records
X  # (usually lines) of the region.  Each record in\1C0B will
X  # be placed in $_.
X  #
X  # =item -p
X  #
X  # Like B<-n>, but do a print (of $_) at the end of the loop.
X  #
X  # =item -i
X  #
X  # Enable the I<inplace_edit> flag for the buffer.  When used with
X  # either B<-n> or B<-p>, this will cause the lines to be deleted from the
X  # buffer as they are read.
X  #
X  # Unlike the corresponding perl command line switch, it is not possible
X  # to specify a backup file.  If you don't like what happens, just hit
X  # the 'B<u>' key to undo it.
X  #
X  # =item -l
X  #
X  # Only meaningful when used with either B<-n> or B<-p>.  This will
X  # perform an initial chomp on $_ after a record has been read.
X  #
X  # =item -0
X  #
X  # This must be followed by one or more digits which represent the
X  # value with which to set $/ (\1106is the input record separator).
X  # The special value B<00> indicates that $/ should be set to the
X  # empty string which will cause Perl to slurp input in paragraph
X  # mode.  The special value 0777 indicates that perl should slurp
X  # the entire region without paying attention to record separators.
X  # Normally, $/ is set to '`5Cn' which corresponds to -012
X  #
X  # =item -a
X  #
X  # Turn on autosplit mode.  Upon being read, each record is split
X  # into the @F array.
X  #
X  # =item -F
X  #
X  # When used with B<-a>, specify an alternate pattern to split on.
X  #
X  # =back
X  #
X  # The default region for the perldo command is the line on which
X  # the cursor is currently on.  The reason for this is that it is
X  # often used like vile's builtin substitute operator is and this
X  # is the default region for the substitute command.  You can of
X  # course use any of the standard means to operate over larger
X  # regions, e.g,
X  #
X  #     :1,$perldo s/a/b/g
X  #
X  #
X */
X
Xint
Xperldo(int f GCC_UNUSED, int n\120B)
X`7B
X    int status;
X
X#if OPT_HISTORY
X    hst_init(EOS);
X#endif
X
X    status = perldo_prompt();
X
X#if OPT_HISTORY
X    hst_flush();
X#endif
X
X    return status;
X`7D
X
Xstatic int
Xperldo_prompt(void)
X`7B
X    register int status;
X    char buf`5BNLINE`5D;`09/* buffer to receive command into */
X    char obuf`5BNLINE`5D;`09/* buffer for options */
X    SV *cmd;`09`09/* constructed command string */
X
X#define`09OPT_i`09001
X#define`09OPT_n`09002
X#define`09OPT_p`09004
X#define`09OPT_l`09010
X#define`09OPT_a`09020
X    int opts = 0;
X    char *o = obuf;
X    char *split = "' '";
X
X#define`09RS_PARA`090776
X#define`09RS_NONE`090777
X    int i_rs = '`5Cn';
X    int o_rs = RS_NONE;
X
X    buf`5B0`5D = EOS;
X    if ((status = mlreply_no_opts("Perl command: ", buf, sizeof(buf))) != TRUE
V)
X`09return status;
X
X#if OPT_HISTORY
X    hst_glue('`5Cr');
X#endif
X
X    strcpy(obuf, "-lpi");
X    if ((status = mlreply_no_opts("options: ", obuf, sizeof(obuf))) != TRUE)
X`09return status;
X
X    /* skip optional leading `60-' */
X    if (*o == '-')
X`09o++;
X
X    /* parse options */
X    while (*o)
X`09switch (*o)
X`09`7B
X`09case 'a': opts `7C= OPT_a; o++; break;
X`09case 'i': opts `7C= OPT_i; o++; break;
X`09case 'n': opts `26= `7EOPT_p;\1006`7C= OPT_n; o++; break;
X`09case 'p': opts `26= `7EOPT_n;\1006`7C= OPT_p; o++; break;
X`09case 'l':
X`09    opts `7C= OPT_l;
X`09    o++;
X`09    if (isoctal(*o))
X`09`09o_rs = octal(`26o);
X`09    else
X`09`09o_rs = i_rs;
X
X`09    break;
X
X`09case '0':
X`09    /* special cases: 00, 0777 */
X`09    if (*++o == '0' `26`26 !isoctal(*(o+1)))
X`09    `7B
X`09`09i_rs = RS_PARA;
X`09`09o++;
X`09    `7D
X`09    else if (!strncmp(o, "777", 3))
X`09    `7B
X`09`09i_rs = RS_NONE;
X`09`09o += 3;
X`09    `7D
X`09    else
X`09`09i_rs = octal(`26o);
X
X`09    break;
X
X`09case 'F':
X`09    opts `7C= OPT_a; /* implied */
X`09    if (*++o == '/' `7C`7C *\0D06"\0D0C`5C'')
X`09    `7B
X`09`09char sep = *o;
X`09`09char esc = 0;
X
X`09`09split = o++;
X`09`09while (*o)
X`09`09`7B
X`09`09    if (*o == sep `26`26 !esc)
X`09`09    `7B
X`09`09`09o++;
X`09`09`09break;
X`09`09    `7D
X
X`09`09    if (*o++ == '`5C`5C')
X`09`09`09esc `5E= 1;
X`09`09    else
X`09`09`09esc = 0;
X`09`09`7D
X
X`09`09if (*o `26`26 *o != ' ')
X`09`09`7B
X`09`09    mlforce("`5Bno closing %c`5D", sep);
X`09`09    return FALSE;
X`09`09`7D
X`09    `7D
X`09    else if (*o)
X`09    `7B
X`09`09split = o++;
X`09`09while (*o `26`26 *o != ' ') o++;
X`09    `7D
X`09    else
X`09    `7B
X`09`09mlforce("`5B-F requires an argument`5D");
X`09`09return FALSE;
X`09    `7D
X
X`09    if (*o)
X`09`09*o++ = 0; /* terminate */
X`09`09/* FALLTHRU */
X`09    else
X`09`09break;
X
X`09case ' ':
X`09    while (*o == ' ') o++;
X`09    if (!*o)
X`09`09break; /* trailing spaces */
X
X`09    if (*o == '-' `26`26 *(o+1))
X`09    `7B
X`09`09o++;
X`09`09break;
X`09    `7D
X
X`09    /* FALLTHRU */
X
X`09default:
X`09    mlforce("`5Binvalid option -%s`5D", o);
X`09    return FALSE;
X`09`7D
X
X    /* construct command: block with localised $/ and $`5C */
X    cmd = newSVpv("`7Blocal $/=", 0); /*`7D*/
X    if (i_rs == RS_NONE)
X`09sv_catpv(cmd, "undef");
X    else if (i_rs == RS_PARA)
X`09sv_catpv(cmd, "''");
X    else
X`09sv_catpvf(cmd, "`5C"`5C`5Cx%02x`5C"", i_rs);
X
X    sv_catpv(cmd, ";local $`5C`5C=");
X    if (o_rs == RS_NONE)
X`09sv_catpv(cmd, "undef");
X    else if (o_rs == RS_PARA)
X`09sv_catpv(cmd, "`5C"`5C`5Cn&025Cn`5C"");
X    else
X`09sv_catpvf(cmd, "`5C"`5C`5Cx%02x`5C"", o_rs);
X
X    /* set default output handle */
X    sv_catpv(cmd, ";my $_save_fh=select ");
X    if (opts `26 OPT_i)
X`09sv_catpv(cmd, "$Vile::current_buffer"); /* -i goes to \1806 */
X    else
X`09sv_catpv(cmd, "STDOUT"); /* mini */
X
X    /* implicit loop for -n/-p */
X    if (opts `26 (OPT_n`7COPT_p))
X    `7B
X`09sv_catpv(cmd, ";LINE:while(<$Vile::current_buffer>)`7B"); /*`7D*/
X`09if (opts `26 OPT_l)
X`09    sv_catpv(cmd, "chomp;");
X
X`09/* autosplit to @F */
X`09if (opts `26 OPT_a)
X`09`7B
X`09    sv_catpv(cmd, "@F=split ");
X`09    if (*split == '/' `7C`7C \110B"\1110`5C'')
X`09`09sv_catpv(cmd, split);
X`09    else
X`09    `7B
X`09`09char delim;
X`09`09char *try = "'`7E#`5C200`5C1";
X`09`09/* try to find a delimiter not in the string */
X`09`09while (*try `26`26 strchr(split, *try)) try++;
X`09`09delim = *try;
X`09`09sv_catpvf(cmd, "q%c%s%c", delim, split\0E07);
X`09    `7D
X
X`09    sv_catpv(cmd, ";");
X`09`7D
X    `7D
X    else
X`09sv_catpv(cmd, ";");
X
X    /* add the command */
X    sv_catpv(cmd, buf);
X
X    /* close the loop */
X    if (opts `26 (OPT_n`7COPT_p))
X    `7B
X/*`7B*/`09sv_catpv(cmd, "`7D");
X`09if (opts `26 OPT_p)
X`09    sv_catpv(cmd, "continue`7Bprint`7D");
X    `7D
X    else
X`09sv_catpv(cmd, ";");
X
X    /* reset handle and close block */
X/*`7B*/ sv_catpv(cmd, "select $_save_fh`7D");
X
X    status = do_perl_cmd(cmd, opts `26 OPT_i);
X    SvREFCNT_dec(cmd);
X
X    return status;
X`7D
X
Xstatic int
Xsvcurbuf_set(SV *sv, MAGIC *mg)
X`7B
X    VileBuf *vbp;
X    if (sv_isa(sv, "Vile::Buffer")
X        `26`26 (vbp = (VileBuf *) SvIV((SV*)GvSV((GV*)SvRV(sv)))) != NULL)
X    `7B
X`09api_swscreen(NULL, vbp);
X    `7D
X    else `7B
X`09/* FIXME: Print out warning about reseting things */
X`09/* Reset to curbp */
X`09sv_setsv(svcurbuf, newVBrv(sv_2mortal(newSV(0)), api_bp2vbp(curbp)));
X    `7D
X    return 1;
X`7D
X
Xstatic int
Xperl_init(void)
X`7B
X    char *embedding`5B`5D = `7B "", "-e", "0" `7D;
X    char *bootargs`5B`5D  = `7B "Vile", NULL `7D;
X    SV   *svminibuf;
X    AV   *av;
X    SV   *sv;
X    int  len;
X    char  temp`5BNFILEN`5D;
X    char *vile_path;
X#ifdef _WIN32
X    const char *perl_subdir = "`5C`5Cperl";
X#else
X    const char *perl_subdir = "/perl";
X#endif
X    static char svcurbuf_name`5B`5D = "Vile::current_buffer";
X
X    perl_interp =\0E06alloc();
X    perl_construct(perl_interp);
X
X    if (perl_parse\0B06interp, xs_init, 3, embedding, NULL)) `7B
X`09perl_destruct(perl_interp);
X`09perl_free(perl_interp);
X`09perl_interp = NULL;
X`09return FALSE;
X    `7D
X    perl_call_argv("Vile::bootstrap", G_DISCARD, bootargs);
X
X    /* Add our own paths to the front of @INC */
X#ifdef HELP_LOC
X    av_unshift(av = GvAVn(incgv), 2);
X    av_store(av, 0, newSVpv(lengthen_path(strcpy(temp,"`7E/.vile/perl")),0));
V
X    sv = newSVpv(HELP_LOC,0);
X    sv_catpv(sv, "perl");
X    av_store(av, 1, sv);
X#endif
X    /* Always recognize environment variable */
X    if ((vile_path = getenv("VILE_LIBRARY_PATH")) != 0)
X    `7B
X`09/*
X`09 * "patch" @INC to look (first) for scripts in the directory
X`09 * %VILE_LIBRARY_PATH%`5C`5Cperl .
X`09 */
X`09len = strlen(vile_path) - 1;
X`09if (len >= 0 `26`26 is_slashc(vile_path`5Blen`5D))
X`09    vile_path`5Blen`5D = '`5C0'; /* Chop trailing path delim */
X`09av_unshift(av = GvAVn(incgv), 1);
X`09sv = newSVpv(vile_path, 0);
X`09sv_catpv(sv, perl_subdir);
X`09av_store(av, 0, sv);
X    `7D
X
X    /* Obtain handles to specific perl variables, creating them
X       if they do not exist. */
X    svcurbuf  = perl_get_sv(\1808_name,  TRUE);
X
X    svminibuf   = newVBrv(newSV(0), api_bp2vbp(bminip));
X
X    /* Tie STDOUT and STDERR to miniscr->PRINT() function */
X    sv_magic((SV *) gv_fetchpv("STDOUT", TRUE, SVt_PVIO), svminibuf, 'q',
X`09     Nullch, 0);
X    sv_magic((SV *) gv_fetchpv("STDERR", TRUE, SVt_PVIO), svminibuf, 'q',
X`09     Nullch, 0);
X    sv_magic((SV *) gv_fetchpv("STDIN", TRUE, SVt_PVIO), svminibuf, 'q',
X`09     Nullch, 0);
X
X    sv_magic(svcurbuf, NULL, '`7E', \1508_name, strlen\2B09_name));
X    mg_find(svcurbuf, '`7E')->mg_virtual = `26\1E08_accessors;
X    SvMAGICAL_on(svcurbuf);
X
X    /* Get sv for $/, the input record separator.  See comment
X       above (where svrs is declared) for why we don't use rs.  */
X    svrs = perl_get_sv("main::/", FALSE);
X
X    /* Some things are better (or easier) to do in perl... */
X    perl_eval_pv("$SIG`7B__WARN__`7D='Vile::Warn';"
X`09`09 "sub Vile::Buffer::PRINTF `7B"
X`09`09 "    my $fh=shift;\0E06mt\0F07"
X`09`09 "    print $fh sprintf($fmt,@_);"
X`09`09 "`7D", G_DISCARD);
X
X    /* Load user or system wide initialization script */
X    require("vileinit.pl", TRUE);
X    return TRUE;
X`7D
X
X/* Register any extra external extensions */
X
Xextern void boot_DynaLoader _((CV* cv));
Xextern void boot_Vile _((CV* cv));
X
Xstatic void
Xxs_init()
X`7B
X    char *file = __FILE__;
X    dXSUB_SYS;
X    newXS("DynaLoader::boot_\110A", \120F, file);
X    newXS("Vile::bootstrap", boot_Vile, file);
X`7D
X
X/*
X * Stringify a code ref so it may be called from vile.
X */
X
Xstatic char *CRfmtstr = "perl `5C"`26`7B$Vile::CRs`5B%d`5D`7D`5C"";
Xstatic AV *CRarray   = 0;
Xstatic int freeCRidx = 0;
X
Xstatic char *
Xstringify_coderef(SV *\0C07) `7B
X    char buf`5B40`5D;
X    int idx = 0;
X    int badstore = 0;
X
X    if (CRarray == 0) `7B
X`09/* Short name to keep the size of strings short on the vile side */
X`09CRarray = perl_get_av("Vile::CRs", TRUE);
X`09freeCRidx = -1;
X    `7D
X
X    if (freeCRidx >= 0) `7B
X`09SV **svp;
X`09idx = freeCRidx;
X`09svp = av_fetch(CRarray, (I32) idx, 0);
X`09if (svp == 0) `7B
X`09    /* Something's screwy... */
X`09    freeCRidx = -1;
X`09`7D
X`09else `7B
X`09    freeCRidx = SvIV(*svp);
X`09    SvREFCNT_dec(*svp);
X`09`7D
X`09if (av_store(CRarray, (I32) idx, SvREFCNT_inc(coderef)) == 0) `7B
X`09    badstore = 1;
X`09    SvREFCNT_dec(coderef);
X`09`7D
X    `7D
X
X    if (freeCRidx < 0 `7C`7C badstore) `7B
X`09av_push(CRarray, SvREFCNT_inc(coderef));
X`09idx = av_len(CRarray);
X    `7D
X
X    sprintf(buf, CRfmtstr, idx);
X    return strdup(buf);
X`7D
X
Xvoid
Xperl_free_callback(char *\0F08)
X`7B
X    int idx;
X    if (sscanf(callback, CRfmtstr, `26idx) == 1) `7B
X`09SV **svp;
X`09SV *svfreeCRidx;
X`09svp = av_fetch(CRarray, (I32) idx, 0);
X`09if (svp == 0)
X`09    return;`09/* Something screwy, bail... */
X
X`09if (!SvROK(*svp) `7C`7C SvTYPE(SvRV\1506) != SVt_PVCV)
X`09    return;`09/* Most likely freed already (?) */
X
X`09SvREFCNT_dec(*svp);`09/* This should deallocate it */
X
X`09svfreeCRidx = SvREFCNT_inc(newSViv(\2109));
X`09if (av_store(CRarray, (I32) idx, svfreeCRidx) == 0) `7B
X`09    /* Not successful (!) */
X`09    SvREFCNT_dec(svfreeCRidx);
X`09`7D
X`09else `7B
X`09    freeCRidx = idx;
X`09`7D
X    `7D
X`7D
X
X/*
X * Returns a line number given an SV.  '$' represents the last line
X * in the file. '$$' represents the line after\0F06ast line.  The
X * only time that '$' and '$$' represent the same line is when the
X * buffer is empty.
X */
X
Xstatic I32
Xsv2linenum(SV *sv)
X`7B
X    I32 linenum;
X
X    if (!SvIOKp(sv) `26`26 strcmp(SvPV(sv,na),"$") == 0) `7B
X`09linenum = line_count(curbp);
X    `7D
X    else if (!SvIOKp(sv) `26`26 strcmp(SvPV(sv,na),"$$") == 0) `7B
X`09linenum = line_count(curbp) + 1;
X    `7D
X    else `7B
X`09linenum = SvIV(sv);
X`09if (linenum < 1) `7B
X`09    linenum = 1;
X`09`7D
X`09else if (linenum > line_count(curbp)) `7B
X`09    linenum = line_count(curbp);
X`09`7D
X    `7D
X    return linenum;
X`7D
X
X
X/*
X * Returns an offset within the current line (where DOT is) given an
X * SV.  '$' represents the last non-newline character in\2206ine.  '$$'
X * represents the newline character.  The only time '$' and '$$' \3E09
X * the same position is when the line is empty.
X */
X
Xstatic I32
Xsv2offset(SV *sv)
X`7B
X    I32 offset;
X    if (!SvIOKp(sv) `26`26 strcmp(SvPV(sv,na),"$") == 0) `7B
X`09offset = llength(DOT.l) - 1;
X`09if (offset < 0)
X`09    offset = 0;
X    `7D
X    else if (!SvIOKp(sv) `26`26 strcmp(SvPV(sv,na),"$$") == 0) `7B
X`09offset = llength(DOT.l);
X    `7D
X    else `7B
X`09offset = SvIV(sv);
X`09if (offset < 0) `7B
X`09    offset = 0;
X`09`7D
X`09else if (offset > llength(DOT.l)) `7B
X`09    offset = llength(DOT.l);
X`09`7D
X    `7D
X    return offset;
X`7D
X
X/*
X * Fetch a line or portion thereof from the current buffer.  Like
X * api_dotgline(), except it's faster because it creates an SV of
X * the right size from the outset.  It's also faster because it
X * relies on the caller to set up the fake window properly.  (Not
X * a big deal if only getting a scalar, but it can be if fetching
X * an entire array.)
X *
X * Does not handle rectangular regions.
X *
X * Implementation notes:  In my first attempts at i\2F08ing these
X * functions, I used the region's end mark to determine when/where to
X * stop.  This usually worked, but there were times (particularly
X * when the inplace_edit flag was set to true)\2C0Aend marker
X * would either disappear entirely or \2306move to some undesirable
X * location.  I considered "fixing" the mark machinery so that it
X * would work as I desired.  The only problem with this is that my
X * attempts to do this could either destabilize the rest of the editor
X * or cause vile to be incompatible with real vi.
X *
X * So I decided that a lot of the code would be cleaner if I simply
X * gave up trying to use the end marker.  Instead I rely on the
X * length field, r_size, located in the region structure to determine
X * the right time to stop.  The only problem I see with this approach
X * is that motions could screw it up... but I suppose we can adjust
X * the r_size field in one way or another to account for this.
X *
X * In any event, I've decided that it is a bad idea to rely on
X * either of the marks once buffer modifications have started.
X */
X
Xstatic int
Xsvgetline(SV **svp, VileBuf *vbp, char *rsstr, int rslen)
X`7B
X    int len;
X    int nllen;
X    char *text;
X    SV *sv;
X    if (   is_header_line(DOT, curbp) `7C`7C vbp->region.r_size <= 0) `7B
X`09*svp = newSVsv(`26sv_undef);
X`09return FALSE;
X    `7D
X
X    len = llength(DOT.l) - DOT.o;
X    text = DOT.l->l_text + DOT.o;
X
X    if (len > vbp->region.r_size)
X`09len = vbp->region.r_size;
X
X    if (   vbp->region.r_size > 0
X        `26`26 (   lforw(DOT.l) != buf_head(curbp)
X`09    `7C`7C b_val(curbp, MDNEWLINE)))
X    `7B
X`09nllen = 1;
X`09DOT.o = 0;
X`09DOT.l = lforw(DOT.l);
X    `7D
X    else `7B
X`09nllen = 0;
X`09DOT.o += len;
X    `7D
X
X    vbp->region.r_size -= len + (nllen != 0);
X
X    if (vbp->inplace_edit)
X`09vbp->ndel += len + (nllen != 0);
X
X    if (len < 0)
X`09len = 0;`09`09/* shouldn't happen */
X
X    *svp = sv = newSV(len + nl\08061);`09/* +1 for `5C0 */
X
X    if (len > 0) `7B
X`09sv_setpvn(sv, text, len);
X`09if (nllen > 0)
X`09    sv_catpvn(sv, "`5Cn", 1);
X    `7D
X    else if (nllen > 0) `7B
X`09sv_setpvn(sv, "`5Cn", 1);
X    `7D
X    else `7B
X`09sv_setpvn(sv, "", 0);
X    `7D
X
X    return TRUE;
X`7D
X
X/*
X * Fetch an entire region (or remainder thereof).
X */
X
Xstatic int
Xsvgetregion(SV **svp, VileBuf *vbp, char *rsstr, int rslen)
X`7B
X    int len;
X    SV *sv;
X    LINEPTR lp;
X    int off;
X
X    if (is_header_line(DOT, curbp) `7C`7C vbp->region.r_size <= 0) `7B
X`09*svp = newSVsv(`26sv_undef);
X`09return FALSE;
X    `7D
X
X    len = vbp->region.r_size;
X    vbp->region.r_size = 0;
X
X    *svp = sv = newSV(len + 1);`09/* + 1 for `5C0 */
X    sv_setpvn(sv, "", 0);
X
X    if (vbp->inplace_edit)
X`09vbp->ndel += len;
X
X    lp = DOT.l;
X    off = DOT.o;
X    while (len > 0) `7B
X`09int clen = llength(lp) - off;
X
X`09if (clen > len)
X`09    clen = len;
X
X`09if (clen > 0) `7B
X`09    sv_catpvn(sv, lp->l_text + off, clen);
X`09    len -= clen;
X`09    off += clen;
X`09`7D
X
X`09if (len > 0) `7B
X`09    if (lforw(lp) != buf_head(curbp) `7C`7C b_val\1006, MDNEWLINE))
X`09`09sv_catpvn(sv, "`5Cn", 1);
X`09    len--;
X`09    off++;
X`09`7D
X
X`09if (off > llength(lp)) `7B
X`09    lp = lforw(lp);
X`09    off = 0;
X`09`7D
X    `7D
X    DOT.l = lp;
X    DOT.o = off;
X
X    return TRUE;
X`7D
X
X/*
X * Gets the next portion of a region up to\230Arecord separator
X * or the end of region, whichever comes first.
X */
X
Xstatic int
Xsvgettors(SV **svp, VileBuf *vbp, char *rsstr, int rslen)
X`7B
X    int len, reglen;
X    SV *sv;
X    int rs1;
X    int orig_rslen = rslen;
X    LINEPTR lp;
X    int off;
X
X
X    /* See if we're already at the end of the region and have nothing
X       to do. */
X    if (is_header_line(DOT, curbp) `7C`7C vbp->region.r_size <= 0) `7B
X`09*svp = newSVsv(`26sv_undef);
X`09return FALSE;
X    `7D
X
X    /* Adjust rsstr if need be */
X    if (rslen == 0) `7B
X`09rsstr = "`5Cn`5Cn";
X`09rslen = 2;
X    `7D
X
X    /* Get first separator character */
X    rs1 = *rsstr;
X
X    /* Compute length of region up to record separator or til
X       end of region, whichever comes first */
X    lp  = DOT.l;
X    off = DOT.o;
X    len = 0;
X    reglen = vbp->region.r_size;
X    for (;;) `7B
X`09int loff;
X`09int cont_off;
X`09LINEPTR cont_lp;
X`09int fidx;
X`09int rsidx;
X
X`09if (off > llength(lp)) `7B
X`09    off = 0;
X`09    lp = lforw(lp);
X`09`7D
X
X`09if (lp == buf_head(curbp) `7C`7C len >= reglen)
X`09    goto have_length;
X
X`09/* loff is the last offset that we'll do our initial search
X`09   to on this line */
X`09loff = llength(lp);
X`09if (loff - off > reglen - len)
X`09    loff = off + reglen - len;
X
X`09/* Try to find the first record separator character */
X`09if (rs1 == '`5Cn') `7B
X`09    /* newline; no searching needed, must be at end of line */
X`09    if (loff < llength(lp)) `7B
X`09`09len += loff;
X`09`09goto have_length;
X`09    `7D
X`09    else
X`09`09fidx = loff;
X`09`7D
X`09else `7B
X`09    /* Gotta search */
X`09    for (fidx = off; fidx < loff `26`26 lp->l_text`5Bfidx`5D != rs1\2806++)
V
X`09`09;
X`09    if (fidx >= loff) `7B
X`09`09if (loff < llength(lp)) `7B
X`09`09    len += loff;
X`09`09    goto have_length;
X`09`09`7D
X`09`09len += loff - off + 1;
X`09`09off = loff + 1;
X`09`09continue;
X`09    `7D
X`09`7D
X
X`09/* If we get to this point, fidx\0C06s at first character in
X`09   the record separator. */
X`09len += fidx - off + 1;
X`09cont_lp = lp;
X`09cont_off = fidx + 1;
X
X`09/* Attempt to match the rest of\0C07cord separator */
X`09for (rsidx = 1; \0B06< rslen\0F07++) `7B
X`09    fidx++;
X`09    if (fidx >= llength(lp)) `7B
X`09`09lp = lforw(lp);
X`09`09fidx = 0;
X`09    `7D
X`09    if (lp == buf_head(curbp) `7C`7C len + rsidx - 1 >= reglen) `7B
X`09`09off = fidx;
X`09`09len += rsidx - 1;
X`09`09goto have_length;
X`09    `7D
X`09    if (rsstr`5Brsidx`5D == '`5Cn') `7B
X`09`09if (fidx < llength(lp))
X`09`09    break;
X`09    `7D
X`09    else if (rsstr`5Brsidx`5D != lp->l_text`5Bfidx`5D)
X`09`09break;
X`09`7D
X
X`09if (rsidx >= rslen) `7B
X`09    len += rslen - 1;
X`09    off = fidx;
X`09    goto have_length;
X`09`7D
X`09lp = cont_lp;
X`09off = cont_off;
X    `7D
Xhave_length:
X
X    /* See if we have the special paragraph separator and if so, consume
X       as many additional newlines as we can */
X    if (orig_rslen == 0) `7B
X`09lp = lforw(lp);
X`09off = 0;
X`09while (   ! (lp == buf_head(curbp) `7C`7C len >= reglen)
X`09       `26`26 llength(lp) == 0)
X`09`7B
X`09    len++;
X`09    lp = lforw(lp);
X`09    off = 0;
X`09`7D
X    `7D
X
X    /* Make sure there's still something left to return */
X    if (len <= 0) `7B
X`09*svp = newSVsv(`26sv_undef);
X`09return FALSE;
X    `7D
X
X    vbp->region.r_size -= len;
X
X    /* Now copy the region over to the SV... */
X    *svp = sv = newSV(len + 1);`09/* + 1 for `5C0 */
X    sv_setpvn(sv, "", 0);
X
X    if (vbp->inplace_edit)
X`09vbp->ndel += len;
X
X    lp = DOT.l;
X    off = DOT.o;
X    while (len > 0) `7B
X`09int clen = llength(lp) - off;
X
X`09if (clen > len)
X`09    clen = len;
X
X`09if (clen > 0) `7B
X`09    sv_catpvn(sv, lp->l_text + off, clen);
X`09    len -= clen;
X`09    off += clen;
X`09`7D
X
X`09if (len > 0) `7B
X`09    if (lforw(lp) != buf_head(curbp) `7C`7C b_val\1006, MDNEWLINE))
X`09`09sv_catpvn(sv, "`5Cn", 1);
X`09    len--;
X`09    off++;
X`09`7D
X
X`09if (off > llength(lp)) `7B
X`09    lp = lforw(lp);
X`09    off = 0;
X`09`7D
X    `7D
X    DOT.l = lp;
X    DOT.o = off;
X
X    return TRUE;
X`7D
X
X
XMODULE = Vile`09PACKAG\0F08
X
XPROTOTYPES: DISABLE
X
X  #
X  # =back
X  #
X  # =head2 Loading Perl Modules from Vile
X  #
X  # A perl module that is usable by vile should probably be
X  # located some place on the @INC path.  For vile,\1A09
X  # array has been augmented to include $HOME/.vile/perl and
X  # /usr/local/share/vile.  (This latter path may differ depending
X  # upon your machine and configuration options.)  If you want to
X  # see what exactly\0D06these paths are, just issue the following
X  # command from within vile:
X  #
X  #     :perl print join ':', @INC`5B0,1`5D
X  #
X  # Let us suppose that the following script is stored in
X  # $HOME/.vile/perl/number_lines.pl.
X  #
X  #     sub number_lines `7B
X  #         my ($lnum, $width) = @_;
X  #
X  #         $lnum = 1 unless defined($lnum);
X  #         $width = 4 unless defined(\1A06);
+-+-+-+-+-+-+-+-  END  OF PART 92 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 93 -+-+-+-+-+-+-+-+
X  #
X  #         $Vile::current_buffer->inplace_edit(1);
X  #
X  #         while (<$Vile::current_buffer>) `7B
X  #             print $Vile::current_buffer
X  #        \0808   ' ' x ($width - length($lnum) - 1),
X  #        \0808   $lnum, ' ', $_;
X  #             $lnum++;
X  #         `7D
X  #     `7D
X  #
X  #     1;
X  #
X  # Note the trailing "1;" at the end.  The reason for this is so
X  # that I<true> is returned as the result of the script.  If things
X  # are not done this way, the loading mechansim might flag an
X  # error.  (All it needs to do is return a true value somehow.)
X  #
X  # Assuming the above code has been placed in the file
X  # 'number_lines.pl', the following vile command may be used
X  # to load it:
X  #
X  #         :perl require 'number_lines.pl'
X  #
X  # When writing a new script, I will often test it in the same
X  # editor session that I've created the script in.  My\0F07
X  # may have a bug in it and I'll fix it.  In order to reload
X  # the script, you can do the following:
X  #
X  #         :perl do 'number_lines.pl'
X  #
X  # Perl's builtin 'require' function wouldn't have worked to
X  # reload the file because it keeps track of files that have
X  # been loaded via this facility and refuses to load a file
X  # twice.  The 'do' function on the other hand is a more general
X  # facility for executing the contents of a file and doesn't
X  # care how often it's called.
X  #
X  # Caveat: Sometimes it's better to start with a clean slate,
X  # particularly if you've renamed your subroutines or if there
X  # are global variables involved.  Just start a fresh copy of
X  # vile and start over.
X  #
X  # Now to invoke our number_lines program, we do it as follows:
X  #
X  #         :perl number_lines(1)
X  #
X  # It is also possible to use vile's builtin macro language to
X  # load perl modules and call them.  The hgrep.p\2508 comes
X  # with the I<vile> distribution.  You may want to put this
X  # macro in your F<.vilerc> file:
X  #
X  #     store-procedure hgrep
X  #         perl "require 'hgrep.pl'"
X  #         perl hgrep
X  #         error-buffer $cbufname
X  #     `7Eendm
X  #
X  # Notice that there are two perl commands in the above macro.
X  # The first will make sure that the script hgrep.pl is loaded.
X  # The second will actually call the main subroutine of the
X  # script.
X  #
X  # See also the Vile::C<register> functions.
X  #
X
X
XMODULE = Vile`09PACKAG\0F08
X
X  #
X  # =head2 Package Vile
X  #
X  # The B<Vile> package contains subroutines and methods of a
X  # general nature.  They range from providing an interface to
X  # I<vile's> modes to providing facilities for obtaining user input.
X  #
X  # =head2 Package Vile Subroutines and Methods
X  #
X  # =over 4
X  #
X
Xvoid
XWarn(warning)
X    char *warning
X
X    CODE:
X`09write_message(GvSV(errgv));
X`09sv_catpv(GvSV(errgv),warning);
X
X  #
X  # =item beep
X  #
X  # Rings terminal bell (or equivalent).
X  #
X
Xvoid
Xbeep()
X    CODE:
X    `09kbd_alarm();
X
X  #
X  # =item buffers
X  #
X  # Returns a list of the editor's buffers.
X  #
X
Xvoid
Xbuffers(...)
X
X    PREINIT:
X`09BUFFER *bp;
X
X    PPCODE:
X
X`09if (! (items == 0
X`09       `7C`7C (items == 1 `26`26 strcmp(SvPV(ST(0), na), "Vile") == 0)) )
X`09`7B
X`09    /* Must be called as either Vile::buffers() o\1306->\130A*/
X`09    croak("buffers: called with too many arguments");
X`09`7D
X
X`09for_each_buffer(bp) `7B
X`09    XPUSHs(sv_2mortal(newVBrv(newSV(0), api_bp2vbp(bp))));
X`09`7D
X
X  #
X  # =item command CMDLINE
X  #
X  # executes the given vile command line (as if it were typed on the :
X  # line).
X  #
X  # This is not exactly safe in all contexts.  (It is easy to cause
X  # seg faults.) If you need access to some portion of vile that would
X  # lead you to want to use this subroutine, let me know and I will
X  # work on suitable facilities.
X  #
X
Xint
Xcommand(cline)
X    char *cline
X
X    PREINIT:
X    `09int old_discmd;
X
X    CODE:
X`09old_discmd = \0906;
X`09discmd = FALSE;
X`09RETVAL = docmd(cline, TRUE, FALSE, 1);
X`09discmd = old_\0D06;
X
X    OUTPUT:
X`09RETVAL
X
X  #
X  # =item keystroke
X  #
X  # =item keystroke WAITVAL
X  #
X  # Returns a single, fairly raw keystroke from the keyboard.
X  #
X  # The optional WAITVAL indicates if the editor should wait for the
X  # next keystroke.  When WAITVAL is false, undef will
X  # be returned if no input is ready.
X  #
X
Xvoid
Xkeystroke(...)
X
X    PREINIT:
X    `09int noget;
X    PPCODE:
X`09if (items > 1)
X`09    croak("Too many arguments to keystroke");
X
X`09curwp = curwp_visible ?\100F:\2006;
X`09curbp = curwp->w_bufp;
X
X`09noget = FALSE;
X
X`09if (items == 1 `26`26 !SvTRUE(ST(0))) `7B
X`09    if (!sysmapped_c_avail()) `7B
X`09`09XPUSHs(`26sv_undef);
X`09`09noget = TRUE;
X`09    `7D
X`09`7D
X
X`09if (!noget)
X`09    XPUSHs(sv_2mortal(newSViv(sysmapped_c())));
X
X`09curwp_visible = curwp;
X
X  #
X  # =item mlreply PROMPT
X  #
X  # =item mlreply PROMPT, INITIALVALUE
X  #
X  # Prompts the user with the given prompt and (optional) supplied
X  # initial value.  Certain characters that the user may input have
X  # special meanings to mlreply and may have to be escaped by the
X  # user to be input.  If this is unacceptable, use mlreply_no_opts
X  # instead.
X  #
X  # Returns the user's response string.  If\2009 aborts
X  # (via the use of the escape key) the query, an undef is
X  # returned.
X  #
X
Xvoid
Xmlreply(prompt, ...)
X    char *prompt
X
X    PREINIT:
X`09char buf`5BNLINE`5D;
X`09int status;
X
X    PPCODE:
X`09if (items == 2) `7B
X`09    strncpy(buf, SvPV(ST(1),na), NLINE-1);
X`09    buf`5BNLINE-1`5D = EOS;
X`09`7D
X`09else if (items > 2)
X`09    croak("Too many arguments to mlreply");
X`09else
X`09    buf`5B0`5D = EOS;
X
X`09status = mlreply(prompt, buf, sizeof(buf));
X#if OPT_HISTORY
X`09if (status == TRUE)
X`09    hst_glue('`5Cr');
X#endif
X`09XPUSHs((status == TRUE `7C`7C \120AFALSE)
X`09         ? sv_2mortal(newSVpv(buf, 0))
X`09`09 : `26sv_undef);
X
X
X  #
X  # =item mlreply_dir PROMPT
X  #
X  # =item mlreply_dir PROMPT, INITIALVALUE
X  #
X  # Prompts the user for a directory name with the given prompt
X  # and (optional) initial value.  Filename completion (via the
X  # TAB key, if enabled) may be used to assist in entering
X  # the directory name.
X  #
X  # Returns the user's response string.  If\2009 aborts
X  # (via the use of the escape key) the query, an undef is
X  # returned.
X  #
X
Xvoid
Xmlreply_dir(prompt, ...)
X    char *prompt
X
X    PREINIT:
X`09char buf`5BNFILEN`5D;
X`09static TBUFF *last;
X`09int status;
X
X    PPCODE:
X`09if (items == 2) `7B
X`09    tb_scopy(`26last, SvPV(ST(1),na));
X`09`7D
X`09else if (items > 2) `7B
X`09    croak("Too many arguments to mlreply_dir");
X`09`7D
X
X`09buf`5B0`5D = EOS;
X`09status = mlreply_dir(prompt, `26last, buf);
X#if OPT_HISTORY
X`09if (status == TRUE)
X`09    hst_glue('`5Cr');
X#endif
X`09XPUSHs((status == TRUE `7C`7C \120AFALSE)
X`09         ? sv_2mortal(newSVpv(buf, 0))
X`09`09 : `26sv_undef);
X
X
X  #
X  # =item mlreply_file PROMPT
X  #
X  # =item mlreply_file PROMPT, INITIALVALUE
X  #
X  # Prompts the user for a filename with the given prompt and
X  # (optional) initial value.  Filename completion (via the
X  # TAB key, if enabled) may be used to assist in entering
X  # the filename.
X  #
X  # Returns the user's response string.  If\2009 aborts
X  # (via the use of the escape key) the query, an undef is
X  # returned.
X  #
X
Xvoid
Xmlreply_file(prompt, ...)
X    char *prompt
X
X    PREINIT:
X`09char buf`5BNFILEN`5D;
X`09static TBUFF *last;
X`09int status;
X
X    PPCODE:
X`09if (items == 2) `7B
X`09    tb_scopy(`26last, SvPV(ST(1),na));
X`09`7D
X`09else if (items > 2) `7B
X`09    croak("Too many arguments to mlreply_file");
X`09`7D
X
X`09buf`5B0`5D = EOS;
X`09status = mlreply_file(prompt, `26last, FILEC_UNKNOWN, buf);
X#if OPT_HISTORY
X`09if (status == TRUE)
X`09    hst_glue('`5Cr');
X#endif
X`09XPUSHs((status == TRUE `7C`7C \120AFALSE)
X`09         ? sv_2mortal(newSVpv(buf, 0))
X`09`09 : `26sv_undef);
X
X
X  #
X  # =item mlreply_no_opts PROMPT
X  #
X  # =item mlreply_no_opts PROMPT, INITIALVALUE
X  #
X  # Prompts the user with the given prompt and (optional) supplied
X  # initial value.  All printable characters may be entered by the
X  # without any special escapes.
X  #
X  # Returns the user's response string.  If\2009 aborts
X  # (via the use of the escape key) the query, an undef is
X  # returned.
X  #
X
Xvoid
Xmlreply_no_opts(prompt, ...)
X    char *prompt
X
X    PREINIT:
X`09char buf`5BNLINE`5D;
X`09int status;
X
X    PPCODE:
X`09if (items == 2) `7B
X`09    strncpy(buf, SvPV(ST(1),na), NLINE-1);
X`09    buf`5BNLINE-1`5D = EOS;
X`09`7D
X`09else if (items > 2)
X`09    croak("Too many arguments to mlreply_no_opts");
X`09else
X`09    buf`5B0`5D = EOS;
X
X`09status = mlreply_no_opts(prompt, buf, sizeof(buf));
X#if OPT_HISTORY
X`09if (status == TRUE)
X`09    hst_glue('`5Cr');
X#endif
X`09XPUSHs((status == TRUE `7C`7C \120AFALSE)
X`09         ? sv_2mortal(newSVpv(buf, 0))
X`09`09 : `26sv_undef);
X
X
X #
X # =item selection_buffer
X #
X # =item selection_buffer BUFOBJ
X #
X # =item Vile::Buffer::set_selection BUFOBJ
X #
X # Gets or sets the buffer associated with the current selection.
X #
X # When getting the selection, the buffer object that has the current
X # selection is returned and its reg\1B07set to be the same \1D06
X # as is occupied by the selection.  If there is no current\230A, undef
X # is returned.
X #
X # When setting the selection, a buffer object must be passed in.  The
X # editor's selection is set to the region associated with the buffer object.
V
X # If successful, the buffer object is returned; otherwise undef will be
X # returned.
X #
X # Examples:
X #
X #      $sel = Vile->selection_buffer->fetch;
X #        \0808\1010\2006# Put the current selection in $sel
X #
X #      Vile->selection_buffer($Vile::current\1607);
X #        \0808\1010\2006# Set the selection to the region
X #        \0808\1010\2006# contained in the current buffer
X #
X # Vile::Buffer::set_selection is an alias for\2C07\2009_buffer, but
X # can only function as a setter.  It may be used like this:
X #
X #      Vile->current_buffer->set_region('w')\1106selection;
X #        \0808\1010\2006# set the selection to be the word
X #        \0808\1010\2006# starting at the current position
X #        \0808\1010\2006# in the current buffer
X #
X #      Vile->current_buffer->motion('?`5C/`5C*' . "`5Cn")
X #        \0808\100A->set_region('%')
X #        \0808\100A->set_selection();
X #        \0808\1010\2006# set the selection to be the nearest
X #        \0808\1010\2006# C-style comment above or at the
X #        \0808\1010\2006# current position.
X #
X
Xvoid
Xselection_buffer(...)
X
X    ALIAS:
X`09Vile::Buffer::set_selection = 1
X
X    PREINIT:
X`09int argno;
X
X    PPCODE:
X#if OPT_SELECTIONS
X`09argno = 0;
X
X`09if (strcmp(SvPV(ST(argno), na), "Vile") == 0)
X`09    argno++;
X
X`09if (items - argno == 0) `7B /* getter */
X`09    BUFFER *bp;
X`09    AREGION aregion;
X
X`09    bp = get_selection_buffer_and_region(`26a\0906);
X`09    if (bp != NULL) `7B
X`09`09VileBuf *vbp = api_bp2vbp(bp);
X`09`09vbp->region = a\0A06.ar_\1406;
X`09`09vbp->regionshape =  a\1006.ar_shape;
X`09`09XPUSHs(sv_2mortal(newVBrv(newSV(0), vbp)));
X`09    `7D
X`09    else `7B
X`09`09XPUSHs(`26sv_undef);
X`09    `7D
X`09`7D
X`09else if (items - argno == 1) `7B /* setter */
X`09    VileBuf *vbp;
X`09    char *croakmess;
X`09    /* Need a buffer object */
X`09    vbp = getVB(ST(argno), `26croakmess);
X
X`09    if (vbp == 0)
X`09`09croak("Vile::%sselection: %s",
X`09`09      ix == 1 ? "Buffer::" : "",
X`09`09      croakmess);
X`09    api_setup_fake_win(vbp, TRUE);
X`09    DOT = vbp->region.r_orig;
X`09    sel_begin();
X`09    DOT = vbp->region.r_end;
X`09    if (sel_extend(FALSE, FALSE) == TRUE) `7B
X`09`09XPUSHs(ST(argno));
X`09    `7D
X`09    else `7B
X`09`09XPUSHs(`26sv_undef);
X`09    `7D
X`09`7D
X`09else `7B
X`09    croak("Vile::selection: Incorrect number of arguments");
X`09`7D
X#else
X`09croak("%s requires vile to be compiled with OPT_SELECTIONS",
X`09      GvNAME(CvGV(cv)));
X#endif
X
X #
X # =item set PAIRLIST
X #
X # =item get LIST
X #
X # =item Vile::Buffer::set BUFOBJ PAIRLIST
X #
X # =item Vile::Buffer::get BUFOBJ LIST
X #
X # Provides access to Vile's various modes, buffer and otherwise.
X #
X # For the set methods, PAIRLIST should be a list of key => value
X # pairs, where key is a mode name and value is an appropriate value
X # for that mode.  When used in an array context, the resulting key =>
X # value pairs are returned.  (The \2006may be a different, but
X # equivalent string than originally specified.) When used in an array
X # context, either the package name or buffer object is returned
X # (depending on how it was invoked) in order that the result may be
X # used as the target of further method calls.
X #
X # When one of the get forms is used, a list of modes should be
X # supplied.  When used in an array context, a list of key => value
X # pairs is returned.  When used in a scalar context, only one mode
X # name may be supplied and the value associated with this mode is
X # returned.
X #
X # The methods in Vile::Buffer attempt to get the local modes
X # associated with the buffer (falling back to the global ones if no
X # specific local mode has been\1D08ed up to this point).
X #
X # Note:  Access to certain internal attributes such as the buffer
X # name and file \0E06re not provided via this mechanism yet.  There
X # is no good reason for this other than that vile does not provide
X # access to these attributes via its set command.
X #
X
Xvoid
Xset(...)
X
X    ALIAS:
X`09Vile::get = 1
X`09Vile::Buffer::set = 2
X`09Vile::Buffer::get = 3
X
X    PREINIT:
X`09int argno;
X`09int isglobal;
X`09int issetter;
X`09char *mode;
X`09int status;
X`09VALARGS args;
X`09I32 gimme;
X`09char **modenames;
X`09int nmodenames = 0;
X
X    PPCODE:
X#if OPT_EVAL
X`09argno    = 0;
X`09isglobal = (ix == 0 `7C`7C \0B061);
X`09issetter = (ix == 0 `7C`7C \0B062);
X`09gimme    = GIMME_V;
X`09mode     = NULL;`09`09/* just in case it never gets set */
X
X`09if (!isglobal /* one of the Vile::Buffer methods */) `7B
X`09    char *croakmess;
X`09    VileBuf *vbp;
X
X`09    /* Need a buffer object */
X`09    vbp = getVB(ST(argno), `26croakmess);
X`09    argno++;
X
X`09    if (vbp == 0)
X`09`09croak("Vile::Buffer::set: %s", croakmess);
X
X`09    isglobal = 0;
X`09    api_setup_fake_win(vbp, TRUE);
X`09`7D
X`09else `7B
X`09    /* We're in the Vile package.  See if we're called via
X`09       Vile->set */
X`09    if (strcmp(SvPV(ST(argno), na), "Vile") == 0)
X`09`09argno++;
X`09`7D
X
X`09nmodenames = 0;
X`09modenames = NULL;
X`09if (gimme == G_ARRAY) `7B
X`09    int n = items - argno + 1;`09`09/* +1 in case of odd set */
X`09    if (!issetter)
X`09`09n *= 2;
X`09    if (n > 0) `7B
X`09`09modenames = typeallocn(char *, n);
X`09`09if (modenames == NULL)
X`09`09    croak("Can't allocate space");
X`09    `7D
X`09`7D
X
X`09while (argno < items) `7B
X`09    mode = SvPV(ST(argno), na);
X`09    argno++;
X
X`09    /* Look for a mode first */
X`09    status = find_mode(mode, isglobal, `26args);
X
X
X`09    if (status == TRUE) `7B
X`09`09if (modenames)
X`09`09    modenames`5Bn\0B09++`5D = mode;
X
X`09`09if (issetter) `7B
X`09`09    char *val;
X`09`09    val = NULL;
X`09`09    if (argno >= items) `7B
X`09`09`09if (args.names->type == VALTYPE_BOOL) `7B
X`09`09`09    val = "1";
X`09`09`09`7D
X`09`09`09else `7B
X`09`09`09    if (modenames) free\100B;
X`09`09`09    croak("set: value required for %s", mode);
X`09`09`09`7D
X`09`09    `7D
X`09`09    else `7B
X`09`09`09val = SvPV(ST(argno), na);
X`09`09`09argno++;
X`09`09    `7D
X
X`09`09    if (set_mode_value(mode, TRUE, isglobal, `26args, val) != TRUE) `7B
V
X`09`09`09if (modenames) free\100B;
X`09`09`09croak("set: Invalid value %s for mode %s", val, mode);
X`09`09    `7D
X`09`09`7D
X`09    `7D else `7B
X`09`09char *val;
X`09`09val = gtenv(mode);
X`09`09if (val == errorm) `7B
X`09`09    if (modenames)
X`09`09`09free(modenames);
X`09`09    croak("set: Invalid mode or variable %s", mode);
X`09`09`7D
X
X`09`09if (modenames)
X`09`09    modenames`5Bn\0B09++`5D = mode;
X
X`09`09if (issetter) `7B
X`09`09    if (argno >= items) `7B
X`09`09`09if (modenames) free\100B;
X`09`09`09croak("set: value required for %s", mode);
X`09`09    `7D
X`09`09    else `7B
X`09`09`09val = SvPV(ST(argno), na);
X`09`09`09argno++;
X`09`09    `7D
X`09`09    status = stenv(mode, val);
X
X`09`09    if (status != TRUE) `7B
X`09`09`09if (modenames) free\100B;
X`09`09`09croak("set: Unable to set variable %s to value %s",
X`09`09`09      mode, val);
X`09`09    `7D
X`09`09`7D
X`09    `7D
X`09`7D
X
X`09if (modenames == NULL) `7B
X`09    if (issetter) `7B
X`09`09if (isglobal)
X`09`09    XPUSHs(sv_2mortal(newSVpv("Vile", 0)));
X`09`09else
X`09`09    XPUSHs(ST(0));`09/* Buffer object */
X`09    `7D
X`09    else `7B
X`09`09if (mode != NULL) `7B
X`09`09    status = find_mode(mode, isglobal, `26args);
X`09`09    if (status == TRUE)
X`09`09`09XPUSHs(sv_2mortal(newSVpv(string_mode_val(`26args), 0)));
X`09`09    else
X`09`09`09XPUSHs(sv_2mortal(newSVpv(gtenv(mode), 0)));
X`09`09`7D
X`09    `7D
X`09`7D
X`09else `7B
X`09    int i;
X`09    for (i = 0; i < nmodenames; i++) `7B
X`09`09mode = modenames`5Bi`5D;
X`09`09status = find_mode(mode, isglobal, `26args);
X`09`09if (status == TRUE) `7B
X`09`09    XPUSHs(sv_2mortal(newSVpv(mode, 0)));
X`09`09    XPUSHs(sv_2mortal(newSVpv(string_mode_val(`26args), 0)));
X`09`09`7D
X`09`09else `7B
X`09`09    XPUSHs(sv_2mortal(newSVpv(mode, 0)));
X`09`09    XPUSHs(sv_2mortal(newSVpv(gtenv(mode), 0)));
X`09`09`7D
X`09    `7D
X`09    free(modenames);
X`09`7D
X#else
X`09croak("%s requires vile to be compiled with OPT_EVAL",
X`09      GvNAME(CvGV(cv)));
X#endif
X
X  #
X  # =item update
X  #
X  # Update the editor's display.  It is usually not necessary to
X  # call this if you're returning to the editor in fairly short
X  # order.  It will be necessary to call this, for example, if
X  # you write an input loop in perl which\2206s things to some
X  # on-screen buffers, but does not return to the editor immediately.
X  #
X
Xvoid
Xupdate(void)
X    PPCODE:
X`09api_update();
X
X  #
X  # =item working
X  #
X  # =item working VAL
X  #
X  # Returns value 1 if working message will be printed during
X  # substantial pauses, 0 if disabled.
X  #
X  # When passed an argument, modifies value of the working message.
X  #
X
Xint
Xworking(...)
X
X    CODE:
X`09if (items > 1)
X`09    croak("Too many arguments to working");
X`09else if (items == 1) `7B
X#if OPT_WORKING
X`09    no_working = !SvIV(ST(0));
X#endif
X`09`7D
X#if OPT_WORKING
X`09RETVAL = !no_working;
X#else
X`09RETVAL = 0;
X#endif
X    OUTPUT:
X`09RETVAL
X
X  #
X  # =item register NAME, `5BSUB, HELP, REQUIRE`5D
X  #
X  # Register a subroutine SUB as Vile function NAME.  Once r\3707ed,
X  # the subroutine may then be invoked as a named command and bound to
X  # keystrokes.
X  #
X  # SUB may be given either as a string to eval, or a reference to a
X  # subroutine.  If omitted, SUB defaults to NAME.
X  #
X  # HELP provides a description of the subroutine for the `5BBinding
X  # List`5D functions.
X  #
X  # An optional file to require may be given.
X  #
X  # Example:
X  #
X  #     Vile::register grep => 'hgrep', 'recursive grep', 'hgrep.pl';
X  #
X  # or
X  #
X  #     require 'hgrep.pl';
X  #     Vile::register grep => `5C`26hgrep, 'recursive grep';
X  #
X  # also
X  #
X  #     sub foo `7B print "foo" `7D
X  #     Vile::register 'foo';
X  #     Vile::register bar => 'print "bar"';
X  #     Vile::register quux => sub `7B print "quux" `7D;
X  #
X  # =item register_motion NAME, `5BSUB, HELP, REQUIRE`5D
X  #
X  # =item register_oper NAME, `5BSUB, HELP, REQUIRE`5D
X  #
X  # These synonyms for Vile::C<register> allow perl subroutines to
X  # behave as motions and operators.  For example, these subroutines
X  # behave like their builtin counterparts:
X  #
X  #     *cb = `5C$Vile::current_buffer;
X  #     Vile::register_motion 'my-forward-line-at-bol' => sub `7B
X  #         $cb->dot((scalar\1109) + 1, 0);
X  #     `7D;
X  #
X  #     Vile::register_oper 'my-delete-til' => sub `7B $cb->\1A06 `7D;
X  #
X
Xvoid
Xregister(name, ...)
X    char *name
X
X    ALIAS:
X`09register_motion = MOTION
X`09register_oper = OPER
X
X    PREINIT:
X`09CMDFUNC *cmd;
X`09AV *av;
X`09char *p;
X
X    PPCODE:
X#if OPT_NAMEBST
X`09if (items > 4)
X`09    croak("Too many arguments to %s", GvNAME(CvGV(cv)));
X
X`09for (p = name; *p; p++)
X`09    if (!isalnum(*p) `26`26 *p != '-'\0D0B_')
X`09`09croak("invalid subroutine name");
X
X`09if (!(cmd = typealloc(CMDFUNC)))
X`09    croak("Can't allocate space");
X
X`09cmd->cu.c_perl = av = newAV();
X`09cmd->c_flags = REDO`7CUNDO`7CVIEWOK`7CCMD_PERL`7Cix;
X#if OPT_ONLINEHELP
X`09cmd->c_help = strmalloc((items > 2 `26`26 SvTRUE(ST(2)))
X`09`09&0209? SvPV(ST(2), na)
X`09`09&0209: "Perl subroutine");
X#endif
X
X`09if (insert_namebst(name, cmd, FALSE) != TRUE)
X`09`7B
X#if OPT_ONLINEHELP
X`09    free((char *) cmd->c_help);
X#endif
X`09    free(cmd);
X`09    av_undef(av);
X`09`7D
X`09else
X`09`7B
X`09    /* push the name */
X`09    av_push(av, newSVpv(name, 0));
X
X`09    /* push the subroutine */
X`09    if (items > 1 `26`26 SvTRUE(ST(1)))
X`09    `7B
X`09`09SvREFCNT_inc(ST(1));
X`09`09av_push(av, ST(1));
X
X`09`09/* push the require */
X`09`09if (items > 3 `26`26 SvTRUE(ST(3)))
X`09`09`7B
X`09`09    SvREFCNT_inc(ST(3));
X`09`09    av_push(av, ST(3));
X`09`09`7D
X`09    `7D
X`09    else /* sub = name */
X`09`09av_push(av, newSVpv(name, 0));
X`09`7D
X#else
X`09croak("%s requires vile to be compiled with OPT_NAMBST",
X`09      GvNAME(CvGV(cv)));
X#endif
X
X  #
X  # =item watchfd FD, WATCHTYPE, CALLBACK
X  #
X  # Adds a callback so that when the file descriptor FD is available
X  # for a particular type of I/O activity (specified by WATCHTYPE),
X  # the callback associated with CALLBACK is called.
X  #
X  # WATCHTYPE must be one of 'read', 'write', or 'except' and have
X  # the obvious meanings.
X  #
X  # The callback should either be a string representing a vile
X  # command to execute (good luck) or (more usefully) a Perl subroutine
X  # reference.
X  #
X
Xvoid
Xwatchfd(fd, watchtypestr, ...)
X    int fd
X    char *watchtypestr
X
X    PREINIT:
X`09char *cmd;
X`09int   watchtype;
X
X
X    PPCODE:
X`09if (items != 3)
X`09    croak("Wrong number of arguments to watchfd");
X
X`09if (strcmp(watchtypestr, "read") == 0)
X`09    watchtype = WATCHREAD;
X`09else if (strcmp(watchtypestr, "write") == 0)
X`09    watchtype = WATCHWRITE;
X`09else if (strcmp(watchtypestr, "except") == 0)
X`09    watchtype = WATCHEXCEPT;
X`09else
X`09    croak("Second argument to watchfd must be one of `5C"read`5C", `5C"writ
Ve`5C", or `5C"except`5C".");
X
X`09if (SvROK(ST(2))
X`09    `26`26 SvTYPE(SvRV(ST(2))) == SVt_PVCV)
X`09`7B
X`09    /* We have a code ref (cool) */
X`09    cmd = stringify_coderef(ST(2));
X`09`7D
X`09else `7B
X`09    /* It's just a string (how boring) */
X`09    cmd = strdup(SvPV(ST(2),na));
X`09`7D
X`09watchfd(fd, watchtype, cmd);
X
X  #
X  # =item unwatchfd FD
X  #
X  # Removes the callback associated with FD and frees up the
X  # associated data structures.
X  #
X
Xvoid
Xunwatchfd(fd)
X    int fd
X
X    PPCODE:
X`09unwatchfd(fd);
X
X
XMODULE = Vile`09PACKAG\0F08::Buffer
X
X  #
X  # =back
X  #
X  # =head2 Package Vile::Buffer
X  #
X  # The Vile::Buffer package contains methods for creating new buffers
X  # and for accessing already existing buffers in various ways.
X  #
X  # A Vile::Buffer object may be viewed as a filehandle.  Therefore,
X  # the usual sorts of methods for reading from and writing to
X  # filehandles will work as expected.
X  #
X  # Example:
X  #
X  # A word count program that you might invoke from your favorite
X  # shell could be written as follows:
X  #
X  #     #!/usr/local/bin/perl -w
X  #
X  #     my $words;
X  #     while (<>) `7B
X  #         $words += split;
X  #     `7D
X  #     print "$words words`5Cn";
X  #
X  # A programmer accustomed to the above, will find Vile's perl
X  # interface to be a comfortable one.  Here is the above script
X  # modified slightly to count the words in the current buffer:
X  #
X  #     sub wc `7B
X  #         my $words;
X  #         while (<$Vile::current_buffer>) `7B
X  #             $words+=split;
X  #         `7D
X  #         print "$words words";
X  #     `7D
X  #
X  # =head2 Package Vile::Buffer Methods
X  #
X  # =over 4
X  #
X
X
X
X  #
X  # =item E<lt>BUFOBJE<gt>
X  #
X  # When used in a scalar context, returns the next line or portion of
X  # thereof in the current region.
X  #
X  # When used in an array context, returns the rest of the lines (or
X  # portions thereof) in the current region.
X  #
X  # The current region is either set with set_\1E07o\1706by default
X  # for you when perl is invoked from vile.  This region will either
X  # be the region that the user specified or the whole buffer if not
X  # user specified.  Unless you know for sure that the region is set
X  # properly, it is probably best to set it explicitly.
X  #
X  # After a line is read, DOT is left at the next location in the
X  # buffer at which to start reading.  Note, however, that the value
X  # of DOT (which a convenient name for the current position in the
X  # buffer) is not propogated back to any of the users windows unless
X  # it has been explicitly set by calling dot (the method).
X  #
X  # When the I<inplace_edit> flag has been set via the C\2A0E
X  # method, text that is retrieved from the buffer is deleted
X  # immediately after retrieval.
X  #
X  # Examples:
X  #
X  #     # Example 1: Put all lines of the current buffer into
X  #    \0606        an array
X  #
X  #     $Vile::current_buffer->set_region(1,'$$');
X  #        \0808\1010     # Set the region to be the
X  #        \0808\1010     # entire buffer.
X  #     my @lines = <$Vile::current_buffer>;
X  #        \0808\1010     # Fetch all lines and put them
X  #        \0808\1010     # in the @lines array.
X  #     print $lines`5B$#lines/2`5D if @lines;
X  #        \0808\1010     # Print the middle line to
X  #        \0808\1010     # the status line
X  #
X  #
X  #     # Example 2: Selectively delete lines from a buffer
X  #
X  #     my $curbuf = $Vile::current_buffer;
X  #        \0808\1010     # get an easier to type handle
X  #        \0808\1010     # for the current buffer
X  #     $curbuf->inplace_edit(1);       # set the \210C flag
X  #        \0808\1010     # so that lines will be deleted
X  #        \0808\1010     # as they are read
X  #
X  #     while (<$curbuf>) `7B             # fetch line into $_
X  #         unless (/MUST`5Cs+DELETE/) `7B  # see if we should keep the line
X  #             print $curbuf $_;\1E07# put it back if we should keep it
X  #         `7D
X  #     `7D
X  #
X
Xvoid
XREADLINE(vbp)
X    VileBuf * vbp
X
X    PPCODE:
X`09if (vbp2bp(vbp) == bminip) `7B
X`09    int status;
X`09    char buf`5BNLINE`5D;
X`09    char prompt`5BNLINE`5D;
X`09    buf`5B0`5D = EOS;
X`09    strcpy(prompt, "(perl input) ");
X`09    if (use_ml_as_prompt `26`26 !is_empty_buf(bminip)) `7B
X`09`09LINE *lp = lback(buf_head(bminip));
X`09`09int len = llength(lp);
X`09`09if (len > NLINE-1)
X`09`09    len = NLINE-1;
X`09`09strncpy(prompt, lp->l_text, len);
X`09`09prompt`5Blen`5D = 0;
X`09    `7D
X`09    status = mlreply_no_opts(prompt, buf, sizeof(buf));
X#if OPT_HISTORY
X`09    if (status == TRUE)
X`09`09hst_glue('`5Cr');
X#endif
X`09    EXTEND(sp,1);
X`09    if (status != TRUE `26`26 \120AFALSE) `7B
X`09`09PUSHs(`26sv_undef);
X`09    `7D
X`09    else `7B
X`09`09use_ml_as_prompt = 0;
X`09`09PUSHs(sv_2mortal(newSVpv(buf,0)));
X`09    `7D
X`09`7D
X`09else `7B
X`09    I32 gimme = GIMME_V;
X`09    struct MARK old_DOT;
X`09    int (*f)(SV**,VileBuf*,char*,int);
X`09    char *rsstr;
X`09    int rslen;
X
X`09    if (RsSNARF(svrs)) `7B
X`09`09f = svgetregion;
X`09`09rsstr = 0;
X`09`09rslen = 0;
X`09    `7D
X`09    else `7B
X`09`09rsstr = SvPV(svrs, rslen);
X`09`09if (rslen == 1 `26`26 *rsstr == '`5Cn')
X`09`09    f = svgetline;
X`09`09else
X`09`09    f = svgettors;
X`09    `7D
X
X`09    /* Set up the fake window */
X`09    api_setup_fake_win(vbp, TRUE);
X`09    if (!vbp->dot_inited) `7B
X`09`09DOT = vbp->region.r_orig;`09/* set DOT to beginning of \2A06 */
X`09`09vbp->dot_inited = 1;
X`09    `7D
X
X`09    old_DOT = DOT;
X
X`09    if (gimme == G_VOID `7C`7C \130BSCALAR) `7B
X`09`09SV *sv;
+-+-+-+-+-+-+-+-  END  OF PART 93 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 94 -+-+-+-+-+-+-+-+
X`09`09(void) f(`26sv, vbp, rsstr, rslen);
X`09`09if (gimme == G_SCALAR) `7B
X`09`09    XPUSHs(sv_2mortal(sv));
X`09`09`7D
X`09    `7D
X`09    else `7B /* wants an array */
X`09`09SV *sv;
X
X`09`09while (f(`26sv, vbp, rsstr, rslen)) `7B
X`09`09    XPUSHs(sv_2mortal(sv));
X`09`09`7D
X`09    `7D
X`09    if (vbp->inplace_edit) `7B
X`09`09DOT = old_DOT;
X`09    `7D
X`09`7D
X
X  #
X  # =item attribute BUFOBJ LIST
X  #
X  # Attach an attributed region to the\0E08associated with BUFOBJ
X  # with the attributes found in LIST.
X  #
X  # These attributes may be any of the following:
X  #
X  #     'color' => NUM          (where NUM is the color number
X  #        \0808\100Efrom 0 to 15)
X  #     'underline'
X  #     'bold'
X  #     'reverse'
X  #     'italic'
X  #     'hyper' => HYPERCMD     (where\140Ais a string
X  #        \0808\100Drepresenting a vile command to
X  #        \0808\100Dexecute.  It may also be a
X  #        \0808\100D(perl) subroutine reference.
X  #     'normal'
X  #
X  # Normal is a special case.  It will override any other arguments
X  # passed in and remove all attributes associated with the region.
X  #
X
Xvoid
Xattribute(vbp, ...)
X    VileBuf *vbp
X
X    PPCODE:
X#if OPT_SELECTIONS
X`09if (items <= 1) `7B
X`09    /* Hmm.  What does this mean?  Should we attempt to fetch
X`09       the attributes for this region?  Should we turn off all
X`09       the attributes?
X
X`09       Personally, I think it'd be cool to return a list of
X`09       all the regions and their attributes.  But I'll save
X`09       that exercise for another night...
X`09    */
X`09`7D
X`09else `7B
X`09    int i;
X`09    char *atname;
X`09    VIDEO_ATTR vattr = 0;
X`09    int normal = 0;
X`09    char *hypercmd = 0;
X`09    int status;
X
X`09    for (i = 1; i < items; i++) `7B
X`09`09atname = SvPV(ST(i), na);
X`09`09if (       strcmp(atname, "underline") == 0) `7B
X`09`09    vattr `7C= VAUL;
X`09`09`7D else if (strcmp(atname, "bold"     ) == 0) `7B
X`09`09    vattr `7C= VABOLD;
X`09`09`7D else if (strcmp(atname, "reverse"  ) == 0) `7B
X`09`09    vattr `7C= VAREV;
X`09`09`7D else if (strcmp(atname, "italic"   ) == 0) `7B
X`09`09    vattr `7C= VAITAL;
X`09`09`7D else if (strcmp(atname, "normal"   ) == 0) `7B
X`09`09    normal = 1;
X`09`09`7D else if (strcmp(atname, "color"    ) == 0) `7B
X`09`09    i++;
X`09`09    if (i < items) `7B
X`09`09`09vattr `7C= VCOLORATTR(SvIV(ST(i)) `26 0xf);
X`09`09    `7D
X`09`09    else `7B
X`09`09`09croak("Color attribute not supplied");
X`09`09    `7D
X`09`09`7D else if (strcmp(atname, "hyper"    ) == 0
X`09`09        `7C`7C strcmp(atname, "hypertext") == 0) `7B
X`09`09    i++;
X`09`09    if (i < items) `7B
X`09`09`09if (SvROK(ST(i))
X`09`09`09    `26`26 SvTYPE(SvRV(ST(i))) == SVt_PVCV)
X`09`09`09`7B
X`09`09`09    /* We have a code ref */
X`09`09`09    hypercmd = stringify_coderef(ST(i));
X`09`09`09`7D
X`09`09`09else `7B
X`09`09`09    /* It's just a string */
X`09`09`09    hypercmd = strdup(SvPV(ST(i),na));
X`09`09`09`7D
X`09`09    `7D
X`09`09    else `7B
X`09`09`09croak("Hypertext command not supplied");
X`09`09    `7D
X`09`09`7D else `7B
X`09`09    croak("Invalid attribute");
X`09`09`7D
X`09    `7D
X
X`09    if (normal) `7B
X`09`09vattr = 0;
X`09`09hypercmd = 0;
X`09    `7D
X
X`09    status = attributeregion_over_\0C06(
X`09    `09`09`26vbp->region, \0D0Bshape, vattr, hypercmd);
X
X`09    if (status == TRUE)`09`09/* not the same as "\290A)" */
X`09`09XPUSHs(ST(0));&0209/* return buffer object */
X`09    else
X`09`09XPUSHs(`26sv_undef);`09/* else return undef */
X`09`7D
X#else
X`09croak("%s requires vile to be compiled with OPT_SELECTIONS",
X`09      GvNAME(CvGV(cv)));
X#endif
X
X  #
X  # =item attribute_cntl_a_sequences BUFOBJ
X  #
X  # Causes the editor to attach attributes to the <Ctrl>A
X  # sequences found in the buffer for the current region (which
X  # may be set via set_region).
X  #
X  # Returns the buffer object.
X  #
X
XVileBuf *
Xattribute_cntl_a_sequences(vbp)
X    VileBuf *vbp
X
X    CODE:
X#if OPT_SELECTIONS
X`09api_setup_fake_win(vbp, TRUE);
X`09attribute_cntl_a_sequences_over_region(`26vbp->\0D06, \0D0Bshape);
X`09RETVAL = vbp;
X#else
X`09croak("%s requires vile to be compiled with OPT_SELECTIONS",
X`09      GvNAME(CvGV(cv)));
X#endif
X
X    OUTPUT:
X`09RETVAL
X
X  #
X  # =item buffername BUFOBJ
X  #
X  # Returns the buffer name associated with BUFOBJ.
X  #
X  # =item buffername BUFOBJ BUFNAME
X  #
X  # Sets the buffer name associated with BUFOBJ to the string
X  # given by BUFNAME.  This string must be unique.  If the name
X  # given is already being used by another buffer, or if it's
X  # malformed in some way, undef will be returned.  Otherwise
X  # the name of the buffer will be returned.
X  #
X  # Note: The name of the buffer returned may be different than
X  # that passed in due some adjustments\2406may be done on the
X  # buffer name.  (It will be trimmed of spaces and a length limit
X  # is imposed.)
X  #
X  # =item filename BUFOBJ
X  #
X  # Returns the file name associated with BUFOBJ.
X  #
X  # =item filename BUFOBJ FILENAME
X  #
X  # Sets the name of the file associated with BUFOBJ to the string
X  # given by FILENAME.
X  #
X
Xvoid
Xbuffername(vbp,...)
X    VileBuf *vbp
X
X    ALIAS:
X`09filename = 1
X
X    PREINIT:
X`09int status;
X
X    PPCODE:
X
X`09status = TRUE;
X`09api_setup_fake_win(vbp, TRUE);
X
X`09if (items > 2)
X`09    croak("Too many arguments to %s",
X`09          ix == 0 ? "buffername" : "filename");
X`09else if (items == 2) `7B
X`09    if (ix == 0)
X`09`09status = renamebuffer(curbp, SvPV(ST(1),na));
X`09    else
X`09`09ch_fname(curbp, SvPV(ST(1),na));
X`09`7D
X
X`09if (status == TRUE) `7B
X`09    XPUSHs(sv_2mortal(newSVpv(ix == 0 ?
X`09        \0808\100Ecurbp->b_bname :\110Afname, 0)));
X`09`7D
X`09else `7B
X`09    XPUSHs(`26sv_undef);`09`09/* return undef */
X`09`7D
X
X  #
X  # =item command BUFOBJ CMDLINE
X  #
X  # executes the given vile command line (as if it were typed
X  # on the : line) with BUFOBJ as the current buffer.
X  #
X  # Returns BUFOBJ if successful, otherwise r\2807undef.
X  #
X
Xvoid
Xcommand(vbp,cline)
X    VileBuf *vbp
X    char *cline
X
X    PREINIT:
X`09int status;
X`09int old_discmd;
X    PPCODE:
X`09old_discmd = \0906;
X`09discmd = FALSE;
X`09api_setup_fake_win(vbp, TRUE);
X`09status = docmd(cline, TRUE, FALSE, 1);
X`09discmd = old_\0D06;
X`09if (status) `7B
X`09    XPUSHs(ST(0));`09`09/* return buffer object */
X`09`7D
X`09else `7B
X`09    XPUSHs(`26sv_undef);`09`09/* return undef */
X`09`7D
X
X  #
X  # =item current_buffer
X  #
X  # =item current_buffer BUFOBJ
X  #
X  # =item current_buffer PKGNAME
X  #
X  # =item current_buffer BUFOBJ   NEW\0C06
X  #
X  # =item current_buffer PKGNAME  NEWBUFOBJ
X  #
X  # Returns the current buffer.  When first entering perl from a vile
X  # session, the current buffer is the one that the user is actively
X  # editing.  Several buffers may be on the screen at once, but only one
X  # of them is current.  The\0E08 one will be the one in which the
X  # cursor appears.
X  #
X  # This method may also be used to set the current buffer.  When\2606in
X  # the form
X  #
X  #     $oldbuf->current_buffer($newbuf)
X  #
X  # then $newbuf will replace $oldbuf in one of the visible windows.
X  # (This only makes sense when $oldbuf was visible in some window on the
X  # screen.  If it wasn't visible, it'll just replace whatever buffer was
X  # last both current and visible.)
X  #
X  # When used as a setter, the current buffer is still returned.  In this
X  # case it will be the new buffer object which becomes the current
X  # buffer.
X  #
X  # Note also that the current_buffer method is in both the Vile package
X  # and the Vile::Buffer package.  I couldn't decide which\2208 it should
X  # be in so I put it into both.  It seemed like a real hassle to have to
X  # say
X  #
X  #     my $curbuf = Vile::Buffer->current_buffer
X  #
X  # So instead, you can just say
X  #
X  #     my $curbuf = Vile->current_buffer;
X  #
X  # current_buffer is also a variable, so you can\1C06do it this way:
X  #
X  #     my $curbuf = $Vile::current_buffer;
X  #
X  # If you want $main::curbuf (or some other variable) to be an alias to
X  # the current buffer, you can do it like this:
X  #
X  #     *main::curbuf = `5C$Vile::current_buffer;
X  #
X  # Put this in some bit of initialization code and then you'll never have
X  # to call the current_buffer method at all.
X  #
X  # One more point, since $Vile::current_buffer is magical, the alias
X  # above will be magical too, so you'\1A06able to do
X  #
X  #     $curbuf = $newbuf;
X  #
X  # in order to set the buffer.  (Yeah, this looks obvious, but realize
X  # that doing the assignment actually causes some vile specific code to
X  # run which will cause $newbuf to become the new current buffer upon
X  # return.)
X  #
X
XVileBuf *
Xcurrent_buffer(...)
X
X    ALIAS:
X`09Vile::current_buffer = 1
X
X    PREINIT:
X`09VileBuf *callbuf;
X`09VileBuf *newbuf;
X
X    PPCODE:
X`09if (items > 2)
X`09    croak("Too many arguments to current_buffer");
X`09else if (items == 2) `7B
X`09    if (sv_isa(ST(0), "Vile::Buffer")) `7B
X`09`09callbuf = (VileBuf *)SvIV((SV*)GvSV((GV*)SvRV(ST(0))));
X`09`09if (callbuf == 0) `7B
X`09`09    croak("buffer no longer exists");
X`09`09`7D
X`09    `7D
X`09    else
X`09`09callbuf = 0;
X
X`09    if (sv_isa(ST(1), "Vile::Buffer")) `7B
X`09`09newbuf = (VileBuf *)SvIV((SV*)GvSV((GV*)SvRV(ST(1))));
X`09`09if (newbuf == 0) `7B
X`09`09    croak("switched to buffer no longer exists");
X`09`09`7D
X`09    `7D
X`09    else `7B
X`09`09croak("switched to buffer of wrong type");
X`09    `7D
X
X`09    if (api_swscreen(callbuf, newbuf))
X`09`09sv_setsv(svcurbuf, ST(1));
X`09`7D
X
X`09XPUSHs(svcurbuf);
X
X  #
X  # =item delete BUFOBJ
X  #
X  # Deletes the currently set region.
X  #
X  # Returns the buffer object if all went well, undef otherwise.
X  #
X
XVileBuf *
Xdelete(vbp)
X    VileBuf *vbp
X
X    CODE:
X`09if (api_delregion(vbp))
X`09    RETVAL = vbp;
X`09else
X`09    RETVAL = 0;`09`09/* which gets turned into undef */
X    OUTPUT:
X`09RETVAL
X
X  #
X  # =item dot BUFOBJ
X  #
X  # =item dot BUFOBJ LINENUM
X  #
X  # =item dot BUFOBJ LINENUM, OFFSET
X  #
X  # Returns the current value of dot (which represent\2B06\2F0B
X  # position in the buffer).  When used in a scalar context returns,
X  # the line number of dot.  When used in an array context, returns
X  # the line number and position within\2409.
X  #
X  # When supplied with one argument, the line number, dot is set to
X  # the beginning of that line.  When supplied with two arguments,
X  # both the line number and offset components are set.
X  #
X  # Either the line number or offset (or both) may be the special
X  # string '$' which represents the last line in the buffer and the
X  # last character on a line.
X  #
X  # Often times, however, the special string '$$' will be more useful.
X  # It truly represents the farthest that it possible to go in both
X  # the vertical and horizontal directions.  As a line number, this
X  # represents the line beyond\1006ast\1506of the buffer.
X  # Characters inserted at this point will form a new line.  As an
X  # offset, '$$' refers to the newline character at the end of a line.
X  # Characters inserted at this point will be\1F0Abefore the
X  # newline character.
X  #
X  #
X  # Examples:
X  #
X  #     my $cb = $VILE::current_buffer; # Provide a convenient handle
X  #        \0808\1010     # for the current buffer.
X  #
X  #     $linenum = $cb->dot;            # Fetch the line number at which dot
X  #        \0808\1010     # is located.
X  #
X  #     $cb->dot(\0908+1);           # Advance dot by one line
X  #     $cb->dot(\0909'$') - 1);
X  #        \0808\1010     # Set dot to the penultimate line of
X  #        \0808\1010     # the buffer.
X  #
X  #     $cb->dot(25, 6);          \0A06# Set dot to line 25, character 6
X  #
X  #     ($ln,$off) = $cb->dot;          # Fetch the current position
X  #     $cb->dot($ln+1,$off-1);         # and advance one line, but
X  #        \0808\1010     # back one character.
X  #
X  #     $cb->inplace_edit(1);
X  #     $cb->set_region(scalar($cb->dot),\2206dot+5);
X  #     @lines = <$cb>;
X  #     $cb->dot(\0908 - 1);
X  #     print $cb @lines;
X  #        \0808\1010     # The above block takes (at
X  #        \0808\1010     # most) six lines starting at
X  #        \0808\1010     # the line DOT is on and moves
X  #        \0808\1010     # them before the previous
X  #        \0808\1010     # line.
X  #
X  # Note: current_position is an alias for dot.
X  #
X
Xvoid
Xdot(vbp, ...)
X    VileBuf *vbp
X
X    ALIAS:
X`09current_position = 1
X
X    PREINIT:
X`09I32 gimme;
X
X    PPCODE:
X`09api_setup_fake_win(vbp, TRUE);
X`09if ( items > 3) `7B
X`09    croak("Invalid number of arguments");
X`09`7D
X`09else if (items > 1) `7B
X`09    /* Expect a line number or '$' */
X
X`09    api_gotoline(vbp, sv2linenum(ST(1)));
X
X`09    if (items == 3)
X`09`09DOT.o = sv2offset(ST(2));
X
X`09    /* Don't allow api_dotgline to change dot if\0706s explicitly
X`09       set.  OTOH, simply querying dot doesn't count. */
X`09    vbp->dot_inited = TRUE;
X`09    /* Indicate that DOT has been explicitly changed which means
X`09       that changes to DOT will be propogated upon return to vile */
X`09    vbp->dot_changed = TRUE;
X`09`7D
X`09gimme = GIMME_V;
X`09if (gimme == G_SCALAR) `7B
X`09    XPUSHs(sv_2mortal(newSViv(line_no(curbp, DOT.l))));
X`09`7D
X`09else if (gimme == G_ARRAY) `7B
X`09    XPUSHs(sv_2mortal(newSViv(line_no(curbp, DOT.l))));
X`09    XPUSHs(sv_2mortal(newSViv(DOT.o)));
X`09`7D
X
X  #
X  # =item fetch BUFOBJ
X  #
X  # Returns the current region or remainder thereof.  The same effect
X  # could be achieved by setting $/ to undef and then evaluating the
X  # buffer object between angle brackets.
X  #
X  # Example:
X  #
X  #     $word = $Vile::current_buffer->set_region('w')->fetch;
X  #        \0808\100D# Fetch the next word and put it in $word
X  #
X
Xvoid
Xfetch(vbp)
X    VileBuf * vbp
X
X    PREINIT:
X`09SV *sv;
X`09struct MARK old_DOT;
X
X    PPCODE:
X`09/* Set up the fake window */
X`09api_setup_fake_win(vbp, TRUE);
X`09if (!vbp->dot_inited) `7B
X`09    DOT = vbp->region.r_orig;`09/* set DOT to beginning of \2A06 */
X`09    vbp->dot_inited = 1;
X`09`7D
X
X`09old_DOT = DOT;
X
X`09svgetregion(`26sv, vbp, 0, 0);
X
X`09XPUSHs(sv_2mortal(sv));
X
X`09if (vbp->inplace_edit)
X`09    DOT = old_DOT;
X
X
X  #
X  # =item inplace_edit BUFOBJ
X  #
X  # =item inplace_edit BUFOBJ VALUE
X  #
X  # Sets the value of the "inplace edit" flag (either tr\2806false).
X  # Returns the old value.  When used without an argument, merely
X  # returns current value without modifying the \240D.
X  #
X  # This flag determines whether a line is deleted after being read.
X  # E.g,
X  #
X  #     my $curbuf = $Vile::current_buffer;
X  #     $curbuf->inplace_edit(1);
X  #     while (<$curbuf>) `7B
X  #         s/foo/bar/g;
X  #         print;
X  #     `7D
X  #
X  # The <$curbuf> operation will cause one line to be read and
X  # deleted.  DOT will be left at the beginning of the next line.  The
X  # print statment will cause $_ to get inserted prior the the next
X  # line.
X  #
X  # Setting this flag to true is very similar to s\2D09e
X  # $INPLACE_EDIT flag (or $`5EI) for normal filehandles or using the B<-i>
X  # switch from the command line.
X  #
X  # Setting it to false (which is its default value) will cause the
X  # lines that are read to be left alone.
X  #
X
Xint
Xinplace_edit(vbp, ...)
X    VileBuf *vbp
X
X    CODE:
X`09RETVAL = vbp->inplace_edit;
X`09if (items > 1)
X`09    vbp->inplace_edit = SvIV(ST(1));
X
X    OUTPUT:
X`09RETVAL
X
X  #
X  # =item motion BUFOBJ MOTIONSTR
X  #
X  # Moves dot (the current position) by the given MOTIONSTR in
X  # BUFOBJ.
X  #
X  # When used in an array context, returns a 4-tuple containing
X  # the beginning and ending positions.  This 4-tuple is suitable
X  # for passing to C<set_region>.
X  #
X  # When used in a scalar context, returns the buffer object that
X  # it was called with.
X  #
X  # In either an array or scalar context, if the motion string was
X  # bad, and undef is returned.  Motions that don't work are okay,
X  # such as 'h' when you're already at the left edge of a line.  But
X  # attempted "motions" like 'inewstring' will result in an error.
X  #
X  # Example:
X  #
X  #     # The following code deletes the previous 2 words and then
X  #     # positions the cursor at the next occurrence of the word
X  #     # "foo".
X  #
X  #     my $cb = $Vile::current_buffer;
X  #     $cb->set_region($cb->motion("2b"))->delete;
X  #        \0808     # delete the previous two words
X  #
X  #     $cb->set_region("2b")->delete;
X  #        \0808     # another way to delete the previous
X  #        \0808     # two words
X  #
X  #     $cb->motion("/foo/");
X  #        \0808     # position DOT at the beginning of
X  #        \0808     # "foo".
X  #
X  #     $cb->dot(\0908);
X  #        \0808     # Make sure DOT gets propogated back.
X  #        \0808     # (It won't get propogated unless
X  #        \0808     # explicitly set.)
X  #
X
Xvoid
Xmotion(vbp,mstr)
X    VileBuf *vbp
X    char *mstr
X
X    PREINIT:
X`09I32 gimme;
X`09struct MARK old_DOT;
X`09int status;
X
X    PPCODE:
X`09old_DOT = DOT;
X    `09status = api_motion(vbp, mstr);
X
X`09gimme = GIMME_V;
X`09if (!status) `7B
X`09    XPUSHs(`26sv_undef);`09`09/* return undef */
X`09`7D
X`09else if (gimme == G_SCALAR) `7B
X`09    XPUSHs(ST(0));`09`09/* return the buffer object */
X`09`7D
X`09else if (gimme == G_ARRAY) `7B
X`09    I32 sl, el, so, eo;
X`09    sl = line_no(curbp, old_DOT.l);
X`09    so = old_DOT.o;
X`09    el = line_no(curbp, DOT.l);
X`09    eo = DOT.o;
X`09    if (sl > el) `7B
X`09`09I32 tl = sl;
X`09`09sl = el;
X`09`09el = tl;
X`09    `7D
X`09    if (sl == el `26`26 so > eo) `7B
X`09`09I32 to = so;
X`09`09so = eo;
X`09`09eo = to;
X`09    `7D
X`09    XPUSHs(sv_2mortal(newSViv(sl)));
X`09    XPUSHs(sv_2mortal(newSViv(so)));
X`09    XPUSHs(sv_2mortal(newSViv(el)));
X`09    XPUSHs(sv_2mortal(newSViv(eo)));
X`09`7D
X
X  #
X  # =item new BUFOBJ
X  #
X  # =item new PKGNAME
X  #
X  # =item new BUFOBJ  FILENAME
X  #
X  # =item new PKGNAME FILENAME
X  #
X  # =item edit BUFOBJ
X  #
X  # =item edit PKGNAME
X  #
X  # =item edit BUFOBJ  FILENAME
X  #
X  # =item edit PKGNAME FILENAME
X  #
X  # These methods create a new buffer and return it.
X  #
X  # When no filename is supplied, an anonymous buffer is created.
X  # These buffer's will be named `5Bunnamed-1`5D,\0D0A2`5D, etc.  and
X  # will not have a file name associated with them.
X  #
X  # When a name is supplied as an argument to new or edit, a check is
X  # made to see if the name is the same as an already existing buffer.
X  # If so, that buffer is returned.  Otherwise, the name is taken to
X  # be a file name.  If the file exists, it is opened and read into
X  # the newly created buffer.  If the file does not exist, a new
X  # buffer will be created with the associated file name.  The name of
X  # the buffer will be based on the file name.  T\1008\2A07
X  # created when the buffer is first written out to disk.
X  #
X  # new and edit are synonyms.  In each case, PKGNAME is Vile::Buffer.
X  # There is no difference between Vile::Buffer->new($fname) and
X  # $buf->new($fname).  These two different forms are merely provided
X  # for convenience.
X  #
X  # Example:
X  #
X  #     $Vile::current_buffer = new \1B06B\1306'makefile';
X  #        \0808\1010     # open makefile and make it visible
X  #        \0808\1010     # on the screen.
X  #
X  #     $abuf = new Vile::Buffer;       # Create an anonymous buffer
X  #     print $abuf "Hello";            # put something in it
X  #     Vile->current_buffer($abuf);    # make the anonymous \2706 \3607
X  #        \0808\1010     #   (viewable).
X  #
X  #     Vile->current_buffer($abuf->edit('makefile'));
X  #        \0808\1010     # Now makefile is the current
X  #        \0808\1010     #   buffer
X  #     $abuf->current_buffer(Vile::Buffer->new('makefile'));
X  #        \0808\1010     # Same thing
X  #
X
XVileBuf *
Xnew(...)
X
X    ALIAS:
X`09edit = 1
X
X    PREINIT:
X`09char *name;
X`09VileBuf *newvbp;
X
X    CODE:
X`09if (items > 2)
X`09    croak("Too many arguments to %s", GvNAME(CvGV(cv)));
X
X`09name = (items == 1) ? NULL : (char *)SvPV(ST(1),na);
X
X`09(void) api_edit(NULL, name, `26newvbp);
X
X`09RETVAL = newvbp;
X
X    OUTPUT:
X`09RETVAL
X
X
X  #
X  # =item print BUFOBJ STR1,..,STRN
X  #
X  # =item insert BUFOBJ STR1,...,STRN
X  #
X  # Inserts one or more strings the buffer object at the current
X  # position of DOT.  DOT will be left at the end of the strings
X  # just inserted.
X  #
X  # When STDERR or STDOUT are printed to, the output will be
X  # directed to the message line.
X  #
X  # Examples:
X  #
X  #     print "Hello, world!";          # Print a well known greeting on
X  #        \0808\1010     # the message line.
X  #     print $Vile::current_buffer "new text";
X  #        \0808\1010     # put some new text in the current
X  #        \0808\1010     # buffer.
X  #
X  #     my $passbuf = new Vile::Buffer '/etc/passwd';
X  #        \0808\1010     # Fetch the password file
X  #     $passbuf->dot('$$');            # Set the position a\1006end
X  #     print $passbuf "joeuser::1000:100:Joe User:/home/\2108/bin/bash
X  #        \0808\1010     # Add 'joeuser' to the this buffer
X  #     Vile->current_buffer($passbuf); # Make it visible to the user.
X  #
X
Xvoid
XPRINT(vbp, ...)
X    VileBuf *vbp
X
X    ALIAS:
X`09insert = 1
X
X    CODE:
X`09if (vbp2bp(vbp) == bminip) `7B
X`09    if (items > 0) `7B
X`09`09SV *tmp = newSVsv(ST(1));
X`09`09int i;
X
X`09`09for (i = 2; i < items; i++) `7B
X`09`09    if (ofslen > 0)
X`09`09`09sv_catpvn(tmp, ofs, ofslen);
X
X`09`09    sv_catsv(tmp, ST(i));
X`09`09`7D
X
X`09`09if (write_message(tmp))
X`09`09    use_ml_as_prompt = 1;
X
X`09`09SvREFCNT_dec(tmp);
X`09    `7D
X`09`7D
X`09else `7B
X`09    int i;
X`09    for (i = 1; i < items; ) `7B
X`09`09STRLEN len;
X`09`09char *arg = SvPV(ST(i), len);
X`09`09api_dotinsert(vbp, arg, len);
X`09`09i++;
X`09`09if (i < items `26`26 ofslen > 0)
X`09`09    api_dotinsert(vbp, ofs, ofslen);
X`09    `7D
X`09    if (orslen > 0)
X`09`09api_dotinsert(vbp, ors, orslen);
X`09`7D
X
X  #
X  # =item set_region BUFOBJ
X  #
X  # =item set_region BUFOBJ MOTIONSTR
X  #
X  # =item set_region BUFOBJ STARTLINE, ENDLINE
X  #
X  # =item set_region BUFOBJ STARTLINE,\0B06OFFSET, END\1606END\1406
X  #
X  # =item set_region BUFOBJ STARTLINE,\0B06OFFSET, END\1606END\1408'rectangle'
V
X  #
X  # =item set_region BUFOBJ STARTLINE,\0B06OFFSET, END\1606END\1408'exact'
X  #
X  # Sets the region upon which certain other methods will operate and
X  # sets DOT to the beginning of the region.
X  #
X  # Either the line number or offset (or both) may be the special
X  # string '$' which represents the last line in the buffer and the
X  # last character on a line.
X  #
X  # Often times, however, the special string '$$' will be more useful.
X  # It truly represents the farthest that it possible to go in both
X  # the vertical and horizontal directions.  As a line number, this
X  # represents the line beyond\1006ast\1506of the buffer.
X  # Characters inserted at this point will form a new line.  As an
X  # offset, '$$' refers to the newline character at the end of a line.
X  # Characters inserted at this point will be\1F0Abefore the
X  # newline character.
X  #
X  # When used in an array context, returns a five element\2607with
X  # the start line,\0C07offset, end\1807end \1608and a string
X  # indicating the type of region (one of 'line', 'rectangle', or
X  # 'exact').
X  #
X  # When used in a scalar context, returns the buffer object so that
X  # cascading method calls may be performed, i.e,
X  #
X  #     $Vile::current_buffer->set_region(3,4)
X  #        \0808\100A->attribute_cntl_a_sequences;
X  #
X  # There is a special form of set_region which may be used as follows:
X  #
X  #     $Vile::current_buffer->set_region('j2w');
X  #
X  # The above statement will set the region beginning a\1806current
X  # location of DOT and ending at the\220Aarrived at by moving
X  # down one line and over two words.  This may be viewed as a
X  # shorthand way of expressing the following (somewhat cumbersome)
X  # statement:
X  #
X  #     $Vile::current_buffer->set_region(
X  #             $Vile::current_buffer->motion('j2w'));
X  #
X  # Notes:
X  #
X  # =item 1
X  #
X  # rectangular regions are not implemented yet.
X  #
X  # =item 2
X  #
X  # setregion is an alias for set_\1B06.
X  #
X
Xvoid
Xset_region(vbp, ...)
X    VileBuf *vbp
X
X    ALIAS:
X`09setregion = 1
X
X    PREINIT:
X`09I32 gimme;
X`09char *shapestr;
X
X    PPCODE:
X`09api_setup_fake_win(vbp, TRUE);
X`09switch (items) `7B
X`09    case 1:
X`09`09/* set DOT and recompute region */
X`09`09DOT = vbp->region.r_orig;
X`09`09MK  = vbp->region.r_end;
X`09`09regionshape = vbp->\130B;
X`09`09break;
X`09    case 2: `7B
X`09`09/* Set up a "motion" region */
X`09`09vbp->region.r_orig = DOT;`09/* Remember DOT */
X`09`09if (api_motion(vbp, SvPV(ST(1), na))) `7B
X`09`09    /* DOT is now at the other end of the motion */
X`09`09    MK = vbp->region.r_orig;`09/* Put remembered DOT in MK */
X`09`09    regionshape = EXACT;
X`09`09`7D
X`09`09else `7B
X`09`09    croak("set_region: Invalid motion");
X`09`09`7D
X`09`09break;
X`09    `7D
X`09    case 3:
X`09`09/* Set up a full line region */
X`09`09regionshape = FULLLINE;
X`09`09api_gotoline(vbp, sv2linenum(ST(2)));
X`09`09MK = DOT;
X`09`09api_gotoline(vbp, sv2linenum(ST(1)));
X`09`09break;
X`09    case 5:
X`09`09/* Set up an exact region */
X`09`09regionshape = EXACT;
X`09`09goto set_region_common;
X`09`09break;
X`09    case 6:
X`09`09/* Set up any kind of region (exact, fullline, or rectangle) */
X`09`09shapestr = SvPV(ST(5), na);
X`09`09if (strcmp(shapestr, "exact"))
X`09`09    regionshape = EXACT;
X`09`09else if (strcmp(shapestr, "rectangle"))
X`09`09    regionshape = RECTANGLE;
X`09`09else if (strcmp(shapestr, "fullline"))
X`09`09    regionshape = FULLLINE;
X`09`09else `7B
X`09`09    croak("Region shape argument not one of `5C"exact`5C", `5C"fullline
V`5C", or `5C"rectangle`5C"");
X`09`09`7D
X`09    set_region_common:
X`09`09api_gotoline(vbp, sv2linenum(ST(3)));
X`09`09DOT.o = sv2offset(ST(4));
X`09`09MK = DOT;
X`09`09api_gotoline(vbp, sv2linenum(ST(1)));
X`09`09DOT.o = sv2offset(ST(2));
X`09`09break;
X`09    default:
X`09`09croak("Invalid number of arguments to set_region");
X`09`09break;
X`09`7D
X`09haveregion = NULL;
X`09if (getregion(`26vbp->\0D06) != TRUE) `7B
X`09    croak("set_region: Unable to set the \1A06");
X`09`7D
X`09vbp->regionshape = \0E0B;
X`09DOT = vbp->region.r_orig;
X`09vbp->dot_inited = 1;
X`09gimme = GIMME_V;
X`09if (gimme == G_SCALAR) `7B
X`09    XPUSHs(ST(0));
X`09`7D
X`09else if (gimme == G_ARRAY) `7B
X`09    /* Return range information */
X`09    XPUSHs(sv_2mortal(newSViv(line_no(curbp, vbp->region.r_orig.l))));
X`09    XPUSHs(sv_2mortal(newSViv(vbp->region.r_orig.o)));
X`09    XPUSHs(sv_2mortal(newSViv(line_no(curbp, vbp->region.r_end.l)
X`09        \0808\1010\200D- (vbp->regionshape == FULLLINE))));
X`09    XPUSHs(sv_2mortal(newSViv(vbp->region.r_end.o)));
X`09    XPUSHs(sv_2mortal(newSVpv(
X`09`09vbp->regionshape == FULLLINE ? "fullline" :
X`09`09vbp->regionshape == EXACT    ? "exact"
X`09`09        \0808\100C: "rectangle",    0 )));
X`09`7D
X
X
X  #
X  # =item unmark
X  #
X  # Clear the "modified" status of the buffer.
X  #
X  # Returns the buffer object.
X  #
X
XVileBuf *
Xunmark(vbp)
X    VileBuf *vbp
X
X    CODE:
X`09api_setup_fake_win(vbp, TRUE);
X`09unmark(0,0);
X`09RETVAL = vbp;
X
X    OUTPUT:
X`09RETVAL
$ call unpack [.VILE-8_0]PERL.XS;1 -
 219923880 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 184 98 152
$!
$ create 'f'
X/*
X *   This file was automatically generated by cextract version 1.2.
X *   Manual editing now recommended, since I've done a whole lot of it.
X *
X *   Created: Thu May 14 15:44:40 1992
X *
X * $Header: /usr/build/vile/vile/RCS/proto.h,v 1.285 1998/05/29 00:52:14 tom E
Vxp $
X *
X */
X
X#ifndef VILE_PROTO_H
X#define VILE_PROTO_H 1
X
X#if !CHECK_PROTOTYPES
Xextern int main (int argc, char **argv);
X#endif
X
X#ifdef __cplusplus
Xextern "C" `7B
X#endif
X
Xextern SIGT catchintr (int ACTUAL_SIG_ARGS);
Xextern char *strend (const\1408);
Xextern char *strncpy0 (\1006t, const\1F07f, SIZE_T l);
Xextern int call_cmdfunc(const CMDFUNC *p, int f\0706n);
Xextern int no_memory (const char *s);
Xextern int rdonly (void);
Xextern int writeall (int f, int n\0706promptuser\1706leaving\2406autowriting);
V
+-+-+-+-+-+-+-+-  END  OF PART 94 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 95 -+-+-+-+-+-+-+-+
Xextern void charinit (void);
Xextern void do_repeats (int *cp, int *f\0908np);
Xextern void not_interrupted (void);
Xextern void setup_handler (int sig,\1D06(*disp)\1706ACTUAL_SIG_ARGS));
Xextern void tidy_exit (int code);
X
X#ifndef interrupted
Xextern int interrupted (void);
X#endif
X
X#ifndef strmalloc
Xextern char *strmalloc (const\1708);
X#endif
X
X#if OPT_RAMSIZE
Xextern char *reallocate (\1206mp, unsigned nbytes);
Xextern char *allocate (unsigned nbytes);
Xextern void release (char *mp);
X#endif
X
X/* screen-drivers */
X#if OPT_XTERM >= 3
Xextern int xterm_mouse_t (int f, int n);
Xextern int xterm_mouse_T (int f, int n);
X#endif
X
X#if OPT_PERL
X/* perl.xs (perl.c) */
Xextern`09void`09perl_default_region(void);
Xextern`09void`09perl_free_handle(void *);
Xextern`09void`09perl_free_callback(char *);
X#if OPT_NAMEBST
Xextern`09int`09perl_call_sub(void *, int, int, int);
Xextern`09void`09perl_free_sub(void *);
X#endif
X
X/* api.c */
Xextern void api_free_private(void *);
X/* There are others as well, but the rest are found in api.h */
X#endif
X
X/* basic.c */
Xextern int firstchar (LINE *lp);
Xextern int getgoal (LINE *dlp);
Xextern int gonmmark (int c);
Xextern int lastchar (LINE *lp);
Xextern int next_column (int c, int col);
Xextern int next_sw(int col);
Xextern int nextchar (LINE *lp, int off);
Xextern int setmark (void);
Xextern void swapmark (void);
X
X#if OPT_MOUSE
Xextern`09int setcursor (int row, int col);
Xextern`09int setwmark (int row, int col);
X#endif
X
X#if SMALLER`09/* cancel 'neproto.h' */
Xextern int gotobob (int f, int n);
Xextern int gotoeob (int f, int n);
X#endif
X
X/* bind.c */
Xextern char *flook (\0D07name, UINT hflag);
Xextern char *kbd_engl (const\1607prompt,\2407buffer);
Xextern char *kcod2pstr (int c,\1807seq);
Xextern const CMDFUNC *engl2fnc (\1906char *fname);
Xextern const CMDFUNC *kcod2fnc (int c);
Xextern int fnc2kcod (const CMDFUNC *);
Xextern int kbd_complete (int case_insensitive, int c, char *buf, unsigned *pos
V, const char *table, SIZE_T size_entry);
Xextern int kbd_engl_stat (const char *prompt,\0E07buffer, int stated);
Xextern int kbd_length (void);
Xextern int kcod2escape_seq (int c, char *ptr);
Xextern int no_such_function (const char *fname);
Xextern void kbd_alarm (void);
Xextern void kbd_erase (void);
Xextern void kbd_erase_to_end (int column);
Xextern void kbd_init (void);
Xextern void kbd_putc (int c);
Xextern void kbd_puts (const char *s);
Xextern void kbd_unquery (void);
Xextern void popdown_completions (void);
X
X#if DISP_X11
Xextern char *fnc2pstr (const CMDFUNC *f);
X#endif
X
X#if OPT_EVAL
Xextern const char *prc2engl (\160Cskey);
X#endif
X
X#if OPT_MENUS
Xextern char *give_accelerator (\1907 );
X#endif
X
X#if OPT_NAMEBST
Xextern int delete_namebst(const char *name, int release);
Xextern int insert_namebst(const char *name, const CMDFUNC *cmd, int ro);
Xextern int rename_namebst(const char *oldname, c\150Bnewname);
Xextern int search_namebst(const char *name);
Xextern void build_namebst(const NTAB *nametbl, int lo\0806hi);
X#endif
X
X/* buffer.c */
XBUFFER *make_bp (const char *fname, int flags);
Xextern BUFFER *bfind (const char *bname, int bflag);
Xextern BUFFER *find_alt (void);
Xextern BUFFER *find_any_buffer (const char *name);
Xextern BUFFER *find_b_file (const char *fname);
Xextern BUFFER *find_b_hist(int number);
Xextern BUFFER *find_b_name (const char *name);
Xextern BUFFER *find_bp (\1108bp1);
Xextern BUFFER *getfile2bp (const char *fname, int ok_to_ask\0F06cmdline);
Xextern WINDOW *bp2any_wp (BUFFER *bp);
Xextern char *add_brackets(\1306dst, const\2407src);
Xextern char *hist_lookup ( int c );
Xextern char *strip_brackets(\1506dst, const\2608rc);
Xextern int add_line_at (BUFFER *bp, LINEPTR prevp, const char *text, int len);
V
Xextern int addline (BUFFER *bp, const char *text, int len);
Xextern int any_changed_buf (BUFFER **bpp);
Xextern int any_unread_buf (BUFFER **bpp);
Xextern int bclear (BUFFER *bp);
Xextern int bsizes (BUFFER *bp);
Xextern int delink_bp (BUFFER *bp);
Xextern int popupbuff (BUFFER *bp);
Xextern int shiftwid_val (BUFFER *bp);
Xextern int swbuffer (BUFFER *bp);
Xextern int swbuffer_lfl (BUFFER *bp, int lockfl);
Xextern int tabstop_val (BUFFER *bp);
Xextern int zotbuf (BUFFER *bp);
Xextern int renamebuffer(BUFFER *rbp, char *bufname);
Xextern int zotwp (BUFFER *bp);
Xextern void chg_buff (BUFFER *bp, USHORT flag);
Xextern void imply_alt (char *fname, int copy\0A06lockfl);
Xextern void make_current (BUFFER *nbp);
Xextern void set_bname (BUFFER *bp, const char *name);
Xextern void sortlistbuffers (void);
Xextern void unchg_buff (BUFFER *bp, USHORT flag);
Xextern void undispbuff (BUFFER *bp, WINDOW *wp);
X
X#if BEFORE
Xextern char *get_bname (BUFFER *bp);
X#endif
X
X#if !OPT_MAJORMODE
Xextern int has_C_suffix (BUFFER *bp);
X#endif
X
X#if OPT_UPBUFF
Xvoid updatelistbuffers (void);
Xvoid update_scratch (const char *name, int (*func)(BUFFER *));
X#else
X#define updatelistbuffers()
X#define update_scratch(name, func)
X#endif
X
X/* crypt.c */
X#if`09OPT_ENCRYPT
Xextern`09int`09ue_makekey (char *key, ALLOC_T len);
Xextern`09void`09ue_crypt (char *bptr, ALLOC_T len);
X#endif`09/* OPT_ENCRYPT */
X
X/* csrch.c */
X
X/* display.c */
Xextern char *lsprintf (\1006buf, const\2107fmt, ...);
Xextern int col_limit (WINDOW *wp);
Xextern int im_waiting (int flag);
Xextern int mk_to_vcol (MARK mark, int expanded\0E06base);
Xextern int nu_width (WINDOW *wp);
Xextern int offs2col (WINDOW *wp, LINEPTR lp, C_NUM offset);
Xextern int update (int force);
Xextern int video_alloc (VIDEO **vpp);
Xextern int vtinit (void);
Xextern void bottomleft (void);
Xextern void bprintf (const char *fmt, ...);
Xextern void bputc (int c);
Xextern void dbgwrite (const char *fmt, ...);
Xextern void hilite (int row, int colfrom\0D09to\1806on);
Xextern void kbd_flush (void);
Xextern void kbd_openup (void);
Xextern void kbd_overlay(const char *s);
Xextern void mlerase (void);
Xextern void mlerror (const char *s);
Xextern void mlforce (const char *fmt, ...);
Xextern void mlprompt (const char *fmt, ...);
Xextern void mlsavec (int c);
Xextern void mlwarn (const char *fmt, ...);
Xextern void mlwrite (const char *fmt, ...);
Xextern void movecursor (int row, int col);
Xextern void newscreensize (int h, int w);
Xextern void upmode (void);
X
X#if !DISP_X11
Xextern void getscreensize (int *widthp, int *heightp);
X#if defined(SIGWINCH)
Xextern SIGT sizesignal (int ACTUAL_SIG_ARGS);
X#endif
X#endif
X
X#if defined(SIGWINCH) `7C`7C OPT_WORKING
Xextern void beginDisplay (void);
Xextern void endofDisplay (void);
X#endif
X
X#ifdef WMDLINEWRAP
Xextern int line_height (WINDOW *wp, LINEPTR lp);
X#else
X#define line_height(wp,lp) 1
X#endif
X
X#if defined(WMDLINEWRAP) `7C`7C OPT_MOUSE
Xextern WINDOW *row2window (int row);
Xextern int col2offs (WINDOW *wp, LINEPTR lp, C_NUM col);
X#endif
X
X#if OPT_WORKING
Xextern SIGT imworking (int ACTUAL_SIG_ARGS);
X#endif
X
X#if OPT_PSCREEN
Xextern`09OUTC_DCL psc_putchar`09(OUTC_ARGS);
Xextern`09void`09psc_eeol`09(void);
Xextern`09void`09psc_eeop`09(void);
Xextern`09void`09psc_flush`09(void);
Xextern`09void`09psc_move`09(int row, int col);
Xextern`09void`09psc_rev`09`09(UINT huh);
X#endif`09/* OPT_PSCREEN */
X
X/* djhandl.c */
X#if CC_DJGPP
Xextern unsigned long was_ctrl_c_hit (void);
Xextern void want_ctrl_c (int yes);
Xextern void clear_hard_error (void);
Xextern void hard_error_catch_setup (void);
Xextern void hard_error_teardown (void);
Xextern int did_hard_error_occur (void);
X#endif
X
X/* eval.c */
Xextern char *get_shell(void);
Xextern char *l_itoa (int i);
Xextern char *mklower (\0F06str);
Xextern char *mktrimmed (\1106str);
Xextern const char *skip_cblanks (\1A0Dtr);
Xextern const char *skip_cstring (\1A0Dtr);
Xextern const char *skip_ctext (\180Dtr);
Xextern int absol (int x);
Xextern int is_falsem (const char *val);
Xextern int is_truem (const char *val);
X
X#ifdef const
X#define skip_blanks(s)\0F06c\1009
X#define skip_string(s)\0F06c\1009
X#define skip_text(s)\0D06c\0E07
X#else
Xextern char *skip_blanks (\1307tr);
Xextern char *skip_string (\1307tr);
Xextern char *skip_text (\1107tr);
X#endif
X
X#if OPT_EVAL
Xextern char *gtenv (const\1307vname);
Xextern int   stenv(const char *name, c\120Bvalue);
Xextern int set_variable (const char *name);
X#endif
X
X#if OPT_EVAL `7C`7C DISP_X11
Xextern int stol (const char *val);
X#endif
X
X#if OPT_EVAL `7C`7C OPT_COLOR
Xextern int set_palette (const char *value);
X#endif
X
X#if OPT_EVAL `7C`7C !SMALLER
Xextern char *mkupper (\0F06str);
X#endif
X
X#if OPT_COLOR
Xextern void set_ctrans (const char *value);
X#endif
X
X/* exec.c */
Xextern int do_source (char *fname, int n\0706optional);
Xextern int dobuf (BUFFER *bp);
Xextern int docmd (char *cline, int execflag\0E06f\1506n);
Xextern int dofile (char *fname);
Xextern int end_named_cmd (void);
Xextern int execute (const CMDFUNC *execfunc, int f\0706n);
Xextern int more_named_cmd (void);
X
X#if OPT_PROCEDURES
Xextern int run_procedure (const char *name);
X#endif
X
X/* file.c */
Xextern SIGT imdying (int ACTUAL_SIG_ARGS);
Xextern int bp2readin (BUFFER *bp, int lockfl);
Xextern int getfile (char *fname, int lockfl);
Xextern int ifile (char *fname, int belowthisline, FILE *haveffp);
Xextern int kwrite (char *fn, int msgf);
Xextern int no_such_file (const char *fname);
Xextern int readin (char *fname, int lockfl, BUFFER *bp\1806mflg);
Xextern int same_fname (char *fname, BUFFER *bp, int lengthen);
Xextern int slowreadf (BUFFER *bp, int *nlinep);
Xextern int writeout (const char *fn, BUFFER *bp, int forced\0C06msgf);
Xextern int writeregion (void);
Xextern time_t file_modified (char *path);
Xextern void makename (char *bname, const char *fname);
Xextern void markWFMODE (BUFFER *bp);
Xextern void set_last_file_edited(const char *);
Xextern void unqname (char *name);
X
X#ifdef MDCHK_MODTIME
Xextern int ask_shouldchange (BUFFER *bp);
Xextern int check_modtime (BUFFER *bp, char *fn);
Xextern int check_visible_modtimes (void);
Xextern int get_modtime (BUFFER *bp, time_t *the_time);
Xextern void set_modtime (BUFFER *bp, char *fn);
X#endif
X
X#if OPT_ENCRYPT
Xextern int resetkey (BUFFER *bp, const char *fname);
X#endif
X
X#if SMALLER`09/* cancel neproto.h */
Xextern int filesave (int f, int n);
X#endif
X
X/* filec.c */
Xextern char *filec_expand (void);
Xextern int mlreply_dir (const char *prompt, TBUFF **buf, \1B06result);
Xextern int mlreply_file (const char *prompt, TBUFF **buf, int flag, \2506resul
Vt);
X
X#if COMPLETE_FILES `7C`7C\120ADIRS
Xextern int path_completion (DONE_ARGS);
Xextern void init_filec(const char *buffer_name);
X#endif
X
X/* fileio.c */
Xextern int ffaccess (char *fn, int mode);
Xextern int ffclose (void);
Xextern int ffexists (char *p);
Xextern int ffhasdata (void);
Xextern int ffputc (int c);
Xextern int ffputline (const char *buf, int nbuf, \1B0Cending);
Xextern int ffronly (char *fn);
Xextern int ffropen (char *fn);
Xextern int ffwopen (char *fn,\1706orced);
Xextern off_t ffsize (void);
X
X#if !(SYS_MSDOS `7C`7C SYS_WIN31)
Xextern int ffread (char *buf, long len);
Xextern void ffseek (long n);
Xextern void ffrewind (void);
X#endif
X
X/* finderr.c */
X#if OPT_FINDERR
Xextern void set_febuff (const char *name);
X#endif
X
X/* glob.c */
Xextern`09char **`09glob_free   (\1507list_of_items);
Xextern`09char **`09glob_string (\1506item);
Xextern`09int`09doglob (char *path);
Xextern`09int`09glob_length (char **list_of_items);
X
X#if !SYS_UNIX
Xextern`09int`09glob_needed (char **list_of_items);
Xextern`09void`09expand_wild_args (int *argcp, char ***argvp);
X#endif
X
X/* globals.c */
X
X/* history.c */
X#if OPT_HISTORY
Xextern`09int`09edithistory (TBUFF **buffer, unsigned *position, int *given, UI
VNT options\1A06(*func)(EOL_ARGS)\3106eolchar);
Xextern`09void`09hst_append (TBUFF *cmd, int glue);
Xextern`09void`09hst_append_s (char *cmd, int glue);
Xextern`09void`09hst_flush (void);
Xextern`09void`09hst_glue (int c);
Xextern`09void`09hst_init (int c);
Xextern`09void`09hst_remove (const char *cmd);
X#else
X#define`09hst_append(p,c)
X#define`09hst_append_s(p,c)
X#define`09hst_flush()
X#define`09hst_glue(c)
X#define`09hst_init(c)
X#define`09hst_remove(p)
X#endif
X
X/* ibmpc.c */
X#if SYS_MSDOS `7C`7C SYS_OS2\0B08WINNT
Xextern`09VIDEO *`09scread (\1007vp, int row);
Xextern`09void`09scwrite (int row, int col\0906nchar, const char *outstr, VIDEO
V_ATTR *attrstr, int forg\4706bacg);
X#endif
X
X/* input.c */
Xextern int dotcmdbegin (void);
Xextern int dotcmdfinish (void);
Xextern int end_string (void);
Xextern int eol_history(EOL_ARGS);
Xextern int get_recorded_char (int eatit);
Xextern int is_edit_char (int c);
Xextern int kbd_delimiter (void);
Xextern int kbd_is_pushed_back (void);
Xextern int kbd_replaying (int match);
Xextern int kbd_reply (const char *prompt, TBUFF **extbuf, int (*efunc)(EOL_ARG
VS)\1806eolchar, UINT options\3308c\3306DONE\3406);
Xextern int kbd_seq (void);
Xextern int kbd_seq_nomap (void);
Xextern int kbd_show_response (TBUFF **dst, char *src, unsigned bufn, int eolch
Var, UINT options);
Xextern int kbd_string (const char *prompt,\0E07extbuf, unsigned bufn, int eolc
Vhar, UINT options\1B06(*func)(DONE_ARGS));
Xextern int kbm_started (int macnum, int force);
Xextern int keystroke (void);
Xextern int keystroke8 (void);
Xextern int keystroke_avail (void);
Xextern int keystroke_raw8 (void);
Xextern int mapped_keystroke (void);
Xextern int mlquickask (const char *prompt, c\140Brespchars, int *cp);
Xextern int mlreply (const char *prompt,\0E07buf, int bufn);
Xextern int mlreply_no_bs (const char *prompt,\0E07buf, int bufn);
Xextern int mlreply_no_opts (const char *prompt,\0E07buf, int bufn);
Xextern int mlreply_reg (const char *prompt,\0E07cbuf, int *retp\0B06at_dft);
Xextern int mlreply_reg_count (int state, int *retp\0B07next);
Xextern int mlyesno (const char *prompt);
Xextern int no_completion (DONE_ARGS);
Xextern int screen_string (char *buf, int bufn, CHARTYPE inclchartype);
Xextern int start_kbm (int n, int macnum, ITBUFF *ptr);
Xextern int tgetc (int quoted);
Xextern int tgetc_avail (void);
Xextern void dotcmdstop (void);
Xextern void incr_dot_kregnum (void);
Xextern void kbd_kill_response (TBUFF *buf, unsigned *position, int c);
Xextern void kbd_pushback (TBUFF *buf, int skip);
Xextern void set_end_string (int c);
Xextern void tungetc(int c);
Xextern void unkeystroke (int c);
X
X#if COMPLETE_FILES
Xextern int shell_complete (DONE_ARGS);
X#else
X#define shell_complete no\0C08ion
X#endif
X
X/* insert.c */
Xextern int indentlen (LINE *lp);
Xextern int ins (void);
Xextern int ins_mode (WINDOW *wp);
Xextern int inschar (int c, int *backsp_limit_p);
Xextern int previndent (int *bracefp);
X
X#if OPT_EVAL
Xextern char *current_modename (void);
X#endif
X
X#if SMALLER`09/* cancel 'neproto.h' */
Xextern int newline (int f,\1406);
Xextern int wrapword (int f, int n);
X#endif
X
X/* isearch.c */
X#if SMALLER`09/* cancel 'neproto.h' */
Xextern int forwhunt (int f, int n);
Xextern int backhunt (int f, int n);
X#endif
X
X/* itbuff.c */
XALLOC_T`09 itb_length (ITBUFF *p);
XITBUFF * itb_alloc (\1408*p, ALLOC_T n);
XITBUFF * itb_append (\1508*p, int c);
XITBUFF * itb_bappend (\1608*, const char *s, ALLOC_T len);
XITBUFF * itb_copy (\1308*d, \1F08s);
XITBUFF * itb_init (\1308*p, int c);
XITBUFF * itb_sappend (\1608*, const char *s);
Xint`09 itb_get (ITBUFF *p, ALLOC_T n);
Xint`09 itb_last (ITBUFF *p);
Xint`09 itb_more (ITBUFF *p);
Xint`09 itb_next (ITBUFF *p);
Xint`09 itb_peek (ITBUFF *p);
Xint *`09 itb_values (ITBUFF *p);
Xvoid`09 itb_first (ITBUFF *p);
Xvoid`09 itb_free (ITBUFF **p);
Xvoid`09 itb_stuff (ITBUFF *p, int c);
X
X#if NEEDED
XITBUFF * itb_insert (\1508*p, int c);
Xvoid`09 itb_delete (ITBUFF *p, ALLOC_T cnt);
Xvoid`09 itb_unnext (ITBUFF *p);
Xvoid`09 itb_unput (ITBUFF *p);
X#endif
X
X/* lckfiles.c */
X#if OPT_LCKFILES
Xextern int set_lock (const char *fname,\0D07who, int n);
Xextern void release_lock (const char *fname);
X#endif
X
X/* line.c */
Xextern LINEPTR lalloc (int used, BUFFER *bp);
Xextern int do_report (L_NUM value);
Xextern int index2reg (int c);
Xextern int index2ukb (\0F06x);
Xextern int kinsert (int c);
Xextern int kinsertlater (int c);
Xextern int ldelete (long n, int kflag);
Xextern int linsert (int n, int c);
Xextern int lnewline (void);
Xextern int lstrinsert (const char *s,\1F06en);
Xextern int reg2index (int c);
Xextern void kdone (void);
Xextern void kregcirculate (int killing);
Xextern void ksetup (void);
Xextern void lfree (LINEPTR lp, BUFFER *bp);
Xextern void lremove (BUFFER *bp, LINEPTR lp);
Xextern void ltextfree (LINE *lp, BUFFER *bp);
X
X#if OPT_EVAL
Xextern char * getctext (CHARTYPE type);
Xextern int putctext (const char *iline);
X#endif
X
X#if SMALLER`09/* cancel neproto.h */
Xextern int insspace (int f, int n);
X#endif
X
X/* map.c */
Xextern int mapped_c (int remap, int raw);
Xextern int mapped_c_avail (void);
Xextern int mapped_ungotc_avail(void);
Xextern int sysmapped_c (void);
Xextern int sysmapped_c_avail (void);
Xextern void abbr_check (int *backsp_limit_p);
Xextern void addtosysmap (const char *seq, int seqlen\0C06code);
Xextern void mapungetc (int c);
X
X/* menu.c */
X#if OPT_MENUS
Xextern int parse_menu (const char *rc_filename);
X#if NEED_X_INCLUDES
Xextern void do_menu ( Widget menub );
X#endif
X#endif
X
X/* msgs.c */
X#if OPT_POPUP_MSGS
Xvoid msg_putc (int c);
Xvoid popup_msgs (void);
Xvoid purge_msgs (void);
X#endif
X
X/* modes.c */
Xextern REGEXVAL *new_regexval (const char *pattern, int magic);
Xextern char *string_mode_val (VALARGS *args);
Xextern int adjvalueset (const char *cp, int setting\0D06global, VALARGS *args)
V;
Xextern int find_mode (const char *mode, int global, VALARGS *args);
Xextern int mode_eol (EOL_ARGS);
Xextern int set_mode_value(const char *cp,\2308ting\0D06global, VALARGS *args,
V \380Crp);
Xextern int string_to_number (const char *from, int *np);
Xextern void copy_mvals (int maximum, struct VAL *dst\110Esrc);
Xextern void free_local_vals (const struct VALNAMES *names,\180B *gbl\110Eval);
V
X
X#if OPT_EVAL `7C`7C OPT_COLOR
Xextern int set_ncolors(int \0C07);
X#endif
X
X#if OPT_EVAL `7C`7C OPT_MAJORMODE
Xextern int is_varmode ( const char *name );
Xextern const char *\0C06* list_of_modes (void);
X#endif
X
X#if OPT_MAJORMODE
Xextern int alloc_mode(const char *name, int predef);
Xextern void set_majormode_rexp(const char *name, int n, \190Cpat);
Xextern void set_submode_val(const char *name, int n\0706value);
Xextern void setm_by_suffix (BUFFER *bp);
Xextern void setm_by_preamble (BUFFER *bp);
X#else
X#define setm_by_suffix(bp) fix_cmode(bp, (global_b_val(MDCMOD) `26`26 has_C
V\380B))
X#define setm_by_preamble(bp) /* nothing */
X#endif
X
X#if OPT_UPBUFF
Xextern void save_vals (int maximum, struct VAL *gbl\110Edst\220Esrc);
X#endif
X
X/* npopen.c */
X#if SYS_UNIX `7C`7C SYS_MSDOS\0D08WIN31\1A08OS2\180BNT
Xextern FILE * npopen (char *cmd, const char *type);
Xextern void npclose (FILE *fp);
Xextern int inout_popen (FILE **fr, \0B08w, char *cmd);
Xextern int softfork (void);
X#endif
X
X#if SYS_UNIX `7C`7C SYS_OS2\0B08WINNT
Xextern int system_SHELL (char *cmd);
X#endif
X
X#if SYS_MSDOS `7C`7C SYS_WIN31 &027C (SYS_OS2 `26`26 CC_CSETPP) &027C TEST_DOS
V_PIPES
Xextern void npflush (void);
X#endif
X
X/* ntconio.c */
X#if DISP_NTCONS
Xextern void ntcons_reopen(void);
X#endif
X
X/* oneliner.c */
Xextern int llineregion (void);
Xextern int plineregion (void);
Xextern int pplineregion (void);
Xextern int subst_again_region (void);
Xextern int substregion (void);
X
X/* opers.c */
Xextern int vile_op (int f, int n, OpsFunc fn, const char *str);
X
X/* path.c */
Xextern char * is_appendname (\1606fn);
Xextern char * last_slash (\1306fn);
Xextern char * lengthen_path (\1606path);
Xextern char * pathcat (\1006dst, const\2107path, char *leaf);
Xextern char * pathleaf (\1106path);
Xextern char * shorten_path (\1506path, int keep_cwd);
Xextern int is_directory (char *path);
Xextern int is_internalname (const char *fn);
Xextern int is_pathname (char *path);
Xextern int is_scratchname (const char *fn);
Xextern int maybe_pathname (char *fn);
X
X#if OPT_MSDOS_PATH
Xextern char * is_msdos_drive (\1706path);
Xextern char * sl_to_bsl (const\1807p);
X#endif
X
X#ifndef bsl_to_sl_inplace
Xextern void bsl_to_sl_inplace (char *p);
X#endif
X
X#if OPT_PATHLOOKUP `26`26 (SYS_UNIX`7C`7CSYS_VMS&027COPT_MSDOS_PATH)
Xextern const char *parse_pathlist (\1C0Clist,\2807result);
X#endif
X
X#if OPT_CASELESS `26`26 SYS_OS2
Xextern int is_case_preserving (const char *name);
X#endif
X
X#if OPT_VMS_PATH
Xextern char * strip_version (\1606path);
Xextern char * unix_pathleaf (\1606path);
Xextern char * vms_pathleaf (\1506path);
Xextern int is_vms_pathname (const char *path, int option);
X#endif
X
X#if SYS_UNIX
Xextern char * home_path (\1206path);
X#endif
X
X/* random.c */
Xextern L_NUM line_count (BUFFER *the_buffer);
Xextern L_NUM line_no (BUFFER *the_buffer, LINEPTR the_line);
Xextern char * current_directory (int force);
Xextern int fmatchindent (int c);
Xextern int getccol (int bflg);
Xextern int getcol (MARK mark, int actual);
Xextern int getoff (C_NUM goal, \0C06*rcolp);
Xextern int gocol (int n);
Xextern int is_user_fence (int ch, int *sdirp);
Xextern int line_report (L_NUM before);
Xextern int liststuff (const char *name, int appendit, void (*)(LIST_ARGS)\2306
Viarg\1F07*vargp);
Xextern int set_directory (const char *dir);
Xextern void catnap (int milli, int watchinput);
Xextern void ch_fname (BUFFER *bp, const char *fname);
Xextern void set_rdonly (BUFFER *bp, const char *name, int mode);
X
X#if OPT_EVAL
Xextern L_NUM getcline (void);
Xextern char * previous_directory (void);
X#endif
X
X#if SYS_MSDOS `7C`7C SYS_OS2\0B08WINNT
Xextern const char * curr_dir_on_drive (int drive);
Xextern int curdrive (void);
Xextern int setdrive (int d);
Xextern void update_dos_drv_dir (char * cwd);
X# if CC_WATCOM
X     extern int dos_crit_handler (unsigned deverror, \1309errcode\120B*devhdr)
V;
X# else
X     extern void dos_crit_handler (void);
X# endif
X# if OPT_MS_MOUSE
X     extern int ms_exists (void);
X     extern void ms_processing (void);
X# endif
X#endif
X
X/* regexp.c */
Xextern regexp * regcomp (char *origexp, int magic);
Xextern int regexec (regexp *prog, char *strin\0E0Egend, int startoff\0E06endo
Vff);
Xextern int lregexec (regexp *prog, LINE *lp, int startoff\0E06endoff);
X
X/* region.c */
Xextern int blank_region (void);
Xextern int cryptregion (void);
Xextern int detab_region (void);
Xextern int detabline (void *flagp, int l\0706r);
Xextern int entab_region (void);
Xextern int entabline (void *flagp, int l\0706r);
Xextern int flipregion (void);
Xextern int get_fl_region (REGION *rp);
Xextern int getregion (REGION *rp);
Xextern int killregion (void);
Xextern int killregionmaybesave (int save);
Xextern int lowerregion (void);
Xextern int openregion (void);
Xextern int shiftlregion (void);
Xextern int shiftrregion (void);
Xextern int stringrect (void);
Xextern int trim_region (void);
Xextern int trimline (void *flagp, int l\0706r);
Xextern int upperregion (void);
Xextern int yankregion (void);
X
X#if NEEDED
Xextern int charprocreg (int (*)(int));
X#endif
X
X/* search.c */
Xextern int findpat (int f, int n, regexp *exp\1406direc);
Xextern int fsearch (int f, int n\0706marking\1406fromscreen);
Xextern int readpattern (const char *prompt,\0E07apat, regexp **srchexpp, int c
V\0706fromscreen);
Xextern int scanner (regexp *exp, int direct\0C06wrapok\1806*wrappedp);
Xextern void attrib_matches (void);
Xextern void regerror (const char *s);
Xextern void scanboundry (int wrapok, MARK dot, int dir);
X
X#if OPT_EVAL `7C`7C UNUSED
Xextern int eq (int bc, int pc);
X#endif
X
X#if OPT_HILITEMATCH
Xvoid clobber_save_curbp(BUFFER *bp);
X#endif
X
X/* select.c */
X#if OPT_SELECTIONS
Xextern`09int`09assign_attr_id`09(void);
Xextern`09int`09attribute_cntl_a_sequences_over_region(REGION *rp, \0C06SHAPE s
Vhape);
Xextern`09int`09attributeregion (void);
Xextern`09int`09attributeregion_over_\0C06(REGION *rp, \0C06SHAPE shape,
X`09`09`09        \0808    VIDEO_ATTR vattr, char *hc);
Xextern`09int`09sel_begin`09(void);
Xextern`09int`09sel_extend`09(int wiping, int include_dot);
Xextern`09int`09sel_setshape`09(REGIONSHAPE shape);
Xextern`09void`09find_release_attr (BUFFER *bp, REGION *rp);
Xextern`09void`09free_attrib`09(BUFFER *bp, AREGION *ap);
Xextern`09void`09free_attribs`09(BUFFER *bp);
Xextern`09void`09sel_reassert_ownership (BUFFER *bp);
Xextern`09void`09sel_release`09(void);
X#if OPT_SEL_YANK
Xextern`09int`09sel_yank`09(int reg);
Xextern`09int`09sel_attached`09(void);
Xextern`09BUFFER *sel_buffer`09(void);
X#endif
X#if OPT_PERL `7C`7C OPT_TCL
Xextern`09BUFFER *get_selection_buffer_and_region(AREGION *arp);
X#endif /* OPT_PERL `7C`7C OPT_TCL */
X#endif /* OPT_SELECTIONS */
X
X/* spawn.c */
X#if OPT_SHELL
Xextern SIGT rtfrmshell (int ACTUAL_SIG_ARGS);
Xextern void pressreturn (void);
Xextern int filterregion (void);
X#else
X#define pressreturn() (void)keystroke()
X#endif
X
X/* tags.c */
X#if OPT_TAGS
Xextern int cmdlinetag (const char *t);
X#endif /* OPT_TAGS */
X
X/* tbuff.c */
XALLOC_T`09tb_length (TBUFF *p);
XTBUFF *`09tb_alloc (\1207*p, ALLOC_T n);
XTBUFF *`09tb_append (\1307*p, int c);
XTBUFF *`09tb_bappend (\1407*p, const char *s, ALLOC_T len);
XTBUFF *`09tb_copy (\1107*d, \1C07s);
XTBUFF *`09tb_init (\1107*p, int c);
XTBUFF *`09tb_insert (\1307*p, ALLOC_T n, int c);
XTBUFF *`09tb_put (\1007*p, ALLOC_T n, int c);
XTBUFF *`09tb_sappend (\1407*p, const char *s);
XTBUFF *`09tb_scopy (\1207*p, const char *s);
XTBUFF *`09tb_string (const char *s);
Xchar *`09tb_values (TBUFF *p);
Xint`09tb_get (TBUFF *p, ALLOC_T n);
Xint`09tb_more (TBUFF *p);
Xint`09tb_next (TBUFF *p);
Xint`09tb_peek (TBUFF *p);
Xvoid`09tb_first (TBUFF *p);
Xvoid`09tb_free (TBUFF **p);
Xvoid`09tb_stuff (TBUFF *p, int c);
Xvoid`09tb_unnext (TBUFF *p);
Xvoid`09tb_unput (TBUFF *p);
X
X/* termio.c */
Xextern OUTC_DCL ttputc (OUTC_ARGS);
Xextern int open_terminal (TERM *termp);
Xextern int ttgetc (void);
Xextern int tttypahead (void);
Xextern void null_t_icursor (int c);
Xextern void null_t_pflush (void);
Xextern void null_t_scroll (int f, int t\0706n);
Xextern void null_t_setback (int b);
Xextern void null_t_setfor (int f);
Xextern void null_t_setpal (const char *p);
Xextern void null_t_title (char *t);
Xextern int  null_t_watchfd (int fd, WATCHTYPE type, long *idp);
Xextern void null_t_unwatchfd (int fd, long id);
Xextern void ttclean (int f);
Xextern void ttclose (void);
Xextern void ttflush (void);
Xextern void ttopen (void);
Xextern void ttunclean (void);
X
X/* undo.c */
Xextern void copy_for_undo (LINEPTR lp);
Xextern void dumpuline (LINEPTR lp);
Xextern void freeundostacks (BUFFER *bp, int both);
Xextern void mayneedundo (void);
Xextern void nounmodifiable (BUFFER *bp);
Xextern void tag_for_undo (LINEPTR lp);
Xextern void toss_to_undo (LINEPTR lp);
X
X/* version.c */
Xextern const char * getversion (void);
Xextern const char * non_filename (void);
Xextern void print_usage (void);
X
X/* vms2unix.c */
X#if OPT_VMS_PATH
Xextern`09char *`09is_vms_dirtype`09(\1706path);
Xextern`09char *`09is_vms_rootdir`09(\1706path);
Xextern`09char *`09unix2vms_path   (\1806dst, const char *src);
Xextern`09char *`09vms2unix_path   (\1806dst, const char *src);
Xextern`09char *`09vms_path2dir    (const \1E06src);
Xextern`09void`09vms_dir2path`09(char *path);
X#endif
X
X/* vmspipe.c */
X#if SYS_VMS
Xextern FILE *vms_rpipe (const char *cmd, int fd, \190Cinput_file);
X#endif
X
X/* w32misc.c */
X#if SYS_WINNT
Xextern char *mk_shell_cmd_str(\1706cmd, int *allocd_mem\1106prepend_shc);
Xextern int  is_win95(void);
Xextern int  is_winnt(void);
Xextern int  w32_inout_popen(FILE **fr, \0B08w, char *cmd);
Xextern int  w32_system(const char *cmd);
Xextern void restore_console_title(void);
Xextern void set_console_title(const char *title);
Xextern void w32_npclose(FILE *fp);
X#endif
X
X/* watchfd.c */
Xextern int watchfd(int fd, WATCHTYPE type, char *callback);
Xextern void unwatchfd(int fd);
Xextern void dowatchcallback(int fd);
X
X/* window.c */
Xextern WINDOW * wpopup (void);
Xextern int delwp (WINDOW *thewp);
Xextern int set_curwp (WINDOW *wp);
Xextern void copy_traits (W_TRAITS *dst, \0F0Asrc);
Xextern void shrinkwrap (void);
Xextern void winit (int screen);
X
X#if OPT_EVAL
Xextern int getwpos (void);
X#endif
X
X#if SMALLER`09/* cancel neproto.h */
Xextern int reposition (int f, int n);
Xextern int resize (int f, int n);
X#endif
X
X#if OPT_SEL_YANK `7C`7C OPT_PERL
Xextern WINDOW * push_fake_win(BUFFER *bp);
Xextern BUFFER * pop_fake_win(WINDOW *oldwp);
X#endif
X
X/* word.c */
Xextern const char * token (\140Csrc,\1F07tok, int eolchar);
Xextern const char * tokval (\150Ctokn);
Xextern int ffgetline (int *lenp);
Xextern int formatregion (void);
Xextern int isendviwordf (void);
Xextern int isendwordf (void);
+-+-+-+-+-+-+-+-  END  OF PART 95 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 96 -+-+-+-+-+-+-+-+
Xextern int isnewviwordb (void);
Xextern int isnewviwordf (void);
Xextern int isnewwordb (void);
Xextern int isnewwordf (void);
Xextern int joinregion (void);
Xextern int macarg (char *tok);
Xextern int macliteralarg (TBUFF **tok);
Xextern int macroize (TBUFF **p, \0B07src, int skip);
Xextern int toktyp (const char *tokn);
Xextern void fmatch (int rch);
Xextern void setchartype (void);
X
X/* x11.c */
X#if DISP_X11
Xextern`09char *`09x_current_fontname`09(void);
Xextern`09char *`09x_get_icon_name (void);
Xextern`09char *`09x_get_window_name (void);
Xextern`09int`09x_setfont`09`09(const char *fname);
Xextern`09int`09x_typahead`09`09(int milli);
Xextern`09void`09x_move_events`09`09(void);
Xextern`09void`09x_preparse_args`09`09(int *pargc, char ***pargv);
Xextern`09void`09x_resize`09`09(int cols, int rows);
Xextern`09void`09x_set_icon_name (const char *name);
Xextern`09void`09x_set_window_name (const char *name);
X
X#if XTOOLKIT
Xextern`09void`09own_selection`09`09(void);
Xextern`09void`09update_scrollbar`09(WINDOW *uwp);
X#else`09/* !XTOOLKIT */
Xextern`09void`09x_set_rv`09`09(void);
Xextern`09void`09x_setname`09`09(char *name);
Xextern`09void`09x_set_wm_title`09`09(char *name);
Xextern`09void`09x_setforeground`09`09(char *colorname);
Xextern`09void`09x_setbackground`09`09(char *colorname);
Xextern  void`09x_set_geometry`09`09(char *g);
Xextern`09void`09x_set_dpy`09`09(char *dn);
Xextern`09int`09x_key_events_ready`09(void);
X#endif`09/* !XTOOKIT */
X
X#if OPT_MENUS
Xextern`09int`09x_menu_height`09`09(void);
X#endif
X
X#if OPT_WORKING
Xextern`09void`09x_working`09`09(void);
X#endif
X
X#endif`09/* DISP_X11 */
X
X#if NO_LEAKS
Xextern`09void`09bind_leaks (void);
Xextern`09void`09bp_leaks (void);
Xextern`09void`09ev_leaks (void);
Xextern`09void`09itb_leaks (void);
Xextern`09void`09kbs_leaks (void);
Xextern`09void`09map_leaks (void);
Xextern`09void`09mode_leaks (void);
Xextern`09void`09onel_leaks (void);
Xextern`09void`09path_leaks (void);
Xextern`09void`09tags_leaks (void);
Xextern`09void`09tb_leaks (void);
Xextern`09void`09vt_leaks (void);
Xextern`09void`09wp_leaks (void);
X
X#if DISP_X11
Xextern`09void`09x11_leaks`09`09(void);
X#endif
X
X#endif
X
X#if SYS_UNIX
X#if MISSING_EXTERN__FILBUF
Xextern`09int`09_filbuf`09(FILE *fp);
X#endif
X#if MISSING_EXTERN__FLSBUF
Xextern`09int`09_flsbuf`09(int n, FILE *fp);
X#endif
X#if MISSING_EXTERN_ACCESS
Xextern`09int`09access`09(const char *path, int mode);
X#endif
X#if MISSING_EXTERN_ALARM
Xextern`09UINT`09alarm`09(UINT secs);
X#endif
X#if MISSING_EXTERN_ATOI
Xextern int`09atoi`09(const char *s);
X#endif
X#if MISSING_EXTERN_BZERO
Xextern`09void`09bzero`09(char *b, int n);
X#endif
X#if MISSING_EXTERN_CHDIR
Xextern`09int`09chdir`09(const char *path);
X#endif
X#if MISSING_EXTERN_CLOSE
Xextern`09int`09close`09(int fd);
X#endif
X#if MISSING_EXTERN_DUP
Xextern`09int`09dup`09(int fd);
X#endif
X#if MISSING_EXTERN_EXECLP
Xextern`09int`09execlp`09(const char *path, ...);
X#endif
X#if MISSING_EXTERN_FCLOSE
Xextern`09int`09fclose`09(FILE *fp);
X#endif
X#if MISSING_EXTERN_FCLOSE
Xextern`09int`09fflush`09(FILE *fp);
X#endif
X#if MISSING_EXTERN_FGETC
Xextern`09int`09fgetc`09(FILE *fp);
X#endif
X#if MISSING_EXTERN_FILENO `26`26 !defined(fileno)
Xextern`09int`09fileno`09(FILE *fp);
X#endif
X#if MISSING_EXTERN_FORK
Xextern`09int`09fork`09(void);
X#endif
X#if MISSING_EXTERN_FPRINTF
Xextern`09int`09fprintf`09(FILE *fp, const char *fmt, ...);
X#endif
X#if MISSING_EXTERN_FPUTC
Xextern`09int`09fputc`09(int c, FILE *fp);
X#endif
X#if MISSING_EXTERN_FPUTS
Xextern`09int`09fputs`09(const char *s, FILE *fp);
X#endif
X#if MISSING_EXTERN_FREAD
Xextern`09int`09fread`09(char *ptr, SIZE_T size\0D09nmemb, FILE *fp);
X#endif
X#if MISSING_EXTERN_FREE
Xextern void`09free`09(void *ptr);
X#endif
X#if MISSING_EXTERN_FSEEK
Xextern`09int`09fseek`09(FILE *fp, long offset, int whence);
X#endif
X#if MISSING_EXTERN_FWRITE
Xextern`09int`09fwrite`09(const char *ptr, SIZE_T size\0D09nmemb, FILE *fp);
X#endif
X#if MISSING_EXTERN_GETCWD `26`26 HAVE\0F07
Xextern`09char *`09getcwd (\0F06buffer, int len);
X#endif
X#if MISSING_EXTERN_GETENV
Xextern`09char *`09getenv`09(const \1506name);
X#endif
X#if MISSING_EXTERN_GETPASS
Xextern`09char *`09getpass`09(const \1606prompt);
X#endif
X#if MISSING_EXTERN_GETHOSTNAME `26`26 HAVE\140C
Xextern`09int`09gethostname (char *name, int len);
X#endif
X#if MISSING_EXTERN_GETPGRP
Xextern`09int`09getpgrp`09(int pid);
X#endif
X#if MISSING_EXTERN_GETPID
Xextern`09int`09getpid`09(void);
X#endif
X#if MISSING_EXTERN_GETUID
Xextern`09int`09getuid`09(void);
X#endif
X#if MISSING_EXTERN_GETWD `26`26 HAVE\0E06
Xextern`09char *`09getwd`09(\0E06buffer);
X#endif
X#if MISSING_EXTERN_IOCTL
Xextern`09int`09ioctl`09(int fd, ULONG mask, caddr_t ptr);
X#endif
X#if MISSING_EXTERN_ISATTY
Xextern`09int`09isatty`09(int fd);
X#endif
X#if MISSING_EXTERN_KILL
Xextern`09int`09kill`09(int pid, int sig);
X#endif
X#if MISSING_EXTERN_KILLPG `26`26 HAVE\0F07
Xextern`09int`09killpg`09(int pgrp, int sig);
X#endif
X#if MISSING_EXTERN_LINK `26`26 HAVE_LINK
Xextern`09int`09link`09(const char *, c\0E0B);
X#endif
X#if MISSING_EXTERN_LONGJMP
Xextern`09void`09longjmp`09(jmp_buf env, int val);
X#endif
X#if MISSING_EXTERN_LSTAT
Xextern`09int`09lstat (const char *path, struct stat *sb);
X#endif
X#if MISSING_EXTERN_MEMSET
Xextern`09void *`09memset`09(\0F06dst, int ch, size_t n);
X#endif
X#if MISSING_EXTERN_MKDIR `26`26 HAVE\0E06
Xextern`09int`09mkdir`09(const char *path, int mode);
X#endif
X#if MISSING_EXTERN_MKTEMP
Xextern`09char *`09mktemp (\0F06template);
X#endif
X#if MISSING_EXTERN_OPEN
Xextern`09int`09open`09(char *path, int flags);
X#endif
X#if MISSING_EXTERN_PERROR
Xextern`09void`09perror`09(const char *s);
X#endif
X#if MISSING_EXTERN_PIPE
Xextern`09int`09pipe`09(int filedes`5B2`5D);
X#endif
X#if MISSING_EXTERN_PRINTF
Xextern`09int`09printf`09(const char *fmt, ...);
X#endif
X#if MISSING_EXTERN_PUTS
Xextern`09int`09puts`09(const char *s);
X#endif
X#if MISSING_EXTERN_QSORT
X#if ANSI_QSORT
Xextern void qsort (void *base, size_t nmemb\0E09size, int (*compar)(const`20
V\3B06a, \0F0Cb);
X#else
Xextern void qsort (void *base, size_t nmemb\0E09size, int (*compar)(char **a,
V \0A07b);
X#endif
X#endif
X#if MISSING_EXTERN_READ
Xextern`09int`09read`09(int fd, char *buffer, SIZE_T size);
X#endif
X#if MISSING_EXTERN_READLINK
Xextern`09int`09readlink (const char *path,\0C07buffer, size_t size);
X#endif
X#if MISSING_EXTERN_SELECT `26`26 HAVE\0F07
Xextern`09int`09select`09(int numfds, fd_set *read\110Dwrite\230Dexceptfds, str
Vuct timeval *timeout);
X#endif
X#if MISSING_EXTERN_SETBUF
Xextern`09void`09setbuf`09(FILE *fp, char *buffer);
X#endif
X#if MISSING_EXTERN_SETBUFFER
Xextern`09void`09setbuffer (FILE *fp, char *\1806, int size);
X#endif
X#if MISSING_EXTERN_SETITIMER `26`26 HAVE\120A
Xextern`09int`09setitimer (int which, const struct \2006val *value, \1912ovalue
V);
X#endif
X#if MISSING_EXTERN_SETJMP `26`26 !defined(setjmp)
Xextern`09int`09setjmp`09(jmp_buf env);
X#endif
X#if MISSING_EXTERN_SETPGRP
X#if SETPGRP_VOID
Xextern`09pid_t`09setpgrp`09(void);
X#else
Xextern`09int`09setpgrp`09(int pid, int pgid);
X#endif
X#endif
X#if MISSING_EXTERN_SETSID
Xextern`09pid_t`09setsid`09(void);
X#endif
X#if MISSING_EXTERN_SETVBUF
X#if SETVBUF_REVERSED
Xextern`09int`09setvbuf (FILE *fp, int mode, char *buffer, size_t size);
X#else
Xextern`09int`09setvbuf (FILE *fp, char *buffer, int mode, size_t size);
X#endif
X#endif
X#if MISSING_EXTERN_SLEEP
Xextern`09int`09sleep`09(UINT secs);
X#endif
X#if MISSING_EXTERN_SSCANF
Xextern`09int`09sscanf`09(const char *src, c\110Bfmt, ...);
X#endif
X#if MISSING_EXTERN_STRERROR
Xextern`09char *`09strerror (int code);
X#endif
X#if MISSING_EXTERN_STRTOL
Xextern`09long`09strtol`09(const char *nptr,\0C07*endptr, int base);
X#endif
X#if MISSING_EXTERN_SYSTEM
Xextern`09int`09system`09(const char *cmd);
X#endif
X#if MISSING_EXTERN_TIME
Xextern`09time_t`09time`09(\0D06 *t);
X#endif
X#if MISSING_EXTERN_UNLINK
Xextern`09int`09unlink`09(char *path);
X#endif
X#if MISSING_EXTERN_UTIME `26`26 HAVE\0E06
Xextern`09int`09utime`09(const char *path, const struct utimbuf *t);
X#endif
X#if MISSING_EXTERN_UTIMES `26`26 HAVE\0F07
Xextern`09int`09utimes`09(const char *path, struct timeval *t);
X#endif
X#if MISSING_EXTERN_WAIT
Xextern`09int`09wait`09(int *sb);
X#endif
X#if MISSING_EXTERN_WRITE
Xextern`09int`09write`09(int fd, const char *buffer, int size);
X#endif
X#endif
X
X#ifdef __cplusplus
X`7D
X#endif
X
X#endif /* VILE_PROTO_H */
$ call unpack [.VILE-8_0]PROTO.H;1 -
 289159959 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 76 99 152
$!
$ create 'f'
X/* The following set of definitions comprise the interface to pscreen
X * in display.c.
X */
X
X#ifndef PSCREEN_H
X#define PSCREEN_H 1
X
Xextern VIDEO **pscreen;
X
X#define IS_DIRTY_LINE(r)`09(pscreen`5B(r)`5D->v_flag `26 VFCHG)
X#define IS_DIRTY(r,c)`09`09(pscreen`5B(r)`5D->v_attrs`5B(c)`5D `26 VADIRTY)
X#define IS_REVERSED(r,c)`09((pscreen`5B(r)`5D->v_attrs`5B(c)`5D `26 (VAREV`7CV
VASEL)) != 0)
X#define MARK_LINE_DIRTY(r)`09(pscreen`5B(r)`5D->v_flag `7C= VFCHG)
X#define MARK_CELL_DIRTY(r,c)`09(pscreen`5B(r)`5D->v_attrs`5B(c)`5D `7C= VADIRT
VY)
X#define CLEAR_LINE_DIRTY(r)`09(pscreen`5B(r)`5D->v_flag `26= `7EVFCHG)
X#define CLEAR_CELL_DIRTY(r,c)`09(pscreen`5B(r)`5D->v_attrs`5B(c)`5D `26= `7EVA
VDIRTY)
X#define CELL_TEXT(r,c)`09`09(pscreen`5B(r)`5D->v_text`5B(c)`5D)
X#define CELL_ATTR(r,c)`09`09(pscreen`5B(r)`5D->v_attrs`5B(c)`5D)
X
X#endif /* PSCREEN_H */
$ call unpack [.VILE-8_0]PSCREEN.H;1 -
 1096495331 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 2 100 152
$!
$ create 'f'
XTYPEMAP
XVileBuf`09* T_\0C07
X
XINPUT
XT_VileBuf
X`09if (sv_isa($arg, `5C"Vile::Buffer`5C")) `7B
X`09    IV tmp = SvIV((SV*)GvSV((GV*)SvRV($arg)));`20
X`09    $var = ($type) tmp;
X`09    if (!tmp)
X`09`09croak(`5C"buffer no longer exists`5C");
X`09`7D
X`09else
X`09    croak(`5C"$var is not of type $`7Bntype`7D`5C")
X
X
XOUTPUT
XT_VileBuf
X`09if ($var != 0)
X`09    newVBrv($arg, $var);
X`09else
X`09    sv_setsv($arg, `26sv_undef);
$ call unpack [.VILE-8_0]PTYPEMAP.;1 -
 1208763833 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 1 101 152
$!
$ create 'f'
X/*
X * This file contains the command processing functions for a number of random
V
X * commands. There is no functional grouping here, for sure.
X *
X * $Header: /usr/build/vile/vile/RCS/random.c,v 1.191 1998/04/28 10:18:29 tom
V Exp $
X *
X */
X
X#ifdef _WIN32
X# include <windows.h>
X#endif
X
X#include`09"estruct.h"
X#include`09"edef.h"
X#include`09"nefunc.h"
X
X#if SYS_UNIX
X#if HAVE_POLL `26`26\0D0A_H
X# include <poll.h>
X#endif
X#endif
X
X#include`09"dirstuff.h"
X
X#if CC_TURBO
X#include <dir.h>`09/* for 'chdir()' */
X#endif
X
X#if SYS_VMS
X#include <starlet.h>
X#include <lib$routines.h>
X#endif
X
X/*--------\0808\1010\2020\400A*/
X
X/*
X * Set default parameters for an automatically-generated, view-only buffer.
X * This is invoked after buffer creation, but usually before the \2807is
X * loaded with text.
X * the "mode" argument should be MDVIEW or MDREADONLY
X */
Xvoid
Xset_rdonly(BUFFER *bp, const char *name, int mode)
X`7B
X`09ch_fname(bp, name);
X
X`09b_clr_changed(bp);`09`09/* assumes text is loaded... */
X`09bp->b_active = TRUE;
X
X`09make_local_b_val(bp, mode);
X`09set_b_val(bp,mode,TRUE);
X
X`09make_local_b_val(bp,VAL_TAB);
X`09set_b_val(bp,VAL_TAB,8);
X
X`09make_local_b_val(bp,MDDOS);
X`09set_b_val(bp, MDDOS, CRLF_LINES);
X
X`09fix_cmode(bp, FALSE);
X`7D
X
X/* generic "lister", which takes care of popping a window/buffer pair under
X`09the given name, and calling "func" with a couple of args to fill in
X`09the buffer */
Xint
Xliststuff(
Xconst char *name,
Xint appendit,
Xvoid (*func) (LIST_ARGS),`09/* ptr to function to execute */
Xint iarg,
Xvoid *vargp)
X`7B
X`09register BUFFER *bp;
X`09register int`09s;
X`09WINDOW  *wp;
X`09int alreadypopped;
X`09BUFFER *ocurbp = curbp;
X
X`09/* create the buffer list\0C08  */
X`09bp = bfind(name, BFSCRTCH);
X`09if (bp == NULL)
X`09`09return FALSE;
X
X`09if (!appendit `26`26 (s=bclear(bp)) != TRUE) /* clear old text (?) */
X`09`09return (s);
X`09b_set_scratch(bp);
X`09alreadypopped = (bp->b_nwnd != 0);
X`09if (popupbuff(bp) == FALSE) `7B
X`09`09(void)zotbuf(bp);
X`09`09return (FALSE);
X`09`7D
X
X`09if ((wp = bp2any_wp(bp)) != NULL) `7B
X`09`09make_local_w_val(wp,WMDNUMBER);
X`09`09set_w_val(wp,WMDNUMBER,FALSE);
X`09`7D
X`09if (appendit) `7B
X`09`09(void)gotoeob(FALSE,1);
X`09`09MK = DOT;
X`09`7D
X`09/* call the passed in function, giving it both the integer and
X`09`09character pointer arguments */
X`09(*func)(iarg,vargp);
X`09if (alreadypopped `26`26 appendit) `7B
X`09`09(void)gomark(FALSE,1);
X`09`09(void)forwbline(FALSE,1);
X`09`09(void)reposition(FALSE,1);
X`09`7D else `7B /* if we're not appending, go to the top */
X`09`09(void)gotobob(FALSE,1);
X`09`7D
X`09set_rdonly(bp, non_filename(), MDVIEW);
X
X`09if (alreadypopped) /* don't switch to the popup if it wasn't there */
X`09`09swbuffer(ocurbp);
X`09else
X`09`09shrinkwrap(); /* only resize if it's fresh */
X
X`09return TRUE;
X`7D
X
X/*
X * Display the current position of\1808sor, lines and columns, in the file,
X * the character that is under the cursor (in hex), and the fraction of the
X * text that is before the cursor. The displayed column is not the current
X * column, but the\1007 that would be used on an infinite width display.
X */
X/* ARGSUSED */
Xint
Xshowcpos(int f GCC_UNUSED, int n\120B)
X`7B
X`09register LINE`09*lp;`09`09/* current line */
X`09register B_COUNT numchars = 0;`09/* # of \1306in file */
X`09register L_NUM`09 numlines = 0;`09/* # of \1306in file */
X`09register B_COUNT predchars = 0;`09/* # \1006preceding point */
X`09register L_NUM`09 predlines = 0;`09/* # \1006preceding point */
X`09register int`09curchar = '`5Cn';`09/* character under cursor */
X`09long ratio;
X`09C_NUM col;
X`09C_NUM savepos;`09`09`09/* temp save for current offset */
X`09C_NUM ecol;`09`09`09/* column pos/end of current line */
X
X#if CC_WATCOM `7C`7C CC_DJGPP /* for testing interrupts */
X`09if (f `26`26 n == 11) `7B
X`09`09mlwrite("DOS interrupt test.  hit control-C or\0D09BREAK");
X`09`09while (!interrupted())
X`09`09`09;
X`09`09mlwrite("whew.  got interrupted");
X`09`09return ABORT;
X`09`7D
X#endif
X#if debug_undo_log
X`09extern int do_undolog;
X`09if (f `26`26 n == 11)
X`09`09do_undolog = !\0E0A;
X#endif
X`09/* count chars and lines */
X`09for_each_line(lp, curbp) `7B
X`09`09/* if we are on the current line, record it */
X`09`09if (lp == DOT.l) `7B
X`09`09`09predlines = numlines;
X`09`09`09predchars = num\0B06+ DOT.o;
X`09`09`09if (DOT.o == llength(lp))
X`09`09&0209curchar = '`5Cn';
X`09`09`09else
X`09`09&0209curchar = char_at(DOT);
X`09`09`7D
X`09`09/* on to the next line */
X`09`09++numlines;
X`09`09numchars += llength(lp) + 1;
X`09`7D
X
X`09if (!b_val(curbp,MDNEWLINE))
X`09`09numchars--;
X
X`09/* if at end of file, record it */
X`09if (is_header_line(DOT,curbp)) `7B
X`09`09predlines = numlines;
X`09`09predchars = numchars;
X`09`7D
X
X`09/* Get real column and end-of-line\1707. */
X`09col = mk_to_vcol(DOT, FALSE, 0);
X`09savepos = DOT.o;
X`09DOT.o = llength(DOT.l);
X`09ecol = mk_to_vcol(DOT, FALSE, 0);
X`09DOT.o = savepos;
X
X`09ratio = 0;`09`09/* Ratio before dot. */
X`09if (numchars != 0)
X`09`09ratio = (100L*predchars) / numchars;
X
X`09/* summarize and report the info */
X`09mlforce(
X"Line %d of %d, Col\0E0Char %D of %D (%D%%) char is 0x%x or 0%o",
X`09`09predlines+1, numlines, col+1, ecol,
X`09`09predchars+1, numchars, ratio, curchar\0909);
X`09return TRUE;
X`7D
X
X/* ARGSUSED */
Xint
Xshowlength(int f GCC_UNUSED, int n\120B)
X`7B
X`09/* actually, can be used to show any address-value */
X`09mlforce("%d", line_no(curbp, MK.l));
X`09return TRUE;
X`7D
X
Xint
Xline_report(L_NUM before)
X`7B
X`09L_NUM`09after = line_count(curbp);
X
X`09if (do_report(before-after)) `7B
X`09`09if (before > after)
X`09`09`09mlwrite("`5B%d fewer lines`5D", before - after);
X`09`09else
X`09`09`09mlwrite("`5B%d more lines`5D", after - before);
X`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X
XL_NUM
Xline_count(BUFFER *the_buffer)
X`7B
X    if (the_buffer == (BUFFER *) 0)
X`09return 0;
X    else `7B
X#if !SMALLER
X`09(void)bsizes(the_buffer);
X`09return the_buffer->b_linecount;
X#else
X`09register LINE`09*lp;`09`09/* current line */
X`09register L_NUM`09numlines = 0;`09/* # of \1306in file */
X
X`09for_each_line(lp, the_buffer)
X`09`09++numlines;
X
X`09return numlines;
X#endif
X    `7D
X`7D
X
XL_NUM
Xline_no(`09`09/* return the number of the given line */
XBUFFER *the_buffer,
XLINEPTR the_line)
X`7B
X`09if (the_line != null_ptr) `7B
X#if !SMALLER
X`09`09L_NUM`09it;
X`09`09(void)bsizes(the_buffer);
X`09`09if ((it = the_line->l_number) == 0)
X`09`09`09it = the_buffer->b_linecount + 1;
X`09`09return it;
X#else
X`09`09register LINE`09*lp;&0209/* current line */
X`09`09register L_NUM`09numlines = 0;`09/* # of \1306before point */
X
X`09`09for_each_line(lp, the_buffer) `7B
X`09`09`09/* if we are on the specified line, record it */
X`09`09`09if (lp == the_line)
X`09`09&0209break;
X`09`09`09++numlines;
X`09`09`7D
X
X`09`09/* and return the resulting count */
X`09`09return(numlines + 1);
X#endif
X`09`7D
X`09return 0;
X`7D
X
X#if OPT_EVAL
XL_NUM
Xgetcline(void)`09/* get the current line number */
X`7B
X`09return line_no(curbp, DOT.l);
X`7D
X#endif
X
X/*
X * Return the screen column in any line given an offset.
X * Assume the line is in curwp/curbp
X */
Xint
Xgetcol(
XMARK mark,
Xint actual)`09/* false: effective column (expand tabs) */
X`09`09/* true: compute the actual column (depends on 'list' mode)*/
X`7B
X`09register C_NUM c, i;
X`09register C_NUM col = 0;
X
X`09if (llength(mark.l) > 0) `7B
X`09`09if (actual) `7B
X`09`09`09col = offs2col(curwp, mark.l\0807o) - nu_width\2206);
X`09`09`7D else `7B
X`09`09`09C_NUM len = mark.o;
X`09`09`09if (len > llength(mark.l))
X`09`09&0209len = llength(mark.l);
X`09`09`09for (i = w_left_margin(curwp); i < len; ++i) `7B
X`09`09&0209c = lgetc(mark.l, i);
X`09`09&0209col = next_column(c,col); /* assumes curbp */
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09return col;
X`7D
X
X/*
X * Return current screen column.  Stop at first non-blank given TRUE argument.
V
X */
Xint
Xgetccol(int bflg)
X`7B
X`09return getcol(DOT, bflg);
X`7D
X
X
X/*
X * Set current column, based on counting from 1
X */
Xint
Xgotocol(int f, int n)
X`7B
X`09if (!f `7C`7C n <= 0)
X`09`09n = 1;
X`09return gocol(n - 1);
X`7D
X
X/* given a column, return the offset */
X/*  if there aren't that many columns, return how too few we were */
X/*`09also, if non-null, return the column we _did_ reach in *rcolp */
Xint
Xgetoff(
XC_NUM goal,
XC_NUM *rcolp)
X`7B
X`09register C_NUM c;`09`09/* character being scanned */
X`09register C_NUM i;`09`09/* index into current line */
X`09register C_NUM col;`09/* current cursor column   */
X`09register C_NUM llen;`09/* length of line in bytes */
X
X`09col = 0;
X`09llen = llength(DOT.l);
X
X`09/* scan the line until we are at or past the target column */
X`09for (i = w_left_margin(curwp); i < llen; ++i) `7B
X`09`09/* upon reaching the target, drop out */
X`09`09if (col >= goal)
X`09`09`09break;
X
X`09`09/* advance one character */
X`09`09c = lgetc(DOT.l, i);
X`09`09col = next_column(c,col);
X`09`7D
X
X`09if (rcolp)
X`09`09*rcolp = col;
X
X`09/* and tell whether we made it */
X`09if (col >= goal)
X`09`09return i;`09/* we made it */
X`09else
X`09`09return col - goal; /* else how far short (in spaces) we were */
X`7D
X
X/* really set column, based on counting from 0, for internal use */
Xint
Xgocol(int n)
X`7B
X`09register int offs;`09/* current cursor column   */
X
X`09offs = getoff(n, (C_NUM *)0);
X
X`09if (offs >= 0) `7B
X`09`09DOT.o = offs;
X`09`09return TRUE;
X`09`7D
X
X`09DOT.o = llength(DOT.l) - 1;
X`09return FALSE;
X
X`7D
X
X
X#if ! SMALLER
X/*
X * Twiddle the two characters on under and to the left of dot.  If dot is
X * at the end of the line twiddle the two characters before it.  This fixes
X * up a very common typo with a single stroke.  This always works within a
X * line, so "WFEDIT" is good enough.
X */
X/* ARGSUSED */
Xint
Xtwiddle(int f GCC_UNUSED, int n\120B)
X`7B
X`09MARK`09`09dot;
X`09register char`09cl;
X`09register char`09cr;
X
X`09dot = DOT;
X`09if (llength(dot.l) <= 1)
X`09`09return FALSE;
X`09if (is_at_end_of_line(dot))
X`09`09--dot.o;
X`09if (dot.o == 0)
X`09`09dot.o = 1;
X`09cr = char_at(dot);
X`09--dot.o;
X`09cl = char_at(dot);
X`09copy_for_undo(dot.l);
X`09put_char_at(dot, cr);
X`09++dot.o;
X`09put_char_at(dot, cl);
X`09chg_buff(curbp, WFEDIT);
X`09return (TRUE);
X`7D
X#endif
X
X
X
X#if OPT_AEDIT
X/*
X * Force zero or more blank lines at dot.  no argument leaves no blanks.
X * Lines will be deleted or added as needed to match the argument if it
X * is given.
X */
Xint
Xforceblank(int f, int n)
X`7B
X`09register LINE`09*lp1;
X`09register LINE`09*lp2 = 0;
X`09B_COUNT nld;
X`09B_COUNT n_arg;
X`09C_NUM`09nchar;
X`09int s = TRUE;
X
X`09if (!f `7C`7C n < 0)
X`09`09n = 0;
X`09n_arg = n;
X
X`09lp1 = DOT.l;
X`09/* scan backward */
X`09while (firstchar(lp1) < 0 `26`26
X`09`09`09(lp2 = lback(lp1)) != buf_head(curbp))
X`09`09lp1 = lp2;
X`09lp2 = lp1;
X
X`09nld = 0;
X`09nchar = 0;
X
X`09/* scan forward */
X`09while ((lp2 = lforw(lp2)) != buf_head(curbp) `26`26
X`09`09`09firstchar(lp2) < 0) `7B
X`09`09++nld;
X`09`09if (nld > n_arg)
X`09`09`09nchar += llength(lp2) + 1;
X`09`7D
X
X`09DOT.l = lforw(lp1);
X`09DOT.o = 0;
X
X`09if (n_arg == nld) `7B`09`09/* things are just right */
X`09`09/*EMPTY*/;
X`09`7D else if (n_arg < nld) `7B`09/* delete (nld - n_arg) lines */
X`09`09DOT.l = lp2;
X`09`09DOT.o = 0;
X`09`09backchar(TRUE,nchar);
X`09`09s = ldelete((B_COUNT)nchar, FALSE);
X`09`7D else `7B `09`09`09/* insert (n_arg - nld) lines */
X`09`09n_arg = \0806- nld;
X`09`09while (s `26`26 n_arg--)
X`09`09`09s = lnewline();
X`09`7D
X
X`09/* scan forward */
X`09while ((firstchar(DOT.l) < 0) `26`26
X`09`09`09(DOT.l != buf_head(curbp)))
X`09`09DOT.l = lforw(DOT.l);
X
X`09return s;
X`7D
X
X#endif
X
X/* '`7E' is the traditional vi flip: flip a char and advance one */
Xint
Xflipchar(int f, int n)
X`7B
X`09int s;
X
X`09havemotion = `26f_forwchar_to_eol;
X`09s = operflip(f,n);
X`09if (s != TRUE)
X`09`09return s;
X`09return forwchar_to_eol(f,n);
X`7D
X
X/* 'x' is synonymous with 'd<space>' */
Xint
Xforwdelchar(int f, int n)
X`7B
X`09havemotion = `26f_forwchar_to_eol;
X`09return operdel(f,n);
X`7D
X
X/* 'X' is synonymous with 'd<backspace>' */
Xint
Xbackdelchar(int f, int n)
X`7B
X`09havemotion = `26f_backchar_to_bol;
X`09return operdel(f,n);
X`7D
X
X/* 'D' is synonymous with 'd$' */
X/* ARGSUSED */
Xint
Xdeltoeol(int f GCC_UNUSED, int n\120B)
X`7B
X`09if (is_empty_line(DOT))
X`09`09return TRUE;
X
X`09havemotion = `26f_gotoeol;
X`09return operdel(FALSE,1);
X`7D
X
X/* 'C' is synonymous with 'c$' */
Xint
Xchgtoeol(int f, int n)
X`7B
X`09if (is_empty_line(DOT)) `7B
X`09`09return ins();
X`09`7D else `7B
X`09`09havemotion = `26f_gotoeol;
X`09`09return operchg(f,n);
X`09`7D
X`7D
X
X/* 'Y' is synonymous with 'yy' */
Xint
Xyankline(int f, int n)
X`7B
X`09havemotion = `26f_godotplus;
X`09return(operyank(f,n));
X`7D
X
X/* 'S' is synonymous with 'cc' */
Xint
Xchgline(int f, int n)
X`7B
X`09havemotion = `26f_godotplus;
X`09return(operchg(f,n));
X`7D
X
X/* 's' is synonymous with 'c<space>' */
Xint
Xchgchar(int f, int n)
X`7B
X`09havemotion = `26f_forwchar_to_eol;
X`09return(operchg(f,n));
X`7D
X
X
X
X/*`09This function simply clears the message line,
X`09`09mainly for macro usage&0209`09*/
X
X/* ARGSUSED */
Xint
Xclrmes(int f GCC_UNUSED, int n\120B)
X`7B
X`09mlerase();
X`09return(TRUE);
X`7D
X
X#if ! SMALLER
X
X/*`09This function writes a string on the message line
X`09`09mainly for macro usage&0209`09*/
X
X/* ARGSUSED */
Xint
Xwritemsg(int f GCC_UNUSED, int n\120B)
X`7B
X`09register int status;
X`09char buf`5BNPAT`5D;`09`09/* buffer to receive message into */
X
X`09buf`5B0`5D = EOS;
X`09if ((status = mlreply("Message to write: ", buf, sizeof(buf))) != TRUE)
X`09`09return(status);
X
X`09/* write the message out */
X`09mlforce("%s",buf);
X`09return(TRUE);
X`7D
X
X/* ARGSUSED */
Xint
Xuserbeep(int f GCC_UNUSED, int n\120B)
X`7B
X`09TTbeep();
X`09return TRUE;
X`7D
X#endif /* !SMALLER */
X
X
X/* delay for the given number of milliseconds.  if "watchinput" is true,
X`09then user input will abort the delay */
Xvoid
Xcatnap(int milli, int watchinput)
X`7B
X    if (milli == 0)
X    `09return;
X#if DISP_X11
X    if (watchinput)
X`09x_typahead(milli);
X    else
X#endif
X    `7B
X#if SYS_UNIX
X# if HAVE_SELECT
X
X`09struct timeval tval;
X`09fd_set read_bits;
X#  if HAVE_SIGPROCMASK
X`09sigset_t newset, oldset;
X`09sigemptyset(`26newset);
X`09sigaddset(`26newset, SIGALRM);
X`09sigprocmask(SIG_BLOCK, `26newset, `26oldset);
X#  endif
X
X`09FD_ZERO(`26read_bits);
X`09if (watchinput) `7B
X`09`09FD_SET(0, `26read_bits);
X`09`7D
X`09tval.tv_sec = milli / 1000;
X`09tval.tv_usec = (milli % 1000) * 1000;`09/* microseconds */
X`09(void)select (1, `26read_bits, (fd_set*)0\0C0C, `26tval);
X
X#  if HAVE_SIGPROCMASK
X`09sigprocmask(SIG_SETMASK, `26oldset, (sigset_t*)0);
X#  endif
X
X# else
X#  if HAVE_POLL `26`26\0D0A_H
X
X`09struct pollfd pfd;
X`09int fdcnt;
X`09if (watchinput) `7B
X`09`09pfd.fd = 0;
X`09`09pfd.events = POLLIN;
X`09`09fdcnt = 1;
X`09`7D else `7B
X`09`09fdcnt = 0;
X`09`7D
X`09(void)poll(`26pfd, fdcnt, milli); /*\0B06seconds */
X
X#  else
X
X`09int seconds = (milli + 999) / 1000;
X`09if (watchinput)  `7B
X`09`09while(seconds > 0) `7B
X`09`09`09sleep(1);
X`09`09`09if (TTtypahead())
X`09`09&0209return;
X`09`09`09seconds -= 1;
X`09`09`7D
X`09`7D else `7B
X`09`09sleep(seconds);
X`09`7D
X
X#  endif
X# endif
X#define have_slept 1
X#endif
X
X#if SYS_VMS
X`09float`09seconds = milli/1000.;
X`09if (watchinput)  `7B
X`09`09float tenth = .1;
X`09`09while(seconds > 0.1) `7B
X`09`09`09lib$wait(`26tenth);
X`09`09`09if (TTtypahead())
X`09`09&0209return;
X`09`09`09seconds -= tenth;
X`09`09`7D
X`09`7D
X`09lib$wait(`26seconds);
X#define have_slept 1
X#endif
X
X#if SYS_WINNT `7C`7C (CC_NEWDOSCC `26`26 SYS_MSDOS)\1E08WATCOM &0226 (SYS_OS2
V &027C \280A)
X#if SYS_WINNT
X#define delay(a) Sleep(a)
X#endif
X`09if (watchinput)  `7B
X`09`09while(milli > 100) `7B
X`09`09`09delay(100);
X`09`09`09if (TTtypahead())
X`09`09&0209return;
X`09`09`09milli -= 100;
X`09`09`7D
X`09`7D
X`09delay(milli);
X#define have_slept 1
X#endif
X
X#ifndef have_slept
X`09long i;
X`09for (i = 0; i < term.t_pause; i++)
X`09`09;
X#endif
X    `7D
X`7D
X
Xstatic char`09current_dirname`5BNFILEN`5D;
X
X/* Return a string naming the current directory.  If we're unable to read the
V
X * directory name, return "."; otherwise we'll expect a fully-resolved path.
X */
Xchar *
Xcurrent_directory(int force)
X`7B
X`09char *s;
X`09static char *cwd;
X
X`09if (!force `26`26 cwd)
X`09`09return cwd;
X#if HAVE_GETCWD
X`09cwd = getcwd(current_dirname, NFILEN);
X#else
X# if HAVE_GETWD
X`09cwd = getwd(current_dirname);
X# else
X`09`7B
X`09`09FILE *f;
X`09`09int n;
X`09`09f = npopen("pwd", "r");
X`09`09if (f != NULL) `7B
X`09`09`09n = fread(current_dirname, 1, NFILEN, f);
X`09`09`09current_dirname`5Bn`5D = EOS;
X`09`09`09npclose(f);
X`09`09`09cwd = current_dirname;
X`09`09`7D else
X`09`09`09cwd = 0;
X`09`7D
X# endif
X#endif
X`09if (cwd == NULL) `7B
X`09`09cwd = current_dirname;
X`09`09current_dirname`5B0`5D = '.';
X`09`09current_dirname`5B1`5D = EOS;
X`09`7D else `7B
X`09`09s = strchr(cwd, '`5Cn');
X`09`09if (s)
X`09`09`09*s = EOS;
X`09`7D
X#if OPT_MSDOS_PATH
X`09lengthen_path(cwd);
X#if !OPT_CASELESS
X`09mklower(cwd);
X#endif
X#endif
X
X#if SYS_MSDOS `7C`7C SYS_OS2
X`09update_dos_drv_dir(cwd);
X#endif
X
X`09TRACE(("current_directory(%s)`5Cn", cwd))
X`09return cwd;
X`7D
X
X#if SYS_MSDOS `7C`7C SYS_OS2
X
X/* convert drive index to _letter_ */
Xstatic int
Xdrive2char(unsigned d)
X`7B
X`09if (d >= 26) `7B
X`09`09mlforce("`5BIllegal drive index %d`5D", d);
X`09`09d = 0;
X`09`7D
X`09return (d + 'A');
X`7D
X
X/* convert drive _letter_ to index */
Xstatic unsigned
Xchar2drive(int d)
X`7B
X`09if (isAlpha(d)) `7B
X`09`09if (isLower(d))
X`09`09`09d = toUpper(d);
X`09`7D else `7B
X`09`09mlforce("`5BNot a drive '%c'`5D", d);
X`09`09d = curdrive();
X`09`7D
X`09return (d - 'A');
X`7D
X
X/* returns drive _letter_ */
Xint
Xcurdrive(void)
X`7B
X#if SYS_OS2
X`09unsigned d;
X# if CC_CSETPP
X`09d = _getdrive();
X# else
+-+-+-+-+-+-+-+-  END  OF PART 96 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 97 -+-+-+-+-+-+-+-+
X`09_dos_getdrive(`26d);  `09/* A=1 B=2 ... */
X# endif
X`09return drive2char((d-1) `26 0xff);
X#else
X`09return drive2char(bdos(0x19, 0, 0) `26 0xff);
X#endif
X`7D
X
X/* take drive _letter_ as arg. */
Xint
Xsetdrive(int d)
X`7B
X`09if (isAlpha(d)) `7B
X#if SYS_OS2
X# if CC_CSETPP
X`09`09_chdrive(char2\0B06d) + 1);
X# else
X`09`09unsigned maxdrives;
X`09`09_dos_setdrive(char2\0B06d)+1, `26maxdrives); /* 1 based */
X# endif
X#else
X`09`09bdos(0x0e, char2drive(d), 0); /* 0 based */
X#endif
X`09`09return TRUE;
X`09`7D
X`09mlforce("`5BBad drive specifier`5D");
X`09return FALSE;
X`7D
X
X
Xstatic int curd;`09`09/* current drive-letter */
Xstatic char *cwds`5B26`5D;`09`09/* list of current dirs on each drive */
X
Xconst char *
Xcurr_dir_on_drive(int drive)
X`7B
X`09int`09n = char2drive(drive);
X
X`09if (n != 0) `7B
X`09`09if (curd == 0)
X`09`09`09curd = curdrive();
X
X`09`09if (cwds`5Bn`5D)
X`09`09`09return cwds`5Bn`5D;
X`09`09else `7B
X`09`09`09cwds`5Bn`5D = castalloc(char,NFILEN);
X
X`09`09`09if (cwds`5Bn`5D) `7B
X`09`09&0209if (setdrive(drive) == TRUE) `7B
X`09`09&0209`09(void)strcpy(cwds`5Bn`5D, current_directory(TRUE));
X`09`09&0209`09(void)setdrive(curd);
X`09`09&0209`09(void)current_directory(TRUE);
X`09`09&0209`09return cwds`5Bn`5D;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09return current_directory(FALSE);
X`7D
X
Xvoid
Xupdate_dos_drv_dir(char *cwd)
X`7B
X`09char`09*s;
X
X`09if ((s = is_msdos_drive(cwd)) != 0) `7B
X`09`09int n = char2drive(*cwd);
X
X`09`09if (!cwds`5Bn`5D)
X`09`09`09cwds`5Bn`5D = castalloc(char,NFILEN);
X
X`09`09if (cwds`5Bn`5D)
X`09`09`09(void)strcpy(cwds`5Bn`5D, s);
X`09`7D
X`7D
X#endif
X
X#if OPT_SHELL
X/* ARGSUSED */
Xint
Xcd(int f GCC_UNUSED, int n\120B)
X`7B
X`09register int status;
X`09static`09TBUFF`09*last;
X`09char cdirname`5BNFILEN`5D;
X
X`09status = mlreply_dir("Change to directory: ", `26last, cdirname);
X#if SYS_UNIX `7C`7C SYS_VMS
X`09if (status == FALSE) `7B`09`09/* empty reply, go HOME */
X`09`09(void)strcpy(cdirname, "`7E");
X`09`09status = TRUE;
X`09`7D
X#endif
X`09if (status == TRUE)
X`09`09status = set_directory(cdirname);
X`09return status;
X`7D
X
X/* ARGSUSED */
Xint
Xpwd(int f GCC_UNUSED, int n\120B)
X`7B
X`09mlforce("%s",current_directory(f));
X`09return TRUE;
X`7D
X
Xstatic char prevdir`5BNFILEN`5D;
X
Xstatic int
Xcd_and_pwd(char *path)
X`7B
X#if OPT_PROCEDURES
X`09static int cdhooking;
X#endif
X#if CC_CSETPP
X`09if (_chdir(SL_TO_BSL(path)) == 0)
X#else
X`09if (chdir(SL_TO_BSL(path)) == 0)
X#endif
X`09`7B
X#if SYS_UNIX
X`09`09const char *p = current_directory(TRUE);
X`09`09if (!is_slashc(*p)) `7B
X`09`09`09if (is_slashc(*prevdir))
X`09`09&0209p = lengthen_path(pathcat(current_dirname, prevdir, path));
X`09`09`09sgarbf = TRUE;`09/* some shells print to stderr */
X`09`09`09update(TRUE);
X`09`09`7D
X
X`09`09mlforce("%s", p);
X#else
X`09`09(void)pwd(TRUE,1);
X#endif
X#if OPT_PROCEDURES
X`09`09if (!cdhooking `26`26 *\0E06) `7B
X`09`09`09cdhooking = TRUE;
X`09`09`09run_procedure(cdhook);
X`09`09`09cdhooking = FALSE;
X`09`09`7D
X#endif
X`09`09updatelistbuffers();
X`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X
X#if OPT_EVAL
Xchar *
Xprevious_directory(void)
X`7B
X`09if (*prevdir)
X`09`09return prevdir;
X`09else
X`09`09return current_directory(FALSE);
X`7D
X#endif
X
X/* move to the named directory.  (Dave Lemke) */
Xint
Xset_directory(const char *dir)
X`7B
X    char       exdir`5BNFILEN`5D;
X#if SYS_UNIX
X    const char *cdpath = 0;
X    char       cdpathdir`5BNFILEN`5D;
X#endif
X    char *exdp;
X#if SYS_MSDOS `7C`7C SYS_OS2
X    int curd = curdrive();
X#endif
X
X    upmode();
X
X    TRACE(("set_directory(%s)`5Cn", dir))
X    exdp = strcpy(exdir, dir);
X
X    if (doglob(exdp)) `7B
X#if SYS_MSDOS `7C`7C SYS_OS2
X`09char`09*s;
X`09if ((s = is_msdos_drive(exdp)) != 0) `7B
X`09`09if (setdrive(*exdp) == TRUE) `7B
X`09`09`09exdp = s;`09/* skip device-part */
X`09`09`09if (!*exdp) `7B
X`09`09&0209return pwd(TRUE,1);
X`09`09`09`7D
X`09`09`7D else `7B
X`09`09`09return FALSE;
X`09`09`7D
X`09`7D
X#endif
X`09/*
X`09** "cd -" switches to the previous directory.
X`09*/
X`09if (!strcmp(exdp, "-"))
X`09`7B
X`09`09if (*prevdir)
X`09`09`09(void) strcpy(exdp, prevdir);
X`09`09else
X`09`09`7B
X`09`09    mlforce("`5BNo previous directory");
X`09`09    return FALSE;
X`09`09`7D
X`09`7D
X
X`09/* Save current directory for subsequent "cd -". */
X`09(void) strcpy(prevdir, current_directory(FALSE));
X
X#if OPT_VMS_PATH
X`09if (!*exdp)
X`09`09strcpy(exdp, "`7E");
X`09if (!strcmp(exdp, "/"))`09`09/* cannot really "cd /" on vms */
X`09`09lengthen_path(exdp);
X`09if (!is_vms_pathname(exdp,TRUE)) `7B
X`09`09int end = strlen(exdp);
X`09`09if (exdp`5Bend-1`5D != SLASHC) `7B
X`09`09`09exdp`5Bend++`5D  = SLASHC;
X`09`09`09exdp`5Bend`5D    = EOS;
X`09`09`7D
X`09`09unix2vms_path(exdp,exdp);
X`09`7D
X#endif
X
X`09if (cd_and_pwd(exdp))
X`09`09return TRUE;
X
X#if SYS_UNIX `26`26 OPT_PATHLOOKUP
X`09/*
X`09** chdir failed.  If the directory name doesn't begin with any of
X`09** "/", "./", or "../", get the CDPATH environment variable and check
X`09** if the specified directory name is a sub\170Aof a
X`09** directory in CDPATH.
X`09*/
X`09if (!is_pathname(exdp)
X`09 `26`26 (cdpath = getenv("CDPATH")) != 0) `7B
X`09`09/* For each colon-separated component in CDPATH */
X`09`09while ((cdpath = parse_pathlist\1807, \2006dir)) != 0) `7B
X`09`09`09if (cd_and_pwd(pathcat(cdpathdir, \0B0Bexdp))) `7B
X`09`09&0209return TRUE;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X#endif
X    `7D
X#if SYS_MSDOS `7C`7C SYS_OS2
X    setdrive(curd);
X    current_directory(TRUE);
X#endif
X    mlforce("`5BCouldn't change to `5C"%s`5C"`5D", exdir);
X    return FALSE;
X`7D
X#endif /* OPT_SHELL */
X
Xvoid
Xch_fname(BUFFER *bp, const char *fname)
X`7B
X`09int len;
X`09char nfilen`5BNFILEN`5D;
X`09char *np;
X`09char *holdp = NULL;
X
X`09np = strcpy(nfilen, fname);
X
X`09/* produce a full pathname, unless already absolute or "internal" */
X`09if (!isInternalName(np))
X`09`09(void) lengthen_path(nfilen);
X
X`09len = strlen(np)+1;
X
X`09if (bp->b_fname == 0 `7C`7C strcmp\1B0C, np)) `7B
X
X`09`09if (bp->b_fname `26`26 \0F08len < len ) `7B
X`09`09`09/* don't free it yet -- it _may_ have been passed in as
X`09`09`09 * the current file-name
X`09`09`09 */
X`09`09`09holdp = bp->b_fname;
X`09`09`09bp->b_fname = NULL;
X`09`09`7D
X
X`09`09if (!bp->b_fname) `7B
X`09`09`09bp->b_fname = strmalloc(np);
X`09`09`09if (!bp->b_fname) `7B
X`09`09&0209bp->b_fname = out_of_mem;
X`09`09&0209bp->b_fnlen = strlen(\1508ame);
X`09`09&0209return;
X`09`09`09`7D
X`09`09`09bp->b_fnlen = len;
X`09`09`7D
X
X`09`09/* it'll fit, leave len untouched */
X`09`09(void)strcpy(bp->b_fname, np);
X
X`09`09if (holdp != out_of_mem)
X`09`09`09FreeIfNeeded(holdp);
X`09`09updatelistbuffers();
X`09`7D
X#ifdef`09MDCHK_MODTIME
X`09(void)get_modtime(bp, `26(bp->b\1408));
X`09bp->b_modtime_at_warn = 0;
X#endif
X`7D
$ call unpack [.VILE-8_0]RANDOM.C;1 -
 643227997 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 46 102 152
$!
$ create 'f'
X
XREADME for vile, version 8.0
X--------\0808\100D
X
Xvile is a text editor which is extremely compatible with vi in terms
Xof "finger feel".  in addition, it has extended capabilities in many areas,
Xnotably multi-file editing and viewing, key rebinding, and real X window
Xsystem support.
X
Xthe authors of vile are Paul Fox, Tom Dickey, and Kevin Buettner.
X
Xmany patches have been contributed by a lot of users.  we thank them.
X
Xmore recent additions to this README appear near the bottom.  that is, most
Xof the newest stuff is at the end, not up here where you are.
X
Xvisit
X`09ftp://ftp.clark.net/pub/dickey/vile
X`09ftp://id.wing.net/pub/pgf/vile
Xto be sure it's still the latest.
X
Ximpatient?  just type "./configure; make", and get a cup of coffee, decaf
Xif necessary. `20
X
Xwant X11 support?  you'd better look at doc/config.doc, although`20
X"./configure --with-screen=x11"; make" may well do what you want.
X
Xif you like vile, and wish to be informed of new releases, let me
Xknow -- i maintain a mailing list for that purpose.  don't worry -- the
Xvolume won't fill your inbox.
X
Xpaul fox, pgf@foxharp.boston.ma.us (original author)
Xkevin buettner, kev@primenet.com
Xtom dickey,\0807@clark.net (current maintainer)
X
X--------\0808\1010\2016
XSend bug reports to
X`09vile-bugs@foxharp.boston.ma.us
X
XRequests to be put on the announcement list should go to
X`09vile-announce-request@foxharp.boston.ma.us
X
X--------\0808\1010\2016
X
Xoriginal README, from February, 1992:
X
XVILE -- VI Like Emacs: a vi workalike put together from Micro-Emacs by Paul Fo
Vx
X--------\0808\1010\2020\400F
X
X`09This editor grew out of a frustration that although lots of
X`09eager programmers have tackled rewrites of Emacs, with new and
X`09better features (not to mention free source), I've not seen
X`09anything similar done with the Second True Editor.  (The
X`09First, of course, being /bin/ed)
X
X`09So I took a copy of MicroEmacs 3.9 (which I've since
X`09discovered was out of date, unfortunately) and turned it
X`09into a vi "feel-alike".  It retains the multiple
X`09buffer/multiple window features of uemacs, but the
X`09"finger-feel", if you will, is very much that of vi.  It is
X`09definitely not a clone, in that some substantial stuff is
X`09missing, and the screen doesn't look quite the same.  But what
X`09matters most is that one's "muscle memory" does the right thing
X`09to the text in front of you, and that is what vile tries to do
X`09for vi users.   THIS IS NOT A "CLONE"!  But it feels good.
X`09(Put another way, the things that you tend to type over and
X`09over probably work -- things done less frequently, like configuring
X`09a .exrc file, are quite different.)
X
X`09This is the second really public release of vile.  Users of
X`09previous versions will hopefully find many new features -- see the
X`09CHANGES file for details.
X
X`09The collective developers of Micro-Emacs should be
X`09complimented that the changes were as easy as they were.  The
X`09code was pretty clean and well designed before I started on
X`09it.  I'm not sure that the same can be said anymore...`20
X
X`09The major benefits over standard vi include:
X`09`09- multiple files open at once
X`09`09- multiple windows on the screen
X`09`09- a larger set of operator commands
X`09`09- the possibility of porting to your favorite micro.
X`09`09- "next error" cursor positioning after compilation
X`09      `5B`09- infinite undo  -pgf 7/93 `5D
X`09Of course, it _may_ lack some of vi's reliability. :-)
X`09`5Bbut not much -- it's _very_ stable these days. -pgf 1/95`5D
X
X`09Take a look at vile.hlp for more information about features
X`09and differences.`20
X
X`09In general, I suspect that the quality of the code is roughly
X`09on a par with MicroEmacs.  I've been using vile regularly under
X`09both SunOS and 386 UNIX for almost two years `5Bmore like 5\1306
X`09now, on a lot more platforms than that -pgf 12/94`5D, with no major
X`09problems (that haven't been fixed).  Version three was built and
X`09used by many others on the net, and their feedback was invaluable.`20
X`09I think all of the reported bugs have been fixed, and hopefully not
X`09too many new ones introduced.
X
X`09I have not run this much on a small system, and not much at all on
X`09DOS.  Pete Rusczinski has done an excellent job of porting
X`09version three to DOS -- his changes are now incorporated here (as
X`09of version 3.20), but since in general the DOS\2C09has been
X`09less well exercised than the UNIX version, it probably harbors
X`09more bugs.
X
X`09Hope you enjoy --`20
X
X`09Paul G. Fox`09June, 1991, and February, 1992
X
Xp.s. By the way, I'm _not_ the same Paul Fox who wrote Crisp, the Brief
X`09work-alike.
X
X
X--------\0808\1007
X
XSeptember, 1992
X
XI don't have much to add to the original README -- vile has gotten a lot
Xbetter since I first released it, thanks to a lot of users and \1308
Xbug reports.  It compiles and runs without modification on most major UNIXes,
V
Xand under DOS.  It offers vi finger feel, and most (not all) of its features.
V
XI hope it fills someone's need out there.  -pgf 9/92
X
X(Special thanks to Dave Lemke and Pete Rucszinski, for X and DOS support,
Xand (in no particular order) to Eric Krohn, Willem Kasdorp, J.C.Webber,
XWarren Vik, Julia Harper, Chris Sherman, Thomas Woo, Yanek Martinson, Miura
XMasahiro, Tom Dickey for lots of bug reports and suggestion\1006patience.)
X
X--------\0808\100E
X
XApril, 1993
X
XWell, here's an update on vile.  The first release was a long time
Xago (a couple of years?).  Tom Dickey has been contributing a _whole_ lot
Xof good changes.  vile now runs on VMS, and is much more stable on DOS
Xthanks to Tom.  For me, vile is becoming an "old" program -- I first worked
Xon it in 1989 sometime.  So it's been fun to have someone contributing
Xfixes so energetically.  Thanks Tom.
X
XOne thing that's changed since I first started vile is that "lots of eager
Xprogrammers" have now tackled rewrites of vi.  There are several good work-
Xalikes out there: elvis (the "king" :-), xvi, vim, stevie, and recent
Xversions of vip-mode in GNU emacs.  `5Badd "nvi" to that list.  and whatever
Xhappened to xvi?  -pgf 12/94`5D  From what little I've used any of
Xthese, they all seem like real good programs.  vile feels different from
Xmost of them, mainly due to its roots in MicroEmacs.  You may or may not
Xlike it.  If you don't, try one of the others.  There's certainly no reason
Xto not have a vi-like editor on just about any machine you choose.  (yeah,
XI know -- I'm assuming you _want_ a vi-like editor...  :-)  Enjoy.
X
XOh yes -- building it.  On UNIX, type "make", and choose one of the predefined
V
Xtargets.  Like "make linux". `5B not anymore -- use "configure; make"  -pgf 12
V/94`5D
X
XDOS makefiles are named after the compiler they support: \3609.tbc for
XTurbo-C, makefile.wat.  There is support in "\2408" for Microsoft-C, but
Xit's next to useless -- if anyone puts together a good "nmake" makefile,
Xcould you pass it along?  `5Bthat support isn't there anymore.  -pgf 12/94`5D
V
X
XThe Watcom C/386 v9.0 compiler should also work -- the makefile to use is
Xmakefile.wat.
X
XThe latest version of vile is usually available for ftp at "ftp.cayman.com",
Xin the pub/vile directory.  `5Bnot anymore -- it's at "id.wing.net" in the
X"pub/pgf/vile" directory.  -pgf 12/94`5D Sometimes there's a compiled DOS
Xbinary there too.  I don't maintain a mailing list, or anyth\1206ke that
Xto inform folks of new releases -- you just sort of have to check once in a
Xwhile, or send me mail...  `5B I've set up a mailing list -- contact me to be
V
Xadded -pgf 7/93`5D
X
Xpaul
X
X--------\0808\100E
X
XJuly, 1993
X
XMore new features:  infinite undo, modification time checking, and, at
Xlong last, primitive support for the :map command.  `5B:map is now fully
Xfunctional -pgf, 12/94`5D I've also received patches that let vile compile
Xfor DOS with the DJ GCC compiler.  Have I mentioned filename completion?`20
XTom Dickey provided that and variable/modename/command completion too.
X
XIf you would like to be informed, via email, of new vile releases (bearing
Xin mind that the newest release may be _more_ likely to be buggy, rather
Xthan _less_), please send me mail, and I will add you to my list.  The email
Xwill probably contain a capsule summary of the most recent changes to the
Xcode.
X
XThanks to Tuan Dang for the Watcom and DJ GCC work.  I don't know much
Xabout djgpp, the DOS port of djgcc, but take a look at makefile.djg.
X
X
Xpgf
X
X
X--------\0808\100F
X
XMarch, 1994
X
XThe X support in xvile has been given a huge boost with contributions from
XKevin Buettner -- scrollbars, Motif widget support make it feel like a real
Xapplication...  We now have rectangular regions.  DOS support is getting
Xbetter all the time.  The major version number got bumped to 4 somewhere
Xalong the line, because Tom and I were getting tired of 3.  There are quite
Xa few new "modes", some to support vi functionality\2207altogether new.`20
XWe should have keyboard selections and highlighted regions soon...
X
Xpgf, pgf@foxharp.boston.ma.us
X
X
X--------\0808\100F
XDecember, 1994
X
Xhmmmm -- lets see.  new stuff.  see the CHANGES and help files for details.
X
X`09- vile is now completely autoconf'ed -- you should be able to type
X`09either "./configure; make" o\170E --with-screen=x11" to build
X`09it on any (unix-like) platform.`20
X
X`09- :map and :map! are now much more complete, but still by no means
X`09done.  expect to have to edit your favorite macros to make
X`09them work.
X
X`09- :abbr now works.
X
X`09- along with proper :map support comes\1A08function key\2208.
X`09function keys defined for your terminal in the termcap/info database
X`09are now premapped and can be bound to as #-1 etc.  so those of
X`09you with ESC `5B 10 `7E style function keys should be happy now.
X
X`09- mouse clicks which move the cursor now count as proper motion
X`09commands in both xvile and vile-in-an-xterm.  this means, for
X`09instance, that '' or `60`60 will get you back to where you were before
X`09you clicked the mouse, and you can apply operators to\2606
X`09movements.  for example -- click the mouse somewhere, hit 'd' to
X`09start a delete operation, and click the mouse somewhere else.  the
X`09text between the two mouse-click locations will be deleted.
X
X`09- on-line help (just a single line) for every function, available
X`09with describe-`7Bbindings,function,key`7D commands.
X
X`09- new modes to better control beeping and the "working..." message.
X
X`09- autowrite mode now supported, on a global or buffer-by-buffer basis.
X
X`09- popup windows now adjust their size to\0E07contents -- less screen
X`09space is wasted for small window, and more is us\2307big\2107s.
X
X`09- file and comm\0807pletion is now more emacs/bash/tcsh-like, in
X`09that possible choices are shown when you hit a second TAB key.  this
X`09can be tuned via a new mode, "popup-choices"
X
X`09- "quoted" motions, which highlight the text they will act on.  type
X`09a 'q', and start moving around, then type another 'q'.
X
X`09- various fixes to the macro language, for core dumps and usability.
X
X`09- file.bak and file`7E backup files now supported.
X
X`09- infinite (?) screen sizes should now be supported under X.
X
X`09- it's now possible to break lines by putting `5EM in the replacement
X`09pattern.
X
X`09- selections, the modelines, and the cursor, under xvile, can all
X`09have different colors.
X
X`09- color support for termcap, at least on the linux console.
X
X`09- put'ing from registers (i.e. 'p' and 'P' commands) should be much
X`09faster.
X
X`09- multiple (error) messages arising from running a macro or a startup
X`09file will now accumulate in a new popup window.
X
X`09- a simple, probably incomplete file-locking protocol is available,
X`09but is not compiled in by default.  the organization which
X`09contributed the code (Baan Development) uses it to aid their
X`09multi-user development.  turn on OPT_LCKFILES in estruct.h and
X`09"set usefilelock" in your .vilerc to play with it.
X
X`09- Windows NT support -- console mode only.  anyone want to port this
X`09to the Windows95 console?  it's probably not hard, though i haven't
X`09looked into it very hard.
X
X`09- lots of bug fixes
X
X--------\0808\100F
XFebrary, 1995
X`09xvile now supports color attributes, which means we can do some
X`09primitive syntax coloring of C programs, using the external filter,
X`09"c-filt".  this is still pretty new stuff.  expect it to get better
X`09with age.
X
X
X--------\0808\100F
XNovember, 1995
X`09lots of new users in the last year, due to better advertising
X`09and inclusion in some of the big linux and freebsd archives.
X`09support for NT and OS/2 has gotten much better, and lots of
X`09little bugs have been fixed, and features added.  Win32 support
X`09is very good these days, thanks mostly to the efforts of Rick
X`09Sladkey.
X
X--------\0808\100F
XJune, 1996
X`09gee, i don't remember _what_ we've done recently.  enjoy.
X
X--------\0808\100F
X
XSeptember, 1996
X`09tom dickey has volunteered to take over releases, and maintaining
X`09"official" sources.  i'll still contribute, but more as part of the
X`09"audience".  tom has done a _huge_ amount of work over the years
X`09on vile -- i _really_ appreciate it...  -pgf
X
X--------\0808\100F
X$Header: /usr/build/vile/vile-8.0/RCS/README,v 1.66 1998/05/30 20:29:13 tom Ex
Vp $
X--------\0808\100F
$ call unpack [.VILE-8_0]README.;1 -
 1275671533 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 27 103 152
$!
$ create 'f'
X
XRunning vile on a PC...
X--------\0808\100F
X
Xvile can be built for DOS, OS/2, Windows/NT or \0E0895
X
XDOS information
X--------\0808
Xunder DOS, you're best off using a DOS extender of some kind.  either
Xthe Watcom or DJGPP compiler suites may be used --\2507gives you a
Xfaster executable, but the Watcom compiler is about 10 times \3D06.
Xyou can use Turbo or Borland C as well, but neither of those support an
Xextender, so you end up only being able to edit files that fit in memory.
Xif you do this, be sure to '#define SMALLER 1' in estruct.h, to save as
Xmuch code space as possible.
X
Xif you build with Watcom, you'll need to have both vile.exe and dos4gw.exe
Xin your path to run vile.
X
Xif you build with DJGPP, you'll need to have both vile.exe and go32.exe
Xin your path to run vile.  newer versions of DJGPP may rely on DPMI, and
Xyou might need cwsdpmi.exe instead of go32.  experiment.  have fun!
X
Xlet me know about bugs/oddities when you use vile on a PC -- i probably don't
V
Xuse it as much as you do.
X
X(it's quite possible that the DOS makefiles are a little out of date --
Xrefer to the UNIX makefile (\0A08.in) for correct current list of source
Xand object files.)
X
Xoh -- there are three possible screen drivers in the source distribution
Xthat should work, with varying degrees of success:
X`09borland.c (need #define BORLAND in estruct.h or makefile): this
X`09`09uses the "conio" routines that come with Turbo C or Borland
X`09`09C++.  Again, the trouble with this under DOS is that the
X`09`09Borland compilers don't produce a dos-extender 32 bit app,
X`09`09so you're _severely_ limited as to filesize.  but the DJGPP
X`09`09libraries emulate the borland screen i/o routines, so this
X`09`09screen driver is used there as well.
X
X`09ibmpc.c (need #define IBMPC in estruct.h or makefile): goes
X`09`09straight to the video controller and the screen, should
X`09`09support most popular video modes on CGA/EGA/VGA cards.`20
X`09`09this is fine under regular DOS, but starts causing problems
X`09`09in a Windows DOS-box, due to its direct video accesses.
X
X`09ansi.c (need #define ANSI in estruct.h or makefile):  uses ANSI.SYS.
X`09`09this may be more portable than ibmpc.c, since it relies on
X`09`09the ansi driver for its cursor/scrolling/color services.`20
X`09`09if you can change the resolution of your screen (to 43 or
X`09`0950 line mode) with your ansi driver, just use the
X`09`09"screen-rows" and/or \1508columns" vile commands to make
X`09`09its idea of the size match your physical screen, and
X`09`09you'll be all set.  (i've only tested it with a free/public
X`09`09replacement program called NNANSI.  i got my copy from a
X`09`09simtel mirror.  i can probably find you a copy if you need
X`09`09it.)
X
X
XOS/2 information:
X--------\0808-
X
Xi believe vile can be built with the Borland compiler, or IBM CSET. be
Xaware that vile is NOT a PM program.  the two builds use the borland.c
Xor os2vio.c screen drivers, respectively.  with vile 7.3, an EMX port
Xis supported (for comparison, since OS/2 VIO performs much better).
X
XWIN32 information (Windows NT and 95):
X--------\0808\1010\2006
Xeither Visual C++ or the Borland compiler can be used. see the makefiles
Xfor details.  the screen driver is ntconio.c -- this is a console-mode
Xonly port.  as of vile 7.3, a simple gui (ntwinio.c) is provided.  we plan
Xto do more work to fill out the functionality to make it like the other
Ximplementations of vile (e.g., scrollbars and menus).
X
X
X--------\0808\1010\2018
Xtom dickey,\0807@clark.net
X
X--------\0808\1010\2018
Xpaul fox, pgf@foxharp.boston.ma.us (home)
X
X--------\0808\1008
X$Header: /usr/build/vile/vile/RCS/README.PC,v 1.14 1998/04/30 23:46:59 tom Exp
V $
X--------\0808\1008
$ call unpack [.VILE-8_0]README.PC;1 -
 826402298 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 8 104 152
$!
$ create 'f'
X/*
X *`09This code has been MODIFIED for use in vile (see the original
X *`09copyright information down below) -- in particular:
X *`09 - regexec no longer needs to scan a null terminated string
X *`09 - regexec takes two extra arguments describing the first and
X *`09 `09just-past-last legal scan start offsets, to limit matches
X *`09`09to beginning in that range
X *`09 - inexact character matches are now handled, if the global ignorecase
X *`09 `09is set
X *`09 - regexps are now relocatable, rather than locked down
X *
X *`09`09pgf, 11/91
X *
X * $Header: /usr/build/vile/vile/RCS/regexp.c,v 1.65 1998/04/28 10:18:34 tom E
Vxp $
X *
X */
X
X/*
X * regcomp and regexec -- regsub\1609rror are elsewhere
X *
X *`09Copyright (c) 1986 by University of Toronto.
X *`09Written by Henry Spencer.  Not derived from licensed software.
X *
X *`09Permission is granted to anyone to use this software for any
X *`09purpose on any computer system, and to redistribute it freely,
X *`09subject to the following restrictions:
X *
X *`091. The author is not responsible for the consequences of use of
X *`09`09this software, no matter how awful, even if they arise
X *`09`09from defects in it.
X *
X *`092. The origin of this software must not be misrepresented, either
X *`09`09by explicit claim or by omission.
X *
X *`093. Altered versions must be plainly marked as such, and must not
X *`09`09be misrepresented as being the original software.
X *
X * Beware that some of this code is subtly aware of the way operator
X * precedence is structured in regular expressions.  Serious changes in
X * regular-expression syntax might require a total rethink.
X */
X
X#include "estruct.h"
X#include "edef.h"
X
X#if OPT_TRACE
X/* #define REGDEBUG  1 */
X#endif
X
X#undef PLUS  /* vile conflict */
X
Xstatic`09char *`09reg(int paren, int *flagp);
Xstatic`09char *`09regatom(int *flagp, int at_bop);
Xstatic`09char *`09regbranch(int *flagp);
Xstatic`09char *`09regnext(\0F06p);
Xstatic`09char *`09regnode(int op);
Xstatic`09char *`09regpiece(int *flagp, int at_bop);
Xstatic`09int`09regmatch(char *prog);
Xstatic`09int`09regrepeat(const char *p);
Xstatic`09int`09regtry(regexp *prog, char *strin\0E0Egend);
Xstatic`09void`09regc(int b);
Xstatic`09void`09regninsert(int n, char *opnd);
Xstatic`09void`09regopinsert(int op, char *opnd);
Xstatic`09void`09regoptail(char *p, \0906val);
Xstatic`09void`09regtail(char *p, \0906val);
X
X#ifdef REGDEBUG
Xstatic int regnarrate = 1;
Xstatic void regdump(regexp *r);
Xstatic char *regprop(\0E06op);
X#endif
X
X/*
X * The "internal use only" fields in regexp.h are present to pass info from
X * compile to execute that permits the \1908phase to run lots faster on
X * simple cases.  They are:
X *
X * regstart`09char that must begin a match; EOS if none obvious
X * reganch`09is the match anchored (at beginning-of-line only)?
X * regmust`09string (starting at program`5Boffset`5D) that match must
X *`09`09&0209include, or NULL
X * regmlen`09length of regmust string
X *
X * Regstart and reganch permit very fast decisions on suitable starting points
V
X * for a match, cutting down the work a lot.  Regmust permits fast rejection
X * of lines that cannot possibly match.  The regmust tests are costly enough
X * that regcomp() supplies a regmust only if the r.e. contains something
X * potentially expensive (at present, the only such thing detected is * or +
X * at the start of the r.e., which can involve a lot of backup).  Regmlen is
X * supplied because the test in regexec() needs it and regcomp() is computing
V
X * it anyway.
X */
X
X/*
X * Structure for regexp "program".  This is essentially a linear encoding
X * of a nondeterministic finite-state machine (aka syntax charts or
X * "railroad normal form" in parsing technology).  Each node is an opcode
X * plus a "next" pointer, possibly\2007n operand.  "N\2B0Cs of
X * all nodes except BRANCH implement concatenation; a "next" pointer with
X * a BRANCH on both ends of it is connecting two alternatives.  (Here we
X * have one of the subtle syntax dependencies:  an individual BRANCH (as
X * opposed to a collection of them) is never concatenated with anything
X * because of operator precedence.)  The operand of some types of node is
X * a literal string; for others, it is a node leading into a sub-FSM.  In
X * particular, the operand of a BRANCH node is the first\1206of the branch.
X * (NB this is *not* a tree structure:  the tail of the branch connects
+-+-+-+-+-+-+-+-  END  OF PART 97 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 98 -+-+-+-+-+-+-+-+
X * to the thing following the set of BRANCHes.)  The opcodes are:
X */
X
X/* definition`09number`09opnd?`09meaning */
X#define`09END`090`09/* no`09End of program. */
X#define`09BOL`091`09/* no`09Match "" at beginning of line. */
X#define`09EOL`092`09/* no`09Match "" at end of line. */
X#define`09ANY`093`09/* no`09Match any one character. */
X#define`09ANYOF`094`09/* str`09Match any character in this string. */
X#define`09ANYBUT`095`09/* str`09Match any character not in this string. */
X#define`09BRANCH`096`09/* node`09Match this alternative, or the next... */
X#define`09BACK`097`09/* no`09Match "", "next" ptr points backward. */
X#define`09EXACTLY`098`09/* str`09Match this string. */
X#define`09NOTHING`099`09/* no`09Match empty string. */
X#define`09STAR`0910`09/* node`09Match this (simple) thing 0 or more times. */
V
X#define`09PLUS`0911`09/* node`09Match this (simple) thing 1 or more times. */
V
X#define`09BEGWORD`0912`09/* node`09Match "" between nonword and word. */
X#define`09ENDWORD 13`09/* node`09Match "" between word and nonword. */
X#define`09WHITESP 14`09/* node`09Match single whitespace, excluding BOL and EO
VL */
X#define`09NWHITESP 15`09/* node`09Match single nonwhitespace, excluding BOL an
Vd EOL */
X#define`09ALNUM`0916`09/* node`09Match any alphanumeric, include _ */
X#define`09NALNUM`0917`09/* node`09inverse above, including BOL and EOL */
X#define`09DIGIT`0918`09/* node`09Match any digit */
X#define`09NDIGIT`0919`09/* node`09Match any non-digit */
X#define`09PRINT`0920`09/* node`09Match any printable char (including whitesp)
V */
X#define`09NPRINT`0921`09/* node`09Match any non-printable char */
X#define`09OPEN`0930`09/* no`09Mark this point in input as start of #n. */
X`09`09`09/*`09OPEN+1 is number 1, etc. */
X#define`09CLOSE`0940`09/* no`09Analogous to OPEN. */
X
X/*
X * Opcode notes:
X *
X * BRANCH`09The set of branches constituting a single choice are hooked
X *`09`09together with their "next" pointers, since precede\0B07vents
X *`09`09anything being concatenated to any individual branch.  The
X *`09`09"next" pointer of the last BRANCH in a choice points to the
X *`09`09thing following the whole choice.  This is also where the
X *`09`09final "next" pointer of each individual branch points; each
X *`09`09branch starts with the operand node of a BRANCH node.
X *
X * BACK`09`09Normal "next" pointers all implicitly\1806 forward; BACK
X *`09`09exists to make loop structures possible.
X *
X * STAR,PLUS`09'?', and complex '*' and '+', are implemented as circular
X *`09`09BRANCH structures using BACK.  Simple cases (one character
X *`09`09per match) are implemented with STAR and PLUS for speed
X *`09`09and to minimize recursive plunges.
X *
X * OPEN,CLOSE`09...are numbered at compile time.
X */
X
X/*
X * A node is one char of opcode followed by two chars of "next" pointer.
X * "Next" pointers are stored as two 8-bit pieces, high order first.  The
X * value is a positive offset from the opcode of the node containing it.
X * An operand, if any, simply follows the node.  (Note that much of the
X * code generation knows about this implicit relationship.)
X *
X * Using two bytes for the "next" pointer is vast overkill for most things,
X * but allows patterns to get big without disasters.
X */
X#define`09OP(p)`09(*(p))
X#define`09NEXT(p)`09(((*((p)+1)`260377)<<8) + \16072\1607)
X#define`09OPERAND(p)`09((p) + 3)
X
X/*
X * See regmagic.h for one further detail of program structure.
X */
X
X
X/*
X * Utility definitions.
X */
X
X#define`09ISMULT(c)`09((c) == '*' `7C`7C \0E08+\0E0D?')
X#define`09META`09"`5E$.`5B()`7C?+*`5C`5C<>"
X
X/*
X * Flags to be passed up and down.
X */
X#define`09HASWIDTH`0901`09/* Known never to match null string. */
X#define`09SIMPLE`09`0902`09/* Simple enough to be STAR/PLUS operand. */
X#define`09SPSTART`09`0904`09/* Starts with * or +. */
X#define`09WORST`09`090`09/* Worst case. */
X
X/*
X * Global work variables for regcomp().
X */
Xstatic char *regparse;`09`09/* Input-scan pointer. */
Xstatic int regnpar;`09`09/* () count. */
Xstatic char regdummy;
Xstatic char *regcode;`09`09/* Code-emit pointer; `26regdummy = don't. */
Xstatic long regsize;`09`09/* Code size. */
X
X/*
X *`09`09&0209regexp&0209in magic`09in nomagic
X *`09`09&0209char&0209enter as\0909
X *`09`09&0209-------\0909-`09\0908
X *`090 or 1`09`09`09?&0209`5C?&0209`5C?
X *`091 or more`09`09+&0209`5C+&0209`5C+
X *`090 or more`09`09*`09`09*`09`09`5C*
X *`09beg. nest`09`09(&0209`5C(&0209`5C(
X *`09end nest`09`09)&0209`5C(&0209`5C)
X *`09beg chr class`09`09`5B&0209`5B&0209`5C`5B
X *`09beg "word"`09`09<&0209`5C<&0209`5C<
X *`09end "word"`09`09>&0209`5C>&0209`5C>
X *`09beginning`09`09`5E&0209`5E&0209`5E
X *`09end`09`09`09$&0209$&0209$
X *`09any char`09`09.&0209.&0209`5C.
X *`09alternation`09`09`7C&0209`5C`7C&0209`5C`7C
X *`09flip or literal`09`09`5C&0209`5C`5C&0209`5C`5C
X *`09last replace`09`09`7E&0209`7E&0209`5C`7E
X *`09words`09`09`09`5Cw&0209`5Cw&0209`5Cw
X *`09spaces`09`09`09`5Cs&0209`5Cs&0209`5Cs
X *`09digits`09`09`09`5Cd&0209`5Cd&0209`5Cd
X *`09printable`09`09`5Cp&0209`5Cp&0209`5Cp
X *
X *`09So:  in magic mode, we remove `5C from ? + ( ) < > `7C
X *`09`09`09   and add `5C to bare ? + ( ) < > `7C
X *`09   in nomagic mode, we remove `5C from ? + ( ) < > `7C * `5B `5D . `7E
X *`09`09`09   and add `5C to bare ? + ( ) < > `7C * `5B `5D . `7E
X */
X
X#define MAGICMETA   "?+()<>`7C"
X#define NOMAGICMETA "?+()<>`7C*`5B`5D .`7E"
X
Xstatic void
Xregmassage(const char *old,\0B07nxt, int magic)
X`7B
X`09const char *metas =  magic ? MAGICMETA : NO\0E09;
X`09while (*old) `7B
X`09`09if (*old == '`5C`5C') `7B /* remove `5C from these metas */
X`09`09`09if (*(old+1) == EOS) `7B
X`09`09&0209*nxt++ = '`5C`5C';
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09if (strchr(metas, *(old+1))) `7B
X`09`09&0209old++; /* skip the `5C */
X`09`09`09`7D else if (*(old+1) == '`5C`5C') `7B
X`09`09&0209*nxt++ = *old++;  /* the escape */
X`09`09`09`7D
X`09`09`7D else if (strchr(metas, *old)) `7B /* add `5C to these metas */
X`09`09`09*nxt++ = '`5C`5C';
X`09`09`7D
X`09`09*nxt++ = *old++;  /* the char */
X`09`7D
X`09*nxt = EOS;
X`7D
X
X/*
X - regcomp - compile a regular expression into internal code
X *
X * We can't allocate space until we know how big the compiled form will be,
X * but we can't compile it (and thus know how big it is) until we've got a
X * place to put the code.  So we cheat:  we compile it twice, once with code
X * generation turned off and size counting\1D09n, and once "for real".
X * This also means that we don't allocate space until we are sure that the
X * thing really will compile successfully, and we never have to move the
X * code and thus invalidate pointers into it.  (Note that it has to be in
X * one piece because free() must be able to free it all.)
X *
X * Beware that the optimization-preparation code in here knows about some
X * of the structure \1107compiled regexp.
X */
X
Xregexp *
Xregcomp(char *origexp, int magic)
X`7B
X`09register regexp *r;
X`09register char *scan;
X`09register char *longest;
X`09register ALLOC_T len;
X`09int flags;
X`09static char *exp;
X`09static ALLOC_T explen;
X
X`09if (origexp == NULL) `7B
X`09`09regerror("NULL argument");
X`09`09return NULL;
X`09`7D
X
X`09TRACE(("regcomp(%s,%d)`5Cn", origexp, magic))
X
X`09len = strlen(origexp)+1;
X`09if (explen < 2*len+20) `7B
X`09`09if (exp)
X`09`09`09free(exp);
X`09`09exp = castalloc(char, 2*len+20);
X`09`09if (exp == NULL) `7B
X`09`09`09regerror("couldn't allocate exp copy");
X`09`09`09return NULL;
X`09`09`7D
X`09`09explen = 2*len+20;
X`09`7D
X
X`09regmassage(origexp, exp, magic);
X`09TRACE(("after regmassage: '%s'`5Cn", exp))
X
X`09/* First pass: determine size, legality. */
X`09regparse = exp;
X`09regnpar = 1;
X`09regsize = 0;
X`09regcode = `26regdummy;
X`09regc(REGEXP_MAGIC);
X`09if (reg(0, `26flags) == NULL)
X`09`09return(NULL);
X
X`09/* Small enough for pointer-storage convention? */
X`09if (regsize >= 32767) `7B /* Probably could be 65535. */
X`09`09regerror("regexp too big");
X`09`09return NULL;
X`09`7D
X
X`09/* Allocate space. */
X`09r = typeallocplus(regexp, regsize);
X`09if (r == NULL) `7B
X`09`09regerror("out of space");
X`09`09return NULL;
X`09`7D
X
X`09/* how big is it?  (vile addition) */
X`09r->size = sizeof(regexp) + regsize;
X
X`09/* Second pass: emit code. */
X`09regparse = exp;
X`09regnpar = 1;
X`09regcode = r->program;
X`09regc(REGEXP_MAGIC);
X`09if (reg(0, `26flags) == NULL)
X`09`09return(NULL);
X
X`09/* Dig out information for optimizations. */
X`09r->regstart = EOS;`09/* Worst-case defaults. */
X`09r->reganch = 0;
X`09r->regmust = -1;
X`09r->regmlen = 0;
X`09scan = r->program+1;`09`09`09/* First BRANCH. */
X`09if (OP(regnext(scan)) == END) `7B`09`09/* Only one top-level choice. */
X`09`09scan = OPERAND(scan);
X
X`09`09/* Starting-point info. */
X`09`09if (OP(scan) == EXACTLY)
X`09`09`09r->regstart = *OPERAND(scan);
X`09`09else if (OP(scan) == BEGWORD `26`26 OP(regnext\1F06) == EXACTLY)
X`09`09`09r->regstart = *OPERAND(regnext(scan));
X`09`09else if (OP(scan) == BOL)
X`09`09`09r->reganch++;
X
X`09`09/*
X`09`09 * If there's something expensive in the r.e., find the
X`09`09 * longest literal string that must appear and make it the
X`09`09 * regmust.  Resolve ties in favor of later strings, since
X`09`09 * the regstart check works with the beginning of\2F06.e.
X`09`09 * and avoiding duplication strengthens checking.  Not a
X`09`09 * strong reason, but sufficient in the absence of others.
X`09`09 */
X`09`09if (flags`26SPSTART) `7B
X`09`09`09longest = NULL;
X`09`09`09len = 0;
X`09`09`09for (; scan != NULL\0E07= regnext(scan))
X`09`09&0209if (OP(scan) == EXACTLY `26`26 strlen(OPERAND\2306) >= len) `7B
X`09`09&0209`09longest = OPERAND(scan);
X`09`09&0209`09len = strlen(OPERAND(scan));
X`09`09&0209`7D
X`09`09`09if (longest) `7B
X`09`09&0209r->regmust = longest - r->program;
X`09`09&0209r->regmlen = len;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X
X#if NO_LEAKS
X`09if (exp != 0) `7B free(exp); exp = 0; explen\0C06`7D
X#endif
X#if REGDEBUG
X`09regdump(r);
X#endif
X`09return(r);
X`7D
X
X/*
X - reg\0606ular expression, i.e. main body or parenthesized thing
X *
X * Caller must absorb opening parenthesis.
X *
X * Combining parenthesis handling with the base level of regular expression
X * is a trifle forced, but the need to tie the tails of the branches to what
X * follows makes it hard to avoid.
X */
Xstatic char *
Xreg(
Xint paren,`09`09`09/* Parenthesized? */
Xint *flagp)
X`7B
X`09register char *ret;
X`09register char *br;
X`09register char *ender;
X`09register int parno;
X`09int flags;
X
X`09*flagp = HASWIDTH;`09/* Tentatively. */
X
X`09/* Make an OPEN node, if parenthesized. */
X`09if (paren) `7B
X`09`09if (regnpar >= NSUBEXP) `7B
X`09`09`09regerror("too many ()");
X`09`09`09return NULL;
X`09`09`7D
X`09`09parno = regnpar;
X`09`09regnpar++;
X`09`09ret = regnode(OPEN+parno);
X`09`7D else `7B
X`09`09ret = NULL;
X`09`09parno = 0;
X`09`7D
X
X`09/* Pick up the branches, linking them together. */
X`09br = regbranch(`26flags);
X`09if (br == NULL)
X`09`09return(NULL);
X`09if (ret != NULL)
X`09`09regtail(ret, br);`09/* OPEN -> first. */
X`09else
X`09`09ret = br;
X`09if (!(flags`26HASWIDTH))
X`09`09*flagp `26= `7EHASWIDTH;
X`09*flagp `7C= flags`26SPSTART;
X`09while (*regparse == '`7C') `7B
X`09`09regparse++;
X`09`09br = regbranch(`26flags);
X`09`09if (br == NULL)
X`09`09`09return(NULL);
X`09`09regtail(ret, br);`09/* BRANCH ->\0A07. */
X`09`09if (!(flags`26HASWIDTH))
X`09`09`09*flagp `26= `7EHASWIDTH;
X`09`09*flagp `7C= flags`26SPSTART;
X`09`7D
X
X`09/* Make a closing node, and hook it on the end. */
X`09ender = regnode((paren) ? CLOSE+parno : END);
X`09regtail(ret, ender);
X
X`09/* Hook the tails of the branches to the closing node. */
X`09for (br = ret; br != NULL; br = regnext(br))
X`09`09regoptail(br, ender);
X
X`09/* Check for proper termination. */
X`09if (paren `26`26 *regparse++ != ')') `7B
X`09`09regerror("unmatched ()");
X`09`09return NULL;
X`09`7D else if (!paren `26`26 *regparse != EOS) `7B
X`09`09if (*regparse == ')')
X`09`09`09regerror("unmatched ()");
X`09`09else
X`09`09`09regerror("Can't happen");
X`09`09return NULL;
X`09`7D
X
X`09return(ret);
X`7D
X
X/*
X - regbranch - one alternative of an `7C operator
X *
X * Implements the concatenation operator.
X */
Xstatic char *
Xregbranch(int *flagp)
X`7B
X`09register char *ret;
X`09register char *chain;
X`09register char *latest;
X`09int flags;
X
X`09*flagp = WORST;`09`09/* Tentatively. */
X
X`09ret = regnode(BRANCH);
X`09chain = NULL;
X`09while (*regparse != EOS `26`26 \140D'`7C'\1412)') `7B
X`09`09latest = regpiece(`26flags, chain == NULL);
X`09`09if (latest == NULL)
X`09`09`09return(NULL);
X`09`09if (chain `26`26 OP\0C06) == EOL) `7B
X`09`09`09regninsert(2,latest);
X`09`09`09OP(chain) = EXACTLY;
X`09`09`09*latest++ = '$';
X`09`09`09*latest++ = EOS;
X`09`09`09flags `7C= HASWIDTH`7CSIMPLE;
X`09`09`7D
X`09`09*flagp `7C= flags`26HASWIDTH;
X`09`09if (chain == NULL)`09/* First piece. */
X`09`09`09*flagp `7C= flags`26SPSTART;
X`09`09else
X`09`09`09regtail(chain, latest);
X`09`09chain = latest;
X`09`7D
X`09if (chain == NULL)`09/* Loop ran zero times. */
X`09`09(void) regnode(NOTHING);
X
X`09return(ret);
X`7D
X
X/*
X - regpiece - something followed by possible `5B*+?`5D
X *
X * Note that the branching code sequences used for ? and the general cases
X * of * and + are somewhat optimized:  they use the same NOTHING node as
X * both the endmarker for their branch list and the body of the last \2506.
X * It might seem that this node could be dispensed with entirely, but the
X * endmarker role is not redundant.
X */
Xstatic char *
Xregpiece(int *flagp, int at_bop)
X`7B
X`09register char *ret;
X`09register char op;
X`09register char *next;
X`09int flags;
X
X`09ret = regatom(`26flags, at_bop);
X`09if (ret == NULL)
X`09`09return(NULL);
X
X`09op = *regparse;
X`09if (!ISMULT(op)) `7B
X`09`09*flagp = flags;
X`09`09return(ret);
X`09`7D
X
X`09if (!(flags`26HASWIDTH) `26`26 op != '?') `7B
X`09`09regerror("*+ operand could be empty");
X`09`09return NULL;
X`09`7D
X`09*flagp = (op != '+') ? (WORST`7CSPSTART) :\1208HASWIDTH);
X
X`09if (op == '*' `26`26 (flags`26SIMPLE))
X`09`09regopinsert(STAR, ret);
X`09else if (op == '*') `7B
X`09`09/* Emit x* as (x`26`7C), where `26 means "self". */
X`09`09regopinsert(BRANCH, ret);&0209`09/* Either x */
X`09`09regoptail(ret, regnode(BACK));&0209/* and loop */
X`09`09regoptail(ret, ret);&0209`09/* back */
X`09`09regtail(ret, regnode(BRANCH));&0209/* or */
X`09`09regtail(ret, regnode(NOTHING));&0209/* null. */
X`09`7D else if (op == '+' `26`26 (flags`26SIMPLE))
X`09`09regopinsert(PLUS, ret);
X`09else if (op == '+') `7B
X`09`09/* Emit x+ as x(`26`7C), where `26 means "self". */
X`09`09next = regnode(BRANCH);&0209`09/* Either */
X`09`09regtail(ret, next);
X`09`09regtail(regnode(BACK), ret);&0209/* loop back */
X`09`09regtail(next, regnode(BRANCH));&0209/* or */
X`09`09regtail(ret, regnode(NOTHING));&0209/* null. */
X`09`7D else if (op == '?') `7B
X`09`09/* Emit x? as (x`7C) */
X`09`09regopinsert(BRANCH, ret);&0209`09/* Either x */
X`09`09regtail(ret, regnode(BRANCH));&0209/* or */
X`09`09next = regnode(NOTHING);&0209/* null. */
X`09`09regtail(ret, next);
X`09`09regoptail(ret, next);
X`09`7D
X`09regparse++;
X`09if (ISMULT(*regparse)) `7B
X`09`09regerror("nested *?+");
X`09`09return NULL;
X`09`7D
X
X`09return(ret);
X`7D
X
X/*
X - regatom - the lowest level
X *
X * Optimization:  gobbles an entire sequence of ordinary characters so that
X * it can turn them into a single node, which is smaller to store and
X * faster to run.  Backslashed characters are exceptions, each becoming a
X * separate node; the code is simpler that way and it's not worth fixing.
X */
Xstatic char *
Xregatom(int *flagp, int at_bop)
X`7B
X`09register char *ret;
X`09int flags;
X`09int len = 1;
X
X`09*flagp = WORST;`09`09/* Tentatively. */
X
X`09switch (*regparse++) `7B
X`09case '`5E':
X`09`09if (!at_bop) `7B
X`09`09`09regparse--;
X`09`09`09goto defchar;
X`09`09`7D
X`09`09ret = regnode(BOL);
X`09`09break;
X`09case '$':
X`09`09ret = regnode(EOL);
X`09`09break;
X`09case '<':
X`09`09ret = regnode(BEGWORD);
X`09`09break;
X`09case '>':
X`09`09ret = regnode(ENDWORD);
X`09`09break;
X`09case '.':
X`09`09ret = regnode(ANY);
X`09`09*flagp `7C= HASWIDTH`7CSIMPLE;
X`09`09break;
X`09case '`5B': `7B
X`09`09`09register int classbgn;
X`09`09`09register int classend;
X
X`09`09`09if (*regparse == '`5E') `7B`09/* Complement of range. */
X`09`09&0209ret = regnode(ANYBUT);
X`09`09&0209regparse++;
X`09`09`09`7D else
X`09`09&0209ret = regnode(ANYOF);
X`09`09`09if (*regparse == '`5D' `7C`7C \140E-')
X`09`09&0209regc(*regparse++);
X`09`09`09while (*regparse != EOS `26`26 \140D'`5D') `7B
X`09`09&0209if (*regparse == '-') `7B
X`09`09&0209`09regparse++;
X`09`09&0209`09if (*regparse == '`5D' `7C`7C \140DEOS)
X`09`09&0209&0209regc('-');
X`09`09&0209`09else `7B
X`09`09&0209&0209classbgn = UCHAR_AT(regparse-2)+1;
X`09`09&0209&0209classend = UCHAR_AT(regparse);
X`09`09&0209&0209if (classbgn > classend+1) `7B
X`09`09&0209&0309regerror("invalid `5B`5D range");
X`09`09&0209&0309return NULL;
X`09`09&0209&0209`7D
X`09`09&0209&0209for (; classbgn <=\0C06end\160A++)
X`09`09&0209&0309regc(classbgn);
X`09`09&0209&0209regparse++;
X`09`09&0209`09`7D
X`09`09&0209`7D else
X`09`09&0209`09regc(*regparse++);
X`09`09`09`7D
X`09`09`09regc(EOS);
X`09`09`09if (*regparse != '`5D') `7B
X`09`09&0209regerror("unmatched `5B`5D");
X`09`09&0209return NULL;
X`09`09`09`7D
X`09`09`09regparse++;
X`09`09`09*flagp `7C= HASWIDTH`7CSIMPLE;
X`09`09`7D
X`09`09break;
X`09case '(':
X`09`09ret = reg(1, `26flags);
X`09`09if (ret == NULL)
X`09`09`09return(NULL);
X`09`09*flagp `7C= flags`26(HASWIDTH`7CSPSTART);
X`09`09break;
X`09case EOS:
X`09case '`7C':
X`09case ')':`09/* Supposed to be caught earlier. */
X`09`09regerror("internal urp");
X`09`09return NULL;
X
X`09case '?': /* FALLTHROUGH */
X`09case '+': /* FALLTHROUGH */
X`09case '*':
X`09`09regerror("?+* follows nothing");
X`09`09return NULL;
X
X`09case '`5C`5C':
X`09`09switch(*regparse) `7B
X`09`09case EOS:
X#ifdef FAIL_TRAILING_BS
X`09`09`09regerror("trailing `5C`5C");
X`09`09`09return NULL;
X#else
X`09`09`09/* as a special case, treat a trailing '`5C' char as
X`09`09`09 * a trailing '.'.  This makes '`5C' work in isearch
X`09`09`09 * most of the time */
X`09`09`09ret = regnode(ANY);
X`09`09`09*flagp `7C= HASWIDTH`7CSIMPLE;
X`09`09`09return ret;
X#endif
X`09`09case 's':
X`09`09`09ret = regnode(WHITESP);
X`09`09`09*flagp `7C= HASWIDTH`7CSIMPLE;
X`09`09`09break;
X`09`09case 'S':
X`09`09`09ret = regnode(NWHITESP);
X`09`09`09*flagp `7C= HASWIDTH`7CSIMPLE;
X`09`09`09break;
X`09`09case 'w':
X`09`09`09ret = regnode(ALNUM);
X`09`09`09*flagp `7C= HASWIDTH`7CSIMPLE;
X`09`09`09break;
X`09`09case 'W':
X`09`09`09ret = regnode(NALNUM);
X`09`09`09*flagp `7C= HASWIDTH`7CSIMPLE;
X`09`09`09break;
X`09`09case 'd':
X`09`09`09ret = regnode(DIGIT);
X`09`09`09*flagp `7C= HASWIDTH`7CSIMPLE;
X`09`09`09break;
X`09`09case 'D':
X`09`09`09ret = regnode(NDIGIT);
X`09`09`09*flagp `7C= HASWIDTH`7CSIMPLE;
X`09`09`09break;
X`09`09case 'p':
X`09`09`09ret = regnode(PRINT);
X`09`09`09*flagp `7C= HASWIDTH`7CSIMPLE;
X`09`09`09break;
X`09`09case 'P':
X`09`09`09ret = regnode(NPRINT);
X`09`09`09*flagp `7C= HASWIDTH`7CSIMPLE;
X`09`09`09break;
X`09`09default:
X`09`09`09ret = regnode(EXACTLY);
X`09`09`09regc(*regparse);
X`09`09`09regc(EOS);
X`09`09`09*flagp `7C= HASWIDTH`7CSIMPLE;
X`09`09`09break;
X`09`09`7D
X`09`09regparse++;
X`09`09break;
X`09default: `7B
X`09`09`09register char ender;
X
X`09`09`09regparse--;
X`09`09`09len = strcspn(regparse, META);
X`09`09`09if (len <= 0) `7B
X`09`09&0209regerror("internal disaster");
X`09`09&0209return NULL;
X`09`09`09`7D
X`09`09`09ender = *(regparse+len);
X`09`09`09if (len > 1 `26`26 ISMULT(ender))
X`09`09&0209len--;&0209/* Back off clear of ?+* operand. */
X`09`09defchar:
X`09`09`09*flagp `7C= HASWIDTH;
X`09`09`09if (len == 1)
X`09`09&0209*flagp `7C= SIMPLE;
X`09`09`09ret = regnode(EXACTLY);
X`09`09`09while (len > 0) `7B
X`09`09&0209regc(*regparse++);
X`09`09&0209len--;
X`09`09`09`7D
X`09`09`09regc(EOS);
X`09`09`7D
X`09`09break;
X`09`7D
X
X`09return(ret);
X`7D
X
X/*
X - regnode - emit a node
X */
Xstatic char *`09`09/* Location. */
Xregnode(int op)
X`7B
X`09register char *ret;
X`09register char *ptr;
X
X`09ret = regcode;
X`09if (ret == `26regdummy) `7B
X`09`09regsize += 3;
X`09`09return(ret);
X`09`7D
X
X`09ptr = ret;
X`09*ptr++ = op;
X`09*ptr++ = EOS;`09`09/* Null "next" pointer. */
X`09*ptr++ = EOS;
X`09regcode = ptr;
X
X`09return(ret);
X`7D
X
X/*
X - regc - emit (if appropriate) a byte of code
X */
Xstatic void
Xregc(int b)
X`7B
X`09if (regcode != `26regdummy)
X`09`09*regcode++ = (char)b;
X`09else
X`09`09regsize++;
X`7D
X
X/*
X - regninsert - \0907n bytes in front of already-emitted operand
X *
X * Means relocating the operand.
X */
Xstatic void
Xregninsert(register int n, char *opnd)
X`7B
X`09register char *src;
X`09register char *dst;
X`09register char *place;
X
X`09if (regcode == `26regdummy) `7B
X`09`09regsize += n;
X`09`09return;
X`09`7D
X
X`09src = regcode;
X`09regcode += n;
X`09dst = regcode;
X`09while (src > opnd)
X`09`09*--dst = *--src;
X
X`09place = opnd;`09`09/* Op node, where operand used to be. */
X`09while (n--)
X`09`09*place++ = EOS;
X`7D
X
X/*
X - regopinsert - \0907an operator in front of already-emitted\2506nd
X *
X * Means relocating the operand.
X */
Xstatic void
Xregopinsert(int op, char *opnd)
X`7B
X`09regninsert(3, opnd);
X`09if (regcode == `26regdummy)
X`09`09return;
X`09*opnd = op;
X`7D
X
X
X/*
X - regtail - set the next-pointer a\1406end of a node chain
X */
Xstatic void
Xregtail(char *p, \0906val)
X`7B
X`09register char *scan;
X`09register char *temp;
X`09register int offset;
X
X`09if (p == `26regdummy)
X`09`09return;
X
X`09/* Find last node. */
X`09scan = p;
X`09for_ever `7B
X`09`09temp = regnext(scan);
X`09`09if (temp == NULL)
X`09`09`09break;
X`09`09scan = temp;
X`09`7D
X
X`09if (OP(scan) == BACK)
X`09`09offset = scan - val;
X`09else
X`09`09offset = val - scan;
X`09*(scan+1) = (char)((offset>>8)`260377);
X`09*(scan+2) = (char)(offset`260377);
X`7D
X
X/*
X - regoptail\0C06tail on operand of first argument; nop if \2207less
X */
Xstatic void
Xregoptail(char *p, \0906val)
X`7B
X`09/* "Operandless" and "op != BRANCH" are synonymous in practice. */
X`09if (p == NULL `7C`7C p == `26regdummy &027C OP(p) != BRANCH)
X`09`09return;
X`09regtail(OPERAND(p), val);
X`7D
X
X/*
X * regexec and friends
X */
X
X/*
X * Global work variables for regexec().
X */
Xstatic char *reginput;`09`09/* String-input pointer. */
Xstatic char *regnomore;`09`09/* String-input end pointer. */
Xstatic char *regbol;`09`09/* Beginning of input, for `5E check. */
Xstatic char **regstartp;`09/* Pointer to \1606 array. */
Xstatic char **regendp;`09`09/* Ditto for endp. */
X
X/* this very special copy of strncmp allows for caseless operation,
X * and also for non-null terminated strings.  the A arg ends at position
X * E, which can be NULL if A really is null terminated.  B must be null-
X * terminated.  At most n characters are compared.
X */
Xstatic int
Xregstrncmp(const char *a, c\0F0Bb, int n\160Ee)
X`7B
X`09if (ignorecase) `7B
X`09`09if (e == NULL) `7B
X`09`09`09while (--n >=0 `26`26 *a &0226 nocase_eq(*a,*b) &0226 *b)
X`09`09&0209a++, b++;
X`09`09`7D else `7B
X`09`09`09while (--n >=0 `26`26 (a != e) &0226 nocase_eq(*a,*b) &0226 *b)
X`09`09&0209a++, b++;
X`09`09`7D
X`09`7D else `7B
X`09`09if (e == NULL) `7B
X`09`09`09return strncmp(a,b,(SIZE_T)n);
X`09`09`7D else `7B
X`09`09`09while (--n >=0 `26`26 (a != e) &0226 (*a == *b) &0226 *b)
X`09`09&0209a++, b++;
X`09`09`7D
X`09`7D
X
X`09if (n < 0) return 0;
X`09if (a == e) return -*b;
X`09return *a - *b;
X`7D
X
Xstatic char *
Xregstrchr(register char *s, \1209int c\100Bconst\2807e)
X`7B
X`09if (ignorecase) `7B
X`09`09while (s != e) `7B
X`09`09`09if (nocase_eq(*s,c)) return s;
X`09`09`09s++;
X`09`09`7D
X`09`7D else `7B
X`09`09while (s != e) `7B
X`09`09`09if (*s == c) return s;
X`09`09`09s++;
X`09`09`7D
X`09`7D
X`09return 0;
X`7D
X
X/*
X * Same as 'regstrchr()', except that the string has special characters
X * escaped.  The 's' argument is always null-terminated.
X */
Xstatic const char *
XRegStrChr2(register const char *s, \1809int c)
X`7B
X`09if (ignorecase) `7B
X`09`09while (*s != EOS) `7B
X`09`09`09if (*s == '`5C`5C' `26`26 *++s == EOS)
X`09`09&0209break;
X`09`09`09if (nocase_eq(*s,c)) return s;
X`09`09`09s++;
X`09`09`7D
X`09`7D else `7B
X`09`09while (*s != EOS) `7B
X`09`09`09if (*s == '`5C`5C' `26`26 *++s == EOS)
X`09`09&0209break;
X`09`09`09if (*s == c) return s;
X`09`09`09s++;
X`09`09`7D
X`09`7D
X`09return (char *)0;
X`7D
X
X/*
X - regexec - match a\1206p against a string
X `09prog is the compiled expression, strin\2309\0E06\1608end
X`09points just after the string, and the match can begin at or after
X`09startoff, but must end before endoff
X */
Xint
Xregexec(
Xregister regexp *prog,
Xregister char *string,
Xregister char *stringend,  /* pointer to the null, if there were one */
Xregister int startoff,
Xregister int endoff)
X`7B
X`09register char *s, *endsrch;
X
X`09/* Be paranoid... */
X`09if (prog == NULL `7C`7C strin\1209) `7B
X`09`09regerror("NULL parameter");
X`09`09return(0);
X`09`7D
X
X`09/* Check validity of program. */
X`09if (UCHAR_AT(prog->program) != REGEXP_MAGIC) `7B
X`09`09regerror("corrupted program");
X`09`09return(0);
X`09`7D
X
X`09/* supply an endpoint if none given */
X`09if (stringend == NULL) `7B
X`09`09stringend = `26\0D06`5Bstrlen(\1B06)`5D;
X`09`7D else if (stringend < \0C06) `7B
X`09`09regerror("end less than start");
X`09`09return(0);
X`09`7D
X
X
X`09if (endoff < 0)
X`09`09endoff = stringend -\0C07;
X
X`09endsrch = `26string`5Bendoff`5D;
X
X`09/* if our outer limit is the end-of-string, let us scan there,
X`09`09in case we're trying to match a lone '$' */
X`09if (endsrch == stringend)
X`09`09endsrch++;
X
X`09/* If there is a "must appear" string, look for it. */
X`09if (prog->regmust != -1) `7B
X`09`09s = `26string`5Bstartoff`5D;
X`09`09while ( (s = regstrchr(s, prog->program`5B\0E06regmust`5D,
X`09`09&0209&0209stringend))
X`09`09&0209`09!= NULL `26`26 s < endsrch) `7B
X`09`09`09if (regstrncmp(s, `26prog->program`5B\0E06regmust`5D,
X`09`09&0209&0209prog->regmlen, stringend) == 0)
X`09`09&0209break;`09/* Found it. */
X`09`09`09s++;
X`09`09`7D
X`09`09if (s >= endsrch `7C`7C s == NULL)`09/* Not present. */
X`09`09`09return(0);
X`09`7D
X
X`09/* Mark beginning of line for `5E . */
X`09regbol = string;
X
X`09/* Simplest case:  anchored match need be tried only once. */
X`09if (startoff == 0 `26`26 prog->reganch)
X`09`09return(regtry(prog, strin\0808gend));
X
X`09/* Messy cases:  unanchored match. */
X`09s = `26string`5Bstartoff`5D;
X`09if (prog->regstart != EOS) `7B
X`09`09/* We know what char it must start with. */
X`09`09while ( (s = regstrchr(s, prog->regstart, stringend)) != NULL `26`26
X`09`09&0209`09s < endsrch) `7B
X`09`09`09if (regtry(prog, s, stringend))
X`09`09&0209return(1);
X`09`09`09s++;
X`09`09`7D
X`09`7D else `7B
X`09`09/* We don't -- general case. */
X`09`09do `7B
X`09`09`09if (regtry(prog, s, stringend))
X`09`09&0209return(1);
X`09`09`7D while (s++ != stringend `26`26 s < endsrch);
X`09`7D
X
X`09/* Failure. */
X`09return(0);
X`7D
X
X/*
X - regtry - try match at specific point
X */
Xstatic int`09`09/* 0 failure, 1 success */
Xregtry(
Xregexp *prog,
Xchar *string,
Xchar *stringend)
X`7B
X`09register int i;
X`09register char **sp;
X`09register char **ep;
X
X`09reginput = string;
X`09regnomore = stringend;
X`09regstartp = prog->\0F06;
X`09regendp = prog->endp;
X
X`09sp = prog->startp;
X`09ep = prog->endp;
X`09for (i = NSUBEXP; i > 0; i--) `7B
X`09`09*sp++ = NULL;
X`09`09*ep++ = NULL;
X`09`7D
X`09if (regmatch(prog->program + 1)) `7B
X`09`09prog->startp`5B0`5D = string;
X`09`09prog->endp`5B0`5D = reginput;
X`09`09prog->mlen = reginput - string;
X`09`09return(1);
X`09`7D else `7B
X`09`09prog->mlen = 0;  /* not indicative of anything */
X`09`09return(0);
X`09`7D
X`7D
X
X/*
X - regmatch - main matching routine
X *
X * Conceptually the strategy is simple:  check to see whether the current
X * node matches, call self recursively to see whether the rest\3709
X * and then act accordingly.  In practice we make some effort to avoid
X * recursion, in particular by going through "ordinary" nodes (that don't
X * need to know whether the rest of the match failed) by a loop instead of
X * by recursion.
X */
Xstatic int`09`09/* 0 failure, 1 success */
Xregmatch(char *prog)
X`7B
X`09register char *scan;`09/* Current node. */
X`09char *next;`09`09/* Next node. */
X
X`09scan = prog;
X#ifdef REGDEBUG
+-+-+-+-+-+-+-+-  END  OF PART 98 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 99 -+-+-+-+-+-+-+-+
X`09if (scan != NULL `26`26 regnarrate)
X`09`09TRACE(( "%s(`5Cn", regprop(scan)));
X#endif
X`09while (scan != NULL) `7B
X#ifdef REGDEBUG
X`09`09if (regnarrate)
X`09`09`09TRACE(( "%s...`5Cn", regprop(scan)));
X#endif
X`09`09next = regnext(scan);
X
X`09`09switch (OP(scan)) `7B
X`09`09case BOL:
X`09`09`09if (reginput != regbol)
X`09`09&0209return(0);
X`09`09`09break;
X`09`09case EOL:
X`09`09`09if (reginput != regnomore)
X`09`09&0209return(0);
X`09`09`09break;
X`09`09case BEGWORD:
X`09`09`09/* Match if current char isident
X`09`09`09 * and previous char BOL or !ident */
X`09`09`09if ((reginput == regnomore `7C`7C !isident(*\2308))
X`09`09&0209`09`7C`7C (reginput != regbol
X`09`09&0209`09`26`26 isident(reginput`5B-1`5D)))
X`09`09&0209return(0);
X`09`09`09break;
X`09`09case ENDWORD:
X`09`09`09/* Match if previous char isident
X`09`09`09 * and current char EOL or !ident */
X`09`09`09if ((reginput != regnomore `26`26 isident(*\2208))
X`09`09&0209`09`7C`7C reginput == regbol
X`09`09&0209`09`7C`7C !isident(reginput`5B-1`5D))
X `09`09&0209return(0);
X `09`09`09break;
X`09`09case WHITESP:
X`09`09`09/* any single whitespace, but not bol or eol */
X`09`09`09if (reginput == regnomore)
X`09`09&0209return 0;
X`09`09`09if (!isSpace(*reginput))
X`09`09&0209return 0;
X`09`09`09reginput++;
X`09`09`09break;
X`09`09case NWHITESP:
X`09`09`09if (reginput == regnomore)
X`09`09&0209return 0;
X`09`09`09if (isSpace(*reginput))
X`09`09&0209return 0;
X`09`09`09reginput++;
X`09`09`09break;
X`09`09case ALNUM: /* includes _ */
X`09`09`09if (reginput == regnomore)
X`09`09&0209return 0;
X`09`09`09if (!isident(*reginput))
X`09`09&0209return 0;
X`09`09`09reginput++;
X`09`09`09break;
X`09`09case NALNUM:
X`09`09`09if (reginput == regnomore)
X`09`09&0209return 0;
X`09`09`09if (isident(*reginput))
X`09`09&0209return 0;
X`09`09`09reginput++;
X`09`09`09break;
X`09`09case DIGIT:
X`09`09`09if (reginput == regnomore)
X`09`09&0209return 0;
X`09`09`09if (!isDigit(*reginput))
X`09`09&0209return 0;
X`09`09`09reginput++;
X`09`09`09break;
X`09`09case NDIGIT:
X`09`09`09if (reginput == regnomore)
X`09`09&0209return 0;
X`09`09`09if (isDigit(*reginput))
X`09`09&0209return 0;
X`09`09`09reginput++;
X`09`09`09break;
X`09`09case PRINT:
X`09`09`09if (reginput == regnomore)
X`09`09&0209return 0;
X`09`09`09if (!(isPrint(*reginput) `7C`7C isSpace\160B))
X`09`09&0209return 0;
X`09`09`09reginput++;
X`09`09`09break;
X`09`09case NPRINT:
X`09`09`09if (reginput == regnomore)
X`09`09&0209return 0;
X`09`09`09if (isPrint(*reginput) `7C`7C isSpace\160B)
X`09`09&0209return 0;
X`09`09`09reginput++;
X`09`09`09break;
X`09`09case ANY:
X`09`09`09if (reginput == regnomore)
X`09`09&0209return(0);
X`09`09`09reginput++;
X`09`09`09break;
X`09`09case EXACTLY: `7B
X`09`09&0209register int len;
X`09`09&0209register char *opnd;
X
X`09`09&0209if (reginput == regnomore)
X`09`09&0209`09return(0);
X
X`09`09&0209opnd = OPERAND(scan);
X`09`09&0209/* Inline the first character, for speed. */
X`09`09&0209if (ignorecase) `7B
X`09`09&0209`09if (!nocase_eq(*opnd, *reginput))
X`09`09&0209&0209return(0);
X`09`09&0209`7D else `7B
X`09`09&0209`09if (*opnd != *reginput)
X`09`09&0209&0209return(0);
X`09`09&0209`7D
X`09`09&0209len = strlen(opnd);
X`09`09&0209if (len > 1 `26`26 regstrncmp(reginput, opnd, len,
X`09`09&0209&0209regnomore) != 0)
X`09`09&0209`09return(0);
X`09`09&0209reginput += len;
X`09`09`09`7D
X`09`09`09break;
X`09`09case ANYOF:
X`09`09`09if (reginput == regnomore
X`09`09`09 `7C`7C RegStrChr2(OPERAND(scan), *reginput) == 0)
X`09`09&0209return(0);
X`09`09`09reginput++;
X`09`09`09break;
X`09`09case ANYBUT:
X`09`09`09if (reginput == regnomore
X`09`09`09 `7C`7C RegStrChr2(OPERAND(scan), *reginput) != 0)
X`09`09&0209return(0);
X`09`09`09reginput++;
X`09`09`09break;
X`09`09case NOTHING:
X`09`09`09break;
X`09`09case BACK:
X`09`09`09break;
X`09`09case OPEN+1:
X`09`09case OPEN+2:
X`09`09case OPEN+3:
X`09`09case OPEN+4:
X`09`09case OPEN+5:
X`09`09case OPEN+6:
X`09`09case OPEN+7:
X`09`09case OPEN+8:
X`09`09case OPEN+9: `7B
X`09`09&0209register int no;
X`09`09&0209register char *save;
X
X`09`09&0209no = OP(scan) - OPEN;
X`09`09&0209save = reginput;
X
X`09`09&0209if (regmatch(next)) `7B
X`09`09&0209`09/*
X`09`09&0209`09 * Don't set startp if some later
X`09`09&0209`09 * invocation of the same parentheses
X`09`09&0209`09 * already has.
X`09`09&0209`09 */
X`09`09&0209`09if (regstartp`5Bno`5D == NULL)
X`09`09&0209&0209regstartp`5Bno`5D = save;
X`09`09&0209`09return(1);
X`09`09&0209`7D else
X`09`09&0209`09return(0);
X`09`09`09`7D
X`09`09`09/* NOTREACHED */
X
X`09`09case CLOSE+1:
X`09`09case CLOSE+2:
X`09`09case CLOSE+3:
X`09`09case CLOSE+4:
X`09`09case CLOSE+5:
X`09`09case CLOSE+6:
X`09`09case CLOSE+7:
X`09`09case CLOSE+8:
X`09`09case CLOSE+9: `7B
X`09`09&0209register int no;
X`09`09&0209register char *save;
X
X`09`09&0209no = OP(scan) - CLOSE;
X`09`09&0209save = reginput;
X
X`09`09&0209if (regmatch(next)) `7B
X`09`09&0209`09/*
X`09`09&0209`09 * Don't set endp if some later
X`09`09&0209`09 * invocation of the same parentheses
X`09`09&0209`09 * already has.
X`09`09&0209`09 */
X`09`09&0209`09if (regendp`5Bno`5D == NULL)
X`09`09&0209&0209regendp`5Bno`5D = save;
X`09`09&0209`09return(1);
X`09`09&0209`7D else
X`09`09&0209`09return(0);
X`09`09`09`7D
X`09`09`09/* NOTREACHED */
X
X`09`09case BRANCH: `7B
X`09`09&0209register char *save;
X
X`09`09&0209if (OP(next) != BRANCH)&0209/* No choice. */
X`09`09&0209`09next = OPERAND(scan);`09/* Avoid recursion. */
X`09`09&0209else `7B
X`09`09&0209`09do `7B
X`09`09&0209&0209save = reginput;
X`09`09&0209&0209if (regmatch(OPERAND(scan)))
X`09`09&0209&0309return(1);
X`09`09&0209&0209reginput = save;
X`09`09&0209&0209scan = regnext(scan);
X`09`09&0209`09`7D while (scan != NULL `26`26 OP(scan) == BRANCH);
X`09`09&0209`09return(0);
X`09`09&0209`09/* NOTREACHED */
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09break;
X`09`09case STAR:
X`09`09case PLUS: `7B
X`09`09&0209register char nxtch;
X`09`09&0209register int no;
X`09`09&0209register char *save;
X`09`09&0209register int min;
X
X`09`09&0209/*
X`09`09&0209 * Lookahead to avoid useless match attempts
X`09`09&0209 * when we know what character comes next.
X`09`09&0209 */
X`09`09&0209nxtch = EOS;
X`09`09&0209if (OP(next) == EXACTLY)
X`09`09&0209`09nxtch = *OPERAND(next);
X`09`09&0209min = (OP(scan) == STAR) ? 0 : 1;
X`09`09&0209save = reginput;
X`09`09&0209no = regrepeat(OPERAND(scan));
X`09`09&0209if (ignorecase)
X`09`09&0209    while (no >= min) `7B
X`09`09&0209`09/* If it could work, try it. */
X`09`09&0209`09if (nxtch == EOS `7C`7C
X`09`09&0209&0209reginput == regnomore `7C`7C
X`09`09&0209&0209nocase_eq(*reginput,nxtch))
X`09`09&0209&0209if (regmatch(next))
X`09`09&0209&0309return(1);
X`09`09&0209`09/* Couldn't or didn't -- back up. */
X`09`09&0209`09no--;
X`09`09&0209`09reginput = save + no;
X`09`09&0209    `7D
X`09`09&0209else
X`09`09&0209    while (no >= min) `7B
X`09`09&0209`09/* If it could work, try it. */
X`09`09&0209`09if (nxtch == EOS `7C`7C
X`09`09&0209&0209reginput == regnomore `7C`7C
X`09`09&0209&0209*reginput == nxtch)
X`09`09&0209&0209if (regmatch(next))
X`09`09&0209&0309return(1);
X`09`09&0209`09/* Couldn't or didn't -- back up. */
X`09`09&0209`09no--;
X`09`09&0209`09reginput = save + no;
X`09`09&0209    `7D
X`09`09&0209return(0);
X`09`09`09`7D
X`09`09`09/* NOTREACHED */
X
X`09`09case END:
X`09`09`09return(1);`09/* Success! */
X`09`09default:
X`09`09`09regerror("memory corruption");
X`09`09`09return(0);
X`09`09`7D
X
X`09`09scan = next;
X`09`7D
X
X`09/*
X`09 * We get here only if there's trouble -- normally "case END" is
X`09 * the terminating point.
X`09 */
X`09regerror("corrupted pointers");
X`09return(0);
X`7D
X
X/*
X - regrepeat - repeatedly match something simple, report how many
X */
Xstatic int
Xregrepeat(const char *p)
X`7B
X`09register int count = 0;
X`09register char *scan;
X`09register const char *opnd;
X
X`09scan = reginput;
X`09opnd = OPERAND(p);
X`09switch (OP(p)) `7B
X`09case ANY:
X`09`09count = regnomore - scan;
X`09`09scan += count;
X`09`09break;
X`09case EXACTLY:
X`09`09if (ignorecase)
X`09`09`09while (scan != regnomore `26`26 nocase_eq(*opnd,*scan)) `7B
X`09`09&0209count++;
X`09`09&0209scan++;
X`09`09`09`7D
X`09`09else
X`09`09`09while (scan != regnomore `26`26 *opnd == *scan) `7B
X`09`09&0209count++;
X`09`09&0209scan++;
X`09`09`09`7D
X`09`09break;
X`09case ANYOF:
X`09`09while (scan != regnomore `26`26 RegStrChr2(opnd, *scan) != NULL) `7B
X`09`09`09count++;
X`09`09`09scan++;
X`09`09`7D
X`09`09break;
X`09case ANYBUT:
X`09`09while (scan != regnomore `26`26 RegStrChr2(opnd, *scan) == NULL) `7B
X`09`09`09count++;
X`09`09`09scan++;
X`09`09`7D
X`09`09break;
X`09case WHITESP:
X`09`09while (scan != regnomore `26`26 isSpace(*scan)) `7B
X`09`09`09count++;
X`09`09`09scan++;
X`09`09`7D
X`09`09break;
X`09case NWHITESP:
X`09`09while (scan != regnomore `26`26 !isSpace(*scan)) `7B
X`09`09`09count++;
X`09`09`09scan++;
X`09`09`7D
X`09`09break;
X`09case ALNUM:
X`09`09while (scan != regnomore `26`26 isident(*scan)) `7B
X`09`09`09count++;
X`09`09`09scan++;
X`09`09`7D
X`09`09break;
X`09case NALNUM:
X`09`09while (scan != regnomore `26`26 !isident(*scan)) `7B
X`09`09`09count++;
X`09`09`09scan++;
X`09`09`7D
X`09`09break;
X`09case DIGIT:
X`09`09while (scan != regnomore `26`26 isDigit(*scan)) `7B
X`09`09`09count++;
X`09`09`09scan++;
X`09`09`7D
X`09`09break;
X`09case NDIGIT:
X`09`09while (scan != regnomore `26`26 !isDigit(*scan)) `7B
X`09`09`09count++;
X`09`09`09scan++;
X`09`09`7D
X`09`09break;
X`09case PRINT:
X`09`09while (scan != regnomore `26`26
X`09`09&0209(isPrint(*scan) `7C`7C isSpace\1207)) `7B
X`09`09`09count++;
X`09`09`09scan++;
X`09`09`7D
X`09`09break;
X`09case NPRINT:
X`09`09while (scan != regnomore `26`26
X`09`09&0209!(isPrint(*scan) `7C`7C isSpace\1207)) `7B
X`09`09`09count++;
X`09`09`09scan++;
X`09`09`7D
X`09`09break;
X`09default:`09`09/* Oh dear.  Called inappropriately. */
X`09`09regerror("internal foulup");
X`09`09count = 0;`09/* Best compromise. */
X`09`09break;
X`09`7D
X`09reginput = scan;
X
X`09return(count);
X`7D
X
X/*
X - regnext - dig the "next" pointer out of a node
X */
Xstatic char *
Xregnext(register char *p)
X`7B
X`09register int offset;
X
X`09if (p == `26regdummy)
X`09`09return(NULL);
X
X`09offset = NEXT(p);
X`09if (offset == 0)
X`09`09return(NULL);
X
X`09if (OP(p) == BACK)
X`09`09return(p-offset);
X`09else
X`09`09return(p+offset);
X`7D
X
X#ifdef REGDEBUG
X
X/*
X - regdump - dump a regexp onto stdout in vaguely comprehensible form
X */
Xstatic void
Xregdump(regexp *r)
X`7B
X`09register char *s;
X`09register char op = EXACTLY;`09/* Arbitrary non-END op. */
X`09register char *next;
X
X`09s = r->program + 1;
X`09while (op != END) `7B`09/* While that wasn't END last time... */
X`09`09op = OP(s);
X`09`09TRACE(("%2d%s", s-r->program, regprop(s))); /* Where, what. */
X`09`09next = regnext(s);
X`09`09if (next == NULL)&0209/* Next ptr. */
X`09`09`09TRACE(("(0)"))
X`09`09else
X`09`09`09TRACE(("(%d)", (s-r->program)+(next-s)))
X`09`09s += 3;
X`09`09if (op == ANYOF `7C`7C \0F09BUT\100AEXACTLY) `7B
X`09`09`09/* Literal string, where present. */
X`09`09`09while (*s != EOS) `7B
X`09`09&0209TRACE(("%c", *s));
X`09`09&0209s++;
X`09`09`09`7D
X`09`09`09s++;
X`09`09`7D
X`09`09TRACE(("`5Cn"));
X`09`7D
X
X`09/* Header fields of interest. */
X`09if (r->regstart != EOS)
X`09`09TRACE(("start `60%c' ", r->regstart));
X`09if (r->reganch)
X`09`09TRACE(("anchored "));
X`09if (r->regmust != -1)
X`09`09TRACE(("must have `5C"%s`5C"", `26(r->program`5Br->regmust`5D)));
X`09TRACE(("`5Cn"));
X`7D
X
X/*
X - regprop - printable representation of opcode
X */
Xstatic char *
Xregprop(char *op)
X`7B
X`09register char *p = "?";
X`09static char buf`5B50`5D;
X
X`09(void) strcpy(buf, ":");
X
X`09switch (OP(op)) `7B
X`09case BOL:
X`09`09p = "BOL";
X`09`09break;
X`09case EOL:
X`09`09p = "EOL";
X`09`09break;
X`09case ANY:
X`09`09p = "ANY";
X`09`09break;
X`09case ANYOF:
X`09`09p = "ANYOF";
X`09`09break;
X`09case ANYBUT:
X`09`09p = "ANYBUT";
X`09`09break;
X`09case BRANCH:
X`09`09p = "BRANCH";
X`09`09break;
X`09case EXACTLY:
X`09`09p = "EXACTLY";
X`09`09break;
X`09case NOTHING:
X`09`09p = "NOTHING";
X`09`09break;
X`09case BACK:
X`09`09p = "BACK";
X`09`09break;
X`09case END:
X`09`09p = "END";
X`09`09break;
X`09case BEGWORD:
X`09`09p = "BEGWORD";
X`09`09break;
X`09case ENDWORD:
X`09`09p = "ENDWORD";
X`09`09break;
X`09case WHITESP:
X`09`09p = "WHITESP";
X`09`09break;
X`09case NWHITESP:
X`09`09p = "NWHITESP";
X`09`09break;
X`09case ALNUM:
X`09`09p = "ALNUM";
X`09`09break;
X`09case NALNUM:
X`09`09p = "NALNUM";
X`09`09break;
X`09case DIGIT:
X`09`09p = "DIGIT";
X`09`09break;
X`09case NDIGIT:
X`09`09p = "NDIGIT";
X`09`09break;
X`09case PRINT:
X`09`09p = "PRINT";
X`09`09break;
X`09case NPRINT:
X`09`09p = "NPRINT";
X`09`09break;
X`09case OPEN+1:
X`09case OPEN+2:
X`09case OPEN+3:
X`09case OPEN+4:
X`09case OPEN+5:
X`09case OPEN+6:
X`09case OPEN+7:
X`09case OPEN+8:
X`09case OPEN+9:
X`09`09(void)sprintf(buf+strlen(buf), "OPEN%d", OP(op)-OPEN);
X`09`09p = NULL;
X`09`09break;
X`09case CLOSE+1:
X`09case CLOSE+2:
X`09case CLOSE+3:
X`09case CLOSE+4:
X`09case CLOSE+5:
X`09case CLOSE+6:
X`09case CLOSE+7:
X`09case CLOSE+8:
X`09case CLOSE+9:
X`09`09(void)sprintf(buf+strlen(buf), "CLOSE%d", OP(op)-CLOSE);
X`09`09p = NULL;
X`09`09break;
X`09case STAR:
X`09`09p = "STAR";
X`09`09break;
X`09case PLUS:
X`09`09p = "PLUS";
X`09`09break;
X`09default:
X`09`09regerror("corrupted opcode");
X`09`09break;
X`09`7D
X`09if (p != NULL)
X`09`09(void) strcat(buf, p);
X`09return(buf);
X`7D
X#endif
X
X/*
X * The following is provided for those people who do not have strcspn() in
X * their C libraries.  They should get off\2807butts and do something
X * about it; at least one public-domain implementation of those (highly
X * useful) string routines has been published on Usenet.
X */
X#ifdef STRCSPN
X/*
X * strcspn - find length of initial segment of s1 consisting entirely
X * of characters not from s2
X */
X
Xint
Xstrcspn(char *s1, \0A072)
X`7B
X`09register char *scan1;
X`09register char *scan2;
X`09register int count;
X
X`09count = 0;
X`09for (scan1 = s1; *\0D06!= EOS; scan1++) `7B
X`09`09for (scan2 = s2; *\0D06!= EOS;)`09/* ++ moved down. */
X`09`09`09if (*scan1 == *scan2++)
X`09`09&0209return(count);
X`09`09count++;
X`09`7D
X`09return(count);
X`7D
X#endif
X
X/* vile support:
X * like regexec, but takes LINE * as input instead of char *
X */
Xint
Xlregexec(
Xregister regexp *prog,
Xregister LINE *lp,
Xregister int startoff,
Xregister int endoff)
X`7B
X`09if (endoff < startoff)
X`09`09return 0;
X
X`09if (lp->l_text) `7B
X`09`09return regexec(prog, lp->l_text, `26(\0E0A`5Bllength(lp)`5D),
X`09`09&0209`09startoff, endoff);
X`09`7D else `7B
X`09`09/* the prog might be `5E$, or something legal on a null string */
X
X`09`09char *nullstr = "";
X`09`09int s;
X
X`09`09if (startoff > 0)
X`09`09`09return 0;
X`09`09s = regexec(prog, nullstr\0909, 0, 0);
X`09`09if (s) `7B
X`09`09`09if (prog->mlen > 0) `7B
X`09`09&0209mlforce("BUG: non-zero match on null string");
X`09`09&0209return 0;
X`09`09`09`7D
X`09`09`09prog->startp`5B0`5D = \1206end\1007NULL;
X`09`09`7D
X`09`09return s;
X`09`7D
X`7D
$ call unpack [.VILE-8_0]REGEXP.C;1 -
 1899730581 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 84 105 152
$!
$ create 'f'
X/*
X * The routines in this file
X * deal with the region, that magic space
X * between "." and mark. Some functions are
X * commands. Some functions are just for
X * internal use.
X *
X * $Header: /usr/build/vile/vile/RCS/region.c,v 1.89 1998/05/12 22:40:49 tom E
Vxp $
X *
X */
X
X#include`09"estruct.h"
X#include        "edef.h"
X
Xtypedef`09int (*CharProcFunc) (int c);
X
Xstatic`09int`09blankline(void *flagp, int l\0706r);
Xstatic`09int`09do_chars_in_line(void *flagp, int ll\0806rr);
Xstatic`09int`09do_lines_in_region(int (*linefunc) (REGN_ARGS), void *argp, int
V convert_cols);
Xstatic`09int`09killrectmaybesave (int save);
X
Xstatic CharProcFunc charprocfunc;
X
X/*
X * Kill the region. Ask "get\1006"
X * to figure out the bounds of the region.
X * Move "." to the start, and kill the characters.
X */
Xint
Xkillregion(void)
X`7B
X`09if (regionshape == RECTANGLE)
X`09    return killrectmaybesave(TRUE);
X`09else
X`09    return killregionmaybesave(TRUE);
X`7D
X
Xint
Xkillregionmaybesave(int save)
X`7B
X`09register int    status;
X`09REGION          region;
X
X`09if ((status = getregion(`26\0806)) == TRUE) `7B
X`09`09if (save) `7B
X`09`09`09kregcirculate(TRUE);
X`09`09`09ksetup();&0209/* command, so do magic */
X`09`09`09if (regionshape == FULLLINE)
X`09`09&0209kregflag `7C= KLINES;
X`09`09`7D
X`09`09DOT = region.r_orig;
X`09`09status = ldelete(region.r_size, save);
X`09`09if (save) `7B
X`09`09`09kdone();
X`09`09`09ukb = 0;
X`09`09`7D
X`09`7D
X#if OPT_SELECTIONS
X`09find_release_attr(curbp, `26region);
X#endif
X`09return status;
X`7D
X
Xstatic int
Xkill_line(void *flagp, int l\0706r)
X`7B
X`09int s;
X`09int save = *(int *)flagp;
X`09LINE *lp = DOT.l;
X
X`09s = detabline((void *)FALSE, 0, 0);
X`09if (s != TRUE) return s;
X
X`09DOT.o = l;
X
X`09if (r > llength(lp))
X`09    r = llength(lp);
X
X`09if (r > l) `7B
X`09    s = ldelete((B_COUNT)(r - l), save);
X`09    if (s != TRUE) return s;
X`09`7D
X
X`09if (save)
X`09`09kinsert('`5Cn');
X
X`09if (b_val(curbp,MDTABINSERT))
X`09`09s = entabline((void *)TRUE, 0, 0);
X
X`09DOT.o = l;
X`09return s;
X`7D
X
Xstatic int
Xkillrectmaybesave(int save)
X`7B
X`09register int    s;
X`09MARK savedot;
X
X`09savedot = DOT;
X
X`09if (save) `7B
X`09`09kregcirculate(TRUE);
X`09`09ksetup();
X`09`09if (regionshape == FULLLINE) `7B
X`09`09`09kregflag `7C= KLINES;
X`09`09`7D else if (regionshape == RECTANGLE) `7B
X`09`09`09kregflag `7C= KRECT;
X`09`09`7D
X`09`7D
X`09s = do_lines_in_region(kill_line, (void *)`26save, FALSE);
X`09DOT = savedot;
X
X`09if (s `26`26 do_report(klines+(kchars!=0))) `7B
X`09`09mlwrite("`5B%d line%s, %d character%s killed`5D",
X`09`09`09klines, PLURAL(\0F06),
X`09`09`09kchars, PLURAL(\0F06));
X`09`7D
X`09if (save) `7B
X`09`09kdone();
X`09`09ukb = 0;
X`09`7D
X`09return (s);
X`7D
X
X/*
X * open up a region -- shift the "selected" area of each line by its
X * own length.  most useful for rectangular regions.
X * fill character is space, unless a string is passed in, in which case
X * it is used instead.
X */
X/*ARGSUSED*/
Xstatic int
Xopen_hole_in_line(void *flagp, int l\0706r)
X`7B
X    `09char *string = (\1006)flagp;
X`09int len;
X`09int s;
X`09int saveo = DOT.o;
X`09LINE *lp = DOT.l;
X
X`09s = detabline((void *)FALSE, 0, 0);
X`09if (s != TRUE) return s;
X
X`09if (llength(lp) <= l) `7B`09/* nothing to do if no string */
X`09`09if (!string) `7B
X`09`09    if (b_val(curbp,MDTABINSERT))
X`09`09`09    s = entabline((void *)TRUE, 0, 0);
X`09`09    DOT.o = saveo;
X`09`09    return s;
X`09`09`7D else `7B
X`09`09    DOT.o = llength(lp);
X`09`09    if (l - DOT.o)
X`09`09`09linsert(l - DOT.o, ' ');
X`09`09`7D
X`09`7D
X`09DOT.o = l;
X`09if (string) `7B
X`09`09len = strlen(string);
X`09`09if (len < r - l)
X`09`09`09len = r - l;
X`09`7D else `7B
X`09`09len = r - l;
X`09`7D
X`09s =  lstrinsert(string, len );
X`09if (s != TRUE) return s;
X
X`09DOT.o = saveo;
X`09if (b_val(curbp,MDTABINSERT))
X`09`09s = entabline((void *)TRUE, 0, 0);
X`09return s;
X`7D
X
X/*
X * open up a region
X */
Xint
Xopenregion(void)
X`7B
X`09return do_lines_in_region(open_hole_in_line, (void *)NULL, FALSE);
X`7D
X
X/*
X * open up a region, filling it with a supplied string
X * this is pretty simplistic -- could be a lot more clever
X */
Xint
Xstringrect(void)
X`7B
X`09int             s;
X`09static char     buf`5BNLINE`5D;
X
X`09s = mlreply("Rectangle text: ", buf, sizeof(buf) );
X`09if (s != TRUE)
X`09`09return s;
X
X/* i couldn't decide at first whether we should be inserting or
X`09overwriting... this chooses. */
X#ifdef insert_the_string
X`09return do_lines_in_region(open_hole_in_line, (void *)buf, FALSE);
X#else /* overwrite the string */
X`09return do_lines_in_region(blankline, (void *)buf, FALSE);
X#endif
X`7D
X
X/*
X * insert a shiftwidth at the front of the line
X * don't do it if we're in cmode and the line starts with '#'
X */
X/*ARGSUSED*/
Xstatic int
Xshift_right_line(void *flagp GCC_UNUSED, int l\1211r\240B)
X`7B
X`09int s, t;
X
X`09if (is_empty_line(DOT) `7C`7C (is_c_mode(curbp) `26`26
X`09`09&0209`09llength(DOT.l) > 0 `26`26
X`09`09&0209`09char_at(DOT) == '#')) `7B
X`09`09return TRUE;
X`09`7D
X`09s = shiftwid_val(curbp);
X`09t = curtabval;
X`09DOT.o = w_left_margin(curwp);
X`09if (s) `7B  /* try to just insert tabs if possible */
X`09`09if (b_val(curbp,MDTABINSERT) `26`26 s >= t &0226 (s % t == 0)) `7B
X`09`09`09linsert(s/t, '`5Ct');
X`09`09`7D else `7B
X`09`09`09detabline((void *)TRUE, 0, 0);
X`09`09`09DOT.o = w_left_margin(curwp);
X`09`09`09linsert(s, ' ');
X`09`09`7D
X`09`09if (b_val(curbp,MDTABINSERT))
X`09`09`09entabline((void *)TRUE, 0, 0);
X`09`7D
X`09return firstnonwhite(FALSE,1);
X`7D
X
X/*
X * shift region right by a tab stop
X * if region is rectangular, "open it up"
X */
Xint
Xshiftrregion(void)
X`7B
X    `09if (regionshape == RECTANGLE)
X`09    return do_lines_in_region(open_hole_in_line, (void *)NULL, FALSE);
X
X`09regionshape = FULLLINE;
X`09return do_lines_in_region(shift_right_line, (void *)0, FALSE);
X`7D
X
X/*
X * delete a shiftwidth-equivalent from the front of the line
X */
X/*ARGSUSED*/
Xstatic int
Xshift_left_line(void *flagp GCC_UNUSED, int l\1211r\240B)
X`7B
X`09register int`09i;
X`09register int`09lim;
X`09register int`09s;
X`09register LINE *linep = DOT.l;
X
X`09if (llength(linep) == 0)
X`09`09return TRUE;
X
X`09s = shiftwid_val(curbp);
X
X`09detabline((void *)TRUE, 0, 0);
X
X`09/* examine the line to the end, or the first shiftwidth, whichever
X`09`09comes first */
X`09lim = (s < llength(linep)) ? s :\160F;
X
X
X`09i = 0;
X`09/* count the leading spaces */
X`09while (lgetc(linep,i) == ' ' `26`26 i < lim)
X`09`09i++;
X
X`09if (i != 0) `7B /* did we find space/tabs to kill? */
X`09`09DOT.o = w_left_margin(curwp);
X`09`09if ((s = ldelete((B_COUNT)i,FALSE)) != TRUE)
X`09`09`09return s;
X`09`7D
X
X`09DOT.o = w_left_margin(curwp);
X`09if (b_val(curbp,MDTABINSERT))
X`09`09entabline((void *)TRUE, 0, 0);
X`09return TRUE;
X`7D
X
X/*
X * shift region left by a tab stop
X */
Xint
Xshiftlregion(void)
X`7B
X    `09if (regionshape == RECTANGLE)
X`09    return killrectmaybesave(FALSE);
X
X`09regionshape = FULLLINE;
X`09return do_lines_in_region(shift_left_line, (void *)0, FALSE);
X`7D
X
X/*
X * change all tabs in the line to the right number of spaces.
X * leadingonly says only do\1908 whitespace
X */
X/*ARGSUSED*/
Xint
Xdetabline(void *flagp GCC_UNUSED, int l\1211r\240B)
X`7B
X`09register int`09s;
X`09register int`09c;
X`09int`09ocol;
X`09long leadingonly = (long)flagp;
X`09LINE *lp = DOT.l;
X
X`09if (llength(lp) == 0)
X`09`09return TRUE;
X
X`09ocol = getccol(FALSE);
X
X`09DOT.o = 0;
X
X`09/* detab the entire current line */
X`09while (DOT.o < llength(lp)) `7B
X`09`09c = char_at(DOT);
X`09`09if (leadingonly `26`26 !isSpace(c))
X`09`09`09break;
X`09`09/* if we have a tab */
X`09`09if (c == '`5Ct') `7B
X`09`09`09if ((s = ldelete(1L, FALSE)) != TRUE
X`09`09`09`7C`7C  (s = insspace(TRUE, curtabval - (DOT.o %\150A) )) != TRUE)
X`09`09&0209return s;
X`09`09`7D
X`09`09DOT.o++;
X`09`7D
X`09(void)gocol(ocol);
X`09return TRUE;
X`7D
X
X
X/*
X * change all tabs in the region to\0E06ight number of spaces
X */
X#if OPT_AEDIT
Xint
Xdetab_region(void)
X`7B
X`09regionshape = FULLLINE;
X`09return do_lines_in_region(detabline,(void *)FALSE, FALSE);
X`7D
X#endif
X
X/*
X * convert all appropriate spaces in the line to tab characters.
X * leadingonly says only do\1908 whitespace
X */
X/*ARGSUSED*/
Xint
Xentabline(void *flagp GCC_UNUSED, int l\1211r\240B)
X`7B
X`09register int fspace;`09/* pointer to first space if in a run */
X`09register int ccol;`09/* current cursor column */
X`09register char cchar;`09/* current character */
X`09int`09ocol;
X`09long leadingonly = (long)flagp;
X`09LINE *lp = DOT.l;
X
X`09if (llength(lp) == 0)
X`09`09return TRUE;
X
X`09ocol = getccol(FALSE);
X
X`09/* entab the current line */
X`09/* would this have been easier if it had started at
X`09`09the _end_ of the line, rather than the beginning?  -pgf */
X`09fspace = -1;
X`09ccol = 0;
X
X`09detabline(flagp, 0, 0);`09/* get rid of possible existing tabs */
X`09DOT.o = 0;
X`09for_ever `7B
X`09`09/* see if it is time to compress */
X`09`09if ((fspace >= 0) `26`26 (nextab\1807) <= ccol)) `7B
X`09`09`09if (ccol - fspace < 2) `7B
X`09`09&0209fspace = -1;
X`09`09`09`7D else `7B
X`09`09&0209backchar(TRUE, ccol - fspace);
X`09`09&0209(void)ldelete((B_COUNT)(ccol - fspace), FALSE);
X`09`09&0209linsert(1, '`5Ct');
X`09`09&0209fspace = -1;
X`09`09`09`7D
X`09`09`7D
X
X`09`09if (DOT.o >= llength(lp))
X`09`09`09break;
X
X`09`09/* get the current character */
X`09`09cchar = char_at(DOT);
X
X`09`09if (cchar == ' ') `7B /* a space...compress? */
X`09`09`09if (fspace == -1)
X`09`09&0209fspace = ccol;
X`09`09`7D else `7B
X`09`09`09if (leadingonly)
X`09`09&0209break;
X`09`09`09fspace = -1;
X`09`09`7D
X`09`09ccol++;
X`09`09DOT.o++;
X`09`7D
X`09(void)gocol(ocol);
X`09return TRUE;
X`7D
X
X/*
X * convert all appropriate spaces in the region to tab characters
X */
X#if OPT_AEDIT
Xint
Xentab_region(void)
X`7B
X`09regionshape = FULLLINE;
X`09return do_lines_in_region(entabline,(void *)FALSE, FALSE);
X`7D
X#endif
X
X/* trim trailing whitespace from a line.  dot is preserved if possible. */
X/* (dot is even preserved if it was sitting on the newline) */
X/*ARGSUSED*/
Xint
Xtrimline(void *flag GCC_UNUSED, int l\1211r\240B)
X`7B
X`09register int off;
X`09register LINE *lp;
X`09int odoto, s;
X`09int delcnt, was_at_eol;
X
X`09lp = DOT.l;
X
X`09if (llength(lp) == 0)
X`09`09return TRUE;
X
X`09/* may return -1 if line is all whitespace.  but
X`09`09that's okay, since the math still works. */
X`09off = lastchar(lp);
X
X`09delcnt = llength(lp) - (off + 1);
X`09if (!delcnt)
X`09`09return TRUE;
X
X`09odoto = DOT.o;
X`09was_at_eol = (odoto == llength(lp));
X
X`09DOT.o = off + 1;
X`09s = ldelete((B_COUNT)delcnt,FALSE);
X
X`09if (odoto > off) `7B`09/* do we need to back up? */
X`09`09odoto = llength(lp);
X`09`09if (!was_at_eol)
X`09`09`09odoto--; /* usually we want the last char on line */
X`09`7D
X
X`09if (odoto < 0)
X`09`09DOT.o = 0;
X`09else
X`09`09DOT.o = odoto;
X`09return s;
X`7D
X
X/*
X * trim trailing whitespace from a region
X */
X#if OPT_AEDIT
Xint
Xtrim_region(void)
X`7B
X`09regionshape = FULLLINE;
X`09return do_lines_in_region(trimline, (void *)0, FALSE);
X`7D
X#endif
X
X/* turn line, or part, to whitespace */
X/*ARGSUSED*/
Xstatic int
Xblankline(void *flagp, int l\0706r)
X`7B
X    `09char *string = (\1006)flagp;
X`09int len;
X`09int s = TRUE;
X`09int saveo;
X`09LINE *lp = DOT.l;
X
X`09saveo = l;
X
X`09/* if the shape is rectangular, then l and r are columns, not
X`09`09offsets */
X`09if (regionshape == RECTANGLE) `7B
X`09`09s = detabline((void *)FALSE, 0, 0);
X`09`09if (s != TRUE)
X`09`09`09return s;
X`09`7D
X
X`09if (llength(lp) <= l) `7B`09/* nothing to do if no string */
X`09`09if (!string) `7B
X`09`09    if (regionshape == RECTANGLE `26`26 b_val(curbp,MDTABINSERT))
X`09`09`09    s = entabline((void *)TRUE, 0, 0);
X`09`09    DOT.o = saveo;
X`09`09    return s;
X`09`09`7D else `7B
X`09`09    DOT.o = llength(lp);
X`09`09    if (l - DOT.o)
X`09`09`09linsert(l - DOT.o, ' ');
X`09`09`7D
X`09`7D
X
X`09DOT.o = l;
X
X`09if (llength(lp) <= r) `7B
X`09    `09/* then the rect doesn't extend to the end of line */
X`09`09ldelete((B_COUNT)(llength(lp) - l), FALSE);
X
X`09`09/* so there's nothing beyond the rect, so insert at
X`09`09`09most r-l chars of the string, or nothing */
X`09`09if (string) `7B
X`09`09    len = strlen(string);
X`09`09    if (len > r - l)
X`09`09`09    len = r - l;
X`09`09`7D else `7B
X`09`09    len = 0;
X`09`09`7D
X`09`7D else `7B
X`09    `09/* the line goes on, so delete and reinsert exactly */
X`09`09ldelete((B_COUNT)(r - l), FALSE);
X`09    `09len = r - l;
X`09`7D
X
X`09s = lstrinsert(string, len);
X`09if (s != TRUE) return s;
X
X        if (regionshape == RECTANGLE `26`26 b_val(curbp,MDTABINSERT))
X`09`09s = entabline((void *)TRUE, 0, 0);
X
X`09return s;
X`7D
X
X/*
X * Copy all of the characters in the
X * region to the kill buffer. Don't move dot
X * at all. This is a bit like a kill region followed
X * by a yank.
X */
Xstatic int
+-+-+-+-+-+-+-+-  END  OF PART 99 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 100 -+-+-+-+-+-+-+-+
X_yankchar(int c)
X`7B
X`09kinsert(c);
X`09/* FIXX check return value, longjmp back to yank_line */
X`09return -1;
X`7D
X
X/*ARGSUSED*/
Xstatic int
Xyank_line(void *flagp GCC_UNUSED, int l\0706r)
X`7B
X`09int s;
X`09charprocfunc = _yankchar;
X`09s = do_chars_in_line((void  *)NULL, l, r);
X`09if (s) `7B
X`09    if (r == llength(DOT.l) `7C`7C regionshape == RECTANGLE) `7B
X`09`09/* we don't necessarily want to insert the last newline
X`09`09`09in a region, so we delay it */
X`09`09s = kinsertlater('`5Cn');
X`09    `7D
X`09    else if (r > llength(DOT.l)) `7B
X`09`09/* This can happen when selecting with the mouse. */
X`09`09kinsert('`5Cn');
X`09    `7D
X`09`7D
X`09return s;
X`7D
X
Xint
Xyankregion(void)
X`7B
X`09register int    s;
X
X`09kregcirculate(TRUE);
X`09ksetup();
X`09if (regionshape == FULLLINE) `7B
X`09`09kregflag `7C= KLINES`7CKYANK;
X`09`7D else if (regionshape == RECTANGLE) `7B
X`09`09kregflag `7C= KRECT`7CKYANK;
X`09`7D
X`09s = do_lines_in_region(yank_line, (void *)0, TRUE);
X`09if (s `26`26 do_report(klines+(kchars!=0))) `7B
X`09`09mlwrite("`5B%d line%s, %d character%s yanked`5D",
X`09`09`09klines, PLURAL(\0F06),
X`09`09`09kchars, PLURAL(\0F06));
X`09`7D
X`09kdone();
X`09ukb = 0;
X`09return (s);
X`7D
X
X
X#if NEEDED
Xint
X_blankchar(int c)
X`7B
X`09if (!isSpace(c))
X`09`09return ' ';
X`09return -1;
X`7D
X#endif
X
Xstatic int
X_to_lower(int c)
X`7B
X`09if (isUpper(c))
X`09`09return c `5E DIFCASE;
X`09return -1;
X`7D
X
Xstatic int
X_to_upper(int c)
X`7B
X`09if (isLower(c))
X`09`09return c `5E DIFCASE;
X`09return -1;
X`7D
X
Xstatic int
X_to_caseflip(int c)
X`7B
X`09if (isAlpha(c))
X`09`09return c `5E DIFCASE;
X`09return -1;
X`7D
X
X/*
X * turn region to whitespace
X */
X#if OPT_AEDIT
Xint
Xblank_region(void)
X`7B
X`09return do_lines_in_region(blankline, (void *)NULL, FALSE);
X`7D
X#endif
X
Xint
Xflipregion(void)
X`7B
X`09charprocfunc = _to_caseflip;
X`09return do_lines_in_region(do_chars_in_line,(void *)NULL, TRUE);
X`7D
X
Xint
Xlowerregion(void)
X`7B
X`09charprocfunc = _to_lower;
X`09return do_lines_in_region(do_chars_in_line,(void *)NULL, TRUE);
X`7D
X
Xint
Xupperregion(void)
X`7B
X`09charprocfunc = _to_upper;
X`09return do_lines_in_region(do_chars_in_line,(void *)NULL, TRUE);
X`7D
X
X#if OPT_ENCRYPT
Xstatic int
Xcrypt_char(int c)
X`7B
X`09char nc = c;
X`09ue_crypt(`26nc, 1);
X`09if (nc != c)
X`09`09return nc;
X`09return -1;
X`7D
X
Xint
Xcryptregion(void)
X`7B
X`09int s;
X`09char`09temp`5BNPAT`5D;
X`09/* make a key if we don't have one */
X`09if (curbp->b_key`5B0`5D == EOS) `7B
X`09`09s = ue_makekey(curbp->b_key, sizeof\150D));
X`09`09if (s != TRUE)
X`09`09`09return (s == FALSE);
X`09`7D
X`09(void)strcpy(temp, curbp->b_key);
X`09ue_crypt((char *)0, 0);
X`09ue_crypt(temp, strlen(temp));
X`09charprocfunc = crypt_char;
X`09return do_lines_in_region(do_chars_in_line,(void *)NULL, TRUE);
X`7D
X#endif
X
X#if NEEDED
X/* this walks a region, char by char, and invokes a funcion for
X `09each.  it does _not_ know about rectangles, which is why it is
X`09probably obsolete -- we can do_lines_in_region/do_chars_in_line
X`09to get the same effect*/
Xint
Xcharprocreg(int (*func)(int))
X`7B
X`09MARK`09`09m;
X`09register int    c,nc;
X`09register int    status;
X`09REGION          region;
X`09int `09`09changed = 0;
X
X`09if ((status = getregion(`26\0806)) == TRUE) `7B
X`09`09m = region.r_orig;
X`09`09while (region.r_size-- > 0) `7B
X`09`09`09if (is_at_end_of_line(m)) `7B
X`09`09&0209m.l = lforw(m.l);
X`09`09&0209m.o = w_left_margin(curwp);
X`09`09`09`7D else `7B
X`09`09&0209c = char_at(m);
X`09`09&0209nc = (func)(c);
X`09`09&0209if (nc != -1) `7B
X`09`09&0209`09copy_for_undo(m.l);
X`09`09&0209`09put_char_at(m, nc);
X`09`09&0209`09changed++;
X`09`09&0209`7D
X`09`09&0209++m.o;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09if (changed)
X`09    chg_buff(curbp, WFHARD);
X`09return (status);
X`7D
X#endif
X
X/* finish filling in the left/right column info for a rectangular region */
Xstatic void
Xset_rect_columns(register REGION *rp)
X`7B
X`09if (regionshape == RECTANGLE) `7B
X`09`09MARK`09lc, rc;
X
X`09`09lc = (rp->r_orig.o < \0F06end.o) ?\0F07orig :\1C0A;
X`09`09rc = (rp->r_orig.o > \0F06end.o) ?\0F07orig :\1C0A;
X
X`09`09/* convert to columns */
X`09`09rp->r_leftcol = getcol(lc, FALSE);
X`09`09rp->r_rightcol = getcol(rc, FALSE) + 1;
X`09`7D
X`7D
X
X
X/*
X * This routine figures out the
X * bounds of the region in the current window, and
X * fills in the fields of the "REGION" structure pointed
X * to by "rp". Because the dot and mark are usually very
X * close together, we scan outward from dot looking for
X * mark. This should save time. Return a standard code.
X */
X
XREGION *haveregion;
X
Xint
Xgetregion(register REGION *rp)
X`7B
X`09register LINE   *flp;
X`09register LINE   *blp;
X`09B_COUNT fsize;
X`09B_COUNT bsize;
X
X`09if (haveregion) `7B
X`09`09*rp = *haveregion;
X`09`09haveregion = NULL;
X`09`09return TRUE;
X`09`7D
X
X#if OPT_SELECTIONS
X`09rp->r_attr_id = (unsigned short) assign\2208();
X#endif
X
X`09if (MK.l == NULL) `7B
X`09`09mlforce("BUG: getregion: no mark set in this window");
X`09`09return FALSE;
X`09`7D
X
X#define line_length(lp) (l\0D0A+1)`09/* length counting newline */
X`09if (sameline(DOT, MK)) `7B
X`09`09rp->r_orig =
X`09`09rp->r_end  = DOT;
X`09`09if (regionshape == FULLLINE) `7B
X`09`09`09rp->r_orig.o =
X`09`09`09rp->r_end.o  = w_left_margin(curwp);
X`09`09`09rp->r_end.l  = lforw(DOT.l);
X`09`09`09rp->r_size   = (B_COUNT)(line_length(DOT.l) - w_left_margin(curwp));
V
X`09`09`7D else `7B
X`09`09`09if (DOT.o < MK.o) `7B
X`09`09&0209rp->r_orig.o = \0F06leftcol = DOT.o;
X`09`09&0209rp->r_end.o  = \0F06rightcol = MK.o;
X`09`09`09`7D else `7B
X`09`09&0209rp->r_orig.o = \0F06leftcol = MK.o;
X`09`09&0209rp->r_end.o  = \0F06rightcol = DOT.o;
X`09`09`09`7D
X`09`09`09rp->r_size = \0D06end.o -\0E07orig.o;
X`09`09`09set_rect_columns(rp);
X`09`09`7D
X`09`09return TRUE;
X`09`7D
X
X#if !SMALLER
X`09if (b_is_counted(curbp)) `7B /* we have valid line numbers */
X`09`09register LINE   *flp_start;
X`09`09L_NUM dno, mno;
X`09`09dno = line_no(curbp, DOT.l);
X`09`09mno = line_no(curbp, MK.l);
X`09`09if (mno > dno) `7B
X`09`09`09flp = DOT.l;
X`09`09`09blp = MK.l;
X`09`09`09rp->r_orig = DOT;
X`09`09`09rp->r_end  = MK;
X`09`09`7D else `7B
X`09`09`09flp = MK.l;
X`09`09`09blp = DOT.l;
X`09`09`09rp->r_orig = MK;
X`09`09`09rp->r_end  = DOT;
X`09`09`7D
X`09`09fsize = (B_COUNT)(line_length(flp) -
X`09`09&0209    ((regionshape == FULLLINE) ?
X`09`09&0209`09w_left_margin(curwp) : rp->r_orig.o));
X`09`09flp_start = flp;
X`09`09while (flp != blp) `7B
X`09`09`09flp = lforw(flp);
X`09`09`09if (flp != buf_head(curbp) `26`26 \1A07flp_start) `7B
X`09`09`09    fsize += line_length(flp) - w_left_margin(curwp);
X`09`09`09`7D else if (flp != blp) `7B
X`09`09`09    mlwrite ("BUG: hit buf end in getregion");
X`09`09`09    return FALSE;
X`09`09`09`7D
X
X`09`09`09if (flp == blp) `7B
X`09`09&0209if (regionshape == FULLLINE) `7B
X`09`09&0209`09rp->r_orig.o =
X`09`09&0209`09rp->r_end.o  = w_left_margin(curwp);
X`09`09&0209`09rp->r_end.l  = lforw(\150B);
X`09`09&0209`7D else `7B
X`09`09&0209`09fsize -=
X`09`09&0209`09    (line_length(flp) - rp->r_end.o);
X`09`09&0209`09set_rect_columns(rp);
X`09`09&0209`7D
X`09`09&0209rp->r_size = fsize;
X`09`09&0209return TRUE;
X`09`09`09`7D
X`09`09`7D
X`09`7D else
X#endif /* !SMALLER */
X`09`7B
X`09`09blp = DOT.l;
X`09`09flp = DOT.l;
X`09`09if (regionshape == FULLLINE) `7B
X`09`09`09bsize = f\0806
X`09`09`09(B_COUNT)(line_length(blp) - w_left_margin(curwp));
X`09`09`7D else `7B
X`09`09`09bsize = (B_COUNT)(DOT.o - w_left_margin(curwp));
X`09`09`09fsize = (B_COUNT)(line_length(flp) - DOT.o);
X`09`09`7D
X`09`09while ((flp != buf_head(curbp)) `7C`7C
X`09`09&0209(lback(blp) != buf_head(curbp))) `7B
X`09`09    if (flp != buf_head(curbp)) `7B
X`09`09`09flp = lforw(flp);
X`09`09`09if (flp != buf_head(curbp))
X`09`09&0209fsize += line_length(flp) - w_left_margin(curwp);
X`09`09`09if (flp == MK.l) `7B
X`09`09&0209rp->r_orig = DOT;
X`09`09&0209rp->r_end  = MK;
X`09`09&0209if (regionshape == FULLLINE) `7B
X`09`09&0209`09rp->r_orig.o =
X`09`09&0209`09rp->r_end.o  = w_left_margin(curwp);
X`09`09&0209`09rp->r_end.l  = lforw(\150B);
X`09`09&0209`7D else `7B
X`09`09&0209`09fsize -= (line_length(flp) - MK.o);
X`09`09&0209`09set_rect_columns(rp);
X`09`09&0209`7D
X`09`09&0209rp->r_size = fsize;
X`09`09&0209return TRUE;
X`09`09`09`7D
X`09`09    `7D
X`09`09    if (lback(blp) != buf_head(curbp)) `7B
X`09`09`09blp = lback(blp);
X`09`09`09bsize += line_length(blp) - w_left_margin(curwp);
X`09`09`09if (blp == MK.l) `7B
X`09`09&0209rp->r_orig = MK;
X`09`09&0209rp->r_end  = DOT;
X`09`09&0209if (regionshape == FULLLINE) `7B
X`09`09&0209`09rp->r_orig.o =
X`09`09&0209`09rp->r_end.o  = w_left_margin(curwp);
X`09`09&0209`09rp->r_end.l  = lforw(\150B);
X`09`09&0209`7D else `7B
X`09`09&0209`09bsize -= (MK.o - w_left_margin(curwp));
X`09`09&0209`09set_rect_columns(rp);
X`09`09&0209`7D
X`09`09&0209rp->r_size = bsize;
X`09`09&0209return TRUE;
X`09`09`09`7D
X`09`09    `7D
X`09`09`7D
X`09`7D
X`09mlforce("BUG: lost mark");
X`09return FALSE;
X`7D
X
Xint
Xget_fl_region(REGION *rp)
X`7B
X`09int`09status;
X
X`09regionshape = FULLLINE;
X`09status = getregion(rp);
X`09regionshape = EXACT;
X
X`09return status;
X`7D
X
X
X/* the (*linefunc)() routine that this calls _must_ be prepared to
X`09to get empty lines passed to it from this routine. */
Xstatic int
Xdo_lines_in_region(
Xint (*linefunc) (REGN_ARGS),
Xvoid *argp,
Xint convert_cols)`09/* if rectangle,\1F08 columns to offsets */
X`7B
X`09register LINE   *linep;
X`09register int    status;
X`09REGION          region;
X`09C_NUM`09`09l, r;
X
X`09if ((status=getregion(`26\0806)) == TRUE) `7B
X
X`09`09/* for each line in the region, ... */
X`09`09linep = region.r_orig.l;
X`09`09for_ever `7B
X`09`09`09/* move through the region... */
X`09`09`09/* it's important that the linefunc get called
X`09`09&0209for every line, even if blank, since it
X`09`09&0209may want to keep track of newlines, for
X`09`09&0209instance */
X`09`09`09DOT.l = linep;
X`09`09`09DOT.o = w_left_margin(curwp);
X`09`09`09if (regionshape == RECTANGLE) `7B
X`09`09`09    if (convert_cols) `7B
X`09`09&0209C_NUM reached;
X`09`09&0209l = getoff(region.r_leftcol, `26reached);
X`09`09&0209if (l < 0) l = -l + llength(linep);
X`09`09&0209r = getoff(region.r_rightcol, `26reached);
X`09`09&0209if (r < 0) r = -r + llength(linep);
X`09`09&0209if (reached > region.r_rightcol) /* a tab? */
X`09`09&0209`09reached = region.r_rightcol;
X`09`09`09    `7D else `7B
X`09`09&0209l = region.r_leftcol;
X`09`09&0209r = region.r_rightcol;
X`09`09`09    `7D
X`09`09`09`7D else `7B
X`09`09&0209l =  w_left_margin(curwp);
X`09`09&0209r = llength(DOT.l);
X`09`09&0209if (sameline(region.r_orig, DOT))
X`09`09&0209`09l = region.r_orig.o;
X`09`09&0209if (sameline(region.r_end, DOT)) `7B
X`09`09&0209`09r = region.r_end.o;
X`09`09&0209`09/* if we're on the end-of-
X`09`09&0209`09 * region, in col 0, we're
X`09`09&0209`09 * done. we don't want to
X`09`09&0209`09 * call teh line function
X`09`09&0209`09 * for the empty case
X`09`09&0209`09 */
X`09`09&0209`09if (r == 0)
X`09`09&0209&0209break;
X`09`09&0209`7D
X`09`09`09`7D
X
X`09`09`09/* ...and process each line */
X`09`09`09if ((status = (*linefunc)(argp,l,r)) != TRUE) `7B
X`09`09&0209return status;
X`09`09`09`7D
X
X`09`09`09if (linep == region.r_end.l)
X`09`09&0209break;
X
X`09`09`09linep = lforw(linep);
X
X`09`09`09/*
X`09`09`09 * If this happened to be a full-line region, then
X`09`09`09 * we've bumped the end-region pointer to the next line
X`09`09`09 * so we won't run into problems with the width.  But
X`09`09`09 * we don't really want to _process_ the end-region
X`09`09`09 * line, so check here also. (Leave the above check
X`09`09`09 * alone just in case the buffer is empty).
X`09`09`09 */
X`09`09`09if (regionshape == FULLLINE
X`09`09`09 `26`26 linep == region.r_end.l)
X`09`09&0209break;
X
X`09`09`7D
X`09`09if (regionshape == FULLLINE) `7B
X`09`09    (void)kinsertlater(-1);
X`09`09    (void)firstnonwhite(FALSE,1);
X`09`09`7D
X`09`7D
X#if OPT_SELECTIONS
X`09if (linefunc == kill_line) /* yuck.  it's the only one that deletes */
X`09`09find_release_attr(curbp, `26region);
X#endif
X`09return status;
X`7D
X
X
X/* walk through the characters in a line, applying a function.  the
X`09line is marked changed if the function returns other than -1.
X`09if it returns other than -1, then the char is replaced with
X`09that value.
X    the ll and rr args are OFFSETS, so if you use this routine with
X    `09do_lines_in_region, tell it to CONVERT columns to offsets. */
X/*ARGSUSED*/
Xstatic int
Xdo_chars_in_line(
Xvoid`09*flagp GCC_UNUSED,
Xint`09ll, int`09rr)`09`09/* offsets of of chars to be processed */
X`7B
X`09register int    c,nc;
X`09int `09`09changed = 0;
X`09register LINE *lp;
X`09int i;
X
X`09lp = DOT.l;
X
X
X`09if (llength(lp) < ll)
X`09`09return TRUE;
X
X`09DOT.o = ll;
X`09if (rr > llength(lp))
X`09`09rr = llength(lp);
X
X`09for (i = ll; i < rr; i++) `7B
X`09`09c = lgetc(lp,i);
X`09`09nc = (charprocfunc)(c);
X`09`09if (nc != -1) `7B
X`09`09`09copy_for_undo(lp);
X`09`09`09lputc(lp,i,(char)nc);
X`09`09`09changed++;
X`09`09`7D
X`09`7D
X`09if (changed)
X`09    chg_buff(curbp, WFHARD);
X`09return TRUE;
X`7D
$ call unpack [.VILE-8_0]REGION.C;1 -
 1852421703 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 48 106 152
$!
$ create 'f'
Xrevlist for vile-8.0, version v8_0
X--------\0808\1010\2020\4010
XCHANGES`091.176
XCHANGES.R3`091.1
XCHANGES.R4`091.1
XCHANGES.R5`091.1
XCHANGES.R6`091.1
XCOPYING`091.1
XINSTALL`091.6
XMANIFEST`09none
XREADME`091.66
XREADME.PC`091.14
Xaclocal.m4`091.55
Xansi.c`091.33
Xapi.c`091.14
Xapi.h`091.10
Xbasic.c`091.98
Xbind.c`091.180
Xborland.c`091.25
Xbtree.c`091.4
Xbtree.h`091.3
Xbuffer.c`091.173
Xbuglist`091.343
Xc-filt.c`091.10
Xc-filt.flx`091.1
Xchgdfunc.h`091.4
Xcmdtbl`091.158
Xconfig.emx`091.1
Xconfig_h.in`091.2
Xconfigure`09none
Xconfigure.in`091.86
Xcrypt.c`091.22
Xcsrch.c`091.28
Xdescrip.mms`091.35
Xdirstuff.h`091.23
Xdisplay.c`091.250
Xdjhandl.c`091.6
Xdumbterm.c`091.13
Xedef.h`091.227
Xestruct.h`091.356
Xeval.c`091.160
Xexec.c`091.161
Xexterns.c`091.6
Xfences.c`091.48
Xfile.c`091.227
Xfilec.c`091.81
Xfileio.c`091.125
Xfinderr.c`091.70
Xglob.c`091.58
Xglobals.c`091.43
Xgppconio.c`091.2
Xhistory.c`091.48
Xibmpc.c`091.88
Xinput.c`091.183
Xinsert.c`091.109
Xinstall.sh`091.2
Xisearch.c`091.49
Xitbuff.c`091.12
Xlckfiles.c`091.8
Xline.c`091.111
Xmain.c`091.325
Xmakefile.blc`091.7
Xmakefile.djg`091.25
Xmakefile.emx`091.2
Xmakefile.icc`091.10
Xmakefile.in`091.111
Xmakefile.tbc`091.22
Xmakefile.wat`091.24
Xmakefile.wnt`091.27
Xmanfilt.c`091.22
Xmap.c`091.81
Xmenu.c`091.20
Xmkdirs.sh`091.2
Xmkprlenv.wnt`091.2
Xmktbls.c`091.87
Xmodes.c`091.118
Xmodetbl`091.98
Xmsgs.c`091.17
Xnpopen.c`091.64
Xntconio.c`091.34
Xntwinio.c`091.10
Xoneliner.c`091.89
Xopers.c`091.62
Xos2keys.h`091.1
Xos2pipe.c`091.4
Xos2vio.c`091.19
Xpas-filt.c`091.2
Xpatchlev.h`091.122
Xpath.c`091.84
Xperl.xs`091.24
Xproto.h`091.285
Xpscreen.h`091.1
Xptypemap`091.5
Xrandom.c`091.191
Xregexp.c`091.65
Xregion.c`091.89
Xrevlist`09v8_0
Xsearch.c`091.111
Xselect.c`091.69
Xspawn.c`091.128
Xtags.c`091.89
Xtbuff.c`091.31
Xtcap.c`091.107
Xtcap.h`091.4
Xtermio.c`091.155
Xtrace.c`091.8
Xtrace.h`091.6
Xundo.c`091.69
Xversion.c`091.37
Xvile.1`091.17
Xvile.hlp`091.356
Xvms2unix.c`091.31
Xvmsbuild.com`091.20
Xvmspipe.c`091.12
Xvmsvt.c`091.34
Xw32cbrd.c`091.4
Xw32misc.c`091.2
Xw32pipe.c`091.9
Xwatch.c`091.2
Xwindow.c`091.81
Xword.c`091.62
Xwordmov.c`091.19
Xx11.c`091.183
Xxshell.sh`091.4
Xdoc/config.doc`091.1
Xdoc/macros.doc`091.1
Xdoc/menus.doc`091.1
Xdoc/modes.doc`091.1
Xdoc/perl.doc`091.1
Xmacros/digraphs.rc`091.1
Xmacros/manpage.rc`091.1
Xmacros/pictmode.rc`091.1
Xmacros/vile-pager`091.1
Xperl/glob2re.pl`091.1
Xperl/hgrep.pl`091.1
Xperl/manfilt.pl`091.1
Xperl/search.pl`091.2
Xperl/shell.pl`091.1
Xperl/tailf.pl`091.1
Xperl/visit.pl`091.1
$ call unpack [.VILE-8_0]REVLIST.;1 -
 1278733572 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 5 107 152
$!
$ create 'f'
X/*
X * The functions in this file implement commands that search\2C06e forward
X * and backward directions.
X *  heavily modified by Paul Fox, 1990
X *
X * $Header: /usr/build/vile/vile/RCS/search.c,v 1.111 1998/05/27 00:34:46 tom
V Exp $
X *
X * original written Aug. 1986 by John M. Gamble, but I (pgf) have since
X * replaced his regex stuff with Henry Spencer'\2107p package.
X *
X */
X
X#include`09"estruct.h"
X#include        "edef.h"
X
Xstatic char const onlyonemsg`5B`5D = "Only one occurrence of pattern";
Xstatic char const notfoundmsg`5B`5D = "Not found";
Xstatic char const hitendmsg`5B`5D = "Search reached %s without matching patter
Vn";
X
Xstatic`09int`09rsearch(int f, int n\0706dummy\1206fromscreen);
Xstatic`09void`09nextch(MARK *pdot, int dir);
Xstatic`09void`09savematch(MARK curpos, SIZE_T matchlen);
X
Xstatic void
Xnot_found_msg(int wrapok, int dir)
X`7B
X`09if (wrapok `7C`7C global_b_val(MDTERSE))
X`09`09mlforce (notfoundmsg);
X`09else
X`09`09mlforce (hitendmsg, dir == FORWARD ? "bottom":"top");
X`7D
X
Xint
Xscrforwsearch(int f, int n)
X`7B
X`09return fsearch(f,n,FALSE,TRUE);
X`7D
X
Xint
Xscrbacksearch(int f, int n)
X`7B
X`09return rsearch(f,n,FALSE,TRUE);
X`7D
X
X/*
X * forwsearch -- S\0A06forward.  Get a \2107string from the user, and
X *`09search for the string.  If found, reset the "." to be just after
X *`09the match string, and (perhaps) repaint the display.
X */
X
Xint
Xforwsearch(int f, int n)
X`7B
X`09register int status;
X`09hst_init('/');
X`09status = fsearch(f, n, FALSE\0707);
X`09hst_flush();
X`09return status;
X`7D
X
X/* extra args -- marking if called from globals, and should mark line\1706
X`09fromscreen, if the searchpattern is on the s\2707so we don't need to
X`09ask for it.  */
Xint
Xfsearch(int f, int n\0706marking\1406fromscreen)
X`7B
X`09register int status;
X`09int wrapok;
X`09MARK curpos;
X`09int didmark = FALSE;
X`09int didwrap;
X
X`09if (f `26`26 n < 0)
X`09`09return rsearch(f, -n, FALSE\0707);
X
X`09wrapok = marking `7C`7C window_b_val(curwp, MDSWRAP);
X
X`09last_srch_direc = FORWARD;
X
X`09/* Ask the user for the text of a pattern.  If the
X`09 * response is TRUE (\1208s other than FALSE are
X`09 * possible), search for the pattern for as long as
X`09 * n is positive (n == 0 will go through once, which
X`09 * is just fine).
X`09 *
X`09 * If "marking", then we were called to do line \2907 for the
X`09 *  global command.
X`09 */
X`09if (!marking `26`26 (status = readpattern("Search: ", `26pat`5B0`5D,
X`09`09&0209`26gregexp, lastkey, fromscreen)) != TRUE) `7B
X`09`09return status;
X`09`7D
X
X`09ignorecase = window_b_val(curwp, MDIGNCASE);
X
X`09curpos = DOT;
X`09scanboundry(wrapok,curpos,FORWARD);
X`09didwrap = FALSE;
X`09do `7B
X`09`09nextch(`26(DOT), FORWARD);
X`09`09status = scanner(gregexp, FORWARD, wrapok, `26didwrap);
X`09`09if (status == ABORT) `7B
X`09`09`09mlforce("`5BAborted`5D");
X`09`09`09DOT = curpos;
X`09`09`09return status;
X`09`09`7D
X`09`09/* if found, mark the line */
X`09`09if (status `26`26 marking) `7B
X`09`09`09/* if we were on a match when we started, then
X`09`09&0209scanner returns TRUE, even though it's
X`09`09&0209on a boundary. quit if we find ourselves
X`09`09&0209marking a line twice */
X`09`09`09if (lismarked(DOT.l))
X`09`09&0209break;
X`09`09`09lsetmarked(DOT.l);
X`09`09`09/* and, so the next nextch gets to next line */
X`09`09`09DOT.o = llength(DOT.l);
X`09`09`09didmark = TRUE;
X`09`09`7D
X`09`09if (!marking `26`26 didwrap) `7B
X`09`09`09mlwrite("`5BSearch wrapped past end of buffer`5D");
X`09`09`09didwrap = FALSE;
X`09`09`7D
X`09`7D while ((marking `7C`7C --n > 0) `26`26 status == TRUE);
X
X`09if (!marking `26`26 !status)
X`09`09nextch(`26(DOT),REVERSE);
X
X`09if (marking) `7B  /* restore dot and offset */
X`09`09DOT = curpos;
X`09`7D else if (status) `7B
X`09`09savematch(DOT,gregexp->mlen);
X`09`09if (samepoint(DOT,curpos)) `7B
X`09`09`09mlwrite(onlyonemsg);
X`09`09`7D
X`09`7D
X
X`09/* Complain if not there.  */
X`09if ((marking `26`26 didmark == FALSE) `7C`7C
X`09`09&0209(!marking `26`26 status == FALSE)) `7B
X`09`09not_found_msg(wrapok,FORWARD);
X`09`09return FALSE;
X`09`7D
X
X`09attrib_matches();
X`09return TRUE;
X`7D
X
X/*
X * forwhunt -- Search forward for a previously acquired s\2906string.
X *`09If found, reset the "." to be just after the match string,
X *`09and (perhaps) repaint the display.
X */
X
Xint
Xforwhunt(int f, int n)
X`7B
X`09register int status;
X`09int wrapok;
X`09MARK curpos;
X`09int didwrap;
X
X`09wrapok = window_b_val(curwp, MDSWRAP);
X
X`09if (n < 0)`09`09/* search backwards */
X`09`09return(backhunt(f, -n));
X
X`09/* Make sure a pattern exists */
X`09if (pat`5B0`5D == EOS)
X`09`7B
X`09`09mlforce("`5BNo pattern set`5D");
X`09`09return FALSE;
X`09`7D
X
X`09ignorecase = window_b_val(curwp, MDIGNCASE);
X
X`09/* Search for the pattern for as long as
X`09 * n is positive (n == 0 will go through once, which
X`09 * is just fine).
X`09 */
X`09curpos = DOT;
X`09scanboundry(wrapok,DOT,FORWARD);
X`09didwrap = FALSE;
X`09do `7B
X`09`09nextch(`26(DOT),FORWARD);
X`09`09status = scanner(gregexp, FORWARD, wrapok, `26didwrap);
X`09`09if (didwrap) `7B
X`09`09`09mlwrite("`5BSearch wrapped past end of buffer`5D");
X`09`09`09didwrap = FALSE;
X`09`09`7D
X`09`7D while ((--n > 0) `26`26 status == TRUE);
X
X`09/* Save away the match, or complain if not there.  */
X`09if (status == TRUE) `7B
X`09`09savematch(DOT,gregexp->mlen);
X`09`09if (samepoint(DOT,curpos)) `7B
X`09`09`09mlwrite(onlyonemsg);
X`09`09`7D
X`09`7D else if (status == FALSE) `7B
X`09`09nextch(`26(DOT),REVERSE);
X`09`09not_found_msg(wrapok,FORWARD);
X`09`7D else if (status == ABORT) `7B
X`09`09mlforce("`5BAborted`5D");
X`09`09DOT = curpos;
X`09`09return status;
X`09`7D
X
X`09attrib_matches();
X`09return status;
X`7D
X
X/*
X * backsearch -- Reverse \1206.  Get a\0F07 string from the user, and
X *`09search, starting at "." and proceeding toward the front of the buffer.
X *`09If found "." is left pointing at the first character of the pattern
X *`09(the last character that was matched).
X */
Xint
Xbacksearch(int f, int n)
X`7B
X`09register int status;
X`09hst_init('?');
X`09status = rsearch(f, n, FALSE\0707);
X`09hst_flush();
X`09return status;
X`7D
X
X/* ARGSUSED */
Xstatic int
Xrsearch(int f, int n\0706dummy GCC_UNUSED\1D06fromscreen)
X`7B
X`09register int status;
X`09int wrapok;
X`09MARK curpos;
X`09int didwrap;
X
X`09if (n < 0)
X`09`09return fsearch(f, -n, FALSE, fromscreen);
X
X`09wrapok = window_b_val(curwp, MDSWRAP);
X
X`09last_srch_direc = REVERSE;
X
X`09/* Ask the user for the text of a pattern.  If the
X`09 * response is TRUE (\1208s other than FALSE are
X`09 * possible), search for the pattern for as long as
X`09 * n is positive (n == 0 will go through once, which
X`09 * is just fine).
X`09 */
X`09if ((status = readpattern("Reverse search: ", `26pat`5B0`5D,
X`09`09&0209`26gregexp, EOS, fromscreen)) == TRUE) `7B
X`09`09ignorecase = window_b_val(curwp, MDIGNCASE);
X
X`09`09curpos = DOT;
X`09`09scanboundry(wrapok,DOT,REVERSE);
X`09`09didwrap = FALSE;
X`09`09do `7B
X`09`09`09nextch(`26(DOT),REVERSE);
X`09`09`09status = scanner(gregexp, REVERSE, wrapok, `26didwrap);
X`09`09`09if (didwrap) `7B
X`09`09&0209mlwrite(
X`09`09&0209  "`5BSearch wrapped past start of buffer`5D");
X`09`09&0209didwrap = FALSE;
X`09`09`09`7D
X`09`09`7D while ((--n > 0) `26`26 status == TRUE);
X
X`09`09/* Save away the match, or complain if not there.  */
X`09`09if (status == TRUE)
X`09`09`09savematch(DOT,gregexp->mlen);
X`09`09`09if (samepoint(DOT,curpos)) `7B
X`09`09&0209mlwrite(onlyonemsg);
X`09`09`09`7D
X`09`09else if (status == FALSE) `7B
X`09`09`09nextch(`26(DOT),FORWARD);
X`09`09`09not_found_msg(wrapok,REVERSE);
X`09`09`7D else if (status == ABORT) `7B
X`09`09`09mlforce("`5BAborted`5D");
X`09`09`09DOT = curpos;
X`09`09`09return status;
X`09`09`7D
X`09`7D
X`09attrib_matches();
X`09return status;
X`7D
X
X/*
X * backhunt -- Reverse search for a previously acquired\2108string,
X *`09starting at "." and proceeding toward the front of the buffer.
X *`09If found "." is left pointing at the first character of the pattern
X *`09(the last character that was matched).
X */
Xint
Xbackhunt(int f, int n)
X`7B
X`09register int status;
X`09int wrapok;
X`09MARK curpos;
X`09int didwrap;
X
X`09wrapok = window_b_val(curwp, MDSWRAP);
X
X`09if (n < 0)`09`09/* search forwards */
X`09`09return(forwhunt(f, -n));
X
X`09/* Make sure a pattern exists */
X`09if (pat`5B0`5D == EOS) `7B
X`09`09mlforce("`5BNo pattern set`5D");
X`09`09return FALSE;
X`09`7D
X
X`09/* Go search for it for as long as
X`09 * n is positive (n == 0 will go through once, which
X`09 * is just fine).
X`09 */
X
X`09ignorecase = window_b_val(curwp, MDIGNCASE);
X
X`09curpos = DOT;
X`09scanboundry(wrapok,DOT,REVERSE);
X`09didwrap = FALSE;
X`09do `7B
X`09`09nextch(`26(DOT),REVERSE);
X`09`09status = scanner(gregexp, REVERSE, wrapok, `26didwrap);
X`09`09if (didwrap) `7B
X`09`09`09mlwrite("`5BSearch wrapped past start of buffer`5D");
X`09`09`09didwrap = FALSE;
X`09`09`7D
X`09`7D while ((--n > 0) `26`26 status == TRUE);
X
X`09/* Save away the match, or complain
X`09 * if not there.
X`09 */
X`09if (status == TRUE) `7B
X`09`09savematch(DOT,gregexp->mlen);
X`09`09if (samepoint(DOT, curpos)) `7B
X`09`09`09mlwrite(onlyonemsg);
X`09`09`7D
X`09`7D else if (status == FALSE) `7B
X`09`09nextch(`26(DOT),FORWARD);
X`09`09not_found_msg(wrapok,REVERSE);
X`09`7D else if (status == ABORT) `7B
X`09`09mlforce("`5BAborted`5D");
X`09`09DOT = curpos;
X`09`09return status;
X`09`7D
X
X`09attrib_matches();
X`09return status;
X`7D
X
X/* continue searching in the same direction as previous */
Xint
Xconsearch(int f, int n)
X`7B
X`09if (last_srch_direc == FORWARD)
X`09`09return(forwhunt(f,n));
X`09else
X`09`09return(backhunt(f,n));
X`7D
X
X/* reverse the search direction */
Xint
Xrevsearch(int f, int n)
X`7B
X`09if (last_srch_direc == FORWARD)
X`09`09return(backhunt(f,n));
X`09else
X`09`09return(forwhunt(f,n));
X`7D
X
Xstatic int
Xtestit(LINE *lp, regexp *exp, int *end\0A06srchlim)
X`7B
X`09char *txt = lp->l_text;
X`09C_NUM col = (C_NUM)(exp->startp`5B0`5D - txt) + 1;
X
X`09if (col > llength(lp))
X`09`09col = llength(lp);
X`09if (lregexec(exp, lp, col, srchlim)) `7B
X`09`09col = (C_NUM)(exp->startp`5B0`5D - txt) + 1;
X`09`09if (col > llength(lp) `26`26 !*end) `7B
X`09`09`09col = llength(lp);
X`09`09`09*end = TRUE;
X`09`09`7D
X`09`09if (col <= srchlim)
X`09`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X
X/*
X * scanner -- Search for a pattern in either direction.  If found,
X *`09reset the "." to be a\1106start or just after the match string
X */
Xint
Xscanner(
Xregexp`09*exp,`09/* the compiled expression */
Xint`09direct,`09/* which way to go.*/
Xint`09wrapok,`09/* ok to wrap around bottom of buffer? */
Xint`09*wrappedp)
X`7B
X`09MARK curpos;
X`09int found;
X`09int wrapped = FALSE;
X
X`09if (!exp) `7B
X`09`09mlforce("BUG: null exp");
X`09`09return FALSE;
X`09`7D
X
X`09/* Setup local scan pointers to global ".".
X`09 */
X`09curpos = DOT;
X
X`09/* Scan each character until we hit the scan boundary */
X`09for_ever `7B
X`09`09register int startoff, srchlim;
X
X`09`09if (interrupted()) `7B
X`09`09`09if (wrappedp)
X`09`09&0209*wrappedp = \0B07;
X`09`09`09return ABORT;
X`09`09`7D
X
X`09`09if (sameline(curpos, scanboundpos)) `7B
X`09`09`09if (scanbound_is_header) `7B
X`09`09&0209/* if we're on the header, nothing can match */
X`09`09&0209found = FALSE;
X`09`09&0209srchlim = 0;
X`09`09`09`7D else `7B
X`09`09&0209if (direct == FORWARD) `7B
X`09`09&0209`09if (wrapped) `7B
X`09`09&0209&0209startoff = curpos.o;
X`09`09&0209&0209srchlim = scanboundpos.o;
X`09`09&0209`09`7D else `7B
X`09`09&0209&0209startoff = curpos.o;
X`09`09&0209&0209srchlim =
X`09`09&0209&0209 (scanboundpos.o > startoff) ?
X`09`09&0209&0309scanboundpos.o :
X`09`09&0209&0309llength(curpos.l);
X`09`09&0209`09`7D
X`09`09&0209`7D else `7B
X`09`09&0209`09if (wrapped) `7B
X`09`09&0209&0209startoff = scanboundpos.o;
X`09`09&0209&0209srchlim = llength(curpos.l);
X`09`09&0209`09`7D else `7B
X`09`09&0209&0209startoff = 0;
X`09`09&0209&0209srchlim = scanboundpos.o + 1;
X`09`09&0209`09`7D
X`09`09&0209`7D
X`09`09&0209found = lregexec(exp, curpos.l,
X`09`09&0209&0309startoff, srchlim);
X`09`09`09`7D
X`09`09`7D else `7B
X`09`09`09if (direct == FORWARD) `7B
X`09`09&0209startoff = curpos.o;
X`09`09&0209srchlim = llength(curpos.l);
X`09`09`09`7D else `7B
+-+-+-+-+-+-+-+-  END  OF PART 100 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 101 -+-+-+-+-+-+-+-+
X`09`09&0209startoff = 0;
X`09`09&0209srchlim = curpos.o+1;
X`09`09&0209if (srchlim > llength(curpos.l))
X`09`09&0209`09srchlim = llength(curpos.l);
X`09`09`09`7D
X`09`09`09found = lregexec(exp, curpos.l,
X`09`09&0209&0209startoff, srchlim);
X`09`09`7D
X`09`09if (found) `7B
X`09`09`09char *txt = curpos.l->l_text;
X`09`09`09char *got = exp->startp`5B0`5D;
X`09`09`09C_NUM next;
X`09`09`09C_NUM last = curpos.o;
X
X`09`09`09if (direct == REVERSE) `7B /* find the last one */
X`09`09&0209int end = FALSE;
X`09`09&0209char *tst = 0;
X
X`09`09&0209last++;
X`09`09&0209while (testit(curpos.l, exp, `26end, srchlim)) `7B
X`09`09&0209`09got = exp->startp`5B0`5D;
X`09`09&0209`09/* guard against infinite loop:  "?$"
X`09`09&0209`09 * or "?.*"
X`09`09&0209`09 */
X`09`09&0209`09if (tst == got)
X`09`09&0209&0209break;
X`09`09&0209`09tst = got;
X`09`09&0209`7D
X`09`09&0209if (end)
X`09`09&0209`09last++;
X`09`09&0209if (!lregexec(exp, curpos.l,
X`09`09&0209`09    (int)(got - txt), srchlim)) `7B
X`09`09&0209`09mlforce("BUG: prev. match no good");
X`09`09&0209`09return FALSE;
X`09`09&0209`7D
X`09`09`09`7D else if (llength(curpos.l) <= 0
X`09`09`09   `7C`7C last < llength(curpos.l))
X`09`09&0209last--;
X`09`09`09next = (C_NUM)(got - txt);
X`09`09`09if (next != last) `7B
X`09`09&0209DOT.l = curpos.l;
X`09`09&0209DOT.o = next;
X`09`09&0209curwp->w_flag `7C= WFMOVE; /* flag that we have moved */
X`09`09&0209if (wrappedp)
X`09`09&0209`09*wrappedp = \0B07;
X`09`09&0209return TRUE;
X`09`09`09`7D
X`09`09`7D else `7B
X`09`09`09if (sameline(curpos,scanboundpos) `26`26
X`09`09&0209&0309(!wrapok `7C`7C wrapped))
X`09`09&0209break;
X`09`09`7D
X`09`09if (direct == FORWARD) `7B
X`09`09`09curpos.l = lforw(\1108);
X`09`09`7D else `7B
X`09`09`09curpos.l = lback(\1108);
X`09`09`7D
X`09`09if (is_header_line(curpos, curbp)) `7B
X`09`09`09wrapped = TRUE;
X`09`09`09if (sameline(curpos,scanboundpos) `26`26
X`09`09&0209&0209(!wrapok `7C`7C wrapped) )
X`09`09&0209break;
X`09`09`09if (direct == FORWARD)
X`09`09&0209curpos.l = lforw(\1108);
X`09`09`09else
X`09`09&0209curpos.l = lback(\1108);
X`09`09`7D
X`09`09if (direct == FORWARD) `7B
X`09`09`09curpos.o = 0;
X`09`09`7D else `7B
X`09`09`09if ((curpos.o = llength\1308l)-1) < 0)
X`09`09&0209curpos.o = 0;
X`09`09`7D
X
X`09`7D
X
X`09if (wrappedp)
X`09`09*wrappedp = \0B07;
X`09return FALSE;`09/* We could not find a match.*/
X`7D
X
X#if OPT_HILITEMATCH
Xstatic int hilite_suppressed;
Xstatic char savepat`5BNPAT`5D;
Xstatic int save_igncase;
Xstatic int save_magic;
Xstatic BUFFER *save_curbp;
Xstatic VIDEO_ATTR save_vattr;
X
Xvoid
Xclobber_save_curbp(BUFFER *bp)
X`7B
X`09if (save_curbp == bp)
X`09`09save_curbp = NULL;
X`7D
X
X/* keep track of enough state to give us a hint as to whether
X`09we need to redo the visual matches */
Xstatic int
Xneed_to_rehilite(void)
X`7B
X`09/* save static copies of state that affects the search */
X
X`09if ((curbp->b_highlight `26 (HILITE_ON`7C\0A07DIRTY)) ==
X`09`09&0209  (HILITE_ON`7C\0A07DIRTY) `7C`7C
X`09`09`09strcmp(pat, savepat) != 0 `7C`7C
X`09`09`09save_igncase != ignorecase `7C`7C
X`09`09`09save_vattr != b_val(curbp,VAL_HILITEMATCH) `7C`7C
X`09`09`09save_magic != b_val(curbp, MDMAGIC) `7C`7C
X`09`09`09(!hilite_suppressed `26`26 save_curbp != curbp)) `7B
X`09`09(void)strcpy(savepat, pat);
X`09`09save_igncase = ignorecase;
X`09`09save_vattr = b_val(curbp,VAL_HILITEMATCH);
X`09`09save_magic = b_val(curbp, MDMAGIC);
X`09`09save_curbp = curbp;
X`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X#endif
X
X#if OPT_HILITEMATCH
X/* ARGSUSED */
Xint
Xclear_match_attrs(int f GCC_UNUSED, int n\120B)
X`7B
X`09int status;
X`09MARK origdot, origmark;
X
X`09if ((curbp->b_highlight `26 HILITE_ON) == 0)
X`09`09return TRUE;
X
X`09origdot = DOT;
X`09origmark = MK;
X
X`09DOT.l = lforw(buf_head(curbp));
X`09DOT.o = 0;
X`09MK.l = lback(buf_head(curbp));
X`09MK.o = llength(MK.l) - 1;
X`09videoattribute = VOWN_MATCHES;
X`09if ((status = attributeregion()) == TRUE) `7B
X`09`09DOT = origdot;
X`09`09MK = origmark;
X`09`09curbp->b_highlight = 0;
X#if OPT_HILITEMATCH
X`09`09hilite_suppressed = TRUE;
X#endif
X`09`7D
X`09return status;
X`7D
X#endif
X
Xvoid
Xattrib_matches(void)
X`7B
X#if OPT_HILITEMATCH
X`09MARK origdot;
X`09int status = TRUE;
X`09REGIONSHAPE oregionshape = \0E0B;
X`09VIDEO_ATTR vattr;
X
X`09ignorecase = window_b_val(curwp, MDIGNCASE);
X
X`09if (!need_to_rehilite())
X`09`09return;
X
X`09if (pat`5B0`5D == EOS `7C`7C gregexp == NULL)
X`09`09return;
X
X/* #define track_hilite 1 */
X#ifdef track_hilite
X`09mlwrite("rehighlighting");
X#endif
X
X`09vattr = b_val(curbp,VAL_HILITEMATCH);
X`09if (vattr == 0)
X`09`09return;
X
X`09(void)clear_match_attrs(TRUE,1);
X
X`09origdot = DOT;
X`09DOT.l = buf_head(curbp);
X`09DOT.o = 0;
X
X`09scanboundry(FALSE,DOT,FORWARD);
X`09do `7B
X`09`09nextch(`26(DOT),FORWARD);
X`09`09status = scanner(gregexp, FORWARD, FALSE, (int *)0);
X`09`09if (status != TRUE)
X`09`09`09break;
X`09`09if (vattr != VACOLOR)
X`09`09`09videoattribute = vattr;
X`09`09else `7B
X`09`09`09int c;
X`09`09`09for (c = NSUBEXP-1; c > 0; c--)
X`09`09&0209if ( gregexp->startp`5Bc`5D ==\16110`5D
X`09`09&0209  `26`26 gregexp->endp`5Bc`5D ==\140F0`5D )
X`09`09&0209`09break;
X`09`09`09if (c > NCOLORS-1)
X`09`09&0209videoattribute = VCOLORATTR(NCOLORS-1);
X`09`09`09else
X`09`09&0209videoattribute = VCOLORATTR(c+1);
X`09`09`7D
X`09`09MK.l = DOT.l;
X`09`09MK.o = DOT.o + gregexp->mlen;
X`09`09regionshape = EXACT;
X`09`09videoattribute `7C= VOWN_MATCHES;
X`09`09status = attributeregion();
X`09`7D while (status == TRUE);
X
X`09DOT = origdot;
X`09regionshape = o\0F0B;
X`09curbp->b_highlight = HILITE_ON;  /* `26 `7E\1207DIRTY */
X`09hilite_suppressed = FALSE;
X#endif /* OPT_HILITEMATCH */
X`7D
X
Xvoid
Xregerror(const char *s)
X`7B
X`09mlforce("`5BBad pattern: %s `5D",s);
X`7D
X
X
X/*
X * eq -- Compare two characters.  The "bc" comes from the buffer, "pc"
X *`09from the pattern.  If we are in IGNCASE mode, fold out the case.
X */
X#if OPT_EVAL `7C`7C UNUSED
Xint
Xeq(register int bc, \110Dpc)
X`7B
X`09if (bc == pc)
X`09`09return TRUE;
X`09if (!window_b_val(curwp, MDIGNCASE))
X`09`09return FALSE;
X`09return nocase_eq(bc,pc);
X`7D
X#endif
X
X/* ARGSUSED */
Xint
Xscrsearchpat(int f GCC_UNUSED, int n\120B)
X`7B
X`09int s;
X`09s =  readpattern("", pat, `26gregexp, EOS, TRUE);
X`09mlwrite("Search pattern is now %s", pat);
X`09last_srch_direc = FORWARD;
X`09return s;
X`7D
X
X/*
X * readpattern -- Read a \1207.  Stash it in apat.  If it is the
X *`09search string, re_comp() it.
X *`09Apat is not updated if the user types in an empty line.  If
X *`09the user typed an empty line, and there is no old pattern, it is
X *`09an error.  Display the old pattern, in the style of Jeff Lomicka.
X *`09There is some do-it-yourself control expansion.
X *`09An alternate termination character is passed in.
X */
Xint
Xreadpattern(
Xconst char *prompt,
Xchar`09*apat,
Xregexp`09**srchexpp,
Xint`09c,
Xint`09fromscreen)
X`7B
X`09int status;
X
X`09/* Read a pattern.  Either we get one,
X`09 * or we don't, and use the previous pattern.
X`09 * Then, if it's the search string, compile it.
X`09 */
X`09if (fromscreen) `7B
X`09`09status = screen_string(apat, NPAT, _ident);
X`09`09if (status != TRUE)
X`09`09`09return status;
X`09`7D else `7B
X`09`09/* don't expand #, %, :, and never process backslashes
X`09`09`09since they're handled by regexp directly for the
X`09`09`09search pattern, and in delins() for the replacement
X`09`09`09pattern */
X`09`09hst_glue(c);
X`09`09status = kbd_string(prompt, apat, NPAT, c, KBD_EXPPAT`7CKBD_0CHAR,
X`09`09&0209    no_completion);
X`09`7D
X `09if (status == TRUE) `7B
X`09`09if (srchexpp) `7B`09/* If doing the search string, compile it */
X`09`09`09FreeIfNeeded(*srchexpp);
X`09`09`09*srchexpp = regcomp(pat, b_val(curbp, MDMAGIC));
X`09`09`09if (!*srchexpp)
X`09`09&0209return FALSE;
X`09`09`7D
X`09`7D else if (status == FALSE `26`26 *apat != EOS) `7B /* Old one */
X`09`09status = TRUE;
X`09`7D
X
X`09return status;
X`7D
X
X/*
X * savematch -- We found the pattern?  Let's save it away.
X */
X
Xstatic void
Xsavematch(MARK curpos, SIZE_T matchlen)
X`7B
X`09static`09ALLOC_T`09patlen = 0;`09/* length of last malloc */
X
X`09/* free any existing match string */
X`09if (patmatch == NULL `7C`7C patlen < matchlen) `7B
X`09`09FreeIfNeeded(patmatch);
X`09`09/* attempt to allocate a new one */
X`09`09patmatch = castalloc(char, patlen = matchlen + 20);
X`09`09if (patmatch == NULL)
X`09`09`09return;
X`09`7D
X
X`09(void)strncpy(patmatch, `26(curpos.l->l_text`5B\1107o`5D), matchlen);
X
X`09/* null terminate the match string */
X`09patmatch`5Bmatchlen`5D = EOS;
X`7D
X
Xvoid
Xscanboundry(int wrapok, MARK dot, int dir)
X`7B
X`09if (wrapok) `7B
X`09`09nextch(`26dot,dir);
X`09`09scanboundpos = dot;
X`09`09scanbound_is_header = FALSE;
X`09`7D else `7B
X`09`09scanboundpos = curbp->b_line;
X`09`09scanbound_is_header = TRUE;
X`09`7D
X`7D
X
X/*
X * nextch -- advance/retreat the given mark
X *  will wrap, and doesn't set motion flags
X */
Xstatic void
Xnextch(MARK *pdot, int dir)
X`7B
X`09register LINE`09*curline;
X`09register int`09curoff;
X
X`09curline = pdot->l;
X`09curoff = pdot->o;
X`09if (dir == FORWARD) `7B
X`09`09if (curoff == llength(curline)) `7B
X`09`09`09curline = lforw(\1007);`09/* skip to next line */
X`09`09`09curoff = 0;
X`09`09`7D else `7B
X`09`09`09curoff++;
X`09`09`7D
X`09`7D else `7B
X`09`09if (curoff == 0) `7B
X`09`09`09curline = lback(\1007);
X`09`09`09curoff = llength(curline);
X`09`09`7D else `7B
X`09`09`09curoff--;
X`09`09`7D
X`09`7D
X`09pdot->l = curline;
X`09pdot->o = curoff;
X`7D
X
X
X/* simple finder -- give it a compiled regex, a direction, and it takes you
X`09there if it can.  no wrapping allowed  */
Xint
Xfindpat(int f, int n, regexp *exp\1406direc)
X`7B
X`09int s;
X`09MARK savepos;
X
X`09if (!exp)
X`09`09return FALSE;
X
X`09if (!f) n = 1;
X
X`09s = TRUE;
X`09scanboundpos = curbp->b_line; /* was \2509ry(FALSE,savepos,0); */
X`09scanbound_is_header = TRUE;
X`09while (s == TRUE `26`26 n--) `7B
X`09`09savepos = DOT;
X`09`09s = (direc == FORWARD) ? forwchar(TRUE,1) : back\130C;
X`09`09if (s == TRUE)
X`09`09`09s = scanner(exp, direc, FALSE, (int *)0);
X`09`7D
X`09if (s != TRUE)
X`09`09DOT = savepos;
X
X`09return s;
X`7D
$ call unpack [.VILE-8_0]SEARCH.C;1 -
 825564999 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 41 108 152
$!
$ create 'f'
X/*
X * select.c`09`09--\0D07ion handling code for vile.
X *
X * Author: Kevin Buettner, Paul Fox
X * Creation: 2/26/94
X *
X * Description:  The following code is an attempt to improve the selection
X * mechanism for vile/xvile.  While my initial goal is to improve selection
X * handling for xvile, there is no reason that this code can not be used on
X * other platforms with some kind of pointing device.  In addition, the
X * mechanism is general enough to be used for other kinds of persisent
X * attributed text.
X *
X * For the purposes of this code, a selection is considered to be a region of
V
X * text which most applications highlight in some manner.  The user may
X * transfer selected text from one application to another (or even to the
X * same application) in some platform dependent way.  The mechanics of
X * transfering the selection are not dealt with in this file.  Procedures
X * for dealing with the representation are maintained in this file.
X *
X * $Header: /usr/build/vile/vile/RCS/select.c,v 1.69 1998/05/21 22:55:38 tom E
Vxp $
X *
X */
X
X#include`09"estruct.h"
X#include`09"edef.h"
X#include`09"nefunc.h"
X
X#if OPT_SELECTIONS
X
Xextern REGION *haveregion;
X
Xstatic`09void`09detach_attrib (BUFFER *bp, AREGION *arp);
Xstatic`09int`09attribute_cntl_a_sequences (void);
X
X/*
X * startbufp and\0E06region are used to represent the start of a selection
X * prior to any highlighted text being displayed.  The start and end of
X * the region will both be where the selection is to start.  Although
X * startregion is attached to the buffer indicated by\3306bufp, nothing
X * will be displayed since the ar_vattr field is zero.  The reason for
X * attaching it to the buffer is to force the MARKs which represent the
X * start of the region to be updated.
X *
X * selbufp and selregion are used to represent a highlighted selection.
X *
X * When starbufp or selbufp are NULL, the corresponding AREGION (startregion o
Vr
X * selregion) is not attached to any buffer and is invalid.
X */
X
Xstatic MARK orig_region;
Xstatic MARK plus_region;
Xstatic BUFFER *`09startbufp = NULL;
Xstatic AREGION`09startregion;
Xstatic BUFFER *`09selbufp = NULL;
Xstatic AREGION`09selregion;
X#if OPT_HYPERTEXT
Xstatic char *`09hypercmd;
X#endif
X
Xtypedef enum `7B ORIG_FIXED, END\0B08UNFIXED `7D WHICHEND;
X
Xstatic WHICHEND whichend;
X
Xvoid
Xfree_attribs(BUFFER *bp)
X`7B
X    AREGION *p, *q;
X    p = bp->b_attribs;
X    while (p != NULL) `7B
X`09q = p->ar_next;
X#if OPT_HYPERTEXT
X`09if (p->ar_hypercmd)
X`09    free(p->ar_hypercmd);
X`09    p->ar_hypercmd = 0;
X#endif
X`09if (p == `26selregion)
X`09    selbufp = NULL;
X`09else if (p == `26startregion)
X`09    startbufp = NULL;
X`09else
X`09    free((char *) p);
X`09p = q;
X    `7D
X    bp->b_attribs = NULL;
X`7D
X
Xvoid
Xfree_attrib(BUFFER *bp, AREGION *ap)
X`7B
X    detach_attrib(bp, ap);
X#if OPT_HYPERTEXT
X    if (ap->ar_hypercmd) `7B
X`09free(ap->ar_hypercmd);
X`09ap->ar_hypercmd = 0;
X    `7D
X#endif
X    if (ap == `26selregion)
X`09selbufp = NULL;
X    else if (ap == `26startregion)
X`09startbufp = NULL;
X    else
X`09free((char *) ap);
X`7D
X
Xstatic void
Xdetach_attrib(BUFFER *bp, AREGION *arp)
X`7B
X    if (bp != NULL) `7B
X`09WINDOW *wp;
X`09AREGION **rpp;
X`09for_each_visible_window(wp) `7B
X`09    if (wp->w_bufp == bp)
X`09`09wp->w_flag `7C= WFHARD;
X`09`7D
X`09rpp = `26bp->b_attribs;
X`09while (*rpp != NULL) `7B
X`09    if (*rpp == arp) `7B
X`09`09*rpp = (*rpp)->ar_next;
X`09`09arp->ar_region.r_attr_id = 0;
X`09`09break;
X`09    `7D
X`09    else
X`09`09rpp = `26(*rpp)->ar_next;
X`09`7D
X    `7D
X`7D
X
Xvoid
Xfind_release_attr(BUFFER *bp, REGION *rp)
X`7B
X    if (bp != NULL) `7B
X`09AREGION **rpp;
X`09rpp = `26bp->b_attribs;
X`09while (*rpp != NULL) `7B
X`09    if ((*rpp)->ar_region.r_attr_id == rp->\1109) `7B
X`09`09free_attrib(bp, *rpp);
X`09`09break;
X`09    `7D
X`09    else
X`09`09rpp = `26(*rpp)->ar_next;
X`09`7D
X    `7D
X`7D
X
Xint
Xassign_attr_id(void)
X`7B
X    static int attr_id;
X    return attr_id++;
X`7D
X
Xstatic void
Xattach_attrib(BUFFER *bp, AREGION *arp)
X`7B
X    WINDOW *wp;
X    arp->ar_next = bp->b_attribs;
X    bp->b_attribs = arp;
X    for_each_visible_window(wp)
X`09if (wp->w_bufp == bp)
X`09    wp->w_flag `7C= WFHARD;
X    arp->ar_region.r_attr_id = (unsigned short) assign\2208();
X`7D
X
X/*
X * Adjusts dot to last char of\0D06line if dot is past end of buffer.  This
X * can happen when selecting with the mouse.
X */
X
Xstatic void
Xfix_dot(void)
X`7B
X    if (is_header_line(DOT, curwp->w_bufp)) `7B
X`09DOT.l = lback(DOT.l);
X`09DOT.o = llength(DOT.l);
X    `7D
X`7D
X
X/*
X * Output positional information regarding the selection to the message line.
V
X */
X
Xstatic void
Xoutput_selection_position_to_message_line(int yanked)
X`7B
X#ifdef WMDTERSELECT
X    if (!w_val(curwp, WMDTERSELECT)) `7B
X`09mlwrite("(%d,%d) thru \0D08%s",
X`09`09line_no(selbufp, selregion.ar_\0A07r_orig.l),
X`09`09getcol(selregion.ar_\0A07r_orig, FALSE) + 1,
X`09`09line_no(selbufp, selregion.ar_\0A07r_end.l),
X`09`09getcol(selregion.ar_\0A07r_end, FALSE),
X`09`09yanked ? "\0A06" : "selected");
X
X    `7D
X#endif /* WMDTERSELECT */
X`7D
X
X/* Start a selection at dot */
Xint
Xsel_begin(void)
X`7B
X    fix_dot();
X    detach_attrib(startbufp, `26startregion);
X    plus_region =
X    orig_region =
X    startregion.ar_\0A07r_orig =
X    startregion.ar_\0A07r_end  = DOT;
X    plus_region.o += 1;
X    startregion.ar_vattr = 0;
X    startregion.ar_shape = EXACT;
X#if OPT_HYPERTEXT
X    startregion.ar_hypercmd = 0;
X#endif
X    startbufp = curwp->w_bufp;
X    attach_attrib(startbufp, `26startregion);
X    whichend = UNFIXED;
X    return TRUE;
X`7D
X
Xstatic int
Xdot_vs_mark(void)
X`7B
X`09int`09cmp = line_no(curbp, DOT.l) -\1810MK.l);
X`09if (cmp == 0)
X`09`09cmp = DOT.o - MK.o;
X`09return cmp;
X`7D
X
X/* Extend the current selection to dot */
Xint
Xsel_extend(int wiping, int include_dot)
X`7B
X`09REGIONSHAPE save_shape = regionshape;
X`09REGION a,b;
X`09WINDOW *wp;
X`09MARK saved_dot;
X`09MARK working_dot;
X
X`09saved_dot = DOT;
X`09if (startbufp != NULL) `7B
X`09`09detach_attrib(selbufp, `26selregion);
X`09`09selbufp = startbufp;
X`09`09selregion = start\0E06;
X`09`09attach_attrib(selbufp, `26selregion);
X`09`09detach_attrib(startbufp, `26startregion);
X`09`09startbufp = NULL;
X`09`7D
X
X`09if (curwp->w_bufp != selbufp)
X`09`09return FALSE;&0209/* handles NULL case also */
X
X`09fix_dot();
X`09regionshape = sel\1106.ar_shape;
X
X`09if (wiping `26`26 whichend == END_FIXED)
X`09`09MK = selregion.ar_\0A07r_end;
X`09else
X`09`09MK = selregion.ar_\0A07r_orig;
X
X`09/* FIXME: Make sure DOT and MK are in the same buffer */
X
X`09/*
X`09 * If we're extending in the positive direction, we want to include DOT
X`09 * in the selection.  To include DOT, we must advance it one char since
X`09 * a region runs from r_orig up to but not including r_end.
X`09 */
X`09working_dot = DOT;
X`09if (include_dot
X`09 `26`26 (selregion.ar_shape == EXACT)
X`09 `26`26 dot_vs_mark() >= 0) `7B
X`09`09if (samepoint(MK, orig_region)) `7B
X`09`09`09DOT.o += 1;
X`09`09`7D else if (samepoint(MK, plus_region)) `7B
X`09`09`09DOT.o += 1;
X`09`09`09MK = orig_region;
X`09`09`7D
X`09`7D
X`09if (getregion(`26a) == FALSE) `7B
X`09`09return FALSE;
X`09`7D
X`09DOT = working_dot;
X
X`09/*
X`09 * Build a second region in the "opposite" direction.
X`09 */
X`09if (wiping `26`26 whichend == ORIG_FIXED)
X`09`09MK = selregion.ar_\0A07r_orig;
X`09else
X`09`09MK = selregion.ar_\0A07r_end;
X
X`09if (include_dot) `7B
X`09`09if (selregion.ar_shape == EXACT) `7B
X`09`09`09if (dot_vs_mark() <= 0) `7B
X`09`09&0209if (samepoint(MK, orig_region))
X`09`09&0209`09MK.o += 1;
X`09`09`09`7D
X`09`09`7D else if (selregion.ar_shape == RECTANGLE) `7B
X`09`09`09if (samepoint(MK, DOT)) `7B /* avoid making empty-region */
X`09`09&0209MK =  orig_region;
X`09`09&0209DOT = plus_region;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09if (getregion(`26b) == FALSE) `7B
X`09`09return FALSE;
X`09`7D
X
X`09/*
X`09 * The two regions, 'a' and 'b' are _usually_ identical, except for the
X`09 * special case where we've extended one to the right to include the
X`09 * right endpoint of the region.
X`09 *
X`09 * For EXACT selections, setting 'whichend' to ORIG_FIXED means that
X`09 * we're selecting from the anchor point right/down.  Conversely,
X`09 * setting it to END_FIXED means that we selecting left/up.
X`09 *
X`09 * Rectangles are specified by making MK the opposite corner from DOT.
X`09 * If DOT is below MK, we'll say that the selection region is
X`09 * ORIG_FIXED so that the next call on this function will build the
X`09 * regions a/b consistently.
X`09 *
X`09 * If the regions a/b are empty, we've made a mistake; this will cause
X`09 * the selection to be dropped in xvile.
X`09 */
X
X`09if (a.r_size > b\0B07) `7B
X`09`09whichend = ORIG_FIXED;
X`09`09selregion.ar_\0A06 = a;
X`09`7D
X`09else `7B
X`09`09if (selregion.ar_shape == RECTANGLE) `7B
X`09`09`09if (dot_vs_mark() < 0)
X`09`09&0209whichend = END_FIXED;
X`09`09`09else
X`09`09&0209whichend = ORIG_FIXED;
X`09`09`7D else `7B`09/* exact or full-line */
X`09`09`09whichend = END_FIXED;
X`09`09`7D
X`09`09selregion.ar_\0A06 = b;
X`09`7D
X
X`09selregion.ar_vattr = VASEL `7C VOWN_SELECT;
X`09for_each_visible_window(wp) `7B
X`09`09if (wp->w_bufp == selbufp)
X`09`09`09wp->w_flag `7C= WFHARD;
X`09`7D
X
X`09output_selection_position_to_message_line(FALSE);
X
X`09regionshape = save_shape;
X`09DOT = saved_dot;
X`09OWN_SELECTION();
X`09return TRUE;
X`7D
X
X/*
X * Detach current selection (if attached) and null the associated buffer
X * pointer.
X */
Xvoid
Xsel_release(void)
X`7B
X    detach_attrib(selbufp, `26selregion);
X    selbufp = NULL;
X`7D
X
X/*
X * Assert/reassert ownership of selection if appropriate.  This is necessary
X * in order to paste a selection after it's already been pasted once and then
V
X * modified.
X */
X
Xvoid
Xsel_reassert_ownership(BUFFER *bp)
X`7B
X    if (selbufp == bp) `7B
X`09OWN_SELECTION();
X    `7D
X`7D
X
X#if OPT_SEL_YANK
X/*
X * Yank the selection.  Return TRUE if\1B0A could be yanked, FALSE
X * otherwise.  Note that this code will work even if the buffer being
X * yanked from is not attached to any window since it creates its own
X * fake window in order to perform the yanking.
X */
X
Xint
Xsel_yank(int reg)
X`7B
X    REGIONSHAPE save_shape;
X    WINDOW *save_wp;
X
X    if (selbufp == NULL)
X`09return FALSE;`09`09`09/* No selection to yank */
X
X    if ((save_wp = push_fake_win(selbufp)) == NULL)
X`09return FALSE;
X
X    save_shape = regionshape;
X    ukb = reg;
X    kregflag = 0;
X    haveregion = `26sel\0D06.ar_\1706;
X    regionshape = sel\1106.ar_shape;
X    yankregion();
X    haveregion = NULL;
X    regionshape = save_shape;
X    pop_fake_win(save_wp);
X    output_selection_position_to_message_line(TRUE);
X
X    /* put cursor back on screen...is there a cheaper way to do this?  */
X    (void)update(FALSE);
X    return TRUE;
X`7D
X
X#if NEEDED
Xint
Xsel_attached(void)
X`7B
X    return startbufp == NULL;
X`7D
X#endif  /* NEEDED */
X
XBUFFER *
Xsel_buffer(void)
X`7B
X    return (startbufp != NULL) ? \150A: selbufp;
X`7D
X#endif  /* OPT_SEL_YANK */
X
Xint
Xsel_setshape(REGIONSHAPE shape)
X`7B
X    if (startbufp != NULL) `7B
X`09startregion.ar_shape = shape;
X`09return TRUE;
X    `7D
X    else if (selbufp != NULL) `7B
X`09selregion.ar_shape = shape;
X`09return TRUE;
X    `7D
X    else `7B
X`09return FALSE;
X    `7D
X`7D
X
X/* return a region which goes from DOT to the far end of the current
X`09selection region.  shape is maintained.  returns pointer to static
X`09region struct.
X*/
Xstatic REGION *
Xextended_region(void)
X`7B
X    REGION *rp = NULL;
X    static REGION a, b;
X    MARK savemark;
X
X    savemark = MK;
X    regionshape = sel\1106.ar_shape;
X    MK = selregion.ar_\0A07r_orig;
X    DOT.o += 1;
X    if (getregion(`26a) == TRUE) `7B
X`09DOT.o -= 1;
X`09MK = selregion.ar_\0A07r_end;
X`09if (regionshape == FULLLINE)
X`09    MK.l = lback(MK.l);
X`09/* region b is to the end of the selection */
X`09if (getregion(`26b) == TRUE) `7B
X`09    /* if a is bigger, it's the one we want */
X`09    if (a.r_size > b\0B07)
X`09`09rp = `26a;
X`09    else
X`09`09rp = `26b;
X`09`7D
X    `7D else `7B
X`09DOT.o -= 1;
X    `7D
X    MK = savemark;
X    return rp;
X`7D
X
Xstatic`09int`09doingopselect;
X
X/* ARGSUSED */
Xint
Xsel_motion(int f GCC_UNUSED, int n\120B)
X`7B
X    if (selbufp == NULL) `7B
X`09mlwrite("`5BNo selection exists.`5D");
X`09return FALSE;
X    `7D
X
X    if (selbufp != curbp) `7B
X`09/* FIXME -- sure would be nice if we could do non-destructive
X`09`09things to other buffers, mainly yank. */
X`09mlwrite("`5BSelection not in current buffer.`5D");
X`09return FALSE;
X    `7D
X
X    curwp->w_flag `7C= WFMOVE;
X
X    /* if this is happening on behalf of an operator, we're pretending
X     * that the motion took us from one end of the selec\2607 the
X     * other, unless we're trying to select to the\0E07ion, in which
X     * case that would be self-defeating
X     */
X    if (doingopcmd `26`26 !\0F07select) `7B
X`09pre_op_dot = selregion.ar_\0A07r_orig;  /* move us there */
X`09haveregion = `26sel\0D06.ar_\1706;
X`09regionshape = sel\1106.ar_shape;
X`09return TRUE;
X    `7D
X
X    if (!doingopcmd) `7B /* it's a simple motion -- go to the top of selection
V */
X`09/* remember -- this can never be used with an operator, as in
X`09 * "delete to the selection", since that case is taken care
X`09 * of above, and is really the whole reason for this
X`09 * "motion" in the first place.  */
X`09DOT = selregion.ar_\0A07r_orig;  /* move us there */
X`09return TRUE;
X    `7D
X
X    /* we must be doing an extension */
X    haveregion = extended_\1206();
X    return haveregion ? TRUE:FALSE;
X
X`7D
X
Xstatic int
Xselectregion(void)
X`7B
X`09register int    status;
X`09REGION`09`09region;
X`09MARK`09`09savedot;
X`09MARK`09`09savemark;
X`09int`09`09hadregion = FALSE;
X
X`09savedot = DOT;
X`09savemark = MK;
X`09if (haveregion) `7B`09/* get\1006() will clear this, so
X`09`09&0209`09we need to save it */
X`09`09region = *have\0E06;
X`09`09hadregion = TRUE;
X`09`7D
X`09status = yankregion();
X`09DOT = savedot;
X`09MK = savemark;
X`09if (status != TRUE)
X`09`09return status;
X`09if (hadregion `7C`7C ((status = get\1806(`26\2006)) == TRUE)) `7B
X`09    detach_attrib(startbufp, `26startregion);
X`09    detach_attrib(selbufp, `26selregion);
X`09    selbufp = curbp;
X`09    selregion.ar_\0A06 = \1306;
X`09    selregion.ar_vattr = VASEL `7C VOWN_SELECT;
X`09    selregion.ar_shape = \1206shape;
X#if OPT_HYPERTEXT
X`09    selregion.ar_hypercmd = 0;
X#endif
X`09    attach_attrib(selbufp, `26selregion);
X`09    OWN_SELECTION();
X`09`7D
X`09return status;
X`7D
X
Xint
Xmultimotion(int f, int n)
X`7B
X`09const CMDFUNC`09*cfp;
X`09int s,c,waserr;
X`09REGIONSHAPE shape;
X`09MARK savedot;
X`09MARK savemark;
X`09MARK realdot;
X`09char`09temp`5BNLINE`5D;
X`09BUFFER *origbp = curbp;
X`09static int wassweephack = FALSE;
X
X`09/* Use the repeat-count as a shortcut to specify the type of selection.
X`09 * I'd use int-casts of the enum value, but declaring enums with
X`09 * specific values isn't 100% portable.
X`09 */
X`09if (!f `7C`7C n <= 0)
X`09`09n = 1;
X`09if (n == 3)
X`09`09regionshape = RECTANGLE;
X`09else if (n == 2)
X`09`09regionshape = FULLLINE;
X`09else
X`09`09regionshape = EXACT;
X`09shape = regionshape;
X
X`09sweephack = FALSE;
X`09savedot = DOT;
X`09if (doingsweep) `7B /* the same command terminates as starts the sweep */
X`09`09doingsweep = FALSE;
X`09`09mlforce("`5BSweeping: Completed`5D");
X`09`09regionshape = shape;
X`09`09/* since the terminating 'q' is executed as a motion, we have
X`09`09   now lost the value of sweephack we were interested in, the
X`09`09   one that tells us to include DOT.o in the selection.
X`09`09   so we preserved it in wassweephack, and restore it here.
X`09`09 */
X`09`09if (wassweephack)
X`09`09`09sweephack = was\0F09;
X`09`09return TRUE;
X`09`7D else `7B
X`09`09(void)kcod2pstr(fnc2kcod(`26f_multimotion), temp);
X`09`09doingsweep = TRUE;
X`09`09mlwrite("`5BBegin cursor sweep... (end with %*S)`5D",*temp,temp+1);
X`09`09(void)sel_begin();
X`09`09(void)sel_setshape(shape);
X`09`7D
X
X`09waserr = TRUE; /* to force message "state-machine" */
X
X`09while (doingsweep) `7B
X
X`09`09/* Fix up the screen`09*/
X`09`09s = update(FALSE);
X
X`09`09/* get the next command from the keyboard */
X`09`09c = kbd_seq();
X
X`09`09if (ABORTED(c)
X`09`09 `7C`7C curbp != origbp) `7B
X`09`09`09doingsweep = FALSE;
X`09`09`09mlforce("`5BSweeping: Aborted`5D");
X`09`09`09sel_release();
X`09`09`09return FALSE;
X`09`09`7D
X
X`09`09f = FALSE;
X`09`09n = 1;
X
X`09`09do_repeats(`26c,`26f,`26n);
X
X`09`09/* and execute the command */
X`09`09cfp = kcod2fnc(c);
X`09`09if ( (cfp != NULL)
X`09`09 `26`26 ((cfp->c_flags `26 MOTION) != 0)) `7B
X`09`09`09wassweephack = \0C09;
X`09`09`09sweephack = FALSE;
X`09`09`09s = execute(cfp, f, n);
X`09`09`09if (s != TRUE) `7B
X`09`09&0209mlforce(
X`09`09&0209"`5BSweeping: Motion failed. (end with %*S)`5D",*temp,temp+1);
X`09`09&0209waserr = TRUE;
X`09`09`09`7D else `7B
X`09`09&0209if (waserr `26`26 doingsweep) `7B
X`09`09&0209`09mlforce("`5BSweeping... (end with %*S)`5D",*temp,temp+1);
X`09`09&0209`09waserr = FALSE;
X`09`09&0209`7D
X`09`09&0209realdot = DOT;
X`09`09&0209DOT = savedot;
X`09`09&0209(void)sel_begin();
X`09`09&0209DOT = realdot;
X`09`09&0209(void)sel_setshape(shape);
X`09`09&0209/* we sometimes want to include DOT.o in the
X`09`09&0209   selection (unless it's a rectangle, in
X`09`09&0209   which case it's taken care of elsewhere)
X`09`09&0209 */
X`09`09&0209sel_extend(TRUE,(regionshape != RECTANGLE `26`26
X`09`09&0209`09sweephack));
X`09`09`09`7D
X`09`09 `7D else `7B
X`09`09`09mlforce(
X`09`09`09"`5BSweeping: Only motions permitted (end with %*S)`5D",*temp,temp+1)
V;
X`09`09`09waserr = TRUE;
X`09`09 `7D
X
X`09`7D
X`09regionshape = shape;
X`09/* if sweephack is set here, it's because the last motion had
X`09`09it set */
X`09if (doingopcmd)
X`09`09pre_op_dot = savedot;
X`09savedot = DOT;
X`09savemark = MK;
+-+-+-+-+-+-+-+-  END  OF PART 101 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 102 -+-+-+-+-+-+-+-+
X`09if ((regionshape != RECTANGLE) `26`26 sweephack) `7B
X`09`09if (dot_vs_mark() < 0)
X`09`09`09MK.o += 1;
X`09`09else
X`09`09`09DOT.o += 1;
X`09`7D
X`09s = yankregion();
X`09DOT = savedot;
X`09MK = savemark;
X`09sweephack = was\0F0CFALSE;
X`09return s;
X`7D
X
X/*ARGSUSED*/
Xint
Xmultimotionfullline(int f GCC_UNUSED, int n\120B)
X`7B
X`09return multimotion(TRUE,2);
X`7D
X
X/*ARGSUSED*/
Xint
Xmultimotionrectangle(int f GCC_UNUSED, int n\120B)
X`7B
X`09return multimotion(TRUE,3);
X`7D
X
X#if OPT_PERL `7C`7C OPT_TCL
XBUFFER *
Xget_selection_buffer_and_region(AREGION *arp)
X`7B
X    if (selbufp) `7B
X`09*arp = selregion;
X    `7D
X    return selbufp;
X`7D
X#endif
X
Xint
Xattributeregion(void)
X`7B
X`09register int    status;
X`09REGION`09`09region;
X`09AREGION *`09arp;
X
X`09if ((status = getregion(`26\0806)) == TRUE) `7B
X`09    if (VATTRIB(videoattribute) != 0
X#if OPT_HYPERTEXT
X`09`09`7C`7C hypercmd != 0)
X#endif
X`09    `7B
X`09`09/* add new attribute-region */
X`09`09if ((arp = typealloc(AREGION)) == NULL) `7B
X`09`09    (void)no_memory("AREGION");
X`09`09    return FALSE;
X`09`09`7D
X`09`09arp->ar_region = \0906;
X`09`09arp->ar_vattr = videoattribute; /* include ownership */
X`09`09arp->ar_shape = regionshape;
X#if OPT_HYPERTEXT
X`09`09arp->ar_hypercmd = \0B08;`09/* already malloc'd for us */
X`09`09hypercmd = 0;&0209`09/* reset it for future calls */
X#endif
X`09`09attach_attrib(curbp, arp);
X`09    `7D else `7B /* purge attributes in this region */
X`09`09L_NUM first = line_no(curbp, region.r_orig.l);
X`09`09L_NUM last  = line_no(curbp, region.r_end.l);
X`09`09AREGION *p, *q;
X`09`09int owner;
X
X`09`09owner = VOWNER(videoattribute);
X
X`09`09for (p = curbp->b_attribs, q = 0; p !\0807= q) `7B
X`09`09    L_NUM f0, l0;
X
X`09`09    q = p->ar_next;
X
X`09`09    if (owner != 0 `26`26 \0E09VOWNER(p->ar_vattr))
X`09`09`09continue;
X
X`09`09    f0 = line_no(curbp, p->ar_region.r_orig.l);
X`09`09    l0 = line_no(curbp, p->ar_region.r_end.l);
X
X`09`09    if (l0 < first `7C`7C f0 > last)
X`09`09`09continue;`09/* no overlap */
X
X`09`09    /* FIXME: this removes the whole of an overlapping region;
X`09`09     * we really only want to remove the overlapping portion...
X`09`09     */
X`09`09    detach_attrib(curbp, p);
X`09`09`7D
X`09    `7D
X`09`7D
X`09return status;
X`7D
X
Xint
Xattributeregion_over_\0C06(REGION *rp,
X        \0808\100CREGIONSHAPE shape,
X`09`09`09    VIDEO_ATTR vattr,
X`09`09`09    char *hc)
X`7B
X    haveregion = rp;
X    DOT =  rp->r_orig;
X    MK = rp->r_end;
X    if (shape == FULLLINE)
X`09MK.l = lback(MK.l);
X    regionshape = shape;`09/* Not that the following actually cares */
X    videoattribute = vattr;
X#if OPT_HYPERTEXT
X    hypercmd = hc;
X#endif /* OPT_HYPERTEXT */
X    return attributeregion();
X`7D
X
Xint
Xoperselect(int f, int n)
X`7B
X`09int s;
X`09opcmd = OPOTHER;
X`09doingopselect = TRUE;
X`09s = vile_op(f,n,selectregion,"Select");
X`09doingopselect = FALSE;
X`09return s;
X`7D
X
Xint
Xoperattrbold(int f, int n)
X`7B
X      opcmd = OPOTHER;
X      videoattribute = VABOLD `7C VOWN_OPERS;
X      return vile_op(f,n,attributeregion,"Set bold \1A09");
X`7D
X
Xint
Xoperattrital(int f, int n)
X`7B
X      opcmd = OPOTHER;
X      videoattribute = VAITAL `7C VOWN_OPERS;
X      return vile_op(f,n,attributeregion,"Set italic \1C09");
X`7D
X
Xint
Xoperattrno(int f, int n)
X`7B
X      opcmd = OPOTHER;
X      videoattribute = 0;`09/* clears no matter who "owns" */
X      return vile_op(f,n,attributeregion,"Set normal \1C09");
X`7D
X
Xint
Xoperattrrev(int f, int n)
X`7B
X      opcmd = OPOTHER;
X      videoattribute = VAREV `7C VOWN_OPERS;
X      return vile_op(f,n,attributeregion,"Set reverse \1D09");
X`7D
X
Xint
Xoperattrul(int f, int n)
X`7B
X      opcmd = OPOTHER;
X      videoattribute = VAUL `7C VOWN_OPERS;
X      return vile_op(f,n,attributeregion,"Set underline \1F09");
X`7D
X
X#if OPT_HYPERTEXT
Xstatic int
Xattributehyperregion(void)
X`7B
X    char line`5BNLINE`5D;
X    int  status;
X
X    line`5B0`5D = 0;
X    status = mlreply_no_opts("Hypertext Command: ", line, NLINE);
X
X    if (status != TRUE)
X`09return status;
X
X    hypercmd = strmalloc(line);
X    return attributeregion();
X`7D
X
Xint
Xoperattrhc(int f, int n)
X`7B
X    opcmd = OPOTHER;
X    videoattribute = 0;
X    return vile_op(f,n,attributehyperregion,"Set hypertext command");
X`7D
X
Xstatic int
Xhyperspray(int (*f)(char *))
X`7B
X    L_NUM    dlno;
X    int      doff;
X    AREGION *p;
X    int count = 0;
X
X    (void) bsizes(curbp);`09`09/* attach line numbers to e\1509*/
X
X    dlno = DOT.l->l_number;
X    doff = DOT.o;
X
X    for (p = curbp->b_attribs; p != 0; p = p->ar_next) `7B
X`09if (p->ar_hypercmd) `7B
X`09    int slno, elno, soff, eoff;
X
X`09    slno = p->ar_region.r_orig.l->l_number;
X`09    elno = p->ar_region.r_end.l->l_number;
X`09    soff = p->ar_region.r_orig.o;
X`09    eoff = p->ar_region.r_end.o;
X
X`09    if (   ((slno == dlno `26`26 doff >= soff) `7C`7C\1906> slno)
X`09`09`26`26 ((elno == dlno &0226 doff <  eoff) `7C`7C\1906< elno) )
X`09    `7B
X`09`09f(p->ar_hypercmd);
X`09`09count++;
X`09    `7D
X`09`7D
X    `7D
X    return count;
X`7D
X
Xstatic int
Xdoexechypercmd(char *cmd)
X`7B
X    return docmd(cmd,TRUE,FALSE,1);
X`7D
X
Xint
Xexechypercmd(int f GCC_UNUSED, int n\120B)
X`7B
X    int count;
X    count = hyperspray(doexechypercmd);
X    return count != 0;
X`7D
X
Xstatic int
Xdoshowhypercmd(char *cmd)
X`7B
X    mlforce("%s",cmd);
X    return 1;
X`7D
X
Xint
Xshowhypercmd(int f GCC_UNUSED, int n\120B)
X`7B
X    int count;
X    count = hyperspray(doshowhypercmd);
X    return count != 0;
X`7D
X#endif
X
Xint
Xoperattrcaseq(int f, int n)
X`7B
X      opcmd = OPOTHER;
X      videoattribute = VAUL `7C VOWN_CTLA;
X      return vile_op(f,n,attribute_cntl_a_sequences,
X`09`09      "Attribute `5EA sequences");
X`7D
X
Xint
Xattribute_cntl_a_sequences_over_region(REGION *rp, \0C06SHAPE shape)
X`7B
X    haveregion = rp;
X    DOT =  rp->r_orig;
X    MK = rp->r_end;
X    if (shape == FULLLINE)
X`09MK.l = lback(MK.l);
X    regionshape = shape;`09/* Not that the following actually cares */
X    return attribute_cntl_a_sequences();
X`7D
X
X/*
X * attribute_cntl_a_sequences can take quite a while when processing a region
V
X * with a large number of attributes.  The reason for this is that th\3708
X * of marks to check for fixing (from ldelete) increases with each attribute
X * that is added.  It is not really necessary to check the attributes that
X * we are adding in attribute_cntl_a_sequences due to the order in which
X * they are added (i.e, none of them ever need to be fixed up when ldelete
X * is called from within attribute_cntl_a_sequences).
X *
X * It is still necessary to update those attributes which existed (if any)
X * prior to calling attribute_cntl_a_sequences.
X *
X * We define EFFICIENCY_HACK to be 1 if we want to enable the code which
X * will prevent ldelete from doing unnecessary work.  Note that we are
X * depending on the fact that attach_attrib() adds new attributes to the
X * beginning of the list.  It is for this reason that I conside\1C06
X * code to be somewhat hacky.
X */
X#define EFFICIENCY_HACK 1
X
Xstatic int
Xattribute_cntl_a_sequences(void)
X`7B
X    register int c;`09`09/* current char during scan */
X    register LINEPTR pastline;`09/* pointer to line just past EOP */
X    C_NUM offset;`09`09/*\0C07 in cur line of place to attribute */
X
X#if EFFICIENCY_HACK
X    AREGION *orig_attribs;
X    AREGION *new_attribs;
X    orig_attribs = new\0E0Bcurbp->b\2108;
X#endif
X
X    if (!sameline(MK, DOT)) `7B
X`09REGION region;
X`09if (getregion(`26\0806) != TRUE)
X`09    return FALSE;
X`09if (sameline(region.r_orig, MK))
X`09    swapmark();
X    `7D
X    pastline = MK.l;
X    if (pastline != win_head(curwp))
X`09    pastline = lforw(\1108);
X    DOT.o = 0;
X    regionshape = EXACT;
X    while (DOT.l != pastline) `7B
X`09while (DOT.o < llength(DOT.l)) `7B
X`09    if (char_at(DOT) == CONTROL_A) `7B
X`09`09int count = 0;
X`09`09offset = DOT.o+1;
Xstart_scan:
X`09`09while (offset < llength(DOT.l)) `7B
X`09`09    c = lgetc(DOT.l, offset);
X`09`09    if (isDigit(c)) `7B
X`09`09`09count = \0806* 10 + c - '0';
X`09`09`09offset++;
X`09`09    `7D
X`09`09    else
X`09`09`09break;
X`09`09`7D
X`09`09if (count == 0)
X`09`09    count = 1;
X`09`09videoattribute = VOWN_CTLA;
X`09`09while (offset < llength(DOT.l)) `7B
X`09`09    c = lgetc(DOT.l, offset);
X`09`09    switch (c) `7B
X`09`09`09case 'C' :
X`09`09`09    /* We have color. Get\0B06 value */
X`09`09`09    offset++;
X`09`09`09    c = lgetc(DOT.l, offset);
X`09`09`09    if (isDigit(c))
X`09`09&0209videoattribute `7C= VCOLORATTR(c - '0');
X`09`09`09    else if ('A' <= c `26`26 c <= 'F')
X`09`09&0209videoattribute `7C= VCOLORATTR(c - 'A' + 10);
X`09`09`09    else if ('a' <= c `26`26 c <= 'f')
X`09`09&0209videoattribute `7C= VCOLORATTR(c - 'a' + 10);
X`09`09`09    else
X`09`09&0209offset--; /* Invalid attribute */
X`09`09`09    break;
X`09`09`09case 'U' : videoattribute `7C= VAUL;   break;
X`09`09`09case 'B' : videoattribute `7C= VABOLD; break;
X`09`09`09case 'R' : videoattribute `7C= VAREV;  break;
X`09`09`09case 'I' : videoattribute `7C= VAITAL; break;
X#if OPT_HYPERTEXT
X`09`09`09case 'H' : `7B
X`09`09`09    int save_offset = \0906;
X`09`09`09    offset++;
X`09`09`09    while (offset < llength(DOT.l)
X`09`09&0209`26`26 lgetc(DOT.l,offset) != 0)
X`09`09&0209offset++;
X`09`09`09    if (offset < llength(DOT.l)) `7B
X`09`09&0209hypercmd = strmalloc(`26DOT.l->l_text`5Bsave_offset+1`5D);
X`09`09`09    `7D
X`09`09`09    else `7B
X`09`09&0209/* Bad hypertext string... skip it */
X`09`09&0209offset = save_\0E06;
X`09`09`09    `7D
X
X`09`09`09    break;
X`09`09`09`7D
X#endif
X`09`09`09case ':' : offset++;
X`09`09`09    if (offset < llength(DOT.l)
X`09`09`09     `26`26 lgetc(DOT.l, offset) == CONTROL_A) `7B
X`09`09&0209count = 0;
X`09`09&0209offset++;
X`09`09&0209goto start_scan; /* recover from filter-err */
X`09`09`09    `7D
X`09`09`09    /* FALLTHROUGH */
X`09`09`09default  : goto attribute_found;
X`09`09    `7D
X`09`09    offset++;
X`09`09`7D
Xattribute_found:
X#if EFFICIENCY_HACK
X`09`09new_attribs = curbp->b\1308;
X`09`09curbp->b_attribs = orig\0F08;
X`09`09ldelete((B_COUNT)(offset - DOT.o), FALSE);
X`09`09curbp->b_attribs = new\0E08;
X#else
X`09`09ldelete((B_COUNT)(offset - DOT.o), FALSE);
X#endif
X`09`09MK = DOT;
X`09`09MK.o += count;
X`09`09if (MK.o > llength(DOT.l))
X`09`09    MK.o = llength(DOT.l);
X`09`09if (VATTRIB(videoattribute) `7C`7C hypercmd != 0)
X`09`09    (void) attributeregion();
X`09    `7D
X`09    DOT.o++;
X`09`7D
X`09DOT.l = lforw(DOT.l);
X`09DOT.o = 0;
X    `7D
X    return TRUE;
X`7D
X#endif /* OPT_SELECTIONS */
$ call unpack [.VILE-8_0]SELECT.C;1 -
 856933617 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 54 109 152
$!
$ create 'f'
X/*`09Spawn:`09various DOS access commands
X *`09`09for MicroEMACS
X *
X * $Header: /usr/build/vile/vile/RCS/spawn.c,v 1.128 1998/05/30 11:46:40 tom E
Vxp $
X *
X */
X
X#ifdef _WIN32
X# include    <process.h>
X#endif
X
X#include`09"estruct.h"
X#include`09"edef.h"
X#include`09"nefunc.h"
X
X#if SYS_UNIX `26`26 defined(SIGTSTP) &0226 !DISP_X11
X#define USE_UNIX_JOB_CTL 1
X#else
X#define USE_UNIX_JOB_CTL 0
X#endif
X
X#if SYS_VMS
X#include <starlet.h>
X#include <lib$routines.h>
Xextern`09int`09vms_system(char *);`09/*FIXME: not the same as '\2A07)'?*/
X#endif
X
Xstatic`09int spawn1(int rerun, int pressret);
X
X
X
X#if`09SYS_VMS
X#define EFN`090`09`09&0209/* Event flag.&0209*/
X
X#include`09<ssdef.h>`09`09`09/* Random headers.`09*/
X#include`09<stsdef.h>
X#include`09<descrip.h>
X#include`09<iodef.h>
X
Xextern  int`09oldmode`5B3`5D;`09`09`09/* In "termio.c"`09*/
Xextern  int`09newmode`5B3`5D;`09`09`09/* In "termio.c"`09*/
Xextern  short`09iochan;`09`09&0209/* In "termio.c"`09*/
X#endif
X
X#if CC_NEWDOSCC `26`26 !CC_DJGPP`09`09`09/* Typo, was NEWS\2606`09*/
X#include`09<process.h>
X#endif
X
X/*
X * Check all modification-times after executing a shell command
X */
X#ifdef`09MDCHK_MODTIME
X#define`09AfterShell()`09check_visible_modtimes()
X#else
X#define`09AfterShell()`09TRUE
X#endif
X
X#if DISP_X11
Xstatic void x_window_SHELL(const char *cmd)
X`7B
X`09TBUFF *tmp = 0;
X
X`09/*
X`09 * We would use the -display option of xterm, but that \3106get in the
X`09 * way of the user's ability to customize $xshell.
X`09 */
X#if HAVE_PUTENV
X`09static char *display_env;
X`09char *env = gtenv("xdisplay");
X`09if (display_env != 0)
X`09`09free(display_env);
X`09display_env = typeallocn(char,20+strlen(env));
X`09lsprintf(display_env, "DISPLAY=%s", env);
X`09putenv(display_env);
X#endif
X
X`09tmp = tb_scopy(`26tmp, gtenv("xshell"));
X`09if (cmd != 0) `7B
X`09`09tb_unput(tmp);
X`09`09tmp = tb_sappend(`26tmp, " -e ");
X`09`09tmp = tb_sappend(`26tmp, cmd);
X`09`09tmp = tb_append(`26tmp, EOS);
X`09`7D
X`09TRACE(("executing '%s'`5Cn", tb_values(tmp)));
X`09(void)system(tb_values(tmp));
X`09tb_free(`26tmp);
X`7D
X#endif
X
X/*
X * Create a subjob with a copy of the command interpreter in it. When the
X * command interpreter exits, mark the screen as garbage so that you do a full
V
X * repaint. The message at the start in VMS puts out a newline.
X * Under some (unknown) condition, you don't get one free when DCL starts up.
V
X */
X/* ARGSUSED */
Xint
Xspawncli(int f GCC_UNUSED, int n\120B)
X`7B
X#undef OK_SPAWN
X
X#if`09SYS_UNIX
X#define`09OK_SPAWN
X`09ttclean(TRUE);
X`09kbd_openup();
X#if`09DISP_X11
X`09(void)x_window_SHELL((char *)0);
X#else
X`09(void)system_SHELL((char *)0);
X#endif
X`09kbd_openup();
X`09ttunclean();
X`09sgarbf = TRUE;
X`09return AfterShell();
X#endif /* SYS_UNIX */
X
X
X#if`09SYS_VMS
X#define`09OK_SPAWN
X`09mlforce("`5BStarting DCL`5D`5Cr`5Cn");
X`09kbd_flush();`09`09&0209/* Ignore "ttcol".`09*/
X`09sgarbf = TRUE;
X`09return vms_system(NULL);`09`09/* NULL => DCL.&0209*/
X#endif
X
X
X#if`09SYS_MSDOS `7C`7C SYS_OS2\0B08WINNT
X#define`09OK_SPAWN
X`09bottomleft();
X`09kbd_flush();
X`09TTkclose();
X`09`7B
X`09`09char *shell = gtenv("shell");
X#if SYS_OS2
X/*
X *`09spawn it if we know it.  Some 3rd party command processors fail
X *`09if they system themselves (eg 4OS2).  CCM 24-MAR-94
X */
X`09`09spawnl( P_WAIT, shell\0707, NULL);
X#else
X#if SYS_WINNT
X`09`09w32_system(shell);
X#else
X`09`09system(shell);
X#endif
X#endif
X`09`7D
X`09TTkopen();
X`09sgarbf = TRUE;
X`09return AfterShell();
X#endif
X
X
X#ifndef`09OK_SPAWN
X`09mlforce("`5BThis version of vile cannot spawn an interactive shell`5D");
X`09return FALSE;
X#endif
X`7D
X
X
X/* ARGSUSED */
Xint
Xbktoshell(int f, int n)`09`09/* suspend and wait to wake up */
X`7B
X#if USE_UNIX_JOB_CTL
X`09int forced = (f `26`26 n == SPECIAL_BANG_ARG); /* then it was :stop! */
X
X`09/* take care of autowrite */
X`09if (!forced `26`26 writeall(f,n,FALSE,TRUE,TRUE) != TRUE)
X`09`09return FALSE;
X
X`09beginDisplay();
X`09ttclean(TRUE);
X
X/* #define simulate_job_control_for_debug */
X# ifdef simulate_job_control_for_debug
X`09rtfrmshell(SIGCONT);
X`09return TRUE;
X# else
X`09(void)signal_pg(SIGTSTP);
X
X `09/*
X `09 * Next four lines duplicate spawncli() actions following return
X `09 * from shell.  Adding lines 1-3 ensure that vile properly redraws
X `09 * its screen when TERM type is vt220 or vt320 and host is linux.
X `09 */
X`09kbd_openup();
X `09ttunclean();
X `09sgarbf = TRUE;
X `09return AfterShell();
X# endif
X#else
X`09mlforce("`5BJob control unavailable`5D");
X`09return FALSE;
X#endif /* SIGTSTP */
X`7D
X
X/*ARGSUSED*/
XSIGT
Xrtfrmshell(int ACTUAL_SIG_ARGS GCC_UNUSED)
X`7B
X#if USE_UNIX_JOB_CTL
X`09endofDisplay();
X`09ttunclean();
X`09sgarbf = TRUE;
X#  if SYS_APOLLO
X`09(void)TTgetc();`09`09/* have to skip a character */
X`09ttunclean();`09`09/* ...so that I can finally suppress echo */
X#  endif
X`09TTkopen();
X`09setup_handler(SIGCONT,rtfrmshell); /* suspend `26 restart */
X`09(void)update(TRUE);
X#endif
X#ifdef`09MDCHK_MODTIME
X`09(void)check_visible_modtimes();
X#endif
X`09SIGRET;
X`7D
X
Xvoid
Xpressreturn(void)
X`7B
X`09int c;
X`09int odiscmd;
X
X`09odiscmd = \0906;
X`09discmd = TRUE;
X`09mlprompt("`5BPress return to continue`5D");
X`09discmd = o\0A06;
X`09/* loop for a CR, a space, or a : to do another named command */
X`09while ((c = keystroke()) != '`5Cr' `26`26
X`09`09`09c != '`5Cn' `26`26
X`09`09`09c != ' ' `26`26
X`09`09`09!ABORTED(c)) `7B
X`09`09if (kcod2fnc(c) == `26f_namedcmd) `7B
X`09`09`09unkeystroke(c);
X`09`09`09break;
X`09`09`7D
X`09`7D
X`09kbd_erase_to_end(0);
X`7D
X
X/* ARGSUSED */
Xint
Xrespawn(int f, int n GCC_UNUSED)
X`7B
X`09return spawn1(TRUE, !f);
X`7D
X
X/* ARGSUSED */
Xint
Xspawn(int f, int n GCC_UNUSED)
X`7B
X`09return spawn1(FALSE, !f);
X`7D
X
X#define COMMON_SH_PROMPT (SYS_UNIX `7C`7C SYS_VMS\0B08MSDO\0D09OS2\2308WINNT)
V
X
X#if COMMON_SH_PROMPT
X/*
X * Common function for prompting for shell/pipe command, and for recording the
V
X * last shell/pipe command so that we can support "!!" convention.
X *
X * Note that for 'pipecmd()', we must retain a leading "!".
X */
Xstatic int
XShellPrompt(
XTBUFF`09**holds,
Xchar`09*result,
Xint`09rerun)`09`09/* TRUE/FALSE: spawn, -TRUE: pipecmd */
X`7B
X`09register int`09s;
X`09register SIZE_T`09len;
X`09static`09const char bang`5B`5D = SHPIPE_LEFT;
X`09BUFFER *bp;
X`09int`09cb`09= any_changed_buf(`26bp),
X`09`09fix`09= (rerun != -TRUE);
X`09char`09save`5BNLINE`5D,
X`09`09temp`5BNLINE`5D,
X`09`09line`5BNLINE+1`5D;
X
X`09if ((len = tb_length(*holds)) != 0) `7B
X`09`09(void)strncpy(save, tb_values(*holds), len);
X`09`7D
X`09save`5Blen`5D = EOS;
X
X`09/* if it doesn't start with '!', or if that's all it is */
X`09if (!isShellOrPipe(save) `7C`7C save`5B1`5D == EOS)
X`09`09(void)strcpy(save, bang);
X
X`09(void)strcpy(line, save);
X`09if (rerun != TRUE) `7B
X`09`09if (cb != 0) `7B
X`09`09    if (cb > 1) `7B
X`09`09`09(void)lsprintf(temp,
X`09`09&0209"Warning: %d modified buffers: %s",
X`09`09&0209cb, bang);
X`09`09    `7D else `7B
X`09`09`09(void)lsprintf(temp,
X`09`09&0209"Warning: buffer `5C"%s`5C" is modified: %s",
X`09`09&0209bp->b_bname, bang);
X`09`09    `7D
X`09`09`7D else `7B
X`09`09`09(void)lsprintf(temp, "%s%s",
X`09`09&0209rerun == -TRUE ? "" : ": ", bang);
X`09`09`7D
X
X`09`09if ((s = mlreply_no_bs(temp, line+1, NLINE)) != TRUE)
X`09`09`09return s;
X`09`7D
X`09if (line`5B1`5D == EOS)
X`09`09return FALSE;
X
X`09*holds = tb_scopy(holds, line);
X`09(void)strcpy(result, line+fix);
X`09return TRUE;
X`7D
X#endif
X
X/*
X * Run a one-liner in a subjob. When the command returns, wait for a single
X * character to be typed, then mark the screen as garbage so a full repaint is
V
X * done.
X */
X/* the #ifdefs have been totally separated, for readability */
Xstatic int
Xspawn1(int rerun, int pressret)
X`7B
X#if DISP_IBMPC
X`09int`09closed;
X#endif
X#if COMMON_SH_PROMPT
X`09register int`09s;
X`09char`09line`5BNLINE`5D;`09/* command line send to shell */
X
X`09if ((s = ShellPrompt(`26save_shell`5B0`5D, line, rerun)) != TRUE)
X`09`09return s;
X#endif`09/* COMMON_SH_PROMPT */
X
X`09/* take care of autowrite */
X`09if (writeall(FALSE,1,\0806TRUE,TRUE) != TRUE)
X`09`09return FALSE;
X
X#if SYS_UNIX
X#if DISP_X11
X`09/*FIXME (void)x_window_SHELL(line); */
X`09(void)system_SHELL(line);
X#else
X`09ttclean(TRUE);
X`09(void)system_SHELL(line);
X`09TTflush();
X`09ttunclean();
X`09if (pressret)
X`09`09pressreturn();
X`09TTopen();
X`09TTkopen();
X`09TTflush();
X`09sgarbf = TRUE;
X#endif /* DISP_X11 */
X`09return AfterShell();
X#endif /* SYS_UNIX */
X
X#if`09SYS_VMS
X`09kbd_flush();
X`09s = vms_system(line);`09`09/* Run the command.`09*/
X`09if (pressret) `7B
X`09`09TTputc('`5Cr');
X`09`09TTputc('`5Cn');
X`09`09TTflush();
X`09`09pressreturn();
X`09`7D
X`09sgarbf = TRUE;
X`09return (s);
X#endif
X#if`09SYS_WIN31
X`09mlforce("`5BNot in Windows 3.1`5D");
X`09return FALSE;
X#endif
X#if`09SYS_MSDOS `7C`7C SYS_OS2\0B08WINNT
X`09kbd_erase_to_end(0);
X`09kbd_flush();
X`09TTkclose();
X#if`09DISP_IBMPC
X`09/* If we don't reset to 80x25, parts of the shell-output will go
X`09 * astray.
X`09 */
X`09closed = term.t_ncol != 80 `7C`7C\1509row != 25;
X`09if (closed)
X`09`09TTclose();
X#endif
X#if SYS_WINNT
X`09w32_system(line);
X#else
X`09system(line);
X#endif
X`09TTkopen();
X`09/* if we are interactive, pause here */
X`09if (pressret) `7B
X`09`09pressreturn();
X`09`7D
X#if`09DISP_IBMPC
X`09/* Reopen the display _after_ the prompt, to keep the shell-output
X`09 * in the same type of screen as the prompt.
X`09 */
X`09if (closed)
X`09`09TTopen();
X#endif
X#if DISP_NTCONS
X`09ntcons_reopen();
X#endif
X`09sgarbf = TRUE;
X`09return AfterShell();
X#endif
X`7D
X
X#if SYS_UNIX `7C`7C SYS_MSDOS\0D08VMS\1808OS2\2308WINNT
X/*
X * Pipe a one line command into a window
X */
X/* ARGSUSED */
Xint
Xpipecmd(int f, int n)
X`7B
X`09register BUFFER *bp;`09/* pointer to buff\0A06zot */
X`09register int`09s;
X`09char line`5BNLINE`5D;`09/* command line send to shell */
X
X`09/* get the command to pipe in */
X`09hst_init('!');
X`09s = ShellPrompt(`26save_shell`5B!global_g_val(GMDSAMEBANGS)`5D, line, -TRUE
V);
X`09hst_flush();
X
X`09/* prompt ok? */
X`09if (s != TRUE)
X`09`09return s;
X
X`09/* take care of autowrite */
X`09if (writeall(f,n,FALSE\0606,TRUE) != TRUE)
X`09`09return FALSE;
X
X
X#if BEFORE
X`09if (((s = ((bp = bfind(OUTPUT_BufName, 0)) != NULL)) == TRUE)
X`09 `26`26 ((s = popupbuff(bp)) == TRUE)
X`09 `26`26 ((s = swbuffer(bp)) == TRUE)
X`09 `26`26 ((s = readin(line, FALSE, bp, TRUE)) == \0A06
X`09`09set_rdonly(bp, line, MDVIEW);
X
X#else
X`09if ((s = ((bp = bfind(OUTPUT_BufName, 0)) != NULL\0A06TRUE)
X`09`09return s;
X`09if ((s = popupbuff(bp)) != TRUE)
X`09`09return s;
X`09ch_fname(bp,line);
X`09bp->b_active = FALSE; /* force a re-read */
X`09if ((s = swbuffer_lfl(bp,FALSE)) != TRUE)
X`09`09return s;
X`09set_rdonly(bp, line, MDVIEW);
X#endif
X
X`09return (s);
X`7D
X
X#else /* ! SYS_UNIX */
X
X/*
X * Pipe a one line command into a window
X */
Xint
Xpipecmd(int f, int n)
X`7B
X`09register int`09s;`09/* return status from CLI */
X`09register WINDOW *wp;`09/* pointer to new window */
X`09register BUFFER *bp;`09/* pointer to buff\0A06zot */
X`09static char oline`5BNLINE`5D;`09/* command line send to shell */
X`09char`09line`5BNLINE`5D;`09/* command line send to shell */
X`09WINDOW *ocurwp;`09`09/* save the current window during delete */
X
X`09static char filnam`5BNSTRING`5D = "command";
X
X`09/* get the command to pipe in */
X`09if ((s=mlreply("cmd: <", oline, NLINE)) != TRUE)
X`09`09return(s);
X
X`09(void)strcpy(line,oline);
X
X`09/* get rid of the command output buffer if it exists */
X`09if ((bp=find_b_name(OUTPUT_BufName)) != NULL) `7B
X`09`09/* try to make sure we are off screen */
X`09`09ocurwp = NULL;
X`09`09for_each_window(wp) `7B
X`09`09`09if (wp->w_bufp == bp) `7B
X`09`09&0209if (curwp != wp) `7B
X`09`09&0209`09ocurwp = curwp;
X`09`09&0209`09curwp = wp;
X`09`09&0209`7D
X`09`09&0209delwind(FALSE, 1);
X`09`09&0209if (ocurwp != NULL)
X`09`09&0209`09curwp = ocurwp;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`09if (zotbuf(bp) != TRUE)
X`09`09`09return(FALSE);
X`09`7D
X
X`09if (s != TRUE)
X`09`09return(s);
X
X`09/* split the current window to make room for\2406ommand output */
X`09if (splitwind(FALSE, 1) == FALSE)
X`09`09return(FALSE);
X
X`09/* and read the stuff in */
X`09if (getfile(filnam, FALSE) ==\0A07
X`09`09return(FALSE);
X
X`09/* overwrite its buffer name for consistency */
X`09set_bname(curbp, OUTPUT_BufName);
X
X`09/* make this window in VIEW mode, update buffer's mode lines */
X`09make_local_b_val(curwp->w_bufp,MDVIEW);
X`09set_b_val(curwp->w_bufp,MDVIEW,TRUE);
X`09curwp->w_flag `7C= WFMODE;
X
X#if OPT_FINDERR
X`09set_febuff(OUTPUT_BufName);
X#endif
X
X`09/* and get rid of the temporary file */
X`09unlink(filnam);
X`09return AfterShell();
X`7D
X#endif /* SYS_UNIX */
X
X#if SYS_UNIX `7C`7C SYS_MSDOS &027C (SYS_OS2 `26`26 CC_CSETPP)\2708WINNT
X/*
X * write_data_to_pipe() exists to facilitate execution of a Win32 thread.
X * All other host operating systems are simply victims.
X */
Xstatic void
Xwrite_data_to_pipe(void *writefp)
X`7B
X    FILE *fw;
X    KILL *kp;       /* pointer into kill register */
X
X    fw = (FILE *)writefp;
X    kregcirculate(FALSE);
X    kp = kbs`5Bukb`5D.kbufh;
X    while (kp != NULL)
X    `7B
X        fwrite((char *)kp->d_chunk, 1, (SIZE_T)KbSize(ukb,kp), fw);
X        kp = kp->d_next;
X    `7D
X    ukb = 0;   /* was modified by kregciruclate() */
X#if SYS_UNIX `26`26 ! TEST_DOS_PIPES
X    (void)fflush(fw);
X    (void)fclose(fw);
X    ExitProgram (GOODEXIT);
X    /* NOTREACHED */
X#else
X    npflush();  /* fake multi-processing */
X#endif
X#if SYS_WINNT
X    /*
X     * If this function is invoked by a thread, then that\1207 (not
X     * the parent process) must close write pipe.  We generalize this
X     * function so that all Win32 execution environments (threaded or
X     * not) use the same code.
X     */
X    (void)fflush(fw);
X    (void)fclose(fw);
X#endif
X`7D
X#endif
X
X/* run a region through an external filter, replace it with its output */
Xint
Xfilterregion(void)
X`7B
X/* FIXX work on this for OS2, need inout_popen support, or named pipe? */
X#if SYS_UNIX `7C`7C SYS_MSDOS &027C (SYS_OS2 `26`26 CC_CSETPP)\2708WINNT
X    static char oline`5BNLINE`5D;   /* command line send to shell */
X    char    line`5BNLINE`5D;    /* command line send to shell */
X    FILE *fr, *fw;
X    int s;
X
X    /* get the filter name and its args */
X    if ((s=mlreply_no_bs("!", oline, NLINE)) != TRUE)
X        return(s);
X    (void)strcpy(line,oline);
X    if ((s = inout_popen(`26fr, `26fw, line)) != TRUE) `7B
X        mlforce("`5BCouldn't open pipe or command`5D");
X        return s;
X    `7D
X
X    killregion();
X    if (!softfork())
X    `7B
X#if !(SYS_WINNT `26`26 defined(GMDW32PIPES))
X        write_data_to_pipe(fw);
X#else
X        /* This is a Win32 environment with compiled\2007pipe support. */
X        if (global_g_val(GMDW32PIPES))
X        `7B
X            /*
X             * w32pipes mode enabled -- create child thread to blast
X             * region to write pipe.
X             */
X
X            if (_beginthread(write_data_to_pipe, 0, fw) == -1)
X            `7B
X        \0808mlforce("`5BCan't create Win32 write pipe`5D");
X        \0808(void) fclose(fw);
X        \0808(void) npclose(fr);
X        \0808return (FALSE);
X            `7D
X        `7D
X        else
X        `7B
X            /*
X             * Single-threaded parent process writes region to pseudo
X             * write pipe (temp file).
X             */
X
X            write_data_to_pipe(fw);
X        `7D
X#endif
X    `7D
X#if ! ((SYS_OS2 `26`26 CC_CSETPP) `7C`7C SYS_WINNT)
X    (void)fclose(fw);
X#endif
X    DOT.l = lback(DOT.l);
X    s = ifile((char *)0,TRUE,fr);
X    npclose(fr);
X    (void)firstnonwhite(FALSE,1);
X    (void)setmark();
X    return s;
X#else
X    mlforce("`5BRegion filtering not available -- try buffer\260A`5D");
X    return FALSE;
X#endif
X`7D
X
X/*
X * filter a buffer through an external DOS program
X * this is obsolete, the filterregion code is better.
X */
X/* ARGSUSED */
Xint
Xvile_filter(int f GCC_UNUSED, int n\120B)
X`7B
X#if !(SYS_UNIX`7C`7CSYS_MSDOS &027C (SYS_OS2 `26`26 CC_CSETPP)) /* filterregio
Vn up above is better */
X`09register int`09s;`09/* return status from CLI */
X`09register BUFFER *bp;`09/* pointer to buff\0A06zot */
X`09static char oline`5BNLINE`5D;`09/* command line send to shell */
X`09char`09line`5BNLINE`5D;`09/* command line send to shell */
X`09char tnam`5BNFILEN`5D;`09/* place to store real file name */
X`09static char bname1`5B`5D = "fltinp";
X#if`09SYS_UNIX
X`09char`09*t;
X#endif
X
X`09static char filnam1`5B`5D = "fltinp";
X`09static char filnam2`5B`5D = "fltout";
X
X#if`09SYS_VMS
X`09mlforce("`5BNot available under VMS`5D");
X`09return(FALSE);
X#endif
X`09/* get the filter name and its args */
X`09if ((s=mlreply("cmd: `7C", oline, NLINE)) != TRUE)
X`09`09return(s);
X`09(void)strcpy(line,oline);
X
X`09/* setup the proper file names */
X`09bp = curbp;
X`09(void)strcpy(tnam, bp->b_fname);/* save the original name */
X`09ch_fname(bp, bname1);`09`09/* set it to our new one */
X
X`09/* write it out, checking for errors */
X`09if (writeout(filnam1,curbp,TRUE,TRUE) != \0906`7B
X`09`09mlforce("`5BCannot write filter file`5D");
X`09`09ch_fname(bp, tnam);
X`09`09return(FALSE);
X`09`7D
X
X#if`09SYS_MSDOS `7C`7C SYS_OS2\0B08WINNT
X`09(void)strcat(line," <fltinp >fltout");
X`09bottomleft();
X`09TTkclose();
X`09system(line);
X`09TTkopen();
+-+-+-+-+-+-+-+-  END  OF PART 102 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 103 -+-+-+-+-+-+-+-+
X`09sgarbf = TRUE;
X`09s = TRUE;
X#endif
X#if`09SYS_UNIX
X`09bottomleft();
X`09ttclean(TRUE);
X`09if ((t = strchr(line, '`7C')) != 0) `7B
X`09`09char`09temp`5BNLINE`5D;
X`09`09(void)strcpy(temp, t);
X`09`09(void)strcat(strcpy(t, " <fltinp"), temp);
X`09`7D else `7B
X`09`09(void)strcat(line, " <fltinp");
X`09`7D
X`09(void)strcat(line," >fltout");
X`09system(line);
X`09ttunclean();
X`09TTflush();
X`09sgarbf = TRUE;
X`09s = TRUE;
X#endif
X
X`09/* on failure, escape gracefully */
X`09if (s != TRUE `7C`7C (readin(filnam2,FALSE,curbp,TRUE) == FALSE)) `7B
X`09`09mlforce("`5BExecution failed`5D");
X`09`09ch_fname(bp, tnam);
X`09`09unlink(filnam1);
X`09`09unlink(filnam2);
X`09`09return(s);
X`09`7D
X
X`09ch_fname(bp, tnam); /* restore name */
X
X`09b_set_changed(bp);`09/* flag it as \1B07 */
X`09nounmodifiable(bp);`09/* and it can never be "un-changed" */
X
X`09/* and get rid of the temporary file */
X`09unlink(filnam1);
X`09unlink(filnam2);
X`09return AfterShell();
X#else
X`09mlforce("`5BBuffer filtering not available -- use \1F06 operator`5D");
X`09return FALSE;
X#endif
X`7D
X
X#if`09SYS_VMS
X/*
X * Run a command. The "cmd" is a pointer to\250A string, or NULL if you
X * want to run a copy of DCL in the subjob (this is how\1806tandard routine
X * lib$spawn works. You have to do wierd stuff with the terminal on the way in
V
X * and the way out, because DCL does not want the channel to be in raw mode.
X */
Xint
Xvms_system(register char *cmd)
X`7B
X`09struct  dsc$descriptor  cdsc;
X`09struct  dsc$descriptor  *cdscp;
X`09long`09status;
X`09long`09substatus;
X`09long`09iosb`5B2`5D;
X
X`09status = sys$qiow(EFN, iochan, IO$_SETMODE, iosb, 0, 0,
X`09`09`09  oldmode, sizeof(\1007), 0, 0\0606);
X`09if (status!=SS$_NORMAL `7C`7C (iosb`5B0`5D`260xFFFF)\200C)
X`09`09return (FALSE);
X`09cdscp = NULL;`09`09&0209/* Assume DCL.&0209*/
X`09if (cmd != NULL) `7B`09`09`09/* Build descriptor.`09*/
X`09`09cdsc.dsc$a_pointer = cmd;
X`09`09cdsc.dsc$w_length  = strlen(cmd);
X`09`09cdsc.dsc$b_dtype   = DSC$K_DTYPE_T;
X`09`09cdsc.dsc$b_class   = DSC$K_CLASS_S;
X`09`09cdscp = `26cdsc;
X`09`7D
X`09status = lib$spawn(cdscp, 0, 0\0606, 0, `26sub\2D06\1B09);
X`09if (status != SS$_NORMAL)
X`09`09substatus = \0906;
X`09status = sys$qiow(EFN, iochan, IO$_SETMODE, iosb, 0, 0,
X`09`09`09  newmode, sizeof(\1007), 0, 0\0606);
X`09if (status!=SS$_NORMAL `7C`7C (iosb`5B0`5D`260xFFFF)\200C)
X`09`09return (FALSE);
X`09if ((substatus`26STS$M_SUCCESS) == 0)`09/* Command failed.`09*/
X`09`09return (FALSE);
X`09return AfterShell();
X`7D
X#endif
$ call unpack [.VILE-8_0]SPAWN.C;1 -
 760094869 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 38 110 152
$!
$ create 'f'
X/* Look up vi-style tags in the file "tags".
X *`09Invoked either by ":ta routine-name" o\1906`5E`5D" while sitting
X *`09on a string.  In the latter case, the tag is the word under
X *`09the cursor.
X *`09written for vile: Copyright (c) 1990, 1995 by Paul Fox
X *
X * $Header: /usr/build/vile/vile/RCS/tags.c,v 1.89 1998/04/28 10:18:57 tom Exp
V $
X *
X */
X#include`09"estruct.h"
X#include        "edef.h"
X
X#if OPT_TAGS
X
X#if OPT_TAGS_CMPL
Xtypedef struct `7B
X`09/* FIXME: we could make next-tag work faster if we also hash the
X`09 * line-pointers for each key.
X`09 */
X`09char`09*bi_key;
X`09`7D TAGS_DATA;
X
X#define BI_DATA TAGS_DATA
X#include`09"btree.h"
X
X#endif
X
X#define`09UNTAG`09struct`09untag
X`09UNTAG `7B
X`09char *u_fname;
X`09L_NUM u_lineno;
X`09UNTAG *u_stklink;
X#if OPT_SHOW_TAGS
X`09char`09*u_templ;
X#endif
X`7D;
X
X#define TAGHITS`09struct`09taghits
X`09TAGHITS`09`7B
X`09TAGHITS`09*link;
X`09LINE`09*tag;`09/* points to tag-buffer line */
X`09LINE`09*hit;`09/* points to corresponding line in source-file */
X`7D;
X
Xstatic`09LINE *`09cheap_tag_scan(LINEPTR oldlp, char *name, SIZE_T taglen);
Xstatic`09LINE *`09cheap_buffer_scan(BUFFER *bp, char *patrn, int dir);
Xstatic`09BUFFER *gettagsfile(int n, int *endofpathflagp\1507did_read);
Xstatic`09int`09popuntag(char *fname, L_NUM *linenop);
Xstatic`09void`09pushuntag(char *fname, L_NUM lineno, \1B06tag);
Xstatic`09int`09tag_search(char *tag, int taglen\0C06initial);
Xstatic`09void`09tossuntag (void);
X
Xstatic`09TAGHITS*tag_hits;
Xstatic`09UNTAG *`09untaghead;
Xstatic`09char`09tagname`5BNFILEN+2`5D;  /* +2 since we may add a tab later */
V
X
X#if OPT_SHOW_TAGS
X#  if OPT_UPBUFF
Xstatic`09int`09update_tagstack ( BUFFER *bp );
X#  endif
X#endif`09/* OPT_SHOW_TAGS */
X
X#if OPT_TAGS_CMPL
X
Xstatic BI_NODE*
Xnew_tags (BI_DATA *a)
X`7B
X`09BI_NODE *p = typecalloc(\1807);
X`09p->value = *a;
X`09BI_KEY(p) = strmalloc(a->bi_key);
X`09return p;
X`7D
X
Xstatic void
Xold_tags (BI_NODE *a)
X`7B
X`09free(BI_KEY(a));
X`09free(a);
X`7D
X
Xstatic void
Xdpy_tags (BI_NODE *a GCC_UNUSED, int level\160B)
X`7B
X#if OPT_TRACE
X`09while (level-- > 0)
X`09`09TRACE((". "));
X`09TRACE(("%s (%d)`5Cn", BI_KEY(a), a->balance));
X#endif
X`7D
X
Xstatic BI_TREE tags_tree = `7B new_tags, old\0A07dpy_tags `7D;
X
X/* Parse the identifier out of the given line and store it in the binary tree
V */
Xstatic void
Xstore_tag(LINE *lp)
X`7B
X`09char`09my_name`5Bsizeof(tagname)`5D;
X`09size_t`09len, got;
X`09int`09c;
X
X`09if (llength(lp) > 0) `7B
X`09`09len = llength(lp);
X`09`09for (got = 0; got < len; got++) `7B
X`09`09`09c = lgetc(lp, got);
X`09`09`09if (!isident(c))
X`09`09&0209break;
X`09`09`09my_name`5Bgot`5D = c;
X`09`09`7D
X`09`09my_name`5Bgot`5D = EOS;
X`09`09if (got) `7B
X`09`09`09BI_DATA temp;
X#ifdef MDTAGIGNORECASE
X`09`09`09if (b_val(curbp,MDTAGIGNORECASE))
X`09`09&0209mklower(my_name);
X#endif
X`09`09`09temp.bi_key = my_name;
X`09`09`09btree_insert(`26tags_tree, `26temp);
X`09`09`7D
X`09`7D
X`7D
X
X/* check if the binary-tree is up-to-date.  If not, rebuild it. */
Xstatic const char **
Xinit_tags_cmpl (char *buf, unsigned cpos)
X`7B
X`09int tf_num;
X`09BUFFER *bp;
X`09LINE *lp;
X`09int done;
X`09int flag;
X`09int obsolete = (tags_tree.count == 0);
X
X#ifdef MDTAGIGNORECASE
X`09/* If curbp's b_val(curbp,MDTAGIGNORECASE)) is different from the last
X`09 * time we built the tree, obsolete t\1309sinc\1006keys changed.
X`09 */
X`09`7B
X`09`09static int my_tcase = SORTOFTRUE;
X`09`09if (b_val(curbp,MDTAGIGNORECASE) != my_tcase) `7B
X`09`09`09my_tcase = b_val(curbp,MDTAGIGNORECASE);
X`09`09`09obsolete = TRUE;
X`09`09`7D
X`09`7D
X#endif
X`09/*
X`09 * Check if we've already loaded all of the tags buffers.  If not, we
X`09 * know we should build the tree.  Also, if any aren't empty, we may
X`09 * have loaded the buffer for some other reason than tags processing.
X`09 */
X`09if (!obsolete) `7B
X`09`09for (tf_num = 0; ; \0E06++) `7B
X`09`09`09bp = gettagsfile(tf_num, `26done, `26flag);
X`09`09`09if (done `7C`7C bp == 0)
X`09`09&0209break;
X`09`09`09(void)bsizes(bp);
X`09`09`09obsolete = flag `7C`7C (bp->b_linecount != 0);
X`09`09`09if (obsolete)
X`09`09&0209break;
X`09`09`7D
X`09`7D
X
X`09if (obsolete) `7B
X`09`09btree_freeup(`26tags_tree);
X
X`09`09for (tf_num = 0; ; \0E06++) `7B
X`09`09`09bp = gettagsfile(tf_num, `26done, `26flag);
X`09`09`09if (done `7C`7C bp == 0)
X`09`09&0209break;
X`09`09`09for_each_line(lp,bp)
X`09`09&0209store_tag(lp);
X`09`09`7D
X
X`09`09TRACE(("stored %d tags entries`5Cn", tags_tree.count))
X`09`7D
X
X`09return btree_parray(`26tags_tree, buf, cpos);
X`7D
X
Xstatic int
Xtags_completion(int c, char *buf, unsigned *pos)
X`7B
X`09register unsigned cpos = *pos;
X`09int status = FALSE;
X`09const char **nptr;
X
X`09kbd_init();`09`09/* nothing to erase */
X`09buf`5Bcpos`5D = EOS;`09/* terminate it for us */
X
X`09if ((nptr = init_tags_cmpl(buf, cpos)) != 0) `7B
X`09`09status = kbd_complete(FALSE, c, buf, pos, (char *)nptr, sizeof(*nptr));
V
X`09`09free((char *)nptr);
X`09`7D
X`09return status;
X`7D
X#else
X#define tags_completion no\0E0B
X#endif
X
X/*
X * Record the places we've been to during a tag-search, so we'll not push the
V
X * stack just because there's repetition in the tags files.  Return true if
X * we've been here before.
X */
Xstatic int
Xmark_tag_hit(LINE *tag, \0B06hit)
X`7B
X`09TAGHITS *p;
X
X`09TRACE(("mark_tag_hit %s:%d`5Cn", curbp->b_bname, line_no(curbp, hit)))
X`09for (p = tag_hits; p != 0; p = p->link) `7B
X`09`09if (p->hit == hit) `7B
X`09`09`09TRACE(("... mark_tag_hit TRUE`5Cn"))
X`09`09`09return (p->tag == tag) ? ABORT : TRUE;
X`09`09`7D
X`09`7D
X
X`09p = typecalloc(TAGHITS);
X`09p->link  = tag_hits;
X`09p->tag   = tag;
X`09p->hit   = hit;
X`09tag_hits = p;
X
X`09TRACE(("... mark_tag_hit FALSE`5Cn"))
X`09return FALSE;
X`7D
X
X/*
X * Discard the list of tag-hits when we're about to begin a new tag-search.
X */
Xstatic void
Xfree_tag_hits(void)
X`7B
X`09TAGHITS *p;
X`09while ((p = tag_hits) != 0) `7B
X`09`09tag_hits = p->link;
X`09`09free(p);
X`09`7D
X`7D
X
X/* ARGSUSED */
Xint
Xgototag(int f GCC_UNUSED, int n\120B)
X`7B
X`09register int s;
X`09int taglen;
X
X`09if (clexec `7C`7C isnamedcmd) `7B
X`09`09UINT mode = KBD_NORMAL
X#if OPT_TAGS_CMPL
X`09`09`09`7C KBD_MAYBEC
X#endif
X`09`09`09;
X#ifdef MDTAGIGNORECASE
X`09`09`09if (b_val(curbp,MDTAGIGNORECASE))
X`09`09&0209mode `7C= KBD_LOWERC;
X#endif
X`09`09if ((s = kbd_string("Tag name: ",
X`09`09&0209tagname, sizeof(\1007),
X`09`09&0209'`5Cn', mode, tags_completion)) != TRUE)
X`09        \0808return (s);
X`09`09taglen = b_val(curbp,VAL_TAGLEN);
X`09`7D else `7B
X`09`09s = screen_string(tagname, sizeof\1008), _ident);
X`09`09taglen = 0;
X`09`7D
X
X`09if (s == TRUE) `7B
X#ifdef MDTAGIGNORECASE
X`09`09if (b_val(curbp,MDTAGIGNORECASE))
X`09`09`09mklower(tagname);
X#endif
X`09`09free_tag_hits();
X`09`09s = tag_search(tagname,taglen,TRUE);
X`09`7D else
X`09`09tagname`5B0`5D = EOS;
X`09return s;
X`7D
X
X/*
X * Continue a tag-search by looking for other references in the tags file.
X */
X/*ARGSUSED*/
Xint
Xnexttag(int f GCC_UNUSED, int n\120B)
X`7B
X`09int`09s = FALSE;
X`09if (tagname`5B0`5D != EOS) `7B
X`09`09do `7B
X`09`09`09s = tag_search(tagname, global_b_val(VAL_TAGLEN), FALSE);
X`09`09`7D while (s == SORTOFTRUE);
X`09`09if (s == ABORT)
X`09`09`09mlwarn("`5BNo more matches`5D");
X`09`7D
X`09return s;
X`7D
X
Xint
Xcmdlinetag(const char *t)
X`7B
X`09return tag_search(strncpy0(tagname, t, NFILEN),
X`09`09global_b_val(VAL_TAGLEN),
X`09`09TRUE);
X`7D
X
X/*
X * Jump back to the given file `26 line.
X */
Xstatic int
Xfinish_pop(char *fname, L_NUM lineno)
X`7B
X`09MARK odot;
X`09int s;
X
X`09s = getfile(fname,FALSE);
X`09if (s == TRUE) `7B
X`09`09/* it's an absolute move -- remember where we are */
X`09`09odot = DOT;
X`09`09s = gotoline(TRUE, lineno);
X`09`09/* if we moved, update the "last dot" mark */
X`09`09if (s == TRUE) `7B
X`09`09`09if (!sameline(DOT, odot))
X`09`09&0209curwp->w_flag `26= `7EWFMOVE;
X`09`09`09else
X`09`09&0209curwp->w_lastdot = odot;
X`09`09`7D
X`09`7D
X`09return s;
X`7D
X
Xstatic int
Xtag_search(char *tag, int taglen\0C06initial)
X`7B
X`09/* variables for 'initial'=FALSE */
X`09static`09int tf_num;
X`09static`09char last_bname`5BNBUFN`5D;
X#ifdef`09MDCHK_MODTIME
X`09static`09time_t`09last_modtime;
X#endif
X
X`09static TBUFF *srchpat;
X
X`09register LINE *lp;
X`09register SIZE_T i;
X`09register int status;
X`09char *tfp, *lplim;
X`09char tfname`5BNFILEN`5D;
X`09int flag;
X`09L_NUM lineno;
X`09int changedfile;
X`09MARK odot;
X`09BUFFER *tagbp;
X`09int nomore;
X`09int gotafile = FALSE;
X`09int retried = FALSE;
X
X`09if (initial)
X`09`09tf_num = 0;
X#ifdef`09MDCHK_MODTIME
X`09else `7B
X`09`09if ((tagbp = find_b_name(last_bname)) == NULL
X`09`09 `7C`7C last_modtime != tagbp->b\1408) `7B
X`09`09`09initial = TRUE;
X`09`09`09tf_num = 0;
X`09`09`7D
X`09`7D
X#endif
X
X`09do `7B
X`09`09tagbp = gettagsfile(tf_num, `26nomore, `26flag);
X`09`09lp = 0;
X`09`09if (nomore) `7B
X`09`09`09if (gotafile) `7B
X`09`09&0209if (initial `7C`7C retried) `7B
X`09`09&0209`09mlwarn("`5BNo such tag: `5C"%s`5C"`5D", tag);
X`09`09&0209`09return FALSE;
X`09`09&0209`7D
X`09`09&0209retried = TRUE;
X`09`09&0209tf_num = 0;
X`09`09&0209continue;
X`09`09`09`7D else `7B
X`09`09&0209mlforce("`5BNo tags file available.`5D");
X`09`09&0209return FALSE;
X`09`09`09`7D
X`09`09`7D
X
X`09`09if (tagbp) `7B
X`09`09`09lp = cheap_tag_scan(
X`09`09&0209initial `7C`7C retried
X`09`09&0209  ? buf_head(tagbp)
X`09`09&0209  : tagbp->b_dot.l,
X`09`09&0209tag, (SIZE_T)taglen);
X`09`09`09gotafile = TRUE;
X`09`09`7D
X
X`09`09tf_num++;
X
X`09`7D while (lp == NULL);
X
X`09/* Save the position in the tags-file so "next-tag" will work */
X`09tf_num--;
X`09(void)strcpy(last_bname, tagbp->b\1006);
X`09tagbp->b_dot.l = lp;
X`09tagbp->b_dot.o = 0;
X#ifdef`09MDCHK_MODTIME
X`09last_modtime = tagbp->b\1308;
X#endif
X
X`09/* Parse the line from the tags-file */
X`09lplim = `26lp->l_text`5B\0B06used`5D;
X`09tfp = lp->l_text;
X`09while (tfp < lplim)
X`09`09if (*tfp++ == '`5Ct')
X`09`09`09break;
X`09if (*tfp == '`5Ct') `7B /* then it's a new-fangled NeXT tags file */
X`09`09tfp++;  /* skip the tab */
X`09`7D
X
X`09i = 0;
X`09if (b_val(curbp,MDTAGSRELTIV) `26`26 !is_slashc(*tfp)
X#if OPT_MSDOS_PATH
X`09`26`26 !is_msdos_drive(tfp)
X#endif
X`09) `7B
X`09`09register char *first = tagbp->b_fname;
X`09`09char *lastsl = pathleaf(tagbp->b_fname);
X`09`09while (lastsl != first)
X`09`09`09tfname`5Bi++`5D = *first++;
X`09`7D
X`09while (i < sizeof(tfname) `26`26 tfp < lplim &0226 *tfp != '`5Ct') `7B
X`09`09tfname`5Bi++`5D = *tfp++;
X`09`7D
X`09tfname`5Bi`5D = EOS;
X
X`09if (tfp >= lplim) `7B
X`09`09mlforce("`5BBad line in tags file.`5D");
X`09`09return FALSE;
X`09`7D
X
X`09if (curbp `26`26 curwp) `7B
X`09`09lineno = line_no(curbp, DOT.l);
X`09`09if (!isInternalName(curbp->b_fname))
X`09`09`09pushuntag(curbp->b_fname, lineno, tag);
X`09`09else
X`09`09`09pushuntag(curbp->b_bname, lineno, tag);
X`09`7D
X
X`09if (curbp == NULL
X`09 `7C`7C !same_fname(tfname, curbp, TRUE)) `7B
X`09`09(void) doglob(tfname);
X`09`09status = getfile(tfname,TRUE);
X`09`09if (status != TRUE) `7B
X`09`09`09tossuntag();
X`09`09`09return status;
X`09`09`7D
X`09`09changedfile = TRUE;
X`09`7D else `7B
X`09`09changedfile = FALSE;
X`09`7D
X
X`09/* it's an absolute move -- remember where we are */
X`09odot = DOT;
X
X`09tfp++;  /* skip the tab */
X`09if (tfp >= lplim) `7B
X`09`09mlforce("`5BBad line in tags file.`5D");
X`09`09return FALSE;
X`09`7D
X`09if (isDigit(*tfp)) `7B /* then it's a line number */
X`09`09lineno = 0;
X`09`09while (isDigit(*tfp) `26`26 (tfp < lplim)) `7B
X`09`09`09lineno = 10*\0C07+ *tfp - '0';
X`09`09`09tfp++;
X`09`09`7D
X`09`09status = gotoline(TRUE,lineno);
X`09`09if (status != TRUE `26`26 !changedfile)
X`09`09`09tossuntag();
X`09`7D else `7B
X`09`09int delim = *tfp;
X`09`09int quoted = FALSE;
X`09`09char *p;
X`09`09int dir;
X
X`09`09if (delim == '?') `7B
X`09`09`09dir = REVERSE;
X`09`09`7D else `7B
X`09`09`09dir = FORWARD;
X`09`09`7D
X`09`09p = ++tfp;`09/* skip the "/" */
X
X`09`09/* we're on the '/', so look for the matching one */
X`09`09while (p < lplim) `7B
X`09`09`09if (quoted) `7B
X`09`09&0209quoted = FALSE;
X`09`09`09`7D else if (*p == '`5C`5C') `7B
X`09`09&0209quoted = TRUE;
X`09`09`09`7D else if (*p == delim) `7B
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09p++;
X`09`09`7D
X`09`09if (p >= lplim) `7B
X`09`09`09mlforce("`5BBad pattern in tags file.`5D");
X`09`09`09return FALSE;
X`09`09`7D
X
X`09`09if ((srchpat = tb_init(`26\1307, EOS)) == 0
X`09`09 `7C`7C (srchpat = tb_bappend(`26\1607, tfp, (ALLOC_T)(p - tfp))) == 0
X`09`09 `7C`7C (srchpat = tb_append(`26\1507, EOS)) == 0)
X`09`09`09return no_memory("tags");
X
X`09`09lp = cheap_buffer_scan(curbp, tb_values(srchpat), dir);
X`09`09if (lp == NULL) `7B
X`09`09`09mlwarn("`5BTag not present`5D");
X`09`09`09if (!changedfile)
X`09`09&0209tossuntag();
X`09`09`09return FALSE;
X`09`09`7D
X`09`09DOT.l = lp;
X`09`09curwp->w_flag `7C= WFMOVE;
X`09`09(void)firstnonwhite(FALSE,1);
X`09`09status = TRUE;
X`09`7D
X
X`09if (status == TRUE) `7B
X`09`09int s;
X`09`09if ((s = mark_tag_hit(tagbp->b_dot.l, DOT.l)) != FALSE) `7B
X`09`09`09if (popuntag(tfname, `26lineno))
X`09`09&0209(void) finish_pop(tfname, lineno);
X`09`09`09return s;
X`09`09`7D
X
X`09`09if (!changedfile)
X`09`09`09mlwrite("Tag `5C"%s`5C" in current buffer", tag);
X
X`09`09/* if we moved, update the "last dot" mark */
X`09`09if (!sameline(DOT, odot)) `7B
X`09`09`09curwp->w_lastdot = odot;
X`09`09`7D
X`09`7D
X
X`09return status;
X`7D
X
X/*
X * return (in buf) the Nth whitespace
X *`09separated word in "path", counting from 0
X */
Xstatic void
Xnth_name(char *buf, const char *path, int n)
X`7B
X`09while (n-- > 0) `7B
X`09`09path = skip_cblanks(path);
X`09`09path = skip_ctext(path);
X`09`7D
X`09path = skip_cblanks(path);
X`09while (*path `26`26 !isSpace\1206)) *buf++ = *path++;
X`09*buf = EOS;
X`7D
X
X
Xstatic BUFFER *
Xgettagsfile(int n, int *endofpathflagp\1507did_read)
X`7B
X#ifdef`09MDCHK_MODTIME
X`09time_t current;
X#endif
X`09char *tagsfile;
X`09BUFFER *tagbp;
X`09char tagbufname`5BNBUFN`5D;
X`09char tagfilename`5BNFILEN`5D;
X
X`09*endofpathflagp = FALSE;
X`09*did_read = FALSE;
X
X`09(void)lsprintf(tagbufname, TAGFILE_BufName, n+1);
X
X`09/* is the buffer around? */
X`09if ((tagbp=find_b_name(tagbufname)) == NULL) `7B
X`09`09char *tagf = global_b_val_ptr(VAL_TAGS);
X
X`09`09nth_name(tagfilename, tagf, n);
X`09`09if (!doglob(tagfilename)
X`09`09 `7C`7C tagfilename`5B0`5D == EOS) `7B
X`09`09`09*endofpathflagp = TRUE;
X`09`09`09return NULL;
X`09`09`7D
X
X`09`09/* look up the tags file */
X`09`09tagsfile = flook(tagfilename, FL_HERE`7CFL_READABLE);
X
X`09`09/* if it isn't around, don't sweat it */
X`09`09if (tagsfile == NULL)
X`09`09`7B
X`09`09`09return NULL;
X`09`09`7D
X
X`09`09/* find the pointer to that buffer */
X`09`09if ((tagbp=bfind(tagbufname, BFINVS)) == NULL) `7B
X`09`09`09mlforce("`5BCan't create tags buffer`5D");
X`09`09`09return NULL;
X`09`09`7D
X
X`09`09if (readin(tagsfile, FALSE, tagbp\0E07) != TRUE) `7B
X`09`09`09return NULL;
X`09`09`7D
X`09`09*did_read = TRUE;
X        `7D
X#ifdef`09MDCHK_MODTIME
X`09/*
X`09 * Re-read the tags buffer if we are checking modification-times and
X`09 * find that the tags file's been changed. We check the global mode
X`09 * value because it's too awkward to set the local mode \3506for a
X`09 * scratch buffer.
X`09 */
X`09if (global_b_val(MDCHK_MODTIME)
X`09 `26`26 get_modtime(tagbp, `26current)
X`09 `26`26 tagbp->b_modtime != current) `7B
X`09`09if (!*did_read
X`09`09 `26`26 readin(tagbp->b_fname, FALSE, tagbp\0E07) != TRUE) `7B
X`09`09`09return NULL;
X`09`09`7D
X`09 `09set_modtime(tagbp, tagbp->b_fname);
X`09`09*did_read = TRUE;
X`09`7D
X#endif
X`09b_set_invisible(tagbp);
X`09return tagbp;
X`7D
X
X#ifdef MDTAGIGNORECASE
Xstatic int my_strncasecmp(const char *a, c\0F0Bb, size_t len)
X`7B
X`09int aa = EOS, bb\0A06;
X
X`09while ((len != 0)
X`09  `26`26   ((aa = (isUpper(*a) ? toLow\0E07: *a)) != EOS)
X`09  `26`26   ((bb = (isUpper(*b) ? toLow\0E07: *b)) != EOS)
X`09  `26`26   (aa == bb)) `7B
X`09`09len--;
X`09`09a++;
X`09`09b++;
X`09`7D
X
X`09return aa - bb;
X`7D
X#endif
X
X/*
X * Do exact/inexact lookup of an anchored string in a buffer.
X *`09if taglen is 0, matches must be exact (i.e.  all
X *`09characters significant).  if the user enters less than 'taglen'
X *`09characters, this match must also be exact.  if the user enters
X *`09'taglen' or more characters, only that many \1B0A will be
X *`09significant in the lookup.
X */
Xstatic LINE *
Xcheap_tag_scan(LINEPTR oldlp, char *name, SIZE_T taglen)
X`7B
X`09register LINE *lp,*retlp;
X`09SIZE_T namelen = strlen(name);
X`09int exact = (taglen == 0);
X`09int added_tab;
X#ifdef MDTAGIGNORECASE
X`09int (*compare)(const char *a, c\0F0Bb, size_t len)
X`09`09= b_val(curbp,MDTAGIGNORECASE)
X`09`09? my_strncasecmp
X`09`09: strncmp;
X#else
X#define compare strncmp
X#endif
X
X`09/* force a match of the tab delimiter if we're supposed to do
X`09`09exact matches or if we're searching for something shorter
X`09`09than the "restricted" length */
X`09if (exact `7C`7C namelen < taglen) `7B
X`09`09name`5Bnamelen++`5D = '`5Ct';
X`09`09name`5Bnamelen`5D = EOS;
X`09`09added_tab = TRUE;
X`09`7D else `7B
X`09`09added_tab = FALSE;
X`09`7D
X
X`09retlp = NULL;
X`09lp = lforw(oldlp);
X`09while (lp != oldlp) `7B
X`09`09if (llength(lp) > (int)namelen) `7B
X`09`09`09if (!compare(lp->l_text, name\0606len)) `7B
X`09`09&0209retlp = lp;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`09lp = lforw(lp);
X`09`7D
X`09if (added_tab)
X`09`09name`5Bnamelen-1`5D = EOS;
X`09return retlp;
X`7D
X
Xstatic LINE *
Xcheap_buffer_scan(BUFFER *bp, char *patrn, int dir)
X`7B
X`09register LINE *lp;
X`09register LINE *result = 0;
X`09regexp *exp = regcomp(patrn, FALSE);
X#ifdef MDTAGIGNORECASE
X`09int savecase = ignorecase;
X`09if (b_val(bp,MDTAGIGNORECASE))
X`09`09ignorecase = TRUE;
X#endif
X
X`09TRACE(("cheap_buffer_scan '%s' %s`5Cn",
X`09`09patrn,
X`09`09dir == FORWARD ? "fwd" : "bak"))
X
X`09for (lp = dir == FORWARD ? lforw(buf_head(bp)) : lback\160E;
X`09`09lp != buf_head(bp);
X`09`09lp = dir == FORWARD ? lforw(lp) : lback(lp))
X`09`7B
X`09`09if (lregexec(exp, lp, 0, llength(lp))) `7B
X`09`09`09result = lp;
X`09`09`09break;
X`09`09`7D
X`09`7D
X`09free(exp);
X#ifdef MDTAGIGNORECASE
X`09ignorecase = savecase;
X#endif
X`09return (result);
X`7D
X
Xint
Xuntagpop(int f, int n)
X`7B
X`09L_NUM lineno;
X`09char fname`5BNFILEN`5D;
X`09int s;
X
X`09if (!f) n = 1;
X`09while (n `26`26 popuntag(fname,`26lineno))
X`09`09n--;
X`09if (lineno `26`26 fname`5B0`5D) `7B
X`09`09s = finish_pop(fname, lineno);
X`09`7D else `7B
X`09`09mlwarn("`5BNo stacked un-tags`5D");
X`09`09s = FALSE;
X`09`7D
X`09return s;
X`7D
X
X
Xstatic void
Xfree_untag(UNTAG *utp)
X`7B
X`09FreeIfNeeded(utp->u_fname);
X#if OPT_SHOW_TAGS
X`09FreeIfNeeded(utp->u_templ);
X#endif
X`09free((char *)utp);
X`7D
X
X
X/*ARGSUSED*/
Xstatic void
Xpushuntag(char *fname, L_NUM lineno, \1B06tag)
X`7B
X`09UNTAG *utp;
X`09utp = typealloc(UNTAG);
X`09if (!utp)
X`09`09return;
X
X`09if ((utp->u_fname = strmalloc(fname)) == 0
X#if OPT_SHOW_TAGS
X`09 `7C`7C (utp->u_templ = strmalloc(tag)) == 0
X#endif
X`09   ) `7B
X`09`09free_untag(utp);
X`09`09return;
X`09`7D
X#if OPT_VMS_PATH
X`09strip_version(utp->u_fname);
X#endif
X
X`09utp->u_lineno = \0906;
X`09utp->u_stklink = untaghead;
X`09untaghead = utp;
X`09update_scratch(TAGSTACK_BufName, \2107tagstack);
X`7D
X
X
Xstatic int
Xpopuntag(char *fname, L_NUM *linenop)
X`7B
X`09register UNTAG *utp;
X
X`09if (untaghead) `7B
X`09`09utp = untaghead;
X`09`09untaghead = utp->u_stklink;
X`09`09(void)strcpy(fname, utp->u_fname);
X`09`09*linenop = utp->u_\1106;
X`09`09free_untag(utp);
X`09`09update_scratch(TAGSTACK_BufName, \2107tagstack);
X`09`09return TRUE;
X`09`7D
X`09fname`5B0`5D = EOS;
X`09*linenop = 0;
X`09return FALSE;
X
X`7D
X
X/* discard without returning anything */
Xstatic void
Xtossuntag(void)
X`7B
X`09register UNTAG *utp;
X
X`09if (untaghead) `7B
X`09`09utp = untaghead;
X`09`09untaghead = utp->u_stklink;
X`09`09free_untag(utp);
X`09`09update_scratch(TAGSTACK_BufName, \2107tagstack);
X`09`7D
X`7D
X
X#if OPT_SHOW_TAGS
X/*ARGSUSED*/
Xstatic void
Xmaketagslist (int value GCC_UNUSED, void *dummy\180B)
X`7B
X`09register UNTAG *utp;
X`09register int`09n;
X`09int`09taglen = global_b_val(VAL_TAGLEN);
X`09char`09temp`5BNFILEN`5D;
X
X`09if (taglen == 0) `7B
X`09`09for (utp = untaghead; utp != 0\0A06= utp->u_stklink) `7B
X`09`09`09n = strlen(utp->u_templ);
X`09`09`09if (n > taglen)
X`09`09&0209taglen = n;
X`09`09`7D
X`09`7D
X`09if (taglen < 10)
X`09`09taglen = 10;
X
X`09bprintf("    %*s FROM line in file`5Cn", taglen, "TO tag");
X`09bprintf("    %*p --------- %30p",      taglen, '-', '-');
X
X`09for (utp = untaghead, n = 0; utp !\0A09= utp->u_stklink)
X`09`09bprintf("`5Cn %2d %*s %8d  %s",
X`09`09`09++n,
X`09`09`09taglen, utp->u_templ,
X`09`09`09utp->u_lineno,
X`09`09`09shorten_path(strcpy(temp, utp->u_fname), TRUE));
X`7D
X
X
X#if OPT_UPBUFF
X/* ARGSUSED */
Xstatic int
Xupdate_tagstack(BUFFER *bp GCC_UNUSED)
X`7B
X`09return showtagstack(FALSE,1);
X`7D
X#endif
X
X/*
X * Display the contents of the tag-stack
X */
X/*ARGSUSED*/
Xint
Xshowtagstack(int f, int n GCC_UNUSED)
X`7B
X`09return liststuff(TAGSTACK_BufName, FALSE, maketagslist, f, (void *)0);
X`7D
X#endif`09/* OPT_SHOW_TAGS */
X
X#if NO_LEAKS
Xvoid tags_leaks (void)
X`7B
X`09L_NUM lineno;
X`09char fname`5BNFILEN`5D;
X
X`09free_tag_hits();
X`09while (popuntag(fname, `26lineno))
X`09`09;
X#if OPT_TAGS_CMPL
X`09btree_freeup(`26tags_tree);
X#endif
X`7D
X#endif
X
X#endif`09/* OPT_TAGS */
$ call unpack [.VILE-8_0]TAGS.C;1 -
 1092303077 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 39 111 152
$!
$ create 'f'
X/*
X *`09tbuff.c
X *
X *`09Manage dynamic temporary buffers.
X *`09Note that some temp-buffs are never freed, for speed
X *
X *`09To do:`09add 'tb_ins()' an\0F06del()' to support cursor-level command
X *`09`09editing.
X *
X * $Header: /usr/build/vile/vile/RCS/tbuff.c,v 1.31 1998/04/26 13:57:45 tom Ex
Vp $
X *
X */
X
X#include "estruct.h"
X#include "edef.h"
X
X#define`09NCHUNK`09NLINE
X
X/*******(testing)\1007\1707\0E0E\1C1C****/
X#if NO_LEAKS
Xtypedef`09struct`09_tb_list`09`7B
X`09struct`09_tb_list`09*link;
X`09TBUFF`09`09`09*buff;
X`09`7D TB_LIST;
X
Xstatic`09TB_LIST`09*all_tbuffs;
X
X#define`09AllocatedBuffer(q)`09tb_remember(q);
X#define`09FreedBuffer(q)`09`09tb_forget(q);
X
Xstatic
Xvoid
Xtb_remember(TBUFF *p)
X`7B
X`09register TB_LIST *q = typealloc(\1707);
X`09q->buff = p;
X`09q->link = all_tbuffs;
X`09all_tbuffs = q;
X`7D
X
Xstatic
Xvoid
Xtb_forget(TBUFF *p)
X`7B
X`09register TB_LIST *q, *r;
X
X`09for (q = all_tbuffs, r = 0; q != 0; r = q, q = q->link)
X`09`09if (q->buff == p) `7B
X`09`09`09if (r != 0)
X`09`09&0209r->link = q\0A06;
X`09`09`09else
X`09`09&0209all_tbuffs = q->link;
X`09`09`09free((char *)q);
X`09`09`09break;
X`09`09`7D
X`7D
X
Xvoid
Xtb_leaks(void)
X`7B
X`09while (all_tbuffs != 0) `7B
X`09`09TBUFF`09*q = all_tbuffs->buff;
X`09`09FreedBuffer(q);
X`09`09tb_free(`26q);
X`09`7D
X`7D
X
X#else
X#define`09AllocatedBuffer(q)
X#define`09FreedBuffer(q)
X#endif
X
X/*******(initialization)\1707\1E07\0E0E\1C19/
X
X/*
X * ensure that the given temp-buff has as much space as specified
X */
XTBUFF *
Xtb_alloc(TBUFF **p, ALLOC_T n)
X`7B
X`09register TBUFF *q = *p;
X`09if (q == 0) `7B
X`09`09q = *p = typealloc(TBUFF);
X`09`09q->tb_data = typeallocn(char, \1E06size = n);
X`09`09q->tb_used = 0;
X`09`09q->tb_last = 0;
X`09`09q->tb_endc = abortc;
X`09`09q->tb_data`5B0`5D = 0;`09/* appease Purify */
X`09`09AllocatedBuffer(q)
X`09`7D else if (n >= q->tb_size) `7B
X`09`09q->tb_data = typereallocn(char, \200A\0C08size = (n*2));
X`09`7D
X`09return q;
X`7D
X
X/*
X * (re)initialize a temp-buff
X */
XTBUFF *
Xtb_init(TBUFF **p, int c)
X`7B
X`09register TBUFF *q = *p;
X`09if (q == 0)
X`09`09q = tb_alloc(p, NCHUNK);
X`09q->tb_used = 0;
X`09q->tb_last = 0;
X`09q->tb_endc = c;`09`09/* code to return if no-more-data */
X`09return (*p = q);
X`7D
X
X/*
X * deallocate a temp-buff
X */
Xvoid
Xtb_free(TBUFF **p)
X`7B
X`09register TBUFF *q = *p;
X
X`09if (q != 0) `7B
X`09`09FreedBuffer(q)
X`09`09free(q->tb_data);
X`09`09free((char *)q);
X`09`7D
X`09*p = 0;
X`7D
X
X/*******(storage)\1007\1707\0E0E\1C1C****/
X
X/*
X * put a character c at the nth position of the temp-buff
X */
XTBUFF *
Xtb_put(TBUFF **p, ALLOC_T n, int c)
X`7B
X`09register TBUFF *q;
X
X`09if ((q = tb_alloc(p, n+1)) != 0) `7B
X`09`09q->tb_data`5Bn`5D = (char)c;
X`09`09q->tb_used = n+1;
X`09`7D
X`09return (*p = q);
X`7D
X
X#if NEEDED
X/*
X * stuff the nth character into the temp-buff -- assumes space already there
X *  it's sort of the opposite of tb_peek
X */
Xvoid
Xtb_stuff(TBUFF *p, int c)
X`7B
X`09if (p->tb_last < \0D06used)
X`09`09p->tb_data`5B\0B06last`5D = c;
X`09else
X`09`09p->tb_endc = c;
X`7D
X#endif
X/*
X * append a character to the temp-buff
X */
XTBUFF *
Xtb_append(TBUFF **p, int c)
X`7B
X`09register TBUFF *q = *p;
X`09register ALLOC_T n = (q != 0) ? q->tb_used : 0;
X
X`09return tb_put(p, n, c);
X`7D
X
X/*
X * insert a character into the temp-buff
X */
XTBUFF *
Xtb_insert(TBUFF **p, ALLOC_T n, int c)
X`7B
X`09register ALLOC_T m = tb_length(*p);
X`09register TBUFF *q = tb_append(p, c);
X
X`09if (q != 0 `26`26 n < m) `7B
X`09`09while (n < m) `7B
X`09`09`09q->tb_data`5Bm`5D = \100C-1`5D;
X`09`09`09m--;
X`09`09`7D
X`09`09q->tb_data`5Bm`5D = c;
X`09`7D
X`09return q;
X`7D
X
X/*
X * Copy one temp-buff to another
X */
XTBUFF *
Xtb_copy(TBUFF **d, \0B07s)
X`7B
X`09register TBUFF *p;
X
X`09if (s != 0) `7B
+-+-+-+-+-+-+-+-  END  OF PART 103 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 104 -+-+-+-+-+-+-+-+
X`09`09if ((p = tb_init(d, s->tb_endc)) != 0)
X`09`09`09p = tb_bappend(d, s->tb_data\0C08used);
X`09`7D else
X`09`09p = tb_init(d, abortc);
X`09return p;
X`7D
X
X/*
X * append a binary data to the temp-buff
X */
XTBUFF *
Xtb_bappend(TBUFF **p, const char *s, ALLOC_T len)
X`7B
X`09while ((len-- != 0) `26`26 tb_append(p, (int)(*s++)) != 0)
X`09`09;
X`09return *p;
X`7D
X/*
X * append a string to the temp-buff
X */
XTBUFF *
Xtb_sappend(TBUFF **p, const char *s)
X`7B
X`09if (!s)
X`09`09return *p;
X`09while (*s `26`26 tb_append(p, (int)(*s++)) != 0)
X`09`09;
X`09return *p;
X`7D
X
X/*
X * copy a string to the temp-buff, including a null
X */
XTBUFF *
Xtb_scopy(TBUFF **p, const char *s)
X`7B
X`09(void) tb_init(p, EOS);
X`09(void) tb_sappend(p, s);
X`09return tb_append(p, EOS);
X`7D
X
X/*
X * Construct a TBUFF from a null-terminated string, omitting its null.
X */
XTBUFF *
Xtb_string(const char *s)
X`7B
X`09TBUFF *p = 0;
X`09(void) tb_init(`26p, EOS);
X`09return tb_bappend(`26p, s, strlen(s));
X`7D
X
X/*******(retrieval)\1207\1907\0E0E\1C1C****/
X
X#if DISP_X11
X/*
X * get the nth character from the temp-buff
X */
Xint
Xtb_get(TBUFF *p, ALLOC_T n)
X`7B
X`09register int`09c = abortc;
X
X`09if (p != 0)
X`09`09c = (n < p->tb_used) ?\0E07data`5Bn`5D :\1E07endc;
X
X`09return char2int(c);
X`7D
X#endif
X
X/*
X * undo the last 'tb_put'
X */
Xvoid
Xtb_unput(TBUFF *p)
X`7B
X`09if (p != 0
X`09 `26`26 p->tb_used != 0)
X`09`09p->tb_used -= 1;
X`7D
X
X/*******(iterators)\1207\1907\0E0E\1C1C****/
X
X#if NEEDED
X/*
X * Reset the iteration-count
X */
Xvoid
Xtb_first(TBUFF *p)
X`7B
X`09if (p != 0)
X`09`09p->tb_last = 0;
X`7D
X#endif
X
X#if DISP_X11
X/*
X * Returns true iff the iteration-count has not gone past the end of temp-buff
V.
X */
Xint
Xtb_more(TBUFF *p)
X`7B
X`09return (p != 0) ? (p->tb_last < \0D06used) : FALSE;
X`7D
X
X/*
X * get the next character from the temp-buff
X */
Xint
Xtb_next(TBUFF *p)
X`7B
X`09if (p != 0)
X`09`09return tb_get(p, p->tb_last++);
X`09return abortc;
X`7D
X#endif
X
X#if NEEDED
X/*
X * undo a tb_next
X */
Xvoid
Xtb_unnext(TBUFF *p)
X`7B
X`09if (p == 0)
X`09`09return;
X`09if (p->tb_last > 0)
X`09`09p->tb_last--;
X`7D
X
X/*
X * get the next character from the temp-buff w/o incrementing index
X */
Xint
Xtb_peek(TBUFF *p)
X`7B
X`09if (p != 0)
X`09`09return tb_get(p, p->tb_last);
X`09return abortc;
X`7D
X#endif  /* NEEDED */
X
X/*******(bulk-data)\1207\1907\0E0E\1C1C****/
X
X/*
X * returns a pointer to data, assumes it is one long string
X */
Xchar *
Xtb_values(TBUFF *p)
X`7B
X`09return (p != 0) ? p->tb_data : 0;
X`7D
X
X/*
X * returns the length of the data
X */
XALLOC_T
Xtb_length(TBUFF *p)
X`7B
X`09return (p != 0) ? p->tb_used : 0;
X`7D
$ call unpack [.VILE-8_0]TBUFF.C;1 -
 52643277 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 13 112 152
$!
$ create 'f'
X/*`09tcap:`09Unix V5, V7 and BS4.2 Termcap video driver
X *`09`09for MicroEMACS
X *
X * $Header: /usr/build/vile/vile/RCS/tcap.c,v 1.107 1998/05/28 10:20:33 tom Ex
Vp $
X *
X */
X
X#define termdef 1`09`09`09/* don't d\1C06"term" external */
X
X#include`09"estruct.h"
X#include`09"edef.h"
X
X#if DISP_TERMCAP
X
X#define MARGIN`098
X#define SCRSIZ`0964
X#define NPAUSE`0910`09`09`09/* # times thru update to pause */
X
X#include`09"tcap.h"
X
X#undef WINDOW
X#define WINDOW vile_\0C06
X
X#if USE_TERMCAP
X#  define TCAPSLEN 768
X`09static`09char tcapbuf`5BTCAPSLEN`5D;
X#endif
X
Xstatic char *tc_CM,\0806E\0807L\1006SO\0807E;
Xstatic char *tc_TI,\0806E\0806KS\0807E;
Xstatic char *tc_CS, *tc_dl\0806a\0807DL\1806A\0807SF\0807R;
X
X#if OPT_VIDEO_ATTRS
Xstatic char *tc_US;`09/* underline-start */
Xstatic char *tc_UE;`09/* underline-end */
Xstatic char *tc_ME;
Xstatic char *tc_MD;
X#endif
X
X#if OPT_FLASH
Xstatic char *vb;`09/* visible-bell */
X#endif
X
X#if OPT_COLOR
X/*
X * This implementation is based on the description of SysVr4 curses found in
X * ncurses 1.8.7, which lists the following terminal capabilities:
X *
X * Full name        Terminfo  Type   Termcap Description
X * --------\0808\1108   ----\0707   \2A11\3A0D
X * back_color_erase "bce"     bool   "ut"    screen erased with background col
Vor
X * max_colors       "\0E06"  num    "Co"    maximum numbers of \3907on screen
V
X * max_pairs        "pairs"   num\1107"    maximum number of color-\3E06on the
V screen
X * no_color_video   "ncv"     num    "NC"    \2106attributes that can't be use
Vd with colors
X * orig_pair        "op"\0C06str    "op"
X * orig_colors      "oc"\0A06str\110Cset original \3206
X * initialize_color "initc"   str    "Ic"
X * initialize_pair  "initp"   str    "Ip"
X * set_color_pair   "scp"     str    "sp"
X * set_a_foreground "setaf"   str    "AF"
X * set_a_background "setab"   str    "AB"
X * color_names      "colornm" str    "Yw"
X *
X * FIXME: In this version, we don't support color pairs, since the only
X * platform on which it's been tested is Linux, with an IBM-PC compatible
X * display.  Also, the color names are hardcoded.  The termcap must have
X * the following capabilities set:
X *`09Co (limited to 1 .. (NCOLORS-1)
X *`09AF (e.g., "`5CE`5B%a+c`5C036%dm")
X *`09AB (e.g., "`5CE`5B%a+c`5C050%dm")
X *`09oc (e.g., "`5CE`5B0m")
X */
X
X#define NO_COLOR (-1)
X#define`09Num2Color(n) ((n >= 0) ? ctrans`5B(n) `26 (ncolors-1)`5D : NO_COLOR)
V
X
Xstatic`09char`09*AF;
Xstatic`09char`09*AB;
Xstatic`09char`09*Sf;
Xstatic`09char`09*Sb;
Xstatic`09char`09*OrigColors;
Xstatic`09int`09have_bce;
X
X`09/* ANSI: black, red, green, yellow, blue, magenta, cyan, white   */
Xstatic`09const char ANSI_palette`5B`5D = `7B "0 1 2 3 4 5 6 7" `7D;
Xstatic`09const char UNKN_palette`5B`5D = `7B "0 4 2 6 1 5 3 7 8 12 10 14 9 13
V 11 15" `7D;
X/*
X * We don't really _know_ what the default colors are set to, so the initial
X * values of the current_`5Bfb`5Dcolor are set to an illegal\3606 to force the
V
X * colors to be set.
X */
Xstatic`09int`09given_fcolor = NO_COLOR;
Xstatic`09int`09given_bcolor = NO_COLOR;
X
Xstatic`09int`09shown_fcolor = NO_COLOR;
Xstatic`09int`09shown_bcolor = NO_COLOR;
X#endif /* OPT_COLOR */
X
Xstatic const struct `7B
X    char * capname;
X    int    code;
X`7D keyseqs`5B`5D = `7B
X    /* Arrow keys */
X    `7B CAPNAME("ku","kcuu1"),`09KEY_Up `7D,`09`09/* up */
X    `7B CAPNAME("kd","kcud1"),`09KEY_Down `7D,`09`09/* down */
X    `7B CAPNAME("kr","kcuf1"),`09KEY_Right `7D,`09`09/* right */
X    `7B CAPNAME("kl","kcub1"),`09KEY_Left `7D,`09`09/* left */
X    /* other cursor-movement */
X    `7B CAPNAME("kh","khome"),`09KEY_Home `7D,`09`09/* home */
X    `7B CAPNAME("kH","kll"),`09KEY_End `7D,`09`09/* end (variant) */
X    `7B CAPNAME("@7","kend"),`09KEY_End `7D,`09`09/* end */
X    /* page scroll */
X    `7B CAPNAME("kN","knp"),`09KEY_Next `7D,`09`09/* next page */
X    `7B CAPNAME("kP","kpp"),`09KEY_Prior `7D,`09`09/* previous page */
X    /* editing */
X    `7B CAPNAME("kI","kich1"),`09KEY_Insert `7D,`09`09/* \0E07*/
X    `7B CAPNAME("kD","kdch1"),`09KEY_Delete `7D,`09`09/* \0E07*/
X    `7B CAPNAME("@0","kfnd"),`09KEY_Find `7D,`09`09/* Find */
X    `7B CAPNAME("*6","kslt"),`09KEY_Select `7D,`09`09/* \0E07*/
X    /* command */
X    `7B CAPNAME("%1","khlp"),`09KEY_Help `7D,`09`09/* Help */
X    /* function keys */
X    `7B CAPNAME("k1","kf1"),`09KEY_F1 `7D,`09`09/* F1 */
X    `7B CAPNAME("k2","kf2"),`09KEY_F2 `7D,
X    `7B CAPNAME("k3","kf3"),`09KEY_F3 `7D,
X    `7B CAPNAME("k4","kf4"),`09KEY_F4 `7D,
X    `7B CAPNAME("k5","kf5"),`09KEY_F5 `7D,
X    `7B CAPNAME("k6","kf6"),`09KEY_F6 `7D,
X    `7B CAPNAME("k7","kf7"),`09KEY_F7 `7D,
X    `7B CAPNAME("k8","kf8"),`09KEY_F8 `7D,
X    `7B CAPNAME("k9","kf9"),`09KEY_F9 `7D,
X    `7B CAPNAME("k;","kf10"),`09KEY_F10 `7D,`09`09/* F10 */
X    `7B CAPNAME("F1","kf11"),`09KEY_F11 `7D,`09`09/* F11 */
X    `7B CAPNAME("F2","kf12"),`09KEY_F12 `7D,`09`09/* F12 */
X    `7B CAPNAME("F3","kf13"),`09KEY_F13 `7D,`09`09/* F13 */
X    `7B CAPNAME("F4","kf14"),`09KEY_F14 `7D,
X    `7B CAPNAME("F5","kf15"),`09KEY_F15 `7D,
X    `7B CAPNAME("F6","kf16"),`09KEY_F16 `7D,
X    `7B CAPNAME("F7","kf17"),`09KEY_F17 `7D,
X    `7B CAPNAME("F8","kf18"),`09KEY_F18 `7D,
X    `7B CAPNAME("F9","kf19"),`09KEY_F19 `7D,`09`09/* F19 */
X    `7B CAPNAME("FA","kf20"),`09KEY_F20 `7D,`09`09/* F20 */
X    `7B CAPNAME("FB","kf21"),`09KEY_F21 `7D,
X    `7B CAPNAME("FC","kf22"),`09KEY_F22 `7D,
X    `7B CAPNAME("FD","kf23"),`09KEY_F23 `7D,
X    `7B CAPNAME("FE","kf24"),`09KEY_F24 `7D,
X    `7B CAPNAME("FF","kf25"),`09KEY_F25 `7D,
X    `7B CAPNAME("FG","kf26"),`09KEY_F26 `7D,
X    `7B CAPNAME("FH","kf27"),`09KEY_F27 `7D,
X    `7B CAPNAME("FI","kf28"),`09KEY_F28 `7D,
X    `7B CAPNAME("FJ","kf29"),`09KEY_F29 `7D,
X    `7B CAPNAME("FK","kf30"),`09KEY_F30 `7D,
X    `7B CAPNAME("FL","kf31"),`09KEY_F31 `7D,
X    `7B CAPNAME("FM","kf32"),`09KEY_F32 `7D,
X    `7B CAPNAME("FN","kf33"),`09KEY_F33 `7D,
X    `7B CAPNAME("FO","kf34"),`09KEY_F34 `7D,
X    `7B CAPNAME("FP","kf35"),`09KEY_F35 `7D
X`7D;
X
X#if SYS_OS2_EMX
X#include "os2keys.h"
X#endif
X
Xstatic int  colors_are_really_ANSI (void);
Xstatic int  tcapcres (const char *cres);
Xstatic void putnpad(char *str, int n);
Xstatic void putpad(char *str);
Xstatic void tcapbeep (void);
Xstatic void tcapclose (void);
Xstatic void tcapeeol (void);
Xstatic void tcapeeop (void);
Xstatic void tcapkclose (void);
Xstatic void tcapkopen (void);
Xstatic void tcapmove (int row, int col);
Xstatic void tcapopen (void);
Xstatic void tcapscroll_delins (int from, int to\0806n);
Xstatic void tcapscroll_reg (int from, int to\0806n);
Xstatic void tcapscrollregion (int top, int bot);
X
X#if OPT_COLOR
Xstatic void tcapfcol ( int color );
Xstatic void tcapbcol ( int  color);
Xstatic void tcapspal ( const char *s );
X#endif
X
X#if OPT_VIDEO_ATTRS
Xstatic void tcapattr ( UINT attr );
X#else
Xstatic void tcaprev  ( UINT state );
X#endif
X
XTERM term = `7B
X`090,`09/* these four values are set dynamically at open time */
X`090,
X`090,
X`090,
X`09MARGIN,
X`09SCRSIZ,
X`09NPAUSE,
X`09tcapopen,
X`09tcapclose,
X`09tcapkopen,
X`09tcapkclose,
X`09ttgetc,
X`09ttputc,
X`09tttypahead,
X`09ttflush,
X`09tcapmove,
X`09tcapeeol,
X`09tcapeeop,
X`09tcapbeep,
X#if OPT_VIDEO_ATTRS
X`09tcapattr,
X#else
X`09tcaprev,
X#endif
X`09tcapcres,
X#if`09OPT_COLOR
X`09tcapfcol,
X`09tcapbcol,
X`09tcapspal,
X#else
X`09null_t_setfor,
X`09null_t_setback,
X`09null_t_setpal,
X#endif
X`09null_t_scroll,`09`09/* set dynamically at open time */
X`09null_t_pflush,
X`09null_t_icursor,
X`09null_t_title,
X`09null_t_watchfd,
X`09null_t_unwatchfd,
X`7D;
X
X#define`09XtermPos()`09((unsigned)(keystroke() - 040))
X
X#if OPT_XTERM >= 3
X# define XTERM_ENABLE_TRACKING   "`5C033`5B?1001h"`09/* mouse hilite tracking
V */
X# define XTERM_DISABLE_TRACKING  "`5C033`5B?1001l"
X#else
X# if OPT_XTERM >= 2
X#  define XTERM_ENABLE_TRACKING   "`5C033`5B?1000h"`09/* normal tracking mode
V */
X#  define XTERM_DISABLE_TRACKING  "`5C033`5B?1000l"
X# else
X#  define XTERM_ENABLE_TRACKING   "`5C033`5B?9h"`09/* X10 compatibility mode *
V/
X#  define XTERM_DISABLE_TRACKING  "`5C033`5B?9l"
X# endif
X#endif
X
Xstatic`09int`09i_am_xterm;
Xstatic`09int`09x_origin = 1,
X`09`09y_origin = 1;
X
X#if HAVE_TPARM`09/* usually terminfo */
X#define CALL_TPARM(cap,code) tparm(cap, code)
X#define FREE_TPARM(s) /* nothing */
X#else
X#if HAVE_TPARAM`09/* GNU termcap */
X#if DOALLOC
X#undef free
X#endif
X#define CALL_TPARM(cap,code) tparam(cap, (char *)0, 0, code)
X#define FREE_TPARM(s) free(s)
X#else
Xstatic char *my_tparm(\0F06cap GCC_UNUSED, int code\150B)
X`7B
X`09static char result`5B10`5D;
X`09sprintf(result, cap, code);
X`09return strcmp(result, cap) ? \0F06 : 0;
X`7D
X#define CALL_TPARM(cap,code) my_tparm(cap, code)
X#define FREE_TPARM(s) /* nothing */
X#endif
X#endif
X
Xstatic void
Xtcapopen(void)
X`7B
X#if USE_TERMCAP
X`09char tcbuf`5B2048`5D;
X`09char err_str`5B72`5D;
X`09char *t, *p;
X#endif
X`09char *tv_stype;
X`09SIZE_T i;
X`09int j;
X`09static int already_open = 0;
X
X`09static const struct `7B
X`09`09char *name;
X`09`09char **data;
X`09`7D tc_strings`5B`5D = `7B
X`09 `7B CAPNAME("AL","il"),    `26tc_AL `7D`09/* add p1 lines above cursor */
V
X`09,`7B CAPNAME("DL","dl"),    `26tc_DL `7D`09/* delete p1 lines, begin at cur
Vsor */
X`09,`7B CAPNAME("al","il1"),   `26tc_al `7D`09/* add line below cursor */
X`09,`7B CAPNAME("ce","el"),    `26tc_CE `7D`09/* clear to end of line */
X`09,`7B CAPNAME("cl","clear"), `26tc_CL `7D`09/* clear screen, cursor to home
V */
X`09,`7B CAPNAME("cm","cup"),   `26tc_CM `7D`09/* move cursor to row p1, col p2
V */
X`09,`7B CAPNAME("cs","csr"),   `26tc_CS `7D`09/* set scrolling to rows p1 .. p
V2 */
X`09,`7B CAPNAME("dl","dl1"),   `26tc_dl `7D`09/* delete line */
X`09,`7B CAPNAME("ke","rmkx"),  `26tc_KE `7D`09/* end keypad-mode */
X`09,`7B CAPNAME("ks","smkx"),  `26tc_KS `7D`09/* start keypad-mode */
X`09,`7B CAPNAME("se","rmso"),  `26tc_SE `7D`09/* end standout-mode */
X`09,`7B CAPNAME("sf","ind"),   `26tc_SF `7D`09/* scroll forward 1 line */
X`09,`7B CAPNAME("so","smso"),  `26tc_SO `7D`09/* start standout-mode */
X`09,`7B CAPNAME("sr","ri"),    `26tc_SR `7D`09/* scroll reverse 1 line */
X`09,`7B CAPNAME("te","rmcup"), `26tc_TE `7D`09/* end cursor-motion program */
V
X`09,`7B CAPNAME("ti","smcup"), `26tc_TI `7D`09/* initialize cursor-motion prog
Vram */
X#if`09OPT_COLOR
X`09,`7B CAPNAME("AF","setaf"), `26AF `7D`09`09/* set ANSI foreground-color */
V
X`09,`7B CAPNAME("AB","setab"), `26AB `7D`09`09/* set ANSI background-color */
V
X`09,`7B CAPNAME("Sf","setf"),  `26Sf `7D`09`09/* set foreground-color */
X`09,`7B CAPNAME("Sb","setb"),  `26Sb `7D`09`09/* set background-color */
X`09,`7B CAPNAME("op","op"), `26OrigColors `7D`09/* set to original color pair
V */
X`09,`7B CAPNAME("oc","oc"), `26OrigColors `7D`09/* set to original c\1C06*/
X#endif
X#if`09OPT_FLASH
X`09,`7B CAPNAME("vb","flash"), `26vb `7D`09`09/* visible bell */
X#endif
X#if`09OPT_VIDEO_ATTRS
X`09,`7B CAPNAME("me","sgr0"),  `26tc_ME `7D`09/* turn off all attributes */
X`09,`7B CAPNAME("md","bold"),  `26tc_MD `7D`09/* turn on bold attribute */
X`09,`7B CAPNAME("us","smul"),  `26tc_US `7D`09/* underline-start */
X`09,`7B CAPNAME("ue","rmul"),  `26tc_UE `7D`09/* underline-end */
X#endif
X`09`7D;
X
X`09if (already_open)
X`09`09return;
X
X`09if ((tv_stype = getenv("TERM")) == NULL)
X`09`7B
X`09`09puts("Environment variable TERM not defined!");
X`09`09ExitProgram(BADEXIT);
X`09`7D
X
X#if USE_TERMINFO
X`09setupterm(tv_stype, fileno(stdout), (int *)0);
X#else
X`09if ((tgetent(tcbuf, tv_stype)) != 1)
X`09`7B
X`09`09(void)lsprintf(err_str, "Unknown terminal type %s!", tv_stype);
X`09`09puts(err_str);
X`09`09ExitProgram(BADEXIT);
X`09`7D
X#endif
X
X`09/* Get screen size from system, or els\1507termcap.  */
X`09getscreensize(`26term.t_ncol, \0E09row);
X
X`09if ((term.t_nrow <= 1)
X`09 `26`26 (term.t_nrow = TGETNUM(CAPNAME("li","lines"))) < 0) `7B
X`09`09term.t_nrow = 24;
X`09`7D
X
X`09if ((term.t_ncol <= 1)
X`09 `26`26 (term.t_ncol = TGETNUM(CAPNAME("co","cols"))) < 0)`7B
X`09`09term.t_ncol = 80;
X`09`7D
X
X#if OPT_COLOR
X`09if ((j = TGETNUM(CAPNAME("Co","colors"))) > 0)
X`09`09set_ncolors(j);
X#endif
X
X`09/* are we probably an xterm?  */
X`09i_am_xterm = FALSE;
X`09if (!strncmp(tv_stype, "xterm", sizeof(\1007) - 1)
X`09 `7C`7C !strcmp(tv_stype, "rxvt")) `7B
X`09`09i_am_xterm = TRUE;
X`09`7D
X#if USE_TERMCAP
X`09else `7B
X`09`09p = tcbuf;
X`09`09while (*p `26`26 *p != ':') `7B
X`09`09`09if (*p == 'x'
X`09`09`09    `26`26 strncmp(p, "xterm", sizeof(\1007) - 1) == 0) `7B
X`09`09&0209i_am_xterm = TRUE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09p++;
X`09`09`7D
X`09`7D
X#endif
X`09if (i_am_xterm) `7B
X`09`09x_origin = 0;
X`09`09y_origin = 0;
X`09`7D
X
X`09term.t_mrow =  \0F07nrow;
X`09term.t_mcol =  \0F07ncol;
X
X#if USE_TERMCAP
X`09p = tcapbuf;
X#endif
X`09for (i = 0; i < TABLESIZE(tc_strings); i++) `7B
X`09`09/* allow aliases */
X`09`09if (NO_CAP(*(tc_strings`5Bi`5D.data)))
X`09`09    *(tc_strings`5Bi`5D.data) = TGETSTR\1E0Fname, `26p);
X`09`09/* simplify subsequence checks */
X`09`09if (NO_CAP(*(tc_strings`5Bi`5D.data)))
X`09`09    *(tc_strings`5Bi`5D.data) = 0;
X`09`7D
X
X#if USE_TERMCAP
X#  if HAVE_EXTERN_TCAP_PC
X`09t = TGETSTR("pc", `26p);
X`09if(t)
X`09`09PC = *t;
X#  endif
X#endif
X
X`09if (tc_SO != NULL)
X`09`09revexist = TRUE;
X
X`09if(tc_CL == NULL `7C`7C tc_CM\1108)
X`09`7B
X`09`09puts("Incomplete termcap entry`5Cn");
X`09`09ExitProgram(BADEXIT);
X`09`7D
X
X`09if (tc_CE == NULL) `09/* will we be able to use clear to EOL? */
X`09`09eolexist = FALSE;
X
X`09if (!tc_CS `7C`7C !tc_SR) `7B /* some xterm's termcap entry is missing entr
Vies */
X`09`09if (i_am_xterm) `7B
X`09`09`09if (!tc_CS) tc_CS = "`5C033`5B%i%d;%dr";
X`09`09`09if (!tc_SR) tc_SR = "`5C033M";
X`09`09`7D
X`09`7D
X
X`09if (tc_CS `26`26 tc_SR) `7B
X`09`09if (tc_SF == NULL) /* assume '`5Cn' scrolls forward */
X`09`09`09tc_SF = "`5Cn";
X`09`09term.t_scroll = tcap\0D06_reg;
X`09`7D else if ((tc_DL `26`26 tc_AL) `7C`7C (tc_dl\1407al)) `7B
X`09`09term.t_scroll = tcap\0D06_delins;
X`09`7D else `7B
X`09`09term.t_scroll = null_\1008;
X`09`7D
X#if`09OPT_COLOR
X`09/*
X`09 * If we've got one of the canonical strings for resetting to the
X`09 * default colors, we don't have to assume the screen is black/white.
X`09 */
X`09if (OrigColors != 0) `7B
X`09`09set_global_g_val(GVAL_FCOLOR, NO_COLOR); /* foreground color */
X`09`09set_global_g_val(GVAL_BCOLOR, NO_COLOR); /* background color */
X`09`7D
X
X`09/* clear with current bcolor */
X`09have_bce = TGETFLAG(CAPNAME("ut","bce")) > 0;
X
X#if`09OPT_VIDEO_ATTRS
X`09if (OrigColors == 0)
X`09`09OrigColors = tc_ME;
X#endif
X`09if (ncolors == 8 `26`26 AF != 0 &0226 AB != 0) `7B
X`09`09Sf = AF;
X`09`09Sb = AB;
X`09`09set_palette(ANSI\0D08);
X`09`7D else if (colors_are_really_ANSI()) `7B
X`09`09set_palette(ANSI\0D08);
X`09`7D else
X`09`09set_palette(UNKN\0D08);
X#endif
X#if OPT_VIDEO_ATTRS
X`09if (tc_US == 0 `26`26 tc_UE == 0) `7B`09/* if we don't have underline, do b
Vold */
X`09`09tc_US = tc_MD;
X`09`09tc_UE = tc_ME;
X`09`7D
X#endif
X
X#if SYS_OS2_EMX
X`09for (i = TABLESIZE(VIO_KeyMap); i--; ) `7B
X`09`09addtosysmap(VIO_KeyMap`5Bi`5D.seq, 2, \160Ecode);
X`09`7D
X#endif
X`09for (i = TABLESIZE(keyseqs); i--; ) `7B
X`09    char *seq = TGETSTR(keyseqs`5Bi`5D.capname, `26p);
X`09    if (!NO_CAP(seq)) `7B
X`09`09int len;
X#define DONT_MAP_DEL 1
X#if DONT_MAP_DEL
X`09`09/* NetBSD, FreeBSD, etc. have the kD (delete) function key
X`09`09    defined as the DEL char.  i don't like this hack, but
X`09`09    until we (and we may never) have separate system "map"
X`09`09    and "map!" maps, we can't allow this -- DEL has different
X`09`09    semantics in insert and command mode, whereas KEY_Delete
X`09`09    has the same semantics (whatever they may be) in both.
X`09`09    KEY_Delete is the only non-motion system map, by the
X`09`09    way -- so the rest are benign in insert or command
X`09`09    mode.  */
X`09`09if (strcmp(seq,"`5C177") == 0)
X`09`09    continue;
X#endif
X`09`09addtosysmap(seq, len = strlen(seq), keyseqs`5Bi`5D.code);
X`09`09/*
X`09`09 * Termcap represents nulls as octal 200, which is ambiguous
X`09`09 * (ugh).  To avoid losing escape sequences that may contain
X`09`09 * nulls, check here, and add a mapping for the strings with
X`09`09 * explicit nulls.
X`09`09 */
X#define TCAP_NULL '`5C200'
X`09`09if (strchr(seq, TCAP_NULL) != 0) `7B
X`09`09    char temp`5BBUFSIZ`5D;
X`09`09    (void)strcpy(temp, seq);
X`09`09    for (j = 0; j < len; j++)
X`09`09`09if (char2int(temp`5Bj`5D) == TCAP_NULL)
X`09`09`09    temp`5Bj`5D = '`5C0';
X`09`09    addtosysmap(temp, len, keyseqs`5Bi`5D.code);
X`09`09`7D
X`09    `7D
X`09`7D
X#if OPT_XTERM
X`09addtosysmap("`5C033`5BM", 3, KEY_Mouse);
X#if OPT_XTERM >= 3
X`09addtosysmap("`5C033`5Bt", 3, KEY_text);
X`09addtosysmap("`5C033`5BT", 3, KEY_textInvalid);
X#endif
X#endif
X
X#if USE_TERMCAP
X`09if (p >= `26tcapbuf`5BTCAPSLEN`5D)
X`09`7B
X`09`09puts("Terminal description too big!`5Cn");
X`09`09ExitProgram(BADEXIT);
X`09`7D
X#endif
X`09ttopen();
X`09already_open = TRUE;
X`7D
X
Xstatic void
Xtcapclose(void)
X`7B
X#if OPT_VIDEO_ATTRS
X`09if (tc_ME)`09/* end special attributes (including color) */
X`09`09putpad(tc_ME);
X#endif
X`09TTmove(term.t_nrow-1, 0);`09/* cf: dumbterm.c */
X`09TTeeol();
X#if OPT_COLOR
X`09shown_fcolor = \0F06b\0F07
X`09given_fcolor = \0F06b\0F08NO_COLOR;
X#endif
X`7D
X
X/*
X * We open or close the keyboard when either of the following are true:
X *`09a) we're changing the xterm-mouse setting
X *`09b) we're spawning a subprocess (e.g., shell or pipe command)
X */
Xstatic`09int`09keyboard_open = FALSE;
X
Xstatic void
Xtcapkopen(void)
X`7B
X#if OPT_XTERM
X`09if (i_am_xterm `26`26 global_g_val(GMDXTERM_MOUSE))
X`09`09putpad(XTERM_ENABLE_TRACKING);
X#endif
X`09if (!keyboard_open) `7B
X`09`09keyboard_open = TRUE;
X`09`09if (tc_TI) `7B
X`09`09`09putnpad(tc_TI, (int)strlen\1306));
X`09`09`09ttrow = ttcol = -1;`09/* 'ti' may move the cursor */
X`09`09`7D
X`09`09if (tc_KS)
X`09`09`09putpad(tc_KS);
X`09`7D
X`09(void)strcpy(sres, "NORMAL");
X`7D
X
Xstatic void
Xtcapkclose(void)
X`7B
X#if OPT_XTERM
X`09if (i_am_xterm `26`26 global_g_val(GMDXTERM_MOUSE))
X`09`09putpad(XTERM_DISABLE_TRACKING);
X#endif
X`09if (keyboard_open) `7B
X`09`09keyboard_open = FALSE;
X`09`09if (tc_TE)
X`09`09`09putnpad(tc_TE, (int)strlen\1306));
X`09`09if (tc_KE)
X`09`09`09putpad(tc_KE);
X`09`7D
X`09TTflush();
X`7D
X
Xstatic void
Xtcapmove(register int row, r\120Ccol)
X`7B
X`09putpad(tgoto(tc_CM, col, row));
X`7D
X
X#if`09OPT_COLOR
X/*
X * Accommodate brain-damaged non-bce terminals by writing a blank to each
X * space that we'll color, return true if we moved the cursor.
X */
Xstatic int
Xclear_non_bce(int row, int col)
X`7B
X`09int n;
X`09int last = (row >= term.t_nrow-1) ? (\1208col - 1) :\2509col;
X`09if (col < last) `7B
X`09`09for (n = col; n < last; n++)
X`09`09`09ttputc(' ');
X`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X
Xstatic void
Xerase_non_bce(int row, int col)
X`7B
X`09if (clear_non_bce(row, col))
X`09`09TTmove(row, col);
X`7D
X
X#define NEED_BCE_FIX (!have_bce `26`26 shown_bcolor != NO_COLOR)
X#define FILL_BCOLOR(row,col) if(NEED_BCE_FIX) erase_non_bce(row, col)
X#else
X#define FILL_BCOLOR(row,col) /*nothing*/
X#endif
X
Xstatic void
Xtcapeeol(void)
X`7B
X#if`09OPT_COLOR
X`09if (NEED_BCE_FIX) `7B
X`09`09erase_non_bce(ttrow, ttcol);
X`09`7D else
X#endif
X`09putpad(tc_CE);
X`7D
X
Xstatic void
Xtcapeeop(void)
X`7B
X#if`09OPT_COLOR
X`09tcapfcol(gfcolor);
X`09tcapbcol(gbcolor);
X
X`09if (NEED_BCE_FIX) `7B
X`09`09int row = ttrow;
X`09`09if (row < term.t_nrow-1) `7B
X`09`09`09while (++row < term.t_nrow) `7B
X`09`09&0209if (ttrow != row `7C`7C ttcol != 0)
X`09`09&0209`09TTmove(row, 0);
X`09`09&0209(void) clear_non_bce(row, 0);
X`09`09`09`7D
X`09`09`09TTmove(ttrow, ttcol);
X`09`09`7D
X`09`09erase_non_bce(ttrow, ttcol);
X`09`7D else
X#endif
X`09putpad(tc_CL);
X`7D
X
X/*ARGSUSED*/
Xstatic int
Xtcapcres(const char *res GCC_UNUSED)`09/* change screen resolution */
X`7B
X`09return(TRUE);
X`7D
X
X
X/* move howmany lines starting at from to to */
Xstatic void
Xtcapscroll_reg(int from, int to\0806n)
X`7B
X`09int i;
X`09if (to == from) return;
X`09if (to < from) `7B
X`09`09tcapscrollregion(to, from + n - 1);
X`09`09tcapmove(from + n - 1, 0);
X`09`09for (i = from - to; i > 0; i--) `7B
X`09`09`09putpad(tc_SF);
X`09`09`09FILL_BCOLOR(from + n - 1, 0);
X`09`09`7D
X`09`7D else `7B /* from < to */
X`09`09tcapscrollregion(from, to + n - 1);
X`09`09tcapmove(from, 0);
X`09`09for (i = to - from; i > 0; i--) `7B
X`09`09`09putpad(tc_SR);
X`09`09`09FILL_BCOLOR(from, 0);
X`09`09`7D
X`09`7D
X`09tcapscrollregion(0, term.t_nrow-1);
X`7D
X
X/*
XOPT_PRETTIER_SCROLL is prettier but slower -- it scrolls
X`09`09a line at a time instead of all at once.
X*/
X
X/* move howmany lines starting at from to to */
Xstatic void
Xtcapscroll_delins(int from, int to\0806n)
X`7B
X`09int i;
X`09if (to == from) return;
X`09if (tc_DL `26`26 tc_AL) `7B
X`09`09if (to < from) `7B
X`09`09`09tcapmove(to, 0);
X`09`09`09putpad(tgoto(tc_DL, 0, from-to));
X`09`09`09tcapmove(to+n, 0);
X`09`09`09putpad(tgoto(tc_AL, 0, from-to));
X`09`09`09FILL_BCOLOR(to+n, 0);
X`09`09`7D else `7B
X`09`09`09tcapmove(from+n, 0);
X`09`09`09putpad(tgoto(tc_DL, 0, to-from));
X`09`09`09tcapmove(from, 0);
X`09`09`09putpad(tgoto(tc_AL, 0, to-from));
X`09`09`09FILL_BCOLOR(from+n, 0);
X`09`09`7D
X`09`7D else `7B /* must be dl and al */
X#if OPT_PRETTIER_SCROLL
X`09`09if (absol(from-to) > 1) `7B
X`09`09`09tcapscroll_delins(from, (from<to) ? to-1:to+1, n);
X`09`09`09if (from < to)
X`09`09&0209from = to-1;
X`09`09`09else
X`09`09&0209from = to+1;
X`09`09`7D
X#endif
X`09`09if (to < from) `7B
X`09`09`09tcapmove(to, 0);
X`09`09`09for (i = from - to; i > 0; i--)
X`09`09&0209putpad(tc_dl);
X`09`09`09tcapmove(to+n, 0);
X`09`09`09for (i = from - to; i > 0; i--) `7B
X`09`09&0209putpad(tc_al);
X`09`09&0209FILL_BCOLOR(to + n, 0);
X`09`09`09`7D
X`09`09`7D else `7B
X`09`09`09tcapmove(from+n, 0);
X`09`09`09for (i = to - from; i > 0; i--)
X`09`09&0209putpad(tc_dl);
X`09`09`09tcapmove(from, 0);
X`09`09`09for (i = to - from; i > 0; i--) `7B
X`09`09&0209putpad(tc_al);
X`09`09&0209FILL_BCOLOR(from, 0);
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`7D
X
X/* cs is set up just like cm, so we use tgoto... */
Xstatic void
Xtcapscrollregion(int top, int bot)
X`7B
X`09putpad(tgoto(tc_CS, bot, top));
X`7D
X
X#if`09OPT_COLOR
X/*
X * This ugly hack is designed to work around an incompatibility built into
X * non BSD-derived systems that implemented color based on a SVr4 manpage.
X */
Xstatic int
Xcolors_are_really_ANSI (void)
X`7B
X`09int ok = FALSE;
X`09int n;
X`09char cmp`5BBUFSIZ`5D, *t;
X
X`09if (Sf != 0 `26`26 Sb\0B09ncolors == 8) `7B
X`09`09for (n = 0; n < ncolors; n++) `7B
X`09`09`09(void)lsprintf(cmp, "`5C033`5B4%dm", n);
X`09`09`09if ((t = CALL_TPARM(Sb, n)) == 0 `7C`7C strcmp(t, cmp))
X`09`09&0209break;
X`09`09`09FREE_TPARM(t);
X`09`09`09(void)lsprintf(cmp, "`5C033`5B3%dm", n);
X`09`09`09if ((t = CALL_TPARM(Sf, n)) == 0 `7C`7C strcmp(t, cmp))
X`09`09&0209break;
X`09`09`09FREE_TPARM(t);
X`09`09`7D
X`09`09if (n >= ncolors)`09/* everything matched */
X`09`09`09ok = TRUE;
X`09`7D
X`09return ok;
X`7D
X
Xstatic void
Xshow_ansi_colors (void)
X`7B
X`09char`09*t;
X
X`09if (shown_fcolor == NO_COLOR
X`09 `7C`7C shown_bcolor == NO_COLOR) `7B
X`09`09if (OrigColors)
X`09`09`09putpad(OrigColors);
X`09`7D
X
X`09if ((shown_fcolor != NO_COLOR)
X`09 `26`26 (t = CALL_TPARM(Sf, shown_fcolor)) != 0) `7B
X`09`09putpad(t);
X`09`09FREE_TPARM(t);
X`09`7D
X`09if ((shown_bcolor != NO_COLOR)
X`09 `26`26 (t = CALL_TPARM(Sb, shown_bcolor)) != 0) `7B
X`09`09putpad(t);
X`09`09FREE_TPARM(t);
X`09`7D
X`7D
X
Xstatic void
Xreinitialize_colors (void)
X`7B
X`09int`09saved_fcolor = given\0F07;
X`09int`09saved_bcolor = given\0F07;
X
X`09shown_fcolor = \0F06b\0F07
X`09given_fcolor = \0F06b\0F08NO_COLOR;
X
X`09tcapfcol(saved_fcolor);
X`09tcapbcol(saved_bcolor);
X`7D
X
Xstatic void
Xtcapfcol(int color)
X`7B
X`09if (color != given_fcolor) `7B
X`09`09given_fcolor = color;
X`09`09shown_fcolor = (Sf != 0) ? Num2Color(color) : NO_COLOR;
X`09`09show_ansi_colors();
X`09`7D
X`7D
X
Xstatic void
Xtcapbcol(int color)
X`7B
X`09if (color != given_bcolor) `7B
X`09`09given_bcolor = color;
X`09`09shown_bcolor = (Sb != 0) ? Num2Color(color) : NO_COLOR;
X`09`09show_ansi_colors();
X`09`7D
X`7D
X
Xstatic void
Xtcapspal(const char *thePalette)`09/* reset the palette registers */
X`7B
X`09set_ctrans(thePalette);
X`09reinitialize_colors();
X`7D
X#endif /* OPT_COLOR */
X
X#if OPT_VIDEO_ATTRS
X/*
X * NOTE:
X * On Linux console, the 'me' termcap setting `5CE`5Bm resets _all_ attributes
V,
X * including color.  However, if we use 'se' instead, it doesn't clear the
X * boldface.  To compensate, we reset the colors when we put out any "ending"
V
X * sequence, such as 'me'.
X *
X * In rxvt (2.12), setting _any_ attribute seems to clobber the color \3307s.
V
X */
Xstatic void
Xtcapattr(UINT attr)
X`7B
X`09static`09const`09struct`09`7B
X`09`09char`09**start;
X`09`09char`09**end;
X`09`09UINT`09mask;
X`09`7D tbl`5B`5D = `7B
X`09`09`7B `26tc_SO,\0806E, VASEL`7CVAREV `7D,
X`09`09`7B `26tc_US,\0806E, VAUL `7D,
X`09`09`7B `26tc_US,\0806E, VAITAL `7D,
X`09`09`7B `26tc_MD,\0806E, VABOLD `7D,
X`09`7D;
X`09static`09UINT last;
X
X`09attr = VATTRIB(attr);
X`09if (attr `26 VASPCOL) `7B
X`09`09attr = VCOLORATTR((attr `26 (NCOLORS - 1)));
X`09`7D else `7B
X`09`09attr `26= `7E(VAML`7CVAMLFOC);
X`09`7D
X
X`09if (attr != last) `7B
X`09`09register SIZE_T n;
X`09`09register char *s;
X`09`09UINT`09diff = attr `5E last;
X`09`09int`09ends = FALSE;
X
+-+-+-+-+-+-+-+-  END  OF PART 104 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 105 -+-+-+-+-+-+-+-+
X`09`09/* turn OFF old attributes */
X`09`09for (n = 0; n < TABLESIZE(tbl); n++) `7B
X`09`09`09if ((tbl`5Bn`5D.mask `26 diff) != 0
X`09`09`09 `26`26 (tbl`5Bn`5D.mask `26 attr) == 0
X`09`09`09 `26`26 (s = *(tbl`5Bn`5D.end))  != 0) `7B
X`09`09&0209putpad(s);
X#if OPT_COLOR
X`09`09&0209reinitialize_colors();
X#endif
X`09`09&0209ends = TRUE;
X`09`09&0209diff `26= `7E(tbl`5Bn`5D.mask);
X`09`09`09`7D
X`09`09`7D
X
X`09`09/* turn ON new attributes */
X`09`09for (n = 0; n < TABLESIZE(tbl); n++) `7B
X`09`09`09if ((tbl`5Bn`5D.mask `26 diff)  != 0
X`09`09`09 `26`26 (tbl`5Bn`5D.mask `26 attr)  != 0
X`09`09`09 `26`26 (s = *(tbl`5Bn`5D.start)) != 0) `7B
X`09`09&0209putpad(s);
X`09`09&0209diff `26= `7E(tbl`5Bn`5D.mask);
X`09`09`09`7D
X`09`09`7D
X
X`09`09if (tc_SO != 0 `26`26 tc_SE != 0) `7B
X`09`09`09if (ends `26`26 (attr `26 (VAREV`7CVASEL))) `7B
X`09`09&0209putpad(tc_SO);
X`09`09`09`7D else if (diff) `7B`09/* we didn't find it */
X`09`09&0209putpad(tc_SE);
X`09`09`09`7D
X`09`09`7D
X#if OPT_COLOR
X`09`09if (attr `26 VACOLOR)
X`09`09`09tcapfcol(VCOLORNUM(attr));
X`09`09else if (given_fcolor != g\0B06)
X`09`09`09tcapfcol(gfcolor);
X#endif
X`09`09last = attr;
X`09`7D
X`7D
X
X#else`09/* highlighting is a minimum attribute */
X
Xstatic void
Xtcaprev(`09`09/* change reverse video status */
XUINT state)`09`09/* FALSE = normal video, TRUE = reverse\1606 */
X`7B
X`09static int revstate = -1;
X`09if (state == revstate)
X`09`09return;
X`09revstate = state;
X`09if (state) `7B
X`09`09if (tc_SO != NULL)
X`09`09`09putpad(tc_SO);
X`09`7D else `7B
X`09`09if (tc_SE != NULL)
X`09`09`09putpad(tc_SE);
X`09`7D
X`7D
X
X#endif`09/* OPT_VIDEO_ATTRS */
X
Xstatic void
Xtcapbeep(void)
X`7B
X#if OPT_FLASH
X`09if (global_g_val(GMDFLASH)
X`09 `26`26 vb != NULL) `7B
X`09`09putpad(vb);
X`09`7D else
X#endif
X`09ttputc(BEL);
X`7D
X
Xstatic void
Xputpad(char *str)
X`7B
X`09tputs(str, 1, ttputc);
X`7D
X
Xstatic void
Xputnpad(char *str, int n)
X`7B
X`09tputs(str, n, ttputc);
X`7D
X
X
X
X#if OPT_XTERM
X/* Finish decoding a mouse-click in an xterm, after the ESC and '`5B' chars.
X *
X * There are 3 mutually-exclusive xterm mouse-modes (selected here by values o
Vf
X * OPT_XTERM):
X *`09(1) X10-compatibility (not used here)
X *`09`09Button-press events are received.
X *`09(2) normal-tracking
X *`09`09Button-press and b\1106release events are received.
X *`09`09Button-events have modifiers (e.g., shift, control, meta).
X *`09(3) hilite-tracking
X *`09`09Button-press and text-location events are received.
X *`09`09Button-events have modifiers (e.g., shift, control, meta).
X *`09`09Dragging with the mouse produces highlighting.
X *`09`09The text-locations are checked by xterm to ensure validity.
X *
X * NOTE:
X *`09The hilite-tracking code is here for testing and (later) use.  Because
X *`09we cannot guarantee that we always are decoding escape-sequences when
X *`09reading from the terminal, there is the potential for the xterm hanging
X *`09when a mouse-dragging operation is begun: it waits for us to specify
X *`09the screen locations that limit the highlighting.
X *
X * `09While highlighting, the xterm accepts other characters, but the display
V
X *`09does not appear to be refreshed until highlighting is ended. So (even
X *`09if we always capture the beginning of highlighting) we cannot simply
X *`09loop here waiting for the end of highlighting.
X *
X *`091993/aug/6 dickey@software.org
X */
X
Xstatic`09int`09xterm_button (int c);
X
X/*ARGSUSED*/
Xint
Xmouse_motion(int f GCC_UNUSED, int n\120B)
X`7B
X`09return xterm_button('M');
X`7D
X
X#if OPT_XTERM >= 3
X/*ARGSUSED*/
Xint
Xxterm_mouse_t(int f, int n)
X`7B
X`09return xterm_button('t');
X`7D
X
X/*ARGSUSED*/
Xint
Xxterm_mouse_T(int f, int n)
X`7B
X`09return xterm_button('T');
X`7D
X#endif`09/* OPT_XTERM >= 3 */
X
Xstatic int
Xxterm_button(int c)
X`7B
X`09WINDOW`09*wp;
X`09int`09event;
X`09int`09button;
X`09int`09x;
X`09int`09y;
X`09int`09status;
X#if OPT_XTERM >= 3
X`09int`09save_row = ttrow;
X`09int`09save_col = ttcol;
X`09int`09firstrow, lastrow;
X`09int`09startx, endx, mousex;
X`09int`09starty, endy, mousey;
X`09MARK`09save_dot;
X`09char`09temp`5BNSTRING`5D;
X`09static`09const`09char`09*fmt = "`5C033`5B%d;%d;\0606%dT";
X#endif`09/* OPT_XTERM >= 3 */
X
X`09if ((status = (global_g_val(GMDXTERM_MOUSE))) != 0) `7B
X`09`09beginDisplay();
X`09`09switch(c) `7B
X`09`09case 'M':`09/* button-event */
X`09`09`09event`09= keystroke();
X`09`09`09x`09= XtermPos() + x_origin;
X`09`09`09y`09= XtermPos() + y_origin;
X
X`09`09`09button`09= (event `26 3) + 1;
X`09`09`09TRACE(("M-button event:%d x:%d y:%d`5Cn",\1706, x, y))
X`09`09`09if (button > 3) `7B
X`09`09&0209endofDisplay();
X`09`09&0209return TRUE; /* button up */
X`09`09`09`7D
X`09`09`09wp = row2window(y-1);
X`09`09`09if (insertmode `26`26 wp != curwp) `7B
X`09`09&0209kbd_alarm();
X`09`09&0209return ABORT;
X`09`09`09`7D
X#if OPT_XTERM >= 3
X`09`09`09/* Tell the xterm how to highlight the selection.
X`09`09`09 * It won't do anything else until we do this.
X`09`09`09 */
X`09`09`09if (wp != 0) `7B
X`09`09&0209firstrow = wp->w_toprow + 1;
X`09`09&0209lastrow  = mode_row(wp) + 1;
X`09`09`09`7D else `7B&0209/* from message-line */
X`09`09&0209firstrow = term.t_nrow ;
X`09`09&0209lastrow  = term.t_nrow + 1;
X`09`09`09`7D
X`09`09`09if (y >= lastrow)`09/* don't select modeline */
X`09`09&0209y = lastrow - 1;
X`09`09`09(void)lsprintf(temp, fmt, 1, x, y, firstrow, lastrow);
X`09`09`09putpad(temp);
X`09`09`09TTflush();
X#endif`09/* OPT_XTERM >= 3 */
X`09`09`09/* Set the dot-location if button 1 was pressed in a
X`09`09`09 * window.
X`09`09`09 */
X`09`09`09if (wp != 0
X`09`09`09 `26`26 button == 1
X`09`09`09 `26`26 !reading_msg_line
X`09`09`09 `26`26 setcursor(y-1, x-1)) `7B
X`09`09&0209/*mlerase();*/
X`09`09&0209(void)update(TRUE);
X`09`09&0209status = TRUE;
X`09`09`09`7D else if (button <= 3) `7B
X#if OPT_XTERM >= 3
X`09`09&0209/* abort the selection */
X`09`09&0209(void)lsprintf(temp, fmt, 0, x, y, firstrow, lastrow);
X`09`09&0209putpad(temp);
X`09`09&0209TTflush();
X#endif`09/* OPT_XTERM >= 3 */
X`09`09&0209status = ABORT;
X`09`09`09`7D else `7B
X`09`09&0209status = FALSE;
X`09`09`09`7D
X`09`09`09break;
X#if OPT_XTERM >= 3
X`09`09case 't':`09/* reports valid text-location */
X`09`09`09x = XtermPos();
X`09`09`09y = XtermPos();
X
X`09`09`09TRACE(("t: x:%d y:%d`5Cn", x, y))
X`09`09`09setwmark(y-1, x-1);
X`09`09`09yankregion();
X
X`09`09`09movecursor(save_row, save_col);
X`09`09`09/*mlerase();*/
X`09`09`09(void)update(TRUE);
X`09`09`09break;
X`09`09case 'T':`09/* reports invalid text-location */
X`09`09`09/*
X`09`09`09 * The starting-location returned is not the \1D08
X`09`09`09 * at which the mouse was pressed.  Instead, it is the
X`09`09`09 * top-most location of the selection.  In turn, the
X`09`09`09 * ending-location is the bottom-most \1C09of the
X`09`09`09 * selection.  The mouse-up location is not necessarily
X`09`09`09 * a pointer to valid text.
X`09`09`09 *
X`09`09`09 * This case handles multi-clicking events as well as
X`09`09`09 * selections whose start or end location was not
X`09`09`09 * pointing to text.
X`09`09`09 */
X`09`09`09save_dot = DOT;
X`09`09`09startx = XtermPos();`09/* starting-location */
X`09`09`09starty = XtermPos();
X`09`09`09endx   = XtermPos();`09/* ending-location */
X`09`09`09endy   = XtermPos();
X`09`09`09mousex = XtermPos();`09/* location at mouse-up */
X`09`09`09mousey = XtermPos();
X
X`09`09`09TRACE(("T: start(%d,%d) end\0B08mouse\1807`5Cn",
X`09`09&0209starty, startx,
X`09`09&0209endy,   endx,
X`09`09&0209mousey, mousex))
X`09`09`09setcursor(starty - 1, startx - 1);
X`09`09`09setwmark (endy   - 1, endx\0C06);
X`09`09`09if (MK.o != 0 `26`26 !is_at_end_of_line(MK))
X`09`09&0209MK.o += 1;
X`09`09`09yankregion();
X
X`09`09`09DOT = save_dot;
X`09`09`09movecursor(save_row, save_col);
X`09`09`09/*mlerase();*/
X`09`09`09(void)update(TRUE);
X`09`09`09break;
X#endif /* OPT_XTERM >= 3 */
X`09`09default:
X`09`09`09status = FALSE;
X`09`09`7D
X`09`09endofDisplay();
X`09`7D
X`09return status;
X`7D
X#endif`09/* OPT_XTERM */
X
X#endif`09/* DISP_TERMCAP */
$ call unpack [.VILE-8_0]TCAP.C;1 -
 419812088 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 61 113 152
$!
$ create 'f'
X/*
X * Configurable headers used by termcap/terminfo driver for vile.
X *
X * $Header: /usr/build/vile/vile/RCS/tcap.h,v 1.4 1998/02/23 11:27:56 tom Exp
V $
X */
X
X#ifndef VILE_TCAP_H
X#define VILE_TCAP_H 1
X
X#ifdef __cplusplus
Xextern "C" `7B
X#endif
X
X#undef TRUE
X#undef FALSE
X#undef WINDOW`09`09/* avoid conflict with <curses.h> or <term.h> */
X
X#if NEED_CURSES_H
X#  if HAVE_NCURSES_H
X#    include <ncurses.h>
X#  else
X#    include <curses.h>
X#  endif
X#endif
X
X#if HAVE_TERM_H
X#  include <term.h>
X#endif
X#if NEED_TERMCAP_H
X#  include <termcap.h>
X#endif
X
X#ifndef TRUE
X#  define TRUE 1
X#endif
X#ifndef FALSE
X#  define FALSE 0
X#endif
X
X#if USE_TERMINFO
X#  define TGETSTR(name, bufp) tigetstr(name)
X#  define TGETNUM(name)       tigetnum\1507/* may be tigetint() */
X#  define TGETFLAG(name)      tigetflag\1506
X#  define CAPNAME(a,b)        b
X#  define NO_CAP(s)           (s == 0 `7C`7C s == (char *)-1)
X#  if !HAVE_TIGETNUM `26`26 \110AINT
X#    define tigetnum\0906int
X#  endif
X#else /* USE_TERMCAP */
X#  undef USE_TERMCAP
X#  define USE_TERMCAP 1
X#  define TGETSTR(name, bufp) tgetstr\140C
X#  define TGETNUM(name)       tgetnum\1406
X#  define TGETFLAG(name)      tgetflag\1406
X#  define CAPNAME(a,b)        a
X#  define NO_CAP(s)           (s == 0)
X#endif /* USE_TERMINFO */
X
X#if HAVE_EXTERN_TCAP_PC
Xextern char PC;`09`09`09/* used in 'tputs()' */
X#endif
X
X#if MISSING_EXTERN_TGETENT
Xextern`09int`09tgetent (char *buffer, \0E06termtype);
X#endif
X#if MISSING_EXTERN_TGETFLAG `7C`7C\1B11I\1C07
Xextern`09int`09TGETFLAG (char *name);
X#endif
X#if MISSING_EXTERN_TGETNUM `7C`7C\1A11I\1B06
Xextern`09int`09TGETNUM (char *name);
X#endif
X#if MISSING_EXTERN_TGETSTR `7C`7C\1A11I\1B06
Xextern`09char *`09TGETSTR(const \1506name,\0C07*area);
X#endif
X#if MISSING_EXTERN_TGOTO
Xextern`09char *`09tgoto (const \1406cstring, int hpos\0A06vpos);
X#endif
X#if MISSING_EXTERN_TPARAM
Xextern`09char *`09tparam (\0F06cstring, \1E06buf, int size, ...);
X#endif
X#if MISSING_EXTERN_TPARM
Xextern`09char *`09tparm (const \1406fmt, ...);
X#endif
X#if MISSING_EXTERN_TPUTS
Xextern`09int`09tputs (char *string, int nlines, OUTC_DCL (*_f)(OUTC_ARGS) );
X#endif
X
X#ifdef __cplusplus
X`7D
X#endif
X
X#endif /* VILE_TCAP_H */
$ call unpack [.VILE-8_0]TCAP.H;1 -
 1077174496 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 5 114 152
$!
$ create 'f'
X/*
X * The functions in this file negotiate with the operating system for
X * characters, and write\160B in a barely buffered fashion on the display.
X * All operating systems.
X *
X * $Header: /usr/build/vile/vile/RCS/termio.c,v 1.155 1998/05/14 23:17:20 tom
V Exp $
X *
X */
X#include`09"estruct.h"
X#include`09"edef.h"
X#include`09"nefunc.h"
X
X#if CC_DJGPP
X# include <pc.h>   /* for kbhit() */
X#endif
X
X#if SYS_VMS
X#include <starlet.h>
X#include <lib$routines.h>
X#endif
X
X#if SYS_UNIX
X
Xstatic void ttmiscinit (void);
X
X/* there are three copies of the tt...() routines here -- one each for
X`09POSIX termios, traditional\1507, and sgtty.  If you have a
X`09choice, I recommend them in that order. */
X
X/* ttopen() and ttclose() are responsible for putting the terminal in raw
X`09mode, setting up terminal signals, etc.
X   ttclean() prepares the terminal for shell escapes, and ttun\3908gets
X`09us back into vile's mode
X*/
X
X/* I suppose this config stuff should move to estruct.h */
X
X#if HAVE_TERMIOS_H `26`26\1207CGETATTR
X/* Note: <termios.h> is available on some systems, but in order to use it
X * a special library needs to be linked in.  This is the case on the NeXT
X * where libposix.a needs to be linked in.  Unfortunately\310Cis buggy.
X * So we have the configuration script test to make sure that tcgetattr is
X * available through the standard set of libraries in order to help us
X * determine whether or not to use <termios.h>.
X */
X# define USE_POSIX_TERMIOS 1
X# define USE_FCNTL 1
X#else
X# if HAVE_TERMIO_H
X#  define USE_TERMIO 1
X#  define USE_FCNTL 1
X# else
X#  if HAVE_SGTTY_H
X#   define USE_SGTTY 1
X#   define USE_FIONREAD 1
X#  else
X huh?
X#  endif
X# endif
X#endif
X
X/* FIXME: There used to be code here which dealt with OSF1 not working right
X * with termios.  We will have to determine if this is still the case and
X * add code here to deal with it if so.
X */
X
X#if !defined(FIONREAD)
X/* try harder to get it */
X# if HAVE_SYS_FILIO_H
X#  include "sys/filio.h"
X# else /* if you have trouble including ioctl.h, try "sys/\1207" instead */
X#  if HAVE_IOCTL_H
X#   include <ioctl.h>
X#  else
X#   if HAVE_SYS_IOCTL_H
X#    include <sys/ioctl.h>
X#   endif
X#  endif
X# endif
X#endif
X
X#if DISP_X11`09/* don't use either one */
X# undef USE_FCNTL
X# undef USE_FIONREAD
X#else
X# if defined(FIONREAD)
X  /* there seems to be a bug in someone's implementation of fcntl -- it
X   * causes output to be flushed if you change to ndelay input while \3906
X   * is pending.  for these systems, we use FIONREAD instead, if possible.
X   * In fact, if try and use FIONREAD in any case if present.  If you have
X   * the problem with fcntl, you'll notice that the screen doesn't always
X   * refresh correctly, as if the fcntl is interfering with the output drain
X   */
X#  undef USE_FCNTL
X#  define USE_FIONREAD 1
X# endif
X#endif
X
X#if USE_FCNTL
X/* this is used to determine whether input is pending from the user */
X#include`09<fcntl.h>
Xint kbd_flags;`09`09`09/* saved keyboard fcntl flags`09*/
Xint kbd_is_polled;`09`09/* in O_NDELAY mode?&0209*/
Xint kbd_char_present;`09`09/* there is a char in\2909`09*/
Xchar kbd_char;`09`09`09/* the char we've already read`09*/
X#endif
X
X#define SMALL_STDOUT 1
X
X#if defined(SMALL_STDOUT) `26`26 (\1A07 (USE_FCNTL) `7C`7C\3109USE_FIONREAD))
V
X#define TBUFSIZ 128 /* Provide a smaller terminal output buffer so that
X`09   the type-ahead detection works better (more often).
X`09   That is, we overlap screen writing with more keyboard polling */
X#else
X#define TBUFSIZ 1024`09/* reduces the number of writes */
X#endif
X
X#if USE_POSIX_TERMIOS
X
X#include <termios.h>
X
X#if NEED_PTEM_H
X/* they neglected to define struct winsize in termios.h -- it's only
X   in termio.h`09*/
X#include`09<sys/stream.h>
X#include`09<sys/ptem.h>
X#endif
X
X#ifndef VDISABLE
X# ifdef`09_POSIX_VDISABLE
X#  define VDISABLE _POSIX_\1008
X# else
X#  define VDISABLE '`5C0'
X# endif
X#endif
X
Xstruct termios o\0907, n\1307;
X
Xchar tobuf`5BTBUFSIZ`5D;`09`09/* terminal output buffer */
X
Xvoid
Xttopen(void)
X`7B
X`09int s;
X`09s = tcgetattr(0, `26otermios);
X`09if (s < 0) `7B
X`09`09perror("ttopen tcgetattr");
X`09`09ExitProgram(BADEXIT);
X`09`7D
X#if !DISP_X11
X#if HAVE_SETVBUF
X# if SETVBUF_REVERSED
X`09setvbuf(stdout, _IOFBF, tobuf, TBUFSIZ);
X# else
X`09setvbuf(stdout, tobuf, _IOFBF, TBUFSIZ);
X# endif
X#else /* !HAVE_SETVBUF */
X`09setbuffer(stdout, tobuf, TBUFSIZ);
X#endif /* !HAVE_SETVBUF */
X#endif /* !DISP_X11 */
X
X`09suspc =   otermios.c_cc`5BVSUSP`5D;
X`09intrc =   otermios.c_cc`5BVINTR`5D;
X`09killc =   otermios.c_cc`5BVKILL`5D;
X`09startc =  otermios.c_cc`5BVSTART`5D;
X`09stopc =   otermios.c_cc`5BVSTOP`5D;
X`09backspc = otermios.c_cc`5BVERASE`5D;
X#ifdef VWERASE`09/* Sun has it.`09any others? */
X`09wkillc = otermios.c_cc`5BVWERASE`5D;
X#else
X`09wkillc =  tocntrl('W');
X#endif
X
X`09/* this could probably be done more POSIX'ish? */
X#if OPT_SHELL `26`26 defined(SIGTSTP)\140FCONT)
X`09setup_handler(SIGTSTP,SIG_DFL); `09/* set signals so that we can */
X`09setup_handler(SIGCONT,rtfrmshell);`09/* suspend `26 restart */
X#endif
X#ifdef SIGTTOU
X`09setup_handler(SIGTTOU,SIG_IGN); `09/* ignore output prevention */
X#endif
X
X#if USE_FCNTL
X`09kbd_flags = fcntl( 0, F_GETFL, 0 );
X`09kbd_is_polled = FALSE;
X#endif
X
X#if ! DISP_X11
X`09ntermios = o\0B07;
X
X`09/* new input settings: turn off crnl mapping, cr-ignoring,
X`09 * case-conversion, and allow BREAK
X`09 */
X`09ntermios.c_iflag = BRKINT `7C (o\1D10`26
X`09`09(unsigned long) `7E(INLCR `7C IGN\0806CRNL
X#ifdef IUCLC
X`09`09&0209`09`7C IUCLC
X#endif
X`09`09&0209 ));
X
X`09ntermios.c_oflag = 0;
X`09ntermios.c_lflag = ISIG;
X`09ntermios.c_cc`5BVMIN`5D = 1;
X`09ntermios.c_cc`5BVTIME`5D = 0;
X#ifdef`09VSWTCH
X`09ntermios.c_cc`5BVSWTCH`5D = VDISABLE;
X#endif
X`09ntermios.c_cc`5BVSUSP`5D  = VDISABLE;
X#if defined (VDSUSP) `26`26\1408(NCCS) &0226 \1C06 < NCCS
X`09ntermios.c_cc`5BVDSUSP`5D  = VDISABLE;
X#endif
X`09ntermios.c_cc`5BVSTART`5D = VDISABLE;
X`09ntermios.c_cc`5BVSTOP`5D  = VDISABLE;
X#endif /* ! DISP_X11 */
X
X`09ttmiscinit();
X
X`09ttunclean();
X`7D
X
X/* we disable the flow control chars so we can use `5ES as a command, but
X  some folks still need it.  they can put "flow-control-enable" in their
X  .vilerc
X  no argument:`09re-enable `5ES/`5EQ processing in the driver
X  with arg:`09disable it
X*/
X/* ARGSUSED */
Xint
Xflow_control_enable(int f, int n GCC_UNUSED)
X`7B
X#if !DISP_X11
X`09if (!f) `7B
X`09`09ntermios.c_cc`5BVSTART`5D = (char)startc;
X`09`09ntermios.c_cc`5BVSTOP`5D  = (char)stopc;
X`09`7D else `7B
X`09`09ntermios.c_cc`5BVSTART`5D = VDISABLE;
X`09`09ntermios.c_cc`5BVSTOP`5D  = VDISABLE;
X`09`7D
X`09ttunclean();
X#endif
X`09return TRUE;
X`7D
X
Xvoid
Xttclose(void)
X`7B
X`09ttclean(TRUE);
X`7D
X
X/*
X * Clean up in anticipation for a return to the
X * operating system. Move down to the last line and advance, to make room
X * for the system prompt. Shut down the channel to the
X * terminal.
X */
X/*ARGSUSED*/
Xvoid
Xttclean(int f)
X`7B
X#if !DISP_X11
X`09if (f)
X`09`09kbd_openup();
X
X`09(void)fflush(stdout);
X`09tcdrain(1);
X`09tcsetattr(0, TCSADRAIN, `26otermios);
X`09TTflush();
X`09TTclose();
X`09TTkclose();
X#if USE_FCNTL
X`09fcntl(0, F_SETFL, kbd_flags);
X`09kbd_is_polled = FALSE;
X#endif
X#endif
X`7D
X
Xvoid
Xttunclean(void)
X`7B
X#if ! DISP_X11
X`09tcdrain(1);
X`09tcsetattr(0, TCSADRAIN, `26ntermios);
X#endif
X`7D
X
X
X#endif /* USE_POSIX_TERMIOS */
X
X#if USE_TERMIO
X
X#include`09<termio.h>
X
X/* original terminal characteristics and\1411to use inside */
Xstruct`09termio`09o\0806, n\1106;
X
X#ifdef AVAILABLE  /* setbuffer() isn't on most termio systems */
Xchar tobuf`5BTBUFSIZ`5D;`09`09/* terminal output buffer */
X#endif
X
Xvoid
Xttopen(void)
X`7B
X
X`09ioctl(0, TCGETA, (char *)`26otermio);`09/* save old settings */
X#if defined(AVAILABLE) `26`26 !DISP_X11
X`09setbuffer(stdout, tobuf, TBUFSIZ);
X#endif
X
X`09intrc =   otermio.c_cc`5BVINTR`5D;
X`09killc =   otermio.c_cc`5BVKILL`5D;
X`09startc =  tocntrl('Q');
X`09stopc =   tocntrl('S');
X`09backspc = otermio.c_cc`5BVERASE`5D;
X`09wkillc =  tocntrl('W');
X
X#if USE_FCNTL
X`09kbd_flags = fcntl( 0, F_GETFL, 0 );
X`09kbd_is_polled = FALSE;
X#endif
X
X#if SIGTSTP
X/* be careful here -- VSUSP is sometimes out of the range \0D07c_cc array */
X#ifdef V_SUSP
X`09ntermio.c_cc`5BV_SUSP`5D = -1;
X`09suspc = otermio.c_cc`5BV_SUSP`5D;
X#else
X`09suspc = -1;
X#endif
X#ifdef V_DSUSP
X`09ntermio.c_cc`5BV_DSUSP`5D = -1;
X#endif
X
X#if OPT_SHELL
X`09setup_handler(SIGTSTP,SIG_DFL); `09/* set signals so that we can */
X`09setup_handler(SIGCONT,rtfrmshell);`09/* suspend `26 restart */
X#endif
X`09setup_handler(SIGTTOU,SIG_IGN); `09/* ignore output prevention */
X
X#else /* no SIGTSTP */
X`09suspc =   tocntrl('Z');
X#endif
X
X#if ! DISP_X11
X`09ntermio = o\0A06;
X
X`09/* setup new settings, allow BREAK */
X`09ntermio.c_iflag = BRKINT;
X`09ntermio.c_oflag = 0;
X`09ntermio.c_lflag = ISIG;
X`09ntermio.c_cc`5BVMIN`5D = 1;
X`09ntermio.c_cc`5BVTIME`5D = 0;
X#ifdef`09VSWTCH
X`09ntermio.c_cc`5BVSWTCH`5D = -1;
X#endif
X#endif
X
X`09ttmiscinit();
X`09ttunclean();
X
X`7D
X
X/* we disable the flow control chars so we can use `5ES as a command, but
X  some folks still need it.  they can put "flow-control-enable" in their
X  .vilerc */
X/* ARGSUSED */
Xint
Xflow_control_enable(int f, int n)
X`7B
X#if !DISP_X11
X`09ntermio.c_iflag `26= `7E(IXON`7CIXANY`7CIXOFF);
X`09if (!f)
X`09`09ntermio.c_iflag `7C= o\130F`26 (IXON`7CIXANY`7CIXOFF);
X`09ttunclean();
X#endif
X`09return TRUE;
X`7D
X
Xvoid
Xttclose(void)
X`7B
X`09ttclean(TRUE);
X`7D
X
Xvoid
Xttclean(int f)
X`7B
X#if ! DISP_X11
X`09if (f)
X`09`09kbd_openup();
X
X`09(void)fflush(stdout);
X`09TTflush();
X`09TTclose();
X`09TTkclose();`09/* xterm */
X`09ioctl(0, TCSETAF, (char *)`26otermio);
X#if USE_FCNTL
X`09fcntl(0, F_SETFL, kbd_flags);
X`09kbd_is_polled = FALSE;
X#endif
X#endif`09/* DISP_X11 */
X`7D
X
Xvoid
Xttunclean(void)
X`7B
X#if ! DISP_X11
X`09ioctl(0, TCSETAW, (char *)`26ntermio);
X#endif
X`7D
X
X#endif /* USE_TERMIO */
X
X#if USE_SGTTY
X
X#if USE_FIONREAD
Xchar tobuf`5BTBUFSIZ`5D;`09`09/* terminal output buffer */
X#endif
X
X#undef`09CTRL
X#include`09<sgtty.h>`09 /* for stty/gtty functions */
Xstruct`09sgttyb`09ostate; `09 /* saved tty state */
Xstruct`09sgttyb`09nstate; `09 /* values for editor mode */
Xstruct`09sgttyb`09rnstate;`09  /* values for raw editor mode */
Xint olstate;`09`09/* Saved local mode values */
Xint nlstate;`09`09/* new local mode values */
Xstruct ltchars`09o\0907;`09/* Saved terminal special character set */
Xstruct ltchars`09n\0907 = `7B -1, -1,\0808\1007 `7D; /* a lot of nothing */
Xstruct tchars`09o\0806;`09/* Saved terminal special character set */
Xstruct tchars`09n\0806; /*  = `7B -1, -1,\0808\1007 `7D; */
X
Xvoid
Xttopen(void)
X`7B
X`09ioctl(0,TIOCGETP,(char *)`26ostate); /* save old state */
X`09killc = ostate.sg_kill;
X`09backspc = ostate.sg_erase;
X
X#if ! DISP_X11
X`09nstate = ostate;
X`09nstate.sg_flags `7C= CBREAK;
X`09nstate.sg_flags `26= `7E(ECHO`7CCRMOD);`09/* no echo for now... */
X`09ioctl(0,TIOCSETN,(char *)`26nstate); /* set new state */
X#endif
X
X`09rnstate = \0906;
X`09rnstate.sg_flags `26= `7ECBREAK;
X`09rnstate.sg_flags `7C= RAW;
X
X`09ioctl(0, TIOCGETC, (char *)`26otchars);`09/* Save old characters */
X`09intrc =  otchars.t_intrc;
X`09startc = otchars.t_\1306;
X`09stopc =  otchars.t_stopc;
X
X#if ! DISP_X11
X`09ntchars = o\0A06;
X`09ntchars.t_brkc = -1;
X`09ntchars.t_eofc = -1;
X`09ntchars.t_startc = -1;
X`09ntchars.t_stopc = -1;
X`09ioctl(0, TIOCSETC, (char *)`26ntchars);`09/* Place new character into K */
V
X#endif
X
X`09ioctl(0, TIOCGLTC, (char *)`26oltchars);`09/* Save old characters */
X`09wkillc = oltchars.t_werasc;
X`09suspc = oltchars.t_suspc;
X#if ! DISP_X11
X`09ioctl(0, TIOCSLTC, (char *)`26nltchars);`09/* Place new character into K */
V
X#endif
X
X#ifdef`09TIOCLGET
X`09ioctl(0, TIOCLGET, (char *)`26olstate);
X#if ! DISP_X11
X`09nlstate = o\0A06;
X`09nlstate `7C= LLITOUT;
X`09ioctl(0, TIOCLSET, (char *)`26nlstate);
X#endif
X#endif
X#if USE_FIONREAD
X`09setbuffer(stdout, tobuf, TBUFSIZ);
X#endif
X#if ! DISP_X11
X
X#if OPT_SHELL
X`09setup_handler(SIGTSTP,SIG_DFL); `09/* set signals so that we can */
X`09setup_handler(SIGCONT,rtfrmshell);`09/* suspend `26 restart */
X#endif
X`09setup_handler(SIGTTOU,SIG_IGN); `09/* ignore output prevention */
X
X#endif
X
X`09ttmiscinit();
X`7D
X
X/* we disable the flow control chars so we can use `5ES as a command, but
X  some folks still need it.  they can put "flow-control-enable" in their
X  .vilerc */
X/* ARGSUSED */
Xint
Xflow_control_enable(int f, int n)
X`7B
X#if !DISP_X11
X`09if (!f) `7B
X`09`09ntchars.t_startc = \0906;
X`09`09ntchars.t_stopc = stopc;
X`09`7D else `7B
X`09`09ntchars.t_startc = -1;
X`09`09ntchars.t_stopc = -1;
X`09`7D
X`09ttunclean();
X#endif
X`09return TRUE;
X`7D
X
Xvoid
Xttclose(void)
X`7B
X`09ttclean(TRUE);
X`7D
X
Xvoid
Xttclean(int f)
X`7B
X#if ! DISP_X11
X`09if (f)
X`09`09kbd_openup();
X
X`09TTflush();
X`09TTclose();
X`09TTkclose();`09/* xterm */
X`09ioctl(0, TIOCSETN, (char *)`26ostate);
X`09ioctl(0, TIOCSETC, (char *)`26otchars);
X`09ioctl(0, TIOCSLTC, (char *)`26oltchars);
X#ifdef`09TIOCLSET
X`09ioctl(0, TIOCLSET, (char *)`26olstate);
X#endif
X#if SYS_APOLLO
X`09TTflush();
X#endif
X#endif
X`7D
X
Xvoid
Xttunclean(void)
X`7B
X#if ! DISP_X11
X#if SYS_APOLLO
X`09int literal = LLITOUT;
X
X`09(void)fflush(stdout);
X`09ioctl(0, TIOCLSET, (caddr_t)`26olstate);
X`09ioctl(0, TIOCSETP, (caddr_t)`26nstate);`09/* setting nlstate changes sb_fla
Vgs */
X`09TTflush();
X`09ioctl(0, TIOCLBIS, (caddr_t)`26literal);`09/* set this before nltchars! */
V
X`09ioctl(0, TIOCSETC, (caddr_t)`26ntchars);
X`09ioctl(0, TIOCSLTC, (caddr_t)`26nltchars);
X
X#else
X
X`09ioctl(0, TIOCSETN, (char *)`26nstate);
X`09ioctl(0, TIOCSETC, (char *)`26ntchars);
X`09ioctl(0, TIOCSLTC, (char *)`26nltchars);
X#ifdef`09TIOCLSET
X`09ioctl(0, TIOCLSET, (char *)`26nlstate);
X#endif
X
X#endif`09/* SYS_APOLLO */
X#endif`09/* !DISP_X11 */
X`7D
X
X#endif /* USE_SGTTY */
X
X#if !DISP_X11
XOUTC_DCL
Xttputc(OUTC_ARGS)
X`7B
X`09OUTC_RET putchar((char)c);
X`7D
X
Xvoid
Xttflush(void)
X`7B
X`09(void)fflush(stdout);
X`7D
X
X/*
X * Read a character from the terminal, performing no editing and do\1508cho
X * at all.
X */
Xint
Xttgetc(void)
X`7B
X#if`09USE_FCNTL
X`09int n;
X`09if( kbd_char_present ) `7B
X`09`09kbd_char_present = FALSE;
X`09`7D else `7B
X`09`09if( kbd_is_polled `26`26 fcntl( 0, F_SETFL, kbd_flags ) < 0 )
X`09`09`09imdying(SIGINT);
X`09`09kbd_is_polled = FALSE;
X`09`09n = read(0, `26kbd_char, 1);
X`09`09if (n <= 0) `7B
X`09`09`09if (n < 0 `26`26 errno == EINTR)
X`09`09&0209return -1;
X`09`09`09imdying(SIGINT);
X`09`09`7D
X`09`7D
X`09return ( kbd_char );
X#else /* USE_FCNTL */
X#if SYS_APOLLO
X`09/*
X`09 * If we try to read a `5EC in cooked mode it will echo anyway.  Also,
X`09 * the 'getchar()' won't be interruptable.  Setting raw-mode
X`09 * temporarily here still allows the program to be interrupted when we
X`09 * are not actually looking for a character.
X`09 */
X`09int`09c;
X`09ioctl(0, TIOCSETN, (char *)`26rnstate);
X`09c = getchar();
X`09ioctl(0, TIOCSETN, (char *)`26nstate);
X#else
X`09int c;
X`09c = getchar();
X#endif
X`09if (c == EOF) `7B
X#ifdef linux
X`09`09/*
X`09`09 * The command "`5EX!vile -V" makes vile receive an EOF at this
X`09`09 * point.
X`09`09 */
X`09`09return -1;
X#else
X`09`09if (errno == EINTR)
X`09`09`09return -1;
X`09`09imdying(SIGINT);
X#endif
X`09`7D
X`09return c;
X#endif
X`7D
X#endif /* !DISP_X11 */
X
X/* tttypahead:`09Check to see if any characters are already in the
X`09`09keyboard buffer
X*/
Xint
Xtttypahead(void)
X`7B
X
X#if DISP_X11
X`09return x_typahead(0);
X#else
X
X# if`09USE_FIONREAD
X`09`7B
X`09long x;
X`09return((ioctl(0,FIONREAD,(caddr_t)`26x) < 0) ? 0 : (int)x);
X`09`7D
X# else
X#  if`09USE_FCNTL
X`09if( !kbd_char_present )
X`09`7B
X`09`09if( !kbd_is_polled `26`26
X`09`09&0209fcntl(0, F_SETFL, kbd_flags`7CO_NDELAY ) < 0 )
X`09`09`09return(FALSE);
X`09`09kbd_is_polled = TRUE;  /* I think */
X`09`09kbd_char_present = (1 == read( 0, `26\2308, 1 ));
X`09`7D
X`09return ( kbd_char_present );
X#  else
X`09return FALSE;
X#  endif/* USE_FCNTL */
X# endif/* USE_FIONREAD */
X#endif`09/* DISP_X11 */
X`7D
X
X/* this takes care of some stuff that's common across all ttopen's.  Some of
X`09it should arguably be somewhere else, but... */
Xstatic void
Xttmiscinit(void)
X`7B
X`09/* make sure backspace is bound to\160B*/
X`09asciitbl`5Bbackspc`5D = `26f_backchar_to_bol;
X
X#if !DISP_X11
X`09/* no buffering on input */
X`09setbuf(stdin, (char *)0);
X#endif
X`7D
X
X#else /* not SYS_UNIX */
X
X#if SYS_MSDOS `7C`7C SYS_OS2\0B08WINNT
X# if CC_DJGPP
X#  include <gppconio.h>
X# else
X#  if CC_NEWDOSCC
X#   include <conio.h>
X#  endif
X# endif
X#endif
X
X
X
X#if`09SYS_VMS
X#include`09<stsdef.h>
X#include`09<ssdef.h>
X#include`09<descrip.h>
X#include`09<iodef.h>
X#include`09<ttdef.h>
X#include`09<tt2def.h>
X
Xtypedef struct`09`7B
X`09unsigned short int status;`09/* I/O completion\1A07 */
X`09unsigned short int count;`09/* byte transfer\1806`09 */
X`09int dev_dep_data;`09`09/* device dependant data */
X`09`7D QIO_SB;`09`09`09/* This is a QIO I/O Status Block */
X
X#define NIBUF`091024`09`09`09/* Input buffer size&0209*/
X#define NOBUF`091024`09`09`09/* MM says big buffers win!`09*/
X#define EFN`090`09`09`09/* Event flag&0309*/
X
Xchar`09obuf`5BNOBUF`5D;`09`09`09/* Output buffer`09`09*/
Xint`09nobuf;`09`09&0209/* # of bytes in above&0209*/
Xchar`09ibuf`5BNIBUF`5D;`09`09`09/* Input buffer &0209*/
Xint`09nibuf;`09`09&0209/* # of bytes in above&0209*/
Xint`09ibufi;`09`09&0209/* Read index&0309*/
Xint`09oldmode`5B3`5D;`09`09`09/* Old TTY mode bits&0209*/
Xint`09newmode`5B3`5D;`09`09`09/* New TTY mode bits&0209*/
+-+-+-+-+-+-+-+-  END  OF PART 105 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 106 -+-+-+-+-+-+-+-+
Xshort`09iochan; `09`09`09/* TTY I/O channel&0209*/
X#endif
X
X
X#if`09SYS_MSDOS `26`26 CC_NEWDOSCC &0226 !CC_MSC
Xunion REGS rg;`09`09/* cpu register for use of DOS calls (ibmpc.c) */
Xint nxtchar = -1;`09/* character held from type ahead    */
X#endif
X
Xvoid
Xttopen(void)
X`7B
X#if`09SYS_VMS
X`09struct`09dsc$descriptor`09idsc;
X`09struct`09dsc$descriptor`09odsc;
X`09char`09oname`5B40`5D;
X`09QIO_SB`09iosb;
X`09int`09status;
X
X`09odsc.dsc$a_pointer = "TT";
X`09odsc.dsc$w_length  = strlen(\1C09a_pointer);
X`09odsc.dsc$b_dtype`09= DSC$K_DTYPE_T;
X`09odsc.dsc$b_class`09= DSC$K_CLASS_S;
X`09idsc.dsc$b_dtype`09= DSC$K_DTYPE_T;
X`09idsc.dsc$b_class`09= DSC$K_CLASS_S;
X`09do `7B
X`09`09idsc.dsc$a_pointer = o\1511;
X`09`09idsc.dsc$w_length  = o\1510;
X`09`09odsc.dsc$a_pointer = `26oname`5B0`5D;
X`09`09odsc.dsc$w_length  = sizeof(oname);
X`09`09status = lib$sys_trnlog(`26idsc, `26odsc.dsc$w_length\1407);
X`09`09if (status!=SS$_NORMAL `26`26 \160ETRAN)
X`09`09`09tidy_exit(status);
X`09`09if (oname`5B0`5D == 0x1B) `7B
X`09`09`09odsc.dsc$a_pointer += 4;
X`09`09`09odsc.dsc$w_length  -= 4;
X`09`09`7D
X`09`7D while (status == SS$_NORMAL);
X`09status = sys$assign(`26odsc, `26iochan, 0, 0);
X`09if (status != SS$_NORMAL)
X`09`09tidy_exit(status);
X`09status = sys$qiow(EFN, iochan, IO$_SENSEMODE, `26iosb, 0, 0,
X`09`09`09  oldmode, sizeof(\1007), 0, 0\0606);
X`09if (status != SS$_NORMAL
X`09 `7C`7C iosb.status != SS$_NORMAL)
X`09`09tidy_exit(status);
X`09newmode`5B0`5D = old\0D07;
X`09newmode`5B1`5D = old\0D07;
X`09newmode`5B1`5D `26= `7E(TT$M_TTSYNC`7CTT$M_HOSTSYNC);
X`09newmode`5B2`5D = old\0D08`7C TT2$M_PASTHRU;
X`09status = sys$qiow(EFN, iochan, IO$_SETMODE, `26iosb, 0, 0,
X`09`09`09  newmode, sizeof(\1007), 0, 0\0606);
X`09if (status != SS$_NORMAL
X`09 `7C`7C iosb.status != SS$_NORMAL)
X`09`09tidy_exit(status);
X`09term.t_nrow = (newmode`5B1`5D>>24);
X`09term.t_ncol = newmode`5B0`5D>>16;
X
X#endif
X
X`09/* make sure backspace is bound to\160B*/
X`09asciitbl`5Bbackspc`5D = `26f_backchar_to_bol;
X
X`7D
X
Xvoid
Xttclose(void)
X`7B
X
X#if`09SYS_VMS
X`09/*
X`09 * Note: this code used to check for errors when closing the output,
X`09 * but it didn't work properly (left the screen set in 1-line mode)
X`09 * when I was running as system manager, so I took out the error
X`09 * checking -- T.Dickey 94/7/15.
X`09 */
X`09int`09status;
X`09QIO_SB`09iosb;
X
X`09ttflush();
X`09status = sys$qiow(EFN, iochan, IO$_SETMODE, `26iosb, 0, 0,
X`09`09 oldmode, sizeof(\1007), 0, 0\0606);
X`09if (status == SS$_IVCHAN)
X`09`09return; /* already closed it */
X`09(void) sys$dassgn(iochan);
X#endif
X#if`09!SYS_VMS
X`09ttclean(TRUE);
X#endif
X`7D
X
Xvoid
Xttclean(int f)
X`7B
X`09if (f)
X`09`09kbd_openup();
X
X`09TTflush();
X`09TTclose();
X`09TTkclose();
X`7D
X
Xvoid
Xttunclean(void)
X`7B
X`7D
X
X/*
X * Write a character to the display. On VMS, terminal output is buffered, and
V
X * we just put the characters in the big array, after checking for overflow.
X * On CPM terminal I/O unbuffered, so we just write the byte out. Ditto on
X * MS-DOS (use the very very raw console output routine).
X */
XOUTC_DCL
Xttputc(OUTC_ARGS)
X`7B
X#if`09SYS_VMS
X`09if (nobuf >= NOBUF)
X`09`09ttflush();
X`09obuf`5Bnobuf++`5D = c;
X`09OUTC_RET c;
X#endif
X#if`09SYS_OS2 `26`26 !DISP_VIO
X`09OUTC_RET putch(c);
X#endif
X#if`09SYS_MSDOS
X# if DISP_IBMPC
X`09/* unneeded currently -- output is memory-mapped */
X# endif
X# if DISP_ANSI
X`09OUTC_RET putchar(c);
X# endif
X#endif
X`7D
X
X
X/*
X * Flush terminal buffer. Does real work where the\2A0Aoutput is \3406ed
X * up. A no-operation on systems where byte at a time terminal I/O is done.
X */
Xvoid
Xttflush(void)
X`7B
X#if`09SYS_VMS
X`09QIO_SB`09iosb;
X
X`09if (nobuf != 0) `7B
X`09`09(void) sys$qiow(EFN, iochan, IO$_WRITELBLK`7CIO$M_NOFORMAT,
X`09`09`09 `26iosb, 0, 0, obuf, n\0706\13060, 0);
X`09`09nobuf = 0;
X`09`7D
X#endif
X
X#if`09SYS_MSDOS
X# if DISP_ANSI
X`09fflush(stdout);
X# endif
X#endif
X`7D
X
X#if SYS_VMS
Xstatic void
Xread_vms_tty(int length)
X`7B
X`09int`09status;
X`09QIO_SB`09iosb;
X`09int`09term`5B2`5D = `7B0,0`7D;
X
X`09status = sys$qiow(EFN, iochan,
X`09`09(length == 1)
X`09`09`09? IO$_READLBLK`7CIO$M_NOECHO\0C08FILTR
X`09`09`09: IO$_READLBLK`7CIO$M_NOECHO\0C08FILTR\1906TIMED,
X`09`09`26iosb, 0, 0, ibuf, length, 0, term\1D06);
X
X`09if (status != SS$_NORMAL)
X`09`09tidy_exit(status);
X`09if (iosb.status == SS$_ENDOFFILE)
X`09`09tidy_exit(status);
X
X`09`09/* FIXME: check documentation */
X`09nibuf = iosb.count + (iosb.dev_dep_data >> 16);
X`09ibufi = 0;
X`7D
X#endif
X
X/*
X * Read a character from the terminal, performing no editing and do\1508cho
X * at all. More complex in VMS that almost anyplace else, which figures. Very
V
X * simple on CPM, because the system can do exactly what you want.
X * This should be a terminal dispatch function.
X */
Xint
Xttgetc(void)
X`7B
X#if`09SYS_VMS
X`09while (ibufi >= nibuf) `7B
X`09`09if (!tttypahead())
X`09`09`09read_vms_tty(1);
X`09`7D
X`09return (ibuf`5Bibufi++`5D `26 0xFF);`09  /* Allow multinational  */
X#else
X#if SYS_MSDOS `7C`7C SYS_OS2
X`09/*
X`09 * If we've got a mouse, poll waiting for\1806 movement and\2B06
X`09 * clicks until we've got a character to return.
X`09 */
X# if OPT_MS_MOUSE
X`09if (ms_exists()) `7B
X`09`09for_ever `7B
X`09`09`09if (tttypahead())
X`09`09&0209break;
X`09`09`09ms_processing();
X`09`09`7D
X`09`7D
X# endif /* OPT_MS_MOUSE */
X#if`09CC_MSC `7C`7C CC_TURBO &027C SYS_OS2
X`09return getch();
X#endif
X#if`09CC_NEWDOSCC `26`26 !(CC_MSC`7C`7CCC_TURBO&027CSYS_OS2\0906WINNT)
X`09`7B
X`09int c;
X
X`09/* if a char already is ready, return it */
X`09if (nxtchar >= 0) `7B
X`09`09c = nxtchar;
X`09`09nxtchar = -1;
X`09`09return(c);
X`09`7D
X
X`09/* call the dos to get a char */
X`09rg.h.ah = 7;`09`09/* dos Direct Console Input call */
X`09intdos(`26rg, `26rg);
X`09c = rg.h.al;`09`09/* grab the char */
X`09return(c `26 0xff);
X`09`7D
X#endif
X#else /* ! (SYS_MSDOS `7C`7C SYS_OS2) */
X`09/* Not used. */
X`09return 0;
X#endif
X#endif
X
X`7D
X
X
X/* tttypahead:`09Check to see if any characters are already in the
X`09`09keyboard buffer
X*/
X#if`09! SYS_WINNT
Xint
Xtttypahead(void)
X`7B
X
X#if`09DISP_X11
X`09return x_typahead(0);
X#endif
X
X#if`09DISP_VMSVT
X`09if (ibufi >= nibuf) `7B
X`09`09read_vms_tty(NIBUF);
X`09`09return (nibuf > 0);
X`09`7D
X`09return TRUE;
X#endif
X
X#if`09SYS_MSDOS `7C`7C SYS_OS2
X`09return (kbhit() != 0);
X#endif
X
X`7D
X#endif
X
X#endif /* not SYS_UNIX */
X
X
X/* Get terminal size from system, first trying the driver, and then
X * the environment.  Store number of lines into *heightp and width
X * into *widthp.  If zero or a negative number is stored, the value
X * is not valid.  This may be fixed (in the tcap.c case) by the TERM
X * variable.
X */
X#if ! DISP_X11
Xvoid
Xgetscreensize (int *widthp, int *heightp)
X`7B
X`09char *e;
X#ifdef TIOCGWINSZ
X`09struct winsize size;
X#endif
X`09*widthp = 0;
X`09*heightp = 0;
X#ifdef TIOCGWINSZ
X`09if (ioctl (0, TIOCGWINSZ, (caddr_t)`26size) == 0) `7B
X`09`09if ((int)(size.ws_row) > 0)
X`09`09`09*heightp = size.ws_row;
X`09`09if ((int)(size.ws_col) > 0)
X`09`09`09*widthp = size.ws_col;
X`09`7D
X`09if (*widthp <= 0) `7B
X`09`09e = getenv("COLUMNS");
X`09`09if (e)
X`09`09`09*widthp = atoi(e);
X`09`7D
X`09if (*heightp <= 0) `7B
X`09`09e = getenv("LINES");
X`09`09if (e)
X`09`09`09*heightp = atoi(e);
X`09`7D
X#else
X`09e = getenv("COLUMNS");
X`09if (e)
X`09`09*widthp = atoi(e);
X`09e = getenv("LINES");
X`09if (e)
X`09`09*heightp = atoi(e);
X#endif
X`7D
X#endif
X
X/********\0808\1010\2020\400E/
X
X/*
X * Define an empty terminal type for machines where we cannot use 'dumb_term',
V
X * so that command-line prompting will have something to talk to.
X */
X
Xstatic int  null_cres     (const char *res);
Xstatic int  null_getc     (void);
Xstatic OUTC_DCL null_putc (OUTC_ARGS);
Xstatic int  null_typahead (void);
Xstatic void null_beep     (void);
Xstatic void null_close    (void);
Xstatic void null_eeol     (void);
Xstatic void null_eeop     (void);
Xstatic void null_flush    (void);
Xstatic void null_kclose   (void);
Xstatic void null_kopen    (void);
Xstatic void null_move     (int row, int col);
Xstatic void null_open     (void);
Xstatic void null_rev      (UINT state);
X
XTERM null_term = `7B
X`091,
X`091,
X`0980,
X`0980,
X`090/*MARGIN*/,
X`090/*SCRSIZ*/,
X`090/*NPAUSE*/,
X`09null_open,
X`09null_close,
X`09null_kopen,
X`09null_kclose,
X`09null_getc,
X`09null_putc,
X`09null_typahead,
X`09null_flush,
X`09null_move,
X`09null_eeol,
X`09null_eeop,
X`09null_beep,
X`09null_rev,
X`09null_cres,
X`09null_t_setfor,
X`09null_t_setback,
X`09null_t_setpal,
X`09null_t_scroll,
X`09null_t_pflush,
X`09null_t_icursor,
X`09null_t_title,
X`09null_t_watchfd,
X`09null_t_unwatchfd,
X`7D;
X
Xstatic void null_open(void)`09`7B `7D
Xstatic void null_close(void)`09`7B `7D
Xstatic void null_kopen(void)`09`7B `7D
Xstatic void null_kclose(void)`09`7B `7D
Xstatic int  null_getc(void)`09`7B return abortc; `7D
X/*ARGSUSED*/
Xstatic OUTC_DCL null_putc(OUTC_ARGS) `7B\2006RET c; `7D
Xstatic int  null_typahead(void)`09`7B return FALSE; `7D
Xstatic void null_flush(void)`09`7B `7D
X/*ARGSUSED*/
Xstatic void null_move(int row GCC_UNUSED, int col\140B) `7B `7D
Xstatic void null_eeol(void)`09`7B `7D
Xstatic void null_eeop(void)`09`7B `7D
Xstatic void null_beep(void)`09`7B `7D
X/*ARGSUSED*/
Xstatic void null_rev(UINT state GCC_UNUSED) `7B `7D
X/*ARGSUSED*/
Xstatic int null_cres(const char *res GCC_UNUSED) `7B return(FALSE); `7D
X
X/*
X * These are public, since we'll use them as placeholders for unimplemented
X * device methods.
X */
X/*ARGSUSED*/ void null_t_setfor (int f GCC_UNUSED) `7B `7D
X/*ARGSUSED*/ void null_t_setback (int b GCC_UNUSED) `7B `7D
X/*ARGSUSED*/ void null_t_setpal (const char *p GCC_UNUSED) `7B `7D
X/*ARGSUSED*/ void null_t_scroll (int f GCC_UNUSED, int t \1210n\240B) `7B `7D
V
X/*ARGSUSED*/ void null_t_pflush (void) `7B `7D
X/*ARGSUSED*/ void null_t_icursor (int c GCC_UNUSED) `7B `7D
X/*ARGSUSED*/ void null_t_title (char *t GCC_UNUSED) `7B `7D
X/*ARGSUSED*/ int  null_t_watchfd (int fd GCC_UNUSED, WATCHTYPE type\1B0Dlong *
Vidp\310B) `7B return 0; `7D
X/*ARGSUSED*/ void null_t_unwatchfd (int fd GCC_UNUSED, long id \140A) `7B `7D
V
X
X/********\0808\1010\2020\400E/
X
X/*
X * This function is used during terminal initialization to allow us to setup
X * either a dumb or null terminal driver to handle stray command-line and othe
Vr
X * debris, then (in the second call), open the screen driver.
X */
Xint
Xopen_terminal(TERM *termp)
X`7B
X`09static`09TERM`09save_term;
X`09static int`09initialized;
X
X`09if (!initialized++) `7B
X
X`09`09/*
X`09`09 * If the open and/or close slots are empty, fill them in with
X`09`09 * the screen driver's functions.
X`09`09 */
X`09`09if (termp->t_open == 0)
X`09`09`09termp->t_open = term.\0E06;
X
X`09`09if (termp->t_close == 0)
X`09`09`09termp->t_close = term.\0F07;
X
X`09`09/*
X`09`09 * If the command-line driver is the same a\0C07creen\2107,
X`09`09 * then all we're really doing is opening the terminal in raw
X`09`09 * mode (e.g., the termcap driver), but with restrictions on
X`09`09 * cursor movement, etc.  We do a bit of juggling, because the
X`09`09 * screen driver typically sets entries (such as the\3207
X`09`09 * size) in the 'term' struct.
X`09`09 */
X`09`09if (term.t_open == termp->\1106) `7B
X`09`09`09TTopen();
X`09`09`09save_term = term;
X`09`09`09term = *termp;
X`09`09`7D else `7B
X`09`09`09save_term = term;
X`09`09`09term = *termp;
X`09`09`09TTopen();
X`09`09`7D
X`09`7D else `7B
X`09`09/*
X`09`09 * If the command-line driver isn't the same as\0C06creen
X`09`09 * driver, reopen the terminal with the screen \2C06.
X`09`09 */
X`09`09if (save_term.t_open != \0F0B) `7B
X`09`09`09TTclose();
X`09`09`09term = save_term;
X`09`09`09TTopen();
X`09`09`7D else `7B
X`09`09`09term = save_term;
X`09`09`7D
X`09`7D
X`09return TRUE;
X`7D
$ call unpack [.VILE-8_0]TERMIO.C;1 -
 54864984 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 56 115 152
$!
$ create 'f'
X/*
X * debugging support -- tom dickey.
X *
X * $Header: /usr/build/vile/vile/RCS/trace.c,v 1.8 1998/04/26 12:36:05 tom Exp
V $
X *
X */
X#include "estruct.h"
X#include <ctype.h>
X
X#undef fopen`09/* avoid conflict with 'fakevms.c' */
X
X#ifndef _trace_h
X#include "trace.h"
X#endif
X
X#if SYS_UNIX
X#include <sys/time.h>
X#endif
X
X#if`09defined(sun) `26`26 !\1108__SVR4)
Xextern`09void`09perror ( const char *s );
Xextern`09int`09gettimeofday ( struct timeval *t,\130Czone *z );
Xextern`09int`09vfprintf ( FILE *fp, const char *fmt, va_list v );
Xextern`09int`09fflush ( FILE *fp );
X#endif
X
X#include <stdarg.h>
X
X#if`09DOALLOC
X#undef`09calloc
X#undef`09malloc
X#undef`09realloc
X#undef`09free
X#endif`09/* DOALLOC */
X
Xstatic const char *bad_form;
X
Xvoid
XTrace(const char *fmt, ...)
X`7B
X`09static`09FILE`09*fp;
X`09va_list ap;
X
X`09if (!fp)
X`09`09fp = fopen("Trace.out", "w");
X`09if (!fp)
X`09`09abort();
X
X`09va_start(ap,fmt);
X`09if (fmt != bad_form) `7B
X`09`09vfprintf(fp, fmt, ap);
X`09`09va_end(ap);
X`09`09(void)fflush(fp);
X`09`7D else `7B
X`09`09(void)fclose(fp);
X`09`09(void)fflush(stdout);
X`09`09(void)fflush(stderr);
X`09`7D
X`7D
X
Xchar *
Xtb_visible(TBUFF *p)
X`7B
X`09static char *result;
X`09size_t j, k = 0;
X
X`09if (result != 0)
X`09`09free(result);
X`09result = malloc(tb_length(p)*4 + 1);
X
X`09for (j = 0; j < tb_length(p); j++) `7B
X`09`09int c = tb_values(p)`5Bj`5D `26 0xff;
X`09`09if (isprint(c)) `7B
X`09`09`09result`5Bk++`5D = c;
X`09`09`7D else `7B
X`09`09`09if (c >= 128)
X`09`09&0209sprintf(result+k, "`5C`5C%03o", c);
X`09`09`09else if (c == 127)
X`09`09&0209strcpy(result+k, "`5E?");
X`09`09`09else
X`09`09&0209sprintf(result+k, "`5E%c", c `7C '@');
X`09`09`09k = strlen(result);
X`09`09`7D
X`09`7D
X`09result`5Bk`5D = 0;
X`09return result;
X`7D
X
X#define`09SECS(tv)`09(tv.tv_sec + \0D07usec / 1.0e6))
X
Xvoid
XElapsed(char *msg)
X`7B
X#if SYS_UNIX
X`09struct`09timeval`09`09tv1;
X`09struct`09timezone`09tz1;
X`09static`09struct`09timeval`09tv0;
X`09static`09int`09init;
X`09gettimeofday(`26tv1, `26tz1);
X`09if (!init++)
X`09`09tv0 = tv1;
X`09Trace("%10.3f %s`5Cn", SECS(tv1) -\0C080), msg);
X`09tv0 = tv1;
X#endif
X`7D
X
X#ifdef`09apollo
Xstatic int
Xcontains(char *ref, \0B06tst)
X`7B
X`09size_t`09len`09= strlen(ref);
X`09while (*tst) `7B
X`09`09if (!strncmp(ref,tst++,len))
X`09`09`09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X#endif`09/* apollo */
X
Xvoid
XWalkBack(void)
X`7B
X#ifdef`09apollo
X`09static`09char`09*first`09= "`5C"WalkBack`5C"",
X`09`09`09*last`09= "`5C"unix_$main`5C"";
X`09auto`09FILE`09*pp;
X`09auto`09char`09bfr`5BBUFSIZ`5D;
X`09auto`09int`09ok`09= FALSE;
X`09static`09int`09count;
X
X`09Trace("%s %d`5Cn", first, ++count);
X`09sprintf(bfr, "/com/tb %d", getpid());
X`09if (!(pp = popen(bfr, "r")))
X`09`09perror(bfr);
X
X`09while (fgets(bfr, sizeof(bfr), pp)) `7B
X`09`09if (ok `26`26 contains(last, bfr))
X`09`09`09break;
X`09`09else if (contains(first, bfr))
X`09`09`09ok = TRUE;
X`09`09else if (ok)
X`09`09`09Trace("%s", bfr);
X`09`7D
X`09(void)fclose(pp);
X#endif`09/* apollo */
X`7D
X
Xstatic`09int`09count_alloc,
X`09`09count_freed;
X
Xvoid
Xfail_alloc(char *msg, \0B06ptr)
X`7B
X`09Trace("%s: %p`5Cn", msg, ptr);
X`09Trace("allocs %d, frees %d`5Cn", count_alloc\0D08freed);
X`09WalkBack();
X#if NO_LEAKS
X`09show_alloc();
X#endif
X`09Trace(bad_form);
X`09abort();
X`7D
X
X#if`09DOALLOC
Xtypedef`09struct`09`7B
X`09long`09size;`09/* ...its size */
X`09char`09*text;`09/* the actual segment */
X`09int`09note;`09/* ...last value of 'count_alloc' */
X`09`7D AREA;
X
Xstatic`09AREA`09*area;
X
Xstatic`09long`09maxAllocated,`09/* maximum # of bytes a\2108 */
X`09`09nowAllocated;`09/* current # of bytes a\2108 */
Xstatic`09int`09nowPending,`09/* current end of 'area`5B`5D' table */
X`09`09maxPending;`09/* maximum # of segments allocated */
X
Xstatic void
XInitArea(void)
X`7B
X`09if (area == 0) `7B
X`09`09area = (AREA *)calloc(DOALLOC,sizeof(AREA));
X`09`09if (area == 0)
X`09`09`09abort();
X`09`09Trace("Initialized doalloc (%d * %d) = %ld`5Cn",
X`09`09`09DOALLOC,
X`09`09`09sizeof(AREA),
X`09`09`09(long)sizeof(AREA) * \1506DOALLOC);
X`09`7D
X`7D
X
Xstatic int
XFindArea(char *ptr)
X`7B
X`09register int j;
X
X`09InitArea();
X`09for (j = 0; j < DOALLOC; j++)
X`09`09if (area`5Bj`5D.text == ptr) `7B
X`09`09`09if (j >= nowPending) `7B
X`09`09&0209nowPending = j+1;
X`09`09&0209if (nowPending > max\0D07)
X`09`09&0209`09maxPending = now\0D07;
X`09`09`09`7D
X`09`09`09return j;
X`09`09`7D
X`09return -1;
X`7D
X
Xstatic int
Xrecord_freed(char *ptr)
X`7B
X`09register int j;
X
X`09if ((j = FindArea(ptr)) >= 0) `7B
X`09`09nowAllocated -= area`5Bj`5D.size;
X`09`09area`5Bj`5D.size = 0;
X`09`09area`5Bj`5D.text = 0;
X`09`09area`5Bj`5D.note = count_freed;
X`09`09if ((j+1) == nowPending) `7B
X`09`09`09register int`09k;
X`09`09`09for (k = j; (k >= 0) `26`26 !area`5Bk`5D.size; k--)
X`09`09&0209nowPending = k;
X`09`09`7D
X`09`7D
X`09return j;
X`7D
X
Xstatic int
Xrecord_alloc(char *newp, \0C06oldp, unsigned len)
X`7B
X`09register int`09j;
X
X`09if (newp == oldp) `7B
X`09`09if ((j = FindArea(oldp)) >= 0) `7B
X`09`09`09nowAllocated -= area`5Bj`5D.size;
X`09`09`09area`5Bj`5D.size = len;
X`09`09`09area`5Bj`5D.note = count_alloc;
X`09`09`7D else
X`09`09`09fail_alloc("could not find", oldp);
X`09`7D else `7B
X`09`09if (oldp != 0)
X`09`09`09record_freed(oldp);
X`09`09if ((j = FindArea((char *)0)) >= 0) `7B
X`09`09`09area`5Bj`5D.text = newp;
X`09`09`09area`5Bj`5D.size = len;
X`09`09`09area`5Bj`5D.note = count_alloc;
X`09`09`7D else
X`09`09`09fail_alloc("no room in table", newp);
X`09`7D
X
X`09nowAllocated += len;
X`09if (nowAllocated > max\0F09)
X`09`09maxAllocated = now\0F09;
X`09return len;
X`7D
X
X#define`09OK_ALLOC(p,q,n)`09((p != 0) `26`26 (record_alloc\2207 >= 0))
X#define`09OK_FREE(p)`09((p != 0) `26`26 (record_freed(p) >= 0))
X#else
X#define`09OK_ALLOC(p,q,n)`09(p != 0)
X#define`09OK_FREE(p)`09(p != 0)
X#endif`09/* DOALLOC */
X
X#ifdef`09DEBUG2
X#define`09LOG_PTR(msg,num)`09Trace("%s %p`5Cn", msg, num);
X#define`09LOG_LEN(msg,num)`09Trace("%s %d`5Cn", msg, num);
X#else
X#define LOG_PTR(msg,num)
X#define`09LOG_LEN(msg,num)
X#endif
X
X/********\0808\1010\2020\4008
X *`09public entrypoints`09`09&0209&0209*
X ********\0808\1010\2020\4008/
X#if DOALLOC
Xchar *
Xdoalloc (char *oldp, unsigned amount)
X`7B
X`09register char`09*newp;
X
X`09count_alloc += (oldp == 0);
X`09LOG_LEN("allocate", amount)
X`09LOG_PTR("  old = ", oldp)
X
X`09newp = (oldp != 0) ? realloc(oldp, amount) : m\1706\1107;
X`09if (!OK_ALLOC(newp,oldp,amount)) `7B
X`09`09perror("doalloc");
X`09`09fail_alloc("doalloc", oldp);
X`09`09/*NOT REACHED*/
X`09`7D
X
X`09LOG_PTR("  new = ", newp)
X`09return (newp);
X`7D
X
Xchar *
Xdo_calloc (unsigned nmemb, \1009size)
X`7B
X`09unsigned len = nmemb * size;
X`09char`09*result = doalloc((char *)0, len);
X`09memset(result, 0, len);
X`09return result;
X`7D
X
X/*
X * Entrypoint so we can validate pointers
X */
Xvoid
Xdofree(void *oldp)
X`7B
X`09count_freed++;
X`09LOG_PTR("dealloc ", oldp)
X
X`09if (OK_FREE(oldp)) `7B
X`09`09free(oldp);
X`09`09return;
X`09`7D
X
X`09fail_alloc("free (not found)", oldp);
X`7D
X
X/*
X * Write over the area if it is valid.
X */
Xvoid
Xdopoison(void *oldp, long len)
X`7B
X`09int j;
X
X`09if ((j = FindArea(oldp)) >= 0) `7B
X`09`09if (area`5Bj`5D.size >= len)
X`09`09`09(void)memset((char *)oldp, 0xdf, len);
X`09`09else
X`09`09`09fail_alloc("incorrect length", oldp);
X`09`7D else `7B
X`09`09fail_alloc("cannot find to poison", oldp);
X`09`7D
X`7D
X#endif
X
X#ifndef show_alloc
Xvoid
Xshow_alloc(void)
X`7B
X#if`09DOALLOC
X`09static`09char`09*fmt = ".. %-24.24s %10ld`5Cn";
X
X`09printf("show_alloc`5Cn"); /* patch */
X`09Trace("** allocator metrics:`5Cn");
X`09Trace(fmt, "allocs:", count_alloc);
X`09Trace(fmt, "frees:",  count_freed);
X`09`7B
X`09`09register int`09j, count = 0;
X`09`09register long`09total`09= 0;
X
X`09`09for (j = 0; j < nowPending; j++) `7B
X`09`09`09if (area`5Bj`5D.text) `7B
X`09`09&0209if (count++ < 10)
X`09`09&0209`09Trace("...%5d) %5ld bytes in alloc #%-5d @%p`5Cn",
X`09`09&0209&0209j,
X`09`09&0209&0209area`5Bj`5D.size,
X`09`09&0209&0209area`5Bj`5D.note,
X`09`09&0209&0209area`5Bj`5D.text);
X`09`09&0209total += area`5Bj`5D.size;
X`09`09`09`7D
X`09`09`7D
X`09`09Trace(fmt, "total bytes allocated:",   total);
X`09`09Trace(fmt, "current bytes allocated:", nowA\1008);
X`09`09Trace(fmt, "maximum bytes allocated:", maxA\1008);
X`09`09Trace(fmt, "segment-table length:",    nowPending);
X`09`09Trace(fmt, "current # of segments:",   (long)count);
X`09`09Trace(fmt, "maximum # of segments:",   maxPending);
X`09`7D
X#endif
X`7D
X#endif`09/* show_alloc */
$ call unpack [.VILE-8_0]TRACE.C;1 -
 423039460 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 16 116 152
$!
$ create 'f'
X/*
X * debugging support -- tom dickey.
X *
X * $Header: /usr/build/vile/vile/RCS/trace.h,v 1.6 1998/04/26 12:36:03 tom Exp
V $
X *
X */
X#ifndef`09_trace_h
X#define`09_trace_h
X
X#ifndef`09NO_LEAKS
X#define NO_LEAKS 0
X#endif
X
X#ifndef DOALLOC
X#define DOALLOC 0
X#endif
X
X#ifndef`09show_alloc
Xextern`09void`09show_alloc (void);
X#endif
X
X#if`09DOALLOC
Xextern`09char *`09doalloc (\1006oldp, unsigned amount);
Xextern`09char *`09do_calloc (unsigned nmemb, \1009size);
Xextern`09void`09dofree (void *oldp);
Xextern`09void`09dopoison (void *oldp, long len);
X#undef`09calloc
X#define`09calloc(n,m)`09do_\0F09 m)
X#undef`09malloc
X#define`09malloc(n)`09do\0B06(char *)0,n)
X#undef`09realloc
X#define`09realloc(p,n)`09do\0D0A
X#undef`09free
X#define`09free(p)`09`09do\0B07
X#ifdef POISON
X#undef`09poison
X#define`09poison(p,s)`09do\0E0B
X#endif
X#endif`09/* DOALLOC */
X
X#if !(defined(__GNUC__) `7C`7C \150Aattribute__))
X#define __attribute__(p)
X#endif
X
Xextern`09void`09fail_alloc (char *msg, \0B06ptr);
Xextern`09void`09Trace ( const char *fmt, ... ) __attribute__ ((format(printf,1
V,2)));
Xextern`09void`09Elapsed ( char * msg);
Xextern`09void`09WalkBack (void);
X
X#ifdef _estruct_h
Xextern`09char *`09tb_visible (TBUFF *p);
X#endif
X
X#undef TRACE
X#define TRACE(p) Trace p;
X
X#endif`09/* _trace_h */
$ call unpack [.VILE-8_0]TRACE.H;1 -
 1265457728 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 3 117 152
$!
$ create 'f'
X/* these routines take care of undo operations
X * code by Paul Fox, original algorithm mostly by Julia Harper May, 89
X *
X * written for vile: Copyright (c) 1990, 1995 by Paul Fox
X *
X * $Header: /usr/build/vile/vile/RCS/undo.c,v 1.69 1998/04/28 10:19:14 tom Exp
V $
X *
X */
X
X#include "estruct.h"
X#include "edef.h"
X
X#ifndef NULL
X#define NULL 0
X#endif
X
X/*
X * There are two stacks and two "dots" saved for undo operations.
X *
X * The first stack, the "backstack", or\1406undo\2506", is used to move
X * back in history -- that is, as changes are made, they go on this stack,
X * and as we undo those changes, they come off of this stack.  The second
X * stack, the "forward\1406" or "redo\1007, is used when going \3307
X * in history, i.e., when undoing a\0B06.
X *
X * The "backdot" is the last value of DOT _before_ a change occurred, and
X * therefore must be restored _after_ undoing that change.  The "forwdot"
X * is the first value of DOT _after_ a change occurred, and therefore must
X * be restored _after_ re-doing that change.
X *
X * Distinct sets of changes (i.e.  single user-operations) are separated on
X * the stacks by "stack separator" (natch) entries.  The lforw and lback
X * pointers of these entries are used to save the values \2D06 forward and
X * backward dots.
X *
X * The undo strategy is this:
X *
X * 1) For any deleted line, push it onto the undo stack.
X *
X * 2) On any change to a line, make a copy of it, push the copy to the undo
X * stack, and mark the original as having been copied.  Do not copy/push
X * lines that are already marked as having been copied.  Push a tag
X * matching up the copy with the original.  Later, when undoing, and the
X * copy is being put into the file, we can go down through the undo stack,
X * find all references to the original line, and make them point at the
X * copy instead.  We could do this immediately,\2808 of pushing the
X * "patch" and waiting for the undo, but it seems better to pay the price
X * of that stack walk at undo time, rather than at the time\3906e change.
X * This patching wouldn't be necessary at all if we used line no's as the
X * pointers, instead of real\1A09.
X *
X * On the actual undo, we pop these things (lines or tags) one by one.
X * There should be either a) no lines where it goes (it was a deleted line)
X * and we can just put it back, or b) exactly one line where it goes (it
X * was a changed/copied line) and it can be replaced, or if this is a tag
X * we're popping (not a real line), then the line it points at was a
X * fresh insert (and should be deleted now).  That makes it easy to undo
X * the changes one by one.  Of course, we need to build a different,
X * inverse stack (the "forward", or "redo"\2006) as we go, so that undo
X * can itself be undone.
X *
X * The "copied" cookie in the LINE structure is unioned with the stack link
X * pointer on the undo stack, since they aren't both needed at once.
X *
X * There are basically three interface routines for code making buffer changes
V:
X *  toss_to_undo() -- called when deleting a whole line
X *  tag_for_undo() -- called when inserting a whole line
X *  copy_for_undo() -- called when modifying a line
X * These routines should be called _before_ calling chg_buff to mark the
X * buffer as modified, since they want to record the current
X * modified/un\0B08 state in the undo stack, so it can be restored later.
X *
X * In addition:
X *  freeundostacks() cleans up any undo data structures for a buffer,
X *  nounmodifiable() is called if a change is happening to a
X *`09buffer that is not undoable.
X *  mayneedundo() is called before starting an operation that might call
X *`09one of the toss/copy/tag routines above.
X *  dumpuline() is called if the whole-line undo (the 'U' command) line
X *`09may need to be flushed due to the current change.
X *
X * The command functions are:
X *  backundo() -- undo changes going back in history  (`5EX-u)
X *  forwredo() -- redo changes going forward in history  (`5EX-r)
X *  undo() -- undo changes, toggling backwards and for\0D06 (u)
X *  lineundo() -- undo all changes to currently-being-modified line (U)
X *`09(The lineundo() command is kind of separate, and acts independently
X *`09 of the normal undo stacks -- an extra copy\2B08line is simply
X *`09 made when the first change is made.)
X *
X *
X * Notes on how the "copied" marks work:
X *
X * Say you do a change to a line, like you go into insertmode, and type
X * three characters.  The first\170A causes linsert to be called,
X * which calls copy_for_undo(),\1D08opies the line, and marks it as
X * "copied".  Then, the second and third characters also call
X * copy_for_undo(), but since the line is marked, nothing happens.  Now you
X * hit ESC.  Now enter insertmode again.  So far, nothing has happened,
X * except that the "needundocleanup" flag has been set (by execute()s call
X * to mayneedundo()), since we're in an undo-able command.  Type a
X * character.  linsert() calls copy_for_undo() which\1C07preundocleanup()
X * (based on the "needundocleanup" flag.  In previous versions of vile,
X * this cleanup required walking the entire buffer, to reset the "copied"
X * flag.  Now, the "copied" flag is actually a word-sized "cookie", which
X * matches the global "current_undo_cookie" when the line has bee copied.
X * By incrementing the global "current_undo_cookie" in preundocleanup(), we
X * are effectively resetting all of the lines' "marks", since the cookie is
X * now _guaranteed_ to not match against any of them.  Which is why, when
X * the cookie wraps around to 0, we _do_ need to clean the buffer, because
X * now there's a chance that the current_undo_cookie might match a very old
X * marked line.
X */
X
X#define FORW 0
X#define BACK 1
X
X/* shorthand for the two stacks and \1308dots */
X#define BACKSTK(bp) (`26(bp->b_udstks`5BBACK`5D))
X#define FORWSTK(bp) (`26(bp->b_udstks`5BFORW`5D))
X#define BACKDOT(bp) (bp->b_uddot`5BBACK`5D)
X#define FORWDOT(bp) (bp->b_uddot`5BFORW`5D)
X
X/* these let us refer to the current and other stack in relative terms */
X#define STACK(i)`09(`26(curbp->b_udstks`5Bi`5D))
X#define OTHERSTACK(i)`09(`26(curbp->b_udstks`5B1`5Ei`5D))
X
Xstatic`09LINEPTR`09copyline(LINE *lp);
Xstatic`09void`09make_undo_patch(LINEPTR olp, \0D08nlp);
+-+-+-+-+-+-+-+-  END  OF PART 106 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 107 -+-+-+-+-+-+-+-+
Xstatic`09void`09freshstack(int stkindx);
Xstatic`09void`09pushline(LINEPTR lp, \0C08*stk);
Xstatic`09LINE *`09popline(LINEPTR *stkp, int force);
Xstatic`09int`09undoworker(int stkindx);
Xstatic`09void`09preundocleanup (void);
Xstatic`09void`09repointstuff(register LINEPTR nlp, \1611olp);
Xstatic`09int`09linesmatch(LINE *lp1, register \14082);
Xstatic`09void`09setupuline(LINEPTR lp);
X
Xstatic`09short`09needundocleanup;
X
X/* this could be per-buffer, but i don't think it matters in practice */
Xstatic unsigned short current_undo_cookie = 1;
X
X/* #define UNDOLOG 1 */
X#if UNDOLOG
Xstatic void
Xundolog(char *s, LINEPTR lp)
X`7B
X`09char *t;
X`09if (lisreal(lp))`09t = "real";
X`09else if (lispurestacksep(lp))t= "\150C";
X`09else if (lisstacksep(lp))t= "\1108";
X`09else if (lispatch(lp))`09t = "patch";
X`09else `09`09`09t = "unknown";
X
X`09dbgwrite("%s %s lp 0x%x",s,t,lp);
X`7D
X#else
X# define undolog(s,l)
X#endif
X
X/*
X * Test if the buffer is modifiable
X */
Xstatic int
XOkUndo(void)
X`7B
X`09if (curbp == bminip)
X`09`09return FALSE;
X#define SCRATCH 1
X#if SCRATCH
X`09if (b_is_scratch(curbp))
X#else
X`09if (b_val(curbp, MDVIEW))
X#endif
X`09`09return FALSE;
X`09return TRUE;
X`7D
X
X/* push a deleted line onto the undo stack. */
Xvoid
Xtoss_to_undo(LINEPTR lp)
X`7B
X`09register LINEPTR next;
X`09register LINEPTR prev;
X`09int fc;
X
X`09if (!OkUndo())
X`09`09return;
X
X`09if (needundocleanup)
X`09`09preundocleanup();
X
X`09pushline(lp, BACKSTK(curbp));
X
X`09next = lforw(lp);
X
X`09/* need to save a dot -- either the next line or
X`09`09the previous one */
X`09if (next == buf_head(curbp)) `7B
X`09`09prev = lback(lp);
X`09`09FORWDOT(curbp).l = prev;
X`09`09fc =  firstchar(prev);
X`09`09if (fc < 0) /* all white */
X`09`09`09FORWDOT(curbp).o = llength(prev) - 1;
X`09`09else
X`09`09`09FORWDOT(curbp).o = fc;
X`09`7D else `7B
X`09`09FORWDOT(curbp).l = next;
X`09`09fc =  firstchar(next);
X`09`09if (fc < 0) /* all white */
X`09`09`09FORWDOT(curbp).o = b_left_margin\1907;
X`09`09else
X`09`09`09FORWDOT(curbp).o = fc;
X`09`7D
X
X`09dumpuline(lp);
X`7D
X
X/*
X * Push a copy of a line onto the undo stack. \2C08patch so we can
X * later fix up any references to this line that might already be in the
X * stack.  When the undo happens, the later pops (i.e. those lines still
X * in the stack) will point at the _original_ (which\2406by then be on the
X * redo stack) instead of at the copy, which will have just been popped,
X * unless we fix them by popping and using the patch.
X */
X
Xvoid
Xcopy_for_undo(LINEPTR lp)
X`7B
X`09register LINEPTR nlp;
X
X`09if (!OkUndo())
X`09`09return;
X
X`09if (needundocleanup)
X`09`09preundocleanup();
X
X`09if (liscopied(lp))
X`09`09return;
X
X`09/* take care of the normal undo stack */
X`09nlp = copyline(lp);
X`09if (nlp == null_ptr)
X`09`09return;
X
X`09pushline(nlp, BACKSTK(curbp));
X
X`09make_undo_patch(lp, nlp);
X
X`09lsetcopied(lp);
X
X`09setupuline(lp);
X
X`09FORWDOT(curbp).l = lp;
X`09FORWDOT(curbp).o = DOT.o;
X`7D
X
X/* push an unreal line onto the undo stack
X * lp should be the new line, _after_ insertion, so
X *`09lforw() and lback() are right
X */
Xvoid
Xtag_for_undo(LINEPTR lp)
X`7B
X`09register LINEPTR nlp;
X
X`09if (!OkUndo())
X`09`09return;
X
X`09if (needundocleanup)
X`09`09preundocleanup();
X
X`09if (liscopied(lp))
X`09`09return;
X
X`09nlp = lalloc(LINENOTREAL, curbp);
X`09if (nlp == null_ptr)
X`09`09return;
X`09set_lforw(nlp, \0B06lp));
X`09set_lback(nlp, \0B06lp));
X
X`09pushline(nlp, BACKSTK(curbp));
X
X`09lsetcopied(lp);
X`09FORWDOT(curbp).l = lp;
X`09FORWDOT(curbp).o = DOT.o;
X`7D
X
X/* Change all PURESTACKSEPS on the stacks to \1B09, so that undo won't
X * reset the BFCHG bit.  This should be called anytime a non-undable change is
V
X * made to a buffer.
X */
Xvoid
Xnounmodifiable(BUFFER *bp)
X`7B
X`09register LINE *tlp;
X`09for (tlp = *BACKSTK(bp); tlp != NULL;
X`09`09&0209tlp = tlp->l_nxtundo) `7B
X`09`09if (lispurestacksep(tlp))
X`09`09`09tlp->l_used = STACKSEP;
X`09`7D
X`09for (tlp = *FORWSTK(bp); tlp != NULL;
X`09`09&0209tlp = tlp->l_nxtundo) `7B
X`09`09if (lispurestacksep(tlp))
X`09`09`09tlp->l_used = STACKSEP;
X`09`7D
X`7D
X
X/* before any undoable command (except undo itself), clean the undo list */
X/* clean the copied flag o\1306line we're \2207y of */
Xvoid
Xfreeundostacks(register BUFFER *bp, int both)
X`7B
X`09register LINE *lp;
X
X`09while ((lp = popline(FORWSTK(bp),TRUE)) != NULL) `7B
X`09`09lfree(lp,bp);
X`09`7D
X`09if (both) `7B
X`09`09while ((lp = popline(BACKSTK(bp),TRUE)) != NULL)
X`09`09`09lfree(lp,bp);
X`09`09bp->b_udtail = null_ptr;
X`09`09bp->b_udlastsep = null_ptr;
X`09`09bp->b_udcount = 0;
X`09`7D
X
X`7D
X
X/* ARGSUSED */
Xint
Xundo(int f GCC_UNUSED, int n\120B)
X`7B
X`09int s;
X`09L_NUM`09before;
X
X`09if (b_val(curbp, MDVIEW))
X`09`09return(rdonly());
X
X`09before = line_count(curbp);
X`09if ((s = undoworker(curbp->b_udstkindx)) == TRUE) `7B
X`09`09if (!line_report(before)) `7B
X`09`09`09mlwrite("`5Bchange %sdone`5D",
X`09`09&0209curbp->b_udstkindx == BACK ? "un" : "re");
X`09`09`7D
X`09`09curbp->b_udstkindx `5E= 1;  /* flip to other stack */
X`09`7D else `7B
X`09`09mlwarn("`5BNo changes to undo`5D");
X`09`7D
X`09return s;
X`7D
X
Xint
Xinf_undo(int f, int n)
X`7B
X`09int s = TRUE;
X
X`09if (!f `7C`7C n < 1) n = 1;
X
X`09if (b_val(curbp, MDVIEW))
X`09`09return(rdonly());
X
X`09curbp->b_udstkindx `5E= 1;  /* flip to other stack */
X`09while (s `26`26 n--) `7B
X`09`09if ((s = undoworker(curbp->b_udstkindx)) == TRUE) `7B
X`09`09`09mlwrite("`5Bchange %sdone`5D",
X`09`09&0209curbp->b_udstkindx == BACK ? "un" : "re");
X`09`09`7D else `7B
X`09`09`09mlwarn("`5BNo more changes to %s`5D",
X`09`09&0209curbp->b_udstkindx == BACK ? "undo" : "redo");
X`09`09`7D
X`09`7D
X`09curbp->b_udstkindx `5E= 1;  /* flip to other stack */
X`09return s;
X`7D
X
Xint
Xbackundo(int f, int n)
X`7B
X`09int s = TRUE;
X
X`09if (b_val(curbp, MDVIEW))
X`09`09return(rdonly());
X
X`09if (!f `7C`7C n < 1) n = 1;
X
X`09while (s `26`26 n--) `7B
X`09`09s = undoworker(BACK);
X`09`09if (s) `7B
X`09`09`09mlwrite("`5Bchange undone`5D");
X`09`09`7D else `7B
X`09`09`09mlwarn("`5BNo more changes to undo`5D");
X`09`09`7D
X`09`7D
X
X`09curbp->b_udstkindx = FORW;  /* flip to other stack */
X
X`09return s;
X`7D
X
Xint
Xforwredo(int f, int n)
X`7B
X`09int s = TRUE;
X
X`09if (b_val(curbp, MDVIEW))
X`09`09return(rdonly());
X
X`09if (!f `7C`7C n < 1) n = 1;
X
X`09while (s `26`26 n--) `7B
X`09`09s = undoworker(FORW);
X`09`09if (s) `7B
X`09`09`09mlwrite("`5Bchange redone`5D");
X`09`09`7D else `7B
X`09`09`09mlwarn("`5BNo more changes to redo`5D");
X`09`09`7D
X`09`7D
X
X`09curbp->b_udstkindx = BACK;  /* flip to other stack */
X
X`09return s;
X`7D
X
Xvoid
Xmayneedundo(void)
X`7B
X`09needundocleanup = TRUE;
X`7D
X
Xstatic void
Xpreundocleanup(void)
X`7B
X`09register LINE *lp;
X
X`09freeundostacks(curbp,FALSE);
X
X`09/* clear the flags in the buffer */
X`09/* there may be a way to clean these less drastically, by
X`09`09using the information on the stacks above, but I
X`09`09couldn't figure it out.  -pgf  */
X`09if (++current_undo_cookie == 0) `7B
X`09`09current_undo_cookie++;`09/* never let it be zero */
X`09`09for_each_line(lp, curbp) `7B  /* once in while, feel the pain */
X`09`09`09lsetnotcopied(lp);
X`09`09`7D
X`09`7D
X
X`09curbp->b_udstkindx = BACK;
X
X`09if (doingopcmd)
X`09`09BACKDOT(curbp) = pre_op_dot;
X`09else
X`09`09BACKDOT(curbp) = DOT;
X
X`09/* be sure FORWDOT has _some_ value (may be null the first time)
X`09if (sameline(FORWDOT(curbp), nullmark))
X`09`09FORWDOT(curbp) = BACK\110A;
X`09*/
X`09freshstack(BACK);
X`09FORWDOT(curbp) = BACK\110A;
X
X`09needundocleanup = FALSE;
X`7D
X
Xstatic void
Xpushline(LINEPTR lp, \0C08*stk)
X`7B
X`09lp->l_nxtundo = *stk;
X`09*stk = lp;
X`09undolog("pushing", lp);
X`7D
X
X/* get a line from the specified stack.  unless force'ing, don't
X`09go past a false bottom stack-separator */
Xstatic LINE *
Xpopline(LINEPTR *stkp, int force)
X`7B
X`09LINE *lp;
X
X`09lp = *stkp;
X
X`09if (lp == NULL `7C`7C (!force `26`26 lisstacksep(lp))) `7B
X`09`09undolog("popping null",lp);
X`09`09return NULL;
X`09`7D
X
X`09*stkp = lp->l_nxtundo;
X`09lp->l_nxtundo = null_ptr;
X`09undolog("popped", lp);
X`09return (lp);
X`7D
X
Xstatic LINE *
Xpeekline(LINEPTR *stkp)
X`7B
X`09return *stkp;
X`7D
X
Xstatic void
Xfreshstack(int stkindx)
X`7B
X`09register LINEPTR plp;
X`09/* push on a stack delimiter, so we know where this undo ends */
X`09if (b_is_changed(curbp)) `7B
X`09`09plp = lalloc(STACKSEP, curbp);
X`09`7D else `7B /* if the buffer is unmodified, use special separator */
X`09`09plp = lalloc(PURESTACKSEP, curbp);
X
X`09`09/* and make sure there are no _other_ special separators */
X`09`09nounmodifiable(curbp);
X`09`7D
X`09if (plp == null_ptr)
X`09`09return;
X`09set_lback(plp, BACKDOT(curbp).l);
X`09plp->l_back_offs = BACKDOT(curbp).o;
X`09set_lforw(plp, FORWDOT(curbp).l);
X`09plp->l_forw_offs = FORWDOT(curbp).o;
X`09pushline(plp, STACK(stkindx));
X`09if (stkindx == BACK) `7B
X`09`09plp->l_nextsep = null_ptr;
X`09`09if (curbp->b_udtail == null_ptr) `7B
X`09`09`09if (curbp->b_udcount != 0) `7B
X`09`09&0209mlwrite("BUG: null tail with non-0 undo count");
X`09`09&0209curbp->b_udcount = 0;
X`09`09`09`7D
X`09`09`09curbp->b_udtail = plp;
X`09`09`09curbp->b_udlastsep = plp;
X`09`09`7D else `7B
X`09`09`09if (curbp->b_udlastsep == null_ptr) `7B
X`09`09&0209/* then we need to find lastsep */
X`09`09&0209int i;
X`09`09&0209curbp->b_udlastsep = \150Btail;
X`09`09&0209for (i = curbp->b_udcount-1; i > 0; i-- ) `7B
X`09`09&0209`09curbp->b_udlastsep =
X`09`09&0209`09 curbp->b_udlastsep->l_nextsep;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`09curbp->b_udlastsep->l_nextsep = plp;
X`09`09`09curbp->b_udlastsep = plp;
X`09`09`7D
X`09`09/* enforce stack growth limit */
X`09`09curbp->b_udcount++;
X`09`09/* dbgwrite("bumped undocount %d", curbp->b_udcount); */
X`09`09if ( b_val(curbp, VAL_UNDOLIM) != 0 `26`26
X`09`09&0209curbp->b_udcount > b_val(curbp, VAL_UNDOLIM) ) `7B
X`09`09`09LINEPTR newtail;
X`09`09`09LINEPTR lp;
X
X`09`09`09newtail = curbp->b_udtail;
X`09`09`09while (curbp->b_udcount > b_val\1906, VAL_UNDOLIM)) `7B
X`09`09&0209newtail = \0A07->l_nextsep;
X`09`09&0209curbp->b_udcount--;
X`09`09`09`7D
X
X`09`09`09curbp->b_udtail = newtail;
X`09`09`09newtail = \0A07->l_nxtundo;
X`09`09`09if (newtail != null_ptr) `7B
X`09`09&0209do `7B
X`09`09&0209`09lp = newtail;
X`09`09&0209`09if (newtail == curbp->b_udlastsep)
X`09`09&0209&0209mlwrite("BUG: tail passed lastsep");
X`09`09&0209`09newtail = \0A07->l_nxtundo;
X`09`09&0209`09lfree(lp,curbp);
X`09`09&0209`7D while (newtail != null_ptr);
X`09`09`09`7D
X`09`09`09curbp->b_udtail->l_nxtundo = null_ptr;
X
X`09`09`7D
X`09`7D
X`7D
X
Xstatic void
Xmake_undo_patch(LINEPTR olp, \0D08nlp)
X`7B
X`09register LINEPTR plp;
X`09/* push on a tag that matches up the copy with the original */
X`09plp = lalloc(LINEUNDOPATCH, curbp);
X`09if (plp == null_ptr)
X`09`09return;
X`09set_lforw(plp, olp);`09/* \1406) is the original line */
X`09set_lback(plp, nlp);`09/* \1406) is the copy */
X`09pushline(plp, BACKSTK(curbp));
X`7D
X
Xstatic void
Xapplypatch(LINEPTR newlp, \0F08oldlp)
X`7B
X`09register LINE *tlp;
X`09for (tlp = *BACKSTK(curbp); tlp != NULL;
X`09`09&0209`09tlp = tlp->l_nxtundo) `7B
X`09`09if (!lispatch(tlp)) `7B
X`09`09`09if (lforw(tlp) == oldlp)
X`09`09&0209set_lforw(tlp, newlp);
X`09`09`09if (lback(tlp) == oldlp)
X`09`09&0209set_lback(tlp, newlp);
X`09`09`7D else `7B /* it's a patch */
X`09`09`09if (lforw(tlp) == oldlp) `7B
X`09`09&0209set_lforw(tlp, newlp);
X`09`09`09`7D
X`09`09`09if (lback(tlp) == oldlp) `7B
X`09`09&0209mlforce("BUG? copy is an old line");
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`7D
X
Xstatic LINEPTR
Xcopyline(register LINE *lp)
X`7B
X`09register LINE *nlp;
X
X`09nlp = lalloc(lp->l_used,curbp);
X`09if (nlp == NULL)
X`09`09return null_ptr;
X`09/* copy the text and forward and back pointers.  everything else
X`09`09matches already */
X`09set_lforw(nlp, \0B06lp));
X`09set_lback(nlp, \0B06lp));
X`09/* copy the rest */
X`09if (lp->l_text `26`26 n\0F0A)
X`09`09(void)memcpy(nlp->l_text, \0C0C(SIZE_T)\2006used);
X`09return nlp;
X`7D
X
Xstatic int
Xundoworker(int stkindx)
X`7B
X`09register LINEPTR lp;
X`09register LINEPTR alp;
X`09int nopops = TRUE;
X
X`09while ((lp = popline(STACK(stkindx), FALSE)) != 0) `7B
X`09`09if (nopops)  /* first pop -- establish a new stack base */
X`09`09`09freshstack(1`5Estkindx);
X`09`09nopops = FALSE;
X`09`09if (lislinepatch(lp)) `7B
X`09`09`09applypatch(lback(lp), lforw(lp));
X`09`09`09lfree(lp,curbp);
X`09`09`09continue;
X`09`09`7D
X`09`09if (lforw(lback(lp)) != \1407p)) `7B /* theres something\1106 */
X`09`09`09if (lforw\0606(lback(lp))) == \1B07p)) `7B
X`09`09&0209/* then there is exactly one line \1A06*/
X`09`09&0209/* alp is the line to remove */
X`09`09&0209/* lp is the line we're putting in */
X`09`09&0209alp = lforw(lback(lp));
X`09`09&0209repointstuff(lp,alp);
X`09`09&0209/* remove it */
X`09`09&0209set_lforw(lback(lp), \1106alp));
X`09`09&0209set_lback(lforw(alp), \1206alp));
X`09`09`09`7D else `7B /* there is more than one line \1C06*/
X`09`09&0209mlforce("BUG: no stacked line for an insert");
X`09`09&0209/* cleanup ? naw, a bugs\0706 */
X`09`09&0209return(FALSE);
X`09`09`09`7D
X`09`09`7D else `7B /* there is no line where we're going */
X`09`09`09/* create an "unreal" tag line to push */
X`09`09`09alp = lalloc(LINENOTREAL, curbp);
X`09`09`09if (alp == null_ptr)
X`09`09&0209return(FALSE);
X`09`09`09set_lforw(alp, \0B06lp));
X`09`09`09set_lback(alp, \0B06lp));
X`09`09`7D
X
X`09`09/* insert real lines into the buffer
X`09`09`09throw away the markers */
X`09`09if (lisreal(lp)) `7B
X`09`09`09set_lforw(lback(lp), lp);
X`09`09`09set_lback(lforw(lp), lp);
X`09`09`7D else `7B
X`09`09`09lfree(lp, curbp);
X`09`09`7D
X
X`09`09pushline(alp, OTHERSTACK(stkindx));
X`09`7D
X
X`09if (nopops) `7B
X`09`09if (stkindx == BACK `26`26 curbp->b_udcount != 0) `7B
X`09`09`09mlwrite("BUG: nopop, non-0 undo count");
X`09`09`7D
X`09`09return (FALSE);
X`09`7D
X
X#define bug_checks 1
X#ifdef bug_checks
X`09if ((lp = peekline(STACK(stkindx))) == 0) `7B
X`09`09mlforce("BUG: found null after undo/redo");
X`09`09return FALSE;
X`09`7D
X
X`09if (!lisstacksep(lp)) `7B
X`09`09mlforce("BUG: found non-sep after undo/redo");
X`09`09return FALSE;
X`09`7D
X#endif
X
X`09lp = popline(STACK(stkindx),TRUE);
X`09FORWDOT(curbp).l = lforw(lp);
X`09FORWDOT(curbp).o = lp->l_forw_offs;
X`09BACKDOT(curbp).l = lback(lp);
X`09BACKDOT(curbp).o = lp->l_back_offs;
X`09if (stkindx == FORW) `7B
X`09`09/* if we moved, update the "last dot" mark */
X`09`09if (!sameline(DOT, FORWDOT(curbp)))
X`09`09`09curwp->w_lastdot = DOT;
X`09`09DOT = FORWDOT(curbp);
X`09`7D else `7B
X`09`09/* if we moved, update the "last dot" mark */
X`09`09if (!sameline(DOT, BACKDOT(curbp)))
X`09`09`09curwp->w_lastdot = DOT;
X`09`09DOT = BACKDOT(curbp);
X`09`09/* dbgwrite("about to decr undocount %d", curbp->b_udcount); */
X`09`09curbp->b_udcount--;
X`09`09curbp->b_udlastsep = null_ptr;  /* it's only a hint */
X`09`09if (curbp->b_udtail == lp) `7B
X`09`09`09if (curbp->b_udcount != 0) `7B
X`09`09&0209mlwrite("BUG: popped tail; non-0 undo count");
X`09`09&0209curbp->b_udcount = 0;
X`09`09`09`7D
X`09`09`09/* dbgwrite("clearing tail 0x%x and lastsep 0x%x", curbp->b_udtail,
X`09`09&0209&0209curbp->b_udlastsep); */
X`09`09`09curbp->b_udtail = null_ptr;
X`09`09`09curbp->b_udlastsep = null_ptr;
X`09`09`7D
X`09`7D
X
X`09b_clr_counted(curbp);`09/* don't know the size! */
X`09if (lispurestacksep(lp))
X`09`09unchg_buff(curbp, 0);
X`09else
X`09`09chg_buff(curbp, WFHARD`7CWFINS`7CWFKILLS);
X
X`09lfree(lp,curbp);
X
X`09return TRUE;
X`7D
X
Xstatic void
Xsetupuline(LINEPTR lp)
X`7B
X`09register LINE *  ulp;
X`09/* take care of the U line */
X`09if ((ulp = curbp->b_ulinep) == NULL
X`09 `7C`7C (ulp->l_nxtundo != lp)) `7B
X`09`09if (ulp != NULL)
X`09`09`09lfree(curbp->b_ulinep, curbp);
X`09`09ulp = curbp->b_ulinep = copyline(lp);
X`09`09if (ulp != NULL)
X`09`09`09ulp->l_nxtundo = lp;
X`09`7D
X`7D
X
Xvoid
Xdumpuline(LINEPTR lp)
X`7B
X`09register LINE *ulp = curbp->b_ulinep;
X
X`09if ((ulp != NULL) `26`26 (ulp->l_nxtundo == lp)) `7B
X`09`09lfree(curbp->b_ulinep, curbp);
X`09`09curbp->b_ulinep = null_ptr;
X`09`7D
X`7D
X
X/* ARGSUSED */
Xint
Xlineundo(int f GCC_UNUSED, int n\120B)
X`7B
X`09register LINE *ulp;`09/* the Undo line */
X`09register LINE *lp;`09/* the line we may replace */
X`09register WINDOW *wp;
X`09register char *ntext;
X
X`09ulp = curbp->b_ulinep;
X`09if (ulp == NULL) `7B
X`09`09kbd_alarm();
X`09`09return FALSE;
X`09`7D
X
X`09lp = ulp->l_nxtundo;
X
X`09if (lforw(ulp) != \0E06lp) `7C`7C
X`09    lback(ulp) !=\0E07lp)) `7B
X`09    `09/* then the last change affected more than one line,
X`09`09`09and we can't use the saved U-line */
X`09`09dumpuline(curbp->b_ulinep);
X`09`09kbd_alarm();
X`09`09return FALSE;
X`09`7D
X
X`09/* avoid losing our undo stacks needlessly */
X`09if (linesmatch(ulp,lp) == TRUE)
X`09`09return TRUE;
X
X`09DOT.l = lp;
X
X`09preundocleanup();
X
X`09ntext = NULL;
X`09if (ulp->l_size `26`26 (ntext = typeallocn(char,\280B)) == NULL)
X`09`09return (FALSE);
X
X`09copy_for_undo(lp);
X
X`09if (ntext `26`26 lp->l_text) `7B
X`09`09(void)memcpy(ntext, ulp->l_\0D06(SIZE_T)llength(ulp));
X`09`09ltextfree(lp,curbp);
X`09`7D
X
X`09lp->l_text = ntext;
X`09lp->l_used = u\0E0A;
X`09lp->l_size = u\0E0A;
X
X#if ! WINMARK
X`09if (MK.l == lp)
X`09`09MK.o = b_left_margin(curbp);
X#endif
X`09/* let's be defensive about this */
X`09for_each_window(wp) `7B
X`09`09if (wp->w_dot.l == lp)
X`09`09`09wp->w_dot.o = b_left_margin(curbp);
X#if WINMARK
X`09`09if (wp->w_mark.l == lp)
X`09`09`09wp->w_mark.o = b_left_margin(curbp);
X#endif
X`09`09if (wp->w_lastdot.l == lp)
X`09`09`09wp->w_lastdot.o = b_left_margin(curbp);
X`09`7D
X`09do_mark_iterate(mp,
X`09`09`09if (mp->l == lp)
X`09`09&0209mp->o = b_left_margin(curbp);
X`09);
X
X`09chg_buff(curbp, WFEDIT`7CWFKILLS`7CWFINS);
X
X`09return TRUE;
X
X`7D
X
X
X#define _min(a,b) ((a) < (b)) ? (a) : (b)
X
Xstatic void
Xrepointstuff(register LINEPTR nlp, \1611olp)
X`7B
X`09register WINDOW *wp;
X`09int`09usenew = lisreal(nlp);
X`09register LINEPTR point;
X`09register LINE *  ulp;
X
X`09point = usenew ? nlp : lforw(olp);
X#if ! WINMARK
X`09if (MK.l == olp) `7B
X`09`09MK.l = point;
X`09`09MK.o = _min(MK.o, llength(point));
X`09`7D
X#endif
X`09/* fix anything important that points to it */
X`09for_each_window(wp) `7B
X`09`09if (wp->w_dot.l == olp) `7B
X`09`09`09wp->w_dot.l = point;
X`09`09`09wp->w_dot.o = _min(\130B, llength(point));
X`09`09`7D
X`09`09if (wp->w_line.l == olp)
X`09`09`09wp->w_line.l = point;
X#if WINMARK
X`09`09if (wp->w_mark.l == olp) `7B
X`09`09`09wp->w_mark.l = point;
X`09`09`09wp->w_mark.o = _min(\140C, llength(point));
X`09`09`7D
X#endif
X`09`09if (wp->w_lastdot.l == olp) `7B
X`09`09`09wp->w_lastdot.l = point;
X`09`09`09wp->w_lastdot.o = _min(\170F, llength(point));
X`09`09`7D
X`09`7D
X`09do_mark_iterate(mp,
X`09`09`09if (mp->l == olp) `7B
X`09`09&0209`09mp->l = point;
X`09`09&0209`09mp->o = _min(mp->o, llength(point));
X`09`09`09`7D
X`09);
X
X`09/* reset the uline */
X`09if ((ulp = curbp->b_ulinep) != NULL
X`09 `26`26 (ulp->l_nxtundo == olp)) `7B
X`09`09if (usenew) `7B
X`09`09`09ulp->l_nxtundo = point;
X`09`09`7D else `7B
X`09`09`09/* we lose the ability to undo all changes
X`09`09&0209to this line, since it's going away */
X`09`09`09curbp->b_ulinep = null_ptr;
X`09`09`7D
X`09`7D
X
X`7D
X
X
Xstatic int
Xlinesmatch(register LINE *lp1, \14112)
X`7B
X`09if (llength(lp1) != \100A2))
X`09`09return FALSE;
X`09if (llength(lp1) == 0)
X`09`09return TRUE;
X`09return !memcmp(lp1->l_text, lp2\0D0A(SIZE_T)llength(lp1));
X`7D
X
$ call unpack [.VILE-8_0]UNDO.C;1 -
 1616730962 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 48 118 152
$!
$ create 'f'
X/*
X * version `26 usage-messages for vile
X *
X * $Header: /usr/build/vile/vile/RCS/version.c,v 1.37 1998/05/27 23:46:32 tom
V Exp $
X *
X */
X
X#include`09"estruct.h"`09/* global \1406ures and defines */
X#include`09"edef.h"`09/* global definitions */
X#include`09"patchlev.h"
X
Xstatic`09char`09version_string`5BNSTRING`5D;
X
Xvoid
Xprint_usage (void)
X`7B
X`09static`09const char *\0C06options`5B`5D = `7B
X`09"-h             to get help on startup",
X`09"-gNNN          or simply +NNN to go to line NNN",
X`09"-sstring       or +/\1207to search for `5C"\2906`5C"",
X#if OPT_TAGS
X`09"-ttagname      to look up a tag",
X#endif
X`09"-v             to edit in `5C"view`5C" mode -- no changes permitted",
X`09"-R             to edit files `5C"read-only`5C" -- no writes permitted",
X#if OPT_ENCRYPT
X`09"-kcryptkey     for encrypted files (same as -K)",
X#endif
X#if DISP_X11
X`09"-name name     to change program\1B06for X resources",
X`09"-wm name       to set\1206in title bar",
X`09"-fg color      to change foreground\2006",
X`09"-bg color      to change background\2006",
X`09"-fn fontname   to change font",
X`09"-fork          to spawn xvile immediately on startup",
X`09"+fork          to force xvile to not spawn on startup",
X`09"-display       \0E07name to change the default\2208",
X`09"-rv            for reverse video",
X`09"-geometry CxR  to set initial size to R rows and C columns",
X`09"-xrm Resource  to change an xvile r\1D07",
X`09"-leftbar       Put scrollbar(s) on left",
X`09"-rightbar      Put scrollbar(s) on right (default)",
X#endif
X#if DISP_IBMPC `7C`7C\0E06BORLAND
X`09"-2             25-line mode",
X`09"-4             43-line mode",
X`09"-5             50-line mode",
X#if SYS_OS2
X`09"-6`09`0960-line mode",
X#endif
X`09"(see help file for more screen resolutions)",
X#endif
X`09"-V             for version info",
X`09"use @cmdfile to run \0F08as commands (this will suppress .vilerc)"
X`09`7D;
X`09register SIZE_T`09j;
X
X`09ttclean(TRUE);
X`09(void)fprintf(stderr, "usage: %s `5B-flags`5D `5B@cmdfile`5D files...`5Cn",
V
X`09`09prog_arg);
X`09for (j = 0; j < TABLESIZE(options); j++)
X`09`09(void)fprintf(stderr, "`5Ct%s`5Cn", options`5Bj`5D);
X`09ExitProgram(BADEXIT);
X`7D
X
Xconst char *
Xgetversion(void)
X`7B
X`09if (*version_string)
X`09`09return version_string;
X#if SYS_UNIX `7C`7C SYS_VMS
X`09/*
X`09 * We really would like to have the date at which this program was
X`09 * linked, but a.out doesn't have that in general.  COFF files do.
X`09 * Getting the executable's modification-time is a reasonable
X`09 * compromise.
X`09 */
X`09(void) lsprintf(version_string, "%s %s%s for %s",
X`09`09&0209prognam, version, PATCHLEVEL, opersys);
X`09`7B
X`09`09char *s;
X`09`09if ((s = flook(prog_arg,
X`09`09&0209(FL_EXECDIR`7CFL_PATH)`7CFL_EXECABLE)) != NULL) `7B
X`09`09`09time_t mtime = file_modified(s);
X`09`09`09if (mtime != 0) `7B
X`09`09&0209(void)strcat(version_string, ", installed ");
X`09`09&0209(void)strcat(version_string, ctime(`26mtime));
X`09`09&0209/* trim the newline */
X`09`09&0209version_string`5Bstrlen(\160E)-1`5D = EOS;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X#else
X# if SYS_MSDOS `7C`7C SYS_OS2\0B08WINNT
X#  if defined(__DATE__) `26`26 !SMALLER
X`09(void)lsprintf(version_string,"%s %s%s for %s, built %s %s with %s",
X`09`09prognam, version, PATCHLEVEL, opersys, __DATE__, __TIME__,
X#   if CC_WATCOM
X`09`09"Watcom C/386"
X#   endif
X#   if CC_DJGPP
X#    if __DJGPP__ >= 2
X`09`09"DJGPP v2"
X#    else
X`09`09"DJGPP"
X#    endif
X#   endif
X#   if CC_TURBO
X#    ifdef __BORLANDC__
X`09`09"Borland C++"
X#    else
X        \0808"Turbo C"
X#    endif
X#   endif
X#   if CC_CSETPP
X#    if __IBMC__ >= 300
X`09`09"VisualAge C++"
X#    else
X`09`09"IBM C Set ++"
X#    endif
X#   endif
X#   if CC_MSVC
X`09`09"Visual C++"
X#   endif
X`09);
X#  endif
X# endif /* SYS_MSDOS `7C`7C SYS_OS2\0B08WINNT */
X#endif /* not SYS_UNIX or SYS_VMS */
X`09return version_string;
X`7D
X
X/* ARGSUSED */
Xint
Xshowversion(int f GCC_UNUSED, int n\120B)
X`7B
X`09mlforce(getversion());
X`09return TRUE;
X`7D
X
X
X/*
X * Returns the special string consisting of program name + version, used to
X * fill in the filename-field for scratch buffers that are not associated with
V
X * an external file.
X */
Xconst char *
Xnon_filename(void)
X`7B
X`09static`09char`09buf`5B80`5D;
X`09if (buf`5B0`5D == EOS)
X`09`09(void)lsprintf(buf, "       %s   %s%s",
X`09`09&0209prognam, version, PATCHLEVEL);
X`09return buf;
X`7D
$ call unpack [.VILE-8_0]VERSION.C;1 -
 1783231713 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 9 119 152
$!
$ create 'f'
X.`5C" obligatory man page for vile
X.`5C" $Header: /usr/build/vile/vile/RCS/vile.1,v 1.17 1998/03/15 21:28:52 pgf
V Exp $`20
X.TH VILE 1
X.SH NAME
Xvile, xvile `5C- `5CfBVI L`5CfRike`5CfR `5CfBE`5CfRmacs
X.SH SYNOPSIS
X.B "vile `5B-hVv`5D `5B-s`5CfIpattern`5CfB`5D `5B+`5CfI/\120D-t`5CfItag\0E07g
V`5CfINNN\2E0A\0D09@`5CfIcmdfile\4C06`5CfIfilename`5CfB`5D..."
X.SH DESCRIPTION
X.I vile
Xis a text editor.  This man page is fairly terse.  More information can
Xbe obtained from the internal help, available with the `5CfB-h`5CfR option
Xor by using the ":help" command from within
X.IR vile .
X.PP
X.I xvile
Xis the same text editor, built as an X-windows application, with fully
Xintegrated mouse support, scrollbars, etc.
X.SH "SPIRIT"
X.I vile
Xretains the "finger-feel", if you will, of
X.IR vi ,
Xwhile adding the
Xmultiple buffer and \1409window features of emacs and other editors.
XIt is definitely not a vi clone, in that some substantial stuff is
Xmissing, and the screen doesn't look quite the same. `20
XThe things that you tend to type over and
Xover probably work.  Things done less frequently, like configuring
Xa startup file, are somewhat (or very, depending on how ambitious
Xyou are) different.
XBut what
Xmatters most is that one's "muscle memory" does the right thing
Xto the text in front of you, and that is what
X.I vile
Xtries to do for vi users.
X.SH OPTIONS
X.IP "+`5CfINNN`5CfR and -g\1009"
X.I vile
Xwill begin the session on the first file at the specified line number.
X.IP "+/`5CfIpattern`5CfR or -s \140D"
XIn the first file,
X.I vile
Xwill execute an initial search for the given pattern.
X.IP "-t `5CfItag`5CfR"
X.br
X.I vile
Xwill edit the correct file and move the cursor to the location of the tag.
XThis requires a tagsfile created with the`20
X.IR ctags (1)
Xcommand.  The option -T is equivalent, and can be used when X11\3207
Xparsing eats the -t.
X.IP -h
XInvokes
X.I vile
Xon the helpfile.
X.IP -R
XInvokes
X.I vile
Xin "readonly" mode `5C- no writes are permitted while
Xin this mode.
X(This will also be true if
X.I vile
Xis invoked as
X.IR view ,
Xor if "readonly" mode is set in the startup file.)
X.IP -v
XInvokes
X.I vile
Xin "view" mode `5C- no changes are permitted to any buffer while
Xin this mode.
X.IP -V
X.I vile
Xwill report its version number.
X.IP @`5CfIcmdfile`5CfR
X.I vile
Xwill run the specified file as its startup
Xfile, and will bypass any normal startup file (i.e.
X.IR .vilerc )
Xor environment variable (i.e.`20
X.IR $VILEINIT ).
X.IP "-25 -43 -50"
XOn PC systems you may be able to set the initial screen resolution from the
Xcommand line.  See
X.I vile.hlp
Xfor details.
X.PP
X.IR xvile -specific
Xcommand-line options are detailed in the help file (see "Standard X \4407
Xline arguments").  The standard ones (e.g. -display, -fn, -geometry, -name,
Xetc.) are all supported.
X.SH "INVOCATION"
Xvile will edit the files specified on the command line.  If no\2C06
Xare specified, and standard input is not connected to a terminal, then
Xvile will bring up a buffer containing the output of the pipe it is
Xconnected to, and will re-open /dev/tty for commands.  Files (except for
Xthe first) are not actually read into buffers until "visited".  All\1E08
Xare kept in memory: machines with not much\1F07 or swap space may
Xhave trouble with this.
X.SH "STARTUP"
XIf the
X.IR @ cmdfile
Xoption is given, then the file given as "cmdfile"
Xwill be run before any files are loaded.  If no
X.I @
Xoption appears, startup commands will be taken from the user's
X.I VILEINIT
Xvariable, if it is set, from the file
X.I .vilerc
Xin the current directory, if it exists, or from
X.IR $HOME/.vilerc ,
Xas a last resort.
XSee the help file for examples of what sorts of things might go into
Xthese command files.
X.SH "COMMANDS"
XPlease refer to the help available within`20
X.I vile
Xfor
X.IR vile -specific
Xcommands.
X(That document, however, assumes familiarity with vi.)
XShort descriptions
Xof each`20
X.I vile
Xcommand may be obtained with the ": describe-function" and`20
X": describe-key" commands.  All\0F09 may be listed with ": show-\3308".
X.PP
+-+-+-+-+-+-+-+-  END  OF PART 107 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 108 -+-+-+-+-+-+-+-+
XAdditional documentation on writing macros using the internal scripting
Xlanguage can be found in the file "macros.doc", distributed with the vile
Xsource.
X.SH "RELATED PROGRAMS"
X.I vile
Xmay also be built and installed as
X.IR xvile ,
Xin which case it
Xbehaves as a native X Windows application, with scrollbars, better mouse
Xsupport, etc.  The help file has more information on this.
X.PP
XThere is a program distributed with the vile source which
Xis usually installed as
X.IR vile-manfilt .
X(Two versions of the source for`20
X.I vile-manfilt
Xare available, in C (manfilt.c) and in Perl\180Apl).)
XIt may be used in conjunction with
X.I vile
Xor
X.I xvile
X(with the help of the macro in the file manpage.rc)
Xto filter and view system manual pages.
X.I xvile
Xwill even`20
X(with your font set properly)`20
Xdisplay certain portions of the manual
Xpage text in bold or italics as appropriate. `20
XSee the help file for details.
X.PP
XLikewise, there is a
X.I vile-c-filt
Xprogram which can embolden, underline, or perform coloring on C p\4006
Xsource code.   (And again, two versions of the \2F06, in C and in "flex",
Xare available.) Again, see the help file for more information.`20
X.PP`20
XThe program`20
X.I vile-crypt`20
Xcan be used to encrypt/decrypt files using the same algorithm as `20
X.IR vile 's`20
Xinternal crypt algorithm.  The encryption key can be specified on the`20
Xcommand line with "-k key", and "-m" can be used to treat the file as a`20
Xmail message; in that case, only text after the first blank line will be`20
Xcrypted, leaving the headers intact and only affect\2608body of the`20
Xmessage.  Text to be encrypted can be specified as filenames on the command`20
Xline, or provided as the standard input.  On systems with a getpass()`20
Xlibrary routine, the user will be prompted for the encryption key if it is`20
Xnot given on the command line.  To accomodate systems (such as linux) where`20
Xthe getpass() library routine is not interruptible from the keyboard,`20
Xentering a crypt-key password which ends in `5EC will cause the program to`20
Xquit.  See the help file for more information on`20
X.IR vile 's`20
Xencryption support.`20
X`20
X.SH "SEE ALSO"
XYour favorite vi document, the file
X.IR macros.doc ,
Xand the
X.I vile
Xhelp page, available with the
X.I -h
Xoption or as the text file
X.IR vile.hlp .
X.SH "DEBTS and CREDITS"
X.I vile`20
Xwas originally built from a copy of microEmacs, so a large debt of gratitude
Xis due to the developers of that program.  A lot of people have helped with
Xcode and bug reports on
X.IR vile .
XNames are named at the bottom of the help file.
X.SH "AUTHORS"
X.I vile
Xwas created by Paul Fox, Tom Dickey, and Kevin Buettner.
X.SH "BUGS"
XThe "`5CfBVI L`5CfRike`5CfR `5CfBE`5CfRmacs" joke isn't really funny.  It only
V
Xsounds that way.  :-)   Other suspicious behavior should be reported
Xto vile-bugs@foxharp.boston.ma.us.
$ call unpack [.VILE-8_0]VILE.1;1 -
 1936002749 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 14 120 152
$!
$ create 'f'
X
XGetting along with vile`09`09&0209&0209(version 8.0)
X--------\0808\1007`09`09&0209&0209\1D0D
X
X`09Use Ctrl-D and\0B06U to scroll through this help information.
X
X`09Type Ctrl-O to make this the only window on the screen.
X`09Type Ctrl-K to get rid of this window.
X
X`09First, to leave vile, use any of the following:
X`09`09:q
X`09`09:quit
X`09`09:exit
X`09`09:wq`09(writes current buffer before quitting)
X`09`09:q!`09(quits without writing any changes!)
X`09`09Q
X`09`09:wwq or ZZ`09(will write all changed buffers)
X`09`09`5EX-`5EC`09(don't know why.  _They_ \1806put in ":q" for _us_!
X`09`09`09 Actually, if `5EC is your interrupt character, this
X`09`09`09 won't get you out of vile.)
X
X`09To get help (probably just this text), use any of:
X`09`09:h
X`09`09:help
X`09`09`5EX-h
X`09`09`5EA-h
X
X`09The only vile commands described herein are those not present in
X`09vi, or differing greatly from those in vi.  There is a section at
X`09the bottom describing other differences between vile and vi.
X
X`09To get a complete list of all commands, type ":show-\1608".  To
X`09get a list of all commands that contain the string "name", type
X`09":apropos name".  These lists will show all command synonyms and
X`09key sequences that are bound to the same function, along with a
X`09short description of the command, and whether it is a mo\2B06r
X`09operator command.
X
X`09To get information on a specific key-binding or function, use the
X`09"describe-key" or \120Afunction" commands.  You will be asked
X`09for a keystroke or function name, and a short description will be
X`09shown.
X
X`09You needn't type full command names --\1B06a few characters and
X`09hit TAB to perform command completion.  Hitting a second TAB will
X`09pop up a window containing the list of possible completions.
X
X`09If your screen hops around a lot when you scroll, see the "Note on
X`09Scrolling" section near the bottom of this file.
X
XGeneral Remarks
X--------\0807
X
X`09vile holds text in "buffers".  Usually, these correspond to a file
X`09that you are editing, but not always.  For instance, a buffer
X`09might be used to display this help text, or to hold the output
X`09of a shell command that you have run.  Buffers\1306names, and
X`09these usually match the names of the files they contain.
X
X`09Buffers are sometimes displayed in windows.  A buffer may be
X`09displayed in more than one window at the same time.  There is
X`09no such thing as a hidden window.  All existing \1606s are on
X`09the screen.  There may, however, be hidden buffers, which are not
X`09currently associated with any window.
X
X`09All yank/delete registers (the default unnamed\1F09, the numbered
X`09registers ("1-"9) that hold line-deletes, and the named \3809
X`09("a-"z)) are global to the editor, and not attached to any single
X`09buffer.  Thus you can delete text in one \2906 and put it back in
X`09another.
X
X`09Undo operations are attached to a buffer, not a window.  Thus if
X`09you have two windows to the same buffer, and make a change in one,
X`09you can undo it in the other.
X
X`09vile is 8-bit clean, allowing it to be used more easily at non-
X`09English speaking sites.  See the section on "8-Bit Operation" for
X`09more information.
X
XCommand Prefixes
X--------\0808
X
X`09To extend the vi command set in vile, two (or three, depending on
X`09how you count them) command "prefixes" exist.  These keystrokes,
X`09in combination with another key, can be bound as a pair to execute
X`09any vile function.  The default values for these prefixes are
X`09`09Key:&0209`09Bound to dummy function:
X`09`09`5EX     Control-X `09cntl_x-prefix
X`09`09`5EA     Control-A `09cntl_a-prefix
X`09`09#      poundsign`09function-prefix
X`09If you find any of these keys hard to type, or would prefer that
X`09they are all control characters (or all non-\1F07), they can
X`09be changed by binding a new key to the function listed above.  See
X`09the section on "Key Rebinding" below.  If you do change the values
X`09of these keys, most of vile's informational displays (the Binding
X`09List, for instance) will reflect these changes.  This documentation,
X`09of course, will not change.
X
X`09(The '#' key is used in vi to give terminal independent access
X`09to function key bindings.  This is also true in vile -- if something
X`09is bound to '#2', then it is also probably available with key F2
X`09on your keyboard.)
X
XBuffer manipulation commands:
X--------\0808\100D
X
X`09vile stores buffers in a sorted list.  Depending on the
X`09setting of the "autobuffer" mode, this list is either sorted
X`09in "most-recently-used" order (this is the vile default), or in a
X`09fixed order dependent on the\1707of editing (this is how vi
X`09normally does it, and can be attained by turning "autobuffer"
X`09off, with "set noautobuffer").
X
X`09_`09Show a list of the first 9 buffers.  Follow this command
X`09`09with a digit to select that buffer, or simply repeat it
X`09`09("__") to select the buffer most-recently visited.  In
X`09`09autobuffer mode, this is identical to "_1".  If \300A
X`09`09mode is off, the buffer which will be visited with "__" is
X`09`09flagged with a '#' character in the list.  Modified buffers
X`09`09are preceded by a '*' in the history list.  There are many
X`09`09different ways to get the previous file:
X`09`09`09__
X`09`09`09_1`09(autobuffer mode on)
X`09`09`091_`09(    "    \0808")
X`09`09`09:e#
X`09`09`09`5E`5E   (ctrl-`5E)  (but many keyboards can't produce this)
X
X`09`09The buffer number may also precede the '_' command.  This is
X`09`09necessary when visiting buffers numbered higher than '9'.  For
X`09`09example, one would type "13_" to visit buffer 13 in the list.
X
X`09`09`5B See the note under "Differences", below, for comments on
X`09`09vi's use of '_'.`5D
X
X`09:e`09Edit a file.  If the file is already in a buffer, that \0D06
X`09`09will be recalled into the current window.  This occurs as
X`09`09follows: If the name given contains no path delimiters
X`09`09(i.e. slashes), then it will be compared to the existing
X`09`09vile buffer names.  Failing that comparison (or if there
X`09`09are any slashes in the name),\0B09 will be stretched
X`09`09into an absolute path, and will be compared to the existing
X`09`09buffers' filenames.  In either case, the matching \3206
X`09`09will be chosen.  If there are no such matches, the file
X`09`09will be fetched from the filesystem.  This matching
X`09`09technique introduces an ambiguity, since buffer names are
X`09`09created from the last path component of filenames.  To
X`09`09force vile to edit a file from the current directory whose
X`09`09basename matches that of one that was edited elsewhere,
X`09`09simply preface the name with "./".  For example, if you
X`09`09edit "../Makefile" and later attempt to \2806\2509,
X`09`09vile will assume you are referring to the _buffer_ named
X`09`09"Makefile".  To get the file in the current directory,
X`09`09specify "./Makefile".
X
X`09:e!`09Re-edit a file.  A different filename can be given, and the
X`09`09buffer name will change to match it.  This command is not as
X`09`09necessary in vile as it is in vi, since multiple buffers may
X`09`09have outstanding unwritten changes.
X
X`09:n`09Go to the next buffer.  "Next" means "least recently used"
X`09`09in autobuffer mode.  In no\170F, "next" means
X`09`09next in numeric sequence.  (The ":n file ..." version of
X`09`09the command is not supported.)
X
X`09:rename-buffer   Rename the current \1C06.  Prompts for a new name.
X`09`09Does not affect the filename associated with the buffer.
X`09`09Use ":f" to do that.  This command is useful for renaming
X`09`09the "`5BOutput`5D" buffer, if you wish to preserve its
X`09`09contents, but run a new command.
X
X`09:rewind`09Go to the first buffer.  This is used only in 'noauto\2506'
X`09`09(vi-style buffering) mode.  It does nothing in "auto\2A06"
X`09`09mode.  Remember that "autobuffer" mode is the default.
X
X`09:b`09Edit a buffer.  Recalls the named\1B0ADoes not look for
X`09`09a file of that name.  Will find "invisible" buffers.
X
X`09:ki`09Kill a buffer.  Remove the \1406 and its contents from the
X`09`09editor.  Will ask if changes to the buffer should be
X`09`09discarded.
X
X`09`5EX-e`09Edit the file whose pathname appears under the cursor.  For
X`09`09example, if you are editing a makefile, you could edit one
X`09`09of the source files by placing the cursor at\2A06tart of
X`09`09its name and using this command.  Note that\1906does not
X`09`09know about some characters that your shell might usually
X`09`09translate for you, like the '$' in '$HOME'.
X
X`09`5EX-k`09Kill the buffer whose name or filename appears under the
X`09`09cursor.
X
X`09*`09Display a list of all buffers, or make that d\2C07go away
X`09`09if it's already present.  Leave your finger on the key, and
X`09`09it's easy to create and destroy the list.  The buffers are
X`09`09numbered; the \0E06s correspond to the history\2208
X`09`09shown and used by the '_' command, described above.  (If
X`09`09the buffer number is greater than 9, then the "nn_" form of
X`09`09the '_' command must be used, sinc\2006will only accept a
X`09`09single following digit.)  The order of the list is either
X`09`09most-recently-used, or fixed, depending on the setting
X`09`09of "autobuffer" mode (see below).  vile attempts to keep
X`09`09the contents of the buffer list window up to date if it
X`09`09is left up on the screen while other buffer manipulation
X`09`09commands are given.
X
X`09`5EA-*`09Always display a list of all buffers.  Useful for updating the
X`09`09list if it's already on the screen but may be out of date.
X`09`09Any argument will cause the list to include _all_ buffers,
X`09`09even those normally considered "invisible".  (For example,
X`09`09macros are stored in "invisible" buffers.)  `5BThis command
X`09`09isn't as necessary now that the buffer list is maintained
X`09`09dynamically...`5D
X
XWindow manipulation commands:
X--------\0808\100D
X
X`09`5EX-2`09Make Two windows.  Splits the current\1D07 in half. This
X`09`09is the usual way to create a new window.
X`09`5EK or `5EX-0`09Get rid of (Kill) this window.
X`09`5EO or `5EX-1`09Make this the Only window on the screen.
X
X`09`5EX-o`09Move to the next window.
X`09`5EX-O`09Move to the previous window.
X
X`09v`09Make the current window smaller.
X`09V`09Make the current window larger.
X
X`09`5EA-`5ED`09Scroll the next window down half a screen.
X`09`5EA-`5EU`09Scroll the next window up half a screen.
X`09`5EA-`5EE`09Scroll the next window up one line.
X`09`5EA-`5EY`09Scroll the next window down one line.
X`09(The previous four commands are useful when comparing two buffers.
X`09 Mnemonic -- think of them as affecting the "A"lternate window.)
X
X`09zH zM zL
X`09zt zm zb
X`09`09These are synonyms for vi's 'z+', 'z.', and 'z-', which
X`09`09position the line holding the cursor at the top, middle, or
X`09`09bottom of the screen, respectively.  (Any\2309econd
X`09`09characters can be upper or lower case.)  Mnemonically, these
X`09`09correspond to the H, M, and L screen positioning commands,
X`09`09or to "top", "middle", or "bottom" -- take your choice.
X`09`09In a macro, only the first character of the argument is
X`09`09significant, but something like "position-window middle" is
X`09`09most readable.  Supplying a count will offset that far
X`09`09from the top or bottom of window.  (But the middle is
X`09`09always the middle.)
X
X`09`5EX-`5ER`09Scroll the window right or left by 1/3 of a screen, or by the
X`09`5EX-`5EL`09number of columns specified.  Changes the "sideways" value.
X`09`09Neither of these commands will actually move the cursor
X`09`09in the buffer -- they only reframe your view into\2F0B.
X`09`09If the cursor would be forced to move off-screen (which is
X`09`09of course impossible and undesirable) as a result of the
X`09`09requested sideways scroll, then nothing at all will happen.
X`09`09The commands are arguably crippled as is.
X
X`09If for some reason you can't get your screen set right via a
X`09TERM variable, try the ":screen-rows" or\120Acolumns"
X`09commands (which take their args (number of rows or columns
X`09respectively) before you type the ":").
X
X`09`5B Personally, I put the following bindings in my .vilerc:
X`09    bind-key split-current-window `5ET`09;\1A06 into 'T'wo \1D06s
X`09    bind-key next-window `5EN`09`09; 'N'ext \1406
X`09    bind-key previous-window `5EP`09`09; 'P'\1807 \1806
X`09Since `5EK already 'K'ills a window, and `5EO makes it the 'O'nly \2307
X`09these give more mnemonic, and faster, access to multiple windows.
X`09(These would be the default, but `5EN, `5EP, and `5ET have other meanings
X`09in real vi (all of which have alternate bindings in vile.) `5D
X
XFile manipulation commands:
X--------\0808\100B
X
X`09The usual ":e", ":r", ":f", ":w" commands are available, though
X`09only ":e!" and ":w!" are available of the "!" options.  The ":r"
X`09command reads the named file in after the current line.  To read a
X`09file before the first line, use ":0r".  File completion works like
X`09command completion: using the TAB and '?' keys you can\2F08e or
X`09see next character choices.  Additionally, on unix hosts, backquotes
X`09may be used to invoke a shell command that returns the path of a
X`09desired file.  For example:
X
X`09`09:e `60which locks`60       # csh looks for script called "locks"
X`09`09:e `60type -path locks`60  # bash equivalent
X
X`09The commands ":ww" and ":wwq" correspond roughly to ":w\2609q",
X`09but they each write all modified buffers, rather than just the
X`09current one.  Giving any numeric argument to ":ww" (i.e. "1:ww")
X`09will suppress the per-file and "Press return to continue" message.
X`09This may be useful when using the command from within a macro.
X
X`09As in vi, ranges of lines specified by line numbers (including '.',
X`09'$', and '%' shorthands) or marks may precede these commands.
X`09Unlike vi, search patterns cannot be used as line specifiers.
X
X`09In addition, two non-"colon" commands have been added:
X
X`09`5ER`09Prompts for a filename, and then reads it in _above_ the
X`09`09current line.  If a register is specified (e.g. "a`5ER ),
X`09`09the file is read into that named register, but not inserted
X`09`09into the current buffer.
X
X`09`5EW`09is a writing operator, which prompts for a filename, and
X`09`09writes the specified region to that file.  Like all operators,
X`09`09if the command is repeated, as in `5EW`5EW, then lines are
X`09`09affected.  Use 10`5EW`5EW to write 10 lines.
X
X`09`09If a register is specified (e.g. "a`5EW ) then the command
X`09`09is _not_ an operator, but writes the specified register to
X`09`09the named file.
X
XShell Access
X------------
X
X`09Anywhere a filename is valid, a command \1908also
X`09valid, entered in the form "!shell-command".  The whole line is
X`09handed to the shell, and the read or write operation is done on
X`09the commands standard input or output, as appropriate.  Thus
X`09you can type ":e !date" to edit a copy of today's date.
X
X`09The ": !cmd" shell escape works pretty much as it does in vi.
X`09The command ":!!" will rerun the previous such shell \3107.
X
X`09The '!' operator works as a filter, as expected.
X
X`09In addition, the `5EX-! command runs a shell\1509and captures
X`09its output in a specific buffer, called "`5BOutput`5D".  This is
X`09almost identical to ":e !cmd", except that in\0806case the buffer
X`09is named according to the command name.
X
X`09These "output capture" commands are most useful in conjunction with
X`09the "error finder", '`5EX-`5EX', described below.
X
X`09Filename completion is performed on words of the shell command
X`09in response to a TAB character.  To actually include \260F
X`09in the shell command, escape it with `5EV.  C\1D06 completion is
X`09not currently implemented -- so, for instance, $PATH is not searched
X`09for possible completions to the first word of a command line.
X
X`09On systems supporting job control, `5EZ (or ":stop") will suspend vile.
X
X`09The :cd and :pwd commands are of course supported.  Unlike vi,
X`09filenames will track their directory of origin, so you can't simply
X`09edit a file in one directory, cd to another, and write it.  You
X`09must explicitly write to ./filename in the new directory to
X`09accomplish this.  ":cd -" will return to the previous directory, as
X`09it does in some shells.  The CDPATH environment variable provides a
X`09search path for the :cd command.
X
X`09Giving an argument to the ": !" (also called "shell-command" when
X`09writing macros) will suppress the "Press return to continue" message
X`09after the command runs.
X
XText manipulation command:
X--------\0808\100A
X
X`09Remember, these are only the new or different commands.  The
X`09standard vi set should still work.
X
X`09The vi "global" (":g") command is present.  So is the "substitute"
X`09(":s") command.  These both look pretty different while they're
X`09being used than they do in vi, due to the interactive nature of
X`09the prompting.  And, since the searching is done right after the
X`09pattern is entered, there may be a slight delay while you're trying
X`09to finish typing your complete command.  (If the pattern does not
X`09exist, you may not get to finish typing your command at all.)  You
X`09can use the commands just as you would have in vi, i.e.
X`09":g/oldpat/s//newstring/" will work.  But you won't see any of the
X`09'/' characters.  Try it-- you'll get the idea.  Line ranges are not
X`09possible on ":g", but they ar\1607s".
X
X`09The ":g" command can be followed by any of l (list), p (print),
X`09< (left shift), > (righ\110Ar (read file), d (delete),
X`09L (lower case), U (upp\100A`7E (flip\1F08put (append
X`09yanked text), Put (prepend \1B0Es (substitute),
X`09trim (trim trailing whitespace).  For example, ":g/pattern/Put"
X`09will insert the contents of the default yank register just
X`09above every line containing "pattern".   The ":g" command can
X`09only be used over the entire file -- smaller regions are not
X`09permitted.
X
X`09The ":v" counterpart to ":g" is also implemented -- it performs the
X`09given command on all lines that don't match the \3006pattern.
X
X`09The substitute command can be followed by any of 'g', a digit, or
X`09'p', to do the substitution for all occurrences, the n'th
X`09occurrence, or to print the resulting line respectively.  You can
X`09also add a 'c', and you will be asked to confirm each replacement
X`09before it occurs.  The text being replaced will be highlighted,
X`09and you can answer with 'y', 'n', 'q', or 'a'.  'a' will suppress
X`09further prompting, and will do the rest of\0C07placements.
X
X`09The ":`26" and '`26' commands work much as they do in vi, and repeat
X`09the last substitution.  The '`5EA-`26' command is a new operator (see
X`09below), so it can work on regions: for example use '`5EA-`26`7D' to
X`09"repeat the previous substitution over the rest of this paragraph".
X
X`09Infinite Undo
X`09--------\0806
X`09The regular undo ('u') and line-\1407U') are available for all
X`09commands.  They are a little more predictable than their vi
X`09counterparts, since they do not share the default yank register for
X`09their operation.  Also, line-undo ('U') is available until the next
X`09change anywhere in the file, rather than until you leave the line.
X
X`09vile also lets you undo all changes made to a buffer since it was
X`09first edited (so-called "infinite undo").  The '`5EX-u' command will
X`09undo changes, one by one (or given a count, several at a time).
X`09The '`5EX-r' command will walk forward, redoing the previously undone
X`09changes one by one.  A fresh \1D06 to the buffer will cause
X`09previously undone changes to no longer be redoable.  Remember that
X`09with key rebinding, you can change your 'u' or 'U' command to be an
X`09infinite undo, making it easier to type.
X
X`09In addition, the '.' command, which normally re-executes the last
X`09buffer-modifying command, has special behavior with respect to
X`09undo.  If the '.' command immediately follows one o\2B06undo
X`09commands ('u', '`5EX-u', or '`5EX-r'), then it will perform another
X`09undo or redo, as appropriate.  If there are any intervening commands,
X`09then '.' will re-execute the last command prior to the undo.  `5B This
X`09modification to the behavior of "u." does not conflict (much) with
X`09traditional use of '.', since by definition, the sequence "u." is
X`09(almost) always identical to "uu", and the latter is more easily
X`09typed.  (Credit goes to the designers of "nvi" for this trick.)
X`09(BTW, the one case i know of where "u." is not identical to "uu" is
X`09when putting back the contents of the numbered registers:  the
X`09sequence "1pu.u.u.u. would successively insert the contents of "1,
X`09"2, "3, "4, and "5, allowing you to choose the "correct" register.
X`09This sequence no longer works.  You can still put them _all_ back
X`09with "1p..... and then delete the ones you _don't_ want. `5D
X
X`09The number of changes stored in the undo "history" is controlled by
X`09the numeric mode "undolimit".  The default history length is 10 --
X`09that is, only 10 changes may be undone.  Set th\1106limit to 0 for
X`09truly infinite undo.  This can consume a lot of memory.
X
X`09The cursor position after an undo may not always be the same as it
X`09would be in vi.
X
X`09Operators
X`09---------
X`09vi has a class of commands known as "operators".  O\0D07\2909
X`09are always immediately followed by a motion command.  The region of
X`09text affected by an operator is bounded on one end by the initial
X`09position of the cursor, and on the other by\200B \3708
X`09after the motion is completed.  Thus the delete operator ('d') can
X`09be followed by the word motion command ('w'), causing the next word
X`09to be deleted.  The sequence "dG" will\2107 from the cursor
X`09through the end of the file, and "d/junk" will delete to the next
X`09occurrence of the string "junk".  As a special "honorary" type of
X`09motion, operators can all be "stuttered" to affect lines.  Thus
X`09"dd" deletes one line, "4dd" affects 4 lines, etc.
X
X`09Most operators affect the region exactly, but some cause only whole
X`09lines to be affected.  This is usually a function of what sort of
X`09motion follows the operator, but can sometimes be affected by the
X`09operator itself.  The best example of motions having different
X`09effects is the 'goto-mark' motions,\1906'' and '`60' commands.  If a
X`09mark is set, say mark 'a', with the 'ma' command, then if the
X`09command d`60a is executed, the exact text between the cursor and the
X`09mark will be deleted.  If, on the other hand, the d'a command is
X`09used, the deleted region will include the lines containing the
X`09cursor and the mark in their entirety.
X
X`09Some operators in vile can be "forced" to affect regions of whole
X`09lines, though the motion wouldn't normally imply it, by using the
X`09'`5EX' form of the command.  (It's not really forced -- it's \1606
X`09a separate operator.)  For example, "d%" (assuming you are on a
X`09curly brace) will delete a C-style block of code.  "`5EX-d%" will
X`09delete that same area, plus anything else on the lines containing
X`09the curly-brace endpoints.
X
X`09Note that some operators always affect whole lines, no matter
X`09how the motion is specified.  The '!' operator is an example:
X`09"!w" will always filter an entire line, and not just a single word.
X
X`09vile extends this notion of the "shape" of a region by adding
X`09the concept of rectangular regions, whose boundaries are
X`09delimited by the rectangle whose opposite corners are at the
X`09cursor and at the other end of the motion, respectively.  See
X`09the section "Rectangular regions" below.
X
X`09The "show-operators" command will show all available \2B09.
X`09The "show-motions" command will show all available \2907.
X`09Any operator may be followed by any motion.
X
X`09There are several new operator commands in vile:
X
X`09`5EA-`7E`09Is the operator form of the '`7E' command, so "`5EA-`7E`7E"
X`09`09changes the case of all characters on\1E06urrent
X`09`09line, "`5EA-`7Ew" does it to a word, "3`5EA-`7E`7D\1C0Afor
X`09`093 paragraphs, etc.  (In vile, the simple '`7E' command
X`09`09will take a repeat count, unlike some versions of vi.
X`09`09If you wish it to be an operator, rebind '`7E' to the
X`09`09"flip-til" command.)
X`09`5EA-u`09Like `5EA-`7E, but converts the region to upper case.
X`09`5EA-l`09Like `5EA-`7E, but converts the region to lower case.
X
X`09`5EA-f`09Format the region based on the current fill column.  The
X`09`09initial indentation of both the first and second lines of
X`09`09each "paragraph" in the region are preserved, and all
X`09`09subsequent lines get the second line's indentation.  This
X`09`09makes indented/out\0A06 paragraphs (like this one) work
X`09`09correctly.  (This is intentionally _not_ the same behavior
X`09`09obtained by using "!fmt", since that behavior is obviously
X`09`09available elsewhere.)  The usual usage of this command is
X`09`09"`5EA-f`7D", which reformats the current paragraph.  The
X`09`09re-formatting begins again with each new paragraph, where a
X`09`09paragraph has the same boundaries used by the '`7B' and '`7D'
X`09`09commands -- i.e. blank lines, or\0A06 beginning in .I .L
X`09`09.P .Q or .b.  This makes it possible to use "3`5EA-f`7D" or
X`09`09"`5EA-fG" to reformat multiple paragraphs.  The \2308ting
X`09`09operation knows a little about both C, C++, and shell
X`09`09comments, and will attempt to do the "right" thing with
X`09`09lines that start with '#' or '*' characters.  (It also knows
X`09`09about the '>' character, making it fairly easy to reformat
X`09`09mail and news inclusions...  but is it ethical?  :-)
X
X`09`5EX-s`09For every occurrence of a search string, put in a replace-
X`09`09ment string.  This is similar to "s/pattern/replacement/g"
X`09`09over the region.
X
X`09`5EA-`26`09Is an operator in vile, similar to the traditional `26 command.
V
X`09`09It repeats the last substitution over the specified region.
X`09`09(Unlike the '`26' command, this one will remember trailing
X`09`09g, p, l, or numeric options.)
X
X`09`5EX-d`09Delete the region, including the lines it starts and ends on.
+-+-+-+-+-+-+-+-  END  OF PART 108 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 109 -+-+-+-+-+-+-+-+
X`09`5EX-c`09Change the region, including the lines it starts and ends on.
X`09`5EX-y`09Yank the region, including the lines it starts and ends on.
X
X`09`5EA-t`09Trim trailing whitespace from all lines in the region.
X
X`09`5EA-<SPACE> Convert tabs to spaces, using the curren\2206top value.
X`09`5EA-<TAB>   Convert as many spaces to tabs as appropriate.
X
X`09`5EA-b`09Blank out a region.  Turns the\1307 to whitespace.  Useful
X`09`09with rectangular regions.
X`09`5EA-r`09Open up a rectangle.  Text to the right of the left edge
X`09`09of the rectangular region will shift to\2506ight by the
X`09`09width of the rectangle, leaving a whitespace "hole".
X`09`5EA-q`09Sweep out a rectangle with multiple motion commands.  See
X`09`09description of 'q', below.
X
X`09`5EA-s`09Select and yank a region.  The\0D07 will be highlighted
X`09`09on the screen, as if it had been swept by a mouse.  It
X`09`09is also yanked, as with the 'y' operator.  This \1008
X`09`09is useful in combination with the `5ES motion command, which
X`09`09lets one reference the selected region with other operators.
X`09`09(If you use this command much, it is recommended that you
X`09`09bind it to and easier to type sequence, such as 'S'.)
X`09`5EX-C`09Encrypt or de\0B06the region, using the current encryption
X`09`09key.  If no key has been set, user will be prompted.  See
X`09`09"Encryption" below.
X
X`09Text insertion
X`09--------\0806
X`09`5EX-p`09Causes the previously yanked or deleted text, no matter
X`09`09how it was obtained, to be inserted after the current line.
X`09`09Usually text that did not consist of whole lines where it
X`09`09came from is inserted immediately following the cursor.
X`09`5EX-P`09As above, but the text is put before the current line.
X`09`09Thus "dw" followed by a "p" command does a normal insertion
X`09`09of the deleted word, whereas "`5EX-p" results in the word
X`09`09being inserted on a line by itself.
X
X`09R`09vi's overwrite mode is supported.  Note that the combination
X`09`09of overwrite mode and the (ANSI) arrow keys can be used to
X`09`09give a "picture drawing" mode of operation: anything you
X`09`09type goes into the buffer without moving adjacent text, and
X`09`09you can move around using the arrow keys without leaving
X`09`09overwrite mode.  Hint: start with a buffer full of lines
X`09`09that consist entirely of blanks (as opposed to\1606
X`09`09lines).
X
X`09`5EA-i`09Like their 'i', 'o', and 'O' counterparts, but any autoindent
X`09`5EA-o    or cmode setting is ignored for the duration of this insert.
X`09`5EA-O`09These are most useful when pre-formatted text is being
X`09`09pasted, as when using a mouse.
X
X`09Searching
X`09---------
X`09`5EX-/`09Does a forward search for the "word" located under the
X`09`09cursor.
X`09`5EX-?`09Does a reverse search for the "word" located under the
X`09`09cursor.
X`09`5EA-/`09Does not do a search, but sets the\1507 pattern to the
X`09`09"word" under the cursor.  Useful for "picking up" a word
X`09`09from one buffer, and searching for it in another.
X
X`09The following two commands may not always be present in vile,
X`09`09depending on how it was built:
X`09`5EX-S`09Incremental forward searching.  As you enter the\1D07
X`09`09string, the cursor is advanced to the next match with
X`09`09what you've typed so far.  Use `5EF and `5ER to continue the
X`09`09search forward or in reverse, using the current pattern.
X`09`5EX-R`09As above, but in reverse.
X
X`09Tags
X`09----
X`09vile supports vi-style "tags" files.
X
X`09":ta" or ":tag" allows you to enter a tagname to locate.  Changes
X`09`09to that file and location.
X`09`5E`5D`09Uses the identifier currently under the cursor as the
X`09`09tagname.
X`09`5ET or `5EX-`5E`5D or ":pop" - pops to the file and location just previous
V
X`09`09to the last tag command.
X`09`5EA-`5E`5D or ":next-tag" continues searching through the tags file(s)
X`09`09for additional matches.
X
X`09When one of these commands is used, vile will (by default) look for
X`09a file named "tags" in the current directory, and load it into a
X`09hidden buffer for use during tag searches.  This\2A08is editable
X`09if you wish (":e tags"), but will not appear in the buffer lists.
X`09If a buffer named "`5BTags 1`5D" is already available when a tag is
X`09first requested, it will be used instead of a file found by
X`09searching the tags setting, and of course will remain visible.
X
X`09The name of the default tags file may be changed with "se\2306"
X`09(see "tags" under "Editor modes", below).  If multiple filenames
X`09are given in the "tags" setting (separated by whitespace), they are
X`09searched in order, and plac\1506buffers named "`5BTags 1`5D", \0C072`5D",
X`09"`5BTags 3`5D", etc.
X
X`09Tags searched for using '`5E`5D' will always be matched exactly.
X`09If the ":ta" form o\1206command is used, tag matches will be
X`09exact unless the mode "taglength" is set non-zero, in which case
X`09the first tag matching that many characters will be used.
X
X`09Filenames referred to in tags files are expanded, so environment
X`09variables and shell special characters like `7E may be used.
X
X`09The stack of buffer locations waiting to be "popped" to with the
X`09'`5ET' (or '`5EX-`5E`5D' or ":pop") command may be viewed with the
X`09"show-tagstack" command.  The "`5BTag Stack`5D" buffer is animated --
X`09it will dynamically keep track of current tag references.
X
X`09Limitations:  In a real vi-style tags file, there are three tab
X`09    separated fields.  The first contains the tagname\2107second
X`09    contains the (relative or absolute) filename.  Everything after
X`09    the second tab is an arbitrary ex-mode command.  vile is not
X`09    quite so flexible as regular vi, and only supports a couple of
X`09    commands in that last "field".  It can be a line number, in
X`09    which case the tag is an absolute index into the file.  Or, it
X`09    can be a search command.  If it begins with a '/', the \2E06
X`09    goes forward.  If it begins with a '?', the search goes
X`09    backward.  In either case, the matching delimiter _must_ be the
X`09    last character on the line in the tags file.
X
X`09    All of this isn't as bad as it sounds, since ctags, the program
X`09    most people use to generate tags files, does\1A0Aexactly
X`09    this format.  (Surprise, s\0A07.)  However, if you attempt
X`09    to create your own tags files, or have other tools that do so,
X`09    you should be aware of these limitations.
X
XMiscellaneous commands
X--------\0808\1006
X
X`09`5EA-d`09Remove blank lines ("deblank").  If the cursor is on a\3006
X`09`09line, then it and any blank lines surrounding it will be
X`09`09removed.  If a non-blank line, then any immediately following
X`09`09blank lines will be removed.  If given an argument,\2806force
X`09`09exactly that many blank lines to exist at that point,
X`09`09regardless of how many were there before.  Moves current
X`09`09location forward, to allow repeated use.
X
X`09`5EX-`5EX`09The "error finder".  Goes to the next file/line \2B06pair
X`09`09specified in the last buffer captured from a command's
X`09`09output.  This buffer is usually created with the `5EX-!
X`09`09command.  For example, "`5EX-!cc -c junk.c" puts all of the
X`09`09compiler output into the buffer named "`5BOutput`5D".
X`09`09Repeatedly hitting `5EX-`5EX will position the editor at each
X`09`09error in turn, and will eventually start over again at the
X`09`09top.  The buffer searched for "errors" will be the last
X`09`09shell command run, or the buffer named with the "error-
X`09`09buffer" command.  The "Entering directory XXX" and "Leaving
X`09`09directory XXX" messages that GNU make puts out with the -w
X`09`09switch are honored, so that files are found with the
X`09`09correct path.  (Tip: I use the following macro to quickly
X`09`09grep a source directory for the string unde\1106cursor:
X`09`09    use-register g load\100A"`5EX!egrep -n : *.`5Bchs`5D`5EM"
X`09`09where the `5EX and `5EM are each single control characters,
X`09`09entered using `5EV to escape them.  Then I invoke with @g to
X`09`09execute. `5BNB: this macro won't work with DOS versions of
X`09`09vile, since ':' doesn't expand to the word under the cursor
X`09`09in those versions, since it conflicts with the driver letter
X`09`09separator.)
X
X`09`09The command parsing is done with regular expressions.  Vile
X`09`09compiles these from the buffer `5BError Expressions`5D, which are a
X`09`09set of regular expressions with extra embedded information.
X`09`09Unescaped '%' followed by 'V', 'B', 'F', 'L', 'C' or 'T'
X`09`09substitute verb (Entering/Leaving for gmake), buffer (i.e.,
X`09`09scratch buffer with a bracketed name), file, line, column and
X`09`09text fields.  The V, B, F, T substitutions are for nonblank
X`09`09fields, which is not always enough, so vile additionally
X`09`09recognizes a range in brackets, e.g.,
X
X`09`09`09`5E%`5B`5E: `09`5D:`5Cs*%L:%T
X
X`09`09is compiled as
X
X`09`09`09`5E`5C(`5B`5E: `09`5D`5C+`5C):`5Cs*`5C(`5B0-9\0F07(.`5C+`5C)
X
X`09`5EX-t Set or report on the tab-stop width.  To set, the spacing must
X`09`09precede the command, as in "4`5EX-t".  The "set tabstop"
X`09`09command described below does the same thing.  The status
X`09`09output indicates whether the buffer is currently using the
X`09`09local or global copy of the tabstop value.
X
X`09`5EX-f Set the local fill-column to be used with `5EA-f and auto-wrap
X`09`09mode on insert.  The default value is 7/8's of the screen
X`09`09size, with a maximum of 70.  Since arguments come before
X`09`09commands, you type: 65`5EX-f.  The "set fillcol" \2F07 does
X`09`09the same thing.  The status output indicates whether the
X`09`09buffer is currently using the local or global copy of the
X`09`09tabstop value.
X
X`09`5EX-X    Set current encryption key for this buffer.  See "E\2609"
X`09`09below for more information.
X
X`09K`09Count prefix.  The first time you type it, it is equivalent
X`09`09to an argument of 4 to the following command.  If you repeat
X`09`09it, it becomes worth 16, the next time 64, etc...
X
X`09%`09In addition to finding matching braces, brackets, and
X`09`09parentheses, the '%' command will find matching #if's,
X`09`09#ifdef's and C-style comments.  If the cursor is on the #
X`09`09of "#ifdef"/"#if", the '%' command will find the matching
X`09`09"#endif" or "#else".  On an \1007 it will find "#endif",
X`09`09and on "#endif" it will go back up to the "#ifdef"/"#if".
X`09`09If the cursor is on any part of a "/*" or "*/" sequence, it
X`09`09will find the appropriate corresponding C comment endpoint.
X`09`09(See fence-if,\0A07pairs to customize this behavior).
X
X`09`5C`09Identical to the `60 motion, in that the cursor moves to
X`09`09the specified mark (i.e. `5Ca moves to\1706'a').  When
X`09`09used with an operator command, the resulting region is
X`09`09rectangular instead of "exact".  This is similar to
X`09`09the ' motion, which also goes to `5Bthe line holding`5D the
X`09`09mark, and causes regions to become "full line"\1E08.
X
X`09q`09A "quoted motion" command.  After entering 'q', more\2B07
X`09`09commands are accepted until another 'q' is entered.  The
X`09`09result of the motion is the cumulative effect of all the
X`09`09entered motions.  Thus, one might type:
X`09`09`09dq<arrow>\0707\0E07...\1807q
X`09`09to delete all of the text between the starting point
X`09`09and the final cursor position.
X
X`09`09Any motion command can appear in between the two 'q'
X`09`09commands.  If used alone, i.e. not in an operator
X`09`09context, then the spanned text is selected, highlighted,
X`09`09and yanked as a side effect.  The resulting selection can
X`09`09then be manipulated with the `5ES pseudo-motion, below.
X
X`09`09Most motions will select up to but not including their
X`09`09endpoint.  The 'e', 'E', 'f', 't', and '%' commands are
X`09`09exceptions to this.  If used in an operator context the
X`09`09cursor position may sometimes appear incorrect.  This
X`09`09is because operators sometimes change the cursor location
X`09`09internally to force the motion to do the "right" thing,
X`09`09and the 'q' command makes these internal "fudge factors"
X`09`09visible.  An example of this is "dq%q" which does the
X`09`09right thing (assuming the cursor is on a '(' to start)
X`09`09but which looks wrong, since the cursor will overshoot
X`09`09the ')' before the second 'q' is typed.
X
X`09`09If a mouse is available, whether in an xterm via the
X`09`09"xterm-mouse" setting, or in xvile, then button 1 can be
X`09`09clicked to do the extensions, since it, too, is a motion
X`09`09command.  (Of course in xvile, it is easier to simply
X`09`09"click and drag" -- the 'q' command isn't really necessary
X`09`09at all.
X
X`09`09Use the repeat-count to specify types of selection: exact=1
X`09`09(default), full-line=2, rectangle=3.
X
X`09`5EA-q`09As above, but the motions will sweep out rectangular regions.
X
X`09`5ES`09A motion, or "pseudo-\1306" command.  If a region of
X`09`09text has been previously selected, either with the mouse
X`09`09(if available) or with the keyboard selection operator
X`09`09(`5EA-s) it can be referenced by any other operator by
X`09`09applying that operator to the `5ES motion.  As an example,
X`09`09suppose a word is selected with the mouse, or\1306`5EA-sw.
X`09`09Then, from anywhere in that buffer, one can use d`5ES to
X`09`09delete that word.  `5ES used by itself will move the cursor
X`09`09to the start of\0D06elected region.  `5ES applied to
X`09`09the selection operator (`5EA-s) will extend the current
X`09`09selection to include the current location of\1808sor.
X
X`09`09`5ES makes it possible to select any region (including
X`09`09rectangular regions) of text with a mouse, and then apply
X`09`09any vi operator to that region.
X
X`09=`09If "visual-matches" is set, then vile will highlight all
X`09`09occurrences of a pattern that is searched for with one of
X`09`09the usual searching commands.  The '='\1308 will clear
X`09`09this highlighting, until the next search for a different
X`09`09pattern.
X
X
X`09vile can display more of its internal "state" than traditional vi.
X`09Portions of the internal "state" may be viewed using various
X`09"show-xxx" commands:
X
X`09show-abbreviations -- displays list of shortcuts defined with the
X`09`09":abbr" command.  (synonymous with \2306<CR>")
X
X`09show-buffers -- displays the current list of available \3207.  Given
X`09`09any numeric argument, will list _all_ buffers, even those
X`09`09normally invisible or considered temporary.
X
X`09show-commands or show-bindings -- displays the list of \3208
X`09`09and the keys bound to them.
X
X`09show-global-modes, show-modes -- both synonymous with ":set<CR>"
X
X`09show-help -- synonymous with ":help", '`5EA-h', etc.
X
X`09show-history -- displays the user's command line \2C07.
X
X`09show-majormodes -- displays the builtin and user-defined major modes.
X
X`09show-mapped-chars -- displays the strings \2506 for command mode
X`09`09with ":map".  (synonymous \1A0A<CR>")
X
X`09show-mapped!-chars -- displays the strings \2606 for insert mode
X`09`09with ":map!".  (synonymous \1B0B<CR>")
X
X`09show-printable -- displays a \1406of the \250Acharacters,
X`09`09with associated types.
X
X`09show-registers -- displays the current contents of the named and
X`09`09numbered registers.
X
X`09show-system-mapped-chars -- displays the strings \2506 to
X`09`09represent the terminal's function keys.
X
X`09show-tagstack -- displays the contents of the "tags stack", the
X`09`09list of locations from which the ":ta" or '`5E`5D' commands have
X`09`09been used, and to which the ":pop" and '`5ET' (or '`5EX-`5E`5D')
X`09`09commands will return.
X
X`09show-terminal-chars -- displays the list of special \2606normally
X`09`09associated with the TTY driver, i.e. backspace, interrupt,
X`09`09suspend, etc.
X
X`09show-variables -- displays the list of vile $\280Aand user
X`09`09%variables, and their values.
X
XNew Registers
X-------------
X`09In addition to the usual "a through "z, and "1\130A9, vile
X`09has additional registers.
X
X`09The register named '<' contains the last few hundred keystrokes
X`09that have been typed by the user.  The principle use for this
X`09is to make it easier to create :map commands based on\1209
X`09you've already given.  `5BIt's also useful sometimes when debugging
X`09to be able to see what key sequence led to a problem...`5D
X
X`09The register name '.' contains the current selected text in xvile.
X`09Also in xvile, the register name ';' is a synonym for the clipboard.
X`09Other versions of vile permit use of '.' and ';' as supplemental
X`09register storage.
X
X`09The register name '"' is a synonym for the default unnamed\3709,
X`09which is also sometimes referred to as register 0.
X
XCompletion
X----------
X`09Many responses to vile prompts need not be typed in their entirety.
X`09vile can complete the response for you.  This applies to command
X`09names, file \0C07vile mod\0C09variables, and the "terminal
X`09characters".
X
X`09To invoke vile completion, type a few characters and hit TAB (or
X`09your current "name-complete" terminal character).  Hitting it a
X`09second time will pop up a window containing the list of possible
X`09completions.  If there are more \200B than will fit in the
X`09window, hitting further TAB characters will cause that window
X`09to scroll through the choices.  The window will go away when the
X`09current command is finished.
X
X`09An older form of completion is also supported:
X`09    You can also type a question mark (or the current "test-
X`09    completions" terminal character) to display a list of the
X`09    characters that you would have to type to complete the command.
X`09    For example, to complete the "unmark" or "unmap" commands:
X`09`09:unm?&0209`09-- you type
X`09`09:unm`7Ba`7D`5Bpr`5D&0209-- you see
X`09    This style of completion-display shows curly braces around the
X`09    string that will be supplied by pressing TAB, and square
X`09    brackets around characters that you must type to make the
X`09    command unique.
X
XArrow keys
X----------
X
X`09vile will understand your terminal's arrow keys, as long as they
X`09are described correctly in the termcap/terminfo database.
X`09The keys are interpreted as function keys, and are by default bound
X`09to the up, down, left, and right screen motions.  These bindings
X`09are honored in insert mode as well as command mode.
X
XRectangular regions
X--------\0808---
X
X`09Just as the regions defined by vi's commands and motions can either
X`09be "exact", or encompass "full lines", regions in vile can in
X`09addition be "rectangular".  The easiest way to use a \280B
X`09region is with the '`5C' motion, which, like '`60' and ''', goes to a
X`09named mark.  The region it describes, however, is "rectangular"
X`09(instead of "exact" or "full line").  The following operators know
X`09how to correctly act on rectangular regions:
X
X`09`5EA-r`09Opens up a rectangle.  Text to the right of the left
X`09`09edge of the rectangle is shifted right by the width of
X`09`09the rectangle.
X`09>`09Shift right.  Identical to '`5EA-r' when region is rectangular.
X`09d`09Deletes the (rectangular) region.  Text to the right moves
X`09`09left to fill the rectangle.
X`09<`09Shift left.  Identical to 'd' when region is rectangular.
X`09y`09Yanks the (rectangular) region.  (vile remembers that the
X`09`09yanked text is rectangular in shape.
X`09c`09Change the region.  If\100B is _not_ rectangular,
X`09`09insert mode is entered after the region is deleted.  If
X`09`09the region _is_ rectangular, the user is prompted for
X`09`09text with which the lines of the rectangle will be filled.
X`09`5EA-u `5EA-l `5EA-`7E `5EA-b`09These four operators perform their characte
Vr
X`09`09transformations on rectangular regions, as well as exact or
X`09`09full-line regions. (uppercase, low\0B08flip-\1606and
X`09`09blank, respectively)
X
X`09p P `09The 'put'ting commands know whether the text being 'put' was
X`09`09originally rectangular, and will do a\1B0C insert
X`09`09of the text, in front of or behind the cursor.  The
X`09`09cursor position defines the upper left corner of the
X`09`09insertion.
X`09`5EA-p`09These two forms of the put command force the text being
X`09`5EA-P`09'put' to be inserted as if it had been rectangular when
X`09`09originally yanked or deleted.  The width of the rectangle
X`09`09is the length of\0E06ongest line in register being 'put'.
X
X`09Note that because it is sometimes hard to manipulate rectangles
X`09containing or bordering on tab characters, currently (for some
X`09operations) vile "detabs" the region being \2B06ed on before
X`09commencing, and re-entabs the lines again after the operation.  The
X`09re-entabing is limited to leading whitespace, and of course is
X`09suppressed if "notabinsert" mode is set.  `5B This misfeature is
X`09arguably a bug, and may be fixed.  In the meantime, you've been
X`09warned. `5D
X
XEditor modes
X------------
X
X`09Modes come in three "flavors".  They are universal, and affect the
X`09editor generally, or are associated with either buffers or with
X`09windows, and are usually inherited from a set of "global" buffer
X`09and window modes.  The value of a buffer or \280B will track
X`09changes to the respective global mode, until the "local" value is
X`09set independently of the global one.
X
X`09You can also define new modes, called "majormodes", which are
X`09collections of buffer mode values, together with qualifiers that
X`09automatically assign a majormode to new buffers.  Vile has one
X`09built-in majormode, "c" (displayed as "cmode").  The associated
X`09majormode values are named according to the corresponding buffer
X`09modes, e.g., the "c" majormode's tabstop is predefined as
X`09"c-tabstop", or "cts" for short.
X
X`09To set or change a global mode, use ":set".  To remove the mode,
X`09use ":unset", ":setno", or\0D06" with the modename prefixed with
X`09"no".
X
X`09To set and reset local modes, use ":setl", ":un\0B09setlno".
X
X`09To display modes, use ":setall", ":modes", or\1806 all".  Local
X`09mode values are only shown if they differ from the global\3507,
X`09whether they have been independently set or not.  The "local"
X`09version of the set/unset commands ("setl"/"unsetl") do not make
X`09sense when used with universal modes, since there is only one
X`09copy of these.
X
X`09To define majormodes, use ":\1906-\1909".  To remove the
X`09majormode, use ":remove-\1809".  Some keywords (e.g., suffixes)
X`09are automatically associated with each majormode.  To\240A a
X`09buffer mode with a majormode, use ":define-submode".  To remove the
X`09association, use ":remove-submode".  Once \2A08ed, \1C07s can
X`09be set and unset just like regular buffer modes.  Use
X`09":show-majormodes" to display the list of \230A with their
X`09associated submodes.  The ":setall" command displays the names of
X`09the majormodes only, showing which are currently enabled (i.e.,
X`09vile compares each new buffer against the preamble and suffixes to
X`09determine if the majormode should be set for that buffer.  Only one
X`09majormode can be set for a buffer.
X
X`09The possible modes, with synonyms in parentheses, and a trailing U,
X`09M, B or W indicating whether the mode is universal, or belongs to
X`09majormodes, buffers or windows, are:
X
X`09alt-tabpos (atp) If set, vile will position the cursor over tab and
X`09`09control characters the way emacs would, that is, at the
X`09`09start of a tab or control character display sequence.  If
X`09`09turned off (the default), the cursor is positioned over
X`09`09tabs and control characters the way it would be in vi, i.e.
X`09`09at the end of the tab or control character display
X`09`09sequence.  (To match the behavior of earlier versions of
X`09`09vile, should be set.) (U)
X
X`09animated Controls whether vile automatically updates the contents of
X`09`09scratch buffers when their contents would change.  The animated
X`09`09buffers include:
X`09`09`09`5BBinding List`5D
X`09`09`09`5BBuffer List`5D
X`09`09`09`5BMajor Modes`5D
X`09`09`09`5BMap Sequences`5D
X`09`09`09`5BMap! Sequences`5D
X`09`09`09`5BRegisters`5D
X`09`09`09`5BSettings`5D
X`09`09`09`5BTerminal Characters`5D
X`09`09`09`5BTag Stack`5D
X`09`09Turning off "animated" is rarely necessary: the capability
X`09`09is present mostly as a debugging aid.  (B)
X
X`09autobuffer (ab) Controls whether vile uses "most-recently-used"
X`09`09style buffering, or vi-\1706(command-line order)\2C07s.
X`09`09That is, if autobuffer is on, then \1306s are sorted in
X`09`09order of use, in that buffers not frequently used will
X`09`09drift to the end of the list.  If this mode is not on, then
X`09`09vile will behave more like vi, in that buffers remain in a
X`09`09fixed order, that in which they were edited. (U)
X
X`09autowrite (aw)  vile will write out any changed buffers for which
X`09`09this mode is set before performing a `5EZ, "stop", "suspend",
X`09`09":!<cmd>", or '`5EX-\1006'.  The ":sh" command is not
X`09`09affected, nor is ":stop!" or ":suspend!".  Since buffers
X`09`09inherit the global value of a mode, simply setting the
X`09`09global autowrite value will cause all buffers to be
X`09`09auto-written.  Individual buffers can be forced or
X`09`09prevented from autowriting by setting the local value of
X`09`09the mode for those buffers appropriately.  `5BIn real vi,
X`09`09autowrite mode will also force buffers to be written when
X`09`09switching between files.  This is unnecessary in vile.`5D (B)
X
X`09autoindent (ai) During insert, newly created lines inherit their
X`09`09leading indent from the previous line in the buffer. (B)
X
X`09autosave (as) Automatic file saving.  Writes the file after every
X`09`09'autosavecnt' characters of inserted text.  Other file
X`09`09changes are not counted.  (B)
X
X`09autosavecnt (ascnt) How often (after how many inserted characters)
X`09`09will automatic saves take place.  256 by default. (B)
X
X`09backspacelimit (bl)  When in insert mode, this controls whether
X`09`09one can backspace past the point at which the insert began. (B)
X
X`09backup-style  Specifies the \1506used for creating file \3906s
X`09`09when a file is written.  Can have values of "off", ".bak",
X`09`09and (under UNIX) "tilde", for no backups, DOS-style .BAK
X`09`09files, and file.c`7E style backups, respectively.  Files
X`09`09are copied before being written, to protect links to
X`09`09the original file.  Permissions, modification and access
X`09`09times are all preserved.  If creation of the backup fails,
X`09`09the write of the file will fail, unless it is forced
X`09`09using the ":w!" form of the write command.  (U)
X
X`09bcolor`09On systems supporting this, will set the background color.
X`09`09Currently only terminfo/termcap, OS/2 and PC's (Win32, DOS) can
X`09`09do color, although the X11 version (xvile) can be given colors
X`09`09at startup or via .Xdefaults.  See notes about the color
X`09`09palette down below, under DOS specifics.
X
X`09check-modtime  Check modification-time.  If a file has changed since
X`09`09it was last read or written, vile will issue a "file newer
X`09`09than buffer" warning and prompt appropriately for
X`09`09confirmation when 1) popping up a window on an existing
X`09`09buffer, 2) reading or writing the \2208or 3) after
X`09`09performing some shell command.  The prompt will occur only
X`09`09once, unless the modification time of the file changes
X`09`09again, in which case the warning will be repeated.  The
X`09`09warning will be repeated in any case if the file is being
X`09`09written.  Invoking a shell, or suspending/restarting vile,
X`09`09will cause all visible buffers (those currently in windows)
X`09`09to have their times checked immediately.
X
X`09cmode   C-code mode.  A built-in major\1708lso useful for other
X`09`09languages.  Maintains current indentation level
X`09`09automatically during insert, like autoindent, above.  If a
X`09`09line ends with a '`7B', '(', or ':', then the next line
X`09`09indents further.  If a line begins with a '`7D' or ')', it is
X`09`09lined up with the line containing the matching '`7B' or '('.
X`09`09If a line starting with '#' is inserted it is moved to
X`09`09column 1.  Additionally, if a line begins with a '#'
X`09`09character, it will not shift right with the '>>' command. (M)
X
X`09crypt`09Causes buffer(s) to be decrypted when read, and en\1907
X`09`09when written.  This is NOT compatible with the UNIX
X`09`09crypt(1) routines.  See the section on "Encryption" for
X`09`09more information.  (B)
X
X`09comment-prefix A regular expression denoting the portion of a line
X`09`09that is replicated and untouched, except for leading
X`09`09indentation when doing text formatting.  The expression
X`09`09should begin with "`5E", e.g., the default value
X`09`09`09`5E`5Cs*`5C(`5Cs*`5B#*>`5D`5C)`5C+
X`09`09is useful for matching shell comments (#), multi-line C
X`09`09comments (*) and email (>).  (B)
X
X`09comments A regular expression defining \2707ed paragraph
X`09`09delimiters.  This is used in addition to the "paragraphs"
X`09`09expression (see below) when reformatting a region.  The net
X`09`09effect is that paragraphs inside of these comments are
X`09`09preserved when doing text reformatting, but are not
X`09`09reachable with the '`7D' and '`7B' motions.  (B)
X
+-+-+-+-+-+-+-+-  END  OF PART 109 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 110 -+-+-+-+-+-+-+-+
X`09dirc`09Causes vile to check each name when scanning directories for
X`09`09filename completion.  This is slower, but provides additional
X`09`09information allowing you to distinguish between directory and
X`09`09file names in the prompt.  (U)
X
X`09dos`09On input, if the global copy of this mode is set, then
X`09`09incoming CR/LF pairs are taken as line terminators, the CR
X`09`09characters are stripped out, and the local dos mode is set
X`09`09for the buffer.  (Actually, the local dos mode is only set
X`09`09if the _majority_ of lines had CR characters at the end.)
X`09`09If global dos mode is _not_ set, then incoming CR
X`09`09characters will be left visible on the screen (as '`5EM'),
X`09`09and the local mode will not be set.
X
X`09`09On output, when writing a buffer with local dos mode set,
X`09`09all lines will be terminated with CR/LF pairs, rather than
X`09`09the usual single LF.
X
X`09`09When buffers representing non-existent files are created
X`09`09they will inherit the line-style of the operating system
X`09`09(LF-only on UNIX and VMS, CRLF-style on DOS derivatives)
X`09`09regardless of the global setting of dos mode.
X
X`09`09Setting dos mode makes editing binary files unreliable.
X`09`09The global value for this mode is set on by default in DOS
X`09`09versions of vile, and should therefore be turned off if
X`09`09doing binary editing.  (B)
X
X`09errorbells (eb) Controls whether a bell sounds (or\1A09the
X`09`09screen flashes, if "flash" mode is on") when an error
X`09`09occurs. (U)
X
X`09expand-chars Controls the set of characters that are \3506ed in
X`09`09command lines.  These include
X`09`09`09'%' (the current buffer),
X`09`09`09'#' (the alternate buffer),
X`09`09`09'!' (the last shell command) and
X`09`09`09':' (the token at the cursor position).  For VMS
X`09`09`09    and MS-DOS, this is '`26'.
X`09`09(U)
X
X`09expand-path Controls whether %/# are \2506ed to the full pathname
X`09`09of a buffer, or just to its basename (i.e. the name with
X`09`09the path stripped off).  (U)
X
X`09fcolor`09On systems supporting this, will set the foreground color.
X`09`09Currently only terminfo/termcap, OS/2 and PC's (Win32, DOS) can
X`09`09do color, although the X11 version (xvile) can be given colors
X`09`09at startup or via .Xdefaults.  See notes about the color
X`09`09palette down below, under DOS specifics.
X
X`09fence-begin
X`09fence-end Respectively, the regular expressions for balancing simple
X`09`09(character-oriented, non-nestable) fences.
X
X`09fence-if
X`09fence-elif
X`09fence-else
X`09fence-fi Respectively, the regular expressions for balancing
X`09`09line-oriented, nested fences, e.g., as C-preprocessor lines
X`09`09(the default).
X
X`09fence-pairs  Each pair of characters in this string is taken to be
X`09`09a set of "fences", which should be matched with the '%'
X`09`09command.  The default value is "`7B`7D()`5B`5D", which produces
X`09`09normal vi behavior.  This can, for instance, be augmented
X`09`09with the '<' and '>' characters ("`7B`7D()`5B`5D<>") to cause angle
X`09`09brackets to be matched as well.  See "showmatch" mode for
X`09`09another use of the "fence-pairs" mode.  (B)
X
X`09fillcol (fc)  Sets the value for the fill column, which is the
X`09`09column at which autowrapping and region formatting will
X`09`09break lines.  (B)
X
X`09flash   If your terminal can, will \2306the screen rather than
X`09`09beeping on errors.  No audible or visible indication will
X`09`09occur at all if "errorbells" mode is not set on.  (U)
X
X`09glob`09Controls how wildcard characters (e.g., '*' and '?') are
X`09`09treated in prompts for filenames.  Set glob to 'off' to
X`09`09disable expansion, or to 'on' to use the internal globber.
X`09`09The internal globber will handle *, ?, `5Ba-z`5D style ranges,
X`09`09environment variables, and the `7Euser notation for finding
X`09`09home directories.
X
X`09`09On UNIX, glob can be set to be a pipe command that
X`09`09will expand more wildcards.  The default value of
X`09`09glob on UNIX is "!echo %s", which should provide globbing
X`09`09that matches that of your shell.  If set to a command that
X`09`09will separate filenames with newlines or nulls rather than
X`09`09spaces, then filenames containing \2206 may be more easily
X`09`09edited.  ("!/bin/ls -d %s" is one possibility, "!glob %s"
X`09`09is another if you use csh.) (U).
X
X`09history (hi) When true (the default), commands from the :-line are
X`09`09logged in a buffer `5BHistory`5D.  Turning this off causes the
X`09`09buffer to be removed.  (U)
X
X`09horizscroll (hs) If the cursor is moved "off-screen", this mode
X`09`09controls what happens.  If set (as it is by default), the
X`09`09whole screen will shift sideways to make the cursor position
X`09`09visible.  If not set, then only the current line will shift,
X`09`09which may be desirable on slower displays. (W)
X
X`09ignorecase (ic) Text searches normally match the pattern exactly.
X`09`09With this set, searches are case-insensitive. (B)
X
X`09implybuffer (ib) Causes vile to create a \2407when you write to a new
X`09`09file, or read from one (e.g., with ":r").  (U)
X
X`09linewrap (lw) Displays lines that are too long to fit on one line as a
X`09`09series of "wrapped" lines.  Overrides left/right scrolling
X`09`09controlled by "sideways" and "horizscroll" modes.  (W)
X
X`09list`09(li) The buffer will be displayed with tabs and newlines made
X`09`09visible, instead of as whitespace. (W)
X
X`09magic Honor unescaped regular expression metacharacters in search
X`09`09strings.  See the section "Regular Expressions" for more
X`09`09detail.  (B)
X
X`09meta-insert-bindings (mib)  Controls behavior of 8-bit characters
X`09`09during insert.  Normally, key-bindings are only operational
X`09`09when in command mode: \1608insert mode, all characters
X`09`09are self-inserting.  If this mode is on, and a meta-character
X`09`09(i.e.  a character with the 8th bit set) is typed which is
X`09`09bound to a function, then that\1409 binding will be
X`09`09honored and executed from within insert mode.  Any unbound
X`09`09meta-characters will remain self-inserting.  (B)
X
X`09mini-hilite (mh) When user toggles editing mode in the minibuffer
X`09`09(`5EG, mini-edit), display the minibuffer with the given
X`09`09attribute.  These are the same as for visual-matches.
X
X`09multibeep If a motion command fails, then vile, like vi, will
X`09`09normally sound the bell.  Turning this mode off prevents
X`09`09subsequent identical motion failures from also sounding the
X`09`09bell.  That is, if you repeat a failed motion many times
X`09`09(e.g. by holding down the backspace key), you only get one
X`09`09beep.  (U)
X
X`09newline (nl) The buffer ends with a \2407.  This is set when reading
X`09`09a buffer.  (B)
X
X`09number`09(nu) All lines in the buffer will be prefixed by their line
X`09`09number. (W)
X
X`09maplength Controls the maximum \1C07of a :map string, to prevent
X`09`09runaway recursion.  This is the total number of characters that
X`09`09can be gotten during a :map expansion; vile pushes characters
X`09`09onto the stack, so this is only a rough measure.  (U)
X
X`09maplonger Controls whether the \1C07or shorter of two "nested"
X`09`09map strings will be favored by the editor.  When set, vile
X`09`09will match the longest available mapped string.  When reset,
X`09`09(the default) vile will match the shortest available map.
X`09`09For more information, see the section describing the ":map"
X`09`09command, below.  (U)
X
X`09paragraphs A regular expression defining where the "next-\3909"
X`09`09('`7D') and "previous-paragraph" ('`7B') commands will go. (B)
X
X`09popup-choices (pc) Must be set to one of the following three
X`09`09values: "off", "immediate", or "delayed".  When enabled
X`09`09with either "immediate" or "delayed", vile pops up the
X`09`09`5BCompletions`5D buffer showing choices for filename and
X`09`09command completion in response to a TAB.  "immediate" will
X`09`09force the buffer to be popped up immediately if no progress
X`09`09is made in forming a completion.  "delayed" will cause vile
X`09`09to wait until TAB is pressed a second time before popping
X`09`09up the completion choices.  (U)
X
X`09popup-msgs (pm) When enabled, vile pops up the `5BMessages`5D buffer
X`09`09showing the text that was written to the message line.
X`09`09Closing the window clears its content until the next
X`09`09message is written.  This is most useful during the
X`09`09debugging of macros, since many messages may appear,
X`09`09each overwriting a previous one.  This mode is treated
X`09`09specially during startup; unless the\1408 file
X`09`09(e.g., .vilerc) sets it, all messages will be popped
X`09`09up, then the mode will be initialized to "false".  (U)
X
X`09preamble (pre) A regular expression describing the first line of
X`09`09filenames for which the corresponding majormode will be
X`09`09set.  For example, you may have a majormode "sh", with
X`09`09sh-preamble set to "`5E#`5Cs*!`5Cs*`5C/.*sh`5C>" to match the
X`09`09lines "# ! /bin/sh", "#!/bin/csh -f", etc.  (M)
X
X`09printing-low The integer value representing the first of the
X`09`09printable set of "high bit" (i.e. 8-bit) characters.
X`09`09Defaults to 0.  Most foreign (relative to me!) users would
X`09`09set this to 160, the first printable character in the upper
X`09`09range of the ISO 8859/1 character set.  C\1008s 128-159 are
X`09`09control characters in the ISO scheme (e.g., ISO 8859-1).  (U)
X
X`09printing-high The integer value representing the last character of
X`09`09the printable set of "high bit" (i.e. 8-bit) characters.
X`09`09Defaults to 0.  Set this to 255 for ISO 8859/1
X`09`09compatibility.  The printing-low and\110Ahigh modes
X`09`09are not necessary if your system supports the locale
X`09`09functions.  (U)
X
X`09readonly (ro) Prevent writing a buffer to its associated file.  Unlike
X`09`09"view" mode (see below) which prevents any modifications to
X`09`09a buffer, this mode allows changes, but prevents updates.
X`09`09This is set automatically for the output of shell commands
X`09`09and pipes. (B)
X
X`09readonly-on-\0C08 (roro) Causes "\2408" mode to be set for
X`09`09read-only files.  Normally vile will attempt to write\2C06
X`09`09whether the operating system will allow it or not.  This
X`09`09mode should be turned on to truly mimic vi's default
X`09`09behavior.  (U)
X
X`09remap   Controls whether :map o\0806! sequences entered with
X`09`09no explicit remapping control should be subject to \2709
X`09`09(i.e. recursive mapping).  (U)
X
X`09remapfirst Controls whether the \1B06character of a map expanded
X`09`09due to :map or :map! is eligible for remapping.  This is
X`09`09off by default for vi compatibility.
X
X`09report`09A threshold value that is used to control messages\2106\3F06
X`09`09the number of lines deleted, changed, etc.  (U)
X
X`09resolve-links Controls whether vile fully \2A07s file names in
X`09`09cases where some path components are symbolic links.  This
X`09`09makes vile smarter about symbolic links that provide
X`09`09multiple paths to a given file (preventing \2B08
X`09`09unintentional edits of the same physical file via different
X`09`09pathnames).  It may trigger long timeouts on systems where
X`09`09symbolic links are used in conjunction with NFS automounted
X`09`09directories.  (Note that this does not detect or prevent
X`09`09multiple edits caused by hard file links -- only symbolic
X`09`09ones.) (U)
X
X`09ruler Shows the current line and column in the status line, as
X`09`09well as what percentage of the current buffer's lines lie
X`09`09in front of the cursor.  (This percentage is different than
X`09`09that given by `5EG (the "position" function), which gives a
X`09`09percentage of characters rather than lines.) (B)
X
X`09samebangs (sb) Controls whether the ":!!" and "`5EX-!" commands
X`09`09remember the same command string.  (U)
X
X`09sections A regular expression defining where the "next-\3707" ('`5D')
X`09`09and "previous-section" ('`5B') commands will go. (B)
X
X`09shiftwidth (sw) This is much like a tabstop, except that it is
X`09`09independent of hardware tabs and tab characters.  It is the
X`09`09number of columns a line will shift by if the '<<' or '>>'
X`09`09commands are used, and it chooses the next column stop for
X`09`09the cursor if a '`5ET' or '`5ED' is typed during insert mode. (B)
X
X`09showmatch (sm) During insert, if a closing "fence" character
X`09`09(usually '`7D', '`5D', or ')', but may be changed by setting
X`09`09"fence-pairs") is typed, the cursor will highlight the
X`09`09matching member of the pair for about a quarter second.
X`09`09(B)
X
X`09showmode (smd) Causes an indicator on the modeline to\1D08e what
X`09`09mode vile is currently in: insert (I), replace (R), or
X`09`09command (none).  (B)
X
X`09showram (sr) Displays the amount of ram currently allocated at the
X`09`09end of the message line. (not in all versions) (U)
X
X`09sideways  Will prompt for a new value for the \2E09scroll offset,
X`09`09which allow display of a section of code normally off the
X`09`09screen to the right.  Also affected by the `5EX-`5ER and `5EX-`5EL
X`09`09commands.  (W)
X
X`09smoothscroll (ss) Force \1806 scrolling.  By default, this option
X`09`09is turned off so that vile will try to keep up with your
X`09`09keystrokes instead of keeping the display up to date.  Some
X`09`09keyboards repeat faster than the screen can keep up causing
X`09`09the screen to jump.  If this bothers you, set smoothscroll
X`09`09to true.  Warning: If your keyboard repeats really fast and
X`09`09you have smoothscroll enabled, it may take a while for vile
X`09`09to catch up.  (U)
X
X`09spaces-after-sentence (sas) Insert two \2706 after each s\2C07
X`09`09when formatting a paragraph.  By default this option is
X`09`09turned on.  When disabled, the format routiine will insert
X`09`09only one space after each sentence.  (U)
X
X`09suffixes (suf) A regular expression describing filenames for which
X`09`09the corresponding majormode will be set.  This is arguably
X`09`09misnamed, since the regular expression need not describe
X`09`09only suffixes.  (M)
X
X`09tabinsert (ti) Allow the physical \1F06ion of tab characters into
X`09`09the buffer.  If turned off ("notabinsert"), and an attempt
X`09`09is made to insert a tab character by explicitly typing it
X`09`09or by using shiftwidth or the line shifting commands, then
X`09`09the appropriate number of space characters will be inserted
X`09`09instead.  Use '`5EV`5EI' to insert a real tab, and remember
X`09`09that pre-existing tabs will not be affected.  Use the
X`09`09'`5EA-<SP>' operator command to eliminate pre-existing tabs
X`09`09from a region of text.  (B)
X
X`09tabstop (ts) Set the value for spacing of normal t\3106s. (B)
X
X`09tagignorecase (tc) Causes tag searches to be done ignoring upper
X`09`09and lower case. (B)
X
X`09taglength (tl) Sets the significant \2107for tags.  If non-zero,
X`09`09lookups for names longer than the taglength value will only
X`09`09attempt to match that many characters.  If a lookup is for
X`09`09a shorter pattern, or the value of taglength is zero, then
X`09`09the tags must match the lookup pattern exactly.  This will
X`09`09not effect tags picked up from the cursor -- they are
X`09`09always matched exactly.  (B)
X
X`09tagrelative (tr) Causes files looked up via the tags mechanism to
X`09`09be found relative to the location of the tags file, rather
X`09`09than relative to the current directory. This allows the
X`09`09same tags file to be useful from different locations, while
X`09`09not requiring absolute filenames.  For example, using
X`09`09`60set tags "tags ../tags"' would allow a single\2A06file
X`09`09(located in the parent) to be us\1A06a small source
X`09`09hierarchy from either the parent or a child directory.  (B)
X
X`09tags`09Gives a path of names of file(s) in which to look up
X`09`09tag references.  It is a whitespace-separated list of
X`09`09filenames.  Relative pathnames in this list are evaluated
X`09`09with respect to the current directory of vile at the time
X`09`09of the tags lookup.  (B)
X
X`09tagword (tw) When scanning the word to lookup from the cursor position
X`09`09for the tags mechanism, grab the whole word rather than the
X`09`09substring starting at the cursor position.  The latter, which
X`09`09is vi-like, is the default.  (B)
X
X`09terse   vile produces more "status" messages than vi, which may
X`09`09become annoying at low baud rates.  Setting terse mode will
X`09`09suppress many of these.  (B)
X
X`09terse-selections (tsel)  Boolean indicating whether or not additional
X`09`09information is displayed about a selection.  When false, the
X`09`09starting and ending positions of the selection are displayed
X`09`09as the selection is extended.  The default is true. (W)
X
X`09timeoutlen  How long to wait for the characters of a :map'd sequence.
X`09`09Typically needed to resolve the ambiguity between a
X`09`09user-pressed ESCape key and an ESC character that is part
X`09`09of a function key sequence.  vile will wait for "timeoutlen"
X`09`09milliseconds after seeing an ESC, in order to check the
X`09`09next character of input.  The time defaults to 500, or half
X`09`09a second.  Users of fast local screens, like a \1606xterm,
X`09`09may wish to reduce this to something like 50 for crisper
X`09`09response to a user-pressed ESC.  (U)
X
X`09timeoutlen-user  If set non-zero, this will enforce a maximum
X`09`09waiting time for characters in a user-defined :map sequence.
X`09`09If zero, the value of timeoutlen, above, will be used for
X`09`09both "system" and user sequences.  It is likely that a
X`09`09short time is desired for system sequences, and a long time
X`09`09for user sequences.  For this reason the default value of
X`09`09timeoutlen-user is 60000.  This will give a full minute to
X`09`09type each character of a user-defined :map.  Be careful --
X`09`09extremely large values may overflow the word size on
X`09`09smaller machines, i.e, you will probably want to avoid
X`09`09setting timeoutlen-user larger than 65535.  (U)
X
X`09undolimit (ul) Sets a \1206on how many undoable buffer-changing
X`09`09commands will be saved.  If set to 0, there is no limit,
X`09`09and all changes are undoable.  The default value is 10. (B)
X
X`09unprintable-as-octal (uo) If an 8-bit character is non-printing, it
X`09`09will normally be displayed in hex.  This setting will force
X`09`09octal display.  Non-printing characters whose 8th bit is
X`09`09not set are always displayed in control character (e.g. '`5EC')
X`09`09notation.  (B)
X
X`09view`09View the file only.  No changes are permitted.  (B)
X
X`09view-on-readonly (viewro) Causes "view" mode to be set for
X`09`09read-only files.  (U)
X
X`09visual-matches When a search command is executed, the cursor will
X`09`09move as usual.  In addition, all matching occurrences of
X`09`09the searched-for pattern (in the current buffer) will be
X`09`09emphasized according to the value of this mode: "none",
X`09`09"underline", "bold", "italic", or "reverse".  Additionally,
X`09`09on systems which support color, this mode may be used to set
X`09`09the text foreground color using any of the \1706values.
X
X`09`09The '=' command can be used to clear this sort of
X`09`09highlighting, until the next search is done for a different
X`09`09pattern.  Note that setting this mode can significantly
X`09`09slow down the editor's operation when complex or frequently
X`09`09occurring patterns are used, since vile will need to scan
X`09`09the entire buffer for matches on any change to the \2806.
X`09`09(B)
X
X`09warn-rename  When using ":e" to find a file that has the same name
X`09`09as another buffer, vile will normally offer for you to edit
X`09`09the proposed alternate name for the buffer constructed by
X`09`09adding a "-1", "-2", etc. to the end of the name.  Turning
X`09`09off "warn-rename" will make vile choose buffer names without
X`09`09user intervention.  (U)
X
X`09warn-reread  When using ":e!" to \1C07a buffer from the file on
X`09`09disk, vile will normally warn you that you are about to
X`09`09clobber a modified buffer.  Turning off "warn-reread" mode
X`09`09will make vile assume you known what you are doing.  (U)
X
X`09warn-unread  When leaving the editor, if not all buffers have been
X`09`09"visited", then normally vile will complain, and remind the
X`09`09user to use ":q!".  Turning off "warn-unread" mode will
X`09`09suppress this behavior.  (U)
X
X`09working If turned off (no\1907), will suppress the activity
X`09`09indicator ("working..."/"...\1007") which appears during
X`09`09long-running operations.  (U)
X
X`09wrapmargin (wm)  Implements vi's auto-wrap mode.  If nonzero, the
X`09`09wrapmargin specifies the number of columns on the
X`09`09screen's right margin to reserve before breaking the input
X`09`09lines on a preceding space.  Thus a value of 5 and an
X`09`0980 column screen will result in 75 character lines.  This
X`09`09mode is different from the "wrapwords" mode (below) which
X`09`09uses the "fillcol" setting as its target column.  The two
X`09`09modes probably shouldn't both be used at once.
X`09`09(B)
X
X`09wrapscan (ws) Text searches will continue from past the bottom of
X`09`09the file to the top, and vice-versa.  (B)
X
X`09wrapwords (ww) `5Bdeprecated`5D Similar to, but different from, vi's
X`09`09auto-wrap mode (i.e. "wrapmargin").  While inserting,
X`09`09words are moved to the next line if the curren\1407gets
X`09`09too long.  Wrapping is only attempted when a space is
X`09`09typed.  The target maximum width of lines is changed with
X`09`09the "fillcol" setting.  (B)
X
X`09xterm-mouse Enables mouse-clicking if you are running within an
X`09`09xterm.  That is, it allows vile to receive mouse events.
X`09`09Since this mode overrides xterm's cut `26 paste, you will
X`09`09need to use the Shift key when pressing the mouse buttons
X`09`09to cut and paste between X windows.  Your TERM variable's
X`09`09termcap entry must contain the string "xterm" for this to
X`09`09work.  (U)
X
X8-Bit Operation
X--------\0807
X
X`09vile allows input, manipulation, and display of all 256 possible
X`09byte-wide characters.  (Doubl\1A11 are not supported.)
X
X`09Output
X`09------
X`09By default, characters with the high bit set (decimal value 128 or
X`09greater) will display as hex (or octal; see "non-printing-\1A06"
X`09above) sequences, e.g.  `5CxA5.  A range of characters which should
X`09display as themselves (that is, characters understood by the user's
X`09display terminal) may be given using the "printing-low" and
X`09"printing-high" settings (see above).  Useful values for these
X`09settings are 160 and 255, which correspond to the printable range
X`09of the ISO-Latin-1 character set.
X
X`09Input
X`09-----
X
X`09There are basically three ways of getting 8-bit characters into
X`09a vile buffer:
X
X`09Directly -- if the user's input device (i.e. the terminal or
X`09    xterm) can generate all characters, and if the terminal
X`09    settings are such that these characters pass through
X`09    unmolested, then vile will happily incorporate them into the
X`09    user's text, or act on them if they are bound to functions.  On
X`09    an xterm, try "stty cs8 -parenb -istrip".  Real serial lines
X`09    may take more convincing, at both ends, but use that stty
X`09    command as a starting point.
X
X`09As numbers -- the `5EV prefix (or, more correctly, the key bound to
X`09    the "quote-next-character" function), if followed by up to
X`09    three digits, will insert a character whose value is that
X`09    number (no greater than 255) into the buffer.  The \3307may
X`09    be entered in decimal (`5EVNNN), octal with a leading '0' (`5EV0NNN),
X`09    or hex with a leading 'x' (`5EVxNN).
X
X`09As digraphs -- Perhaps more useful to some people is using a set of
X`09    ":map!" commands to aid insertion of 8-bit text.  The file
X`09    "digraphs.rc" distributed with the vile source contains a set
X`09    of mappings which should aid the input of ISO 8859/1 text.  As
X`09    examples, the mappings in digraphs.rc allow one to type `5EKu"
X`09    to get an umlaut character, `5EK12\2108the little '1/2'
X`09    symbol, `5EKY- to get the Yen currency\2509or `5EK:\2809an
X`09    arithmetic division symbol.
X
X`09Users who have no need to enter 8-bit text may want access to the
X`09meta-bound functions while in insert mode as well as command mode.
X`09The mode "meta-insert-bindings" controls whether functions bound to
X`09meta- keys (characters with the high bit set) are executed only in
X`09command mode, or in both \1908and insert modes.  In either case,
X`09if a character is _not_ bound to a function, then it will be
X`09self-inserting when in insert mode.  (To bind to a meta key in the
X`09.vilerc file, one may specify it as itself, or in hex or octal, or
X`09with the shorthand 'M-c' where c is the corresponding character
X`09without the high bit set.
X
X`09(Although it is possible to edit and view all 256 characters,\3406
X`09currently impossible to _search_ for a string that contains the NULL
X`09character, since this is used internally to terminate the search
X`09string.)
X
XCommand History
X--------\0807
X
X`09You may scroll through the list of previous replies to the :-prompt
X`09by using the up- or down-arrow special keys on your keyboard (if
X`09your configuration supports it).
X
XEditing the Minibuffer
X--------\0808\1006
X
X`09The minibuffer (i.e., the last line on the screen, aka the :-prompt)
X`09can be edited using arrow keys, the delete character, or by toggling to
X`09vi-mode with the `5EG (mini-edit) character.  In \1A09 mode, you may
X`09use commands that do not move the cursor to a different line, as well
X`09as the following editing commands: i, a, I, A.
X
X`09Vile treats the minibuffer specially.  Completed lines are written
X`09to the history buffer.  When scrolling up/down in the command\3708,
X`09vile displays the data that correspond to the command which you have
X`09entered, e.g., a :set command will display the variables e\3906 for
X`09preceding :set commands.
X
XSpecial Character Expansion
X--------\0808\100B
X
X`09As in vi, the % and # characters typed while responding to a prompt
X`09will expand to the current or "alternate" filename.
X
X`09Also as in vi, the `7E character will expand to be the previous
X`09replacement pattern when entering either a \2B0Cor search
X`09pattern,
X
X`09In addition, the colon character (":") expands at most prompts to
X`09be the identifier name under the cursor.
X
X`09Expansion of ! to the last command run is implemented, but only
X`09when a shell command is being entered.
X
X`09Any of these expansions can be suppressed by prefixing with a '`5C'.
X
XKey Rebinding
X-------------
X
X`09There is a key rebinding facility (if vile is built to include it),
X`09which is invoked as follows.  One must know the "english" name for the
X`09command being rebound.  Use ":show-\2307s" or ":apropos string"
X`09to find english names containing "string".  Then use the command:
X`09`09":bind-key englishname keyseq"
X`09where keyseq is the exact keyboard sequence (i.e. single character,
X`09or '`5EX', '`5EA', or '#' followed by a single character) to which the
X`09command should be bound.  In a .vilerc file, keyseq can be either
X`09the literal sequence, or the printable representation of the
X`09sequence, e.g. `5EA-a or `5EX-S.   (A summary of how key-\3508s can
X`09be represented appears at the end of this section.)
X
X`09Commands can also be bound to meta keys, which are regular ASCII
X`09characters with the eighth bit (0x80) bit set.  The "printable"
X`09form for these keys is 'M-c'.
X
X`09Commands bound to '#-c' key sequences are usually also available
X`09by using the function keys on the terminal.  Thus the up-arrow
X`09function key can be bound to as '#-A'.
X
X`09Even the `5EA and `5EX prefix characters can be rebound, using the
X`09dummy functions "cntl_a-prefix" and\1407x\1408, and the '#'
X`09key itself can be rebound -- it is represented by the command name
X`09"function-prefix".
X
X`09Examples:
X`09 To cause the / and ? commands to perform incremental
X`09  searches, use:
X`09`09bind-key incremental-search /
X`09`09bind-key reverse-incremental-search ?
X`09 To make `5EN and `5EP switch windows instead of cause motion by lines,
X `09  try:
X`09`09bind-key next-window `5EN
X`09`09bind-key previous-window `5EP
X`09 To cause the space bar to move forward by pages, as in the "more"
X`09  command, use:
X`09`09bind-key next-page `5Cs
X
X`09(Space and tab can be represented with: "`5Cs" and "`5Ct".)
X
X`09Note that when interactive, `5EA and `5EX are typed using the control
X`09key.  In a file, however, they can be either a caret (`5E) followed
X`09by a letter, or the literal control key.  In\1D06atter case you
X`09would not use the '-' separator.  So `5EA-x as four distinct
X`09characters could also be entered as `5EAx, which would only be two
X`09characters.
X
X`09Characters can be entered in hex or octal as well, in the form
X`090xNN, where NN is exactly two hex digits.  So if you know the hex
X`09value for a key, you can bind to it like:
X`09`09bind-key next-window `5EA-`5Cx14
X`09or
X`09`09bind-key next-window #-`5C213
X
X`09The sequence 'M-', represents a "meta-key", or\1108" character.
X`09It is equivalent to setting the high bit of the following
+-+-+-+-+-+-+-+-  END  OF PART 110 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 111 -+-+-+-+-+-+-+-+
X`09character, so 'M-e' is has the value of (0x80`7C0x65), or 0xe5.
X
X`09Function and meta-key bindings are available in insert mode, as
X`09well as in command mode.  (But only via either the "meta bit" or
X`09ESC sequence form -- the '#' prefix will not work in insert mode.)
X`09So the following macro will work correctly in both command and
X`09insert modes:
X
X`09`0915 store-macro
X`09`09`09insert-string "fprintf(stderr, `5C""
X`09`09`09set-named-mark z
X`09`09`09insert-string "`5C`5Cn`5C");`5Cn"
X`09`09`09goto-named-mark-exact z
X`09`09`09; enter insert mode if we weren't already there
X`09`09`09`7Eif `26seq $mode "command"
X`09`09&0209insert-chars
X`09`09`09`7Eendif
X`09`09`7Eendm
X`09`09; bind to function key f
X`09`09bind-key execute-macro-15 #-f
X`09`09; also bind to meta-A
X`09`09bind-key execute-macro-15 M-A
X
X`09Actually the "meta-insert-bindings" setting controls whether meta-
X`09keys will have their bound effect when in insert mode.  If this
X`09setting is not on (or if the meta-key\1E08bound to any function)
X`09then the key's value will simply be inserted into the buffer.
X
X
X`09Syntax for key-sequences:
X`09--------\0808\1009
X`09To summarize, a key-sequence being bound to is specified with:
X`09`091) an optional prefix, like this:
X`09`09`09`5EA-`09(three chars)
X`09`09`09`5EX-`09(three chars)
X`09`09`09`5EA`09(one char)
X`09`09`09`5EX`09(one char)
X
X`09`092) followed by an optional "function" prefix:
X`09`09`09#-`09(two chars) or
X`09`09`09FN-`09(three chars)
X
X`09`093) followed by an optional "meta" prefix:
X`09`09`09M-`09(two chars)
X`09`09`09(this is the same as with specifying a character
X`09`09`09    in that has the high bit set)
X
X`09`094) followed by a character, like this:
X`09`09`09C`09(one char)
X`09`09`09`5EC`09(one char)
X`09`09`09`5EC`09(two chars)
X`09`09`09`5CNNN`09(max of four chars, where NNN are octal digits)
X`09`09`09`5CxNN`09(max of four chars, where NN are hex digits)
X`09`09`09`5Cn,`5Cr,`5Ct,`5Cb,`5Cf,`5Ca (two chars each, usual meanings)
X`09`09`09`5Ce`09(two chars, means ESC)
X`09`09`09`5Cs`09(two chars, means SPACE)
X
X`09(The "one char" control character entries in the above table are
X`09represented in this help file as two printable characters, to
X`09ensure they are not deleted by mailers or file transfer programs.)
X
X`09Function Keys
X`09-------------
X`09When you bind to a function key, you will see its value printed
X`09as a 'poundsign' sequence.  And, if you wish to :map a function
X`09key, you will need to use its poundsign sequence.  This is
X`09explained more fully below.
X
X`09The list of function key labels, along with their "vile name",
X`09are as follows:
X
X`09   Usual Label    Vile name     \1D18
X`09   -----------   \0F0A    \1D19
X`09    Up-arrow        #A\0A08  Home\0E0A  #H
X`09    Down-arrow      #B\0806    End\0D0A   #E
X`09    Left-arrow      #D\0806    Insert\100A#i
X`09    Right-arrow     #C          Delete\100A#d
X`09    Prior (PageUp)  #p          Find\0E0A  #f
X`09    Next (PageDown) #n          Select \1109#s
X`09    Help            #?`09`09Menu\140Dm
X`09    F1        \0806#\100BF12\1C0E@
X`09    F2        \0806#\100BF13\1C0E#
X`09    F3        \0806#\100BF14\1C0E$
X`09    F4        \0806#\100BF15\1C0E%
X`09    F5        \0806#\100BF16\1C0E`5E
X`09    F6        \0806#\100BF17\1C0E`26
X`09    F7        \0806#\100BF18\1C0E*
X`09    F8        \0806#\100BF19\1C0E(
X`09    F9        \0806#\100BF20\1C0E)
X`09    F10             #\0F0BF11\1C0E!
X`09    KeyPad_F1       #P\0907\1C0B3   #R
X`09    KeyPad_F2       #Q\0907\1C0B4   #S
X
X`09    In addition, #M, #t, and #T are used internally to support
X`09    mouse operations in an xterm.  To undo the rel\2406hip
X`09    between a "system-defined" function key and the poundsign
X`09    sequence it produces, use ":unmap-system-chars".
X
X
X`09:map, :map!, :nore\1106\0A07!
X`09--------\0808\1010-
X`09The vi "map" and "map!" commands are implemented in vile.  As in
X`09vi, mapping works best if the character sequence being bound
X`09corresponds to pressing a single key.  Multip\0F06 sequences will
X`09work as long as the next key in the sequence is pressed within a
X`09specified number of milliseconds.  The value of "timeoutlen" is
X`09used for system-defined character sequences, i.e. function keys.
X`09User defined sequences will use this too, unless the value of
X`09"timeoutlen-user" is non-zero, in which case this value will be
X`09used instead.
X
X`09Because "map" and "map!" may be used to remap arbitrary sequences,
X`09these sequences must be entered literally, i.e, the syntax for
X`09key sequences as listed above will not work for "map" and "map!".
X`09To enter control characters into a .vilerc file, use the `5EV escaping
X`09mechanism.  A map command entered from the\1909line will require
X`09fewer characters be escaped with `5EV.
X
X`09To provide a relatively portable way of specifying function key
X`09mappings, vile will reapply \1C07 to the result of a system-
X`09defined map.  System function keys are mapped to "poundsign"
X`09sequences, like '#1' for function key 1, and '#B\1D06the down-arrow
X`09key.  The remapping allows one to put
X`09`09map #1 <some-user-map-sequence>
X`09in the .vilerc file, and have the user-sequence executed when the
X`09system F1 key is pressed.  (Otherwise the terminal-specific
X`09sequence would have to appear in the .vilerc.)  See the section
X`09on "Function Keys" above for a full list.
X
X`09The "remap" option controls whether the successfully mapped result
X`09of a map is reevaluated for more mapping matches.  The "noremap" (and
X`09"noremap!") variants of the map commands will force that particular
X`09mapping to be applied without subsequent re\2B07, regardless of
X`09the current setting of the global "remap"\1E08.
X
X`09Since key sequences starting the '`5EX', '`5EA', or '#' prefixes
X`09are normally expected to act as a unit, no remapping is done on
X`09characters that follow such prefixes.  For instance, this keeps a
X`09map like:
X`09`09:map h ihello<ESC>
X`09from breaking the '`5EX-h' command.
X
X`09Long running loops caused by recursive :map definitions are
X`09detected and assumed to be infinite.  When such a loop is \3A08,
X`09execution is aborted.  Turning off the "remap" option, or doing
X`09some of the maps with the ":noremap/\0908!" form\2F0B
X`09commands will eliminate most such loops.
X
X`09vile normally duplicates real vi's behavior (but not vim's) in that
X`09the first character of the sequence being mapped to is not subject
X`09to recursive (map) evaluation.  Assuming "remap" is on, pressing
X`09'j' when ":map j jh" is in effect will not cause an infinite loop,
X`09whereas ":map j hj" _will_ cause such a loop.  Setting the
X`09"remapfirst" option will allow this sort of remapping (and will
X`09cause an infinite loops for both examples).
X
X`09The "maplonger" option controls whether the \2406 or shorter of
X`09two "nested" map strings will be favored by the editor.  That is,
X`09if both "foo" and "foobar" are mapped (to presumably different
X`09values), then with "maplonger" set, vile will not expand "foo" until
X`09it is sure (either because the next character is not 'b', or a
X`09timeout has expired) that "foobar" will not be seen.  Real vi will
X`09always expand "foo" immediately, and this is the default behavior.
X`09Though not particularly recommended, the "maplonger" mechanism even
X`09permits the following types of mappings:
X
X`09`09:map z j
X`09`09:map zz k
X
X`09When 'z' is pressed by itself it will cause vile to move down one
X`09line (assuming j has not been rebound or remapped).  But if 'z' is
X`09pressed twice rapidly (enough) in succession, vile will move to the
X`09previous line.
X
X`09The left hand side of a map`5B!`5D definition may contain the usual
X`09backslash escapes:  `5Cn, `5Cr, `5Ct, `5Cb, `5Cf, `5Ca (`5EG), `5Ce (ESC),
V
X`09`5Cs (SPACE), `5CxNN (hex), `5CNNN (octal).  The right hand side is
X`09taken exactly literally, so special characters must be expressed
X`09as themselves.
X
X`09The current set of mappings or "map!"ings may be viewed with
X`09the commands ":map<CR>" (or ":show-mapped-chars") or ":map!<CR>"
X`09(or ":show-mapped!-chars").
X
X`09The system-defined maps, representing the function keys, may be
X`09shown with ":show-system-mapped-chars".
X
X`09To undo a mapping, use "unmap", \0906!", or\1607-system-chars".
X
X`09:abbr
X`09------
X`09The "abbr" command is also present in vile.  It is similar to, but
X`09slightly different than, "map!".  Whereas\1107 examines
X`09characters as they are typed, continuously looking for a match
X`09against the stored translation strings, the "abbr" command examines
X`09them after they are already in the buffer, and is more sensitive to
X`09their surrounding context.
X
X`09First, abbreviations are never expanded unless followed by
X`09non-"word" characters.  In addition, abbreviations which begin like
X`09a "word" (i.e. with letters, digits, or the '_' character) are not
X`09expanded if they immediately follow another "word" character --
X`09they must follow whitespace or punctuation or the beginning of the
X`09line.  Likewise, abbreviations that begin with a punctuation
X`09character are not detected within more punctuation -- they must
X`09follow whitespace or a "word", or the beginning of the line.
X
X`09If the "backspacelimit" setting is set (and it is, by default),
X`09then characters not inserted during the curren\1C08ion command
X`09are not considered in the above comparisons -- the start of the
X`09current insertion behaves much like the beginning of line in that
X`09case.
X
X`09Abbreviations are never recursive.
X
X`09vile is more lenient than vi regarding what is a valid
X`09abbreviation.  vi insists that an a\220B be all "word"
X`09characters, or be all "non-word" \210Cexcept for the last
X`09character, which _must_ be a "word" \2409.  vile allows
X`09anything at all to be abbreviated, only enforcing the expansion
X`09rules mentioned above.
X
X`09To undo an abbreviation, use "un\1509e".
X
XSpecial "Terminal" Key Rebinding
X--------\0808\1010
X
X`09In addition to the above binding mechanism for vile commands, other
X`09keystrokes to the editor are rebindable using the "set-terminal"
X`09command.  These keystrokes are mostly derived directly from the
X`09user's tty settings on entering the editor, but there are a couple
X`09of additions related to command and filename completion.
X
X`09The values of these characters can be shown with the "show-terminal"
X`09command, and can be changed with the "set-terminal" c\3406.
X
X`09`09&0209Default value&0209Typical\0F06
X`09--------\0808\1010\201D
X`09backspace`09`09from tty settings`09(DEL or `5EH)
X`09interrupt`09`09from tty settings`09(`5EC or DEL)
X`09line-kill`09`09from tty settings`09(`5EU or @)
X`09mini-edit`09`09(`5EG)
X`09name-complete`09`09<tab>
X`09quote-next`09`09from tty settings`09(`5EV)
X`09start-output`09`09from tty settings`09(`5EQ)
X`09stop-output`09`09from tty settings`09(`5ES)
X`09suspend`09`09`09from tty settings`09(`5EZ)
X`09test-completions`09?
X`09word-kill`09`09from tty settings`09(`5EW)
X
XFlow-control
X------------
X`09Historically, the flow of data between the computing host and the
X`09user's terminal was throttled through the use of special characters
X`09in the input stream, known as XON and XOFF (whose values are `5EQ and
X`09`5ES respectively).  Most modern systems do not need these
X`09characters, and regulate the flow in an "out-of-band" manner.  The
X`09terminal device driver, however, is usually still set up with
X`09software flow control enabled, to allow the user to manually start
X`09and stop output with the `5ES and `5EQ characters.
X
X`09vile normally resets the driver to allow the `5ES and `5EQ characters
X`09to be bound to commands, since most systems no longer need software
X`09flow control, and since there is usually no reason for a user to
X`09wish to suspend output when running vile.  Some older devices
X`09(usually older slower terminals), however, still need to be able to
X`09automatically control the data flow by generating `5ES/`5EQ without the
X`09user's intervention.
X
X`09To accommodate these situations, the "flow-control-enable" command
X`09will reset the terminal driver to its original state.  Software
X`09flow-control will be re-enabled, and commands bound only to the `5ES
X`09and `5EQ characters will be inaccessible.  The \260Baffected
X`09in this way may be seen with the "show-terminal-chars" command,
X`09where they will appear as the "start/stop-output" characters.
X`09The action of the "flow-control-enable" command will be reversed
X`09if it is given any argument.
X
XRecorded macros
X--------\0807
X
X`09The first type of macro in vile is for temporary, quick\2606
X`09usage, and lets you record a macro a\1606execute vile commands.
X`09You can then replay those keystrokes with a single key.
X
X`09`5EX-(`09Begin recording a keyboard macro.  The keystrokes you type
X`09`09are recorded, until you use `5EX-).
X`09`5EX-)`09Finish recording a keyboard macro.
X`09`5EX-`26`09Execute the keyboard macro.
X`09`5EX-`5E`09Copy recorded keyboard macro to a named register, for saving,
X`09`09or for execution using '@a', as below.  (Type "a`5EX`5E )
X
X`09The vi '@' command is present as well, and can be used to execute
X`09the contents of a named register as if it were entered at the
X`09keyboard.  To make this more useful, the "load-register" command
X`09will allow preloading a named register, from .vilerc file.  For
X`09example:
X`09`09use-register a load\100Aihello`5E`5B
X`09will load register 'a' with a command to insert the word "hello".
X`09(The `5E`5B should be a real ESC character, entered by preceding it
X`09with `5EV.)  A better example, is this:
X`09    use-register w load\100A":!chmod +w %`5EM:w`5EM"
X`09which makes the current file writable and writes it.  (Again, use
X`09`5EV to get the CR characters into the .vilerc file.)
X
XProgrammed procedures and macros
X--------\0808\1010
X
X`09`5B For more/different information on programmed macros, refer
X`09to the file "macros.doc", supplied with the vile source code. `5D
X
X`09vile can also be extended by defining macros and then binding
X`09the execution of those macros to key sequences.  For instance, if
X`09the following lines appear in a .vilerc file:
X`09`091 store-macro
X`09`09 5 delete-til next-word
X`09`09`7Eendm
X`09`09bind-key execute-macro-1 `5EA-1
X`09then when `5EA-1 is executed, 5 words will be deleted.  The "-til"
X`09suffix on an englishname denotes that it is a vi operator style
X`09command, and expects to be followed by a motion \3007.  Also,
X`09`091 store-macro
X`09`09 5 delete-til lines
X`09`09`7Eendm
X`09would be the equivalent of "5dd" sinc\1E06word "lines" represents
X`09the stuttered 'dd' style of operation.  More examples are given
X`09down below.
X
X`09Variables
X`09---------
X`09There are some built-in variables that can be used in macros to gain
X`09access to parts of vile status, and\1A0Athe current buffer.
X`09Built-in variables are accessed by name, prefixed with the '$'
X`09character.  There are two types of built-in variables (the environment
X`09variables, and mode values).  The environment va\2E07 are:
X
X`09$abufname`09alternate buffer name (i.e. last visited)
X`09$buffer-hook`09name of procedure to run when switching to a \3906
X`09$cbufname`09current buffer name
X`09$cd-hook`09name of procedure to run when changing directories
X`09$cfilname`09current file name
X`09$char`09`09character under the cursor
X`09$cryptkey`09encryption key`09`09&0209(write only)
X`09$curcol`09`09current column position of cursor
X`09$curline`09current line in file
X`09$cwd`09`09current directory
X`09$cwline`09`09line offset in current window
X`09$debug`09`09macro debugging -- set true for line by\0806tracing
X`09$directory`09controls location of temp-files
X`09$discmd`09`09display commands on\0C08 line
X`09$disinp`09`09display command line input characters
X`09$end-of-cmd`09true if user ended the cmd with <CR>
X`09$exit-hook`09name of procedure to run when quitting
X`09$flicker`09set true to suppress CGA \2107 on a PC.  ugh.
X`09$font`09`09current font name (X11 version only)
X`09$forward-search`09\0706 direction, true=\2607
X`09$helpfile`09help-filename (vile.hlp)
X`09$iconname`09current icon name (X11 version only)
X`09$identifier`09current punctuated word
X`09$kill`09`09some of the kill register&0209(read only)
X`09$lastkey`09last keyboard char struck
X`09$line`09`09text of current line
X`09$llength`09\0706 of current line`09`09`09(read only)
X`09$majormode`09current \1209, if any`09`09(read only)
X`09$match`09`09last matched magic pattern&0209(read only)
X`09$mode`09`09current mode ("command","insert","overwrite") (rd. o.)
X`09$modeline-format \0707of mode lines.  see "M\1208 customization".
X`09$modified`09is current buffer \1B08 or not?
X`09$ntildes`09percent of window filled by `7E chars, at end of buffer
X`09$ocwd`09`09previous directory&0209`09(read only)
X`09$os`09`09operating system ("unix", "dos", "vms", "os/2") (rd. o.)
X`09$pagelen`09number of screen lines in use by editor
X`09$pagewid`09current screen width
X`09$palette`09current \1007 string
X`09$patchlevel`09current patch-level (empty for release)
X`09$pathname`09current path-like word
X`09$pending`09typeahead \1207 flag`09`09`09(read only)
X`09$pid`09`09returns vile's process-id&0209(read only)
X`09$progname`09returns "vile" or "xvile".`09`09(read only)
X`09$qidentifier`09current qualified name (as with C++ ::)`09(read only)
X`09$read-hook`09name of procedure to run after a file is read
X`09$replace`09\0807ment pattern
X`09$search`09`09\0806 pattern
X`09$seed`09`09current random number seed
X`09$shell`09`09name of the shell program for spawned commands.
X`09$sres`09`09current screen resolution
X`09$status`09`09returns the \1406 of the last command
X`09$title`09`09current window title (X11 version only)
X`09$tpause`09`09length to pause for paren matching (PC versions)
X`09$version`09current \1007 number`09`09`09(read only)
X`09$wline`09`09number of lines in current window
X`09$word`09`09current "word"
X`09$write-hook`09name of procedure to run before a file is written
X`09$xdisplay`09the value to set $DISPLAY when running $xshell.
X`09$xshell`09`09name of the terminal program for spawned xvile commands.
X
X`09In addition to the environment variables, you may set and use the
X`09values of the editor modes (i.e., universal\1706, buffer-only\2A07or
X`09window-only modes), e.g., "setv $dos=true".  The global values of the
X`09editor modes are not visible to the expression evaluator.
X
X`09User-defined variables can also be set and used; their names are
X`09prefixed with the '%' character.
X
X`09Response variables (a '@' followed by a prompt-string) cause vile to
X`09prompt for input with the given \2006-string.
X
X`09Buffer variables (a '<' followed by a b\2606name) return the current
X`09line of the specified buffer, automatically setting the position to the
X`09next line.
X
X`09Functions
X`09---------
X`09There are also functions available, which can act on those variables,
X`09or on hard-coded values.  Operations are expressed in prefix notation,
X`09so to add to numbers you would say "`26add 3 5".
X
X`09func`09no. of
X`09name`09args
X`09--------\0806
X`09`26add`092`09add two numbers together
X`09`26sub`092`09subtraction
X`09`26tim`092`09multiplication
X`09`26div`092`09division
X`09`26mod`092`09modulus
X`09`26neg`091`09negate
X`09`26cat`092`09concatenate string
X`09`26lef`092`09left string(\0706, len)
X`09`26rig`092`09right string(\0706, pos)
X`09`26mid`093`09mid string(\0706, pos, len)
X`09`26not`091`09logical not
X`09`26equ`092`09logical equality
X`09`26les`092`09logical less than
X`09`26gre`092`09logical greater than
X`09`26seq`092`09string logical equality check
X`09`26sle`092`09string logical less than
X`09`26sgr`092`09string logical greater than
X`09`26ind`091`09evaluate indirect value
X`09`26and`092`09logical and
X`09`26or `092`09logical or
X`09`26len`091`09string length
X`09`26upp`091`09uppercase string
X`09`26low`091`09lower case string
X`09`26tri`091`09trim whitespace from string
X`09`26tru`091`09Truth of the universe logical test
X`09`26asc`091`09char to integer conversion
X`09`26chr`091`09integer to char conversion
X`09`26gtk`090`09get 1 character
X`09`26gts`090`09get keycode sequence, e.g., #1
X`09`26rnd`091`09get a random number from 1 to n
X`09`26abs`091`09absolute value of a number
X`09`26sin`092`09find the index of second string in first
X`09`26env`091`09retrieve a system environment variable
X`09`26bin`091`09lookup what function name is bound to key
X`09`26rd`091`09is a file readable
X`09`26wr`091`09is a file writable
X`09`26glo`091`09retrieves global mode setting
X`09`26loc`091`09retrieves local mode setting
X
X
X`09Directives
X`09----------
X`09Primitive flow-of-control within a macro may be obtained with
X`09certain directives.  Macro\130B start with a "`7E" and include
X`09the following:  (see the file macros.doc for more detail)
X
X`09`7Eif cond`09conditional execution
X`09`7Eelseif cond`09conditional execution
X`09`7Eelse
X`09`7Eendif
X`09`7Ereturn`09`09Return (terminating current macro)
X`09`7Egoto label`09Jump to a\1006 in the current macro
X`09`7Eforce`09`09Force macro to continue...even if command fails
X`09`7Ewhile cond`09Execute a loop if th\1B06ition is true
X`09`7Ebreak
X`09`7Eendwhile
X
X`09`7Eendm`09`09End a macro
X
X`09Line Labels begin with a "*" as the first nonblank char, like:
X
X`09*LBL01
X
X`09(you would jump to this with:
X`09`09`7Egoto LBL01
X`09)
X
X`09Lines ending with '`5C' are joined before interpreting them.
X
X`09Procedures vs. Macros
X`09--------\0808-----
X`09Macros are really just a special use of stored "procedures", which
X`09are, in turn, really just a special "type" of buffer.  To execute
X`09the contents of a buffer, it needs to have a name of the form
X`09"`5Bbuffername`5D".  Then, it can be executed as a procedure with the
X`09"run" command, as in "run buffername".  The best way to get
X`09procedures into buffers named that way (and also to make them
X`09invisible, so they don't clutter the buffer list) is to use
X`09the "store-procedure" command:
X
X`09    store-procedure my_cd_action
X`09`09write-message `26cat `26cat\0A06"moved from " $ocwd " to " $cwd
X`09`09`7Eif `26seq $progname "xvile"
X`09`09    set title $cwd
X`09`09`7Eendif
X`09    `7Eendm
X
X`09Macros are a special usage of procedures, which are bindable to
X`09keystrokes (i.e. if procedures could be bound directly to keys,
X`09then macros would be redundant).  When the "9 store-macro" command
X`09is used, it creates a procedure whose name is `5BMacro 9`5D, where 9
X`09is the argument to "store-macro".  This can then be executed
X`09with either
X`09`09run "Macro 9"
X`09or
X`09`09execute-macro-9
X`09Most of the examples given below use the macro form of definition,
X`09since one most often wants to bind macros to keys.
X
X`09Hooks
X`09-----
X`09There are a few places within vile w\2306 user-specifiable
X`09procedure will be executed if desired.  These points are referred
X`09to as "hooks".  Hooks are specified by\0D06al variables which
X`09hold the name of a procedure to run at that point in the code.
X`09For instance, there is a "cd-hook", which is run when you change
X`09directories.  So, using the "my_cd_action" example given above,
X`09if the line
X`09`09set cd-hook my_cd_action
X`09is added, then that procedure will print a message and, under
X`09xvile, change the window title when the current directory is
X`09changed.
X
X`09The following hooks are currently implemented:
X`09$buffer-hook`09run when switching to a \2406
X`09$cd-hook`09run when changing directories
X`09$exit-hook`09run when quitting
X`09$read-hook`09run after a file is read
X`09$write-hook`09run before a file is written
X
X`09Be careful with "buffer-hook".  Executing commands in the hook
X`09which themselves switch buffers is not recommended.  In general,
X`09all the hooks are a little dangerous, since vile has not been
X`09written with re-entrancy foremost in mind.  One should avoid putting
X`09actions in hooks which might cause the hook to be re-executed.
X`09(vile keeps the hook procedure itself from being re-executed, to
X`09prevent recursion, but the code surrounding\1506all to it may not
X`09be safe either.)
X
X`09Macro examples
X`09--------\0806
X`09To prevent vile from thinking that a failed command is an error in
X`09the macro, you can put "`7Eforce" in front of it.  So, to write a
X`09macro which will run the "man" command o\1506identifier under the
X`09cursor, where you don't really consider it an error if the command
X`09fails, you might use:
X
X`09`099 store-macro
X`09`09`09`7Eforce 1 shell-command `26cat "man " $identifier
X`09`09`7Eendm
X`09`09bind-key execute-macro-9 `5EX-m
X
X`09(The argument '1' suppresses the "press return" prompt which
X`09normally appears after a command runs, since man runs a pager
X`09which does this anyway.)
X
X`09The "screen-search-forward" command could be re-implemented as:
X`09`0910 store-macro
X`09`09`09`7Eforce search-forward $identifier
X`09`09`7Eendm
X`09`09bind-key execute-macro-10 `5EX-/
X
X`09And the "screen-search-pattern-grab" command, normally bound to
X`09`5EA-/, could be implemented with:
X`09`0911 store-macro
X`09`09    set-variable $search $identifier
X`09`09    write-message `26cat "Search pattern is now " $search
X`09`09`7Eendm
X`09`09bind-key execute-macro-11 `5EA-/
X
X`09A variation, which will not find the identifier if it is a substring
X`09of another word, is:
X`09`0912 store-macro
X`09`09`09`7Eforce search-forward `26cat "`5C`5C<"\0B06$identifier "&025C>"
X`09`09`7Eendm
X`09This works by surrounding the string with the `5C< and `5C> regular
X`09expression metacharacters.
X
X
X`09Here's another example, which finds C++ qualified identifiers, and
X`09uses them for a tag lookup:
X`09`09* Implement  `5EA-`5E`5D for qualified-name tag lookup
X`09`0924 store-macro
X`09`09`09backward-character
X`09`09`09set-variable %osearch $\0806
X`09`09`09search-forward "`5E`5Ba-zA-Z_`5D\09070-9_:`5D*"
X`09`09`09set-variable $search %o\0906
X`09`09`09set-variable %osearch ""
X`09`09`09write-message `26cat "Tag pattern is now " $match
X`09`09`09`7Eforce find-tag $match
X`09`09`7Eendm
X`09`09bind-key execute-macro-24 `5EA-`5E`5D
X`09(The "backward-character" is needed because "search-forward" will
X`09always skip the cursor position when scanning, so as to a\3806find
X`09the next occurrence.  The user variable %osearch is used so as not
X`09to disturb the search string.)
X
X`09Note that for simple key-remappings, binding is often preferable
X`09to creating a macro.  Some people prefer using lower-case 'g' to
X`09as an equivalent to 'G', to goto a specific line.  If done as a
X`09macro, like this:
X
X`09`093 store-macro
X`09`09    goto-line
X`09`09`7Eendm
X`09`09bind-key execute-macro-3 g
X
X`09then both g and G go to the end of the file, but whereas 1000G goes
X`09to line 1000, 1000g goes to the end of the fil\2806 times.  It is
X`09easier (and more correct) to do:
X
X`09`09bind-key goto-line g
X
X`09A couple more examples of slightly\1A06complex macros:
X`09They cause a jump to the next (or previous) line of the same (or
X`09lesser) indent, skipping over empty lines.  (Thanks to MIURA Masahiro)
X
X`09; macro 1 - back to the line of same indent
X`09;
X`091 store-macro
X`09`09first-nonwhite
X`09`09set-variable %indlev $curcol
X`09`09`7Eforce back-line-at-bol
X`09`09`7Eif `26seq `26trim $line ""
X`09`09`09`7Egoto L1
X`09`09`7Eendif
X`09`09`7Ewhile `26les %indlev $curcol
X`09`09`09*L1
X`09`09`09`7Eforce back-line-at-bol
X`09`09`09`7Eif `26seq $status "FALSE"
X`09`09&0209`7Ereturn
X`09`09`09`7Eendif
X`09`09`09`7Eif `26seq `26trim $line ""
X`09`09&0209`7Egoto L1
X`09`09`09`7Eendif
X`09`09`7Eendwhile
X`09`7Eendm
X`09bind-key execute-macro-1 `5EX-`5B
X
X`09; macro 2 - forward to the line of same indent
X`09;
X`092 store-macro
X`09`09first-nonwhite
X`09`09set-variable %indlev $curcol
X`09`09`7Eforce down-line-at-bol
X`09`09`7Eif `26seq `26trim $line ""
X`09`09`09`7Egoto L2
X`09`09`7Eendif
X`09`09`7Ewhile `26les %indlev $curcol
X`09`09`09*L2
X`09`09`09`7Eforce down-line-at-bol
X`09`09`09`7Eif `26seq $status "FALSE"
X`09`09&0209`7Ereturn
X`09`09`09`7Eendif
X`09`09`09`7Eif `26seq `26trim $line ""
X`09`09&0209`7Egoto L2
X`09`09`09`7Eendif
X`09`09`7Eendwhile
X`09`7Eendm
X`09bind-key execute-macro-2 `5EX-`5D
X
X`09; macro 14 - grep for the word unde\0F06cursor, and put the result
X`09;`09in a buffer named after that word.  set the error-\2D06,
X`09;`09so that `5EX-`5EX may be used to visit the lines found by grep.
X`09;`09(we have to set error-buffer explicitly, since we renamed
X`09;`09the buffer -- otherwise it tracks the last pipe read by vile)
X`0914 store-macro
X`09`09set-variable %grepfor $identifier
X`09`09edit-file `26cat "!egrep -n "\1206%grepfor " *.`5Bchs`5D"
X`09`09rename-buffer %grepfor
X`09`09error-buffer %grepfor
X`09`7Eendm
X`09bind-key execute-macro-14 `5EA-g
X
X`09As a hint, it is (almost?) never correct to write a ':' command
X`09when creating a programmed macro.  For instance, if you find
X`09yourself writing something like:
X
+-+-+-+-+-+-+-+-  END  OF PART 111 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 112 -+-+-+-+-+-+-+-+
X`09    `26cat ":!chmod +w " $cfilname
X`09    `26cat ":e! " $cfilname
X
X`09(in an attempt to make a buffer writable before editing it), then
X`09what you really want is:
X
X`09    shell-command `26cat "chmod +w " $cfilname
X`09    replace-with-file $cfilname
X
X`09Furthermore, some things are just as easy if done with a
X`09"keystroke" macro rather than a programmed\1F06:
X
X`09    ; use this as '@w'
X`09    use-register w load\100A":!chmod +w %`5EM:setl noview`5EM:w`5EM"
X
X`09or
X
X`09    map `5EA-w ":!chmod +w %`5EM:setl noview`5EM:w`5EM"
X
X`09(Of course you need to replace the `5EM's with real carriage-returns.)
X
X`09Picture Mode
X`09------------
X`09Another example of a fairly complex vile procedure can be found
X`09in the file "pictmode.rc".  The code there implements a primitive
X`09means of drawing "ASCII art":
X
X`09`09o--------\0808\1010\2008o
X`09       /--------\0808\1010\2008/`7C
X`09      o--------\0808\1010\2008o`7C`7C
X`09      `7C To use it, first ":source pictmode.rc" `7C`7C`7C
X`09      `7C and then "run pic".  See the comments  `7C`7C`7C
X`09      `7C at the top of pictmode.rc for more     `7C`7Co
X`09      `7C information...`09`09\1907 `7C/
X`09      o--------\0808\1010\2008o
X
XRegular Expressions
X--------\0808---
X
X`09Searches use regular expressions, which, as in vi, may be magic
X`09by default or not.
X
X`09vile introduces some new magic metacharacters.
X
X`09The code that implements the expressions is based directly on
X`09Henry Spencer's regexp code.  Quoting from the original man page:
X
X`09`5BFor ease of reference, the metacharacters are noted in\2006argin.)
X
X   `5C`7C`09"A regular expression is zero or more branches, separated by `60
V`5C`7C'.
X`09It matches anything that\1609one of the branches."
X
X`09"A branch is zero or more pieces, concatenated.  It matches a\0A06
X`09for the first, followed by a match fo\2306second, etc."
X
X`09"A piece is an atom possibly followed by `60*', `60`5C+', or `60`5C?'.  A
V\3206
X   *`09followed by `60*' matches a sequence of 0 or more \2008of the
X   +`09atom.  An atom followed by `60`5C+' matches a sequence of 1 or more
X   `5C?`09matches of the atom.  An atom followed by `60`5C?' \2F08a\0A06 of
X`09the atom, or the null string." `5Bi.e., `60`5C?' matches 0 or 1 occurrences
V`5D
X
X `5C( `5C)`09"An atom is a regular expression in backslashed parentheses
X`09(matching a match for the regular expression), a range (see below),
X  . `5E`09`60.' (matching any single character), `60`5E\250Cthe null string
X   $`09at the beginning of the input string), `60$' (matching the null
X   `5Cc`09string at the end of the input \1F06), a `60`5C' followed by a singl
Ve
X   c`09character (matching that c\1908), or a single\180A with no
X`09other significance (matching that character)."
X
X `5C< `5C>`09In addition, vile atoms may be: `5C< and `5C>, which match the
X `5Cs `5CS`09beginning and end of a "word", `5Cs and `5CS, which match charact
Vers of
X `5Cw `5CW`09whitespace and "darkspace", `5Cw and `5CW, which match alphanumer
Vics
X `5Cd `5CD`09(including '_') and non-alphanumerics, `5Cd and `5CD, which match
V
X `5Cp `5CP`09digits and non-\0F06, and `5Cp and `5CP, which match printable an
Vd
X`09non-printable characters (whitespace is \2409).
X
X `5B `5D`09"A range is a sequence of characters enclosed in `60`5B`5D'.  It no
Vrmally
X`09matches any single character from the sequence.  If\120D
X`09begins with `60`5E', it matches any single character not from the
X`09rest of the sequence.  If two characters in\240D are
X`09separated by `60-', this is shorthand for the full list of ASCII
X`09characters between them (e.g.  `60`5B0-9`5D' matches any decimal digit).
X`09To include a literal `60`5D' in the sequence, make it the first
X`09character (following a possible `60`5E').  To include a literal `60-',
X`09make it the first or last character."
X
X`09Additionally for vile, if "ignorecase" is set, then all literal
X`09matches, including those in character classes, are done without
X`09regard to upper and lower case.
X
X`09In magic mode, the following set of metacharacters
X`09must be preceded by '`5C' to hide their special meaning:
X`09`09* `5B . `5E $
X`09These characters are special if they _are_ preceded with a '`5C':
X`09`09? + ( ) `7C < >
X
X`09If magic mode is _not_ on, only `5E and $ are special if not escaped.
X`09All of the following must be preceded with a '`5C' to be special,
X`09otherwise they are taken literally:
X`09`09? + ( ) `7C * `5B . < >
X
X`09Replacement subexpressions are supported when substituting.  That
X`09is, if part of an expression is contained in `5C( and `5C), then the
X`09part of the matched text in between those symbols will be
X `5C1 `5C9`09substituted for an occurrence of `5C1 in the replacement pattern.
V  Up
X`09to 9 such substitutions can be made.  The special symbol `26 will
X  `26`09substitute for the entire match string.
X
X  `7E`09The tilde (`7E) character will expand immediately when it is typed
X`09to be the contents of the previously entered replacement pattern.
X`09`5B Earlier versions of vile made this \1B07 of the pattern
X`09available immediately, as a default response, but this made it
X`09difficult to substitute nothing after previously\240Aing
X`09something.  `5D
X
X`09The replacement part of the substitution may also contain the
X `5CU `5CL`09special sequences `5CU and `5CL, which cause the replacement to b
Ve
X `5CE`09forced to uppercase or low\0D07until a terminating `5CE is found;
X `5Cu `5Cl`09`5Cu and `5Cl, which force the case of a single character;\3406b,
V
X `5Cbfrtn`09`5Cf, `5Cr, `5Ct, `5Cn, which insert the usual ASCII character.
X`09Note that vile mimics perl's handling of `5Cu`5CL`5C1`5CE instead of vi's.
V
X`09Given :s/`5C(abc`5C)/`5Cu`5CL`5C1`5CE/ vi will replace with "abc" whereas v
Vile
X`09and perl will replace with "Abc".  This is somewhat more useful for
X`09capitalizing words.
X
XCommand files
X-------------
X
X`09On startup (in the absence of '@' arguments -- see Invocation
X`09below), vile will attempt to read the file ".vilerc" in the current
X`09directory, and then in $HOME\1306will execute the commands found
X`09therein.  `5BThis file is called "vile.rc" under DOS, and is searched
X`09for in the current directory and along the PATH.`5D  It is possible to
X`09nest such executions.  For example, you might keep your general
X`09default settings in your home directory, and put the following
X`09lines in a .vilerc\0D06directory in which you prefer tabs be set
X`09to 4 spaces:
X
X`09`09source "$HOME/.vilerc"
X`09`09set tabstop 8
X
X`09The quotes surrounding the filename are necessary to protect the
X`09name from interpretation as a vile variable, since it starts with
X`09the '$' character.
X
X`09Files can be executed at any time with the ":source" (or
X`09":execute-file") command.  There are control structures available,
X`09such as `7Ewhile, `7Eif, etc.  Refer to the file macros.doc which
X`09is distributed with vile for more information.
X
X`09Nesting of source'd files is limited to a depth of ten, to prevent
X`09infinite recursion.
X
X`09The ';' character can be used as a comment\230Bin command
X`09files, but not necessarily on the same line as valid commands.  Put
X`09your comments on separate lines to be safe.
X
XInvocation
X----------
X
X`09As mentioned above, vile normally looks for files called "./.vilerc"
X`09and "$HOME/.vilerc", and executes the first one found.  If the
X`09variable VILEINIT is set in the environment, it is used as a set of
X`09vile commands to initialize the editor.  As a not-very-useful
X`09example of a VILEINIT sequence, the following setting will exactly
X`09recreate the default (i.e. no VILEINIT variable) behavior:
X
X`09`09export VILEINIT
X`09`09VILEINIT="
X`09`09`7Eif `26rd `5C"./.vilerc`5C"
X`09`09`09source `5C"./.vilerc`5C"
X`09`09`7Eelse
X`09`09`09`7Eif `26rd `5C"$HOME/.vilerc`5C"
X`09`09&0209source `5C"$HOME/.vilerc`5C"
X`09`09`09`7Eendif
X`09`09`7Eendif"
X
X`09Other environment variables:
X
X`09VILE_HELP_FILE
X`09`09override the name of the help file, normally "vile.hlp".
X`09VILE_STARTUP_FILE
X`09`09override the name of the startup file, normally ".vilerc"
X`09`09(or "vile.rc" for non-UNIX systems).
X`09VILE_STARTUP_PATH
X`09`09override the search path for\1406tartup and help files.
X
X
X`09Command line options
X`09--------\0808----
X`09The command line options are fairly straightforward.  vile does not
X`09support running just _any_ command after a '+', as does vi, but does
X`09support the commonly used '+400' to go to line 400 and '+/foo' to
X`09search for foo.  Command files can be explicitly executed on
X`09startup by prefixing them with the '@' character, as in "vile
X`09@mycmds file.c".  This will suppress the operation of VILEINIT and
X`09the .vilerc files.
X
X`09Use "vile -?" to get the usage message.
X
X`09+NNN and -gNNN  vile will begin the session on the first file
X`09`09at the specified line number.
X
X`09+/pattern or -s \0E08  In the first file, vile will execute an
X`09`09initial search for the given pattern.
X
X`09-t tag  vile will edit the correct file and move the cursor
X`09`09to the location of the tag.  This requires a tagsfile
X`09`09created with the ctags(1) command.
X
X`09-h      Invokes vile on the helpfile.
X
X`09-v`09Invokes vile in "view" mode - no changes are permitted
X`09`09to the buffer in this mode.  (This will also be true if
X`09`09vile is invoked as view.)
X
X`09-V`09vile will report its version number.
X
X`09@cmdfile   vile will run the specified file as its startup
X`09`09file, and will bypass any normal startup file (i.e.
X`09`09.vilerc) or environment variable (i.e. $VILEINIT).
X
XEncryption
X----------
X`09vile implements a simple encryption algorithm, and can apply this
X`09to your buffers either automatically (via a mode setting) or
X`09manually (via an explicit command).  The algorithm is reversible,
X`09so crypting a previously\1606ed buffer or region will undo that
X`09encryption.
X
X`09The encryption key for a buffer will be a) inherited from the
X`09global cryptkey which was set via the vile command line (-k) if it
X`09exists, b) set with the set-crypt-key (`5EX-X) command, or c)
X`09obtained from the user interactively.  The details of this are a
X`09little messy, and should probably be cleaned up somewhat.  The
X`09buffer's key will remain active until changed or reset.
X
X`09If "crypt" mode is on, then when the buffer is writt\1607user
X`09will be prompted for the encryption key to use in none has yet been
X`09set.  If "crypt" mode is on, and an encryption key has been set,
X`09then the buffer will be crypted when read.  In practice this means
X`09you need to read the file, then set crypt mod\1508re\2B08
X`09file.  (Or, equivalently, create the buffer, set crypt mode, and
X`09then insert the file into it (with ":r").
X
X`09The `5EX-C operator will crypt an arbitrary region of a buffer, using
X`09the current key.  Note that crypting two adjacent regions
X`09separately will _not_ produce the same result as crypting their
X`09single equivalent region once.
X
X`09vile's encryption algorithm is also available externally, via the
X`09"vile-crypt" program built from the same sources.  \320A will
X`09encrypt/decrypt a file using vile's \1A07lgorithm.  You can use
X`09"-k key" to supply the key on the commandline, and "-m" to treat
X`09the file as a mail message -- in that case, only text after the
X`09first blank line will be crypted.  Text to be en\1707 can be
X`09specified as filenames on the command line, or provid\2E06the
X`09standard input.  All output appears on stdout.  On systems with
X`09a getpass() library routine, the user will be prompted for the
X`09encryption key if it is not given on the command line.  To
X`09accomodate systems (such as linux) where the getpass() library
X`09routine is not interruptible from the keyboard, entering a
X`09crypt-key password which ends in `5EC will cause the program to quit.
X
X
XCrash Recovery
X--------\0806
X
X`09The "vi -r" option, used to recover an edited buffer after a system
X`09crash, is not present in vile.  If vile itself crashes (usually
X`09(though infrequently :-) due to a bug, but perhaps\1A09n
X`09externally applied signal), it will attempt to save any modified
X`09buffers in a directory under /tmp, and send mail to the user to
X`09that affect.  If system crashes are frequent on your\2407, you
X`09should stop using it.  You might also consider the "autosave" and
X`09"autowrite" options, which will cause more frequent saves of your
X`09work.
X
X
XMode line customization
X--------\0808\1007
X
X`09At the bottom of each window is a mode (or "status") line which
X`09is used for displaying certain characteristics of the window and
X`09the buffer associated with it.  On most displays, this mode line
X`09will be highlighted in reverse video or via other means in order
X`09to visually separate windows and to distinguish the mode line from
X`09text displayed in the window.
X
X`09The editor variable "modeline-format" is set to a string which
X`09controls formatting of mode lines.  This variable is user settable and
X`09thus may be used to customize the display of mode lines.  The
X`09format specifiers which may appear in the \2A07control strings
X`09are as follows:
X
X`09`09%i `09insert/overwrite/replace mode indicator, displayed
X`09`09`09only when in insert, overwrite, or replace mode.
X`09`09`09When not in one of these modes, the separator
X`09`09`09character (often "-", "=", or " ") will be displayed.
X`09`09%b`09buffer name
X`09`09%f`09file name when not internal buffer and\1D0Athe
X`09`09`09same as the buffer name.
X`09`09%F`09internal buffer name
X`09`09%m`09major mode(s), e.g., cmode, view-only, etc.  Displayed
X`09`09`09in square brackets.
X`09`09%l`09line number to be displayed if "ruler" is set
X`09`09%c`09column number if "ruler" is set
X`09`09%p`09line number as percentage of\1808of lines if
X`09`09`09"ruler" is set
X`09`09%S`09rough position of window with respect to buffer (top,
X`09`09`09bot, all, emp, mid) when ruler not set (or \1206is
X`09`09`09set, but buffer is empty).
X`09`09%L`09number of lines in buffer, if ruler is set
X`09`09%=`09middle separator; should appear at most once in a
X`09`09`09format string.  This indicates where to separate the
X`09`09`09left and right hand portions of the mode line with a
X`09`09`09long string of dashes (or whatever the separator
X`09`09`09character is).
X`09`09%-`09single occurrence of separator character
X`09`09%`7C`09eighty column indicator
X`09`09%%`09percent sign
X`09`09%:`09colon
X
X`09Some of the format specifiers (%f, %F, %m, %l, %c, %p, %S, %L) are
X`09conditionally displayed.  For example "%m" will\2208 the major
X`09modes only if there are some major modes set or \2506 buffer has
X`09been modified (which is sort of a major mode).  Similarly, "%F" and
X`09"%f" will cause the associated file name to be displayed when the
X`09buffer is of the appropriate type (a scratch \2D07or not) and the
X`09shortened file name is different from the buffer name.  It is
X`09desirable at times to cause a prefix string and/or a suf\170A
X`09to be emitted along with the string obtained after conversion of
X`09the format specifier.  This may be done by following \350A
X`09specifier with a colon, the prefix string, another \220A
X`09suffix string, and another colon.  For example, "%l:(:,:%c::) :"
X`09might be used to display the line and column number for "ruler"
X`09mode.  Note that either or both of the prefix and suffix strings
X`09may be empty.
X
X`09Characters in the string which are not part of a format specifier
X`09are output verbatim.
X
X`09The default format control string is as follows:
X
X`09    "%-%i%- %b %m:: :%f:is : :%=%F: : :%l:(:,:%c::) :%p::% :%S%-%-%`7C"
X
X`09Mode lines for some versions of vile previous to\1D08 4.7 can be
X`09obtained with the following format string.  This will remove the
X`09percentage indication from the mode line when in ruler\1806and
X`09also shift the ruler indicator to the far right in the mode line.
X
X`09    "%-%i%- %b %m:: :%f:is : :%=%F: : %-%-%-%-:%l:(:,:%c::):%S::\1606`7C"
X
XFiltering "man" pages
X--------\0808-----
X
X`09When used in conjunction with the vile-manfilt program (supplied as
X`09source file "manfilt.c"), either vile or xvile may be used to filter
X`09and view manual pages.  xvile will even display (with your font set
X`09properly) certain portions of the manual page text in bold or
X`09italics as appropriate.
X
X`09The file manpage.rc (found in the vile source directory, and also
X`09copied below) contains a macro which is bound to `5EX-m.  It will
X`09prompt for a manual page, filter it, attach attributes and display
X`09it in the current window.  The text of manpage.rc may be either
X`09incorporated verbatim into your .vilerc file or may be read from
X`09your .vilerc as follows:
X
X`09`09source `7E/manpage.rc
X
X`09This assumes that you have moved the manpage.rc file to your home
X`09directory.  If you do all of this but use vile rather than xvile,
X`09you will still end up with a legible man page, albeit without the
X`09spiffy formatting.
X
X`09The manual page filtering program may also be used to look at other
X`09text formatted with nroff.  From the vile source directory, for
X`09example, the following command will format and filter the vile
X`09manual page (which is nroff source).
X
X`09`09:e !nroff -man vile.1 `7C vile-manfilt
X
X`09Once loaded, it will look rather funny.  There will be Cntl-A
X`09characters scattered throughout the text followed by a sequence of
X`09digits followed by one or more uppercase letter\2A0Ea
X`09colon.  These Cntl-A sequences specify how the text following the
X`09colon should be attributed.  The vile command
X`09"attribute-cntl_a-sequences-til" (bound to `5EA-A) may be used to
X`09format a region of text containing these sequences.  To continue our
X`09example, the following command will translate this representation of
X`09attributed text into one which is more pleasing to look at.
X
X`09`09`5EA-AG
X
X`09Here is the macro from the file manpage.rc:
X`09;;
X`09;; Macros for obtaining manual pages and then attributing them.
X`09;;
X`09;; Author: Kevin Buettner
X
X`0929 store-macro
X`09`09set-variable %manpage @"man page? "
X`09`09`7Eif `26or `26seq %manpage "ERROR" `26 \170E"
X`09`09`09`7Ereturn
X`09`09`7Eendif
X`09`09set-variable %manpagebuf `26cat "<"\0906\1A08 ">"
X`09`09set terse
X`09`09`7Eforce select-buffer %manpagebuf
X`09`09`7Eif `26not $status
X`09`09`09edit-file `26cat "!man "\0D06%manpage " `7C vile-manfilt"
X`09`09`09`7Eforce rename-buffer %manpagebuf
X`09`09`09`7Eforce error-buffer %manpagebuf
X`09`09`09write-message "`5BAttaching attributes...`5D"
X`09`09`09goto-beginning-of-file
X`09`09`09setl noview
X`09`09`09attribute-cntl_a-sequences-til end-of-file
X`09`09`09unmark-buffer
X`09`09`09setl view
X`09`09`09goto-beginning-of-file
X`09`09`09write-message "`5BDone formatting manual page.`5D"
X`09`09`7Eendif
X`09`09set noterse
X`09`7Eendm
X`09bind-key execute-macro-29 `5EX-m
X
XFiltering C programs
X--------\0808----
X`09C program text may be displayed with keywords and comments
X`09highlighted in a similar fashion to the man page filtering
X`09described above.  A filter which performs this is supplied with
X`09vile, and is called "vile-c-filt" (source is "\1406.c").  Its use
X`09is described more fully in comments at the head of the source file.
X`09It doesn't provide what one would describe as "tightly integrated
X`09syntax coloring".  Its usefulness is limited by reliance on an
X`09external filter to do the coloring, and the fact that the filter
X`09interferes with the normal undo history of the buffer (since it
X`09must modify the buffer to do its work).  Nonetheless, it's an
X`09interesting adjunct to the editor.
X
X`09Here is a macro one might use to invoke the colorizer:
X`09    30 store-macro
X`09`09    write-message "`5BAttaching C/C++ attributes...`5D"
X`09`09    set-variable %savcol $curcol
X`09`09    set-variable %savline $curline
X`09`09    set-variable %modified $\0A08
X`09`09    goto-beginning-of-file
X`09`09    filter-til end-of-file "vile-c-filt"
X`09`09    goto-beginning-of-file
X`09`09    attribute-cntl_a-sequences-til end-of-file
X`09`09    `7Eif `26not %modified
X`09`09`09    unmark-buffer
X`09`09    `7Eendif
X`09`09    %savline goto-line
X`09`09    %savcol goto-column
X`09`09    write-message "`5BAttaching C/C++ attributes...done `5D"
X`09    `7Eendm
X`09    bind-key execute-macro-30 `5EX-q
X
X`09The vile-c-filt program does its work based on the contents of
X`09$HOME/.vile.keywords, which contains a set of \2207/attribute
X`09pairs.  An example (and probably insufficient) .vile.keywords file
X`09might contain:
X`09`09Comments:B
X`09`09Literal:B
X`09`09Cpp:U
X`09`09if:C3
X`09`09else:C3
X`09`09for:C3
X`09`09while:C3
X`09`09do:C3
X`09`09typedef:I
X`09`09struct:I
X`09(The "Comments" keyword is a pseudo-\1408which determines the
X`09attribute given to C and C++ style comments.  "Literal" applies to
X`09string literals. "Cpp" applies to C preprocessor lines, e.g. #if,
X`09etc.)
X
X`09An alternative filter, written using "flex", is available in
X`09c-filt.flx.  It might suit your needs better, or be a\1007
X`09starting point for creating similar coloring mechanisms for other
X`09languages.
X
XWriting your own filters
X--------\0808\1008
X`09Filters may be written as either an external program or with
X`09the Perl interface.  Both the manual page filter and the C
X`09program colorizer are examples of external \2B07s which do
X`09the filtering.  The hgrep.pl perl script is an example of a
X`09filter which uses the vile's interface to Perl.
X
X`09Regardless, the goal of the filter is to embed in the text
X`09a control sequences which describe how the sub\2406t text
X`09should be attributed by the vile command
X
X`09`09attribute-cntl_a-sequences-til
X
X`09(See above for examples of how to use this command.)
X
X`09The control sequences take the following form:
X
X`09`09`5EA<Count><Attr>:
X
X`09<Count> is a sequence of digits representing the number of
X`09characters following the ':' to be attributed.
X
X`09<Attr> is a sequence of characters which indicates how to
X`09attribute the required number of characters following the
X`09':'.  The following sequences are recognized by vile:
X
X`09`09I&0209-- italic
X`09`09B&0209-- bold
X`09`09R&0209-- reverse (or inverse) video
X`09`09U&0209-- underline
X`09`09C<hex digit>`09-- color number (one of 16)
X`09`09H<command>`5C0`09-- hypertext \1807
X
X`09The <command> for hypertext \1707s may be any sequence of
X`09characters except for newlines and null \280A.  A null
X`09character must terminate the hypertext command.  The \0E07
X`09should be a valid vile command such as you might enter into
X`09your .vilerc file.
X
X`09The attribute characters may be used together in any
X`09combination.  So, for example, you could use the following
X`09to make some text appear both bold and italic:
X
X`09`09`5EA15IB:Bold and italic
X
XHypertext
X---------
X`09Vile does not currently supply a builtin key binding for
X`09executing hypertext commands.  The following macro and
X`09key binding will cause the space bar to be bound to a macro
X`09which will follow a hypertext link when the cursor is placed
X`09on top of it.  If no hypertext link is present, then the
X`09normal default action of advancing one character to the
X`09right is taken:
X
X`09    22 store-macro
X`09`09`7Eforce execute-hypertext-command
X`09`09`7Eif  `26not $status
X`09`09    `7Eforce forward-character-to-eol
X`09`09`7Eendif
X`09    `7Eendm
X`09    bind-key execute-macro-22 `5C
X
X`09`5B Note to Paul and Tom:  Maybe we should just add a little
X`09  bit of code to make this the default binding for space bar?
X`09  Or is some other key binding preferable?  In any event,
X`09  it'll only take 7 or 8 lines to do the job... `5D
X
X`09When using xvile, double clicking on a hypertext link will
X`09cause the hypertext command to be executed.  If no \2909
X`09command is associated with the text under the cursor, the
X`09default action of selecting the word under the cursor will
X`09occur instead.
X
XX Window System specifics
X--------\0808\1009
X
X`09If you are using xvile under X11, the following additions are
X`09available:
X
X`09Mouse Buttons
X`09-------------
X
X`091 -`09Sets cursor position and the start of\0D06election when
X`09`09mouse pointer is positioned in any vile window (but not the
X`09`09message line).`09Clicking on a mod\1A06 will set the
X`09`09keyboard focus to the corresponding vile window.  Double
X`09`09clicking on a mode line will do the above in addition to
X`09`09clearing the highlighting associated with the current
X`09`09selection.
X
X`09`09Selections may be made by holding button one down and
X`09`09"wiping" with the mouse.  Release of\170A button will
X`09`09cause the selection to be yanked and made available (if
X`09`09desired) for pasting.  The region selected may be forced to
X`09`09be rectangular by holding the control key down while wiping
X`09`09with button one depressed.  If the wiping motion goes out of
X`09`09the current window, text will be scrolled in the appropriate
X`09`09direction if possible to accommodate selections larger than
X`09`09the window.  The speed at which the scrolling occurs will
X`09`09increase with the passage of time making it practical to
X`09`09select large regions of text quickly.
X
X`09`09Individual words or lines may be selected by double or
X`09`09triple clicking.
X
X`092 -`09Paste the current PRIMARY selection.  With a shift modifier,
X`09`09it pastes at the mouse position, otherwise \2B0C
X`09`09the last text cursor position before selecting.
X
X`093 -`09Extend the current selection.  As with button one, the
X`09`09selection may be adjusted or scrolled by holding down button
X`09`09three and wiping with it.  Selections may be extended in any
X`09`09window open to the same buffer as which\1906election was
X`09`09started in.
X
X`09`5B As described below in the "Scrollbars" section, the buttons
X`09are modified by the control key as follows, when used on a scrollbar:
X
X`09Ctrl-Button-1 splits the clicked-on window into two \1006s.
X`09Ctrl-Button-2 deletes the clicked-on window.
X`09Ctrl-Button-3 makes the clicked-on window the only\1007. `5D
X
X
X`09Areas of selected text can be operated on with any vile\1A07or
X`09command, in conjunction with the special "motion" command '`5ES',
X`09which applies the operator to the selected region.  For example,
X`09after selecting text with the mouse, it can be converted to
X`09uppercase with `5EA-u`5ES.`09Remember that some operators (e.g. the
X`09shell-filtering operator, '!') are only capable of working on full
X`09lines of text.
X
X`09Clipboard
X`09---------
X
X`09Data may be exchanged between many X applications via the
X`09PRIMARY selection.  This\110A is set and manipulated as
X`09described in the above section entitled "Mouse Buttons".
X
X`09Other applications, most notably OpenLook\240Fuse
X`09the CLIPBOARD selection to exchange data between applications.
X`09On many Sun keyboards, selected text is moved to the clipboard
X`09by pressing the "Copy" key and pasted \2611Paste"
X`09key.  If you find that you can not paste text selected in
X`09xvile in other applications or vice-versa, it may well be that
X`09these applications use the CLIPBOARD selection instead of the
X`09PRIMARY selection.  (The other mechanism used among really old
X`09applications involves the use of a ring of cut buffers.)
X
X`09xvile provides two commands for manipulating with the
X`09clipboard.  These are copy-to-\1E09 and
X`09paste-from-clipboard.  When copy-to\190A is executed, the
X`09contents of the current selection are copied to the special
X`09clipboard kill register (denoted by ';' in the\200Alist).
X`09When an application requests the clipboard selection, xvile
X`09gives it the contents of this kill register.  The
X`09paste-from-clipboard command requests c\1B09data from the
X`09current owner of the CLIPBOARD selection.
X
X`09Users of Sun systems may want to put the following key
X`09bindings in their .vilerc file in order to make use of the
X`09Copy and Paste keys found on their keyboards:
X
X`09`09bind-key copy-to-clipboard #-`5E
X`09`09bind-key paste-from-clipboard #-*
X
X`09Scrollbars
X`09----------
X
X`09The X toolkit version of xvile provides default translations
X`09similar to the translations for scrollbars found in the Athena
X`09widget set.  (If you know how to use xterm's scrollbars,\2809
X`09how to use these scrollbars.)  Button on\1908s forward.\1D08
X`09three scrolls backward.  The amount of\2107ing obtained by these
X`09buttons depends on the position at which they were pressed\2B07
X`09scrollbar.  Clicking near the top of the \2909 will\0F07 the
X`09text by a small amount which may be as little as one line.
X`09Clicking in the middle will scroll by about half a page.  \3A08
X`09near the bottom will scroll by a larger amount up to a whole page.
X`09Holding either one of these buttons down will cause repeated
X`09scrolling.
X
X`09If simply pressed and released, button two will set the position in
X`09the buffer to a position proportional to the location of the
+-+-+-+-+-+-+-+-  END  OF PART 112 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 113 -+-+-+-+-+-+-+-+
X`09pointer on the scroll bar.  Button two may be held down to "drag"
X`09the slider from one place to another causing text to scroll
X`09continuously.
X
X`09The Motif and OpenLook versions provide scrollbars from their
X`09respective widget sets.  Both versions have a slider indicating the
X`09position of the window over the buffer.  OpenLook's slider is fixed
X`09in size with little arrows at the top and bottom of the slider.
X`09Pressing on one of these arrows will cause scrolling in the
X`09appropriate direction.`09The slider may be "grabbed" and moved by
X`09pressing and dragging the middle portion between the arrows.
X`09Motif's slider is solid with size varying to indicate the size of
X`09the window with respect to the size of the buffer.  Any portion of
X`09it may be grabbed for movement.  There are little arrows at the top
X`09and bottom of the scroll bar which may be clicked upon to cause
X`09scrolling by one line.`09In both of these widget sets, clicking on
X`09the scrollbar either above or below the slider will caus\3608ing
X`09by a full page.  OpenLook has two additional control areas; the
X`09buffer position may be set to either the beginning or end of the
X`09buffer by pressing on one of the little rectangular areas at either
X`09the top or bottom of the scrollbar.
X
X`09In all versions built with scrollbars enabled, you can resize
X`09windows by moving the border between corresponding scrollbars (with
X`09the mouse).  The X toolkit version is probably the most functional,
X`09with the windows being continuously resized as the mouse is moved.
X`09The OpenLook and Motif versions wait until after a position is
X`09selected to resize the windows.  The OpenLook version is perhaps
X`09the least functional; there is no visible indication (other than
X`09the position of the mouse pointer) to indicate where the new border
X`09will be.
X
X`09Splitting and deleting of windows may also be done with the mouse.
X`09In each case the action is selected by pressing one of the mouse
X`09buttons over a scrollbar with the control key held down.  Button
X`09one (with the control key held down) will split the scrollbar and
X`09the corresponding vile window with the new border at or near the
X`09mouse cursor.  Button two (with control key) will delete the
X`09scrollbar and corresponding window.  Button three (with control
X`09key) will make the corresponding window the only\1007.
X
X`09Standard X command line arguments
X`09--------\0808\1010-
X
X`09-fn fontname`09Font to use (or -font).
X`09-rv`09`09Use reverse video (also -r\1506).
X`09+rv`09`09Don't use reverse video.
X`09-display disp`09D\0D07to run xvile on.
X`09-fg color`09Foreground\1106 (or -f\1609).
X`09-bg color`09Background\1106 (or -b\1609).
X`09-bd color`09Border\0D06 (or -bordercolor).
X`09-name name`09Name used for resource lookups.
X`09-title name`09Name to be displayed in titlebar.
X`09-geometry geom`09Initial window dimensions in columns and rows.
X`09-iconic `09Start xvile iconified.
X`09-xrm Resource`09Specify or change an X r\2007 internal to xvile.
X
X`09Additional xvile command line arguments
X`09--------\0808\1010\2007
X
X`09-fork`09`09to spawn xvile immediately on startup
X`09+fork`09`09to force xvile to not spawn on startup
X`09-leftbar`09Put scrollbar(s) on left.
X`09-rightbar`09Put scrollbar(s) on right (default).
X
X`09Setting a new process group
X`09--------\0808\100B
X`09Some systems and/or some shells and display managers seem to want
X`09xvile to run in its own process group, to help isolate its signals
X`09and actions from the signals \1D0Cof the parent process
X`09(i.e. the shell or window manager that starts xvile). \0906 can
X`09be forced into its own process group with the "new-\1C07-group"
X`09command, which one would put in the .vilerc file.  Using this will
X`09cause a call to "setpgrp()" or "setsid()".  This behavior is not
X`09the default because a) it can't be undone, and b) it seems
X`09undesirable on some systems, in that xvile cannot be suspended and
X`09put in the background after startup if it's in its own group.
X
X`09Additionally, if given a count as argument, this command will cause
X`09xvile to fork(), and the parent to exit before the new process
X`09group is set by the child.  This will further isolate it from its
X`09process environment (and in fact will move xvile into the background
X`09if started from the shell).
X
X`09The "new-process-group" command has no effect in non-X11 versions
X`09of vile.
X
X
X`09X Resources
X`09-----------
X
X`09font`09`09Font to use.
X
X`09geometry`09Window dimensions in characters.
X
X`09charClass`09Character classes for multiple click selections.
X`09`09`09The format is identical to that of xterm(1).
X
X`09multiClickTime`09How long between clicks (in milliseconds) to
X`09`09`09be accepted as a multi-click.
X
X`09foreground
X`09background`09Fore\0B06/B\1609 color of the main xvile text
X`09`09`09area.
X
X`09cursor.foreground
X`09cursor.background   Fore\0D06/B\180Acolor of the c\3706
X`09`09`09By default the cursor location is indicated by
X`09`09`09inverting the foreground and back\0F07colors of
X`09`09`09the cell the cursor is over.  Thus the color of the
X`09`09`09cursor will vary depending upon location.  Use of
X`09`09`09these subresources will cause the cursor to
X`09`09`09maintain constant coloration of the user's
X`09`09`09choosing, and may make it easier to see when it
X`09`09`09appears in a "highlighted" or "selected" area of
X`09`09`09text.
X
X`09modeline.focusForeground
X`09modeline.focusBackground   Fore\0D06/\180Bcolor of the mode
X`09`09`09line corresponding to the window with focus, i.e.
X`09`09`09the "current" window.
X
X`09modeline.foreground
X`09modeline.background   Fore\0D06/B\180Acolor of mode lines
X`09`09`09corresponding to windows without the keyboard
X`09`09`09focus.  modeline.background is also used for the
X`09`09`09scrollbar borders and resize grips.
X
X`09forkOnStartup`09If true, xvile forks after initialization.
X
X`09focusFollowsMouse  If true, the "current" window is the \0E06
X`09`09`09inhabited by the mouse; no clicking is necessary
X`09`09`09to change windows.
X
X`09pointer.foreground
X`09pointer.background   Fore\0D06/B\180Acolor of the \3808
X
X`09pointer.normalShape
X`09pointer.watchShape   Set the shapes for the normal and watch \3D07s
X`09`09`09respectively.
X
X`09scrollbarOnLeft Either true or false; control the placement of
X`09`09`09the scrollbars.  By default,\190B are placed
X`09`09`09on the right.
X
X`09scrollbarWidth`09An integer indicating the width of the \3609.
X
X`09scrollbar.foreground
X`09scrollbar.background  Fore\0C06/B\170Acolor of the slider or
X`09`09`09one of the colors\0E08slider if a stippled
X`09`09`09pixmap is used.  To force the slider to be only the
X`09`09`09foreground color, you should set sliderIsSolid to
X`09`09`09true.  (X toolkit version only)
X
X`09scrollbar.sliderIsSolid  If false, indicates that the stippled
X`09`09`09pixmap should be used to simulate grey.  This will
X`09`09`09be best on monochrome displays.  True works better
X`09`09`09for color displays.  True indicates the slider will
X`09`09`09be displayed in the foreground color, shaded to
X`09`09`09look three-dimensional, if possible.  (X toolkit
X`09`09`09version only)
X
X`09scrollRepeatTimeout  Amount of time in milliseconds to wait initially
X`09`09`09before repeating scroll when button one or three are
X`09`09`09held down. (X toolkit version only).
X
X`09scrollRepeatInterval  Amount of time to wait between repeating
X`09`09`09subsequent scrolls.   This parameter is also used
X`09`09`09for controlling the speed at which selections are
X`09`09`09scrolled.
X
X`09selection.foreground
X`09selection.background  Fore\0C06/B\170Acolor of the \3909
X`09`09`09regions.  "foreground" is the color that
X`09`09`09the text is displayed in.
X
X`09persistentSelections  If true (the default), highlighting of the
X`09`09`09selection will persist even when button one is
X`09`09`09pressed to set the cursor position.  A false value
X`09`09`09will behave more like other X applications in which
X`09`09`09display of the selection is lost as soon as button
X`09`09`09one is pressed.
X
X`09selectionSetsDOT  If false (the default), the cursor will be restored
X`09`09`09to its previous position prior to making the selection.
X`09`09`09If true, the cursor will be positioned at the location
X`09`09`09of the mouse at the end of making a selection (usually
X`09`09`09at either the start or end of a selection).
X
X`09blinkInterval`09An integer indicating the time in milliseconds to wait
X`09`09`09before blinking the cursor.  A positive value will
X`09`09`09cause the cursor to always blink.  Setting
X`09`09`09blinkInterval to zero will cause the cursor to never
X`09`09`09blink which may be useful on some display servers
X`09`09`09connected to very slow networks.  The disadvantage
X`09`09`09of setting it to zero is that it is sometimes hard
X`09`09`09to tell where the cursor is when situated at the
X`09`09`09boundary of a highlighted region.  A negative value
X`09`09`09(which is the default) will cause the cursor to
X`09`09`09blink only when situated in a highlighted region
X`09`09`09such as a selection.  This will make the cursor
X`09`09`09visible no matter where it is.
X
X`09color.fcolor1,
X`09color.bcolor1, ...,
X`09color.fcolor15,
X`09color.bcolor15
X`09`09`09When doing text attribution with the
X`09`09`09"attribute-cntl_a-sequences-til" command (bound to
X`09`09`09`5EA-A), the attribute may be of the form "Cn", where
X`09`09`09'n' is a hex digit.  This digit picks one of the 16
X`09`09`09fcolor/bcolor pairs set up in the color
X`09`09`09subresource.  For example, if the buffer contained
X`09`09`09the text:
X`09`09&0209`5EA6C3:foobar
X`09`09`09then after the `5EA-A command was applied, the leading
X`09`09`09"`5EA3C3:" would be gone, and the word "foobar\2507
X`09`09`09appear in the foreground and back\0F07colors
X`09`09`09specified by color.fcolor3 and \1206b\1206.  Either
X`09`09`09of the pair can be left unspecified, and will default
X`09`09`09to the natural foreground or back\0E07color of
X`09`09`09normal text.
X
X`09menuHeader
X`09menuEntry`09The names given to the menu header and entries,
X`09`09`09respectively.
X`09menuHeight`09resource controlling the Athena menu-height
X
X`09Sample .Xdefault entries
X`09--------\0808\1008
X
X`09You may or may not want to use the following as a starting point
X`09for the "XVile" section of your .Xdefaults or .Xresources file.  If
X`09you have a monochrome display server, you will probably not want
X`09to use any of the color specifications.  You may, however, wish
X`09to set up a blinking cursor, using "blinkInterval"  (see above).
X
X`09XVile*font: -*-courier-medium-r-normal-*-*-*-75-75-m-70-iso8859-*
X`09XVile*geometry:`0980x54
X`09XVile.background: darkslategrey
X`09XVile.foreground: honeydew
X`09XVile.scrollbar.foreground: firebrick2
X`09XVile.scrollbar.sliderIsSolid: true
X`09XVile.selection.background: aquamarine4
X`09XVile.selection.foreground: honeydew
X`09XVile.cursor.background: yellow
X`09XVile.cursor.foreground: darkslategrey
X`09XVile.modeline.Background: steelblue
X`09XVile.modeline.foreground: darkslategrey
X`09XVile.modeline.focusForeground: yellow
X
X`09Fonts
X`09-----
X
X`09To change the font on\0C06ly, us\1906':setv' command to set the
X`09$font variable, with ":setv \1C06<fontname>".
X
X`09At present, only xvile is capable of displaying bold and italic (or
X`09underline) text associated with attributes.  It is anticipated that
X`09other versions of vile will catch up to the best of their ability.
X`09Users of xvile will find that the italic font in particular is not
X`09always available with the font that they've chosen (or have had
X`09chosen for them).  If an italic font is unavailable, xvile will
X`09underline text which is meant to be italic.  The program xfontsel is
X`09quite useful for determining which fonts are available on your
X`09display server and whether there are corresponding bold and/or
X`09italic fonts available.
X
X`09Here are some tips on using xfontsel to find an appropriate font.
X
X`09`091) Set rgstry (registry) to iso8859
X`09`092) Set spc (spacing) to either "c" (cell font) or "m"
X`09`09   (monospaced font).  You will be more likely to find a
X`09`09   font which will work as italic if you choose a
X`09`09   monospaced font, however.  You definitely do not want
X`09`09   a proportional font.
X`09`093) Now pull down the slant menu.  Select either "i"
X`09`09   (italic) or "o" (oblique).  If neither of these are
X`09`09   available, go back to step 2 and choose a different
X`09`09   spacing.
X`09`094) Set avgWdth (average width) next. If you divide the
X`09`09   value you've chosen by ten, this will be width of a
X`09`09   glyph in the font in pixels.
X`09`095) Set wght (weight) to medium.  If you have a hard time
X`09`09   seeing the characters, you might want to choose bold,
X`09`09   but xvile will not be able to use the bold font for
X`09`09   displaying bold text.  It will be forced to overwrite
X`09`09   text that it wants to be bold with the text shifted by
X`09`09   one pixel.  This works fairly well for larger fonts.
X`09`096) Set fmly (family) to a value according to personal taste.
X`09`09   By this step, you might not have any choice on the matter
X`09`09   anyway.
X`09`097) If only one font is available at this point, the other
X`09`09   fields don't matter that much.  Otherwise set these
X`09`09   according to taste.
X`09`098) Go back to the slant menu and change either the "i" or
X`09`09   "o" to "r".
X
X`09`09This will be the font to use.  xvile \2008attempt to get
X`09`09the italic font when needed by substituting either "o" or
X`09`09"i" for the "r".
X
X`09If the above seems too tedious, you can just try the following font
X`09which (on many display servers) is pretty close to the size of the
X`09default font that xvile will start up with.
X
X`09`09-*-courier-medium-r-*-*-*-*-\080670-*-*
X
X`09You can try it out by issuing the appropriate "set font" command
X`09from xvile.  For longer term use, you will probably want to put it
X`09in your .Xdefaults file.  It will look something like this:
X
X`09`09XVile*font: -*-courier-medium-r-*-*-*-*-\080670-*-*
X
X`09You may also set the font from your .vilerc file.  This is not
X`09recommended, however, as you lose the ability to choose a different
X`09font from the command line or resource file.  It may also cause the
X`09xvile window to be unnecessarily resized during initialization.
X
X
X
X
XDOS specifics
X-------------
X
X`09The .vilerc file is called vile.rc under DOS.
X
X`09vile is perfectly happy (and even tries very hard) to use the
X`09UNIX-style "forward-slash" ('/') as a path delimiter.  Entering the
X`09"backslash" ('`5C') will work, but you should be aware that vile uses
X`09this character as an escape mechanism for entering special
X`09characters (e.g. "`5Ct" for TAB) in strings.  As an example setting
X`09"tags" to "tags ..`5C\1206will not have the intended result.
X`09Instead, use "tags ..`5C`5Ctags" or better, \1B08/tags".
X
X`09vile should leave your screen in the mode you're in when you
X`09enter it, unless you explicitly change it to a different mode with
X`09a "set sres=" line in your vile.rc, or if you use a command line
X`09option to change it.  Command line \2306s consist of a dash
X`09followed by one of the \1706ing selectors (these are the same
X`09values that can be assigned to "sres"):
X`09    "default",
X`09    "2",     "25\0A06"80x25",
X`09    "4",     "43\0A06"80x43",
X`09    "5",     "50\0A06"80x50",
X`09    "80x14", "80x28",
X`09    "40x12", "40x21\09085\12088\1B0750",
X
X`09`5B Currently, under DOS, not all modes may work, as a result of
X`09  the screen library being used... (in version 5.5).  More may
X`09  work under OS/2. `5D
X
X`09If you shell out in 50 line mode, make sure you are \230F
X`09before you exit the dos shell, otherwis\2207nd up with a 50 line
X`09edit window with only the top 25 displayed.
X
X`09The vile.rc file can be located in the same directory as your
X`09binary executable, since vile searches the PATH for this file.
X
X`09All file globbing, including from the command line, is done using
X`09UNIX shell-style wild-carding conventions.
X
X`09The expansion of the ':' character in user input, which normally
X`09expands to the "word under the cursor", is suppressed for DOS, due
X`09to the conflict with the drive-specifier syntax (e.g. "c:`5Cfoo").
X`09The character '`26' may be used for this instead.
X
X`09In any version of vile there is a command, "set-dos-mode", which
X`09will a) strip all carriage-return ('`5EM') characters from the ends
X`09of lines in the buffer and b) set the "dos" mode so that carriage
X`09returns are appended when the file is written.  There is also a
X`09corresponding "set-unix-mode" command, which strips carriage
X`09returns, and forces "nodos" mode, so that they don't come back when
X`09you write the file.  In both cases, "dos" mode becomes a so-called
X`09"local" mode, so that the rest of your buffers will be unaffected.
X
X`09Vile supports a 16-color palette under DOS, which includes:
X
X`09`09black, red, green, brown, blue, magenta, cyan,
X`09`09lightgray, \0606brightred\0B08green, yellow,
X`09`09brightblue, \0C06magenta\0F08cyan, white
X
X`09If you wish to change vile's internal notion of these colors, put
X`09a line in your vile.rc which resets the "palette" variable.  By
X`09default its value is "0 4 2 6 1 5 3 7 8 12 10 14 9 13 11 15",
X`09which associates each of the above colors with\1606ppropriate
X`09PC color attribute.  Under MS-DOS, the palette values are masked
X`09with 7 before being used as background colors, to prevent blinking
X`09characters.
X
X
X
X
XWin32 specifics
X--------\0807
X
X`09Flavors
X`09-------
X`09The editor may be invoked/built as a console or GUI application.
X`09The former is known as vile.exe and the latter as win\1E09.
X`09For the remainder of this section\1006e help file, a generic
X`09reference to "vile" refers to both the console and GUI editor,
X`09unless otherwise stated.
X
X`09Heritage
X`09--------
X`09The Win32 version of vile supports almost all of the features
X`09and changes listed directly above in the section entitled
X`09"DOS specifics", with the exception that\1306ditor's screen
X`09resolution cannot be changed using command-line switches or
X`09the sres command.
X
X`09Pipes
X`09-----
X`09Internally, vile uses two radically different mechanisms for piping
X`09data to and from the shell.  One mechanism uses temporary files and
X`09the other simply calls native Win32 services (no temp files).  This
X`09dichotomy exists because the original Win95 console shell (command.com)
X`09accesses the floppy drive each and every time a process communicates
X`09with it via a pipe and the OS R2 shell abruptly hangs under similar
X`09conditions.  By default, then, on a WinNT host, vile's pipes are
X`09implemented with Win32 services and via temp files on a Win95 host.
X`09If the user's replacement Win95 shell does not exhibit problems
X`09similar to those described above (e.g., Thompson Toolkit Shell),
X`09vile may be forced to use native Win32 pipes by setting the global
X`09mode "w32pipes" (e.g., "se \1509).
X
X`09Mouse
X`09-----
X`09Selecting and dragging with the left mouse button yanks text to the
X`09unnamed register.  Extend the selection beyon\1506bottom of the
X`09current window by continuing to hold the left mouse button down while
X`09moving the cursor back and forth across the window's mode line.
X
X`09Change vile's window focus via left mouse button clicks (when
X`09multiple windows are displayed).
X
X`09Clipboard
X`09---------
X`09Copy data from the unnamed register to the windows clipboard via
X`09the copy-unnamed-reg-to-clipboard command (bound to Alt+Insert).
X
X`09Utilities
X`09---------
X`09vile-c-filt has been ported and may be used to statically color
X`09source files (refer to the section of this file entitled "Filtering
X`09C programs" for further info).  There exist detailed, win32-related
X`09comments within the source file c-filt.c that describe minor
X`09porting changes, as well as providing example usage that leverages
X`09the editor's 16-color palette.
X
X`09Perl
X`09----
X`09At the user's discretion, vile may be built with an embedded perl
X`09interpreter.  To date, only the perl `5Bbinary`5D distribution at the
X`09following URL is supported:
X
X`09    http://www.perl.com/CPAN-local/ports/win32/Standard/x86/
X
X`09If you acquire (i.e., do not personally build) a copy of
X`09"perl-embedded" vile, these external configuration steps are
X`09necessary:
X
X`091) Obtain the `5Bbinary`5D perl distribution from the aforementioned
X`09   URL and install it.  Included in this distribution, among many
X`09   other items, is a required DLL and the usual perl packages.
X
X`092) `5BOptional`5D To invoke vile-based perl scripts distributed with the
X`09   editor, create an exported environment variable called
X`09   VILE_LIBRARY_PATH that specifies a directory of your choice.  Then
X`09   create a subdirectory called %VILE_LIBRARY_PATH%`5Cperl and copy the
X`09   scripts to same.  The list of\1E09known to work in a Win32
X`09   environment includes:
X
X`09`09hgrep.pl glob2re.pl visit.pl search.pl
X
X`09Modes
X`09-----
X`09force-console   Boolean indicating whether or not winvile forces
X`09`09`09console creation prior to initiating a native read
X`09`09`09pipe or filter region operation.  Must be set when the
X`09`09`09host shell doesn't properly communicate with consoles
X`09`09`09created as a side effect of the CreateProcess() API.
X`09`09`09Reset by default unless Win95's command.com is the
X`09`09`09current shell.  Note:  this mode is applicable only
X`09`09`09when w32pipes is set. (U)
X
X`09scroll-pause`09An integer indicating the time in milliseconds to
X`09`09`09wait after scrolling the display.  A value of zero,
X`09`09`09the default, disables this mode.  T\0C08 is
X`09`09`09necessary when rapid scrolling operations cause
X`09`09`09improper screen refresh by the console editor
X`09`09`09(should only be a problem with inexpensive video
X`09`09`09HW).  Typical values, if required, are 20-80
X`09`09`09(msec).  (U)
X
X`09w32pipes`09See discussion of pipes above.  (U)
X
X
X
X
XDifferences from vi
X--------\0808---
X
X`09Of course, this really isn't vi.  Some of the following differences
X`09deserve changing, others do not.
X
X`09The parser for the ':' commands is not very vi-like.  For instance,
X`09":e" will prompt you for a file name.  Most commands remember their
X`09last argument, and will present it as the default reply to their
X`09prompt.
X
X`09The backspace, line kill, word\0B07job control, etc. characters
X`09are not rebindable.  They are, however, read from the tty settings
X`09on startup.
X
X`09There is no expansion of ! in filenames.  It is expanded in shell
X`09escapes, so the command ":!!" does rerun the previous shell\2C08.
X`09Occurrences of '#' and '%' are recognized and expanded to the
X`09previous or current filename.
X
X`09Paragraph and section boundaries, for the `7B, `7D, `5B, and `5D commands
X`09are configurable, but may not exactly match those in vi.  They are
X`09expressed via regular \1607ions.  The default\2214
X`09are quite complex, to support the traditional nroff and troff
X`09boundaries.  If you are just editing code, you may want to replace
X`09them:
X
X`09`09; set paragraph and section r.e.s for speed on C/C++/perl code.
X`09`09set paragraphs=`5E$
X`09`09set sections=`5E`5B`7B`5EL`5D
X
X`09There is no special lisp support.  But then, when was the last time
X`09you heard of a lisp programmer that used vi?
X
X`09Of course, ex and open mode aren't there.  (Too bad.  I'd love
X`09to have a companion editor called "exile".)
X
X`09Most, but not all, of the word-motion-with-operator and end-of-line
X`09anomalies have been recreated.  One missing \2C06y: In vile, "dw"
X`09on the last word of a line ending in whitespace deletes the
X`09trailing whitespace.  vi does not delete the \240B
X
X`09In the real vi, the '_' command is a little-used motion \2007,
X`09which moves the cursor to the start of the Nth next line, where N
X`09is the argument given, less 1.  So '2_' takes you to the start of
X`09the next line.  Primarily intended for use in an operator context,
X`09as in "2d_", it is always exactly equivalent in those cases to
X`09"stuttering" the operator, as in "2dd".  Most people know about and
X`09use the stuttered form, so in vile, the '_' command is used by
X`09default for buffer history.  If the regular vi behavior is desired,
X`09put the following in the .vilerc file:
X
X`09`09bind-key whole-lines _
X
XSample .vilerc
X--------\0806
X
X`09Here's a sample .vilerc, to help get you started with the
X`09syntax and style of vile macros:
X
X`09set autoindent
X`09set fillcol 75
X`09set cmode
X`09set c-tabstop 4
X
X`09; sitting on a brace, run the C code block through indent
X`091 store-macro
X`09`09write-file
X`09`09filter-til goto-matching-fence "indent -st"
X`09`7Eendm
X
X
X`09; format the current paragraph
X`092 store-macro
X`09`09previous-paragraph
X`09`09filter-til next-paragraph "/usr/ucb/fmt"
X`09`7Eendm
X
X`09; put 'fprintf(stderr,"`5Cn");" into the file, and
X`09; position the cursor to add to the string
X`093 store-macro
X`09`09`7Eforce next-line
X`09`09beginning-of-line
X`09`09insert-string "fprintf(stderr, `5C"`5C`5Cn`5C");`5Cn"
X`09`09; six back, because it counts the newline
X`09`096 backward-character
X`09`09insert-chars
X`09`7Eendm
X
X`09; insert '> ' in front of every line from here til the end
X`09; (this works because without argument, the default action
X`09; for "goto-line" is to go to the end of file.
X`094 store-macro
X`09`09substitute-til goto-line "`5E" "> "
X`09`7Eendm
X
X`09; spelling keystroke: write the buffer, invoke ispell, and force
X`09; `09it to be read back in.
X`092 store-macro
X`09`09write-file
X`09`09; suppress "\0706return" with "1" argument to shell-command
X`09`091 shell-command `26cat "ispell " $cfilname
X`09`09replace-with-file $cfilname
X`09`7Eendm
X`09bind-key execute-macro-2 =
X
X
X
X`09; the next three give more mnemonic window commands
X`09bind-key next-window `5EN
X`09bind-key previous-window `5EP
X`09bind-key split-current-window `5ET
X
X`09bind-key execute-macro-1 `5EA-C
X`09bind-key execute-macro-2 `5EA-F
X`09bind-key execute-macro-3 `5EA-K
X`09bind-key execute-macro-4 `5EA-M
X
XNotes on TERM types and Scrolling
X--------\0808\1010-
X
X`09vile will determine the window size in one of three ways: first it
X`09will ask the tty driver (using a TIOCGWINSZ ioctl call under UNIX).
X`09Failing that, it will use the LINES and COLUMNS environment
X`09variables.  As a last resort it will use the size specified in the
X`09TERMCAP entry corresponding to the TERM variable.  In addition,
X`09vile will attempt to support the SIGWINCH signal, which allows it
X`09to track changes to the size of the window in which it is running.
X
X`09If scrolling is really slow, or\1008ugly (the status line hops
X`09around a lot), and you're using a vt102 or compatible terminal that
X`09you think should be able to scroll okay, then the problem is almost
X`09certainly your termcap entry, which probably doesn't describe
X`09scrolling regions adequately.  Most standard termcap entries are
X`09insufficient.  The standard "xterm" entry on many systems falls
X`09into this category, and vile contains code that, as a special case,
X`09will augment an "xterm" entry with the codes needed for scrolling
X`09regions.
X
X`09In any case, here's a termcap entry that should work:
X
X        dy`7Cvt102`7Cvt-102`7Cdec vt102:`5C
X            :do=`5EJ:co#80:li#24:cl=50`5CE`5B;H`5CE`5B2J:`5C
X            :le=`5EH:bs:cm=5`5CE`5B%i%d;%dH:nd=2`5CE`5BC:up=2`5CE`5BA:`5C
X            :ce=3`5CE`5BK:cd=50`5CE`5BJ:so=2`5CE`5B7m:se=2`5CE`5Bm:us=2`5CE`5B
V4m:u\1308`5C
X            :md=2`5CE`5B1m:mr=2`5CE`5B7m:mb=2`5CE`5B5m:me=2`5CE`5Bm:is=`5CE`5B
V1;24r`5CE`5B24;1H:`5C
X            :rs=`5CE>`5CE`5B?3l`5CE`5B?4l`5CE`5B?5l`5CE`5B?7h`5CE`5B?8h:ks=`5C
VE`5B?1h`5CE=:ke\0D06l`5CE>:`5C
X            :ku=`5CEOA:kd=`5CEOB:kr=`5CEOC:kl=`5CEOD:kb=`5EH:`5C
X            :ho=`5CE`5BH:k1=`5CEOP:k2=`5CEOQ:k3=`5CEOR:k4=`5CEOS:pt:sr=5`5CEM:
Vvt#3:`5C
X            :sc=`5CE7:rc=`5CE8:cs=`5CE`5B%i%d;%dr:vs=`5CE`5B?7l:ve\0A06h:
X
X`09The crucial entries are cs and sr -- without both of them,
X`09vile will attempt to use dl and al, and will scroll by
X`09deleting and inser\0E06 block of lines, giving the ugly
X`09behavior you're probably seeing.  If you define PRETTIER_SCROLL
X`09when building vile, it will alternately delete and insert lines,
X`09instead of deleting them all and then inser\1C0D.  This
X`09makes it look a _little_ better, but it's slower.
X
X`09( Here is the terminfo entry equivalent to the abov\2706cap\2606:
X
X`09vt102`7Cvt-102`7Cdec vt102,
X`09`09xon,
X`09`09cols#80, lines#24, vt#3,
X`09`09bel=`5EG, blink=`5CE`5B5m$<2>, bold=`5CE`5B1\1006
X`09`09clear=`5CE`5B;H`5CE`5B2J$<50>, cnorm=`5CE`5B?7h, cr=`5Cr,
X`09`09csr=`5CE`5B%i%p1%d;%p2%dr, cub1=`5Cb, cud1=`5Cn,
X`09`09cuf1=`5CE`5BC$<2>, cup=`5CE`5B%i%p1%d;%p2%dH$<5>,
X`09`09cuu1=`5CE`5BA$<2>, cvvis=`5CE`5B?7l, ed=`5CE`5BJ$<50>,
+-+-+-+-+-+-+-+-  END  OF PART 113 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 114 -+-+-+-+-+-+-+-+
X`09`09el=`5CE`5BK$<3>, home=`5CE`5BH, ht=`5Ct, ind=`5Cn,
X`09`09is2=`5CE`5B1;24r`5CE`5B24;1H, kbs=`5Cb, kcub1=`5CEOD, kcud1=`5CEOB,
X`09`09kcuf1=`5CEOC, kcuu1=`5CEOA, k\1606P, kf2=`5CEOQ, kf3=`5CEOR,
X`09`09kf4=`5CEOS, rc=`5CE8, rev=`5CE`5B7m$<2>, ri=`5CEM$<5>,
X`09`09rmkx=`5CE`5B?1l`5CE>, rmso=`5CE`5Bm$<2>, rmul\0F0A
X`09`09rs2=`5CE>`5CE`5B?3l`5CE`5B?4l`5CE`5B?5l`5CE`5B?7h`5CE`5B?8h, sc=`5CE7,
X`09`09sgr0=`5CE`5Bm$<2>, smkx=`5CE`5B?1h`5CE=, smso=`5CE`5B7\2006
X`09`09smul=`5CE`5B4m$<2>,
X`09)
X
XCredits
X-------
X
X`09Since version 6.1, Tom Dickey has been maintaining the "official"
X`09source tree, and release responsibilities.  Paul Fox maintains the
X`09mailing lists.
X
X`09This code has been written by a _lot_ of people, with help from a
X`09lot more sending in bug reports, fixes, and suggestions.  The
X`09authors of vile are Tom Dickey (dickey@clark.net) and Kevin Buettner
X`09(kev@primenet.com), and Paul Fox (pgf@foxharp.boston.ma.us).
X
X`09Names appearing within comments in the micro-Emacs source code are:
X`09Dave Conroy, Daniel Lawrence, John Gamble, Roger Ove, Dana Hoggatt,
X`09Jon Reid, Steve Wilhite, George Jones, Adam Fritz, D.R.Banks, Bob
X`09McNamara, and Brian Straight.
X
X`09Tom Dickey has contributed many code improvements and features, and
X`09has stabilized vile on both VMS and DOS.  Kevin Buettner has
X`09contributed lots of changes for X11 Toolkit support, as well as the
X`09bulk of the selection and video attribute mechanisms, and the \3E07
X`09the :map command.  Rick Sladkey has done great stuff making vile
X`09work correctly in Win32 environments, something I might not have done
X`09for a long time.  Some of the "ex" code is by Steve Kirkendall,
X`09author of the vi work-alike "elvis".  The regular expression code and
X`09documentation is by Henry Spencer.  The sample .vilerc was created by
X`09Dave Lemke; he also contributed code for new features, including the
X`09original native X support.  Eric Krohn has done some excellent testing
X`09and enhancement.  The implementation of rectangles and their operations
X`09was inspired by code from the 'notgnu' editor, by Julie Melbin.
X`09Patches to support OS/2 came from Charles Moschel and for Windows/NT
X`09from Joe Greer and Clark Morgan. \0F0D and Greg McFarlane seem
X`09to run full regression tests on each new release, and always seem to
X`09find something to report.  Sean Ahern is also always dependable for
X`09finding a bug or two per release.  The reference.doc file supplied with
X`09Bram Moolenaar's excellent Vim editor was useful in unraveling some of
X`09the less obvious parts of :map functionality.  In addition, his
X`09implementation of digraph insertion was used directly in the creation
X`09of digraphs.rc.  Thanks to Jukka Keto for contributing the c-filt.c
X`09code.
X
X`09The initial changes to create vile from micro-Emacs were all done
X`09by Paul Fox (pgf@foxharp.boston.ma.us).  (By the way, he is not the
X`09Paul D. Fox that wrote the Crisp editor.)
X
XProblems
X--------
X
X`09Send bug reports to
X`09`09vile-bugs@foxharp.boston.ma.us
X
X`09Requests to be put on the announcement list should go to
X`09`09vile-announce-request@foxharp.boston.ma.us
X
XCopyright 1995,1996,1997 by Paul Fox, Tom Dickey, and Kevin Buettner
X--------\0808\1010\2020----
X $Header: /usr/build/vile/vile-8.0/RCS/vile.hlp,v 1.356 1998/05/30 20:29:32 to
Vm Exp $
$ call unpack [.VILE-8_0]VILE.HLP;1 -
 545193162 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 332 121 152
$!
$ create 'f'
X`0C
XVILE.EXE        \0808\1010\201811-SEP-1998 17:06\4908VAX-11 Linker V05-13\650D
VPage    1
X
X        \0808\1010\200D+--------\0808\1008+
X        \0808\1010\200D! Object Module Synopsis !
X        \0808\1010\200D+--------\0808\1008+
X
XModule Name     Ident              Bytes\1306File \1E0E\0F0F  Creation Dat
V\2D07Creator
X-----------     \0A0A     \130F\1E13\2C0E\4208\540D\1308
XMAIN            V1.0\100C    19832 `5BUDAA055.TEMP.VILE-8_0`5DMAIN.OBJ;1    11
V-SEP-1998 16:56  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module MAIN file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DMAIN.OBJ;1
XVMSVT           V1.0\0F0B\1A064032 `5BUDAA055.TEMP.VILE-8_0`5DVMSVT.OBJ;1   11
V-SEP-1998 16:56  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module VMSVT file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVMSVT.OBJ;1
XBASIC           V1.0\0F0B\1A067749 `5BUDAA055.TEMP.VILE-8_0`5DBASIC.OBJ;1   11
V-SEP-1998 16:57  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module BASIC file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DBASIC.OBJ;1
XBIND            V1.0\100C    13797 `5BUDAA055.TEMP.VILE-8_0`5DBIND.OBJ;1    11
V-SEP-1998 16:57  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module BIND file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DBIND.OBJ;1
XBTREE           V1.0\0F0B\1A062335 `5BUDAA055.TEMP.VILE-8_0`5DBTREE.OBJ;1   11
V-SEP-1998 16:57  DEC C V5.3-006
XBUFFER          V1.0\0E0A\180611593 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11
V-SEP-1998 16:57  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module BUFFER file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3106.OBJ;1
V
XCRYPT           V1.0\0F0B\1A07757 `5BUDAA055.TEMP.VILE-8_0`5DCRYPT.OBJ;1   11-
VSEP-1998 16:57  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module CRYPT file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DCRYPT.OBJ;1
XCSRCH           V1.0\0F0B\1A061075 `5BUDAA055.TEMP.VILE-8_0`5DCSRCH.OBJ;1   11
V-SEP-1998 16:58  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module CSRCH file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DCSRCH.OBJ;1
XDISPLAY         V1.0\0D09\160719699 `5BUDAA055.TEMP.VILE-8_0`5D\4107.OBJ;1 11-
VSEP-1998 16:58  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module DISPLAY fi\0D06K$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3207.OBJ;1
V
XDUMBTERM        V1.0\0C08\1408  559 \2A08.OBJ;1\2412     11-SEP-1998 16:58  DE
VC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module DUMBTERM file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3308.OBJ;
V1
XEVAL            V1.0\100C    16970 `5BUDAA055.TEMP.VILE-8_0`5DEVAL.OBJ;1    11
V-SEP-1998 16:58  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module EVAL file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DEVAL.OBJ;1
XEXEC            V1.0\100C    13098 `5BUDAA055.TEMP.VILE-8_0`5DEXEC.OBJ;1    11
V-SEP-1998 16:58  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module EXEC file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DEXEC.OBJ;1
XEXTERNS         V1.0\0D09\160731846 `5BUDAA055.TEMP.VILE-8_0`5D\4107.OBJ;1 11-
VSEP-1998 16:59  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module EXTERNS file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3207.OBJ;1
V
XFENCES          V1.0\0E0A\18072991 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11-
VSEP-1998 16:59  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module FENCES file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3106.OBJ;1
V
XFILE            V1.0\100C    12039 `5BUDAA055.TEMP.VILE-8_0`5DFILE.OBJ;1    11
V-SEP-1998 16:59  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module FILE file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DFILE.OBJ;1
XFILEC           V1.0\0F0B\1A065550 `5BUDAA055.TEMP.VILE-8_0`5DFILEC.OBJ;1   11
V-SEP-1998 16:59  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module FILEC file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DFILEC.OBJ;1
XFILEIO          V1.0\0E0A\18071966 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11-
VSEP-1998 17:00  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module FILEIO file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3106.OBJ;1
V
X`0C
XVILE.EXE        \0808\1010\201811-SEP-1998 17:06\4908VAX-11 Linker V05-13\650D
VPage    2
X
X
XModule Name     Ident              Bytes\1306File \1E0E\0F0F  Creation Dat
V\2D07Creator
X-----------     \0A0A     \130F\1E13\2C0E\4208\540D\1308
XFINDERR         V1.0\0D09\16083452 `5BUDAA055.TEMP.VILE-8_0`5D\4107.OBJ;1 11-S
VEP-1998 17:00  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module FINDERR file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3207.OBJ;1
V
XGLOB            V1.0\100C     1481 `5BUDAA055.TEMP.VILE-8_0`5DGLOB.OBJ;1    11
V-SEP-1998 17:00  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module GLOB file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DGLOB.OBJ;1
XGLOBALS         V1.0\0D09\1609786 `5BUDAA055.TEMP.VILE-8_0`5D\4107.OBJ;1 11-SE
VP-1998 17:00  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module GLOBALS file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3207.OBJ;1
V
XHISTORY         V1.0\0D09\16083268 `5BUDAA055.TEMP.VILE-8_0`5D\4107.OBJ;1 11-S
VEP-1998 17:00  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module HISTORY file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3207.OBJ;1
V
XINPUT           V1.0\0F0B     11090 `5BUDAA055.TEMP.VILE-8_0`5DINPUT.OBJ;1  `20
V11-SEP-1998 17:01  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module INPUT file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DINPUT.OBJ;1
XINSERT          V1.0\0E0A\18078551 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11-
VSEP-1998 17:01  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module INSERT file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3106.OBJ;1
V
XITBUFF          V1.0\0E0A\18071134 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11-
VSEP-1998 17:01  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module ITBUFF file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3106.OBJ;1
V
XISEARCH         V1.0\0D09\16083240 `5BUDAA055.TEMP.VILE-8_0`5D\4107.OBJ;1 11-S
VEP-1998 17:01  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module ISEARCH file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3207.OBJ;1
V
XLINE            V1.0\100C     8119 `5BUDAA055.TEMP.VILE-8_0`5DLINE.OBJ;1    11
V-SEP-1998 17:01  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module LINE file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DLINE.OBJ;1
XMAP             V1.0\110D    4940 `5BUDAA055.TEMP.VILE-8_0`5DMAP.OBJ;1     11-
VSEP-1998 17:02  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module MAP file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DMAP.OBJ;1
XMENU            V1.0\100C\1C080 `5BUDAA055.TEMP.VILE-8_0`5DMENU.OBJ;1    11-SE
VP-1998 17:02  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module MENU file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DMENU.OBJ;1
XMODES           V1.0\0F0B     17576 `5BUDAA055.TEMP.VILE-8_0`5DMODES.OBJ;1   1
V1-SEP-1998 17:02  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module MODES file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DMODES.OBJ;1
XMSGS            V1.0\100C\1C06796 `5BUDAA055.TEMP.VILE-8_0`5DMSGS.OBJ;1    11-
VSEP-1998 17:02  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module MSGS file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DMSGS.OBJ;1
XNPOPEN          V1.0\0E0A\180A0 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11-SEP
V-1998 17:02  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module NPOPEN file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3106.OBJ;1
V
XONELINER        V1.0\0C08\1408 3870 \2A08.OBJ;1\2411\410611-SEP-1998 17:02  DE
VC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module ONELINER file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3308.OBJ;
V1
XOPERS           V1.0\0F0B\1A062761 `5BUDAA055.TEMP.VILE-8_0`5DOPERS.OBJ;1   11
V-SEP-1998 17:03  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module OPERS file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DOPERS.OBJ;1
XPATH            V1.0\100C     5677 `5BUDAA055.TEMP.VILE-8_0`5DPATH.OBJ;1    11
V-SEP-1998 17:03  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module PATH file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DPATH.OBJ;1
XRANDOM          V1.0\0E0A\18074620 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11-
VSEP-1998 17:03  DEC C V5.3-006
X`0C
XVILE.EXE        \0808\1010\201811-SEP-1998 17:06\4908VAX-11 Linker V05-13\650D
VPage    3
X
X
XModule Name     Ident              Bytes\1306File \1E0E\0F0F  Creation Dat
V\2D07Creator
X-----------     \0A0A     \130F\1E13\2C0E\4208\540D\1308
X%LINK-W-WRNERS, compilation warnings
X`09in module RANDOM file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3106.OBJ;1
V
XREGEXP          V1.0\0E0A\180612672 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11
V-SEP-1998 17:03  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module REGEXP file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3106.OBJ;1
V
XREGION          V1.0\0E0A\18075763 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11-
VSEP-1998 17:04  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module REGION file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3106.OBJ;1
V
XSEARCH          V1.0\0E0A\18076211 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11-
VSEP-1998 17:04  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module SEARCH file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3106.OBJ;1
V
XSELECT          V1.0\0E0A\18076120 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11-
VSEP-1998 17:04  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module SELECT file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3106.OBJ;1
V
XSPAWN           V1.0\0F0B\1A062239 `5BUDAA055.TEMP.VILE-8_0`5DSPAWN.OBJ;1   11
V-SEP-1998 17:04  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module SPAWN file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DSPAWN.OBJ;1
XTAGS            V1.0\100C     5480 `5BUDAA055.TEMP.VILE-8_0`5DTAGS.OBJ;1    11
V-SEP-1998 17:04  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module TAGS file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DTAGS.OBJ;1
XTBUFF           V1.0\0F0B\1A061398 `5BUDAA055.TEMP.VILE-8_0`5DTBUFF.OBJ;1   11
V-SEP-1998 17:05  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module TBUFF file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DTBUFF.OBJ;1
XTERMIO          V1.0\0E0A\18073883 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11-
VSEP-1998 17:05  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module TERMIO file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3106.OBJ;1
V
XUNDO            V1.0\100C     5017 `5BUDAA055.TEMP.VILE-8_0`5DUNDO.OBJ;1    11
V-SEP-1998 17:05  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module UNDO file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DUNDO.OBJ;1
XVERSION         V1.0\0D09\16081124 `5BUDAA055.TEMP.VILE-8_0`5D\4107.OBJ;1 11-S
VEP-1998 17:05  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module VERSION file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3207.OBJ;1
V
XVMS2UNIX        V1.0\0C08\1408 3989 V\2A07.OBJ;1\2411\410611-SEP-1998 17:05  D
VEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module VMS2UNIX file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3308.OBJ;
V1
XVMSPIPE         V1.0\0D09\16081567 `5BUDAA055.TEMP.VILE-8_0`5D\4107.OBJ;1 11-S
VEP-1998 17:06  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module VMSPIPE file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3207.OBJ;1
V
XWINDOW          V1.0\0E0A\18075892 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11-
VSEP-1998 17:06  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module WINDOW file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3106.OBJ;1
V
XWORD            V1.0\100C     4292 `5BUDAA055.TEMP.VILE-8_0`5DWORD.OBJ;1    11
V-SEP-1998 17:06  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module WORD file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DWORD.OBJ;1
XWORDMOV         V1.0\0D09\16081305 `5BUDAA055.TEMP.VILE-8_0`5D\4107.OBJ;1 11-S
VEP-1998 17:06  DEC C V5.3-006
X%LINK-W-WRNERS, compilation warnings
X`09in module WORDMOV file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5D\3207.OBJ;1
V
XSYS$P1_VECTOR   X-4      \0606\0C090 SYS$COMMON:`5BSYSLIB`5DSTARLET.OLB;5  `20
V  21-APR-1995 22:22  VAX MACRO V5.4-3
XCMA$TIS_SHR     CMA V1.12-169           0 SYS$COMMON:`5BSYSLIB`5D\3D0B.EXE;1 2
V2-APR-1995 00:10  VAX-11 Linker V05-13
XDECC$SHR        V6.1-15\0F08\1708 0 SYS$COMMON:`5BSYSLIB`5D\3D08.EXE;2    21-J
VAN-1997 13:43  VAX-11 Linker V05-13
XLIBRTL          V06-001\110A\1B070 SYS$COMMON:`5BSYSLIB`5D\3D06.EXE;6\430621-A
VUG-1996 02:34  VAX-11 Linker V05-13
XSMGSHR          V06-001\110A\1B070 SYS$COMMON:`5BSYSLIB`5D\3D06.EXE;\320722-AP
VR-1995 00:12  VAX-11 Linker V05-13
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage    4
X
X
X        \0808\1010\200C+--------\0808\100A+
X        \0808\1010\200C! Program Section Synopsis !
X        \0808\1010\200C+--------\0808\100A+
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
X$ADDRESS_DATA        \0808   00000200\090649B\12079C (\2F08668.) QUAD 3   PIC,
VUSR,CON,REL,LCL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00000200\09078F\1206090 (\3C08144.) QUAD 3
X        \0808VMSVT\150B00000290\090630F\1206080 (\3C08128.) QUAD 3
X        \0808BIND\140C00000310\090787\1206078 (\3C08120.) LONG 2
X        \0808EXEC\140C00000388\0907DF\1206058 (\3C0988.) QUAD 3
X        \0808FINDERR\1709000003E0\0906407\1206028 (\3C0940.) QUAD 3
X        \0808MODES\150B00000408\090777\1206070 (\3C08112.) QUAD 3
X        \0808VERSION\170900000478\09079B\1206024 (\3C0936.) LONG 2
XABBR_BUFNAME        \0808    000004A0\0908F\1206010 (\300916.) QUAD 3   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C000004A0\0908F\1206010 (\3C0916.) QUAD 3
XALL_MODES        \0808\1007000004B0\0906927\120778 (\33071144.) QUAD 3   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C000004B0\0906927\120778 (\3C071144.) QUAD 3
XALL_SUBMODES        \0808    00000928\0906AE3\12061BC (\3008444.) LONG 2   PIC
V,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00000928\0906AE3\12061BC (\3C08444.) LONG 2
XBINDINGLIST_BUFNAME             00000AE4\0907F2\120600F (\290915.) LONG 2   PI
VC,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00000AE4\0907F2\120600F (\3C0915.) LONG 2
XBUFFERLIST_BUFNAME        \080600000AF4\0906B01\120600E (\2A0914.) LONG 2   PI
VC,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00000AF4\0906B01\120600E (\3C0914.) LONG 2
XB_VALNAMES        \0808\100600000B04\0906D4C\1206249 (\3208585.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00000B04\0906D4C\1206249 (\3C08585.) LONG 2
XCOMPLETIONS_BUFNAME             00000D50\0908D\120600E (\290914.) LONG 2   PIC
V,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00000D50\0908D\120600E (\3C0914.) LONG 2
XDIRCOMPLETION_BUFNAME           00000D60\0908F\1206010 (\270916.) QUAD 3   PIC
V,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00000D60\0908F\1206010 (\3C0916.) QUAD 3
XENVARS        \0808\100A00000D70\0906E57\12060E8 (\3608232.) QUAD 3   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00000D70\0906E57\12060E8 (\3C08232.) QUAD 3
XERRORS_BUFNAME        \0808  00000E58\09076B\1206014 (\2E0920.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00000E58\09076B\1206014 (\3C0920.) LONG 2
XFILECOMPLETION_BUFNAME          00000E6C\09077\0907011 (\260917.) LONG 2   PIC
V,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00000E6C\09077\0907011 (\3C0917.) LONG 2
XFUNCS        \0808\100B00000E80\0906FAF\1206130 (\3708304.) QUAD 3   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00000E80\0906FAF\1206130 (\3C08304.) QUAD 3
XF_ABBREV        \0808\100800000FB0\0908B\120600C (\340912.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900000FB0\0908B\120600C (\3C0912.) LONG 2
XF_ALTBUFF        \0808\100700000FBC\0907C7\120600C (\330912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900000FBC\0907C7\120600C (\3C0912.) LONG 2
XF_APPEND        \0808\100800000FC8\0907D3\120600C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900000FC8\0907D3\120600C (\3C0912.) LONG 2
XF_APPENDEOL        \0808     00000FD4\0908F\120600C (\310912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900000FD4\0908F\120600C (\3C0912.) LONG 2
XF_APPSTRING        \0808     00000FE0\0908B\120600C (\310912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900000FE0\0908B\120600C (\3C0912.) LONG 2
XF_BACKBLINE        \0808     00000FEC\0907F7\120600C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900000FEC\0907F7\120600C (\3C0912.) LONG 2
XF_BACKCHAR        \0808\100600000FF8 00001003\120600C (\320912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900000FF8 00001003\120600C (\3C0912.) LONG 2
XF_BACKCHAR_TO_BOL        \080700001004\0908F 0000000C (\2B0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001004\0908F 0000000C (\3C0912.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage    5
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_BACKDELCHAR        \0808   00001010\0908B 0000000C (\2F0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001010\0908B 0000000C (\3C0912.) LONG 2
XF_BACKHPAGE        \0808     0000101C\090727 0000000C (\310912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000101C\090727 0000000C (\3C0912.) LONG 2
XF_BACKHUNT        \0808\100600001028\090733 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001028\090733 0000000C (\3C0912.) LONG 2
XF_BACKLINE        \0808\100600001034\0908F 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001034\0908F 0000000C (\3C0912.) LONG 2
XF_BACKPAGE        \0808\100600001040\0908B 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001040\0908B 0000000C (\3C0912.) LONG 2
XF_BACKSEARCH        \0808    0000104C\090757 0000000C (\300912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000104C\090757 0000000C (\3C0912.) LONG 2
XF_BACKUNDO        \0808\100600001058\090763 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001058\090763 0000000C (\3C0912.) LONG 2
XF_BACKVIWORD        \0808    00001064\0908F 0000000C (\300912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001064\0908F 0000000C (\3C0912.) LONG 2
XF_BACKWORD        \0808\100600001070\0908B 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001070\0908B 0000000C (\3C0912.) LONG 2
XF_BCSRCH        \0808\10080000107C\090787 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000107C\090787 0000000C (\3C0912.) LONG 2
XF_BCSRCH_TO        \0808     00001088\090793 0000000C (\310912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001088\090793 0000000C (\3C0912.) LONG 2
XF_BINDKEY        \0808\100700001094\0908F 0000000C (\330912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001094\0908F 0000000C (\3C0912.) LONG 2
XF_BKTOSHELL        \0808     000010A0\0908B 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000010A0\0908B 0000000C (\3C0912.) LONG 2
XF_CBUF1        \0808\1009000010AC\0907B7 0000000C (\350912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000010AC\0907B7 0000000C (\3C0912.) LONG 2
XF_CBUF10        \0808\1008000010B8\0907C3 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000010B8\0907C3 0000000C (\3C0912.) LONG 2
XF_CBUF11        \0808\1008000010C4\0908F 0000000C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000010C4\0908F 0000000C (\3C0912.) LONG 2
XF_CBUF12        \0808\1008000010D0\0908B 0000000C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000010D0\0908B 0000000C (\3C0912.) LONG 2
XF_CBUF13        \0808\1008000010DC\0907E7 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000010DC\0907E7 0000000C (\3C0912.) LONG 2
XF_CBUF14        \0808\1008000010E8\0907F3 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000010E8\0907F3 0000000C (\3C0912.) LONG 2
XF_CBUF15        \0808\1008000010F4\0908F 0000000C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000010F4\0908F 0000000C (\3C0912.) LONG 2
XF_CBUF16        \0808\100800001100\0908B 0000000C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001100\0908B 0000000C (\3C0912.) LONG 2
XF_CBUF17        \0808\10080000110C\090717 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000110C\090717 0000000C (\3C0912.) LONG 2
XF_CBUF18        \0808\100800001118 \090623 0000000C (\340912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001118\090723 0000000C (\3C0912.) LONG 2
XF_CBUF19        \0808\100800001124\0908F 0000000C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001124\0908F 0000000C (\3C0912.) LONG 2
XF_CBUF2        \0808\100900001130\0908B 0000000C (\350912.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001130\0908B 0000000C (\3C0912.) LONG 2
XF_CBUF20        \0808\10080000113C\090747 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000113C\090747 0000000C (\3C0912.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage    6
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_CBUF21        \0808\100800001148\090753 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001148\090753 0000000C (\3C0912.) LONG 2
XF_CBUF22        \0808\100800001154\0908F 0000000C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001154\0908F 0000000C (\3C0912.) LONG 2
XF_CBUF23        \0808\100800001160\0908B 0000000C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001160\0908B 0000000C (\3C0912.) LONG 2
XF_CBUF24        \0808\10080000116C\090777 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000116C\090777 0000000C (\3C0912.) LONG 2
XF_CBUF25        \0808\100800001178\090783 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001178\090783 0000000C (\3C0912.) LONG 2
XF_CBUF26        \0808\100800001184\0908F 0000000C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001184\0908F 0000000C (\3C0912.) LONG 2
XF_CBUF27        \0808\100800001190\0908B 0000000C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001190\0908B 0000000C (\3C0912.) LONG 2
XF_CBUF28        \0808\10080000119C\0907A7 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000119C\0907A7 0000000C (\3C0912.) LONG 2
XF_CBUF29        \0808\1008000011A8\0907B3 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000011A8\0907B3 0000000C (\3C0912.) LONG 2
XF_CBUF3        \0808\1009000011B4\0908F 0000000C (\350912.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000011B4\0908F 0000000C (\3C0912.) LONG 2
XF_CBUF30        \0808\1008000011C0 \0907B 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000011C0\0908B 0000000C (\3C0912.) LONG 2
XF_CBUF31        \0808\1008000011CC\0907D7 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000011CC\0907D7 0000000C (\3C0912.) LONG 2
XF_CBUF32        \0808\1008000011D8\0907E3 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000011D8\0907E3 0000000C (\3C0912.) LONG 2
XF_CBUF33        \0808\1008000011E4\0908F 0000000C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000011E4\0908F 0000000C (\3C0912.) LONG 2
XF_CBUF34        \0808\1008000011F0\0908B 0000000C (\340912.) LONG 2   PIC,USR,
+-+-+-+-+-+-+-+-  END  OF PART 114 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 115 -+-+-+-+-+-+-+-+
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000011F0\0908B 0000000C (\3C0912.) LONG 2
XF_CBUF35        \0808\1008000011FC\0906207 0000000C (\340912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000011FC\0906207 0000000C (\3C0912.) LONG 2
XF_CBUF36        \0808\100800001208\090713 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001208\090713 0000000C (\3C0912.) LONG 2
XF_CBUF37        \0808\100800001214\0908F 0000000C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001214\0908F 0000000C (\3C0912.) LONG 2
XF_CBUF38        \0808\100800001220\0908B 0000000C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001220\0908B 0000000C (\3C0912.) LONG 2
XF_CBUF39        \0808\10080000122C\090737 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000122C\090737 0000000C (\3C0912.) LONG 2
XF_CBUF4        \0808\100900001238\090743 0000000C (\350912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001238\090743 0000000C (\3C0912.) LONG 2
XF_CBUF40        \0808\100800001244\0908F 0000000C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001244\0908F 0000000C (\3C0912.) LONG 2
XF_CBUF5        \0808\100900001250\0908B 0000000C (\350912.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001250\0908B 0000000C (\3C0912.) LONG 2
XF_CBUF6        \0808\10090000125C\090767 0000000C (\350912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000125C\090767 0000000C (\3C0912.) LONG 2
XF_CBUF7        \0808\100900001268\090773 0000000C (\350912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001268\090773 0000000C (\3C0912.) LONG 2
XF_CBUF8        \0808\100900001274\0908F 0000000C (\350912.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001274\0908F 0000000C (\3C0912.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage    7
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_CBUF9        \0808\100900001280\0908B 0000000C (\350912.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001280\0908B 0000000C (\3C0912.) LONG 2
XF_CD        \0808\100C0000128C\090797 0000000C (\380912.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000128C\090797 0000000C (\3C0912.) LONG 2
XF_CHGCHAR        \0808\100700001298\0907A3 0000000C (\330912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001298\0907A3 0000000C (\3C0912.) LONG 2
XF_CHGLINE        \0808\1007000012A4\0908F 0000000C (\330912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000012A4\0908F 0000000C (\3C0912.) LONG 2
XF_CHGTOEOL        \0808\1006000012B0\0908B 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000012B0\0908B 0000000C (\3C0912.) LONG 2
XF_CLEAR_MATCH_ATTRS             000012BC\0907C7 0000000C (\290912.) LONG 2   P
VIC,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000012BC\0907C7 0000000C (\3C0912.) LONG 2
XF_CLRMES        \0808\1008000012C8\0907D3 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000012C8\0907D3 0000000C (\3C0912.) LONG 2
XF_CNTL_A_FUNC        \0808   000012D4\0908F 0000000C (\2F0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000012D4\0908F 0000000C (\3C0912.) LONG 2
XF_CNTL_X_FUNC        \0808   000012E0\0908B 0000000C (\2F0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000012E0\0908B 0000000C (\3C0912.) LONG 2
XF_COMP_ERR_EXPS        \0808 000012EC\0907F7 0000000C (\2D0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000012EC\0907F7 0000000C (\3C0912.) LONG 2
XF_CONSEARCH        \0808     000012F8\0906303 0000000C (\310912.) LONG 2   PIC
V,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000012F8\0906303 0000000C (\3C0912.) LONG 2
XF_DEFINE_MODE        \0808   00001304\0908F 0000000C (\2F0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001304\0908F 0000000C (\3C0912.) LONG 2
XF_DEFINE_SUBMODE        \080800001310\0908B 0000000C (\2C0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001310\0908B 0000000C (\3C0912.) LONG 2
XF_DELGLOBMODE        \0808   0000131C\090727 0000000C (\2F0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000131C\090727 0000000C (\3C0912.) LONG 2
XF_DELLOCMODE        \0808    00001328\090733 0000000C (\300912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001328\090733 0000000C (\3C0912.) LONG 2
XF_DELTOEOL        \0808\100600001334\0908F 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001334\0908F 0000000C (\3C0912.) LONG 2
XF_DELWIND        \0808\100700001340\0908B 0000000C (\330912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001340\0908B 0000000C (\3C0912.) LONG 2
XF_DESAPRO        \0808\10070000134C\090757 0000000C (\330912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000134C\090757 0000000C (\3C0912.) LONG 2
XF_DESBIND        \0808\100700001358\090763 0000000C (\330912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001358\090763 0000000C (\3C0912.) LONG 2
XF_DESFUNC        \0808\100700001364\0908F 0000000C (\330912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001364\0908F 0000000C (\3C0912.) LONG 2
XF_DESKEY        \0808\100800001370\0908B 0000000C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001370\0908B 0000000C (\3C0912.) LONG 2
XF_DESMOTIONS        \0808    0000137C\090787 0000000C (\300912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000137C\090787 0000000C (\3C0912.) LONG 2
XF_DESOPERS        \0808\100600001388\090793 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001388\090793 0000000C (\3C0912.) LONG 2
XF_DESPRINT        \0808\100600001394\0908F 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001394\0908F 0000000C (\3C0912.) LONG 2
XF_DOTCMDPLAY        \0808    000013A0\0908B 0000000C (\300912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000013A0\0908B 0000000C (\3C0912.) LONG 2
XF_ENLARGEWIND        \0808   000013AC\0907B7 0000000C (\2F0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000013AC\0907B7 0000000C (\3C0912.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage    8
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_ESC_FUNC        \0808\1006000013B8\0907C3 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000013B8\0907C3 0000000C (\3C0912.) LONG 2
XF_EX        \0808\100C000013C4\0908F 0000000C (\380912.) LONG 2   PIC,USR,OVR,
VREL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000013C4\0908F 0000000C (\3C0912.) LONG 2
XF_EXECBUF        \0808\1007000013D0\0908B 0000000C (\330912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000013D0\0908B 0000000C (\3C0912.) LONG 2
XF_EXECFILE        \0808\1006000013DC\0907E7 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000013DC\0907E7 0000000C (\3C0912.) LONG 2
XF_EXECHYPERCMD        \0808  000013E8\0907F3 0000000C (\2E0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000013E8\0907F3 0000000C (\3C0912.) LONG 2
XF_EXECKREG        \0808\1006000013F4\0908F 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000013F4\0908F 0000000C (\3C0912.) LONG 2
XF_EXECPROC        \0808\100600001400\0908B 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001400\0908B 0000000C (\3C0912.) LONG 2
XF_FCSRCH        \0808\10080000140C\090717 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000140C\090717 0000000C (\3C0912.) LONG 2
XF_FCSRCH_TO        \0808     00001418\090723 0000000C (\310912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001418\090723 0000000C (\3C0912.) LONG 2
XF_FILEFIND        \0808\100600001424\0908F 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001424\0908F 0000000C (\3C0912.) LONG 2
XF_FILENAME        \0808\100600001430\0908B 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001430\0908B 0000000C (\3C0912.) LONG 2
XF_FILEREAD        \0808\10060000143C\090747 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000143C\090747 0000000C (\3C0912.) LONG 2
XF_FILESAVE        \0808\100600001448\090753 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001448\090753 0000000C (\3C0912.) LONG 2
XF_FILEWRITE        \0808     00001454\0908F 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001454\0908F 0000000C (\3C0912.) LONG 2
XF_FINDERR        \0808\100700001460\0908B 0000000C (\330912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001460\0908B 0000000C (\3C0912.) LONG 2
XF_FINDERRBUF        \0808    0000146C\090777 0000000C (\300912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000146C\090777 0000000C (\3C0912.) LONG 2
XF_FIRSTBUFFER        \0808   00001478\090783 0000000C (\2F0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001478\090783 0000000C (\3C0912.) LONG 2
XF_FIRSTNONWHITE        \0808 00001484\0908F 0000000C (\2D0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001484\0908F 0000000C (\3C0912.) LONG 2
XF_FISEARCH        \0808\100600001490\0908B 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001490\0908B 0000000C (\3C0912.) LONG 2
XF_FLIPCHAR        \0808\10060000149C\0907A7 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000149C\0907A7 0000000C (\3C0912.) LONG 2
XF_FORCEBLANK        \0808    000014A8\0907B3 0000000C (\300912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000014A8\0907B3 0000000C (\3C0912.) LONG 2
XF_FORWBLINE        \0808     000014B4\0908F 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000014B4\0908F 0000000C (\3C0912.) LONG 2
XF_FORWCHAR        \0808\1006000014C0\0908B 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000014C0\0908B 0000000C (\3C0912.) LONG 2
XF_FORWCHAR_TO_EOL        \0807000014CC\0907D7 0000000C (\2B0912.) LONG 2   PIC
V,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000014CC\0907D7 0000000C (\3C0912.) LONG 2
XF_FORWDELCHAR        \0808   000014D8\0907E3 0000000C (\2F0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000014D8\0907E3 0000000C (\3C0912.) LONG 2
XF_FORWENDW        \0808\1006000014E4\0908F 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000014E4\0908F 0000000C (\3C0912.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage    9
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_FORWHPAGE        \0808     000014F0\0908B 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000014F0\0908B 0000000C (\3C0912.) LONG 2
XF_FORWHUNT        \0808\1006000014FC\0906507 0000000C (\320912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000014FC\0906507 0000000C (\3C0912.) LONG 2
XF_FORWLINE        \0808\100600001508\090713 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001508\090713 0000000C (\3C0912.) LONG 2
XF_FORWPAGE        \0808\100600001514\0908F 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001514\0908F 0000000C (\3C0912.) LONG 2
XF_FORWREDO        \0808\100600001520\0908B 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001520\0908B 0000000C (\3C0912.) LONG 2
XF_FORWSEARCH        \0808    0000152C\090737 0000000C (\300912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000152C\090737 0000000C (\3C0912.) LONG 2
XF_FORWVIENDW        \0808    00001538\090743 0000000C (\300912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001538\090743 0000000C (\3C0912.) LONG 2
XF_FORWVIWORD        \0808    00001544\0908F 0000000C (\300912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001544\0908F 0000000C (\3C0912.) LONG 2
XF_FORWWORD        \0808\100600001550\0908B 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001550\0908B 0000000C (\3C0912.) LONG 2
XF_GLOBALS        \0808\10070000155C\090767 0000000C (\330912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000155C\090767 0000000C (\3C0912.) LONG 2
XF_GODOTPLUS        \0808     00001568\090773 0000000C (\310912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001568\090773 0000000C (\3C0912.) LONG 2
XF_GOEXACTNMMARK        \0808 00001574\0908F 0000000C (\2D0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001574\0908F 0000000C (\3C0912.) LONG 2
XF_GOLINENMMARK        \0808  00001580\0908B 0000000C (\2E0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001580\0908B 0000000C (\3C0912.) LONG 2
XF_GOMARK        \0808\10080000158C\090797 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000158C\090797 0000000C (\3C0912.) LONG 2
XF_GORECTNMMARK        \0808  00001598\0907A3 0000000C (\2E0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001598\0907A3 0000000C (\3C0912.) LONG 2
XF_GOTOBOB        \0808\1007000015A4\0908F 0000000C (\330912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000015A4\0908F 0000000C (\3C0912.) LONG 2
XF_GOTOBOL        \0808\1007000015B0\0908B 0000000C (\330912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000015B0\0908B 0000000C (\3C0912.) LONG 2
XF_GOTOBOP        \0808\1007000015BC\0907C7 0000000C (\330912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000015BC\0907C7 0000000C (\3C0912.) LONG 2
XF_GOTOBOS        \0808\1007000015C8\0907D3 0000000C (\330912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000015C8\0907D3 0000000C (\3C0912.) LONG 2
XF_GOTOBOSEC        \0808     000015D4\0908F 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000015D4\0908F 0000000C (\3C0912.) LONG 2
XF_GOTOBOSENT        \0808    000015E0\0908B 0000000C (\300912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000015E0\0908B 0000000C (\3C0912.) LONG 2
XF_GOTOCOL        \0808\1007000015EC\0907F7 0000000C (\330912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000015EC\0907F7 0000000C (\3C0912.) LONG 2
XF_GOTOEOB        \0808\1007000015F8\0906603 0000000C (\330912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000015F8\0906603 0000000C (\3C0912.) LONG 2
XF_GOTOEOL        \0808\100700001604\0908F 0000000C (\330912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001604\0908F 0000000C (\3C0912.) LONG 2
XF_GOTOEOP        \0808\100700001610\0908B 0000000C (\330912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001610\0908B 0000000C (\3C0912.) LONG 2
XF_GOTOEOS        \0808\10070000161C\090727 0000000C (\330912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000161C\090727 0000000C (\3C0912.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   10
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_GOTOEOSEC        \0808     00001628\090733 0000000C (\310912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001628\090733 0000000C (\3C0912.) LONG 2
XF_GOTOEOSENT        \0808    00001634\0908F 0000000C (\300912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001634\0908F 0000000C (\3C0912.) LONG 2
XF_GOTOLINE        \0808\100600001640\0908B 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001640\0908B 0000000C (\3C0912.) LONG 2
XF_GOTOMOS        \0808\10070000164C\090757 0000000C (\330912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000164C\090757 0000000C (\3C0912.) LONG 2
XF_GOTOTAG        \0808\100700001658\090763 0000000C (\330912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001658\090763 0000000C (\3C0912.) LONG 2
XF_HELP        \0808\100A00001664\0908F 0000000C (\360912.) LONG 2   PIC,USR,OV
VR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001664\0908F 0000000C (\3C0912.) LONG 2
XF_HISTBUFF        \0808\100600001670\0908B 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001670\0908B 0000000C (\3C0912.) LONG 2
XF_INF_UNDO        \0808\10060000167C\090787 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000167C\090787 0000000C (\3C0912.) LONG 2
XF_INSERT        \0808\100800001688\090793 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001688\090793 0000000C (\3C0912.) LONG 2
XF_INSERTBOL        \0808     00001694\0908F 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001694\0908F 0000000C (\3C0912.) LONG 2
XF_INSERT_NO_AINDENT             000016A0\0908B 0000000C (\290912.) LONG 2   PI
VC,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000016A0\0908B 0000000C (\3C0912.) LONG 2
XF_INSFILE        \0808\1007000016AC\0907B7 0000000C (\330912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000016AC\0907B7 0000000C (\3C0912.) LONG 2
XF_INSSPACE        \0808\1006000016B8\0907C3 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000016B8\0907C3 0000000C (\3C0912.) LONG 2
XF_INSSTRING        \0808     000016C4\0908F 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000016C4\0908F 0000000C (\3C0912.) LONG 2
XF_JOINLINES        \0808     000016D0\0908B 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000016D0\0908B 0000000C (\3C0912.) LONG 2
XF_KBD_MAC_BEGIN        \0808 000016DC\0907E7 0000000C (\2D0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000016DC\0907E7 0000000C (\3C0912.) LONG 2
XF_KBD_MAC_END        \0808   000016E8\0907F3 0000000C (\2F0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000016E8\0907F3 0000000C (\3C0912.) LONG 2
XF_KBD_MAC_EXEC        \0808  000016F4\0908F 0000000C (\2E0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000016F4\0908F 0000000C (\3C0912.) LONG 2
XF_KBD_MAC_SAVE        \0808  00001700\0908B 0000000C (\2E0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001700\0908B 0000000C (\3C0912.) LONG 2
XF_KILLBUFFER        \0808    0000170C\090717 0000000C (\300912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000170C\090717 0000000C (\3C0912.) LONG 2
XF_LASTNONWHITE        \0808  00001718\090723 0000000C (\2E0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001718\090723 0000000C (\3C0912.) LONG 2
XF_LINEPUTAFTER        \0808  00001724\0908F 0000000C (\2E0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001724\0908F 0000000C (\3C0912.) LONG 2
XF_LINEPUTBEFORE        \0808 00001730\0908B 0000000C (\2D0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001730\0908B 0000000C (\3C0912.) LONG 2
XF_LINEUNDO        \0808\10060000173C\090747 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000173C\090747 0000000C (\3C0912.) LONG 2
XF_LISTBUFFERS        \0808   00001748\090753 0000000C (\2F0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001748\090753 0000000C (\3C0912.) LONG 2
XF_LISTMODES        \0808     00001754\0908F 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001754\0908F 0000000C (\3C0912.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   11
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_LISTVARS        \0808\100600001760\0908B 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001760\0908B 0000000C (\3C0912.) LONG 2
XF_LIST_MAJORMODES        \08070000176C\090777 0000000C (\2B0912.) LONG 2   PIC
V,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000176C\090777 0000000C (\3C0912.) LONG 2
XF_LOADKREG        \0808\100600001778\090783 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001778\090783 0000000C (\3C0912.) LONG 2
XF_MAP        \0808\100B00001784\0908F 0000000C (\370912.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001784\0908F 0000000C (\3C0912.) LONG 2
XF_MAP_BANG        \0808\100600001790\0908B 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001790\0908B 0000000C (\3C0912.) LONG 2
XF_MATCHFENCE        \0808    0000179C\0907A7 0000000C (\300912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000179C\0907A7 0000000C (\3C0912.) LONG 2
XF_MATCHFENCEBACK        \0808000017A8\0907B3 0000000C (\2C0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000017A8\0907B3 0000000C (\3C0912.) LONG 2
XF_MULTIMOTION        \0808   000017B4\0908F 0000000C (\2F0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000017B4\0908F 0000000C (\3C0912.) LONG 2
XF_MULTIMOTIONFULLLINE           000017C0\0908B 0000000C (\270912.) LONG 2   PI
VC,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000017C0\0908B 0000000C (\3C0912.) LONG 2
XF_MULTIMOTIONRECTANGLE          000017CC\0907D7 0000000C (\260912.) LONG 2   P
VIC,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000017CC\0907D7 0000000C (\3C0912.) LONG 2
XF_MVDNNXTWIND        \0808   000017D8\0907E3 0000000C (\2F0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000017D8\0907E3 0000000C (\3C0912.) LONG 2
XF_MVDNWIND        \0808\1006000017E4\0908F 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000017E4\0908F 0000000C (\3C0912.) LONG 2
XF_MVLEFTWIND        \0808    000017F0\0908B 0000000C (\300912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000017F0\0908B 0000000C (\3C0912.) LONG 2
XF_MVRIGHTWIND        \0808   000017FC\0906807 0000000C (\2F0912.) LONG 2   PIC
V,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000017FC\0906807 0000000C (\3C0912.) LONG 2
XF_MVUPNXTWIND        \0808   00001808\090713 0000000C (\2F0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001808\090713 0000000C (\3C0912.) LONG 2
XF_MVUPWIND        \0808\100600001814\0908F 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001814\0908F 0000000C (\3C0912.) LONG 2
XF_NAMEBUFFER        \0808    00001820\0908B 0000000C (\300912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001820\0908B 0000000C (\3C0912.) LONG 2
XF_NAMEDCMD        \0808\10060000182C\090737 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000182C\090737 0000000C (\3C0912.) LONG 2
XF_NEWLENGTH        \0808     00001838\090743 0000000C (\310912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001838\090743 0000000C (\3C0912.) LONG 2
XF_NEWLINE        \0808\100700001844\0908F 0000000C (\330912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001844\0908F 0000000C (\3C0912.) LONG 2
XF_NEWPROCESSGROUP        \080700001850\0908B 0000000C (\2B0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001850\0908B 0000000C (\3C0912.) LONG 2
XF_NEWWIDTH        \0808\10060000185C\090767 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000185C\090767 0000000C (\3C0912.) LONG 2
XF_NEXTBUFFER        \0808    00001868\090773 0000000C (\300912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001868\090773 0000000C (\3C0912.) LONG 2
XF_NEXTTAG        \0808\100700001874\0908F 0000000C (\330912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001874\0908F 0000000C (\3C0912.) LONG 2
XF_NEXTWIND        \0808\100600001880\0908B 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001880\0908B 0000000C (\3C0912.) LONG 2
XF_NOREMAP        \0808\10070000188C\090797 0000000C (\330912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000188C\090797 0000000C (\3C0912.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   12
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_NOREMAP_BANG        \0808  00001898\0907A3 0000000C (\2E0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001898\0907A3 0000000C (\3C0912.) LONG 2
XF_NULLPROC        \0808\1006000018A4\0908F 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000018A4\0908F 0000000C (\3C0912.) LONG 2
XF_ONLYWIND        \0808\1006000018B0\0908B 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
+-+-+-+-+-+-+-+-  END  OF PART 115 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 116 -+-+-+-+-+-+-+-+
X        \0808EXTERNS\1709000018B0\0908B 0000000C (\3C0912.) LONG 2
XF_OPENDOWN        \0808\1006000018BC\0907C7 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000018BC\0907C7 0000000C (\3C0912.) LONG 2
XF_OPENDOWN_NO_AINDENT           000018C8\0907D3 0000000C (\270912.) LONG 2   P
VIC,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000018C8\0907D3 0000000C (\3C0912.) LONG 2
XF_OPENUP        \0808\1008000018D4\0908F 0000000C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000018D4\0908F 0000000C (\3C0912.) LONG 2
XF_OPENUP_NO_AINDENT             000018E0\0908B 0000000C (\290912.) LONG 2   PI
VC,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000018E0\0908B 0000000C (\3C0912.) LONG 2
XF_OPERATTRBOLD        \0808  000018EC\0907F7 0000000C (\2E0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000018EC\0907F7 0000000C (\3C0912.) LONG 2
XF_OPERATTRCASEQ        \0808 000018F8\0906903 0000000C (\2D0912.) LONG 2   PIC
V,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000018F8\0906903 0000000C (\3C0912.) LONG 2
XF_OPERATTRHC        \0808    00001904\0908F 0000000C (\300912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001904\0908F 0000000C (\3C0912.) LONG 2
XF_OPERATTRITAL        \0808  00001910\0908B 0000000C (\2E0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001910\0908B 0000000C (\3C0912.) LONG 2
XF_OPERATTRNO        \0808    0000191C\090727 0000000C (\300912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000191C\090727 0000000C (\3C0912.) LONG 2
XF_OPERATTRREV        \0808   00001928\090733 0000000C (\2F0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001928\090733 0000000C (\3C0912.) LONG 2
XF_OPERATTRUL        \0808    00001934\0908F 0000000C (\300912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001934\0908F 0000000C (\3C0912.) LONG 2
XF_OPERBLANK        \0808     00001940\0908B 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001940\0908B 0000000C (\3C0912.) LONG 2
XF_OPERCHG        \0808\10070000194C\090757 0000000C (\330912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000194C\090757 0000000C (\3C0912.) LONG 2
XF_OPERCOPY        \0808\100600001958\090763 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001958\090763 0000000C (\3C0912.) LONG 2
XF_OPERCRYPT        \0808     00001964\0908F 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001964\0908F 0000000C (\3C0912.) LONG 2
XF_OPERDEL        \0808\100700001970\0908B 0000000C (\330912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001970\0908B 0000000C (\3C0912.) LONG 2
XF_OPERDETAB        \0808     0000197C\090787 0000000C (\310912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\17090000197C\090787 0000000C (\3C0912.) LONG 2
XF_OPERENTAB        \0808     00001988\090793 0000000C (\310912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001988\090793 0000000C (\3C0912.) LONG 2
XF_OPERFILTER        \0808    00001994\0908F 0000000C (\300912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001994\0908F 0000000C (\3C0912.) LONG 2
XF_OPERFLIP        \0808\1006000019A0\0908B 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000019A0\0908B 0000000C (\3C0912.) LONG 2
XF_OPERFORMAT        \0808    000019AC\0907B7 0000000C (\300912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000019AC\0907B7 0000000C (\3C0912.) LONG 2
XF_OPERGLOBALS        \0808   000019B8\0907C3 0000000C (\2F0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000019B8\0907C3 0000000C (\3C0912.) LONG 2
XF_OPERJOIN        \0808\1006000019C4\0908F 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000019C4\0908F 0000000C (\3C0912.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   13
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_OPERLINECHG        \0808   000019D0\0908B 0000000C (\2F0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000019D0\0908B 0000000C (\3C0912.) LONG 2
XF_OPERLINEDEL        \0808   000019DC\0907E7 0000000C (\2F0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000019DC\0907E7 0000000C (\3C0912.) LONG 2
XF_OPERLINEYANK        \0808  000019E8\0907F3 0000000C (\2E0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000019E8\0907F3 0000000C (\3C0912.) LONG 2
XF_OPERLIST        \0808\1006000019F4\0908F 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\1709000019F4\0908F 0000000C (\3C0912.) LONG 2
XF_OPERLOWER        \0808     00001A00\0908B 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001A00\0908B 0000000C (\3C0912.) LONG 2
XF_OPERLSHIFT        \0808    00001A0C\090717 0000000C (\300912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001A0C\090717 0000000C (\3C0912.) LONG 2
XF_OPERMOVE        \0808\100600001A18\090723 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001A18\090723 0000000C (\3C0912.) LONG 2
XF_OPEROPENRECT        \0808  00001A24\0908F 0000000C (\2E0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001A24\0908F 0000000C (\3C0912.) LONG 2
XF_OPERPPRINT        \0808    00001A30\0908B 0000000C (\300912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001A30\0908B 0000000C (\3C0912.) LONG 2
XF_OPERPRINT        \0808     00001A3C\090747 0000000C (\310912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001A3C\090747 0000000C (\3C0912.) LONG 2
XF_OPERRSHIFT        \0808    00001A48\090753 0000000C (\300912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001A48\090753 0000000C (\3C0912.) LONG 2
XF_OPERSELECT        \0808    00001A54\0908F 0000000C (\300912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001A54\0908F 0000000C (\3C0912.) LONG 2
XF_OPERSUBST        \0808     00001A60\0908B 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001A60\0908B 0000000C (\3C0912.) LONG 2
XF_OPERSUBSTAGAIN        \080800001A6C\090777 0000000C (\2C0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001A6C\090777 0000000C (\3C0912.) LONG 2
XF_OPERTRANSF        \0808    00001A78\090783 0000000C (\300912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001A78\090783 0000000C (\3C0912.) LONG 2
XF_OPERTRIM        \0808\100600001A84\0908F 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001A84\0908F 0000000C (\3C0912.) LONG 2
XF_OPERUPPER        \0808     00001A90\0908B 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001A90\0908B 0000000C (\3C0912.) LONG 2
XF_OPERVGLOBALS        \0808  00001A9C\0907A7 0000000C (\2E0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001A9C\0907A7 0000000C (\3C0912.) LONG 2
XF_OPERWRITE        \0808     00001AA8\0907B3 0000000C (\310912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001AA8\0907B3 0000000C (\3C0912.) LONG 2
XF_OPERYANK        \0808\100600001AB4\0908F 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001AB4\0908F 0000000C (\3C0912.) LONG 2
XF_OVERWRITECHARS        \080800001AC0\0908B 0000000C (\2C0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001AC0\0908B 0000000C (\3C0912.) LONG 2
XF_OVERWSTRING        \0808   00001ACC\0907D7 0000000C (\2F0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001ACC\0907D7 0000000C (\3C0912.) LONG 2
XF_PIPECMD        \0808\100700001AD8\0907E3 0000000C (\330912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001AD8\0907E3 0000000C (\3C0912.) LONG 2
XF_POSWIND        \0808\100700001AE4\0908F 0000000C (\330912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001AE4\0908F 0000000C (\3C0912.) LONG 2
XF_POUNDC_FUNC        \0808   00001AF0\0908B 0000000C (\2F0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001AF0\0908B 0000000C (\3C0912.) LONG 2
XF_PREVWIND        \0808\100600001AFC\0906B07 0000000C (\320912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001AFC\0906B07 0000000C (\3C0912.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   14
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_PUTAFTER        \0808\100600001B08\090713 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001B08\090713 0000000C (\3C0912.) LONG 2
XF_PUTBEFORE        \0808     00001B14\0908F 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001B14\0908F 0000000C (\3C0912.) LONG 2
XF_PWD        \0808\100B00001B20\0908B 0000000C (\370912.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001B20\0908B 0000000C (\3C0912.) LONG 2
XF_QUICKEXIT        \0808     00001B2C\090737 0000000C (\310912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001B2C\090737 0000000C (\3C0912.) LONG 2
XF_QUIT        \0808\100A00001B38\090743 0000000C (\360912.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001B38\090743 0000000C (\3C0912.) LONG 2
XF_QUITHARD        \0808\100600001B44\0908F 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001B44\0908F 0000000C (\3C0912.) LONG 2
XF_QUOTE        \0808\100900001B50\0908B 0000000C (\350912.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001B50\0908B 0000000C (\3C0912.) LONG 2
XF_RECTPUTAFTER        \0808  00001B5C\090767 0000000C (\2E0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001B5C\090767 0000000C (\3C0912.) LONG 2
XF_RECTPUTBEFORE        \0808 00001B68\090773 0000000C (\2D0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001B68\090773 0000000C (\3C0912.) LONG 2
XF_REMOVE_MODE        \0808   00001B74\0908F 0000000C (\2F0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001B74\0908F 0000000C (\3C0912.) LONG 2
XF_REMOVE_SUBMODE        \080800001B80\0908B 0000000C (\2C0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001B80\0908B 0000000C (\3C0912.) LONG 2
XF_REPLACECHAR        \0808   00001B8C\090797 0000000C (\2F0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001B8C\090797 0000000C (\3C0912.) LONG 2
XF_REPOSITION        \0808    00001B98\0907A3 0000000C (\300912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001B98\0907A3 0000000C (\3C0912.) LONG 2
XF_REP_CSRCH        \0808     00001BA4\0908F 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001BA4\0908F 0000000C (\3C0912.) LONG 2
XF_RESIZE        \0808\100800001BB0\0908B 0000000C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001BB0\0908B 0000000C (\3C0912.) LONG 2
XF_RESPAWN        \0808\100700001BBC\0907C7 0000000C (\330912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001BBC\0907C7 0000000C (\3C0912.) LONG 2
XF_RESTWND        \0808\100700001BC8\0907D3 0000000C (\330912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001BC8\0907D3 0000000C (\3C0912.) LONG 2
XF_REVSEARCH        \0808     00001BD4\0908F 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001BD4\0908F 0000000C (\3C0912.) LONG 2
XF_REV_CSRCH        \0808     00001BE0\0908B 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001BE0\0908B 0000000C (\3C0912.) LONG 2
XF_RISEARCH        \0808\100600001BEC\0907F7 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001BEC\0907F7 0000000C (\3C0912.) LONG 2
XF_SAVEWND        \0808\100700001BF8\0906C03 0000000C (\330912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001BF8\0906C03 0000000C (\3C0912.) LONG 2
XF_SCRBACKSEARCH        \0808 00001C04\0908F 0000000C (\2D0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001C04\0908F 0000000C (\3C0912.) LONG 2
XF_SCRFORWSEARCH        \0808 00001C10\0908B 0000000C (\2D0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001C10\0908B 0000000C (\3C0912.) LONG 2
XF_SCRNEXTDW        \0808     00001C1C\090727 0000000C (\310912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001C1C\090727 0000000C (\3C0912.) LONG 2
XF_SCRNEXTUP        \0808     00001C28\090733 0000000C (\310912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001C28\090733 0000000C (\3C0912.) LONG 2
XF_SCRSEARCHPAT        \0808  00001C34\0908F 0000000C (\2E0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001C34\0908F 0000000C (\3C0912.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   15
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_SEL_MOTION        \0808    00001C40\0908B 0000000C (\300912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001C40\0908B 0000000C (\3C0912.) LONG 2
XF_SETFILLCOL        \0808    00001C4C\090757 0000000C (\300912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001C4C\090757 0000000C (\3C0912.) LONG 2
XF_SETGLOBMODE        \0808   00001C58\090763 0000000C (\2F0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001C58\090763 0000000C (\3C0912.) LONG 2
XF_SETLOCMODE        \0808    00001C64\0908F 0000000C (\300912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001C64\0908F 0000000C (\3C0912.) LONG 2
XF_SETNMMARK        \0808     00001C70\0908B 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001C70\0908B 0000000C (\3C0912.) LONG 2
XF_SETTAB        \0808\100800001C7C\090787 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001C7C\090787 0000000C (\3C0912.) LONG 2
XF_SETVAR        \0808\100800001C88\090793 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001C88\090793 0000000C (\3C0912.) LONG 2
XF_SET_DOSMODE        \0808   00001C94\0908F 0000000C (\2F0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001C94\0908F 0000000C (\3C0912.) LONG 2
XF_SET_TERMCHRS        \0808  00001CA0\0908B 0000000C (\2E0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001CA0\0908B 0000000C (\3C0912.) LONG 2
XF_SET_UNIXMODE        \0808  00001CAC\0907B7 0000000C (\2E0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001CAC\0907B7 0000000C (\3C0912.) LONG 2
XF_SHOWCPOS        \0808\100600001CB8\0907C3 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001CB8\0907C3 0000000C (\3C0912.) LONG 2
XF_SHOWHISTORY        \0808   00001CC4\0908F 0000000C (\2F0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001CC4\0908F 0000000C (\3C0912.) LONG 2
XF_SHOWHYPERCMD        \0808  00001CD0\0908B 0000000C (\2E0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001CD0\0908B 0000000C (\3C0912.) LONG 2
XF_SHOWKREG        \0808\100600001CDC\0907E7 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001CDC\0907E7 0000000C (\3C0912.) LONG 2
XF_SHOWLENGTH        \0808    00001CE8\0907F3 0000000C (\300912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001CE8\0907F3 0000000C (\3C0912.) LONG 2
XF_SHOWTAGSTACK        \0808  00001CF4\0908F 0000000C (\2E0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001CF4\0908F 0000000C (\3C0912.) LONG 2
XF_SHOWVERSION        \0808   00001D00\0908B 0000000C (\2F0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001D00\0908B 0000000C (\3C0912.) LONG 2
XF_SHOW_TERMCHRS        \0808 00001D0C\090717 0000000C (\2D0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001D0C\090717 0000000C (\3C0912.) LONG 2
XF_SHRINKWIND        \0808    00001D18\090723 0000000C (\300912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001D18\090723 0000000C (\3C0912.) LONG 2
XF_SOURCE        \0808\100800001D24\0908F 0000000C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001D24\0908F 0000000C (\3C0912.) LONG 2
XF_SPAWN        \0808\100900001D30\0908B 0000000C (\350912.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001D30\0908B 0000000C (\3C0912.) LONG 2
XF_SPAWNCLI        \0808\100600001D3C\090747 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001D3C\090747 0000000C (\3C0912.) LONG 2
XF_SPLITWIND        \0808     00001D48\090753 0000000C (\310912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001D48\090753 0000000C (\3C0912.) LONG 2
XF_STOREMAC        \0808\100600001D54\0908F 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001D54\0908F 0000000C (\3C0912.) LONG 2
XF_STOREPROC        \0808     00001D60\0908B 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001D60\0908B 0000000C (\3C0912.) LONG 2
XF_SUBST_AGAIN        \0808   00001D6C\090777 0000000C (\2F0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001D6C\090777 0000000C (\3C0912.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   16
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_SYSMAP        \0808\100800001D78\090783 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001D78\090783 0000000C (\3C0912.) LONG 2
XF_TOGGLELISTBUFFERS             00001D84\0908F 0000000C (\290912.) LONG 2   PI
VC,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001D84\0908F 0000000C (\3C0912.) LONG 2
XF_TWIDDLE        \0808\100700001D90\0908B 0000000C (\330912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001D90\0908B 0000000C (\3C0912.) LONG 2
XF_UE_SETKEY        \0808     00001D9C\0907A7 0000000C (\310912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001D9C\0907A7 0000000C (\3C0912.) LONG 2
XF_UNABBR        \0808\100800001DA8\0907B3 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001DA8\0907B3 0000000C (\3C0912.) LONG 2
XF_UNARG_FUNC        \0808    00001DB4\0908F 0000000C (\300912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001DB4\0908F 0000000C (\3C0912.) LONG 2
XF_UNBINDKEY        \0808     00001DC0\0908B 0000000C (\310912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001DC0\0908B 0000000C (\3C0912.) LONG 2
XF_UNDO        \0808\100A00001DCC\0907D7 0000000C (\360912.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001DCC\0907D7 0000000C (\3C0912.) LONG 2
XF_UNIMPL        \0808\100800001DD8\0907E3 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001DD8\0907E3 0000000C (\3C0912.) LONG 2
XF_UNMAP        \0808\100900001DE4\0908F 0000000C (\350912.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001DE4\0908F 0000000C (\3C0912.) LONG 2
XF_UNMAP_BANG        \0808    00001DF0\0908B 0000000C (\300912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001DF0\0908B 0000000C (\3C0912.) LONG 2
XF_UNMAP_SYSTEM        \0808  00001DFC\0906E07 0000000C (\2E0912.) LONG 2   PIC
V,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001DFC\0906E07 0000000C (\3C0912.) LONG 2
XF_UNMARK        \0808\100800001E08\090713 0000000C (\340912.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001E08\090713 0000000C (\3C0912.) LONG 2
XF_UNTAGPOP        \0808\100600001E14\0908F 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001E14\0908F 0000000C (\3C0912.) LONG 2
XF_UPSCREEN        \0808\100600001E20\0908B 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001E20\0908B 0000000C (\3C0912.) LONG 2
XF_USEBUFFER        \0808     00001E2C\090737 0000000C (\310912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001E2C\090737 0000000C (\3C0912.) LONG 2
XF_USEKREG        \0808\100700001E38\090743 0000000C (\330912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001E38\090743 0000000C (\3C0912.) LONG 2
XF_USERBEEP        \0808\100600001E44\0908F 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001E44\0908F 0000000C (\3C0912.) LONG 2
XF_VGLOBALS        \0808\100600001E50\0908B 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001E50\0908B 0000000C (\3C0912.) LONG 2
XF_VIEWFILE        \0808\100600001E5C\090767 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001E5C\090767 0000000C (\3C0912.) LONG 2
XF_VILE_FILTER        \0808   00001E68\090773 0000000C (\2F0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001E68\090773 0000000C (\3C0912.) LONG 2
XF_VILE_REFRESH        \0808  00001E74\0908F 0000000C (\2E0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001E74\0908F 0000000C (\3C0912.) LONG 2
XF_VISUAL        \0808\100800001E80\0908B 0000000C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001E80\0908B 0000000C (\3C0912.) LONG 2
XF_WORDCOUNT        \0808     00001E8C\090797 0000000C (\310912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001E8C\090797 0000000C (\3C0912.) LONG 2
XF_WRAPWORD        \0808\100600001E98\0907A3 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001E98\0907A3 0000000C (\3C0912.) LONG 2
XF_WRITEALLCHANGED        \080700001EA4\0908F 0000000C (\2B0912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001EA4\0908F 0000000C (\3C0912.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   17
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_WRITEMSG        \0808\100600001EB0\0908B 0000000C (\320912.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001EB0\0908B 0000000C (\3C0912.) LONG 2
XF_WRITEQUIT        \0808     00001EBC\0907C7 0000000C (\310912.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001EBC\0907C7 0000000C (\3C0912.) LONG 2
XF_YANKLINE        \0808\100600001EC8\0907D3 0000000C (\320912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001EC8\0907D3 0000000C (\3C0912.) LONG 2
XF_ZZQUIT        \0808\100800001ED4\0908F 0000000C (\340912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900001ED4\0908F 0000000C (\3C0912.) LONG 2
XG_VALNAMES        \0808\100600001EE0 0000208C 000001AD (\3208429.) LONG 2   PI
VC,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00001EE0 0000208C 000001AD (\3C08429.) LONG 2
XHELP_BUFNAME        \0808    00002090\09086 00000007 (\300A7.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00002090\09086 00000007 (\3C0A7.) LONG 2
XHEXDIGITS        \0808\100700002098\0907BC 00000025 (\330937.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00002098\0907BC 00000025 (\3C0937.) LONG 2
XHISTORY_BUFNAME        \0808 000020C0\09089 0000000A (\2D0910.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C000020C0\09089 0000000A (\3C0910.) LONG 2
XMACRO_N_BUFNAME        \0808 000020CC\0907D6 0000000B (\2D0911.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C000020CC\0907D6 0000000B (\3C0911.) LONG 2
XMAJORMODES_BUFNAME        \0806000020D8\0907E5 0000000E (\2A0914.) LONG 2   PI
VC,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C000020D8\0907E5 0000000E (\3C0914.) LONG 2
XMAPBANG_BUFNAME        \0808 000020E8\0907F\09060011 (\2D0917.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C000020E8\0907F\09060011 (\3C0917.) LONG 2
XMAP_BUFNAME        \0808     00002100\0908F 00000010 (\310916.) QUAD 3   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00002100\0908F 00000010 (\3C0916.) QUAD 3
XMESSAGES_BUFNAME        \080800002110\0908A 0000000B (\2C0911.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00002110\0908A 0000000B (\3C0911.) LONG 2
XM_VALNAMES        \0808\10060000211C\090742 00000027 (\320939.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C0000211C\090742 00000027 (\3C0939.) LONG 2
XNAMETBL        \0808\100900002148 00003127 00000FE0 (\35074064.) QUAD 3   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900002148 00003127 00000FE0 (\3C074064.) QUAD 3
XNAMETBLSIZE        \0808     00003128\0908B 00000004 (\310A4.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808EXTERNS\170900003128\0908B 00000004 (\3C0A4.) LONG 2
XOUTPUT_BUFNAME        \0808  0000312C\090734 00000009 (\2E0A9.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C0000312C\090734 00000009 (\3C0A9.) LONG 2
XPRINTABLECHARS_BUFNAME          00003138\090749 00000012 (\260918.) LONG 2   P
VIC,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00003138\090749 00000012 (\3C0918.) LONG 2
XP_LINES_BUFNAME        \0808 0000314C\090755 0000000A (\2D0910.) LONG 2   PIC,
+-+-+-+-+-+-+-+-  END  OF PART 116 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 117 -+-+-+-+-+-+-+-+
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C0000314C\090755 0000000A (\3C0910.) LONG 2
XREGISTERS_BUFNAME        \080700003158\090763 0000000C (\2B0912.) LONG 2   PIC
V,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00003158\090763 0000000C (\3C0912.) LONG 2
XSETTINGS_BUFNAME        \080800003164\0908E 0000000B (\2C0911.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00003164\0908E 0000000B (\3C0911.) LONG 2
XSTDIN_BUFNAME        \0808   00003170\09078\09060011 (\2F0917.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00003170\09078\09060011 (\3C0917.) LONG 2
XSYSMAP_BUFNAME        \0808  00003184\090791 0000000E (\2E0914.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00003184\090791 0000000E (\3C0914.) LONG 2
XTAGFILE_BUFNAME        \0808 00003194\0908D 0000000A (\2D0910.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00003194\0908D 0000000A (\3C0910.) LONG 2
XTAGSTACK_BUFNAME        \0808000031A0\0908B 0000000C (\2C0912.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C000031A0\0908B 0000000C (\3C0912.) LONG 2
XTERMINALCHARS_BUFNAME           000031AC\0907B\09060011 (\270917.) LONG 2   PI
VC,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C000031AC\0907B\09060011 (\3C0917.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   18
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XUNNAMED_BUFNAME        \0808 000031C0\09089 0000000A (\2D0910.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C000031C0\09089 0000000A (\3C0910.) LONG 2
XVARIABLES_BUFNAME        \0807000031CC\0907D7 0000000C (\2B0912.) LONG 2   PIC
V,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C000031CC\0907D7 0000000C (\3C0912.) LONG 2
XVILEINIT_BUFNAME        \0808000031D8\0907E2 0000000B (\2C0911.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C000031D8\0907E2 0000000B (\3C0911.) LONG 2
XW_VALNAMES        \0808\1006000031E4\0906258 00000075 (\3208117.) LONG 2   PIC
V,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C000031E4\0906258 00000075 (\3C08117.) LONG 2
X$DATA        \0808\100B00003400 00005397 00001F98 (\37078088.) QUAD 3   PIC,US
VR,CON,REL,LCL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00003400\09083 00000004 (\3C0A4.) LONG 2
X        \0808VMSVT\150B00003408\0906863 0000045C (\3C071116.) QUAD 3
X        \0808BASIC\150B00003864\09087 00000004 (\3C0A4.) LONG 2
X        \0808BIND\140C00003868\0906CC7 00000460 (\3C071120.) QUAD 3
X        \0808BUFFER\160A00003CC8\0906D1F 00000058 (\3C0988.) QUAD 3
X        \0808CRYPT\150B00003D20\09087 00000008 (\3C0A8.) LONG 2
X        \0808CSRCH\150B00003D28\090731 0000000A (\3C0910.) LONG 2
X        \0808DISPLAY\170900003D34\090797 00000064 (\3C08100.) LONG 2
X        \0808DUMBTERM\180800003D98\0908F 00000008 (\3C0A8.) LONG 2
X        \0808EVAL\140C00003DA0 0000403F 000002A0 (\3C08672.) QUAD 3
X        \0808EXEC\140C00004040\0907A8 00000069 (\3C08105.) LONG 2
X        \0808FENCES\160A000040B0\0908F 00000010 (\3C0916.) QUAD 3
X        \0808FILE\140C000040C0\0906157 00000098 (\3C08152.) QUAD 3
X        \0808FILEC\150B00004158\090777 00000020 (\3C0932.) LONG 2
X        \0808FILEIO\160A00004178\0908B 00000004 (\3C0A4.) LONG 2
X        \0808FINDERR\170900004180\0906217 00000098 (\3C08152.) QUAD 3
X        \0808GLOB\140C00004218\090723 0000000C (\3C0912.) LONG 2
X        \0808HISTORY\170900004224\090747 00000024 (\3C0936.) LONG 2
X        \0808INPUT\150B00004248\090773 0000002C (\3C0944.) LONG 2
X        \0808INSERT\160A00004278\0906410 00000199 (\3C08409.) QUAD 3
X        \0808ISEARCH\170900004418\090681F 00000408 (\3C071032.) QUAD 3
X        \0808LINE\140C00004820\0907B7 00000098 (\3C08152.) QUAD 3
X        \0808MAP\130D000048B8\0907F7 00000040 (\3C0964.) LONG 2
X        \0808MODES\150B000048F8\090695F 00000068 (\3C08104.) QUAD 3
X        \0808MSGS\140C00004960\0907E9 0000008A (\3C08138.) LONG 2
X        \0808ONELINER\1808000049EC\0906A0F 00000024 (\3C0936.) LONG 2
X        \0808RANDOM\160A00004A10\0906C1B 0000020C (\3C08524.) QUAD 3
X        \0808REGEXP\160A00004C1C\09074B 00000030 (\3C0948.) LONG 2
X        \0808REGION\160A00004C50\0906D57 00000108 (\3C08264.) QUAD 3
X        \0808SEARCH\160A00004D58\0907F3 0000009C (\3C08156.) QUAD 3
X        \0808SELECT\160A00004DF8\0906EB7 000000C0 (\3C08192.) QUAD 3
X        \0808SPAWN\150B00004EB8\0906FCC 00000115 (\3C08277.) QUAD 3
X        \0808TAGS\140C00004FD0 00005123 00000154 (\3C08340.) LONG 2
X        \0808TERMIO\160A00005128\0907A3 0000007C (\3C08124.) QUAD 3
X        \0808UNDO\140C000051A4\09087 00000004 (\3C0A4.) LONG 2
X        \0808VERSION\1709000051A8\0906277 000000D0 (\3C08208.) QUAD 3
X        \0808VMS2UNIX\180800005278\090637F 00000108 (\3C08264.) QUAD 3
X        \0808WINDOW\160A00005380\090793 00000014 (\3C0920.) LONG 2
X        \0808WORDMOV\170900005394\09087 00000004 (\3C0A4.) LONG 2
XABORTC        \0808\100A00005398\0908B 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005398\0908B 00000004 (\3C0A4.) LONG 2
XAM_INTERRUPTED        \0808  0000539C\0908F 00000004 (\2E0A4.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C0000539C\0908F 00000004 (\3C0A4.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   19
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XASCIITBL        \0808\1008000053A0\090679F 00000400 (\34071024.) QUAD 3   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808EXTERNS\1709000053A0\090679F 00000400 (\3C071024.) QUAD 3
XAUTOINDENTED        \0808    000057A0\09083 00000004 (\300A4.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000057A0\09083 00000004 (\3C0A4.) LONG 2
XBACKSPC        \0808\1009000057A4\09087 00000004 (\350A4.) LONG 2   PIC,USR,OV
VR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000057A4\09087 00000004 (\3C0A4.) LONG 2
XBHEADP        \0808\100A000057A8\0908B 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000057A8\0908B 00000004 (\3C0A4.) LONG 2
XBMINIP        \0808\100A000057AC\0908F 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000057AC\0908F 00000004 (\3C0A4.) LONG 2
XBSTORE        \0808\100A000057B0\09083 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000057B0\09083 00000004 (\3C0A4.) LONG 2
XBUFHOOK        \0808\1009000057B4\0907C8 00000015 (\350921.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000057B4\0907C8 00000015 (\3C0921.) LONG 2
XCALLEDBEFORE        \0808    000057CC\0908F 00000004 (\300A4.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000057CC\0908F 00000004 (\3C0A4.) LONG 2
XCDHOOK        \0808\100A000057D0\0907E4 00000015 (\360921.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000057D0\0907E4 00000015 (\3C0921.) LONG 2
XCLEXEC        \0808\100A000057E8\0908B 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000057E8\0908B 00000004 (\3C0A4.) LONG 2
XCMDSTATUS        \0808\1007000057EC\0908F 00000004 (\330A4.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000057EC\0908F 00000004 (\3C0A4.) LONG 2
XCNTL_A        \0808\100A000057F0\09083 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000057F0\09083 00000004 (\3C0A4.) LONG 2
XCNTL_X        \0808\100A000057F4\09087 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000057F4\09087 00000004 (\3C0A4.) LONG 2
XCRYPTFLAG        \0808\1007000057F8\0908B 00000004 (\330A4.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000057F8\0908B 00000004 (\3C0A4.) LONG 2
XCRYPTKEY        \0808\1008000057FC\0908F 00000004 (\340A4.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000057FC\0908F 00000004 (\3C0A4.) LONG 2
XCURBP        \0808\100B00005800\09083 00000004 (\370A4.) LONG 2   PIC,USR,OVR,
VREL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005800\09083 00000004 (\3C0A4.) LONG 2
XCURCOL        \0808\100A00005804\09087 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005804\09087 00000004 (\3C0A4.) LONG 2
XCURGOAL        \0808\100900005808\0908B 00000004 (\350A4.) LONG 2   PIC,USR,OV
VR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005808\0908B 00000004 (\3C0A4.) LONG 2
XCURROW        \0808\100A0000580C\0908F 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C0000580C\0908F 00000004 (\3C0A4.) LONG 2
XCURTABVAL        \0808\100700005810\09083 00000004 (\330A4.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005810\09083 00000004 (\3C0A4.) LONG 2
XCURWP        \0808\100B00005814\09087 00000004 (\370A4.) LONG 2   PIC,USR,OVR,
VREL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005814\09087 00000004 (\3C0A4.) LONG 2
XDISCMD        \0808\100A00005818\0908B 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005818\0908B 00000004 (\3C0A4.) LONG 2
XDISINP        \0808\100A0000581C\0908F 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C0000581C\0908F 00000004 (\3C0A4.) LONG 2
XDOINGOPCMD        \0808\100600005820\09083 00000004 (\320A4.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005820\09083 00000004 (\3C0A4.) LONG 2
XDOINGSWEEP        \0808\100600005824\09087 00000004 (\320A4.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005824\09087 00000004 (\3C0A4.) LONG 2
XDOTCMD        \0808\100A00005828\0908B 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005828\0908B 00000004 (\3C0A4.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   20
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XDOTCMDARG        \0808\10070000582C\0908F 00000004 (\330A4.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C0000582C\0908F 00000004 (\3C0A4.) LONG 2
XDOTCMDCNT        \0808\100700005830\09083 00000004 (\330A4.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005830\09083 00000004 (\3C0A4.) LONG 2
XDOTCMDKREG        \0808\100600005834\09085 00000002 (\320A2.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005834\09085 00000002 (\3C0A2.) LONG 2
XDOTCMDMODE        \0808\100600005838\0908B 00000004 (\320A4.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005838\0908B 00000004 (\3C0A4.) LONG 2
XDOTCMDREP        \0808\10070000583C\0908F 00000004 (\330A4.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C0000583C\0908F 00000004 (\3C0A4.) LONG 2
XDUMB_TERM        \0808\100700005840\0907B7 00000078 (\3308120.) QUAD 3   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808DUMBTERM\180800005840\0907B7 00000078 (\3C08120.) QUAD 3
XEDITC        \0808\100B000058B8\0908B 00000004 (\370A4.) LONG 2   PIC,USR,OVR,
VREL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000058B8\0908B 00000004 (\3C0A4.) LONG 2
XEOFFLAG        \0808\1009000058BC\0908F 00000004 (\350A4.) LONG 2   PIC,USR,OV
VR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000058BC\0908F 00000004 (\3C0A4.) LONG 2
XEOLEXIST        \0808\1008000058C0\09083 00000004 (\340A4.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000058C0\09083 00000004 (\3C0A4.) LONG 2
XERRORM        \0808\100A000058C4\09089 00000006 (\360A6.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000058C4\09089 00000006 (\3C0A6.) LONG 2
XEV_END_OF_CMD        \0808   000058CC\0908F 00000004 (\2F0A4.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000058CC\0908F 00000004 (\3C0A4.) LONG 2
XEXECSTR        \0808\1009000058D0\09083 00000004 (\350A4.) LONG 2   PIC,USR,OV
VR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000058D0\09083 00000004 (\3C0A4.) LONG 2
XEXEC_PATHNAME        \0808   000058D4\09087 00000004 (\2F0A4.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000058D4\09087 00000004 (\3C0A4.) LONG 2
XEXITHOOK        \0808\1008000058D8\0907EC 00000015 (\340921.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000058D8\0907EC 00000015 (\3C0921.) LONG 2
XFALSEM        \0808\100A000058F0\09085 00000006 (\360A6.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000058F0\09085 00000006 (\3C0A6.) LONG 2
XFFP        \0808\100D000058F8\0908B 00000004 (\390A4.) LONG 2   PIC,USR,OVR,RE
VL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000058F8\0908B 00000004 (\3C0A4.) LONG 2
XFILEISPIPE        \0808\1006000058FC\0908F 00000004 (\320A4.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000058FC\0908F 00000004 (\3C0A4.) LONG 2
XFLEN        \0808\100C00005900\09083 00000004 (\380A4.) LONG 2   PIC,USR,OVR,R
VEL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005900\09083 00000004 (\3C0A4.) LONG 2
XFLICKCODE        \0808\100700005904\09087 00000004 (\330A4.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005904\09087 00000004 (\3C0A4.) LONG 2
XFLINE        \0808\100B00005908\0908B 00000004 (\370A4.) LONG 2   PIC,USR,OVR,
VREL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005908\0908B 00000004 (\3C0A4.) LONG 2
XGLOBAL_B_VALUES        \0808 00005910\0906A9F 00000190 (\2D08400.) QUAD 3   PI
VC,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005910\0906A9F 00000190 (\3C08400.) QUAD 3
XGLOBAL_G_VALUES        \0808 00005AA0\0906C0F 00000170 (\2D08368.) QUAD 3   PI
VC,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005AA0\0906C0F 00000170 (\3C08368.) QUAD 3
XGLOBAL_W_VALUES        \0808 00005C10\090757 00000048 (\2D0972.) QUAD 3   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005C10\090757 00000048 (\3C0972.) QUAD 3
XGOLABEL        \0808\100900005C58\0907D7 00000080 (\3508128.) QUAD 3   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005C58\0907D7 00000080 (\3C08128.) QUAD 3
XGREGEXP        \0808\100900005CD8\0908B 00000004 (\350A4.) LONG 2   PIC,USR,OV
VR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005CD8\0908B 00000004 (\3C0A4.) LONG 2
XHAVEMOTION        \0808\100600005CDC\0908F 00000004 (\320A4.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005CDC\0908F 00000004 (\3C0A4.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   21
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XHAVEREGION        \0808\100600005CE0\09083 00000004 (\320A4.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808REGION\160A00005CE0\09083 00000004 (\3C0A4.) LONG 2
XHELPFILE        \0808\100800005CE4\09087 00000004 (\340A4.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005CE4\09087 00000004 (\3C0A4.) LONG 2
XHELP_AT        \0808\100900005CE8\0908B 00000004 (\350A4.) LONG 2   PIC,USR,OV
VR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00005CE8\0908B 00000004 (\3C0A4.) LONG 2
XIBUF        \0808\100C00005CF0 000060EF 00000400 (\38071024.) QUAD 3   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808TERMIO\160A00005CF0 000060EF 00000400 (\3C071024.) QUAD 3
XIBUFI        \0808\100B000060F0\09083 00000004 (\370A4.) LONG 2   PIC,USR,OVR,
VREL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808TERMIO\160A000060F0\09083 00000004 (\3C0A4.) LONG 2
XIGNORECASE        \0808\1006000060F4\09087 00000004 (\320A4.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000060F4\09087 00000004 (\3C0A4.) LONG 2
XINSERTMODE        \0808\1006000060F8\0908B 00000004 (\320A4.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000060F8\0908B 00000004 (\3C0A4.) LONG 2
XINTRC        \0808\100B000060FC \0907F 00000004 (\370A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000060FC\0908F 00000004 (\3C0A4.) LONG 2
XIOCHAN        \0808\100A00006100\09081 00000002 (\360A2.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808TERMIO\160A00006100\09081 00000002 (\3C0A2.) LONG 2
XISNAMEDCMD        \0808\100600006104\09087 00000004 (\320A4.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006104\09087 00000004 (\3C0A4.) LONG 2
XKBDMODE        \0808\100900006108\0908B 00000004 (\350A4.) LONG 2   PIC,USR,OV
VR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006108\0908B 00000004 (\3C0A4.) LONG 2
XKBD_EXPAND        \0808\10060000610C\0908F 00000004 (\320A4.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C0000610C\0908F 00000004 (\3C0A4.) LONG 2
XKBINDTBL        \0808\100800006110\09065F1 000004E2 (\34071250.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808EXTERNS\170900006110\09065F1 000004E2 (\3C071250.) LONG 2
XKBS        \0808\100D000065F4\09068B1 000002BE (\3908702.) LONG 2   PIC,USR,OV
VR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000065F4\09068B1 000002BE (\3C08702.) LONG 2
XKCHARS        \0808\100A000068B4\09087 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000068B4\09087 00000004 (\3C0A4.) LONG 2
XKILLC        \0808\100B000068B8\0908B 00000004 (\370A4.) LONG 2   PIC,USR,OVR,
VREL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000068B8\0908B 00000004 (\3C0A4.) LONG 2
XKLINES        \0808\100A000068BC\0908F 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000068BC\0908F 00000004 (\3C0A4.) LONG 2
XKREGFLAG        \0808\1008000068C0\09081 00000002 (\340A2.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000068C0\09081 00000002 (\3C0A2.) LONG 2
XKREGWIDTH        \0808\1007000068C4\09087 00000004 (\330A4.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000068C4\09087 00000004 (\3C0A4.) LONG 2
XLASTCMD        \0808\1009000068C8\0908B 00000004 (\350A4.) LONG 2   PIC,USR,OV
VR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000068C8\0908B 00000004 (\3C0A4.) LONG 2
XLASTFILEEDITED        \0808  000068CC\0908F 00000004 (\2E0A4.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808FILE\140C000068CC\0908F 00000004 (\3C0A4.) LONG 2
XLASTKEY        \0808\1009000068D0\09083 00000004 (\350A4.) LONG 2   PIC,USR,OV
VR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000068D0\09083 00000004 (\3C0A4.) LONG 2
XLAST_SRCH_DIREC        \0808 000068D4\09087 00000004 (\2D0A4.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000068D4\09087 00000004 (\3C0A4.) LONG 2
XLINES_DELETED        \0808   000068D8\0908B 00000004 (\2F0A4.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000068D8\0908B 00000004 (\3C0A4.) LONG 2
XMACBUG        \0808\100A000068DC\0908F 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000068DC\0908F 00000004 (\3C0A4.) LONG 2
XMARK        \0808\100C000068E0\09087 00000008 (\380A8.) QUAD 3   PIC,USR,OVR,R
VEL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000068E0\09087 00000008 (\3C0A8.) QUAD 3
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   22
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XMINIEDIT        \0808\1008000068E8\0908B 00000004 (\340A4.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000068E8\0908B 00000004 (\3C0A4.) LONG 2
XMLSAVE        \0808\100A000068F0\090696F 00000080 (\3608128.) QUAD 3   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000068F0\090696F 00000080 (\3C08128.) QUAD 3
XMODELINE_FORMAT        \0808 00006970\09083 00000004 (\2D0A4.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006970\09083 00000004 (\3C0A4.) LONG 2
XMSTORE        \0808\100A00006974\09087 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006974\09087 00000004 (\3C0A4.) LONG 2
XNAME_CMPL        \0808\100700006978\0908B 00000004 (\330A4.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006978\0908B 00000004 (\3C0A4.) LONG 2
XNEWMODE        \0808\10090000697C\090787 0000000C (\350912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808TERMIO\160A0000697C\090787 0000000C (\3C0912.) LONG 2
XNIBUF        \0808\100B00006988\0908B 00000004 (\370A4.) LONG 2   PIC,USR,OVR,
VREL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808TERMIO\160A00006988\0908B 00000004 (\3C0A4.) LONG 2
XNOBUF        \0808\100B0000698C\0908F 00000004 (\370A4.) LONG 2   PIC,USR,OVR,
VREL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808TERMIO\160A0000698C\0908F 00000004 (\3C0A4.) LONG 2
XNTILDES        \0808\100900006990\09083 00000004 (\350A4.) LONG 2   PIC,USR,OV
VR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006990\09083 00000004 (\3C0A4.) LONG 2
XNULLMARK        \0808\100800006998\0908F 00000008 (\340A8.) QUAD 3   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006998\0908F 00000008 (\3C0A8.) QUAD 3
XNULL_TERM        \0808\1007000069A0\0906A17 00000078 (\3308120.) QUAD 3   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808TERMIO\160A000069A0\0906A17 00000078 (\3C08120.) QUAD 3
XOBUF        \0808\100C00006A18\0906E17 00000400 (\38071024.) QUAD 3   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808TERMIO\160A00006A18\0906E17 00000400 (\3C071024.) QUAD 3
XOLDMODE        \0808\100900006E18\090723 0000000C (\350912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808TERMIO\160A00006E18\090723 0000000C (\3C0912.) LONG 2
XOPCMD        \0808\100B00006E24\09085 00000002 (\370A2.) LONG 2   PIC,USR,OVR,
VREL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006E24\09085 00000002 (\3C0A2.) LONG 2
XOPERSYS        \0808\100900006E28\0908B 00000004 (\350A4.) LONG 2   PIC,USR,OV
VR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006E28\0908B 00000004 (\3C0A4.) LONG 2
XOUT_OF_MEM        \0808\100600006E2C\090739 0000000E (\320914.) LONG 2   PIC,U
VSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006E2C\090739 0000000E (\3C0914.) LONG 2
XPALSTR        \0808\100A00006E3C\0908F 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006E3C\0908F 00000004 (\3C0A4.) LONG 2
XPAT        \0808\100D00006E40\0907BF 00000080 (\3908128.) QUAD 3   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006E40\0907BF 00000080 (\3C08128.) QUAD 3
XPATMATCH        \0808\100800006EC0\09083 00000004 (\340A4.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006EC0\09083 00000004 (\3C0A4.) LONG 2
XPOUNDC        \0808\100A00006EC4\09087 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006EC4\09087 00000004 (\3C0A4.) LONG 2
XPRE_OP_DOT        \0808\100600006EC8\0908F 00000008 (\320A8.) QUAD 3   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006EC8\0908F 00000008 (\3C0A8.) QUAD 3
XPROGNAM        \0808\100900006ED0\09084 00000005 (\350A5.) LONG 2   PIC,USR,OV
VR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006ED0\09084 00000005 (\3C0A5.) LONG 2
XPROG_ARG        \0808\100800006ED8\0908B 00000004 (\340A4.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006ED8\0908B 00000004 (\3C0A4.) LONG 2
XPSCREEN        \0808\100900006EDC\0908F 00000004 (\350A4.) LONG 2   PIC,USR,OV
VR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808DISPLAY\170900006EDC\0908F 00000004 (\3C0A4.) LONG 2
XQUOTEC        \0808\100A00006EE0\09083 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006EE0\09083 00000004 (\3C0A4.) LONG 2
XREADHOOK        \0808\100800006EE4\0907F8 00000015 (\340921.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006EE4\0907F8 00000015 (\3C0921.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   23
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XREADING_MSG_LINE        \080800006EFC\0908F 00000004 (\2C0A4.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006EFC\0908F 00000004 (\3C0A4.) LONG 2
XREAD_JMP_BUF        \0808    00006F00\09073B 0000003C (\300960.) LONG 2   PIC,
VUSR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006F00\09073B 0000003C (\3C0960.) LONG 2
XREGIONSHAPE        \0808     00006F3C\0908F 00000004 (\310A4.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006F3C\0908F 00000004 (\3C0A4.) LONG 2
XRELISTING_B_VALS        \080800006F40\09083 00000004 (\2C0A4.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006F40\09083 00000004 (\3C0A4.) LONG 2
XRELISTING_W_VALS        \080800006F44\09087 00000004 (\2C0A4.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006F44\09087 00000004 (\3C0A4.) LONG 2
XREPTC        \0808\100B00006F48\0908B 00000004 (\370A4.) LONG 2   PIC,USR,OVR,
VREL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006F48\0908B 00000004 (\3C0A4.) LONG 2
XREVEXIST        \0808\100800006F4C\0908F 00000004 (\340A4.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006F4C\0908F 00000004 (\3C0A4.) LONG 2
XRPAT        \0808\100C00006F50\0907CF 00000080 (\3808128.) QUAD 3   PIC,USR,OV
VR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006F50\0907CF 00000080 (\3C08128.) QUAD 3
XSAVE_SHELL        \0808\100600006FD0\09087 00000008 (\320A8.) QUAD 3   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006FD0\09087 00000008 (\3C0A8.) QUAD 3
XSCANBOUNDPOS        \0808    00006FD8\0908F 00000008 (\300A8.) QUAD 3   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006FD8\0908F 00000008 (\3C0A8.) QUAD 3
XSCANBOUND_IS_HEADER             00006FE0\09083 00000004 (\290A4.) LONG 2   PIC
V,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006FE0\09083 00000004 (\3C0A4.) LONG 2
XSEED        \0808\100C00006FE4\09087 00000004 (\380A4.) LONG 2   PIC,USR,OVR,R
VEL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006FE4\09087 00000004 (\3C0A4.) LONG 2
XSGARBF        \0808\100A00006FE8\0908B 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006FE8\0908B 00000004 (\3C0A4.) LONG 2
XSIGNAL_WAS        \0808\100600006FEC\0908F 00000004 (\320A4.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006FEC\0908F 00000004 (\3C0A4.) LONG 2
XSRES        \0808\100C00006FF0 00007004 00000015 (\380921.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00006FF0 00007004 00000015 (\3C0921.) LONG 2
XSTARTC        \0808\100A00007008\0908B 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00007008\0908B 00000004 (\3C0A4.) LONG 2
XSTARTUP_FILE        \0808    0000700C\0908F 00000004 (\300A4.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
+-+-+-+-+-+-+-+-  END  OF PART 117 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 118 -+-+-+-+-+-+-+-+
X        \0808MAIN\140C0000700C\0908F 00000004 (\3C0A4.) LONG 2
XSTARTUP_PATH        \0808    00007010\09083 00000004 (\300A4.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00007010\09083 00000004 (\3C0A4.) LONG 2
XSTOPC        \0808\100B00007014\09087 00000004 (\370A4.) LONG 2   PIC,USR,OVR,
VREL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00007014\09087 00000004 (\3C0A4.) LONG 2
XSUSPC        \0808\100B00007018\0908B 00000004 (\370A4.) LONG 2   PIC,USR,OVR,
VREL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00007018\0908B 00000004 (\3C0A4.) LONG 2
XSWEEPHACK        \0808\10070000701C\0908F 00000004 (\330A4.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C0000701C\0908F 00000004 (\3C0A4.) LONG 2
XSWINDOW        \0808\100900007020\09083 00000004 (\350A4.) LONG 2   PIC,USR,OV
VR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00007020\09083 00000004 (\3C0A4.) LONG 2
XTABOFF        \0808\100A00007024\09087 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00007024\09087 00000004 (\3C0A4.) LONG 2
XTERM        \0808\100C00007028\09079F 00000078 (\3808120.) QUAD 3   PIC,USR,OV
VR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808VMSVT\150B00007028\09079F 00000078 (\3C08120.) QUAD 3
XTEST_CMPL        \0808\1007000070A0\09083 00000004 (\330A4.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000070A0\09083 00000004 (\3C0A4.) LONG 2
XTRUEM        \0808\100B000070A4\09088 00000005 (\370A5.) LONG 2   PIC,USR,OVR,
VREL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000070A4\09088 00000005 (\3C0A5.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   24
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XTTCOL        \0808\100B000070AC\0908F 00000004 (\370A4.) LONG 2   PIC,USR,OVR,
VREL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000070AC\0908F 00000004 (\3C0A4.) LONG 2
XTTROW        \0808\100B000070B0\09083 00000004 (\370A4.) LONG 2   PIC,USR,OVR,
VREL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000070B0\09083 00000004 (\3C0A4.) LONG 2
XUKB        \0808\100D000070B4\09085 00000002 (\390A2.) LONG 2   PIC,USR,OVR,RE
VL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000070B4\09085 00000002 (\3C0A2.) LONG 2
XUSER_VARS        \0808\1007000070B8\0908B 00000004 (\330A4.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000070B8\0908B 00000004 (\3C0A4.) LONG 2
XVERSION        \0808\1009000070BC\0907C7 0000000C (\350912.) LONG 2   PIC,USR,
VOVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000070BC\0907C7 0000000C (\3C0912.) LONG 2
XVIDEOATTRIBUTE        \0808  000070C8\09089 00000002 (\2E0A2.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000070C8\09089 00000002 (\3C0A2.) LONG 2
XVSCREEN        \0808\1009000070CC\0908F 00000004 (\350A4.) LONG 2   PIC,USR,OV
VR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808DISPLAY\1709000070CC\0908F 00000004 (\3C0A4.) LONG 2
XVTCOL        \0808\100B000070D0\09083 00000004 (\370A4.) LONG 2   PIC,USR,OVR,
VREL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000070D0\09083 00000004 (\3C0A4.) LONG 2
XVTROW        \0808\100B000070D4\09087 00000004 (\370A4.) LONG 2   PIC,USR,OVR,
VREL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000070D4\09087 00000004 (\3C0A4.) LONG 2
XWARNINGS        \0808\1008000070D8\0908B 00000004 (\340A4.) LONG 2   PIC,USR,O
VVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000070D8\0908B 00000004 (\3C0A4.) LONG 2
XWHEADP        \0808\100A000070DC\0908F 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000070DC\0908F 00000004 (\3C0A4.) LONG 2
XWKILLC        \0808\100A000070E0\09083 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000070E0\09083 00000004 (\3C0A4.) LONG 2
XWMINIP        \0808\100A000070E4\09087 00000004 (\360A4.) LONG 2   PIC,USR,OVR
V,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000070E4\09087 00000004 (\3C0A4.) LONG 2
XWRITEHOOK        \0808\1007000070E8\0907FC 00000015 (\330921.) LONG 2   PIC,US
VR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C000070E8\0907FC 00000015 (\3C0921.) LONG 2
X_CHARTYPES_        \0808     00007100\09064FF 00000400 (\31071024.) QUAD 3   P
VIC,USR,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808MAIN\140C00007100\09064FF 00000400 (\3C071024.) QUAD 3
X_PIPES        \0808\100A00007500\09066F3 000001F4 (\3608500.) LONG 2   PIC,USR
V,OVR,REL,GBL,NOSHR,NOEXE,  RD,  WRT,NOVEC
X        \0808VMSPIPE\170900007500\09066F3 000001F4 (\3C08500.) LONG 2
X$CODE        \0808\100B00007800 0004D12\09065921 (     284961.) QUAD 3   PIC,U
VSR,CON,REL,LCL,  SHR,  EXE,  RD,NOWRT,NOVEC
X        \0808MAIN\140C00007800 0000A7CD 00002FCE (\3C0612238.) QUAD 3
X        \0808VMSVT\150B0000A7D0 0000B23B 00000A6C (\3C072668.) LONG 2
X        \0808BASIC\150B0000B23C 0000D07\09061E41 (\3C077745.) LONG 2
X        \0808BIND\140C0000D080 0001018C 0000310D (\3C0612557.) QUAD 3
X        \0808BTREE\150B00010190\0906AAE 0000091F (\3C072335.) LONG 2
X        \0808BUFFER\160A00010AB0 000137A0 00002CF1 (\3C0611505.) QUAD 3
X        \0808CRYPT\150B000137A4\0906A90 000002ED (\3C08749.) LONG 2
X        \0808CSRCH\150B00013A94\0906EBC 00000429 (\3C071065.) LONG 2
X        \0808DISPLAY\170900013EC0 00018B46 00004C87 (\3C0619591.) QUAD 3
X        \0808DUMBTERM\180800018B48\0906CF6 000001AF (\3C08431.) LONG 2
X        \0808EVAL\140C00018CF8 0001CCA1 00003FAA (\3C0616298.) QUAD 3
X        \0808EXEC\140C0001CCA8 0001FF10 00003269 (\3C0612905.) QUAD 3
X        \0808EXTERNS\17090001FF18 00025387 00005470 (\3C0621616.) QUAD 3
X        \0808FENCES\160A00025388\0906F26 00000B9F (\3C072975.) LONG 2
X        \0808FILE\140C00025F28 00028D92 00002E6B (\3C0611883.) QUAD 3
X        \0808FILEC\150B00028D94 0002A321 0000158E (\3C075518.) LONG 2
X        \0808FILEIO\160A0002A328\0906AD1 000007AA (\3C071962.) QUAD 3
X        \0808FINDERR\17090002AAD8 0002B793 00000CBC (\3C073260.) QUAD 3
X        \0808GLOB\140C0002B794\0906D50 000005BD (\3C071469.) LONG 2
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   25
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
X$CODE        \0808\100B00007800 0004D12\09065921 (     284961.) QUAD 3   PIC,U
VSR,CON,REL,LCL,  SHR,  EXE,  RD,NOWRT,NOVEC`20
X        \0808GLOBALS\17090002BD54 0002C065 00000312 (\3C08786.) LONG 2
X        \0808HISTORY\17090002C068\0906D07 00000CA0 (\3C073232.) QUAD 3
X        \0808INPUT\150B0002CD08 0002F82D 00002B26 (\3C0611046.) QUAD 3
X        \0808INSERT\160A0002F830 000317FD 00001FCE (\3C078142.) QUAD 3
X        \0808ITBUFF\160A00031800\0906C6D 0000046E (\3C071134.) LONG 2
X        \0808ISEARCH\170900031C70 0003250F 000008A0 (\3C072208.) LONG 2
X        \0808LINE\140C00032510 0003442E 00001F1F (\3C077967.) QUAD 3
X        \0808MAP\130D00034430 0003573B 0000130C (\3C074876.) QUAD 3
X        \0808MODES\150B00035740 00039B0F 000043D0 (\3C0617360.) QUAD 3
X        \0808MSGS\140C00039B10\0906DA1 00000292 (\3C08658.) LONG 2
X        \0808ONELINER\180800039DA8 0003ACA1 00000EFA (\3C073834.) QUAD 3
X        \0808OPERS\150B0003ACA8 0003B770 00000AC9 (\3C072761.) QUAD 3
X        \0808PATH\140C0003B774 0003CDA0 0000162D (\3C075677.) LONG 2
X        \0808RANDOM\160A0003CDA8 0003DDA7 00001000 (\3C074096.) QUAD 3
X        \0808REGEXP\160A0003DDA8 00040EF7 00003150 (\3C0612624.) QUAD 3
X        \0808REGION\160A00040EF8 0004246E 00001577 (\3C075495.) LONG 2
X        \0808SEARCH\160A00042470 00043C16 000017A7 (\3C076055.) LONG 2
X        \0808SELECT\160A00043C18 0004533F 00001728 (\3C075928.) QUAD 3
X        \0808SPAWN\150B00045340\0906AE9 000007AA (\3C071962.) LONG 2
X        \0808TAGS\140C00045AEC 00046EFF 00001414 (\3C075140.) LONG 2
X        \0808TBUFF\150B00046F00 00047475 00000576 (\3C071398.) LONG 2
X        \0808TERMIO\160A00047478\0906A88 00000611 (\3C071553.) QUAD 3
X        \0808UNDO\140C00047A90 00048E24 00001395 (\3C075013.) QUAD 3
X        \0808VERSION\170900048E28 00049197 00000370 (\3C08880.) QUAD 3
X        \0808VMS2UNIX\180800049198 0004A024 00000E8D (\3C073725.) LONG 2
X        \0808VMSPIPE\17090004A028\0906452 0000042B (\3C071067.) LONG 2
X        \0808WINDOW\160A0004A458 0004BB47 000016F0 (\3C075872.) QUAD 3
X        \0808WORD\140C0004BB48 0004CC0B 000010C4 (\3C074292.) QUAD 3
X        \0808WORDMOV\17090004CC0C 0004D120 00000515 (\3C071301.) LONG 2
X
X        \0808\1010\200D+--------\0808\1008+
X        \0808\1010\200D! Symbol Cross Reference !
X        \0808\1010\200D+--------\0808\1008+
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XABBREV        \0808\100A000347A0-R\2407MAP\2E11EXTERNS\4607
XABBR_BUFNAME        \0808    000004A0-R\1E07MAIN\2910MAP\3C0B
XABBR_CHECK        \0808\1006000353B4-R\2007MAP\2A11INSERT\4108
XABORTC        \0808\100A00005398-R\2407MAIN\2F10BASI\4410BIND\5710CSRCH\6C09
X        \0808\1010\2020     EXEC\4910HISTORY\600DINPUT\7209
X        \0808\1010\2020     INSERT\140FSEARCH\280ETBUFF\7308
X        \0808\1010\2020     MAP\4811SELECT\140FPAWN\7209
X        \0808\1010\2020     TBUFF\1410ERMIO\5F0EWINDOW\7308
XABSOL        \0808\100B0001CC34-R\2507EVA\3011WINDOW\4608
XADDLINE        \0808\100900012E20-R\2307BUFFE\0D08\1408IND\4210EXEC\5610FIL
V\6A0B
X        \0808\1010\2020     FINDERR\4C0DHISTORY\600DONELINER\7506
X        \0808\1010\2020     WINDOW\4B08
XADDTOSYSMAP        \0808     00034BDC-R\1F07\2914VMSVT\3F09
XADD_BRACKETS        \0808    000122B4-R\1E07BUFFE\0D08\3207EXEC\3D0A
XADD_LINE_AT        \0808     00012E60-R\1F07BUFFE\0D08\1414\4707FILE\520A
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   26
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XADJVALUESET        \0808     00036C04-R\1F07MODES\2B0FEVAL\3E10\280E
XALLOC_MODE        \0808\100600038D28-R\2007MODES\2C0FMAIN\3F10\280E
XALL_MODES        \0808\1007000004B0-R\2107MAIN\2C10\410E
XALL_SUBMODES        \0808    00000928-R\1E07MAIN\2910\3E0E
XALTBUFF        \0808\100900011810-R\2307BUFFE\0D08\3707EXTERNS\4507
XAM_INTERRUPTED        \0808  0000539C-R    WK-MAIN\2710BASIC\1410UFFER\510ECSR
VCH\6409
X        \0808\1010\2020     FENCES\140FILEIO\5F0EHISTORY\7407
X        \0808\1010\2020     INPUT\1411SER\150FISEARCH\7407
X        \0808\1010\2020  WK-MAIN\4910SEARCH\1410LECT\7308
X        \0808\1010\2020     SPAWN\4A0FWINDOW\140FORD\710A
XANY_CHANGED_BUF        \0808 00012F44-R\1B07BUFFE\0D08\2F07MAIN\3A10SPAW\150A
V
XANY_UNREAD_BUF        \0808  00012F84-R\1C07BUFFE\0D08\3007MAIN\3B0A
XAPPEND        \0808\100A0002FE40-R\2407INSERT\310EEXTERNS\4607
XAPPENDEOL        \0808\10070002FE98-R\2107INSERT\2E0EEXTERNS\4307
XAPPSTRING        \0808\100700030C78-R\2107INSERT\2E0EEXTERNS\4307
XASCIITBL        \0808\1008000053A0-R\2207EXTERNS\300DBIND\4110TERMIO\5708
XASK_SHOULDCHANGE        \08080002652C-R\1A07FIL\2511EXEC\390A
XASSIGN_ATTR_ID        \0808  00043FA8-R\1C07SELECT\290EREGION\3D08
XATTRIBUTEREGION        \0808 00044A24-R\1B07SELECT\280ESEARCH\1410\280C
XATTRIBUTEREGION_OVER_\0C06     00044B50-R       SELECT\0D07`20
XATTRIBUTE_CNTL_A_SEQUENCES_OVER 00044E94-R       SELECT\0D07`20
XATTRIB_MATCHES        \0808  00043744-R\1C07SEARCH\290EMAIN\3B10MOD\5011\3C0E
V
XAUTOINDENTED        \0808    000057A0-R\1E07MAIN\2910INSERT\3F08
XBACKBLINE        \0808\10070000BCE8-R\2107BASIC\2D0FEXTERNS\4307
XBACKCHAR        \0808\10080000B304-\2208BASIC\2E0F\1414CSRCH\560FEVAL\690A
X        \0808\1010\2020     EXTERNS\4C0DFENCE\130E INSERT\7308
X        \0808\1010\2020     ISEARCH\4C0DLINE\5D10MAIN\710A
X        \0808\1010\2020     RANDOM\140FEGION\5F0ESEARCH\7308
X        \0808\1010\2020     WORD\490A
XBACKCHAR_TO_BOL        \0808 0000B3A0-R\1B07BASIC\270F\1414EXTERNS\5107
XBACKDELCHAR        \0808     0003D78C-\1F08RANDOM\2C0EEXTERNS\4107
XBACKHPAGE        \0808\10070000CB0C-R\2107BASIC\2D0F\1414EXTERNS\570DWINDOW
V\6A08
XBACKHUNT        \0808\100800042F84-R\2207SEARCH\2F0EEXTERNS\440D\280E
XBACKLINE        \0808\10080000BD24-R\2207BASIC\2E0F\1414EXTERNS\580DHISTORY
V\6C07
X        \0808\1010\2020     INSERT\4B0ELINE\5D10MAIN\710A
X        \0808\1010\2020     OPERS\4A09
XBACKPAGE        \0808\10080000C908-R\2207BASIC\2E0F\1414EXTERNS\5807
XBACKSEARCH        \0808\100600042C98-R\2007\2D14EXTERNS\4207
XBACKSPC        \0808\1009000057A4-R\2307MAIN\2E10BIND\4210INPUT\1411SER\1509
X        \0808\1010\2020     ISEARCH\4C0DTERMIO\5F08
XBACKUNDO        \0808\10080004826C-R\2207\2D14EXTERNS\4407
XBACKVIWORD        \0808\10060004C04C-R\2007\2B14EXTERNS\4207
XBACKWORD        \0808\10080004C0F0-R\2207\2D14EXTERNS\440DINSERT\570E\690E
XBCLEAR        \0808\100A0001328C-\2408BUFFE\310F\1414EXEC\5710FILE\6B0A
X        \0808\1010\2020     FILEC\4A0FONELINER\610CRANDOM\7308
XBCSRCH        \0808\100A00013CEC-R\2407\3014EXTERNS\4607
XBCSRCH_TO        \0808\100700013D84-R\2107CSRCH\2D0FEXTERNS\4307
XBFIND        \0808\100B0001306C-R\2507BUFFE\0D08\1408\4413\2814EXEC\6C0A
X        \0808\1010\2020     FILE\1414C\2811NDERR\7407
X        \0808\1010\2020     HISTORY\4C0DMAIN\5D10MSGS\710A
X        \0808\1010\2020     ONELINER\4D0CRANDOM\5F0ESPAWN\7209
X        \0808\1010\2020     TAGS\4910WINDOW\5F08
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   27
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XBHEADP        \0808\100A000057A8-R    WK-MAIN\2F10BUFFER    \490AFILE\570D
V\3C11
X        \0808\1010\2020     MODES\4A09
XBINDINGLIST_BUFNAME             00000AE4-R\1707MAIN\220D   BIND\360A
XBINDKEY        \0808\10090000D8C4-R\2307BIND\2E10EXTERNS\4507
XBKTOSHELL        \0808\100700045498-R\2107SPAWN\2D0FEXTERNS\4307
XBLANK_REGION        \0808    00041C94-R\1E07\2B14OPERS\3E09
XBMINIP        \0808\100A000057AC-R    WK-MAIN\2F10BIND\1411UFFER    \5D0AINPUT
V\6C09
X        \0808\1010\2020  WK-MAIN\4910UNDO\2B11INDOW\7308
XBOTTOMLEFT        \0808\1006000185D0-R\2007DISPLAY\2E07
XBP2ANY_WP        \0808\1007000112A4-R\2107BUFFE\0D08\3507DISPLAY\430DEXEC\5410
VMAIN\680A
X        \0808\1010\2020     MSGS\4910ONELINER\610CRANDOM\7308
XBP2READIN        \0808\100700027514-R\2107FILE\2C10BUFFE\2108`20
XBPRINTF        \0808\100900018A10-R\2307DISPLAY\310DBIND\4210BUFFE\3508\5F07EV
VAL\6A0A
X        \0808\1010\2020     LINE\4910MAIN\1412P\700B
X        \0808\1010\2020     MODES\4A0FONELINER\610CTAG\270B
XBPUTC        \0808\100B000189EC-R\2507DISPLAY\330DBUFFE\2108\281BLINE\6C0A
X        \0808\1010\2020     MAIN\1412P\2812ODES\7209
X        \0808\1010\2020     MSGS\490A
XBSIZES        \0808\100A000133E4-R\2407BUFFE\0D08\1414\4C07FILE\5710FILEC\6C09
V
X        \0808\1010\2020     FINDERR\4C0DMAIN\5D10MODES\7209
X        \0808\1010\2020     RANDOM\4B0ESELECT\5F0ETAGS\710A
X        \0808\1010\2020     WINDOW\4B08
XBSTORE        \0808\100A000057B0-R    WK-MAIN\2F10EXEC\430D\2811
XBTREE_DELETE        \0808    00010460-R\1E07BTREE\2A0FBIND\3D10\280E
XBTREE_FREEUP        \0808    00010A74-R\1E07BTREE\2A0FTAGS\3D0A
XBTREE_INSERT        \0808    00010190-R\1E07BTREE\2A0FBIND\3D10TAGS\510A
XBTREE_PARRAY        \0808    00010A10-R\1E07BTREE\2A0FBIND\3D10TAGS\510A
XBTREE_PMATCH        \0808    000108C8-R\1E07BTREE\2A0FBIND\3D10\280E
XBTREE_PRINTF        \0808    000108B0-R\1E07BTREE\2A09
XBTREE_SEARCH        \0808    00010770-R\1E07BTREE\2A0FBIND\3D0A
XBUFFERLIST_BUFNAME        \080600000AF4-R\1807MAIN\230E  \4506\3908
XBUFHOOK        \0808\1009000057B4-R    WK-MAIN\2E10BUFFER    \480AEVAL\560D
V\3C11
XBUILD_NAMEBST        \0808   00010144-R\1D07BIND\2810MAIN\3C0A
XB_VALNAMES        \0808\100600000B04-R\2007MAIN\2B10BUFFE\2108\2808OD\540B
XCALLEDBEFORE        \0808    000057CC-R    WK-MAIN\2910EXEC\3D10FILE\5110GLOBA
VLS\6807
X        \0808\1010\2020  WK-MAIN\4910ONELINER\6106
XCALL_CMDFUNC        \0808    0001E180-R\1E07EXE\2911GLOBALS\4007
XCATCHINTR        \0808\100700009C6C-\2108MAIN\2C10\140E
XCATNAP        \0808\100A0003D8FC-R\2407RANDOM\310EFENCES\450EM\560D
XCBUF1        \0808\100B0001FAB4-R\2507EXEC\3010EXTERNS\4707
XCBUF10        \0808\100A0001FBB0-R\2407EXEC\2F10EXTERNS\4607
XCBUF11        \0808\100A0001FBCC-R\2407EXEC\2F10EXTERNS\4607
XCBUF12        \0808\100A0001FBE8-R\2407EXEC\2F10EXTERNS\4607
XCBUF13        \0808\100A0001FC04-R\2407EXEC\2F10EXTERNS\4607
XCBUF14        \0808\100A0001FC20-R\2407EXEC\2F10EXTERNS\4607
XCBUF15        \0808\100A0001FC3C-R\2407EXEC\2F10EXTERNS\4607
XCBUF16        \0808\100A0001FC58-R\2407EXEC\2F10EXTERNS\4607
XCBUF17        \0808\100A0001FC74-R\2407EXEC\2F10EXTERNS\4607
XCBUF18        \0808\100A0001FC90-R\2407EXEC\2F10EXTERNS\4607
XCBUF19        \0808\100A0001FCAC-R\2407EXEC\2F10EXTERNS\4607
XCBUF2        \0808\100B0001FAD0-R\2507EXEC\3010EXTERNS\4707
XCBUF20        \0808\100A0001FCC8-R\2407EXEC\2F10EXTERNS\4607
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   28
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XCBUF21        \0808\100A0001FCE4-R\2407EXEC\2F10EXTERNS\4607
XCBUF22        \0808\100A0001FD00-R\2407EXEC\2F10EXTERNS\4607
XCBUF23        \0808\100A0001FD1C-R\2407EXEC\2F10EXTERNS\4607
XCBUF24        \0808\100A0001FD38-R\2407EXEC\2F10EXTERNS\4607
XCBUF25        \0808\100A0001FD54-R\2407EXEC\2F10EXTERNS\4607
XCBUF26        \0808\100A0001FD70-R\2407EXEC\2F10EXTERNS\4607
XCBUF27        \0808\100A0001FD8C-R\2407EXEC\2F10EXTERNS\4607
XCBUF28        \0808\100A0001FDA8-R\2407EXEC\2F10EXTERNS\4607
XCBUF29        \0808\100A0001FDC4-R\2407EXEC\2F10EXTERNS\4607
XCBUF3        \0808\100B0001FAEC-R\2507EXEC\3010EXTERNS\4707
XCBUF30        \0808\100A0001FDE0-R\2407EXEC\2F10EXTERNS\4607
XCBUF31        \0808\100A0001FDFC-R\2407EXEC\2F10EXTERNS\4607
XCBUF32        \0808\100A0001FE18-R\2407EXEC\2F10EXTERNS\4607
XCBUF33        \0808\100A0001FE34-R\2407EXEC\2F10EXTERNS\4607
XCBUF34        \0808\100A0001FE50-R\2407EXEC\2F10EXTERNS\4607
XCBUF35        \0808\100A0001FE6C-R\2407EXEC\2F10EXTERNS\4607
XCBUF36        \0808\100A0001FE88-R\2407EXEC\2F10EXTERNS\4607
XCBUF37        \0808\100A0001FEA4-R\2407EXEC\2F10EXTERNS\4607
XCBUF38        \0808\100A0001FEC0-R\2407EXEC\2F10EXTERNS\4607
XCBUF39        \0808\100A0001FEDC-R\2407EXEC\2F10EXTERNS\4607
XCBUF4        \0808\100B0001FB08-R\2507EXEC\3010EXTERNS\4707
XCBUF40        \0808\100A0001FEF8-R\2407EXEC\2F10EXTERNS\4607
XCBUF5        \0808\100B0001FB24-R\2507EXEC\3010EXTERNS\4707
XCBUF6        \0808\100B0001FB40-R\2507EXEC\3010EXTERNS\4707
XCBUF7        \0808\100B0001FB5C-R\2507EXEC\3010EXTERNS\4707
XCBUF8        \0808\100B0001FB78-R\2507EXEC\3010EXTERNS\4707
XCBUF9        \0808\100B0001FB94-R\2507EXEC\3010EXTERNS\4707
XCD        \0808\100E0003D9CC-R\2807RANDOM\350EEXTERNS\4A07
XCDHOOK        \0808\100A000057D0-R    WK-MAIN\2F10EVAL\430D\2817RANDOM\6D08
XCHARINIT        \0808\10080000A3C8-R\2207MAIN\2D10\1414MODES\5609
XCHECK_MODTIME        \0808   00026608-R\1D07FIL\2811BUFFE\2108`20
XCHECK_VISIBLE_MODTIMES          00026640-R\1407FILE\1F0A\2906SPAWN\3409
XCHGCHAR        \0808\10090003D874-\2308RANDOM\300EEXTERNS\4507
XCHGD_AUTOBUF        \0808    00037C5C-R\1E07MODES\2A0FMAIN\3D0A
XCHGD_BUFFER        \0808     00037C74-\1F08MODES\2B0FMAIN\3E0A
XCHGD_CHARSET        \0808    00037CAC-R\1E07MODES\2A0FMAIN\3D0A
XCHGD_DISABLED        \0808   00037CD4-R\1D07MODES\2909
XCHGD_FENCES        \0808     00037CF0-R\1F07MOD\2B11MAIN\3E0A
XCHGD_HILITE        \0808     00037E40-R\1F07MODES\2B0FMAIN\3E0A
XCHGD_MAJOR        \0808\100600037D2C-\2008MODES\2C0FMAIN\3F0A
XCHGD_MAJOR_W        \0808    00037D78-R\1E07MODES\2A0FMAIN\3D10\280E
XCHGD_STATUS        \0808     00037E00-R\1F07MODE\2B10MAIN\3E0A
XCHGD_WINDOW        \0808     00037E1C-R\1F07MODES\2B0FMAIN\3E0A
XCHGD_XTERM        \0808\100600037E38-R\2007MODES\2C0FMAIN\3F0A
XCHGLINE        \0808\10090003D850-R\2307RANDOM\300EEXTERNS\4507
XCHGTOEOL        \0808\10080003D7EC-R\2207RANDOM\2F0EEXTERNS\4407
XCHG_BUFF        \0808\10080001345C-R\2207BUFFE\0D08\3607FILE\4110LIN\1411RANDO
VM\6B08
X        \0808\1010\2020     REGION\4B0EUNDO\5D0A
XCH_FNAME        \0808\10080003DCA0-R\2207RANDOM\2F0EBUFFE\2108\4A07EVAL\5510FI
VL\690B
X        \0808\1010\2020     RANDOM\4B0ESPAWN\5E09
XCLEAR_MATCH_ATTRS        \0807000436A4-R\1907SEARCH\260EEXTERN\3B0E\280E
XCLEXEC        \0808\100A000057E8-R    WK-MAIN\2F10BASI\4410BIND\2811UFFER  `20
V    `20
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   29
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
X        \0808\1010\2020     CSRCH\4A0FEVAL\5D10EXEC\710A
X        \0808\1010\2020     FILE\1414C\5E0FHISTORY\7407
X        \0808\1010\2020     INPUT\1411SER\150FISEARCH\7407
X        \0808\1010\2020     LINE\490DWK-MAIN\5D10MAP\700B
X        \0808\1010\2020     MODES\4A0FOPER\1410TAG\270B
X        \0808\1010\2020     WINDOW\4B08
XCLOBBER_SAVE_CURBP        \080600043588-R\1807SEARCH\250EBUFFER\3908
XCLRMES        \0808\100A0003D898-R\2407RANDOM\310EEXTERN\4608
XCMA$TIS_ERRNO_GET_ADDR          0004D248-RX\1506\3108SH\260ADISPLAY\360A   FIL
VEIO\4908
XCMDLINETAG        \0808\100600046070-R\2007TAGS\2B10MAIN\3F0A
XCMDSTATUS        \0808\1007000057EC-R\2107MAIN\2C10EVAL\1411XEC\540A
XCNTL_A        \0808\100A000057F0-R\2407MAIN\2F10BIND\4310INPUT\5809
XCNTL_A_FUNC        \0808     0000A2AC-R\1F07MAIN\2A10EXTERNS\4107
XCNTL_X        \0808\100A000057F4-R\2407MAIN\2F10BIND\4310INPUT\5809
XCNTL_X_FUNC        \0808     0000A2B4-R\1F07MAIN\2A10EXTERNS\4107
XCOL2OFFS        \0808\100800016A4C-R\2207DISPLAY\300D\140E
XCOL_LIMIT        \0808\10070001460C-R\2107DISPLAY\2F0D\140E
XCOMPLETIONS_BUFNAME             00000D50-R\1707MAIN\220D   BIND\360A
XCOMP_ERR_EXPS        \0808   0002B774-R\1D07FINDERR\2B0DEXTERN\3F08
XCONSEARCH        \0808\100700043240-R\2107\2E14EXTERNS\4307
XCOPY_FOR_UNDO        \0808   00047D64-R\1D07\2814LINE\3C10RANDOM\140FEGION
V\6608
X        \0808\1010\2020     UNDO\490A
XCOPY_MVALS        \0808\10060003686C-R\2007MODE\2C10DISPLAY\420DWINDOW\5508
XCOPY_TRAITS        \0808     0004AFA4-R\1F07WINDOW\2C0EBUFFE\2108\4707FILE
V\520A
XCRYPTFLAG        \0808\1007000057F8-R\2107MAIN\2C10FILE\1414IO\5608
XCRYPTKEY        \0808\1008000057FC-R\2207MAIN\2D10BUFFE\2108`20
XCRYPTREGION        \0808     00041D48-R\1F07\2C14OPERS\3F09
XCURBP        \0808\100B00005800-R    WK-MAIN\3010BASIC\1410IND\2811UFFER   `20
V   `20
X        \0808\1010\2020     CRYPT\4A0FDISPLAY\600DEVAL\710A
X        \0808\1010\2020     EXEC\4910FENCES\140FILE\710A
X        \0808\1010\2020     FILEC\1411NDERR\600DGLOBALS\7407
X        \0808\1010\2020     INPUT\1411SER\150FISEARCH\7407
X        \0808\1010\2020     LINE\490DWK-MAIN\5D10MODES\7209
X        \0808\1010\2020     MSGS\4910ONELINER\140DPER\290A
X        \0808\1010\2020     RANDOM\140FEGION\5F0ESEARCH\7308
X        \0808\1010\2020     SELECT\140FPAWN\5E0FTAGS\710A
X        \0808\1010\2020     UNDO\4910WINDOW\140FORD\710A
XCURCOL        \0808\100A00005804-R    WK-MAIN\2F10DISPLAY\460A\2811
XCURGOAL        \0808\100900005808-R\2307MAIN\2E10BASIC\1410UFFE\3508\5F07DISPL
VAY\6D07
X        \0808\1010\2020     EXEC\4910INSERT\5F0EWINDOW\7308
XCURRENT_DIRECTORY        \08070003D968-R\1907RANDOM\260EBIND\380F BUFFE\3508
V\5507EVAL\600A
X        \0808\1010\2020     FILEC\4A0FPATH\5D0A
XCURRENT_MODENAME        \0808000317C0-R\1A07INSERT\270EEVAL\390A
XCURROW        \0808\100A0000580C-R    WK-MAIN\2F10DISPLAY\460A\2811
XCURTABVAL        \0808\100700005810-R    WK-MAIN\2C10BASIC\1410UFFER    \5A0AD
VISPLAY\6B07
X        \0808\1010\2020     INSERT\4B0ELINE\5D0DWK-MAIN\710A
X        \0808\1010\2020     MODES\4A0FREGION\5F08
XCURWP        \0808\100B00005814-R    WK-MAIN\3010BASIC\1410IND\2811UFFER   `20
V   `20
X        \0808\1010\2020     CRYPT\1410SRCH\5E0FDISPLAY\7407
X        \0808\1010\2020     EVAL\1411XEC\5D10FENCES\7308
X        \0808\1010\2020     FILE\1412NDERR\600DGLOBALS\7407
X        \0808\1010\2020     HISTORY\4C0DINPUT\5E0FINSER\1509
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   30
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
X        \0808\1010\2020     ISEARCH\4C0DLINE\5D0DWK-MAIN\710A
X        \0808\1010\2020     MAP\1412ODES\2810SG\130B
X        \0808\1010\2020     ONELINER\140DPERS\5E0FRANDOM\7308
X        \0808\1010\2020     REGION\4B0ESEARCH\1410LECT\7308
X        \0808\1010\2020     TAGS\4910UNDO\5D10WINDOW\7308
X        \0808\1010\2020     WORD\1414MOV\6007
XDBGWRITE        \0808\1008000187C0-R\2207DISPLAY\300DMAP\400B
XDECC$ATOI        \0808\10070004D278-RX\2206DECC$SHR\300CEVAL\4010EXEC\5410FIND
VER\3B08
X        \0808\1010\2020     MAIN\4910TERMIO\5F08
XDECC$CALLOC        \0808     0004D28C-RX\2006DECC$SHR\2E0CBIND\3E10BUFFE\260D
V  DISPLAY\6907
X        \0808\1010\2020     FILEC\4A0FMAP\5C11MODES\7209
X        \0808\1010\2020     TAGS\4910VMS2UNIX\610CWINDOW\7308
XDECC$CFREE        \0808\10060004D280-RX\2106DECC$SHR\2F0CVMS2UNI\2207
XDECC$CHDIR        \0808\10060004D270-RX\2106DECC$SH\2F0DRANDOM\4108
XDECC$CLOSE        \0808\10060004D2A8-RX\2106DECC$SHR\2F0CFILEIO\410EMAIN\5310P
VATH\670A
X        \0808\1010\2020     VMSPIPE\4C07
XDECC$CREAT        \0808\10060004D2B4-RX\2106DECC$SHR\2F0CFILEIO\4108
XDECC$CTIME        \0808\10060004D274-RX\2106DECC$SHR\2F0CVERSION\4207
XDECC$DELETE        \0808     0004D260-RX\2006DECC$SHR\2E0CSPAWN\3F09
XDECC$DFPRINTF        \0808   0004D258-RX\1E06DECC$SHR\2C0CFILE\3C10VERSION
V\5307
XDECC$DPRINTF        \0808    0004D254-RX\1F06DECC$SHR\2D0CMAIN\3D10VMSVT\5209
V
XDECC$DUP        \0808\10080004D2B8-RX\2306DECC$SHR\310CMAIN\410A
XDECC$EXIT        \0808\10070004D2A0-RX\2206DECC$SHR\300CMAIN\4010VERSIO\170EWI
VNDOW\6A08
XDECC$FCLOSE        \0808     0004D2A4-RX\2006DECC$SHR\2E0CFILEIO\4008
XDECC$FDOPEN        \0808     0004D29C-RX\2006DECC$SHR\2E0CFILEIO\400EMAI\520B
V
XDECC$FFLUSH        \0808     0004D2BC-RX\2006DECC$SHR\2E0CDUMBTERM\420CVMSPIPE
V\5507
XDECC$FGETC        \0808\10060004D2CC-RX\2106DECC$SHR\2F0CFILEIO\4108
XDECC$FGETNAME        \0808   0004D298-RX\1E06DECC$SHR\2C0CFIL\3C11FILEIO\5208
V
XDECC$FOPEN        \0808\10060004D2AC-RX\2106DECC$SHR\2F0CFILEIO\4108
XDECC$FPUTC        \0808\10060004D2C4-RX\2106DECC$SHR\2F0CFILEIO\4108
XDECC$FREE        \0808\10070004D27C-RX\2206DECC$SHR\300CBIND\4010BUFFE\260D  D
VISPLAY\6B07
X        \0808\1010\2020     EVAL\1411XEC\5D10FILE\710A
X        \0808\1010\2020     FILEC\1413IO\2810NDERR\7407
X        \0808\1010\2020     GLOB\4910INPUT\1410SEARCH\7407
X        \0808\1010\2020     ITBUFF\4B0ELINE\5D10MAIN\710A
X        \0808\1010\2020     MAP\1412ODES\5E0FONELINER\7506
X        \0808\1010\2020     RANDOM\140FEGEXP\5F0ESEARCH\7308
X        \0808\1010\2020     SELECT\4B0ETAGS\5D10TBUFF\7209
X        \0808\1010\2020     WINDOW\4B08
XDECC$FSEEK        \0808\10060004D2D4-RX\2106DECC$SHR\2F0CFILEIO\4108
XDECC$FSTAT        \0808\10060004D2DC-RX\2106DECC$SHR\2F0CFILEIO\4108
XDECC$FWRITE        \0808     0004D2E0-RX\2006DECC$SHR\2E0CVMSPIP\4108
XDECC$GA_ENVIRON        \0808 0004D348-RX\1C06DECC$SHR\2A0CFILEC\3B09
XDECC$GA_RMS_FAB        \0808 0004D344-RX\1C06DECC$SHR\2A0CPATH\3A10VMS2UNI
V\3607
XDECC$GA_RMS_NAM        \0808 0004D340-RX\1C06DECC$SHR\2A0CPATH\3A10VMS2UNI
V\3607
XDECC$GA_STDERR        \0808  0004D33C-RX\1D06DECC$SH\2B0DFILE\3B10VERSION\5207
V
XDECC$GA_STDIN        \0808   0004D338-RX\1E06DECC$SHR\2C0CMA\3C0C
XDECC$GA_STDOUT        \0808  0004D334-RX\1D06DECC$SHR\2B0CDUMBTERM\3F0CMAIN
V\4F0A
XDECC$GETCHAR        \0808    0004D2C8-RX\1F06DECC$SH\2D0DDUMBTERM\4106
XDECC$GETCWD        \0808     0004D26C-RX\2006DECC$SHR\2E0CRANDOM\400EVMS2UNI
V\3607
XDECC$GETENV        \0808     0004D2E4-RX\2006DECC$SHR\2E0CBIND\3E10EVAL\5210MA
VIN\660A
X        \0808\1010\2020     TERMIO\4B0EVMS2UNIX\6106
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   31
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XDECC$GETNAME        \0808    0004D294-RX\1F06DECC$SHR\2D0CPATH\3D0A
XDECC$ISATTY        \0808     0004D290-RX\2006DECC$SHR\2E0CMAIN\3E0A
XDECC$LONGJMP        \0808    0004D2F0-RX\1F06DECC$SHR\2D0CMAIN\3D0A
XDECC$MAIN_ARGS        \0808  0004D2F4-RX\1D06DECC$SHR\2B0CMAIN\3B0A
XDECC$MALLOC        \0808     0004D288-RX\2006DECC$SHR\2E0CBASI\3F10BIND\5210BT
VREE\6709
X        \0808\1010\2020     DISPLAY\4C0DEVAL\5D10EXEC\710A
X        \0808\1010\2020     FILE\1414C\2813IO\7308
X        \0808\1010\2020     FINDERR\4C0DGLOB\5D10INPUT\7209
X        \0808\1010\2020     ITBUFF\4B0ELINE\5D10MAIN\710A
+-+-+-+-+-+-+-+-  END  OF PART 118 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 119 -+-+-+-+-+-+-+-+
X        \0808\1010\2020     MAP\1412ODES\5E0FONELINER\7506
X        \0808\1010\2020     REGEXP\4B0ESEARCH\1410LECT\7308
X        \0808\1010\2020     TAGS\1411BUFF\5E0FUNDO\710A
XDECC$MEMCMP        \0808     0004D300-RX\2006DECC$SHR\2E0CDISPLAY\410DEXEC
V\5210HISTOR\2808
X        \0808\1010\2020     UNDO\4910WORD\5D0A
XDECC$MEMCPY        \0808     0004D2F8-RX\2006DECC$SHR\2E0CBUFFE\120D  DISPLA
V\550EFILEIO\6808
X        \0808\1010\2020     INPUT\4A0FLINE\5D10MAP\700B
X        \0808\1010\2020     MODES\4A0FONELINER\610CUNDO\710A
XDECC$MEMSET        \0808     0004D2FC-RX\2006DECC$SHR\2E0CDISPLAY\410DFINDER
V\270D LINE\660A
X        \0808\1010\2020     MAIN\1411ODES\5E09
XDECC$MKDIR        \0808\10060004D268-RX\2106DECC$SH\2F0DFILE\3F0A
XDECC$MKTEMP        \0808     0004D264-RX\2006DECC$SHR\2E0CFILE\3E10VMS2UNI
V\3607
XDECC$OPEN        \0808\10070004D2B0-RX\2206DECC$SHR\300CFILEIO\420EMAI\5411PAT
VH\680A
X        \0808\1010\2020     VMSPIPE\4C07
XDECC$PUTCHAR        \0808    0004D2C0-RX\1F06DECC$SH\2D0DDUMBTERM\4106
XDECC$QSORT        \0808\10060004D304-RX\2106DECC$SHR\2F0CFILEC\4009
XDECC$READ        \0808\10070004D2D8-RX\2206DECC$SHR\300CFILEIO\4208
XDECC$REALLOC        \0808    0004D284-RX\1F06DECC$SHR\2D0CDISPLAY\400DEXEC
V\5110FILE\650A
X        \0808\1010\2020     FILEC\4A0FGLOB\5D10ITBUFF\7308
X        \0808\1010\2020     MAP\1412ODES\5E0FTBUFF\7209
XDECC$REWIND        \0808     0004D2D0-RX\2006DECC$SHR\2E0CVMSPIPE\4107
XDECC$SETJMP        \0808     0004D2EC-RX\2006\3106HR\2E0CINPUT\3F09
XDECC$SIGNAL        \0808     0004D2E8-RX\2006\3106HR\2E0CMAIN\3E0A
XDECC$STAT        \0808\10070004D308-RX\2206\3106HR\300CFILE\4010FILEIO\560EPAT
VH\680A
XDECC$STRCAT        \0808     0004D30C-RX\2006\3106HR\2E0CBIND\3E10BUFFE\260D
V  EVAL\660A
X        \0808\1010\2020     FILE\1414C\5E0FINPUT\7209
X        \0808\1010\2020     PATH\4910VERSION\140EMS2UNIX\7506
X        \0808\1010\2020     VMSPIPE\4C07
XDECC$STRCHR        \0808     0004D310-RX\2006\3106\2E0EDISPLAY\410DEXEC\5210FE
VNCES\6808
X        \0808\1010\2020     FILE\1414C\5E0FGLOB\710A
X        \0808\1010\2020     INPUT\4A0FPATH\5D10RANDOM\7308
X        \0808\1010\2020     REGEXP\4B0EVMS2UNIX\610CWINDOW\7308
XDECC$STRCMP        \0808     0004D314-RX\2006\3106HR\2E0CBIND\3E10BTREE\1410UF
VFE\3A09
X        \0808\1010\2020     DISPLAY\4C0DEVAL\5D10FILE\710A
X        \0808\1010\2020     FILEC\1411NDERR\600DINSERT\7308
X        \0808\1010\2020     MAIN\1412P\2812ODES\7209
X        \0808\1010\2020     OPERS\4A0FPATH\5D10RANDOM\7308
X        \0808\1010\2020     REGION\4B0ESEARCH\5F0EVMS2UNIX\7506
X        \0808\1010\2020     WORD\490A
XDECC$STRCPY        \0808     0004D318-RX\2006\3106HR\2E0CBIND\3E10BUFFE\260D
V  CRYPT\6709
X        \0808\1010\2020     DISPLAY\4C0DEVAL\5D10EXEC\710A
X        \0808\1010\2020     FILE\1414C\2813IO\7308
X        \0808\1010\2020     FINDERR\4C0DGLOB\5D10INPUT\7209
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   32
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
X        \0808\1010\2020     MAIN\1411ODES\5E0FONELINER\7506
X        \0808\1010\2020     PATH\4910RANDOM\140FEGION\7308
X        \0808\1010\2020     SEARCH\140FPAWN\5E0FTAGS\710A
X        \0808\1010\2020     VMS2UNIX\140FPIPE\2810VT\7209
XDECC$STRCSPN        \0808    0004D31C-RX\1F06\3106HR\2D0CREGEXP\3F08
XDECC$STRLEN        \0808     0004D320-RX\2006\3106HR\2E0CBIND\3E10BTREE\1410UF
VFE\3A09
X        \0808\1010\2020     CRYPT\4A0FDISPLAY\600DEVAL\710A
X        \0808\1010\2020     EXEC\4910FILE\1414\290A
X        \0808\1010\2020     FINDERR\4C0DGLOB\5D10INPUT\7209
X        \0808\1010\2020     ISEARCH\4C0DMAIN\5D10MODES\7209
X        \0808\1010\2020     PATH\4910RANDOM\140FEGEXP\7308
X        \0808\1010\2020     REGION\4B0ESPAW\130F TAGS\710A
X        \0808\1010\2020     TBUFF\1410ERMIO\5F0EVERSION\7407
X        \0808\1010\2020     VMS2UNIX\140FPIPE\2810VT\7209
XDECC$STRNCMP        \0808    0004D324-RX\1F06\3106HR\2D0CBIND\3D10BTREE\520FEV
VAL\650A
X        \0808\1010\2020     FILE\4910GLOB\5D10MODES\7209
X        \0808\1010\2020     PATH\4910REGEXP\5F0ETAGS\710A
X        \0808\1010\2020     VMS2UNIX\4D06
XDECC$STRNCPY        \0808    0004D328-RX\1F06\3106HR\2D0CBIND\3D10BUFFE\260D
V  DISPLA\6808
X        \0808\1010\2020     EVAL\1411XEC\5D10FIL\150B
X        \0808\1010\2020     GLOB\4910MAIN\5D10SEARCH\7308
X        \0808\1010\2020     SPAWN\4A09
XDECC$STRRCHR        \0808    0004D32C-RX\1F06\3106\2D0EFILEC\3E0FGLOB\5110PATH
V\650A
X        \0808\1010\2020     VMS2UNIX\4D06
XDECC$STRTOL        \0808     0004D330-RX\2006\3106HR\2E0CEVA\3E11MODES\530FVMS
V2UNI\4A07
XDECC$TMPFILE        \0808    0004D25C-RX\1F06DECC$SHR\2D0CVMSPIP\4008
XDEFINE_MODE        \0808     00039228-R\1F07MODES\2B0FEXTERN\1608
XDEFINE_SUBMODE        \0808  00039718-R\1C07MODES\280FEXTERN\1608
XDELETE_NAMEBST        \0808  0000FF88-R\1C07BIND\2710\1414BUFFE\3508`20
XDELGLOBMODE        \0808     00037C44-R\1F07MODES\2B0FEXTERN\1608
XDELINK_BP        \0808\1007000121AC-R\2107BUFFE\0D08\1414\4907WINDOW\5608
XDELLOCMODE        \0808\100600037C18-R\2007MODES\2C0FEXTERN\1608
XDELTOEOL        \0808\10080003D7B0-R\2207RANDOM\2F0EEXTERNS\440DLINE\550A
XDELWIND        \0808\10090004AE44-R\2307WINDOW\300EEXTERNS\4507
XDELWP        \0808\100B0004AE60-R\2507WINDOW\320EBUFFE\2108\2815
XDESAPRO        \0808\10090000DF44-R\2307BIND\2E10EXTERNS\4507
XDESBIND        \0808\10090000DEA0-R\2307\2E14EXTERNS\4507
XDESFUNC        \0808\10090000DF98-R\2307BIND\2E10EXTERNS\4507
XDESKEY        \0808\100A0000E0E4-R\2407BIND\2F10EXTERNS\4607
XDESMOTIONS        \0808\10060000DED4-R\2007BIND\2B10EXTER\4209
XDESOPERS        \0808\10080000DF0C-R\2207BIND\2D10EXTERN\4408
XDESPRINT        \0808\10080000A3A4-R\2207MAIN\2D10EXTERNS\4407
XDETABLINE        \0808\100700041660-R\2107REGION\2E0E\140E
XDETAB_REGION        \0808    0004175C-R\1E07\2B14OPERS\3E09
XDIRCOMPLETION_BUFNAME           00000D60-R\1507MAIN\200B     FILEC\3509
XDISCMD        \0808\100A00005818-R\2407MAIN\2F10BIN\4311DISPLAY\5A0DEVAL\6B0A
V
X        \0808\1010\2020     EXEC\4910SPAWN\5E09
XDISINP        \0808\100A0000581C-R\2407MAIN\2F10BIND\4310CRYPT\580FEVAL\6B0A
X        \0808\1010\2020     HISTORY\4C0DINPUT\5E09
XDOBUF        \0808\100B0001F730-R\2507EXEC\3010\1414MAIN\580A
XDOCMD        \0808\100B0001DFF0-R\2507EXEC\3010\1414SELECT\5A08
XDOFILE        \0808\100A0001F920-R\2407EXEC\2F10\140E
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   33
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XDOGLOB        \0808\100A0002BC98-R\2407\2F14EVAL\4310FILEC\580FRANDOM\6D08
X        \0808\1010\2020     TAGS\490A
XDOINGOPCMD        \0808\100600005820-R    WK-MAIN\2B10BASIC\400FCSRCH\540FEXE
V\270B
X        \0808\1010\2020     FENCES\4B0BWK-MAIN\5D10OPER\270A
X        \0808\1010\2020     SELECT\4B0EUNDO\5D10WORDMOV\7407
XDOINGSWEEP        \0808\100600005824-R    WK-MAIN\2B10CSRCH\400FEXEC\5310FENCE
VS\6908
X        \0808\1010\2020  WK-MAIN\4910SELECT\2B0FORDMOV\7407
XDOTCMD        \0808\100A00005828-R    WK-MAIN\2F10INPUT\1411SER\150C\3C11
XDOTCMDARG        \0808\10070000582C-R\2107MAIN\2C10EXEC\4010INPUT\1411SER\1509
V
XDOTCMDBEGIN        \0808     0002F2CC-R\1F07INPUT\2B0FMA\3E0C
XDOTCMDCNT        \0808\100700005830-R    WK-MAIN\2C10INPU\4110INSER\560C\3C11
V
XDOTCMDFINISH        \0808    0002F338-R\1E07INPUT\2A0FMAIN\3D0A
XDOTCMDKREG        \0808\100600005834-R    WK-MAIN\2B10EXEC\3F10INPUT\540FLINE
V\670A
X        \0808\1010\2020  WK-MAIN\490A
XDOTCMDMODE        \0808\100600005838-R\2007MAIN\2B10EXEC\3F10INPUT\1411SER
V\1509
X        \0808\1010\2020     LINE\490A
XDOTCMDPLAY        \0808\10060002F3F0-R\2007INPUT\2C0FEXTERNS\4207
XDOTCMDREP        \0808\10070000583C-R    WK-MAIN\2C10INPUT\1411SER\150C\3C11
XDOTCMDSTOP        \0808\10060002F3DC-R\2007INPUT\2C0FEXEC\3F0A
XDO_REPEATS        \0808\100600009F0C-R\2007MAIN\2B10LINE\3F10OPER\5410SELECT
V\6908
XDO_REPORT        \0808\1007000325B0-R\2107LINE\2C10ONELINE\2308\1406PERS\550FR
VANDOM\6A08
X        \0808\1010\2020     REGION\4B08
XDO_SOURCE        \0808\10070001F7C0-R\2107EXEC\2C10MAIN\400A
XDUMB_TERM        \0808\100700005840-R\2107DUMB\3010MAIN\400A
XDUMPULINE        \0808\100700048AB4-R\2107UNDO\2C10\400E
XEDITC        \0808\100B000058B8-R\2507MAIN\3010BIND\4410INPUT\5909
XEDITHISTORY        \0808     0002CACC-R\1F07\2D14INPUT\3F09
XEND_NAMED_CMD        \0808   0001D1A8-R\1D07EXEC\2810FILE\3C10MAP\4F0B
XEND_STRING        \0808\10060002DD14-R\2007INPUT\2C0FEXEC\3F10MODES\5409
XENGL2FNC        \0808\10080000ED34-R\2207BIND\2D10EXE\4111GLOBALS\580DLINE
V\690A
X        \0808\1010\2020     OPERS\4A09
XENLARGEWIND        \0808     0004B260-R\1F07WINDOW\2C0EEXTERNS\410D\280E
XENTABLINE        \0808\10070004177C-R\2107REGION\2E0E\1414WORD\540A
XENTAB_REGION        \0808    00041874-R\1E07\2B14OPERS\3E09
XENVARS        \0808\100A00000D70-R\2407MAIN\2F10EVAL\430A
XEOFFLAG        \0808\1009000058BC-R    WK-MAIN\2E10FILEIO\440B\2811
XEOLEXIST        \0808\1008000058C0-R\2207MAIN\2D10DISPLAY\440DVMSV\560A
XEOL_HISTORY        \0808     0002E2E0-R\1F07INPUT\2B0FEXEC\3E10\2814MAP\650B
X        \0808\1010\2020     MODES\4A09
XEQ        \0808\100E00043944-R\2807SEARCH\350EEVAL\470A
XERRORM        \0808\100A000058C4-R\2407MAIN\2F10EVAL\4310MODES\5809
XERRORS_BUFNAME        \0808  00000E58-R\1C07MAIN\2710FINDERR\3E07
XESC_FUNC        \0808\10080000A1A0-R\2207MAIN\2D10EXTERNS\440DINPUT\5609
XEV_END_OF_CMD        \0808   000058CC-R    WK-MAIN\2810EVAL\1411XEC\500D\3C11
V
XEX        \0808\100E0000A290-R\2807MAIN\3310EXTERNS\4A07
XEXECBUF        \0808\10090001EBA8-R\2307EXEC\2E10EXTERNS\4507
XEXECFILE        \0808\10080001F828-R\2207EXEC\2D10EXTERNS\4407
XEXECHYPERCMD        \0808    00044E14-R\1E07SELECT\2B0EEXTERNS\4007
XEXECKREG        \0808\100800033FA8-R\2207LINE\2D10EXTERNS\4407
XEXECPROC        \0808\10080001EA9C-R\2207EXEC\2D10EXTERNS\4407
XEXECSTR        \0808\1009000058D0-R    WK-MAIN\2E10EVAL\1411XEC\5610INPUT\6B09
V
X        \0808\1010\2020  WK-MAIN\490A
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   34
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XEXECUTE        \0808\10090001E1D8-R\2307EXEC\2E10\1414INPUT\1411SER\1509
X        \0808\1010\2020     LINE\4910MAIN\5D10OPERS\7209
X        \0808\1010\2020     SELECT\4B08
XEXEC_PATHNAME        \0808   000058D4-R\1D07MAIN\2810BIND\3C0A
XEXITHOOK        \0808\1008000058D8-R    WK-MAIN\2D10EVAL\410D\2811
XEXPAND_WILD_ARGS        \08080002BAF0-R\1A07GLOB\2510MAIN\390A
XFALSEM        \0808\100A000058F0-R\2407MAIN\2F10EVAL\4310MODES\5809
XFCSRCH        \0808\100A00013CB8-R\2407\3014EXTERNS\4607
XFCSRCH_TO        \0808\100700013D20-R\2107CSRCH\2D0FEXTERNS\4307
XFFACCESS        \0808\10080002A52C-R\2207FILEIO\2F0EBIND\4110\280E
XFFCLOSE        \0808\10090002A784-R\2307FILEIO\300EFILE\4210MAIN\560A
XFFEXISTS        \0808\10080002A664-R\2207FILEIO\2F0EBUFFE\2108\280B\550A
XFFGETLINE        \0808\10070002A8F8-R\2107FILEIO\2E0EFILE\400A
XFFHASDATA        \0808\10070002AAB8-R\2107FILEIO\2E08
XFFP        \0808\100D000058F8-R    WK-MAIN\3210FILE\1414IO\5C0B\3C11
XFFPUTC        \0808\100A0002A8A4-R\2407FILEIO\310EFILE\430A
XFFPUTLINE        \0808\10070002A7C0-R\2107FILEIO\2E0EFILE\400A
XFFREAD        \0808\100A0002A6A4-R\2407FILEIO\310EFILE\430A
XFFREWIND        \0808\10080002A748-R\2207FILEIO\2F0EFILE\410A
XFFRONLY        \0808\10090002A5FC-R\2307FILEIO\300EFILE\420A
XFFROPEN        \0808\10090002A3B8-R\2307FILEIO\300EFILE\4210\280E
XFFSEEK        \0808\100A0002A6F8-R\2407FILEIO\310EFILE\430A
XFFSIZE        \0808\100A0002A634-R\2407FILEIO\310EFILE\430A
XFFWOPEN        \0808\10090002A49C-R\2307FILEIO\300EFILE\420A
XFILECOMPLETION_BUFNAME          00000E6C-R\1407MAIN\1F0A\2906BIND\1410FILEC
V\290FINPUT\5C09
XFILEC_EXPAND        \0808    0002A2E8-R\1E07FILEC\2A0FFILE\3D0A
XFILEFIND        \0808\1008000269B4-R\2207FILE\2D10EXTERNS\4407
XFILEISPIPE        \0808\1006000058FC-R    WK-MAIN\2B10FILE\1414IO\550B\3C11
XFILENAME        \0808\10080002875C-R\2207FILE\2D10EXTERNS\4407
XFILEREAD        \0808\10080002689C-R\2207FILE\2D10EXTERNS\4407
XFILESAVE        \0808\100800027F08-R\2207FILE\2D10BUFFE\2108\4A07EXTERNS\580DI
VNSERT\6B08
X        \0808\1010\2020     MAIN\490A
XFILEWRITE        \0808\100700027E40-R\2107FILE\2C10EXTERNS\4307
XFILE_MODIFIED        \0808   00026388-R\1D07FILE\2810VERSION\3F07
XFILTERREGION        \0808    000458B8-R\1E07SPAW\2A10OPERS\3E09
XFINDERR        \0808\10090002B268-\2308\3114EXTERNS\4507
XFINDERRBUF        \0808\10060002B6E4-R\2007\3107\2E0DEXTERNS\4207
XFINDPAT        \0808\100900043B64-R\2307SEARCH\300EBASIC\4309
XFIND_ALT        \0808\10080001142C-R\2207BUFFE\0D08\1414\4A07EVAL\5510INPU
V\6A0A
XFIND_ANY_BUFFER        \0808 00010F08-\1B08\2814\3C14FINDER\5108
XFIND_BP        \0808\100900010DC8-R\2307BUFFE\0D08\3707MAIN\420A
XFIND_B_FILE        \0808     00010DEC-R\1F07BUFFE\0D08\3307EXEC\3E10\520E
XFIND_B_HIST        \0808     00010E38-R\1F07BUFFE\0D08`20
XFIND_B_NAME        \0808     00013028-R\1F07BUFFE\0D08\1408IND\3E10\2814EVAL
V\660A
X        \0808\1010\2020     EXEC\4910FILE\1412NDERR\7407
X        \0808\1010\2020     HISTORY\4C0DMSGS\5D10TA\140C
XFIND_MODE        \0808\1007000373B8-R\2107MODES\2D0FEVAL\4010\280E
XFIND_RELEASE_ATTR        \080700043F24-\1908SELECT\260EREGION\3A08
XFIRSTBUFFER        \0808     00011898-\1F08\2C14EXTERNS\4107
XFIRSTCHAR        \0808\10070000BB74-\2108BASIC\2D0F\1414FENCES\560EINSERT\6A08
V
X        \0808\1010\2020     RANDOM\4B0EUNDO\5D0A
XFIRSTNONWHITE        \0808   0000BA90-R\1D07BASIC\290F\1414EXE\2710 EXTERNS
V\6707
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   35
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
X        \0808\1010\2020     FENCES\4B0EINSERT\5F0ELINE\710A
X        \0808\1010\2020     OPERS\4A0FREGION\5F0ETAG\270B
X        \0808\1010\2020     WORD\490A
XFISEARCH        \0808\100800031D50-R\2207\3014EXTERNS\4407
XFLEN        \0808\100C00005900-R    WK-MAI\3111FILEIO\470B\2811
XFLICKCODE        \0808\100700005904-R    WK-MAIN\2C10EVAL\400D\2811
XFLINE        \0808\100B00005908-R    WK-MAIN\3010FIL\4411FILEIO\5A0B\3C11
XFLIPCHAR        \0808\10080003D728-\2208RANDOM\2F0EEXTERNS\4407
XFLIPREGION        \0808\100600041CAC-R\2007\2D14OPERS\4009
XFLOOK        \0808\100B0000E804-R\2507BIND\3010\1414EVAL\1411XEC\6C0A
X        \0808\1010\2020     FILEC\4A0FMAIN\5D10TAGS\710A
X        \0808\1010\2020     VERSION\4C07
XFMATCH        \0808\100A00025E24-R\2407FENCES\310EINSERT\4508
XFMATCHINDENT        \0808    00025DC0-R\1E07FENCES\2B0EINSER\3F09
XFNC2KCOD        \0808\10080000EC70-R\2207BIN\2D11\1414INPUT\560FSELEC\1509
XFORCEBLANK        \0808\10060003D5A4-R\2007RANDOM\2D0EEXTERNS\4207
XFORMATREGION        \0808    0004CAF0-R\1E07WORD\2910OPERS\3E09
XFORWBLINE        \0808\10070000BCAC-R\2107BASIC\2D0FEXTERNS\430DRANDOM\5608
XFORWCHAR        \0808\10080000B464-\2208BASIC\2E0F\1414BIND\5510CSRCH\6A09
X        \0808\1010\2020     EXTERNS\4C0DFENCE\130E INSERT\7308
X        \0808\1010\2020     ISEARCH\4C0DLINE\5D10ONELINER\7506
X        \0808\1010\2020     SEARCH\4B0EWORD\5D0A
XFORWCHAR_TO_EOL        \0808 0000B534-R\1B07BASIC\270F\1414EXTERNS\510DRANDOM
V\6408
XFORWDELCHAR        \0808     0003D768-\1F08RANDOM\2C0EEXTERNS\4107
XFORWENDW        \0808\10080004BFA0-R\2207WORD\2D10EXTERNS\4407
XFORWHPAGE        \0808\10070000CA10-R\2107BASIC\2D0F\1414BIND\5410EXTERNS\6B07
V
X        \0808\1010\2020     WINDOW\4B08
XFORWHUNT        \0808\1008000429E0-R\2207SEARCH\2F0EEXTERNS\440DMAIN\5510\3C0E
V
XFORWLINE        \0808\10080000B964-R\2207BASIC\2E0F\1414BUFFE\3508\5E07EVAL
V\690A
X        \0808\1010\2020     EXEC\1412TERNS\600DHISTORY\7407
X        \0808\1010\2020     WORD\490A
XFORWPAGE        \0808\10080000C814-R\2207BASIC\2E0F\1414EXTERNS\5807
XFORWREDO        \0808\10080004830C-R\2207UN\2D12EXTERNS\4407
XFORWSEARCH        \0808\100600042664-R\2007\2D14EXTERNS\4207
XFORWVIENDW        \0808\10060004BEF4-R\2007WORD\2B10EXTERNS\4207
XFORWVIWORD        \0808\10060004BD9C-R\2007\2B14EXTERNS\4207
XFORWWORD        \0808\10080004BE48-R\2207\2D14EXTERNS\440DINSERT\570E\690E
XFREEUNDOSTACKS        \0808  00047F7C-R\1C07UNDO\2710BUFFE\2108\2815
XFREE_ATTRIB        \0808     00043E74-R\1F07SELECT\2C0EDISPLAY\410DLINE\520A
XFREE_ATTRIBS        \0808    00043E10-R\1E07SELECT\2B0EBUFFE\2108`20
XFREE_LOCAL_VALS        \0808 00036908-R\1B07MODE\2710BUFFE\2108\2815
XFSEARCH        \0808\100900042690-R\2307\3014GLOBALS\450D\580E
XFUNCS        \0808\100B00000E80-R\2507MAIN\3010EVAL\440A
XF_ABBREV        \0808\100800000FB0-R\2207EXTERNS\3007
XF_ALTBUFF        \0808\100700000FBC-R\2107EXTERNS\2F07
XF_APPEND        \0808\100800000FC8-R\2207EXTERNS\300DINPUT\4209
XF_APPENDEOL        \0808     00000FD4-R\1F07EXTERNS\2D0DINPUT\3F09
XF_APPSTRING        \0808     00000FE0-R\1F07EXTERNS\2D07
XF_BACKBLINE        \0808     00000FEC-R\1F07EXTERNS\2D07
XF_BACKCHAR        \0808\100600000FF8-\2008EXTERNS\2E07
XF_BACKCHAR_TO_BOL        \080700001004-R\1907EXTERNS\270DRANDOM\3A0ETERMIO
V\4E08
XF_BACKDELCHAR        \0808   00001010-\1D08EXTERNS\2B07
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   36
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XF_BACKHPAGE        \0808     0000101C-R\1F07EXTERNS\2D07
XF_BACKHUNT        \0808\100600001028-R\2007EXTERNS\2E07
XF_BACKLINE        \0808\100600001034-R\2007EXTERNS\2E07
XF_BACKPAGE        \0808\100600001040-R\2007EXTERNS\2E07
XF_BACKSEARCH        \0808    0000104C-R\1E07EXTERNS\2C07
XF_BACKUNDO        \0808\100600001058-R\2007EXTERNS\2E0DMAIN\3F0A
XF_BACKVIWORD        \0808    00001064-R\1E07EXTERNS\2C07
XF_BACKWORD        \0808\100600001070-R\2007EXTERNS\2E07
XF_BCSRCH        \0808\10080000107C-R\2207EXTERNS\3007
XF_BCSRCH_TO        \0808     00001088-R\1F07EXTERNS\2D07
XF_BINDKEY        \0808\100700001094-R\2107EXTERNS\2F07
XF_BKTOSHELL        \0808     000010A0-R\1F07EXTERNS\2D07
XF_CBUF1        \0808\1009000010AC-R\2307EXTERNS\3107
XF_CBUF10        \0808\1008000010B8-R\2207EXTERNS\3007
XF_CBUF11        \0808\1008000010C4-R\2207EXTERNS\3007
XF_CBUF12        \0808\1008000010D0-R\2207EXTERNS\3007
XF_CBUF13        \0808\1008000010DC-R\2207EXTERNS\3007
XF_CBUF14        \0808\1008000010E8-R\2207EXTERNS\3007
XF_CBUF15        \0808\1008000010F4-R\2207EXTERNS\3007
XF_CBUF16        \0808\100800001100-R\2207EXTERNS\3007
XF_CBUF17        \0808\10080000110C-R\2207EXTERNS\3007
XF_CBUF18        \0808\100800001118-R\2207EXTERNS\3007
XF_CBUF19        \0808\100800001124-R\2207EXTERNS\3007
XF_CBUF2        \0808\100900001130-R\2307EXTERNS\3107
XF_CBUF20        \0808\10080000113C-R\2207EXTERNS\3007
XF_CBUF21        \0808\100800001148-R\2207EXTERNS\3007
XF_CBUF22        \0808\100800001154-R\2207EXTERNS\3007
XF_CBUF23        \0808\100800001160-R\2207EXTERNS\3007
XF_CBUF24        \0808\10080000116C-R\2207EXTERNS\3007
XF_CBUF25        \0808\100800001178-R\2207EXTERNS\3007
XF_CBUF26        \0808\100800001184-R\2207EXTERNS\3007
XF_CBUF27        \0808\100800001190-R\2207EXTERNS\3007
XF_CBUF28        \0808\10080000119C-R\2207EXTERNS\3007
XF_CBUF29        \0808\1008000011A8-R\2207EXTERNS\3007
XF_CBUF3        \0808\1009000011B4-R\2307EXTERNS\3107
XF_CBUF30        \0808\1008000011C0-R\2207EXTERNS\3007
XF_CBUF31        \0808\1008000011CC-R\2207EXTERNS\3007
XF_CBUF32        \0808\1008000011D8-R\2207EXTERNS\3007
XF_CBUF33        \0808\1008000011E4-R\2207EXTERNS\3007
XF_CBUF34        \0808\1008000011F0-R\2207EXTERNS\3007
XF_CBUF35        \0808\1008000011FC-R\2207EXTERNS\3007
XF_CBUF36        \0808\100800001208-R\2207EXTERNS\3007
XF_CBUF37        \0808\100800001214-R\2207EXTERNS\3007
XF_CBUF38        \0808\100800001220-R\2207EXTERNS\3007
XF_CBUF39        \0808\10080000122C-R\2207EXTERNS\3007
XF_CBUF4        \0808\100900001238-R\2307EXTERNS\3107
XF_CBUF40        \0808\100800001244-R\2207EXTERNS\3007
XF_CBUF5        \0808\100900001250-R\2307EXTERNS\3107
XF_CBUF6        \0808\10090000125C-R\2307EXTERNS\3107
XF_CBUF7        \0808\100900001268-R\2307EXTERNS\3107
XF_CBUF8        \0808\100900001274-R\2307EXTERNS\3107
XF_CBUF9        \0808\100900001280-R\2307EXTERNS\3107
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   37
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XF_CD        \0808\100C0000128C-R\2607EXTERNS\3407
XF_CHGCHAR        \0808\100700001298-\2108EXTERNS\2F07
XF_CHGLINE        \0808\1007000012A4-R\2107EXTERNS\2F07
XF_CHGTOEOL        \0808\1006000012B0-R\2007EXTERNS\2E07
XF_CLEAR_MATCH_ATTRS             000012BC-R\1707EXTERN\2508
XF_CLRMES        \0808\1008000012C8-R\2207EXTERN\3008
XF_CNTL_A_FUNC        \0808   000012D4-R\1D07EXTERNS\2B0DBIND\3C0A
XF_CNTL_X_FUNC        \0808   000012E0-R\1D07EXTERNS\2B0DBIND\3C0A
XF_COMP_ERR_EXPS        \0808 000012EC-R\1B07EXTERN\2908
XF_CONSEARCH        \0808     000012F8-R\1F07EXTERNS\2D07
XF_DEFINE_MODE        \0808   00001304-R\1D07EXTERNS\2B07
XF_DEFINE_SUBMODE        \080800001310-R\1A07EXTERNS\2807
XF_DELGLOBMODE        \0808   0000131C-R\1D07EXTERNS\2B07
XF_DELLOCMODE        \0808    00001328-R\1E07EXTERNS\2C07
XF_DELTOEOL        \0808\100600001334-R\2007EXTERNS\2E07
XF_DELWIND        \0808\100700001340-R\2107EXTERNS\2F07
XF_DESAPRO        \0808\10070000134C-R\2107EXTERNS\2F07
XF_DESBIND        \0808\100700001358-R\2107EXTERNS\2F07
XF_DESFUNC        \0808\100700001364-R\2107EXTERNS\2F07
XF_DESKEY        \0808\100800001370-R\2207EXTERNS\3007
XF_DESMOTIONS        \0808    0000137C-R\1E07EXTER\2C09
XF_DESOPERS        \0808\100600001388-R\2007EXTERN\2E08
XF_DESPRINT        \0808\100600001394-R\2007EXTERNS\2E07
XF_DOTCMDPLAY        \0808    000013A0-R\1E07EXTERNS\2C0DEXEC\3D10MAIN\510A
XF_ENLARGEWIND        \0808   000013AC-R\1D07EXTERNS\2B07
XF_ESC_FUNC        \0808\1006000013B8-R\2007EXTERNS\2E0DBIND\3F0A
XF_EX        \0808\100C000013C4-R\2607EXTERNS\3407
XF_EXECBUF        \0808\1007000013D0-R\2107EXTERNS\2F07
XF_EXECFILE        \0808\1006000013DC-R\2007EXTERNS\2E07
XF_EXECHYPERCMD        \0808  000013E8-R\1C07EXTERNS\2A07
XF_EXECKREG        \0808\1006000013F4-R\2007EXTERNS\2E07
XF_EXECPROC        \0808\100600001400-R\2007EXTERNS\2E07
XF_FCSRCH        \0808\10080000140C-R\2207EXTERNS\3007
XF_FCSRCH_TO        \0808     00001418-R\1F07EXTERNS\2D07
XF_FILEFIND        \0808\100600001424-R\2007EXTERNS\2E07
XF_FILENAME        \0808\100600001430-R\2007EXTERNS\2E07
XF_FILEREAD        \0808\10060000143C-R\2007EXTERNS\2E07
XF_FILESAVE        \0808\100600001448-R\2007EXTERNS\2E07
XF_FILEWRITE        \0808     00001454-R\1F07EXTERNS\2D0DEXEC\3E0A
XF_FINDERR        \0808\100700001460-\2108EXTERNS\2F07
XF_FINDERRBUF        \0808    0000146C-R\1E07EXTERNS\2C07
XF_FIRSTBUFFER        \0808   00001478-\1D08EXTERNS\2B07
XF_FIRSTNONWHITE        \0808 00001484-R\1B07EXTERNS\290DINPUT\3B09
XF_FISEARCH        \0808\100600001490-R\2007EXTERNS\2E07
XF_FLIPCHAR        \0808\10060000149C-\2008EXTERNS\2E07
XF_FORCEBLANK        \0808    000014A8-R\1E07EXTERNS\2C07
XF_FORWBLINE        \0808     000014B4-R\1F07EXTERNS\2D07
XF_FORWCHAR        \0808\1006000014C0-\2008EXTERNS\2E07
XF_FORWCHAR_TO_EOL        \0807000014CC-R\1907EXTERNS\270DINPUT\390FRANDOM\4E08
V
XF_FORWDELCHAR        \0808   000014D8-\1D08EXTERNS\2B07
XF_FORWENDW        \0808\1006000014E4-R\2007EXTERNS\2E07
XF_FORWHPAGE        \0808     000014F0-R\1F07EXTERNS\2D07
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   38
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XF_FORWHUNT        \0808\1006000014FC-R\2007EXTERNS\2E07
XF_FORWLINE        \0808\100600001508-R\2007EXTERNS\2E07
XF_FORWPAGE        \0808\100600001514-R\2007EXTERNS\2E07
XF_FORWREDO        \0808\100600001520-R\2007EXTERNS\2E0DMAIN\3F0A
XF_FORWSEARCH        \0808    0000152C-R\1E07EXTERNS\2C07
XF_FORWVIENDW        \0808    00001538-R\1E07EXTERNS\2C07
XF_FORWVIWORD        \0808    00001544-R\1E07EXTERNS\2C07
XF_FORWWORD        \0808\100600001550-R\2007EXTERNS\2E07
XF_GLOBALS        \0808\10070000155C-R\2107EXTERN\2F0EEXEC\400A
XF_GODOTPLUS        \0808     00001568-R\1F07EXTERN\2D0EGLOBAL\410EOPER\5310RAN
VDOM\6808
X        \0808\1010\2020     WORD\490A
XF_GOEXACTNMMARK        \0808 00001574-R\1B07EXTERNS\2907
XF_GOLINENMMARK        \0808  00001580-R\1C07EXTERNS\2A07
XF_GOMARK        \0808\10080000158C-R\2207EXTERNS\300DEXEC\410A
XF_GORECTNMMARK        \0808  00001598-R\1C07EXTERNS\2A07
XF_GOTOBOB        \0808\1007000015A4-R\2107EXTERNS\2F07
XF_GOTOBOL        \0808\1007000015B0-R\2107EXTERNS\2F07
XF_GOTOBOP        \0808\1007000015BC-R\2107EXTERNS\2F07
XF_GOTOBOS        \0808\1007000015C8-R\2107EXTERN\2F08
XF_GOTOBOSEC        \0808     000015D4-R\1F07EXTERNS\2D07
XF_GOTOBOSENT        \0808    000015E0-R\1E07EXTERNS\2C07
XF_GOTOCOL        \0808\1007000015EC-R\2107EXTERNS\2F07
XF_GOTOEOB        \0808\1007000015F8-R\2107EXTERNS\2F07
XF_GOTOEOL        \0808\100700001604-R\2107EXTERNS\2F0DINPUT\410FRANDOM\5608
XF_GOTOEOP        \0808\100700001610-R\2107EXTERNS\2F07
XF_GOTOEOS        \0808\10070000161C-R\2107EXTERN\2F08
XF_GOTOEOSEC        \0808     00001628-R\1F07EXTERNS\2D07
XF_GOTOEOSENT        \0808    00001634-R\1E07EXTERNS\2C07
XF_GOTOLINE        \0808\100600001640-R\2007EXTERNS\2E07
XF_GOTOMOS        \0808\10070000164C-R\2107EXTERN\2F08
XF_GOTOTAG        \0808\100700001658-R\2107EXTERNS\2F07
XF_HELP        \0808\100A00001664-R\2407EXTERNS\3207
XF_HISTBUFF        \0808\100600001670-R\2007EXTERNS\2E07
XF_INF_UNDO        \0808\10060000167C-R\2007EXTERNS\2E0DMAIN\3F0A
XF_INSERT        \0808\100800001688-R\2207EXTERNS\300DINPU\420A
XF_INSERTBOL        \0808     00001694-R\1F07EXTERNS\2D0DINPUT\3F09
XF_INSERT_NO_AINDENT             000016A0-R\1707EXTERNS\2507
XF_INSFILE        \0808\1007000016AC-R\2107EXTERNS\2F0DEXEC\400A
XF_INSSPACE        \0808\1006000016B8-R\2007EXTERNS\2E07
XF_INSSTRING        \0808     000016C4-R\1F07EXTERNS\2D07
XF_JOINLINES        \0808     000016D0-R\1F07EXTERN\2D08
XF_KBD_MAC_BEGIN        \0808 000016DC-R\1B07EXTERNS\2907
XF_KBD_MAC_END        \0808   000016E8-R\1D07EXTERNS\2B07
XF_KBD_MAC_EXEC        \0808  000016F4-R\1C07EXTERNS\2A07
XF_KBD_MAC_SAVE        \0808  00001700-R\1C07EXTERNS\2A07
XF_KILLBUFFER        \0808    0000170C-\1E08EXTERNS\2C07
XF_LASTNONWHITE        \0808  00001718-R\1C07EXTERNS\2A07
XF_LINEPUTAFTER        \0808  00001724-\1C08EXTERNS\2A0DEXEC\3B0A
XF_LINEPUTBEFORE        \0808 00001730-R\1B07EXTERNS\290DEXEC\3A0A
XF_LINEUNDO        \0808\10060000173C-R\2007EXTERNS\2E07
XF_LISTBUFFERS        \0808   00001748-R\1D07EXTERN\2B08
XF_LISTMODES        \0808     00001754-R\1F07EXTERN\2D08
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   39
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XF_LISTVARS        \0808\100600001760-R\2007EXTERN\2E08
XF_LIST_MAJORMODES        \08070000176C-R\1907EXTERN\2708
XF_LOADKREG        \0808\100600001778-R\2007EXTERNS\2E07
XF_MAP        \0808\100B00001784-R\2507EXTERNS\3307
XF_MAP_BANG        \0808\100600001790-R\2007EXTERNS\2E07
XF_MATCHFENCE        \0808    0000179C-R\1E07EXTERNS\2C07
XF_MATCHFENCEBACK        \0808000017A8-R\1A07EXTERNS\2807
XF_MULTIMOTION        \0808   000017B4-R\1D07EXTERNS\2B0DSELECT\3E08
XF_MULTIMOTIONFULLLINE           000017C0-R\1507EXTERNS\2307
XF_MULTIMOTIONRECTANGLE          000017CC-R\1407EXTERNS\2207
XF_MVDNNXTWIND        \0808   000017D8-R\1D07EXTERNS\2B07
XF_MVDNWIND        \0808\1006000017E4-R\2007EXTERNS\2E07
XF_MVLEFTWIND        \0808    000017F0-R\1E07EXTERNS\2C07
XF_MVRIGHTWIND        \0808   000017FC-R\1D07EXTERNS\2B07
XF_MVUPNXTWIND        \0808   00001808-R\1D07EXTERNS\2B07
XF_MVUPWIND        \0808\100600001814-R\2007EXTERNS\2E07
XF_NAMEBUFFER        \0808    00001820-\1E08EXTERNS\2C07
XF_NAMEDCMD        \0808\10060000182C-R\2007EXTERNS\2E0DSPAWN\4009
XF_NEWLENGTH        \0808     00001838-R\1F07EXTERNS\2D07
XF_NEWLINE        \0808\100700001844-R\2107EXTERNS\2F07
XF_NEWPROCESSGROUP        \080700001850-R\1907EXTERNS\2707
XF_NEWWIDTH        \0808\10060000185C-R\2007EXTERNS\2E07
XF_NEXTBUFFER        \0808    00001868-\1E08EXTERNS\2C07
XF_NEXTTAG        \0808\100700001874-R\2107EXTERNS\2F07
XF_NEXTWIND        \0808\100600001880-R\2007EXTERNS\2E07
XF_NOREMAP        \0808\10070000188C-R\2107EXTERNS\2F07
XF_NOREMAP_BANG        \0808  00001898-R\1C07EXTERNS\2A07
XF_NULLPROC        \0808\1006000018A4-R\2007EXTERNS\2E07
XF_ONLYWIND        \0808\1006000018B0-R\2007EXTERNS\2E07
XF_OPENDOWN        \0808\1006000018BC-R\2007EXTERNS\2E0DEXEC\3F0A
XF_OPENDOWN_NO_AINDENT           000018C8-R\1507EXTERNS\2307
XF_OPENUP        \0808\1008000018D4-R\2207EXTERNS\300DEXEC\410A
XF_OPENUP_NO_AINDENT             000018E0-R\1707EXTERNS\2507
XF_OPERATTRBOLD        \0808  000018EC-R\1C07EXTERNS\2A07
+-+-+-+-+-+-+-+-  END  OF PART 119 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 120 -+-+-+-+-+-+-+-+
XF_OPERATTRCASEQ        \0808 000018F8-R\1B07EXTERNS\2907
XF_OPERATTRHC        \0808    00001904-R\1E07EXTERNS\2C07
XF_OPERATTRITAL        \0808  00001910-R\1C07EXTERNS\2A07
XF_OPERATTRNO        \0808    0000191C-R\1E07EXTERNS\2C07
XF_OPERATTRREV        \0808   00001928-R\1D07EXTERNS\2B07
XF_OPERATTRUL        \0808    00001934-R\1E07EXTERNS\2C07
XF_OPERBLANK        \0808     00001940-R\1F07EXTERNS\2D07
XF_OPERCHG        \0808\10070000194C-R\2107EXTERNS\2F07
XF_OPERCOPY        \0808\100600001958-R\2007EXTERNS\2E07
XF_OPERCRYPT        \0808     00001964-R\1F07EXTERNS\2D07
XF_OPERDEL        \0808\100700001970-R\2107EXTERNS\2F07
XF_OPERDETAB        \0808     0000197C-R\1F07EXTERNS\2D07
XF_OPERENTAB        \0808     00001988-R\1F07EXTERNS\2D07
XF_OPERFILTER        \0808    00001994-\1E08EXTERNS\2C0DEXEC\3D0A
XF_OPERFLIP        \0808\1006000019A0-R\2007EXTERNS\2E07
XF_OPERFORMAT        \0808    000019AC-R\1E07EXTERNS\2C07
XF_OPERGLOBALS        \0808   000019B8-R\1D07EXTERN\2B0EEXEC\3C0A
XF_OPERJOIN        \0808\1006000019C4-R\2007EXTERNS\2E07
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   40
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XF_OPERLINECHG        \0808   000019D0-R\1D07EXTERNS\2B07
XF_OPERLINEDEL        \0808   000019DC-R\1D07EXTERNS\2B07
XF_OPERLINEYANK        \0808  000019E8-R\1C07EXTERNS\2A07
XF_OPERLIST        \0808\1006000019F4-R\2007EXTERNS\2E07
XF_OPERLOWER        \0808     00001A00-\1F08EXTERNS\2D07
XF_OPERLSHIFT        \0808    00001A0C-R\1E07EXTERNS\2C07
XF_OPERMOVE        \0808\100600001A18-R\2007EXTERNS\2E07
XF_OPEROPENRECT        \0808  00001A24-R\1C07EXTERNS\2A07
XF_OPERPPRINT        \0808    00001A30-R\1E07EXTERNS\2C07
XF_OPERPRINT        \0808     00001A3C-R\1F07EXTERNS\2D07
XF_OPERRSHIFT        \0808    00001A48-R\1E07EXTERNS\2C07
XF_OPERSELECT        \0808    00001A54-R\1E07EXTERNS\2C07
XF_OPERSUBST        \0808     00001A60-R\1F07EXTERNS\2D07
XF_OPERSUBSTAGAIN        \080800001A6C-R\1A07EXTERNS\2807
XF_OPERTRANSF        \0808    00001A78-R\1E07EXTERNS\2C07
XF_OPERTRIM        \0808\100600001A84-R\2007EXTERNS\2E07
XF_OPERUPPER        \0808     00001A90-\1F08EXTERNS\2D07
XF_OPERVGLOBALS        \0808  00001A9C-R\1C07EXTERN\2A0EEXEC\3B0A
XF_OPERWRITE        \0808     00001AA8-R\1F07EXTERNS\2D0DEXEC\3E0A
XF_OPERYANK        \0808\100600001AB4-R\2007EXTERNS\2E07
XF_OVERWRITECHARS        \080800001AC0-R\1A07EXTERN\2808
XF_OVERWSTRING        \0808   00001ACC-R\1D07EXTERNS\2B07
XF_PIPECMD        \0808\100700001AD8-R\2107EXTERNS\2F07
XF_POSWIND        \0808\100700001AE4-R\2107EXTERNS\2F07
XF_POUNDC_FUNC        \0808   00001AF0-R\1D07EXTERNS\2B0DBIND\3C0A
XF_PREVWIND        \0808\100600001AFC-R\2007EXTERNS\2E07
XF_PUTAFTER        \0808\100600001B08-\2008EXTERNS\2E07
XF_PUTBEFORE        \0808     00001B14-R\1F07EXTERNS\2D07
XF_PWD        \0808\100B00001B20-R\2507EXTERNS\3307
XF_QUICKEXIT        \0808     00001B2C-R\1F07EXTERNS\2D07
XF_QUIT        \0808\100A00001B38-R\2407EXTERNS\3207
XF_QUITHARD        \0808\100600001B44-R\2007EXTERNS\2E07
XF_QUOTE        \0808\100900001B50-R\2307EXTERNS\3107
XF_RECTPUTAFTER        \0808  00001B5C-\1C08EXTERNS\2A07
XF_RECTPUTBEFORE        \0808 00001B68-R\1B07EXTERNS\2907
XF_REMOVE_MODE        \0808   00001B74-R\1D07EXTERNS\2B07
XF_REMOVE_SUBMODE        \080800001B80-R\1A07EXTERNS\2807
XF_REPLACECHAR        \0808   00001B8C-\1D08EXTERNS\2B07
XF_REPOSITION        \0808    00001B98-R\1E07EXTERNS\2C07
XF_REP_CSRCH        \0808     00001BA4-R\1F07EXTERNS\2D07
XF_RESIZE        \0808\100800001BB0-R\2207EXTERNS\3007
XF_RESPAWN        \0808\100700001BBC-R\2107EXTERNS\2F07
XF_RESTWND        \0808\100700001BC8-R\2107EXTERNS\2F07
XF_REVSEARCH        \0808     00001BD4-R\1F07EXTERNS\2D07
XF_REV_CSRCH        \0808     00001BE0-R\1F07EXTERNS\2D07
XF_RISEARCH        \0808\100600001BEC-R\2007EXTERNS\2E07
XF_SAVEWND        \0808\100700001BF8-R\2107EXTERNS\2F07
XF_SCRBACKSEARCH        \0808 00001C04-R\1B07EXTERNS\2907
XF_SCRFORWSEARCH        \0808 00001C10-R\1B07EXTERNS\2907
XF_SCRNEXTDW        \0808     00001C1C-R\1F07EXTERNS\2D07
XF_SCRNEXTUP        \0808     00001C28-R\1F07EXTERNS\2D07
XF_SCRSEARCHPAT        \0808  00001C34-R\1C07EXTERNS\2A07
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   41
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XF_SEL_MOTION        \0808    00001C40-R\1E07EXTERNS\2C07
XF_SETFILLCOL        \0808    00001C4C-R\1E07EXTERNS\2C07
XF_SETGLOBMODE        \0808   00001C58-R\1D07EXTERNS\2B07
XF_SETLOCMODE        \0808    00001C64-R\1E07EXTERNS\2C07
XF_SETNMMARK        \0808     00001C70-R\1F07EXTERNS\2D07
XF_SETTAB        \0808\100800001C7C-R\2207EXTERNS\3007
XF_SETVAR        \0808\100800001C88-\2208EXTERNS\3007
XF_SET_DOSMODE        \0808   00001C94-R\1D07EXTERNS\2B07
XF_SET_TERMCHRS        \0808  00001CA0-R\1C07EXTERN\2A08
XF_SET_UNIXMODE        \0808  00001CAC-R\1C07EXTERNS\2A07
XF_SHOWCPOS        \0808\100600001CB8-R\2007EXTERN\2E08
XF_SHOWHISTORY        \0808   00001CC4-R\1D07EXTERNS\2B07
XF_SHOWHYPERCMD        \0808  00001CD0-R\1C07EXTERNS\2A07
XF_SHOWKREG        \0808\100600001CDC-R\2007EXTERNS\2E07
XF_SHOWLENGTH        \0808    00001CE8-R\1E07EXTERNS\2C0DEXEC\3D0A
XF_SHOWTAGSTACK        \0808  00001CF4-R\1C07EXTERNS\2A07
XF_SHOWVERSION        \0808   00001D00-R\1D07EXTERNS\2B07
XF_SHOW_TERMCHRS        \0808 00001D0C-R\1B07EXTERN\2908
XF_SHRINKWIND        \0808    00001D18-R\1E07EXTERNS\2C07
XF_SOURCE        \0808\100800001D24-R\2207EXTERNS\3007
XF_SPAWN        \0808\100900001D30-R\2307EXTERNS\310DEXEC\420A
XF_SPAWNCLI        \0808\100600001D3C-R\2007EXTERNS\2E07
XF_SPLITWIND        \0808     00001D48-R\1F07EXTERNS\2D07
XF_STOREMAC        \0808\100600001D54-R\2007EXTERNS\2E07
XF_STOREPROC        \0808     00001D60-R\1F07EXTERNS\2D07
XF_SUBST_AGAIN        \0808   00001D6C-R\1D07EXTERNS\2B07
XF_SYSMAP        \0808\100800001D78-R\2207EXTERNS\3007
XF_TOGGLELISTBUFFERS             00001D84-R\1707EXTERN\2508
XF_TWIDDLE        \0808\100700001D90-R\2107EXTERNS\2F07
XF_UE_SETKEY        \0808     00001D9C-R\1F07EXTERNS\2D07
XF_UNABBR        \0808\100800001DA8-\2208EXTERNS\3007
XF_UNARG_FUNC        \0808    00001DB4-R\1E07EXTERNS\2C0DBIND\3D0A
XF_UNBINDKEY        \0808     00001DC0-R\1F07EXTERNS\2D07
XF_UNDO        \0808\100A00001DCC-R\2407EXTERNS\320DMAIN\430A
XF_UNIMPL        \0808\100800001DD8-R\2207EXTERNS\3007
XF_UNMAP        \0808\100900001DE4-R\2307EXTERNS\3107
XF_UNMAP_BANG        \0808    00001DF0-R\1E07EXTERNS\2C07
XF_UNMAP_SYSTEM        \0808  00001DFC-R\1C07EXTERNS\2A07
XF_UNMARK        \0808\100800001E08-R\2207EXTERNS\3007
XF_UNTAGPOP        \0808\100600001E14-R\2007EXTERNS\2E07
XF_UPSCREEN        \0808\100600001E20-R\2007EXTERNS\2E07
XF_USEBUFFER        \0808     00001E2C-\1F08EXTERNS\2D07
XF_USEKREG        \0808\100700001E38-R\2107EXTERNS\2F07
XF_USERBEEP        \0808\100600001E44-R\2007EXTERNS\2E07
XF_VGLOBALS        \0808\100600001E50-R\2007EXTERN\2E0EEXEC\3F0A
XF_VIEWFILE        \0808\100600001E5C-R\2007EXTERNS\2E07
XF_VILE_FILTER        \0808   00001E68-\1D08EXTERNS\2B07
XF_VILE_REFRESH        \0808  00001E74-R\1C07EXTERNS\2A07
XF_VISUAL        \0808\100800001E80-R\2207EXTERNS\3007
XF_WORDCOUNT        \0808     00001E8C-R\1F07EXTERNS\2D07
XF_WRAPWORD        \0808\100600001E98-R\2007EXTERNS\2E07
XF_WRITEALLCHANGED        \080700001EA4-R\1907EXTERNS\2707
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   42
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XF_WRITEMSG        \0808\100600001EB0-R\2007EXTERNS\2E07
XF_WRITEQUIT        \0808     00001EBC-R\1F07EXTERNS\2D07
XF_YANKLINE        \0808\100600001EC8-R\2007EXTERNS\2E07
XF_ZZQUIT        \0808\100800001ED4-R\2207EXTERNS\3007
XGETCCOL        \0808\10090003D3D0-R\2307RANDOM\300EBASIC\430FBUFFE\3508\5F07DI
VSPLAY\6D07
X        \0808\1010\2020     EVAL\4910INSERT\5F0EREGION\7308
X        \0808\1010\2020     WINDOW\4B08
XGETCLINE        \0808\10080003D300-R\2207RANDOM\2F0EEVAL\410A
XGETCOL        \0808\100A0003D340-R\2407RANDOM\310ELINE\4310\2814REGION\6D08
X        \0808\1010\2020     SELECT\4B08
XGETCTEXT        \0808\1008000330E8-R\2207LINE\2D10EVAL\410A
XGETFILE        \0808\100900026E30-R\2307\2E14BUFFE\2108\2809NDER\150ETAGS\6A0A
V
XGETFILE2BP        \0808\100600026BFC-R\2007FILE\2B10\1414MAIN\530A
XGETGOAL        \0808\10090000C70C-R\2307BASIC\2F0FBUFFE\2108\4B07WINDOW\5808
XGETOFF        \0808\100A0003D444-R\2407RANDOM\310ELINE\4310\2814REGION\6D08
XGETREGION        \0808\100700041E40-R\2107\2E14FILE\4010\5614SELECT\6A08
X        \0808\1010\2020     WORD\490A
XGETSCREENSIZE        \0808   00047910-R\1D07TERMIO\2A08
XGETVERSION        \0808\1006000490AC-R\2007\2E14MAI\3F11\560E
XGETWPOS        \0808\10090004B924-R\2307WINDOW\300EEVAL\420A
XGET_FL_REGION        \0808   00042270-R\1D07\2A14ONELINE\2307
XGET_MODTIME        \0808     0002655C-R\1F07FIL\2A11\1414RANDOM\540ETAGS\660A
V
XGET_RECORDED_CHAR        \08070002D558-\1908INPUT\250FDISPLAY\3B0D\280E
XGET_SHELL        \0808\100700018E30-R\2107EVA\2C11\140E
XGLOBALS        \0808\10090002BDC4-R\2307\3114EXTERN\4508
XGLOBAL_B_VALUES        \0808 00005910-R    WK-MAIN\2610BUFFER    \400ADISPLAY
V\510DFILE\620A
X        \0808\1010\2020     GLOB\4910ISEARCH\600AWK-MAIN\710A
X        \0808\1010\2020     MODES\4A0FONELINER\610CSEARCH\7308
X        \0808\1010\2020     TAGS\490A
XGLOBAL_G_VALUES        \0808 00005AA0-R    WK-MAIN\2610BIND\1411UFFER    \540A
VDISPLAY\6507
X        \0808\1010\2020     EXEC\4910FILE\1414\290A
X        \0808\1010\2020     GLOB\1414ALS\600DHISTORY\7407
X        \0808\1010\2020     INPUT\4A0FLINE\5D0DWK-MAIN\710A
X        \0808\1010\2020     MAP\1412ODES\2810SG\130B
X        \0808\1010\2020     SPAWN\4A0FWORD\5D0A
XGLOBAL_W_VALUES        \0808 00005C10-R    WK-MAIN\2610BUFFER    \400ADISPLAY
V\510A\3C11
X        \0808\1010\2020     MODES\4A0FWINDOW\5F08
XGLOB_FREE        \0808\10070002BAB4-R\2107GLOB\2C10FILEC\4109
XGLOB_LENGTH        \0808     0002BA84-R\1F07GLOB\2A10FILEC\3F09
XGLOB_NEEDED        \0808     0002B8FC-R\1F07GLOB\2A10\140E
XGLOB_STRING        \0808     0002BA68-R\1F07GLOB\2A10FILEC\3F09
XGOCOL        \0808\100B0003D4C0-R\2507RANDOM\320EDISPLAY\470DINSERT\5A0EREGION
V\6E08
XGODOTPLUS        \0808\10070000CFAC-R\2107BASIC\2D0FEXTERN\4308
XGOEXACTNMMARK        \0808   0000CD6C-R\1D07BASIC\290FEXTERNS\3F07
XGOLABEL        \0808\100900005C58-R    WK-MAIN\2E10EXEC\420D\2811
XGOLINENMMARK        \0808    0000CD2C-R\1E07BASIC\2A0FEXTERNS\4007
XGOMARK        \0808\100A0000CF80-R\2407BASIC\300FEXTERNS\460DFENCE\130E INSERT
V\6D08
X        \0808\1010\2020     ONELINER\4D0CRANDOM\5F08
XGONMMARK        \0808\10080000CE74-R\2207BASIC\2E0F\1414EXE\270B
XGORECTNMMARK        \0808    0000CD98-R\1E07BASIC\2A0FEXTERNS\4007
XGOTOBOB        \0808\10090000B6C0-R\2307BASIC\2F0FBIND\4210EXTERNS\590DRANDOM
V\6C08
XGOTOBOL        \0808\10090000B2BC-R\2307BASIC\2F0FEXTERNS\450DINSERT\5808
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   43
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XGOTOBOP        \0808\10090000BE74-R\2307BASIC\2F0FEXTERNS\4507
XGOTOBOS        \0808\10090000B740-R\2307BASIC\2F0FEXTERN\4508
XGOTOBOSEC        \0808\10070000C27C-R\2107BASI\2D10EXTERNS\4307
XGOTOBOSENT        \0808\10060000C350-R\2007BASIC\2C0FEXTERNS\4207
XGOTOCOL        \0808\10090003D3F4-R\2307RANDOM\300EEVA\4211EXTERNS\5907
XGOTOEOB        \0808\10090000B700-R\2307BASIC\2F0FEXE\1310 EXTERNS\590DMAIN
V\6A0A
X        \0808\1010\2020     RANDOM\4B08
XGOTOEOL        \0808\10090000B408-R\2307BASIC\2F0FEXTERNS\450DINSERT\580EWORD
V\6A0A
XGOTOEOP        \0808\10090000C074-R\2307BASIC\2F0FEXTERNS\4507
XGOTOEOS        \0808\10090000B894-R\2307BASIC\2F0F\1414BIND\5610EXTERN\6D08
XGOTOEOSEC        \0808\10070000C2F8-R\2107BASI\2D10EXTERNS\4307
XGOTOEOSENT        \0808\10060000C5B8-R\2007BASIC\2C0FEXTERNS\4207
XGOTOLINE        \0808\10080000B5C8-R\2207BASIC\2E0FBIND\4110DISPLAY\580DEVAL
V\690A
X        \0808\1010\2020     EXEC\1412TERNS\600DFINDERR\7407
X        \0808\1010\2020     MAIN\4910TAGS\5D0A
XGOTOMOS        \0808\10090000B7CC-R\2307BASIC\2F0FEXTERN\4508
XGOTOTAG        \0808\100900045EF8-R\2307TAGS\2E10EXTERN\1708
XGREGEXP        \0808\100900005CD8-R    WK-MAIN\2E10EVAL\4210GLOBALS\590DISEARC
VH\6D07
X        \0808\1010\2020  WK-MAIN\4910ONELINER\610CSEARCH\7308
XGTENV        \0808\100B0001A504-R\2507EVAL\3010\140E
XG_VALNAMES        \0808\100600001EE0-R\2007MAIN\2B10MOD\400B
XHAVEMOTION        \0808\100600005CDC-R    WK-MAI\2B11EXEC\3F10GLOBALS\560A
V\3C11
X        \0808\1010\2020     OPERS\4A0FRANDOM\5F0EWORD\710A
XHAVEREGION        \0808\100600005CE0-R    WK-R\2D13OPERS\400C\2817SELECT\6908
V
XHELP        \0808\100C0000D554-R\2607BIND\3110EXTERNS\480DMAIN\590A
XHELPFILE        \0808\100800005CE4-R    WK-MAIN\2D10BIND\4110EVAL\550D\3C11
XHELP_AT        \0808\100900005CE8-R\2307MAIN\2E10BIND\1411UFFE\3508`20
XHELP_BUFNAME        \0808    00002090-R\1E07MAIN\2910BIND\1411UFFE\3508`20
XHEXDIGITS        \0808\100700002098-R\2107MAIN\2C10DISPLAY\4307
XHILITE        \0808\100A00016C7C-R\2407DISPLAY\320D\1414ONELINE\3707
XHISTBUFF        \0808\1008000112CC-R\2207BUFFE\0D08\1414\4A07EXTERNS\5807
XHISTORY_BUFNAME        \0808 000020C0-R\1B07MAIN\2610\4507\3D07
XHIST_LOOKUP        \0808     00011164-R\1F07BUFFE\0D08\1414`20
XHST_APPEND        \0808\10060002C31C-R\2007HISTORY\2E0D\1414INPUT\5409
XHST_APPEND_S        \0808    0002C444-R\1E07HISTORY\2C0DBIND\3D0A
XHST_FLUSH        \0808\10070002C4E0-R\2107HISTORY\2F0DEXEC\4010SEARC\560FSPAWN
V\6909
XHST_GLUE        \0808\10080002C2E8-R\2207HISTORY\300DEXEC\4110FIL\5511MAP\680B
V
X        \0808\1010\2020     MODES\4A0FSEARCH\5F08
XHST_INIT        \0808\10080002C2AC-R\2207HISTORY\300DEXEC\4110SEARCH\140FPAWN
V\6A09
XHST_REMOVE        \0808\10060002C470-R\2007HISTORY\2E0DEXEC\3F0A
XIBUF        \0808\100C00005CF0-R    WK-TERMIO\330B\1411
XIBUFI        \0808\100B000060F0-R    WK-TERMIO\320B\1411
XIFILE        \0808\100B00028818-R\2507\3014\440E
XIGNORECASE        \0808\1006000060F4-R    WK-MAIN\2B10ISEARCH\420A\2817MODES
V\6809
X        \0808\1010\2020     ONELINER\4D0CREGEXP\5F0ESEARCH\7308
X        \0808\1010\2020     TAGS\490A
XIMDYING        \0808\100900028AFC-R\2307FILE\2E0A
XIMPLY_ALT        \0808\10070001151C-R\2107BUFFE\0D08\3507FILE\400A
XIM_WAITING        \0808\100600018B2C-R\2007DISPLAY\2E0DINPUT\400FMAIN\530A
XINCR_DOT_KREGNUM        \08080002D478-R\1A07INPUT\260FLINE\390A
XINDENTLEN        \0808\100700031288-R\2107INSERT\2E0EFENCES\420E\2814WORD\680A
V
XINDEX2REG        \0808\100700033640-R\2107LINE\2C10INPUT\4109
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   44
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XINDEX2UKB        \0808\100700033728-R\2107LINE\2C0A
XINF_UNDO        \0808\100800048160-R\2207\2D14EXTERNS\4407
XINIT_FILEC        \0808\100600029830-R\2007\2C14BIND\3F10INPUT\5409
XINS        \0808\100D00030608-R\2707INSERT\340EOPER\4710RANDOM\5C08
XINSCHAR        \0808\10090003070C-\2308INSERT\300E\1414MAP\550B
XINSERT        \0808\100A0002FDB4-R\2407\3114EXTERNS\4607
XINSERTBOL        \0808\10070002FDFC-R\2107\3106\2E0EEXTERNS\4307
XINSERTMODE        \0808\1006000060F8-R    WK-MAIN\2B10BASIC\1410UFFER\550EDISP
VLAY\6A07
X        \0808\1010\2020     EXEC\4910INPUT\1411SER\1509
X        \0808\1010\2020  WK-MAIN\4910MAP\5C0B
XINSERT_NAMEBST        \0808  0000FF00-R\1C07BIND\2710\1414EXEC\4F0A
XINSERT_NO_AINDENT        \08070002FDD0-R\1907\3106\260EEXTERNS\3B07
XINSFILE        \0808\100900026B98-R\2307\2E14EXTERNS\4507
XINSSPACE        \0808\100800032850-R\2207LIN\2D11EXTERNS\440DREGION\5708
XINSSTRING        \0808\100700030CB8-R\2107INSERT\2E0EEXTERNS\4307
XINS_MODE        \0808\10080002FED0-R\2207INSERT\2F0EDISPLAY\4407
XINTRC        \0808\100B000060FC-R\2507MAIN\3010BASI\4510BIND\5810CSRCH\6D09
X        \0808\1010\2020     HISTORY\4C0DINPUT\5E0FINSER\1509
X        \0808\1010\2020     ISEARCH\4C0DSELECT\5F0ESPAWN\7209
X        \0808\1010\2020     WINDOW\4B08
XIOCHAN        \0808\100A00006100-R    WK-TERMIO\310ESPAW\440D\2811
XISENDVIWORDF        \0808    0004D054-R\1E07WORDMOV\2C0DWORD\3D0A
XISENDWORDF        \0808\10060004CF84-R\2007WORDMOV\2E0DWORD\3F0A
XISNAMEDCMD        \0808\100600006104-R    WK-MAIN\2B10BASIC\1410UFFER    \590A
VCSRCH\6809
X        \0808\1010\2020     EXEC\4910FIL\1511INPUT\7209
X        \0808\1010\2020     INSERT\4B0ELINE\5D0DWK-MAIN\710A
X        \0808\1010\2020     TAGS\4910WINDOW\5F08
XISNEWVIWORDB        \0808    0004CEF4-R\1E07WORDMOV\2C0DWORD\3D0A
XISNEWVIWORDF        \0808    0004CDD0-R\1E07WORDMOV\2C0DWORD\3D0A
XISNEWWORDB        \0808\10060004CD40-R\2007WORDMOV\2E0DWORD\3F0A
XISNEWWORDF        \0808\10060004CC80-R\2007WORDMOV\2E0DWORD\3F0A
XIS_APPENDNAME        \0808   0003CA8C-R\1D07PATH\2810FIL\3C11FILEC\2813IO\6608
V
XIS_DIRECTORY        \0808    0003CC14-R\1E07PATH\2910FILEC\1413IO\5308
XIS_EDIT_CHAR        \0808    0002E054-\1E08INPUT\2A0FEXEC\3D10HISTORY\5407
XIS_FALSEM        \0808\10070001CA20-R\2107EVAL\2C10\1414MODES\5509
XIS_INTERNALNAME        \0808 0003CB60-R\1B07PATH\2610BUFFER\3C0EDISPLAY\510DFI
VL\620B
X        \0808\1010\2020     FILEC\1413IO\5F0EGLOB\710A
X        \0808\1010\2020     INPUT\4A0FPATH\5D10RANDOM\7308
X        \0808\1010\2020     TAGS\490A
XIS_PATHNAME        \0808     0003C96C-R\1F07PATH\2A10FILEC\3F0F\280E
XIS_SCRATCHNAME        \0808  0003CBDC-R\1C07PATH\2710BIND\1411UFFE\3508\5807FI
VL\630B
XIS_TRUEM        \0808\10080001C97C-R\2207EVAL\2D10\1414MODES\5609
XIS_USER_FENCE        \0808   00025814-R\1D07FENCES\2A0E\1414INSERT\5208
XIS_VARMODE        \0808\100600037E58-R\2007MODES\2C0FEVAL\3F0A
XIS_VMS_DIRTYPE        \0808  00049A14-R\1C07VMS2UNIX\2B0CFILEC\3C0F\280E
XIS_VMS_PATHNAME        \0808 0003B7D4-R\1B07PATH\2610FIL\3A11FILEC\4F0F\3C0E
X        \0808\1010\2020     RANDOM\4B08
XIS_VMS_ROOTDIR        \0808  00049AA8-\1C08VMS2UNIX\2B06
XITB_ALLOC        \0808\100700031800-R\2107ITBUFF\2E0E\140E
XITB_APPEND        \0808\1006000318DC-R\2007ITBUFF\2D0EINPUT\400FINSER\150FMAP
V\660B
XITB_BAPPEND        \0808     00031A38-R\1F07ITBUFF\2C08
XITB_COPY        \0808\100800031920-R\2207ITBUFF\2F0EINPUT\4209
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   45
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XITB_FIRST        \0808\100700031B14-R\2107ITBUFF\2E0EINPU\4110INSER\5609
XITB_FREE        \0808\100800031898-R\2207ITBUFF\2F0EINPUT\420FMAP\540B
XITB_GET        \0808\100900031AE8-R\2307ITBUFF\300EINPU\430A
XITB_INIT        \0808\100800031864-R\2207ITBUFF\2F0EINPU\4210INSER\570FMAP
V\680B
XITB_LAST        \0808\100800031BB0-R\2207ITBUFF\2F0EINPU\4210MAP\540B
XITB_LENGTH        \0808\100600031C58-R\2007ITBUFF\2D0EINPUT\4009
XITB_MORE        \0808\100800031B48-R\2207ITBUFF\2F0EINPUT\420FINSER\150FMAP
V\680B
XITB_NEXT        \0808\100800031B68-R\2207ITBUFF\2F0EINPU\4210INSER\570FMAP
V\680B
XITB_PEEK        \0808\100800031C00-R\2207ITBUFF\2F0EINPUT\4209
XITB_STUFF        \0808\1007000318BC-R\2107ITB\2E11INPUT\4109
XITB_VALUES        \0808\100600031C40-R\2007ITBUFF\2D0EMAP\3E0B
XJOINLINES        \0808\10070004C2F4-R\2107WORD\2C10EXTERN\4308
XJOINREGION        \0808\10060004C194-R\2007WORD\2B10OPERS\4009
XKBDMODE        \0808\100900006108-R\2307MAIN\2E10INPUT\4309
XKBD_ALARM        \0808\10070000F04C-R\2107BIND\2C10DISPLAY\430DEXEC\5410FENCES
V\6A08
X        \0808\1010\2020     HISTORY\4C0DINPUT\5E0FINSER\1509
X        \0808\1010\2020     ISEARCH\4C0DMAIN\5D10OPERS\7209
X        \0808\1010\2020     UNDO\4910WINDOW\5F08
XKBD_COMPLETE        \0808    0000F818-R\1E07BIND\2910\1414EVAL\5110FILEC\6609
V
X        \0808\1010\2020     MODES\4A0FTAG\130B
XKBD_DELIMITER        \0808   0002DD34-\1D08INPUT\290FGLOBALS\3F0DONELINE\5407
V
XKBD_ENGL        \0808\10080000EF94-R\2207BIND\2D10GLOBALS\4407
XKBD_ENGL_STAT        \0808   0000FE5C-R\1D07BIND\2810EXEC\3C0A
XKBD_ERASE        \0808\10070000F178-R\2107BIND\2C10\1414INPUT\5509
XKBD_ERASE_TO_END        \08080000F1EC-R\1A07BI\2512\1414DISPLAY\500DSPAWN\6209
V
XKBD_EXPAND        \0808\10060000610C-R    WK-MAIN\2B10BIN\3F11DISPLAY\560DINPU
VT\6809
X        \0808\1010\2020  WK-MAIN\490A
XKBD_FLUSH        \0808\10070001517C-R\2107DISPLAY\2F0DBIND\4010\2814INPUT\6909
V
X        \0808\1010\2020     ISEARCH\4C0DSPAWN\5E09
XKBD_INIT        \0808\10080000F728-R\2207BIND\2D10INPU\4210TAGS\550A
XKBD_IS_PUSHED_BACK        \08060002E384-R\1807INPUT\240E FILEC\3809
XKBD_KILL_RESPONSE        \08070002E0A0-R\1907INPUT\250FHISTORY\3B0D\280E
XKBD_LENGTH        \0808\10060000F738-R\2007BIND\2B10MAIN\3F0A
XKBD_MAC_BEGIN        \0808   0002F528-R\1D07INPUT\290FEXTERNS\3F07
XKBD_MAC_END        \0808     0002F580-R\1F07INPUT\2B0FEXTERNS\4107
XKBD_MAC_EXEC        \0808    0002F5C0-R\1E07INPUT\2A0FEXTERNS\4007
XKBD_MAC_SAVE        \0808    0002F608-R\1E07INPUT\2A0FEXTERNS\4007
XKBD_OPENUP        \0808\100600015028-R\2007DISPLAY\2E0D\1414TERMIO\5508
XKBD_OVERLAY        \0808     00015144-R\1F07DISP\2D0A
XKBD_PUSHBACK        \0808    0002E31C-R\1E07INPUT\2A0FHISTORY\4007
XKBD_PUTC        \0808\10080000F08C-R\2207BIND\2D10\1414DISPLAY\580DFILE\6A0A
X        \0808\1010\2020     INPUT\1410SEARCH\600DMSGS\710A
XKBD_PUTS        \0808\10080000F154-R\2207BIND\2D0A
XKBD_REPLAYING        \0808   0002F4B0-R\1D07INPUT\290FDISPLAY\3F0DEXEC\500A
XKBD_REPLY        \0808\10070002E810-R\2107INPUT\2D0FBIND\4010EVAL\1411XEC\680A
V
X        \0808\1010\2020     INPUT\4A0FMAP\5C11MODES\7209
XKBD_SEQ        \0808\10090002D9D4-R\2307INPUT\2F0FBIND\4210EXEC\5610\3C0E
X        \0808\1010\2020     LINE\4910MAIN\5D10OPERS\7209
X        \0808\1010\2020     SELECT\4B08
XKBD_SEQ_NOMAP        \0808   0002DA60-R\1D07INPUT\290FBIND\3C10EVAL\500A
XKBD_SHOW_RESPONSE        \08070002E198-R\1907INPUT\250FHISTORY\3B0D\280E
XKBD_STRING        \0808\10060002E3A4-R\2007INPUT\2C0FEVAL\3F10FILEC\540FMODES
V\6809
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   46
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
X        \0808\1010\2020     SEARCH\4B0ETAGS\5D0A
XKBD_UNQUERY        \0808     0000F758-R\1F07BIND\2A10INPUT\3F09
XKBINDTBL        \0808\100800006110-R\2207EXTERNS\300DBIND\410A
XKBM_STARTED        \0808     0002F680-R\1F07INPUT\2B0FLINE\3E0A
XKBS        \0808\100D000065F4-R    WK-MAIN\3210EVAL\4610FILE\5A10LIN\140B
X        \0808\1010\2020  WK-MAIN\4910MAP\5C0B
XKCHARS        \0808\100A000068B4-R    WK-MAIN\2F10LINE\430D\2817REGIO\3E09
XKCOD2ESCAPE_SEQ        \0808 0000EAA8-R\1B07BIND\2610\1414EVAL\4E10MAP\610B
XKCOD2FNC        \0808\10080000EC38-R\2207BIND\2D10HISTORY\440DINPUT\560FINSER
V\1509
X        \0808\1010\2020     LINE\4910MAIN\5D10OPERS\7209
X        \0808\1010\2020     SELECT\140FPAWN\5E09
XKCOD2PSTR        \0808\10070000EA54-\2108BIND\2C10SELECT\4208
XKDONE        \0808\100B000333D0-R\2507LI\3012FIL\4411INPUT\590F\3C0E
X        \0808\1010\2020     REGION\4B08
XKEYSTROKE        \0808\10070002D828-R\2107INPUT\2D0FBASIC\1410IND\5410CSRCH
V\6909
X        \0808\1010\2020     EXEC\4910HISTORY\600DINSERT\7308
X        \0808\1010\2020     SPAWN\4A0FWINDOW\5F08
XKEYSTROKE8        \0808\10060002D844-R\2007INPUT\2C0FBUFFE\2108\2808SEARCH
V\5607
XKEYSTROKE_AVAIL        \0808 0002D8BC-R\1B07INPUT\270FDISPLAY\3D0DEVA\4E0B
XKEYSTROKE_RAW8        \0808  0002D880-R\1C07INPUT\280FCSRCH\3C0FEVAL\4F10INSER
V\3D09
XKILLBUFFER        \0808\100600011F5C-\2008\2D14EXTERNS\4207
XKILLC        \0808\100B000068B8-R\2507MAIN\3010BIND\4410EXE\5811HISTORY\6F07
X        \0808\1010\2020     INPUT\1411SER\1509
XKILLREGION        \0808\100600040FC0-R\2007\2D14OPERS\4009
XKILLREGIONMAYBESAVE             00040FEC-R\1707\2D06\240D\1414 WORD\4A0A
XKINSERT        \0808\100900033574-R\2307LINE\2E10FIL\1411INPU\5710\3C0E
X        \0808\1010\2020     REGION\4B08
XKINSERTLATER        \0808    00033518-\1E08LINE\2910REGION\3F08
XKLINES        \0808\100A000068BC-R    WK-MAIN\2F10LINE\430D\2817REGIO\3E09
XKREGCIRCULATE        \0808   000338B4-R\1D07LIN\2811\1414REGION\5208
XKREGFLAG        \0808\1008000068C0-R    WK-MAIN\2D10EXEC\4110LINE\550D\3C11
X        \0808\1010\2020     REGION\4B08
XKREGWIDTH        \0808\1007000068C4-R    WK-MAIN\2C10LINE\400D\2811
XKSETUP        \0808\100A00033390-R\2407LINE\2F10FIL\1411INPUT\580FREGION\6D08
V
XKWRITE        \0808\100A000285EC-R\2407FIL\2F11OPERS\4409
XLALLOC        \0808\100A00032604-R\2407LINE\2F10BUFFE\2108\4C07FILE\5810\3C0E
V
X        \0808\1010\2020     UNDO\490A
XLASTCHAR        \0808\10080000BC48-\2208BASIC\2E0FINSERT\430EREGION\5708
XLASTCMD        \0808\1009000068C8-R    WK-MAIN\2E10INPUT\430C\2811
XLASTFILEEDITED        \0808  000068CC-R    WK-FILE\270D\1411
XLASTKEY        \0808\1009000068D0-R    WK-MAIN\2E10BASIC\1410UFFER    \5C0AEVA
VL\6A0A
X        \0808\1010\2020     EXEC\4910INPUT\5E0CWK-MAIN\710A
X        \0808\1010\2020     ONELINER\140DPERS\5E0FSEARCH\7308
XLASTNONWHITE        \0808    0000BAE8-R\1E07BASIC\2A0FEXTERNS\4007
XLAST_SLASH        \0808\10060003BCA8-R\2007PAT\2B11MAIN\3F0A
XLAST_SRCH_DIREC        \0808 000068D4-R    WK-MAIN\2610EVAL\3A10ISEARCH\510A
V\3C11
X        \0808\1010\2020     SEARCH\4B08
XLDELETE        \0808\100900032E1C-R\2307LIN\2E11BIND\4210EVAL\5610INSERT\6C08
V
X        \0808\1010\2020     MAP\4811ONELINER\610CRANDOM\7308
X        \0808\1010\2020     REGION\4B0ESELECT\5F0EWORD\710A
XLENGTHEN_PATH        \0808   0003C37C-R\1D07\2814BUFFE\2108\4507FILE\5010FILEC
V\6509
X        \0808\1010\2020     MAIN\4910PATH\5D10RANDOM\7308
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   47
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XLFREE        \0808\100B0003269C-R\2507LIN\3011BUFFE\2108\4D07FILEC\590FUNDO
V\6C0A
XLIB$FREE_EF        \0808     0004D358-RX\2006LIBRTL\2C0EVMSPIPE\4107
XLIB$GET_EF        \0808\10060004D354-RX\2106LIBRTL\2D0EVMSPIPE\4207
XLIB$SPAWN        \0808\10070004D35C-RX\2206LIBRTL\2E0E\4114VMSPIPE\5707
XLIB$SYS_TRNLOG        \0808  0004D360-RX\1D06LIBRTL\290ETERMIO\3D08
XLIB$WAIT        \0808\10080004D364-RX\2306LIBRTL\2F0ERANDOM\4308
XLINEPUTAFTER        \0808    000339D4-\1E08LINE\2910EXTERNS\4007
XLINEPUTBEFORE        \0808   000339B8-R\1D07LINE\2810EXTERNS\3F07
XLINES_DELETED        \0808   000068D8-R    WK-MAIN\2810LINE\3C0D\2817OPERS
V\6509
XLINEUNDO        \0808\100800048AE8-R\2207\2D14EXTERNS\4407
XLINE_COUNT        \0808\10060003D2A8-R\2007RANDOM\2D0EDISPLAY\420DFILEC\540FGL
VOBALS\6A07
X        \0808\1010\2020     LINE\4910UNDO\5D10WINDOW\7308
XLINE_HEIGHT        \0808     00016B84-R\1F07DISPLAY\2D0DBASIC\3F0F\2814ONELINE
V\4B07
X        \0808\1010\2020     WINDOW\4B08
XLINE_NO        \0808\10090003D2CC-R\2307RANDOM\300EBUFFE\2108\4B07DISPLAY\590D
VEXEC\6A0A
X        \0808\1010\2020     FILE\4910ONELINER\610CREGION\7308
X        \0808\1010\2020     SELECT\4B0ETAGS\5D0A
XLINE_REPORT        \0808     0003D240-R\1F07RANDOM\2C0EGLOBALS\410DLINE\5210UN
VDO\660A
XLINSERT        \0808\10090003290C-R\2307LINE\2E10BIND\4210DISPLAY\590DEVAL
V\6A0A
X        \0808\1010\2020     INPUT\1411SER\150FLINE\710A
X        \0808\1010\2020     ONELINER\4D0CREGION\5F0EWORD\710A
XLISTBUFFERS        \0808     00012D88-R\1F07\2D06\2C0EEXTERN\4108
XLISTMODES        \0808\100700037328-R\2107\2D14EXTERN\4308
XLISTSTUFF        \0808\10070003CF54-R\2107RANDOM\2E0EBIND\4010BUFFE\3508\5D07E
VVAL\680A
X        \0808\1010\2020     LINE\4910MAIN\1412P\700B
X        \0808\1010\2020     MODES\4A0FTAG\130B
XLISTVARS        \0808\100800018FA0-R\2207EVAL\2D10EXTERN\4408
XLIST_MAJORMODES        \0808 00038CE8-R\1B07\2714EXTERN\3D08
XLIST_OF_MODES        \0808   00037E8C-R\1D07\2914EVAL\3C0A
XLLINEREGION        \0808     0003A17C-R\1F07ONELINER\2E0COPERS\3F09
XLNEWLINE        \0808\100800032BE4-R\2207\2D14DISPLAY\440DEVAL\5510INSERT\6B08
V
X        \0808\1010\2020     LINE\4910ONELINER\610CRANDOM\7308
X        \0808\1010\2020     WORD\490A
XLOADKREG        \0808\100800034108-R\2207LINE\2D10EXTERNS\4407
XLOWERREGION        \0808     00041CD0-R\1F07\2C14OPERS\3F09
XLREGEXEC        \0808\100800040E70-R\2207REGEXP\2F0EBASI\4210FENCES\140FINDER
V\4A08
X        \0808\1010\2020     MODES\4A0FSEARCH\5F0ETAG\270B
X        \0808\1010\2020     WORD\490A
XLREMOVE        \0808\100900032758-R\2307LIN\2E11BUFFE\2108\4B07FILEC\570F\3C0E
V
XLSPRINTF        \0808\1008000189B4-R\2207DISPLAY\300DBIND\4110BUFFE\3508\3C15
V
X        \0808\1010\2020     EVAL\1411XEC\5D10FILE\710A
X        \0808\1010\2020     FILEC\1411NDERR\600DINPUT\7209
X        \0808\1010\2020     ISEARCH\4C0DMODES\5E0FOPER\140A
X        \0808\1010\2020     SPAWN\4A0FTAGS\5D10VERSIO\2A08
X        \0808\1010\2020     VMS2UNIX\4D06
XLSTRINSERT        \0808\100600032880-R\2007LINE\2B10REGION\4108
+-+-+-+-+-+-+-+-  END  OF PART 120 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 121 -+-+-+-+-+-+-+-+
XLTEXTFREE        \0808\100700032718-R\2107LIN\2C11UNDO\400A
XL_ITOA        \0808\100A0001C628-R\2407EVAL\2F10MODES\4409
XMACARG        \0808\100A0001E774-R\2407EXEC\2F10BIND\4310EVAL\5710LINE\6B0A
X        \0808\1010\2020     OPERS\4A09
XMACBUG        \0808\100A000068DC-R    WK-MAIN\2F10EVAL\430D\2811
XMACLITERALARG        \0808   0001E7C4-R\1D07EXEC\2810MAP\3B0B
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   48
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XMACROIZE        \0808\10080001E68C-R\2207EXEC\2D10INPUT\4209
XMACRO_N_BUFNAME        \0808 000020CC-R\1B07MAIN\2610EXEC\3A0A
XMAIN        \0808\100C0000856C-R\2607\310E
XMAJORMODES_BUFNAME        \0806000020D8-R\1807MAIN\230E  MODES\3809
XMAKENAME        \0808\100800027BA0-R\2207FIL\2D11BUFFE\2108\2815
XMAKE_BP        \0808\10090001324C-R\2307BUFFE\0D08\3707EXEC\420A
XMAKE_CURRENT        \0808    00011A1C-R\1E07BUFFE\0D08\1414\4607FINDER\290EMAI
VN\650A
X        \0808\1010\2020     WINDOW\4B08
XMAP        \0808\100D00034710-R\2707\3114EXTERNS\4907
XMAPBANG_BUFNAME        \0808 000020E8-R\1B07MAIN\2610MAP\390B
XMAPPED_C        \0808\1008000350E0-R\2207MAP\2C11INPUT\4209
XMAPPED_C_AVAIL        \0808  00035090-R\1C07MAP\2611EXEC\3B10INPUT\500F\3C0E
XMAPPED_KEYSTROKE        \08080002D808-R\1A07INPUT\260FINSER\1509
XMAPPED_UNGOTC_AVAIL             000350B8-R\1707MAP\210B
XMAPUNGETC        \0808\100700034F6C-R\2107MAP\2B11INPUT\410FLINE\540A
XMAP_BANG        \0808\100800034734-R\2207MAP\2C11EXTERNS\4407
XMAP_BUFNAME        \0808     00002100-R\1F07MAIN\2A10MAP\3D0B
XMARK        \0808\100C000068E0-R    WK-MAIN\3110BASIC\1410IND\2811UFFER    `20
V  `20
X        \0808\1010\2020     FENCES\140FILE\5D10INPUT\7209
X        \0808\1010\2020     INSERT\4B0ELINE\5D0DWK-MAIN\710A
X        \0808\1010\2020     ONELINER\140DPERS\5E0FRANDOM\7308
X        \0808\1010\2020     REGION\4B0ESEARCH\1410LECT\7308
X        \0808\1010\2020     UNDO\4910WINDOW\140FORD\710A
XMARKWFMODE        \0808\100600028C58-R\2007FIL\2B0B
XMATCHFENCE        \0808\100600025D58-R\2007FENCES\2D0EEXTERN\1508
XMATCHFENCEBACK        \0808  00025D8C-R\1C07FENCES\290EEXTERN\1508
XMAYBE_PATHNAME        \0808  0003C9E4-R\1C07PATH\2710FIL\3B11\280E
XMAYNEEDUNDO        \0808     000483B0-R\1F07\2A14EVAL\1411XEC\5210GLOBALS\6907
V
XMESSAGES_BUFNAME        \080800002110-R\1A07MAIN\2510MSGS\390A
XMINIEDIT        \0808\1008000068E8-R    WK-MAIN\2D10DISPLAY\440DINPU\560D\3C11
V
XMKLOWER        \0808\10090001CB44-\2308EVAL\2E10\1414FILE\5610INPUT\6B09
X        \0808\1010\2020     MODES\4A0FTAG\1310 VMS2UNIX\7506
XMKTRIMMED        \0808\10070001CB7C-R\2107EVAL\2C10BUFFE\2108\2815
XMKUPPER        \0808\10090001CB0C-\2308EVAL\2E10FILEC\430FGLOB\5610INPUT\6B09
V
X        \0808\1010\2020     PATH\4910VMS2UNIX\6106
XMK_TO_VCOL        \0808\100600014F30-R\2007DISPLAY\2E0D\1414RANDOM\5508
XMLERASE        \0808\100900018628-R\2307DISPLAY\310DBIND\4210BUFFER\580ECRYPT
V\6B09
X        \0808\1010\2020     FILE\1414C\5E0FINPUT\7209
X        \0808\1010\2020     INSERT\140FSEARCH\600DMAIN\710A
X        \0808\1010\2020     MODES\4A0FONELINER\140DPER\280A
X        \0808\1010\2020     RANDOM\4B08
XMLERROR        \0808\100900018958-\2308DISPLAY\310DFILE\4210FILEIO\5808
XMLFORCE        \0808\100900018714-R\2307DISPLAY\310DBASIC\430FBIND\5610BUFFE
V\4908`20
X        \0808\1010\2020     DISPLAY\4C0DEVAL\5D10EXEC\710A
X        \0808\1010\2020     FILE\1414C\2813IO\7308
X        \0808\1010\2020     FINDERR\4C0DGLOBALS\600DHISTORY\7407
X        \0808\1010\2020     INPUT\1410SEARCH\600DLINE\710A
X        \0808\1010\2020     MAIN\1412P\2812ODES\7209
X        \0808\1010\2020     ONELINER\140DPERS\5E0FPATH\710A
X        \0808\1010\2020     RANDOM\140FEGEXP\1411ION\7308
X        \0808\1010\2020     SEARCH\1410LECT\280FPAWN\7209
X        \0808\1010\2020     TAGS\4910UNDO\5D10VERSION\7407
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   49
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
X        \0808\1010\2020     VMSPIPE\4C0DWINDOW\5F0EWORD\710A
XMLPROMPT        \0808\100800018734-R\2207DISPLAY\300DBIND\4110EXEC\5510INPU
V\6A0A
X        \0808\1010\2020     MAIN\4910SPAW\150A
XMLQUICKASK        \0808\10060002CF78-R\2007INPUT\2C0FONELINE\2307
XMLREPLY        \0808\10090002D2C0-R\2307INPUT\2F0FBASIC\1410IND\5610BUFFE\4908
V`20
X        \0808\1010\2020     CRYPT\1410SRCH\5E0FEVAL\710A
X        \0808\1010\2020     EXEC\4910FILE\1412NDERR\7407
X        \0808\1010\2020     INSERT\4B0EONELINER\610CRANDOM\7308
X        \0808\1010\2020     REGION\4B0ESPAW\130F WINDOW\7308
XMLREPLY_DIR        \0808     0002A1FC-\1F08FILEC\2B0FRANDOM\4008
XMLREPLY_FILE        \0808    00029E9C-R\1E07FILEC\2A0FEX\1311 FILE\5110OPERS
V\6609
XMLREPLY_NO_BS        \0808   0002D350-R\1D07INPUT\290FSPAWN\3D09
XMLREPLY_NO_OPTS        \0808 0002D3EC-R\1B07INPUT\270FLINE\3A10SELEC\2909
XMLREPLY_REG        \0808     0002D000-R\1F07INPUT\2B0FLINE\3E0A
XMLREPLY_REG_COUNT        \08070002D12C-R\1907INPU\2510EXEC\380A
XMLSAVE        \0808\100A000068F0-R    WK-MAIN\2F10DISPLAY\460A\2811
XMLSAVEC        \0808\100900018640-R\2307DISPLAY\310D\1414MSGS\560A
XMLWARN        \0808\100A00018978-R\2407DISPLAY\320DBUFFE\2108\281BEXEC\6B0A
X        \0808\1010\2020     FILE\1412NDERR\600DINPUT\7209
X        \0808\1010\2020     ISEARCH\4C0DLINE\5D10MAIN\710A
X        \0808\1010\2020     MODES\4A0FTAG\1310 UNDO\710A
XMLWRITE        \0808\100900018670-R\2307DISPLAY\310DBASIC\430FBIND\5610BUFFE
V\4908`20
X        \0808\1010\2020     EVAL\4910FILE\1414C\7209
X        \0808\1010\2020     INPUT\1411SER\150FMAIN\710A
X        \0808\1010\2020     MODES\4A0FOPER\1410RANDOM\7308
X        \0808\1010\2020     REGION\4B0ESEARCH\1410LECT\7308
X        \0808\1010\2020     TAGS\4910UNDO\5D0A
XMLYESNO        \0808\10090002CEE4-R\2307INPUT\2F0FBUFFE\2108\4B07CRYP\2810FILE
V\6A0A
X        \0808\1010\2020     FILEC\4A0FGLOB\5D0A
XMODELINE_FORMAT        \0808 00006970-R    WK-MAIN\2610DISPLAY\3D0DEVAL\4E0D
V\3C11
XMODE_EOL        \0808\1008000373A0-R\2207MODES\2E0FEVA\4111\280E
XMORE_NAMED_CMD        \0808  0001D1F0-R\1C07EXEC\2710FILE\3B10ONELINE\3707
XMOVECURSOR        \0808\10060001857C-\2008DISPLAY\2E0DMSGS\3F0A
XMSG_PUTC        \0808\100800039B10-R\2207MSGS\2D10DISPLAY\4407
XMSTORE        \0808\100A00006974-R    WK-MAIN\2F10EXEC\430D\2811
XMULTIMOTION        \0808     000446B4-R\1F07SELECT\2C0EEXTERNS\410D\280E
XMULTIMOTIONFULLLINE             000449F4-R\1707SELECT\240D EXTERNS\3907
XMULTIMOTIONRECTANGLE            00044A0C-R\1607SELECT\230C  EXTERNS\3807
XMVDNNXTWIND        \0808     0004AB88-R\1F07WINDOW\2C0EEXTERNS\4107
XMVDNWIND        \0808\10080004A9DC-R\2207WINDOW\2F0EEXTERNS\4407
XMVLEFTWIND        \0808\10060004AD34-R\2007WINDOW\2D0EBASIC\400FDISPLAY\560DEX
VTERNS\6A07
X        \0808\1010\2020     INPUT\4A09
XMVRIGHTWIND        \0808     0004AD1C-R\1F07WINDOW\2C0EDISPLAY\410DEXTERNS
V\550DINPUT\6709
XMVUPNXTWIND        \0808     0004ABC8-R\1F07WINDOW\2C0EEXTERNS\4107
XMVUPWIND        \0808\10080004AA00-R\2207WINDOW\2F0EEXTERNS\440D\280E
XM_VALNAMES        \0808\10060000211C-R\2007MAIN\2B10MOD\400B
XNAMEBUFFER        \0808\100600012548-\2008\2D14EXTERNS\4207
XNAMEDCMD        \0808\10080001DB34-R\2207EXEC\2D10EXTERNS\440DLINE\550A
XNAMETBL        \0808\100900002148-R\2307EXTERNS\310DBIND\4210MAIN\560A
XNAMETBLSIZE        \0808     00003128-R\1F07EXTERNS\2D0DMAIN\3E0A
XNAME_CMPL        \0808\100700006978-R\2107MAIN\2C10BIND\4010EVA\5411EXEC\680A
V
X        \0808\1010\2020     FILEC\4A0FINPUT\5E0FMODES\7209
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   50
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XNEWLENGTH        \0808\10070004B754-R\2107WINDOW\2E0EDISPLAY\430DEVAL\5410EXTE
VRNS\6B07
XNEWLINE        \0808\100900030E74-R\2307INSERT\300EEXTERNS\450D\2814WORD\6A0A
V
XNEWMODE        \0808\10090000697C-R    WK-TERMIO\300ESPAWN\430C\2811
XNEWPROCESSGROUP        \0808 0000A7C8-R\1B07MAIN\2610EXTERNS\3D07
XNEWSCREENSIZE        \0808   00018A3C-R\1D07DISPLAY\2B0D\140E
XNEWWIDTH        \0808\10080004B894-R\2207WINDOW\2F0EDISPLAY\440DEVAL\5510EXTER
VNS\6C07
XNEW_REGEXVAL        \0808    000367A0-R\1E07MODES\2A0FMAIN\3D10\280E
XNEXTBUFFER        \0808\1006000118E8-\2008\2D14EXTERNS\4207
XNEXTCHAR        \0808\10080000BBEC-\2208BASIC\2E09
XNEXTTAG        \0808\10090004600C-R\2307TAGS\2E10EXTERN\1708
XNEXTWIND        \0808\10080004A74C-R\2207WINDOW\2F0EEXTERNS\440D\280E
XNEXT_COLUMN        \0808     0000C7C8-R\1F07BASIC\2B0FRANDOM\4008
XNEXT_SW        \0808\10090000C7A4-R\2307BASIC\2F0FINSERT\4408
XNIBUF        \0808\100B00006988-R    WK-TERMIO\320B\1411
XNOBUF        \0808\100B0000698C-R    WK-TERMIO\320B\1411
XNON_FILENAME        \0808    00049160-R\1E07VERSION\2C0DHISTORY\400DMSGS\5110O
VNELINE\4B07
X        \0808\1010\2020     PATH\4910RANDOM\5F08
XNOREMAP        \0808\100900034758-R\2307\2D14EXTERNS\4507
XNOREMAP_BANG        \0808    0003477C-R\1E07MAP\2811EXTERNS\4007
XNOT_INTERRUPTED        \0808 00009CA8-R\1B07MAIN\2610INPUT\3B09
XNOUNMODIFIABLE        \0808  00047F34-R\1C07UNDO\2710SPAWN\3C0F\280E
XNO_COMPLETION        \0808   0002CE58-R\1D07INPUT\290FEVAL\3C10EXEC\5010FILE
V\150A
X        \0808\1010\2020     INPUT\4A0FMAP\5C11MODES\7209
X        \0808\1010\2020     SEARCH\4B08
XNO_MEMORY        \0808\100700009234-R\2107MAIN\2C10BASIC\1410IND\2811UFFE\4908
V`20
X        \0808\1010\2020     EXEC\4910GLOB\5D10HISTORY\7407
X        \0808\1010\2020     LINE\4910SELECT\5F0ETAGS\710A
X        \0808\1010\2020     WINDOW\4B08
XNO_SUCH_FILE        \0808    00026698-R\1E07\2914EXEC\3D0A
XNO_SUCH_FUNCTION        \08080000D52C-R\1A07BIND\2510EXEC\3910GLOBALS\500DOPER
V\120A
XNTILDES        \0808\100900006990-R\2307MAIN\2E10DISPLAY\450DEVAL\560A
XNULLMARK        \0808\100800006998-R\2207MAIN\2D10BASIC\1410UFFE\3508\5E07FILE
V\690A
X        \0808\1010\2020     WINDOW\4B08
XNULLPROC        \0808\10080000A2A4-R\2207MAIN\2D10EXTERNS\440DINSERT\5708
XNULL_TERM        \0808\1007000069A0-R\2107TERMIO\2E0EMAIN\400A
XNULL_T_ICURSOR        \0808  000479B8-\1C08TERMIO\290EDUMBTERM\3F0C\2814VMSVT
V\6409
XNULL_T_PFLUSH        \0808   000479B4-R\1D07TERMIO\2A0EDUMBTERM\400C\2814VMSVT
V\6509
XNULL_T_SCROLL        \0808   000479B0-R\1D07TERMIO\2A0EDISPLAY\140EUMBTERM
V\540C\3C0E
X        \0808\1010\2020     VMSVT\4A09
XNULL_T_SETBACK        \0808  000479A8-R\1C07TERMIO\290EDUMBTERM\3F0C\2814VMSVT
V\6409
XNULL_T_SETFOR        \0808   000479A4-\1D08TERMIO\2A0EDUMBTERM\400C\2814VMSVT
V\6509
XNULL_T_SETPAL        \0808   000479AC-R\1D07TERMIO\2A0EDUMBTERM\400C\2814VMSVT
V\6509
XNULL_T_TITLE        \0808    000479BC-R\1E07TERMIO\2B0EDUMBTERM\410C\2814VMSVT
V\6609
XNULL_T_UNWATCHFD        \0808000479C8-R\1A07TERMIO\270EDUMBTERM\3D0C\2814VMSVT
V\6209
XNULL_T_WATCHFD        \0808  000479C0-R\1C07TERMIO\290EDUMBTERM\3F0C\2814VMSVT
V\6409
XNU_WIDTH        \0808\1008000145DC-R\2207DISPLAY\300DINSERT\430ERANDOM\5708
XOBUF        \0808\100C00006A18-R    WK-TERMIO\330B\1411
XOFFS2COL        \0808\1008000168F4-R\2207DISPLAY\300D\1414ONELINE\3708     RAN
VDOM\6B08
XOLDMODE        \0808\100900006E18-R    WK-TERMIO\300ESPAWN\430C\2811
XONLYWIND        \0808\10080004AD4C-R\2207WINDOW\2F0EEXTERNS\4407
XOPCMD        \0808\100B00006E24-R    WK-MAIN\300D\1414   OPERS\590FSELECT\6E08
V
X        \0808\1010\2020     WORDMOV\4C07
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   51
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XOPENDOWN        \0808\10080002FCD0-R\2207INSERT\2F0EEXTERNS\440D\2814OPER\260A
V
XOPENDOWN_NO_AINDENT             0002FD88-R\1707INSER\240E EXTERNS\3907
XOPENREGION        \0808\100600041368-R\2007\2D14OPERS\4009
XOPENUP        \0808\100A0002FA98-R\2407INSERT\310EEXTERNS\460D\2814OPER\260A
XOPENUP_NO_AINDENT        \08070002FCA4-R\1907INSER\260FEXTERNS\3B07
XOPEN_TERMINAL        \0808   000479CC-R\1D07TERMIO\2A0EMAIN\3C0A
XOPERATTRBOLD        \0808    00044BEC-R\1E07SELECT\2B0EEXTERNS\4007
XOPERATTRCASEQ        \0808   00044E64-R\1D07SELECT\2A0EEXTERNS\3F07
XOPERATTRHC        \0808\100600044D40-R\2007SELECT\2D0EEXTERNS\4207
XOPERATTRITAL        \0808    00044C20-R\1E07SELECT\2B0EEXTERNS\4007
XOPERATTRNO        \0808\100600044C54-R\2007SELECT\2D0EEXTERNS\4207
XOPERATTRREV        \0808     00044C84-R\1F07SELECT\2C0EEXTERNS\4107
XOPERATTRUL        \0808\100600044CB8-R\2007SELECT\2D0EEXTERNS\4207
XOPERBLANK        \0808\10070003B6E8-R\2107OPERS\2D0FEXTERN\1608
XOPERCHG        \0808\10090003B1AC-R\2307OPERS\2F0FEXTERN\160ERANDOM\5808
XOPERCOPY        \0808\10080000A204-R\2207MAIN\2D10EXTERNS\4407
XOPERCRYPT        \0808\10070003B714-R\2107OPERS\2D0FEXTERN\1608
XOPERDEL        \0808\10090003B060-R\2307OPERS\2F0FEXTERN\160ERANDOM\5808
XOPERDETAB        \0808\10070003B680-R\2107OPERS\2D0FEXTERN\1608
XOPERENTAB        \0808\10070003B64C-R\2107OPERS\2D0FEXTERN\1608
XOPERFILTER        \0808\10060003B514-\2008OPERS\2C0FEXTERN\1608
XOPERFLIP        \0808\10080003B2D8-R\2207OPERS\2E0FEXTERN\160ERANDOM\5708
XOPERFORMAT        \0808\10060003B4E0-R\2007OPERS\2C0FEXTERN\1608
XOPERGLOBALS        \0808     0000A240-R\1F07MAIN\2A10EXTERN\4108
XOPERJOIN        \0808\10080003B21C-R\2207OPERS\2E0FEXTERN\160EWORD\550A
XOPERLINECHG        \0808     0003B1E0-R\1F07OPERS\2B0FEXTERN\1608
XOPERLINEDEL        \0808     0003B0C8-R\1F07OPERS\2B0FEXTERN\1608
XOPERLINEYANK        \0808    0003B28C-R\1E07OPERS\2A0FEXTERN\1608
XOPERLIST        \0808\10080003B5B0-R\2207OPERS\2E0FEXTERN\1608
XOPERLOWER        \0808\10070003B330-\2108OPERS\2D0FEXTERN\1608
XOPERLSHIFT        \0808\10060003B35C-R\2007OPERS\2C0FEXTERN\1608
XOPERMOVE        \0808\10080000A218-R\2207MAIN\2D10EXTERNS\4407
XOPEROPENRECT        \0808    0003B740-R\1E07OPERS\2A0FEXTERN\1608
XOPERPPRINT        \0808\10060003B57C-R\2007OPERS\2C0FEXTERN\1608
XOPERPRINT        \0808\10070003B548-R\2107OPERS\2D0FEXTERN\1608
XOPERRSHIFT        \0808\10060003B3E8-R\2007OPERS\2C0FEXTERN\1608
XOPERSELECT        \0808\100600044BB4-R\2007\2D14EXTERNS\4207
XOPERSUBST        \0808\10070003B5E4-R\2107OPERS\2D0FEXTERN\1608
XOPERSUBSTAGAIN        \0808  0003B618-R\1C07OPERS\280FEXTERN\1608
XOPERSYS        \0808\100900006E28-R\2307MAIN\2E10EVAL\4210VERSIO\2B08
XOPERTRANSF        \0808\10060000A22C-R\2007MAIN\2B10EXTERNS\4207
XOPERTRIM        \0808\10080003B6B4-R\2207OPERS\2E0FEXTERN\1608
XOPERUPPER        \0808\10070003B304-\2108OPERS\2D0FEXTERN\1608
XOPERVGLOBALS        \0808    0000A254-R\1E07MAIN\2910EXTERN\4008
XOPERWRITE        \0808\10070003B474-R\2107OPERS\2D0FEXTERN\1608
XOPERYANK        \0808\10080003B248-R\2207OPERS\2E0FEXTERN\160ERANDOM\5708
XOUTPUT_BUFNAME        \0808  0000312C-R\1C07MAIN\2710FINDER\2208\4506SPAW\290A
V
XOUT_OF_MEM        \0808\100600006E2C-R\2007MAIN\2B10BUFFE\2108\4807RANDO\5509
V
XOVERWRITECHARS        \0808  0002FEE8-R\1C07INSERT\290EEXTERNS\3E07
XOVERWSTRING        \0808     00030CD0-R\1F07INSERT\2C0EEXTERNS\4107
XPALSTR        \0808\100A00006E3C-R    WK-MAIN\2F10EVAL\430D\2811
XPARSE_PATHLIST        \0808  0003CD10-R\1C07PATH\2710BIND\3B0A
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   52
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XPAT        \0808\100D00006E40-R    WK-MAIN\3210EVAL\4610GLOBALS\5D0DISEARCH
V\7107
X        \0808\1010\2020  WK-MAIN\4910ONELINER\610CSEARCH\7308
XPATHCAT        \0808\10090003BB08-R\2307PATH\2E10BIND\4210FILE\1414C\6B09
X        \0808\1010\2020     FINDERR\4C0DVMS2UNIX\6106
XPATHLEAF        \0808\10080003BA94-R\2207PATH\2D10BIND\4110FILE\1414C\6A09
X        \0808\1010\2020     MAIN\4910TAGS\5D10VMS2UNIX\7506
XPATH_COMPLETION        \0808 00029844-R\1B07FILEC\270F\1414INPUT\4F09
XPATMATCH        \0808\100800006EC0-R    WK-MAIN\2D10EVAL\410D\2817SEAR\6B0A
XPIPECMD        \0808\1009000457AC-R\2307SPAWN\2F0FEXTERNS\4507
XPLINEREGION        \0808     0003A1A4-R\1F07ONELINER\2E0COPERS\3F09
XPOPDOWN_COMPLETIONS             0000F61C-R\1707BIND\220D   INPUT\3709
XPOPUPBUFF        \0808\1007000125F4-R\2107BUFFE\0D08\1408IND\4010HISTORY\570DM
VSGS\680A
X        \0808\1010\2020     ONELINER\4D0CRANDOM\5F0ESPAWN\7209
XPOPUP_MSGS        \0808\100600039C18-R\2007\2B14DISPLAY\420DMAIN\530A
XPOSWIND        \0808\10090004A820-R\2307WINDOW\300EEXTERNS\4507
XPOUNDC        \0808\100A00006EC4-R\2407MAIN\2F10BIND\4310INPUT\580FMAP\6A0B
XPOUNDC_FUNC        \0808     0000A2BC-R\1F07MAIN\2A10EXTERNS\4107
XPPLINEREGION        \0808    0003A190-R\1E07ONELINER\2D0COPERS\3E09
XPRC2ENGL        \0808\10080000EF24-R\2207BIND\2D10EVA\410B
XPRESSRETURN        \0808     000454BC-R\1F07SPAW\2B10BUFFE\2108\2815
XPREVINDENT        \0808\100600030FAC-R\2007INSER\2D0FFENCES\410E\280E
XPREVIOUS_DIRECTORY        \08060003DA8C-R\1807RANDOM\250EEVAL\370A
XPREVWIND        \0808\10080004A948-R\2207WINDOW\2F0EEXTERNS\440D\280E
XPRE_OP_DOT        \0808\100600006EC8-R    WK-MAIN\2B10BASIC\400FFENCES\550B
V\3C11
X        \0808\1010\2020     OPERS\4A0FSELECT\5F0EUNDO\710A
XPRINTABLECHARS_BUFNAME          00003138-R\1407MAIN\1F0A
XPRINT_USAGE        \0808     00049050-R\1F07VERSION\2D0DMAIN\3E0A
XPROGNAM        \0808\100900006ED0-R\2307MAIN\2E10EVAL\4210VERSIO\2B08
XPROG_ARG        \0808\100800006ED8-R    WK-MAIN\2D10BIND\410D\2817VERSIO\3F08
V
XPSCREEN        \0808\100900006EDC-R    WK-DISPLAY\310A\1411
XPURGE_MSGS        \0808\100600039D34-R\2007\2B14MAIN\3F0A
XPUTAFTER        \0808\10080003399C-\2208LINE\2D10EXTERNS\4407
XPUTBEFORE        \0808\100700033980-R\2107LIN\2C11EXTERNS\4307
XPUTCTEXT        \0808\10080003310C-R\2207LINE\2D10EVAL\410A
XPWD        \0808\100D0003DA1C-R\2707RANDOM\340EEXTERNS\490D\280E
XP_LINES_BUFNAME        \0808 0000314C-R\1B07MAIN\2610ONELINE\2307
XQUICKEXIT        \0808\10070000A038-R\2107MAIN\2C10EXTERNS\4307
XQUIT        \0808\100C0000A08C-R\2607MAIN\3110EXTERNS\480D\280E
XQUITHARD        \0808\10080000A074-R\2207MAIN\2D10EXTERNS\4407
XQUOTE        \0808\100B00031594-R\2507INSERT\320EEXTERNS\470D\280E
XQUOTEC        \0808\100A00006EE0-R\2407MAIN\2F10BIND\4310CSRCH\580FHISTORY
V\6E07
X        \0808\1010\2020     INPUT\1411SER\150FISEARCH\7407
XRDONLY        \0808\100A0000A1D8-R\2407MAIN\2F10EVAL\1411XEC\5710GLOBALS\6E07
V
X        \0808\1010\2020     UNDO\490A
XREADHOOK        \0808\100800006EE4-R    WK-MAIN\2D10EVAL\4110FILE\550D\3C11
XREADIN        \0808\100A00027088-R\2407FILE\2F10BIND\1411UFFE\3508\6007EXEC
V\6B0A
X        \0808\1010\2020     FILE\4910SPAWN\5E0FTAGS\710A
XREADING_MSG_LINE        \080800006EFC-R    WK-MAIN\2510BUFFER    \3F0ADISPLAY
V\500DINPUT\6209
X        \0808\1010\2020  WK-MAIN\4910MAP\5C0B
XREADPATTERN        \0808     00043A20-R\1F07SEARCH\2C0EGLOBALS\410DONELINE
V\3708\3C13
XREAD_JMP_BUF        \0808    00006F00-R    WK-MAIN\2910INPUT\3E0C\2811
XRECTPUTAFTER        \0808    00033A0C-\1E08LINE\2910EXTERNS\4007
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   53
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XRECTPUTBEFORE        \0808   000339F0-R\1D07LIN\2811EXTERNS\3F07
XREG2INDEX        \0808\10070003369C-R\2107LINE\2C10INPUT\410F\280E
XREGCOMP        \0808\10090003E018-R\2307REGEX\300FEVAL\4210FINDER\3608\6006ISE
VARCH\6D07
X        \0808\1010\2020     MODES\4A0FSEARCH\5F0ETAG\270B
XREGERROR        \0808\100800043930-\2208SEARCH\2F0EONELINE\450DREGEXP\5708
XREGEXEC        \0808\1009000400CC-R\2307REGEXP\300EMODES\430F\280E
XREGIONSHAPE        \0808     00006F3C-R    WK-MAIN\2A10BASIC\3F0FEXE\1310 FENC
VES\6808
X        \0808\1010\2020  WK-MAIN\4910OPERS\5E0FREGIO\2A09
X        \0808\1010\2020     SEARCH\1410LECT\5F0EWORD\710A
XREGISTERS_BUFNAME        \080700003158-R\1907MAIN\240F LIN\380B
XRELISTING_B_VALS        \080800006F40-R    WK-MAIN\2510DISPLAY\3C0A\2817MODE
V\620A
XRELISTING_W_VALS        \080800006F44-R    WK-MAIN\2510DISPLAY\3C0A\2817MODE
V\620A
XREMOVE_MODE        \0808     00039740-R\1F07MODES\2B0FEXTERN\1608
XREMOVE_SUBMODE        \0808  0003972C-R\1C07MODES\280FEXTERN\1608
XRENAMEBUFFER        \0808    00012400-\1E08\2B14\3F0E
XRENAME_NAMEBST        \0808  00010090-R\1C07BIND\2710BUFFE\2108`20
XREPLACECHAR        \0808     0002FF40-\1F08INSERT\2C0EEXTERNS\4107
XREPOSITION        \0808\10060004A6C0-R\2007WINDOW\2D0EEXTERNS\420DRANDOM\5508
V
XREPTC        \0808\100B00006F48-R\2507MAIN\3010BIND\440A
XREP_CSRCH        \0808\100700013DE8-R\2107\2D14\4114EXTERNS\5707
XRESETKEY        \0808\100800028C84-R\2207FILE\2D10\140E
XRESIZE        \0808\100A0004B494-R\2407WINDOW\310EEVAL\4310EXTERNS\5A07
XRESPAWN        \0808\100900045574-R\2307\2F14EXTERNS\4507
XRESTWND        \0808\10090004B6D0-R\2307WINDOW\300EEXTERNS\4507
XREVEXIST        \0808\100800006F4C-R    WK-MAIN\2D10DISPLAY\440A\2817VMSV\6A0A
V
XREVSEARCH        \0808\100700043274-R\2107\2E14EXTERNS\4307
XREV_CSRCH        \0808\100700013E88-R\2107\2D14EXTERNS\4307
XRISEARCH        \0808\100800031CD8-R\2207\3014EXTERNS\4407
XROW2WINDOW        \0808\100600016C44-R\2007DISPLAY\2E07
XRPAT        \0808\100C00006F50-R    WK-MAIN\3110EVAL\4510INPU\5A0D\3C11
X        \0808\1010\2020     ONELINER\4D06
XRTFRMSHELL        \0808\1006000454AC-R\2007SPAWN\2C09
XRUN_PROCEDURE        \0808   0001EB50-R\1D07EXEC\2810BUFFE\2108\4507FIL\5011MA
VIN\640A
X        \0808\1010\2020     RANDOM\4B08
XSAME_FNAME        \0808\1006000266B0-R\2007FIL\2B11BUFFE\2108\281BFILEC\6809
X        \0808\1010\2020     TAGS\490A
XSAVEWND        \0808\10090004B6BC-R\2307WINDOW\300EEXTERNS\4507
XSAVE_SHELL        \0808\100600006FD0-R    WK-MAIN\2B10INPUT\400C\2817SPAW\3D0A
V
XSAVE_VALS        \0808\1007000368B0-R\2107MODE\2D10DISPLAY\4307
XSCANBOUNDPOS        \0808    00006FD8-R    WK-MAIN\290D\1414   ONELINER   `20
V\5908SEARCH\6708
XSCANBOUNDRY        \0808     00043AE4-R\1F07SEARCH\2C0EFENCES\400EI\290D
XSCANBOUND_IS_HEADER             00006FE0-R    WK-MAIN\220D\1414   ONELIN\4E0ES
VEARCH\6008
XSCANNER        \0808\100900043308-\2308SEARCH\300EFENCES\440EI\2913ONELI\6E09
V
X        \0808\1010\2020     SEARCH\4B08
XSCRBACKSEARCH        \0808   00042648-R\1D07\2A14EXTERNS\3F07
XSCREEN_STRING        \0808   0002DA94-R\1D07INPUT\290FBUFFE\2108\4507FILEC
V\510F\3C0E
X        \0808\1010\2020     LINE\4910SEARCH\5F0ETAGS\710A
XSCRFORWSEARCH        \0808   00042628-R\1D07\2A14EXTERNS\3F07
XSCRNEXTDW        \0808\10070004B68C-R\2107WINDO\2E0FEXTERNS\4307
XSCRNEXTUP        \0808\10070004B65C-R\2107WINDOW\2E0EEXTERNS\4307
XSCRSEARCHPAT        \0808    000439E0-R\1E07\2E06\2B0EEXTERNS\4007
XSEARCH_NAMEBST        \0808  0001011C-R\1C07BIND\2710BUFFE\2108`20
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   54
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XSEED        \0808\100C00006FE4-R    WK-MAIN\3110EVAL\450D\2811
XSEL_BEGIN        \0808\1007000440B4-R\2107SELECT\2E0E\140E
XSEL_EXTEND        \0808\100600044134-R\2007SELECT\2D0E\140E
XSEL_MOTION        \0808\10060004453C-R\2007SELECT\2D0EEXTERNS\4207
XSEL_REASSERT_OWNERSHIP          00044454-R\1407SELECT\210A    LINE\120E  UNDO
V\470A
XSEL_RELEASE        \0808     00044438-R\1F07SELECT\2C08
XSEL_SETSHAPE        \0808    00044460-R\1E07SELECT\2B08
XSETCHARTYPE        \0808     0004CC6C-R\1F07WORDMOV\2D0DWORD\3E0A
XSETFILLCOL        \0808\100600036684-R\2007MODES\2C0FEXTERN\1608
XSETGLOBMODE        \0808     00037C2C-R\1F07MODES\2B0FEXTERN\1608
XSETLOCMODE        \0808\100600037C00-R\2007MODES\2C0FEXTERN\1608
XSETMARK        \0808\10090000CF6C-R\2307BASIC\2F0FEXE\1310 LINE\5610ONELINE
V\4B07
X        \0808\1010\2020     WORD\490A
XSETM_BY_PREAMBLE        \080800039920-R\1A07MODES\260FBUFFE\2108\4207FI\4D0C
XSETM_BY_SUFFIX        \0808  0003986C-R\1C07MODES\280FBUFFE\2108\4407FILE\4F0A
V
XSETNMMARK        \0808\10070000CC0C-R\2107BASIC\2D0FEXTERNS\4307
XSETTAB        \0808\100A0003658C-R\2407MODES\300FEXTERN\1608
XSETTINGS_BUFNAME        \080800003164-R\1A07MAIN\2510MODES\3A09
XSETUP_HANDLER        \0808   0000A7B4-\1D08MAIN\280A
XSETVAR        \0808\100A0001B314-\2408EVAL\2F10EXTERNS\4607
XSET_BNAME        \0808\100700012FC4-R\2107BUFFE\0D08\1408IND\4010\2814EVAL
V\680A
X        \0808\1010\2020     FILE\4910ONELINER\6106
XSET_CURWP        \0808\10070004A5C0-R\2107WINDOW\2E0EGLOBALS\4307
XSET_DIRECTORY        \0808   0003DAFC-R\1D07RANDOM\2A0EEVAL\3C10\280E
XSET_DOSMODE        \0808     00026FD8-R\1F07FIL\2A11EXTERNS\410D\280E
XSET_END_STRING        \0808  0002DD24-R\1C07INPUT\280FEVAL\3B10EXEC\4F0A
XSET_FEBUFF        \0808\10060002ACB0-R\2007FINDER\0E08\1408LE\3F10MAIN\530A
XSET_LAST_FILE_EDITED            0002699C-R\1607FILE\210C    MAIN\350A
XSET_MAJORMODE_REXP        \080600039A7C-R\1807MODES\240E MAIN\370A
XSET_MODE_VALUE        \0808  00036D8C-R\1C07MODES\280F\140E
XSET_MODTIME        \0808     000265D0-R\1F07FIL\2A11TAGS\3E0A
XSET_PALETTE        \0808     0001C604-R\1F07EVAL\2A0A
XSET_RDONLY        \0808\10060003CE90-R\2007RANDOM\2D0EBIND\3F10EXEC\5310FINDER
V\4A08
X        \0808\1010\2020     HISTORY\4C0DMAIN\5D10MSGS\710A
X        \0808\1010\2020     ONELINER\4D0CRANDOM\5F0ESPAWN\7209
XSET_SUBMODE_VAL        \0808 000399F4-R\1B07MODES\270FMAIN\3A0A
XSET_TERMCHRS        \0808    0000D7CC-R\1E07BIND\2910EXTERN\4008
XSET_UNIXMODE        \0808    00027064-R\1E07FIL\2911EXTERNS\4007
XSET_VARIABLE        \0808    0001B514-R\1E07EVAL\2910MODES\3E09
XSGARBF        \0808\100A00006FE8-R\2407MAIN\2F10BUFFE\2108\4C07DISPLAY\5A0DMSG
VS\6B0A
X        \0808\1010\2020     SPAWN\4A0FWINDOW\5F08
XSHELL_COMPLETE        \0808  0002CE60-R\1C07INPUT\280FBIND\3B10FILEC\500F\3C0E
V
XSHIFTLREGION        \0808    00041628-R\1E07\2B14OPERS\3E09
XSHIFTRREGION        \0808    000414FC-R\1E07\2B14OPERS\3E09
XSHIFTWID_VAL        \0808    00011F30-R\1E07BUFFE\0D08\1408ASIC\3E0FINSERT
V\530EREGION\6708
XSHORTEN_PATH        \0808    0003C040-R\1E07\2914BUFFE\2108\4607DISPLAY\540DFI
VLE\650A
X        \0808\1010\2020     FILEC\4A0FINPUT\5E0FPATH\710A
X        \0808\1010\2020     TAGS\490A
XSHOWCPOS        \0808\10080003D0C8-R\2207RANDOM\2F0EEXTERN\440EFILE\550A
XSHOWHISTORY        \0808     0002C61C-R\1F07\2D14EXTERNS\4107
XSHOWHYPERCMD        \0808    00044E48-R\1E07SELECT\2B0EEXTERNS\4007
XSHOWKREG        \0808\1008000343BC-R\2207LINE\2D10EXTERNS\4407
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   55
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XSHOWLENGTH        \0808\10060003D1FC-R\2007RANDOM\2D0EEXTERNS\4207
XSHOWTAGSTACK        \0808    00046EDC-R\1E07TAGS\2910EXTERN\1708
XSHOWVERSION        \0808     00049144-R\1F07\2D14EXTERNS\4107
XSHOW_TERMCHRS        \0808   0000D8A0-R\1D07BIND\2810EXTERN\3F08
XSHRINKWIND        \0808\10060004B378-R\2007WINDOW\2D0EEXTERNS\420D\280E
XSHRINKWRAP        \0808\10060004B55C-R\2007WINDOW\2D0EBIND\3F10RANDOM\5508
XSIGNAL_WAS        \0808\100600006FEC-R    WK-MAIN\2B0D\1411
XSKIP_BLANKS        \0808     0001C568-R\1F07EVAL\2A10PATH\3E10VMS2UNIX\5606
XSKIP_CBLANKS        \0808    0001C4CC-R\1E07EVAL\2910TAG\3D0B
XSKIP_CSTRING        \0808    0001C50C-R\1E07EVAL\290A
XSKIP_CTEXT        \0808\10060001C524-R\2007EVAL\2B10TAGS\3F0A
XSKIP_STRING        \0808     0001C5A8-R\1F07EVAL\2A10BIND\3E10FILE\5210GLOB
V\660A
X        \0808\1010\2020     PATH\4910VMS2UNIX\6106
XSKIP_TEXT        \0808\10070001C5C0-R\2107EVAL\2C0A
XSLOWREADF        \0808\100700027894-R\2107FILE\2C10\1414MAIN\540A
XSMG$GET_TERM_DATA        \08070004D370-RX\1A06SMGSHR\260EVMSVT\3909
XSMG$INIT_TERM_TABLE_BY_TYPE     0004D374-RX      SMGSHR\0C06\1206  VMSVT\1309
V
XSORTLISTBUFFERS        \0808 000126C4-R\1B07\2906\280EMODE\3B0A
XSOURCE        \0808\100A0000A268-R\2407MAIN\2F10EXTERNS\4607
XSPAWN        \0808\100B00045594-R\2507\3114EXTERNS\4707
XSPAWNCLI        \0808\100800045468-R\2207SPAWN\2E0FEXTERNS\4407
XSPLITWIND        \0808\10070004B244-R\2107WINDOW\2E0EEXTERNS\4307
XSRES        \0808\100C00006FF0-R    WK-MAIN\3110EVAL\450D\2817VMSVT\6E09
XSTARTC        \0808\100A00007008-R\2407MAIN\2F10BIND\4310INSERT\5908
XSTARTUP_FILE        \0808    0000700C-R    WK-MAIN\2910EVAL\3D0D\2811
XSTARTUP_PATH        \0808    00007010-R    WK-MAIN\2910BIND\3D10EVAL\510D\3C11
V
XSTART_KBM        \0808\10070002F748-R\2107INPUT\2D0F\140E
XSTDIN_BUFNAME        \0808   00003170-R\1D07MAIN\280A
XSTENV        \0808\100B0001B4C4-R\2507EVAL\300A
XSTOL        \0808\100C0001CAC4-R\2607EVA\3111EXEC\450A
XSTOPC        \0808\100B00007014-R\2507MAIN\3010BIND\4410INSERT\5A08
XSTOREMAC        \0808\10080001E800-R\2207EXE\2D11\1414EXTERNS\5807
XSTOREPROC        \0808\10070001E8B8-R\2107EXE\2C11EXTERNS\4307
XSTRINGRECT        \0808\100600041380-R\2007REGION\2D0EOPERS\4009
XSTRING_MODE_VAL        \0808 00035E98-R\1B07MODES\270FE\3A13\280E
XSTRING_TO_NUMBER        \080800036970-\1A08MODES\260FINPUT\3A09
XSTRIP_BRACKETS        \0808  00012258-R\1C07BUFFE\0D08\1408IND\3B0A
+-+-+-+-+-+-+-+-  END  OF PART 121 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 122 -+-+-+-+-+-+-+-+
XSTRIP_VERSION        \0808   0003CD84-R\1D07PATH\2810FILE\1414IO\520ETAGS\640A
V
X        \0808\1010\2020     VMS2UNIX\4D06
XSTRMALLOC        \0808\100700009204-R\2107MAIN\2C10BIND\4010DISPLAY\570DEVAL
V\680A
X        \0808\1010\2020     EXEC\4910FINDERR\600DGLOB\710A
X        \0808\1010\2020     MAP\1412ODES\5E0FRANDOM\7308
X        \0808\1010\2020     SELECT\4B0ETAGS\5D10VMS2UNIX\7506
XSTRNCPY0        \0808\10080000A78C-R\2207MAIN\2D10BIND\1411UFFE\3508\5E07EVAL
V\690A
X        \0808\1010\2020     FILE\1412NDERR\600DISEARCH\7407
X        \0808\1010\2020     MODES\4A0FTAG\130B
XSUBSTREGION        \0808     0003A1B8-R\1F07ONELINE\0F08\1406PERS\3F09
XSUBST_AGAIN        \0808     0003A1E0-R\1F07ONELINE\0F08     EXTERNS\4107
XSUBST_AGAIN_REGION        \08060003A1CC-R\1807ONELINE\0F08\1406PERS\3809
XSUSPC        \0808\100B00007018-R\2507MAIN\3010BIND\440A
XSWAPMARK        \0808\10080000D024-R\2207BASIC\2E0FEXE\1310 LINE\5510ONELINE
V\4B07
X        \0808\1010\2020     OPERS\4A0FSELECT\5F0EWORD\710A
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   56
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
XSWBUFFER        \0808\100800011B30-\2208\2F14BIND\4110EVAL\1411XEC\690A
X        \0808\1010\2020     MAIN\1411ODES\5E0FONELINER\7506
X        \0808\1010\2020     RANDOM\4B08
XSWBUFFER_LFL        \0808    00011C40-R\1E07\2F06\2B0E\1414FILE\5110SPAWN\6609
V
XSWEEPHACK        \0808\10070000701C-R    WK-MAIN\2C10CSRCH\410FFENCES\560B
V\3C11
X        \0808\1010\2020     SELECT\4B0EWORDMOV\6007
XSWINDOW        \0808\100900007020-R    WK-MAIN\2E0D\1414   W\580D
XSYS$ASSIGN        \0808\10067FFEDE50\1E09SYS$P1_VECTOR\3407TERMIO\410EVMSVT
V\5409
XSYS$CREMBX        \0808\10067FFEDEB8\1E09SYS$P1_VECTOR\3407VMSPIPE\4207
XSYS$DASSGN        \0808\10067FFEDEE0\1E09SYS$P1_VECTOR\3407TERMIO\410EVMSPIPE
V\1410VT\6809
XSYS$GETDVIW        \0808     7FFEE418\1D09SYS$P1_VECTOR\3307VMSPIPE\4107
XSYS$IMGSTA        \0808\10067FFEDF68\1E09SYS$P1_VECTOR`20
XSYS$PARSE        \0808\10077FFEE230\1F09SYS$P1_VECTOR\3507PATH\4010VMS2UNIX
V\5806
XSYS$QIOW        \0808\10087FFEDE00\2009SYS$P1_VECTOR\1408PAWN\420FTERMIO\570EV
VMSPIPE\6C07
X        \0808\1010\2020     VMSVT\4A09
XSYS$SEARCH        \0808\10067FFEE248\1E09SYS$P1_VECTOR\3407VMS2UNIX\4306
XSYSMAP        \0808\100A000347C4-R\2407\2E14EXTERNS\4607
XSYSMAPPED_C        \0808     00034EC0-R\1F07MAP\2911INPUT\3F09
XSYSMAPPED_C_AVAIL        \080700034F38-R\1907MAP\230F  INPUT\3909
XSYSMAP_BUFNAME        \0808  00003184-R\1C07MAIN\2710MAP\3A0B
XTABOFF        \0808\100A00007024-R    WK-MAIN\2F10DISPLAY\460A\2811
XTABSTOP_VAL        \0808     00011F04-R\1F07BUFFE\0D08\3307DISPLAY\410DMODES
V\530FONELINE\4B07
XTAGFILE_BUFNAME        \0808 00003194-R\1B07MAIN\2610TAGS\3A0A
XTAGSTACK_BUFNAME        \0808000031A0-R\1A07MAIN\2510TAGS\390A
XTAG_FOR_UNDO        \0808    00047E8C-R\1E07\2914FILE\3D10LIN\140B
XTB_ALLOC        \0808\100800046F00-R\2207TBUFF\2E0FINPUT\420F\280E
XTB_APPEND        \0808\100700046FF0-R\2107TBUFF\2D0FBI\4012EXEC\5410FINDER
V\4A08
X        \0808\1010\2020     HISTORY\4C0DINPUT\5E0FTAGS\710A
X        \0808\1010\2020     WORD\490A
XTB_BAPPEND        \0808\1006000471E4-R\2007TBUFF\2C0FFINDER\2208\4906HISTORY
V\560DINPUT\6809
X        \0808\1010\2020     TAGS\1411BUFF\5E0FWORD\710A
XTB_COPY        \0808\1009000470BC-R\2307TBUFF\2F0FHISTOR\450EINPUT\5709
XTB_FREE        \0808\100900046F98-R\2307TBUFF\2F0FFINDER\2208\4C06HISTORY\590D
VINPUT\6B09
X        \0808\1010\2020     MAP\4811WORD\5D0A
XTB_INIT        \0808\100900046F64-R\2307TBUFF\2F0FBIND\4210EXEC\5610FINDER
V\4A08
X        \0808\1010\2020     HISTORY\4C0DINPUT\5E0FMAP\700B
X        \0808\1010\2020     TAGS\4910WORD\5D0A
XTB_INSERT        \0808\100700047038-R\2107TBUFF\2D0FINPU\410A
XTB_LENGTH        \0808\100700047460-R\2107TBUFF\2D0FBIND\4010EXEC\5410HISTORY
V\6B07
X        \0808\1010\2020     INPUT\4A0FMAP\5C11SPAWN\7209
X        \0808\1010\2020     WORD\490A
XTB_PUT        \0808\100A00046FBC-R\2407TBUFF\300FIN\4412MAP\560B
XTB_SAPPEND        \0808\10060004729C-R\2007TBUFF\2C0FBI\3F12EXEC\5310HISTORY
V\6A07
X        \0808\1010\2020     TBUFF\4A09
XTB_SCOPY        \0808\100800047360-R\2207TBUFF\2E0FBIND\4110EVAL\1411XEC\690A
V
X        \0808\1010\2020     FILE\1414C\2811NDERR\7407
X        \0808\1010\2020     HISTORY\4C0DINPUT\5E0FMAP\700B
X        \0808\1010\2020     MODES\4A0FSPAWN\5E09
XTB_STRING        \0808\1007000473E0-R\2107TBUFF\2D0FHISTORY\4307
XTB_UNPUT        \0808\100800047434-R\2207TBUFF\2E0FHISTORY\440DI\560D
XTB_VALUES        \0808\100700047448-R\2107TBUFF\2D0FBIND\4010EVAL\1411XEC\680A
V
X        \0808\1010\2020     FILEC\1411NDERR\600DHISTORY\7407
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   57
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
X        \0808\1010\2020     INPUT\4A0FMAP\5C11MODES\7209
X        \0808\1010\2020     SPAWN\4A0FTAGS\5D10WORD\710A
XTERM        \0808\100C00007028-R\2607VMSVT\320FBIND\4510DISPLAY\140EUMB\710A
X        \0808\1010\2020     EVAL\4910FILE\1414C\7209
X        \0808\1010\2020     INPUT\1411SER\150FMAIN\710A
X        \0808\1010\2020     MAP\1412ODES\5E0FRANDOM\7308
X        \0808\1010\2020     SPAWN\4A0FTERMIO\5F0EWINDOW\7308
XTERMINALCHARS_BUFNAME           000031AC-R\1507MAIN\200B     BIND\340A
XTEST_CMPL        \0808\1007000070A0-R\2107MAIN\2C10BIND\4010FILEC\550FINPUT
V\6909
XTGETC        \0808\100B0002D928-R\2507INPUT\310FMAP\430B
XTGETC_AVAIL        \0808     0002D8F0-R\1F07INPUT\2B0FMAP\3D0B
XTIDY_EXIT        \0808\1007000091E8-R\2107MAIN\2C10BIND\4010FILE\5410TERMIO
V\6A08
X        \0808\1010\2020     VMSVT\4A09
XTOGGLELISTBUFFERS        \080700012814-R\1907\2706\260EEXTERN\3B08
XTOKEN        \0808\100B0001E378-R\2507EXEC\3010EVAL\1411\2813INPUT\6D09
XTOKTYP        \0808\100A0001C650-R\2407EVAL\2F10\1414EXEC\570A
XTOKVAL        \0808\100A0001C744-R\2407E\2F13\1414EXEC\5710INPUT\6C09
XTOSS_TO_UNDO        \0808    00047C60-R\1E07\2914LINE\3D0A
XTRIMLINE        \0808\100800041894-R\2207REGION\2F0EINSERT\430E\280E
XTRIM_REGION        \0808     0004192C-R\1F07\2C14OPERS\3F09
XTRUEM        \0808\100B000070A4-R\2507MAIN\3010EVAL\4410MODES\5909
XTTCLEAN        \0808\100900047668-R\2307TERMIO\300EMAI\4211VERSIO\5908
XTTCLOSE        \0808\1009000475F8-R\2307TERMIO\300EVMSVT\4309
XTTCOL        \0808\100B000070AC-R\2507MAIN\3010DISPLAY\470DMSGS\580A
XTTFLUSH        \0808\1009000476F0-R\2307TERMIO\300EVMSVT\4309
XTTGETC        \0808\100A0004772C-R\2407TERMIO\310EVMSVT\4409
XTTOPEN        \0808\100A00047498-R\2407TERMIO\310EVMSVT\4409
XTTPUTC        \0808\100A0004769C-R\2407TERMIO\310EVMSVT\4409
XTTROW        \0808\100B000070B0-R\2507MAIN\3010DISPLAY\470DMSGS\580A
XTTTYPAHEAD        \0808\100600047864-R\2007TERMIO\2D0EVMSVT\4009
XTTUNCLEAN        \0808\100700047698-R\2107TERMIO\2E08
XTUNGETC        \0808\10090002D8D0-R\2307INPUT\2F0FMAP\410B
XTWIDDLE        \0808\10090003D500-R\2307RANDOM\300EEXTERNS\4507
XUE_CRYPT        \0808\10080001396C-R\2207\2E14\4214FILE\5510FILEIO\6B08
X        \0808\1010\2020     MAIN\4910REGIO\1609
XUE_MAKEKEY        \0808\1006000137D4-R\2007CRYPT\2C0FFILE\3F10REGION\5508
XUE_SETKEY        \0808\100700013848-R\2107CRYPT\2D0FEXTERNS\4307
XUKB        \0808\100D000070B4-R    WK-MAIN\3210EXEC\4610FILE\5A10INPUT\6F09
X        \0808\1010\2020     LINE\490DWK-MAIN\5D10OPERS\7209
X        \0808\1010\2020     REGION\4B08
XUNABBR        \0808\100A00034AB8-\2408MAP\2E11EXTERNS\4607
XUNARG_FUNC        \0808\10060000A2C4-R\2007MAIN\2B10EXTERNS\4207
XUNBINDKEY        \0808\10070000DC9C-R\2107BIND\2C10EXTERNS\4307
XUNCHG_BUFF        \0808\100600013528-R\2007BUFFE\0D08\1414\4807FILE\5310UNDO
V\670A
XUNDISPBUFF        \0808\100600011E64-R\2007BUFFE\0D08\1414\4807WINDOW\5508
XUNDO        \0808\100C000480A0-R\2607\3114EXTERNS\4807
XUNIMPL        \0808\100A0000A1F0-R\2407MAIN\2F10BIND\4310EXTERNS\5A07
XUNIX2VMS_PATH        \0808   00049408-R\1D07VMS2UNIX\2C0CFILEC\3D0F\5014RANDOM
V\6608
XUNIX_PATHLEAF        \0808   0003BA48-R\1D07PATH\2810\140E
XUNKEYSTROKE        \0808     0002D7F0-R\1F07INPUT\2B0FBIND\3E10BUFFE\3508\5B07
VEVAL\660A
X        \0808\1010\2020     EXEC\4910HISTORY\600DINSERT\7308
X        \0808\1010\2020     ISEARCH\4C0DMODES\5E0FONELINER\7506
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   58
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
X        \0808\1010\2020     SPAWN\4A09
XUNMAP        \0808\100B00034A58-R\2507\2F14EXTERNS\4707
XUNMAP_BANG        \0808\100600034A78-R\2007MAP\2A11EXTERNS\4207
XUNMAP_SYSTEM        \0808    00034A98-R\1E07MAP\2811EXTERNS\4007
XUNMARK        \0808\100A000135C0-R\2407BUFFE\0D08\3807EXTERNS\4607
XUNNAMED_BUFNAME        \0808 000031C0-R\1B07MAIN\2610FIL\3A0B
XUNQNAME        \0808\100900027D6C-R\2307FIL\2E11BUFFE\2108\2815
XUNTAGPOP        \0808\100800046C74-R\2207TAGS\2D10EXTERN\1708
XUPDATE        \0808\100A0001536C-R\2407DISPLAY\320DBIND\4310BUFFE\3508\3C15
X        \0808\1010\2020     FENCES\4B0EINPUT\5E0FINSER\1509
X        \0808\1010\2020     ISEARCH\4C0DMAIN\5D10ONELINER\7506
X        \0808\1010\2020     OPERS\4A0FSELECT\5F0EWINDOW\7308
XUPDATELISTBUFFERS        \080700012CD4-R\1907\2706\260E\1414FILE\4C0F HISTORY
V\6307
X        \0808\1010\2020     RANDOM\4B0EWINDOW\5F08
XUPDATE_SCRATCH        \0808  00012D30-R\1C07BUFFE\0D08\1408IND\3B10FINDER\290E
VLINE\630A
X        \0808\1010\2020     MAP\1412ODES\5E0FTAG\130B
XUPMODE        \0808\100A00018264-R\2407DISPLAY\320DBUFFE\2108\4C07EVAL\5710FIN
VDER\4A08
X        \0808\1010\2020     RANDOM\4B0EWINDOW\5F08
XUPPERREGION        \0808     00041CF4-R\1F07\2C14OPERS\3F09
XUPSCREEN        \0808\100800014F18-R\2207DISPLAY\300DEXTERNS\4407
XUSEBUFFER        \0808\100700011848-\2108\2E14EXTERNS\4307
XUSEKREG        \0808\100900033764-R\2307LINE\2E10EXTERNS\4507
XUSERBEEP        \0808\10080003D8E8-R\2207RANDOM\2F0EEXTERNS\4407
XUSER_VARS        \0808\1007000070B8-R    WK-MAIN\2C10EVAL\400D\2811
XVARIABLES_BUFNAME        \0807000031CC-R\1907MAIN\240F EVAL\380A
XVERSION        \0808\1009000070BC-R\2307MAI\2E11EVAL\4210\590E
XVGLOBALS        \0808\10080002BDE0-R\2207\3014EXTERN\4408
XVIDEOATTRIBUTE        \0808  000070C8-R    WK-MAIN\270D\1414   SEARCH\1410LECT
V\6508
XVIDEO_ALLOC        \0808     000146D4-R\1F07DISPLAY\2D0D\140E
XVIEWFILE        \0808\100800026A38-R\2207\2D14EXTERNS\4407
XVILEINIT_BUFNAME        \0808000031D8-R\1A07MAIN\250A
XVILE_CLOSEDIR        \0808   000492E4-\1D08VMS2UNIX\2C0CFILEC\3D0FGLOB\500A
XVILE_FILTER        \0808     000458D0-\1F08SPAWN\2B0FEXTERNS\4107
XVILE_OP        \0808\10090003AE68-R\2307OPERS\2F0F\1414SELECT\5808
XVILE_OPENDIR        \0808    000491F8-\1E08VMS2UNIX\2D0CFILEC\3E0FGLOB\510A
XVILE_READDIR        \0808    000492B4-\1E08VMS2UNIX\2D0CFILEC\3E0FGLOB\510A
XVILE_REFRESH        \0808    0004A71C-R\1E07WINDOW\2B0EEXTERNS\4007
XVILE_TEMPNAM        \0808    000492F8-R\1E07VMS2UNIX\2D06
XVISUAL        \0808\100A0000A27C-R\2407MAIN\2F10EXTERNS\4607
XVMS2UNIX_PATH        \0808   00049CD8-R\1D07\3108\2C0CFILEC\3D0F\500E
XVMS_DIR2PATH        \0808    00049AF0-R\1E07VMS2UNIX\2D0CFILEC\3E09
XVMS_PATH2DIR        \0808    00049B74-\1E08VMS2UNIX\2D06
XVMS_PATHLEAF        \0808    0003B9F8-R\1E07PATH\2910BIND\3D10FILEC\520FVMS2UN
VIX\6906
XVMS_RPIPE        \0808\10070004A0FC-R\2107VMS\2F11FILEIO\4208
XVMS_SYSTEM        \0808\100600045A10-R\2007SPAWN\2C0F\140E
XVSCREEN        \0808\1009000070CC-R    WK-DISPLAY\310A\1411
XVTCOL        \0808\100B000070D0-R    WK-MAIN\3010DISPLAY\470A\2811
XVTINIT        \0808\100A00014670-R\2407DISPLAY\320DMAIN\430A
XVTROW        \0808\100B000070D4-R    WK-MAIN\3010DISPLAY\470A\2811
XWARNINGS        \0808\1008000070D8-R    WK-MAIN\2D10BIND\410D\2817MS\690C
XWHEADP        \0808\100A000070DC-R    WK-MAIN\2F10BUFFER    \490ADISPLAY\5A0DE
VXEC\6B0A
X        \0808\1010\2020     FILE\1412NDERR\600DHISTORY\7407
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   59
X
X
XSymbol        \0808\100AValue\1F0BDefined By\3409Referenc\1606...
X------        \0808\100A\1F10\3006\340D\130A\1D07
X        \0808\1010\2020     LINE\490DWK-MAIN\5D10MODES\7209
X        \0808\1010\2020     ONELINER\4D0CSELECT\5F0EUNDO\710A
X        \0808\1010\2020     WINDOW\4B08
XWINIT        \0808\100B0004B964-R\2507WINDOW\320EMAIN\440A
XWKILLC        \0808\100A000070E0-R\2407MAIN\2F10BIND\4310INPUT\1411SER\1509
XWMINIP        \0808\100A000070E4-R    WK-MAIN\2F10BIND\4310DISPLAY\5A0DHISTOR
V\1408
X        \0808\1010\2020     INPUT\4A0CWK-MAIN\5D10WINDOW\7308
XWORDCOUNT        \0808\10070004CB48-R\2107WORD\2C10EXTERNS\4307
XWPOPUP        \0808\100A0004B4D4-R\2407WINDOW\310EBUFFE\2108`20
XWRAPWORD        \0808\10080004BB88-R\2207\2D14EXTERNS\440DINSERT\5708
XWRITEALL        \0808\100800013600-R\2207BUFFE\0D08\1414\4A07MAIN\5510SPAW
V\150A
XWRITEALLCHANGED        \0808 000135D8-R\1B07BUFFE\0D08\2F07EXTERNS\3D07
XWRITEHOOK        \0808\1007000070E8-R    WK-MAIN\2C10EVAL\4010FILE\540D\3C11
XWRITEMSG        \0808\10080003D8A8-R\2207RANDOM\2F0EEXTERNS\4407
XWRITEOUT        \0808\100800027FA8-R\2207FILE\2D10SPAWN\4209
XWRITEQUIT        \0808\10070000A16C-R\2107MAIN\2C10EXTERNS\4307
XWRITEREGION        \0808     00027FEC-R\1F07FILE\2A10OPERS\3F09
XW_VALNAMES        \0808\1006000031E4-R\2007MAIN\2B10MOD\400B
XYANKLINE        \0808\10080003D82C-R\2207RANDOM\2F0EEXTERNS\4407
XYANKREGION        \0808\100600041B34-R\2007\2D14OPERS\400FSELECT\5508
XZOTBUF        \0808\100A000122E4-R\2407BUFFE\0D08\1408IND\4310\2814EXEC\6B0A
X        \0808\1010\2020     HISTORY\4C0DMAIN\5D10MSGS\710A
X        \0808\1010\2020     RANDOM\4B08
XZOTWP        \0808\100B00010FBC-R\2507BUFFE\0D08\1408IND\4410\2814MAIN\6C0A
XZZQUIT        \0808\100A00009F54-R\2407MAIN\2F10EXTERNS\4607
X_CHARTYPES_        \0808     00007100-R    WK-MAIN\2A10BASIC\1410IND\2811UFFER
V       `20
X        \0808\1010\2020     DISPLAY\140EUMBTERM\610CEVAL\710A
X        \0808\1010\2020     EXEC\4910FILE\1414\290A
X        \0808\1010\2020     HISTORY\4C0DINPUT\5E0FINSER\1509
X        \0808\1010\2020     ISEARCH\4C0DLINE\5D0DWK-MAIN\710A
X        \0808\1010\2020     MAP\1412ODES\5E0FONELINER\7506
X        \0808\1010\2020     PATH\4910REGEXP\1411ION\7308
X        \0808\1010\2020     SEARCH\1410LECT\5F0ETAGS\710A
X        \0808\1010\2020     VMS2UNIX\4D0CWORD\5D10WORDMOV\7407
X_PIPES        \0808\100A00007500-R    WK-VMSPIPE\320A\1411
X__MAIN        \0808\100A00008548-R\2407\2F0E
X
X
X
X`09  Key for special characters above:
X`09`09+--------\0808--+
X`09`09! *  - Undefined   !
X`09`09! U  - Universal   !
X`09`09! R  - Relocatable !
X`09`09! X  - External    !
X`09`09! WK - Weak        !
X`09`09+--------\0808--+
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.EXE;1        \0808 11-SEP-1998 1
V7:06\2208VAX-11 Linker V05-13\3E0DPage   60
X
X        \0808\1010\2011+--------\0808+
X        \0808\1010\2011! Image Synopsis !
X        \0808\1010\2011+--------\0808+
X
XVirtual memory allocated:        \0808\100900000200 0004D5FF\0906400 (316416.
V bytes, 618. pages)
XStack size:        \0808\1010\200D20. pages
XImage header virtual block limits:        \0808\10071.\0A0A (\1207block)
XImage binary virtual block limits:        \0808\10072.\1906619. (  618. blocks
V)
XImage name and identification:        \0808    VILE VILE 8.0
XNumber of files:        \0808\1010\200857.
XNumber of modules:        \0808\1010\200656.
XNumber of program sections:        \0808\100C520.
XNumber of global symbols:        \0808\100D3261.
XNumber of cross references:        \0808\100B4255.
XNumber of image sections:        \0808\100F23.
XUser transfer address:        \0808\100C00008548
XDebugger transfer address:        \0808\10087FFEDF68
XNumber of code references to shareable images:          70.
XImage type:        \0808\1010\2007EXECUTABLE.
XMap format:        \0808\1010\2007DEFAULT WITH CROSS REFERENCE in file DISK$CO
VMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DVILE.MAP
XEstimated map length:        \0808\100D956. blocks
X        \0808\1010\200E+--------\0808-----+
X        \0808\1010\200E! Link Run Statistics !
X        \0808\1010\200E+--------\0808-----+
X
XPerformance Indicators        \0808\100CPage Faults`09CPU Time`09Elapsed Time
V
X--------\0808\1006        \0808\100C\320B`09\0909\470C
X    Command processing:        \0808\1010   578`0900:00:00.52\0C0A93
X    Pass 1:        \0808\1010\200E1084`0900:00:00.9\0C092.51
X    Allocation/Re\0B08:        \0808\1010 52`0900:00:00.04\0C0A12
X    Pass 2:        \0808\1010\200F821`0900:00:01.14\0C082.18
X    Map data after object module synopsis:        \0808 19`0900:00:00.62\0C081
V.01
X    Symbol table output:        \0808\1010    3`0900:00:00.00\0C0B4
XTotal run values:        \0808\1010\20082557`0900:00:03.26\0C086.79
X
XUsing a working set limited to 4120 pages and 2024\0F07of data storage (exclud
Ving image)
X
XTotal number object records read (both passes):   2822
X    of which 24 were in libraries and 186\1A06DEBUG data records containing 81
V452 bytes
X73435 bytes of DEBUG data were written,starting at VBN 620 with 144 blocks all
Vocated
X
XNumber of modules extracted explicitly             = 0
X    with 1 extracted to resolve undefined symbols
X
X4 library searches were for symbols not in the\2D10d
X
XA total of 0 global symbol table records was written
X
XLINK/MAP=VILE/CROSS_REFERENCE/EXEC=VILE.EXE MAIN.OBJ,VMSVT\0A08_LINK/OPT
$ call unpack [.VILE-8_0]VILE.MAP;2 1798232968 "" 639 122 152
$!
$ create 'f'
X/*
X *`09vms2unix.c
X *
X *`09Miscellaneous routines for UNIX/VMS compatibility.
X *
X * $Header: /usr/build/vile/vile/RCS/vms2unix.c,v 1.31 1997/10/06 23:33:39 tom
V Exp $
X *
X */
X#include`09"estruct.h"
X#include`09"edef.h"
X#include`09"dirstuff.h"
X
X#define PERIOD    '.'
X#define COLON     ':'
X#define SEMICOLON ';'
X
Xstatic const char RootDir`5B`5D = "000000";
Xstatic const char DirType`5B`5D = ".DIR";
X
X#if SYS_VMS
X#include`09<starlet.h>
X#include`09<unixio.h>
X
X#define`09zfab`09dirp->dd_fab
X#define`09znam`09dirp->dd_nam
X#define`09zrsa`09dirp->dd_ret.d_name
X#define`09zrsl`09dirp->dd_ret.d_namlen
X#define`09zesa`09dirp->dd_esa
X
XDIR *
Xopendir(char *filename)
X`7B
X`09DIR`09*dirp = typecalloc(DIR);
X`09long`09status;
X
X`09if (dirp == 0)
X`09`09return (0);
X
X`09zfab = cc$rms_fab;
X`09zfab.fab$l_fop = FAB$M_NAM;
X`09zfab.fab$l_nam = `26znam;`09`09/* FAB => NAM block`09*/
X`09zfab.fab$l_dna = "*.*;*";`09/* Default-selection`09*/
X`09zfab.fab$b_dns = strlen(\1809l_dna);
X
X`09zfab.fab$l_fna = filename;
X`09zfab.fab$b_fns = strlen(filename);
X
X`09znam = cc$rms_nam;
X`09znam.nam$b_ess = NAM$C_MAXRSS;
X`09znam.nam$l_esa = zesa;
X`09znam.nam$b_rss = NAM$C_MAXRSS;
X`09znam.nam$l_rsa = zrsa;
X
X`09if (sys$parse(`26zfab) != RMS$_NORMAL) `7B
X`09`09(void)closedir(dirp);
X`09`09dirp = 0;
X`09`7D
X`09return (dirp);
X`7D
X
XDIRENT *
Xreaddir(DIR *dirp)
X`7B
X`09if (sys$search(`26zfab) == RMS$_NORMAL) `7B
X`09`09zrsl = znam.nam$b_rsl;
X`09`09return (`26(dirp->dd_ret));
X`09`7D
X`09return (0);
X`7D
X
Xint
Xclosedir(DIR *dirp)
X`7B
X`09cfree(dirp);
X`09return 0;
X`7D
X
Xchar *
Xtempnam(const char *head, c\120Btail)
X`7B
X`09char`09temp`5BNFILEN`5D;
X`09char`09leaf`5BNFILEN`5D;
X`09return mktemp(
X`09`09strmalloc(
X`09`09`09pathcat(temp,
X`09`09&0209head,
X`09`09&0209strcat(strcpy(leaf, tail), "XXXXXX"))));
X`7D
X#endif
X
X#if OPT_VMS_PATH
X/*
X * These functions are adapted from my port2vms library -- T.Dickey
X */
X
X/********\0808\1010\2020\400E
X * Translate a UNIX-style name into a VMS\160B.        \0808\1009*
X ********\0808\1010\2020\400E/
X
Xstatic`09int`09DotPrefix (char *s);
Xstatic`09char`09CharToVms (int c);
Xstatic`09int`09leading_uc (char *dst, \0B06src);
Xstatic`09int`09is_version (char *s);
X
Xstatic`09int`09leaf_dot;   /* counts dots found in a particular leaf */
Xstatic`09int`09leaf_ver;   /* set if we found a DECshell version */
X
X/*
X * If we have a dot in the second character position, force that to a dollar
X * sign.  Otherwise, keep the first dot in each unix leaf as a\1B08the
X * resulting vms name.
X */
Xstatic int
XDotPrefix(char * s)
X`7B
X`09if (s`5B0`5D != EOS
X`09 `26`26 s`5B1`5D == PERIOD
X`09 `26`26 s`5B2`5D != EOS
X`09 `26`26 strchr("sp", s`5B0`5D))`09/* hack for SCCS */
X`09`09return (-1);
X`09return (0);
X`7D
X
Xstatic char
XCharToVms(int c)
X`7B
X`09if (c == PERIOD) `7B
X`09`09if (leaf_dot++)
X`09`09`09c = '$';
X`09`7D else if (!isAlnum(c) `26`26 !strchr("_-", c)) `7B
X`09`09c = '$';
X`09`7D
X`09return (c);
X`7D
X
Xstatic int
Xleading_uc(char * dst, \0C07src)
X`7B
X`09char`09*base = dst;
X`09register int`09c;
X
X`09while ((c = *src) != EOS `26`26 c != SLASHC) `7B
X`09`09if (isAlpha(c)) `7B
X`09`09`09if (isLower(c))
X`09`09&0209return (0);
X`09`09`7D else if (!strchr("0123456789$_", c))
X`09`09`09return (0);
X`09`09*dst++ = c;
X`09`09*dst   = EOS;
X`09`09src++;
X`09`7D
X`09*dst = EOS;
X`09if ((*base) `26`26 (dst = getenv(base)) != 0) `7B
X`09`09c = strlen(base);
X`09`09dst = skip_blanks(dst);
X`09`09(void)strcpy(base, dst);
X`09`09return (c);
X`09`7D
X`09return (0);
X`7D
X
X/*
X * Returns true if the string points to a valid VMS version indicator, which
X * may begin with a '.' or ';', e.g.,
X *`09;1
X *`09;*
X *`09;-1
X */
Xstatic int
Xis_version(char *s)
X`7B
X`09char `09*t;
X
X`09if (*s == PERIOD
X`09 `7C`7C *s == SEMICOLON) `7B
X`09`09if (*++s == EOS
X`09`09 `7C`7C !strcmp(s, "*")
X`09`09 `7C`7C !strcmp(s, "0")
X`09`09 `7C`7C (strtol(s, `26t, 10) `26`26 *t == EOS))
X`09`09 `09return TRUE;
X`09`7D
X`09return FALSE;
X`7D
X
Xstatic char *
Xpath_suffix(char *path)
X`7B
X`09char *leaf = pathleaf(path);
X`09char *type = strchr(leaf, '.');
X`09if (type == 0)
X`09`09type = skip_string(leaf);
X`09return type;
X`7D
X
Xstatic char *
Xpath_version(char *path)
X`7B
X`09char *vers = strchr(path, SEMICOLON);
X`09if (vers == 0)
X`09`09vers = skip_string(path);
X`09return vers;
X`7D
X
Xchar *
Xunix2vms_path(char *dst, const char *src)
X`7B
X#if !SYS_VMS
X`09char`09tmp2`5BNFILEN`5D;
X#endif
X`09char`09tmp`5BNFILEN`5D,
X`09`09leading`5BNFILEN`5D,
X`09`09*t,
X`09`09*s = strcpy(tmp, src),`09/* ... to permit src == dst */
X`09`09*d = dst,
X`09`09c  = '?';
X`09int`09bracket`09= FALSE,`09/* true when "`5B" passed. */
X`09`09on_top`09= FALSE,`09/* true when no "`5B." lead */
X`09`09node`09= FALSE,`09/* true when node found */
X`09`09device`09= FALSE,`09/* true when \1D06 found */
X`09`09len;
X
X`09/*
X`09 * If VMS 'getenv()' is given an upper-case name, it assumes that it
X`09 * corresponds to a logical device assignment.  As a special case, if
X`09 * we have a leading token of this form, translate it.
X`09 */
X`09if ((len = leading_uc(leading,s)) != 0) `7B
X`09`09s  += len;
X`09`09len = strlen(strcpy(d, leading));
X`09`09while (len > 1 `26`26 d`5Blen-1`5D == ' ')
X`09`09`09len--;
X`09`09if (*s) `7B&0209/* text follows leading token */
X`09`09`09s++;&0209/* skip (assumed) SLASHC */
X`09`09`09if ((len > 1)
X`09`09`09`26`26  (d`5Blen-1`5D == COLON)) `7B
X`09`09&0209on_top = TRUE;
X`09`09`09`7D else if (strchr(s, SLASHC)) `7B`09/* must do a splice */
X`09`09&0209if ((len > 2)
X`09`09&0209`26`26  (d`5Blen-1`5D == RBRACK)) `7B
X`09`09&0209`09bracket++;
X`09`09&0209`09if (d`5Blen-2`5D == PERIOD)
X`09`09&0209&0209/* rooted-device ? */
X`09`09&0209&0209len -= 2;
X`09`09&0209`09else
X`09`09&0209&0209len--;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`7D
X`09`09d`5Blen`5D = EOS;
X`09`09if ((t = strchr(d, COLON)) != NULL) `7B
X`09`09`09if (t`5B1`5D == COLON) `7B
X`09`09&0209node = TRUE;
X`09`09&0209if ((t = strchr(t+2, COLON)) != NULL)
X`09`09&0209`09device = TRUE;
X`09`09`09`7D else
X`09`09&0209device = TRUE;
X`09`09`7D
X`09`09d  += len;
X`09`7D else if (*s == '`7E') `7B`09`09/* process home-directory reference */
X`09`09char *home = getenv("SYS$LOGIN");
X#if !SYS_VMS
X`09`09if (home == 0)
X`09`09`09home = unix2vms_path(tmp2, getenv("HOME"));
X#endif
X`09`09node =
X`09`09device = TRUE;
X`09`09s++;
X
X`09`09len = strlen(strcpy(d, home));
X
X`09`09if (d`5Blen-1`5D == RBRACK) `7B
X`09`09`09bracket++;
X`09`09`09if (strcmp(s, "/")) `7B /* strip right-bracket to allow new levels */
V
X`09`09&0209if (d`5Blen-2`5D == PERIOD)
X`09`09&0209`09len--;
X`09`09&0209d`5Blen-1`5D = PERIOD;
X`09`09`09`7D else `7B
X`09`09&0209s++;
X`09`09&0209len--;
X`09`09`09`7D
X`09`09`7D
X`09`09d += len;
X`09`7D
X
X`09/* look for node-name in VMS-format */
X`09if (!node
X`09`26`26  (t = strchr(s, '!')) != 0
X`09`26`26  (t`5B1`5D == SLASHC `7C`7C \1208EOS)) `7B
X`09`09leaf_dot = DotPrefix(s);
X`09`09while (s < t)
X`09`09`09*d++ = CharToVms(*s++);
X`09`09*d++ = COLON;
X`09`09*d++ = COLON;
X`09`09s++;&0209/* skip over '!' */
X`09`7D
X
X`09/* look for device-name, indicated by a leading SLASHC */
X`09if (!device
X`09`26`26  (*s == SLASHC)) `7B
X`09`09leaf_dot = DotPrefix(++s);
X`09`09if ((t = strchr(s, SLASHC)) == 0)
X`09`09`09t = skip_string(s);
X`09`09else if (t`5B1`5D == EOS)
X`09`09`09on_top = TRUE;
X`09`09while (s < t)
X`09`09`09*d++ = CharToVms(*s++);
X`09`09if (d != dst)
X`09`09`09*d++ = COLON;
X`09`7D
X
X`09/* permit leading "./" to simplify cases in which we concatenate */
X`09if (!strncmp(s, "./", 2))
X`09`09s += 2;
X
X`09/* translate repeated leading "../" */
X`09while (!strncmp(s, "../", 3)) `7B
X`09`09s += 3;
X`09`09if (!bracket++)
X`09`09`09*d++ = LBRACK;
X`09`09*d++ = '-';
X`09`7D
X`09if (!strcmp(s, "..")) `7B
X`09`09s += 2;
X`09`09if (!bracket++)
X`09`09`09*d++ = LBRACK;
X`09`09*d++ = '-';
X`09`7D
X
X`09if (strchr(s, SLASHC)) `7B
X`09`09if (!bracket++)
X`09`09`09*d++ = LBRACK;
X`09`09if (*s == SLASHC) `7B
X`09`09`09s++;
X`09`09`7D else if (!on_top) `7B
X`09`09`09*d++ = PERIOD;
X`09`09`7D
X`09`09while ((c = *s++) != EOS) `7B
X`09`09`09if (c == PERIOD) `7B
X`09`09&0209c = '$';
X`09`09&0209if (*s == SLASHC) /* ignore "./" */
X`09`09&0209`09continue;
X`09`09`09`7D
X`09`09`09if (c == SLASHC) `7B
X`09`09    &0209leaf_dot = DotPrefix(s);
X`09`09&0209if (strchr(s, SLASHC))
X`09`09&0209`09*d++ = PERIOD;
X`09`09&0209else `7B
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09`09`7D else `7B
X`09`09&0209*d++ = CharToVms(c);
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09if (bracket) `7B
X`09`09if (on_top `26`26 d`5B-1`5D == LBRACK) `7B
X`09`09`09(void)strcpy(d, RootDir);
X`09`09`09d += strlen(d);
X`09`09`7D
X`09`09*d++ = RBRACK;
X`09`7D
X`09if (c != EOS `26`26 *s) `7B
X`09`09leaf_dot = DotPrefix(s);
X`09`09while ((c = *s) != EOS) `7B
X`09`09`09if ((leaf_ver = is_version(s)) == TRUE) `7B
X`09`09&0209leaf_dot = TRUE; /* no longer pertinent */
X`09`09&0209(void)strcpy(d, s);
X`09`09&0209*d = SEMICOLON;`09/* make this unambiguous */
X`09`09&0209d += strlen(d);
X`09`09&0209break;
X`09`09`09`7D else `7B
X`09`09&0209*d++ = CharToVms(c);
X`09`09`09`7D
X`09`09`09s++;
X`09`09`7D
X`09`09if (!leaf_dot)
X`09`09`09*d++ = PERIOD;
X`09`09if (!leaf_ver)
X`09`09`09*d++ = SEMICOLON;
X`09`7D
X`09*d = EOS;
X`09return mkupper(dst);
X`7D
X
X/********\0808\1010\2020\400E
X * Returns a pointer to a pathname's suffix iff it is likely a directory's `20
V  *
X ********\0808\1010\2020\400E/
Xchar *
Xis_vms_dirtype(char *path)
X`7B
X`09register char *t = path_suffix(path);
X`09register char *v = path_version(t);
X`09size_t len = (v-t);
X
X`09if (len == sizeof(DirType)-1
X`09 `26`26 !strncmp(t, DirType, len)
X`09 `26`26 (!*v `7C`7C !strcmp(v, ";1"))) `7B
X`09`09return t;
X`09`7D
X`09return 0;
X`7D
X
X/********\0808\1010\2020\400E
X * Returns a pointer to a pathname's leaf iff it is the root directory     `20
V  *
X ********\0808\1010\2020\400E/
Xchar *
Xis_vms_rootdir(char *path)
X`7B
X`09char *type;
X`09if ((type = is_vms_dirtype(path)) != 0) `7B
X`09`09char *leaf = pathleaf(path);
X`09`09size_t len = (type - leaf);
X`09`09if (len == sizeof(RootDir)-1
X`09`09 `26`26 !strncmp(leaf, RootDir, len))
X`09`09 `09return leaf;
X`09`7D
X`09return 0;
X`7D
X
X/********\0808\1010\2020\400E
X * Convert a VMS directory-filename into the corresponding pathname        `20
V  *
X ********\0808\1010\2020\400E/
Xvoid
Xvms_dir2path(char *path)
X`7B
X`09char *s;
X
X`09if ((s = is_vms_rootdir(path)) != 0) `7B
X`09`09*s = EOS;
X`09`7D else `7B
X`09`09if ((s = strrchr(path, RBRACK)) != 0
X`09`09 `26`26 (s`5B1`5D != EOS)) `7B
X`09`09`09char *t;
X`09`09`09if ((t = is_vms_dirtype(s)) != 0) `7B
X`09`09&0209*s = '.';
X`09`09&0209*t++ = RBRACK;
X`09`09&0209*t = EOS;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`7D
X
X/********\0808\1010\2020\400E
X * Convert a VMS pathname into the name of the corresponding directory-file.
V  *
X *        \0808\1010\2020\400C*
X * Note that this returns a pointer to a static buffer which is overwritten`20
V  *
X * by each call.        \0808\1010\201E*
X ********\0808\1010\2020\400E/
X
Xchar *
Xvms_path2dir(const char *src)
X`7B
X`09static`09char`09buffer`5BNFILEN`5D;
+-+-+-+-+-+-+-+-  END  OF PART 122 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 123 -+-+-+-+-+-+-+-+
X`09register char`09*s`09= skip_string(strcpy(buffer, src));
X
X`09if (s != buffer `26`26 *(--s) == RBRACK) `7B
X`09`09(void)strcpy(s, DirType);
X`09`09while (--s >= buffer) `7B
X`09`09`09if (*s == PERIOD) `7B
X`09`09&0209*s = RBRACK;
X`09`09&0209if (s == buffer+1) `7B`09/* absorb "`5D" */
X`09`09&0209`09register char *t = s + 1;
X`09`09&0209`09s = buffer;
X`09`09&0209`09while ((*s++ = *t++) != EOS)
X`09`09&0209&0209/*EMPTY*/;
X`09`09&0209`7D
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09if (*s == LBRACK) `7B&0209/* absorb "`5B" */
X`09`09&0209register char *t = s + 1;
X`09`09&0209if (is_vms_rootdir(t)
X`09`09&0209 `26`26 (s == buffer `7C`7C s`5B-1`5D == COLON)) `7B
X`09`09&0209`09(void) lsprintf(t, "%s%c%s%s",
X`09`09&0209&0209RootDir,
X`09`09&0209&0209RBRACK,
X`09`09&0209&0209RootDir,
X`09`09&0209&0209DirType);
X`09`09&0209`7D else `7B
X`09`09&0209`09while ((*s++ = *t++) != EOS)
X`09`09&0209&0209/*EMPTY*/;
X`09`09&0209`7D
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09return (buffer);
X`7D
X
X/********\0808\1010\2020\400E
X * Translate a VMS-style pathname to a UNIX\1910       \0808    *
X ********\0808\1010\2020\400E/
X
Xchar *
Xvms2unix_path(char *dst, const char *src)
X`7B
X`09char`09current`5BNFILEN`5D;
X`09int`09need_dev = FALSE,
X`09`09have_dev = FALSE;
X`09char`09tmp`5BNFILEN`5D,
X`09`09*output = dst,
X`09`09*base = tmp,
X`09`09*s = strcpy(tmp, src),`09/* ... to permit src == dst */
X`09`09*d;
X
X`09strip_version(s);
X
X`09/* look for node specification */
X`09if ((s = strchr(base, COLON)) != 0
X`09`26`26  (s`5B1`5D == COLON)) `7B
X`09`09while (base < s) `7B
X`09`09`09*dst++ = *base++;
X`09`09`7D
X`09`09*dst++ = '!';
X`09`09base += 2;
X`09`09need_dev = TRUE;
X`09`7D
X
X`09/*
X`09 * Look for device specification.  If not found, see if the path must
X`09 * begin at the top of the device.  In this case, it would be ambiguous
X`09 * if no device is supplied.
X`09 */
X`09if ((s = strchr(base, COLON)) != NULL) `7B
X`09`09*dst++ = SLASHC;
X`09`09while (base < s) `7B
X`09`09`09*dst++ = *base++;
X`09`09`7D
X`09`09base++;&0209`09/* skip over ":" */
X`09`09have_dev = TRUE;
X`09`7D else if (need_dev
X`09`7C`7C`09  ((base`5B0`5D == LBRACK)
X`09`26`26`09   (base`5B1`5D != '-')
X`09`26`26`09   (base`5B1`5D != PERIOD)
X`09`26`26`09   (base`5B1`5D != RBRACK))) `7B`09/* must supply a device */
X`09`09register char`09*a = getcwd(current, NFILEN),
X`09`09&0209*b = strchr(a ? a : "?", COLON);
X`09`09if ((b != 0)
X`09`09`26`26  (b`5B1`5D == COLON)) `7B`09/* skip over node specification */
X`09`09`09a = b + 2;
X`09`09`09b = strchr(a, COLON);
X`09`09`7D
X`09`09if (b != 0) `7B
X`09`09`09*dst++ = SLASHC;`09/* begin the device */
X`09`09`09while (a < b) `7B
X`09`09&0209*dst++ = *a++;
X`09`09`09`7D
X`09`09`09have_dev = TRUE;
X`09`09`7D&0209`09/* else, no device in getcwd! */
X`09`7D
X
X`09/* translate directory-syntax */
X`09if ((s = strchr(base, LBRACK)) != NULL) `7B
X`09`09int bracketed = TRUE;
X`09`09if (s`5B1`5D == RBRACK) `7B
X`09`09`09if (dst != output `26`26 *\1207SLASHC)
X`09`09&0209*dst++ = SLASHC;
X`09`09`09*dst++ = PERIOD;
X`09`09`09if (s`5B2`5D != EOS)
X`09`09&0209*dst++ = SLASHC;
X`09`09`09s += 2;
X`09`09`09d = s;
X`09`09`09bracketed = FALSE;
X`09`09`7D else if (s`5B1`5D == PERIOD) `7B
X`09`09`09if (have_dev `26`26 dst`5B-1`5D != SLASHC)
X`09`09&0209*dst++ = SLASHC;
X`09`09`09s += 2;
X`09`09`09d = s;
X`09`09`7D else if (s`5B1`5D == '-' `26`26 strchr("-.`5D", s`5B2`5D)) `7B
X`09`09`09s++;
X`09`09`09while (*s == '-') `7B
X`09`09&0209s++;
X`09`09&0209*dst++ = PERIOD;
X`09`09&0209*dst++ = PERIOD;
X`09`09&0209if (*s == PERIOD
X`09`09&0209 `26`26 (s`5B1`5D == '-' `7C`7C \0F08RBRACK))
X`09`09&0209`09/* allow "-.-" */
X`09`09&0209`09s++;
X`09`09&0209if (*s == '-')
X`09`09&0209`09*dst++ = SLASHC;
X`09`09`09`7D
X`09`09`09d = s;
X`09`09`7D else if (!strncmp(s+1, RootDir, sizeof(\1007)-1)
X`09`09        `26`26 strchr(".`5D", s`5Bsizeof(RootDir)`5D)) `7B
X`09`09`09s += sizeof(RootDir);
X`09`09`09d = s;
X`09`09`7D else `7B
X`09`09`09d = s;
X`09`09`09*s++ = SLASHC;
X`09`09`7D
X`09`09/* expect s points to the last token before right-bracket */
X`09`09if (bracketed) `7B
X`09`09`09while (*s `26`26 *s != RBRACK) `7B
X`09`09&0209if (*s == PERIOD)
X`09`09&0209`09*s = SLASHC;
X`09`09&0209s++;
X`09`09`09`7D
X`09`09`09if (*s)
X`09`09&0209*s = s`5B1`5D ? SLASHC : EOS;
X`09`09`7D
X`09`7D else `7B
X`09`09if (have_dev `26`26 dst`5B-1`5D != SLASHC)
X`09`09`09*dst++ = SLASHC;
X`09`09d = base;
X`09`7D
X
X`09/*
X`09 * Copy the remainder of the string, trimming trailing "."
X`09 */
X`09for (s = dst; *d; s++, d++) `7B
X`09`09*s = *d;
X`09`09if (*s == PERIOD `26`26 d`5B1`5D == EOS)
X`09`09`09*s = EOS;
X`09`7D
X`09*s = EOS;
X
X`09s = vms_pathleaf(dst);
X
X`09/* SCCS hack */
X`09if (*s == '$') `7B
X`09`09*s++ = PERIOD;
X`09`7D else if (s`5B0`5D == 's' `26`26 s`5B1\0F06$') `7B
X`09`09s`5B1`5D = PERIOD;
X`09`09s += 2;
X`09`7D
X
X`09return mklower(output);
X`7D
X#endif`09/* OPT_VMS_PATH */
$ call unpack [.VILE-8_0]VMS2UNIX.C;1 -
 844720746 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 29 123 152
$!
$ create 'f'
X$! $Header: /usr/build/vile/vile-8.0/RCS/vmsbuild.com,v 1.20 1998/05/30 20:29:
V30 tom Exp $
X$! VMS build-script for vile.  Requires installed C compiler
X$!
X$! Tested with:
X$!`09VMS system version 5.4-2
X$!`09VAX-C version 3.2
X$! and
X$!`09VMS system version 6.1, 6.2
X$!`09DEC C version 5.0, 5.2
X$!
X$! To build vile invoke @vms\1606
X$! To build xvile invoke @vms\170B
X$!
X$!
X$!
X$!      Build the option-file
X$!
X$ open/write optf vms_link.opt
X$ write optf "Identification=""Vile 8.0"""
X$ write optf "basic.obj"
X$ write optf "bind.obj"
X$ write optf "btree.obj"
X$ write optf "buffer.obj"
X$ write optf "crypt.obj"
X$ write optf "csrch.obj"
X$ write optf "display.obj"
X$ write optf "dumbterm.obj"
X$ write optf "eval.obj"
X$ write optf "exec.obj"
X$ write optf "externs.obj"
X$ write optf "fences.obj"
X$ write optf "file.obj"
X$ write optf "filec.obj"
X$ write optf "fileio.obj"
X$ write optf "finderr.obj"
X$ write optf "glob.obj"
X$ write optf "globals.obj"
X$ write optf "history.obj"
X$ write optf "input.obj"
X$ write optf "insert.obj"
X$ write optf "itbuff.obj"
X$ write optf "isearch.obj"
X$ write optf "line.obj"
X$ write optf "map.obj"
X$ write optf "menu.obj"
X$ write optf "modes.obj"
X$ write optf "msgs.obj"
X$ write optf "npopen.obj"
X$ write optf "oneliner.obj"
X$ write optf "opers.obj"
X$ write optf "path.obj"
X$ write optf "random.obj"
X$ write optf "regexp.obj"
X$ write optf "region.obj"
X$ write optf "search.obj"
X$ write optf "select.obj"
X$ write optf "spawn.obj"
X$ write optf "tags.obj"
X$ write optf "tbuff.obj"
X$ write optf "termio.obj"
X$ write optf "undo.obj"
X$ write optf "version.obj"
X$ write optf "vms2unix.obj"
X$ write optf "vmspipe.obj"
X$ write optf "window.obj"
X$ write optf "word.obj"
X$ write optf "wordmov.obj"
X$! Look for the compiler used
X$!
X$ CC = "CC"
X$ if f$getsyi("HW_MODEL").ge.1024
X$ then
X$  arch = "__alpha__=1"
X$  comp  = "__decc__=1"
X$  CFLAGS = "/prefix=all"
X$  DEFS = ",HAVE_ALARM"
X$  if f$trnlnm("SYS").eqs."" then define sys sys$library:
X$ else
X$  arch = "__vax__=1"
X$  if f$search("SYS$SYSTEM:DECC$COMPILER.EXE").eqs.""
X$   then
X$    if f$trnlnm("SYS").eqs."" then define sys sys$library:
X$    DEFS = ",HAVE_SYS_ERRLIST"
X$    write optf "sys$library:vaxcrtl.exe/share"
X$    if f$search("SYS$SYSTEM:VAXC.EXE").eqs.""
X$     then
X$     if f$trnlnm("GNU_CC").eqs.""
X$      then
X$       write sys$output "C compiler required to rebuild vile"
X$       close optf
X$       exit
X$     else
X$      write optf "gnu_cc:`5B000000`5Dgcclib.olb/lib"
X$      comp = "__gcc__=1"
X$      CC = "GCC"
X$     endif`20
X$    else
X$    comp  = "__vaxc__=1"
X$    endif
X$   else
X$    if f$trnlnm("SYS").eqs."" then define sys decc$library_include:
X$    comp  = "__decc__=1"
X$  endif
X$ endif
X$
X$ MKTBLS :== $SYS$DISK:'F$DIRECTORY()\2306.EXE`09! make a foreign command
X$
X$ if "''p1'" .nes. "XVILE" .and. "\1C13.EXE"
X$  then
X$! for regular vile, use these:
X$   SCREEN := vmsvt
X$   TARGET := vile
X$   SCRDEF := "DISP_VMSVT,scrn_chosen"
X$   mmstar = "__vile__=1"
X$ else
X$! for building the Motif version (untested):
X$   SCREEN := x11
X$   TARGET := xvile
X$   SCRDEF := "MOTIF_WIDGETS,XTOOLKIT,DISP_X11,scrn_chosen"
X$   mmstar = "__xvile__=1"
X$!
X$!  Find out which X-Version we're running.  This will fail for older
X$!  VMS versions (i.e., v5.5-1).  Therefore, choose DECWindows XUI for
X$!  default.
X$!
X$   On Error Then GoTo XUI
X$   @sys$update:decw$get_image_version sys$shar\2107xlibshr.exe decw$\2807
X$   if f$extract(4,3,decw$version).eqs."1.0"
X$   then
X$     write optf "Sys$share:DECW$DWTLIBSHR.EXE/Share"
X$   endif
X$   if f$extract(4,3,decw$version).eqs."1.1"
X$   then
X$     write optf "sys$share:decw$xmlibshr.exe/share"
X$     write optf "sys$share:decw$xtshr.exe/share"
X$   endif
X$   if f$extract(4,3,decw$version).eqs."1.2"
X$   then
X$     write optf "sys$share:decw$xmlibshr12.exe/share"
X$     write optf "sys$share:decw$xtlibshrr5.exe/share"
X$   endif
X$   GoTo MAIN
X$!
X$XUI:
X$!
X$   write optf "Sys$share:DECW$DWTLIBSHR.EXE/Share"
X$MAIN:
X$!
X$   write optf "sys$share:decw$xlibshr.exe/share"
X$ endif
X$ close optf
X$! for building the X version, xvile, use these:
X$!SCREEN == x11simp
X$!TARGET == xvile
X$!SCRDEF == "DISP_X11,scrn_chosen"
X$
X$! for building the X-toolkit version:
X$!SCREEN := x11
X$!TARGET := xvile
X$!SCRDEF := "NO_WIDGETS,XTOOLKIT,DISP_X11,scrn_chosen"
X$
X$
X$! used /G_FLOAT with vaxcrtlg/share in vms_link.opt
X$! can also use /Debug /Listing, /Show=All
X$
X$ if f$search("SYS$SYSTEM:MMS.EXE").eqs.""
X$  then
X$
X$   CFLAGS := '\0B06/Diagnostics /Define=("os_chosen","''SCRDEF'''DEFS'") /Inc
Vlude=(`5B`5D)
X$
X$  `09if "''p2'" .nes. "" then goto 'p2
X$
X$
X$ all :
X$`09if f$search("mktbls.exe") .eqs. ""
X$`09then
X$`09`09call make mktbls
X$`09`09link /exec=mktbls/map/cross \1106.obj,SYS$LIBRARY:VAXCRTL/LIB
X$`09endif
X$`09if f$search("nebind.h") .eqs. "" then mktbls cmdtbl
X$`09if f$search("nemode.h") .eqs. "" then mktbls modetbl
X$
X$`09call make main
X$`09call make 'SCREEN
X$`09call make basic
X$`09call make bind
X$`09call make btree
X$`09call make buffer
X$`09call make crypt
X$`09call make csrch
X$`09call make display
X$`09call make dumbterm
X$`09call make eval
X$`09call make exec
X$`09call make externs
X$`09call make fences
X$`09call make file
X$`09call make filec
X$`09call make fileio
X$`09call make finderr
X$`09call make glob
X$`09call make globals
X$`09call make history
X$`09call make input
X$`09call make insert
X$`09call make itbuff
X$`09call make isearch
X$`09call make line
X$`09call make map
X$`09call make menu
X$`09call make modes
X$`09call make msgs
X$`09call make npopen
X$`09call make oneliner
X$`09call make opers
X$`09call make path
X$`09call make random
X$`09call make regexp
X$`09call make region
X$`09call make search
X$`09call make select
X$`09call make spawn
X$`09call make tags
X$`09call make tbuff
X$`09call make termio
X$`09call make undo
X$`09call make version
X$`09call make vms2unix
X$`09call make vmspipe
X$`09call make window
X$`09call make word
X$`09call make wordmov
X$
X$`09link /exec='target/map/cross main.obj, 'SCREEN\0D06vms_link/opt`20
X$`09goto build_last
X$
X$ install :
X$`09WRITE SYS$ERROR "** no rule for install"
X$`09goto build_last
X$`09
X$ clobber :
X$`09if f$search("vile.com") .nes. "" then delete \2008;*
X$`09if f$search("xvile.com") .nes. "" then delete \2109;*
X$`09if f$search("*.exe") .nes. "" then delete *.exe;*
X$! fallthru
X$
X$ clean :
X$`09if f$search("*.obj") .nes. "" then delete *.obj;*
X$`09if f$search("*.bak") .nes. "" then delete *.bak;*
X$`09if f$search("*.lis") .nes. "" then delete *.lis;*
X$`09if f$search("*.log") .nes. "" then delete *.log;*
X$`09if f$search("*.map") .nes. "" then delete *.map;*
X$`09if f$search("*.opt") .nes. "" then delete *.opt;*
X$`09if f$search("ne*.h") .nes. "" then delete ne*.h;
X$`09if f$search("$(MKTBLS)") .nes. "" then delete \2109;
X$! fallthru
X$
X$ build_last :
X$`09if f$search("*.dia") .nes. "" then delete *.dia;*
X$`09if f$search("*.lis") .nes. "" then purge *.lis
X$`09if f$search("*.obj") .nes. "" then purge *.obj
X$`09if f$search("*.map") .nes. "" then purge *.map
X$`09if f$search("*.opt") .nes. "" then purge *.opt
X$`09if f$search("*.exe") .nes. "" then purge *.exe
X$`09if f$search("*.log") .nes. "" then purge *.log
X$! fallthru
X$
X$ vms_link_opt :
X$`09exit
X$
X$! Runs VILE from the current directory (used for testing)
X$ vile_com :
X$`09if "''f$search("vile.com")'" .nes. "" then delete \2208;*
X$`09copy nl: vile.com
X$`09open/append  test_script vile.com
X$`09write test_script "$ temp = f$environment(""procedure"")"
X$`09write test_script "$ temp =\0706-"
X$`09write test_script "`09`09- f$parse(temp,,,""version"",""syntax_only"") -"
V
X$`09write test_script "`09`09- f$parse(temp,,,""type"",""syntax_only"")"
X$`09write test_script "$ vile :== $ 'temp'.exe"
X$`09write test_script "$ define/user_mode sys$input  sys$command"
X$`09write test_script "$ define/user_mode sys$output sys$command"
X$`09write test_script "$ vile 'p1 'p2 'p3 'p4 'p5 'p6 'p7 'p8"
X$`09close test_script
X$`09write sys$output "** made vile.com"
X$`09exit
X$
X$! Runs XVILE from the current directory (used for testing)
X$ xvile_com :
X$`09if "''f$search("xvile.com")'" .nes. "" then delete \2309;*
X$`09copy nl: xvile.com
X$`09open/append  test_script xvile.com
X$`09write test_script "$ temp = f$environment(""procedure"")"
X$`09write test_script "$ temp =\0706-"
X$`09write test_script "`09`09- f$parse(temp,,,""name"",""syntax_only"") -"
X$`09write test_script "`09`09- f$parse(temp,,,""version"",""syntax_only"") -"
V
X$`09write test_script "`09`09- f$parse(temp,,,""type"",""syntax_only"")"
X$`09write test_script "$ xvile :== $ 'temp'xvile.exe"
X$`09write test_script "$ define/user_mode sys$input  sys$command"
X$`09write test_script "$ define/user_mode sys$output sys$command"
X$`09write test_script "$ xvile 'p1 'p2 'p3 'p4 'p5 'p6 'p7 'p8"
X$`09close test_script
X$`09write sys$output "** made xvile.com"
X$`09exit
X$
X$  else
X$   mms/ignore=warning/macro=('comp','mmstar','arch') 'p2
X$  endif
X$ exit
X$ make: subroutine
X$`09if f$search("''p1'.obj") .eqs. ""
X$`09then
X$`09`09write sys$output "compiling ''p1'"
X$`09`09'CC 'CFLAGS 'p1.c
X$`09`09if f$search("''p1'.dia") .nes. "" then delete 'p1.dia;*
X$`09endif
X$exit
X$`09return
X$ endsubroutine
$ call unpack [.VILE-8_0]VMSBUILD.COM;1 -
 302444530 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 19 124 152
$!
$ create 'f'
X/*
X *`09vmspipe.c
X *`09`09adapted from elvis, in turn from
X *`09`09Chris Janton's (chj) VMS Icon port.
X *
X * $Header: /usr/build/vile/vile/RCS/vmspipe.c,v 1.12 1996/02/26 04:24:35 pgf
V Exp $
X *
X */
X
X#include "estruct.h"
X
X#include <starlet.h>
X#include <lib$routines.h>
X
X#include <iodef.h>
X#include <ssdef.h>
X#include <dvidef.h>
X#include <file.h>
X
X#define`09OK(f)`09((f) `26 STS$M_SUCCESS)
X#define`09MAXBFR`09256
X
X/*
X *`09Here we fudge to help the "elvis" program implement rpipe.  The
X *`09routine essentially does an popen using fd as stdin--except that
X *`09few VMS utilities use the 'C' library.`09So we pass in the standard
X *`09input file name and use it if fd is non-zero.
X */
X
Xtypedef struct _descr `7B
X`09`09int`09length;
X`09`09char *`09ptr;
X`09`7D descriptor;
X
Xtypedef struct _pipe `7B
X`09long`09pid;`09`09/* process id of child */
X`09long`09status;`09`09/* exit \1106 of child */
X`09long`09flags;`09`09/* lib$spawn flags */
X`09int`09ichan;`09`09/* MBX channel number */
X`09int`09ochan;
X`09int`09efn;
X`09unsigned running : 1;`09/* 1 if child is\1E09*/
X`7D Pipe;
X
XPipe _pipes`5B_NFILE`5D;`09`09/* one for every open file */
X
X#define NOWAIT`09`091
X#define NOCLISYM`092
X#define NOLOGNAM`094
X#define NOKEYPAD`098
X#define NOTIFY`09`0916
X#define NOCONTROL`0932
X#define SFLAGS`09(NOWAIT`7CNOKEYPAD`7CNOCONTROL)
X
X
X/*
X * Taken from pclose - \0806a pipe
X * Last modified 2-Apr-86/chj
X */
Xstatic int
Xvms_rpclose(int pfile)
X`7B
X`09Pipe *pd = (pfile >= 0 `26`26 \0E06< TABLESIZE(_pipes)) ? `26\0C06`5Bpfile
V`5D : 0;
X`09int status;
X`09int fstatus;
X
X`09if (pd == NULL)
X`09`09return (-1);
X`09fstatus = close(pfile);
X`09sys$dassgn(pd->ichan);
X`09sys$dassgn(pd->ochan);
X`09lib$free_ef(`26pd->efn);
X`09pd->running = 0;
X`09return (fstatus);
X`7D
X
Xstatic int
Xvms_pread (int pfile, char *buffer, int size)
X/* Be compatible when we read data in (handle newlines). */
X`7B
X`09Pipe *pd = (pfile >= 0 `26`26 \0E06< TABLESIZE(_pipes)) ? `26\0C06`5Bpfile
V`5D : 0;
X`09struct `7B
X`09`09short`09status,
X`09`09`09count;
X`09`09int:16;
X`09`7D iosb;
X
X`09/*
X`09 * This is sort of nasty.  The default mailbox size is 256 maxmsg and
X`09 * 1056 bufquo if your sysgen parameters are standard.  Asking for more
X`09 * on the CREMBX command (in rpipe) might be a bad idea as that could
X`09 * cause an "exceeded quota" error.  Since we only return -1 on\2306,
X`09 * there's no hope that the poor user would ever know what went wrong.
X`09 */
X`09if (pd != 0) `7B
X`09`09int`09request = size > MAXBFR ?\0908:\1906- 1;
X`09`09register int`09got;
X
X`09`09if (OK(sys$qiow(0, pd->ochan, IO$_READVBLK, `26iosb, 0, 0,
X`09`09&0209buffer, request, 0, 0\0606))) `7B
X
X`09`09`09if (iosb.status == SS$_ENDOFFILE)
X`09`09&0209return 0;
X`09`09`09got = iosb.count;
X`09`09`09if (got == 0 `7C`7C buffer`5Bgot-1`5D != '`5Cn')
X`09`09&0209buffer`5Bgot++`5D = '`5Cn';
X`09`09`09buffer`5Bgot`5D = EOS;
X`09`09`09return got;
X`09`09`7D
X`09`7D
X`09return -1;
X`7D
X
XFILE *
Xvms_rpipe (const char *cmd, int fd, \190Cinput_file)
X`7B
X`09int`09pfile;`09`09/* the Pfile */
X`09Pipe`09*pd;`09`09/* _pipe database */
X`09descriptor inmbxname;`09/* name of input mailbox */
X`09descriptor outmbxname;`09/* name of mailbox */
X`09char`09inmname`5B65`5D;
X`09char`09outmname`5B65`5D;`09/* mailbox name string */
X`09int`09ochan;`09`09/* mailbox channel number */
X`09int`09ichan;`09`09/* Input mailbox channel number */
X`09int`09efn;
X
X`09struct `7B
X`09`09short`09len;
X`09`09short`09code;
X`09`09void *`09address;
X`09`09void *`09retlen;
X`09`09int`09last;
X`09`7D itmlst;
X
X`09if (!cmd `7C`7C cmd`5B0`5D == EOS)
X`09`09return (0);
X`09lib$get_ef(`26efn);
X`09if (efn == -1)
X`09`09return (0);
X
X`09/* create and open the input mailbox */
X`09if (!OK(sys$crembx(0, `26ichan, 0, 0, \06060))) `7B
X`09`09lib$free_ef(`26efn);
X`09`09return (0);
X`09`7D
X
X`09itmlst.last = inmbxname.length = 0;
X`09itmlst.address = inmbxname.ptr\1006name;
X`09itmlst.retlen = `26inmbxname.length;
X`09itmlst.code = DVI$_DEVNAM;
X`09itmlst.len = 64;
X`09if (!OK(sys$getdviw(0, ichan, 0, `26itmlst, 0, 0, 0, 0))) `7B
X`09`09lib$free_ef(`26efn);
X`09`09return (0);
X`09`7D
X`09inmname`5Binmbxname.length`5D = EOS;
X
X`09/* create and open the output mailbox */
X`09if (!OK(sys$crembx(0, `26ochan, 0, 0, \06060))) `7B
X`09`09lib$free_ef(`26efn);
X`09`09return (0);
X`09`7D
X
X`09itmlst.last = outmbxname.length = 0;
X`09itmlst.address = outmbxname.ptr\1107name;
X`09itmlst.retlen = `26outmbxname.length;
X`09if (!OK(sys$getdviw(0, ochan, 0, `26itmlst, 0, 0, 0, 0))) `7B
X`09`09lib$free_ef(`26efn);
X`09`09return (0);
X`09`7D
X
X`09outmname`5Boutmbxname.length`5D = EOS;
X`09pfile = open(outmname, O_RDONLY, S_IREAD);
X`09if (pfile < 0) `7B
X`09`09lib$free_ef(`26efn);
X`09`09sys$dassgn(ichan);
X`09`09sys$dassgn(ochan);
X`09`09return (0);
X`09`7D
X
X`09/* Save file information now */
X`09pd = `26_pipes`5Bpfile`5D; /* get Pipe pointer */
X`09pd->pid   = pd->status\0D07running = 0;
X`09pd->flags = SFLAGS;
X`09pd->ichan = ichan;
X`09pd->ochan = ochan;
X`09pd->efn   = efn;
X
X`09/* Initiate the command by writing down the input mailbox (SYS$INPUT). */
X
X`09if (fd > 0) `7B
X`09`09char`09pre_command`5B132+12`5D;
X
X`09`09(void)strcpy (pre_command, "DEFINE/USER SYS$INPUT ");
X`09`09(void)strcat (pre_command, input_file);
X`09`09if (!OK(
X`09`09`09sys$qiow(0,
X`09`09&0209ichan,
X`09`09&0209IO$_WRITEVBLK `7C IO$M_NOW,
X`09`09&02090, 0, 0,
X`09`09&0209pre_command, strlen(\140B),
X`09`09&02090, 0, 0, 0))) `7B
X`09`09`09lib$free_ef(`26efn);
X`09`09`09sys$dassgn(ichan);
X`09`09`09sys$dassgn(ochan);
X`09`09`09return (0);
X`09`09`7D
X`09`7D
X
X`09if (!OK(
X`09`09sys$qiow(0,
X`09`09ichan,
X`09`09IO$_WRITEVBLK `7C IO$M_NOW,
X`09`090, 0, 0, cmd, strlen(cmd)\18080, 0))) `7B
X`09`09;
X`09`7D else if (!OK(
X`09`09sys$qiow(0,
X`09`09`09ichan,
X`09`09`09IO$_WRITEOF `7C IO$M_NOW,
X`09`09`090, 0, \0606\0C0C0))) `7B
X`09`09;
X`09`7D else if (!OK(
X`09`09lib$spawn(0,
X`09`09`09`26inmbxname,&0209/* input file */
X`09`09`09`26outmbxname,&0209/* output file */
X`09`09`09`26pd->flags,
X`09`09`090,
X`09`09`09`26pd->pid,
X`09`09`09`26pd->status,
X`09`09`09`26pd->efn,
X`09`09`090, 0, 0, 0))) `7B
X`09`09;
X`09`7D else `7B
X`09`09FILE`09*pp;
X`09`09int`09len;
X`09`09int`09count`09= 0;
X`09`09char`09buffer`5BMAXBFR`5D;
X
X`09`09pd->running = 1;
X
X`09`09/*
X`09`09 * For our application, we need a file-pointer.  Empty the
X`09`09 * pipe into a temporary file.  Unfortunately, this means that
X`09`09 * the application will use 'slowreadf()' to write the data.
X`09`09 */
X`09`09if (pp = tmpfile()) `7B
X`09`09`09for_ever `7B
X`09`09&0209len = vms_pread(pfile, buffer, sizeof(\0F06));
X`09`09&0209if (len <= 0)
X`09`09&0209`09break;
X`09`09&0209fwrite(buffer, sizeof(*\1006), len, pp);
X`09`09&0209count++;
X`09`09`09`7D
X`09`09`09mlforce("`5BRead %d lines from %s `5D", count, cmd);
X`09`09`09vms_rpclose(pfile);
X`09`09`09(void)fflush(pp);
X`09`09`09rewind(pp);
X`09`09`09return pp;
X`09`09`7D
X`09`09return (0);
X`09`7D
X
X`09lib$free_ef(`26efn);
X`09sys$dassgn(ichan);
X`09sys$dassgn(ochan);
X`09return (0);
X`7D
$ call unpack [.VILE-8_0]VMSPIPE.C;1 -
 1128907667 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 13 125 152
$!
$ create 'f'
X/*
X *  Advanced VMS terminal driver
X *
X *  Knows about any terminal defined in SMGTERMS.TXT and TERMTABLE.TXT
X *  located in SYS$SYSTEM.
X *
X *  Author:  Curtis Smith
X *  Last Updated: 07/14/87
X *
X * $Header: /usr/build/vile/vile/RCS/vmsvt.c,v 1.34 1998/05/14 23:17:05 tom Ex
Vp $
X *
X */
X
X#include`09"estruct.h"`09`09/* Emacs' \1506ures&0209*/
X#include`09"edef.h"`09`09/* Emacs' definitions&0209*/
X
X#if`09DISP_VMSVT
X
X#include`09<descrip.h>`09`09/* D\0F06tor definitions`09*/
X#include`09<iodef.h>`09`09/* to get IO$_SENSEMODE&0209*/
X#include`09<ttdef.h>`09`09/* to get TT$_UNKNOWN&0209*/
X
X#include`09<starlet.h>
X#include`09<smgtrmptr.h>`09`09/* to get SMG$K_??? definitions`09*/
X#include`09<smg$routines.h>
X
X/** Forward references **/
Xstatic`09void`09vmsscrollregion (int top, int bot);
Xstatic`09void`09vmsscroll_reg (int from, int to\0806n);
Xstatic`09void`09vmsscroll_delins (int from, int to\0806n);
Xstatic`09void`09vmsopen`09(void);
Xstatic`09void`09vmskopen (void);
Xstatic`09void`09vmskclose (void);
Xstatic`09void`09vmsmove (int row, int col);
Xstatic`09void`09vmseeol`09(void);
Xstatic`09void`09vmseeop`09(void);
Xstatic`09void`09vmsbeep`09(void);
Xstatic`09void`09vmsrev`09(UINT);
Xstatic`09int`09vmscres`09(const char *);
X
Xextern`09int`09eolexist, revexist;
Xextern`09char`09sres`5B`5D;
X
X/** SMG stuff (just like termcap) */
Xstatic`09int`09initialized;
Xstatic`09int`09termtype;
Xstatic`09char *`09begin_reverse;
Xstatic`09char *`09end_reverse;
Xstatic`09char *`09erase_to_end_line;
Xstatic`09char *`09erase_whole_display;
X
Xstatic`09char *`09delete_line;
Xstatic`09char *`09insert_line;
Xstatic`09char *`09scroll_forw;
Xstatic`09char *`09scroll_back;
Xstatic`09char *`09scroll_regn;
X
X/* Dispatch table. All hard fields just point into the terminal I/O code. */
XTERM`09term`09= `7B
X`0924,`09`09&0209/* Max number of rows allowable */
X`09/* Filled in */ 0,`09`09/* Current number of rows used`09*/
X`09132,`09`09&0209/* Max number of columns`09*/
X`09/* Filled in */ 0,`09`09/* Current number of columns`09*/
X`0964,`09`09&0209/* Min margin for extended lines*/
X`098,`09`09&0209/* Size of scroll region`09*/
X`09100,`09`09&0209/* # times thru update to pause */
X`09vmsopen,`09`09`09/* Open terminal at the start`09*/
X`09ttclose,`09`09`09/* Close terminal at end`09*/
X`09vmskopen,`09`09`09/* Open keyboard&0209*/
X`09vmskclose,`09`09`09/* Close keyboard&0209*/
X`09ttgetc,`09`09&0209/* Get character from keyboard`09*/
X`09ttputc,`09`09&0209/* Put character to display`09*/
X`09tttypahead,`09`09`09/* char ready fo\0A06ing`09*/
X`09ttflush,`09`09`09/* Flush output buffers&0209*/
X`09vmsmove,`09`09`09/* Move cursor, origin 0`09*/
X`09vmseeol,`09`09`09/* Erase to end of line&0209*/
X`09vmseeop,`09`09`09/* Erase to end of page&0209*/
X`09vmsbeep,`09`09`09/* Beep&0309`09*/
X`09vmsrev,`09`09&0209/* Set reverse video state`09*/
X`09vmscres,`09`09`09/* Change screen resolution`09*/
X`09null_t_setfor,`09`09`09/* N/A: Set foreground color`09*/
X`09null_t_setback,`09`09`09/* N/A: Set background color`09*/
X`09null_t_setpal,`09`09`09/* N/A: Set palette colors`09*/
X`09null_t_scroll,`09`09`09/* set at init-time&0209*/
X`09null_t_pflush,
X`09null_t_icursor,
X`09null_t_title,
X`09null_t_watchfd,
X`09null_t_unwatchfd,
X`7D;
X
Xstatic`09const`09struct`09`7B
X`09char`09*seq;
X`09int`09code;
X`7D keyseqs`5B`5D = `7B
X`09`7B "`5C33`5BA",  KEY_Up `7D,    \1906A", \1709
X`09`7B "`5C33`5BB",  KEY_Down `7D,  \1906B", \170B
X`09`7B "`5C33`5BC",  KEY_Right `7D, \1906C", \170C
X`09`7B "`5C33`5BD",  KEY_Left `7D,  \1906D", \170B
X`09`7B "`5C33OP",  KEY_KP_F1 `7D, \1906P", \170C
X`09`7B "`5C33OQ",  KEY_KP_F2 `7D, \1906Q", \170C
X`09`7B "`5C33OR",  KEY_KP_F3 `7D, \1906R", \170C
X`09`7B "`5C33OS",  KEY_KP_F4 `7D, \1906S", \170C
X`7D;
X
X/***
X *  ttputs  -  Send a string to\1C06c
X *
X *  Nothing returned
X ***/
Xstatic void
Xttputs(char * string)`09`09`09/* String to write&0209*/
X`7B
X`09if (string)
X`09`09while (*string != EOS)
X`09`09`09ttputc(*string++);
X`7D
X
X/***
X *  putpad_tgoto - 2-argument request
X *
X *  Nothing returned
X ***/
Xstatic void
Xputpad_tgoto(request_code, parm1\07062)
X`7B
X`09char buffer`5B32`5D;
X`09int ret_length;
X`09static int max_buffer_length = sizeof(\1706);
X`09static int arg_list`5B3`5D = `7B 2 `7D;
X`09register char * cp;
X
X`09register int i;
X
X`09if (!initialized) `7B
X`09`09printf("`5Cn");
X`09`09return;
X`09`7D
X
X`09/* Set the arguments into\1308_list array
X`09 */
X`09arg_list`5B1`5D = parm1;
X`09arg_list`5B2`5D = parm2;
X
X`09if ((smg$get_term_data(`09`09/* Get terminal data&0209*/
X`09`09`26termtype,&0209/* Terminal table address`09*/
X`09`09`26request_code,&0209/* R\1206 code&0209`09*/
X`09`09`26max_buffer_length,`09/* Maximum \1A06 \1A06`09*/
X`09`09`26ret_length,&0209/* Return \1306&0209*/
X`09`09buffer,&0209`09/* Capability data \1D06`09*/
X`09`09arg_list)&0209/* Argument list array&0209*/
X
X`09/* We'll know soon enough if this doesn't work`09`09*/
X`09`09`09`26 1) == 0) `7B
X`09`09&0209ttputs("OOPS");
X`09`09&0209return;
X`09`09`09`7D
X
X`09/* Send out resulting sequence`09`09&0209*/
X`09i = ret_length;
X`09cp = buffer;
X`09while (i-- > 0)
X`09`09ttputc(*cp++);
X`7D
X
X
X/***
X *  vmsmove  -  Move the cursor (0 origin)
X *
X *  Nothing returned
X ***/
Xstatic void
Xvmsmove (int row, int col)
X`7B
X`09putpad_tgoto(SMG$K_SET_CURSOR_ABS, row+1, col+1);
X`7D
X
X/***
X *  vmsrev  -  Set the reverse video status
X *
X *  Nothing returned
X ***/
Xstatic void
Xvmsrev(UINT status)
X`7B
X`09if (status)
X`09`09ttputs(begin_reverse);
X`09else
X`09`09ttputs(end_reverse);
X`7D
X
X/***
X *  vmscres  -  Change screen resolution (which it doesn't)
X *
X *  Nothing returned
X ***/
Xstatic int
Xvmscres(const char *res)
X`7B
X`09/* But it could.  For vt100/vt200s, one\1E06 switch from
X`0980 and 132 columns modes */
X`09return 0;
X`7D
X
X/***
X *  vmseeol  -  Erase to end of line
X *
X *  Nothing returned
X ***/
Xstatic void
Xvmseeol(void)
X`7B
X`09ttputs(erase_to_end_line);
X`7D
X
X
X/***
X *  vmseeop  -  Erase to end of page (clear screen)
X *
X *  Nothing returned
X ***/
Xstatic void
Xvmseeop(void)
X`7B
X`09ttputs(erase_whole_display);
X`7D
X
X
X/***
X *  vmsbeep  -  Ring the bell
X *
X *  Nothing returned
X ***/
Xstatic void
Xvmsbeep(void)
X`7B
X`09ttputc(BEL);
X`7D
X
X
X/***
X *  vmsgetstr  -  Get an SMG string capability by name
X *
X *  Returns:`09Escape sequence
X *`09`09NULL`09No escape sequence available
X ***/
Xstatic char *
Xvmsgetstr(int request_code)
X`7B
X`09register char * result;
X`09static char seq_storage`5B1024`5D;
X`09static char * buffer = seq_storage;
X`09static int arg_list`5B`5D = `7B 1, 1 `7D;
X`09int max_buffer_length, ret\0C07;
X
+-+-+-+-+-+-+-+-  END  OF PART 123 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 124 -+-+-+-+-+-+-+-+
X`09/*  Precompute buffer length */
X
X`09max_buffer_length = (seq_storage + sizeof\150C)) - \3606;
X
X`09/* Get terminal commands sequence from master table */
X
X`09if ((smg$get_term_data(`09/* Get terminal data`09`09*/
X`09`09`26termtype,`09/* Terminal table address`09*/
X`09`09`26request_code,`09/* R\1106 code&0209`09*/
X`09`09`26max_buffer_length,/* Maximum \1906 \1906`09*/
X`09`09`26ret_length,`09/* Return \1206&0209*/
X`09`09buffer,&0209/* Capability data \1C06`09*/
X`09`09arg_list)`09/* Argument list array&0209*/
X
X`09/* If this doesn't work, try again with no arguments */
X
X`09`09`26 1) == 0 `26`26
X
X`09`09(smg$get_term_data(`09/* Get terminal data&0209*/
X`09`09`09`26termtype,`09/* Terminal table address`09*/
X`09`09`09`26request_code,`09/* R\1106 code&0309*/
X`09`09`09`26max_buffer_length,/* Maximum \1906 \1906`09*/
X`09`09`09`26ret_length,`09/* Return \1206&0209*/
X`09`09`09buffer)&0209/* Capability data \1C06`09*/
X
X`09/* Return NULL pointer if capability is not available */
X
X`09`09`09`26 1) == 0)
X`09`09&0209return NULL;
X
X`09/* Check for empty result */
X`09if (ret_length == 0)
X`09`09return NULL;
X
X`09/* Save current position so we can return it to caller */
X
X`09result = buffer;
X
X`09/* NIL terminate the sequence for return */
X
X`09buffer`5Bret_length`5D = 0;
X
X`09/* Advance buffer */
X
X`09buffer += ret_length + 1;
X
X`09/* Return capability to user */
X`09return result;
X`7D
X
X
X/** I/O information block definitions **/
Xstruct iosb `7B`09`09`09/* I/O status block&0309*/
X`09short`09i_cond;`09`09/* Condition value&0209`09*/
X`09short`09i_xfer;`09`09/* Transfer count`09&0209*/
X`09long`09i_info;`09`09/* Device information&0209`09*/
X`7D;
Xstruct termchar `7B`09`09/* Terminal characteristics&0209*/
X`09char`09t_class;`09/* Terminal class`09`09`09*/
X`09char`09t_type;`09`09/* Terminal type&0209`09*/
X`09short`09t_width;`09/* Terminal width in characters`09`09*/
X`09long`09t_mandl;`09/* Terminal's mode and length`09`09*/
X`09long`09t_extend;`09/* Extended terminal characteristics`09*/
X`7D;
Xstatic struct termchar tc;`09/* Terminal characteristics`09`09*/
X
X/***
X *  vmsgtty - Get terminal type from system control block
X *
X *  Nothing returned
X ***/
Xstatic void
Xvmsgtty(void)
X`7B
X`09short fd;
X`09int status;
X`09struct iosb iostatus;
X`09$DESCRIPTOR(devnam, "SYS$COMMAND");
X
X`09/* Assign input to a channel */
X`09status = sys$assign(`26devnam, `26fd, 0, 0);
X`09if ((status `26 1) == 0)
X`09`09tidy_exit(status);
X
X`09/* Get terminal characteristics */
X`09status = sys$qiow(`09`09/* Queue and wait&0209*/
X`09`090,&0209`09/* Wait on event flag zero`09*/
X`09`09fd,&0209`09/* Channel to input terminal`09*/
X`09`09IO$_SENSEMODE,&0209/* Get current characteristic`09*/
X`09`09`26iostatus,&0209/* Status after operation`09*/
X`09`090, 0,&0209`09/* No AST service&0209*/
X`09`09`26tc,&0209`09/* Terminal characteristics buf */
X`09`09sizeof(tc),&0209/* Size of the buffer&0209*/
X`09`090, 0, 0, 0);&0209/* P3-P6 unused&0209`09*/
X
X`09/* De-assign the input device */
X`09if ((sys$dassgn(fd) `26 1) == 0)
X`09`09tidy_exit(status);
X
X`09/* Jump out if bad status */
X`09if ((status `26 1) == 0)
X`09`09tidy_exit(status);
X`09if ((iostatus.i_cond `26 1) == 0)
X`09`09tidy_exit(iostatus.i_cond);
X`7D
X
X
X/***
X *  vmsopen  -  Get terminal type and open \1708
X *
X *  Nothing returned
X ***/
Xstatic void
Xvmsopen(void)
X`7B
X`09int`09i;
X
X`09/* Get terminal type */
X`09vmsgtty();
X`09if (tc.t_type == TT$_UNKNOWN) `7B
X`09`09printf("Terminal type is unknown!`5Cn");
X`09`09printf("Try set your terminal type with SET TERMINAL/INQUIRE`5Cn");
X`09`09printf("Or get help on SET TERMINAL/DEVICE_TYPE`5Cn");
X`09`09tidy_exit(3);
X`09`7D
X
X`09/* Access the system terminal definition table for the`09`09*/
X`09/* information of the terminal type returned by IO$_SENSEMODE`09*/
X`09if ((smg$init_term_table_by_type(`26tc.t_type, `26termtype) `26 1) == 0)`20
V`7B
X`09`09return;
X`09`7D
X
X`09/* Set sizes */
X`09term.t_nrow = ((UINT) tc.t_mandl >> 24);
X`09term.t_ncol = tc.t_width;
X
X`09if (term.t_mrow < \0E07nrow)
X`09`09term.t_mrow = \0E07nrow;
X
X`09if (term.t_mcol < \0E07ncol)
X`09`09term.t_mcol = \0E07ncol;
X
X`09/* Get some capabilities */
X`09begin_reverse`09= vmsgetstr(SMG$K_BEGIN_REVERSE);
X`09end_reverse`09= vmsgetstr(SMG$K_END_REVERSE);
X`09revexist`09= begin_reverse`09!= NULL
X`09`09`26`26`09  end_reverse`09!= NULL;
X
X`09erase_to_end_line = vmsgetstr(SMG$K_ERASE_TO_END_LINE);
X`09eolexist = erase_whole_display != NULL;
X
X`09erase_whole_display = vmsgetstr(SMG$K_ERASE_WHOLE_DISPLAY);
X
X`09insert_line`09= vmsgetstr(SMG$K_INSERT_LINE);`09`09/* al */
X`09delete_line`09= vmsgetstr(SMG$K_DELETE_LINE);`09`09/* dl */
X`09scroll_forw`09= vmsgetstr(SMG$K_SCROLL_FORWARD);`09/* SF */
X`09scroll_back`09= vmsgetstr(SMG$K_SCROLL_REVERSE);`09/* SR */
X`09scroll_regn`09= vmsgetstr(SMG$K_SET_SCROLL_REGION);`09/* CS */
X
X`09/*
X`09 * I tried 'vmsgetstr()' for a VT100 terminal and it had no codes
X`09 * for insert_line or for delete_line.  (Have to work up a test for
X`09 * that).
X`09 */
X
X`09if (scroll_regn `26`26 \0F07back) `7B
X`09`09if (scroll_forw == NULL) /* assume '`5Cn' \2406s forward */
X`09`09`09scroll_forw = "`5Cn";
X`09`09term.t_scroll = vms\0C06_reg;
X`09`7D else if (delete_line `26`26 insert_line) `7B
X`09`09term.t_scroll = vms\0C06_delins;
X`09`7D else `7B
X`09`09term.t_scroll = null_\1008;
X`09`7D
X
X`09/* Set resolution */
X`09(void)strcpy(sres, "NORMAL");
X
X`09/* Open terminal I/O drivers */
X`09ttopen();
X
X`09/* Set predefined keys */
X`09for (i = TABLESIZE(keyseqs); i--; ) `7B
X`09`09addtosysmap(keyseqs`5Bi`5D.seq, strlen\170F), \280Bcode);
X`09`7D
X`09initialized = TRUE;
X`7D
X
X
X/***
X *  vmskopen  -  Open keyboard (not used)
X *
X *  Nothing returned
X ***/
Xstatic void
Xvmskopen(void)
X`7B
X`7D
X
X
X/***
X *  vmskclose  -  Close keyboard (not used)
X *
X *  Nothing returned
X ***/
Xstatic void
Xvmskclose(void)
X`7B
X`7D
X
X/* copied/adapted from 'tcap.c' 19-apr-1993 dickey@software.org */
X
X/* move howmany lines starting at from to to */
Xstatic void
Xvmsscroll_reg(int from, int to\0806n)
X`7B
X`09int i;
X`09if (to == from) return;
X`09if (to < from) `7B
X`09`09vmsscrollregion(to, from + n - 1);
X`09`09vmsmove(from + n - 1,0);
X`09`09for (i = from - to; i > 0; i--)
X`09`09`09ttputs(scroll_forw);
X`09`7D else `7B /* from < to */
X`09`09vmsscrollregion(from, to + n - 1);
X`09`09vmsmove(from,0);
X`09`09for (i = to - from; i > 0; i--)
X`09`09`09ttputs(scroll_back);
X`09`7D
X`09vmsscrollregion(0, term.t_nrow-1);
X`7D
X
X/*
XOPT_PRETTIER_SCROLL is prettier but slower -- it scrolls
X`09`09a line at a time instead of all at once.
X*/
X
X/* move howmany lines starting at from to to */
Xstatic void
Xvmsscroll_delins(int from, int to\0806n)
X`7B
X`09int i;
X`09if (to == from) return;
X`09/* patch: should make this more like 'tcap.c', or merge logic somehow */
X#if OPT_PRETTIER_SCROLL
X`09if (absol(from-to) > 1) `7B
X`09`09vmsscroll_delins(from, (from<to) ? to-1:to+1, n);
X`09`09if (from < to)
X`09`09`09from = to-1;
X`09`09else
X`09`09`09from = to+1;
X`09`7D
X#endif
X`09if (to < from) `7B
X`09`09vmsmove(to,0);
X`09`09for (i = from - to; i > 0; i--)
X`09`09`09ttputs(delete_line);
X`09`09vmsmove(to+n,0);
X`09`09for (i = from - to; i > 0; i--)
X`09`09`09ttputs(insert_line);
X`09`7D else `7B
X`09`09vmsmove(from+n,0);
X`09`09for (i = to - from; i > 0; i--)
X`09`09`09ttputs(delete_line);
X`09`09vmsmove(from,0);
X`09`09for (i = to - from; i > 0; i--)
X`09`09`09ttputs(insert_line);
X`09`7D
X`7D
X
X/* cs is set up just like cm, so we use tgoto... */
Xstatic void
Xvmsscrollregion(int top, int bot)
X`7B
X`09putpad_tgoto(SMG$K_SET_SCROLL_REGION, top+1, bot+1);
X`7D
X
X
X#else
X
X/***
X *  hellovms  -  Avoid error because of empty module
X *
X *  Nothing returned
X ***/
Xvoid
Xhellovms(void)
X`7B
X`7D
X
X#endif
$ call unpack [.VILE-8_0]VMSVT.C;1 -
 507481186 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 27 126 152
$!
$ create 'f'
X/*
X * w32cbrd:  collection of common clipboard manipulation routines shared by
X *           the Win32 console- and GUI-based vile editor.
X * Written by Clark Morgan for vile (april 1998).
X *
X * Caveats
X * =======
X * -- This code has not been tested with NT 3.51 .
X *
X * -- On a stock Win95 host, the first copy to the clipboard from the
X *    console version of vile causes the busy thread cursor to be displayed
X *    (i.e., cursor changes to a pointer/hourglass icon).  This \3307stays
X *    active for 5-10 seconds (all apps are \2606) and then goes away.
X *    Subsequent copies do not show this cursor.  On an NT 4.0 host, this
X *    phenomenon does not occur.
X *
X * $Header: /usr/build/vile/vile/RCS/w32cbrd.c,v 1.4 1998/05/27 09:52:06 tom E
Vxp $
X */
X
X#include <windows.h>
X#include <assert.h>
X
X#include "estruct.h"
X#include "edef.h"
X
X#define  _SPC_    ' '
X#define  _TAB_    '`5Ct'
X#define  _TILDE_  '`7E'
X
Xstatic char ctrl_lookup`5B`5D = "@ABCDEFGHIJKLMNOPQRSTUVWXYZ`5B`5C`5C`5D`5E_";
V
Xstatic char hex_lookup`5B`5D  = "0123456789ABCDEF";
X
X/* --------\0808\1010\2020-- */
X
X/*
X * Copy contents of unnamed register to Windows clipboard.  The control
X * flow is shamelessly copied from kwrite.
X */
Xint
Xcbrdcpy_unnamed(int unused1, \0D0A2)
X`7B
X    register unsigned       c;
X    HGLOBAL        \0808 hClipMem;
X    register int            i;
X    KILL        \0808    *kp;\1806/* pointer into unnamed register */
X    DWORD        \0808   nbyte;
X    unsigned        \0808nline;
X    int        \0808     rc;
X    register unsigned char  *src, *dst;
X
X    kregcirculate(FALSE);
X
X    /* make sure there is something to put */
X    if (kbs`5Bukb`5D.kbufh == NULL)
X    `7B
X        ukb = 0;
X        mlforce("Nothing to copy");
X        return (FALSE);     /* not an error, just nothing */
X    `7D
X
X    /* tell us we're writing */
X    mlwrite("`5BCopying...`5D");
X    nline = 0;
X    nbyte = 0;
X
X    /*
X     * Make 2 passes over the data.  1st pass counts \1B08 and
X     * adjusts for the fact that:
X     *
X     * 1) each '`5Cn' must be warped to "`5Cr`5Cn" to satisfy clipboard APIs.
V
X     * 2) unprintable data (modulo tabs) must be warped to a \3109
X     *    equivalent.
X     */
X    kp = kbs`5Bukb`5D.kbufh;
X    while (kp != NULL)
X    `7B
X        i\0906= KbSize(ukb, kp);
X        src    = (char *) kp->d_chunk;
X        nbyte += i;
X        while (i--)
X        `7B
X            if ((c = *src++) == '`5Cn')
X            `7B
X        \0808nline++;
X        \0808nbyte++;\1810 /* must prepend '`5Cr'\3D0D*/
X            `7D
X            else if (c < _SPC_ `26`26 c != _TAB_) /* assumes ASCII char set`20
V  */
X        \0808nbyte++;\1810 /* account for '`5E' meta char     */
X            else if (c > _TILDE_)\2108/* assumes ASCII char set\4208*/
X        \0808nbyte += 3;\1B0E/* account for '`5Cxdd' meta chars */
X        `7D
X        kp = kp->d_next;
X    `7D
X    nbyte++;   /* Room for terminating null
X
X    /* 2nd pass -- alloc storage for data and copy to clipboard. */
X    if ((hClipMem = GlobalAlloc(GMEM_MOVEABLE`7CGMEM_DDESHARE, nbyte)) == NULL
V)
X    `7B
X        ukb = 0;
X        mlforce("Insufficient memory for copy operation");
X        return (FALSE);
X    `7D
X    dst = GlobalLock(hClipMem);
X    kp  = kbs`5Bukb`5D.kbufh;
X    while (kp != NULL)
X    `7B
X        i   = KbSize(ukb, kp);
X        src = (char *) kp->d_chunk;
X        while (i--)
X        `7B
X            if ((c = *src++) == '`5Cn')
X            `7B
X        \0808*dst++ = '`5Cr';
X        \0808*dst++ = '`5Cn';
X            `7D
X            else if ((c >= _SPC_ `26`26 c <= _TILDE_) `7C`7C (c == _TAB_))
X        \0808*dst++ = c;
X            else if (c < _SPC_)
X            `7B
X        \0808*dst++ = '`5E';
X        \0808*dst++ = ctrl_lookup`5Bc`5D;
X            `7D
X            else
X            `7B
X        \0808/* c > _TILDE_ */
X
X        \0808*dst++ = '`5C`5C';
X        \0808*dst++ = 'x';
X        \0808*dst++ = hex_lookup`5B(c `26 0xf0) >> 4`5D;
X        \0808*dst++ = hex_lookup`5Bc `26 0xf`5D;
X            `7D
X        `7D
X        kp = kp->d_next;
X    `7D
X    *dst = '`5C0';
X    ukb  = 0;
X    GlobalUnlock(hClipMem);
X    for (rc = i = 0; i < 8 `26`26 (! rc); i++)
X    `7B
X        /* Try to open clipboard */
X
X        if (! OpenClipboard(NULL))
X            Sleep(500);
X        else
X            rc = 1;
X    `7D
X    if (! rc)
X    `7B
X        mlforce("Clipboad currently busy");
X        GlobalFree(hClipMem);
X        return (FALSE);
X    `7D
X    EmptyClipboard();
X    rc = (SetClipboardData(CF_TEXT, hClipMem) != NULL);
X    CloseClipboard();
X    if (! rc)
X    `7B
X        mlforce("Clipboad copy failed");
X        GlobalFree(hClipMem);
X    `7D
X    else
X    `7B
X        /* success */
X
X        if (! global_b_val(MDTERSE))
X        `7B
X            char buf`5B128`5D;
X
X            _snprintf(buf,
X        \0808\1006sizeof(buf),
X        \0808\1006"`5BCopied %u line%s, %u bytes to clipboard`5D",
X        \0808\1006nline,
X        \0808\1006PLURAL(nline),
X        \0808\1006nbyte - 1);   /* subtract terminating nul */
X            mlwrite(buf);
X        `7D
X        else
X            mlforce("`5B%d lines`5D", nline);
X    `7D
X    return (rc);
X`7D
X
X/*
X * Paste contents of windows clipboard (if TEXT) to either the unnamed
X * register or the ';'\140A(a la xvile).  Decision to be made by
X * future implementor and/or vile coding list.
X *
X * Another possible semantic:  cbrdpaste copies windows clipboard to
X * current buffer.
X *
X * Unimplemented.  Bound to Shift+Insert.
X */
Xint
Xcbrdpaste(int f, int n)
X`7B
X    mlforce("`5Bclipboard paste (unimplemented)`5D");
X    return (TRUE);
X`7D
X
X/*
X * Copy contents of specified region or register to Windows clipboard.
X * This command is an operaor and should mimic `5EW.
X *
X * Unimplemented.  Bound to Ctrl+Insert.
X */
Xint
Xopercbrdcpy(int f, int n)
X`7B
X    mlforce("`5Boper clipboard copy (unimplemented)`5D");
X    return (TRUE);
X`7D
$ call unpack [.VILE-8_0]W32CBRD.C;1 -
 1443800030 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 13 127 152
$!
$ create 'f'
X/*`20
X * w32misc:  collection of unrelated, common win32 functions used by both
X *           the console and GUI flavors of the editor.
X * Written by Clark Morgan for vile (may 1998).
X *
X * Caveats `20
X * =======
X * -- This code has not been tested with NT 3.51 .
X *
X * $Header: /usr/build/vile/vile/RCS/w32misc.c,v 1.2 1998/05/27 10:16:56 tom E
Vxp $
X */
X
X#include <windows.h>
X#include <assert.h>
X#include <errno.h>
X
X#include "estruct.h"
X#include "edef.h"
X
X#define CSHEXE      "csh.exe"
X#define CSHEXE_LEN  (sizeof(\1406) - 1)
X#define HOST_95     0
X#define HOST_NT     1
X#define HOST_UNDEF  (-1)
X#define SHEXE       "sh.exe"
X#define SHEXE_LEN   (sizeof(SHEXE) - 1)
X#define SHELL_C_LEN (sizeof(" -c ") - 1)
X
Xstatic int   host_type = HOST_UNDEF; /* nt or 95? */
X#ifndef DISP_NTWIN
Xstatic char  saved_title`5B256`5D;
X#endif
X
X/* --------\0808\1010\2020-- */
X
Xstatic void
Xset_host(void)
X`7B
X    OSVERSIONINFO info;
X
X    info.dwOSVersionInfoSize = sizeof(info);
X    GetVersionEx(`26info);
X    host_type = (info.dwPlatformId == VER_PLATFORM_WIN32_NT) ?
X        \0808HOST_NT :\0A0695;
X`7D
X
X
X
Xint
Xis_winnt(void)
X`7B
X    if (host_type == HOST_UNDEF)
X        set_host();
X    return (host_type == HOST_NT);
X`7D
X
X
X
Xint
Xis_win95(void)
X`7B
X    if (host_type == HOST_UNDEF)
X        set_host();
X    return (host_type == HOST_95);
X`7D
X
X
X
X/*
X * FUNCTION
X *   mk_shell_cmd_str(char *cmd, int *allocd_mem\1106prepend_shc)
X *
X *   cmd         - command string to be be passed to a Win32\2A09
X *        \0808 interpreter.
X *
X *   alloced_mem - Boolean, T -> returned string was\3006ated on heap.
X *
X *   prepend_shc - Boolean, T ->\1C08 "$SHELL -c" to cmd.
X *
X * DESCRIPTION
X *   If the user's shell is a unix lookalike, then a command passed to
X *   system() or CreateProcess() requires special preprocessing.
X *   This extra processing is required because the aforementioned
X *   functions pass a "raw", flat command line to the shell that is
X *   _not_ broken up into the following four canonical argv components:
X *
X *     argv`5B0`5D = name of shell
X *     argv`5B1`5D = name of shell
X *     argv`5B2`5D = -c
X *     argv`5B3`5D = cmd
X *     argv`5B4`5D = NULL
X *
X *   Put another way, a true execlp() does not exist in the win32 world and,
X *   therefore, cannnot be called to effect sh -c "cmdstr".  Consequently,
X *   when a unix shell (executing under win32) receives a "raw" command line,
V
X *   the shell splits the raw command into words, performs its normal
X *   expansions (file globbing, variable substitution, etc.) and then
X *   removes all quote characters.  After that, the shell executes the`20
X *   command.  This scenario means that if the user tries the following`20
X *   command in vile:
X *
X *       :!echo 'word1    word2'
X *
X *   It is passed to the shell as:
X *
X *        sh -c echo 'word1    word2'
X *`20
X *   and is displayed by the shell as:
X *
X *        word1 word2
X *
X *   That's not a big deal, but consider this vile idiom:
X *
X *        `5EX-!egrep -n 'word1 word2' *.c
X *
X *   Egrep receives the following command line from the shell:
X *
X *        egrep -n word1 word2 <glob'd file list>
X *
X *   Oops.  Word2 of the regular expression is now a filename.
X *`20
X * SOLUTIONS
X *   1) If user's shell is a unix lookalike and the command contains no`20
X *      single quote delimiters, enclose the entire command in\3707
X *      quotes.  This forces the shell to treat the command string
X *      as a single argument _before_ word splitting, expansions, and
X *      quote removal.  Otherwise,
X *
X *   2) If user's shell is a unix lookalike, enclose the command string in
X *      double quotes and escape every nonquoted \290C within the
X *      original string.  This is the same principle as 1) above, but uses
X *      a nestable delimiter.  This solution isn't foolproof.  Consider:
X *
X *          `5EX-!echo '`5B#@$*`5D' `5C"special`5C" word
X *
X *      will be read into the error buffer as:
X *
X *          `5B#@$*`5D special word
X *
X *      This could be worked around by preceding a leading `5C" token with '
X *      and appending ' to its closing delimiter.  But that creates its`20
X *      own set of side effects.
X *
X * CAVEATS`20
X *   The workarounds are inappropriate for csh (variants) which don't`20
X *   support nested quotes.
X *
X * RETURNS`20
X *   Pointer to possibly modified string.  If\1509, the comman\2208
X *   was created on the heap and must be free'd by the client.  If`20
X *   storage can't be allocated, NULL is returned.
X */
X
Xchar *
Xmk_shell_cmd_str(char *cmd, int *allocd_mem\1106prepend_shc)
X`7B
X    int         alloc_len;
X    static int  bourne_shell = 0; /* Boolean, T if user's shell has`20
X        \0808\1010   * appearances of a Unix lookalike`20
X        \0808\1010   * bourne shell (e.g., sh, ksh, bash). `20
X        \0808\1010   */
X    char        *out_str, *cp;
X    static char *shell = NULL,\0F07_c = "/c";
X
X    if (shell == NULL)`20
X    `7B
X        int len;
X
X        shell\0D08= get_shell();
X        len\0B08  = strlen(shell);
X        bourne_shell = (len >= 2 `26`26`20
X        \0808\1008tolower(shell`5Blen - 2`5D) == 's' `26`26
X        \0808\1008tolower(shell`5Blen - 1`5D) == 'h')`20
X        \0808\100F`7C`7C
X        \0808\1007(len >= SHEXE_LEN `26`26
X        \0808\1008stricmp(shell + len - SHEXE_LEN,\0B06) == 0);
X        if (bourne_shell)
X        `7B
X            shell_c = "-c";
X           `20
X            /* Now check for csh lookalike. */
X            bourne_shell = ! (
X        \0808\100F(len >= 3 `26`26`20
X        \0808\100Ftolower(shell`5Blen - 3`5D) == 'c')
X        \0808\1010\2008`7C`7C
X        \0808\100F(len >= CSHEXE_LEN `26`26
X        \0808\1010stricmp(shell + len - CSHEXE_LEN,\0C07) == 0)
X        \0808\100D);
X        `7D
X    `7D
X    if (! bourne_shell)
X    `7B
X        /*
X         * MS-DOS shell or csh.  Do not bother quoting user's command
X         * string, since the former is oblivious to the notion of a unix`20
X         * shell's argument quoting and the latter does not support nested`20
X         * double quotes.
X         */
X
X        if (prepend_shc)
X        `7B
X            alloc_len = strlen(cmd) +\0E08shell) + SHELL_C_LEN + 1;
X            if ((out_str = malloc(alloc_len)) == NULL)
X        \0808return (out_str);
X            *allocd_mem = TRUE;
X            sprintf(out_str, "%s %s %s", shell\0707_c, cmd);
X            return (out_str);
X        `7D
X        else
X        `7B
X            *allocd_mem = FALSE;
X            return (cmd);
X        `7D
X    `7D
X
X    /* Else apply solutions 1-2 above. */
X    alloc_len = strlen(cmd) * 2; /* worst case -- every cmd byte quoted */
X    if (prepend_shc)
X        alloc_len += strlen(shell) + SHELL_C_LEN;
X    alloc_len += 3;        \0806/* terminating nul + 2 quote chars     */
X    if ((out_str = malloc(alloc_len)) == NULL)
X    `7B
X        errno = ENOMEM;
X        return (out_str);
X    `7D
X    *allocd_mem = TRUE;
X
X    cp = out_str;
X    if (prepend_shc)
X        cp += sprintf(cp, "%s %s ", shell\0707_c);
X    if (strchr(cmd, '`5C'') == NULL)
X    `7B
X        /* No single quotes in command string.  Solution #1. */
X
X        sprintf(cp, "'%s'", cmd);
X        return (out_str);
X    `7D
X
X    /* Solution #2. */
X    *cp++ = '"';
X    while (*cmd)
X    `7B
X        if (*cmd == '`5C`5C')
X        `7B
X            *cp++ = *cmd++;
X            if (*cmd)
X            `7B
X        \0808/* Any quoted char is immune to further quoting. */
X
X        \0808*cp++ = *cmd++;   `20
X            `7D
X        `7D
X        else if (*cmd != '"')
X            *cp++ = *cmd++;
X        else
X        `7B
X            /* bare '"' */
X
X            *cp++ = '`5C`5C';
X            *cp++ = *cmd++;
X        `7D
X    `7D
X    *cp++ = '"';
X    *cp   = '`5C0';
X    return (out_str);
X`7D
X
X
X
X/*
X * FUNCTION
X *   w32_system(const char *cmd)
X *
X *   cmd - command string to be be passed to a Win32\2A09interpreter.
X *
X * DESCRIPTION
X *   Executes a system() call, taking care to ensure that the user's`20
X *   command string is properly quoted if get_shell() points to a bourne`20
X *   shell clone.
X *
X * RETURNS`20
X *   If memory allocation fails, -1.
X *   Else, whatever system() returns.
X */
X
Xint
Xw32_system(const char *cmd)
X`7B
X    char *cmdstr;
X    int  freestr, rc;
X
X    if ((cmdstr = mk_shell_cmd_str((char *) cmd, `26freestr, FALSE)) == NULL)
V
X    `7B
X        /* heap exhausted! */
X
X        mlforce("insufficient memory to invoke shell");
X
X        /* Give user a chance to read message--more will surely follow. */
X        Sleep(3000);
X        return (-1);
X    `7D
X    set_console_title(cmd);
X    rc = system(cmdstr);
X    if (freestr)
X        free(cmdstr);
X    restore_console_title();
X    return (rc);
X`7D
X
X
X
X/*
X * The code in ntconio.c that saves and restores console titles
X * didn't work reliably for pipe or shell operations.  It's moved here
X * now and called via the w32_system() wrapper or \1C07pipe module.
X */
Xvoid
Xset_console_title(const char *title)
X`7B
X#ifndef DISP_NTWIN
X    GetConsoleTitle(saved_title, sizeof\140C));
X    SetConsoleTitle(title);
X#endif
X`7D
X
X
X
Xvoid
Xrestore_console_title(void)
X`7B
X#ifndef DISP_NTWIN
X    SetConsoleTitle(saved_title);
X#endif
X`7D
$ call unpack [.VILE-8_0]W32MISC.C;1 -
 1447203131 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 20 128 152
$!
$ create 'f'
X/*
X * w32pipe:  win32 clone of npopen.c, utilizes native pipes (not temp files).
V
X * Written by Clark Morgan for vile (december 1997).
X *
X * Background
X * ==========
X * The techniques used in w32_npclose() and w32_inout_popen() are derived
X * from much trial and error and support "pipe" I/O in both a console and
X * GUI environment.  You may _think_ you have a better way of effecting the
X * functionality provided in this module and that may well be the case.
X * But be sure you test your new code with at least these versions of Win32:
X *
X *      win95 (original version), OSR2, NT 4.0
X *
X * For each HOST, be sure to test read pipes, write\0D08and filters (and
X * test repeatedly within the same vile session).
X *
X *
X * Acknowledgments
X * ========\0807
X * Until I read Steve Kirkendall's code for the Win32 version of elvis, I
X * did not realize that attempting to redirect stdin to a device is a
X * _not_ a good strategy.
X *
X *
X * Caveats
X * =======
X *
X * -- This code has not been tested with NT 3.51 .
X *
X * -- The MSDN Knowledge Base has example code that uses anonymous pipes
X *    to redirect a spawned process's stdin, stdout, and stderr.  Don't go
X *    there.
X *
X * -- The original Win95 console shell (command.com) accesses the floppy
X *    drive each and every time a process communicates with it via a pipe
X *    and the OS R2 shell abruptly hangs under similar conditions.  By
X *    default, then, on a WinNT host, vile's pipes are implemented using
X *    native pipes (i.e., with the code in this module), while Win95 hosts
X *    fall back to temp file communication.  If the user's replacement
X *`09  Win95 shell does not exhibit communication problems similar to
X *    those described above (e.g., Thompson Toolkit Shell), vile may be
X *    forced to use native Win32 pipes by setting the global mode
X *    "w32pipes" (e.g., "se \1509).
X *
X * -- This module's native pipes implementation exhibits various problems
X *    when a 16-bit console app is exec'd.  On a win95 host, the editor
X *    and shell generally hang.  WinNT does better, but winvile creates
X *    "background" shell windows that require manual closure.
X *
X * -- This module configures read pipes so that the exec'd app reads
X *    it's input from an empty file.  That's a necessity, not a bug.
X *    Consequently, if an attempt is made to read data from an app
X *    that itself reads input (why would you do that?), the app will
X *    appear to hang if it reopens stdin on the console (because vile's
X *    stdin is not available to the app--another necessity).  In this
X *    situation, kill the app by typing `5EC (and then please apply for a
X *    QA position with a certain Redmond company).
X *
X * $Header: /usr/build/vile/vile/RCS/w32pipe.c,v 1.9 1998/05/27 10:16:41 tom E
Vxp $
X */
X
X#include <windows.h>
X#include <io.h>
X#include <share.h>
X#include <process.h>
X#include <assert.h>
X
X#define HAVE_FCNTL_H 1
X
X#include "estruct.h"
X#include "edef.h"
X
X#define BAD_FD          (-1)
X#define BAD_PROC_HANDLE (INVALID_\1006_VALUE)
X#define PIPESIZ         (4096)
X#define SHELL_ERR_MSG   `5C
X          "error: shell process `5C"%s`5C" failed, check COMSPEC env var`5Cn"
V
X
Xstatic HANDLE proc_handle;
Xstatic char   *tmpin_name;
X
X/* --------\0808\1010\2020-- */
X
Xstatic void
Xglobal_cleanup(void)
X`7B
X    if (tmpin_name)
X    `7B
X        (void) remove(tmpin_name);
X        (void) free(tmpin_name);
X        tmpin_name = NULL;
X    `7D
X    restore_console_title();
X#ifdef DISP_NTWIN
X    if (global_g_val(GMDFORCE_CONSOLE))
X        FreeConsole();
X#endif
X`7D
X
X
X
Xstatic HANDLE
Xexec_shell(char *cmd, HANDLE *handles, int hide_child)
X`7B
X    char        \0808 *cmdstr;
X#ifdef DISP_NTWIN
X    HWND        \0808 fgnd;
X    int        \0808  force_console = global_g_val(GMDFORCE_CONSOLE);
X#endif
X    int        \0808  freestr;
X    PROCESS_INFORMATION  pi;
X    STARTUPINFO          si;
X
X    proc_handle = BAD_PROC_HANDLE;  /* in case of failure */
X    if ((cmdstr = mk_shell_cmd_str(cmd, `26freestr, TRUE)) == NULL)
X    `7B
X        /* heap exhausted! */
X
X        mlforce("insufficient memory to invoke shell");
X
X        /* Give user a chance to read message--more will surely follow. */
X        Sleep(3000);
X        return (proc_handle);
X    `7D
X
X    memset(`26si, 0, sizeof(si));
X    si.cb          = sizeof(si);
X    si.dwFlags     = STARTF_USESTDHANDLES;
X    si.hStdInput   = handles`5B0`5D;
X    si.hStdOutput  = handles`5B1`5D;
X    si.hStdError   = handles`5B2`5D;
X#ifdef DISP_NTWIN
X    if (force_console)
X    `7B
X        if (hide_child)
X            fgnd = GetForegroundWindow();
X        AllocConsole();
X    `7D
X    else if (hide_child)
X    `7B
X        si.dwFlags     `7C= STARTF_USESHOWWINDOW;
X        si.wShowWindow  = SW_HIDE;
X    `7D
X#endif
X    if (CreateProcess(NULL,
X        \0808\1006cmdstr,
X        \0808\1006NULL,
+-+-+-+-+-+-+-+-  END  OF PART 124 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 125 -+-+-+-+-+-+-+-+
X        \0808\1006NULL,
X        \0808\1006TRUE,\1B07/* Inherit handles */
X#ifdef DISP_NTWIN
X        \0808\1006force_console ? 0 : CREATE_NEW_CONSOLE,
X#else
X        \0808\10060,
X#endif
X        \0808\1006NULL,
X        \0808\1006NULL,
X        \0808\1006`26si,
X        \0808\1006`26pi))
X    `7B
X        /* Success */
X
X#ifdef DISP_NTWIN
X        if (force_console `26`26 hide_child)
X            SetForegroundWindow(fgnd);
X#endif
X        CloseHandle(pi.hThread);
X        proc_handle = pi.hProcess;
X    `7D
X    if (freestr)
X        free(cmdstr);
X    return (proc_handle);
X`7D
X
X
X
Xint
Xw32_inout_popen(FILE **fr, \0B08w, char *cmd)
X`7B
X    HANDLE handles`5B3`5D;
X    int    i, rc, rp`5B2`5D, tmpin_fd, wp`5B2`5D;
X
X    proc_handle  = BAD_PROC_HANDLE;
X    rp`5B0`5D        = rp`5B1\0F07= w\1C0A= wp`5B1`5D = BAD_FD;
X    handles`5B0`5D   =\0F091`5D \0D0A2`5D = INVALID_HANDLE_VALUE;
X    tmpin_fd     = BAD_FD;
X    tmpin_name   = NULL;
X    set_console_title(cmd);
X    do
X    `7B
X        if (fr)
X        `7B
X            *fr = NULL;
X
X            /*
X             * Open (parent's) input pipe in TEXT mode, which will force
X             * translation of the child's CR/LF record delimiters to NL
X             * and keep the dreaded `5EM chars from temporarily appearing
X             * in a vile buffer (ugly).
X             */
X            if (_pipe(rp, PIPESIZ, O_TEXT`7CO_NOINHERIT) == -1)
X        \0808break;
X            if (! DuplicateHandle(GetCurrentProcess(),
X        \0808\1010  (HANDLE) _get_osfhandle(rp`5B1`5D),
X        \0808\1010  GetCurrentProcess(),
X        \0808\1010  handles + 1,
X        \0808\1010  0,
X        \0808\1010  TRUE,
X        \0808\1010  DUPLICATE_SAME_ACCESS`7C\160ACLOSE_SOURCE))
X            `7B
X        \0808break;
X            `7D
X            handles`5B2`5D =\0D091`5D;
X            rp`5B1`5D\1106= BAD_FD;   /* closed by DuplicateHandle() */
X            if (! fw)
X            `7B
X        \0808/*
X        \0808 * This is a read pipe (only).  Connect child's stdin to
X        \0808 * an empty file.  Under no circumstances should the
X        \0808 * child's stdin be connected to a device (else lots of
X        \0808 * screwy things will occur).  In particular, connecting
X        \0808 * the child's stdin to the parent\1609will cause
X        \0808 * aborts and hangs on the various Win32 hosts.  You've
X        \0808 * been warned.
X        \0808 */
X
X        \0808if ((tmpin_name = _tempnam(getenv("TEMP"), "vile")) == NULL)
X        \0808    break;
X        \0808if ((tmpin_fd = open\1007name,
X        \0808\1010     O_RDONLY`7CO_CREAT`7CO_TRUNC,
X        \0808\1010     _S_IWRITE`7C_S_IREAD)) == BAD_FD)
X        \0808`7B
X        \0808    break;
X        \0808`7D
X        \0808handles`5B0`5D = (HANDLE) _get_osf\1E06(tmpin_fd);
X            `7D
X            if (! (*fr = fdopen(rp`5B0`5D, "r")))
X        \0808break;
X        `7D
X        if (fw)
X        `7B
X            *fw = NULL;
X
X            /*
X             * Open (child's) output pipe in binary mode, which will
X             * prevent translation of the parent's CR/LF record delimiters
X             * to NL.  Apparently, many apps want those delimiters :-) .
X             */
X            if (_pipe(wp, PIPESIZ, O_BINARY`7CO_NOINHERIT) == -1)
X        \0808break;
X            if (! DuplicateHandle(GetCurrentProcess(),
X        \0808\1010  (HANDLE) _get_osfhandle(wp`5B0`5D),
X        \0808\1010  GetCurrentProcess(),
X        \0808\1010  handles + 0,
X        \0808\1010  0,
X        \0808\1010  TRUE,
X        \0808\1010  DUPLICATE_SAME_ACCESS`7C\160ACLOSE_SOURCE))
X            `7B
X        \0808break;
X            `7D
X            wp`5B0`5D = BAD_FD;     /* closed by DuplicateHandle() */
X            if (! fr)
X        \0808handles`5B1`5D =\0D092`5D = GetStdHandle(STD_OUTPUT_HANDLE);
X            if (! (*fw = fdopen(wp`5B1`5D, "w")))
X        \0808break;
X        `7D
X        rc = (exec_shell(cmd,
X        \0808\1009handles,
X        \0808\1009fr != NULL  /* Child wdw hidden unless write pipe. */
X        \0808\1009) == BAD_PROC_HANDLE) ? FALSE : TRUE;
X        if (fw)
X        `7B
X            if (! rc)
X            `7B
X        \0808 /* Shell process failed, put complaint in user's face. */
X
X        \0808fputc('`5Cn', stdout);
X        \0808printf(SHELL_ERR_MSG, get_shell());
X        \0808fflush(stdout);
X            `7D
X            CloseHandle(handles`5B0`5D);
X        `7D
X        if (fr)
X        `7B
X            if (! rc)
X            `7B
X        \0808char  buf`5B200`5D;
X        \0808DWORD dummy, len;
X
X        \0808/* Shell process failed, put complaint in user's buffer. */
X
X        \0808len = _snprintf(buf, sizeof(buf), SHELL_ERR_MSG, get_shell());
X        \0808(void) WriteFile(handles`5B1`5D, buf, len, `26dummy, NULL);
X        \0808FlushFileBuffers(handles`5B1`5D);
X            `7D
X            CloseHandle(handles`5B1`5D);
X            if (tmpin_fd != BAD_FD)
X        \0808close(tmpin_fd);
X        `7D
X        return (rc);
X    `7D
X    while (FALSE);
X
X    /* If we get here -- some operation has failed.  Clean up. */
X
X    if (wp`5B0`5D != BAD_FD)
X        close(wp`5B0`5D);
X    if (wp`5B1`5D != BAD_FD)
X        close(wp`5B1`5D);
X    if (rp`5B0`5D != BAD_FD)
X        close(rp`5B0`5D);
X    if (rp`5B1`5D != BAD_FD)
X        close(rp`5B1`5D);
X    if (tmpin_fd != BAD_FD)
X        close(tmpin_fd);
X    for (i = 0; i < 3; i++)
X    `7B
X        if (handles`5Bi`5D != INVALID_HANDLE_VALUE)
X            CloseHandle(handles`5Bi`5D);
X    `7D
X    global_cleanup();
X    return (FALSE);
X`7D
X
X
X
Xvoid
Xw32_npclose(FILE *fp)
X`7B
X    int term_status;
X
X    (void) fflush(fp);
X    (void) fclose(fp);
X    if (proc_handle != BAD_PROC_HANDLE)
X    `7B
X        (void) _cwait(`26term_status, (int) proc_handle, 0);
X        (void) CloseHandle(proc_handle);
X        proc_handle = BAD_PROC_HANDLE;
X    `7D
X    global_cleanup();
X`7D
$ call unpack [.VILE-8_0]W32PIPE.C;1 -
 375271918 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 23 129 152
$!
$ create 'f'
X/*
X * watch.c`09-- generic data structures and routines for\3406ing
X *`09`09   file descriptors and timers (eventually)
X */
X
X#include "estruct.h"
X#include "edef.h"
X
Xtypedef struct `7B
X    char     *callback;`09/* a vile command to run... */
X    long      otherid;`09/* e.g, the XtInputId is stored here for x11. */
X    WATCHTYPE type;`09/* one of\1A06INPUT,\2606OUTPUT, or\3606ERROR */
X`7D watchrec;
X
X#define NWATCHFDS 256
X
Xstatic watchrec *watchfds`5BNWATCHFDS`5D;
X
X
Xstatic void unwatch_dealloc(int fd);
Xstatic void unwatch_free_callback(char *\0F08);
X
Xint
Xwatchfd(int fd, WATCHTYPE type, char *callback)
X`7B
X    long otherid;
X    int status;
X
X    if (watchfds`5Bfd`5D) `7B
X`09/* Already allocated/watched, so dea\1807/unwatch */
X`09unwatchfd(fd);
X    `7D
X
X    watchfds`5Bfd`5D = typealloc(watchrec);
X
X    if (watchfds`5Bfd`5D == NULL) `7B
X`09unwatch_free_callback(\0908);
X`09return FALSE;
X    `7D
X
X    status = TTwatchfd(fd, type, `26otherid);
X
X    watchfds`5Bfd`5D->callback = \0B08;
X    watchfds`5Bfd`5D->type     = type;
X    watchfds`5Bfd`5D->otherid  = \0B07;
X
X    if (status != TRUE) `7B
X`09unwatch_dealloc(fd);
X    `7D
X
X    return status;
X`7D
X
Xvoid
Xunwatchfd(int fd)
X`7B
X    if (watchfds`5Bfd`5D == NULL)
X`09return;
X
X    TTunwatchfd(fd, \0C07s`5Bfd`5D->otherid);
X    unwatch_dealloc(fd);
X`7D
X
Xvoid
Xdowatchcallback(int fd)
X`7B
X    if (watchfds`5Bfd`5D == NULL `7C`7C \180C->callback\2208)
X`09return;
X
X    (void) docmd(watchfds`5Bfd`5D->callback, TRUE, FALSE, 1);
X`7D
X
Xstatic void
Xunwatch_dealloc(int fd)
X`7B
X    if (watchfds`5Bfd`5D == NULL)
X`09return;
X
X    unwatch_free_callback(watchfds`5Bfd`5D->\1708);
X    FreeAndNull(watchfds`5Bfd`5D);
X`7D
X
Xstatic void
Xunwatch_free_callback(char *\0F08)
X`7B
X    if (callback == NULL)
X`09return;
X
X#ifdef OPT_PERL
X    if (strncmp("perl", callback, 4) == 0)
X`09perl_free_callback(\0908);
X#endif
X
X    free(callback);
X`7D
$ call unpack [.VILE-8_0]WATCH.C;1 -
 1042307754 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 4 130 152
$!
$ create 'f'
X/*
X * Window management. Some of the functions are internal, and some are
X * attached to keys that the user actually types.
X *
X * $Header: /usr/build/vile/vile/RCS/window.c,v 1.81 1998/04/28 10:15:38 tom E
Vxp $
X *
X */
X
X#include        "estruct.h"
X#include`09"edef.h"
X
X/*
X * Unlink the given window-pointer from the list
X */
Xstatic void
Xunlink_window(WINDOW *thewp)
X`7B
X`09register WINDOW *p, *q;
X
X`09for (p = wheadp, q = 0; p != 0; q = p, p = p->w_wndp)
X`09`09if (p == thewp) `7B
X`09`09`09if (q != 0)
X`09`09&0209q->w_wndp = p\0C08;
X`09`09`09else
X`09`09&0209wheadp = p->w_wndp;
X`09`09`09break;
X`09`09`7D
X`7D
X
X/*
X * Set the current window (and associated \1F08buffer).
X */
Xint
Xset_curwp (WINDOW *wp)
X`7B
X`09if (wp == curwp)
X`09`09return (TRUE);
X`09curwp = wp;
X#if !WINMARK
X`09/* FIXME: this wouldn't be necessary if MK were stored per-buffer */
X`09MK = nullmark;
X#endif
X`09make_current(curwp->w_bufp);
X`09upmode();
X`09updatelistbuffers();
X`09return (TRUE);
X`7D
X
X/*
X * Adjust a LINEPTR forward by the given number of screen-rows, limited by
X * the end of the buffer.
X */
Xstatic LINEPTR
Xadjust_forw(WINDOW *wp, LINEPTR lp, int n)
X`7B
X`09register int i;
X`09LINEPTR`09dlp;
X`09for (i = n; i > 0 `26`26 (lp != win_head(wp)); ) `7B
X`09`09if ((i -= line_height(wp, lp)) < 0)
X`09`09`09break;
X`09`09dlp = lforw(lp);
X`09`09if (dlp == win_head(wp))
X`09`09`09break;
X`09`09lp = dlp;
X`09`7D
X`09return lp;
X`7D
X
X/*
X * Adjust a LINEPTR backward by the given number of screen-rows, limited by
X * the end of the buffer.
X */
Xstatic LINEPTR
Xadjust_back(WINDOW *wp, LINEPTR lp, int n)
X`7B
X`09register int i;
X`09LINEPTR`09dlp;
X`09for (i = n; i > 0 `26`26 (lp != win_head(wp)); ) `7B
X`09`09if ((i -= line_height(wp, lp)) < 0)
X`09`09`09break;
X`09`09dlp = lback(lp);
X`09`09if (dlp == win_head(wp))
X`09`09`09break;
X`09`09lp = dlp;
X`09`7D
X`09return lp;
X`7D
X
X/*
X * Reposition dot's line to\0806"n" of the window. I\0F06argument is
X * positive, it is that line. If\1407negative\2310 from the
X * bottom. If it is 0 the window is centered around dot (this is what
X * the standard redisplay code does). Defaults to 0.
X */
Xint
Xreposition(int f, int n)
X`7B
X`09if (f) `7B
X`09`09int an;
X`09`09/* clamp the value at the size of the window */
X`09`09an = absol(n);
X`09`09if (an > curwp->w_ntrows)
X`09`09`09curwp->w_force = \1109ntrows * (n / an);
X`09`09else
X`09`09`09curwp->w_force = n;
X`09`09curwp->w_flag `7C= WFFORCE;
X`09`7D
X`09return update(TRUE);
X`7D
X
X/*
X * Refresh the screen. With no argument, it just does the refresh\2C07an
X * argument it recenters "." in the current window.
X */
X/* ARGSUSED */
Xint
Xvile_refresh(int f, int n GCC_UNUSED)
X`7B
X
X`09if (f == FALSE) `7B
X`09`09sgarbf = TRUE;
X`09`7D else `7B
X`09        curwp->w_force = 0;\1B08     /* Center dot. */
X`09        curwp->w_flag `7C= WFFORCE;
X`09`7D
X
X`09return (TRUE);
X`7D
X
X/*
X * The command make the next window (next => down the screen) the current
X * window. There are no real errors, although the command does nothing if
X * there is only 1 window on the screen.
X *
X * with an argument this command finds the <n>th window from the top
X *
X */
Xint
Xnextwind(int f, int n)
X`7B
X`09register WINDOW *wp;
X`09register int nwindows;`09`09/* total number of \1D07 */
X
X`09if (f) `7B
X
X`09`09/* first count the # of windows */
X`09`09nwindows = 0;
X`09`09for_each_visible_window(wp)
X`09`09`09nwindows++;
X
X`09`09/* if the argument is negative, it is the nth window
X`09`09   from the bottom of the screen&0209`09*/
X`09`09if (n < 0)
X`09`09`09n = nwindows + n + 1;
X
X`09`09/* if an argument, give them that window from the top */
X`09`09if (n > 0 `26`26 n <= nwindows) `7B
X`09`09`09wp = wheadp;
X`09`09`09while (--n)
X`09`09&0209wp = wp->w_wndp;
X`09`09`7D else `7B
X`09`09`09mlforce("`5BWindow number out of range`5D");
X`09`09`09return(FALSE);
X`09`09`7D
X`09`7D else `7B
X`09`09if ((wp = curwp->w_wndp) == NULL)
X`09`09`09wp = wheadp;
X`09`7D
X`09return set_curwp(wp);
X`7D
X
Xint
Xposwind(int f, int n)
X`7B
X`09register int c;
X`09register int row;
X`09int s;
X
X`09if (!f)
X`09`09n = 1;
X
X`09if (clexec `7C`7C isnamedcmd) `7B
X`09`09static char cbuf`5B20`5D;
X`09`09if ((s=mlreply("Position window with cursor at:  ", cbuf,
X`09`09&0209&020920)) != TRUE)
X`09`09`09return s;
X`09`09c = cbuf`5B0`5D;
X`09`7D else `7B
X`09`09c = keystroke();
X`09`09if (ABORTED(c))
X`09`09`09return ABORT;
X`09`7D
X
X`09if (strchr("+hHtT`5Cr", c)) `7B
X`09`09row = n;
X`09`7D else if (strchr(".mM", c)) `7B
X`09`09row = 0;
X`09`7D else if (strchr("-lLbB`5Cr", c)) `7B
X`09`09row = -n;
X`09`7D else `7B
X`09`09if (!(clexec `7C`7C isnamedcmd))
X`09`09`09kbd_alarm();
X`09`09return FALSE;
X`09`7D
X
X`09return(reposition(TRUE,row));
X`7D
X
X/*
X * This command makes the previous window (\1109=> up the screen) the
X * current window. There aren't any errors, although the command does not do a
V
X * lot if there is 1 window.
X */
Xint
Xprevwind(int f, int n)
X`7B
X`09register WINDOW *wp1;
X`09register WINDOW *wp2;
X
X`09/* if we have an argument, we mean the nth window from the bottom */
X`09if (f)
X`09`09return(nextwind(f, -n));
X
X`09wp1 = wheadp;
X`09wp2 = curwp;
X
X`09if (wp1 == wp2)
X`09`09wp2 = NULL;
X
X`09while (wp1->w_wndp != wp2)
X`09`09wp1 = wp1->w_wndp;
X
X`09return set_curwp(wp1);
X`7D
X
X/*
X * This command moves the current window down by "arg" lines. Recompute the
X * top line in the window. The move up and\0C06down code is almost completely
V
X * the same; most of the work has to do with reframing\2206indow, and picking
V
X * a new dot. We share the code by having "move down" just be an interface to
V
X * "move up". Magic.
X */
Xint
Xmvdnwind(int f, int n)
X`7B
X`09if (!f)
X`09`09n = 1;
X`09return (mvupwind(TRUE, -n));
X`7D
X
X/*
X * Move the current window up by "arg" lines. Recomput\3006new top line of
X * the window. Look to see if "." is still on the screen. If it is, you win.
X * If it isn't, then move "." to center it in the new framing of the window
X * (this command does not really move "." (except as above); it moves the
X * frame).
X */
Xint
Xmvupwind(int f, int n)
X`7B
X`09register LINE  *lp;
X`09register int    i;
X`09int             was_n = n;
X
X`09lp = curwp->w_line.l;
X
X`09if (!f)
X`09`09n = 1;
X
X`09if (n < 0)
X`09`09curwp->w_flag `7C= WFKILLS;
X`09else
X`09`09curwp->w_flag `7C= WFINS;
X
X`09if (n < 0) `7B
X`09`09while (n++ `26`26 lforw(lp) != buf_head(curbp))
X`09`09`09lp = lforw(lp);
X`09`7D else `7B
X`09`09while (n-- `26`26 lback(lp) != buf_head(curbp))
X`09`09`09lp = lback(lp);
X`09`7D
X
X`09curwp->w_line.l = lp;
X`09curwp->w_line.o = 0;
X`09curwp->w_flag `7C= WFHARD `7C WFMODE;
X
X`09/* is it still in the window */
X`09for (i = 0; i < curwp->w_ntrows; lp = lforw(lp)) `7B
X`09`09if ((i += line_height(curwp,lp)) > curwp->w_ntrows)
X`09`09`09break;
X`09`09if (lp == DOT.l)
X`09`09`09return (TRUE);
X`09`09if (lforw(lp) == buf_head(curbp))
X`09`09`09break;
X`09`7D
X`09/*
X`09 * now lp is either just past the window bottom, or it's the last
X`09 * line of the file
X`09 */
X
X`09/* preserve the current column */
X`09if (curgoal < 0)
X`09`09curgoal = getccol(FALSE);
X
X`09if (was_n < 0)
X`09`09DOT.l = curwp->w_line.l;
X`09else
X`09`09DOT.l = lback(lp);
X`09DOT.o = getgoal(DOT.l);
X`09return (TRUE);
X`7D
X
Xint
Xmvdnnxtwind(int f, int n)
X`7B
X`09int`09status;
X
X`09(void)nextwind(FALSE, 1);
X`09status = mvdnwind(f, n);
X`09(void)prevwind(FALSE, 1);
X`09return status;
X`7D
X
Xint
Xmvupnxtwind(int f, int n)
X`7B
X`09int`09status;
X
X`09(void)nextwind(FALSE, 1);
X`09status = mvupwind(f, n);
X`09(void)prevwind(FALSE, 1);
X`09return status;
X`7D
X
Xstatic int
Xscroll_sideways(int f, int n)
X`7B
X`09int`09original = w_val(curwp,WVAL_SIDEWAYS);
X
X`09if (!f) `7B
X`09`09int`09nominal = term.t_ncol / 2;
X`09`09n = (n > 0) ? nominal : -\0B07;
X`09`7D
X
X`09make_local_w_val(curwp,WVAL_SIDEWAYS);
X`09w_val(curwp, WVAL_SIDEWAYS) += n;
X
X`09if (w_val(curwp, WVAL_SIDEWAYS) < 0) `7B
X`09`09if (original == 0)
X`09`09`09kbd_alarm();
X`09`09w_val(curwp, WVAL_SIDEWAYS) = 0;
X`09`7D
X
X`09if (original != w_val(curwp,WVAL_SIDEWAYS))
X        `09curwp->w_flag  `7C= WFHARD`7CWFMOVE`7CWFMODE;
X
X`09return TRUE;
X`7D
X
Xint
Xmvrightwind(int f, int n)
X`7B
X`09return scroll_sideways(f,n);
X`7D
X
Xint
Xmvleftwind(int f, int n)
X`7B
X`09return scroll_sideways(f,-n);
X`7D
X
X/*
X * This command makes the current window the only\1008on the screen.
X * Try to set the framing so that "." does not have to move on the
X * display. Some care has to be taken to keep the values of dot and mark in
X * the buffer structures right if the di\1A06ion of a window makes a \3F06
X * become undisplayed.
X */
X/* ARGSUSED */
Xint
Xonlywind(int f GCC_UNUSED, int n\120B)
X`7B
X        register WINDOW *wp;
X
X        wp = wheadp;
X        while (wp != NULL) `7B
X`09`09register WINDOW *nwp;
X`09`09nwp = wp->w_wndp;
X        `09if (wp != curwp) `7B
X`09        \0808if (--wp->w_bufp->b_nwnd == 0)
X`09        \0808\1008undispbuff(wp->w_bufp,wp);
X`09`09`09unlink_window(wp);
X`09        \0808free((char *) wp);
X`09        `7D
X        \0808wp = nwp;
X        `7D
X        wheadp = curwp;
X        wheadp->w_wndp = NULL;
X
X        curwp->w_line.l = adjust_back(curwp,\2510\110Btoprow);
X`09curwp->w_line.o = 0;
X        curwp->w_ntrows = term.t_nrow-2;
X        curwp->w_toprow = 0;
X        curwp->w_flag  `7C= WFMODE`7CWFHARD`7CWFSBAR;
X`09curwp->w_split_hist = 0;
X        return (TRUE);
X`7D
X
X/*
X * Delete the current window
X */
X
X/* ARGSUSED */
Xint
Xdelwind(int f GCC_UNUSED, int n\120B)
X`7B
X`09return delwp(curwp);
X`7D
X
X/*
X * We attach to each window structure another field (an unsigned long)
X * which I called w_split_history.  When we split a window, we shift this
X * field left by one bit.  The least significant bit for the upper window
X * is 0, the bottom window's lsb is set to 1.
X *
X * We examine the lsb when deleting windows to decide whether to give up
X * the space for the deleted window to the upper \1407or low\1009.
X * If the lsb is 0, we give it to\1C06ower window.  If it is 1\2C0B
X * to the upper window.  If the lsb o\0B06receiving\2507 is different
X * from that of the window being deleted, this means that the two match and
X * so the history is shifted right by one bit for the receiving window.
X * Otherwise we leave the history alone.
X *`09`09&0209&0309kev, 2/94
X *
X * Example:
X *
X * `7C    `7C       `7C 00\0808\1010
X * `7C    `7C 0     -     \0808\100B
X * `7C    `7C       `7C 01\0808\1010
X * `7C 0 -->      -   --> \0808\1010`7C
X * `7C    `7C    \0808   `7C 10\180D
X * `7C    `7C 1    \0808 -     \180B
X * `7C    `7C    \0808   `7C 11\180D
X *
X * Full Split  \0808 and     Kill \0807
X * Screen        \0807Again   \0808either  1
X *        \0808\100E10 or
X *        \0808\100E11
X */
X
Xint
Xdelwp(WINDOW *thewp)
X`7B
X`09register WINDOW *wp;`09/* window to receive deleted space */
X
X`09/* if there is only one window, don't delete it */
X`09if (wheadp->w_wndp == NULL) `7B
X`09`09mlforce("`5BCannot delete the only window`5D");
X`09`09return(FALSE);
X`09`7D
X
X`09/* find receiving window and give up our space */
X`09if (thewp == wheadp
X`09 `7C`7C ((thewp->w_split_hist `26 1) == 0 `26`26 \2109wndp)) `7B
X`09`09/* merge with next window down */
X`09`09wp = thewp->w_wndp;
X        \0808wp->w_line.l = adjust_back(wp,\1F0D,
X`09`09&0209&0209thewp->w_ntrows+1);
X`09`09wp->w_line.o = 0;
X`09`09wp->w_ntrows += the\130C+1;
X`09`09wp->w_toprow = the\120C;
X`09`09if (thewp == wheadp)
X`09`09`09wheadp = wp;
X`09`09else `7B
X`09`09`09WINDOW *pwp = wheadp;
X`09`09`09while(pwp->w_wndp != thewp)
X`09`09&0209pwp = pwp->w_wndp;
X`09`09`09pwp->w_wndp = wp;
X`09`09`7D
X`09`09if (wp->w_split_hist `26 1)
X`09`09`09wp->w_split_hist >>= 1;
X`09`7D else `7B
X`09`09/* find window before thewp in linked list */
X`09`09wp = wheadp;
X`09`09while(wp->w_wndp != thewp)
X`09`09`09wp = wp->w_wndp;
X`09`09/* add thewp's rows to the next window up */
X`09`09wp->w_ntrows += the\130C+1;
X
X`09`09wp->w_wndp = the\100A; /* make their next window ours */
X`09`09if ((wp->w_split_hist `26 1) == 0)
X`09`09`09wp->w_split_hist >>= 1;
X`09`7D
X
X`09/* get rid of the current window */
X`09if (--thewp->w_bufp->b_nwnd == 0)
X`09`09undispbuff(thewp->w_bufp,thewp);
X`09if (thewp == curwp) `7B
X`09`09curwp = wp;
X`09`09make_current(curwp->w_bufp);
X`09`7D
X`09free((char *)thewp);
X`09upmode();
X`09wp->w_flag `7C= WFSBAR `7C WFHARD;
X`09return(TRUE);
X`7D
X
X/*
X * Copy the window-traits struct, and adjust the embedded VAL\2407 so that
X * modes that are local remain so.
X */
Xvoid
Xcopy_traits(W_TRAITS *dst, \0F0Asrc)
X`7B
X`09*dst = *src;
X`09copy_mvals(NUM_W_VALUES, dst->w_vals.wv, src\100B);
X`7D
X
X/*
X`09Split the current window.  A\0B07 smaller than 3 lines cannot be
X`09split.  An argument of 1 forces the cursor into the upper window, an
X`09argument of two forces the cursor to the lower window.  The only other
X`09error that is possible is a "malloc" failure allocating the structure
X`09for the new window.
X */
Xstatic WINDOW *
Xsplitw(int f, int n)
X`7B
X        register WINDOW *wp;
X        register LINE   *lp;
X        register int    ntru;
X        register int    ntrl;
X        register int    ntrd;
X        register WINDOW *wp1;
X        register WINDOW *wp2;
X
X        if (curwp->w_ntrows < MINWLNS) `7B
X        \0808mlforce("`5BCannot split a %d line window`5D", curwp->w_ntrows);
V
X        \0808return NULL;
X        `7D
X`09/* set everything to 0's unless we want nonzero */
X        if ((wp = typecalloc(WINDOW)) == NULL) `7B
X`09`09(void)no_memory("WINDOW");
X        \0808return NULL;
X        `7D
X`09++curwp->w_bufp->b_nwnd;`09       /* Displayed twice.     */
X        wp->w_bufp  = cur\110A;
X        copy_traits(`26(wp->w\0F07), `26(cur\140D);
X        ntru = (curwp->w_ntrows-1) / 2;\2708 /* Upper size\1609  */
X        ntrl = (curwp->w_ntrows-1) - ntru;\2A06/* Lower size\3D08   */
X
X        lp = curwp->w_line.l;
X        ntrd = 0;
X        while (lp != DOT.l) `7B
X        \0808ntrd += line_height(wp,lp);
X        \0808lp = lforw(lp);
X        `7D
X
X`09/* ntrd is now the row containing dot */
X        if (((f == FALSE) `26`26 (ntrd <= ntru)) `7C`7C ((f == TRU\2308 == 1))
V) `7B
X        \0808/* Old is upper window. */
X`09        /* Adjust the top line if necessary */
X        \0808if (ntrd == ntru) `7B\230D/* Hit mode line.\4107*/
X`09`09`09if (ntrl > 1) `7B
X`09`09&0209ntru++;
X`09`09&0209ntrl--;
X`09`09`09`7D else `7B
X`09        \0808\1008curwp->w_line.l = lforw(\180F);
X`09`09&0209curwp->w_line.o = 0;
X`09`09`09`7D
X`09`09`7D
X        \0808curwp->w_ntrows = ntru; /* new size */
X`09`09/* insert new window after curwp in\1608list */
X        \0808wp->w_wndp = cur\100A;
X        \0808curwp->w_wndp = wp;
X`09`09/* set new window's position and size */
X        \0808wp->w_toprow = cur\120C+ntru+1;
X        \0808wp->w_ntrows = ntrl;
X`09`09/* try to keep lower from reframing */
X`09`09wp->w_line.l = adjust_forw(wp, \1F0C, ntru+1);
X`09`09wp->w_line.o = 0;
X`09`09wp->w_dot.l = \0E06line.l;
X`09`09wp->w_dot.o = 0;
X`09`09/* update the split history */
X`09`09curwp->w_split_hist <<= 1;
X`09`09wp->w_split_hist = cur\1611`7C 1;
X        `7D else `7B
X`09`09/* Old is lower window  */
X        \0808wp1 = NULL;
X        \0808wp2 = wheadp;
X        \0808while (wp2 != curwp) `7B
X        \0808\1008wp1 = wp2;
X        \0808\1008wp2 = wp2->w_wndp;
X        \0808`7D
X        \0808if (wp1 == NULL)
X        \0808\1008wheadp = wp;
X        \0808else
X        \0808\1008wp1->w_wndp = wp;
X        \0808wp->w_wndp   = curwp;
X        \0808wp->w_toprow = cur\120C;
X        \0808wp->w_ntrows = ntru;
X        \0808++ntru;\1710\2709/* Mode line.\3D0B*/
X        \0808curwp->w_toprow += ntru;
X        \0808curwp->w_ntrows  = ntrl;
X`09`09wp->w_dot.l = \0E06line.l;
X`09`09/* move upper window dot to bottom line of\2307*/
X`09`09wp->w_dot.l = adjust_forw(wp, \1E0B, ntru-2);
X`09`09wp->w_dot.o = 0;
X`09`09/* adjust lower window topline */
X`09`09curwp->w_line.l = adjust_forw(curwp, \250F, ntru);
X`09`09curwp->w_line.o = 0;
X`09`09/* update the split history */
X`09`09wp->w_split_hist <<= 1;
X`09`09curwp->w_split_hist = \1311`7C 1;
X        `7D
X        curwp->w_flag `7C= WFMODE`7CWFHARD`7CWFSBAR;
X        wp->w_flag `7C= WFMODE`7CWFHARD;
X        return wp;
X`7D
X
X/* external callable version -- return int instead of (WINDOW *) */
Xint
Xsplitwind(int f, int n)
X`7B
X`09return (splitw(f,n)) ? TRUE:FALSE;
X`7D
X
X/*
X * Enlarge the current window. Find the \1106 that loses space. Make sure it
X * is big enough. If so, hack the window descriptions, and ask redisplay to do
V
X * all the hard work. You don't just set "force reframe" because dot would
X * move.
X */
X/* ARGSUSED */
Xint
Xenlargewind(int f, int n)
X`7B
X        register WINDOW *adjwp;
X
X        if (n < 0)
X        \0808return (shrinkwind(f, -n));
X        if (wheadp->w_wndp == NULL) `7B
X        \0808mlforce("`5BOnly one window`5D");
X        \0808return (FALSE);
X        `7D
X        if ((adjwp=curwp->w_wndp) == NULL) `7B
X        \0808adjwp = wheadp;
X        \0808while (adjwp->w_wndp != curwp)
X        \0808\1008adjwp =\0806->w_wndp;
X        `7D
X        if (adjwp->w_ntrows <= n) `7B
X        \0808mlforce("`5BImpossible change`5D");
X        \0808return (FALSE);
X        `7D
X        if (curwp->w_wndp == adjwp) `7B\2508   /* Shrink below.\4008*/
X        \0808adjwp->w_line.l  = adjust_forw(adjwp,\2610, n);
X`09`09adjwp->w_line.o  = 0;
X        \0808adjwp->w_toprow += n;
X        `7D else `7B\1008\1808\1010/* Shrink above.\4008*/
X        \0808curwp->w_line.l  = adjust_back(curwp,\2610, n);
X`09`09curwp->w_line.o  = 0;
X        \0808curwp->w_toprow -= n;
X        `7D
X        curwp->w_ntrows += n;
X        adjwp->w_ntrows -= n;
X        curwp->w_flag `7C= WFMODE`7CWFHARD`7CWFINS`7CWFSBAR;
X        adjwp->w_flag `7C= WFMODE`7CWFHARD`7CWFKILLS;
X        return (TRUE);
X`7D
X
X/*
X * Shrink the current window. Find the \1106 that gains space. Hack at the
X * window descriptions. Ask the redisplay to do all the hard work.
X */
Xint
Xshrinkwind(int f, int n)
X`7B
X        register WINDOW *adjwp;
X
X        if (n < 0)
X        \0808return (enlargewind(f, -n));
X        if (wheadp->w_wndp == NULL) `7B
X        \0808mlforce("`5BOnly one window`5D");
X        \0808return (FALSE);
X        `7D
X        if ((adjwp=curwp->w_wndp) == NULL) `7B
X        \0808adjwp = wheadp;
X        \0808while (adjwp->w_wndp != curwp)
X        \0808\1008adjwp =\0806->w_wndp;
X        `7D
X        if (curwp->w_ntrows <= n) `7B
X        \0808mlforce("`5BImpossible change`5D");
X        \0808return (FALSE);
X        `7D
X        if (curwp->w_wndp == adjwp) `7B\2508   /* Grow below.\190A*/
X        \0808adjwp->w_line.l  = adjust_back(adjwp,\2610, n);
X`09`09adjwp->w_line.o  = 0;
X        \0808adjwp->w_toprow -= n;
X        `7D else `7B\1008\1808\1010/* Grow above.\2E0A*/
X        \0808curwp->w_line.l  = adjust_forw(curwp,\2610, n);
X`09`09curwp->w_line.o  = 0;
X        \0808curwp->w_toprow += n;
X        `7D
X        curwp->w_ntrows -= n;
X        adjwp->w_ntrows += n;
X        curwp->w_flag `7C= WFMODE`7CWFHARD`7CWFKILLS`7CWFSBAR;
X        adjwp->w_flag `7C= WFMODE`7CWFHARD`7CWFINS;
X        return (TRUE);
X`7D
X
X/*`09Resize the current window to the requested size`09*/
Xint
Xresize(int f, int n)
X`7B
X`09int clines;`09/* current # of lines in window */
X
X`09/* must have a non-default argument, else ignore call */
X`09if (f == FALSE)
X`09`09return(TRUE);
X
X`09/* find out what to do */
X`09clines = curwp->w_ntrows;
X
X`09/* already the right size? */
X`09if (clines == n)
X`09`09return(TRUE);
X
X`09return(enlargewind(TRUE, n - clines));
X`7D
X
X/*
X * Pick a window for a pop-up. Split the screen if there is only one \3B06.
X * Pick the uppermost window that isn't the curren\1E08. An LRU algorithm
X * might be better. Return a pointer, or NULL on error.
X */
XWINDOW  *
Xwpopup(void)
X`7B
X        register WINDOW *wp;
X        register WINDOW *owp;
X        register WINDOW *biggest_wp;
X
X`09owp = curwp;
X        wp = biggest_wp = wheadp;\2108\2908/* Find window to split   */
X        while (wp->w_wndp != NULL) `7B
X        \0808wp = wp->w_wndp;
X`09`09if(wp->w_ntrows > biggest_\170C)
X`09`09`09biggest_wp = wp;
+-+-+-+-+-+-+-+-  END  OF PART 125 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 126 -+-+-+-+-+-+-+-+
X`09`7D
X`09if (biggest_wp->w_ntrows >= MINWLNS) `7B
X`09    curwp = biggest_wp;
X`09    wp = splitw(FALSE,0); /* yes -- choose the unoccupied half */
X`09    curwp = owp;
X`09`7D
X`09else `7B
X`09`09/*  biggest_wp was too small  */
X`09`09wp = wheadp;&0209/* Find window to use`09*/
X`09        while (wp!=NULL `26`26 wp==curwp) /* uppermost non-current window *
V/
X`09        \0808wp = wp->w_wndp;
X`09`09if (wp == NULL)
X`09`09    wp = wheadp;
X`09`7D
X        return wp;
X`7D
X
X/*
X * Shrink or expand current window to the number of lines in the buffer.
X * If the buffer is too large, make the window as large as possible using
X * space from window closest in the split history.
X */
X
Xvoid
Xshrinkwrap(void)
X`7B
X    L_NUM nlines;
X
X    if (wheadp->w_wndp == NULL)
X`09return;`09`09`09/* only one window */
X
X    nlines = line_count(curwp->w_bufp);
X    if (nlines <= 0)
X`09nlines = 1;
X
X    if (nlines == curwp->w_ntrows)
X`09return;
X
X    if ((curwp->w_split_hist `26 1) == 0 `7C`7C wheadp == curwp) `7B
X`09int nrows, snrows;
X`09/* give/steal from lower window */
X`09nrows = curwp->w_ntrows +\120Awnd\1A0C- 1;
X`09/* don't take more than 3/4 of its rows */
X`09snrows = (nrows*3)/4;
X`09if (nlines > snrows)
X`09    nlines = snrows;
X`09resize(TRUE, nlines);
X    `7D
X    else `7B
X`09/* give/steal from upper window; need to find\1B0D */
X`09register WINDOW *wp;
X`09WINDOW *savewp = curwp;
X`09int nrows, snrows;
X`09for (wp = wheadp;
X`09     wp->w_wndp != curwp `26`26\170FNULL;
X`09     wp = wp->w_wndp)
X`09    ;
X`09curwp = wp;
X`09nrows = curwp->w_ntrows +\120Awnd\1A0C- 1;
X`09/* don't take more than 3/4 of its rows */
X`09snrows = (nrows*3)/4;
X`09if (nlines > snrows)
X`09    nlines = snrows;
X`09resize(TRUE, nrows - nlines + 1);
X`09curwp = savewp;
X    `7D
X`7D
X
Xint
Xscrnextup(int f, int n)`09/* scroll the next window up (back) a page */
X`7B
X`09int`09status;
X
X`09(void)nextwind(FALSE, 1);
X`09status = backhpage(f, n);
X`09(void)prevwind(FALSE, 1);
X`09return status;
X`7D
X
Xint
Xscrnextdw(int f, int n)`09/* scroll the next window down (forward) a page */
X`7B
X`09int`09status;
X
X`09(void)nextwind(FALSE, 1);
X`09status = forwhpage(f, n);
X`09(void)prevwind(FALSE, 1);
X`09return status;
X`7D
X
X#if ! SMALLER
X/* ARGSUSED */
Xint
Xsavewnd(int f GCC_UNUSED, int n\120B)`09/* save ptr to current window */
X`7B
X`09swindow = curwp;
X`09return(TRUE);
X`7D
X
X/* ARGSUSED */
Xint
Xrestwnd(int f GCC_UNUSED, int n\120B)`09/* restore the saved screen */
X`7B
X`09register WINDOW *wp;
X
X`09/* find the window */
X`09for_each_visible_window(wp) `7B
X`09`09if (wp == swindow)
X`09`09`09return set_curwp(wp);
X`09`7D
X
X`09mlforce("`5BNo such window exists`5D");
X`09return(FALSE);
X`7D
X#endif
X
Xint
Xnewlength(int f, int n)`09/* resize the screen, re-writing\170B */
X`7B
X`09WINDOW *wp;`09/* current window being examined */
X`09WINDOW *nextwp;`09/* next window to scan */
X`09WINDOW *lastwp;`09/* last window scanned */
X
X`09if (!f) `7B
X`09`09mlforce("`5BNo length given`5D");
X`09`09return FALSE;
X`09`7D
X
X`09/* make sure it's in range */
X`09if (n < MINWLNS `7C`7C n > term.t_mrow) `7B
X`09`09mlforce("`5BScreen length out of range`5D");
X`09`09return(FALSE);
X`09`7D
X
X`09if (term.t_nrow == n)
X`09`09return(TRUE);
X`09else if (term.t_nrow < n) `7B
X
X`09`09/* go to the last window */
X`09`09wp = wheadp;
X`09`09while (wp->w_wndp != NULL)
X`09`09`09wp = wp->w_wndp;
X
X`09`09/* and enlarge it as needed */
X`09`09wp->w_ntrows = n - \1306toprow - 2;
X`09`09wp->w_flag `7C= WFHARD`7CWFMODE;
X
X`09`7D else `7B
X
X`09`09/* rebuild the window structure */
X`09`09nextwp = wheadp;
X`09`09lastwp = NULL;
X`09`09while (nextwp != NULL) `7B
X`09`09`09wp = nextwp;
X`09`09`09nextwp = wp->w_wndp;
X
X`09`09`09/* get rid of it i\0606s too low */
X`09`09`09if (wp->w_toprow >= n - 2) `7B
X
X`09`09&0209if (--wp->w_bufp->b_nwnd == 0) `7B
X`09`09&0209`09undispbuff(wp->w_bufp,wp);
X`09`09&0209`7D
X
X`09`09&0209/* update curwp and lastwp if needed */
X`09`09&0209if (wp == curwp) `7B
X`09`09&0209`09curwp = wheadp;
X`09`09&0209`09make_current(curwp->w_bufp);
X`09`09&0209`7D
X`09`09&0209if (lastwp != NULL)
X`09`09&0209`09lastwp->w_wndp = NULL;
X
X`09`09&0209/* free the structure */
X`09`09&0209free((char *)wp);
X`09`09&0209wp = NULL;
X
X`09`09`09`7D else `7B
X`09`09&0209/* need to change this window size? */
X`09`09&0209if (mode_row(wp) >= n - 3) `7B
X`09`09&0209`09wp->w_ntrows = n - \1306toprow - 2;
X`09`09&0209`09wp->w_flag `7C= WFHARD`7CWFMODE;
X`09`09&0209`7D
X`09`09`09`7D
X
X`09`09`09lastwp = wp;
X`09`09`7D
X`09`7D
X
X`09/* screen is garbage */
X`09term.t_nrow = n;
X`09sgarbf = TRUE;
X`09return(TRUE);
X`7D
X
Xint
Xnewwidth(int f, int n)`09/* resize the screen, re-writing\170B */
X`7B
X`09register WINDOW *wp;
X
X`09if (!f) `7B
X`09`09mlforce("`5BNo width given`5D");
X`09`09return FALSE;
X`09`7D
X
X`09/* make sure it's in range */
X`09if (n < 10 `7C`7C n > term.t_mcol) `7B
X`09`09mlforce("`5BScreen width out of range`5D");
X`09`09return(FALSE);
X`09`7D
X
X`09/* otherwise, just re-width it (no big deal) */
X`09term.t_ncol = n;
X`09term.t_margin = n / 10;
X`09term.t_scrsiz = n - (\1507margin * 2);
X
X`09/* force all windows to redraw */
X`09for_each_visible_window(wp)
X`09`09wp->w_flag `7C= WFHARD `7C WFMOVE\0907DE;
X
X`09sgarbf = TRUE;
X
X`09return(TRUE);
X`7D
X
X#if OPT_EVAL
Xint
Xgetwpos(void)`09/* get screen offset of current line in\1009window */
X`7B
X`09register int sline;`09/* screen line from top of window */
X`09register LINE *lp;`09/* scannile line pointer */
X
X`09/* search down the line we want */
X`09lp = curwp->w_line.l;
X`09sline = 1;
X`09while (lp != DOT.l) `7B
X`09`09sline += line_height(curwp,lp);
X`09`09lp = lforw(lp);
X`09`7D
X
X`09/* and return the value */
X`09return(sline);
X`7D
X#endif
X
X/*
X * Initialize all of the windows.
X */
Xvoid
Xwinit(int screen)
X`7B
X        register WINDOW *wp;
X
X        wp = typecalloc(WINDOW);`09`09/* First window\3108 */
X        if (wp==NULL)
X`09`09ExitProgram(BADEXIT);
X        wheadp = wp;
X        curwp  = wp;
X        wp->w_wndp  = NULL;\1B08\2308     /* Initialize window    */
X        wp->w_dot  = nullmark;
X`09wp->w_line = nullmark;
X#if WINMARK
X        wp->w_mark = nullmark;
X#endif
X        wp->w_lastdot = nullmark;
X        wp->w_toprow = 0;
X        wp->w_values = global_\1208;
X        wp->w_ntrows = screen
X`09`09`09? term.t_nrow-2&0209/* "-1" for mode line.  */
X`09`09`09: 1;&0309/* command-line&0209*/
X        wp->w_force = 0;
X        wp->w_flag  = WFMODE`7CWFHARD;\2408    /* Full.\140C    */
X`09wp->w_bufp  = NULL;
X
X`09if (screen) `7B
X`09`09(void)bsizes(bminip);`09/* FIXME */
X`09`09TRACE(("winit delinking bminip, %d lines, %ld bytes`5Cn",
X`09`09`09bminip->b_linecount,
X`09`09`09bminip->b_bytecount));
X`09`09(void) delink_bp(bminip);
X`09`7D else `7B
X`09`09/* create the command-buffer */
X`09`09TRACE(("winit creating bminip `26 wminip`5Cn"));
X`09`09wminip = wp;
X`09`09bminip = wp->w_bufp = bfind("", BFINVS);
X`09`09addline(bminip, "", 0);
X`09`09wminip->w_dot = b\1007b_dot;
X
X`09`09make_local_w_val(wminip,WMDNUMBER);
X`09`09set_w_val(wminip, WMDNUMBER, FALSE);
X
X`09`09make_local_w_val(wminip,WMDLIST);
X`09`09set_w_val(wminip, WMDLIST, FALSE);
X#ifdef WMDLINEWRAP
X`09`09make_local_w_val(wminip,WMDLINEWRAP);
X`09`09set_w_val(wminip, WMDLINEWRAP, FALSE);
X#endif
X`09`7D
X`7D
X
X/* For memory-leak testing (only!), releases all display storage. */
X#if NO_LEAKS
Xvoid`09wp_leaks(void)
X`7B
X`09register WINDOW *wp;
X
X`09while ((wp = wheadp) != 0) `7B
X        `09wp = wp->w_wndp;
X`09`09free((char *)wheadp);
X`09`09wheadp = wp;
X`09`7D
X`09free((char *)wminip);
X`7D
X#endif
X
X/*
X * Allocate a fake window so that we can yank a selection even if the buffer
X * containing the selection is not attached to any window.
X *
X * curwp is set to the new fake window.  A pointer\2308old\3B0Areturned
X * for a later call to pop_fake_win() which will restore curwp.
X */
X
X#if OPT_SEL_YANK `7C`7C OPT_PERL
XWINDOW *
Xpush_fake_win(BUFFER *bp)
X`7B
X    WINDOW *oldwp = curwp;
X    WINDOW *wp;
X    if ((wp = typealloc(WINDOW)) == NULL) `7B
X`09    (void)no_memory("WINDOW");
X`09    return NULL;
X    `7D
X    curwp = wp;
X    curwp->w_bufp = bp;
X#if 0
X    curwp->w_bufp->b_nwnd++;
X#endif
X    if ((wp = bp2any_wp(bp)) == NULL)
X`09copy_traits(`26(curwp->w\1207), `26(bp->b_w\1207);
X    else
X`09copy_traits(`26(curwp->w\1207), `26(\110D);
X    curwp->w_flag  = 0;
X    curwp->w_force = 0;
X    curwp->w_toprow = whead\130C- 2;`09/* should be negative */
X    curwp->w_ntrows = 1;
X    curwp->w_wndp = wheadp;
X    wheadp = curwp;
X    return oldwp;
X`7D
X
X/*
X * kill top fake window allocated by\0D06_fake_win;
X *
X * Set curwp to the oldwp parameter.
X *
X * Return 0 if no fake window popped, else r\2806the buffer pointer
X * of the popped window.
X *
X */
XBUFFER *
Xpop_fake_win(WINDOW *oldwp)
X`7B
X    WINDOW *wp;
X    BUFFER *bp;
X
X    curwp = oldwp;
X
X    wp = wheadp;
X    if (wp->w_toprow >= 0)
X`09return NULL;`09`09&0209/* not a fake window */
X
X    bp = wp->w_bufp;
X#if 0
X    /*
X     * Decrement the window count, but don't update the traits.  We want
X     * to give as little indication as possible that a fake window was
X     * created.  In particular, should the user go back to a buffer
X     * which is not currently displayed, DOT should be where he last
X     * left it.
X     */
X    --bp->b_nwnd;
X#endif
X    /* unlink and free the fake window */
X    wheadp = wp->w_wndp;
X    free((char *)wp);
X    return bp;
X`7D
X
X#endif
$ call unpack [.VILE-8_0]WINDOW.C;1 -
 911611732 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 58 131 152
$!
$ create 'f'
X/*
X * The routines in this file implement commands that work word or a
X * paragraph at a time.  There are all sorts of word mode commands.  If I
X * do any sentence mode commands, they are likely to be put in this file.
X *
X * $Header: /usr/build/vile/vile/RCS/word.c,v 1.62 1998/04/30 23:49:21 tom Exp
V $
X *
X */
X
X#include`09"estruct.h"
X#include`09"edef.h"
X#include`09"nefunc.h"
X
X/* Word wrap on n-spaces. Back-over whatever precedes the point on the current
V
X * line and stop on the first word-break or the beginning of the line. If we
X * reach the beginning of the line, jump back to the end\2208word and start
X * a new line.`09Otherwise, break the line at the word-break, eat it, and jump
V
X * back to the end of the word.
X * Returns TRUE on success, FALSE on errors.
X */
Xint
Xwrapword(int f, int n)
X`7B
X`09register int cnt = 0;`09/* size of word wrapped to next line */
X`09register int c;`09`09/* character temporary */
X`09B_COUNT`09to_delete;
X`09C_NUM to_append = 0;
X
X`09/* Back up from the <NL> 1 char */
X`09if (!backchar(FALSE, 1))
X`09`09return(FALSE);
X
X`09/* If parameter given, delete the trailing white space.  This is done
X`09 * to support a vi-like wrapmargin mode (see insert.c).  Unlike vi,
X`09 * we're deleting all of the trailing whitespace; vi\2C06es only the
X`09 * portion that was added during the current insertion.
X`09 *
X`09 * If there's no trailing whitespace, and we're not inserting blanks
X`09 * (n!=0), try to split the line a\0C07ast embedded whitespace.
X`09 */
X`09if (f) `7B
X`09`09register LINE *lp = DOT.l;
X`09`09to_delete = 0L;
X`09`09if (DOT.o >= 0 `26`26 !n &0226 !isSpace(lgetc(lp,DOT.o))) `7B
X`09`09`09for (c = DOT.o; c >= 0; c--) `7B
X`09`09&0209if (isSpace(lgetc(lp,c))) `7B
X`09`09&0209`09to_append = n;
X`09`09&0209`09cnt = (DOT.o - c);
X`09`09&0209`09DOT.o = c;
X`09`09&0209`09break;
X`09`09&0209`7D
X`09`09`09`7D
X`09`09`7D
X`09`09for (c = DOT.o; c >= 0; c--) `7B
X`09`09`09if (isSpace(lgetc(lp,c))) `7B
X`09`09&0209to_delete++;
X`09`09&0209DOT.o = c;
X`09`09`09`7D else `7B
X`09`09&0209break;
X`09`09`09`7D
X`09`09`7D
X`09`09if (to_delete == 0)
X`09`09`09DOT.o++;
X`09`7D else `7B
X`09`09/* Back up until we aren't in a word, make sure there is a
X`09`09 * break in the line
X`09`09 */
X`09`09while (c = char_at(DOT), !isSpace(c)) `7B
X`09`09`09cnt++;
X`09`09`09if (!backchar(FALSE, 1))
X`09`09&0209return(FALSE);
X`09`09`09/* if we make it to the beginning, start a new line */
X`09`09`09if (DOT.o == 0) `7B
X`09`09&0209(void)gotoeol(FALSE, 0);
X`09`09&0209return(lnewline());
X`09`09`09`7D
X`09`09`7D
X`09`09to_delete = 1L;
X`09`7D
X
X`09/* delete the forward white space */
X`09if (!ldelete(to_\0A06, FALSE))
X`09`09return(FALSE);
X
X`09/* put in a end of line */
X`09if (!newline(FALSE,1))
X`09`09return FALSE;
X
X`09/* and past the first word */
X`09while (cnt-- > 0) `7B
X`09`09if (forwchar(FALSE, 1) == FALSE)
X`09`09`09return(FALSE);
X`09`7D
X`09if (to_append > 0)
X`09`09linsert(to_append, ' ');
X`09return(TRUE);
X`7D
X
X
X/*
X * Implements the vi "w" command.
X *
X * Move the cursor forward by the specified number of words. All of the motion
V
X * is done by "forwchar". Error if you try and move beyond the buffer's end.
X *
X * Returns of SORTOFTRUE result if we're doing a non-delete operation.
X * Whitespace after a word is always included on deletes (and non-operations,
V
X * of course), but only on intermediate words for other operations, for
X * example.  The last word of non-delete ops does _not_ include its whitespace
V.
X */
Xint
Xforwviword(int f, int n)
X`7B
X`09int s;
X
X`09if (n < 0)
X`09`09return (backword(f, -n));
X`09setchartype();
X`09if (forwchar(TRUE, 1) == FALSE)
X`09`09return (FALSE);
X`09while (n--) `7B
X`09`09int any = 0;
X`09`09while (((s = isnewviwordf()) == FALSE) `7C`7C
X`09`09&0209(s == SORTOFTRUE `26`26 n != 0)) `7B
X`09`09`09if (forwchar(TRUE, 1) == FALSE)
X`09`09&0209return (any != 0);
X`09`09`09any++;
X`09`09`7D
X`09`7D
X`09return TRUE;
X`7D
X
X/*
X * Implements the vi "W" command.
X *
X * Move the cursor forward by the specified number of words. All of the motion
V
X * is done by "forwchar". Error if you try and move beyond the buffer's end.
X */
Xint
Xforwword(int f, int n)
X`7B
X`09int s;
X
X`09if (n < 0)
X`09`09return (backword(f, -n));
X`09setchartype();
X`09if (forwchar(TRUE, 1) == FALSE)
X`09`09return (FALSE);
X`09while (n--) `7B
X`09`09int any = 0;
X`09`09while (((s = isnewwordf()) == FALSE) `7C`7C
X`09`09&0209(s == SORTOFTRUE `26`26 n != 0)) `7B
X`09`09`09if (forwchar(TRUE, 1) == FALSE)
X`09`09&0209return (any != 0);
X`09`09`09any++;
X`09`09`7D
X`09`7D
X`09return(TRUE);
X`7D
X
X/*
X * Implements the vi "e" command.
X *
X * Move the cursor forward by the specified number of words. All of the motion
V
X * is done by "forwchar". Error if you try and move beyond the buffer's end.
X */
Xint
Xforwviendw(int f, int n)
X`7B
X`09int s = FALSE;
X`09if (!f)
X`09`09n = 1;
X`09else if (n <= 0)
X`09`09return (FALSE);
X`09if (forwchar(TRUE, 1) == FALSE)
X`09`09return (FALSE);
X`09setchartype();
X`09while (n--) `7B
X`09`09int`09any = 0;
X`09`09while ((s = isendviwordf()) == FALSE) `7B
X`09`09`09if (forwchar(TRUE, 1) == FALSE)
X`09`09&0209return (any != 0);
X`09`09`09any++;
X`09`09`7D
X
X`09`7D
X`09if (s == SORTOFTRUE)
X`09`09return TRUE;
X`09else
X`09`09return backchar(FALSE, 1);
X`7D
X
X/*
X * Implements the vi "E" command.
X *
X * Move the cursor forward by the specified number of words. All of the motion
V
X * is done by "forwchar". Error if you try and move beyond the buffer's end.
X */
Xint
Xforwendw(int f, int n)
X`7B
X`09int s = FALSE;
X`09if (!f)
X`09`09n = 1;
X`09else if (n <= 0)
X`09`09return (FALSE);
X`09if (forwchar(TRUE, 1) == FALSE)
X`09`09return (FALSE);
X`09setchartype();
X`09while (n--) `7B
X`09`09int`09any = 0;
X`09`09while ((s = isendwordf()) == FALSE) `7B
X`09`09`09if (forwchar(TRUE, 1) == FALSE)
X`09`09&0209return (any != 0);
X`09`09`09any++;
X`09`09`7D
X
X`09`7D
X`09if (s == SORTOFTRUE)
X`09`09return TRUE;
X`09else
X`09`09return backchar(FALSE, 1);
X`7D
X
X/*
X * Implements the vi "b" command.
X *
X * Move the cursor backward by "n" words. All of the details of motion are
X * performed by the "backchar" and "forw\0F06routines. Error if you try to
X * move beyond the buffers.
X */
Xint
Xbackviword(int f, int n)
X`7B
X`09if (n < 0)
X`09`09return (forwword(f, -n));
X`09if (backchar(FALSE, 1) == FALSE)
X`09`09return (FALSE);
X`09setchartype();
X`09while (n--) `7B
X`09`09int`09any = 0;
X`09`09while (isnewviwordb() == FALSE) `7B
X`09`09`09any++;
X`09`09`09if (backchar(FALSE, 1) == FALSE)
X`09`09&0209return (any != 0);
X`09`09`7D
X`09`7D
X`09return (forwchar(TRUE, 1));
X`7D
X
X/*
X * Implements the vi "B" command.
X *
X * Move the cursor backward by "n" words. All of the details of motion are
X * performed by the "backchar" and "forw\0F06routines. Error if you try to
X * move beyond the buffers.
X */
Xint
Xbackword(int f, int n)
X`7B
X`09if (n < 0)
X`09`09return (forwword(f, -n));
X`09if (backchar(FALSE, 1) == FALSE)
X`09`09return (FALSE);
X`09setchartype();
X`09while (n--) `7B
X`09`09int`09any = 0;
X`09`09while (isnewwordb() == FALSE) `7B
X`09`09`09any++;
X`09`09`09if (backchar(FALSE, 1) == FALSE)
X`09`09&0209return (any != 0);
X`09`09`7D
X`09`7D
X`09return (forwchar(TRUE, 1));
X`7D
X
Xint
Xjoinregion(void)
X`7B
X`09register int status;
X`09register int doto, c;
X`09LINE`09*end;
X`09REGION`09region;
X`09int`09done = FALSE;
X
X`09if ((status = getregion(`26\0806)) == TRUE
X`09 `26`26 (status = !is_last_line(region.r_orig, curbp)) == TRUE) `7B
X
X`09`09DOT = region.r_orig;
X`09`09end = region.r_end.l;
X`09`09regionshape = EXACT;
X
X`09`09while (!done `26`26 status == TRUE) `7B
X`09`09`09c = EOS;
X`09`09`09(void)gotoeol(FALSE,1);
X`09`09`09if (DOT.o > 0)
X`09`09&0209c = lgetc(DOT.l, DOT.o-1);
X`09`09`09(void)setmark();
X`09`09`09if (forwline(FALSE,1) != TRUE)
X`09`09&0209break;
X`09`09`09(void)firstnonwhite(FALSE,1);
X
X`09`09`09done = ((DOT.l == end) `7C`7C (lforw\1806) \1907);
X`09`09`09if (killregionmaybesave(FALSE) != TRUE)
X`09`09&0209break;
X
X`09`09`09doto = DOT.o;
X`09`09`09if (doto == 0)
X`09`09&0209/*EMPTY*/; /* join at column 0 to empty line */
X`09`09`09else if (doto < llength(DOT.l)) `7B
X`09`09&0209if (lgetc(DOT.l, doto) == ')')
X`09`09&0209`09/*EMPTY*/; /* join after parentheses */
X`09`09&0209else if (lgetc(DOT.l, doto-1) == '.')
X`09`09&0209`09status = linsert(2,' ');
X`09`09&0209else if (!isSpace(c))
X`09`09&0209`09status = linsert(1,' ');
X`09`09`09`7D
X`09`09`7D
X`09`7D
X`09return status;
X`7D
X
Xint
Xjoinlines(int f, int n)
X`7B
X`09havemotion = `26f_godotplus;
X`09return(operjoin(f,n));
X`7D
X
X#if OPT_FORMAT
Xstatic int
Xdot_at_section_break(void)
X`7B
X`09regexp *expP = b_val_rexp(curbp,VAL_PARAGRAPHS)->reg;
X`09regexp *expC = b_val_rexp(curbp,VAL_COMMENTS)->reg;
X
X`09return (lregexec(expP, DOT.l, 0, llength(DOT.l)) `7C`7C
X`09`09lregexec(expC, DOT.l, 0, llength(DOT.l)) );
X`7D
X
X/* returns the length of the comment-prefix, if it matches, otherwise -1 */
Xstatic int
Xcomment_prefix (void)
X`7B
X`09regexp *expP = b_val_rexp(curbp,VAL_CMT_PREFIX)->reg;
X`09int result = -1;
X`09if (lregexec(expP, DOT.l, 0, llength(DOT.l))) `7B
X`09`09result = (int)(expP->endp`5B0`5D - DOT.l->l_text);
X`09`7D
X`09return result;
X`7D
X
X#define cplus_comment_start(c) `5C
X`09`09((c == '/') `5C
X`09`09`26`26 DOT.o+1 < llength(DOT.l) `5C
X`09`09`26`26 lgetc(DOT.l,DOT.o+1) == '/')
X
X#define c_comment_start(c) `5C
X`09`09((c == '/') `5C
X`09`09`26`26 DOT.o+1 < llength(DOT.l) `5C
X`09`09`26`26 lgetc(DOT.l,DOT.o+1) == '*')
X
X#define fmt_insert(count,chr) `5C
X`09`09if ((s = linsert(count,chr)) != TRUE) `5C
X`09`09`09return s; `5C
X`09`09else `5C
X`09`09`09clength += count
X
X#define fmt_c_preprocessor(cp) `5C
X`09`09(tb_length(*cp) == 1 `5C
X`09`09`26`26 *tb_values(*cp) == '#' `5C
X`09`09`26`26 is_c_mode(curbp))
X
X#define word_finishes_c_comment(wp) `5C
X`09`09(tb_length(*wp) >= 2 `5C
X`09`09`26`26 memcmp("/*", tb_values(*wp), 2) == 0)
X
Xstatic int
Xdo_formatting(TBUFF **wp, \0C08cp)
X`7B
X`09register int c;`09`09`09/* current char during scan`09*/
X`09register int clength;`09`09/* position on line during fill`09*/
X`09register int plength;`09`09/* prefix to ignore during fill`09*/
X`09register ALLOC_T i;`09`09/* index during word copy`09*/
X`09register int newlen;`09`09/* tentative new line length`09*/
X`09register int finished;`09`09/* Are we at the End-Of-Paragraph? */
X`09register int firstflag;`09`09/*\0F06 word? (needs no space)`09*/
X`09register int is_comment;`09/* doing a \1407 block?`09*/
X`09register int at_nl = TRUE;`09/* just saw a newline?`09`09*/
X`09register LINEPTR pastline;`09/* pointer to line just past EOP */
X`09register int sentence;`09`09/* was the last char a period?`09*/
X`09int secondindent;
X`09int s;
X
X`09if (!sameline(MK, DOT)) `7B
X`09`09REGION region;
X
X`09`09if (getregion(`26\0806) != TRUE)
X`09`09`09return FALSE;
X`09`09if (sameline(region.r_orig, MK))
X`09`09`09swapmark();
X`09`7D
X`09pastline = MK.l;
X`09if (pastline != buf_head(curbp))
X`09`09pastline = lforw(\1108);
X
X `09finished = FALSE;
X `09while (finished != TRUE) `7B  /* i.e. is FALSE or SORTOFTRUE */
X`09`09if (DOT.l == pastline)`09/* FIXME */
X`09`09`09return setmark();
X`09`09while (dot_at_section_break()) `7B
X`09`09`09DOT.l = lforw(DOT.l);
X`09`09`09if (DOT.l == pastline)
X`09`09&0209return setmark();
X`09`09`7D
X
X`09`09secondindent = \0906len(DOT.l);
X
X`09`09/* go forward to get the indent for the second
X`09`09`09and following lines */
X`09`09DOT.l = lforw(DOT.l);
X
X`09`09if (DOT.l != pastline) `7B
X`09`09`09secondindent = \0906len(DOT.l);
X`09`09`7D
X
X`09`09/* and back where we should be */
X`09`09DOT.l = lback(DOT.l);
X`09`09(void)firstnonwhite(FALSE,1);
X
X`09`09plength = comment_prefix ();
X`09`09clength = indentlen(DOT.l);
X`09`09tb_init(wp, EOS);
X`09`09tb_init(cp, EOS);
X`09`09sentence = FALSE;
X
X`09`09c = char_at(DOT);
X`09`09is_comment = FALSE;
X`09`09if (plength >= 0) `7B
X`09`09`09is_comment = TRUE;
X`09`09`09tb_bappend(cp,
X`09`09&0209DOT.l->l_text + DOT.o,
X`09`09&0209(ALLOC_T)(plength - DOT.o));
X`09`09`7D else if (cplus_comment_start(c)) `7B
X`09`09`09is_comment = TRUE;
X`09`09`09tb_bappend(cp, "//", 2);
X`09`09`7D else if (c_comment_start(c)) `7B
X`09`09`09is_comment = TRUE;
X`09`09`09tb_bappend(cp, "*", 1);
X`09`09`7D
X
X`09`09/* scan through lines, filling words */
X`09`09firstflag = TRUE;
X`09`09finished = FALSE;
X`09`09plength -= DOT.o;
X`09`09while (finished == FALSE) `7B /* i.e. is not TRUE  */
X`09`09&0209`09    /* or SORTOFTRUE */
X`09`09`09if (interrupted()) return ABORT;
X
X`09`09`09/* get the next character */
X`09`09`09if (is_at_end_of_line(DOT)) `7B
X`09`09&0209c = ' ';
X`09`09&0209DOT.l = lforw(DOT.l);
X`09`09&0209if (DOT.l == pastline) `7B
X`09`09&0209`09finished = TRUE;
X`09`09&0209`7D else if (dot_at_section_break()) `7B
X`09`09&0209`09finished = SORTOFTRUE;
X`09`09&0209`7D
X
X`09`09&0209if ((s = comment_prefix ()) >= 0) `7B
X`09`09&0209`09int save = DOT.o;
X
X`09`09&0209`09(void)firstnonwhite(FALSE,1);
X`09`09&0209`09s -= DOT.o;
X
X`09`09&0209`09if (s != (int) tb_length(*cp)
X`09`09&0209`09 `7C`7C (s > 0
X`09`09&0209`09  `26`26 memcmp(tb_values(*cp),
X`09`09&0209&0209DOT.l->l_text + DOT.o,
X`09`09&0209&0209s))) `7B
X`09`09&0209&0209finished = SORTOFTRUE;
X`09`09&0209`09`7D
X
X`09`09&0209`09if (finished == FALSE) `7B
X`09`09&0209&0209plength = s;
X`09`09&0209&0209tb_init(cp, EOS);
X`09`09&0209&0209if (plength > 0) `7B
X`09`09&0209&0309tb_bappend(cp,
X`09`09&0209&0409DOT.l->l_text + DOT.o,
X`09`09&0209&0409(ALLOC_T)(plength));
X`09`09&0209&0209`7D
X`09`09&0209&0209if (DOT.l != pastline
X`09`09&0209&0209 `26`26 !dot_at_section_break()) `7B
X`09`09&0209&0309int spcs = DOT.o;
X`09`09&0209&0309DOT.o = 0;
X`09`09&0209&0309s = ldelete(spcs, FALSE);
X`09`09&0209&0309if (s != TRUE) return s;
X`09`09&0209&0209`7D
X`09`09&0209`09`7D
X`09`09&0209`09DOT.o = save;
X`09`09&0209`7D
X`09`09&0209DOT.l = lback(DOT.l);
X`09`09&0209at_nl = TRUE;
X`09`09`09`7D else `7B
X`09`09&0209c = char_at(DOT);
X`09`09&0209if (at_nl `26`26 ((plength-- > 0) `7C`7C isSpace(c)))
X`09`09&0209`09c = ' ';
X`09`09&0209else
X`09`09&0209`09at_nl = FALSE;
X`09`09`09`7D
X
X`09`09`09/* and then delete it */
X`09`09`09if (finished == FALSE) `7B
X`09`09&0209s = ldelete(1L, FALSE);
X`09`09&0209if (s != TRUE) return s;
X`09`09`09`7D
X
X`09`09`09/* if not a separator, just add it in */
X`09`09`09if (!isBlank(c)) `7B
X`09`09&0209/* was it the end of a "sentence"? */
X`09`09&0209sentence = ((c == '.' `7C`7C \0C06?' &027C
X`09`09&0209&0209c == ':' `7C`7C \0C06!') `26`26
X`09`09&0209&0209global_g_val(GMDSPACESENT));
X`09`09&0209tb_append(wp, c);
X`09`09`09`7D else if (tb_length(*wp)) `7B
X`09`09&0209/* at a word break with\1208waiting */
X`09`09&0209/* calculate tentative new length
X`09`09&0209&0309with word added */
X`09`09&0209newlen = clength + 1 + tb_\1006(*wp);
X`09`09&0209if (newlen <= b_val(curbp,VAL_FILL)) `7B
X`09`09&0209`09/* add word to current line */
X`09`09&0209`09if (!firstflag) `7B
X`09`09&0209&0209fmt_insert(1, ' ');
X`09`09&0209`09`7D
X`09`09&0209`7D else `7B
X`09`09&0209`09/* fix the leading indent now, if
X`09`09&0209&0209some spaces should be tabs */
X`09`09&0209`09if (b_val(curbp,MDTABINSERT))
X`09`09&0209&0209entabline((void *)TRUE, 0, 0);
X`09`09`09        \0808if (lnewline() == FALSE)
X`09`09&0209&0209return FALSE;
X`09`09&0209`09clength = 0;
X`09`09&0209        fmt_insert(secondindent,' ');
X`09`09&0209`09firstflag = TRUE;
X`09`09&0209`7D
X
X`09`09&0209if (firstflag
X`09`09&0209 `26`26 is_comment
X`09`09&0209 `26`26 !word_finishes_c_comment(wp)) `7B
X`09`09&0209`09for (i=0; i < tb_length(*cp); i++) `7B
X`09`09&0209&0209fmt_insert(1, tb_values(*cp)`5Bi`5D);
X`09`09&0209`09`7D
X`09`09&0209`09if (!fmt_c_preprocessor(cp)) `7B
X`09`09&0209&0209fmt_insert(1, ' ');
X`09`09&0209`09`7D
X`09`09&0209`7D
X`09`09&0209firstflag = FALSE;
X
X`09`09&0209/* and add the word in in either case */
X`09`09&0209for (i=0; i < tb_length(*wp); i++) `7B
X`09`09&0209`09fmt_insert(1, tb_values(*wp)`5Bi`5D);
X`09`09&0209`7D
X`09`09&0209if (finished == FALSE `26`26 sentence) `7B
X`09`09&0209`09fmt_insert(1, ' ');
X`09`09&0209`7D
X`09`09&0209tb_init(wp, EOS);
X`09`09`09`7D
X`09`09`7D
X`09`09/* catch the case where we're done with a line not because
X`09`09  there's no more room, but because we're done processing a
X`09`09  section or the region */
X`09`09if (b_val(curbp,MDTABINSERT))
X`09`09`09entabline((void *)TRUE, 0, 0);
X`09`09DOT.l = lforw(DOT.l);
X`09`7D
X`09return setmark();
X`7D
X
Xint
Xformatregion(void)
X`7B
X`09int s = FALSE;
X`09TBUFF *wp = 0;`09`09/* word buffer */
X`09TBUFF *cp = 0;`09`09/* comment-prefix buffer */
X
X`09if ((wp = tb_init(`26wp, EOS)) != 0
X`09 `26`26 (wp = tb_init(`26wp, EOS)) != 0) `7B
X`09`09s = do_formatting(`26wp, `26cp);
X`09`09tb_free(`26wp);
X`09`09tb_free(`26cp);
X`09`7D
X`09return s;
X`7D
X#endif /* OPT_FORMAT */
X
X
X#if`09OPT_WORDCOUNT
X/*`09wordcount:`09count the # of words in the marked region,
X`09`09`09along with average word sizes, # of chars, etc,
X`09`09`09and report on them.&0309*/
X/*ARGSUSED*/
Xint
Xwordcount(int f GCC_UNUSED, int n\120B)
X`7B
X`09register LINE *lp;`09/* current line to scan */
X`09register int offset;`09/* current char to scan */
X`09long size;`09`09/* size of region left to count */
X`09register int ch;`09/* current character to scan */
X`09register int wordflag;`09/* are we in a word now? */
X`09register int lastword;`09/* were we just in a word? */
X`09long nwords;`09`09/* total # of words */
X`09long nchars;`09`09/* total number of chars */
X`09int nlines;`09`09/* total number of lines in region */
X`09int avgch;`09`09/* average number of chars/word */
X`09int status;`09`09/*\0C07 return code */
X`09REGION region;`09`09/*\0C07 to look at */
X
X`09/* make sure we have a region to count */
X`09if ((status = getregion(`26\0806)) != TRUE) `7B
X`09`09return(status);
X`09`7D
X`09lp     = region.r_orig.l;
X`09offset = region.r_orig.o;
X`09size   = region.r_size;
X
X`09/* count up things */
X`09lastword = FALSE;
X`09nchars = 0L;
X`09nwords = 0L;
X`09nlines = 0;
X`09while (size--) `7B
X
X`09`09/* get the current character */
X`09`09if (offset == llength(lp)) `7B`09/* end of line */
X`09`09`09ch = '`5Cn';
X`09`09`09lp = lforw(lp);
X`09`09`09offset = 0;
X`09`09`09++nlines;
X`09`09`7D else `7B
X`09`09`09ch = lgetc(lp, offset);
X`09`09`09++offset;
X`09`09`7D
X
X`09`09/* and tabulate it */
X`09`09if (((wordflag = isident(ch)) != 0) `26`26 !lastword)
X`09`09`09++nwords;
X`09`09lastword = wordflag;
X`09`09++nchars;
X`09`7D
X
X`09/* and report on the info */
X`09if (nwords > 0L)
X`09`09avgch = (int)((100L * nchars) / nwords);
X`09else
X`09`09avgch = 0;
X
X`09mlforce("lines %d, words %D, char\0A06avg\0E06/word %f",
+-+-+-+-+-+-+-+-  END  OF PART 126 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 127 -+-+-+-+-+-+-+-+
X`09`09nlines, nwords, nchars, avgch);
X
X`09return(TRUE);
X`7D
X#endif
$ call unpack [.VILE-8_0]WORD.C;1 -
 1782145989 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 33 132 152
$!
$ create 'f'
X/* These routines report on transitions between word boundaries, both
X *`09in the punctuated vi sense, and \2007whitespace/darkspace
X *`09sense.  The transition is reported _after_ it has occurred.  You
X *`09need to back up to get to the char. before the transition.
X *`09Written for vile: Copyright (c) 1990, 1995 by Paul Fox
X *
X * $Header: /usr/build/vile/vile/RCS/wordmov.c,v 1.19 1998/04/28 10:19:41 tom
V Exp $
X *
X */
X
X#include "estruct.h"
X#include "edef.h"
X
X#define WASSPACE 0
X#define ISSPACE 0
X#define WASIDENT 1
X#define ISIDENT 1
X#define WASOTHER 2
X#define ISOTHER 2
X#define WASNL 3
X#define ISNL 3
X
Xstatic int ochartype;
X
Xstatic int
Xgetchartype(void)
X`7B
X`09register int`09c;
X
X`09if (is_at_end_of_line(DOT))
X`09`09return (ISNL);
X`09else
X`09`09c = char_at(DOT);
X`09return (isSpace(c) ? ISSPACE :
X`09`09`09( isident(c) ? ISIDENT : ISOTHER ) );
X`7D
X
Xvoid
Xsetchartype(void)
X`7B
X`09ochartype = get\0E08();
X`7D
X
X
Xint
Xisnewwordf(void)
X`7B
X`09register int`09ret = FALSE;
X`09register int`09type;
X
X`09type = getchartype();
X
X`09switch (ochartype) `7B
X`09case WASNL:
X`09case WASSPACE:
X`09`09switch (type) `7B
X`09`09case ISNL:
X`09`09`09if (doingopcmd) `7B
X`09`09&0209ret = SORTOFTRUE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09/* FALLTHROUGH */
X`09`09case ISSPACE:
X`09`09`09ret = FALSE;
X`09`09`09break;
X`09`09case ISIDENT:
X`09`09`09/* FALLTHROUGH */
X`09`09case ISOTHER:
X`09`09`09ret = TRUE;
X`09`09`09break;
X`09`09`7D
X`09`09break;
X`09case WASIDENT:
X`09case WASOTHER:
X`09`09switch (type) `7B
X`09`09case ISNL:
X`09`09`09if (doingopcmd) `7B
X`09`09&0209ret = SORTOFTRUE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09/* FALLTHROUGH */
X`09`09case ISSPACE:
X`09`09`09if (doingopcmd `26`26 \0906!= OPDEL) `7B
X`09`09&0209ret = SORTOFTRUE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09/* FALLTHROUGH */
X`09`09case ISIDENT:
X`09`09`09/* FALLTHROUGH */
X`09`09case ISOTHER:
X`09`09`09ret = FALSE;
X`09`09`09break;
X`09`09`7D
X`09`09break;
X`09`7D
X`09ochartype = type;
X`09return (ret);
X`7D
X
Xint
Xisnewwordb(void)
X`7B
X`09register int`09ret = FALSE;
X`09register int`09type;
X
X`09type = getchartype();
X
X`09switch (ochartype) `7B
X`09case WASNL:
X`09case WASSPACE:
X`09`09ret = FALSE;`09break;
X`09case WASIDENT:
X`09`09switch (type) `7B
X`09`09case ISNL:
X`09`09case ISSPACE: ret = TRUE;`09break;
X`09`09case ISIDENT:
X`09`09case ISOTHER: ret = FALSE;`09break;
X`09`09`7D
X`09`09break;
X`09case WASOTHER:
X`09`09switch (type) `7B
X`09`09case ISNL:
X`09`09case ISSPACE: ret = TRUE;`09break;
X`09`09case ISIDENT:
X`09`09case ISOTHER: ret = FALSE;`09break;
X`09`09`7D
X`09`09break;
X`09`7D
X`09ochartype = type;
X`09return (ret);
X`7D
X
Xint
Xisnewviwordf(void)
X`7B
X`09register int`09ret = FALSE;
X`09register int`09type;
X
X`09type = getchartype();
X
X`09switch (ochartype) `7B
X`09case WASNL:
X`09case WASSPACE:
X`09`09switch (type) `7B
X`09`09case ISNL:
X`09`09`09if (doingopcmd) `7B
X`09`09&0209ret = SORTOFTRUE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09/* FALLTHROUGH */
X`09`09case ISSPACE:
X`09`09`09ret = FALSE;
X`09`09`09break;
X`09`09case ISIDENT:
X`09`09`09/* FALLTHROUGH */
X`09`09case ISOTHER:
X`09`09`09ret = TRUE;
X`09`09`09break;
X`09`09`7D
X`09`09break;
X`09case WASIDENT:
X`09`09switch (type) `7B
X`09`09case ISNL:
X`09`09`09if (doingopcmd) `7B
X`09`09&0209ret = SORTOFTRUE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09/* FALLTHROUGH */
X`09`09case ISSPACE:
X`09`09`09if (doingopcmd `26`26 \0906!= OPDEL) `7B
X`09`09&0209ret = SORTOFTRUE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09/* FALLTHROUGH */
X`09`09case ISIDENT:
X`09`09`09ret = FALSE;
X`09`09`09break;
X`09`09case ISOTHER:
X`09`09`09ret = TRUE;
X`09`09`09break;
X`09`09`7D
X`09`09break;
X`09case WASOTHER:
X`09`09switch (type) `7B
X`09`09case ISNL:
X`09`09`09if (doingopcmd) `7B
X`09`09&0209ret = SORTOFTRUE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09/* FALLTHROUGH */
X`09`09case ISSPACE:
X`09`09`09if (doingopcmd `26`26 \0906!= OPDEL) `7B
X`09`09&0209ret = SORTOFTRUE;
X`09`09&0209break;
X`09`09`09`7D
X`09`09`09/* FALLTHROUGH */
X`09`09case ISOTHER:
X`09`09`09ret = FALSE;
X`09`09`09break;
X`09`09case ISIDENT:
X`09`09`09ret = TRUE;
X`09`09`09break;
X`09`09`7D
X`09`09break;
X`09`7D
X`09ochartype = type;
X`09return (ret);
X`7D
X
Xint
Xisnewviwordb(void)
X`7B
X`09register int`09ret = FALSE;
X`09register int`09type;
X
X`09type = getchartype();
X
X`09switch (ochartype) `7B
X`09case WASNL:
X`09case WASSPACE:
X`09`09ret = FALSE;`09break;
X`09case WASIDENT:
X`09`09switch (type) `7B
X`09`09case ISNL:
X`09`09case ISSPACE:
X`09`09case ISOTHER: ret = TRUE;`09break;
X`09`09case ISIDENT: ret = FALSE;`09break;
X`09`09`7D
X`09`09break;
X`09case WASOTHER:
X`09`09switch (type) `7B
X`09`09case ISNL:
X`09`09case ISSPACE:
X`09`09case ISIDENT: ret = TRUE;`09break;
X`09`09case ISOTHER: ret = FALSE;`09break;
X`09`09`7D
X`09`09break;
X`09`7D
X`09ochartype = type;
X`09return (ret);
X`7D
X
Xint
Xisendwordf(void)
X`7B
X`09register int`09ret = FALSE;
X`09register int`09type;
X
X`09type = getchartype();
X
X`09switch (ochartype) `7B
X`09case WASNL:
X`09case WASSPACE:
X`09`09ret = FALSE;`09break;
X`09case WASIDENT:
X`09`09switch (type) `7B
X`09`09case ISNL:
X`09`09case ISSPACE:
X`09`09`09if (doingopcmd) ret = SORTOFTRUE;
X`09`09`09else ret = TRUE;
X`09`09`09if (doingsweep) sweephack = TRUE;
X`09`09`09break;
X`09`09case ISIDENT:
X`09`09case ISOTHER: ret = FALSE;`09break;
X`09`09`7D
X`09`09break;
X`09case WASOTHER:
X`09`09switch (type) `7B
X`09`09case ISNL:
X`09`09case ISSPACE:
X`09`09`09if (doingopcmd) ret = SORTOFTRUE;
X`09`09`09else ret = TRUE;
X`09`09`09if (doingsweep) sweephack = TRUE;
X`09`09`09break;
X`09`09case ISIDENT:
X`09`09case ISOTHER: ret = FALSE;`09break;
X`09`09`7D
X`09`09break;
X`09`7D
X`09ochartype = type;
X`09return (ret);
X`7D
X
Xint
Xisendviwordf(void)
X`7B
X`09register int`09ret = FALSE;
X`09register int`09type;
X
X`09type = getchartype();
X
X`09switch (ochartype) `7B
X`09case WASNL:
X`09case WASSPACE:
X`09`09ret = FALSE;`09break;
X`09case WASIDENT:
X`09`09switch (type) `7B
X`09`09case ISNL:
X`09`09case ISSPACE:
X`09`09case ISOTHER:
X`09`09`09if (doingopcmd) ret = SORTOFTRUE;
X`09`09`09else ret = TRUE;
X`09`09`09if (doingsweep) sweephack = TRUE;
X`09`09`09break;
X`09`09case ISIDENT: ret = FALSE;`09break;
X`09`09`7D
X`09`09break;
X`09case WASOTHER:
X`09`09switch (type) `7B
X`09`09case ISNL:
X`09`09case ISSPACE:
X`09`09case ISIDENT:
X`09`09`09if (doingopcmd) ret = SORTOFTRUE;
X`09`09`09else ret = TRUE;
X`09`09`09if (doingsweep) sweephack = TRUE;
X`09`09`09break;
X`09`09case ISOTHER: ret = FALSE;`09break;
X`09`09`7D
X`09`09break;
X`09`7D
X`09ochartype = type;
X`09return (ret);
X`7D
X
X#ifdef template
Xint
XisANYTHING(void)
X`7B
X`09register int`09ret = FALSE;
X`09register int`09type;
X
X`09type = getchartype();
X
X`09switch (ochartype) `7B
X`09case WASNL:
X`09case WASSPACE:
X`09`09switch (type) `7B
X`09`09case ISNL:
X`09`09case ISSPACE:
X`09`09`09ret = FALSE;`09break;
X`09`09case ISIDENT:
X`09`09`09ret = FALSE;`09break;
X`09`09case ISOTHER:
X`09`09`09ret = FALSE;`09break;
X`09`09`7D
X`09`09break;
X`09case WASIDENT:
X`09`09switch (type) `7B
X`09`09case ISNL:
X`09`09case ISSPACE:
X`09`09`09ret = TRUE;`09break;
X`09`09case ISIDENT:
X`09`09`09ret = FALSE;`09break;
X`09`09case ISOTHER:
X`09`09`09ret = TRUE;`09break;
X`09`09`7D
X`09`09break;
X`09case WASOTHER:
X`09`09switch (type) `7B
X`09`09case ISNL:
X`09`09case ISSPACE:
X`09`09`09ret = TRUE;`09break;
X`09`09case ISIDENT:
X`09`09`09ret = TRUE;`09break;
X`09`09case ISOTHER:
X`09`09`09ret = FALSE;`09break;
X`09`09`7D
X`09`09break;
X`09`7D
X`09ochartype = type;
X`09return (ret);
X`7D
X#endif /* template */
$ call unpack [.VILE-8_0]WORDMOV.C;1 -
 1013402309 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 13 133 152
$!
$ create 'f'
X/*
X * `09X11 support, Dave Lemke, 11/91
X *`09X Toolkit support, Kevin Buettner, 2/94
X *
X * $Header: /usr/build/vile/vile/RCS/x11.c,v 1.183 1998/05/30 12:26:01 tom Exp
V $
X *
X */
X
X/*
X * Widget set selection.
X *
X * You must have exactly one of the following defined
X *
X *    NO_WIDGETS`09-- Use only Xlib and X toolkit (Xt)
X *    ATHENA_WIDGETS`09-- Use Xlib, Xt, and Xaw widget set
X *    MOTIF_WIDGETS`09-- Use Xlib, Xt, and Motif widget set
X *    OL_WIDGETS`09-- Use Xlib, Xt, and Openlook widget set
X *
X * We derive/set from the configure script some flags that allow intermediate
V
X * configurations between NO_WIDGETS and ATHENA\1308
X *
X *    KEV_WIDGETS
X *    OPT_KEV_DRAGGING
X *    OPT_KEV_SCROLLBARS
X */
X
X#define NEED_X_INCLUDES 1
X#include`09"estruct.h"
X#include`09"edef.h"
X#include`09"nefunc.h"
X#include`09"pscreen.h"
X
X#include`09<X11/cursorfont.h>
X
X#if defined(lint) `26`26 HAVE_X11_INTRINSICI_H
X#include`09<X11/IntrinsicI.h>
X#endif
X
X#if XtSpecificationRelease < 4
X#define XtPointer caddr_t
X#endif
X
X#if DISP_X11 `26`26 XTOOLKIT
X
X/* sanity-check, so we know it's safe to not nest ifdef's */
X
X#if NO_WIDGETS
X# if ATHENA_WIDGETS `7C`7C MOTIF\110COL\1F08
X   >make an error<
X# endif
X#else
X# if ATHENA_WIDGETS
X#  if MOTIF_WIDGETS `7C`7C OL\0E08
X    >make an error<
X#  endif
X# else
X#  if MOTIF_WIDGETS
X#   if OL_WIDGETS
X     >make an error<
X#   endif
X#  else
X#   if !OL_WIDGETS
X     >make an error<
X#   endif
X#  endif
X# endif
X#endif
X
X#ifndef OPT_KEV_SCROLLBARS
X# if NO_WIDGETS
X#  define OPT_KEV_SCROLLBARS 1
X# endif
X#endif
X
X#ifndef OPT_KEV_DRAGGING
X# if NO_WIDGETS
X#  define OPT_KEV_DRAGGING 1
X# endif
X#endif
X
X#ifndef KEV_WIDGETS
X# if NO_WIDGETS `7C`7C OPT_KEV_SCROLLBARS
X#  define KEV_WIDGETS 1
X# endif
X#endif
X
X#ifndef OPT_XAW_SCROLLBARS
X# if ATHENA_WIDGETS `26`26 !OPT_KEV_SCROLLBARS
X#  define OPT_XAW_SCROLLBARS 1
X# endif
X#endif
X
X#define MY_CLASS`09"XVile"
X
X#if SYS_VMS
X#undef SYS_UNIX
X#define coreWidgetClass w\0C0B/* patch for VMS 5.4-3 (dickey) */
X#endif
X
X/* redefined in X11/Xos.h */
X#undef strchr
X#undef strrchr
X
X#if OPT_XAW_SCROLLBARS
X#if HAVE_LIB_XAW
X#include`09<X11/Xaw/Form.h>
X#include`09<X11/Xaw/Grip.h>
X#include`09<X11/Xaw/Scrollbar.h>
X#endif
X#if HAVE_LIB_XAW3D
X#include`09<X11/Xaw3d/Form.h>
X#include`09<X11/Xaw3d/Grip.h>
X#include`09<X11/Xaw3d/Scrollbar.h>
X#endif
X#if HAVE_LIB_NEXTAW
X#include`09<X11/neXtaw/Form.h>
X#include`09<X11/neXtaw/Grip.h>
X#include`09<X11/neXtaw/Scrollbar.h>
X#endif
X#endif /* OPT_XAW_SCROLLBARS */
X
X#if OL_WIDGETS
X#undef BANG
X#include`09<Xol/OpenLook.h>
X#include`09<Xol/Form.h>
X#include`09<Xol/BulletinBo.h>
X#include`09<Xol/Slider.h>
X#include`09<Xol/Scrollbar.h>
X#endif /* OL_WIDGETS */
X
X#include`09<X11/Shell.h>
X#include`09<X11/keysym.h>
X#include`09<X11/Xatom.h>
X
X#if MOTIF_WIDGETS
X#include`09<Xm/Form.h>
X#include`09<Xm/PanedW.h>
X#include`09<Xm/ScrollBar.h>
X#include`09<Xm/SashP.h>
X#if defined(lint) `26`26 HAVE_XM_XMP_H
X#include`09<Xm/XmP.h>
X#endif
X#endif /* MOTIF_WIDGETS */
X
X#define`09XCalloc(type)`09typec\110B
X
X#define`09MARGIN`098
X#define`09SCRSIZ`0964
X#define`09absol(x)`09((x) > 0 ? (x) : -(x))
X#define`09CEIL(a,b)`09((a + b - 1) / (b))
X
X#define onMsgRow(tw)`09(ttrow == (int)(tw->rows - 1))
X
X/* XXX -- use xcutsel instead */
X#undef`09SABER_HACK`09`09/* hack to support Saber since it doesn't do
X`09`09&0209 * selections right */
X
X#undef btop`09`09/* defined in SunOS includes */
X
X#define PANE_WIDTH_MAX 200
X
X#if OPT_KEV_SCROLLBARS `7C`7C OPT_XAW\160B
X# define PANE_WIDTH_DEFAULT 15
X# define PANE_WIDTH_MIN 7
X#else
X# if MOTIF_WIDGETS `7C`7C OL\0E08
X#  define PANE_WIDTH_DEFAULT 20
X#  define PANE_WIDTH_MIN 10
X# endif
X#endif
X
X#ifndef XtNmenuHeight
X#define XtNmenuHeight "\0C0A"
X#endif
X
X#ifndef XtCMenuHeight
X#define XtCMenuHeight "\0C0A"
X#endif
X
X#define MENU_HEIGHT_DEFAULT 20
X
X#define MINCOLS`0930
X#define MINROWS MINWLNS
X#define MAXSBS`09((MAXROWS) / 2)
X
X/* Blinking cursor toggle...defined this way to leave room for future
X * cursor flags.
X */
X#define`09BLINK_TOGGLE`090x1
X
X/*
X * Fonts searched flags
X */
X
X#define FSRCH_BOLD`090x1
X#define FSRCH_ITAL`090x2
X#define FSRCH_BOLDITAL`090x4
X
X/* Keyboard queue size */
X#define KQSIZE 64
X
Xstatic Display *dpy;
X
X#if OPT_MENUS
X#if ATHENA_WIDGETS
X#include <X11/Xaw/SimpleMenu.h>
X#include <X11/Xaw/Box.h>
X#include <X11/Xaw/Form.h>
X#include <X11/Xaw/Paned.h>
X#endif
X#if MOTIF_WIDGETS
X#include <Xm/RowColumn.h>
X#endif
X    Widget`09menub;
X#endif
X
X#if OPT_XAW_SCROLLBARS
Xtypedef struct _scroll_info `7B
X    int`09`09totlen;&0209/* total length of scrollbar */
X`7D ScrollInfo;
X#else
X#if OPT_KEV_SCROLLBARS
Xtypedef struct _scroll_info `7B
X    int`09`09top;&0209/* top of "thumb" */
X    int`09`09bot;&0209/* bottom of "thumb" */
X    int`09`09totlen;&0209/* total length of scrollbar */
X    Boolean`09exposed;`09/* has scrollbar received \2306 event? */
X`7D ScrollInfo;
X#endif
X#endif
X
Xtypedef struct _text_win `7B
X    /* X stuff */
X    Window`09win;`09`09/* window corresponding to screen */
X    XtAppContext
X    `09`09app_context;`09/* application \1807 */
X    Widget`09top_widget;`09/* top level \1506 */
X    Widget`09screen;`09`09/* \0C06 widget */
X#if ATHENA_WIDGETS
X    Widget`09pane_widget;`09/* pane \1006, actually a form */
X    Widget`09menu_widget;`09/* menu-bar \1406, actually a box */
X#endif
X    Widget`09form_widget;`09/* form enclosing text-display + scrollbars */
X    Widget`09pane;`09`09/* panes in which scrollbars live */
X    int`09`09maxscrollbars;`09/* how many \180A, sliders, etc. */
X    Widget`09*scrollbars;
X    `09`09&0209/* the scrollbars */
X    int`09`09nscrollbars;`09/* number of currently active \2A06 bars */
X#if OL_WIDGETS
X    Widget`09*sliders;
X#endif
X#if OPT_KEV_SCROLLBARS `7C`7C OPT_XAW\160B
X    Pixel`09scrollbar_fg;
X    Pixel`09scrollbar_bg;
X    Bool`09slider_is_solid;
X    Bool`09slider_is_3D;
X    GC`09`09scrollbargc;`09/* graphics context for \2509 "thumb" */
X    Pixmap`09trough_pixmap;
X    Pixmap`09slider_pixmap;
X    ScrollInfo`09*scrollinfo;
X    Widget`09*grips; `09/* grips for resizing scrollbars */
X    XtIntervalId scroll_repeat_id;
X    ULONG`09scroll_repeat_timeout;
X#endif`09/* OPT_KEV_SCROLLBARS */
X#if OPT_XAW_SCROLLBARS
X    Pixmap`09thumb_bm;`09/* bitmap for scrollbar thumb */
X#endif
X    ULONG`09scroll_repeat_interval;
X    XtIntervalId blink_id;
X    int`09`09blink_status;
X    int`09`09blink_interval;
X    Bool`09exposed;`09/* Have we received any \2106 events? */
X    int`09`09visibility;`09/* How visible is the window? */
X
X    int`09`09base_width;`09/* width with screen widgets'\1B07zero */
X    int`09`09base_height;
X    UINT`09pane_width;`09/* full width of scrollbar pane */
X    Dimension`09menu_height;`09/* \0B06 of menu-bar */
X    Dimension`09top_width;`09/* width of top widget as of last resize */
X    Dimension`09top_height;`09/* \0B06 of top widget as of last resize */
X
X    int`09`09fsrch_flags;`09/* flags which indicate\0F07fonts have
X    `09`09&0209 * been searched for
X`09`09&0209 */
X    XFontStruct *pfont;`09`09/* Normal font */
X    XFontStruct *pfont_bold;
X    XFontStruct *pfont_ital;
X    XFontStruct *pfont_boldital;
X    GC          textgc;
X    GC          reversegc;
X    GC`09`09selgc;
X    GC`09`09revselgc;
X    GC`09`09cursgc;
X    GC`09`09revcursgc;
X    GC`09`09modeline_focus_gc;`09/* GC for \1D08 w/ focus */
X    GC`09`09modeline_gc;&0209/* GC for other \1E08s  */
X    GC`09`09colors_fgc`5B16`5D;
X    GC`09`09colors_bgc`5B16`5D;
X    Pixel`09fg;
X    Pixel`09bg;
X    Pixel`09colors_fg`5B16`5D;
X    Pixel`09colors_bg`5B16`5D;
X    Pixel`09modeline_fg;
X    Pixel`09modeline_bg;
X    Pixel`09modeline_focus_fg;
X    Pixel`09modeline_focus_bg;
X    Pixel`09selection_fg;
X    Pixel`09selection_bg;
X    int         char_width,
X        \0808char_ascent,
X`09`09char_descent,
X        \0808char_height;
X    Bool`09left_ink,`09/* font has "ink" past bounding box on left */
X    `09`09right_ink;`09/* font has "ink" past bounding box on right */
X    char       *geometry;
X    char       *starting_fontname;`09/* name of font at startup */
X    char       *fontname;`09`09/* name of current font */
X    Bool`09focus_follows_mouse;
X    Bool`09fork_on_startup;
X    Bool`09scrollbar_on_left;
X    Bool`09update_window_name;
X    Bool`09update_icon_name;
X    Bool`09persistent_selections;
X    Bool`09selection_sets_DOT;
X
X    /* text stuff */
X    Bool        reverse;
X    unsigned    rows,
X        \0808cols;
X    Bool        show_cursor;
X
X    /* cursor stuff */
X    Pixel`09cursor_fg;
X    Pixel`09cursor_bg;
X
X    /* pointer stuff */
X    Pixel`09pointer_fg;
X    Pixel`09pointer_bg;
X    Cursor`09normal_pointer;
X#if OPT_WORKING
X    Cursor`09watch_pointer;
X    Bool`09want_to_work;
X#endif
X
X    /* selection stuff */
X    String`09multi_click_char_class;`09/* ?? */
X    Time        lasttime;`09/* for multi-click */
X    Time        click_timeout;
X    int         numclicks;
X    Bool        have_selection;
X    Bool`09wipe_permitted;
X    Bool`09was_on_msgline;
X    Bool`09did_select;
X    Bool`09pasting;
X    MARK`09prevDOT;`09`09/* DOT prior to selection */
X    XtIntervalId sel_scroll_id;
X
X    /* key press queue */
X    int`09`09kqhead;
X    int`09`09kqtail;
X    int`09`09kq`5BKQSIZE`5D;
X
X    /* Special translations */
X    XtTranslations my_scrollbars_trans;
X#if OPT_KEV_SCROLLBARS `7C`7C OPT_XAW\160B
X    XtTranslations my_resizeGrip_trans;
X#endif
X`7D           TextWindowRec, *\100A;
X
X
Xstatic`09TextWindowRec cur_win_rec;
Xstatic`09TextWindow cur_win = `26\0B07_rec;
Xstatic`09TBUFF`09*PasteBuf;
X
Xstatic`09Atom`09atom_WM_PROTOCOLS;
Xstatic`09Atom`09atom_WM_DELETE_WINDOW;
Xstatic`09Atom`09atom_FONT;
Xstatic`09Atom`09atom_FOUNDRY;
Xstatic`09Atom`09atom_WEIGHT_NAME;
Xstatic`09Atom`09atom_SLANT;
Xstatic`09Atom`09atom_SETWIDTH_NAME;
Xstatic`09Atom`09atom_PIXEL_SIZE;
Xstatic`09Atom`09atom_RESOLUTION_X;
Xstatic`09Atom`09atom_RESOLUTION_Y;
Xstatic`09Atom`09atom_SPACING;
Xstatic`09Atom`09atom_AVERAGE_WIDTH;
Xstatic`09Atom`09atom_CHARSET_REGISTRY;
Xstatic`09Atom`09atom_CHARSET_ENCODING;
Xstatic`09Atom`09atom_TARGETS;
Xstatic`09Atom`09atom_MULTIPLE;
Xstatic`09Atom`09atom_TIMESTAMP;
Xstatic`09Atom`09atom_TEXT;
Xstatic`09Atom`09atom_CLIPBOARD;
X
X#if OPT_KEV_SCROLLBARS `7C`7C OPT_XAW\160B
Xstatic`09Cursor`09curs_sb_v_double_arrow;
Xstatic`09Cursor`09curs_sb_up_arrow;
Xstatic`09Cursor`09curs_sb_down_arrow;
Xstatic`09Cursor`09curs_sb_left_arrow;
Xstatic`09Cursor`09curs_sb_right_arrow;
Xstatic`09Cursor`09curs_double_arrow;
X#endif
X
X#if MOTIF_WIDGETS
Xstatic Bool lookfor_sb_resize = FALSE;
X#endif
X
Xstruct eventqueue `7B
X    XEvent event;
X    struct eventqueue *next;
X`7D;
X
Xstatic struct eventqueue *evqhead = NULL;
Xstatic struct eventqueue *evqtail = NULL;
X
Xstatic`09int`09x_getc   (void),
X`09`09x_cres   ( const char *flag );
X
Xstatic`09void`09x_open   (void),
X`09`09x_close  (void),
X`09`09x_flush  (void),
X`09`09x_kopen  (void),
X`09`09x_kclose (void),
X`09`09x_beep   (void),
X`09`09x_rev    ( UINT state );
X
X#if OPT_COLOR
Xstatic`09void`09x_fcol   ( int color ),
X`09`09x_bcol   ( int color );
X#endif
X
Xstatic`09void`09x_scroll(int from, int to\0806count);
X
Xstatic`09SIGT`09x_quit (int ACTUAL_SIG_ARGS);
Xstatic`09int`09x_watchfd(int fd, WATCHTYPE type, long *idp);
Xstatic`09void`09x_unwatchfd(int fd, long id);
X
Xstatic`09int`09set_character_class(char *s);
Xstatic`09void`09x_touch (TextWindow tw, int sc\0807r, UINT ec, \0906r);
Xstatic`09void`09x_paste_selection (Atom \1009);
Xstatic`09void`09x_own_selection(Atom \0F09);
Xstatic`09Boolean`09x_get_selected_text(UCHAR **datp, SIZE_T *lenp);
Xstatic`09Boolean`09x_get_clipboard_text(UCHAR **datp, SIZE_T *lenp);
Xstatic`09Boolean`09x_convert_selection (Widget w, Atom *\1B09\1108target,
X`09`09`09Atom *type, XtPointer *value, unsigned long *length,
X`09`09`09int *format);
Xstatic`09void`09extend_selection (TextWindow tw, int nr\0807c, Bool wipe);
Xstatic`09void`09x_process_event (Widget w, XtPointer unused, XEvent *ev,
X`09`09`09Boolean *continue_to_dispatch);
Xstatic`09void`09x_configure_window (Widget w, XtPointer unused, XEvent *ev,
X`09`09`09Boolean *continue_to_dispatch);
Xstatic`09void`09x_change_focus (Widget w, XtPointer unused, XEvent *ev,
X`09`09`09Boolean *continue_to_dispatch);
Xstatic`09void`09x_typahead_timeout (XtPointer flagp, XtIntervalId *id);
Xstatic`09void`09x_key_press (Widget w, XtPointer unused, XEvent *ev,
X`09`09`09Boolean *continue_to_dispatch);
Xstatic`09void`09x_wm_delwin (Widget w, XtPointer unused, XEvent *ev,
X`09`09`09Boolean *continue_to_dispatch);
X#if OPT_KEV_SCROLLBARS `7C`7C OPT_XAW\160B
Xstatic`09Boolean`09too_light_or_too_dark (Pixel pixel);
X#endif
X#if OPT_KEV_SCROLLBARS
Xstatic`09Boolean`09alloc_shadows (Pixel pixel, \0D06*light\0E09dark);
X#endif
Xstatic`09XFontStruct *query_font (TextWindow tw, const char *fname);
Xstatic`09void`09configure_bar (Widget w, XEvent *event, String *params,
X`09`09`09Cardinal *num_params);
Xstatic`09int`09check_scrollbar_allocs (void);
Xstatic`09void`09kqinit(TextWindow tw);
Xstatic`09int`09kqempty(TextWindow tw);
Xstatic`09int`09kqfull(TextWindow tw);
Xstatic`09void`09kqadd (TextWindow tw, int c);
Xstatic`09int`09kqpop(TextWindow tw);
Xstatic`09void`09display_cursor (XtPointer client_data, XtIntervalId *idp);
X#if 0
Xstatic`09void`09check_visuals (void);
X#endif
X#if MOTIF_WIDGETS
Xstatic`09void`09grip_moved (Widget w, XtPointer unused, XEvent *ev,
X`09`09`09Boolean *continue_to_dispatch);
Xstatic`09void`09pane_button (Widget w, XtPointer unused, XEvent *ev,
X`09`09`09Boolean *continue_to_dispatch);
X#endif /* MOTIF_WIDGETS */
X#if OPT_KEV_SCROLLBARS
Xstatic`09void`09x_expose_scrollbar (Widget w, XtPointer unused, XEvent *ev,
X`09`09`09Boolean *continue_to_dispatch);
X#endif /* OPT_KEV_SCROLLBARS */
X#if OPT_KEV_DRAGGING
Xstatic`09void`09repeat_scroll (XtPointer count, XtIntervalId  *id);
X#endif
X#if OPT_WORKING
Xstatic`09void`09x_set_watch_cursor(int onflag);
Xstatic`09int`09x_has_events(void);
X#else
X#define x_has_events() (XtAppPending(cur_win->app_context) `26 XtIMXEvent)
X#endif /* OPT_WORKING */
Xstatic`09int`09evqempty (void);
Xstatic`09void`09evqadd(const XEvent *evp);
X
X#define`09FONTNAME`09"7x13"
X
XTERM        term = `7B
X    0,`09`09&0209/* these four values are set dynamically at
X`09`09&0209 * open time */
X    0,
X    0,
X    0,
X    MARGIN,
X    SCRSIZ,
X    0,
X    x_open,
X    x_close,
X    x_kopen,
X    x_kclose,
X    x_getc,
X    psc_putchar,
X    tttypahead,
X    psc_flush,
X    psc_move,
X    psc_eeol,
X    psc_eeop,
X    x_beep,
X    x_rev,
X    x_cres,
X#if OPT_COLOR
X    x_fcol,
X    x_bcol,
X#else
X    null_t_setfor,
X    null_t_setback,
X#endif
X    null_t_setpal,`09`09/* no palette */
X    x_scroll,
X    x_flush,
X    null_t_icursor,
X    null_t_title,
X    x_watchfd,
X    x_unwatchfd,
X`7D;
X
X
X#define`09x_width(tw)`09`09((tw)->cols * \0D07har\2406)
X#define`09x_height(tw)`09`09((tw)->rows * \0D06char\2507)
X#define`09x_pos(tw, c)`09`09((c) * (tw)->char_width)
X#define`09y_pos(tw, r)`09`09((r) * (tw)->char_height)
X#define`09text_y_pos(tw, r)`09(\0E06(tw), (r)) + (tw)->char_ascent)
X#define min(a,b)`09`09((a) < (b) ? (a) : (b))
X#define max(a,b)`09`09((a) > (b) ? (a) : (b))
X
X
X
X#if KEV_WIDGETS
X/* We define our own little bulletin board widget here...if this gets
X * too unwieldly, we should move it to another file.
X */
X
X#include`09<X11/IntrinsicP.h>
X
X/* New fields for the Bb widget class record */
Xtypedef struct `7Bint empty;`7D BbClassPart;
X
X/* Class record declaration */
Xtypedef struct _BbClassRec `7B
X    CoreClassPart`09core_class;
X    CompositeClassPart  c\1408_class;
X    BbClassPart`09bb_class;
X`7D BbClassRec;
X
Xextern BbClassRec b\0B09;
X
X/* Instance declaration */
Xtypedef struct _BbRec `7B
X    CorePart`09    core;
X    CompositePart   c\1008;
X`7D BbRec;
X
Xstatic XtGeometryResult bb\1108Manager (Widget w, Xt\0C06\3408 *request\1B16pl
Vy);
Xstatic XtGeometryResult bbPreferredSize (Widget widget, Xt\1106\3708 *constrai
Vn\1E15p\4E08);
X
XBbClassRec b\0B0A= `7B
X  `7B
X/* core_class fields      */
X    /* superclass         */    (WidgetClass) `26compositeClassRec,
X    /* class_name         */    "Bb",
X    /* widget_size        */    sizeof(BbRec),
X    /* class_initialize   */    NULL,
X    /* class_part_init    */`09NULL,
X    /* class_inited       */`09FALSE,
X    /* initialize         */    NULL,
X    /* initialize_hook    */`09NULL,
X    /* realize            */    XtInheritR\2206,
X    /* actions            */    NULL,
X    /* num_actions`09  */`090,
X    /* resources          */    NULL,
X    /* num_resources      */    0,
X    /* xrm_class          */    NULLQUARK,
X    /* compress_motion`09  */`09TRUE,
X    /* compress_exposure  */`09TRUE,
X    /* compress_enterleave*/`09TRUE,
X    /* visible_interest   */    FALSE,
X    /* destroy            */    NULL,
X    /* resize             */    XtInheritResize,
X    /* expose             */    NULL,
X    /* set_values         */    NULL,
X    /* set_values_hook    */`09NULL,
X    /* set_values_almost  */    XtInheritSetValuesAlmost,
X    /* get_values_hook    */`09NULL,
X    /* accept_focus       */    NULL,
X    /* version            */`09XtV\1806,
X    /* callback_private   */    NULL,
X    /* tm_table           */    NULL,
X    /* query_geometry     */`09bbPreferredSize, /*XtInheritQueryG\3107,*/
X    /* display_accelerator*/`09XtInheritD\1F06A\1E0A,
X    /* extension          */`09NULL
X  `7D,`7B
X/* composite_class fields */
X    /* geometry_manager   */    bbG\1B07M\1A06,
X    /* change_managed     */    XtInheritChangeM\2106,
X    /* insert_child`09  */`09XtInheritInsertChild,
X    /* delete_child`09  */`09XtInheritDeleteChild,
X    /* extension          */`09NULL
X  `7D,`7B
X/* Bb class fields */
X    /* empty`09`09  */`090,
X  `7D
X`7D;
X
XWidgetClass bb\0E0C= (\1D0B)`26bbClassRec;
X
X/*ARGSUSED*/
Xstatic XtGeometryResult
XbbPreferredSize(
X    Widget w\0706GCC_UNUSED,
X    XtWidgetGeometry *constraint GCC_UNUSED,
X    XtWidgetGeometry *preferred GCC_UNUSED)
X`7B
X    return XtGeometryYes;
X`7D
X
X/*ARGSUSED*/
Xstatic XtGeometryResult
XbbGeometryManager(
X    Widget`09`09w,
X    XtWidgetGeometry`09*request,
X    XtWidgetGeometry`09*reply GCC_UNUSED)`09/* RETURN */
X
X`7B
X    /* Allow any and all changes to the geometry */
X    if (request->\0907_mode `26 CWWidth)
X`09w->core.width = request->width;
X    if (request->\0907_mode `26 CWHeight)
X`09w->core.height = request->\1206;
X    if (request->\0907_mode `26 CWBorderWidth)
X`09w->core.border_width = request->\180C;
X    if (request->\0907_mode `26 CWX)
X`09w->core.x = request->x;
X    if (request->\0907_mode `26 CWY)
X`09w->core.y = request->y;
X
X    return XtGeometryYes;
X`7D
X
X#endif /* KEV_WIDGETS */
X
Xstatic void set_pointer(Window win, Cursor cursor)
X`7B
X    XColor colordefs`5B2`5D;`09`09/* 0 is foreground, 1 is back\1106 */
X
X    XDefineCursor(dpy, win, cursor);
X
X    colordefs`5B0`5D.pixel = cur_win->pointer_fg;
X    colordefs`5B1`5D.pixel = cur_win->pointer_bg;
X    XQueryColors (dpy, DefaultColormap\160EScreen (dpy)),
X`09`09  colordefs, 2);
X    XRecolorCursor (dpy, cursor, colordefs\0B0B+1);
X`7D
X
X#if !OPT_KEV_DRAGGING
Xstatic int dont_update_sb = FALSE;
X
Xstatic void
Xset_scroll_window(long n)
X`7B
X    register WINDOW *wp;
X    for_each_visible_window(wp) `7B
X`09if (n-- == 0)
X`09    break;
X    `7D
X    if (n < 0)
X`09set_curwp(wp);
X`7D
X#endif /* !OPT_KEV_DRAGGING */
X
X#if OL_WIDGETS
Xstatic void
XJumpProc(
X    Widget scrollbar,
X    XtPointer closure,
X    XtPointer call_data)
X`7B
X    long value = (long)closure;
X    OlScrollbarVerify *cbs = (\1A13)call_data;
X
X    if (value >= cur_win->nscrollbars)
X`09return;
X    set_scroll_window(value);
X    mvupwind(TRUE,
X             line_no(curwp->w_bufp, \0F09line.l) - cbs->new_location);
X    dont_update_sb = TRUE;
X    (void)update(TRUE);
X    dont_update_sb = FALSE;
X`7D
X
Xstatic void
Xgrip_moved(
X    Widget slider,
X    XtPointer closure,
X    XtPointer call_data)
X`7B
X    register WINDOW *wp, *saved_curwp;
X    int nlines;
X    long i = (long) closure;
X    OlScrollbarVerify *cbs = (\1A13)call_data;
X
X    for_each_visible_window(wp) `7B
X`09if (i-- == 0)
X`09    break;
X    `7D
X    if (!wp)
X`09return;
+-+-+-+-+-+-+-+-  END  OF PART 127 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 128 -+-+-+-+-+-+-+-+
X    saved_curwp = curwp;
X    nlines = - cbs->new_location;
X    if (nlines < 1)
X`09nlines = 1;
X    curwp = wp;
X    resize(TRUE, nlines);
X    set_curwp(saved\0C06);
X    (void) update(TRUE);
X`7D
X
Xstatic void
Xupdate_scrollbar_sizes(void)
X`7B
X    register WINDOW *wp;
X    int i, newsbcnt;
X    Dimension new_height;
X
X    i=0;
X    for_each_visible_window(wp)
X`09i++;
X    newsbcnt=i;
X
X    /* Create any needed new scrollbars and sliders */
X    for (i = cur_win->nscrollbars+1; i <= newsbcnt; i++)
X`09if (cur_win->scrollbars`5Bi`5D == NULL) `7B
X`09    cur_win->scrollbars`5Bi`5D = XtVaCreateWidget(
X`09`09    "scrollbar",
X`09`09    scrollbarWidgetClass,
X`09`09    cur_win->pane,
X`09`09    XtNtranslations, cur_win->my_scrollbars_trans,
X`09`09    NULL);
X`09    XtAddCallback(cur_win->scrollbars`5Bi`5D,
X`09`09    XtNsliderMoved, JumpProc, (XtPointer) i);
X`09    cur_win->sliders`5Bi`5D = XtVaCreateWidget(
X`09`09    "slider",
X`09`09    sliderWidgetClass,
X`09`09    cur_win->pane,
X`09`09    NULL);
X`09    XtAddCallback(cur_win->sliders`5Bi`5D,
X`09`09    XtNsliderMoved, grip_m\0C06(XtPointer) i);
X`09`7D
X
X    /* Unmanage current set of scrollbars */
X    if (cur_win->nscrollbars > 0)
X`09XtUnmanageChildren(cur_win->scrollbars,
X`09        \0808   (Cardinal) (cur_win->nscrollbars));
X    if (cur_win->nscrollbars > 1)
X`09XtUnmanageChildren(cur_win->sliders,
X`09        \0808   (Cardinal) (cur_win->nscrollbars - 1));
X
X    /* Set sizes and positions on scrollbar\1C06sliders */
X    cur_win->nscrollbars = newsbcnt;
X    i=0;
X    for_each_visible_window(wp) `7B
X`09new_height = wp->w_ntrows * cur_win->char_\2606;
X`09XtVaSetValues(cur_win->scrollbars`5Bi`5D,
X`09    XtNy,`09wp->w_toprow * cur_win->char_height,
X`09    XtNheight,`09new_\0C07
X`09    XtNsliderMin,`091,
X`09    XtNsliderMax,`09200,
X`09    XtNproportionLength, 2,
X`09    XtNsliderValue,`093,
X`09    NULL);
X`09if (wp->w_wndp) `7B
X`09    XtVaSetValues(cur_win->sliders`5Bi`5D,
X`09`09XtNy,&0209wp->w_toprow * cur_win->char_height,
X`09`09XtNheight,`09(wp->w_ntrows + \0F06wnd\170E1)
X`09`09&0209`09    * cur_win->char_height,
X`09`09XtNsliderMax,`090,
X`09`09XtNsliderMin,`09-(wp->w_ntrows + \0F06wnd\170B),
X`09`09XtNsliderValue, -wp->w_ntrows,
X`09`09XtNstopPosition, OL_GRANULARITY,
X`09`09XtNendBoxes,`09FALSE,
X`09`09XtNdragCBType,`09OL_RELEASE,
X`09`09XtNbackground,`09cur_win->fg,
X`09`09NULL);
X`09`7D
X`09wp->w_flag `26= `7EWFSBAR;
X`09update_scrollbar(wp);
X`09i++;
X    `7D
X
X    /* Manage the sliders */
X    if (cur_win->nscrollbars > 1)
X`09XtManageChildren(cur_win->sliders,
X`09`09`09    (Cardinal) (cur_win->nscrollbars - 1));
X
X    /* Manage the current set of scrollbars */
X    XtManageChildren(cur_win->scrollbars,
X`09        \0808   (Cardinal) (cur_win->nscrollbars));
X
X
X    for (i=0; i<cur_win->nscrollbars; i++)
X`09XRaiseWindow(dpy, Xt\0E07cur_win->scrollbars`5Bi`5D));
X`7D
X
X#else
X#if MOTIF_WIDGETS
X
Xstatic void
XJumpProc(
X    Widget scrollbar,
X    XtPointer closure,
X    XtPointer call_data)
X`7B
X    long value = (long)closure;
X    int lcur;
X
X    lookfor_sb_resize = FALSE;
X    if (value >= cur_win->nscrollbars)
X`09return;
X    set_scroll_window(value);
X    lcur = line_no(curwp->w_bufp, \0F09line.l);
X    mvupwind(TRUE, lcur - ((XmScrollBarCallbackStruct *)call_data)->value);
X    dont_update_sb = TRUE;
X    (void)update(TRUE);
X    dont_update_sb = FALSE;
X`7D
X
Xstatic void
Xupdate_scrollbar_sizes(void)
X`7B
X    register WINDOW *wp;
X    int newsbcnt;
X    Dimension new_height;
X    Widget *children;
X    int num_children;
X    long i=0;
X
X    for_each_visible_window(wp)
X`09i++;
X    newsbcnt=i;
X
X    /* Remove event handlers on sashes */
X    XtVaGetValues(cur_win->pane,
X`09XmNchildren, `26\0B09
X`09XmNnumChildren, `26num_c\0F08
X`09NULL);
X    while (num_children-- > 0)
X`09if (XmIsSash(children`5Bnum_\0D08`5D))
X`09    XtRemoveEventHandler(
X`09`09children`5Bnum_\0D08`5D,
X`09`09ButtonReleaseMask,
X`09`09FALSE,
X`09`09pane_button,
X`09`09NULL);
X
X    /* Create any needed new scrollbars */
X    for (i = cur_win->nscrollbars+1; i <= newsbcnt; i++)
X`09if (cur_win->scrollbars`5Bi`5D == NULL) `7B
X`09    cur_win->scrollbars`5Bi`5D = XtVaCreateWidget(
X`09`09    "scrollbar",
X`09`09    xmScrollBarWidgetClass,
X`09`09    cur_win->pane,
X`09`09    XmNsliderSize,`091,
X`09`09    XmNvalue,&02091,
X`09`09    XmNminimum,&02091,
X`09`09    XmNmaximum,&02092,`09/* so we don't get warning */
X`09`09    XmNorientation,`09XmVERTICAL,
X`09`09    XmNtranslations,`09cur_win->my_scrollbars_trans,
X`09`09    NULL);
X`09    XtAddCallback(cur_win->scrollbars`5Bi`5D,
X`09            XmNvalueChangedCallback, JumpProc, (XtPointer) i);
X`09    XtAddCallback(cur_win->scrollbars`5Bi`5D,
X`09            XmNdragCallback, JumpProc, (XtPointer) i);
X`09    XtAddEventHandler(
X`09`09    cur_win->scrollbars`5Bi`5D,
X`09`09    StructureNotifyMask,
X`09`09    FALSE,
X`09`09    grip_moved,
X`09`09    (XtPointer) i);
X`09`7D
X
X    /* Unmanage current set of scrollbars */
X    if (cur_win->nscrollbars >= 0)
X`09XtUnmanageChildren(cur_win->scrollbars,
X`09        \0808   (Cardinal) (cur_win->nscrollbars + 1));
X
X    /* Set sizes on scrollbars */
X    cur_win->nscrollbars = newsbcnt;
X    i=0;
X    for_each_visible_window(wp) `7B
X`09new_height = wp->w_ntrows * cur_win->char_\2606;
X`09XtVaSetValues(cur_win->scrollbars`5Bi`5D,
X`09    XmNallowResize,`09`09TRUE,
X`09    XmNheight,`09`09`09new_\0E07
X`09    XmNpaneMinimum,`09`091,
X`09    XmNpaneMaximum,`09`091000,
X`09    XmNshowArrows,`09`09wp->w_ntrows > 3 ? TRUE : FALSE,
X`09    NULL);
X`09wp->w_flag `26= `7EWFSBAR;
X`09update_scrollbar(wp);
X`09i++;
X    `7D
X    XtVaSetValues(cur_win->scrollbars`5Bi`5D,
X`09    XmNheight,`09`09`09cur_win->char_\1806-1,
X`09    XmNallowResize,`09`09FALSE,
X`09    XmNpaneMinimum,`09`09cur_win->char_height-1,
X`09    XmNpaneMaximum,`09`09cur_win->char_height-1,
X`09    XmNshowArrows,`09`09FALSE,
X`09    NULL);
X
X    /* Manage the current set of scrollbars */
X    XtManageChildren(cur_win->scrollbars,
X`09        \0808   (Cardinal) (cur_win->nscrollbars + 1));
X
X    /* Add event handlers for sashes */
X    XtVaGetValues(cur_win->pane,
X`09XmNchildren, `26\0B09
X`09XmNnumChildren, `26num_c\0F08
X`09NULL);
X    while (num_children-- > 0)
X`09if (XmIsSash(children`5Bnum_\0D08`5D))
X`09    XtAddEventHandler(
X`09`09children`5Bnum_\0D08`5D,
X`09`09ButtonReleaseMask,
X`09`09FALSE,
X`09`09pane_button,
X`09`09NULL);
X`7D
X
X#else
X#if OPT_XAW_SCROLLBARS
X
X#if !OPT_KEV_DRAGGING
Xstatic void
XJumpProc(
X    Widget scrollbar GCC_UNUSED,
X    XtPointer closure,
X    XtPointer call_data)
X`7B
X    L_NUM lcur, lmax;
X    long value = (long)closure;
X    float *percent = (\1207)call_data;
X
X    if (value < cur_win->nscrollbars) `7B
X        set_scroll_window(value);
X        lcur = line_no(curwp->w_bufp, \0F09line.l);
X`09lmax = line_count(curwp->w_bufp);
X        mvupwind(TRUE, (int)(lcur - lmax * (*percent)));
X        (void)update(TRUE);
X    `7D
X`7D
X
Xstatic void
XScrollProc(
X    Widget scrollbar GCC_UNUSED,
X    XtPointer closure,
X    XtPointer call_data)
X`7B
X    long value = (long)closure;
X    long position = (long)call_data;
X
X    if (value < cur_win->nscrollbars) `7B
X        set_scroll_window(value);
X`09forwline(TRUE, (position / cur_win->char_height));
X        (void)update(TRUE);
X    `7D
X`7D
X#endif
X
Xstatic void
Xupdate_scrollbar_sizes(void)
X`7B
X    register WINDOW *wp;
X    int i, newsbcnt;
X    Dimension new_height;
X
X    i=0;
X    for_each_visible_window(wp)
X`09i++;
X    newsbcnt=i;
X
X    /* Create any needed new scrollbars and grips */
X    for (i = cur_win->nscrollbars+1; i <= newsbcnt; i++) `7B
X`09if (cur_win->scrollbars`5Bi`5D == NULL) `7B
X`09    cur_win->scrollbars`5Bi`5D = XtVaCreateWidget(
X`09`09    "scrollbar",
X`09`09    scrollbarWidgetClass,
X`09`09    cur_win->pane,
X`09`09    XtNforeground,`09cur_win->scrollbar_fg,
X`09`09    XtNbackground,`09cur_win->scrollbar_bg,
X`09`09    XtNthumb,&0209cur_win->thumb_bm,
X`09`09    XtNtranslations,`09cur_win->my_scrollbars_trans,
X`09`09    NULL);
X#if !OPT_KEV_DRAGGING
X`09    XtAddCallback(cur_win->scrollbars`5Bi`5D,
X`09`09    XtNjumpProc, J\0A09(XtPointer) i);
X`09    XtAddCallback(cur_win->scrollbars`5Bi`5D,
X`09`09    XtNscrollProc, S\0C0B(XtPointer) i);
X#endif
X`09`7D
X    `7D
X    for (i = newsbcnt-2; i >= 0 `26`26 cur_win->grips`5Bi`5D == NULL; i--) `7B
V
X`09cur_win->grips`5Bi`5D = XtVaCreateWidget(
X`09`09    "resizeGrip",
X`09`09    gripWidgetClass,
X`09`09    cur_win->pane,
X`09`09    XtNbackground,`09cur_win->modeline_bg,
X`09`09    XtNborderWidth,`090,
X`09`09    XtNheight,&02091,
X`09`09    XtNwidth,&02091,
X`09`09    XtNtranslations,`09cur_win->my_resizeGrip_trans,
X`09`09    NULL);
X    `7D
X
X    /* Unmanage current set of scrollbars */
X    if (cur_win->nscrollbars > 0)
X`09XtUnmanageChildren(cur_win->scrollbars,
X`09        \0808   (Cardinal) (cur_win->nscrollbars));
X
X    /* Set sizes and positions on scrollbar\1C06grips */
X    cur_win->nscrollbars = newsbcnt;
X    i=0;
X    for_each_visible_window(wp) `7B
X`09L_NUM total = line_count(curwp->w_bufp);
X`09L_NUM thumb = line_no(curwp->w_bufp, \0F09line.l);
X
X`09new_height = wp->w_ntrows * cur_win->char_\2606;
X`09cur_win->scrollinfo`5Bi`5D.totlen = new_height;
X`09XtVaSetValues(cur_win->scrollbars`5Bi`5D,
X`09    XtNy,`09`09wp->w_toprow * cur_win->char_height,
X`09    XtNheight,`09`09new_\0D07
X`09    XtNorientation,`09Xt\0F06Vertical,
X`09    XtNvertDistance,`09wp->w_toprow * cur_win->char_height,
X`09    XtNhorizDistance,`091,
X`09    NULL);
X`09XawScrollbarSetThumb(cur_win->s\1B08s`5Bi`5D,
X`09`09((float) (thumb - 1)) / max(total, 1),
X`09`09((float) wp->w_ntrows) / max(total,\1B0E);
X`09wp->w_flag `26= `7EWFSBAR;
X`09update_scrollbar(wp);
X`09if (wp->w_wndp) `7B
X`09    XtVaSetValues(cur_win->grips`5Bi`5D,
X`09`09XtNx,&02091,
X`09`09XtNy,&0209(wp->w_wndp->w_toprow-1) * cur_win->char_height,
X`09`09XtNheight,`09cur_win->char_\1607
X`09`09XtNwidth,`09cur_win->pane_width,
X`09`09XtNvertDistance,(wp->w_wndp->w_toprow-1) * cur_win->char_height,
X`09`09XtNhorizDistance,1,
X`09`09NULL);
X`09`7D
X`09i++;
X    `7D
X
X    /* Manage the current set of scrollbars */
X    XtManageChildren(cur_win->scrollbars,
X`09        \0808   (Cardinal) (cur_win->nscrollbars));
X
X    XtManageChildren(cur_win->grips,
X`09        \0808   (Cardinal) (cur_win->nscrollbars - 1));
X
X    for (i=0; i<cur_win->nscrollbars; i++)
X`09XRaiseWindow(dpy, Xt\0E07cur_win->scrollbars`5Bi`5D));
X
X    for (i=1; i<cur_win->nscrollbars; i++)
X`09XRaiseWindow(dpy, Xt\0E07cur_win->grips`5Bi-1`5D));
X`7D
X
X#else
X#if OPT_KEV_SCROLLBARS
Xstatic void
Xupdate_scrollbar_sizes(void)
X`7B
X    register WINDOW *wp;
X    int i, newsbcnt;
X    Dimension new_height;
X    Cardinal nchildren;
X
X    i=0;
X    for_each_visible_window(wp)
X`09i++;
X    newsbcnt=i;
X
X    /* Create any needed new scrollbars and grips */
X    for (i = newsbcnt-1; i >= 0 `26`26 cur_win->scrollbars`5Bi`5D == NULL; i--
V) `7B
X`09if (cur_win->slider_is_3D) `7B
X`09    cur_win->scrollbars`5Bi`5D = XtVaCreateWidget(
X`09`09`09"scrollbar",
X`09`09`09coreWidgetClass,
X`09`09`09cur_win->pane,
X`09`09`09XtNbackgroundPixmap,`09cur_win->trough_p\1806
X`09`09`09XtNborderWidth,&02090,
X`09`09`09XtNheight,&02091,
X`09`09`09XtNwidth,&02091,
X`09`09`09XtNtranslations,`09cur_win->my_scrollbars_trans,
X`09`09`09NULL);
X`09`7D
X`09else `7B
X`09    cur_win->scrollbars`5Bi`5D = XtVaCreateWidget(
X`09`09`09"scrollbar",
X`09`09`09coreWidgetClass,
X`09`09`09cur_win->pane,
X`09`09`09XtNbackground,&0209cur_win->scrollbar_bg,
X`09`09`09XtNborderWidth,&02090,
X`09`09`09XtNheight,&02091,
X`09`09`09XtNwidth,&02091,
X`09`09`09XtNtranslations,`09cur_win->my_scrollbars_trans,
X`09`09`09NULL);
X`09`7D
X
X`09XtAddEventHandler(
X`09`09cur_win->scrollbars`5Bi`5D,
X`09`09ExposureMask,
X`09`09FALSE,
X`09`09x_expose_scrollbar,
X`09`09(XtPointer)0);
X`09cur_win->scrollinfo`5Bi`5D.exposed = False;
X    `7D
X    for (i = newsbcnt-2; i >= 0 `26`26 cur_win->grips`5Bi`5D == NULL; i--)
X`09cur_win->grips`5Bi`5D = XtVaCreateWidget(
X`09`09    "resizeGrip",
X`09`09    coreWidgetClass,
X`09`09    cur_win->pane,
X`09`09    XtNbackground,`09cur_win->modeline_bg,
X`09`09    XtNborderWidth,`090,
X`09`09    XtNheight,&02091,
X`09`09    XtNwidth,&02091,
X`09`09    XtNtranslations,`09cur_win->my_resizeGrip_trans,
X`09`09    NULL);
X
X    /* Set sizes and positions on scrollbar\1C06grips */
X    i=0;
X    for_each_visible_window(wp) `7B
X`09new_height = wp->w_ntrows * cur_win->char_\2606;
X`09XtVaSetValues(cur_win->scrollbars`5Bi`5D,
X`09    XtNx,`09`09cur_win->slider_is_3D ? 0 : 1,
X`09    XtNy,`09`09wp->w_toprow * cur_win->char_height,
X`09    XtNheight,`09`09new_\0D07
X`09    XtNwidth,`09`09cur_win->pane_width
X`09        \0808\100B+ (cur_win->slider_is_3D ? 2 : 0),
X`09    NULL);
X`09cur_win->scrollinfo`5Bi`5D.totlen = new_height;
X`09if (wp->w_wndp) `7B
X`09    XtVaSetValues(cur_win->grips`5Bi`5D,
X`09`09XtNx,&02091,
X`09`09XtNy,&0209(wp->w_wndp->w_toprow-1) * cur_win->char_height,
X`09`09XtNheight,`09cur_win->char_\1607
X`09`09XtNwidth,`09cur_win->pane_width,
X`09`09NULL);
X`09`7D
X`09i++;
X    `7D
X
X    if (cur_win->nscrollbars > newsbcnt) `7B
X`09nchildren = cur_win->nscrollbars - newsbcnt;
X`09XtUnmanageChildren(cur_win->scrollbars+newsbcnt, nc\2807);
X`09XtUnmanageChildren(cur_win->grips+newsbcnt-1,    nc\2807);
X`09for (i = cur_win->nscrollbars; i > newsbcnt; )
X`09    cur_win->scrollinfo`5B--i`5D.exposed = False;
X    `7D
X    else if (cur_win->nscrollbars < newsbcnt) `7B
X`09nchildren = newsbcnt - cur_win->nscrollbars;
X`09XtManageChildren(cur_win->scrollbars+\1409n\150A, nc\3407);
X`09if (cur_win->nscrollbars > 0)
X`09    XtManageChildren(cur_win->grips+\0F09nscrollbars-1, nc\3107);
X`09else if (cur_win->nscrollbars == 0 `26`26 nchildren > 1)
X`09    XtManageChildren(cur_win->grips, nc\1A07-1);
X    `7D
X    cur_win->nscrollbars = newsbcnt;
X
X    i = 0;
X    for_each_visible_window(wp) `7B
X`09wp->w_flag `26= `7EWFSBAR;
X`09update_scrollbar(wp);
X`09i++;
X    `7D
X
X    /*
X     * Set the cursors... It would be nice if we could do this in the
X     * initialization above, but the widget needs to be realized for this
X     * to work
X     */
X    for (i=0; i<cur_win->nscrollbars; i++) `7B
X`09if (XtIsRealized(cur_win->scrollbars`5Bi`5D))
X`09    set_pointer(
X`09`09    XtWindow(cur_win->scrollbars`5Bi`5D),
X`09`09    curs_sb_v_double_arrow);
X`09if (i < cur_win->nscrollbars-1 `26`26 XtIsRealized(\2709grips`5Bi`5D))
X`09    set_pointer(
X`09`09    XtWindow(cur_win->grips`5Bi`5D),
X`09`09    curs_double_arrow);
X    `7D
X`7D
X
X
X/*
X * The X11R5 Athena scrollbar code was used as a reference for writing
X * draw_thumb and parts of update\1A06.
X */
X
X#define FILL_TOP 0x01
X#define FILL_BOT 0x02
X
X#define SP_HT 16`09`09&0209/* slider pixmap height */
X
Xstatic void
Xdraw_thumb(
X    Widget w,
X    int top,
X    int bot,
X    int dofill)
X`7B
X    UINT length = bot - top;
X    if (bot < 0 `7C`7C top\0B08bot <= top)
X`09return;
X
X    if (!dofill)
X`09XClearArea(XtDisplay(w), XtWindow(w), cur_win->slider_is_3D ? 2 : 1,
X`09           top, cur_win->pane_width-2, length, FALSE);
X    else if (!cur_win->slider_is_3D)
X`09XFillRectangle(XtDisplay(w), XtWindow(w), cur_win->scrollbargc,
X`09`09       1, top, cur_win->pane_width-2, length);
X    else `7B
X`09if (dofill `26 FILL_TOP) `7B
X`09    int tbot;
X`09    tbot = bot - ((dofill `26 FILL_BOT) ? 2 : 0);
X`09    if (tbot <= top)
X`09`09tbot = top + 1;
X`09    if (top + (SP_HT-2) < tbot)
X`09`09tbot = top + (SP_HT-2);
X`09    XCopyArea(dpy, cur_win->slider_pixmap, XtWindow(w),
X`09`09      cur_win->scrollbargc,
X`09`09      0, 0, cur_win->pane_width-2, (unsigned int) (tbot - top),
X`09`09      2, top);
X
X`09    top = tbot;
X`09`7D
X`09if (dofill `26 FILL_BOT) `7B
X`09    int btop = max(top, bot-(SP_HT-2));
X`09    XCopyArea(dpy, cur_win->slider_pixmap, XtWindow(w),
X`09        \0806cur_win->scrollbargc,
X`09`09      0, SP_HT - (bot-btop),
X`09`09      cur_win->pane_width-2, (unsigned int) (bot - btop),
X`09`09      2, btop);
X`09    bot = btop;
X
X`09`7D
X`09if (top < bot) `7B
X`09    XFillRectangle(XtDisplay(w), XtWindow(w), cur_win->scrollbargc,
X`09`09           2, top,
X`09`09`09   cur_win->pane_width-2, (unsigned int) (bot-top));
X`09`7D
X    `7D
X`7D
X
X
X#define MIN_THUMB_SIZE 8
X
Xstatic void
Xupdate_thumb(
X    int barnum,
X    int newtop,
X    int newlen)
X`7B
X    int oldtop, oldbot, newbot, totlen;
X    int f = cur_win->slider_is_3D ? 2 : 0;
X    Widget w = cur_win->scrollbars`5Bbarnum`5D;
X
X    oldtop = cur_win->scrollinfo`5Bbarnum`5D.top;
X    oldbot = cur_win->scrollinfo`5Bbarnum`5D.bot;
X    totlen = cur_win->scrollinfo`5Bbarnum`5D.\2506;
X    newtop = min(\0D06, totlen-3);
X    newbot = newtop + max(newlen, MIN_THUMB_SIZE);
X    newbot = min(\0D06, totlen);
X    cur_win->scrollinfo`5Bbarnum`5D.top = newtop;
X    cur_win->scrollinfo`5Bbarnum`5D.bot = newbot;
X
X    if (!cur_win->scrollinfo`5Bbarnum`5D.exposed)
X`09return;
X
X    if (XtIsRealized(w)) `7B
X`09if (newtop < oldtop) `7B
X`09    int tbot = min(newbot, oldtop+f);
X`09    draw_thumb(w, newtop, tbot,
X`09        \0807FILL_TOP `7C ((tbot == newbot) ?\1F06BOT : 0));
X`09`7D
X`09if (newtop > oldtop) `7B
X`09    draw_thumb(w, oldtop, min(newtop, oldbot), 0);
X`09    if (cur_win->slider_is_3D `26`26 newtop < oldbot)
X`09`09draw_thumb(w, newtop, min(\0C06+f, oldbot), FILL_TOP);
X`09`7D
X`09if (newbot < oldbot) `7B
X`09    draw_thumb(w, max(newbot, oldtop), oldbot, 0);
X`09    if (cur_win->slider_is_3D `26`26 oldtop < newbot)
X`09`09draw_thumb(w, max(newbot-f, oldtop), \1306, FILL_BOT);
X`09`7D
X`09if (newbot > oldbot) `7B
X`09    int btop = max(newtop, oldbot-f);
X`09    draw_thumb(w, btop, newbot,
X`09        \0807FILL_BOT `7C ((btop == newtop) ?\1F06TOP : 0));
X`09`7D
X    `7D
X`7D
X
X/*ARGSUSED*/
Xstatic void
Xx_expose_scrollbar(
X    Widget`09w,
X    XtPointer`09unused GCC_UNUSED,
X    XEvent     *ev,
X    Boolean    *continue_to_dispatch GCC_UNUSED)
X`7B
X    int i;
X
X    if (ev->type != Expose)
X`09return;
X
X    for (i=0; i < cur_win->nscrollbars; i++) `7B
X`09if (cur_win->scrollbars`5Bi`5D == w) `7B
X`09    int top, bot;
X`09    top = cur_win->scrollinfo`5Bi`5D.top;
X`09    bot = cur_win->scrollinfo`5Bi`5D.bot;
X`09    cur_win->scrollinfo`5Bi`5D.top = -1;
X`09    cur_win->scrollinfo`5Bi`5D.bot = -1;
X`09    cur_win->scrollinfo`5Bi`5D.exposed = True;
X`09    update_thumb(i, top, bot-top);
X`09`7D
X    `7D
X`7D
X#endif /* OPT_KEV_SCROLLBARS  */
X#endif /* OPT_XAW_SCROLLBARS  */
X#endif /* MOTIF_WIDGETS */
X#endif /* OL_WIDGETS */
X
X#if OPT_KEV_DRAGGING
Xstatic void
Xdo_scroll(
X    Widget w,
X    XEvent *event,
X    String *params,
X    Cardinal *num_params)
X`7B
X    static enum `7B none, forward, back\0A06drag `7D scrollmode = none;
X    int pos;
X    register WINDOW *wp;
X    register int i;
X    XEvent nev;
X    int count;
X
X    /*
X     * Return immediately if behind in processing motion events.  Note:
X     * If this is taken out, scrolling is actually smoother, but sometimes
X     * takes a while to catch up.  I should think that performance would
X     * be horrible on a slow server.
X     */
X
X    if (scrollmode == drag
X     `26`26 event->type == MotionNotify
X     `26`26 x_has_events()
X     `26`26 XtAppPeekEvent(cur_win->app_context, `26nev)
X     `26`26 (nev.type == MotionNotify `7C`7C \1C0CButtonRelease))
X`09return;
X
X    if (*num_params != 1)
X`09return;
X
X    /* Determine vertical position */
X    switch (event->type) `7B
X`09case MotionNotify :
X`09    pos = event->xmotion.y;
X`09    break;
X`09case ButtonPress :
X`09case ButtonRelease :
X`09    pos = event->xbutton.y;
X`09    break;
X`09default :
X`09    return;
X    `7D
X
X    /* Determine scrollbar number and corresponding vile window */
X    i = 0;
X    for_each_visible_window (wp) `7B
X`09if (cur_win->scrollbars`5Bi`5D == w)
X`09    break;
X`09i++;
X    `7D
X
X    if (!wp)
X`09return;
X
X    if (pos < 0)
X`09pos = 0;
X    if (pos > cur_win->scrollinfo`5Bi`5D.totlen)
X`09pos = cur_win->scrollinfo`5Bi`5D.totlen;
X
X    switch (**params) `7B
X`09case 'E' :`09/* End */
X`09    if (cur_win->scroll_repeat_id != (XtIntervalId) 0) `7B
X`09`09XtRemoveTimeOut(cur_win->scroll_repeat_id);
X`09`09cur_win->scroll_repeat_id = (XtIntervalId) 0;
X`09    `7D
X`09    set_pointer(XtWindow(w), curs_sb_v_double_arrow);
X`09    scrollmode = none;
X`09    break;
X`09case 'F' :`09/* Forward */
X`09    if (scrollmode != none)
X`09`09break;
X`09    count = (pos / cur_win->char_height) + 1;
X`09    scrollmode = forward;
X`09    set_pointer(XtWindow(w), curs_sb_up_arrow);
X`09    goto do_scroll_common;
X`09case 'B' :`09/* Backward */
X`09    if (scrollmode != none)
X`09`09break;
X`09    count = -((pos / cur_win->char_height) + 1);
X`09    scrollmode = backward;
X`09    set_pointer(XtWindow(w), curs_sb_down_arrow);
Xdo_scroll_common:
X`09    set_curwp(wp);
X`09    mvdnwind(TRUE, count);
X`09    cur_win->scroll_repeat_id = XtAppAddTimeOut(
X`09`09    cur_win->app_context,
X`09`09    cur_win->scroll_repeat_timeout,
X`09`09    repeat_scroll,
X`09`09    (XtPointer) count);
X`09    (void)update(TRUE);
X`09    break;
X`09case 'S' :`09/* StartDrag */
X`09    if (scrollmode == none) `7B
X`09`09set_curwp(wp);
X`09`09scrollmode = drag;
X`09`09set_pointer(XtWindow(w), curs_sb_right_arrow);
X`09    `7D
X`09    /* FALLTHRU */
X`09case 'D' :`09/* Drag */
X`09    if (scrollmode == drag) `7B
X`09`09int lcur = line_no(curwp->w_bufp, \0F09line.l);
X`09`09int ltarg = (line_count(curwp->w_bufp) * pos
X`09`09`09    `09/ cur_win->scrollinfo`5Bi`5D.totlen) + 1;
X`09`09mvupwind(TRUE, lcur-ltarg);
X`09`09(void)update(TRUE);
X`09    `7D
X`09    break;
X    `7D
X`7D
X
X/*ARGSUSED*/
Xstatic void
Xrepeat_scroll(
X    XtPointer count,
X    XtIntervalId  *id GCC_UNUSED)
X`7B
X    cur_win->scroll_repeat_id = XtAppAddTimeOut(
X`09    cur_win->app_context,
X`09    cur_win->scroll_repeat_interval,
X`09    repeat_scroll,
X`09    (XtPointer) count);
X    mvdnwind(TRUE, (int)count);
X    (void)update(TRUE);
X    XSync(dpy, False);
X`7D
X#endif /* OPT_KEV_DRAGGING */
X
X#if OPT_KEV_SCROLLBARS `7C`7C OPT_XAW\160B
Xstatic void
Xresize_bar(
X    Widget w,
X    XEvent *event,
X    String *params,
X    Cardinal *num_params)
X`7B
X    static int motion_permitted = False;
X    static int root_y;
X    int pos = 0;`09`09`09/* stifle -Wall */
X    register WINDOW *wp;
X    register int i;
X    XEvent nev;
X
X    /* Return immediately if behind in processing motion events */
X    if (motion_permitted
X     `26`26 event->type == MotionNotify
X     `26`26 x_has_events()
X     `26`26 XtAppPeekEvent(cur_win->app_context, `26nev)
X     `26`26 (nev.type == MotionNotify `7C`7C \1C0CButtonRelease))
X`09return;
X
X    if (*num_params != 1)
X`09return;
X
X    switch (**params) `7B
X`09case 'S' :`09/* Start */
X`09    motion_permitted = True;
X`09    root_y = event->xbutton.y_root -\1811;
X`09    return;
X`09case 'D' :`09/* Drag */
X`09    if (!motion_permitted)
X`09`09return;
X`09    /*
X`09     * We use kind of convoluted mechanism to determine the vertical
X`09     * position with respect to the widget which we are moving. The
X`09     * reason is that the x,y position from the event structure is
X`09     * unreliable since the widget may have moved in between the
X`09     * time when the event was first generated (at the display
X`09     * server) and the time at which the event is received (in
X`09     * this code here).  So we keep track of the vertical position
X`09     * of the widget with respect to the root window and use the
X`09     * corresponding field in the event structure to determine
X`09     * the vertical position of the pointer with respect to the
X`09     * widget of interest.  In the past, XQueryPointer() was
X`09     * used to determine the position of\1007inter, but this is
X`09     * not really what we want since the position returned by
X`09     * XQueryPointer is the position of\1007\1F06at a time
X`09     * after the event was both generated and received (and thus
X`09     * inaccurate).  This is why the resize grip would sometimes
X`09     * "follow" the mouse pointer after the button was released.
X`09     */
X`09    pos = event->xmotion.y_root - root_y;
X`09    break;
X`09case 'E' :`09/* End */
X`09    if (!motion_permitted)
X`09`09return;
X`09    pos = event->xbutton.y_root - root_y;
X`09    motion_permitted = False;
X`09    break;
X    `7D
X
X    /* Determine grip number and corresponding vile window (abov\3106) */
X    i = 0;
X    for_each_visible_window (wp) `7B
X`09if (cur_win->grips`5Bi`5D == w)
X`09    break;
X`09i++;
X    `7D
X
X    if (!wp)
X`09return;
X
X    if (pos < 0)
X`09pos -= cur_win->char_height;
X    pos = pos / cur_win->char_height;
X
X    if (pos) `7B
X`09int nlines;
X`09if (pos >= wp->w_wndp->w_ntrows)
X`09    pos = wp->w_wndp->w_ntrows - 1;
X
X`09nlines = wp->w_ntrows + pos;
X`09if (nlines < 1)
X`09    nlines = 1;
X`09root_y += (nlines - wp->w_ntrows) * cur_win->char_height;
X`09set_curwp(wp);
X`09resize(TRUE, nlines);
X`09(void)update(TRUE);
X    `7D
X`7D
X#endif /* OPT_KEV_SCROLLBARS `7C`7C OPT_XAW\160C*/
X
Xvoid
Xupdate_scrollbar(
X    WINDOW *uwp)
X`7B
X    WINDOW *wp;
X    int i;
X    int lnum, lcnt;
X
X#if !OPT_KEV_SCROLLBARS `26`26\1706XAW\170B
X    if (dont_update_sb)
X`09return;
X#endif /* !OPT_KEV_SCROLLBARS */
X
X    i = 0;
X    for_each_visible_window(wp) `7B
X`09if (wp == uwp)
X`09    break;
X`09i++;
X    `7D
X    if (i >= cur_win->nscrollbars `7C`7C (wp->w_flag `26 WFSBAR)) `7B
X`09/*
X`09 * update_scrollbar_sizes will recursively invoke\2F11,
X`09 * but with WFSBAR disabled.
X`09 */
X`09update_scrollbar_sizes();
X`09return;
X    `7D
X
X    lnum = line_no(wp->w_bufp, \0C06line.l);
X    lnum = (lnum > 0) ?\1406: 1;
X    lcnt = line_count(wp->w_bufp);
X#if MOTIF_WIDGETS
X    lcnt += 1;
X    XtVaSetValues(cur_win->scrollbars`5Bi`5D,
X`09    XmNmaximum,`09`09lcnt + wp->w_ntrows,
X`09    XmNsliderSize,`09wp->w_ntrows,
X`09    XmNvalue,`09`09lnum,
X`09    XmNpageIncrement,`09wp->w_ntrows > 1 ? \130C-1 : 1,
X`09    NULL);
X#else
X#if OL_WIDGETS
X    lcnt += 1;
X    XtVaSetValues(cur_win->scrollbars`5Bi`5D,
X`09    XtNsliderMin,`091,
X`09    XtNsliderMax,`09lcnt + wp->w_ntrows,
X`09    XtNproportionLength, wp->w_ntrows,
X`09    XtNsliderValue,`09lnum,
X`09    NULL);
X#else
X#if OPT_XAW_SCROLLBARS
X    XawScrollbarSetThumb(cur_win->s\1B08s`5Bi`5D,
X`09    ((float) (lnum - 1)) / max(lcnt, wp->w_ntrows),
X`09    ((float) wp->w_ntrows) / max(lcnt,\1A0E);
X#else
X#if OPT_KEV_SCROLLBARS
X    `7B
X`09int top, len;
X`09lcnt  = max(lcnt, 1);
X`09len   = (min(lcnt, wp->w_ntrows) * cur_win->scrollinfo`5Bi`5D.totlen
X`09`09&0209/ lcnt) + 1;
X`09top   = ((lnum-1) * cur_win->scrollinfo`5Bi`5D.totlen)
X`09`09    / lcnt;
X`09update_thumb(i, top, len);
X    `7D
X#endif /* OPT_KEV_SCROLLBARS */
X#endif /* OPT_XAW_SCROLLBARS */
X#endif /* OL_WIDGETS */
X#endif /* MOTIF_WIDGETS */
X`7D
X
X#define OLD_RESOURCES 1`09`09/* New stuff not ready for prime time */
X
X#define XtNnormalShape`09`09"\0E0B"
X#define XtCNormalShape`09`09"\0E0B"
X#define XtNwatchShape`09`09"\0D0A"
X#define XtCWatchShape`09`09"\0D0A"
X
X#define XtNforkOnStartup`09"\0F0D"
X#define XtCForkOnStartup`09"\0F0D"
X
X#define XtNscrollbarWidth`09"\100E"
X#define XtCScrollbarWidth`09"\100E"
X#define XtNfocusFollowsMouse`09"\1311"
X#define XtCFocusFollowsMouse`09"\1311"
X#define XtNscrollbarOnLeft`09"\110F"
X#define XtCScrollbarOnLeft`09"\110F"
X#define XtNmultiClickTime`09"\100E"
X#define XtCMultiClickTime`09"\100E"
X#define XtNcharClass`09`09"\0C09"
X#define XtCCharClass`09`09"\0C09"
X#if OPT_KEV_DRAGGING
X#define`09XtNscrollRepeatTimeout`09"\1513"
X#define`09XtCScrollRepeatTimeout`09"\1513"
X#endif
X#define`09XtNscrollRepeatInterval`09"\1614"
X#define`09XtCScrollRepeatInterval`09"\1614"
X#define XtNpersistentSelections`09"\1614"
X#define XtCPersistentSelections`09"\1614"
X#define XtNselectionSetsDOT`09"\1210"
X#define XtCSelectionSetsDOT`09"\1210"
X#define XtNblinkInterval`09"\0F0D"
X#define XtCBlinkInterval`09"\0F0D"
X#define XtNsliderIsSolid`09"\0F0D"
X#define XtCSliderIsSolid`09"\0F0D"
X#define`09XtNfocusForeground`09"\110F"
X#define`09XtNfocusBackground`09"\110F"
X
X#define XtNfcolor0`09`09XtNforeground
X#define XtCFcolor0`09`09XtCForeground
X#define XtNbcolor0`09`09XtNbackground
X#define XtCBcolor0`09`09XtCBackground
X
X#define XtNfcolor1`09`09"\0A07"
X#define XtCFcolor1`09`09"\0A07"
X#define XtNbcolor1`09`09"\0A07"
X#define XtCBcolor1`09`09"\0A07"
X
X#define XtNfcolor2`09`09"\0A07"
X#define XtCFcolor2`09`09"\0A07"
+-+-+-+-+-+-+-+-  END  OF PART 128 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 129 -+-+-+-+-+-+-+-+
X#define XtNbcolor2`09`09"\0A07"
X#define XtCBcolor2`09`09"\0A07"
X
X#define XtNfcolor3`09`09"\0A07"
X#define XtCFcolor3`09`09"\0A07"
X#define XtNbcolor3`09`09"\0A07"
X#define XtCBcolor3`09`09"\0A07"
X
X#define XtNfcolor4`09`09"\0A07"
X#define XtCFcolor4`09`09"\0A07"
X#define XtNbcolor4`09`09"\0A07"
X#define XtCBcolor4`09`09"\0A07"
X
X#define XtNfcolor5`09`09"\0A07"
X#define XtCFcolor5`09`09"\0A07"
X#define XtNbcolor5`09`09"\0A07"
X#define XtCBcolor5`09`09"\0A07"
X
X#define XtNfcolor6`09`09"\0A07"
X#define XtCFcolor6`09`09"\0A07"
X#define XtNbcolor6`09`09"\0A07"
X#define XtCBcolor6`09`09"\0A07"
X
X#define XtNfcolor7`09`09"\0A07"
X#define XtCFcolor7`09`09"\0A07"
X#define XtNbcolor7`09`09"\0A07"
X#define XtCBcolor7`09`09"\0A07"
X
X#define XtNfcolor8`09`09"\0A07"
X#define XtCFcolor8`09`09"\0A07"
X#define XtNbcolor8`09`09"\0A07"
X#define XtCBcolor8`09`09"\0A07"
X
X#define XtNfcolor9`09`09"\0A07"
X#define XtCFcolor9`09`09"\0A07"
X#define XtNbcolor9`09`09"\0A07"
X#define XtCBcolor9`09`09"\0A07"
X
X#define XtNfcolorA`09`09"\0A0610"
X#define XtCFcolorA`09`09"\0A0610"
X#define XtNbcolorA`09`09"\0A0610"
X#define XtCBcolorA`09`09"\0A0610"
X
X#define XtNfcolorB`09`09"\0A0611"
X#define XtCFcolorB`09`09"\0A0611"
X#define XtNbcolorB`09`09"\0A0611"
X#define XtCBcolorB`09`09"\0A0611"
X
X#define XtNfcolorC`09`09"\0A0612"
X#define XtCFcolorC`09`09"\0A0612"
X#define XtNbcolorC`09`09"\0A0612"
X#define XtCBcolorC`09`09"\0A0612"
X
X#define XtNfcolorD`09`09"\0A0613"
X#define XtCFcolorD`09`09"\0A0613"
X#define XtNbcolorD`09`09"\0A0613"
X#define XtCBcolorD`09`09"\0A0613"
X
X#define XtNfcolorE`09`09"\0A0614"
X#define XtCFcolorE`09`09"\0A0614"
X#define XtNbcolorE`09`09"\0A0614"
X#define XtCBcolorE`09`09"\0A0614"
X
X#define XtNfcolorF`09`09"\0A0615"
X#define XtCFcolorF`09`09"\0A0615"
X#define XtNbcolorF`09`09"\0A0615"
X#define XtCBcolorF`09`09"\0A0615"
X
Xstatic XtResource r\0907s`5B`5D = `7B
X#if OPT_KEV_DRAGGING
X    `7B
X`09XtNscrollRepeatTimeout,
X`09XtCScrollRepeatTimeout,
X`09XtRInt,
X`09sizeof(int),
X`09XtOffset(TextWindow, scroll_repeat_timeout),
X`09XtRImmediate,
X`09(XtPointer) 500`09`09`09/* 1/2 second */
X    `7D,
X#endif`09/* OPT_KEV_DRAGGING */
X    `7B
X`09XtNscrollRepeatInterval,
X`09XtCScrollRepeatInterval,
X`09XtRInt,
X`09sizeof(int),
X`09XtOffset(TextWindow, scroll_repeat_interval),
X`09XtRImmediate,
X`09(XtPointer) 60`09`09`09/* 60 milliseconds */
X    `7D,
X    `7B
X`09XtNgeometry,
X`09XtCGeometry,
X`09XtRString,
X`09sizeof(String *),
X`09XtOffset(TextWindow, geometry),
X`09XtRImmediate,
X`09"80x36"
X    `7D,
X    `7B
X`09XtNfont,
X`09XtCFont,
X`09XtRString,
X`09sizeof(String *),
X`09XtOffset(TextWindow, starting_fontname),
X`09XtRImmediate,
X`09XtDefaultFont `09/* used to be FONTNAME */
X    `7D,
X    `7B
X`09XtNforeground,
X`09XtCForeground,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, fg),
X`09XtRString,
X#if OLD_RESOURCES
X        XtDefaultForeground
X#else
X`09"#c71bc30bc71b"
X#endif /* OLD_RESOURCES */
X    `7D,
X    `7B
X`09XtNbackground,
X`09XtCBackground,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, bg),
X`09XtRString,
X#if OLD_RESOURCES
X`09XtDefaultBackground
X#else
X`09"#c71bc30bc71b"
X#endif
X    `7D,
X    `7B
X`09XtNforkOnStartup,
X`09XtCForkOnStartup,
X`09XtRBool,
X`09sizeof(Bool),
X`09XtOffset(TextWindow, fork_on_startup),
X`09XtRImmediate,
X`09(XtPointer) False
X    `7D,
X    `7B
X`09XtNfocusFollowsMouse,
X`09XtCFocusFollowsMouse,
X`09XtRBool,
X`09sizeof(Bool),
X`09XtOffset(TextWindow, focus_follows_mouse),
X`09XtRImmediate,
X`09(XtPointer) False
X    `7D,
X    `7B
X`09XtNmultiClickTime,
X`09XtCMultiClickTime,
X`09XtRInt,
X`09sizeof(Time),
X`09XtOffset(TextWindow, click_timeout),
X`09XtRImmediate,
X`09(XtPointer) 500
X    `7D,
X    `7B
X`09XtNcharClass,
X`09XtCCharClass,
X`09XtRString,
X`09sizeof(String *),
X`09XtOffset(TextWindow, multi_click_char_class),
X`09XtRImmediate,
X`09NULL
X    `7D,
X    `7B
X`09XtNscrollbarOnLeft,
X`09XtCScrollbarOnLeft,
X`09XtRBool,
X`09sizeof(Bool),
X`09XtOffset(TextWindow, scrollbar_on_left),
X`09XtRImmediate,
X`09(XtPointer) False
X    `7D,
X    `7B
X`09XtNscrollbarWidth,
X`09XtCScrollbarWidth,
X`09XtRInt,
X`09sizeof(int),
X`09XtOffset(TextWindow, pane_width),
X`09XtRImmediate,
X`09(XtPointer) PANE_WIDTH_DEFAULT
X    `7D,
X#if OPT_MENUS
X    `7B
X`09XtNmenuHeight,
X`09XtCMenuHeight,
X`09XtRInt,
X`09sizeof(int),
X`09XtOffset(TextWindow, menu_height),
X`09XtRImmediate,
X`09(XtPointer) MENU_HEIGHT_DEFAULT
X    `7D,
X#endif
X    `7B
X`09XtNpersistentSelections,
X`09XtCPersistentSelections,
X`09XtRBool,
X`09sizeof(Bool),
X`09XtOffset(TextWindow, persistent_selections),
X`09XtRImmediate,
X`09(XtPointer) True
X    `7D,
X    `7B
X`09XtNselectionSetsDOT,
X`09XtCSelectionSetsDOT,
X`09XtRBool,
X`09sizeof(Bool),
X`09XtOffset(TextWindow, selection_sets_DOT),
X`09XtRImmediate,
X`09(XtPointer) False
X    `7D,
X    `7B
X`09XtNblinkInterval,
X`09XtCBlinkInterval,
X`09XtRInt,
X`09sizeof(int),
X`09XtOffset(TextWindow, blink_interval),
X`09XtRImmediate,
X`09(XtPointer) -666`09`09/* 2/3 second; only when highlighted */
X    `7D,
X`7D;
X
Xstatic XtResource color_r\0F07s`5B`5D = `7B
X    `7B
X`09XtNfcolor0,
X`09XtCFcolor0,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_fg`5B0`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X    `7D,
X    `7B
X`09XtNbcolor0,
X`09XtCBcolor0,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_bg`5B0`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X    `7D,
X    `7B
X`09XtNfcolor1,
X`09XtCFcolor1,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_fg`5B1`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X    `7D,
X    `7B
X`09XtNbcolor1,
X`09XtCBcolor1,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_bg`5B1`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X    `7D,
X    `7B
X`09XtNfcolor2,
X`09XtCFcolor2,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_fg`5B2`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X    `7D,
X    `7B
X`09XtNbcolor2,
X`09XtCBcolor2,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_bg`5B2`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X    `7D,
X    `7B
X`09XtNfcolor3,
X`09XtCFcolor3,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_fg`5B3`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X    `7D,
X    `7B
X`09XtNbcolor3,
X`09XtCBcolor3,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_bg`5B3`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X    `7D,
X    `7B
X`09XtNfcolor4,
X`09XtCFcolor4,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_fg`5B4`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X    `7D,
X    `7B
X`09XtNbcolor4,
X`09XtCBcolor4,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_bg`5B4`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X    `7D,
X    `7B
X`09XtNfcolor5,
X`09XtCFcolor5,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_fg`5B5`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X    `7D,
X    `7B
X`09XtNbcolor5,
X`09XtCBcolor5,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_bg`5B5`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X    `7D,
X    `7B
X`09XtNfcolor6,
X`09XtCFcolor6,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_fg`5B6`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X    `7D,
X    `7B
X`09XtNbcolor6,
X`09XtCBcolor6,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_bg`5B6`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X    `7D,
X    `7B
X`09XtNfcolor7,
X`09XtCFcolor7,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_fg`5B7`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X    `7D,
X    `7B
X`09XtNbcolor7,
X`09XtCBcolor7,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_bg`5B7`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X    `7D,
X    `7B
X`09XtNfcolor8,
X`09XtCFcolor8,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_fg`5B8`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X    `7D,
X    `7B
X`09XtNbcolor8,
X`09XtCBcolor8,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_bg`5B8`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X    `7D,
X    `7B
X`09XtNfcolor9,
X`09XtCFcolor9,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_fg`5B9`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X    `7D,
X    `7B
X`09XtNbcolor9,
X`09XtCBcolor9,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_bg`5B9`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X    `7D,
X    `7B
X`09XtNfcolorA,
X`09XtCFcolorA,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_fg`5B10`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X    `7D,
X    `7B
X`09XtNbcolorA,
X`09XtCBcolorA,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_bg`5B10`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X    `7D,
X    `7B
X`09XtNfcolorB,
X`09XtCFcolorB,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_fg`5B11`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X    `7D,
X    `7B
X`09XtNbcolorB,
X`09XtCBcolorB,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_bg`5B11`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X    `7D,
X    `7B
X`09XtNfcolorC,
X`09XtCFcolorC,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_fg`5B12`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X    `7D,
X    `7B
X`09XtNbcolorC,
X`09XtCBcolorC,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_bg`5B12`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X    `7D,
X    `7B
X`09XtNfcolorD,
X`09XtCFcolorD,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_fg`5B13`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X    `7D,
X    `7B
X`09XtNbcolorD,
X`09XtCBcolorD,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_bg`5B13`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X    `7D,
X    `7B
X`09XtNfcolorE,
X`09XtCFcolorE,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_fg`5B14`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X    `7D,
X    `7B
X`09XtNbcolorE,
X`09XtCBcolorE,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_bg`5B14`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X    `7D,
X    `7B
X`09XtNfcolorF,
X`09XtCFcolorF,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_fg`5B15`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X    `7D,
X    `7B
X`09XtNbcolorF,
X`09XtCBcolorF,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, colors_bg`5B15`5D),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X    `7D,
X`7D;
X
X#if OPT_KEV_SCROLLBARS `7C`7C OPT_XAW\160B
Xstatic XtResource scrollbar_r\1307s`5B`5D = `7B
X    `7B
X`09XtNforeground,
X`09XtCForeground,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, scrollbar_fg),
X#if OLD_RESOURCES
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X#else
X`09XtRString,
X`09"#b6dab2cab6da"
X#endif
X    `7D,
X    `7B
X`09XtNbackground,
X`09XtCBackground,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, scrollbar_bg),
X#if OLD_RESOURCES
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X#else
X`09XtRString,
X`09"#9e7996589e79"
X#endif /* OLD_RESOURCES */
X    `7D,
X    `7B
X`09XtNsliderIsSolid,
X`09XtCSliderIsSolid,
X`09XtRBool,
X`09sizeof(Bool),
X`09XtOffset(TextWindow, slider_is_solid),
X#if OLD_RESOURCES
X`09XtRImmediate,
X`09(XtPointer) False
X#else
X`09XtRBool,
X`09(XtPointer) `26cur_win_rec.slider_is_solid
X#endif /* OLD_RESOURCES */
X    `7D,
X`7D;
X#endif
X
Xstatic XtResource modeline_r\1207s`5B`5D = `7B
X    `7B
X`09XtNforeground,
X`09XtCForeground,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, modeline_fg),
X#if OLD_RESOURCES
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X#else
X`09XtRString,
X`09"#ffffffffffff"
X#endif /* OLD_RESOURCES */
X    `7D,
X    `7B
X`09XtNbackground,
X`09XtCBackground,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, modeline_bg),
X#if OLD_RESOURCES
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X#else
X`09XtRString,
X`09"#70006ca37000"
X#endif /* OLD_RESOURCES */
X    `7D,
X    `7B
X`09XtNfocusForeground,
X`09XtCForeground,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, modeline_focus_fg),
X#if OLD_RESOURCES
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X#else
X`09XtRString,
X`09"#ffffffffffff"
X#endif /* OLD_RESOURCES */
X    `7D,
X    `7B
X`09XtNfocusBackground,
X`09XtCBackground,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, modeline_focus_bg),
X#if OLD_RESOURCES
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X#else
X`09XtRString,
X`09"#70006ca37000"
X#endif /* OLD_RESOURCES */
X    `7D,
X`7D;
X
Xstatic XtResource selection_r\1307s`5B`5D = `7B
X    `7B
X`09XtNforeground,
X`09XtCBackground,`09`09&0209/* weird, huh? */
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, selection_fg),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X    `7D,
X    `7B
X`09XtNbackground,
X`09XtCForeground,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, selection_bg),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X    `7D,
X`7D;
X
X/*
X * We resort to a bit of trickery for the cursor resources.  Note that the
X * default foreground and back\0F07for the cursor is the same as that for
X * the rest of the window.  This would render the cursor invisible!\2906
X * condition actually indicates that usual technique of inverting the
X * foreground and back\0F07colors should be used, the rationale being
X * that no (sane) user would want to set the cursor foreground and
X * background to be the same as the rest of the window.
X */
X
Xstatic XtResource cursor_r\1007s`5B`5D = `7B
X    `7B
X`09XtNforeground,
X`09XtCForeground,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, cursor_fg),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X    `7D,
X    `7B
X`09XtNbackground,
X`09XtCBackground,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, cursor_bg),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X    `7D,
X`7D;
X
Xstatic XtResource pointer_r\1107s`5B`5D = `7B
X    `7B
X`09XtNforeground,
X`09XtCForeground,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, pointer_fg),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.fg
X    `7D,
X    `7B
X`09XtNbackground,
X`09XtCBackground,
X`09XtRPixel,
X`09sizeof(Pixel),
X`09XtOffset(TextWindow, pointer_bg),
X`09XtRPixel,
X`09(XtPointer) `26cur_win_rec.bg
X    `7D,
X    `7B
X`09XtNnormalShape,
X`09XtCNormalShape,
X`09XtRCursor,
X`09sizeof(Cursor),
X`09XtOffset(TextWindow, normal_pointer),
X`09XtRString,
X`09(XtPointer) "xterm"
X    `7D,
X#if OPT_WORKING
X    `7B
X`09XtNwatchShape,
X`09XtCWatchShape,
X`09XtRCursor,
X`09sizeof(Cursor),
X`09XtOffset(TextWindow, watch_pointer),
X`09XtRString,
X`09(XtPointer) "watch"
X    `7D,
X#endif
X`7D;
X
X#define CHECK_MIN_MAX(v,min,max)`09`5C
X`09do `7B`09`09&0209`5C
X`09    if ((v) > (max))`09`09`5C
X`09`09(v)=(max);&0209`5C
X`09    else if ((v) < (min))`09`5C
X`09`09(v) = (min);&0209`5C
X`09`7D one_time
X
Xstatic void my_error_handler(String message)
X`7B
X    fprintf(stderr, "%s: %s`5Cn", prog_arg, message);
X    print_usage();
X`7D
X
X/* ARGSUSED */
Xvoid
Xx_preparse_args(
X    int        *pargc,
X    char     ***pargv)
X`7B
X    XFontStruct *pfont;
X    XGCValues   gcvals;
X    ULONG`09gcmask;
X    int`09`09geo_mask, startx\0807y, screen_depth;
X    int`09`09i;
X    Cardinal`09start_cols, \0C06rows;
X    static XrmOptionDescRec options`5B`5D = `7B
X`09`7B"-t",   `09(char *)0,          XrmoptionSkipArg,`09(caddr_t)0 `7D,
X`09`7B"-fork",   `09"*forkOnStartup",   XrmoptionNoArg,`09"true" `7D,
X`09`7B"+fork",   `09"*forkOnStartup",   XrmoptionNoArg,`09"false" `7D,
X`09`7B"-leftbar",`09"*scrollbarOnLeft", XrmoptionNoArg,`09"true" `7D,
X`09`7B"-rightbar",`09"*scrollbarOnLeft", XrmoptionNoArg,`09"false" `7D,
X    `7D;
X#if MOTIF_WIDGETS `7C`7C OL\0E08
X    static XtActionsRec new_a\0F06`5B`5D = `7B
X`09`7B "ConfigureBar", c\0F08_bar `7D
X    `7D;
X    static String scrollbars_translations =
X`09"#override `5Cn`5C
X`09`09Ctrl<Btn1Down>:ConfigureBar(Split) `5Cn`5C
X`09`09Ctrl<Btn2Down>:ConfigureBar(Kill) `5Cn`5C
X`09`09Ctrl<Btn3Down>:ConfigureBar(Only)";
X    static String fallback_resources`5B`5D= `7B
X`09"*scrollPane.background:grey80",
X`09"*scrollbar.background:grey60",
X`09NULL
X    `7D;
X#else
X#if OPT_KEV_DRAGGING
X    static XtActionsRec new_a\0F06`5B`5D = `7B
X`09`7B "ConfigureBar", c\0F08_bar `7D,
X`09`7B "DoScroll", do_scroll `7D,
X`09`7B "ResizeBar", resize_bar `7D
X    `7D;
X    static String scrollbars_translations =
X`09"#override `5Cn`5C
X`09`09Ctrl<Btn1Down>:ConfigureBar(Split) `5Cn`5C
X`09`09Ctrl<Btn2Down>:ConfigureBar(Kill) `5Cn`5C
X`09`09Ctrl<Btn3Down>:ConfigureBar(Only) `5Cn`5C
X`09`09<Btn1Down>:DoScroll(Forward) `5Cn`5C
X`09`09<Btn2Down>:DoScroll(StartDrag) `5Cn`5C
X`09`09<Btn3Down>:DoScroll(Backward) `5Cn`5C
X`09`09<Btn2Motion>:DoScroll(Drag) `5Cn`5C
X`09`09<BtnUp>:DoScroll(End)";
X    static String resizeGrip_translations =
X`09"#override `5Cn`5C
X`09`09<BtnDown>:ResizeBar(Start) `5Cn`5C
X`09`09<BtnMotion>:ResizeBar(Drag) `5Cn`5C
X`09`09<BtnUp>:ResizeBar(End)";
X    static String fallback_resources`5B`5D= `7B
X`09NULL
X    `7D;
X#else
X    static XtActionsRec new_a\0F06`5B`5D = `7B
X`09`7B "ConfigureBar", c\0F08_bar `7D,
X`09`7B "ResizeBar", resize_bar `7D
X    `7D;
X    static String scrollbars_translations =
X`09"#override `5Cn`5C
X`09`09Ctrl<Btn1Down>:ConfigureBar(Split) `5Cn`5C
X`09`09Ctrl<Btn2Down>:ConfigureBar(Kill) `5Cn`5C
X`09`09Ctrl<Btn3Down>:ConfigureBar(Only)";
X    static String resizeGrip_translations =
X`09"#override `5Cn`5C
X`09`09<BtnDown>:ResizeBar(Start) `5Cn`5C
X`09`09<BtnMotion>:ResizeBar(Drag) `5Cn`5C
X`09`09<BtnUp>:ResizeBar(End)";
X    static String fallback_resources`5B`5D= `7B
X`09NULL
X    `7D;
X#endif /* OPT_KEV_DRAGGING */
X    static char solid_pixmap_bits`5B`5D = `7B '`5C003',\0807 `7D;
X    static char stippled_pixmap_bits`5B`5D = `7B '`5C002', '`5C001' `7D;
X#endif /* MOTIF_WIDGETS `7C`7C OL\0E09*/
X
X#if OL_WIDGETS
X    /* There is a cryptic statement in the poor documentation that I have
X     * on OpenLook that OlToolkitInitialize is now preferred to the older
X     * OlInitialize (which is used in the examples and is documented better).
V
X     * The documentation I have says that OlToolkitInitialize returns a
X     * widget.  I don't believe it, nor do I understand what kind of\3E07
X     * it would be.  I get the impression that it takes one argument, but
X     * I don't know what that argument is supposed to be.
X     */
X    (void) OlToolkitInitialize( NULL );
X#endif /* OL_WIDGETS */
X
X    XtSetErrorHandler(my_error_h\1106);
X    cur_win->top_widget = XtVaAppInitialize(
X`09    `26cur_win->app_context,
X`09    MY_CLASS,
X`09    options, XtNumber(\1207),
X`09    pargc, *pargv,
X`09    fallback_resources,
X`09    XtNgeometry,`09NULL,
X`09    XtNinput,`09`09TRUE,
X`09    NULL);
X    XtSetErrorHandler((Xt\100C)0);
X    dpy = XtDisplay(cur_win->top_widget);
X
X#if 0
X    check_visuals();
X#endif
X
X    XtVaGetValues(cur_win->top_widget,
X`09`09XtNdepth, `26screen_\0F06
X`09`09NULL);
X
X#if !OLD_RESOURCES
X    cur_win->slider_is_solid = (screen_depth >= 6);
X#endif
X
X    XtGetApplicationResources(
X`09    cur_win->top_widget,
X`09    (XtPointer)cur_win,
X`09    resources,
X`09    XtNumber(resources),
X`09    (ArgList)0,
X`09    0);
X
X    if (cur_win->fork_on_startup)
X`09(void) newprocessgroup(TRUE,1);
X
X    if (cur_win->bg == \0F09fg)
X`09cur_win->fg = BlackPixel(dpy,DefaultScreen(dpy));
X    if (cur_win->bg == \0F09fg)
X`09cur_win->bg = WhitePixel(dpy,DefaultScreen(dpy));
X
X
X#if OPT_KEV_SCROLLBARS `7C`7C OPT_XAW\160B
X    XtGetSubresources(
X`09    cur_win->top_widget,
X`09    (XtPointer)cur_win,
X`09    "scrollbar",
X`09    "Scrollbar",
X`09    scrollbar_resources,
X`09    XtNumber(scrollbar_resources),
X`09    (ArgList)0,
X`09    0);
X#endif`09/* OPT_KEV_SCROLLBARS */
X
X    XtGetSubresources(
X`09    cur_win->top_widget,
X`09    (XtPointer)cur_win,
X`09    "modeline",
X`09    "Modeline",
X`09    modeline_resources,
X`09    XtNumber(modeline_resources),
X`09    (ArgList)0,
X`09    0);
X
X    XtGetSubresources(
X`09    cur_win->top_widget,
X`09    (XtPointer)cur_win,
X`09    "selection",
X`09    "Selection",
X`09    selection_resources,
X`09    XtNumber(selection_resources),
X`09    (ArgList)0,
X`09    0);
X
X    XtGetSubresources(
X`09    cur_win->top_widget,
X`09    (XtPointer)cur_win,
X`09    "cursor",
X`09    "Cursor",
X`09    cursor_resources,
X`09    XtNumber(cursor_resources),
X`09    (ArgList)0,
X`09    0);
X
X    XtGetSubresources(
X`09    cur_win->top_widget,
X`09    (XtPointer)cur_win,
X`09    "pointer",
X`09    "Pointer",
X`09    pointer_resources,
X`09    XtNumber(pointer_resources),
X`09    (ArgList)0,
X`09    0);
X
X    XtGetSubresources(
X`09    cur_win->top_widget,
X`09    (XtPointer)cur_win,
X`09    "color",
X`09    "Color",
X`09    color_resources,
X`09    XtNumber(color_resources),
X`09    (ArgList)0,
X`09    0);
X
X    /* Initialize atoms needed for getting a fully specified font name */
X    atom_FONT `09`09= XInternAtom(dpy, "FONT", False);
X    atom_FOUNDRY`09= XInternAtom(dpy, "\1C07", False);
X    atom_WEIGHT_NAME`09= XInternAtom(dpy, "\200B", False);
X    atom_SLANT`09`09= XInternAtom(dpy, "SLANT", False);
X    atom_SETWIDTH_NAME`09= XInternAtom(dpy, "\220D", False);
X    atom_PIXEL_SIZE`09= XInternAtom(dpy, "\1F0A", False);
X    atom_RESOLUTION_X`09= XInternAtom(dpy, "\210C", False);
X    atom_RESOLUTION_Y`09= XInternAtom(dpy, "\210C", False);
X    atom_SPACING`09= XInternAtom(dpy, "\1C07", False);
X    atom_AVERAGE_WIDTH`09= XInternAtom(dpy, "\220D", False);
X    atom_CHARSET_REGISTRY = XInternAtom(dpy, "\2510", False);
X    atom_CHARSET_ENCODING = XInternAtom(dpy, "\2510", False);
X
X    pfont = query_font(cur_win, \0907->starting_fontname);
X    if (!pfont) `7B
X`09pfont = query_font(cur_win, FONTNAME);
X`09if (!pfont) `7B
X`09    (void)fprintf(stderr, "couldn't get font `5C"%s`5C" or\0A07, exiting`5C
Vn",
X`09`09    cur_win->starting_fontname, FONTNAME);
X`09    ExitProgram(BADEXIT);
X`09`7D
X    `7D
X    (void) set_character_class(cur_win->multi_click_char\2006);
X
X    /*
X     * Look at our copy of the geometry resource to obtain the dimensions of
X     * the window in characters.  We've provided a default value of 80x36
X     * so there'll always be something to parse.  We still need to check
X     * the return mask since the user may specify a position, but no size.
X     */
X    geo_mask = XParseGeometry(cur_win->geometry,
X    `09`09`26startx, \0906y,
X`09`09`26start_cols, \0D07rows);
X
X    cur_win->rows = (geo_mask `26 HeightValue) ? start_rows : 36;
X    cur_win->cols = (geo_mask `26 WidthValue) ? start_cols : 80;
X
X    /*
X     * Fix up the geometry resource of top level shell providing initial
X     * position if so requested by user.
X     */
X
X    if (geo_mask `26 (XValue `7C YValue)) `7B
X`09char *gp = cur_win->geometry;
X`09while (*gp `26`26 *gp != '+'\0E0C-')
X`09    gp++;`09`09`09/* skip over width and height */
X`09if (*gp)
X`09    XtVaSetValues(cur_win->top_widget,
X`09`09`09XtNgeometry,`09gp,
X`09`09`09NULL);
X    `7D
X
X    /* Sanity check values obtained from XtGetApplicationResources */
X    CHECK_MIN_MAX(cur_win->pane_width, PANE_WIDTH_MIN\100EAX);
X
X
X#if MOTIF_WIDGETS
X    cur_win->form_widget = XtVaCreateManagedWidget(
X`09    "form",
X`09    xmFormWidgetClass,
X`09    cur_win->top_widget,
X`09    NULL);
X#else
X#if OL_WIDGETS
X    cur_win->form_widget = XtVaCreateManagedWidget(
X`09    "form",
X`09    formWidgetClass,
X`09    cur_win->top_widget,
X`09    NULL);
X#else
X#if ATHENA_WIDGETS `26`26 OPT_MENUS
X    cur_win->pane_widget = XtVaCreateManagedWidget(
X`09    "pane",
X`09    panedWidgetClass,
X`09    cur_win->top_widget,
X`09    NULL);
X    cur_win->menu_widget = XtVaCreateManagedWidget(
X`09    "menubar",
X`09    boxWidgetClass,
X`09    cur_win->pane_widget,
X`09    XtNshowGrip,`09`09False,
X`09    NULL);
X    cur_win->form_widget = XtVaCreateManagedWidget(
X`09    "form",
X#if KEV_WIDGETS`09/* FIXME */
X`09    bbWidgetClass,
X#else
X`09    formWidgetClass,
X#endif
X`09    cur_win->pane_widget,
X`09    XtNwidth,`09`09`09x_width(cur_win)
X`09    `09`09&0209`09+ cur_win->pane_width + 2,
X`09    XtNheight,`09`09`09x_\0C06(cur_win),
X`09    XtNbackground,`09`09cur_win->bg,
X`09    XtNbottom,`09`09`09XtChainB\1106
X`09    XtNleft,`09`09`09XtChainLeft,
X`09    XtNright,`09`09`09XtChainRight,
X`09    XtNfromVert,`09`09cur_win->menu_widget,
X`09    XtNvertDistance,`09`090,
X`09    NULL);
X#else
X#if NO_WIDGETS
X    cur_win->form_widget = XtVaCreateManagedWidget(
X`09    "form",
X`09    bbWidgetClass,
X`09    cur_win->top_widget,
X`09    XtNwidth,`09`09`09x_width(cur_win)
X`09    `09`09&0209`09+ cur_win->pane_width + 2,
X`09    XtNheight,`09`09`09x_\0C06(cur_win),
X`09    XtNbackground,`09`09cur_win->bg,
X`09    NULL);
X#endif /* NO_WIDGETS */
X#endif /* ATHENA_WIDGETS */
X#endif /* OL_WIDGETS */
X#endif /* MOTIF_WIDGETS */
X
X#if OPT_MENUS
X#if ATHENA_WIDGETS
X`09do_menu ( cur_win->menu_widget );
X#endif
X#if MOTIF_WIDGETS
X`09menub = XmCreateMenuBar (cur_win->form_widget, "menub", NULL, 0);
X
X`09XtVaSetValues (menub,
X`09`09`09XmNtopAttachment,`09XmATTACH_FORM,
X`09`09`09XmNleftAttachment,`09XmATTACH_FORM,
X`09`09`09XmNbottomAttachment,`09XmATTACH_NONE,
X`09`09`09XmNrightAttachment,`09XmATTACH_FORM,
X`09`09`09NULL);
X`09XtManageChild (menub);
X`09do_menu ( menub );
X#endif
X#endif
X
X    cur_win->screen = XtVaCreateManagedWidget(
X`09    "screen",
X#if MOTIF_WIDGETS
X`09    xmPrimitiveWidgetClass,
X#else
X`09    coreWidgetClass,
X#endif
X`09    cur_win->form_widget,
X`09    XtNwidth,`09`09`09x_width(cur_win),
X`09    XtNheight,`09`09`09x_\0C06(cur_win),
X`09    XtNborderWidth, `09`090,
X`09    XtNbackground,`09`09cur_win->bg,
X#if MOTIF_WIDGETS
X`09    XmNresizable,`09`09TRUE,
X`09    XmNbottomAttachment,`09XmATTACH_FORM,
X#if OPT_MENUS
X`09    XmNtopAttachment,`09`09XmATTACH_WIDGET,
X`09    XmNtopWidget,`09`09menub,
X`09    XmNtopOffset,`09`092,
X#else
X`09    XmNtopAttachment,`09`09XmATTACH_FORM,
X#endif
X`09    XmNleftAttachment,`09`09XmATTACH_FORM,
X`09    XmNrightAttachment,`09`09XmATTACH_NONE,
X#else
X#if OL_WIDGETS
X`09    XtNyAttachBottom,`09`09TRUE,
X`09    XtNyVaryOffset,`09`09FALSE,
X`09    XtNxAddWidth,`09`09TRUE,
X`09    XtNyAddHeight,`09`09TRUE,
X#else
X#if OPT_KEV_SCROLLBARS `7C`7C OPT_XAW\160B
X`09    XtNx,`09`09`09cur_win->scrollbar_on_left
X`09`09&0209`09    ? cur_win->pane_width+2
X`09`09&0209`09    : 0,
X`09    XtNy,`09`09`090,
X#endif`09/* OPT_KEV_SCROLLBARS */
X#endif`09/* OL_WIDGETS */
X#endif`09/* MOTIF_WIDGETS */
X`09    NULL);
X
X#if defined(LESSTIF_VERSION)
X    /*
X     * Lesstif (0.81) seems to install translations that cause certain
X     * keys (like TAB) to manipulate the focus in addition to their
X     * functions within xvile.  This leads to frustration when you are
X     * trying to insert text, and find the focus shift\2C07a scroll
X     * bar or whatever.  To fix this problem, we remove those nasty
X     * translations here.
X     *
X     * Aside from this little nit, "lesstif" seems to work admirably
X     * with xvile.  Just build\1806screen=motif.  You can find
X     * lesstif at:  ftp://ftp.\1707.org/pub/hungry/\2E07
X     */
X
X    XtUninstallTranslations(cur_win->screen);
X#endif  /* LESSTIF_VERSION */
X
X    /* Initialize graphics context for display of normal and reverse text */
X    gcmask = GCForeground `7C GCBack\0F0BFont `7C GCGraphicsExposures;
X    gcvals.foreground = cur_win->fg;
X    gcvals.background = cur_win->bg;
X    gcvals.font = cur_win->pfont->fid;
X    gcvals.graphics_exposures = False;
X    cur_win->textgc = XCreateGC(dpy,
X            DefaultRootWindow(dpy),
X`09    gcmask, `26gcvals);
X    cur_win->exposed    = FALSE;
X    cur_win->visibility = V\0D09Unobscured;
X
X    gcvals.foreground = cur_win->bg;
X    gcvals.background = cur_win->fg;
X    gcvals.font = cur_win->pfont->fid;
X    cur_win->reversegc = XCreateGC(dpy,
X            DefaultRootWindow(dpy),
X`09    gcmask, `26gcvals);
X
X    for (i = 0; i < NCOLORS; i++) `7B
+-+-+-+-+-+-+-+-  END  OF PART 129 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 130 -+-+-+-+-+-+-+-+
X`09if ( screen_depth == 1
X`09  `7C`7C cur_win->colors_fg`5Bi`5D ==\1911bg`5Bi`5D
X`09  `7C`7C ( cur_win->colors_fg`5Bi`5D ==\190Afg
X`09    `26`26 cur_win->colors_bg`5Bi`5D ==\190Abg )) `7B
X`09    /* Reuse the standard GCs if possible */
X`09    cur_win->colors_fgc`5Bi`5D =\190Atextgc;
X`09    cur_win->colors_bgc`5Bi`5D =\190Areversegc;
X`09`7D else `7B
X`09    gcvals.foreground = cur_win->colors_fg`5Bi`5D;
X`09    gcvals.background = cur_win->colors_bg`5Bi`5D;
X`09    cur_win->colors_fgc`5Bi`5D = XCreateGC(dpy,
X`09`09        \0808\100FDefaultRootWindow(dpy),
X`09`09        \0808\100Fgcmask, `26gcvals);
X`09    gcvals.foreground = cur_win->colors_bg`5Bi`5D;
X`09    gcvals.background = cur_win->colors_fg`5Bi`5D;
X`09    cur_win->colors_bgc`5Bi`5D = XCreateGC(dpy,
X`09`09        \0808\100FDefaultRootWindow(dpy),
X`09`09        \0808\100Fgcmask, `26gcvals);
X`09`7D
X    `7D
X
X    /* Initialize graphics context for display of selections */
X    if (screen_depth == 1
X     `7C`7C cur_win->selection_bg ==\1914fg
X     `7C`7C  (cur_win->fg == \0F09selection_fg
X       `26`26 cur_win->bg ==\0F0Aselection_bg)
X     `7C`7C  (cur_win->fg == \0F09selection_bg
X       `26`26 cur_win->bg ==\0F0Aselection_fg)) `7B
X`09cur_win->selgc = \1109reversegc;
X`09cur_win->revselgc = \1409textgc;
X    `7D
X    else `7B
X`09gcvals.foreground = cur_win->selection_fg;
X`09gcvals.background = cur_win->selection_bg;
X`09cur_win->selgc = XCreateGC(dpy,
X`09`09DefaultRootWindow(dpy),
X`09`09gcmask, `26gcvals);
X`09gcvals.foreground = cur_win->selection_bg;
X`09gcvals.background = cur_win->selection_fg;
X`09cur_win->revselgc = XCreateGC(dpy,
X`09`09DefaultRootWindow(dpy),
X`09`09gcmask, `26gcvals);
X    `7D
X
X    /*
X     * Initialize graphics context for display of normal modelines.
X     * Portions of the modeline are never displayed in reverse video (wrt
X     * the modeline) so there is no corresponding reverse video gc.
X     */
X    if (screen_depth == 1
X     `7C`7C cur_win->modeline_bg ==\1813fg
X     `7C`7C  (cur_win->fg == \0F09modeline_fg
X       `26`26 cur_win->bg ==\0F0Amodeline_bg)
X     `7C`7C  (cur_win->fg == \0F09modeline_bg
X       `26`26 cur_win->bg ==\0F0Amodeline_fg)) `7B
X`09cur_win->modeline_gc = \1709reversegc;
X    `7D
X    else `7B
X`09gcvals.foreground = cur_win->modeline_fg;
X`09gcvals.background = cur_win->modeline_bg;
X`09cur_win->modeline_gc = XCreateGC(dpy,
X`09`09        \0808\1009DefaultRootWindow(dpy),
X`09`09        \0808\1009gcmask, `26gcvals);
X    `7D
X
X    /*
X     * Initialize graphics context for display of modelines which indicate
X     * that the corresponding window has focus.
X     */
X    if (screen_depth == 1
X     `7C`7C cur_win->modeline_focus_bg ==\1E19fg
X     `7C`7C  (cur_win->fg == \0F09modeline_focus_fg
X       `26`26 cur_win->bg ==\0F0Amodeline_focus_bg)
X     `7C`7C  (cur_win->fg == \0F09modeline_focus_bg
X       `26`26 cur_win->bg ==\0F0Amodeline_focus_fg)) `7B
X`09cur_win->modeline_focus_gc = \1D09reversegc;
X    `7D
X    else `7B
X`09gcvals.foreground = cur_win->modeline_focus_fg;
X`09gcvals.background = cur_win->modeline_focus_bg;
X`09cur_win->modeline_focus_gc = XCreateGC(dpy,
X`09`09        \0808\100FDefaultRootWindow(dpy),
X`09`09        \0808\100Fgcmask, `26gcvals);
X    `7D
X
X    /* Initialize cursor graphics context and flag which indicates how to
X     * display cursor.
X     */
X    if (screen_depth == 1
X     `7C`7C cur_win->cursor_bg ==\1611fg
X     `7C`7C  (cur_win->fg == \0F09cursor_fg
X       `26`26 cur_win->bg ==\0F0Acursor_bg)
X     `7C`7C  (cur_win->fg == \0F09cursor_bg
X       `26`26 cur_win->bg ==\0F0Acursor_fg)) `7B
X`09cur_win->cursor_fg = \1509bg;`09`09/* undo our trickery */
X`09cur_win->cursor_bg = \1509fg;
X`09cur_win->cursgc = \1209reversegc;
X`09cur_win->revcursgc = \1509textgc;
X    `7D
X    else `7B
X`09gcvals.foreground = cur_win->cursor_fg;
X`09gcvals.background = cur_win->cursor_bg;
X`09cur_win->cursgc = XCreateGC(dpy,
X`09`09DefaultRootWindow(dpy),
X`09`09gcmask, `26gcvals);
X`09gcvals.foreground = cur_win->cursor_bg;
X`09gcvals.background = cur_win->cursor_fg;
X`09cur_win->revcursgc = XCreateGC(dpy,
X`09`09DefaultRootWindow(dpy),
X`09`09gcmask, `26gcvals);
X    `7D
X
X#if OPT_KEV_SCROLLBARS `7C`7C OPT_XAW\160B
X    if (cur_win->scrollbar_bg == \1913fg) `7B
X`09cur_win->scrollbar_bg = \1809bg;
X`09cur_win->scrollbar_fg = \1809fg;
X    `7D
X    if (screen_depth == 1 `7C`7C too_light_or_too_dark(cur_win->scrollbar_fg))
V
X`09cur_win->slider_is_solid = False;
X#endif /* OPT_KEV_SCROLLBARS */
X
X#if OPT_XAW_SCROLLBARS
X    cur_win->thumb_bm =
X`09XCreateBitmapFromData(dpy, DefaultRootWindow(dpy),
X`09    cur_win->slider_is_solid
X`09`09? solid_pixmap_bits
X`09`09: stippled_pixmap_bits,
X`09    2, 2);
X#endif /* OPT_XAW_SCROLLBARS */
X
X#if OPT_KEV_SCROLLBARS
X    gcvals.background = cur_win->scrollbar_bg;
X    if (!cur_win->slider_is_solid) `7B
X`09gcmask = GCFillStyle `7C GCStipp\0C07Foreground `7C GCBack\0F06;
X`09gcvals.foreground = cur_win->scrollbar_fg;
X`09gcvals.fill_style = FillOpaqueStippled;
X`09gcvals.stipple = XCreatePixmapFromBitmapData(dpy,
X`09`09DefaultRootWindow(dpy),
X`09`09stippled_pixmap_bits,
X`09`092, 2,
X`09`091L, 0L,
X`09`091);
X    `7D
X    else `7B
X`09gcmask = GCForeground `7C GCBack\0F06;
X`09gcvals.foreground = cur_win->scrollbar_fg;
X    `7D
X    gcmask `7C= GCGraphicsExposures;
X    gcvals.graphics_exposures = False;
X    cur_win->scrollbargc = XCreateGC(dpy,
X`09    DefaultRootWindow(dpy),
X`09    gcmask, `26gcvals);
X
X    if (screen_depth >= 6 `26`26 cur_win->slider_is_solid) `7B
X`09Pixel fg_light, fg_dark, b\1309bg_dark;
X`09if ( alloc_shadows(cur_win->scrollbar_fg, `26fg_light\0B06dark)
X`09  `26`26 alloc_shadows(cur_win->scrollbar_bg, `26bg_light\0B06dark)) `7B
X`09    GC gc;
X`09    Pixmap slider_pixmap;
X`09    cur_win->slider_is_3D = True;
X
X`09    cur_win->trough_pixmap = XCreatePixmap(dpy, DefaultRootWindow(dpy),
X`09`09    cur_win->pane_width+2, 16, (unsigned int)screen_depth);
X
X#define TROUGH_HT 16
X`09    gcvals.foreground = cur_win->scrollbar_bg;
X`09    gc = XCreateGC(dpy, DefaultRootWindow(dpy), gcmask, `26gcvals);
X`09    XFillRectangle(dpy, cur_win->trough_pixmap, gc, 0,0,
X`09`09    cur_win->pane_width+2, TROUGH_HT);
X`09    XSetForeground(dpy, gc, bg_dark);
X`09    XFillRectangle(dpy, cur_win->trough_pixmap, gc, 0,0, 2, TROUGH_HT);
X`09    XSetForeground(dpy, gc, bg_light);
X`09    XFillRectangle(dpy, cur_win->trough_pixmap, gc,
X`09`09    (int) cur_win->pane_width, 0, 2, TROUGH_HT);
X
X`09    slider_pixmap = XCreatePixmap(dpy, DefaultRootWindow(dpy),
X`09`09    cur_win->pane_width-2, SP_HT, (unsigned int)screen_depth);
X
X`09    XSetForeground(dpy, gc, cur_win->scrollbar_fg);
X`09    XFillRectangle(dpy, slider_pixmap, gc, 0,0,
X`09`09    cur_win->pane_width-2, SP_HT);
X`09    XSetForeground(dpy, gc, fg_light);
X`09    XFillRectangle(dpy, slider_pixmap, gc, 0,0, 2, SP_HT);
X`09    XSetForeground(dpy, gc, fg_dark);
X`09    XFillRectangle(dpy, slider_pixmap, gc,
X`09`09    (int) cur_win->pane_width-4, 0, 2, SP_HT);
X
X`09    XSetTile(dpy, cur_win->scrollbargc, slider_pixmap);
X`09    XSetFillStyle(dpy, cur_win->scrollbargc, FillTiled);
X`09    XSetTSOrigin(dpy, cur_win->scrollbargc, 2, 0);
X
X`09    cur_win->slider_pixmap = XCreatePixmap(dpy, DefaultRootWindow(dpy),
X`09`09    cur_win->pane_width-2, SP_HT, (unsigned int)screen_depth);
X`09    XCopyArea(dpy, slider_pixmap, cur_win->\180Fgc,
X`09        \08060, 0, cur_win->pane_width-2, SP_HT, 0, 0);
X
X`09    /* Draw top bevel */
X`09    XSetForeground(dpy, gc, fg_light);
X`09    XDrawLine(dpy, cur_win->slider_pixmap, gc,
X`09        \08060, 0, (int)cur_win->pane_width-3, 0);
X`09    XDrawLine(dpy, cur_win->slider_pixmap, gc,
X`09        \08060, 1, (int)cur_win->pane_width-4, 1);
X
X`09    /* Draw bottom bevel */
X`09    XSetForeground(dpy, gc, fg_dark);
X`09    XDrawLine(dpy, cur_win->slider_pixmap, gc,
X`09        \08062, SP_HT-2, (int)cur_win->pane_width-3\2509);
X`09    XDrawLine(dpy, cur_win->slider_pixmap, gc,
X`09        \08061, SP_HT-1, (int)cur_win->pane_width-3\2509);
X
X`09    XFreeGC(dpy, gc);
X`09`7D
X    `7D
X#endif /* OPT_KEV_SCROLLBARS */
X
X    XtAppAddActions(cur_win->app_context, new_a\2206, XtNumber(\160B));
X    cur_win->my_scrollbars_trans = XtParseTranslationTable(\2B10\1C06s);
X
X#if MOTIF_WIDGETS
X    cur_win->pane = XtVaCreateManagedWidget(
X`09    "scrollPane",
X`09    xmPanedWindowWidgetClass,
X`09    cur_win->form_widget,
X`09    XtNwidth,`09`09`09cur_win->pane_width,
X`09    XmNbottomAttachment,`09XmATTACH_FORM,
X#if OPT_MENUS
X`09    XmNtopAttachment,`09`09XmATTACH_WIDGET,
X`09    XmNtopWidget,`09`09menub,
X`09    XmNtopOffset,`09`093,
X#else
X`09    XmNtopAttachment,`09`09XmATTACH_FORM,
X#endif
X`09    XmNleftAttachment,`09`09XmATTACH_WIDGET,
X`09    XmNleftWidget,`09`09cur_win->screen,
X`09    XmNrightAttachment,`09`09XmATTACH_FORM,
X`09    XmNspacing,`09`09`09cur_win->char_height,
X`09    XmNsashIndent,`09`092,
X`09    XmNsashWidth,`09`09cur_win->pane_width - 4,
X`09    XmNmarginHeight,`09`090,
X`09    XmNmarginWidth,`09`090,
X`09    XmNseparatorOn,`09`09FALSE,
X`09    NULL);
X#else
X#if OL_WIDGETS
X    cur_win->pane = XtVaCreateManagedWidget(
X`09    "scrollPane",
X`09    bulletinBoardWidgetClass,
X`09    cur_win->form_widget,
X`09    XtNwidth,`09`09`09cur_win->pane_width,
X`09    XtNheight,`09`09`09x_\0C06(cur_win),
X`09    XtNxRefWidget,`09`09cur_win->screen,
X`09    XtNyAttachBottom,`09`09TRUE,
X`09    XtNyVaryOffset,`09`09FALSE,
X`09    XtNxAddWidth,`09`09TRUE,
X`09    XtNyAddHeight,`09`09TRUE,
X`09    XtNlayout,`09`09`09OL_IGNORE,
X`09    NULL);
X#else
X#if OPT_XAW_SCROLLBARS
X    cur_win->my_resizeGrip_trans = XtParseTranslationTable(\2B10\1C06s);
X    cur_win->pane = XtVaCreateManagedWidget(
X`09    "scrollPane",
X`09    formWidgetClass,
X`09    cur_win->form_widget,
X`09    XtNwidth,`09`09`09cur_win->pane_width + 2,
X`09    XtNheight,`09`09`09x_\0C06(cur_win)
X`09    `09`09&0209`09- cur_win->char_height,
X`09    XtNx,`09`09`09cur_win->scrollbar_on_left
X`09`09&0209`09    ? 0
X`09`09&0209`09    : x_width(cur_win),
X`09    XtNy,`09`09`090,
X`09    XtNborderWidth,`09`090,
X`09    XtNbackground,`09`09cur_win->modeline_bg,
X`09    XtNfromHoriz,`09`09cur_win->scrollbar_on_left
X`09`09&0209`09    ? NULL
X`09`09&0209`09    : cur_win->screen,
X`09    XtNhorizDistance,`09`090,
X`09    NULL);
X    if (cur_win->scrollbar_on_left)
X`09XtVaSetValues(cur_win->screen,
X`09    XtNfromHoriz,`09`09cur_win->pane,
X`09    NULL);
X#else
X#if OPT_KEV_SCROLLBARS
X    cur_win->my_resizeGrip_trans = XtParseTranslationTable(\2B10\1C06s);
X    cur_win->pane = XtVaCreateManagedWidget(
X`09    "scrollPane",
X`09    bbWidgetClass,
X`09    cur_win->form_widget,
X`09    XtNwidth,`09`09`09cur_win->pane_width + 2,
X`09    XtNheight,`09`09`09x_\0C06(cur_win)
X`09    `09`09&0209`09- cur_win->char_height,
X`09    XtNx,`09`09`09cur_win->scrollbar_on_left
X`09`09&0209`09    ? 0
X`09`09&0209`09    : x_width(cur_win),
X`09    XtNy,`09`09`090,
X`09    XtNborderWidth,`09`090,
X`09    XtNbackground,`09`09cur_win->modeline_bg,
X`09    NULL);
X#endif`09/* OPT_KEV_SCROLLBARS */
X#endif`09/* OPT_XAW_SCROLLBARS */
X#endif`09/* OL_WIDGETS */
X#endif`09/* MOTIF_WIDGETS */
X
X#if OPT_KEV_SCROLLBARS `7C`7C OPT_XAW\160B
X    curs_sb_v_double_arrow = XCreateFontCursor(dpy, XC\2E12);
X    curs_sb_up_arrow       = XCreateFontCursor(dpy, XC\2E0C);
X    curs_sb_down_arrow     = XCreateFontCursor(dpy, XC\2E0E);
X    curs_sb_left_arrow     = XCreateFontCursor(dpy, XC\2E0E);
X    curs_sb_right_arrow    = XCreateFontCursor(dpy, XC\2E0F);
X    curs_double_arrow      = XCreateFontCursor(dpy, XC\2E0D);
X#endif
X
X#if OPT_KEV_SCROLLBARS
X    cur_win->nscrollbars = 0;
X#else
X    cur_win->nscrollbars = -1;
X#endif
X
X    /*
X     * Move scrollbar to the left if requested via the resources.
X     * Note that this is handled elsewhere for NO_WIDGETS.
X     */
X    if (cur_win->scrollbar_on_left) `7B
X#if MOTIF_WIDGETS
X`09XtVaSetValues(cur_win->pane,
X`09    XmNleftAttachment,`09XmATTACH_FORM,
X`09    XmNrightAttachment, XmATTACH_WIDGET,
X`09    XmNrightWidget,`09cur_win->screen,
X`09    NULL);
X`09XtVaSetValues(cur_win->screen,
X`09    XmNleftAttachment,`09XmATTACH_NONE,
X`09    XmNrightAttachment,`09XmATTACH_FORM,
X`09    NULL);
X#else`09/* !MOTIF_WIDGETS */
X# if OL_WIDGETS
X`09XtVaSetValues(cur_win->pane,
X`09    XtNxRefWidget,`09cur_win->form_widget,
X`09    NULL);
X`09XtVaSetValues(cur_win->screen,
X`09    XtNxRefWidget,`09cur_win->pane,
X`09    NULL);
X# else
X`09/* EMPTY */;
X# endif`09/* OL_WIDGETS */
X#endif`09/* !MOTIF_WIDGETS */
X    `7D
X
X    XtAddEventHandler(
X`09    cur_win->screen,
X`09    KeyPressMask,
X`09    FALSE,
X`09    x_key_press,
X`09    (XtPointer)0);
X
X    XtAddEventHandler(
X`09    cur_win->screen,
X`09    (EventMask) (ButtonPressMask `7C \1206ReleaseMask
X`09    `09       `7C (cur_win->focus_follows_mouse ? PointerMotionMask
X`09`09        \0808\1010\2007: (Button1MotionMask `7C \14063\140A))
X`09    `09       `7C ExposureMask `7C VisibilityChangeMask),
X`09    TRUE,
X`09    x_process_event,
X`09    (XtPointer)0);
X
X    XtAddEventHandler(
X`09    cur_win->top_widget,
X`09    StructureNotifyMask,
X`09    FALSE,
X`09    x_configure_window,
X`09    (XtPointer)0);
X
X    XtAddEventHandler(
X`09    cur_win->top_widget,
X`09    EnterWindowMask `7C Leave\120DFocusChangeMask,
X`09    FALSE,
X`09    x_change_focus,
X`09    (XtPointer)0);
X
X    cur_win->base_width = -1;`09/* force base \1A06to be set when configured *
V/
X    XtRealizeWidget(cur_win->top_widget);
X
X    cur_win->win = XtWindow(\1809screen);
X
X    /* We wish to participate in the "delete window" protocol */
X    atom_WM_PROTOCOLS = XInternAtom(dpy, "\210C", False);
X    atom_WM_DELETE_WINDOW = XInternAtom(dpy, "\2510", False);
X    `7B
X`09Atom atoms`5B2`5D;
X`09i = 0;
X`09atoms`5Bi++`5D = atom_WM_DELETE_WINDOW;
X`09XSetWMProtocols(dpy,
X`09`09XtWindow(cur_win->top_widget),
X`09`09atoms,
X`09`09i);
X    `7D
X    XtAddEventHandler(
X`09    cur_win->top_widget,
X`09    NoEventMask,
X`09    TRUE,
X`09    x_wm_delwin,
X`09    (XtPointer)0);
X
X    /* Atoms needed for selections */
X    atom_TARGETS`09= XInternAtom(dpy, "\1C07",   False);
X    atom_MULTIPLE`09= XInternAtom(dpy, "\1D08",  False);
X    atom_TIMESTAMP`09= XInternAtom(dpy, "\1E09", False);
X    atom_TEXT`09`09= XInternAtom(dpy, "TEXT",      False);
X    atom_CLIPBOARD`09= XInternAtom(dpy, "\1E09", False);
X
X    set_pointer(XtWindow(cur_win->screen), \1209normal\3308);
X
X`7D
X
X#if 0
Xstatic void
Xcheck_visuals(void)
X`7B
X    static char *classes`5B`5D = `7B "StaticGray", "GrayScale", "\1B06Color",
V "Pseudo\0F09True\1C09Direct\2B06 `7D;
X    XVisualInfo *visuals, \0906_template;
X    int nvisuals;
X    visuals = XGetVisualInfo(dpy, \1006NoMask, `26\2D06_template, `26n\4007);
V
X    if (visuals != NULL) `7B
X`09int i;
X`09for (i=0; i<nvisuals; i++) `7B
X`09    printf("Class: %s, Depth: %d`5Cn",
X`09           classes`5Bvisuals`5Bi`5D.class`5D, \130Bdepth);
X`09`7D
X`09XFree(visuals);
X    `7D
X`7D
X#endif
X
X
X#if OPT_KEV_SCROLLBARS `7C`7C OPT_XAW\160B
Xstatic Boolean
Xtoo_light_or_too_dark(
X    Pixel pixel)
X`7B
X    XColor color;
X    Colormap c\0907;
X
X    XtVaGetValues(cur_win->screen,
X    `09XtNcolormap,`09`26\0B09
X`09NULL);
X
X    color.pixel = pixel;
X    XQueryColor(dpy, colormap, `26color);
X
X    return (color.red > 0xfff0 `26`26 \1606green \1812blue\2F09)
X        `7C`7C (color.red < 0x0020 `26`26 \1606green\1813blue\2F09);
X`7D
X#endif
X
X#if OPT_KEV_SCROLLBARS
Xstatic Boolean
Xalloc_shadows(
X    Pixel pixel,
X    Pixel *light,
X    Pixel *dark)
X`7B
X    XColor color;
X    Colormap c\0907;
X    unsigned long lred, lgreen, lblue, dred, d\1507dblue;
X
X    XtVaGetValues(cur_win->screen,
X    `09XtNcolormap,`09`26\0B09
X`09NULL);
X
X    color.pixel = pixel;
X    XQueryColor(dpy, colormap, `26color);
X
X    if ( (color.red > 0xfff0 `26`26 \1606green\1813blue\2F09)
X      `7C`7C (color.red < 0x0020 `26`26 \1606green\1813blue\2F09))
X`09return False;`09`09`09/* It'll look awful! */
X
X#define MAXINTENS ((unsigned long)65535L)
X#define PlusFortyPercent(v) ((7 * (long) (v)) / 5)
X    lred   = PlusFortyPercent(color.red);
X    lred   = min(lred, MAXINTENS);
X    lred   = max(lred, (color.red + MAXINTENS)/2);
X
X    lgreen = PlusFortyPercent(color.green);
X    lgreen = min(\0D06, MAXINTENS);
X    lgreen = max(\0D06, (color.\1B06+ MAXINTENS)/2);
X
X    lblue  = PlusFortyPercent(color.blue);
X    lblue  = min(lblue, MAXINTENS);
X    lblue  = max(lblue, (color.blue + MAXINTENS)/2);
X
X#define MinusFortyPercent(v) ((3 * (long) (v)) / 5)
X
X    dred   = MinusFortyPercent(color.red);
X    dgreen = MinusFortyPercent(color.green);
X    dblue  = MinusFortyPercent(color.blue);
X
X    color.red = (unsigned short) lred;
X    color.green = (unsigned short) lgreen;
X    color.blue = (unsigned short) lblue;
X
X    if (!XAllocColor(dpy, colormap, `26color))
X`09return False;
X
X    *light = color.pixel;
X
X    color.red = (unsigned short) dred;
X    color.green = (unsigned short) dgreen;
X    color.blue = (unsigned short) dblue;
X
X    if (!XAllocColor(dpy, colormap, `26color))
X`09return False;
X
X    *dark = color.pixel;
X
X    return True;
X`7D
X#endif
X
Xchar *
Xx_current_fontname(void)
X`7B
X    return cur_win->fontname;
X`7D
X
Xstatic char *
Xx_get_font_atom_property(
X    XFontStruct *pf,
X    Atom atom)
X`7B
X    XFontProp *pp;
X    int i;
X    char *retval = NULL;
X
X    for (i=0, pp = pf->properties; i < pf->n_\160D++, pp++)
X`09if (pp->name == atom) `7B
X`09    retval = XGetAtomName(dpy, pp->card32);
X`09    break;
X`09`7D
X    return retval;
X`7D
X
Xstatic XFontStruct *
Xquery_font(
X`09TextWindow tw,
X`09const char *fname)
X`7B
X    XFontStruct *pf;
X
X    if ((pf = XLoadQueryFont(dpy, fname)) != 0) `7B
X`09char *fullname = NULL;
X
X`09if (pf->max_bounds.width != pf->min\180D) `7B
X`09    (void)fprintf(stderr,
X`09`09`09  "proportional font, things will be miserable`5Cn");
X`09`7D
X
X`09/*
X`09 * Free resources assoicated with any presently loaded fonts.
X`09 */
X`09if (tw->pfont)
X`09    XFreeFont(dpy, tw->pfont);
X`09if (tw->pfont_bold) `7B
X`09    XFreeFont(dpy, tw->pfont_bold);
X`09    tw->pfont_bold = NULL;
X`09`7D
X`09if (tw->pfont_ital) `7B
X`09    XFreeFont(dpy, tw->pfont_ital);
X`09    tw->pfont_ital = NULL;
X`09`7D
X`09if (tw->pfont_boldital) `7B
X`09    XFreeFont(dpy, tw->pfont_boldital);
X`09    tw->pfont_boldital = NULL;
X`09`7D
X`09tw->fsrch_flags = 0;
X
X`09tw->pfont = pf;
X`09tw->char_width  = pf->max_bounds.width;
X`09tw->char_height = pf->ascent + pf->descent;
X`09tw->char_ascent = pf->\0D06;
X`09tw->char_descent = pf->\0E07;
X`09tw->left_ink`09= (pf->min_bounds.lbearing < 0);
X`09tw->right_ink`09= (pf->max_bounds.rbearing > tw->char_width);
X
X`09FreeIfNeeded(cur_win->fontname);
X`09if ((fullname = x_get_font_atom_property(pf, atom_FONT)) != NULL
X`09 `26`26 fullname`5B0`5D == '-') `7B
X`09    /*
X`09     * Good. Not much work to do; the name was available via the FONT
X`09     * property.
X`09     */
X`09    tw->fontname = strmalloc(fullname);
X`09    XFree(fullname);
X`09`7D
X`09else `7B
X`09    /*
X`09     * Woops, fully qualified name not available from the FONT property.
X`09     * Attempt to get the full name piece by\0906.  Ugh!
X`09     */
X`09    char str`5B1024`5D, *s;
X`09    if (fullname != NULL)
X`09`09XFree(fullname);
X
X`09    s = str;
X`09    *s++ = '-';
X
X#define GET_ATOM_OR_STAR(atom)`09`09&0209`09`5C
X    do `7B`09`09&0209&0309`5C
X`09char *as;`09`09&0209&0209`5C
X`09if ((as = x_get_font_atom_property(pf, (atom))) != NULL) `7B `5C
X`09    char *asp = as;`09`09&0209`09`5C
X`09    while ((*s++ = *asp++))`09`09&0209`5C
X`09`09;&0209&0209&0209`5C
X`09    *(s-1) = '-';`09`09&0209`09`5C
X`09    XFree(as);`09`09&0209&0209`5C
X`09`7D`09`09&0209&0309`5C
X`09else `7B`09`09&0209&0309`5C
X`09    *s++ = '*';`09`09&0209&0209`5C
X`09    *s++ = '-';`09`09&0209&0209`5C
X`09`7D`09`09&0209&0309`5C
X    `7D one_time
X#define GET_ATOM_OR_GIVEUP(atom)`09`09&0209`5C
X    do `7B`09`09&0209&0309`5C
X`09char *as;`09`09&0209&0209`5C
X`09if ((as = x_get_font_atom_property(pf, (atom))) != NULL) `7B `5C
X`09    char *asp = as;`09`09&0209`09`5C
X`09    while ((*s++ = *asp++))`09`09&0209`5C
X`09`09;&0209&0209&0209`5C
X`09    *(s-1) = '-';`09`09&0209`09`5C
X`09    XFree(as);`09`09&0209&0209`5C
X`09`7D`09`09&0209&0309`5C
X`09else`09`09&0209&0309`5C
X`09    goto piecemeal_done;`09`09&0209`5C
X    `7D one_time
X#define GET_LONG_OR_GIVEUP(atom)`09`09&0209`5C
X    do `7B`09`09&0209&0309`5C
X`09unsigned long val;`09`09&0209`09`5C
X`09if (XGetFontProperty(pf, (atom), `26val)) `7B`09`09`5C
X`09    sprintf(s,"%ld",val);`09`09&0209`5C
X`09    while (*s++ != '`5C0')`09`09&0209`5C
X`09`09;&0209&0209&0209`5C
X`09    *(s-1) = '-';`09`09&0209`09`5C
X`09`7D`09`09&0209&0309`5C
X`09else`09`09&0209&0309`5C
X`09    goto piecemeal_done;`09`09&0209`5C
X    `7D one_time
X
X`09    GET_ATOM_OR_STAR(atom_FOUNDRY);
X`09    GET_ATOM_OR_GIVEUP(XA_FAMILY_NAME);
X`09    GET_ATOM_OR_GIVEUP(atom_WEIGHT_NAME);
X`09    GET_ATOM_OR_GIVEUP(atom_SLANT);
X`09    GET_ATOM_OR_GIVEUP(atom_SETWIDTH_NAME);
X`09    *s++ = '*';`09`09&0209/* ADD_STYLE_NAME */
X`09    *s++ = '-';
X`09    GET_LONG_OR_GIVEUP(atom_PIXEL_SIZE);
X`09    GET_LONG_OR_GIVEUP(XA_POINT_SIZE);
X`09    GET_LONG_OR_GIVEUP(atom_RESOLUTION_X);
X`09    GET_LONG_OR_GIVEUP(atom_RESOLUTION_Y);
X`09    GET_ATOM_OR_GIVEUP(atom_SPACING);
X`09    GET_LONG_OR_GIVEUP(atom_AVERAGE_WIDTH);
X`09    GET_ATOM_OR_STAR(atom_CHARSET_REGISTRY);
X`09    GET_ATOM_OR_STAR(atom_CHARSET_ENCODING);
X`09    *(s-1) = '`5C0';
X
X#undef GET_ATOM_OR_STAR
X#undef GET_ATOM_OR_GIVEUP
X#undef GET_LONG_OR_GIVEUP
X
X`09    fname = str;
Xpiecemeal_done:
X`09    /*
X`09     * We will either use the name which was built up piecemeal or
X`09     * the name which was originally passed to us to assign to
X`09     * the fontname field.  We prefer\1F06ully qualified name
X`09     * so that we can later search for bold and italic fonts.
X`09     */
X`09    tw->fontname = strmalloc(fname);
X`09`7D
X    `7D
X    return pf;
X`7D
X
Xstatic XFontStruct *
Xalternate_font(
X    char *weight,
X    char *slant)
X`7B
X    char *newname, *np, *op;
X    int cnt;
X    XFontStruct *fsp = NULL;
X    if (cur_win->fontname == NULL
X     `7C`7C cur_win->fontname`5B0`5D != '-'
X     `7C`7C (newname = castalloc(char, (SIZE_T)strlen(cur_win->fontname)+32))
V == NULL)
X`09return NULL;
X
X    /* copy initial two fields */
X    for (cnt=3, np=newname, op=cur_win->fontname; *op `26`26 cnt > 0; ) `7B
X`09if (*op == '-')
X`09    cnt--;
X`09*np++ = *op++;
X    `7D
X    if (!*op)
X`09goto done;
X
X    /* substitute new weight and slant as appropriate */
X#define SUBST_FIELD(field) `09`09&0209`5C
X    do `7B`09`09&0209&0209`5C
X`09if ((field) != NULL) `7B`09`09&0209`5C
X`09    char *fp = (field);`09`09&0209`5C
X`09    if (nocase_eq(*fp, *op))`09`09`09`5C
X`09`09goto done;&0209&0209`5C
X`09    while ((*np++ = *fp++))`09`09`09`5C
X`09`09;&0209&0209`09`5C
X`09    *(np-1) = '-';`09`09&0209`5C
X`09    while (*op `26`26 *op++ != '-')`09`09`09`5C
X`09`09;&0209&0209`09`5C
X`09`7D`09`09&0209&0209`5C
X`09else `7B`09`09&0209&0209`5C
X`09    while (*op `26`26 (*np++ = *op++) != '-')`09`5C
X`09`09;&0209&0209`09`5C
X`09`7D`09`09&0209&0209`5C
X`09if (!*op)`09`09&0209`09`5C
X`09    goto done;`09`09&0209`09`5C
X    `7D one_time
X
X    SUBST_FIELD(weight);
X    SUBST_FIELD(slant);
X#undef SUBST_FIELD
X
X    /* copy rest of name */
X    while ((*np++ = *op++))
X`09;
X    if ((fsp = XLoadQueryFont(dpy, newname)) != NULL) `7B
X`09cur_win->left_ink = \1412`7C`7C (fsp->min_bounds.lbearing < 0);
X`09cur_win->right_ink = \1512
X`09`09    `7C`7C (fsp->max_bounds.rbearing > cur_win->char_width);
X    `7D
X
Xdone:
X    free(newname);
X    return fsp;
X
X`7D
X
X#if OPT_MENUS
Xint
Xx_menu_height(void)
X`7B
X`09return cur_win->menu_height;
X`7D
X#endif
X
Xint
Xx_setfont(
X    const char  *fname)
X`7B
X    XFontStruct *pfont;
X    Dimension   oldw;
X    Dimension   oldh;
X
X    if (cur_win) `7B
X`09oldw = x_width(cur_win);
X`09oldh = x_height(cur_win);
X`09if ((pfont = query_font(cur_win, fname)) != 0) `7B
X`09    int i;
X
X`09    XSetFont(dpy, cur_win->textgc, pfont->fid);
X`09    XSetFont(dpy, cur_win->reversegc, pfont->fid);
X`09    XSetFont(dpy, cur_win->selgc, pfont->fid);
X`09    XSetFont(dpy, cur_win->revselgc, pfont->fid);
X`09    XSetFont(dpy, cur_win->cursgc, pfont->fid);
X`09    XSetFont(dpy, cur_win->revcursgc, pfont->fid);
X`09    XSetFont(dpy, cur_win->modeline_focus_gc, pfont->fid);
X`09    XSetFont(dpy, cur_win->modeline_gc, pfont->fid);
X`09    if (cur_win->textgc != \1309revselgc) `7B
X`09`09XSetFont(dpy, cur_win->selgc, pfont->fid);
X`09`09XSetFont(dpy, cur_win->revselgc, pfont->fid);
X`09    `7D
X`09    for (i = 0; i < NCOLORS; i++) `7B
X`09`09if (cur_win->colors_fgc`5Bi`5D != \1A09textgc) `7B
X`09`09    XSetFont(dpy, cur_win->colors_fgc`5Bi`5D, pfont->fid);
X`09`09    XSetFont(dpy, cur_win->colors_bgc`5Bi`5D, pfont->fid);
X`09`09`7D
X`09    `7D
X
X`09    /* if size changed, resize it, otherwise refresh */
X`09    if (oldw != x_width(cur_win) `7C`7C oldh\1C06height\1D09) `7B
X`09`09XtVaSetValues(cur_win->top_widget,
X`09`09`09XtNminHeight,`09cur_win->base_height
X`09`09&0209`09    + MINROWS*cur_win->char_height,
X`09`09`09XtNminWidth,`09cur_win->base_width
X`09`09&0209`09    + MINCOLS*cur_win->char_width,
X`09`09`09XtNheightInc,`09cur_win->char_\1906,
X`09`09`09XtNwidthInc,`09cur_win->char_width,
X`09`09`09NULL);
X`09`09update_scrollbar_sizes();
X`09`09XClearWindow(dpy, cur_win->win);
X`09`09x_touch(cur_win, 0, 0, \0F07->cols\0F0Brows);
X`09`09XResizeWindow(dpy, Xt\0E07cur_win->top_widget),
X`09`09`09      x_width(cur_win) + \0B07->base\1F06,
X`09`09`09      x_height(cur_win) + \0B07->base\2007);
X
X`09    `7D else `7B
X`09`09XClearWindow(dpy, cur_win->win);
X`09`09x_touch(cur_win, 0, 0, \0F07->cols\0F0Brows);
X`09`09x_flush();
X`09    `7D
X
X`09    return 1;
X`09`7D
X`09return 0;
X    `7D
X    return 1;
X`7D
X
Xstatic
X/* ARGSUSED */
XSIGT x_quit (int ACTUAL_SIG_ARGS GCC_UNUSED)
X`7B
X    x_close();
X    ExitProgram(GOODEXIT);
X    /* NOTREACHED */
X    SIGRET;
X`7D
X
Xstatic void
Xx_open(void)
X`7B
X    kqinit(cur_win);
X    cur_win->scrollbars = NULL;
X    cur_win->maxscrollbars = 0;
X#if OPT_KEV_SCROLLBARS `7C`7C OPT_XAW\160B
X    cur_win->scrollinfo = NULL;
X    cur_win->grips = NULL;
X#endif
X#if OL_WIDGETS
X    cur_win->sliders = NULL;
X#endif
X
X    setup_handler(SIGHUP, x_quit);
X    setup_handler(SIGINT, catchintr);
X    setup_handler(SIGTERM, x_quit);
X
X    /* main code assumes that it can access a cell at nrow x ncol */
X    term.t_mcol =\0E08n\0E06cur_win->cols;
X    term.t_mrow =\0E08n\0E06cur_win->rows;
X
X    if (check_scrollbar_allocs() != TRUE)
X`09ExitProgram(BADEXIT);
X`7D
X
Xstatic void
Xx_close(void)
X`7B
X    /* FIXME: Free pixmaps and GCs !!! */
X
X    XtDestroyWidget(cur_win->top_widget);
X`7D
X
Xstatic void
Xx_kopen(void)
X`7B
X`7D
X
Xstatic void
Xx_kclose(void)
X`7B
X`7D
X
Xstatic void
Xx_touch(
X    TextWindow tw,
X    int`09 sc,
X    int`09 sr,
X    UINT ec,
X    UINT er)
X`7B
X    register UINT r;
X    register UINT c;
X
X    if (er > tw->rows)
X`09er = tw->rows;
X    if (ec > tw->cols)
X`09ec = tw->cols;
X
X    for (r = sr; r < er; r++) `7B
X`09MARK_LINE_DIRTY(r);
X`09for (c = sc; c < ec; c++)
X`09    if (CELL_TEXT(r,c) != ' ' `7C`7C CELL_ATTR(r,c))
X`09`09MARK_CELL_DIRTY(r,c);
X    `7D
X`7D
X
X
Xstatic void
Xwait_for_scroll(
X    TextWindow  tw)
X`7B
X    XEvent      ev;
X    int         sc,
X        \0808sr;
X    unsigned    ec,
X        \0808er;
X    XGraphicsExposeEvent *gev;
X
X    for_ever `7B`09`09/* loop looking for a gfx expose or no\0D08*/
X`09if (XCheckTypedEvent(dpy, NoExpose, `26ev))
X`09    return;
X`09if (XCheckTypedEvent(dpy, GraphicsExpose, `26ev)) `7B
X`09    gev = (XGraphicsExposeEvent *) `26 ev;
X`09    sc = gev->x / tw->char_width;
X`09    sr = gev->y / tw->char_height;
X`09    ec = CEIL(gev->x + gev->width,  tw->char_width);
X`09    er = CEIL(gev->y + gev->height, tw->char_\1106);
X`09    x_touch(tw, sc, sr, ec, er);
X`09    if (gev->count == 0)
X`09`09return;
X`09`7D
X`09XSync(dpy, False);
X    `7D
X`7D
X
X
Xstatic void
Xx_scroll(
X    int from,
X    int to,
X    int count)
X`7B
X    if (cur_win->visibility == V\0E09FullyObscured)
X`09return;`09`09`09/* Why bother? */
X
X    if (from == to)
X`09return;`09`09`09/* shouldn't happen */
X
X    XCopyArea(dpy, cur_win->win\0E0E\1C0Btextgc,
X`09      x_pos(cur_win, 0), y\130Efrom),
X`09      x_width(cur_win), (unsigned)(count * \1D07->char_height),
X`09      x_pos(cur_win, 0), y\130Eto));
X    if (from < to)
+-+-+-+-+-+-+-+-  END  OF PART 130 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 131 -+-+-+-+-+-+-+-+
X`09XClearArea(dpy, cur_win->win,
X        `09x_pos(cur_win, 0), y\130Dfrom),
X`09`09x_width(cur_win), (unsigned)((to-from) * \2107->char_height),
X`09`09FALSE);
X    else
X`09XClearArea(dpy, cur_win->win,
X        `09x_pos(cur_win, 0), y\130Dto+count),
X`09`09x_width(cur_win), (unsigned)((from-to) * \2107->char_height),
X`09`09FALSE);
X    if (cur_win->visibility == V\0E09PartiallyObscured) `7B
X`09XFlush(dpy);
X`09wait_for_scroll(cur_win);
X    `7D
X`7D
X
X/*
X * The X protocol request for clearing a rectangle (PolyFillR\1308) takes
X * 20 bytes.  It will therefore be more expensive to switch from drawing text
V
X * to filling a rectangle unless the area to be cleared is bigger than 20
X * spaces.  Actually it is worse than this if we are going to switch
X * immediately to drawing text again since we incur a certain overhead
X * (16 bytes) for each string to be displayed.  This is how the value of
X * CLEAR_THRESH was computed (36 = 20+16).
X *
X * Kev's opinion:  If XDrawImageString is to be called, it is hardly ever
X * worth it to call XFillRectangle.  The only time where it will be a big
X * win is when the entire area to update is all spaces (in which case
X * XDrawImageString will not be called).  The following code would be much
X * cleaner, simpler, and easier to maintain if we were to just call
X * XDrawImageString where there are non-spaces to be written and
X * XFillRectangle when the entire region is to be cleared.
X */
X#define`09CLEAR_THRESH`0936
X
Xstatic void
Xflush_line(
X    char  *text,
X    int`09   len,
X    unsigned int attr,
X    int`09   sr,
X    int`09   sc)
X`7B
X    GC`09fore_gc;
X    GC`09back_gc;
X    int`09fore_yy = text_y_pos(cur_win, sr);
X    int`09back_yy = y_pos(cur_win, sr);
X    char *p;
X    int   cc, tlen, i, startcol;
X    int   fontchanged = FALSE;
X
X    if (attr == 0) `7B`09/* This is the most common case, so we list it first
V */
X`09fore_gc = cur_win->textgc;
X`09back_gc = cur_win->reversegc;
X    `7D
X    else if (attr `26 VACURS) `7B
X`09fore_gc = cur_win->cursgc;
X`09back_gc = cur_win->revcursgc;
X`09attr `26= `7EVACURS;
X    `7D
X    else if (attr `26 VASEL) `7B
X`09fore_gc = cur_win->selgc;
X`09back_gc = cur_win->revselgc;
X    `7D
X    else if (attr `26 VAMLFOC)
X`09fore_gc = back\0A06cur_win->modeline_focus_gc;
X    else if (attr `26 VAML)
X`09fore_gc = back\0A06cur_win->modeline_gc;
X    else if (attr `26 (VACOLOR)) `7B
X`09fore_gc = cur_win->colors_fgc`5BVCOLORNUM(attr)`5D;
X`09back_gc = cur_win->colors_bgc`5BVCOLORNUM(attr)`5D;
X    `7D
X    else `7B
X`09fore_gc = cur_win->textgc;
X`09back_gc = cur_win->reversegc;
X    `7D
X
X    if (attr `26 (VAREV `7C VACURS)) `7B
X`09GC tmp_gc = fore_gc;
X`09fore_gc = back_gc;
X`09back_gc = tmp_gc;
X    `7D
X
X    if (attr `26 (VABOLD `7C VAITAL)) `7B
X`09XFontStruct *fsp = NULL;
X`09if ((attr `26 (VABOLD `7C VAITAL)) ==\1614`7B
X`09    if (!(cur_win->fsrch_flags `26 FSRCH_BOLDITAL)) `7B
X`09`09if ((fsp = alternate_font("bold","i")) != NULL
X`09         `7C`7C (fsp = alternate_font("bold","o")) != NULL)
X`09`09    cur_win->pfont_boldital = fsp;
X`09`09cur_win->fsrch_flags `7C= FSRCH_BOLDITAL;
X`09    `7D
X`09    if (cur_win->pfont_boldital != NULL) `7B
X`09`09XSetFont(dpy, fore_gc, cur_win->pfont_boldital->fid);
X`09`09fontchanged = TRUE;
X`09`09attr `26= `7E(VABOLD `7C VAITAL);`09/* don't use fallback */
X`09    `7D
X`09    else
X`09`09goto tryital;
X`09`7D
X`09else if (attr `26 VAITAL) `7B
Xtryital:
X`09    if (!(cur_win->fsrch_flags `26 FSRCH_ITAL)) `7B
X`09`09if ((fsp = alternate_font((char *)0,"i")) != NULL
X`09         `7C`7C (fsp = alternate_font((char *)0,"o")) != NULL)
X`09`09    cur_win->pfont_ital = fsp;
X`09`09cur_win->fsrch_flags `7C= FSRCH_ITAL;
X`09    `7D
X`09    if (cur_win->pfont_ital != NULL) `7B
X`09`09XSetFont(dpy, fore_gc, cur_win->pfont_ital->fid);
X`09`09fontchanged = TRUE;
X`09`09attr `26= `7EVAITAL;&0209/* don't use fallback */
X`09    `7D
X`09    else if (attr `26 VABOLD)
X`09`09goto trybold;
X`09`7D
X`09else if (attr `26 VABOLD) `7B
Xtrybold:
X`09    if (!(cur_win->fsrch_flags `26 FSRCH_BOLD)) `7B
X`09`09cur_win->pfont_bold = alternate_font("bold",NULL);
X`09`09cur_win->fsrch_flags `7C= FSRCH_BOLD;
X`09    `7D
X`09    if (cur_win->pfont_bold != NULL) `7B
X`09`09XSetFont(dpy, fore_gc, cur_win->pfont_bold->fid);
X`09`09fontchanged = TRUE;
X`09`09attr `26= `7EVABOLD;&0209/* don't use fallback */
X`09    `7D
X`09`7D
X    `7D
X
X    /* break line into TextStrings and FillRects */
X    p = (char *)text;
X    cc = 0;
X    tlen = 0;
X    startcol = sc;
X    for (i = 0; i < len; i++) `7B
X`09if (text`5Bi`5D == ' ') `7B
X`09    cc++;
X`09    tlen++;
X`09`7D else `7B
X`09    if (cc >= CLEAR_THRESH) `7B
X`09`09tlen -= cc;
X`09`09XDrawImageString(dpy, cur_win->win, fore_gc,
X`09`09&0209 (int)x_pos(cur_win, sc), fore_yy,
X`09`09&0209 p, tlen);
X`09`09if (attr `26 VABOLD)
X`09`09    XDrawString(dpy, cur_win->win, fore_gc,
X`09`09&0209(int)x_pos(cur_win, sc)+1, fore_yy,
X`09`09&0209 p, tlen);
X`09`09p += tlen + cc;
X`09`09sc += tlen;
X`09`09XFillRectangle(dpy, cur_win->win, back_gc,
X`09`09`09       x_pos(cur_win, sc), back_yy,
X`09`09`09       (unsigned)(cc * cur_win->char_width),
X`09`09`09       (unsigned)(cur_win->char_height));
X`09`09sc += cc;
X`09`09tlen = 1;`09/* starting new run */
X`09    `7D else
X`09`09tlen++;
X`09    cc = 0;
X`09`7D
X    `7D
X    if (cc >= CLEAR_THRESH) `7B
X`09tlen -= cc;
X`09XDrawImageString(dpy, cur_win->win, fore_gc,
X`09`09`09 x_pos(cur_win, sc), fore_yy,
X`09`09`09 p, tlen);
X`09if (attr `26 VABOLD)
X`09    XDrawString(dpy, cur_win->win, fore_gc,
X`09`09`09(int)x_pos(cur_win, sc)+1, fore_yy,
X`09`09`09 p, tlen);
X`09sc += tlen;
X`09XFillRectangle(dpy, cur_win->win, back_gc,
X`09`09       x_pos(cur_win, sc), back_yy,
X`09`09       (unsigned)(cc * cur_win->char_width),
X`09`09       (unsigned)(cur_win->char_height));
X    `7D else if (tlen > 0) `7B
X`09XDrawImageString(dpy, cur_win->win, fore_gc,
X`09`09`09 x_pos(cur_win, sc), fore_yy,
X`09`09`09 p, tlen);
X`09if (attr `26 VABOLD)
X`09    XDrawString(dpy, cur_win->win, fore_gc,
X`09`09`09(int)x_pos(cur_win, sc)+1, fore_yy,
X`09`09`09 p, tlen);
X    `7D
X    if (attr `26 (VAUL `7C VAITAL)) `7B
X`09fore_yy += cur_win->char_descent - 1;
X`09XDrawLine(dpy, cur_win->win, fore_gc,
X`09          x_pos(cur_win, startcol), fore_yy,
X`09`09  x_pos(cur_win, startcol + len) - 1, fore_yy);
X    `7D
X
X    if (fontchanged)
X`09XSetFont(dpy, fore_gc, cur_win->pfont->fid);
X`7D
X
X
X/* See above comment regarding CLEAR_THRESH */
X#define NONDIRTY_THRESH 16
X
X/* make sure the screen looks like we want it to */
Xstatic void
Xx_flush(void)
X`7B
X    int r, c, sc, ec, cleanlen;
X    VIDEO_ATTR attr;
X
X    if (cur_win->visibility == V\0E09FullyObscured `7C`7C !\3309exposed)
X`09return;`09`09/* Why bother? */
X
X    /*
X     * Write out cursor _before_ rest of the screen in order to avoid
X     * flickering / winking effect noticable on some display servers.  This
X     * means that the old cursor position (if different from the current
X     * one) will be cleared after the new cursor is displayed.
X     */
X
X    if (ttrow >=0 `26`26 \0D06< term.t_nrow &0226 ttcol >= \2507col \250Acol
X     `26`26 !cur_win->wipe_permitted) `7B
X`09CLEAR_CELL_DIRTY(ttrow, ttcol);
X`09display_cursor((XtPointer) 0, (XtIntervalId *) 0);
X    `7D
X
X    /* sometimes we're the last to know about resizing...*/
X    if (cur_win->rows > term.t_mrow)
X    `09cur_win->rows = term.t_mrow;
X
X    for (r = 0; r < cur_win->rows; r++) `7B
X`09if (!IS_DIRTY_LINE(r))
X`09    continue;
X`09if (r !=  ttrow)
X`09    CLEAR_LINE_DIRTY(r);
X
X`09/*
X`09 * The following code will cause monospaced fonts with ink outside
X`09 * the bounding box to be cleaned up.
X`09 */
X`09if (cur_win->left_ink `7C`7C \1509right_ink)
X`09    for (c=0; c < term.t_ncol; ) `7B
X`09`09while (c < term.t_ncol `26`26 !IS_DIRTY(r,c))
X`09`09    c++;
X`09`09if (c >= term.t_ncol)
X`09`09    break;
X`09`09if (cur_win->left_ink `26`26 c > 0)
X`09`09    MARK_CELL_DIRTY(r,c-1);
X`09`09while (c < term.t_ncol `26`26 IS_DIRTY(r,c))
X`09`09    c++;
X`09`09if (cur_win->right_ink `26`26 c < term.t_ncol) `7B
X`09`09    MARK_CELL_DIRTY(r,c);
X`09`09    c++;
X`09`09`7D
X`09    `7D
X
X`09c = 0;
X`09while (c < term.t_ncol) `7B
X`09    /* Find the beginning of the next dirty sequence */
X`09    while (c < term.t_ncol `26`26 !IS_DIRTY(r,c))
X`09`09c++;
X`09    if (c >= term.t_ncol)
X`09`09break;
X`09    if (r == ttrow `26`26 c\0E06col &0226 !cur_win->wipe_permitted) `7B
X`09`09c++;
X`09`09continue;
X`09    `7D
X`09    CLEAR_CELL_DIRTY(r,c);
X`09    sc = ec = c;
X`09    attr = VATTRIB(CELL_ATTR(r,c));
X`09    cleanlen = NONDIRTY_THRESH;
X`09    c++;
X`09    /*
X`09     * Scan until we find the end of line, a cell with a different
X`09     * attribute, a sequence of NONDIRTY_THRESH non-dirty chars, or
X`09     * the cursor position.
X`09     */
X`09    while (c < term.t_ncol) `7B
X`09`09if (attr != VATTRIB(CELL_ATTR(r,c)))
X`09`09    break;
X`09`09else if (r == ttrow `26`26 c\0E06col &0226 !cur_win->wipe_permitted) `7B
V
X`09`09    c++;
X`09`09    break;
X`09`09`7D
X`09`09else if (IS_DIRTY(r,c)) `7B
X`09`09    ec = c;
X`09`09    cleanlen = NONDIRTY_THRESH;
X`09`09    CLEAR_CELL_DIRTY(r,c);
X`09`09`7D
X`09`09else if (--cleanlen <= 0)
X`09`09    break;
X`09`09c++;
X`09    `7D
X`09    /* write out the portion from sc thru ec */
X`09    flush_line(`26CELL_TEXT(r,sc), ec-sc+1,
X`09        \0807(unsigned int) VATTRIB(CELL_ATTR(r,sc)), r, sc);
X`09`7D
X    `7D
X    XFlush(dpy);
X`7D
X
X
X/* selection processing stuff */
X
X/* multi-click code stolen from xterm */
X/*
X * double click table for cut and paste in 8 bits
X *
X * This table is divided in four parts :
X *
X *`09- control characters`09`5B0,0x1f`5D U `5B0x80,0x9f`5D
X *`09- separators`09`09`5B0x20,0x3f`5D U `5B0xa0,0xb9`5D
X *`09- binding characters`09`5B0x40,0x7f`5D U `5B0xc0,0xff`5D
X *  `09- exceptions
X */
Xstatic int  charClass`5B256`5D = `7B
X/* NUL  SOH  STX  ETX  EOT  ENQ  ACK  BEL */
X    32, 1, 1\0606\0C0A
X/*  BS   HT   NL   VT   NP   CR   SO   SI */
X    1, 32, 1, 1, \06061, 1,
X/* DLE  DC1  DC2  DC3  DC4  NAK  SYN  ETB */
X    1, 1,\0606\0C0C
X/* CAN   EM  SUB  ESC   FS   GS   RS   US */
X    1, 1,\0606\0C0C
X/*  SP    !    "    #    $    %    `26    ' */
X    32, 33, 34, 35, 36, 37, 38, 39,
X/*   (    )    *    +    ,    -    .    / */
X    40, 41, 42, 43, 44, 45, 46, 47,
X/*   0    1    2    3    4    5    6    7 */
X    48, 48,\0808\1010
X/*   8    9    :    ;    <    =    >    ? */
X    48, 48, 58, 59, 60, 61, 62, 63,
X/*   @    A    B    C    D    E    F    G */
X    64, 48, 48\0808\100D
X/*   H    I    J    K    L    M    N    O */
X    48, 48,\0808\1010
X/*   P    Q    R    S    T    U    V    W */
X    48, 48,\0808\1010
X/*   X    Y    Z    `5B    `5C    `5D    `5E    _ */
X    48, 48, 48, 91, 92, 93, 94, 48,
X/*   `60    a    b    c    d    e    f    g */
X    96, 48, 48\0808\100D
X/*   h    i    j    k    l    m    n    o */
X    48, 48,\0808\1010
X/*   p    q    r    s    t    u    v    w */
X    48, 48,\0808\1010
X/*   x    y    z    `7B    `7C    `7D    `7E  DEL */
X    48, 48, 48, 123, 124, 125, 126, 1,
X/* x80  x81  x82  x83  IND  NEL  SSA  ESA */
X    1, 1,\0606\0C0C
X/* HTS  HTJ  VTS  PLD  PLU   RI  SS2  SS3 */
X    1, 1,\0606\0C0C
X/* DCS  PU1  PU2  STS  CCH   MW  SPA  EPA */
X    1, 1,\0606\0C0C
X/* x98  x99  x9A  CSI   ST  OSC   PM  APC */
X    1, 1,\0606\0C0C
X/*   -    i   c/    L   ox   Y-    `7C   So */
X    160, 161, 162, 163, 164, 165, 166, 167,
X/*  ..   c0   ip   <<    _        R0    - */
X    168, 169, 170, 171, 172, 173, 174, 175,
X/*   o   +-    2    3    '    u   q`7C    . */
X    176, 177, 178, 179, 180, 181, 182, 183,
X/*   ,    1    2   >>  1/4  1/2  3/4    ? */
X    184, 185, 186, 187, 188, 189, 190, 191,
X/*  A`60   A'   A`5E   A`7E   A:   Ao   AE   C, */
X    48, 48,\0808\1010
X/*  E`60   E'   E`5E   E:   I`60   I'   I`5E   I: */
X    48, 48,\0808\1010
X/*  D-   N`7E   O`60   O'   O`5E   O`7E   O:    X */
X    48, 48,\0808\100D216,
X/*  O/   U`60   U'   U`5E   U:   Y'    P    B */
X    48, 48,\0808\1010
X/*  a`60   a'   a`5E   a`7E   a:   ao   ae   c, */
X    48, 48,\0808\1010
X/*  e`60   e'   e`5E   e:    i`60  i'   i`5E   i: */
X    48, 48,\0808\1010
X/*   d   n`7E   o`60   o'   o`5E   o`7E   o:   -: */
X    48, 48,\0808\100D248,
X/*  o/   u`60   u'   u`5E   u:   y'    P   y: */
X48, 48, \0808\100E`7D;
X
Xstatic int
Xset_character_class_range(
X    register int low,
X    register int high,`09`09/* in range of `5B0..255`5D */
X    register int value)`09`09/* arbitrary */
X`7B
X
X    if (low < 0 `7C`7C high > 255\0E09< low)
X`09return (-1);
X
X    for (; low <= high; low++)
X`09charClass`5Blow`5D = value;
X
X    return (0);
X`7D
X
X
X/*
X * set_character_class - takes a string of the form
X *
X *        \0808 low`5B-high`5D:val`5B,\100F...`5D`5D
X *
X * and sets the indicated ranges to\180Fvalues.
X */
X
Xstatic int
Xset_character_class(register char *s)
X`7B
X    register int i;`09`09/* iterator, index into s */
X    int         len;`09`09/* length of s */
X    int         acc;`09`09/* accumulator */
X    int         low,
X        \0808high;`09`09/* bounds of range `5B0..127`5D */
X    int         base;`09`09/* 8, 10, 16 (octal, decimal, hex) */
X    int         numbers;`09/* count of\1508 per range */
X    int         digits;`09`09/* count of\1507 in a number */
X    static char *errfmt = "xvile:  %s in range string `5C"%s`5C" (position %d)
V`5Cn";
X
X    if (!s `7C`7C !s`5B0`5D)
X`09return -1;
X
X    base = 10;`09`09`09/* in case we ever add octal, hex */
X    low = high = -1;`09`09/* out of range */
X
X    for (i = 0, len = strlen(s), acc\1A06numbers = digits = 0;
X`09    i < len; i++) `7B
X`09int        c = s`5Bi`5D;
X
X`09if (isSpace(c)) `7B
X`09    continue;
X`09`7D else if (isDigit(c)) `7B
X`09    acc = acc * base + (c - '0');
X`09    digits++;
X`09    continue;
X`09`7D else if (c == '-') `7B
X`09    low = acc;
X`09    acc = 0;
X`09    if (digits == 0) `7B
X`09`09(void)fprintf(stderr, errfmt, "missing number", s, i);
X`09`09return (-1);
X`09    `7D
X`09    digits = 0;
X`09    numbers++;
X`09    continue;
X`09`7D else if (c == ':') `7B
X`09    if (numbers == 0)
X`09`09low = acc;
X`09    else if (numbers == 1)
X`09`09high = acc;
X`09    else `7B
X`09`09(void)fprintf(stderr, errfmt, "too many numbers",
X`09`09`09s, i);
X`09`09return (-1);
X`09    `7D
X`09    digits = 0;
X`09    numbers++;
X`09    acc = 0;
X`09    continue;
X`09`7D else if (c == ',') `7B
X`09    /*
X`09     * now, process it
X`09     */
X
X`09    if (high < 0) `7B
X`09`09high = low;
X`09`09numbers++;
X`09    `7D
X`09    if (numbers != 2) `7B
X`09`09(void)fprintf(stderr, errfmt, "bad value number",
X`09`09`09s, i);
X`09    `7D else if (set_character_class_range(low, high, acc) != 0) `7B
X`09`09(void)fprintf(stderr, errfmt, "bad range", s, i);
X`09    `7D
X`09    low = high = -1;
X`09    acc = 0;
X`09    digits = 0;
X`09    numbers = 0;
X`09    continue;
X`09`7D else `7B
X`09    (void)fprintf(stderr, errfmt, "bad character", s, i);
X`09    return (-1);
X`09`7D`09`09`09/* end if else if ...\0C06*/
X
X    `7D
X
X    if (low < 0 `26`26 high < 0)
X`09return (0);
X
X    /*
X     * now, process it
X     */
X
X    if (high < 0)
X`09high = low;
X    if (numbers < 1 `7C`7C \0F08> 2) `7B
X`09(void)fprintf(stderr, errfmt, "bad value number", s, i);
X    `7D else if (set_character_class_range(low, high, acc) != 0) `7B
X`09(void)fprintf(stderr, errfmt, "bad range", s, i);
X    `7D
X    return (0);
X`7D
X
X/*
X * Copy a single character into the paste-buffer, quoting it if necessary
X */
Xstatic int
Xadd2paste(
XTBUFF`09**p,
Xint`09c)
X`7B
X`09if (c == '`5Cn' `7C`7C isBlank(c))
X`09`09/*EMPTY*/;
X`09else if (isspecial(c) `7C`7C (c == '`5Cr') &027C !isPrint(c))
X`09 `09(void)tb_append(p, quotec);
X`09return (tb_append(p, c) != 0);
X`7D
X
X/*
X * Copy the selection into the PasteBuf buffer.  If we are pasting\2D06a
X * window, check to see if:
X *
X *`09+ the window's buffer is modifiable (if not, don't waste time copying
X *`09  text!)
X *`09+ the buffer uses 'autoindent' mode (if so, do some heuristics
X *`09  for placement of the pasted text -- we may put it on lines by
X *`09  itself, above or below the current line)
X */
X#define OLD_PASTE 0
X
Xstatic int
Xcopy_paste(
XTBUFF`09**p,
Xchar`09*value,
XSIZE_T`09length)
X`7B
X`09WINDOW`09*wp = row2window(ttrow);
X`09BUFFER`09*bp = (wp != 0) ? wp->w_bufp : 0;
X`09int`09status;
X
X`09if (bp != 0 `26`26 b_val(bp,MDVIEW))
X`09`09return FALSE;
X
X`09status = TRUE;
X
X`09if (bp != 0 `26`26 (is_c_mode(bp) `7C`7C b_val(bp,MDAIND))) `7B
X
X#if OLD_PASTE
X`09`09/*
X`09`09 * If the cursor points before the first nonwhite on
X`09`09 * the line, convert the insert into an 'O' command.
X`09`09 * If it points to the end of the line, convert it into
X`09`09 * an 'o' command.  Otherwise (if it is within the
X`09`09 * nonwhite portion of the line), assume the user knows
X`09`09 * what (s)he is doing.
X`09`09 */
X#endif
X`09`09if (setwmark(ttrow, ttcol)) `7B`09/* MK gets cursor */
X#if OLD_PASTE
X`09`09`09LINE`09*lp`09= MK.l;
X`09`09`09int`09first   = firstchar(lp);
X`09`09`09int`09last    = lastchar(lp);
X`09`09`09CMDFUNC`09*f = 0;
X
X`09`09`09/* If the line contains only a single nonwhite,
X`09`09`09 * we will insert before it.
X`09`09`09 */
X`09`09`09if (first >= MK.o)
X`09`09&0209f = `26f_openup_no_aindent;
X`09`09`09else if (last <= MK.o)
X`09`09&0209f = `26f_opendown_no_aindent;
X`09`09`09if (insertmode) `7B
X`09`09&0209if ((*value != '`5Cn') `26`26 MK.o == 0)
X`09`09&0209`09(void)tb_append(p, '`5Cn');
X`09`09`09`7D
X`09`09`09else if (f) `7B
X`09`09`09    `09char *pstr;
X`09`09&0209/* we're _replacing_ the default
X`09`09&0209`09insertion command, so reinit */
X`09`09&0209tb_init(p, abortc);
X`09`09&0209pstr = fnc2pstr(f);
X`09`09&0209tb_bappend(p, pstr + 1, (ALLOC_T) *pstr);
X`09`09`09`7D
X#endif
X`09`09`7D
X`09`7D
X
X`09while (length-- > 0) `7B
X`09`09if (!add2paste(p, *value++)) `7B
X`09`09`09status = FALSE;
X`09`09`09break;
X`09`09`7D
X`09`7D
X
X`09return status;
X`7D
X
X/* ARGSUSED */
Xstatic void
Xx_get_selection(
X    Widget         w GCC_UNUSED,
X    XtPointer      cldat GCC_UNUSED,
X    Atom          *selection,
X    Atom          *type,
X    XtPointer      value,
X    unsigned long *length,
X    int           *format)
X`7B
X    int`09do_ins;
X
X    if (*format != 8 `7C`7C *type != XA_STRING) `7B
X`09x_beep();`09`09`09/* can't handle incoming data */
X`09return;
X    `7D
X
X    if (length != 0 `26`26 value != NULL) `7B
X`09char *s = NULL;`09`09`09/* stifle warning */
X`09/* should be impossible to hit this with existing paste */
X`09/* XXX massive hack -- leave out 'i' if in prompt line */
X`09do_ins = !insertmode
X`09`09`26`26 (!onMsgRow(cur_win) `7C`7C *selection == atom_CLIPBOARD)
X`09`09`26`26 ((s = fnc2pstr(`26f_insert_no_aindent)) != NULL);
X
X`09if (tb_init(`26PasteBuf, abortc)) `7B
X`09`09if ((do_ins `26`26 !tb_bappend(`26PasteBuf, s+1, (ALLOC_T)*s))
X`09`09 `7C`7C !copy_paste(`26PasteBuf, (char *)value, (SIZE_T) *length)
X`09`09 `7C`7C (do_ins `26`26 !tb_append(`26PasteBuf, abortc)))
X`09`09`09tb_free(`26PasteBuf);
X`09`7D
X`09XtFree((char *)value);
X    `7D
X`7D
X
Xstatic void
Xx_paste_selection(Atom \0F09)
X`7B
X    if (cur_win->have_selection `26`26 \0D0A== XA_PRIMARY) `7B
X`09/* local transfer */
X`09UCHAR  *data;
X`09SIZE_T len_st;
X`09unsigned long len_ul;
X
X`09Atom`09type      = XA_STRING;
X`09int`09format    = 8;
X
X`09if (!x_get_selected_text(`26data, `26len_st)) `7B
X`09    x_beep();
X`09    return;
X`09`7D
X`09len_ul = (unsigned long) len_st;`09/* Ugh. */
X`09x_get_selection(cur_win->top_widget, NULL, `26\2609, `26type,
X`09        \0808(XtPointer) data, `26len_ul, `26format);
X    `7D
X    else `7B
X`09XtGetSelectionValue(
X`09    cur_win->top_widget,
X`09    selection,
X`09    XA_STRING,
X`09    x_get_selection,
X`09    (XtPointer)0,`09`09/* client data */
X`09    XtLastTimestampProcessed(dpy));
X    `7D
X`7D
X
Xstatic Boolean
Xx_get_selected_text(
X    UCHAR **datp,
X    SIZE_T *lenp)
X`7B
X    UCHAR`09*data = 0;
X    UCHAR`09*dp = 0;
X    SIZE_T`09length;
X    KILL`09*kp;`09`09/* pointer into kill register */
X
X    /* FIXME: Can't select message line */
X
X    if (!cur_win->have_selection)
X`09return False;
X
X    sel_yank(SEL_KREG);
X    for (length = 0, kp = kbs`5BSEL_KREG`5D.kbufh; kp; kp = kp->d_next)
X`09length += KbSize(SEL_KREG, kp);
X    if ( length == 0
X      `7C`7C (dp = data = (UCHAR *) XtMalloc(length * sizeof\2206))) == 0
X      `7C`7C (kp = kbs`5BSEL_KREG`5D.kbufh) == 0)
X`09return False;
X
X    while (kp != NULL) `7B
X`09SIZE_T len = KbSize(SEL_KREG,kp);
X`09(void)memcpy((char *)dp, \0C08kp->d_chunk, len);
X`09kp = kp->d_next;
X`09dp += len;
X    `7D
X
X    *lenp = length;
X    *datp = data;
X    return True;
X`7D
X
Xstatic Boolean
Xx_get_clipboard_text(
X    UCHAR **datp,
X    SIZE_T *lenp)
X`7B
X    UCHAR`09*data = 0;
X    UCHAR`09*dp = 0;
X    SIZE_T`09length;
X    KILL`09*kp;`09`09/* pointer into kill register */
X
X    for (length = 0, kp = kbs`5BCLIP_KREG`5D.kbufh; kp; kp = kp->d_next)
X`09length += KbSize(CLIP_KREG, kp);
X    if ( length == 0
X      `7C`7C (dp = data = (UCHAR *) XtMalloc(length * sizeof\2206))) == 0
X      `7C`7C (kp = kbs`5BCLIP_KREG`5D.kbufh) == 0)
X`09return False;
X
X    while (kp != NULL) `7B
X`09SIZE_T len = KbSize(CLIP_KREG,kp);
X`09(void)memcpy((char *)dp, \0C08kp->d_chunk, len);
X`09kp = kp->d_next;
X`09dp += len;
X    `7D
X
X    *lenp = length;
X    *datp = data;
X    return True;
X`7D
X
X/* ARGSUSED */
Xstatic Boolean
Xx_convert_selection(
X    Widget`09   w GCC_UNUSED,
X    Atom          *selection,
X    Atom          *target,
X    Atom          *type,
X    XtPointer     *value,
X    unsigned long *length,
X    int           *format)
X`7B
X    if (!cur_win->have_selection `26`26 *\0E0A== XA_PRIMARY)
X`09return False;
X
X    /*
X     * The ICCCM requires us to handle the following targets: TARGETS,
X     * MULTIPLE, and TIMESTAMP.  \1A08\190E are handled by
X     * the Xt intrinsics.  Below, we handle TARGETS, STRING, and TEXT.
X     * The STRING and TEXT targets are what xvile uses to transfer
X     * selected text to another client.  TARGETS is simply a list of
X     * the targets we support (including the ones handled by the Xt
X     * intrinsics).
X     */
X
X    if (*target == atom_TARGETS) `7B
X`09Atom *tp;
X
X#define NTARGS 5
X
X`09*(Atom **)value = tp = \1607)XtMalloc(NTARGS * sizeof(Atom));
X
X`09if (tp == NULL)
X`09    return False;`09/* should not happen (even if out of memory) */
X
X`09*tp++ = atom_TARGETS;
X`09*tp++ = atom_MULTIPLE;
X`09*tp++ = atom_TIMESTAMP;
X`09*tp++ = XA_STRING;
X`09*tp++ = atom_TEXT;
X
X`09*type   = XA_ATOM;
X`09*length = tp - *(Atom **)value;
X`09*format = 32;`09`09/* width of the data being transfered */
X`09return True;
X    `7D
X    else if (*target == XA_STRING `7C`7C \180Batom_TEXT) `7B
X`09*type   = XA_STRING;
X`09*format = 8;
X`09if (*selection == XA_PRIMARY)
X`09    return x_get_selected_text((UCHAR **)value, (SIZE_T *)length);
X`09else`09/* CLIPBOARD */
X`09    return x_get_clipboard_text((UCHAR **)value, (SIZE_T *)length);
X    `7D
X
X    return False;
X`7D
X
X/* ARGSUSED */
Xstatic void
Xx_lose_selection(
X    Widget w GCC_UNUSED,
X    Atom  *selection)
X`7B
X    if (*selection == XA_PRIMARY) `7B
X`09cur_win->have_selection = False;
X`09cur_win->was_on_msgline = False;
X`09sel_release();
X`09(void) update(TRUE);
X    `7D
X    else `7B
X`09/* Free up the data in the kill buffer (how do we do this?) */
X    `7D
X`7D
X
Xvoid own_selection(void)
X`7B
X    x_own_selection(XA_PRIMARY);
X`7D
X
Xstatic void
Xx_own_selection(Atom \0F09)
X`7B
X    /*
X     * Note:  we've been told that the Hummingbird X Server (which runs on a
X     * PC) updates the contents of\1006lipboard only if we remove the next
X     * line, causing this program to assert the selection on each call.  We
X     * don't do that, however, since it would violate the sense of the ICCCM,
V
X     * which is minimizing network traffic.
X     *
X     * Kev's note on the above comment (which I assume was written by Tom):
X     * I've added some new code for dealing with clipboards in now.  It
X     * may well be that the clipboard will work properly now.  Of course,
X     * you'll need to run the copy-to-clipboard command from vile.  If
X     * you're on a Sun keyboard, you might want to bind this to the Copy
X     * key (F16).  I may also think about doing a sort of timer mechanism
X     * which asserts ownership of the clipboard if a certain amount of
X     * time has gone by with no activity.
X     */
X    if (!cur_win->have_selection `7C`7C \0D0A!= XA_PRIMARY)
X`09cur_win->have_selection =
X`09    XtOwnSelection(
X`09`09cur_win->top_widget,
X`09`09selection,
X`09`09XtLastTimestampProcessed(dpy),
X`09`09x_convert_selection,
X`09`09x_lose_selection,
X`09`09(XtSelectionDoneProc)0);
X`7D
X
Xstatic void
Xscroll_selection(
X    XtPointer rowcol,
X    XtIntervalId *idp)
X`7B
X    int row, col;
X    if (*idp == cur_win->sel_scroll_id)
X`09XtRemoveTimeOut(cur_win->sel_scroll_id);`09/* shouldn't happen */
X    cur_win->sel_scroll_id = (XtIntervalId) 0;
X
X    row = (((long) rowcol) >> 16) `26 0xffff;
X    col = ((long) rowcol) `26 0xffff;
X    if (row `26 0x8000)
X`09row `7C= -1 << 16;
X    if (col `26 0x8000)
X`09col `7C= -1 << 16;
X    extend_selection(cur_win, row, col, TRUE);
X`7D
X
Xstatic int
Xline_count_and_interval(
X    long scroll_count,
X    unsigned long *ip)
X`7B
X    scroll_count =\0F0E/ 4 - 2;
X    if (scroll_count <= 0) `7B
X`09*ip = (1 - scroll_count) * cur_win->\1907repeat_interval;
X`09return 1;
X    `7D
X    else `7B
X`09/*
X`09 * FIXME: figure out a cleaner way to do this or something like it...
X`09 */
X`09if (scroll_count > 450)
X`09    scroll_count *= 1024;
X`09else if (scroll_count > 350)
X`09    scroll_count *= 128;
X`09else if (scroll_count > 275)
X`09    scroll_count *= 64;
X`09else if (scroll_count > 200)
X`09    scroll_count *= 16;
X`09else if (scroll_count > 150)
X`09    scroll_count *= 8;
X`09else if (scroll_count > 100)
X`09    scroll_count *= 4;
X`09else if (scroll_count > 75)
X`09    scroll_count *= 3;
X`09else if (scroll_count > 50)
X`09    scroll_count *= 2;
X`09*ip = cur_win->scroll_repeat_interval;
X`09return scroll_count;
X    `7D
X`7D
X
Xstatic void
Xextend_selection(
X    TextWindow tw GCC_UNUSED,
X    int`09nr,
X    int`09nc,
X    Bool wipe)
X`7B
X    static long scroll_count = 0;
X    long rowcol = 0;
X    unsigned long interval = 0;
X
X    if (cur_win->sel_scroll_id != (XtIntervalId) 0) `7B
X`09if (nr < curwp->w_toprow `7C`7C nr >= mode_row(curwp))
X`09    return;`09`09/* Only let timer extend selection */
X`09XtRemoveTimeOut(cur_win->sel_scroll_id);
X`09cur_win->sel_scroll_id = (XtIntervalId) 0;
X    `7D
X
X    if (nr < curwp->w_toprow) `7B
X`09if (wipe) `7B
X`09    mvupwind(TRUE, line_count_and_interval(scroll\1A06++, `26\1A08));
X`09    rowcol = (nr << 16) `7C (nc `26 0xffff);
X`09`7D
X`09else `7B
X`09    scroll_count = 0;
X`09`7D
X`09nr = curwp->w_toprow;
X    `7D
X    else if (nr >= mode_row(curwp)) `7B
X`09if (wipe) `7B
X`09    mvdnwind(TRUE, line_count_and_interval(scroll\1A06++, `26\1A08));
X`09    rowcol = (nr << 16) `7C (nc `26 0xffff);
X`09`7D
X`09else `7B
X`09    scroll_count = 0;
X`09`7D
X`09nr = mode_row(curwp) - 1;
X    `7D
X    else `7B
X`09scroll_count = 0;
X    `7D
X    if (setcursor(nr,nc) `26`26 sel_extend(wipe,TRUE)) `7B
X`09cur_win->did_select = True;
X`09(void)update(TRUE);
X`09if (scroll_count > 0) `7B
X`09    x_flush();
X`09    cur_win->sel_scroll_id = XtAppAddTimeOut(\2909app_context,
X`09        \0808\1010\200Dinterval,
X`09`09&0209&0209     scroll_selection,
X`09`09&0209&0209     (XtPointer) rowcol);
X`09`7D
X    `7D
X    else
X`09x_beep();
X`7D
X
Xstatic void
Xmulti_click(
X`09TextWindow  tw,
X`09int         nr,
X`09int         nc)
X`7B
X    UCHAR`09*p;
X    int`09cclass;
X    int`09sc = nc;
X    int oc = nc;
X    WINDOW`09*wp;
X
X    tw->numclicks++;
X
X    if ((wp = row2window(nr)) != 0 `26`26 nr == mode_row(wp)) `7B
X`09set_curwp(wp);
X`09sel_release();
X`09(void)update(TRUE);
X    `7D
X    else `7B
X`09switch (tw->numclicks) `7B
X`09case 0:
X`09case 1:`09`09`09/* shouldn't happen */
X`09`09mlwrite("BUG: 0 or 1 multiclick value.");
X`09`09return;
X`09case 2:`09`09`09/* word */
X#if OPT_HYPERTEXT
X`09`09if (setcursor(nr,nc) `26`26 exechypercmd(0,0)) `7B
X`09`09    (void) update(TRUE);
X`09`09    return;
X`09`09`7D
X#endif
X`09`09/* find word start */
X`09`09p = (UCHAR *)(`26CELL_TEXT(nr,sc));
X`09`09cclass = charClass`5B*p`5D;
X`09`09do `7B
X`09`09`09--sc;
+-+-+-+-+-+-+-+-  END  OF PART 131 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 132 -+-+-+-+-+-+-+-+
X`09`09`09--p;
X`09`09`7D while (sc >= 0 `26`26 charClass`5B*p`5D == cclass);
X`09`09sc++;
X`09`09/* and end */
X`09`09p = (UCHAR *)(`26CELL_TEXT(nr,nc));
X`09`09cclass = charClass`5B*p`5D;
X`09`09do `7B
X`09`09`09++nc;
X`09`09`09++p;
X`09`09`7D while (nc < tw->cols `26`26 charClass`5B*p`5D == cclass);
X`09`09--nc;
X
X`09`09if (setcursor(nr,sc)) `7B
X`09`09`09(void)sel_begin();
X`09`09`09extend_selection(tw, nr, nc, FALSE);
X`09`09`09(void) setcursor(nr,oc);
X`09`09`09/* FIXME: Too many updates */
X`09`09`09(void) update(TRUE);
X`09`09`7D
X`09`09return;
X`09case 3:`09`09`09/* line (doesn't include trailing newline) */
X`09`09if (setcursor(nr,sc)) `7B
X`09`09`09MARK saveDOT;
X`09`09`09saveDOT = DOT;
X`09`09`09(void) gotobol(0, 0);
X`09`09`09(void) sel_begin();
X`09`09`09(void) gotoeol(FALSE, 0);
X`09`09`09(void) sel_extend(FALSE,TRUE);
X`09`09`09DOT = saveDOT;
X`09`09`09cur_win->did_select = True;
X`09`09`09(void) update(TRUE);
X`09`09`7D
X`09`09return;
X`09default:
X`09`09/*
X`09`09 * This provides a mechanism for getting rid of the
X`09`09 * selection.
X`09`09 */
X`09`09sel_release();
X`09`09(void)update(TRUE);
X`09`09return;
X`09`7D
X    `7D
X`7D
X
Xstatic void
Xstart_selection(
X    TextWindow  tw,
X    XButtonPressedEvent *ev,
X    int`09nr,
X    int`09nc)
X`7B
X    tw->wipe_permitted = FALSE;
X    if ((tw->lasttime != 0)
X     `26`26 (absol(ev->time - tw->lasttime) < tw->click_timeout)) `7B
X`09/* FIXME: This code used to ignore multiple clicks which
X`09 *`09  spanned rows.  Do we still want this behavior?
X`09 *`09  If so, we'll have to (re)implement it.
X`09 */
X`09multi_click(tw, nr, nc);
X    `7D
X    else `7B
X`09WINDOW *wp;
X
X`09beginDisplay();
X
X`09tw->lasttime = ev->time;
X`09tw->numclicks = 1;
X`09tw->was_on_msgline = onMsgRow(tw);
X
X`09if ((wp = row2window(nr)) != 0) `7B
X`09    set_curwp(wp);
X`09`7D
X`09tw->prevDOT = DOT;
X
X`09/*
X`09 * If we're on the message line, do nothing.
X`09 *
X`09 * If we're on a mode line, make the window whose \2109\3606
X`09 * on the current window.
X`09 *
X`09 * Otherwise update the cursor position in whatever window we're
X`09 * in and set things up so that the current position can be the
X`09 * possible start of a selection.
X`09 */
X`09if (reading_msg_line) `7B
X`09    /*EMPTY*/;`09/* ignore */
X`09`7D
X`09else if (wp != 0 `26`26 nr == mode_row(wp)) `7B
X`09    (void)update(TRUE);
X`09`7D
X`09else if (setcursor(nr, nc)) `7B
X`09    if (!cur_win->persistent_selections) `7B
X`09`09sel_yank(SEL_KREG);
X`09`09sel_release();
X`09    `7D
X`09    (void) sel_begin();
X`09    (void)update(TRUE);
X`09    tw->wipe_permitted = TRUE;
X`09    /* force the editor to noti\1507changed DOT, if it cares */
X`09    kqadd(cur_win, KEY_Mouse);
X`09`7D
X`09endofDisplay();
X    `7D
X`7D
X
X/* this doesn't need to do anything.  it's invoked when we do
X`09shove KEY_Mouse back on the input stream, to force the
X`09main editor code to notice that DOT has moved. */
X/*ARGSUSED*/
Xint
Xmouse_motion(int f GCC_UNUSED, int n\120B)
X`7B
X`09return TRUE;
X`7D
X
X/*ARGSUSED*/
Xint
Xcopy_to_clipboard(int f GCC_UNUSED, int n\120B)
X`7B
X    if (!cur_win->have_selection) `7B
X`09x_beep();
X`09return FALSE;
X    `7D
X
X    sel_yank(CLIP_KREG);
X    x_own_selection(atom_CLIPBOARD);
X
X    return TRUE;
X`7D
X
X/*ARGSUSED*/
Xint
Xpaste_from_clipboard(int f GCC_UNUSED, int n\120B)
X`7B
X    x_paste_selection(atom_CLIPBOARD);
X    return TRUE;
X`7D
X
Xstatic XMotionEvent *
Xcompress_motion(
X    XMotionEvent *ev)
X`7B
X    XEvent      nev;
X
X    while (XPending(ev->display)) `7B
X`09XPeekEvent(ev->display, `26nev);
X`09if (nev.type == MotionNotify `26`26
X`09`09nev.xmotion.window == ev->\0E07`26`26
X`09`09nev.xmotion.subwindow == ev->\1109) `7B
X`09    XNextEvent(ev->display, (XEvent *) ev);
X`09`7D else
X`09    break;
X    `7D
X    return ev;
X`7D
X
X/*
X * handle non keyboard events associated with vile screen
X */
X/*ARGSUSED*/
Xstatic void
Xx_process_event(
X    Widget`09w GCC_UNUSED,
X    XtPointer`09unused GCC_UNUSED,
X    XEvent     *ev,
X    Boolean    *continue_to_dispatch GCC_UNUSED)
X`7B
X    int         sc,
X        \0808sr;
X    unsigned    ec,
X        \0808er;
X
X    int         nr,
X        \0808nc;
X    static int onr = -1, onc = -1;
X
X    XMotionEvent *mev;
X    XExposeEvent *gev;
X    Bool`09do_sel;
X    WINDOW`09*wp;
X
X    switch (ev->type) `7B
X    case Expose:
X`09gev = (XExposeEvent *)ev;
X`09sc = gev->x / cur_win->char_width;
X`09sr = gev->y / cur_win->char_height;
X`09ec = CEIL(gev->x + gev->width,  cur_win->char_width);
X`09er = CEIL(gev->y + gev->height, cur_win->char_\1606);
X`09x_touch(cur_win, sc, sr, ec, er);
X`09cur_win->exposed = TRUE;
X`09if (ev->xexpose.count == 0)
X`09`09x_flush();
X`09break;
X
X    case VisibilityNotify:
X`09cur_win->visibility = ev->x\120A.state;
X`09XSetGraphicsExposures(dpy, cur_win->textgc,
X`09`09`09      cur_win->visibility != V\0E09Unobscured);
X`09break;
X
X    case MotionNotify:
X`09do_sel = cur_win->wipe_permitted;
X`09if (!(ev->xmotion.state `26 (Button1Mask `7C \0E063Mask))) `7B
X`09    if (!cur_win->focus_follows_mouse)
X`09`09return;
X`09    else
X`09`09do_sel = FALSE;
X`09`7D
X`09mev = compress_motion((XMotionEvent *) ev);
X`09nc = mev->x / cur_win->char_width;
X`09nr = mev->y / cur_win->char_height;
X
X`09if (nr < 0)
X`09    nr = -1;`09/* want to be out of bounds to force scrolling */
X`09else if (nr > cur_win->rows)
X`09    nr = cur_win->rows;
X
X`09if (nc < 0)
X`09    nc = 0;
X`09else if (nc >= cur_win->cols)
X`09    nc = cur_win->cols-1;
X
X`09/* ignore any spurious motion during a multi-cick */
X`09if (cur_win->numclicks > 1
X`09 `26`26 cur_win->lasttime != 0
X         `26`26 (absol(ev->xmotion.time - cur_win->lasttime) <\150Aclick_timeo
Vut))
X`09    return;
X`09if (do_sel) `7B
X`09    if (ev->xbutton.state `26 ControlMask) `7B
X`09`09(void)sel_setshape(RECTANGLE);
X`09    `7D
X`09    if (nr != onr `7C`7C nc\0D06c)
X`09`09extend_selection(cur_win, nr, nc, True);
X`09    onr = nr;
X`09    onc = nc;
X`09`7D
X`09else `7B
X`09    if (!reading_msg_line `26`26 (wp = row2window(nr)) &0226 wp != curwp)`20
V`7B
X`09`09(void) set_curwp(wp);
X`09`09(void) update(TRUE);
X`09    `7D
X`09`7D
X`09break;
X    case ButtonPress:
X`09nc = ev->xbutton.x / cur_win->char_width;
X`09nr = ev->xbutton.y / cur_win->char_height;
X`09TRACE(("ButtonPress #%d (%d,%d)`5Cn", ev->xbutton.\0706, nr, nc))
X`09switch (ev->xbutton.\0706) `7B
X`09case Button1:`09`09/* move button and set selection point */
X`09    start_selection(cur_win, (XButtonPressedEvent *) ev, nr, nc);
X`09    onr = nr;
X`09    onc = nc;
X`09    break;
X`09case Button2:`09`09/* paste selection */
X`09    /*
X`09     * If shifted, paste at mouse.  Otherwise\1C0Bthe last
X`09     * position marked before beginning a selection.
X`09     */
X`09    if (ev->xbutton.state `26 ShiftMask) `7B
X`09`09if (!setcursor(nr, nc)) `7B
X`09`09    kbd_alarm();`09/* don't know how to paste here */
X`09`09    break;
X`09`09`7D
X`09    `7D
X`09    x_paste_selection(XA_PRIMARY);
X`09    break;
X`09case Button3:`09`09/* end/extend selection */
X`09    if (((wp = row2window(nr)) != 0) `26`26 sel_buffer() == wp->w_bufp)
X`09`09(void) set_curwp(wp);
X`09    if (ev->xbutton.state `26 ControlMask)
X`09`09(void)sel_setshape(RECTANGLE);
X`09    cur_win->wipe_permitted = True;
X`09    cur_win->prevDOT = DOT;
X`09    extend_selection(cur_win, nr, nc, False);
X`09    break;
X`09`7D
X`09break;
X    case ButtonRelease:
X`09TRACE(("ButtonRelease #%d (%d,%d)%s`5Cn",
X`09`09ev->xbutton.\0706,
X`09`09ev->xbutton.y / cur_win->char_height,
X`09`09ev->xbutton.x / cur_win->char_width,
X`09`09cur_win->did_select ? ": \100A" : ""))
X`09switch (ev->xbutton.\0706) `7B
X`09case Button1:
X`09    if (cur_win->persistent_selections)
X`09`09sel_yank(SEL_KREG);
X
X`09    /* FALLTHRU */
X`09case Button3:
X`09    if (cur_win->sel_scroll_id != ((XtIntervalId) 0)) `7B
X`09`09XtRemoveTimeOut(cur_win->sel_scroll_id);
X`09`09cur_win->sel_scroll_id = (XtIntervalId) 0;
X`09    `7D
X`09    if (cur_win->did_select `26`26 !\1809\1406ion_sets_DOT) `7B
X`09`09DOT = cur_win->prevDOT;
X`09`09(void)update(TRUE);
X`09    `7D
X`09    cur_win->did_select = False;
X`09    cur_win->wipe_permitted = False;
X`09    display_cursor((XtPointer) 0, (XtIntervalId *) 0);
X`09    break;
X`09`7D
X`09break;
X    `7D
X`7D
X
X/*ARGSUSED*/
Xstatic void
Xx_configure_window(
X    Widget`09w GCC_UNUSED,
X    XtPointer`09unused GCC_UNUSED,
X    XEvent     *ev,
X    Boolean    *continue_to_dispatch GCC_UNUSED)
X`7B
X    int nr, nc;
X    Dimension new_width, new_height;
X
X    if (ev->type != ConfigureNotify)
X`09return;
X
X    if (cur_win->base_width < 0) `7B
X`09/* First time through...figure out the base width and height */
X`09XtVaGetValues(cur_win->top_widget,
X`09`09XtNheight,`09`26cur_win->top_\1607
X`09`09XtNwidth,`09`26cur_win->top_width,
X`09`09NULL);
X#if ATHENA_WIDGETS
X`09XtVaGetValues(cur_win->menu_widget,
X`09`09XtNheight,`09`26cur_win->menu_\1707
X`09`09XtNwidth,`09`26new_\0C06
X`09`09NULL);
X#endif
X`09XtVaGetValues(cur_win->screen,
X`09`09XtNheight,`09`26new_\0D07
X`09`09XtNwidth,`09`26new_\0C06
X`09`09NULL);
X`09cur_win->base_width = \1609top\1507- new\2106;
X`09cur_win->base_height = \1709menu\1707;
X
X`09XtVaSetValues(cur_win->top_widget,
X#if XtSpecificationRelease >= 4
X`09`09XtNbaseHeight,`09cur_win->base_h\1606
X`09`09XtNbaseWidth,`09cur_win->base_width,
X#endif
X`09`09XtNminHeight,`09cur_win->base_height
X`09`09&0209    + MINROWS*cur_win->char_height,
X`09`09XtNminWidth,`09cur_win->base_width
X`09`09&0209    + MINCOLS*cur_win->char_width,
X`09`09XtNheightInc,`09cur_win->char_\1906,
X`09`09XtNwidthInc,`09cur_win->char_width,
X`09`09NULL);
X    `7D
X
X    if (ev->xconfigure.height == cur_win->top_\1706
X     `26`26 ev->xconfigure.width == cur_win->top_width)
X `09return;
X
X    XtVaGetValues(cur_win->top_widget,
X`09    XtNheight,`09`26new_\0D07
X`09    XtNwidth,`09`26new_\0C06
X`09    NULL);
X    new_height = ((\0F0B- cur_win->base\2607) /\180Achar_\1807
X`09`09`09     * cur_win->char_height;
X    new_width = ((\0E0A- cur_win->base\2406) /
X`09`09    cur_win->char_width) *\1714;
X#if MOTIF_WIDGETS
X    XtVaSetValues(cur_win->form_widget,
X`09    XmNresizePolicy,`09XmRESIZE_NONE,
X`09    NULL);
X    `7B
X`09WidgetList children;
X`09Cardinal nchildren;
X`09XtVaGetValues(cur_win->form_widget,
X`09`09XmNchildren, `26\0B09
X`09`09XmNnumChildren, `26nc\0C08
X`09`09NULL);
X`09XtUnmanageChildren(c\0907, n\0B08);
X    `7D
X#else
X#if NO_WIDGETS `7C`7C ATHENA\1208
X    XtVaSetValues(cur_win->form_widget,
X`09    XtNwidth,`09`09new_width + cur_win->pane\16092,
X`09    XtNheight,`09`09new_\0D07
X`09    NULL);
X#endif /* NO_WIDGETS */
X#endif /* MOTIF_WIDGETS */
X    XtVaSetValues(cur_win->screen,
X`09    XtNheight,`09new_\0C07
X`09    XtNwidth,`09new_\0B06
X#if OPT_KEV_SCROLLBARS `7C`7C OPT_XAW\160B
X`09    XtNx,`09cur_win->scrollbar_on_left ? \1D09pane_width+2 : 0,
X#endif
X`09    NULL);
X    XtVaSetValues(cur_win->pane,
X#if !OPT_KEV_SCROLLBARS `26`26\1706XAW\170B
X`09    XtNwidth,`09cur_win->pane_width,
X#if OL_WIDGETS
X`09    XtNheight,`09new_\0C07
X#endif /* OL_WIDGETS */
X#else`09/* OPT_KEV_SCROLLBARS */
X`09    XtNx,`09cur_win->scrollbar_on_left ? 0 : new_width,
X`09    XtNwidth,`09cur_win->pane_width+2,
X`09    XtNheight,`09new_\0C06 - cur_win->char_\2307
X#endif /* OPT_KEV_SCROLLBARS */
X`09    NULL);
X#if MOTIF_WIDGETS
X    `7B
X`09WidgetList children;
X`09Cardinal nchildren;
X`09XtVaGetValues(cur_win->form_widget,
X`09`09XmNchildren, `26\0B09
X`09`09XmNnumChildren, `26nc\0C08
X`09`09NULL);
X`09XtManageChildren(c\0907, n\0B08);
X    `7D
X    XtVaSetValues(cur_win->form_widget,
X`09    XmNresizePolicy,`09XmRESIZE_ANY,
X`09    NULL);
X#endif /* MOTIF_WIDGETS */
X
X    XtVaGetValues(cur_win->top_widget,
X`09    XtNheight,`09`26cur_win->top_\1607
X`09    XtNwidth,`09`26cur_win->top_width,
X`09    NULL);
X    XtVaGetValues(cur_win->screen,
X`09    XtNheight,`09`26new_\0D07
X`09    XtNwidth,`09`26new_\0C06
X`09    NULL);
X
X    nr = (int)(new_height / cur_win->char_\1706);
X    nc = (int)(new_width  / cur_win->char_width);
X
X    if (nr < MINROWS `7C`7C nc\1006COLS) `7B
X`09x_resize(nc, nr);
X`09/* Calling XResizeWindow will cause another ConfigureNotify
X`09 * event, so we should return early and let this\2E06 occur.
X`09 */
X`09return;
X    `7D
X
X    if (nc != cur_win->cols `7C`7C nr\170Drows) `7B
X`09newscreensize(nr,nc);
X`09cur_win->rows = nr;
X`09cur_win->cols = nc;
X`09if (check_scrollbar_allocs() == TRUE) /* no allocation failure */
X`09`09update_scrollbar_sizes();
X    `7D
X#if MOTIF_WIDGETS
X    lookfor_sb_resize = FALSE;
X#endif
X`7D
X
Xvoid
Xx_resize(
X    int cols,
X    int rows)
X`7B
X    if (cols < MINCOLS)
X`09cols = MINCOLS;
X    if (rows < MINROWS)
X`09rows = MINROWS;
X
X    XResizeWindow(dpy, Xt\0E07cur_win->top_widget),
X`09`09  (unsigned)cols * cur_win->char_width +\160Abase\1606,
X`09`09  (unsigned)rows * cur_win->char_height +\170Abase\1707);
X    /* This should cause a ConfigureNotify event */
X`7D
X
Xstatic
Xint check_scrollbar_allocs(void)
X`7B
X`09int newmax = cur_win->rows/2;
X`09int oldmax = cur_win->maxscrollbars;
X
X`09if (newmax > oldmax) `7B
X
X`09`09GROW(cur_win->scrollbars, Widget, oldmax, newmax);
X#if OL_WIDGETS
X`09`09GROW(cur_win->sliders, Widget, oldmax, newmax);
X#endif
X#if OPT_KEV_SCROLLBARS `7C`7C OPT_XAW\160B
X`09`09GROW(cur_win->scrollinfo, ScrollInfo, oldmax, newmax);
X`09`09GROW(cur_win->grips, Widget, oldmax, newmax);
X#endif
X
X`09`09cur_win->maxscrollbars = newmax;
X`09`7D
X`09return TRUE;
X`7D
X
X#if MOTIF_WIDGETS
Xstatic void
Xgrip_moved(
X    Widget`09w,
X    XtPointer`09unused,
X    XEvent     *ev,
X    Boolean    *continue_to_dispatch)
X`7B
X    int i;
X    register WINDOW *wp, *saved_curwp;
X    Dimension height;
X    int`09lines;
X
X    if (!lookfor_sb_resize)
X`09return;
X    lookfor_sb_resize = FALSE;
X    saved_curwp = curwp;
X
X    i = 0;
X    for_each_visible_window(wp) `7B
X`09XtVaGetValues(cur_win->scrollbars`5Bi`5D,
X`09`09XtNheight, `26\0907
X`09`09NULL);
X`09lines = (height+(cur_win->char_\1606/2)) / \1B14;
X`09if (lines <= 0) `7B
X`09    lines = 1;
X`09`7D
X`09curwp = wp;
X`09resize(TRUE, lines);
X`09i++;
X    `7D
X    set_curwp(saved\0C06);
X    (void) update(TRUE);
X`7D
X#endif
X
Xstatic void
Xconfigure_bar(
X    Widget w,
X    XEvent *event,
X    String *params,
X    Cardinal *num_params)
X`7B
X    WINDOW *wp;
X    int i;
X
X    if (*num_params != 1
X     `7C`7C (event->type != ButtonPress `26`26 \1E15Release))
X`09return;
X
X    i = 0;
X    for_each_visible_window(wp) `7B
X`09if (cur_win->scrollbars`5Bi`5D == w) `7B
X`09    if (strcmp(params`5B0`5D, "Only") == 0) `7B
X`09`09set_curwp(wp);
X`09`09onlywind(TRUE,0);
X`09    `7D
X`09    else if (strcmp(params`5B0`5D, "Kill") == 0) `7B
X`09`09set_curwp(wp);
X`09`09delwind(TRUE,0);
X`09    `7D
X`09    else if (strcmp(params`5B0`5D, "Split") == 0) `7B
X`09`09if (wp->w_ntrows < 3) `7B
X`09`09    x_beep();
X`09`09    break;
X`09`09`7D
X`09`09else `7B
X`09`09    int newsize;
X`09`09    set_curwp(wp);
X`09`09    newsize = CEIL(event->xbutton.y, cur_win->char_height)-1;
X`09`09    if (newsize > wp->w_ntrows - 2)
X`09`09`09newsize = wp->w_ntrows - 2;
X`09`09    else if (newsize < 1)
X`09`09`09newsize = 1;
X`09`09    splitwind(TRUE, 1);
X`09`09    resize(TRUE, newsize);
X`09`09`7D
X`09    `7D
X`09    (void) update(TRUE);
X`09    break;
X`09`7D
X`09i++;
X    `7D
X`7D
X
X
X#if MOTIF_WIDGETS
Xstatic void
Xpane_button(
X    Widget`09w,
X    XtPointer`09unused,
X    XEvent     *ev,
X    Boolean    *continue_to_dispatch)
X`7B
X    lookfor_sb_resize = TRUE;
X`7D
X#endif /* MOTIF_WIDGETS */
X
X/*ARGSUSED*/
Xstatic void
Xx_change_focus(
X    Widget`09w,
X    XtPointer`09unused GCC_UNUSED,
X    XEvent     *ev,
X    Boolean    *continue_to_dispatch GCC_UNUSED)
X`7B
X    static int got_focus_event = FALSE;
X
X    switch (ev->type) `7B
X`09case EnterNotify:
X`09    if (!ev->xcrossing.focus `7C`7C got_focus_event)
X`09`09return;
X`09    goto focus_in;
X`09case FocusIn:
X`09    got_focus_event = TRUE;
Xfocus_in:
X`09    cur_win->show_cursor = True;
X#if MOTIF_WIDGETS
X`09    XmProcessTraversal(cur_win->screen, XmTRAVERSE_CURRENT);
X#else /* OL_WIDGETS `7C`7C NO\0E09*/
X`09    XtSetKeyboardFocus(w, cur_win->screen);
X#endif
X`09    x_flush();
X`09    break;
X`09case LeaveNotify:
X`09    if ( !ev->xcrossing.focus
X`09      `7C`7C got_focus_event
X`09      `7C`7C ev->xcrossing.detail == NotifyInferior)
X`09`09return;
X`09    goto focus_out;
X`09case FocusOut:
X`09    got_focus_event = TRUE;
Xfocus_out:
X`09    cur_win->show_cursor = False;
X`09    x_flush();
X`09    break;
X    `7D
X`7D
X
X/*ARGSUSED*/
Xstatic void
Xx_wm_delwin(
X    Widget`09w GCC_UNUSED,
X    XtPointer`09unused GCC_UNUSED,
X    XEvent     *ev,
X    Boolean    *continue_to_dispatch GCC_UNUSED)
X`7B
X    if ( ev->type == ClientMessage
X      `26`26 ev->xclient.message_type == atom_WM_PROTOCOLS
X      `26`26 (Atom) ev->xclient.data.l`5B0`5D == atom_WM_DELETE_WINDOW) `7B
X`09quit(FALSE, 0);`09`09/* quit might not return */
X`09(void) update(TRUE);
X    `7D
X`7D
X
X/*
X * Return true if we want to disable reports of the cursor position because th
Ve
X * cursor really should be on the message-line.
X */
X#if UNUSED
Xint
Xx_on_msgline(void)
X`7B
X`09return reading_msg_line `7C`7C cur_win->was_on_msgline;
X`7D
X#endif
X
X/*
X * Because we poll our input-characters in 'x_getc()', it is possible to have
V
X * exposure-events pending while doing lengthy processes (e.g., reading from a
V
X * pipe).  This procedure is invoked from a timer-handler and is designed to
X * handle the exposure-events, and to get keypress\1C07 (i.e., for stopping a
V
X * lengthy process).
X */
Xvoid
Xx_move_events(void)
X`7B
X    XEvent ev;
X
X    while (x_has_events()
X        `26`26 !kqfull(cur_win)) `7B
X
X`09/* Get and dispatch next event */
X`09XtAppNextEvent(cur_win->app_context, `26ev);
X
X`09/*
X`09 * Ignore or save certain events which could get us into trouble with
X`09 * reentrancy.
X`09 */
X`09switch (ev.type) `7B
X`09    case ButtonPress :
X`09    case ButtonRelease :
X`09    case MotionNotify :
X`09`09/* Ignore the event */
X`09`09continue;
X
X`09    case ClientMessage :
X`09    case SelectionClear :
X`09    case SelectionNotify :
X`09    case SelectionRequest :
X`09    case ConfigureNotify :
X`09    case ConfigureRequest :
X`09    case PropertyNotify :
X`09    case ReparentNotify :
X`09    case ResizeRequest :
X`09`09/* Queue for later processing.  */
X`09`09evqadd(`26ev);
X`09`09continue;
X
X`09    default :
X`09`09/* do nothing here...we'll dispatch the event below */
X`09`09break;
X`09`7D
X
X`09XtDispatchEvent(`26ev);
X
X`09/*
X`09 * If the event was a keypress, check it to see if it was an
X`09 * interrupt character.  We check here to make sure that the
X`09 * queue was non-empty, because not all keypresses put
X`09 * characters into the queue.  We assume that intrc will not
X`09 * appear in any multi-character sequence generated by a key
X`09 * press, or that if it does, it will be the last character in
X`09 * the sequence.  If this is a bad assumption, we will have to
X`09 * keep track of what the state of the queue was prior to the
X`09 * keypress and scan the characters added to the queue as a
X`09 * result of the keypress.
X`09 */
X
X`09if (!kqempty(cur_win) `26`26 ev.type == KeyPress) `7B
X`09    int c = kqpop(cur_win);
X`09    if (c == intrc) `7B
X`09`09kqadd(cur_win, abortc);
X#if SYS_VMS
X`09`09kbd_alarm(); /* signals? */
X#else
X`09`09(void)signal_pg(SIGINT);
X#endif
X`09    `7D
X`09    else
X`09`09kqadd(cur_win, c);
X`09`7D
X    `7D
X`7D
X
X#if OPT_WORKING
Xvoid
Xx_working(void)
X`7B
X    cur_win->want_to_work = TRUE;
X`7D
X
Xstatic int
Xx_has_events(void)
X`7B
X    if (cur_win->want_to_work == TRUE) `7B
X    `09x_set_watch_cursor(TRUE);
X`09cur_win->want_to_work = FALSE;
X    `7D
X    return (XtAppPending(cur_win->app_context) `26 XtIMXEvent);
X`7D
X
Xstatic void
Xx_set_watch_cursor(int onflag)
X`7B
X    static int watch_is_on = FALSE;
X#if OPT_KEV_SCROLLBARS `7C`7C OPT_XAW\160B
X    int i;
X#endif
X
X    if (onflag == watch_is_on)
X`09return;
X
X    watch_is_on = onflag;
X
X    if (onflag) `7B
X`09set_pointer(XtWindow(cur_win->screen), \1209watch\3208);
X#if OPT_KEV_SCROLLBARS `7C`7C OPT_XAW\160B
X`09for (i=0; i<cur_win->nscrollbars; i++) `7B
X`09    set_pointer(
X`09`09    XtWindow(cur_win->scrollbars`5Bi`5D), \1909watch_pointer);
X`09    if (i < cur_win->nscrollbars-1)
X`09`09set_pointer(
X`09`09`09XtWindow(cur_win->grips`5Bi`5D), \1409watch_pointer);
X`09`7D
X#endif /* OPT_KEV_SCROLLBARS */
X    `7D
X    else `7B
X`09set_pointer(XtWindow(cur_win->screen), \1209normal\3308);
X#if OPT_KEV_SCROLLBARS `7C`7C OPT_XAW\160B
X`09for (i=0; i<cur_win->nscrollbars; i++) `7B
X`09    set_pointer(
X`09`09    XtWindow(cur_win->scrollbars`5Bi`5D),
X`09`09    curs_sb_v_double_arrow);
X`09    if (i < cur_win->nscrollbars-1)
X`09`09set_pointer(
X`09`09`09XtWindow(cur_win->grips`5Bi`5D),
X`09`09`09curs_double_arrow);
X`09`7D
X#endif /* OPT_KEV_SCROLLBARS */
X    `7D
X`7D
X#endif /* OPT_WORKING */
X
Xstatic int
Xevqempty(void)
X`7B
X    return evqhead == NULL;
X`7D
X
Xstatic void
Xevqadd(const XEvent *evp)
X`7B
X    struct eventqueue * newentry;
X    newentry = typealloc(struct eventqueue);
X    if (newentry == NULL)
X`09return;`09`09`09/* FIXME: Need method for indicating error */
X    newentry->next = NULL;
X    newentry->event = *evp;
X    if (evqhead == NULL)
X`09evqhead = evqtail = newentry;
X    else `7B
X`09evqtail->next = newentry;
X`09evqtail = newentry;
X    `7D
X`7D
X
Xstatic void
Xevqdel(XEvent *evp)
X`7B
X    struct eventqueue *delentry = evqhead;
X    if (delentry == NULL)
X`09return;`09`09`09/* should not happen */
X    *evp = delentry->event;
X    evqhead = delentry->next;
X    if (evqhead == NULL)
X`09evqtail = NULL;
X    free((char *)delentry);
X`7D
X
Xstatic void
Xkqinit(TextWindow tw)
X`7B
X    tw->kqhead = 0;
X    tw->kqtail = 0;
X`7D
X
Xstatic int
Xkqempty(TextWindow tw)
X`7B
X    return tw->kqhead ==\0E07tail;
X`7D
X
Xstatic int
Xkqfull(TextWindow tw)
X`7B
X    return tw->kqhead == (\0F06tail + 1) % KQSIZE;
X`7D
X
Xstatic int
Xkqdel(TextWindow tw)
X`7B
X    int c;
X    c = tw->kq`5B\0706head`5D;
X    tw->kqhead = (\0E0B+ 1) % KQSIZE;
X    return c;
X`7D
X
Xstatic void
Xkqadd(
X    TextWindow tw,
X    int c)
X`7B
X    tw->kq`5B\0706tail`5D = c;
X    tw->kqtail = (\0E0B+ 1) % KQSIZE;
X`7D
X
Xstatic int
Xkqpop(TextWindow tw)
X`7B
X    if (--(tw->kqtail) < 0)
X`09tw->kqtail = KQSIZE-1;
X    return (tw->kq`5B\0706tail`5D);
X`7D
X
X/*ARGSUSED*/
Xstatic void
Xdisplay_cursor(
X    XtPointer client_data GCC_UNUSED,
X    XtIntervalId *idp)
X`7B
X    static Bool am_blinking = FALSE;
X    int the_col = (ttcol >= term.t_ncol) ?\0F0C - 1 : ttcol;
X
X    /*
X     * Return immediately if we are either in the process of making a
X     * selection (by wiping with the mouse) or if the cursor is already
X     * displayed and \0E07_cursor() is being called explicitly from the
X     * event loop in x_getc.
X     */
X    if (cur_win->wipe_permitted) `7B
X`09am_blinking = FALSE;
X`09if (cur_win->blink_id != (XtIntervalId) 0) `7B
X`09    XtRemoveTimeOut(cur_win->blink_id);
X`09    cur_win->blink_id = (XtIntervalId) 0;
X`09`7D
X`09return;
X    `7D
X
X    if (IS_DIRTY(ttrow,the_col) `26`26 idp == (XtIntervalId *) 0)
X`09return;
X
X    if (cur_win->show_cursor) `7B
X`09if ( cur_win->blink_interval > 0
X`09  `7C`7C ( cur_win->blink_interval < 0 `26`26 IS_REVERSED(ttrow, the_col) )
V) `7B
X`09    if (idp != (XtIntervalId *) 0 `7C`7C !am_blinking) `7B
X`09`09/* Set timer to get blinking */
X`09`09cur_win->blink_id = XtAppAddTimeOut(
X`09`09`09cur_win->app_context,
X`09`09`09(unsigned long) max(cur_win->blink_interval,
X`09`09`09        \0808    -cur_win->blink_interval),
X`09`09`09display_cursor,
X`09`09`09(XtPointer) 0);
X`09`09cur_win->blink_status `5E= BLINK_TOGGLE;
X`09`09am_blinking = TRUE;
X`09    `7D
X`09    else
X`09`09cur_win->blink_status `26= `7EBLINK_TOGGLE;
X`09`7D
X`09else `7B
X`09    am_blinking = FALSE;
X`09    cur_win->blink_status `26= `7EBLINK_TOGGLE;
X`09    if (cur_win->blink_id != (XtIntervalId) 0) `7B
X`09`09XtRemoveTimeOut(cur_win->blink_id);
X`09`09cur_win->blink_id = (XtIntervalId) 0;
X`09    `7D
X`09`7D
X
X`09MARK_CELL_DIRTY(ttrow,the_col);
X`09MARK_LINE_DIRTY(ttrow);
X`09flush_line(`26CELL_TEXT(ttrow,the_col), 1,
X`09           (unsigned int) (VATTRIB(CELL_ATTR(ttrow,the_col))
X`09`09        \0808`5E ((cur_win->blink_status `26 BLINK_TOGGLE)
X`09`09&0209  ? 0 : VACURS)),
X`09`09   ttrow, the_col);
X    `7D
X    else `7B
X`09/* This code will get called when the window no longer has the focus. */
X`09if (cur_win->blink_id != (XtIntervalId) 0) `7B
X`09    XtRemoveTimeOut(cur_win->blink_id);
X`09    cur_win->blink_id = (XtIntervalId) 0;
X`09`7D
X`09am_blinking = FALSE;
X`09MARK_CELL_DIRTY(ttrow,the_col);
X`09MARK_LINE_DIRTY(ttrow);
X`09flush_line(`26CELL_TEXT(ttrow,the_col), 1,
X`09    (unsigned int) VATTRIB(CELL_ATTR(ttrow,the_col)), \1106 t\1207;
X`09XDrawRectangle(dpy, cur_win->win,
X`09        \0807IS_REVERSED(ttrow,the_col) ? cur_win->cursgc
X`09`09        \0808\1010: cur_win->revcursgc,
X`09        \0807x_pos(cur_win, ttcol), y\1710row),
X`09`09       (unsigned)(cur_win->char_width - 1),
X`09`09       (unsigned)(cur_win->char_height - 1));
X    `7D
X`7D
X
X
X/*
X * main event loop.  this means we'll be stuck if an\2D07that needs
X * instant processing comes in while its off doing other work, but
X * there's no (easy) way around that.
X */
Xstatic int
Xx_getc(void)
X`7B
X    int c;
X
X    while (!evqempty()) `7B
X`09XEvent ev;
X`09evqdel(`26ev);
X`09XtDispatchEvent(`26ev);
X    `7D
X#if OPT_WORKING
X    x_set_watch_cursor(FALSE);
X#endif
X    for_ever `7B
X
X`09if (tb_more(PasteBuf)) `7B`09/* handle any queued pasted text */
X`09    c = tb_next(PasteBuf);
X`09    c `7C= NOREMAP;`09/* pasted chars are not subject to mapping */
X`09    cur_win->pasting = True;
X`09    break;
X`09`7D else if (cur_win->pasting) `7B
X`09    /*
X`09     * Set the default position for new pasting to just past the newly
X`09     * inserted text.
X`09     */
X`09    if (DOT.o < llength(DOT.l) `26`26 !insertmode)
X`09`09DOT.o++;&0209/* Advance DOT so that consecutive
X`09`09&0209`09   pastes come out right */
X`09    cur_win->pasting = False;
X`09    update(TRUE);`09/* make sure ttrow `26 ttcol are valid */
X`09`7D
X
X`09if (!kqempty(cur_win)) `7B
X`09    c = kqdel(cur_win);
X`09    break;
X`09`7D
X
X`09/*
X`09 * Get and dispatch as many X events as possible.  This permits
X`09 * the editor to catch up if it gets behind in processing keyboard
X`09 * events since the keyboard queue will likely have something in it.
X`09 * update() will check for typeahead and will defer its processing
X`09 * until there is nothing more in the keyboard queue.
X`09 */
X
X`09do `7B
X`09    XEvent ev;
X`09    XtAppNextEvent(cur_win->app_context, `26ev);
X`09    XtDispatchEvent(`26ev);
X`09`7D while (x_has_events()
X`09    `26`26 !kqfull(cur_win));
X    `7D
X
X    return c;
X`7D
X
X/*
X * Another event loop used for determining type-ahead.
X */
Xint
Xx_typahead(
X    int milli)`09`09/*\0B06seconds to wait for type-ahead */
X`7B
X    int status;
X    XtIntervalId timeoutid = 0;
X    int timedout;
X    int olddkr;
X
X    if (!cur_win->exposed)
X`09return FALSE;
X
X    olddkr = im_waiting(TRUE);
X
X    status = !kqempty(cur_win) `7C`7C tb_more(PasteBuf);
X
X    if (!status) `7B
X
X`09if (milli) `7B
X`09    timedout = 0;
X`09    timeoutid = XtAppAddTimeOut(
X`09`09`09    cur_win->app_context,
X`09`09`09    (ULONG) milli,
X`09`09`09    x_typahead_timeout,
X`09`09`09    (XtPointer) `26timedout);
X`09`7D
X`09else
X`09    timedout = 1;
X
X`09while (kqempty(cur_win) `26`26 !ev\1607)) `7B
X`09    XEvent ev;
X`09    evqdel(`26ev);
X`09    XtDispatchEvent(`26ev);
X`09`7D
X#if OPT_WORKING
X`09x_set_watch_cursor(FALSE);
X#endif
X
X`09/*
X`09 * Process pending events until we get some keyboard input.
X`09 * Note that we do not block here.
X`09 */
X`09while (kqempty(cur_win) `26`26
X`09`09x_has_events()) `7B
X`09    XEvent ev;
X`09    XtAppNextEvent(cur_win->app_context, `26ev);
X`09    XtDispatchEvent(`26ev);
X`09`7D
X
X`09/* Now wait for timer and process events as necessary. */
X`09while (!timedout `26`26 kqempty(cur_win)) `7B
X`09    XtAppProcessEvent(cur_win->app_context, (XtInputMask)XtIMAll);
X`09`7D
X
X`09if (!timedout)
+-+-+-+-+-+-+-+-  END  OF PART 132 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 133 -+-+-+-+-+-+-+-+
X`09    XtRemoveTimeOut(timeoutid);
X
X`09status = !kqempty(cur_win);
X    `7D
X
X    (void) im_waiting(olddkr);
X
X    return status;
X`7D
X
X/*ARGSUSED*/
Xstatic void
Xx_typahead_timeout(
X    XtPointer flagp,
X    XtIntervalId *id GCC_UNUSED)
X`7B
X    * (int *) flagp = 1;
X`7D
X
X/*ARGSUSED*/
Xstatic void
Xx_key_press(
X    Widget`09w GCC_UNUSED,
X    XtPointer`09unused GCC_UNUSED,
X    XEvent     *ev,
X    Boolean    *continue_to_dispatch GCC_UNUSED)
X`7B
X    char`09buffer`5B128`5D;
X    KeySym`09keysym;
X    int`09`09num;
X
X    register int i;
X    register SIZE_T n;
X
X    static const struct `7B
X`09KeySym  key;
X`09int     code;
X    `7D escapes`5B`5D = `7B
X`09/* Arrow keys */
X`09`7BXK_Up,      KEY_Up`7D,
X`09`7BXK_Down,    KEY_Down`7D,
X`09`7BXK_Right,   KEY\0D06`7D,
X`09`7BXK_Left,    KEY_Left`7D,
X`09/* page scroll */
X`09`7BXK_Next,    KEY_Next`7D,
X`09`7BXK_Prior,   KEY\0D06`7D,
X`09`7BXK_Home,    KEY_Home`7D,
X`09`7BXK_End,     KEY_End`7D,
X`09/* editing */
X`09`7BXK_Insert,  KEY\0D07`7D,
X`09`7BXK_Find,    KEY_Find`7D,
X`09`7BXK_Select,  KEY\0D07`7D,
X`09/* command keys */
X`09`7BXK_Menu,    KEY_Menu`7D,
X`09`7BXK_Help,    KEY_Help`7D,
X`09/* function keys */
X`09`7BXK_F1,      KEY_F1`7D,
X`09`7BXK_F2,      KEY_F2`7D,
X`09`7BXK_F3,      KEY_F3`7D,
X`09`7BXK_F4,      KEY_F4`7D,
X`09`7BXK_F5,      KEY_F5`7D,
X`09`7BXK_F6,      KEY_F6`7D,
X`09`7BXK_F7,      KEY_F7`7D,
X`09`7BXK_F8,      KEY_F8`7D,
X`09`7BXK_F9,      KEY_F9`7D,
X`09`7BXK_F10,     KEY_F10`7D,
X`09`7BXK_F11,     KEY_F11`7D,
X`09`7BXK_F12,     KEY_F12`7D,
X`09`7BXK_F13,     KEY_F13`7D,
X`09`7BXK_F14,     KEY_F14`7D,
X`09`7BXK_F15,     KEY_F15`7D,
X`09`7BXK_F16,     KEY_F16`7D,
X`09`7BXK_F17,     KEY_F17`7D,
X`09`7BXK_F18,     KEY_F18`7D,
X`09`7BXK_F19,     KEY_F19`7D,
X`09`7BXK_F20,     KEY_F20`7D,
X#if defined(XK_F21) `26`26\1309KEY_F21)
X`09`7BXK_F21,     KEY_F21`7D,
X`09`7BXK_F22,     KEY_F22`7D,
X`09`7BXK_F23,     KEY_F23`7D,
X`09`7BXK_F24,     KEY_F24`7D,
X`09`7BXK_F25,     KEY_F25`7D,
X`09`7BXK_F26,     KEY_F26`7D,
X`09`7BXK_F27,     KEY_F27`7D,
X`09`7BXK_F28,     KEY_F28`7D,
X`09`7BXK_F29,     KEY_F29`7D,
X`09`7BXK_F30,     KEY_F30`7D,
X`09`7BXK_F31,     KEY_F31`7D,
X`09`7BXK_F32,     KEY_F32`7D,
X`09`7BXK_F33,     KEY_F33`7D,
X`09`7BXK_F34,     KEY_F34`7D,
X`09`7BXK_F35,     KEY_F35`7D,
X#endif
X`09/* keypad function keys */
X`09`7BXK_KP_F1,   KEY\0D06`7D,
X`09`7BXK_KP_F2,   KEY\0D06`7D,
X`09`7BXK_KP_F3,   KEY\0D06`7D,
X`09`7BXK_KP_F4,   KEY\0D06`7D
X    `7D;
X
X    if (ev->type != KeyPress)
X`09return;
X
X    num = XLookupString((XKeyPressedEvent *) ev, buffer, sizeof(\0F06),
X`09`09`26keysym, (XComposeStatus *) 0);
X
X    if (num <= 0) `7B
X`09for (n = 0; n < TABLESIZE(escapes); n++) `7B
X`09    if (keysym == escapes`5Bn`5D.key) `7B
X`09`09kqadd(cur_win, escapes`5Bn`5D.code);
X`09`09return;
X`09    `7D
X`09`7D
X    `7D
X    else if (num == 1 `26`26 (ev->xkey.state `26 Mod1Mask))
X`09buffer`5B0`5D `7C= HIGHBIT;
X
X    /* FIXME: Should do something about queue full conditions */
X    if (num > 0) `7B
X`09for (i=0; i<num `26`26 !kqfull(cur_win); i++)
X`09    kqadd(cur_win, char2int(buffer`5Bi`5D));
X    `7D
X`7D
X
X/*
X * change reverse video status
X */
Xstatic void
Xx_rev(UINT state)
X`7B
X    cur_win->reverse = state;
X`7D
X
X/* change screen resolution */
X/*ARGSUSED*/
Xstatic int
Xx_cres(const char *flag GCC_UNUSED)
X`7B
X    return TRUE;
X`7D
X
X#if OPT_COLOR
Xstatic void
Xx_fcol(int color)
X`7B
X`7D
X
Xstatic void
Xx_bcol(int color)
X`7B
X`7D
X
X#endif
X
X/* beep */
Xstatic void
Xx_beep(void)
X`7B
X#if OPT_FLASH
X    if (global_g_val(GMDFLASH)) `7B
X`09beginDisplay();
X`09XGrabServer(dpy);
X`09XSetFunction(dpy, cur_win->textgc, GXxor);
X`09XSetBackground(dpy, cur_win->textgc, 0L);
X`09XSetForeground(dpy, cur_win->textgc\110Bfg `5E\1F0Abg);
X`09XFillRectangle(dpy, cur_win->win\0E0Btextgc,
X`09`09       0, 0, x_width(cur_win), x_height\1309);
X`09XFlush(dpy);
X`09catnap(90, FALSE);
X`09XFillRectangle(dpy, cur_win->win\0E0Btextgc,
X`09`09       0, 0, x_width(cur_win), x_height\1309);
X`09XFlush(dpy);
X`09XSetFunction(dpy, cur_win->textgc, GXcopy);
X`09XSetBackground(dpy, cur_win->textgc\110Bbg);
X`09XSetForeground(dpy, cur_win->textgc\110Bfg);
X`09XUngrabServer(dpy);
X`09endofDisplay();
X    `7D
X    else
X#endif
X`09XBell(dpy, 0);
X`7D
X
X#if NO_LEAKS
Xvoid
Xx11_leaks(void)
X`7B
X`09if (cur_win != 0) `7B
X`09`09FreeIfNeeded(cur_win->fontname);
X`09`7D
X`7D
X#endif`09/* NO_LEAKS */
X
Xchar x_window_name`5BNFILEN`5D;
Xchar x_icon_name`5BNFILEN`5D;
X
Xvoid
Xx_set_icon_name(const char *name)
X`7B
X`09XTextProperty Prop;
X
X`09(void)strncpy0(x_icon_name, \0606NFILEN);
X
X`09Prop.value = (unsigned char *)x_icon_name;
X`09Prop.encoding = XA_STRING;
X`09Prop.format = 8;
X`09Prop.nitems = strlen(x_icon_name);
X
X`09XSetWMIconName(dpy,XtWindow(cur_win->top_widget),`26Prop);
X`7D
X
Xchar *
Xx_get_icon_name(void)
X`7B
X`09return x_icon_name;
X`7D
X
Xvoid
Xx_set_window_name(const char *name)
X`7B
X`09XTextProperty Prop;
X
X`09(void)strncpy0(x_window_name, \0606NFILEN);
X
X`09Prop.value = (unsigned char *)x_window_name;
X`09Prop.encoding = XA_STRING;
X`09Prop.format = 8;
X`09Prop.nitems = strlen(x_window_name);
X
X`09XSetWMName(dpy,XtWindow(cur_win->top_widget),`26Prop);
X`7D
X
Xchar *
Xx_get_window_name(void)
X`7B
X    `09return x_window_name;
X`7D
X
Xstatic void
Xwatched_input_callback(XtPointer fd,
X        \0808\1007int *src GCC_UNUSED,
X`09`09       XtInputId *id GCC_UNUSED)
X`7B
X    dowatchcallback((int) fd);
X`7D
X
Xstatic int
Xx_watchfd(int fd, WATCHTYPE type, long *idp)
X`7B
X    *idp = (long) XtAppAddInput(
X`09`09    cur_win->app_context,
X`09`09    fd,
X`09`09    (XtPointer) ((type `26 WATCHREAD)  ? XtInputReadMask :
X`09`09        \0808 (type `26 WATCHWRITE) ? XtInputWriteMask
X`09`09&0209`09             : XtInputExceptMask),
X`09`09    watched_input_callback,
X`09`09    (XtPointer) fd);
X    return TRUE;
X`7D
X
Xstatic void
Xx_unwatchfd(int fd GCC_UNUSED, long id)
X`7B
X    XtRemoveInput((XtInputId) id);
X`7D
X
X#endif`09/* DISP_X11 `26`26 XTOOLKIT */
$ call unpack [.VILE-8_0]X11.C;1 -
 873860111 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 320 134 152
$!
$ create 'f'
X#!/bin/sh
X# $Header: /usr/build/vile/vile/RCS/xshell.sh,v 1.4 1997/11/10 01:28:07 tom Ex
Vp $
X#
X# This script is designed to be used from xvile to support the $xshell variabl
Ve.
X# If you wish to have shell commands of the form
X#`09:!command
X# run in an xterm or equivalent, then set the $xshell variable like this:
X#`09:setv $xshell="xterm -e \1106.sh"
X#
X# Xvile uses the -e option to specify to the xterm which shell command to run.
V
X#
Xif test $# != 0 ; then
X`09case "$1" in #(vi
X`09-e)`09shift
X`09`09;;
X`09esac
Xfi
Xif test $# != 0 ; then
X`09eval $@
X`09echo Press return to exit
X`09read reply
Xelse
X`09eval $`7BSHELL-/bin/sh`7D
Xfi
$ call unpack [.VILE-8_0]XSHELL.SH;1 -
 1667052499 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 2 135 152
$!
$ create 'f'
X`0C
XXVILE.EXE        \0808\1010\201711-SEP-1998 17:36\4808Linker A11-20\5D14Page
V    1
X
X        \0808\1010\200D+--------\0808\1008+
X        \0808\1010\200D! Object Module Synopsis !
X        \0808\1010\200D+--------\0808\1008+
X%LINK-W-NUDFSYMS, 2 undefined symbols:
X%LINK-I-UDFSYM, `09DOWATCHCALLBACK`20
X%LINK-I-UDFSYM, `09FORK`20
X
XModule Name     Ident              Bytes\1306File \1E0E\0F0F  Creation Dat
V\2D07Creator
X-----------     \0A0A     \130F\1E13\2C0E\4208\540D\1308
XDECW$XMLIBSHR12 DW V1.2-3941205         0 `5BSYSLIB`5D\320F.EXE;1\280815-DEC-1
V994 13:53  Linker T10-43
XDECW$XTLIBSHRR5 DW V1.2-3941205         0 `5BSYSLIB`5D\320F.EXE;1\28095-DEC-19
V94 20:54  Linker T10-43
XDECW$XLIBSHR    DW V1.2-3941205         0 `5BSYSLIB`5D\320C.EXE;1\2509   5-DEC
V-1994 20:51  Linker T10-43
XMAIN            V1.0\100C    31770 `5BUDAA055.TEMP.VILE-8_0`5DMAIN.OBJ;1    11
V-SEP-1998 17:21  DEC C V5.5-002
XX11             V1.0\110D   44142 `5BUDAA055.TEMP.VILE-8_0`5DX11.OBJ;\470611-S
VEP-1998 17:22  DEC C V5.5-002
X%LINK-W-USEUNDEF, undefined symbol DOWATCHCALLBACK referenced
X`09in psect $LINK$ offset %X000000C0
X`09in module X11 file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DX11.OBJ;1
XBASIC           V1.0\0F0B     14101 `5BUDAA055.TEMP.VILE-8_0`5DBASIC.OBJ;1   1
V1-SEP-1998 17:22  DEC C V5.5-002
XBIND            V1.0\100C    25218 `5BUDAA055.TEMP.VILE-8_0`5DBIND.OBJ;1    11
V-SEP-1998 17:23  DEC C V5.5-002
XBTREE           V1.0\0F0B\1A064124 `5BUDAA055.TEMP.VILE-8_0`5DBTREE.OBJ;1   11
V-SEP-1998 17:23  DEC C V5.5-002
XBUFFER          V1.0\0E0A\180619636 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11
V-SEP-1998 17:23  DEC C V5.5-002
XCRYPT           V1.0\0F0B\1A061348 `5BUDAA055.TEMP.VILE-8_0`5DCRYPT.OBJ;1   11
V-SEP-1998 17:24  DEC C V5.5-002
XCSRCH           V1.0\0F0B\1A061948 `5BUDAA055.TEMP.VILE-8_0`5DCSRCH.OBJ;1   11
V-SEP-1998 17:24  DEC C V5.5-002
XDISPLAY         V1.0\0D09\160734434 `5BUDAA055.TEMP.VILE-8_0`5D\4107.OBJ;1 11-
VSEP-1998 17:24  DEC C V5.5-002
XDUMBTERM        V1.0\0C08\1408 1508 \2A08.OBJ;1\2411\2A071-SEP-1998 17:24  DEC
V C V5.5-002
XEVAL            V1.0\100C    20720 `5BUDAA055.TEMP.VILE-8_0`5DEVAL.OBJ;1    11
V-SEP-1998 17:25  DEC C V5.5-002
XEXEC            V1.0\100C    24922 `5BUDAA055.TEMP.VILE-8_0`5DEXEC.OBJ;1    11
V-SEP-1998 17:25  DEC C V5.5-002
XEXTERNS         V1.0\0D09\160736508 `5BUDAA055.TEMP.VILE-8_0`5D\4107.OBJ;1 11-
VSEP-1998 17:25  DEC C V5.5-002
XFENCES          V1.0\0E0A\18075164 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11-
VSEP-1998 17:26  DEC C V5.5-002
XFILE            V1.0\100C    21171 `5BUDAA055.TEMP.VILE-8_0`5DFILE.OBJ;1    11
V-SEP-1998 17:26  DEC C V5.5-002
XFILEC           V1.0\0F0B     10479 `5BUDAA055.TEMP.VILE-8_0`5DFILEC.OBJ;1   1
V1-SEP-1998 17:26  DEC C V5.5-002
XFILEIO          V1.0\0E0A\18074291 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11-
VSEP-1998 17:26  DEC C V5.5-002
XFINDERR         V1.0\0D09\16086707 `5BUDAA055.TEMP.VILE-8_0`5D\4107.OBJ;1 11-S
VEP-1998 17:27  DEC C V5.5-002
XGLOB            V1.0\100C     3212 `5BUDAA055.TEMP.VILE-8_0`5DGLOB.OBJ;1    11
V-SEP-1998 17:27  DEC C V5.5-002
XGLOBALS         V1.0\0D09\16081570 `5BUDAA055.TEMP.VILE-8_0`5D\4107.OBJ;1 11-S
VEP-1998 17:27  DEC C V5.5-002
XHISTORY         V1.0\0D09\16086781 `5BUDAA055.TEMP.VILE-8_0`5D\4107.OBJ;1 11-S
VEP-1998 17:27  DEC C V5.5-002
XINPUT           V1.0\0F0B     20965 `5BUDAA055.TEMP.VILE-8_0`5DINPUT.OBJ;1   1
V1-SEP-1998 17:28  DEC C V5.5-002
XINSERT          V1.0\0E0A\180615216 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11
V-SEP-1998 17:28  DEC C V5.5-002
XITBUFF          V1.0\0E0A\18071960 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11-
VSEP-1998 17:28  DEC C V5.5-002
XISEARCH         V1.0\0D09\16084919 `5BUDAA055.TEMP.VILE-8_0`5D\4107.OBJ;1 11-S
VEP-1998 17:29  DEC C V5.5-002
XLINE            V1.0\100C    16482 `5BUDAA055.TEMP.VILE-8_0`5DLINE.OBJ;1    11
V-SEP-1998 17:29  DEC C V5.5-002
XMAP             V1.0\110D   10642 `5BUDAA055.TEMP.VILE-8_0`5DMAP.OBJ;1\2B061-S
VEP-1998 17:29  DEC C V5.5-002
XMENU            V1.0\100C    61173 `5BUDAA055.TEMP.VILE-8_0`5DMENU.OBJ;1    11
V-SEP-1998 17:30  DEC C V5.5-002
X%LINK-W-USEUNDEF, undefined symbol FORK referenced
X`09in psect $LINK$ offset %X000005E0
X`09in module MENU file DISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DMENU.OBJ;1
XMODES           V1.0\0F0B     28820 `5BUDAA055.TEMP.VILE-8_0`5DMODES.OBJ;1   1
V1-SEP-1998 17:30  DEC C V5.5-002
XMSGS            V1.0\100C     1680 `5BUDAA055.TEMP.VILE-8_0`5DMSGS.OBJ;1    11
V-SEP-1998 17:30  DEC C V5.5-002
XNPOPEN          V1.0\0E0A\180A0 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11-SEP
V-1998 17:30  DEC C V5.5-002
XONELINER        V1.0\0C08\1408 7350 \2A08.OBJ;1\2411\410611-SEP-1998 17:31  DE
VC C V5.5-002
XOPERS           V1.0\0F0B\1A067262 `5BUDAA055.TEMP.VILE-8_0`5DOPERS.OBJ;1   11
V-SEP-1998 17:31  DEC C V5.5-002
XPATH            V1.0\100C     7877 `5BUDAA055.TEMP.VILE-8_0`5DPATH.OBJ;1    11
V-SEP-1998 17:31  DEC C V5.5-002
XRANDOM          V1.0\0E0A\18079595 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11-
VSEP-1998 17:32  DEC C V5.5-002
XREGEXP          V1.0\0E0A\180614678 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11
V-SEP-1998 17:32  DEC C V5.5-002
XREGION          V1.0\0E0A\180611418 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11
V-SEP-1998 17:32  DEC C V5.5-002
X`0C
XXVILE.EXE        \0808\1010\201711-SEP-1998 17:36\4808Linker A11-20\5D14Page
V    2
X
X
XModule Name     Ident              Bytes\1306File \1E0E\0F0F  Creation Dat
V\2D07Creator
X-----------     \0A0A     \130F\1E13\2C0E\4208\540D\1308
XSEARCH          V1.0\0E0A\180610374 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11
V-SEP-1998 17:32  DEC C V5.5-002
XSELECT          V1.0\0E0A\180613356 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11
V-SEP-1998 17:33  DEC C V5.5-002
XSPAWN           V1.0\0F0B\1A064682 `5BUDAA055.TEMP.VILE-8_0`5DSPAWN.OBJ;1   11
V-SEP-1998 17:33  DEC C V5.5-002
XTAGS            V1.0\100C    11011 `5BUDAA055.TEMP.VILE-8_0`5DTAGS.OBJ;1    11
V-SEP-1998 17:33  DEC C V5.5-002
XTBUFF           V1.0\0F0B\1A062400 `5BUDAA055.TEMP.VILE-8_0`5DTBUFF.OBJ;1   11
V-SEP-1998 17:33  DEC C V5.5-002
XTERMIO          V1.0\0E0A\18076118 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11-
VSEP-1998 17:34  DEC C V5.5-002
XUNDO            V1.0\100C     8238 `5BUDAA055.TEMP.VILE-8_0`5DUNDO.OBJ;1    11
V-SEP-1998 17:34  DEC C V5.5-002
XVERSION         V1.0\0D09\16082626 `5BUDAA055.TEMP.VILE-8_0`5D\4107.OBJ;1 11-S
VEP-1998 17:34  DEC C V5.5-002
XVMS2UNIX        V1.0\0C08\1408 9240 \2A08.OBJ;1\2411\410611-SEP-1998 17:34  DE
VC C V5.5-002
XVMSPIPE         V1.0\0D09\16082916 `5BUDAA055.TEMP.VILE-8_0`5D\4107.OBJ;1 11-S
VEP-1998 17:35  DEC C V5.5-002
XWINDOW          V1.0\0E0A\180611231 `5BUDAA055.TEMP.VILE-8_0`5D\4106.OBJ;1  11
V-SEP-1998 17:35  DEC C V5.5-002
XWORD            V1.0\100C     8109 `5BUDAA055.TEMP.VILE-8_0`5DWORD.OBJ;1    11
V-SEP-1998 17:35  DEC C V5.5-002
XWORDMOV         V1.0\0D09\16082084 `5BUDAA055.TEMP.VILE-8_0`5D\4107.OBJ;1 11-S
VEP-1998 17:36  DEC C V5.5-002
XCMA$TIS_SHR     CMA V2.12-122           0 SYS$COMMON:`5BSYSLIB`5D\3D0B.EXE;1
V  4-MAY-1995 22:30  Linker A11-12
XDECC$SHR        T06.2-05\1008\18080 SYS$COMMON:`5BSYSLIB`5D\3D08.EXE;2     6-J
VAN-1997 16:33  Linker A11-12
XLIBRTL          X01-001\110A\1B070 SYS$COMMON:`5BSYSLIB`5D\3D06.EXE;2\430624-J
VUL-1996 21:28  Linker A11-12
XLIBOTS          \1007V1.3-012\19090 SYS$COMMON:`5BSYSLIB`5D\3D06.EXE;1\43074-M
VAY-1995 22:30  Linker A11-12
XSYS$PUBLIC_VECTORS            `20
X        \0808X-33\1410    0 `5BSYSLIB`5DSYS$PUBLIC_VECTORS.EXE;1\4A064-MAY-199
V5 22:29  Linker A11-12
X
X        \0808\1010\200C+--------\0808\100A+
X        \0808\1010\200C! Program Section Synopsis !
X        \0808\1010\200C+--------\0808\100A+
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
X$LINK$        \0808\100A00010000 00024B3F 00014B40 (\360684800.) OCTA  4 NOPIC
V,CON,REL,LCL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00010000\0906E88 00000E89 (\3C073721.) OCTA  4
X        \0808X11\130D00010E90 00012367 000014D8 (\3C075336.) OCTA  4
X        \0808BASIC\150B00012370\0906B4F 000007E0 (\3C072016.) OCTA  4
X        \0808BIND\140C00012B50 00013BDF 00001090 (\3C074240.) OCTA  4
X        \0808BTREE\150B00013BE0\0906DC7 000001E8 (\3C08488.) OCTA  4
X        \0808BUFFER\160A00013DD0 00014BEF 00000E20 (\3C073616.) OCTA  4
X        \0808CRYPT\150B00014BF0\0906D0F 00000120 (\3C08288.) OCTA  4
X        \0808CSRCH\150B00014D10\0906ECF 000001C0 (\3C08448.) OCTA  4
X        \0808DISPLAY\170900014ED0 00015D3F 00000E70 (\3C073696.) OCTA  4
X        \0808DUMBTERM\180800015D40\0906ED7 00000198 (\3C08408.) OCTA  4
X        \0808EVAL\140C00015EE0 00016B6F 00000C90 (\3C073216.) OCTA  4
X        \0808EXEC\140C00016B70 00017BAF 00001040 (\3C074160.) OCTA  4
X        \0808FENCES\160A00017BB0\0906E7F 000002D0 (\3C08720.) OCTA  4
X        \0808FILE\140C00017E80 00018CC9 00000E4A (\3C073658.) OCTA  4
X        \0808FILEC\150B00018CD0 000193E7 00000718 (\3C071816.) OCTA  4
X        \0808FILEIO\160A000193F0\090680F 00000420 (\3C071056.) OCTA  4
X        \0808FINDERR\170900019810\0906C3F 00000430 (\3C071072.) OCTA  4
X        \0808GLOB\140C00019C40\0906F17 000002D8 (\3C08728.) OCTA  4
X        \0808GLOBALS\170900019F20 0001A0C7 000001A8 (\3C08424.) OCTA  4
X        \0808HISTORY\17090001A0D0\090660F 00000540 (\3C071344.) OCTA  4
X        \0808INPUT\150B0001A610 0001B52B 00000F1C (\3C073868.) OCTA  4
X        \0808INSERT\160A0001B530\0906E9F 00000970 (\3C072416.) OCTA  4
X        \0808ITBUFF\160A0001BEA0 0001C07F 000001E0 (\3C08480.) OCTA  4
X        \0808ISEARCH\17090001C080\090634F 000002D0 (\3C08720.) OCTA  4
X        \0808LINE\140C0001C350\0906C0F 000008C0 (\3C072240.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page    3
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
X$LINK$        \0808\100A00010000 00024B3F 00014B40 (\360684800.) OCTA  4 NOPIC
V,CON,REL,LCL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD  `20
X        \0808MAP\130D0001CC10 0001D3F7 000007E8 (\3C072024.) OCTA  4
X        \0808MENU\140C0001D400\0906A8F 00000690 (\3C071680.) OCTA  4
X        \0808MODES\150B0001DA90 0001EB0A 0000107B (\3C074219.) OCTA  4
X        \0808MSGS\140C0001EB10\0906CAF 000001A0 (\3C08416.) OCTA  4
X        \0808ONELINER\18080001ECB0 0001F18F 000004E0 (\3C071248.) OCTA  4
X        \0808OPERS\150B0001F190\09069A7 00000818 (\3C072072.) OCTA  4
X        \0808PATH\140C0001F9B0\0906E37 00000488 (\3C071160.) OCTA  4
X        \0808RANDOM\160A0001FE40 0002071F 000008E0 (\3C072272.) OCTA  4
X        \0808REGEXP\160A00020720\0906B0D 000003EE (\3C071006.) OCTA  4
X        \0808REGION\160A00020B10 000212AF 000007A0 (\3C071952.) OCTA  4
X        \0808SEARCH\160A000212B0\09067FF 00000550 (\3C071360.) OCTA  4
X        \0808SELECT\160A00021800\0906FC7 000007C8 (\3C071992.) OCTA  4
X        \0808SPAWN\150B00021FD0 00022497 000004C8 (\3C071224.) OCTA  4
X        \0808TAGS\140C000224A0\0906BC7 00000728 (\3C071832.) OCTA  4
X        \0808TBUFF\150B00022BD0\0906DEF 00000220 (\3C08544.) OCTA  4
X        \0808TERMIO\160A00022DF0 0002319F 000003B0 (\3C08944.) OCTA  4
X        \0808UNDO\140C000231A0\090664F 000004B0 (\3C071200.) OCTA  4
X        \0808VERSION\170900023650\09067FF 000001B0 (\3C08432.) OCTA  4
X        \0808VMS2UNIX\180800023800\0906C9F 000004A0 (\3C071184.) OCTA  4
X        \0808VMSPIPE\170900023CA0\0906E2F 00000190 (\3C08400.) OCTA  4
X        \0808WINDOW\160A00023E30 00024587 00000758 (\3C071880.) OCTA  4
X        \0808WORD\140C00024590\0906A1F 00000490 (\3C071168.) OCTA  4
X        \0808WORDMOV\170900024A20\0906B3F 00000120 (\3C08288.) OCTA  4
X$LITERAL$        \0808\100700024B40 0002F0AF 0000A570 (\330642352.) OCTA  4`20
V  PIC,CON,REL,LCL,  SHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00024B40 000252B4 00000775 (\3C071909.) OCTA  4
X        \0808X11\130D000252C0\0906AD1 00000812 (\3C072066.) OCTA  4
X        \0808BASIC\150B00025AE0\0907F4 00000015 (\3C0921.) OCTA  4
X        \0808BIND\140C00025B00\0906F01 00000402 (\3C071026.) OCTA  4
X        \0808BUFFER\160A00025F10 00026197 00000288 (\3C08648.) OCTA  4
X        \0808CRYPT\150B000261A0\0907CF 00000030 (\3C0948.) OCTA  4
X        \0808DISPLAY\1709000261D0\0906495 000002C6 (\3C08710.) OCTA  4
X        \0808EVAL\140C000264A0\09066AF 00000210 (\3C08528.) OCTA  4
X        \0808EXEC\140C000266B0\0906BE9 0000053A (\3C071338.) OCTA  4
X        \0808EXTERNS\170900026BF0 0002CC3F 00006050 (\3C0624656.) OCTA  4
X        \0808FILE\140C0002CC40\0906F24 000002E5 (\3C08741.) OCTA  4
X        \0808FILEC\150B0002CF30\0907D6 000000A7 (\3C08167.) OCTA  4
X        \0808FILEIO\160A0002CFE0 0002D046 00000067 (\3C08103.) OCTA  4
X        \0808FINDERR\17090002D050\0906242 000001F3 (\3C08499.) OCTA  4
X        \0808GLOB\140C0002D250\09076F 00000020 (\3C0932.) OCTA  4
X        \0808GLOBALS\17090002D270\0907C9 0000005A (\3C0990.) OCTA  4
X        \0808HISTORY\17090002D2D0\0907E8 00000019 (\3C0925.) OCTA  4
X        \0808INPUT\150B0002D2F0\09063B0 000000C1 (\3C08193.) OCTA  4
X        \0808INSERT\160A0002D3C0\0907EB 0000002C (\3C0944.) OCTA  4
X        \0808ISEARCH\17090002D3F0\090646A 0000007B (\3C08123.) OCTA  4
X        \0808LINE\140C0002D470\0907D5 00000066 (\3C08102.) OCTA  4
X        \0808MAP\130D0002D4E0\0906595 000000B6 (\3C08182.) OCTA  4
X        \0808MENU\140C0002D5A0\09066A8 00000109 (\3C08265.) OCTA  4
X        \0808MODES\150B0002D6B0\0906A30 00000381 (\3C08897.) OCTA  4
X        \0808ONELINER\18080002DA40\0906CCD 0000028E (\3C08654.) OCTA  4
X        \0808OPERS\150B0002DCD0\0906DA5 000000D6 (\3C08214.) OCTA  4
X        \0808PATH\140C0002DDB0\0907C4 00000015 (\3C0921.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page    4
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
X$LITERAL$        \0808\100700024B40 0002F0AF 0000A570 (\330642352.) OCTA  4`20
V  PIC,CON,REL,LCL,  SHR,NOEXE,NOWRT,NOVEC,  MOD  `20
X        \0808RANDOM\160A0002DDD0\0906E96 000000C7 (\3C08199.) OCTA  4
X        \0808REGEXP\160A0002DEA0 0002E203 00000364 (\3C08868.) OCTA  4
X        \0808REGION\160A0002E210\0907C1 000000B2 (\3C08178.) OCTA  4
X        \0808SEARCH\160A0002E2D0\09063A1 000000D2 (\3C08210.) OCTA  4
X        \0808SELECT\160A0002E3B0\0906627 00000278 (\3C08632.) OCTA  4
X        \0808SPAWN\150B0002E630\0906731 00000102 (\3C08258.) OCTA  4
X        \0808TAGS\140C0002E740\090688A 0000014B (\3C08331.) OCTA  4
X        \0808UNDO\140C0002E890\0906A2D 0000019E (\3C08414.) OCTA  4
X        \0808VERSION\17090002EA30\0906EC1 00000492 (\3C071170.) OCTA  4
X        \0808VMSPIPE\17090002EED0\0906F07 00000038 (\3C0956.) OCTA  4
X        \0808WINDOW\160A0002EF10 0002F062 00000153 (\3C08339.) OCTA  4
X        \0808WORD\140C0002F070\0907A0 00000031 (\3C0949.) OCTA  4
X$READONLY$        \0808\10060002F0B0\0906D2F 00000C80 (\32073200.) OCTA  4   P
VIC,CON,REL,LCL,  SHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C0002F0B0\0906A6F 000009C0 (\3C072496.) OCTA  4
X        \0808X11\130D0002FA70\0906C0F 000001A0 (\3C08416.) OCTA  4
X        \0808EVAL\140C0002FC10\0908F 00000010 (\3C0916.) OCTA  4
X        \0808EXEC\140C0002FC20\0908F 00000010 (\3C0916.) OCTA  4
X        \0808FINDERR\17090002FC30\090767 00000038 (\3C0956.) OCTA  4
X        \0808INPUT\150B0002FC70\09083 00000004 (\3C0A4.) OCTA  4
X        \0808ISEARCH\17090002FC80\0908F 00000010 (\3C0916.) OCTA  4
X        \0808MODES\150B0002FC90\0907AF 00000020 (\3C0932.) OCTA  4
X        \0808SEARCH\160A0002FCB0\0906D0F 00000060 (\3C0996.) OCTA  4
X        \0808SPAWN\150B0002FD10\09087 00000008 (\3C0A8.) OCTA  4
X        \0808VMS2UNIX\18080002FD20\0908F 00000010 (\3C0916.) OCTA  4
X$READONLY_ADDR$        \0808 0002FD30\0906FBF 00000290 (\2D08656.) OCTA  4   P
VIC,CON,REL,LCL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C0002FD30\0907BF 00000090 (\3C08144.) OCTA  4
X        \0808BIND\140C0002FDC0\0906E5F 000000A0 (\3C08160.) OCTA  4
X        \0808EXEC\140C0002FE60\0907B7 00000058 (\3C0988.) OCTA  4
X        \0808FINDERR\17090002FEC0\0907E7 00000028 (\3C0940.) OCTA  4
X        \0808MODES\150B0002FEF0\0906F5F 00000070 (\3C08112.) OCTA  4
X        \0808VERSION\17090002FF60\0907B7 00000058 (\3C0988.) OCTA  4
XABBR_BUFNAME        \0808    0002FFC0\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C0002FFC0\0908F 00000010 (\3C0916.) OCTA  4
XALL_MODES        \0808\10070002FFD0 0003045F 00000490 (\33071168.) OCTA  4 NOP
VIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C0002FFD0 0003045F 00000490 (\3C071168.) OCTA  4
XALL_SUBMODES        \0808    00030460\090661B 000001BC (\3008444.) OCTA  4 NOP
VIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00030460\090661B 000001BC (\3C08444.) OCTA  4
XBINDINGLIST_BUFNAME             00030620\0908F 00000010 (\290916.) OCTA  4 NOP
VIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00030620\0908F 00000010 (\3C0916.) OCTA  4
XBUFFERLIST_BUFNAME        \080600030630\0908F 00000010 (\2A0916.) OCTA  4 NOPI
VC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00030630\0908F 00000010 (\3C0916.) OCTA  4
XB_VALNAMES        \0808\100600030640\090690F 000002D0 (\3208720.) OCTA  4 NOPI
VC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00030640\090690F 000002D0 (\3C08720.) OCTA  4
XCOMPLETIONS_BUFNAME             00030910\0908F 00000010 (\290916.) OCTA  4 NOP
VIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00030910\0908F 00000010 (\3C0916.) OCTA  4
XDIRCOMPLETION_BUFNAME           00030920\0908F 00000010 (\270916.) OCTA  4 NOP
VIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00030920\0908F 00000010 (\3C0916.) OCTA  4
XENVARS        \0808\100A00030930\0906A2B 000000FC (\3608252.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00030930\0906A2B 000000FC (\3C08252.) OCTA  4
XERRORS_BUFNAME        \0808  00030A30\090747 00000018 (\2E0924.) OCTA  4 NOPIC
V,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00030A30\090747 00000018 (\3C0924.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page    5
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XFILECOMPLETION_BUFNAME          00030A50\090767 00000018 (\260924.) OCTA  4 NO
VPIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00030A50\090767 00000018 (\3C0924.) OCTA  4
XFUNCS        \0808\100B00030A70\0906B9F 00000130 (\3708304.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00030A70\0906B9F 00000130 (\3C08304.) OCTA  4
XF_ABBREV        \0808\100800030BA0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030BA0\0908F 00000010 (\3C0916.) OCTA  4
XF_ALTBUFF        \0808\100700030BB0\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030BB0\0908F 00000010 (\3C0916.) OCTA  4
XF_APPEND        \0808\100800030BC0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030BC0\0908F 00000010 (\3C0916.) OCTA  4
XF_APPENDEOL        \0808     00030BD0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030BD0\0908F 00000010 (\3C0916.) OCTA  4
XF_APPSTRING        \0808     00030BE0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030BE0\0908F 00000010 (\3C0916.) OCTA  4
XF_BACKBLINE        \0808     00030BF0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030BF0\0908F 00000010 (\3C0916.) OCTA  4
XF_BACKCHAR        \0808\100600030C00\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030C00\0908F 00000010 (\3C0916.) OCTA  4
XF_BACKCHAR_TO_BOL        \080700030C10\0908F 00000010 (\2B0916.) OCTA  4 NOPIC
V,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030C10\0908F 00000010 (\3C0916.) OCTA  4
XF_BACKDELCHAR        \0808   00030C20\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030C20\0908F 00000010 (\3C0916.) OCTA  4
XF_BACKHPAGE        \0808     00030C30\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030C30\0908F 00000010 (\3C0916.) OCTA  4
XF_BACKHUNT        \0808\100600030C40\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030C40\0908F 00000010 (\3C0916.) OCTA  4
XF_BACKLINE        \0808\100600030C50\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030C50\0908F 00000010 (\3C0916.) OCTA  4
XF_BACKPAGE        \0808\100600030C60\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030C60\0908F 00000010 (\3C0916.) OCTA  4
XF_BACKSEARCH        \0808    00030C70\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030C70\0908F 00000010 (\3C0916.) OCTA  4
XF_BACKUNDO        \0808\100600030C80\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030C80\0908F 00000010 (\3C0916.) OCTA  4
XF_BACKVIWORD        \0808    00030C90\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030C90\0908F 00000010 (\3C0916.) OCTA  4
+-+-+-+-+-+-+-+-  END  OF PART 133 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 134 -+-+-+-+-+-+-+-+
XF_BACKWORD        \0808\100600030CA0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030CA0\0908F 00000010 (\3C0916.) OCTA  4
XF_BCSRCH        \0808\100800030CB0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030CB0\0908F 00000010 (\3C0916.) OCTA  4
XF_BCSRCH_TO        \0808     00030CC0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030CC0\0908F 00000010 (\3C0916.) OCTA  4
XF_BINDKEY        \0808\100700030CD0\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030CD0\0908F 00000010 (\3C0916.) OCTA  4
XF_BKTOSHELL        \0808     00030CE0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030CE0\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF1        \0808\100900030CF0\0908F 00000010 (\350916.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030CF0\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF10        \0808\100800030D00\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030D00\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF11        \0808\100800030D10\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030D10\0908F 00000010 (\3C0916.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page    6
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_CBUF12        \0808\100800030D20\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030D20\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF13        \0808\100800030D30\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030D30\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF14        \0808\100800030D40\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030D40\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF15        \0808\100800030D50\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030D50\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF16        \0808\100800030D60\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030D60\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF17        \0808\100800030D70\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030D70\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF18        \0808\100800030D80\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030D80\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF19        \0808\100800030D90\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030D90\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF2        \0808\100900030DA0\0908F 00000010 (\350916.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030DA0\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF20        \0808\100800030DB0 \0907F 00000010 (\340916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030DB0\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF21        \0808\100800030DC0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030DC0\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF22        \0808\100800030DD0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030DD0\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF23        \0808\100800030DE0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030DE0\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF24        \0808\100800030DF0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030DF0\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF25        \0808\100800030E00\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030E00\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF26        \0808\100800030E10\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030E10\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF27        \0808\100800030E20\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030E20\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF28        \0808\100800030E30\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030E30\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF29        \0808\100800030E40\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030E40\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF3        \0808\100900030E50\0908F 00000010 (\350916.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030E50\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF30        \0808\100800030E60 \0907F 00000010 (\340916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030E60\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF31        \0808\100800030E70\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030E70\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF32        \0808\100800030E80\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030E80\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF33        \0808\100800030E90\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030E90\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF34        \0808\100800030EA0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030EA0\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF35        \0808\100800030EB0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030EB0\0908F 00000010 (\3C0916.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page    7
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_CBUF36        \0808\100800030EC0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030EC0\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF37        \0808\100800030ED0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030ED0\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF38        \0808\100800030EE0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030EE0\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF39        \0808\100800030EF0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030EF0\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF4        \0808\100900030F00\0908F 00000010 (\350916.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030F00\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF40        \0808\100800030F10 \0907F 00000010 (\340916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030F10\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF5        \0808\100900030F20\0908F 00000010 (\350916.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030F20\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF6        \0808\100900030F30\0908F 00000010 (\350916.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030F30\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF7        \0808\100900030F40\0908F 00000010 (\350916.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030F40\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF8        \0808\100900030F50\0908F 00000010 (\350916.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030F50\0908F 00000010 (\3C0916.) OCTA  4
XF_CBUF9        \0808\100900030F60\0908F 00000010 (\350916.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030F60\0908F 00000010 (\3C0916.) OCTA  4
XF_CD        \0808\100C00030F70\0908F 00000010 (\380916.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030F70\0908F 00000010 (\3C0916.) OCTA  4
XF_CHGCHAR        \0808\100700030F80\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030F80\0908F 00000010 (\3C0916.) OCTA  4
XF_CHGLINE        \0808\100700030F90\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030F90\0908F 00000010 (\3C0916.) OCTA  4
XF_CHGTOEOL        \0808\100600030FA0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030FA0\0908F 00000010 (\3C0916.) OCTA  4
XF_CLEAR_MATCH_ATTRS             00030FB0\0908F 00000010 (\290916.) OCTA  4 NOP
VIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030FB0\0908F 00000010 (\3C0916.) OCTA  4
XF_CLRMES        \0808\100800030FC0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030FC0\0908F 00000010 (\3C0916.) OCTA  4
XF_CNTL_A_FUNC        \0808   00030FD0\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030FD0\0908F 00000010 (\3C0916.) OCTA  4
XF_CNTL_X_FUNC        \0808   00030FE0\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030FE0\0908F 00000010 (\3C0916.) OCTA  4
XF_COMP_ERR_EXPS        \0808 00030FF0\0908F 00000010 (\2D0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900030FF0\0908F 00000010 (\3C0916.) OCTA  4
XF_CONSEARCH        \0808     00031000\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031000\0908F 00000010 (\3C0916.) OCTA  4
XF_COPY_TO_CLIPBOARD             00031010\0908F 00000010 (\290916.) OCTA  4 NOP
VIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031010\0908F 00000010 (\3C0916.) OCTA  4
XF_DEFINE_MODE        \0808   00031020\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031020\0908F 00000010 (\3C0916.) OCTA  4
XF_DEFINE_SUBMODE        \080800031030\0908F 00000010 (\2C0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031030\0908F 00000010 (\3C0916.) OCTA  4
XF_DELGLOBMODE        \0808   00031040\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031040\0908F 00000010 (\3C0916.) OCTA  4
XF_DELLOCMODE        \0808    00031050\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031050\0908F 00000010 (\3C0916.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page    8
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_DELTOEOL        \0808\100600031060\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031060\0908F 00000010 (\3C0916.) OCTA  4
XF_DELWIND        \0808\100700031070\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031070\0908F 00000010 (\3C0916.) OCTA  4
XF_DESAPRO        \0808\100700031080\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031080\0908F 00000010 (\3C0916.) OCTA  4
XF_DESBIND        \0808\100700031090\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031090\0908F 00000010 (\3C0916.) OCTA  4
XF_DESFUNC        \0808\1007000310A0\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000310A0\0908F 00000010 (\3C0916.) OCTA  4
XF_DESKEY        \0808\1008000310B0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000310B0\0908F 00000010 (\3C0916.) OCTA  4
XF_DESMOTIONS        \0808    000310C0\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000310C0\0908F 00000010 (\3C0916.) OCTA  4
XF_DESOPERS        \0808\1006000310D0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000310D0\0908F 00000010 (\3C0916.) OCTA  4
XF_DESPRINT        \0808\1006000310E0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000310E0\0908F 00000010 (\3C0916.) OCTA  4
XF_DOTCMDPLAY        \0808    000310F0\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000310F0\0908F 00000010 (\3C0916.) OCTA  4
XF_ENLARGEWIND        \0808   00031100\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031100\0908F 00000010 (\3C0916.) OCTA  4
XF_ESC_FUNC        \0808\100600031110\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031110\0908F 00000010 (\3C0916.) OCTA  4
XF_EX        \0808\100C00031120\0908F 00000010 (\380916.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031120\0908F 00000010 (\3C0916.) OCTA  4
XF_EXECBUF        \0808\100700031130\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031130\0908F 00000010 (\3C0916.) OCTA  4
XF_EXECFILE        \0808\100600031140\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031140\0908F 00000010 (\3C0916.) OCTA  4
XF_EXECHYPERCMD        \0808  00031150\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031150\0908F 00000010 (\3C0916.) OCTA  4
XF_EXECKREG        \0808\100600031160\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031160\0908F 00000010 (\3C0916.) OCTA  4
XF_EXECPROC        \0808\100600031170\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031170\0908F 00000010 (\3C0916.) OCTA  4
XF_FCSRCH        \0808\100800031180\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031180\0908F 00000010 (\3C0916.) OCTA  4
XF_FCSRCH_TO        \0808     00031190\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031190\0908F 00000010 (\3C0916.) OCTA  4
XF_FILEFIND        \0808\1006000311A0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000311A0\0908F 00000010 (\3C0916.) OCTA  4
XF_FILENAME        \0808\1006000311B0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000311B0\0908F 00000010 (\3C0916.) OCTA  4
XF_FILEREAD        \0808\1006000311C0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000311C0\0908F 00000010 (\3C0916.) OCTA  4
XF_FILESAVE        \0808\1006000311D0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000311D0\0908F 00000010 (\3C0916.) OCTA  4
XF_FILEWRITE        \0808     000311E0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000311E0\0908F 00000010 (\3C0916.) OCTA  4
XF_FINDERR        \0808\1007000311F0\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000311F0\0908F 00000010 (\3C0916.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page    9
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_FINDERRBUF        \0808    00031200\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031200\0908F 00000010 (\3C0916.) OCTA  4
XF_FIRSTBUFFER        \0808   00031210\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031210\0908F 00000010 (\3C0916.) OCTA  4
XF_FIRSTNONWHITE        \0808 00031220\0908F 00000010 (\2D0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031220\0908F 00000010 (\3C0916.) OCTA  4
XF_FISEARCH        \0808\100600031230\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031230\0908F 00000010 (\3C0916.) OCTA  4
XF_FLIPCHAR        \0808\100600031240\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031240\0908F 00000010 (\3C0916.) OCTA  4
XF_FORCEBLANK        \0808    00031250\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031250\0908F 00000010 (\3C0916.) OCTA  4
XF_FORWBLINE        \0808     00031260\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031260\0908F 00000010 (\3C0916.) OCTA  4
XF_FORWCHAR        \0808\100600031270\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031270\0908F 00000010 (\3C0916.) OCTA  4
XF_FORWCHAR_TO_EOL        \080700031280\0908F 00000010 (\2B0916.) OCTA  4 NOPIC
V,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031280\0908F 00000010 (\3C0916.) OCTA  4
XF_FORWDELCHAR        \0808   00031290\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031290\0908F 00000010 (\3C0916.) OCTA  4
XF_FORWENDW        \0808\1006000312A0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000312A0\0908F 00000010 (\3C0916.) OCTA  4
XF_FORWHPAGE        \0808     000312B0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000312B0\0908F 00000010 (\3C0916.) OCTA  4
XF_FORWHUNT        \0808\1006000312C0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000312C0\0908F 00000010 (\3C0916.) OCTA  4
XF_FORWLINE        \0808\1006000312D0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000312D0\0908F 00000010 (\3C0916.) OCTA  4
XF_FORWPAGE        \0808\1006000312E0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000312E0\0908F 00000010 (\3C0916.) OCTA  4
XF_FORWREDO        \0808\1006000312F0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000312F0\0908F 00000010 (\3C0916.) OCTA  4
XF_FORWSEARCH        \0808    00031300\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031300\0908F 00000010 (\3C0916.) OCTA  4
XF_FORWVIENDW        \0808    00031310\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031310\0908F 00000010 (\3C0916.) OCTA  4
XF_FORWVIWORD        \0808    00031320\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031320\0908F 00000010 (\3C0916.) OCTA  4
XF_FORWWORD        \0808\100600031330\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031330\0908F 00000010 (\3C0916.) OCTA  4
XF_GLOBALS        \0808\100700031340\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031340\0908F 00000010 (\3C0916.) OCTA  4
XF_GODOTPLUS        \0808     00031350\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031350\0908F 00000010 (\3C0916.) OCTA  4
XF_GOEXACTNMMARK        \0808 00031360\0908F 00000010 (\2D0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031360\0908F 00000010 (\3C0916.) OCTA  4
XF_GOLINENMMARK        \0808  00031370\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031370\0908F 00000010 (\3C0916.) OCTA  4
XF_GOMARK        \0808\100800031380\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031380\0908F 00000010 (\3C0916.) OCTA  4
XF_GORECTNMMARK        \0808  00031390\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031390\0908F 00000010 (\3C0916.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   10
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_GOTOBOB        \0808\1007000313A0\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000313A0\0908F 00000010 (\3C0916.) OCTA  4
XF_GOTOBOL        \0808\1007000313B0\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000313B0\0908F 00000010 (\3C0916.) OCTA  4
XF_GOTOBOP        \0808\1007000313C0\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000313C0\0908F 00000010 (\3C0916.) OCTA  4
XF_GOTOBOS        \0808\1007000313D0\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000313D0\0908F 00000010 (\3C0916.) OCTA  4
XF_GOTOBOSEC        \0808     000313E0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000313E0\0908F 00000010 (\3C0916.) OCTA  4
XF_GOTOBOSENT        \0808    000313F0\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000313F0\0908F 00000010 (\3C0916.) OCTA  4
XF_GOTOCOL        \0808\100700031400\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031400\0908F 00000010 (\3C0916.) OCTA  4
XF_GOTOEOB        \0808\100700031410\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031410\0908F 00000010 (\3C0916.) OCTA  4
XF_GOTOEOL        \0808\100700031420\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031420\0908F 00000010 (\3C0916.) OCTA  4
XF_GOTOEOP        \0808\100700031430\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031430\0908F 00000010 (\3C0916.) OCTA  4
XF_GOTOEOS        \0808\100700031440\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031440\0908F 00000010 (\3C0916.) OCTA  4
XF_GOTOEOSEC        \0808     00031450\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031450\0908F 00000010 (\3C0916.) OCTA  4
XF_GOTOEOSENT        \0808    00031460\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031460\0908F 00000010 (\3C0916.) OCTA  4
XF_GOTOLINE        \0808\100600031470\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031470\0908F 00000010 (\3C0916.) OCTA  4
XF_GOTOMOS        \0808\100700031480\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031480\0908F 00000010 (\3C0916.) OCTA  4
XF_GOTOTAG        \0808\100700031490\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031490\0908F 00000010 (\3C0916.) OCTA  4
XF_HELP        \0808\100A000314A0\0908F 00000010 (\360916.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000314A0\0908F 00000010 (\3C0916.) OCTA  4
XF_HISTBUFF        \0808\1006000314B0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000314B0\0908F 00000010 (\3C0916.) OCTA  4
XF_INF_UNDO        \0808\1006000314C0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000314C0\0908F 00000010 (\3C0916.) OCTA  4
XF_INSERT        \0808\1008000314D0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000314D0\0908F 00000010 (\3C0916.) OCTA  4
XF_INSERTBOL        \0808     000314E0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000314E0\0908F 00000010 (\3C0916.) OCTA  4
XF_INSERT_NO_AINDENT             000314F0\0908F 00000010 (\290916.) OCTA  4 NOP
VIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000314F0\0908F 00000010 (\3C0916.) OCTA  4
XF_INSFILE        \0808\100700031500\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031500\0908F 00000010 (\3C0916.) OCTA  4
XF_INSSPACE        \0808\100600031510\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031510\0908F 00000010 (\3C0916.) OCTA  4
XF_INSSTRING        \0808     00031520\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031520\0908F 00000010 (\3C0916.) OCTA  4
XF_JOINLINES        \0808     00031530\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031530\0908F 00000010 (\3C0916.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   11
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_KBD_MAC_BEGIN        \0808 00031540\0908F 00000010 (\2D0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031540\0908F 00000010 (\3C0916.) OCTA  4
XF_KBD_MAC_END        \0808   00031550\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031550\0908F 00000010 (\3C0916.) OCTA  4
XF_KBD_MAC_EXEC        \0808  00031560\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031560\0908F 00000010 (\3C0916.) OCTA  4
XF_KBD_MAC_SAVE        \0808  00031570\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031570\0908F 00000010 (\3C0916.) OCTA  4
XF_KILLBUFFER        \0808    00031580\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031580\0908F 00000010 (\3C0916.) OCTA  4
XF_LASTNONWHITE        \0808  00031590\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031590\0908F 00000010 (\3C0916.) OCTA  4
+-+-+-+-+-+-+-+-  END  OF PART 134 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 135 -+-+-+-+-+-+-+-+
XF_LINEPUTAFTER        \0808  000315A0\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000315A0\0908F 00000010 (\3C0916.) OCTA  4
XF_LINEPUTBEFORE        \0808 000315B0\0908F 00000010 (\2D0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000315B0\0908F 00000010 (\3C0916.) OCTA  4
XF_LINEUNDO        \0808\1006000315C0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000315C0\0908F 00000010 (\3C0916.) OCTA  4
XF_LISTBUFFERS        \0808   000315D0\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000315D0\0908F 00000010 (\3C0916.) OCTA  4
XF_LISTMODES        \0808     000315E0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000315E0\0908F 00000010 (\3C0916.) OCTA  4
XF_LISTVARS        \0808\1006000315F0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000315F0\0908F 00000010 (\3C0916.) OCTA  4
XF_LIST_MAJORMODES        \080700031600\0908F 00000010 (\2B0916.) OCTA  4 NOPIC
V,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031600\0908F 00000010 (\3C0916.) OCTA  4
XF_LOADKREG        \0808\100600031610\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031610\0908F 00000010 (\3C0916.) OCTA  4
XF_MAP        \0808\100B00031620\0908F 00000010 (\370916.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031620\0908F 00000010 (\3C0916.) OCTA  4
XF_MAP_BANG        \0808\100600031630\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031630\0908F 00000010 (\3C0916.) OCTA  4
XF_MATCHFENCE        \0808    00031640\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031640\0908F 00000010 (\3C0916.) OCTA  4
XF_MATCHFENCEBACK        \080800031650\0908F 00000010 (\2C0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031650\0908F 00000010 (\3C0916.) OCTA  4
XF_MOUSE_MOTION        \0808  00031660\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031660\0908F 00000010 (\3C0916.) OCTA  4
XF_MULTIMOTION        \0808   00031670\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031670\0908F 00000010 (\3C0916.) OCTA  4
XF_MULTIMOTIONFULLLINE           00031680\0908F 00000010 (\270916.) OCTA  4 NOP
VIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031680\0908F 00000010 (\3C0916.) OCTA  4
XF_MULTIMOTIONRECTANGLE          00031690\0908F 00000010 (\260916.) OCTA  4 NOP
VIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031690\0908F 00000010 (\3C0916.) OCTA  4
XF_MVDNNXTWIND        \0808   000316A0\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000316A0\0908F 00000010 (\3C0916.) OCTA  4
XF_MVDNWIND        \0808\1006000316B0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000316B0\0908F 00000010 (\3C0916.) OCTA  4
XF_MVLEFTWIND        \0808    000316C0\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000316C0\0908F 00000010 (\3C0916.) OCTA  4
XF_MVRIGHTWIND        \0808   000316D0\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000316D0\0908F 00000010 (\3C0916.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   12
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_MVUPNXTWIND        \0808   000316E0\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000316E0\0908F 00000010 (\3C0916.) OCTA  4
XF_MVUPWIND        \0808\1006000316F0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000316F0\0908F 00000010 (\3C0916.) OCTA  4
XF_NAMEBUFFER        \0808    00031700\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031700\0908F 00000010 (\3C0916.) OCTA  4
XF_NAMEDCMD        \0808\100600031710\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031710\0908F 00000010 (\3C0916.) OCTA  4
XF_NEWLENGTH        \0808     00031720\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031720\0908F 00000010 (\3C0916.) OCTA  4
XF_NEWLINE        \0808\100700031730\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031730\0908F 00000010 (\3C0916.) OCTA  4
XF_NEWPROCESSGROUP        \080700031740\0908F 00000010 (\2B0916.) OCTA  4 NOPIC
V,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031740\0908F 00000010 (\3C0916.) OCTA  4
XF_NEWWIDTH        \0808\100600031750\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031750\0908F 00000010 (\3C0916.) OCTA  4
XF_NEXTBUFFER        \0808    00031760\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031760\0908F 00000010 (\3C0916.) OCTA  4
XF_NEXTTAG        \0808\100700031770\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031770\0908F 00000010 (\3C0916.) OCTA  4
XF_NEXTWIND        \0808\100600031780\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031780\0908F 00000010 (\3C0916.) OCTA  4
XF_NOREMAP        \0808\100700031790\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031790\0908F 00000010 (\3C0916.) OCTA  4
XF_NOREMAP_BANG        \0808  000317A0\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000317A0\0908F 00000010 (\3C0916.) OCTA  4
XF_NULLPROC        \0808\1006000317B0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000317B0\0908F 00000010 (\3C0916.) OCTA  4
XF_ONLYWIND        \0808\1006000317C0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000317C0\0908F 00000010 (\3C0916.) OCTA  4
XF_OPENDOWN        \0808\1006000317D0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000317D0\0908F 00000010 (\3C0916.) OCTA  4
XF_OPENDOWN_NO_AINDENT           000317E0\0908F 00000010 (\270916.) OCTA  4 NOP
VIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000317E0\0908F 00000010 (\3C0916.) OCTA  4
XF_OPENUP        \0808\1008000317F0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000317F0\0908F 00000010 (\3C0916.) OCTA  4
XF_OPENUP_NO_AINDENT             00031800\0908F 00000010 (\290916.) OCTA  4 NOP
VIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031800\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERATTRBOLD        \0808  00031810\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031810\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERATTRCASEQ        \0808 00031820\0908F 00000010 (\2D0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031820\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERATTRHC        \0808    00031830\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031830\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERATTRITAL        \0808  00031840\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031840\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERATTRNO        \0808    00031850\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031850\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERATTRREV        \0808   00031860\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031860\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERATTRUL        \0808    00031870\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031870\0908F 00000010 (\3C0916.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   13
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_OPERBLANK        \0808     00031880\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031880\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERCHG        \0808\100700031890\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031890\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERCOPY        \0808\1006000318A0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000318A0\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERCRYPT        \0808     000318B0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000318B0\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERDEL        \0808\1007000318C0\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000318C0\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERDETAB        \0808     000318D0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000318D0\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERENTAB        \0808     000318E0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000318E0\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERFILTER        \0808    000318F0\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000318F0\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERFLIP        \0808\100600031900\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031900\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERFORMAT        \0808    00031910\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031910\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERGLOBALS        \0808   00031920\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031920\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERJOIN        \0808\100600031930\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031930\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERLINECHG        \0808   00031940\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031940\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERLINEDEL        \0808   00031950\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031950\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERLINEYANK        \0808  00031960\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031960\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERLIST        \0808\100600031970\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031970\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERLOWER        \0808     00031980\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031980\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERLSHIFT        \0808    00031990\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031990\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERMOVE        \0808\1006000319A0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000319A0\0908F 00000010 (\3C0916.) OCTA  4
XF_OPEROPENRECT        \0808  000319B0\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000319B0\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERPPRINT        \0808    000319C0\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000319C0\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERPRINT        \0808     000319D0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000319D0\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERRSHIFT        \0808    000319E0\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000319E0\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERSELECT        \0808    000319F0\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000319F0\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERSUBST        \0808     00031A00\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031A00\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERSUBSTAGAIN        \080800031A10\0908F 00000010 (\2C0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031A10\0908F 00000010 (\3C0916.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   14
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_OPERTRANSF        \0808    00031A20\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031A20\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERTRIM        \0808\100600031A30\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031A30\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERUPPER        \0808     00031A40\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031A40\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERVGLOBALS        \0808  00031A50\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031A50\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERWRITE        \0808     00031A60\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031A60\0908F 00000010 (\3C0916.) OCTA  4
XF_OPERYANK        \0808\100600031A70\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031A70\0908F 00000010 (\3C0916.) OCTA  4
XF_OVERWRITECHARS        \080800031A80\0908F 00000010 (\2C0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031A80\0908F 00000010 (\3C0916.) OCTA  4
XF_OVERWSTRING        \0808   00031A90\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031A90\0908F 00000010 (\3C0916.) OCTA  4
XF_PASTE_FROM_CLIPBOARD          00031AA0\0908F 00000010 (\260916.) OCTA  4 NOP
VIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031AA0\0908F 00000010 (\3C0916.) OCTA  4
XF_PIPECMD        \0808\100700031AB0\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031AB0\0908F 00000010 (\3C0916.) OCTA  4
XF_POSWIND        \0808\100700031AC0\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031AC0\0908F 00000010 (\3C0916.) OCTA  4
XF_POUNDC_FUNC        \0808   00031AD0\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031AD0\0908F 00000010 (\3C0916.) OCTA  4
XF_PREVWIND        \0808\100600031AE0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031AE0\0908F 00000010 (\3C0916.) OCTA  4
XF_PUTAFTER        \0808\100600031AF0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031AF0\0908F 00000010 (\3C0916.) OCTA  4
XF_PUTBEFORE        \0808     00031B00\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031B00\0908F 00000010 (\3C0916.) OCTA  4
XF_PWD        \0808\100B00031B10\0908F 00000010 (\370916.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031B10\0908F 00000010 (\3C0916.) OCTA  4
XF_QUICKEXIT        \0808     00031B20\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031B20\0908F 00000010 (\3C0916.) OCTA  4
XF_QUIT        \0808\100A00031B30\0908F 00000010 (\360916.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031B30\0908F 00000010 (\3C0916.) OCTA  4
XF_QUITHARD        \0808\100600031B40\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031B40\0908F 00000010 (\3C0916.) OCTA  4
XF_QUOTE        \0808\100900031B50\0908F 00000010 (\350916.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031B50\0908F 00000010 (\3C0916.) OCTA  4
XF_RECTPUTAFTER        \0808  00031B60\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031B60\0908F 00000010 (\3C0916.) OCTA  4
XF_RECTPUTBEFORE        \0808 00031B70\0908F 00000010 (\2D0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031B70\0908F 00000010 (\3C0916.) OCTA  4
XF_REMOVE_MODE        \0808   00031B80\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031B80\0908F 00000010 (\3C0916.) OCTA  4
XF_REMOVE_SUBMODE        \080800031B90\0908F 00000010 (\2C0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031B90\0908F 00000010 (\3C0916.) OCTA  4
XF_REPLACECHAR        \0808   00031BA0\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031BA0\0908F 00000010 (\3C0916.) OCTA  4
XF_REPOSITION        \0808    00031BB0\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031BB0\0908F 00000010 (\3C0916.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   15
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_REP_CSRCH        \0808     00031BC0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031BC0\0908F 00000010 (\3C0916.) OCTA  4
XF_RESIZE        \0808\100800031BD0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031BD0\0908F 00000010 (\3C0916.) OCTA  4
XF_RESPAWN        \0808\100700031BE0\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031BE0\0908F 00000010 (\3C0916.) OCTA  4
XF_RESTWND        \0808\100700031BF0\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031BF0\0908F 00000010 (\3C0916.) OCTA  4
XF_REVSEARCH        \0808     00031C00\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031C00\0908F 00000010 (\3C0916.) OCTA  4
XF_REV_CSRCH        \0808     00031C10\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031C10\0908F 00000010 (\3C0916.) OCTA  4
XF_RISEARCH        \0808\100600031C20\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031C20\0908F 00000010 (\3C0916.) OCTA  4
XF_SAVEWND        \0808\100700031C30\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031C30\0908F 00000010 (\3C0916.) OCTA  4
XF_SCRBACKSEARCH        \0808 00031C40\0908F 00000010 (\2D0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031C40\0908F 00000010 (\3C0916.) OCTA  4
XF_SCRFORWSEARCH        \0808 00031C50\0908F 00000010 (\2D0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031C50\0908F 00000010 (\3C0916.) OCTA  4
XF_SCRNEXTDW        \0808     00031C60\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031C60\0908F 00000010 (\3C0916.) OCTA  4
XF_SCRNEXTUP        \0808     00031C70\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031C70\0908F 00000010 (\3C0916.) OCTA  4
XF_SCRSEARCHPAT        \0808  00031C80\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031C80\0908F 00000010 (\3C0916.) OCTA  4
XF_SEL_MOTION        \0808    00031C90\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031C90\0908F 00000010 (\3C0916.) OCTA  4
XF_SETFILLCOL        \0808    00031CA0\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031CA0\0908F 00000010 (\3C0916.) OCTA  4
XF_SETGLOBMODE        \0808   00031CB0\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031CB0\0908F 00000010 (\3C0916.) OCTA  4
XF_SETLOCMODE        \0808    00031CC0\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031CC0\0908F 00000010 (\3C0916.) OCTA  4
XF_SETNMMARK        \0808     00031CD0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031CD0\0908F 00000010 (\3C0916.) OCTA  4
XF_SETTAB        \0808\100800031CE0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031CE0\0908F 00000010 (\3C0916.) OCTA  4
XF_SETVAR        \0808\100800031CF0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031CF0\0908F 00000010 (\3C0916.) OCTA  4
XF_SET_DOSMODE        \0808   00031D00\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031D00\0908F 00000010 (\3C0916.) OCTA  4
XF_SET_TERMCHRS        \0808  00031D10\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031D10\0908F 00000010 (\3C0916.) OCTA  4
XF_SET_UNIXMODE        \0808  00031D20\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031D20\0908F 00000010 (\3C0916.) OCTA  4
XF_SHOWCPOS        \0808\100600031D30\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031D30\0908F 00000010 (\3C0916.) OCTA  4
XF_SHOWHISTORY        \0808   00031D40\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031D40\0908F 00000010 (\3C0916.) OCTA  4
XF_SHOWHYPERCMD        \0808  00031D50\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031D50\0908F 00000010 (\3C0916.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   16
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_SHOWKREG        \0808\100600031D60\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031D60\0908F 00000010 (\3C0916.) OCTA  4
XF_SHOWLENGTH        \0808    00031D70\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031D70\0908F 00000010 (\3C0916.) OCTA  4
XF_SHOWTAGSTACK        \0808  00031D80\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031D80\0908F 00000010 (\3C0916.) OCTA  4
XF_SHOWVERSION        \0808   00031D90\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031D90\0908F 00000010 (\3C0916.) OCTA  4
XF_SHOW_TERMCHRS        \0808 00031DA0\0908F 00000010 (\2D0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031DA0\0908F 00000010 (\3C0916.) OCTA  4
XF_SHRINKWIND        \0808    00031DB0\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031DB0\0908F 00000010 (\3C0916.) OCTA  4
XF_SOURCE        \0808\100800031DC0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031DC0\0908F 00000010 (\3C0916.) OCTA  4
XF_SPAWN        \0808\100900031DD0\0908F 00000010 (\350916.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031DD0\0908F 00000010 (\3C0916.) OCTA  4
XF_SPAWNCLI        \0808\100600031DE0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031DE0\0908F 00000010 (\3C0916.) OCTA  4
XF_SPLITWIND        \0808     00031DF0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031DF0\0908F 00000010 (\3C0916.) OCTA  4
XF_STOREMAC        \0808\100600031E00\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031E00\0908F 00000010 (\3C0916.) OCTA  4
XF_STOREPROC        \0808     00031E10\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031E10\0908F 00000010 (\3C0916.) OCTA  4
XF_SUBST_AGAIN        \0808   00031E20\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031E20\0908F 00000010 (\3C0916.) OCTA  4
XF_SYSMAP        \0808\100800031E30\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031E30\0908F 00000010 (\3C0916.) OCTA  4
XF_TOGGLELISTBUFFERS             00031E40\0908F 00000010 (\290916.) OCTA  4 NOP
VIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031E40\0908F 00000010 (\3C0916.) OCTA  4
XF_TWIDDLE        \0808\100700031E50\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031E50\0908F 00000010 (\3C0916.) OCTA  4
XF_UE_SETKEY        \0808     00031E60\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031E60\0908F 00000010 (\3C0916.) OCTA  4
XF_UNABBR        \0808\100800031E70\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031E70\0908F 00000010 (\3C0916.) OCTA  4
XF_UNARG_FUNC        \0808    00031E80\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031E80\0908F 00000010 (\3C0916.) OCTA  4
XF_UNBINDKEY        \0808     00031E90\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031E90\0908F 00000010 (\3C0916.) OCTA  4
XF_UNDO        \0808\100A00031EA0\0908F 00000010 (\360916.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031EA0\0908F 00000010 (\3C0916.) OCTA  4
+-+-+-+-+-+-+-+-  END  OF PART 135 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 136 -+-+-+-+-+-+-+-+
XF_UNIMPL        \0808\100800031EB0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031EB0\0908F 00000010 (\3C0916.) OCTA  4
XF_UNMAP        \0808\100900031EC0\0908F 00000010 (\350916.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031EC0\0908F 00000010 (\3C0916.) OCTA  4
XF_UNMAP_BANG        \0808    00031ED0\0908F 00000010 (\300916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031ED0\0908F 00000010 (\3C0916.) OCTA  4
XF_UNMAP_SYSTEM        \0808  00031EE0\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031EE0\0908F 00000010 (\3C0916.) OCTA  4
XF_UNMARK        \0808\100800031EF0\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031EF0\0908F 00000010 (\3C0916.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   17
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XF_UNTAGPOP        \0808\100600031F00\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031F00\0908F 00000010 (\3C0916.) OCTA  4
XF_UPSCREEN        \0808\100600031F10\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031F10\0908F 00000010 (\3C0916.) OCTA  4
XF_USEBUFFER        \0808     00031F20\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031F20\0908F 00000010 (\3C0916.) OCTA  4
XF_USEKREG        \0808\100700031F30\0908F 00000010 (\330916.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031F30\0908F 00000010 (\3C0916.) OCTA  4
XF_USERBEEP        \0808\100600031F40\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031F40\0908F 00000010 (\3C0916.) OCTA  4
XF_VGLOBALS        \0808\100600031F50\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031F50\0908F 00000010 (\3C0916.) OCTA  4
XF_VIEWFILE        \0808\100600031F60\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031F60\0908F 00000010 (\3C0916.) OCTA  4
XF_VILE_FILTER        \0808   00031F70\0908F 00000010 (\2F0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031F70\0908F 00000010 (\3C0916.) OCTA  4
XF_VILE_REFRESH        \0808  00031F80\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031F80\0908F 00000010 (\3C0916.) OCTA  4
XF_VISUAL        \0808\100800031F90\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031F90\0908F 00000010 (\3C0916.) OCTA  4
XF_WORDCOUNT        \0808     00031FA0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031FA0\0908F 00000010 (\3C0916.) OCTA  4
XF_WRAPWORD        \0808\100600031FB0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031FB0\0908F 00000010 (\3C0916.) OCTA  4
XF_WRITEALLCHANGED        \080700031FC0\0908F 00000010 (\2B0916.) OCTA  4 NOPIC
V,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031FC0\0908F 00000010 (\3C0916.) OCTA  4
XF_WRITEMSG        \0808\100600031FD0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031FD0\0908F 00000010 (\3C0916.) OCTA  4
XF_WRITEQUIT        \0808     00031FE0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031FE0\0908F 00000010 (\3C0916.) OCTA  4
XF_YANKLINE        \0808\100600031FF0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900031FF0\0908F 00000010 (\3C0916.) OCTA  4
XF_ZZQUIT        \0808\100800032000\0908F 00000010 (\340916.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900032000\0908F 00000010 (\3C0916.) OCTA  4
XG_VALNAMES        \0808\100600032010\090621F 00000210 (\3208528.) OCTA  4 NOPI
VC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00032010\090621F 00000210 (\3C08528.) OCTA  4
XHELP_BUFNAME        \0808    00032220\09087 00000008 (\300A8.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00032220\09087 00000008 (\3C0A8.) OCTA  4
XHEXDIGITS        \0808\100700032230\090757 00000028 (\330940.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00032230\090757 00000028 (\3C0940.) OCTA  4
XHISTORY_BUFNAME        \0808 00032260\0908F 00000010 (\2D0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00032260\0908F 00000010 (\3C0916.) OCTA  4
XMACRO_N_BUFNAME        \0808 00032270\0908F 00000010 (\2D0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00032270\0908F 00000010 (\3C0916.) OCTA  4
XMAJORMODES_BUFNAME        \080600032280\0908F 00000010 (\2A0916.) OCTA  4 NOPI
VC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00032280\0908F 00000010 (\3C0916.) OCTA  4
XMAPBANG_BUFNAME        \0808 00032290\0907A7 00000018 (\2D0924.) OCTA  4 NOPIC
V,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00032290\0907A7 00000018 (\3C0924.) OCTA  4
XMAP_BUFNAME        \0808     000322B0\0908F 00000010 (\310916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C000322B0\0908F 00000010 (\3C0916.) OCTA  4
XMESSAGES_BUFNAME        \0808000322C0\0908F 00000010 (\2C0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C000322C0\0908F 00000010 (\3C0916.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   18
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XM_VALNAMES        \0808\1006000322D0\0907FF 00000030 (\320948.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C000322D0\0907FF 00000030 (\3C0948.) OCTA  4
XNAMETBL        \0808\100900032300 000332EF 00000FF0 (\35074080.) OCTA  4 NOPIC
V,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900032300 000332EF 00000FF0 (\3C074080.) OCTA  4
XNAMETBLSIZE        \0808     000332F0\09083 00000004 (\310A4.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808EXTERNS\1709000332F0\09083 00000004 (\3C0A4.) OCTA  4
XOUTPUT_BUFNAME        \0808  00033300\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00033300\0908F 00000010 (\3C0916.) OCTA  4
XPRINTABLECHARS_BUFNAME          00033310\090727 00000018 (\260924.) OCTA  4 NO
VPIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00033310\090727 00000018 (\3C0924.) OCTA  4
XP_LINES_BUFNAME        \0808 00033330\0908F 00000010 (\2D0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00033330\0908F 00000010 (\3C0916.) OCTA  4
XREGISTERS_BUFNAME        \080700033340\0908F 00000010 (\2B0916.) OCTA  4 NOPIC
V,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00033340\0908F 00000010 (\3C0916.) OCTA  4
XSETTINGS_BUFNAME        \080800033350\0908F 00000010 (\2C0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00033350\0908F 00000010 (\3C0916.) OCTA  4
XSTDIN_BUFNAME        \0808   00033360\090777 00000018 (\2F0924.) OCTA  4 NOPIC
V,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00033360\090777 00000018 (\3C0924.) OCTA  4
XSYSMAP_BUFNAME        \0808  00033380\0908F 00000010 (\2E0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00033380\0908F 00000010 (\3C0916.) OCTA  4
XTAGFILE_BUFNAME        \0808 00033390\0908F 00000010 (\2D0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00033390\0908F 00000010 (\3C0916.) OCTA  4
XTAGSTACK_BUFNAME        \0808000333A0\0908F 00000010 (\2C0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C000333A0\0908F 00000010 (\3C0916.) OCTA  4
XTERMINALCHARS_BUFNAME           000333B0\0907C7 00000018 (\270924.) OCTA  4 NO
VPIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C000333B0\0907C7 00000018 (\3C0924.) OCTA  4
XUNNAMED_BUFNAME        \0808 000333D0\0908F 00000010 (\2D0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C000333D0\0908F 00000010 (\3C0916.) OCTA  4
XVARIABLES_BUFNAME        \0807000333E0\0908F 00000010 (\2B0916.) OCTA  4 NOPIC
V,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C000333E0\0908F 00000010 (\3C0916.) OCTA  4
XVILEINIT_BUFNAME        \0808000333F0\0908F 00000010 (\2C0916.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C000333F0\0908F 00000010 (\3C0916.) OCTA  4
XW_VALNAMES        \0808\100600033400\09078F 00000090 (\3208144.) OCTA  4 NOPIC
V,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00033400\09078F 00000090 (\3C08144.) OCTA  4
X$DATA$        \0808\100A00040000\0906E2F 00000E30 (\36073632.) 2 **  5 NOPIC,C
VON,REL,LCL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808X11\130D00040000\0906B03 00000B04 (\3C072820.) 2 **  5
X        \0808BIND\140C00040B10\09074B 0000003C (\3C0960.) OCTA  4
X        \0808BUFFER\160A00040B50\090777 00000028 (\3C0940.) OCTA  4
X        \0808CRYPT\150B00040B80\09087 00000008 (\3C0A8.) OCTA  4
X        \0808FENCES\160A00040B90\0908F 00000010 (\3C0916.) OCTA  4
X        \0808FILE\140C00040BA0\0906C2B 0000008C (\3C08140.) OCTA  4
X        \0808FINDERR\170900040C30\090743 00000014 (\3C0920.) OCTA  4
X        \0808HISTORY\170900040C50\09087 00000008 (\3C0A8.) OCTA  4
X        \0808INPUT\150B00040C60\09087 00000008 (\3C0A8.) OCTA  4
X        \0808INSERT\160A00040C70\09083 00000004 (\3C0A4.) OCTA  4
X        \0808ISEARCH\170900040C80\09083 00000004 (\3C0A4.) OCTA  4
X        \0808LINE\140C00040C90\09087 00000008 (\3C0A8.) OCTA  4
X        \0808MAP\130D00040CA0\0907BF 00000020 (\3C0932.) OCTA  4
X        \0808MENU\140C00040CC0\0906D8F 000000D0 (\3C08208.) OCTA  4
X        \0808MODES\150B00040D90\0907AF 00000020 (\3C0932.) OCTA  4
X        \0808SEARCH\160A00040DB0\09083 00000004 (\3C0A4.) OCTA  4
X        \0808SELECT\160A00040DC0\0908B 0000000C (\3C0912.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   19
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
X$DATA$        \0808\100A00040000\0906E2F 00000E30 (\36073632.) 2 **  5 NOPIC,C
VON,REL,LCL,NOSHR,NOEXE,  WRT,NOVEC,  MOD  `20
X        \0808SPAWN\150B00040DD0\0907E7 00000018 (\3C0924.) OCTA  4
X        \0808TAGS\140C00040DF0\0906E1B 0000002C (\3C0944.) OCTA  4
X        \0808UNDO\140C00040E20\09087 00000008 (\3C0A8.) OCTA  4
XABORTC        \0808\100A00040E30\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00040E30\09083 00000004 (\3C0A4.) OCTA  4
XASCIITBL        \0808\100800040E40 0004123F 00000400 (\34071024.) OCTA  4 NOPI
VC,OVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900040E40 0004123F 00000400 (\3C071024.) OCTA  4
XAUTOINDENTED        \0808    00041240\09083 00000004 (\300A4.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041240\09083 00000004 (\3C0A4.) OCTA  4
XBACKSPC        \0808\100900041250\09083 00000004 (\350A4.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041250\09083 00000004 (\3C0A4.) OCTA  4
XCMDSTATUS        \0808\100700041260\09083 00000004 (\330A4.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041260\09083 00000004 (\3C0A4.) OCTA  4
XCNTL_A        \0808\100A00041270\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041270\09083 00000004 (\3C0A4.) OCTA  4
XCNTL_X        \0808\100A00041280\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041280\09083 00000004 (\3C0A4.) OCTA  4
XCRYPTFLAG        \0808\100700041290\09083 00000004 (\330A4.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041290\09083 00000004 (\3C0A4.) OCTA  4
XCRYPTKEY        \0808\1008000412A0\09083 00000004 (\340A4.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C000412A0\09083 00000004 (\3C0A4.) OCTA  4
XCURGOAL        \0808\1009000412B0\09083 00000004 (\350A4.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C000412B0\09083 00000004 (\3C0A4.) OCTA  4
XDISCMD        \0808\100A000412C0\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C000412C0\09083 00000004 (\3C0A4.) OCTA  4
XDISINP        \0808\100A000412D0\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C000412D0\09083 00000004 (\3C0A4.) OCTA  4
XDOTCMDARG        \0808\1007000412E0\09083 00000004 (\330A4.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C000412E0\09083 00000004 (\3C0A4.) OCTA  4
XDOTCMDMODE        \0808\1006000412F0\09083 00000004 (\320A4.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C000412F0\09083 00000004 (\3C0A4.) OCTA  4
XDUMB_TERM        \0808\100700041300\090777 00000078 (\3308120.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808DUMBTERM\180800041300\090777 00000078 (\3C08120.) OCTA  4
XEDITC        \0808\100B00041380\09083 00000004 (\370A4.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041380\09083 00000004 (\3C0A4.) OCTA  4
XEOLEXIST        \0808\100800041390\09083 00000004 (\340A4.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041390\09083 00000004 (\3C0A4.) OCTA  4
XERRORM        \0808\100A000413A0\09087 00000008 (\360A8.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C000413A0\09087 00000008 (\3C0A8.) OCTA  4
XEXEC_PATHNAME        \0808   000413B0\09083 00000004 (\2F0A4.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C000413B0\09083 00000004 (\3C0A4.) OCTA  4
XFALSEM        \0808\100A000413C0\09087 00000008 (\360A8.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C000413C0\09087 00000008 (\3C0A8.) OCTA  4
XHELP_AT        \0808\1009000413D0\09083 00000004 (\350A4.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C000413D0\09083 00000004 (\3C0A4.) OCTA  4
XINTRC        \0808\100B000413E0\09083 00000004 (\370A4.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C000413E0\09083 00000004 (\3C0A4.) OCTA  4
XKBDMODE        \0808\1009000413F0\09083 00000004 (\350A4.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C000413F0\09083 00000004 (\3C0A4.) OCTA  4
XKBINDTBL        \0808\100800041400\09069E7 000005E8 (\34071512.) OCTA  4 NOPIC
V,OVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808EXTERNS\170900041400\09069E7 000005E8 (\3C071512.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   20
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XKILLC        \0808\100B000419F0\09083 00000004 (\370A4.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C000419F0\09083 00000004 (\3C0A4.) OCTA  4
XNAME_CMPL        \0808\100700041A00\09083 00000004 (\330A4.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041A00\09083 00000004 (\3C0A4.) OCTA  4
XNB_ACTIONS        \0808\100600041A10\09083 00000004 (\320A4.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MENU\140C00041A10\09083 00000004 (\3C0A4.) OCTA  4
XNTILDES        \0808\100900041A20\09083 00000004 (\350A4.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041A20\09083 00000004 (\3C0A4.) OCTA  4
XNULLMARK        \0808\100800041A30\09087 00000008 (\340A8.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041A30\09087 00000008 (\3C0A8.) OCTA  4
XNULL_TERM        \0808\100700041A40\0907B7 00000078 (\3308120.) OCTA  4 NOPIC,
VOVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808TERMIO\160A00041A40\0907B7 00000078 (\3C08120.) OCTA  4
XOPERSYS        \0808\100900041AC0\09087 00000008 (\350A8.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041AC0\09087 00000008 (\3C0A8.) OCTA  4
XOUT_OF_MEM        \0808\100600041AD0\0908F 00000010 (\320916.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041AD0\0908F 00000010 (\3C0916.) OCTA  4
XPOUNDC        \0808\100A00041AE0\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041AE0\09083 00000004 (\3C0A4.) OCTA  4
XPROGNAM        \0808\100900041AF0\09087 00000008 (\350A8.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041AF0\09087 00000008 (\3C0A8.) OCTA  4
XQUOTEC        \0808\100A00041B00\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041B00\09083 00000004 (\3C0A4.) OCTA  4
XREPTC        \0808\100B00041B10\09083 00000004 (\370A4.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041B10\09083 00000004 (\3C0A4.) OCTA  4
XSGARBF        \0808\100A00041B20\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041B20\09083 00000004 (\3C0A4.) OCTA  4
XSTARTC        \0808\100A00041B30\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041B30\09083 00000004 (\3C0A4.) OCTA  4
XSTOPC        \0808\100B00041B40\09083 00000004 (\370A4.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041B40\09083 00000004 (\3C0A4.) OCTA  4
XSUSPC        \0808\100B00041B50\09083 00000004 (\370A4.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041B50\09083 00000004 (\3C0A4.) OCTA  4
XTERM        \0808\100C00041B60\0907D7 00000078 (\3808120.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808X11\130D00041B60\0907D7 00000078 (\3C08120.) OCTA  4
XTEST_CMPL        \0808\100700041BE0\09083 00000004 (\330A4.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041BE0\09083 00000004 (\3C0A4.) OCTA  4
XTRUEM        \0808\100B00041BF0\09087 00000008 (\370A8.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041BF0\09087 00000008 (\3C0A8.) OCTA  4
XTTCOL        \0808\100B00041C00\09083 00000004 (\370A4.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041C00\09083 00000004 (\3C0A4.) OCTA  4
XTTROW        \0808\100B00041C10\09083 00000004 (\370A4.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041C10\09083 00000004 (\3C0A4.) OCTA  4
XVERSION        \0808\100900041C20\0908F 00000010 (\350916.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041C20\0908F 00000010 (\3C0916.) OCTA  4
XWKILLC        \0808\100A00041C30\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,  MOD`20
X        \0808MAIN\140C00041C30\09083 00000004 (\3C0A4.) OCTA  4
X$CODE$        \0808\100A00050000 000B4D1F 00064D20 (     412960.) OCTA  4   PI
VC,CON,REL,LCL,  SHR,  EXE,NOWRT,NOVEC,  MOD`20
X        \0808MAIN\140C00050000 00053AC3 00003AC4 (\3C0615044.) OCTA  4
X        \0808X11\130D00053AD0 0005B793 00007CC4 (\3C0631940.) OCTA  4
X        \0808BASIC\150B0005B7A0 0005E6AF 00002F10 (\3C0612048.) OCTA  4
X        \0808BIND\140C0005E6B0 00062E7F 000047D0 (\3C0618384.) OCTA  4
X        \0808BTREE\150B00062E80 00063CB3 00000E34 (\3C073636.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   21
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
X$CODE$        \0808\100A00050000 000B4D1F 00064D20 (     412960.) OCTA  4   PI
VC,CON,REL,LCL,  SHR,  EXE,NOWRT,NOVEC,  MOD  `20
X        \0808BUFFER\160A00063CC0 00067873 00003BB4 (\3C0615284.) OCTA  4
X        \0808CRYPT\150B00067880\0906C6B 000003EC (\3C071004.) OCTA  4
X        \0808CSRCH\150B00067C70 00068233 000005C4 (\3C071476.) OCTA  4
X        \0808DISPLAY\170900068240 0006F713 000074D4 (\3C0629908.) OCTA  4
X        \0808DUMBTERM\18080006F720\0906AEB 000003CC (\3C08972.) OCTA  4
X        \0808EVAL\140C0006FAF0 00073A8B 00003F9C (\3C0616284.) OCTA  4
X        \0808EXEC\140C00073A90 0007858B 00004AFC (\3C0619196.) OCTA  4
X        \0808FENCES\160A00078590 000796DB 0000114C (\3C074428.) OCTA  4
X        \0808FILE\140C000796E0 0007D7C3 000040E4 (\3C0616612.) OCTA  4
X        \0808FILEC\150B0007D7D0 0007F8DF 00002110 (\3C078464.) OCTA  4
X        \0808FILEIO\160A0007F8E0 00080517 00000C38 (\3C073128.) OCTA  4
X        \0808FINDERR\170900080520 00081833 00001314 (\3C074884.) OCTA  4
X        \0808GLOB\140C00081840 000821C7 00000988 (\3C072440.) OCTA  4
X        \0808GLOBALS\1709000821D0\09065EF 00000420 (\3C071056.) OCTA  4
X        \0808HISTORY\1709000825F0 00083AEF 00001500 (\3C075376.) OCTA  4
X        \0808INPUT\150B00083AF0 00087CC7 000041D8 (\3C0616856.) OCTA  4
X        \0808INSERT\160A00087CD0 0008ACFF 00003030 (\3C0612336.) OCTA  4
X        \0808ITBUFF\160A0008AD00 0008B2C7 000005C8 (\3C071480.) OCTA  4
X        \0808ISEARCH\17090008B2D0\0906E97 00000BC8 (\3C073016.) OCTA  4
X        \0808LINE\140C0008BEA0 0008F533 00003694 (\3C0613972.) OCTA  4
X        \0808MAP\130D0008F540 000915F3 000020B4 (\3C078372.) OCTA  4
X        \0808MENU\140C00091600 00092A57 00001458 (\3C075208.) OCTA  4
X        \0808MODES\150B00092A60 000985FB 00005B9C (\3C0623452.) OCTA  4
X        \0808MSGS\140C00098600\0906A5F 00000460 (\3C071120.) OCTA  4
X        \0808ONELINER\180800098A60 00099F83 00001524 (\3C075412.) OCTA  4
X        \0808OPERS\150B00099F90 0009B2FF 00001370 (\3C074976.) OCTA  4
X        \0808PATH\140C0009B300 0009CD27 00001A28 (\3C076696.) OCTA  4
X        \0808RANDOM\160A0009CD30 0009E6F7 000019C8 (\3C076600.) OCTA  4
X        \0808REGEXP\160A0009E700 000A18CF 000031D0 (\3C0612752.) OCTA  4
X        \0808REGION\160A000A18D0 000A3C0B 0000233C (\3C079020.) OCTA  4
X        \0808SEARCH\160A000A3C10 000A5D77 00002168 (\3C078552.) OCTA  4
X        \0808SELECT\160A000A5D80 000A8697 00002918 (\3C0610520.) OCTA  4
X        \0808SPAWN\150B000A86A0 000A91FF 00000B60 (\3C072912.) OCTA  4
X        \0808TAGS\140C000A9200 000AB32B 0000212C (\3C078492.) OCTA  4
X        \0808TBUFF\150B000AB330\0906A6F 00000740 (\3C071856.) OCTA  4
X        \0808TERMIO\160A000ABA70 000AC587 00000B18 (\3C072840.) OCTA  4
X        \0808UNDO\140C000AC590 000ADF5F 000019D0 (\3C076608.) OCTA  4
X        \0808VERSION\1709000ADF60 000AE237 000002D8 (\3C08728.) OCTA  4
X        \0808VMS2UNIX\1808000AE240 000B009F 00001E60 (\3C077776.) OCTA  4
X        \0808VMSPIPE\1709000B00A0\090680B 0000076C (\3C071900.) OCTA  4
X        \0808WINDOW\160A000B0810 000B2B2B 0000231C (\3C078988.) OCTA  4
X        \0808WORD\140C000B2B30 000B461B 00001AEC (\3C076892.) OCTA  4
X        \0808WORDMOV\1709000B4620\0906D1F 00000700 (\3C071792.) OCTA  4
X$BSS$        \0808\100B000C0000 000C2033 00002034 (\37078244.) 2 **  5 NOPIC,C
VON,REL,LCL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C0000\09083 00000004 (\3C0A4.) OCTA  4
X        \0808X11\130D000C0010\09063AF 000003A0 (\3C08928.) OCTA  4
X        \0808BASIC\150B000C03B0\0908F 00000010 (\3C0916.) OCTA  4
X        \0808BIND\140C000C03C0\0906903 00000544 (\3C071348.) OCTA  4
X        \0808BUFFER\160A000C0910\09073F 00000030 (\3C0948.) OCTA  4
X        \0808CSRCH\150B000C0940\090757 00000018 (\3C0924.) OCTA  4
X        \0808DISPLAY\1709000C0960\0907CF 00000070 (\3C08112.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   22
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
X$BSS$        \0808\100B000C0000 000C2033 00002034 (\37078244.) 2 **  5 NOPIC,C
VON,REL,LCL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD  `20
X        \0808DUMBTERM\1808000C09D0\09087 00000008 (\3C0A8.) OCTA  4
X        \0808EVAL\140C000C09E0\0906C83 000002A4 (\3C08676.) OCTA  4
X        \0808EXEC\140C000C0C90\0906D0B 0000007C (\3C08124.) OCTA  4
X        \0808FILE\140C000C0D10\0908F 00000010 (\3C0916.) OCTA  4
X        \0808FILEC\150B000C0D20\09073F 00000020 (\3C0932.) OCTA  4
X        \0808FILEIO\160A000C0D40\09083 00000004 (\3C0A4.) OCTA  4
X        \0808FINDERR\1709000C0D50\0907D7 00000088 (\3C08136.) OCTA  4
X        \0808GLOB\140C000C0DE0\0908B 0000000C (\3C0912.) OCTA  4
X        \0808HISTORY\1709000C0DF0\0906E0B 0000001C (\3C0928.) OCTA  4
X        \0808INPUT\150B000C0E10\090733 00000024 (\3C0936.) OCTA  4
X        \0808INSERT\160A000C0E40\0906FDF 000001A0 (\3C08416.) OCTA  4
X        \0808ISEARCH\1709000C0FE0 000C13EF 00000410 (\3C071040.) 2 **  5
X        \0808LINE\140C000C13F0\090648F 000000A0 (\3C08160.) OCTA  4
X        \0808MAP\130D000C1490\0907AF 00000020 (\3C0932.) OCTA  4
X        \0808MENU\140C000C14B0\090657B 000000CC (\3C08204.) OCTA  4
X        \0808MODES\150B000C1580\0907CB 0000004C (\3C0976.) OCTA  4
X        \0808MSGS\140C000C15D0\090665F 00000090 (\3C08144.) OCTA  4
X        \0808ONELINER\1808000C1660\090783 00000024 (\3C0936.) OCTA  4
X        \0808RANDOM\160A000C1690\090689B 0000020C (\3C08524.) OCTA  4
X        \0808REGEXP\160A000C18A0\0907D3 00000034 (\3C0952.) OCTA  4
X        \0808REGION\160A000C18E0\09069E7 00000108 (\3C08264.) OCTA  4
X        \0808SEARCH\160A000C19F0\0906A87 00000098 (\3C08152.) OCTA  4
X        \0808SELECT\160A000C1A90\0906B57 000000C8 (\3C08200.) OCTA  4
X        \0808SPAWN\150B000C1B60\0906C5F 00000100 (\3C08256.) OCTA  4
X        \0808TAGS\140C000C1C60\0906D97 00000138 (\3C08312.) OCTA  4
X        \0808TERMIO\160A000C1DA0\0906E1F 00000080 (\3C08128.) OCTA  4
X        \0808UNDO\140C000C1E20\09087 00000008 (\3C0A8.) OCTA  4
X        \0808VERSION\1709000C1E30\0907FF 000000D0 (\3C08208.) OCTA  4
X        \0808VMS2UNIX\1808000C1F00 000C2007 00000108 (\3C08264.) OCTA  4
X        \0808WINDOW\160A000C2010\090727 00000018 (\3C0924.) OCTA  4
X        \0808WORDMOV\1709000C2030\09083 00000004 (\3C0A4.) OCTA  4
XAM_INTERRUPTED        \0808  000C2040\09083 00000004 (\2E0A4.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2040\09083 00000004 (\3C0A4.) OCTA  4
XBHEADP        \0808\100A000C2050\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2050\09083 00000004 (\3C0A4.) OCTA  4
XBMINIP        \0808\100A000C2060\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2060\09083 00000004 (\3C0A4.) OCTA  4
XBSTORE        \0808\100A000C2070\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2070\09083 00000004 (\3C0A4.) OCTA  4
XBUFHOOK        \0808\1009000C2080\090794 00000015 (\350921.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2080\090794 00000015 (\3C0921.) OCTA  4
XCALLEDBEFORE        \0808    000C20A0\09083 00000004 (\300A4.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C20A0\09083 00000004 (\3C0A4.) OCTA  4
XCDHOOK        \0808\100A000C20B0\0907C4 00000015 (\360921.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C20B0\0907C4 00000015 (\3C0921.) OCTA  4
XCLEXEC        \0808\100A000C20D0\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C20D0\09083 00000004 (\3C0A4.) OCTA  4
XCURBP        \0808\100B000C20E0\09083 00000004 (\370A4.) OCTA  4 NOPIC,OVR,REL
+-+-+-+-+-+-+-+-  END  OF PART 136 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 137 -+-+-+-+-+-+-+-+
V,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C20E0\09083 00000004 (\3C0A4.) OCTA  4
XCURCOL        \0808\100A000C20F0\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C20F0\09083 00000004 (\3C0A4.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   23
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XCURROW        \0808\100A000C2100\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2100\09083 00000004 (\3C0A4.) OCTA  4
XCURTABVAL        \0808\1007000C2110\09083 00000004 (\330A4.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2110\09083 00000004 (\3C0A4.) OCTA  4
XCURWP        \0808\100B000C2120\09083 00000004 (\370A4.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2120\09083 00000004 (\3C0A4.) OCTA  4
XDOINGOPCMD        \0808\1006000C2130\09083 00000004 (\320A4.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2130\09083 00000004 (\3C0A4.) OCTA  4
XDOINGSWEEP        \0808\1006000C2140\09083 00000004 (\320A4.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2140\09083 00000004 (\3C0A4.) OCTA  4
XDOTCMD        \0808\100A000C2150\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2150\09083 00000004 (\3C0A4.) OCTA  4
XDOTCMDCNT        \0808\1007000C2160\09083 00000004 (\330A4.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2160\09083 00000004 (\3C0A4.) OCTA  4
XDOTCMDKREG        \0808\1006000C2170\09081 00000002 (\320A2.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2170\09081 00000002 (\3C0A2.) OCTA  4
XDOTCMDREP        \0808\1007000C2180\09083 00000004 (\330A4.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2180\09083 00000004 (\3C0A4.) OCTA  4
XEOFFLAG        \0808\1009000C2190\09083 00000004 (\350A4.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2190\09083 00000004 (\3C0A4.) OCTA  4
XEV_END_OF_CMD        \0808   000C21A0\09083 00000004 (\2F0A4.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C21A0\09083 00000004 (\3C0A4.) OCTA  4
XEXECSTR        \0808\1009000C21B0\09083 00000004 (\350A4.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C21B0\09083 00000004 (\3C0A4.) OCTA  4
XEXITHOOK        \0808\1008000C21C0\0907D4 00000015 (\340921.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C21C0\0907D4 00000015 (\3C0921.) OCTA  4
XFFP        \0808\100D000C21E0\09083 00000004 (\390A4.) OCTA  4 NOPIC,OVR,REL,G
VBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C21E0\09083 00000004 (\3C0A4.) OCTA  4
XFILEISPIPE        \0808\1006000C21F0\09083 00000004 (\320A4.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C21F0\09083 00000004 (\3C0A4.) OCTA  4
XFLEN        \0808\100C000C2200\09083 00000004 (\380A4.) OCTA  4 NOPIC,OVR,REL,
VGBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2200\09083 00000004 (\3C0A4.) OCTA  4
XFLICKCODE        \0808\1007000C2210\09083 00000004 (\330A4.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2210\09083 00000004 (\3C0A4.) OCTA  4
XFLINE        \0808\100B000C2220\09083 00000004 (\370A4.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2220\09083 00000004 (\3C0A4.) OCTA  4
XGLOBAL_B_VALUES        \0808 000C2230\09063BF 00000190 (\2D08400.) OCTA  4 NOP
VIC,OVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2230\09063BF 00000190 (\3C08400.) OCTA  4
XGLOBAL_G_VALUES        \0808 000C23C0\090652F 00000170 (\2D08368.) OCTA  4 NOP
VIC,OVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C23C0\090652F 00000170 (\3C08368.) OCTA  4
XGLOBAL_W_VALUES        \0808 000C2530\090777 00000048 (\2D0972.) OCTA  4 NOPIC
V,OVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2530\090777 00000048 (\3C0972.) OCTA  4
XGOLABEL        \0808\1009000C2580\0907FF 00000080 (\3508128.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2580\0907FF 00000080 (\3C08128.) OCTA  4
XGREGEXP        \0808\1009000C2600\09083 00000004 (\350A4.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2600\09083 00000004 (\3C0A4.) OCTA  4
XHAVEMOTION        \0808\1006000C2610\09083 00000004 (\320A4.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2610\09083 00000004 (\3C0A4.) OCTA  4
XHAVEREGION        \0808\1006000C2620\09083 00000004 (\320A4.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808REGION\160A000C2620\09083 00000004 (\3C0A4.) OCTA  4
XHELPFILE        \0808\1008000C2630\09083 00000004 (\340A4.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2630\09083 00000004 (\3C0A4.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   24
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XIBUF        \0808\100C000C2640\0906A3F 00000400 (\38071024.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808TERMIO\160A000C2640\0906A3F 00000400 (\3C071024.) OCTA  4
XIBUFI        \0808\100B000C2A40\09083 00000004 (\370A4.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808TERMIO\160A000C2A40\09083 00000004 (\3C0A4.) OCTA  4
XIGNORECASE        \0808\1006000C2A50\09083 00000004 (\320A4.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2A50\09083 00000004 (\3C0A4.) OCTA  4
XIOCHAN        \0808\100A000C2A60\09081 00000002 (\360A2.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808TERMIO\160A000C2A60\09081 00000002 (\3C0A2.) OCTA  4
XISNAMEDCMD        \0808\1006000C2A70\09083 00000004 (\320A4.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2A70\09083 00000004 (\3C0A4.) OCTA  4
XKBD_EXPAND        \0808\1006000C2A80\09083 00000004 (\320A4.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2A80\09083 00000004 (\3C0A4.) OCTA  4
XKBS        \0808\100D000C2A90\0906D9B 0000030C (\3908780.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2A90\0906D9B 0000030C (\3C08780.) OCTA  4
XKCHARS        \0808\100A000C2DA0\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2DA0\09083 00000004 (\3C0A4.) OCTA  4
XKLINES        \0808\100A000C2DB0\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2DB0\09083 00000004 (\3C0A4.) OCTA  4
XKREGFLAG        \0808\1008000C2DC0\09081 00000002 (\340A2.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2DC0\09081 00000002 (\3C0A2.) OCTA  4
XKREGWIDTH        \0808\1007000C2DD0\09083 00000004 (\330A4.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2DD0\09083 00000004 (\3C0A4.) OCTA  4
XLASTCMD        \0808\1009000C2DE0\09083 00000004 (\350A4.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2DE0\09083 00000004 (\3C0A4.) OCTA  4
XLASTFILEEDITED        \0808  000C2DF0\09083 00000004 (\2E0A4.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808FILE\140C000C2DF0\09083 00000004 (\3C0A4.) OCTA  4
XLASTKEY        \0808\1009000C2E00\09083 00000004 (\350A4.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2E00\09083 00000004 (\3C0A4.) OCTA  4
XLAST_SRCH_DIREC        \0808 000C2E10\09083 00000004 (\2D0A4.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2E10\09083 00000004 (\3C0A4.) OCTA  4
XLINES_DELETED        \0808   000C2E20\09083 00000004 (\2F0A4.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2E20\09083 00000004 (\3C0A4.) OCTA  4
XMACBUG        \0808\100A000C2E30\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2E30\09083 00000004 (\3C0A4.) OCTA  4
XMARK        \0808\100C000C2E40\09087 00000008 (\380A8.) OCTA  4 NOPIC,OVR,REL,
VGBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2E40\09087 00000008 (\3C0A8.) OCTA  4
XMENUB        \0808\100B000C2E50\09083 00000004 (\370A4.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808X11\130D000C2E50\09083 00000004 (\3C0A4.) OCTA  4
XMINIEDIT        \0808\1008000C2E60\09083 00000004 (\340A4.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2E60\09083 00000004 (\3C0A4.) OCTA  4
XMLSAVE        \0808\100A000C2E70\0907EF 00000080 (\3608128.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2E70\0907EF 00000080 (\3C08128.) OCTA  4
XMODELINE_FORMAT        \0808 000C2EF0\09083 00000004 (\2D0A4.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2EF0\09083 00000004 (\3C0A4.) OCTA  4
XMSTORE        \0808\100A000C2F00\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C2F00\09083 00000004 (\3C0A4.) OCTA  4
XNB_TOKEN        \0808\1008000C2F10\09083 00000004 (\340A4.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MENU\140C000C2F10\09083 00000004 (\3C0A4.) OCTA  4
XNEWMODE        \0808\1009000C2F20\0908B 0000000C (\350912.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808TERMIO\160A000C2F20\0908B 0000000C (\3C0912.) OCTA  4
XNIBUF        \0808\100B000C2F30\09083 00000004 (\370A4.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808TERMIO\160A000C2F30\09083 00000004 (\3C0A4.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   25
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XNOBUF        \0808\100B000C2F40\09083 00000004 (\370A4.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808TERMIO\160A000C2F40\09083 00000004 (\3C0A4.) OCTA  4
XOBUF        \0808\100C000C2F50 000C334F 00000400 (\38071024.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808TERMIO\160A000C2F50 000C334F 00000400 (\3C071024.) OCTA  4
XOLDMODE        \0808\1009000C3350\0908B 0000000C (\350912.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808TERMIO\160A000C3350\0908B 0000000C (\3C0912.) OCTA  4
XOPCMD        \0808\100B000C3360\09081 00000002 (\370A2.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3360\09081 00000002 (\3C0A2.) OCTA  4
XPALSTR        \0808\100A000C3370\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3370\09083 00000004 (\3C0A4.) OCTA  4
XPAT        \0808\100D000C3380\0907FF 00000080 (\3908128.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3380\0907FF 00000080 (\3C08128.) OCTA  4
XPATMATCH        \0808\1008000C3400\09083 00000004 (\340A4.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3400\09083 00000004 (\3C0A4.) OCTA  4
XPRE_OP_DOT        \0808\1006000C3410\09087 00000008 (\320A8.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3410\09087 00000008 (\3C0A8.) OCTA  4
XPROG_ARG        \0808\1008000C3420\09083 00000004 (\340A4.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3420\09083 00000004 (\3C0A4.) OCTA  4
XPSCREEN        \0808\1009000C3430\09083 00000004 (\350A4.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808DISPLAY\1709000C3430\09083 00000004 (\3C0A4.) OCTA  4
XREADHOOK        \0808\1008000C3440\090754 00000015 (\340921.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3440\090754 00000015 (\3C0921.) OCTA  4
XREADING_MSG_LINE        \0808000C3460\09083 00000004 (\2C0A4.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3460\09083 00000004 (\3C0A4.) OCTA  4
XREAD_JMP_BUF        \0808    000C3470\090668F 00000220 (\3008544.) OCTA  4 NOP
VIC,OVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3470\090668F 00000220 (\3C08544.) OCTA  4
XREGIONSHAPE        \0808     000C3690\09083 00000004 (\310A4.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3690\09083 00000004 (\3C0A4.) OCTA  4
XRELISTING_B_VALS        \0808000C36A0\09083 00000004 (\2C0A4.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C36A0\09083 00000004 (\3C0A4.) OCTA  4
XRELISTING_W_VALS        \0808000C36B0\09083 00000004 (\2C0A4.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C36B0\09083 00000004 (\3C0A4.) OCTA  4
XREVEXIST        \0808\1008000C36C0\09083 00000004 (\340A4.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C36C0\09083 00000004 (\3C0A4.) OCTA  4
XRPAT        \0808\100C000C36D0\090674F 00000080 (\3808128.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C36D0\090674F 00000080 (\3C08128.) OCTA  4
XSAVE_SHELL        \0808\1006000C3750\09087 00000008 (\320A8.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3750\09087 00000008 (\3C0A8.) OCTA  4
XSCANBOUNDPOS        \0808    000C3760\09087 00000008 (\300A8.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3760\09087 00000008 (\3C0A8.) OCTA  4
XSCANBOUND_IS_HEADER             000C3770\09083 00000004 (\290A4.) OCTA  4 NOPI
VC,OVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3770\09083 00000004 (\3C0A4.) OCTA  4
XSEED        \0808\100C000C3780\09083 00000004 (\380A4.) OCTA  4 NOPIC,OVR,REL,
VGBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3780\09083 00000004 (\3C0A4.) OCTA  4
XSIGNAL_WAS        \0808\1006000C3790\09083 00000004 (\320A4.) OCTA  4 NOPIC,OV
VR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3790\09083 00000004 (\3C0A4.) OCTA  4
XSRES        \0808\100C000C37A0\0907B4 00000015 (\380921.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C37A0\0907B4 00000015 (\3C0921.) OCTA  4
XSTARTUP_FILE        \0808    000C37C0\09083 00000004 (\300A4.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C37C0\09083 00000004 (\3C0A4.) OCTA  4
XSTARTUP_PATH        \0808    000C37D0\09083 00000004 (\300A4.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C37D0\09083 00000004 (\3C0A4.) OCTA  4
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   26
X
X
XPsect Name      Module \110A Base     End\1307    Length\110B Align\110C\1606t
Vtributes
X----------      \100A\1107 ----\1B08\1307\290A\110B\3B06\110C\510F
XSWEEPHACK        \0808\1007000C37E0\09083 00000004 (\330A4.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C37E0\09083 00000004 (\3C0A4.) OCTA  4
XSWINDOW        \0808\1009000C37F0\09083 00000004 (\350A4.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C37F0\09083 00000004 (\3C0A4.) OCTA  4
XTABOFF        \0808\100A000C3800\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3800\09083 00000004 (\3C0A4.) OCTA  4
XUKB        \0808\100D000C3810\09081 00000002 (\390A2.) OCTA  4 NOPIC,OVR,REL,G
VBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3810\09081 00000002 (\3C0A2.) OCTA  4
XUSER_VARS        \0808\1007000C3820\09083 00000004 (\330A4.) OCTA  4 NOPIC,OVR
V,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3820\09083 00000004 (\3C0A4.) OCTA  4
XVIDEOATTRIBUTE        \0808  000C3830\09081 00000002 (\2E0A2.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3830\09081 00000002 (\3C0A2.) OCTA  4
XVSCREEN        \0808\1009000C3840\09083 00000004 (\350A4.) OCTA  4 NOPIC,OVR,R
VEL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808DISPLAY\1709000C3840\09083 00000004 (\3C0A4.) OCTA  4
XVTCOL        \0808\100B000C3850\09083 00000004 (\370A4.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3850\09083 00000004 (\3C0A4.) OCTA  4
XVTROW        \0808\100B000C3860\09083 00000004 (\370A4.) OCTA  4 NOPIC,OVR,REL
V,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3860\09083 00000004 (\3C0A4.) OCTA  4
XWARNINGS        \0808\1008000C3870\09083 00000004 (\340A4.) OCTA  4 NOPIC,OVR,
VREL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3870\09083 00000004 (\3C0A4.) OCTA  4
XWHEADP        \0808\100A000C3880\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3880\09083 00000004 (\3C0A4.) OCTA  4
XWMINIP        \0808\100A000C3890\09083 00000004 (\360A4.) OCTA  4 NOPIC,OVR,RE
VL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3890\09083 00000004 (\3C0A4.) OCTA  4
XWRITEHOOK        \0808\1007000C38A0\0907B4 00000015 (\330921.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C38A0\0907B4 00000015 (\3C0921.) OCTA  4
XX_ICON_NAME        \0808     000C38C0\09069BF 00000100 (\3108256.) OCTA  4 NOP
VIC,OVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808X11\130D000C38C0\09069BF 00000100 (\3C08256.) OCTA  4
XX_WINDOW_NAME        \0808   000C39C0\0906ABF 00000100 (\2F08256.) OCTA  4 NOP
VIC,OVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808X11\130D000C39C0\0906ABF 00000100 (\3C08256.) OCTA  4
X_CHARTYPES_        \0808     000C3AC0\0906EBF 00000400 (\31071024.) OCTA  4 NO
VPIC,OVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808MAIN\140C000C3AC0\0906EBF 00000400 (\3C071024.) OCTA  4
X_PIPES        \0808\100A000C3EC0 000C40EF 00000230 (\3608560.) OCTA  4 NOPIC,O
VVR,REL,GBL,NOSHR,NOEXE,  WRT,NOVEC,NOMOD`20
X        \0808VMSPIPE\1709000C3EC0 000C40EF 00000230 (\3C08560.) OCTA  4
X
X        \0808\1010\200D+--------\0808\1008+
X        \0808\1010\200D! Symbol Cross Reference !
X        \0808\1010\200D+--------\0808\1008+
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XABBREV        \0808\100A0001D338-R\2408MAP\2F16EXTERNS\4C0C
XABBR_BUFNAME        \0808    0002FFC0-R\1E08MAIN\2A14 MAP\4210
XABBR_CHECK        \0808\10060001CE00-R\2008MAP\2B16INSERT\470D
XABORTC        \0808\100A00040E30-R\2408MAIN\3015BASI\4A15BIND\620F
X        \0808\1010\2020\400BCSRCH\5014EXEC\680F
X        \0808\1010\2020\400BHISTORY\5212INPUT\690E
X        \0808\1010\2020\400BINSERT\1914SEARCH\6B0C
X        \0808\1010\2020\400BITBUFF\5113MAP\6710
X        \0808\1010\2020\400BSELECT\1914PAWN\690E
X        \0808\1010\2020\400BTBUFF\1915ERMIO\6A0D
X        \0808\1010\2020\400BWINDOW\5113X11\6710
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   27
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XABSOL        \0808\100B00015F20-R\2508EVA\3116WINDOW\4C0D
XADDLINE        \0808\100900014560-R\2308BUFFE\0E09\390BBIND\4815EXEC\610F
X        \0808\1010\2020\400BFILE\1917NDERR\6B0C
X        \0808\1010\2020\400BHISTORY\5212ONELINER\6C0B
X        \0808\1010\2020\400BWINDOW\510D
XADDTOSYSMAP        \0808     0001D0D0-R\1F08\2A13
XADD_BRACKETS        \0808    000148A0-R\1E08BUFFE\0E09\340BEXEC\430F
XADD_LINE_AT        \0808     00014540-R\1F08BUFFE\0E09\350BFILE\440F
XADJVALUESET        \0808     0001E228-R\1F08MODES\2C14EVAL\440F
XALLOC_MODE        \0808\10060001E3A8-R\2008MODES\2D14MAIN\450F
XALL_MODES        \0808\10070002FFD0-R\2108MAIN\2D15\4713
XALL_SUBMODES        \0808    00030460-R\1E08MAIN\2A14 M\4412
XALTBUFF        \0808\100900014B60-R\2308BUFFE\0E09\390BEXTERNS\4B0C
XAM_INTERRUPTED        \0808  000C2040-R     WK-MAIN\2812   BASIC\1915UFFER
V\5C0D
X        \0808\1010\2020\400BCSRCH\5014FENCES\6A0D
X        \0808\1010\2020\400BFILEIO\5113HISTORY\6B0C
X        \0808\1010\2020\400BINPUT\1916SER\1A0E
X        \0808\1010\2020\400BISEARCH\520FWK-MAIN\680F
X        \0808\1010\2020\400BSEARCH\1915LECT\6A0D
X        \0808\1010\2020\400BSPAWN\5014WINDOW\6A0D
X        \0808\1010\2020\400BWORD\4F0F
XANY_CHANGED_BUF        \0808 00014530-R\1B08BUFFE\0E09\310BMAIN\1713  SPAW
V\1A0F
XANY_UNREAD_BUF        \0808  00014520-R\1C08BUFFE\0E09\320BMAIN\410F
XAPPEND        \0808\100A0001BD00-R\2408INSERT\3213EXTERNS\4C0C
XAPPENDEOL        \0808\10070001BCD0-R\2108INSERT\2F13EXTERNS\490C
XAPPSTRING        \0808\10070001BAF0-R\2108INSERT\2F13EXTERNS\490C
XASCIITBL        \0808\100800040E40-R\2208EXTERNS\3112BIND\4715TERMIO\620D
XASK_SHOULDCHANGE        \080800018CA0-R\1A08FIL\2611     EXEC\3F0F
XASSIGN_ATTR_ID        \0808  00021860-R\1C08SELECT\2A12 REGION\430D
XATTRIBUTEREGION        \0808 00021888-R\1B08SELECT\2911  SEARCH\420D
XATTRIBUTEREGION_OVER_\0C06     00021C80-R        SELECT\0E08    `20
XATTRIBUTE_CNTL_A_SEQUENCES_OVER 000219A0-R        SELECT\0E08    `20
XATTRIB_MATCHES        \0808  000215D0-R\1C08SEARCH\2A12 MAIN\1713  MOD\5B10
XAUTOINDENTED        \0808    00041240-R\1E08MAIN\2A14 INSERT\450D
XBACKBLINE        \0808\1007000129C8-R\2108BASIC\2E14EXTERNS\490C
XBACKCHAR        \0808\100800012878-\2209BASIC\2F14CSRCH\4814EVAL\600F
X        \0808\1010\2020\400BEXTERNS\5212FENCE\180E
X        \0808\1010\2020\400BINSERT\1914SEARCH\6B0C
X        \0808\1010\2020\400BLINE\4F15MAIN\680F
X        \0808\1010\2020\400BRANDOM\1914EGION\6A0D
X        \0808\1010\2020\400BSEARCH\5113WORD\680F
XBACKCHAR_TO_BOL        \0808 00012AD8-R\1B08BASIC\2811   EXTERNS\430C
XBACKDELCHAR        \0808     000202F0-\1F09RANDOM\2D13EXTERNS\470C
XBACKHPAGE        \0808\100700012790-R\2108BASIC\2E14EXTERNS\4912WINDOW\610D
XBACKHUNT        \0808\100800021698-R\2208SEARCH\3013EXTERNS\4A0C
XBACKLINE        \0808\100800012530-R\2208BASIC\2F14EXTERNS\4A12HISTORY\630C
X        \0808\1010\2020\400BINSERT\5113LINE\680F
X        \0808\1010\2020\400BMAIN\4F15OPERS\690E
XBACKPAGE        \0808\1008000127D8-R\2208BASIC\2F14EXTERNS\4A0C
XBACKSEARCH        \0808\100600021758-R\2008\2E19EXTERNS\480C
XBACKSPC        \0808\100900041250-R\2308MAIN\2F15BIND\4815INPUT\620E
X        \0808\1010\2020\400BINSERT\1914SEARCH\6B0C
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   28
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
X        \0808\1010\2020\400BTERMIO\510D
XBACKUNDO        \0808\100800023530-R\2208\2E19EXTERNS\4A0C
XBACKVIWORD        \0808\100600024960-R\2008\2C19EXTERNS\480C
XBACKWORD        \0808\1008000248E0-R\2208\2E19EXTERNS\4A12INSERT\620D
XBCLEAR        \0808\100A00014130-\2409BUFFE\3214EXEC\4915FILE\620F
X        \0808\1010\2020\400BFILEC\5014ONELINER\6C0B
X        \0808\1010\2020\400BRANDOM\510D
XBCSRCH        \0808\100A00014E50-R\2408\3119EXTERNS\4C0C
XBCSRCH_TO        \0808\100700014E70-R\2108CSRCH\2E14EXTERNS\490C
XBFIND        \0808\100B00014438-R\2508BUFFE\0E09\3B0BB\4A18EXEC\630F
X        \0808\1010\2020\400BFILE\1919C\690E
X        \0808\1010\2020\400BFINDERR\5212HISTORY\6B0C
X        \0808\1010\2020\400BMAIN\1916SGS\680F
X        \0808\1010\2020\400BONELINER\5311RANDOM\6A0D
X        \0808\1010\2020\400BSPAWN\5014TAGS\680F
X        \0808\1010\2020\400BWINDOW\510D
XBHEADP        \0808\100A000C2050-R     WK-MAIN\3015BUFFE\2706\500EFILE\620F
X        \0808\1010\2020\4008WK-MAIN\4F15MENU\680F
X        \0808\1010\2020\400BMODES\500E
XBINDINGLIST_BUFNAME             00030620-R\1708MAIN\230D\3008BIND\190F
XBINDKEY        \0808\1009000139D0-R\2308BIND\2F15EXTERNS\4B0C
XBKTOSHELL        \0808\100700022458-R\2108SPAWN\2E14EXTERNS\490C
XBLANK_REGION        \0808    00021020-R\1E08\2C19OPERS\440E
XBMINIP        \0808\100A000C2060-R     WK-MAIN\3015BIND\1916UFFE\4006\6908
X        \0808\1010\2020\400BINPUT\5011WK-MAIN\680F
X        \0808\1010\2020\400BUNDO\4F15WINDOW\6A0D
XBOTTOMLEFT        \0808\1006000155A0-R\2008DISPLAY\2F0C
XBP2ANY_WP        \0808\100700013F90-R\2108BUFFE\0E09\370BDISPLAY\4912EXEC\5F0F
V
X        \0808\1010\2020\400BMAIN\1916SGS\680F
X        \0808\1010\2020\400BONELINER\5311RANDOM\6A0D
X        \0808\1010\2020\400BWINDOW\510D
XBP2READIN        \0808\1007000189A0-R\2108FILE\2D15BUFFE\2709    `20
XBPRINTF        \0808\100900015B70-R\2308DISPLAY\3212BIND\4815BUFFE\4009    `20
X        \0808\1010\2020\400BEVAL\4F15LINE\680F
X        \0808\1010\2020\400BMAIN\1917P\6710
X        \0808\1010\2020\400BMODES\5014ONELINER\6C0B
X        \0808\1010\2020\400BTAGS\4F0F
XBPUTC        \0808\100B00015B28-R\2508DISPLAY\3412BUFFE\2709\540BLINE\630F
X        \0808\1010\2020\400BMAIN\1917P\6710
X        \0808\1010\2020\400BMODES\1915SG\1810
XBSIZES        \0808\100A00014408-R\2408BUFFE\0E09\3A0BFILE\4915FILEC\630E
X        \0808\1010\2020\400BFINDERR\5212MAIN\680F
X        \0808\1010\2020\400BMODES\5014RANDOM\6A0D
X        \0808\1010\2020\400BSELECT\5113TAGS\680F
X        \0808\1010\2020\400BWINDOW\510D
XBSTORE        \0808\100A000C2070-R     WK-MAIN\3015EXEC\4912\3216
XBTREE_DELETE        \0808    00013C30-R\1E08BTREE\2B14BIND\430F
XBTREE_FREEUP        \0808    00013C50-R\1E08BTREE\2B14TAGS\430F
XBTREE_INSERT        \0808    00013DA8-R\1E08BTREE\2B14BIND\4314 TAGS\5C0F
XBTREE_PARRAY        \0808    00013D10-R\1E08BTREE\2B14BIND\4314 TAGS\5C0F
XBTREE_PMATCH        \0808    00013CD0-R\1E08BTREE\2B14BIND\430F
XBTREE_PRINTF        \0808    00013D68-R\1E08BTREE\2B0E
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   29
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XBTREE_SEARCH        \0808    00013D88-R\1E08BTREE\2B14BIND\430F
XBUFFERLIST_BUFNAME        \080600030630-R\1808MAIN\240E\3207\4B06\3F0D
XBUFHOOK        \0808\1009000C2080-R     WK-MAIN\2F15BUFFE\2706\4F0EEVAL\610F
X        \0808\1010\2020\4008WK-MAIN\4F0F
XBUILD_NAMEBST        \0808   00012DB0-R\1D08BIND\2913  MAIN\420F
XB_VALNAMES        \0808\100600030640-R\2008MAIN\2C15BUFFE\2709\4F0BMOD\5F10
XCALLEDBEFORE        \0808    000C20A0-R     WK-MAIN\2A14 EXEC\1915FILE\5C0F
X        \0808\1010\2020\400BGLOBALS\520FWK-MAIN\680F
X        \0808\1010\2020\400BONELINER\530B
XCALL_CMDFUNC        \0808    00016FF0-R\1E08EXE\2A15 GLOBALS\460C
XCATCHINTR        \0808\100700010DF8-\2109MAIN\2D15X11\4510
XCATNAP        \0808\100A000200F0-R\2408RANDOM\3213FENCES\4B13M\6112
X        \0808\1010\2020\400BX11\4E10
XCBUF1        \0808\100B00017540-R\2508EXEC\3115EXTERNS\4D0C
XCBUF10        \0808\100A00017420-R\2408EXEC\3015EXTERNS\4C0C
XCBUF11        \0808\100A00017400-R\2408EXEC\3015EXTERNS\4C0C
XCBUF12        \0808\100A000173E0-R\2408EXEC\3015EXTERNS\4C0C
XCBUF13        \0808\100A000173C0-R\2408EXEC\3015EXTERNS\4C0C
XCBUF14        \0808\100A000173A0-R\2408EXEC\3015EXTERNS\4C0C
XCBUF15        \0808\100A00017380-R\2408EXEC\3015EXTERNS\4C0C
XCBUF16        \0808\100A00017360-R\2408EXEC\3015EXTERNS\4C0C
XCBUF17        \0808\100A00017340-R\2408EXEC\3015EXTERNS\4C0C
XCBUF18        \0808\100A00017320-R\2408EXEC\3015EXTERNS\4C0C
XCBUF19        \0808\100A00017300-R\2408EXEC\3015EXTERNS\4C0C
XCBUF2        \0808\100B00017520-R\2508EXEC\3115EXTERNS\4D0C
XCBUF20        \0808\100A000172E0-R\2408EXEC\3015EXTERNS\4C0C
XCBUF21        \0808\100A000172C0-R\2408EXEC\3015EXTERNS\4C0C
XCBUF22        \0808\100A000172A0-R\2408EXEC\3015EXTERNS\4C0C
XCBUF23        \0808\100A00017280-R\2408EXEC\3015EXTERNS\4C0C
XCBUF24        \0808\100A00017260-R\2408EXEC\3015EXTERNS\4C0C
XCBUF25        \0808\100A00017240-R\2408EXEC\3015EXTERNS\4C0C
XCBUF26        \0808\100A00017220-R\2408EXEC\3015EXTERNS\4C0C
XCBUF27        \0808\100A00017200-R\2408EXEC\3015EXTERNS\4C0C
XCBUF28        \0808\100A000171E0-R\2408EXEC\3015EXTERNS\4C0C
XCBUF29        \0808\100A000171C0-R\2408EXEC\3015EXTERNS\4C0C
XCBUF3        \0808\100B00017500-R\2508EXEC\3115EXTERNS\4D0C
XCBUF30        \0808\100A000171A0-R\2408EXEC\3015EXTERNS\4C0C
XCBUF31        \0808\100A00017180-R\2408EXEC\3015EXTERNS\4C0C
+-+-+-+-+-+-+-+-  END  OF PART 137 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 138 -+-+-+-+-+-+-+-+
XCBUF32        \0808\100A00017160-R\2408EXEC\3015EXTERNS\4C0C
XCBUF33        \0808\100A00017140-R\2408EXEC\3015EXTERNS\4C0C
XCBUF34        \0808\100A00017120-R\2408EXEC\3015EXTERNS\4C0C
XCBUF35        \0808\100A00017100-R\2408EXEC\3015EXTERNS\4C0C
XCBUF36        \0808\100A000170E0-R\2408EXEC\3015EXTERNS\4C0C
XCBUF37        \0808\100A000170C0-R\2408EXEC\3015EXTERNS\4C0C
XCBUF38        \0808\100A000170A0-R\2408EXEC\3015EXTERNS\4C0C
XCBUF39        \0808\100A00017080-R\2408EXEC\3015EXTERNS\4C0C
XCBUF4        \0808\100B000174E0-R\2508EXEC\3115EXTERNS\4D0C
XCBUF40        \0808\100A00017060-R\2408EXEC\3015EXTERNS\4C0C
XCBUF5        \0808\100B000174C0-R\2508EXEC\3115EXTERNS\4D0C
XCBUF6        \0808\100B000174A0-R\2508EXEC\3115EXTERNS\4D0C
XCBUF7        \0808\100B00017480-R\2508EXEC\3115EXTERNS\4D0C
XCBUF8        \0808\100B00017460-R\2508EXEC\3115EXTERNS\4D0C
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   30
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XCBUF9        \0808\100B00017440-R\2508EXEC\3115EXTERNS\4D0C
XCD        \0808\100E000200B8-R\2808RANDOM\3613EXTERNS\500C
XCDHOOK        \0808\100A000C20B0-R     WK-MAIN\3015EVAL\4912\3216
X        \0808\1010\2020\400BRANDOM\510D
XCHARINIT        \0808\100800010380-R\2208MAIN\2E15MODES\480E
XCHECK_MODTIME        \0808   00018C50-R\1D08FIL\2914  BUFFE\2709    `20
XCHECK_VISIBLE_MODTIMES          00018C80-R\1408FILE\200A\2A0A SPAWN\1A0E
XCHGCHAR        \0808\1009000201D0-\2309RANDOM\3113EXTERNS\4B0C
XCHGD_AUTOBUF        \0808    0001E7C0-R\1E08MODES\2B14MAIN\430F
XCHGD_BUFFER        \0808     0001E790-\1F09MODES\2C14MAIN\440F
XCHGD_CHARSET        \0808    0001E760-R\1E08MODES\2B14MAIN\430F
XCHGD_DISABLED        \0808   0001E428-R\1D08MODES\2A0E
XCHGD_FENCES        \0808     0001E728-R\1F08MOD\2C16MAIN\440F
XCHGD_HILITE        \0808     0001E6C8-R\1F08MODES\2C14MAIN\440F
XCHGD_MAJOR        \0808\10060001E448-\2009MODES\2D14MAIN\450F
XCHGD_MAJOR_W        \0808    0001E468-R\1E08MODES\2B14MAIN\430F
XCHGD_STATUS        \0808     0001E710-R\1F08MODE\2C15MAIN\440F
XCHGD_WINDOW        \0808     0001E410-R\1F08MODES\2C14MAIN\440F
XCHGD_XTERM        \0808\10060001E700-R\2008MODES\2D14MAIN\450F
XCHGLINE        \0808\100900020210-R\2308RANDOM\3113EXTERNS\4B0C
XCHGTOEOL        \0808\100800020270-R\2208RANDOM\3013EXTERNS\4A0C
XCHG_BUFF        \0808\1008000143E8-R\2208BUFFE\0E09\380BFILE\4715LIN\1910
X        \0808\1010\2020\400BRANDOM\1914EGION\6A0D
X        \0808\1010\2020\400BUNDO\4F0F
XCH_FNAME        \0808\10080001FE90-R\2208RANDOM\3013BUFFE\2709\510BEVAL\600F
X        \0808\1010\2020\400BFILE\4F15SPAWN\690E
XCLEAR_MATCH_ATTRS        \080700021538-R\1908SEARCH\270F    EXTERN\410D
XCLEXEC        \0808\100A000C20D0-R     WK-MAIN\3015BASI\4A15BIND\620F
X        \0808\1010\2020\400BBUFFER\5113CSRCH\690E
X        \0808\1010\2020\400BEVAL\1916XEC\680F
X        \0808\1010\2020\400BFILE\1919C\690E
X        \0808\1010\2020\400BHISTORY\5212INPUT\690E
X        \0808\1010\2020\400BINSERT\1914SEARCH\6B0C
X        \0808\1010\2020\400BLINE\4F12WK-MAIN\680F
X        \0808\1010\2020\400BMAP\1917ODES\690E
X        \0808\1010\2020\400BOPERS\5014TAG\1810
X        \0808\1010\2020\400BWINDOW\510D
XCLOBBER_SAVE_CURBP        \0806000215F8-R\1808SEARCH\260E     BUFFER\3F0D
XCLRMES        \0808\100A000201A0-R\2408RANDOM\3213EXTERN\4C0D
XCMA$TIS_ERRNO_GET_ADDR          000000E0-RX\1507\3208SH\270B    DISPLAY\150E
V    FILEIO\2D0D
X        \0808\1010\2020\400BMENU\4F0F
XCMDLINETAG        \0808\1006000229E0-R\2008TAGS\2C15MAIN\450F
XCMDSTATUS        \0808\100700041260-R\2108MAIN\2D15EVAL\1916XEC\5F0F
XCNTL_A        \0808\100A00041270-R\2408MAIN\3015BIND\4915INPUT\630E
XCNTL_A_FUNC        \0808     00010AB0-R\1F08MAIN\2B15EXTERNS\470C
XCNTL_X        \0808\100A00041280-R\2408MAIN\3015BIND\4915INPUT\630E
XCNTL_X_FUNC        \0808     00010AA0-R\1F08MAIN\2B15EXTERNS\470C
XCOL2OFFS        \0808\100800015390-R\2208DISPLAY\3112BASIC\480E
XCOL_LIMIT        \0808\1007000154E0-R\2108DISPLAY\300C
XCOMPLETIONS_BUFNAME             00030910-R\1708MAIN\230D\3008BIND\190F
XCOMP_ERR_EXPS        \0808   000199C0-R\1D08FINDERR\2C12EXTERN\450D
XCONSEARCH        \0808\1007000216D8-R\2108\2F19EXTERNS\490C
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   31
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XCOPY_FOR_UNDO        \0808   00023338-R\1D08\2917  LINE\1915RANDOM\5D0D
X        \0808\1010\2020\400BREGION\510D
XCOPY_MVALS        \0808\10060001EA98-R\2008MODE\2D15DISPLAY\4812WINDOW\600D
XCOPY_TO_CLIPBOARD        \080700011760-R\1908X11\240F\3307EXTERNS\410C
XCOPY_TRAITS        \0808     00023E88-R\1F08WINDOW\2D13BUFFE\2709\4E0BFILE
V\5D0F
XCRYPTFLAG        \0808\100700041290-R\2108MAIN\2D15FILE\1919IO\610D
XCRYPTKEY        \0808\1008000412A0-R\2208MAIN\2E15BUFFE\2709    `20
XCRYPTREGION        \0808     00020EE0-R\1F08\2D19OPERS\450E
XCURBP        \0808\100B000C20E0-R     WK-MAIN\3115BASIC\1915IND\630F
X        \0808\1010\2020\400BBUFFER\5113CRYPT\690E
X        \0808\1010\2020\400BDISPLAY\5212EVAL\680F
X        \0808\1010\2020\400BEXEC\4F15FENCES\6A0D
X        \0808\1010\2020\400BFILE\1919C\690E
X        \0808\1010\2020\400BFINDERR\5212GLOBALS\6B0C
X        \0808\1010\2020\400BINPUT\1916SER\1A0E
X        \0808\1010\2020\400BISEARCH\5212LINE\680F
X        \0808\1010\2020\4008WK-MAIN\4F15MODES\690E
X        \0808\1010\2020\400BMSGS\4F15ONELINER\6C0B
X        \0808\1010\2020\400BOPERS\5014RANDOM\6A0D
X        \0808\1010\2020\400BREGION\5113SEARCH\6A0D
X        \0808\1010\2020\400BSELECT\1914PAWN\690E
X        \0808\1010\2020\400BTAGS\4F15UNDO\680F
X        \0808\1010\2020\400BWINDOW\1914ORD\680F
XCURCOL        \0808\100A000C20F0-R     WK-MAIN\3015DISPLAY\4C0F\3216
XCURGOAL        \0808\1009000412B0-R\2308MAIN\2F15BASIC\1915UFFE\4009    `20
X        \0808\1010\2020\400BDISPLAY\5212EXEC\680F
X        \0808\1010\2020\400BINSERT\5113WINDOW\6A0D
XCURRENT_DIRECTORY        \08070001FF40-R\1908RANDOM\270F    BIND\1713  BUFFE
V\4009    `20
X        \0808\1010\2020\400BEVAL\4F15FILEC\690E
X        \0808\1010\2020\400BPATH\4F0F
XCURRENT_MODENAME        \08080001B5C8-R\1A08INSERT\2810   EVAL\3F0F
XCURROW        \0808\100A000C2100-R     WK-MAIN\3015DISPLAY\4C0F\3216
XCURTABVAL        \0808\1007000C2110-R     WK-MAIN\2D15BASIC\1915UFFE\4006\6608
V
X        \0808\1010\2020\400BDISPLAY\5212INSERT\6A0D
X        \0808\1010\2020\400BLINE\4F12WK-MAIN\680F
X        \0808\1010\2020\400BMODES\5014REGION\6A0D
XCURWP        \0808\100B000C2120-R     WK-MAIN\3115BASIC\1915IND\630F
X        \0808\1010\2020\400BBUFFER\5113CRYPT\690E
X        \0808\1010\2020\400BCSRCH\5014DISPLAY\6B0C
X        \0808\1010\2020\400BEVAL\1916XEC\680F
X        \0808\1010\2020\400BFENCES\1914ILE\680F
X        \0808\1010\2020\400BFINDERR\5212GLOBALS\6B0C
X        \0808\1010\2020\400BHISTORY\5212INPUT\690E
X        \0808\1010\2020\400BINSERT\1914SEARCH\6B0C
X        \0808\1010\2020\400BLINE\4F12WK-MAIN\680F
X        \0808\1010\2020\400BMAP\1917ODES\690E
X        \0808\1010\2020\400BMSGS\4F15ONELINER\6C0B
X        \0808\1010\2020\400BOPERS\5014RANDOM\6A0D
X        \0808\1010\2020\400BREGION\5113SEARCH\6A0D
X        \0808\1010\2020\400BSELECT\5113TAGS\680F
X        \0808\1010\2020\400BUNDO\4F15WINDOW\6A0D
X        \0808\1010\2020\400BWORD\1919MOV\6B0C
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   32
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
X        \0808\1010\2020\400BX11\4E10
XDBGWRITE        \0808\100800015C20-R\2208DISPLAY\3112MAP\4610
XDECC$$ALLOC_VFORK_BLOCKS        00003020-RX\1307DECC$SHR\2208\2A08 MAIN\150F
XDECC$$GET_VFORK_JMPBUF          00003010-RX\1507DECC$SHR\240A\2E07MAIN\150F
XDECC$$SHELL_HANDLER             00003A20-RX\1807DECC$SH\270E    INPUT\1611   M
VAIN\2E0F
XDECC$ACCESS        \0808     00001DB0-RX\2007DECC$SHR\2F11FILEIO\460D
XDECC$ATOI        \0808\100700002080-RX\2207DECC$SHR\3111EVAL\4615EXEC\5F0F
X        \0808\1010\2020\400BFINDERR\5212MAIN\680F
X        \0808\1010\2020\400BMENU\4F0F
XDECC$CALLOC        \0808     00001FF0-RX\2007DECC$SHR\2F11BIND\4415BUFFE\300E
V
X        \0808\1010\2020\400BDISPLAY\5212FILEC\690E
X        \0808\1010\2020\400BMAP\1917ODES\690E
X        \0808\1010\2020\400BTAGS\4F15VMS2UNIX\6C0B
X        \0808\1010\2020\400BWINDOW\510D
XDECC$CFREE        \0808\1006000021E0-RX\2107DECC$SHR\3011VMS2UNI\2808   `20
XDECC$CHDIR        \0808\100600003910-RX\2107DECC$SH\3012RANDOM\470D
XDECC$CLOSE        \0808\100600001DC0-RX\2107DECC$SHR\3011PATH\4515VMSPIP\610D
V
XDECC$CREAT        \0808\100600001DD0-RX\2107DECC$SHR\3011FILEIO\470D
XDECC$CTIME        \0808\100600002930-RX\2107DECC$SHR\3011VERSION\480C
XDECC$DELETE        \0808     00001DE0-RX\2007DECC$SHR\2F11SPAWN\450E
XDECC$DUP        \0808\100800001DF0-RX\2307DECC$SHR\3211MAIN\470F
XDECC$EXECL        \0808\100600003030-RX\2107DECC$SHR\3011MENU\450F
XDECC$EXIT        \0808\100700002000-RX\2207DECC$SHR\3111MAIN\4615VERSIO\1C0D
X        \0808\1010\2020\400BWINDOW\5113X11\6710
XDECC$FCLOSE        \0808     00001580-RX\2007DECC$SHR\2F11FILEIO\4613MENU\5D0F
V
XDECC$FDOPEN        \0808     00001D20-RX\2007DECC$SHR\2F11FILEIO\4613MAI\5D10
V
XDECC$FFLUSH        \0808     000015B0-RX\2007DECC$SHR\2F11DUMBTERM\4811VMSPIPE
V\600C
XDECC$FGETC        \0808\1006000015C0-RX\2107DECC$SHR\3011FILEIO\470D
XDECC$FGETNAME        \0808   00001CF0-RX\1E07DECC$SHR\2D11FIL\4214\1906IO\5D0D
V
XDECC$FGETS        \0808\1006000015E0-RX\2107DECC$SHR\3011MENU\450F
XDECC$FILENO        \0808     000015F0-RX\2007DECC$SHR\2F11FILEI\4614MAIN\5D0F
V
XDECC$FOPEN        \0808\100600001600-RX\2107DECC$SHR\3011FILEIO\4713MENU\5E0F
V
XDECC$FPUTC        \0808\100600001640-RX\2107DECC$SHR\3011FILEIO\470D
XDECC$FPUTS        \0808\100600001650-RX\2107DECC$SHR\3011MAIN\450F
XDECC$FREE        \0808\100700002020-RX\2207DECC$SHR\3111BIND\4615BUFFE\300E
X        \0808\1010\2020\400BDISPLAY\5212EVAL\680F
X        \0808\1010\2020\400BEXEC\4F15FILE\680F
X        \0808\1010\2020\400BFILEC\1918IO\6A0D
X        \0808\1010\2020\400BFINDERR\5212GLOB\680F
X        \0808\1010\2020\400BINPUT\1915SEARCH\6B0C
X        \0808\1010\2020\400BITBUFF\5113LINE\680F
X        \0808\1010\2020\400BMAIN\1917P\6710
X        \0808\1010\2020\400BMODES\5014ONELINER\6C0B
X        \0808\1010\2020\400BRANDOM\1914EGEXP\6A0D
X        \0808\1010\2020\400BSEARCH\1915LECT\6A0D
X        \0808\1010\2020\400BTAGS\1916BUFF\690E
X        \0808\1010\2020\400BWINDOW\5113X11\6710
XDECC$FSEEK        \0808\100600001680-RX\2107DECC$SHR\3011FILEIO\470D
XDECC$FSTAT        \0808\100600001E10-RX\2107DECC$SHR\3011FILEIO\470D
XDECC$FWRITE        \0808     000016E0-RX\2007DECC$SHR\2F11VMSPIP\470D
XDECC$GA_ENVIRON        \0808 00000500-RX\1C07DECC$SHR\2B11FILEC\410E
XDECC$GA_RMS_FAB        \0808 00000550-RX\1C07DECC$SHR\2B11PATH\4011    VMS2UNI
V\4108   `20
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   33
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XDECC$GA_RMS_NAM        \0808 00000560-RX\1C07DECC$SHR\2B11PATH\4011    VMS2UNI
V\4108   `20
XDECC$GA_STDERR        \0808  000004F0-RX\1D07DECC$SH\2C12FILE\4112   MAIN\5A0F
V
X        \0808\1010\2020\400BVERSION\5212X11\6710
XDECC$GA_STDIN        \0808   000004D0-RX\1E07DECC$SHR\2D11DUMBTERM\4611MA\5B11
V
XDECC$GA_STDOUT        \0808  000004E0-RX\1D07DECC$SHR\2C11DUMBTERM\450B
XDECC$GETCHAR        \0808    00001700-RX\1F07DECC$SH\2E12DUMBTERM\470B
XDECC$GETCWD        \0808     000024A0-RX\2007DECC$SHR\2F11RANDOM\4613VMS2UNI
V\4108   `20
XDECC$GETENV        \0808     00002030-RX\2007DECC$SHR\2F11BIND\4415EVAL\5D0F
X        \0808\1010\2020\400BMAIN\1916ENU\680F
X        \0808\1010\2020\400BVMS2UNIX\530B
XDECC$GETNAME        \0808    00001E20-RX\1F07DECC$SHR\2E11PATH\430F
XDECC$GXFPRINTF        \0808  000046D0-RX\1D07DECC$SHR\2C11FILE\4112   VERSION
V\5D0C
X        \0808\1010\2020\400BX11\4E10
XDECC$GXPRINTF        \0808   000046E0-RX\1E07DECC$SHR\2D11MAIN\4213  MENU\5B0F
V
XDECC$GXSPRINTF        \0808  000046F0-RX\1D07DECC$SHR\2C11MENU\4112   X11\5910
V
XDECC$ISATTY        \0808     00001E40-RX\2007DECC$SHR\2F11MAIN\440F
XDECC$LONGJMP        \0808    00001370-RX\1F07DECC$SHR\2E11MAIN\430F
XDECC$MAIN        \0808\1007000007B0-RX\2207DECC$SHR\3111\4613
XDECC$MALLOC        \0808     00002040-RX\2007DECC$SHR\2F11BASI\4515BIND\5D0F
X        \0808\1010\2020\400BBTREE\5014DISPLAY\6B0C
X        \0808\1010\2020\400BEVAL\1916XEC\680F
X        \0808\1010\2020\400BFILE\1919C\690E
X        \0808\1010\2020\400BFILEIO\1915NDERR\6B0C
X        \0808\1010\2020\400BGLOB\4F15INPUT\690E
X        \0808\1010\2020\400BITBUFF\5113LINE\680F
X        \0808\1010\2020\400BMAIN\1917P\6710
X        \0808\1010\2020\400BMENU\1916ODES\690E
X        \0808\1010\2020\400BONELINER\5311REGEXP\6A0D
X        \0808\1010\2020\400BSEARCH\1915LECT\6A0D
X        \0808\1010\2020\400BTAGS\1916BUFF\690E
X        \0808\1010\2020\400BUNDO\4F15WINDOW\6A0D
X        \0808\1010\2020\400BX11\4E10
XDECC$MEMCMP        \0808     00002660-RX\2007DECC$SHR\2F11DISPLAY\4712EXEC
V\5D0F
X        \0808\1010\2020\400BHISTORY\5212UNDO\680F
X        \0808\1010\2020\400BWORD\4F0F
XDECC$MKDIR        \0808\100600003960-RX\2107DECC$SH\3012FILE\450F
XDECC$MKTEMP        \0808     00001E60-RX\2007DECC$SHR\2F11FILE\4415VMS2UNI
V\4108   `20
XDECC$OPEN        \0808\100700001E70-RX\2207DECC$SHR\3111PATH\4615VMSPIPE\620C
V
XDECC$PUTCHAR        \0808    00001770-RX\1F07DECC$SH\2E12DUMBTERM\470B
XDECC$PUTS        \0808\100700001780-RX\2207DECC$SHR\3111MENU\460F
XDECC$QSORT        \0808\100600002170-RX\2107DECC$SHR\3011FILEC\460E
XDECC$READ        \0808\100700001E80-RX\2207DECC$SHR\3111FILEIO\480D
XDECC$REALLOC        \0808    00002050-RX\1F07DECC$SHR\2E11DISPLAY\4612EXEC
V\5C0F
X        \0808\1010\2020\400BFILE\1919C\690E
X        \0808\1010\2020\400BGLOB\4F15ITBUFF\6A0D
X        \0808\1010\2020\400BMAP\1917ODES\690E
X        \0808\1010\2020\400BTBUFF\500E
XDECC$REWIND        \0808     000017B0-RX\2007DECC$SHR\2F11VMSPIPE\470C
XDECC$SIGNAL        \0808     000013D0-RX\2007\3206HR\2F11MAIN\440F
XDECC$STAT        \0808\100700001E90-RX\2207\3206HR\3111FILE\4615FILEIO\610D
X        \0808\1010\2020\400BPATH\4F0F
XDECC$STRCAT        \0808     000026A0-RX\2007\3206HR\2F11BIND\4415BUFFE\300E
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   34
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
X        \0808\1010\2020\400BEVAL\4F15FILE\680F
X        \0808\1010\2020\400BFILEC\5014INPUT\690E
X        \0808\1010\2020\400BPATH\4F15VERSION\6B0C
X        \0808\1010\2020\400BVMS2UNIX\1914PIPE\6B0C
XDECC$STRCHR        \0808     000026B0-RX\2007\3206\2F13DISPLAY\4712EXEC\5D0F
X        \0808\1010\2020\400BFENCES\1914ILE\680F
X        \0808\1010\2020\400BFILEC\5014GLOB\680F
X        \0808\1010\2020\400BINPUT\5014MENU\680F
X        \0808\1010\2020\400BPATH\4F15RANDOM\6A0D
X        \0808\1010\2020\400BREGEXP\5113VMS2UNIX\6C0B
X        \0808\1010\2020\400BWINDOW\510D
XDECC$STRCMP        \0808     000026C0-RX\2007\3206HR\2F11BIND\4415BTREE\5E0E
X        \0808\1010\2020\400BBUFFER\5113DISPLAY\6B0C
X        \0808\1010\2020\400BEVAL\4F15FILE\680F
X        \0808\1010\2020\400BFILEC\1916NDERR\6B0C
X        \0808\1010\2020\400BINSERT\5113MAIN\680F
X        \0808\1010\2020\400BMAP\1917ENU\680F
X        \0808\1010\2020\400BMODES\5014OPER\190F
X        \0808\1010\2020\400BPATH\4F15RANDOM\6A0D
X        \0808\1010\2020\400BREGION\5113SEARCH\6A0D
X        \0808\1010\2020\400BVMS2UNIX\5311WORD\680F
X        \0808\1010\2020\400BX11\4E10
XDECC$STRCPY        \0808     000026E0-RX\2007\3206HR\2F11BIND\4415BUFFE\300E
X        \0808\1010\2020\400BCRYPT\5014DISPLAY\6B0C
X        \0808\1010\2020\400BEVAL\1916XEC\680F
X        \0808\1010\2020\400BFILE\1919C\690E
X        \0808\1010\2020\400BFILEIO\1915NDERR\6B0C
X        \0808\1010\2020\400BGLOB\4F15INPUT\690E
X        \0808\1010\2020\400BMAIN\1916ENU\680F
X        \0808\1010\2020\400BMODES\5014ONELINER\6C0B
X        \0808\1010\2020\400BPATH\4F15RANDOM\6A0D
X        \0808\1010\2020\400BREGION\5113SEARCH\6A0D
X        \0808\1010\2020\400BSPAWN\5014TAGS\680F
X        \0808\1010\2020\400BVMS2UNIX\1914PIPE\6B0C
XDECC$STRCSPN        \0808    000026F0-RX\1F07\3206HR\2E11REGEXP\450D
XDECC$STRLEN        \0808     00002710-RX\2007\3206HR\2F11BIND\4415BTREE\5E0E
X        \0808\1010\2020\400BBUFFER\5113CRYPT\690E
X        \0808\1010\2020\400BDISPLAY\5212EVAL\680F
X        \0808\1010\2020\400BEXEC\4F15FILE\680F
X        \0808\1010\2020\400BFILEC\1916NDERR\6B0C
X        \0808\1010\2020\400BGLOB\4F15INPUT\690E
X        \0808\1010\2020\400BISEARCH\5212MAIN\680F
X        \0808\1010\2020\400BMODES\5014PATH\680F
X        \0808\1010\2020\400BRANDOM\1914EGEXP\6A0D
X        \0808\1010\2020\400BREGION\5113SPAW\180F
X        \0808\1010\2020\400BTAGS\1916BUFF\690E
X        \0808\1010\2020\400BTERMIO\5113VERSION\6B0C
X        \0808\1010\2020\400BVMS2UNIX\1914PIPE\6B0C
X        \0808\1010\2020\400BX11\4E10
XDECC$STRNCMP        \0808    00002730-RX\1F07\3206HR\2E11BIND\4314 BTREE\5D0E
V
X        \0808\1010\2020\400BEVAL\4F15FILE\680F
X        \0808\1010\2020\400BGLOB\4F15MODES\690E
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   35
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
X        \0808\1010\2020\400BPATH\4F15REGEXP\6A0D
X        \0808\1010\2020\400BTAGS\4F15VMS2UNIX\6C0B
XDECC$STRNCPY        \0808    00002740-RX\1F07\3206HR\2E11BIND\4314 BUFFE\300E
V
X        \0808\1010\2020\400BDISPLAY\5212EVAL\680F
X        \0808\1010\2020\400BEXEC\4F15FIL\1A10
X        \0808\1010\2020\400BGLOB\4F15MAIN\680F
X        \0808\1010\2020\400BSEARCH\1914PAWN\690E
XDECC$STRRCHR        \0808    00002760-RX\1F07\3206\2E13FILEC\4414GLOB\5C0F
X        \0808\1010\2020\400BPATH\4F15VMS2UNIX\6C0B
XDECC$STRTOK        \0808     00002780-RX\2007\3206HR\2F11MENU\440F
XDECC$STRTOL        \0808     000021A0-RX\2007\3206HR\2F11EVA\4416MODES\5E0E
X        \0808\1010\2020\400BVMS2UNIX\530B
XDECC$SYSTEM        \0808     00002060-RX\2007\3206HR\2F11SPAWN\450E
XDECC$TMPFILE        \0808    00001840-RX\1F07DECC$SHR\2E11VMSPIP\460D
XDECC$WAIT        \0808\1007000030A0-RX\2207DECC$SHR\3111MENU\460F
XDECC$_EXIT        \0808\100600002010-RX\2107DECC$SHR\3011MENU\450F
XDEFINE_MODE        \0808     0001E3F0-R\1F08MODES\2C14EXTERN\1B0D
XDEFINE_SUBMODE        \0808  0001E358-R\1C08MODES\2912  EXTERN\1B0D
XDELETE_NAMEBST        \0808  00012D20-R\1C08BIND\2812   BUFFE\2709    `20
XDELGLOBMODE        \0808     0001E910-R\1F08MODES\2C14EXTERN\1B0D
XDELINK_BP        \0808\100700014048-R\2108BUFFE\0E09\370BWINDOW\480D
XDELLOCMODE        \0808\10060001E950-R\2008MODES\2D14EXTERN\1B0D
XDELTOEOL        \0808\1008000202B8-R\2208RANDOM\3013EXTERNS\4A12LINE\600F
XDELWIND        \0808\100900024330-R\2308WINDOW\3113EXTERNS\4B12X11\6010
XDELWP        \0808\100B00024310-R\2508WINDOW\3313BUFFE\2709    `20
XDESAPRO        \0808\100900013780-R\2308BIND\2F15EXTERNS\4B0C
XDESBIND        \0808\1009000137F0-R\2308\2F19EXTERNS\4B0C
XDESFUNC        \0808\100900013760-R\2308BIND\2F15EXTERNS\4B0C
XDESKEY        \0808\100A000136D0-R\2408BIND\3015EXTERNS\4C0C
XDESMOTIONS        \0808\1006000137D0-R\2008BIND\2C15EXTER\480E
XDESOPERS        \0808\1008000137B0-R\2208BIND\2E15EXTERN\4A0D
XDESPRINT        \0808\100800010A38-R\2208MAIN\2E15EXTERNS\4A0C
XDETABLINE        \0808\100700020D50-R\2108REGION\2F0D
XDETAB_REGION        \0808    00021140-R\1E08\2C19OPERS\440E
XDIRCOMPLETION_BUFNAME           00030920-R\1508MAIN\210B\2C0AFILEC\1A0E
XDISCMD        \0808\100A000412C0-R\2408MAIN\3015BIN\4916DISPLAY\650C
X        \0808\1010\2020\400BEVAL\1916XEC\680F
X        \0808\1010\2020\400BSPAWN\500E
XDISINP        \0808\100A000412D0-R\2408MAIN\3015BIND\4915CRYPT\630E
X        \0808\1010\2020\400BEVAL\4F15HISTORY\6B0C
X        \0808\1010\2020\400BINPUT\500E
XDOBUF        \0808\100B00016D80-R\2508EXEC\3115MAIN\4A0F
XDOCMD        \0808\100B00016E60-R\2508EXEC\3115MENU\4A15SELECT\650D
XDOFILE        \0808\100A000175B0-R\2408EXEC\3015MENU\490F
XDOGLOB        \0808\100A00019E20-R\2408\3019EVAL\4915FILEC\630E
X        \0808\1010\2020\400BRANDOM\5113TAGS\680F
XDOINGOPCMD        \0808\1006000C2130-R     WK-MAIN\2C15BASIC\4614CSRCH\5F0E
X        \0808\1010\2020\400BEXEC\4F15FENCES\6A0D
X        \0808\1010\2020\4008WK-MAIN\4F15OPERS\690E
X        \0808\1010\2020\400BSELECT\5113UNDO\680F
X        \0808\1010\2020\400BWORDMOV\520C
XDOINGSWEEP        \0808\1006000C2140-R     WK-MAIN\2C15BASIC\4614CSRCH\5F0E
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   36
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
X        \0808\1010\2020\400BEXEC\4F15FENCES\6A0D
X        \0808\1010\2020\4008WK-MAIN\4F15SELECT\6A0D
X        \0808\1010\2020\400BWORDMOV\520C
XDOTCMD        \0808\100A000C2150-R     WK-MAIN\3015INPUT\1916SER\1A0E
X        \0808\1010\2020\4008WK-MAIN\4F0F
XDOTCMDARG        \0808\1007000412E0-R\2108MAIN\2D15EXEC\4615INPUT\600E
X        \0808\1010\2020\400BINSERT\510D
XDOTCMDBEGIN        \0808     0001A960-R\1F08INPUT\2C14MA\4411
XDOTCMDCNT        \0808\1007000C2160-R     WK-MAIN\2D15INPU\4715INSER\610E
X        \0808\1010\2020\4008WK-MAIN\4F0F
XDOTCMDFINISH        \0808    0001A940-R\1E08INPUT\2B14MAIN\430F
XDOTCMDKREG        \0808\1006000C2170-R     WK-MAIN\2C15EXEC\4515INPUT\5F0E
X        \0808\1010\2020\400BLINE\4F12WK-MAIN\680F
XDOTCMDMODE        \0808\1006000412F0-R\2008MAIN\2C15EXEC\4515INPUT\5F0E
X        \0808\1010\2020\400BINSERT\5113LINE\680F
XDOTCMDPLAY        \0808\10060001A8F0-R\2008INPUT\2D14EXTERNS\480C
XDOTCMDREP        \0808\1007000C2180-R     WK-MAIN\2D15INPUT\1916SER\1A0E
X        \0808\1010\2020\4008WK-MAIN\4F0F
XDOTCMDSTOP        \0808\10060001A930-R\2008INPUT\2D14EXEC\450F
XDOWATCHCALLBACK        \0808 00000000-*\1B11\2C10X11\3F10
XDO_MENU        \0808\10090001D840-R\2308\2F19X11\4710
XDO_REPEATS        \0808\100600010098-R\2008MAIN\2C15LINE\4515OPER\5F0F
X        \0808\1010\2020\400BSELECT\510D
XDO_REPORT        \0808\10070001C350-R\2108LINE\2D15ONELINE\2909\190APERS\600E
V
X        \0808\1010\2020\400BRANDOM\1914EGION\6A0D
XDO_SOURCE        \0808\100700017610-R\2108EXEC\2D15MAIN\460F
XDUMB_TERM        \0808\100700041300-R\2108DUMB\310F
XDUMPULINE        \0808\100700023390-R\2108UNDO\2D15\4613
XEDITC        \0808\100B00041380-R\2508MAIN\3115BIND\4A15INPUT\640E
XEDITHISTORY        \0808     0001A3B8-R\1F08\2E19INPUT\450E
XEND_NAMED_CMD        \0808   00017B90-R\1D08EXEC\2913  FILE\1915MAP\5A10
XEND_STRING        \0808\10060001B068-R\2008INPUT\2D14EXEC\4515MODES\5F0E
XENGL2FNC        \0808\100800013440-R\2208BIND\2E15EXE\4716GLOBALS\630C
X        \0808\1010\2020\400BLINE\4F15MENU\680F
X        \0808\1010\2020\400BOPERS\500E
XENLARGEWIND        \0808     00024210-R\1F08WINDOW\2D13EXTERNS\470C
XENTABLINE        \0808\100700020DC0-R\2108REGION\2F13WORD\460F
XENTAB_REGION        \0808    00021118-R\1E08\2C19OPERS\440E
XENVARS        \0808\100A00030930-R\2408MAIN\3015EVAL\490F
XEOFFLAG        \0808\1009000C2190-R     WK-MAIN\2F15FILEIO\4A10\3216
XEOLEXIST        \0808\100800041390-R\2208MAIN\2E0F
XEOL_HISTORY        \0808     0001B018-R\1F08INPUT\2C14EXEC\4415MAP\5C10
X        \0808\1010\2020\400BMODES\500E
XEQ        \0808\100E000214F0-R\2808SEARCH\3613EVAL\4D0F
XERRORM        \0808\100A000413A0-R\2408MAIN\3015EVAL\4915MODES\630E
XERRORS_BUFNAME        \0808  00030A30-R\1C08MAIN\2812   FINDERR\440C
XESC_FUNC        \0808\100800010C20-R\2208MAIN\2E15EXTERNS\4A12INPUT\610E
XEV_END_OF_CMD        \0808   000C21A0-R     WK-MAIN\2913  EVAL\1916XEC\5B0F
X        \0808\1010\2020\4008WK-MAIN\4F0F
XEX        \0808\100E00010B00-R\2808MAIN\3415EXTERNS\500C
XEXECBUF        \0808\100900017680-R\2308EXEC\2F15EXTERNS\4B0C
XEXECFILE        \0808\100800017650-R\2208EXEC\2E15EXTERNS\4A0C
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   37
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XEXECHYPERCMD        \0808    00021AE0-R\1E08SELECT\2C13EXTERNS\4612X11\5B10
XEXECKREG        \0808\10080001C610-R\2208LINE\2E15EXTERNS\4A0C
XEXECPROC        \0808\1008000176E0-R\2208EXEC\2E15EXTERNS\4A0C
XEXECSTR        \0808\1009000C21B0-\2306WK-MAIN\2F15EVAL\1916XEC\610F
X        \0808\1010\2020\400BINPUT\5011WK-MAIN\680F
XEXECUTE        \0808\100900016F48-R\2308EXEC\2F15INPUT\1916SER\1A0E
X        \0808\1010\2020\400BLINE\4F15MAIN\680F
X        \0808\1010\2020\400BOPERS\5014SELECT\6A0D
XEXEC_PATHNAME        \0808   000413B0-R\1D08MAIN\2913  BIND\1915MENU\5B0F
XEXITHOOK        \0808\1008000C21C0-R     WK-MAIN\2E15EVAL\4712\3216
XEXPAND_WILD_ARGS        \080800019E88-R\1A08GLOB\2610     MAIN\3F0F
XFALSEM        \0808\100A000413C0-R\2408MAIN\3015EVAL\4915MODES\630E
XFCSRCH        \0808\100A00014E90-R\2408\3119EXTERNS\4C0C
XFCSRCH_TO        \0808\100700014EB0-R\2108CSRCH\2E14EXTERNS\490C
XFFACCESS        \0808\1008000196C0-R\2208FILEIO\3013BIND\470F
XFFCLOSE        \0808\100900019550-R\2308FILEIO\3113FILE\4815MAIN\610F
XFFEXISTS        \0808\100800019640-R\2208FILEIO\3013BUFFE\2709\510BFILE\600F
XFFGETLINE        \0808\100700019450-R\2108FILEIO\2F13FILE\460F
XFFHASDATA        \0808\100700019438-R\2108FILEIO\2F0D
XFFP        \0808\100D000C21E0-R     WK-MAIN\3315FILE\1919IO\670D
X        \0808\1010\2020\4008WK-MAIN\4F0F
XFFPUTC        \0808\100A000194F0-R\2408FILEIO\3213FILE\490F
XFFPUTLINE        \0808\100700019530-R\2108FILEIO\2F13FILE\460F
XFFREAD        \0808\100A00019600-R\2408FILEIO\3213FILE\490F
XFFREWIND        \0808\100800019580-R\2208FILEIO\3013FILE\470F
XFFRONLY        \0808\1009000196F0-R\2308FILEIO\3113FILE\480F
XFFROPEN        \0808\1009000197C8-R\2308FILEIO\3113FILE\480F
XFFSEEK        \0808\100A000195D0-R\2408FILEIO\3213FILE\490F
XFFSIZE        \0808\100A00019690-R\2408FILEIO\3213FILE\490F
XFFWOPEN        \0808\100900019750-R\2308FILEIO\3113FILE\480F
XFILECOMPLETION_BUFNAME          00030A50-R\1408MAIN\200A\2A0A BIND\1915FILEC
V\330E
X        \0808\1010\2020\400BINPUT\500E
XFILEC_EXPAND        \0808    00018D08-R\1E08FILEC\2B14FILE\430F
XFILEFIND        \0808\100800018BC0-R\2208FILE\2E15EXTERNS\4A0C
XFILEISPIPE        \0808\1006000C21F0-R     WK-MAIN\2C15FILE\1919IO\600D
X        \0808\1010\2020\4008WK-MAIN\4F0F
XFILENAME        \0808\100800018690-R\2208FILE\2E15EXTERNS\4A0C
XFILEREAD        \0808\100800018C30-R\2208FILE\2E15EXTERNS\4A0C
XFILESAVE        \0808\100800018738-R\2208FILE\2E15BUFFE\2709\510BEXTERNS\630C
V
X        \0808\1010\2020\400BINSERT\5113MAIN\680F
XFILEWRITE        \0808\100700018780-R\2108FILE\2D15EXTERNS\490C
XFILE_MODIFIED        \0808   00017E80-R\1D08FILE\2913  VERSION\450C
XFILTERREGION        \0808    00022160-R\1E08SPAW\2B15OPERS\440E
XFINDERR        \0808\100900019B68-\2309\3219EXTERNS\4B0C
XFINDERRBUF        \0808\1006000199F0-R\2008\3207\2F12EXTERNS\480C
XFINDPAT        \0808\1009000213B0-R\2308SEARCH\3113BASIC\490E
XFIND_ALT        \0808\1008000145F8-R\2208BUFFE\0E09\380BEVAL\4715INPU\610F
XFIND_ANY_BUFFER        \0808 00014930-\1B09\2917  FINDER\430D
XFIND_BP        \0808\100900013F80-R\2308BUFFE\0E09\390BMAIN\480F
XFIND_B_FILE        \0808     000148E8-R\1F08BUFFE\0E09\350BEXEC\4415\5D13
XFIND_B_HIST        \0808     000148C0-R\1F08BUFFE\0E09    `20
XFIND_B_NAME        \0808     00013E10-R\1F08BUFFE\0E09\350BBIND\4415EVAL\5D0F
V
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   38
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
X        \0808\1010\2020\400BEXEC\4F15FILE\680F
X        \0808\1010\2020\400BFINDERR\5212HISTORY\6B0C
X        \0808\1010\2020\400BMSGS\4F15TA\1911
XFIND_MODE        \0808\10070001E7F0-R\2108MODES\2E14EVAL\460F
XFIND_RELEASE_ATTR        \080700021FA8-\1909SELECT\270F    REGION\400D
XFIRSTBUFFER        \0808     00014B10-\1F09\2D19EXTERNS\470C
XFIRSTCHAR        \0808\100700012388-\2109BASIC\2E14FENCES\4813INSERT\610D
X        \0808\1010\2020\400BRANDOM\5113UNDO\680F
XFIRSTNONWHITE        \0808   00012398-R\1D08BASIC\2A13 EXE\1815 EXTERNS\5E0C
X        \0808\1010\2020\400BFENCES\5113INSERT\6A0D
X        \0808\1010\2020\400BLINE\4F15OPERS\690E
X        \0808\1010\2020\400BREGION\5113TAGS\680F
X        \0808\1010\2020\400BWORD\4F0F
XFISEARCH        \0808\10080001C330-R\2208\3119EXTERNS\4A0C
XFLEN        \0808\100C000C2200-R     WK-MAI\3216FILEIO\4D10\3216
XFLICKCODE        \0808\1007000C2210-R     WK-MAIN\2D15EVAL\4612\3216
XFLINE        \0808\100B000C2220-R     WK-MAIN\3115FIL\4A16FILEIO\650D
X        \0808\1010\2020\4008WK-MAIN\4F0F
XFLIPCHAR        \0808\100800020338-\2209RANDOM\3013EXTERNS\4A0C
XFLIPREGION        \0808\100600020FC0-R\2008\2E19OPERS\460E
+-+-+-+-+-+-+-+-  END  OF PART 138 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 139 -+-+-+-+-+-+-+-+
XFLOOK        \0808\100B00013510-R\2508BIND\3115EVAL\1916XEC\630F
X        \0808\1010\2020\400BFILEC\5014MAIN\680F
X        \0808\1010\2020\400BMENU\4F15TAGS\680F
X        \0808\1010\2020\400BVERSION\520C
XFMATCH        \0808\100A00017C40-R\2408FENCES\3213INSERT\4B0D
XFMATCHINDENT        \0808    00017DD0-R\1E08FENCES\2C13INSER\450E
XFNC2KCOD        \0808\100800013470-R\2208BIN\2E16INPUT\4814SELEC\1A0E
XFNC2PSTR        \0808\100800013480-\2209BIND\2E15X11\4610
XFORCEBLANK        \0808\100600020380-R\2008RANDOM\2E13EXTERNS\480C
XFORK        \0808\100C00000000-*\261C     MENU\4B0F
XFORMATREGION        \0808    00024818-R\1E08WORD\2A14 OPERS\440E
XFORWBLINE        \0808\1007000129E8-R\2108BASIC\2E14EXTERNS\4912RANDOM\610D
XFORWCHAR        \0808\100800012850-\2209BASIC\2F14BIND\4715CSRCH\610E
X        \0808\1010\2020\400BEXTERNS\5212FENCE\180E
X        \0808\1010\2020\400BINSERT\1914SEARCH\6B0C
X        \0808\1010\2020\400BLINE\4F15ONELINER\6C0B
X        \0808\1010\2020\400BSEARCH\5113WORD\680F
XFORWCHAR_TO_EOL        \0808 00012AB0-R\1B08BASIC\2811   EXTERNS\1B12RANDOM
V\5B0D
XFORWDELCHAR        \0808     00020318-\1F09RANDOM\2D13EXTERNS\470C
XFORWENDW        \0808\100800024990-R\2208WORD\2E15EXTERNS\4A0C
XFORWHPAGE        \0808\1007000127B8-R\2108BASIC\2E14BIND\4615EXTERNS\620C
X        \0808\1010\2020\400BWINDOW\510D
XFORWHUNT        \0808\100800021660-R\2208SEARCH\3013EXTERNS\4A12MAIN\600F
XFORWLINE        \0808\100800012568-R\2208BASIC\2F14BUFFE\2709\510BEVAL\600F
X        \0808\1010\2020\400BEXEC\1917TERNS\6B0C
X        \0808\1010\2020\400BHISTORY\5212WORD\680F
XFORWPAGE        \0808\100800012800-R\2208BASIC\2F14EXTERNS\4A0C
XFORWREDO        \0808\1008000234D0-R\2208UN\2E17EXTERNS\4A0C
XFORWSEARCH        \0808\1006000217A0-R\2008\2E19EXTERNS\480C
XFORWVIENDW        \0808\1006000249C0-R\2008WORD\2C15EXTERNS\480C
XFORWVIWORD        \0808\1006000249F0-R\2008\2C19EXTERNS\480C
XFORWWORD        \0808\100800024930-R\2208\2E19EXTERNS\4A12INSERT\620D
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   39
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XFREEUNDOSTACKS        \0808  000232D0-R\1C08UNDO\2812   BUFFE\2709    `20
XFREE_ATTRIB        \0808     00021F88-R\1F08SELECT\2D13DISPLAY\4712LINE\5D0F
XFREE_ATTRIBS        \0808    00021800-R\1E08SELECT\2C13BUFFE\2709    `20
XFREE_LOCAL_VALS        \0808 0001DDC0-R\1B08MODE\2812   BUFFE\2709    `20
XFSEARCH        \0808\100900021720-R\2308\3119GLOBALS\4B0C
XFUNCS        \0808\100B00030A70-R\2508MAIN\3115EVAL\4A0F
XF_ABBREV        \0808\100800030BA0-R\2208EXTERNS\310C
XF_ALTBUFF        \0808\100700030BB0-R\2108EXTERNS\300C
XF_APPEND        \0808\100800030BC0-R\2208EXTERNS\3112INPUT\480E
XF_APPENDEOL        \0808     00030BD0-R\1F08EXTERNS\2E12INPUT\450E
XF_APPSTRING        \0808     00030BE0-R\1F08EXTERNS\2E0C
XF_BACKBLINE        \0808     00030BF0-R\1F08EXTERNS\2E0C
XF_BACKCHAR        \0808\100600030C00-\2009EXTERNS\2F0C
XF_BACKCHAR_TO_BOL        \080700030C10-R\1908EXTERNS\280F   RANDOM\1812 TERMIO
V\590D
XF_BACKDELCHAR        \0808   00030C20-\1D09EXTERNS\2C0C
XF_BACKHPAGE        \0808     00030C30-R\1F08EXTERNS\2E0C
XF_BACKHUNT        \0808\100600030C40-R\2008EXTERNS\2F0C
XF_BACKLINE        \0808\100600030C50-R\2008EXTERNS\2F0C
XF_BACKPAGE        \0808\100600030C60-R\2008EXTERNS\2F0C
XF_BACKSEARCH        \0808    00030C70-R\1E08EXTERNS\2D0C
XF_BACKUNDO        \0808\100600030C80-R\2008EXTERNS\2F12MAIN\450F
XF_BACKVIWORD        \0808    00030C90-R\1E08EXTERNS\2D0C
XF_BACKWORD        \0808\100600030CA0-R\2008EXTERNS\2F0C
XF_BCSRCH        \0808\100800030CB0-R\2208EXTERNS\310C
XF_BCSRCH_TO        \0808     00030CC0-R\1F08EXTERNS\2E0C
XF_BINDKEY        \0808\100700030CD0-R\2108EXTERNS\300C
XF_BKTOSHELL        \0808     00030CE0-R\1F08EXTERNS\2E0C
XF_CBUF1        \0808\100900030CF0-R\2308EXTERNS\320C
XF_CBUF10        \0808\100800030D00-R\2208EXTERNS\310C
XF_CBUF11        \0808\100800030D10-R\2208EXTERNS\310C
XF_CBUF12        \0808\100800030D20-R\2208EXTERNS\310C
XF_CBUF13        \0808\100800030D30-R\2208EXTERNS\310C
XF_CBUF14        \0808\100800030D40-R\2208EXTERNS\310C
XF_CBUF15        \0808\100800030D50-R\2208EXTERNS\310C
XF_CBUF16        \0808\100800030D60-R\2208EXTERNS\310C
XF_CBUF17        \0808\100800030D70-R\2208EXTERNS\310C
XF_CBUF18        \0808\100800030D80-R\2208EXTERNS\310C
XF_CBUF19        \0808\100800030D90-R\2208EXTERNS\310C
XF_CBUF2        \0808\100900030DA0-R\2308EXTERNS\320C
XF_CBUF20        \0808\100800030DB0-R\2208EXTERNS\310C
XF_CBUF21        \0808\100800030DC0-R\2208EXTERNS\310C
XF_CBUF22        \0808\100800030DD0-R\2208EXTERNS\310C
XF_CBUF23        \0808\100800030DE0-R\2208EXTERNS\310C
XF_CBUF24        \0808\100800030DF0-R\2208EXTERNS\310C
XF_CBUF25        \0808\100800030E00-R\2208EXTERNS\310C
XF_CBUF26        \0808\100800030E10-R\2208EXTERNS\310C
XF_CBUF27        \0808\100800030E20-R\2208EXTERNS\310C
XF_CBUF28        \0808\100800030E30-R\2208EXTERNS\310C
XF_CBUF29        \0808\100800030E40-R\2208EXTERNS\310C
XF_CBUF3        \0808\100900030E50-R\2308EXTERNS\320C
XF_CBUF30        \0808\100800030E60-R\2208EXTERNS\310C
XF_CBUF31        \0808\100800030E70-R\2208EXTERNS\310C
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   40
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XF_CBUF32        \0808\100800030E80-R\2208EXTERNS\310C
XF_CBUF33        \0808\100800030E90-R\2208EXTERNS\310C
XF_CBUF34        \0808\100800030EA0-R\2208EXTERNS\310C
XF_CBUF35        \0808\100800030EB0-R\2208EXTERNS\310C
XF_CBUF36        \0808\100800030EC0-R\2208EXTERNS\310C
XF_CBUF37        \0808\100800030ED0-R\2208EXTERNS\310C
XF_CBUF38        \0808\100800030EE0-R\2208EXTERNS\310C
XF_CBUF39        \0808\100800030EF0-R\2208EXTERNS\310C
XF_CBUF4        \0808\100900030F00-R\2308EXTERNS\320C
XF_CBUF40        \0808\100800030F10-R\2208EXTERNS\310C
XF_CBUF5        \0808\100900030F20-R\2308EXTERNS\320C
XF_CBUF6        \0808\100900030F30-R\2308EXTERNS\320C
XF_CBUF7        \0808\100900030F40-R\2308EXTERNS\320C
XF_CBUF8        \0808\100900030F50-R\2308EXTERNS\320C
XF_CBUF9        \0808\100900030F60-R\2308EXTERNS\320C
XF_CD        \0808\100C00030F70-R\2608EXTERNS\350C
XF_CHGCHAR        \0808\100700030F80-\2109EXTERNS\300C
XF_CHGLINE        \0808\100700030F90-R\2108EXTERNS\300C
XF_CHGTOEOL        \0808\100600030FA0-R\2008EXTERNS\2F0C
XF_CLEAR_MATCH_ATTRS             00030FB0-R\1708EXTERN\260D
XF_CLRMES        \0808\100800030FC0-R\2208EXTERN\310D
XF_CNTL_A_FUNC        \0808   00030FD0-R\1D08EXTERNS\2C12BIND\420F
XF_CNTL_X_FUNC        \0808   00030FE0-R\1D08EXTERNS\2C12BIND\420F
XF_COMP_ERR_EXPS        \0808 00030FF0-R\1B08EXTERN\2A0D
XF_CONSEARCH        \0808     00031000-R\1F08EXTERNS\2E0C
XF_COPY_TO_CLIPBOARD             00031010-R\1708EXTERNS\260C
XF_DEFINE_MODE        \0808   00031020-R\1D08EXTERNS\2C0C
XF_DEFINE_SUBMODE        \080800031030-R\1A08EXTERNS\290C
XF_DELGLOBMODE        \0808   00031040-R\1D08EXTERNS\2C0C
XF_DELLOCMODE        \0808    00031050-R\1E08EXTERNS\2D0C
XF_DELTOEOL        \0808\100600031060-R\2008EXTERNS\2F0C
XF_DELWIND        \0808\100700031070-R\2108EXTERNS\300C
XF_DESAPRO        \0808\100700031080-R\2108EXTERNS\300C
XF_DESBIND        \0808\100700031090-R\2108EXTERNS\300C
XF_DESFUNC        \0808\1007000310A0-R\2108EXTERNS\300C
XF_DESKEY        \0808\1008000310B0-R\2208EXTERNS\310C
XF_DESMOTIONS        \0808    000310C0-R\1E08EXTER\2D0E
XF_DESOPERS        \0808\1006000310D0-R\2008EXTERN\2F0D
XF_DESPRINT        \0808\1006000310E0-R\2008EXTERNS\2F0C
XF_DOTCMDPLAY        \0808    000310F0-R\1E08EXTERNS\2D12EXEC\4314 MAIN\5C0F
XF_ENLARGEWIND        \0808   00031100-R\1D08EXTERNS\2C0C
XF_ESC_FUNC        \0808\100600031110-R\2008EXTERNS\2F12BIND\450F
XF_EX        \0808\100C00031120-R\2608EXTERNS\350C
XF_EXECBUF        \0808\100700031130-R\2108EXTERNS\300C
XF_EXECFILE        \0808\100600031140-R\2008EXTERNS\2F0C
XF_EXECHYPERCMD        \0808  00031150-R\1C08EXTERNS\2B0C
XF_EXECKREG        \0808\100600031160-R\2008EXTERNS\2F0C
XF_EXECPROC        \0808\100600031170-R\2008EXTERNS\2F0C
XF_FCSRCH        \0808\100800031180-R\2208EXTERNS\310C
XF_FCSRCH_TO        \0808     00031190-R\1F08EXTERNS\2E0C
XF_FILEFIND        \0808\1006000311A0-R\2008EXTERNS\2F0C
XF_FILENAME        \0808\1006000311B0-R\2008EXTERNS\2F0C
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   41
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XF_FILEREAD        \0808\1006000311C0-R\2008EXTERNS\2F0C
XF_FILESAVE        \0808\1006000311D0-R\2008EXTERNS\2F0C
XF_FILEWRITE        \0808     000311E0-R\1F08EXTERNS\2E12EXEC\440F
XF_FINDERR        \0808\1007000311F0-\2109EXTERNS\300C
XF_FINDERRBUF        \0808    00031200-R\1E08EXTERNS\2D0C
XF_FIRSTBUFFER        \0808   00031210-\1D09EXTERNS\2C0C
XF_FIRSTNONWHITE        \0808 00031220-R\1B08EXTERNS\2A11 INPUT\410E
XF_FISEARCH        \0808\100600031230-R\2008EXTERNS\2F0C
XF_FLIPCHAR        \0808\100600031240-\2009EXTERNS\2F0C
XF_FORCEBLANK        \0808    00031250-R\1E08EXTERNS\2D0C
XF_FORWBLINE        \0808     00031260-R\1F08EXTERNS\2E0C
XF_FORWCHAR        \0808\100600031270-\2009EXTERNS\2F0C
XF_FORWCHAR_TO_EOL        \080700031280-R\1908EXTERNS\280F   INPUT\1712  RANDOM
V\590D
XF_FORWDELCHAR        \0808   00031290-\1D09EXTERNS\2C0C
XF_FORWENDW        \0808\1006000312A0-R\2008EXTERNS\2F0C
XF_FORWHPAGE        \0808     000312B0-R\1F08EXTERNS\2E0C
XF_FORWHUNT        \0808\1006000312C0-R\2008EXTERNS\2F0C
XF_FORWLINE        \0808\1006000312D0-R\2008EXTERNS\2F0C
XF_FORWPAGE        \0808\1006000312E0-R\2008EXTERNS\2F0C
XF_FORWREDO        \0808\1006000312F0-R\2008EXTERNS\2F12MAIN\450F
XF_FORWSEARCH        \0808    00031300-R\1E08EXTERNS\2D0C
XF_FORWVIENDW        \0808    00031310-R\1E08EXTERNS\2D0C
XF_FORWVIWORD        \0808    00031320-R\1E08EXTERNS\2D0C
XF_FORWWORD        \0808\100600031330-R\2008EXTERNS\2F0C
XF_GLOBALS        \0808\100700031340-R\2108EXTERN\3013EXEC\460F
XF_GODOTPLUS        \0808     00031350-R\1F08EXTERN\2E13GLOBAL\4713OPER\5E0F
X        \0808\1010\2020\400BRANDOM\5113WORD\680F
XF_GOEXACTNMMARK        \0808 00031360-R\1B08EXTERNS\2A0C
XF_GOLINENMMARK        \0808  00031370-R\1C08EXTERNS\2B0C
XF_GOMARK        \0808\100800031380-R\2208EXTERNS\3112EXEC\470F
XF_GORECTNMMARK        \0808  00031390-R\1C08EXTERNS\2B0C
XF_GOTOBOB        \0808\1007000313A0-R\2108EXTERNS\300C
XF_GOTOBOL        \0808\1007000313B0-R\2108EXTERNS\300C
XF_GOTOBOP        \0808\1007000313C0-R\2108EXTERNS\300C
XF_GOTOBOS        \0808\1007000313D0-R\2108EXTERN\300D
XF_GOTOBOSEC        \0808     000313E0-R\1F08EXTERNS\2E0C
XF_GOTOBOSENT        \0808    000313F0-R\1E08EXTERNS\2D0C
XF_GOTOCOL        \0808\100700031400-R\2108EXTERNS\300C
XF_GOTOEOB        \0808\100700031410-R\2108EXTERNS\300C
XF_GOTOEOL        \0808\100700031420-R\2108EXTERNS\3012INPUT\4714RANDOM\610D
XF_GOTOEOP        \0808\100700031430-R\2108EXTERNS\300C
XF_GOTOEOS        \0808\100700031440-R\2108EXTERN\300D
XF_GOTOEOSEC        \0808     00031450-R\1F08EXTERNS\2E0C
XF_GOTOEOSENT        \0808    00031460-R\1E08EXTERNS\2D0C
XF_GOTOLINE        \0808\100600031470-R\2008EXTERNS\2F0C
XF_GOTOMOS        \0808\100700031480-R\2108EXTERN\300D
XF_GOTOTAG        \0808\100700031490-R\2108EXTERNS\300C
XF_HELP        \0808\100A000314A0-R\2408EXTERNS\330C
XF_HISTBUFF        \0808\1006000314B0-R\2008EXTERNS\2F0C
XF_INF_UNDO        \0808\1006000314C0-R\2008EXTERNS\2F12MAIN\450F
XF_INSERT        \0808\1008000314D0-R\2208EXTERNS\3112INPU\480F
XF_INSERTBOL        \0808     000314E0-R\1F08EXTERNS\2E12INPUT\450E
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   42
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XF_INSERT_NO_AINDENT             000314F0-R\1708EXTERNS\260D     X11\1510
XF_INSFILE        \0808\100700031500-R\2108EXTERNS\3012EXEC\460F
XF_INSSPACE        \0808\100600031510-R\2008EXTERNS\2F0C
XF_INSSTRING        \0808     00031520-R\1F08EXTERNS\2E0C
XF_JOINLINES        \0808     00031530-R\1F08EXTERN\2E0D
XF_KBD_MAC_BEGIN        \0808 00031540-R\1B08EXTERNS\2A0C
XF_KBD_MAC_END        \0808   00031550-R\1D08EXTERNS\2C0C
XF_KBD_MAC_EXEC        \0808  00031560-R\1C08EXTERNS\2B0C
XF_KBD_MAC_SAVE        \0808  00031570-R\1C08EXTERNS\2B0C
XF_KILLBUFFER        \0808    00031580-\1E09EXTERNS\2D0C
XF_LASTNONWHITE        \0808  00031590-R\1C08EXTERNS\2B0C
XF_LINEPUTAFTER        \0808  000315A0-\1C09EXTERNS\2B12EXEC\410F
XF_LINEPUTBEFORE        \0808 000315B0-R\1B08EXTERNS\2A11 EXEC\400F
XF_LINEUNDO        \0808\1006000315C0-R\2008EXTERNS\2F0C
XF_LISTBUFFERS        \0808   000315D0-R\1D08EXTERN\2C0D
XF_LISTMODES        \0808     000315E0-R\1F08EXTERN\2E0D
XF_LISTVARS        \0808\1006000315F0-R\2008EXTERN\2F0D
XF_LIST_MAJORMODES        \080700031600-R\1908EXTERN\280D
XF_LOADKREG        \0808\100600031610-R\2008EXTERNS\2F0C
XF_MAP        \0808\100B00031620-R\2508EXTERNS\340C
XF_MAP_BANG        \0808\100600031630-R\2008EXTERNS\2F0C
XF_MATCHFENCE        \0808    00031640-R\1E08EXTERNS\2D0C
XF_MATCHFENCEBACK        \080800031650-R\1A08EXTERNS\290C
XF_MOUSE_MOTION        \0808  00031660-R\1C08EXTERNS\2B0C
XF_MULTIMOTION        \0808   00031670-R\1D08EXTERNS\2C12SELECT\440D
XF_MULTIMOTIONFULLLINE           00031680-R\1508EXTERNS\240B`20
XF_MULTIMOTIONRECTANGLE          00031690-R\1408EXTERNS\230A `20
XF_MVDNNXTWIND        \0808   000316A0-R\1D08EXTERNS\2C0C
XF_MVDNWIND        \0808\1006000316B0-R\2008EXTERNS\2F0C
XF_MVLEFTWIND        \0808    000316C0-R\1E08EXTERNS\2D0C
XF_MVRIGHTWIND        \0808   000316D0-R\1D08EXTERNS\2C0C
XF_MVUPNXTWIND        \0808   000316E0-R\1D08EXTERNS\2C0C
XF_MVUPWIND        \0808\1006000316F0-R\2008EXTERNS\2F0C
XF_NAMEBUFFER        \0808    00031700-\1E09EXTERNS\2D0C
XF_NAMEDCMD        \0808\100600031710-R\2008EXTERNS\2F12SPAWN\460E
XF_NEWLENGTH        \0808     00031720-R\1F08EXTERNS\2E0C
XF_NEWLINE        \0808\100700031730-R\2108EXTERNS\300C
XF_NEWPROCESSGROUP        \080700031740-R\1908EXTERNS\280C
XF_NEWWIDTH        \0808\100600031750-R\2008EXTERNS\2F0C
XF_NEXTBUFFER        \0808    00031760-\1E09EXTERNS\2D0C
XF_NEXTTAG        \0808\100700031770-R\2108EXTERNS\300C
XF_NEXTWIND        \0808\100600031780-R\2008EXTERNS\2F0C
XF_NOREMAP        \0808\100700031790-R\2108EXTERNS\300C
XF_NOREMAP_BANG        \0808  000317A0-R\1C08EXTERNS\2B0C
XF_NULLPROC        \0808\1006000317B0-R\2008EXTERNS\2F0C
XF_ONLYWIND        \0808\1006000317C0-R\2008EXTERNS\2F0C
XF_OPENDOWN        \0808\1006000317D0-R\2008EXTERNS\2F12EXEC\450F
XF_OPENDOWN_NO_AINDENT           000317E0-R\1508EXTERNS\240B`20
XF_OPENUP        \0808\1008000317F0-R\2208EXTERNS\3112EXEC\470F
XF_OPENUP_NO_AINDENT             00031800-R\1708EXTERNS\260C
XF_OPERATTRBOLD        \0808  00031810-R\1C08EXTERNS\2B0C
XF_OPERATTRCASEQ        \0808 00031820-R\1B08EXTERNS\2A0C
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   43
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XF_OPERATTRHC        \0808    00031830-R\1E08EXTERNS\2D0C
XF_OPERATTRITAL        \0808  00031840-R\1C08EXTERNS\2B0C
XF_OPERATTRNO        \0808    00031850-R\1E08EXTERNS\2D0C
XF_OPERATTRREV        \0808   00031860-R\1D08EXTERNS\2C0C
XF_OPERATTRUL        \0808    00031870-R\1E08EXTERNS\2D0C
XF_OPERBLANK        \0808     00031880-R\1F08EXTERNS\2E0C
XF_OPERCHG        \0808\100700031890-R\2108EXTERNS\300C
XF_OPERCOPY        \0808\1006000318A0-R\2008EXTERNS\2F0C
XF_OPERCRYPT        \0808     000318B0-R\1F08EXTERNS\2E0C
XF_OPERDEL        \0808\1007000318C0-R\2108EXTERNS\300C
XF_OPERDETAB        \0808     000318D0-R\1F08EXTERNS\2E0C
XF_OPERENTAB        \0808     000318E0-R\1F08EXTERNS\2E0C
XF_OPERFILTER        \0808    000318F0-\1E09EXTERNS\2D12EXEC\430F
XF_OPERFLIP        \0808\100600031900-R\2008EXTERNS\2F0C
XF_OPERFORMAT        \0808    00031910-R\1E08EXTERNS\2D0C
XF_OPERGLOBALS        \0808   00031920-R\1D08EXTERN\2C13EXEC\420F
XF_OPERJOIN        \0808\100600031930-R\2008EXTERNS\2F0C
XF_OPERLINECHG        \0808   00031940-R\1D08EXTERNS\2C0C
XF_OPERLINEDEL        \0808   00031950-R\1D08EXTERNS\2C0C
XF_OPERLINEYANK        \0808  00031960-R\1C08EXTERNS\2B0C
XF_OPERLIST        \0808\100600031970-R\2008EXTERNS\2F0C
XF_OPERLOWER        \0808     00031980-\1F09EXTERNS\2E0C
XF_OPERLSHIFT        \0808    00031990-R\1E08EXTERNS\2D0C
XF_OPERMOVE        \0808\1006000319A0-R\2008EXTERNS\2F0C
XF_OPEROPENRECT        \0808  000319B0-R\1C08EXTERNS\2B0C
XF_OPERPPRINT        \0808    000319C0-R\1E08EXTERNS\2D0C
XF_OPERPRINT        \0808     000319D0-R\1F08EXTERNS\2E0C
XF_OPERRSHIFT        \0808    000319E0-R\1E08EXTERNS\2D0C
XF_OPERSELECT        \0808    000319F0-R\1E08EXTERNS\2D0C
XF_OPERSUBST        \0808     00031A00-R\1F08EXTERNS\2E0C
XF_OPERSUBSTAGAIN        \080800031A10-R\1A08EXTERNS\290C
XF_OPERTRANSF        \0808    00031A20-R\1E08EXTERNS\2D0C
XF_OPERTRIM        \0808\100600031A30-R\2008EXTERNS\2F0C
XF_OPERUPPER        \0808     00031A40-\1F09EXTERNS\2E0C
XF_OPERVGLOBALS        \0808  00031A50-R\1C08EXTERN\2B13EXEC\410F
XF_OPERWRITE        \0808     00031A60-R\1F08EXTERNS\2E12EXEC\440F
XF_OPERYANK        \0808\100600031A70-R\2008EXTERNS\2F0C
XF_OVERWRITECHARS        \080800031A80-R\1A08EXTERN\290D
XF_OVERWSTRING        \0808   00031A90-R\1D08EXTERNS\2C0C
XF_PASTE_FROM_CLIPBOARD          00031AA0-R\1408EXTERNS\230A `20
XF_PIPECMD        \0808\100700031AB0-R\2108EXTERNS\300C
XF_POSWIND        \0808\100700031AC0-R\2108EXTERNS\300C
XF_POUNDC_FUNC        \0808   00031AD0-R\1D08EXTERNS\2C12BIND\420F
XF_PREVWIND        \0808\100600031AE0-R\2008EXTERNS\2F0C
XF_PUTAFTER        \0808\100600031AF0-\2009EXTERNS\2F0C
XF_PUTBEFORE        \0808     00031B00-R\1F08EXTERNS\2E0C
XF_PWD        \0808\100B00031B10-R\2508EXTERNS\340C
XF_QUICKEXIT        \0808     00031B20-R\1F08EXTERNS\2E0C
XF_QUIT        \0808\100A00031B30-R\2408EXTERNS\330C
XF_QUITHARD        \0808\100600031B40-R\2008EXTERNS\2F0C
XF_QUOTE        \0808\100900031B50-R\2308EXTERNS\320C
XF_RECTPUTAFTER        \0808  00031B60-\1C09EXTERNS\2B0C
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   44
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XF_RECTPUTBEFORE        \0808 00031B70-R\1B08EXTERNS\2A0C
XF_REMOVE_MODE        \0808   00031B80-R\1D08EXTERNS\2C0C
XF_REMOVE_SUBMODE        \080800031B90-R\1A08EXTERNS\290C
XF_REPLACECHAR        \0808   00031BA0-\1D09EXTERNS\2C0C
XF_REPOSITION        \0808    00031BB0-R\1E08EXTERNS\2D0C
XF_REP_CSRCH        \0808     00031BC0-R\1F08EXTERNS\2E0C
XF_RESIZE        \0808\100800031BD0-R\2208EXTERNS\310C
XF_RESPAWN        \0808\100700031BE0-R\2108EXTERNS\300C
XF_RESTWND        \0808\100700031BF0-R\2108EXTERNS\300C
XF_REVSEARCH        \0808     00031C00-R\1F08EXTERNS\2E0C
XF_REV_CSRCH        \0808     00031C10-R\1F08EXTERNS\2E0C
XF_RISEARCH        \0808\100600031C20-R\2008EXTERNS\2F0C
XF_SAVEWND        \0808\100700031C30-R\2108EXTERNS\300C
XF_SCRBACKSEARCH        \0808 00031C40-R\1B08EXTERNS\2A0C
XF_SCRFORWSEARCH        \0808 00031C50-R\1B08EXTERNS\2A0C
XF_SCRNEXTDW        \0808     00031C60-R\1F08EXTERNS\2E0C
XF_SCRNEXTUP        \0808     00031C70-R\1F08EXTERNS\2E0C
XF_SCRSEARCHPAT        \0808  00031C80-R\1C08EXTERNS\2B0C
XF_SEL_MOTION        \0808    00031C90-R\1E08EXTERNS\2D0C
XF_SETFILLCOL        \0808    00031CA0-R\1E08EXTERNS\2D0C
XF_SETGLOBMODE        \0808   00031CB0-R\1D08EXTERNS\2C0C
XF_SETLOCMODE        \0808    00031CC0-R\1E08EXTERNS\2D0C
XF_SETNMMARK        \0808     00031CD0-R\1F08EXTERNS\2E0C
XF_SETTAB        \0808\100800031CE0-R\2208EXTERNS\310C
XF_SETVAR        \0808\100800031CF0-\2209EXTERNS\310C
XF_SET_DOSMODE        \0808   00031D00-R\1D08EXTERNS\2C0C
XF_SET_TERMCHRS        \0808  00031D10-R\1C08EXTERN\2B0D
XF_SET_UNIXMODE        \0808  00031D20-R\1C08EXTERNS\2B0C
XF_SHOWCPOS        \0808\100600031D30-R\2008EXTERN\2F0D
XF_SHOWHISTORY        \0808   00031D40-R\1D08EXTERNS\2C0C
XF_SHOWHYPERCMD        \0808  00031D50-R\1C08EXTERNS\2B0C
XF_SHOWKREG        \0808\100600031D60-R\2008EXTERNS\2F0C
XF_SHOWLENGTH        \0808    00031D70-R\1E08EXTERNS\2D12EXEC\430F
XF_SHOWTAGSTACK        \0808  00031D80-R\1C08EXTERNS\2B0C
XF_SHOWVERSION        \0808   00031D90-R\1D08EXTERNS\2C0C
XF_SHOW_TERMCHRS        \0808 00031DA0-R\1B08EXTERN\2A0D
XF_SHRINKWIND        \0808    00031DB0-R\1E08EXTERNS\2D0C
XF_SOURCE        \0808\100800031DC0-R\2208EXTERNS\310C
XF_SPAWN        \0808\100900031DD0-R\2308EXTERNS\3212EXEC\480F
XF_SPAWNCLI        \0808\100600031DE0-R\2008EXTERNS\2F0C
XF_SPLITWIND        \0808     00031DF0-R\1F08EXTERNS\2E0C
XF_STOREMAC        \0808\100600031E00-R\2008EXTERNS\2F0C
XF_STOREPROC        \0808     00031E10-R\1F08EXTERNS\2E0C
XF_SUBST_AGAIN        \0808   00031E20-R\1D08EXTERNS\2C0C
XF_SYSMAP        \0808\100800031E30-R\2208EXTERNS\310C
XF_TOGGLELISTBUFFERS             00031E40-R\1708EXTERN\260D
XF_TWIDDLE        \0808\100700031E50-R\2108EXTERNS\300C
XF_UE_SETKEY        \0808     00031E60-R\1F08EXTERNS\2E0C
XF_UNABBR        \0808\100800031E70-\2209EXTERNS\310C
XF_UNARG_FUNC        \0808    00031E80-R\1E08EXTERNS\2D12BIND\430F
XF_UNBINDKEY        \0808     00031E90-R\1F08EXTERNS\2E0C
XF_UNDO        \0808\100A00031EA0-R\2408EXTERNS\3312MAIN\490F
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   45
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XF_UNIMPL        \0808\100800031EB0-R\2208EXTERNS\310C
XF_UNMAP        \0808\100900031EC0-R\2308EXTERNS\320C
XF_UNMAP_BANG        \0808    00031ED0-R\1E08EXTERNS\2D0C
XF_UNMAP_SYSTEM        \0808  00031EE0-R\1C08EXTERNS\2B0C
XF_UNMARK        \0808\100800031EF0-R\2208EXTERNS\310C
XF_UNTAGPOP        \0808\100600031F00-R\2008EXTERNS\2F0C
XF_UPSCREEN        \0808\100600031F10-R\2008EXTERNS\2F0C
XF_USEBUFFER        \0808     00031F20-\1F09EXTERNS\2E0C
XF_USEKREG        \0808\100700031F30-R\2108EXTERNS\300C
XF_USERBEEP        \0808\100600031F40-R\2008EXTERNS\2F0C
XF_VGLOBALS        \0808\100600031F50-R\2008EXTERN\2F13EXEC\450F
XF_VIEWFILE        \0808\100600031F60-R\2008EXTERNS\2F0C
XF_VILE_FILTER        \0808   00031F70-\1D09EXTERNS\2C0C
XF_VILE_REFRESH        \0808  00031F80-R\1C08EXTERNS\2B0C
XF_VISUAL        \0808\100800031F90-R\2208EXTERNS\310C
XF_WORDCOUNT        \0808     00031FA0-R\1F08EXTERNS\2E0C
XF_WRAPWORD        \0808\100600031FB0-R\2008EXTERNS\2F0C
XF_WRITEALLCHANGED        \080700031FC0-R\1908EXTERNS\280C
XF_WRITEMSG        \0808\100600031FD0-R\2008EXTERNS\2F0C
XF_WRITEQUIT        \0808     00031FE0-R\1F08EXTERNS\2E0C
XF_YANKLINE        \0808\100600031FF0-R\2008EXTERNS\2F0C
XF_ZZQUIT        \0808\100800032000-R\2208EXTERNS\310C
XGETCCOL        \0808\1009000204E0-R\2308RANDOM\3113BASIC\4914BUFFE\4009    `20
X        \0808\1010\2020\400BDISPLAY\5212EVAL\680F
X        \0808\1010\2020\400BINSERT\5113REGION\6A0D
X        \0808\1010\2020\400BWINDOW\510D
XGETCLINE        \0808\100800020530-R\2208RANDOM\3013EVAL\470F
XGETCOL        \0808\100A000204A0-R\2408RANDOM\3213LINE\4915REGION\640D
X        \0808\1010\2020\400BSELECT\510D
XGETCTEXT        \0808\10080001CB40-R\2208LINE\2E15EVAL\470F
XGETFILE        \0808\100900018AA0-R\2308\2F19BUFFE\2709\520BFINDER\1A0D
X        \0808\1010\2020\400BMENU\4F15TAGS\680F
XGETFILE2BP        \0808\100600018A40-R\2008FILE\2C15MAIN\450F
XGETGOAL        \0808\100900012508-R\2308BASIC\3014BUFFE\2709\520BWINDOW\630D
XGETOFF        \0808\100A00020430-R\2408RANDOM\3213LINE\4915REGION\640D
XGETREGION        \0808\100700020B48-R\2108\2F19FILE\4615SELECT\610D
X        \0808\1010\2020\400BWORD\4F0F
XGETVERSION        \0808\100600023728-R\2008\2F19MAI\4510
XGETWPOS        \0808\100900023FE0-R\2308WINDOW\3113EVAL\480F
XGET_FL_REGION        \0808   00020E40-R\1D08\2B19ONELINE\2909  `20
XGET_MODTIME        \0808     00018110-R\1F08FIL\2B16RANDOM\4613TAGS\5D0F
XGET_RECORDED_CHAR        \08070001B170-\1909INPUT\260F     DISPLAY\410C
XGET_SHELL        \0808\100700016210-R\2108EVA\2D10
XGIVE_ACCELERATOR        \080800012C80-\1A09BIND\2610     MENU\3F0F
XGLOBALS        \0808\10090001A088-R\2308\3219EXTERN\4B0D
XGLOBAL_B_VALUES        \0808 000C2230-R     WK-MAIN\2711    BUFFE\2706\470EDIS
VPLAY\5C0C
X        \0808\1010\2020\400BFILE\4F15GLOB\680F
X        \0808\1010\2020\400BISEARCH\520FWK-MAIN\680F
X        \0808\1010\2020\400BMODES\5014ONELINER\6C0B
X        \0808\1010\2020\400BSEARCH\5113TAGS\680F
XGLOBAL_G_VALUES        \0808 000C23C0-R     WK-MAIN\2711    BIND\1916UFFE\4006
V\6008
X        \0808\1010\2020\400BDISPLAY\5212EXEC\680F
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   46
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
X        \0808\1010\2020\400BFILE\1919C\690E
X        \0808\1010\2020\400BGLOB\1919ALS\6B0C
X        \0808\1010\2020\400BHISTORY\5212INPUT\690E
X        \0808\1010\2020\400BLINE\4F12WK-MAIN\680F
X        \0808\1010\2020\400BMAP\1917ODES\690E
X        \0808\1010\2020\400BMSGS\4F15SPAWN\690E
X        \0808\1010\2020\400BWORD\4F15X11\6710
XGLOBAL_W_VALUES        \0808 000C2530-R     WK-MAIN\2711    BUFFE\2706\470EDIS
VPLAY\5C0C
X        \0808\1010\2020\4008WK-MAIN\4F15MODES\690E
X        \0808\1010\2020\400BWINDOW\510D
XGLOB_FREE        \0808\100700019C78-R\2108GLOB\2D15FILEC\470E
XGLOB_LENGTH        \0808     00019CB0-R\1F08GLOB\2B15FILEC\450E
XGLOB_NEEDED        \0808     00019E68-R\1F08GLOB\2B0F
XGLOB_STRING        \0808     00019E00-R\1F08GLOB\2B15FILEC\450E
XGOCOL        \0808\100B00020460-R\2508RANDOM\3313DISPLAY\4D12INSERT\650D
X        \0808\1010\2020\400BREGION\510D
XGODOTPLUS        \0808\100700012588-R\2108BASIC\2E14EXTERN\490D
XGOEXACTNMMARK        \0808   000126C0-R\1D08BASIC\2A13 EXTERNS\450C
XGOLABEL        \0808\1009000C2580-R     WK-MAIN\2F15EXEC\4812\3216
XGOLINENMMARK        \0808    000126E0-R\1E08BASIC\2B14EXTERNS\460C
XGOMARK        \0808\100A000125A8-R\2408BASIC\3114EXTERNS\4C12FENCE\180E
X        \0808\1010\2020\400BINSERT\5113ONELINER\6C0B
X        \0808\1010\2020\400BRANDOM\510D
XGONMMARK        \0808\1008000125C8-R\2208BASIC\2F14EXE\1810
XGORECTNMMARK        \0808    00012698-R\1E08BASIC\2B14EXTERNS\460C
XGOTOBOB        \0808\1009000128E0-R\2308BASIC\3014BIND\4815EXTERNS\640C
X        \0808\1010\2020\400BRANDOM\510D
XGOTOBOL        \0808\100900012B18-R\2308BASIC\3014EXTERNS\4B12INSERT\630D
X        \0808\1010\2020\400BX11\4E10
XGOTOBOP        \0808\1009000129A0-R\2308BASIC\3014EXTERNS\4B0C
XGOTOBOS        \0808\100900012A58-R\2308BASIC\3014EXTERN\4B0D
XGOTOBOSEC        \0808\100700012930-R\2108BASI\2E15EXTERNS\490C
XGOTOBOSENT        \0808\1006000128F0-R\2008BASIC\2D14EXTERNS\480C
XGOTOCOL        \0808\100900020480-R\2308RANDOM\3113EVA\4816EXTERNS\640C
XGOTOEOB        \0808\100900012A78-R\2308BASIC\3014EXE\1815 EXTERNS\640C
X        \0808\1010\2020\400BMAIN\4F15RANDOM\6A0D
XGOTOEOL        \0808\100900012AF8-R\2308BASIC\3014EXTERNS\4B12INSERT\630D
X        \0808\1010\2020\400BWORD\4F15X11\6710
XGOTOEOP        \0808\100900012960-R\2308BASIC\3014EXTERNS\4B0C
XGOTOEOS        \0808\1009000123B0-R\2308BASIC\3014BIND\4815EXTERN\640D
XGOTOEOSEC        \0808\100700012910-R\2108BASI\2E15EXTERNS\490C
XGOTOEOSENT        \0808\100600012898-R\2008BASIC\2D14EXTERNS\480C
XGOTOLINE        \0808\100800012A90-R\2208BASIC\2F14BIND\4715DISPLAY\630C
X        \0808\1010\2020\400BEVAL\1916XEC\680F
X        \0808\1010\2020\400BEXTERNS\5212FINDERR\6B0C
X        \0808\1010\2020\400BMAIN\4F15TAGS\680F
XGOTOMOS        \0808\100900012A38-R\2308BASIC\3014EXTERN\4B0D
XGOTOTAG        \0808\100900022B30-R\2308TAGS\2F15EXTERN\1C0D
XGREGEXP        \0808\1009000C2600-R     WK-MAIN\2F15EVAL\4815GLOBALS\640C
X        \0808\1010\2020\400BISEARCH\520FWK-MAIN\680F
X        \0808\1010\2020\400BONELINER\5311SEARCH\6A0D
XGTENV        \0808\100B00016418-R\2508EVAL\3115SPAWN\4B0E
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   47
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XG_VALNAMES        \0808\100600032010-R\2008MAIN\2C15MOD\4610
XHAVEMOTION        \0808\1006000C2610-R     WK-MAI\2C16EXEC\4515GLOBALS\610C
X        \0808\1010\2020\4008WK-MAIN\4F15OPERS\690E
X        \0808\1010\2020\400BRANDOM\5113WORD\680F
XHAVEREGION        \0808\1006000C2620-R     WK-R\2E18OPERS\4611\3216
X        \0808\1010\2020\400BSELECT\510D
XHELP        \0808\100C00013B00-R\2608BIND\3215EXTERNS\4E12MAIN\640F
XHELPFILE        \0808\1008000C2630-R     WK-MAIN\2E15BIND\4715EVAL\600F
X        \0808\1010\2020\4008WK-MAIN\4F0F
XHELP_AT        \0808\1009000413D0-R\2308MAIN\2F15BIND\1916UFFE\4009    `20
XHELP_BUFNAME        \0808    00032220-R\1E08MAIN\2A14 BIND\1916UFFE\4009    `20
V
XHEXDIGITS        \0808\100700032230-R\2108MAIN\2D15DISPLAY\490C
XHILITE        \0808\100A00015CC8-R\2408DISPLAY\3312ONELINE\2909  `20
+-+-+-+-+-+-+-+-  END  OF PART 139 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 140 -+-+-+-+-+-+-+-+
XHISTBUFF        \0808\100800014AA0-R\2208BUFFE\0E09\380BEXTERNS\4A12MENU\600F
V
XHISTORY_BUFNAME        \0808 00032260-R\1B08MAIN\2711    \4B07\430C
XHIST_LOOKUP        \0808     00014A38-R\1F08BUFFE\0E09    `20
XHST_APPEND        \0808\10060001A550-R\2008HISTORY\2F12INPUT\460E
XHST_APPEND_S        \0808    0001A5A0-R\1E08HISTORY\2D12BIND\430F
XHST_FLUSH        \0808\10070001A4A0-R\2108HISTORY\3012EXEC\4615SEARC\610E
X        \0808\1010\2020\400BSPAWN\500E
XHST_GLUE        \0808\10080001A5D0-R\2208HISTORY\3112EXEC\4715FIL\6010
X        \0808\1010\2020\400BMAP\1917ODES\690E
X        \0808\1010\2020\400BSEARCH\510D
XHST_INIT        \0808\10080001A5F0-R\2208HISTORY\3112EXEC\4715SEARCH\620D
X        \0808\1010\2020\400BSPAWN\500E
XHST_REMOVE        \0808\10060001A508-R\2008HISTORY\2F12EXEC\450F
XIBUF        \0808\100C000C2640-R     WK-TERMIO\3410\1916
XIBUFI        \0808\100B000C2A40-R     WK-TERMIO\3310\1916
XIFILE        \0808\100B000185F0-R\2508\3113
XIGNORECASE        \0808\1006000C2A50-R     WK-MAIN\2C15ISEARCH\480F\3216
X        \0808\1010\2020\400BMODES\5014ONELINER\6C0B
X        \0808\1010\2020\400BREGEXP\5113SEARCH\6A0D
X        \0808\1010\2020\400BTAGS\4F0F
XIMDYING        \0808\1009000184A8-R\2308FILE\2F0F
XIMPLY_ALT        \0808\100700014B80-R\2108BUFFE\0E09\370BFILE\460F
XIM_WAITING        \0808\100600015220-R\2008DISPLAY\2F12INPUT\4614MAIN\5E0F
X        \0808\1010\2020\400BMENU\4F15X11\6710
XINCR_DOT_KREGNUM        \08080001B300-R\1A08INPUT\2710    LINE\3F0F
XINDENTLEN        \0808\10070001B790-R\2108INSERT\2F13FENCES\4813WORD\5F0F
XINDEX2REG        \0808\10070001C3F8-R\2108LINE\2D15INPUT\470E
XINDEX2UKB        \0808\10070001C430-R\2108LINE\2D0F
XINF_UNDO        \0808\100800023568-R\2208\2E19EXTERNS\4A0C
XINIT_FILEC        \0808\100600019210-R\2008\2D19BIND\4515INPUT\5F0E
XINS        \0808\100D0001BC10-R\2708INSERT\3513OPER\4D15RANDOM\670D
XINSCHAR        \0808\10090001B9E8-\2309INSERT\3113MAP\4710
XINSERT        \0808\100A0001BD70-R\2408\3219EXTERNS\4C0C
XINSERTBOL        \0808\10070001BD20-R\2108\3206\2F13EXTERNS\490C
XINSERT_NAMEBST        \0808  00012D80-R\1C08BIND\2812   EXEC\410F
XINSERT_NO_AINDENT        \08070001BD50-R\1908\3206\270F    EXTERNS\410C
XINSFILE        \0808\100900018B40-R\2308\2F19EXTERNS\4B0C
XINSSPACE        \0808\10080001CBB8-R\2208LIN\2E16EXTERNS\4A12REGION\620D
XINSSTRING        \0808\10070001BAA0-R\2108INSERT\2F13EXTERNS\490C
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   48
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XINS_MODE        \0808\10080001BCC0-R\2208INSERT\3013DISPLAY\4A0C
XINTRC        \0808\100B000413E0-R\2508MAIN\3115BASI\4B15BIND\630F
X        \0808\1010\2020\400BCSRCH\5014HISTORY\6B0C
X        \0808\1010\2020\400BINPUT\1916SER\1A0E
X        \0808\1010\2020\400BISEARCH\5212SELECT\6A0D
X        \0808\1010\2020\400BSPAWN\5014WINDOW\6A0D
X        \0808\1010\2020\400BX11\4E10
XIOCHAN        \0808\100A000C2A60-R     WK-TERMIO\3213SPAW\4A12\3216
XISENDVIWORDF        \0808    00024A40-R\1E08WORDMOV\2D12WORD\430F
XISENDWORDF        \0808\100600024A80-R\2008WORDMOV\2F12WORD\450F
XISNAMEDCMD        \0808\1006000C2A70-R     WK-MAIN\2C15BASIC\1915UFFE\4006
V\6508
X        \0808\1010\2020\400BCSRCH\5014EXEC\680F
X        \0808\1010\2020\400BFILEC\5014INPUT\690E
X        \0808\1010\2020\400BINSERT\5113LINE\680F
X        \0808\1010\2020\4008WK-MAIN\4F15TAGS\680F
X        \0808\1010\2020\400BWINDOW\510D
XISNEWVIWORDB        \0808    00024AA0-R\1E08WORDMOV\2D12WORD\430F
XISNEWVIWORDF        \0808    00024AC0-R\1E08WORDMOV\2D12WORD\430F
XISNEWWORDB        \0808\100600024AE8-R\2008WORDMOV\2F12WORD\450F
XISNEWWORDF        \0808\100600024B08-R\2008WORDMOV\2F12WORD\450F
XIS_APPENDNAME        \0808   0001FB40-R\1D08PATH\2913  FIL\4214\1906C\5C0E
X        \0808\1010\2020\400BFILEIO\510D
XIS_DIRECTORY        \0808    0001FA60-R\1E08PATH\2A14 FILEC\1918IO\5E0D
XIS_EDIT_CHAR        \0808    0001AE10-\1E09INPUT\2B14EXEC\4314 HISTORY\5F0C
XIS_FALSEM        \0808\100700016000-R\2108EVAL\2D15MODES\470E
XIS_INTERNALNAME        \0808 0001FB08-R\1B08PATH\2711    BUFFER\1B13DISPLAY
V\5C0C
X        \0808\1010\2020\400BFILE\1919C\690E
X        \0808\1010\2020\400BFILEIO\5113GLOB\680F
X        \0808\1010\2020\400BINPUT\5014RANDOM\6A0D
X        \0808\1010\2020\400BTAGS\4F0F
XIS_PATHNAME        \0808     0001FBD8-R\1F08PATH\2B15FILEC\450E
XIS_SCRATCHNAME        \0808  0001FAD0-R\1C08PATH\2812   BIND\1916UFFE\4009 `20
V  `20
X        \0808\1010\2020\400BFILE\4F0F
XIS_TRUEM        \0808\100800015F88-R\2208EVAL\2E15MODES\480E
XIS_USER_FENCE        \0808   00017C08-R\1D08FENCES\2B13INSERT\440D
XIS_VARMODE        \0808\10060001DE38-R\2008MODES\2D14EVAL\450F
XIS_VMS_DIRTYPE        \0808  000239E0-R\1C08VMS2UNIX\2C11FILEC\420E
XIS_VMS_PATHNAME        \0808 0001F9B0-R\1B08PATH\2711    FIL\4012\1908C\5A0E
X        \0808\1010\2020\400BRANDOM\510D
XIS_VMS_ROOTDIR        \0808  00023A18-\1C09VMS2UNIX\2C0B
XITB_ALLOC        \0808\10070001BEA0-R\2108ITBUFF\2F0D
XITB_APPEND        \0808\10060001BFC0-R\2008ITBUFF\2E13INPUT\4614INSER\1A0E
X        \0808\1010\2020\400BMAP\4E10
XITB_BAPPEND        \0808     0001BFE0-R\1F08ITBUFF\2D0D
XITB_COPY        \0808\10080001C020-R\2208ITBUFF\3013INPUT\480E
XITB_FIRST        \0808\10070001BF88-R\2108ITBUFF\2F13INPU\4715INSER\610E
XITB_FREE        \0808\10080001C050-R\2208ITBUFF\3013INPUT\4814MAP\5F10
XITB_GET        \0808\10090001BF10-R\2308ITBUFF\3113INPU\490F
XITB_INIT        \0808\10080001C000-R\2208ITBUFF\3013INPU\4815INSER\620E
X        \0808\1010\2020\400BMAP\4E10
XITB_LAST        \0808\10080001BF38-R\2208ITBUFF\3013INPU\4815MAP\5F10
XITB_LENGTH        \0808\10060001BEF0-R\2008ITBUFF\2E13INPUT\460E
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   49
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XITB_MORE        \0808\10080001BF68-R\2208ITBUFF\3013INPUT\4814INSER\1A0E
X        \0808\1010\2020\400BMAP\4E10
XITB_NEXT        \0808\10080001BF50-R\2208ITBUFF\3013INPU\4815INSER\620E
X        \0808\1010\2020\400BMAP\4E10
XITB_PEEK        \0808\10080001BF20-R\2208ITBUFF\3013INPUT\480E
XITB_STUFF        \0808\10070001C040-R\2108ITB\2F16INPUT\470E
XITB_VALUES        \0808\10060001BF00-R\2008ITBUFF\2E13MAP\4410
XJOINLINES        \0808\100700024850-R\2108WORD\2D15EXTERN\490D
XJOINREGION        \0808\100600024890-R\2008WORD\2C15OPERS\460E
XKBDMODE        \0808\1009000413F0-R\2308MAIN\2F15INPUT\490E
XKBD_ALARM        \0808\100700012E40-R\2108BIND\2D15DISPLAY\4912EXEC\5F0F
X        \0808\1010\2020\400BFENCES\5113HISTORY\6B0C
X        \0808\1010\2020\400BINPUT\1916SER\1A0E
X        \0808\1010\2020\400BISEARCH\5212MAIN\680F
X        \0808\1010\2020\400BOPERS\5014UNDO\680F
X        \0808\1010\2020\400BWINDOW\5113X11\6710
XKBD_COMPLETE        \0808    000130F0-R\1E08BIND\2A14 EVAL\1915FILEC\5D0E
X        \0808\1010\2020\400BMODES\5014TAG\1810
XKBD_DELIMITER        \0808   0001B078-\1D09INPUT\2A13 GLOBALS\4512ONELINE\5F0C
V
XKBD_ENGL        \0808\100800013370-R\2208BIND\2E15GLOBALS\4A0C
XKBD_ENGL_STAT        \0808   000131E0-R\1D08BIND\2913  EXEC\420F
XKBD_ERASE        \0808\100700013278-R\2108BIND\2D15INPUT\470E
XKBD_ERASE_TO_END        \080800012F10-R\1A08BI\2612     DISPLAY\1C12SPAWN\590E
V
XKBD_EXPAND        \0808\1006000C2A80-R     WK-MAIN\2C15BIN\4516DISPLAY\610C
X        \0808\1010\2020\400BINPUT\5011WK-MAIN\680F
XKBD_FLUSH        \0808\1007000153F0-R\2108DISPLAY\3012BIND\4615INPUT\600E
X        \0808\1010\2020\400BISEARCH\5212SPAWN\690E
XKBD_INIT        \0808\1008000130E0-R\2208BIND\2E15INPU\4815TAGS\600F
XKBD_IS_PUSHED_BACK        \08060001B058-R\1808INPUT\250E\3306FILEC\3E0E
XKBD_KILL_RESPONSE        \08070001AC70-R\1908INPUT\260F     HISTORY\410C
XKBD_LENGTH        \0808\100600012E88-R\2008BIND\2C15MAIN\450F
XKBD_MAC_BEGIN        \0808   0001A880-R\1D08INPUT\2A13 EXTERNS\450C
XKBD_MAC_END        \0808     0001A850-R\1F08INPUT\2C14EXTERNS\470C
XKBD_MAC_EXEC        \0808    0001A820-R\1E08INPUT\2B14EXTERNS\460C
XKBD_MAC_SAVE        \0808    0001A790-R\1E08INPUT\2B14EXTERNS\460C
XKBD_OPENUP        \0808\1006000155C0-R\2008DISPLAY\2F12TERMIO\470D
XKBD_OVERLAY        \0808     00015CF0-R\1F08DISP\2E0F
XKBD_PUSHBACK        \0808    0001AD40-R\1E08INPUT\2B14HISTORY\460C
XKBD_PUTC        \0808\100800012F68-R\2208BIND\2E15DISPLAY\4A12FILE\610F
X        \0808\1010\2020\400BINPUT\1915SEARCH\6B0C
X        \0808\1010\2020\400BMSGS\4F0F
XKBD_PUTS        \0808\100800013030-R\2208BIND\2E0F
XKBD_REPLAYING        \0808   0001A8B0-R\1D08INPUT\2A13 DISPLAY\4512EXEC\5B0F
XKBD_REPLY        \0808\10070001AF50-R\2108INPUT\2E14BIND\4615EVAL\5F0F
X        \0808\1010\2020\400BEXEC\4F15MAP\6710
X        \0808\1010\2020\400BMODES\500E
XKBD_SEQ        \0808\10090001B0B8-R\2308INPUT\3014BIND\4815EXEC\610F
X        \0808\1010\2020\400BLINE\4F15MAIN\680F
X        \0808\1010\2020\400BOPERS\5014SELECT\6A0D
XKBD_SEQ_NOMAP        \0808   0001B0F8-R\1D08INPUT\2A13 BIND\1814 EVAL\5B0F
XKBD_SHOW_RESPONSE        \08070001AE68-R\1908INPUT\260F     HISTORY\410C
XKBD_STRING        \0808\10060001B028-R\2008INPUT\2D14EVAL\4515FILEC\5F0E
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   50
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
X        \0808\1010\2020\400BMODES\5014SEARCH\6A0D
X        \0808\1010\2020\400BTAGS\4F0F
XKBD_UNQUERY        \0808     00013298-R\1F08BIND\2B15INPUT\450E
XKBINDTBL        \0808\100800041400-R\2208EXTERNS\3112BIND\470F
XKBM_STARTED        \0808     0001A720-R\1F08INPUT\2C14LINE\440F
XKBS        \0808\100D000C2A90-R     WK-MAIN\3315EVAL\4C15FILE\650F
X        \0808\1010\2020\400BLINE\4F12WK-MAIN\680F
X        \0808\1010\2020\400BMAP\4E16X11\6710
XKCHARS        \0808\100A000C2DA0-R     WK-MAIN\3015LINE\4912\3216
X        \0808\1010\2020\400BREGION\510D
XKCOD2ESCAPE_SEQ        \0808 00012BB8-R\1B08BIND\2711    EVAL\1915MAP\5810
XKCOD2FNC        \0808\1008000133D0-R\2208BIND\2E15HISTORY\4A12INPUT\610E
X        \0808\1010\2020\400BINSERT\5113LINE\680F
X        \0808\1010\2020\400BMAIN\4F15OPERS\690E
X        \0808\1010\2020\400BSELECT\1914PAWN\690E
XKCOD2PSTR        \0808\100700012BE0-\2109BIND\2D15SELECT\480D
XKDONE        \0808\100B0001C538-R\2508LI\3117FIL\4A16INPUT\640E
X        \0808\1010\2020\400BREGION\510D
XKEYSTROKE        \0808\10070001ADD0-R\2108INPUT\2E14BASIC\1915IND\5F0F
X        \0808\1010\2020\400BCSRCH\5014EXEC\680F
X        \0808\1010\2020\400BHISTORY\5212INSERT\6A0D
X        \0808\1010\2020\400BSPAWN\5014WINDOW\6A0D
XKEYSTROKE8        \0808\10060001B2E0-R\2008INPUT\2D14BUFFE\2709\4F0BISEARCH
V\610C
XKEYSTROKE_AVAIL        \0808 0001B2B0-R\1B08INPUT\2811   DISPLAY\1B12EVA\5910
V
XKEYSTROKE_RAW8        \0808  0001AE48-R\1C08INPUT\2912  CSRCH\1914EVAL\5A0F
X        \0808\1010\2020\400BINSERT\510D
XKILLBUFFER        \0808\100600014950-\2009\2E19EXTERNS\480C
XKILLC        \0808\100B000419F0-R\2508MAIN\3115BIND\4A15EXE\6310
X        \0808\1010\2020\400BHISTORY\5212INPUT\690E
X        \0808\1010\2020\400BINSERT\510D
XKILLREGION        \0808\100600020D30-R\2008\2E19OPERS\460E
XKILLREGIONMAYBESAVE             00020BF0-R\1708\2E06\250D\3206WORD\170F
XKINSERT        \0808\10090001C578-R\2308LINE\2F15FIL\1916INPU\620F
X        \0808\1010\2020\400BREGION\510D
XKINSERTLATER        \0808    0001CAE0-\1E09LINE\2A14 REGION\450D
XKLINES        \0808\100A000C2DB0-R     WK-MAIN\3015LINE\4912\3216
X        \0808\1010\2020\400BREGION\510D
XKREGCIRCULATE        \0808   0001C408-R\1D08LIN\2914  REGION\440D
XKREGFLAG        \0808\1008000C2DC0-R     WK-MAIN\2E15EXEC\4715LINE\600F
X        \0808\1010\2020\4008WK-MAIN\4F15REGIO\1B0E
X        \0808\1010\2020\400BSELECT\510D
XKREGWIDTH        \0808\1007000C2DD0-R     WK-MAIN\2D15LINE\4612\3216
XKSETUP        \0808\100A0001C5C0-R\2408LINE\3015FIL\1916INPUT\630E
X        \0808\1010\2020\400BREGION\510D
XKWRITE        \0808\100A000186E8-R\2408FIL\3016OPERS\4A0E
XLALLOC        \0808\100A0001C660-R\2408LINE\3015BUFFE\2709\530BFILE\630F
X        \0808\1010\2020\400BUNDO\4F0F
XLASTCHAR        \0808\100800012980-\2209BASIC\2F14INSERT\4913REGION\620D
XLASTCMD        \0808\1009000C2DE0-R     WK-MAIN\2F15INPUT\4911\3216
XLASTFILEEDITED        \0808  000C2DF0-R     WK-FILE\2812\1916
XLASTKEY        \0808\1009000C2E00-R     WK-MAIN\2F15BASIC\1915UFFE\4006\6808
X        \0808\1010\2020\400BEVAL\1916XEC\680F
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   51
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
X        \0808\1010\2020\400BINPUT\5011WK-MAIN\680F
X        \0808\1010\2020\400BONELINER\1912PERS\690E
X        \0808\1010\2020\400BSEARCH\510D
XLASTNONWHITE        \0808    00012A18-R\1E08BASIC\2B14EXTERNS\460C
XLAST_SLASH        \0808\10060001FB80-R\2008PAT\2C16MAIN\450F
XLAST_SRCH_DIREC        \0808 000C2E10-R     WK-MAIN\2711    EVAL\1915ISEARCH
V\5C0C
X        \0808\1010\2020\4008WK-MAIN\4F15SEARCH\6A0D
XLDELETE        \0808\10090001CB70-R\2308LIN\2F16BIND\4815EVAL\610F
X        \0808\1010\2020\400BINSERT\5113MAP\6710
X        \0808\1010\2020\400BONELINER\5311RANDOM\6A0D
X        \0808\1010\2020\400BREGION\5113SELECT\6A0D
X        \0808\1010\2020\400BWORD\4F0F
XLENGTHEN_PATH        \0808   0001FD78-R\1D08\2917  BUFFE\2709\4C0BFILE\5B0F
X        \0808\1010\2020\400BFILEC\5014MAIN\680F
X        \0808\1010\2020\400BRANDOM\510D
XLFREE        \0808\100B0001CBF0-R\2508LIN\3116BUFFE\2709\540BFILEC\640E
X        \0808\1010\2020\400BUNDO\4F0F
XLIB$FREE_EF        \0808     00000180-RX\2007LIBRTL\2D13VMSPIPE\470C
XLIB$GET_CURRENT_INVO_CONTEXT    00001440-RX       LIBRTL\0D07\1407     INPUT
V    \1C10MAIN\300F
XLIB$GET_EF        \0808\100600000190-RX\2107LIBRTL\2E13VMSPIPE\480C
XLIB$SPAWN        \0808\100700000460-RX\2207LIBRTL\2F13\4719VMSPIPE\620C
XLIB$SYS_TRNLOG        \0808  00000CA0-RX\1D07LIBRTL\2A12 TERMIO\430D
XLIB$WAIT        \0808\1008000004E0-RX\2307LIBRTL\3013RANDOM\490D
XLINEPUTAFTER        \0808    0001C990-\1E09LINE\2A14 EXTERNS\460C
XLINEPUTBEFORE        \0808   0001C9B0-R\1D08LINE\2913  EXTERNS\450C
XLINES_DELETED        \0808   000C2E20-R     WK-MAIN\2913  LINE\4212\3216
X        \0808\1010\2020\400BOPERS\500E
XLINEUNDO        \0808\1008000233B0-R\2208\2E19EXTERNS\4A0C
XLINE_COUNT        \0808\100600020550-R\2008RANDOM\2E13DISPLAY\4812FILEC\5F0E
X        \0808\1010\2020\400BGLOBALS\5212LINE\680F
X        \0808\1010\2020\400BUNDO\4F15WINDOW\6A0D
X        \0808\1010\2020\400BX11\4E10
XLINE_HEIGHT        \0808     00015480-R\1F08DISPLAY\2E12BASIC\4514ONELINE\4209
V  `20
X        \0808\1010\2020\400BWINDOW\510D
XLINE_NO        \0808\100900020500-R\2308RANDOM\3113BUFFE\2709\520BDISPLAY\640C
V
X        \0808\1010\2020\400BEXEC\4F15FILE\680F
X        \0808\1010\2020\400BONELINER\5311REGION\6A0D
X        \0808\1010\2020\400BSELECT\5113TAGS\680F
X        \0808\1010\2020\400BX11\4E10
XLINE_REPORT        \0808     00020570-R\1F08RANDOM\2D13GLOBALS\4712LINE\5D0F
X        \0808\1010\2020\400BUNDO\4F0F
XLINSERT        \0808\10090001C7D0-R\2308LINE\2F15BIND\4815DISPLAY\640C
X        \0808\1010\2020\400BEVAL\4F15INPUT\690E
X        \0808\1010\2020\400BINSERT\5113ONELINER\6C0B
X        \0808\1010\2020\400BREGION\5113WORD\680F
XLISTBUFFERS        \0808     000146D8-R\1F08\2E06\2D13EXTERN\470D
XLISTMODES        \0808\10070001E838-R\2108\2E19EXTERN\490D
XLISTSTUFF        \0808\100700020690-R\2108RANDOM\2F13BIND\4615BUFFE\4009    `20
V
X        \0808\1010\2020\400BEVAL\4F15LINE\680F
X        \0808\1010\2020\400BMAIN\1917P\6710
X        \0808\1010\2020\400BMODES\5014TAG\1810
XLISTVARS        \0808\100800016B18-R\2208EVAL\2E15EXTERN\4A0D
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   52
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XLIST_MAJORMODES        \0808 0001E5E8-R\1B08\2816   EXTERN\430D
XLIST_OF_MODES        \0808   0001E6A8-R\1D08\2A18 EVAL\420F
XLLINEREGION        \0808     0001F170-R\1F08ONELINER\2F11OPERS\450E
XLNEWLINE        \0808\10080001C6A8-R\2208\2E19DISPLAY\4A12EVAL\600F
X        \0808\1010\2020\400BINSERT\5113ONELINER\6C0B
X        \0808\1010\2020\400BRANDOM\5113WORD\680F
XLOADKREG        \0808\10080001C5D0-R\2208LINE\2E15EXTERNS\4A0C
XLOWERREGION        \0808     00020F88-R\1F08\2D19OPERS\450E
XLREGEXEC        \0808\1008000208D0-R\2208REGEXP\3013BASI\4815FENCES\620D
X        \0808\1010\2020\400BFINDERR\5212MODES\690E
X        \0808\1010\2020\400BSEARCH\5113TAGS\680F
X        \0808\1010\2020\400BWORD\4F0F
XLREMOVE        \0808\10090001C760-R\2308LIN\2F16BUFFE\2709\520BFILEC\620E
XLSPRINTF        \0808\100800015000-R\2208DISPLAY\3112BIND\4715BUFFE\4009    `20
V
X        \0808\1010\2020\400BEVAL\1916XEC\680F
X        \0808\1010\2020\400BFILE\1919C\690E
X        \0808\1010\2020\400BFINDERR\5212INPUT\690E
X        \0808\1010\2020\400BISEARCH\5212MENU\680F
X        \0808\1010\2020\400BMODES\5014OPER\190F
X        \0808\1010\2020\400BSPAWN\5014TAGS\680F
X        \0808\1010\2020\400BVERSION\1913MS2UNIX\6C0B
XLSTRINSERT        \0808\10060001CB98-R\2008LINE\2C15REGION\470D
XLTEXTFREE        \0808\10070001C740-R\2108LIN\2D16UNDO\460F
XL_ITOA        \0808\100A00016080-R\2408EVAL\3015MODES\4A0E
XMACARG        \0808\100A00016C08-R\2408EXEC\3015BIND\4915EVAL\620F
X        \0808\1010\2020\400BLINE\4F15OPERS\690E
XMACBUG        \0808\100A000C2E30-R     WK-MAIN\3015EVAL\4912\3216
XMACLITERALARG        \0808   00017850-R\1D08EXEC\2913  MAP\4110
XMACROIZE        \0808\100800017870-R\2208EXEC\2E15INPUT\480E
XMACRO_N_BUFNAME        \0808 00032270-R\1B08MAIN\2711    EXEC\400F
XMAIN        \0808\100C000106E0-R\2608\3213
XMAJORMODES_BUFNAME        \080600032280-R\1808MAIN\240E\1908ODES\3E0E
XMAKENAME        \0808\100800018018-R\2208FIL\2E16BUFFE\2709    `20
XMAKE_BP        \0808\1009000144D8-R\2308BUFFE\0E09\390BEXEC\480F
XMAKE_CURRENT        \0808    00014008-R\1E08BUFFE\0E09\340BFINDER\1A13MAIN
V\5C0F
X        \0808\1010\2020\400BWINDOW\510D
XMAP        \0808\100D0001D3B8-R\2708\3219EXTERNS\4F0C
XMAPBANG_BUFNAME        \0808 00032290-R\1B08MAIN\2711\1906P\3F10
XMAPPED_C        \0808\10080001CF40-R\2208MAP\2D16INPUT\480E
XMAPPED_C_AVAIL        \0808  0001CE90-R\1C08MAP\2712    EXEC\1A15INPUT\5B0E
XMAPPED_KEYSTROKE        \08080001B098-R\1A08INPUT\2710\1906SER\1A0E
XMAPPED_UNGOTC_AVAIL             0001CFA8-R\1708MAP\220D  `20
XMAPUNGETC        \0808\10070001CF10-R\2108MAP\2C16INPUT\4714LINE\5F0F
XMAP_BANG        \0808\10080001D398-R\2208MAP\2D16EXTERNS\4A0C
XMAP_BUFNAME        \0808     000322B0-R\1F08MAIN\2B15MAP\4310
XMARK        \0808\100C000C2E40-R     WK-MAIN\3215BASIC\1915IND\640F
X        \0808\1010\2020\400BBUFFER\5113FENCES\6A0D
X        \0808\1010\2020\400BFILE\4F15INPUT\690E
X        \0808\1010\2020\400BINSERT\5113LINE\680F
X        \0808\1010\2020\4008WK-MAIN\4F15ONELINER\6C0B
X        \0808\1010\2020\400BOPERS\5014RANDOM\6A0D
X        \0808\1010\2020\400BREGION\5113SEARCH\6A0D
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   53
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
X        \0808\1010\2020\400BSELECT\5113UNDO\680F
X        \0808\1010\2020\400BWINDOW\1914ORD\680F
XMARKWFMODE        \0808\100600017F80-R\2008FIL\2C10
XMATCHFENCE        \0808\100600017E60-R\2008FENCES\2E13EXTERN\1A0D
XMATCHFENCEBACK        \0808  00017E30-R\1C08FENCES\2A12 EXTERN\1A0D
XMAYBE_PATHNAME        \0808  0001FC20-R\1C08PATH\2812   FIL\4110
XMAYNEEDUNDO        \0808     00023440-R\1F08\2B19EVAL\1916XEC\5D0F
X        \0808\1010\2020\400BGLOBALS\520C
XMENUB        \0808\100B000C2E50-R     WK-X11\3013\1916
XMESSAGES_BUFNAME        \0808000322C0-R\1A08MAIN\2610\1906SGS\3F0F
XMINIEDIT        \0808\1008000C2E60-R     WK-MAIN\2E15DISPLAY\4A12INPU\610F
X        \0808\1010\2020\4008WK-MAIN\4F0F
XMKLOWER        \0808\100900015F68-\2309EVAL\2F15FILE\4815INPUT\620E
X        \0808\1010\2020\400BMODES\5014TAG\1810
X        \0808\1010\2020\400BVMS2UNIX\530B
XMKTRIMMED        \0808\100700015F48-R\2108EVAL\2D15BUFFE\2709    `20
XMKUPPER        \0808\100900015F78-\2309EVAL\2F15FILEC\4914GLOB\610F
X        \0808\1010\2020\400BINPUT\5014PATH\680F
X        \0808\1010\2020\400BVMS2UNIX\530B
XMK_TO_VCOL        \0808\100600015580-R\2008DISPLAY\2F12RANDOM\470D
XMLERASE        \0808\100900015C88-R\2308DISPLAY\3212BIND\4815BUFFER\630D
X        \0808\1010\2020\400BCRYPT\5014FILE\680F
X        \0808\1010\2020\400BFILEC\5014INPUT\690E
X        \0808\1010\2020\400BINSERT\1914SEARCH\6B0C
X        \0808\1010\2020\400BMAIN\1916ODES\690E
X        \0808\1010\2020\400BONELINER\1912PERS\690E
X        \0808\1010\2020\400BRANDOM\510D
XMLERROR        \0808\100900015BE0-\2309DISPLAY\3212FILE\4815FILEIO\630D
XMLFORCE        \0808\100900015658-R\2308DISPLAY\3212BASIC\4914BIND\610F
X        \0808\1010\2020\400BBUFFER\5113EVAL\680F
X        \0808\1010\2020\400BEXEC\4F15FILE\680F
X        \0808\1010\2020\400BFILEC\1918IO\6A0D
X        \0808\1010\2020\400BFINDERR\5212GLOBALS\6B0C
X        \0808\1010\2020\400BHISTORY\5212INPUT\690E
X        \0808\1010\2020\400BISEARCH\5212LINE\680F
X        \0808\1010\2020\400BMAIN\1917P\6710
X        \0808\1010\2020\400BMODES\5014ONELINER\6C0B
X        \0808\1010\2020\400BOPERS\5014PATH\680F
X        \0808\1010\2020\400BRANDOM\1914EGEXP\6A0D
X        \0808\1010\2020\400BREGION\5113SEARCH\6A0D
X        \0808\1010\2020\400BSELECT\1914PAWN\690E
X        \0808\1010\2020\400BTAGS\4F15UNDO\680F
X        \0808\1010\2020\400BVERSION\1913MSPIPE\6B0C
X        \0808\1010\2020\400BWINDOW\1914ORD\680F
XMLPROMPT        \0808\100800015C40-R\2208DISPLAY\3112BIND\4715EXEC\600F
X        \0808\1010\2020\400BINPUT\5014MAIN\680F
X        \0808\1010\2020\400BSPAWN\500E
XMLQUICKASK        \0808\10060001B4C0-R\2008INPUT\2D14ONELINE\2909  `20
XMLREPLY        \0808\10090001B3C8-R\2308INPUT\3014BASIC\1915IND\610F
X        \0808\1010\2020\400BBUFFER\5113CRYPT\690E
X        \0808\1010\2020\400BCSRCH\5014EVAL\680F
X        \0808\1010\2020\400BEXEC\4F15FILE\680F
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   54
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
X        \0808\1010\2020\400BFINDERR\5212INSERT\6A0D
X        \0808\1010\2020\400BONELINER\5311RANDOM\6A0D
X        \0808\1010\2020\400BREGION\5113SPAW\180F
X        \0808\1010\2020\400BWINDOW\510D
XMLREPLY_DIR        \0808     00019220-\1F09FILEC\2C14RANDOM\460D
XMLREPLY_FILE        \0808    00019338-R\1E08FILEC\2B14EX\1816 FILE\5C0F
X        \0808\1010\2020\400BOPERS\500E
XMLREPLY_NO_BS        \0808   0001B380-R\1D08INPUT\2A13 SPAWN\430E
XMLREPLY_NO_OPTS        \0808 0001B330-R\1B08INPUT\2811   LINE\1814 SELEC\330E
V
XMLREPLY_REG        \0808     0001B4A0-R\1F08INPUT\2C14LINE\440F
XMLREPLY_REG_COUNT        \08070001B3E8-R\1908INPU\2610     EXEC\3E0F
XMLSAVE        \0808\100A000C2E70-R     WK-MAIN\3015DISPLAY\4C0F\3216
XMLSAVEC        \0808\100900015C10-R\2308DISPLAY\3212MSGS\480F
XMLWARN        \0808\100A00015BA8-R\2408DISPLAY\3312BUFFE\2709\530BEXEC\620F
X        \0808\1010\2020\400BFILE\1917NDERR\6B0C
X        \0808\1010\2020\400BINPUT\1915SEARCH\6B0C
X        \0808\1010\2020\400BLINE\4F15MAIN\680F
X        \0808\1010\2020\400BMODES\5014TAG\1810
X        \0808\1010\2020\400BUNDO\4F0F
XMLWRITE        \0808\100900015C68-R\2308DISPLAY\3212BASIC\4914BIND\610F
X        \0808\1010\2020\400BBUFFER\5113EVAL\680F
X        \0808\1010\2020\400BFILE\1919C\690E
X        \0808\1010\2020\400BINPUT\1916SER\1A0E
X        \0808\1010\2020\400BMAIN\1916ODES\690E
X        \0808\1010\2020\400BOPERS\5014RANDOM\6A0D
X        \0808\1010\2020\400BREGION\5113SEARCH\6A0D
X        \0808\1010\2020\400BSELECT\5113TAGS\680F
X        \0808\1010\2020\400BUNDO\4F15X11\6710
XMLYESNO        \0808\10090001B500-R\2308INPUT\3014BUFFE\2709\520BCRYP\320F
X        \0808\1010\2020\400BFILE\1919C\690E
X        \0808\1010\2020\400BGLOB\4F0F
XMODELINE_FORMAT        \0808 000C2EF0-R     WK-MAIN\2711    DISPLAY\1C12EVAL
V\590F
X        \0808\1010\2020\4008WK-MAIN\4F0F
XMODE_EOL        \0808\10080001E9D0-R\2208MODES\2F14EVA\4710
XMORE_NAMED_CMD        \0808  00017730-R\1C08EXEC\2812   FILE\1915ONELINE\4209
V  `20
XMOUSE_MOTION        \0808    00011780-R\1E08X11\2914  EXTERNS\4612MAI\5C10
XMOVECURSOR        \0808\100600015230-\2009DISPLAY\2F12MSGS\450F
XMSG_PUTC        \0808\10080001EC30-R\2208MSGS\2E15DISPLAY\4A0C
XMSTORE        \0808\100A000C2F00-R     WK-MAIN\3015EXEC\4912\3216
XMULTIMOTION        \0808     00021E08-R\1F08SELECT\2D13EXTERNS\470C
XMULTIMOTIONFULLLINE             00021EA8-R\1708SELECT\250D\3206EXTERNS\3F0C
XMULTIMOTIONRECTANGLE            00021E88-R\1608SELECT\240C\3007EXTERNS\3E0C
XMVDNNXTWIND        \0808     00024470-R\1F08WINDOW\2D13EXTERNS\470C
XMVDNWIND        \0808\100800024450-R\2208WINDOW\3013EXTERNS\4A12X11\5F10
XMVLEFTWIND        \0808\1006000243A0-R\2008WINDOW\2E13BASIC\4614DISPLAY\610C
X        \0808\1010\2020\400BEXTERNS\5212INPUT\690E
XMVRIGHTWIND        \0808     000243C0-R\1F08WINDOW\2D13DISPLAY\4712EXTERNS
V\600C
X        \0808\1010\2020\400BINPUT\500E
XMVUPNXTWIND        \0808     00024430-R\1F08WINDOW\2D13EXTERNS\470C
XMVUPWIND        \0808\1008000243E0-R\2208WINDOW\3013EXTERNS\4A12X11\5F10
XM_VALNAMES        \0808\1006000322D0-R\2008MAIN\2C15MOD\4610
XNAMEBUFFER        \0808\100600014860-\2009\2E19EXTERNS\480C
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   55
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XNAMEDCMD        \0808\100800017B48-R\2208EXEC\2E15EXTERNS\4A12LINE\600F
XNAMETBL        \0808\100900032300-R\2308EXTERNS\3212BIND\4815MAIN\610F
XNAMETBLSIZE        \0808     000332F0-R\1F08EXTERNS\2E12MAIN\440F
XNAME_CMPL        \0808\100700041A00-R\2108MAIN\2D15BIND\4615EVA\5F10
X        \0808\1010\2020\400BEXEC\4F15FIL\1A10
X        \0808\1010\2020\400BINPUT\5014MODES\690E
XNB_ACTIONS        \0808\100600041A10-R\2008MENU\2C0F
XNB_TOKEN        \0808\1008000C2F10-R     WK-MENU\2E12\1916
XNEWLENGTH        \0808\100700024058-R\2108WINDOW\2F13DISPLAY\4912EXTERNS\620C
V
XNEWLINE        \0808\10090001B880-R\2308INSERT\3113EXTERNS\4B12WORD\610F
XNEWMODE        \0808\1009000C2F20-R     WK-TERMIO\3113SPAWN\4911\3216
XNEWPROCESSGROUP        \0808 00010920-R\1B08MAIN\2711    EXTERNS\1C12MENU\590F
V
X        \0808\1010\2020\400BX11\4E10
XNEWSCREENSIZE        \0808   00015A70-R\1D08DISPLAY\2C12X11\4110
XNEWWIDTH        \0808\100800024010-R\2208WINDOW\3013DISPLAY\4A12EXTERNS\630C
XNEW_REGEXVAL        \0808    0001DAE0-R\1E08MODES\2B14MAIN\430F
XNEXTBUFFER        \0808\100600014A18-\2009\2E19EXTERNS\480C
XNEXTCHAR        \0808\100800012A08-\2209BASIC\2F0E
XNEXTTAG        \0808\100900022A10-R\2308TAGS\2F15EXTERN\1C0D
XNEXTWIND        \0808\100800024128-R\2208WINDOW\3013EXTERNS\4A0C
XNEXT_COLUMN        \0808     000124E0-R\1F08BASIC\2C14RANDOM\460D
XNEXT_SW        \0808\100900012820-R\2308BASIC\3014INSERT\4A0D
XNIBUF        \0808\100B000C2F30-R     WK-TERMIO\3310\1916
XNOBUF        \0808\100B000C2F40-R     WK-TERMIO\3310\1916
XNON_FILENAME        \0808    000236D0-R\1E08VERSION\2D12HISTORY\4612MSGS\5C0F
V
X        \0808\1010\2020\400BONELINER\5311PATH\680F
X        \0808\1010\2020\400BRANDOM\510D
XNOREMAP        \0808\10090001D378-R\2308\2E19EXTERNS\4B0C
XNOREMAP_BANG        \0808    0001D358-R\1E08MAP\2914  EXTERNS\460C
XNOT_INTERRUPTED        \0808 00010DE0-R\1B08MAIN\2711    INPUT\410E
XNOUNMODIFIABLE        \0808  00023260-R\1C08UNDO\2812   SPAWN\420E
XNO_COMPLETION        \0808   0001A980-R\1D08INPUT\2A13 EVAL\1814 EXEC\5B0F
X        \0808\1010\2020\400BFILEC\5014MAP\6710
X        \0808\1010\2020\400BMODES\5014SEARCH\6A0D
XNO_MEMORY        \0808\100700010E58-R\2108MAIN\2D15BASIC\1915IND\5F0F
X        \0808\1010\2020\400BBUFFER\5113EXEC\680F
X        \0808\1010\2020\400BGLOB\4F15HISTORY\6B0C
X        \0808\1010\2020\400BLINE\4F15SELECT\6A0D
X        \0808\1010\2020\400BTAGS\4F15WINDOW\6A0D
XNO_SUCH_FILE        \0808    000185D0-R\1E08\2A18 EXEC\430F
XNO_SUCH_FUNCTION        \080800013740-R\1A08BIND\2610     EXEC\1915GLOBALS
V\5B0C
X        \0808\1010\2020\400BOPERS\500E
XNTILDES        \0808\100900041A20-R\2308MAIN\2F15DISPLAY\4B12EVAL\610F
XNULLMARK        \0808\100800041A30-R\2208MAIN\2E15BASIC\1915UFFE\4009    `20
X        \0808\1010\2020\400BFILE\4F15WINDOW\6A0D
XNULLPROC        \0808\100800010AC0-R\2208MAIN\2E15EXTERNS\4A12INSERT\620D
XNULL_TERM        \0808\100700041A40-R\2108TERMIO\2F13MAIN\460F
XNULL_T_ICURSOR        \0808  00022F08-\1C09TERMIO\2A12 DUMBTERM\4511X11\5910
XNULL_T_PFLUSH        \0808   00022F18-R\1D08TERMIO\2B13DUMBTERM\460B
XNULL_T_SCROLL        \0808   00022F28-R\1D08TERMIO\2B13DISPLAY\1913UMBTERM
V\5F0B
XNULL_T_SETBACK        \0808  00022F48-R\1C08TERMIO\2A12 DUMBTERM\4511X11\5910
V
XNULL_T_SETFOR        \0808   00022F58-\1D09TERMIO\2B13DUMBTERM\4611X11\5A10
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
+-+-+-+-+-+-+-+-  END  OF PART 140 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 141 -+-+-+-+-+-+-+-+
V7:36\2108Linker A11-20\3610    Page   56
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XNULL_T_SETPAL        \0808   00022F38-R\1D08TERMIO\2B13DUMBTERM\4611X11\5A10
XNULL_T_TITLE        \0808    00022EF8-R\1E08TERMIO\2C13DUMBTERM\4711X11\5B10
XNULL_T_UNWATCHFD        \080800022ED8-R\1A08TERMIO\2810   DUMBTERM\430B
XNULL_T_WATCHFD        \0808  00022EE8-R\1C08TERMIO\2A12 DUMBTERM\450B
XNU_WIDTH        \0808\1008000152F8-R\2208DISPLAY\3112INSERT\4913RANDOM\620D
XOBUF        \0808\100C000C2F50-R     WK-TERMIO\3410\1916
XOFFS2COL        \0808\100800015310-R\2208DISPLAY\3112ONELINE\2909\5309RANDOM
V\620D
XOLDMODE        \0808\1009000C3350-R     WK-TERMIO\3113SPAWN\4911\3216
XONLYWIND        \0808\100800024350-R\2208WINDOW\3013EXTERNS\4A12X11\5F10
XOPCMD        \0808\100B000C3360-R     WK-MAIN\3112\1919   OPERS\640E
X        \0808\1010\2020\400BSELECT\5113WORDMOV\6B0C
XOPENDOWN        \0808\10080001BDC0-R\2208INSERT\3013EXTERNS\4A12OPER\170F
XOPENDOWN_NO_AINDENT             0001BDE0-R\1708INSER\250E\3206EXTERNS\3F0C
XOPENREGION        \0808\100600021290-R\2008\2E19OPERS\460E
XOPENUP        \0808\100A0001BE50-R\2408INSERT\3213EXTERNS\4C12OPER\170F
XOPENUP_NO_AINDENT        \08070001BE80-R\1908INSER\2710    EXTERNS\410C
XOPEN_TERMINAL        \0808   00022EB0-R\1D08TERMIO\2B13MAIN\420F
XOPERATTRBOLD        \0808    00021BF0-R\1E08SELECT\2C13EXTERNS\460C
XOPERATTRCASEQ        \0808   000219C8-R\1D08SELECT\2B13EXTERNS\450C
XOPERATTRHC        \0808\100600021B40-R\2008SELECT\2E13EXTERNS\480C
XOPERATTRITAL        \0808    00021BD0-R\1E08SELECT\2C13EXTERNS\460C
XOPERATTRNO        \0808\100600021BB0-R\2008SELECT\2E13EXTERNS\480C
XOPERATTRREV        \0808     00021B90-R\1F08SELECT\2D13EXTERNS\470C
XOPERATTRUL        \0808\100600021B68-R\2008SELECT\2E13EXTERNS\480C
XOPERBLANK        \0808\10070001F3F0-R\2108OPERS\2E14EXTERN\1B0D
XOPERCHG        \0808\10090001F918-R\2308OPERS\3014EXTERN\1B13RANDOM\630D
XOPERCOPY        \0808\100800010BE0-R\2208MAIN\2E15EXTERNS\4A0C
XOPERCRYPT        \0808\10070001F3B0-R\2108OPERS\2E14EXTERN\1B0D
XOPERDEL        \0808\10090001F940-R\2308OPERS\3014EXTERN\1B13RANDOM\630D
XOPERDETAB        \0808\10070001F468-R\2108OPERS\2E14EXTERN\1B0D
XOPERENTAB        \0808\10070001F4A0-R\2108OPERS\2E14EXTERN\1B0D
XOPERFILTER        \0808\10060001F5D0-\2009OPERS\2D14EXTERN\1B0D
XOPERFLIP        \0808\10080001F7B0-R\2208OPERS\2F14EXTERN\1B13RANDOM\620D
XOPERFORMAT        \0808\10060001F600-R\2008OPERS\2D14EXTERN\1B0D
XOPERGLOBALS        \0808     00010B80-R\1F08MAIN\2B15EXTERN\470D
XOPERJOIN        \0808\10080001F838-R\2208OPERS\2F14EXTERN\1B13WORD\600F
XOPERLINECHG        \0808     0001F8F0-R\1F08OPERS\2C14EXTERN\1B0D
XOPERLINEDEL        \0808     0001F988-R\1F08OPERS\2C14EXTERN\1B0D
XOPERLINEYANK        \0808    0001F7E8-R\1E08OPERS\2B14EXTERN\1B0D
XOPERLIST        \0808\10080001F538-R\2208OPERS\2F14EXTERN\1B0D
XOPERLOWER        \0808\10070001F740-\2109OPERS\2E14EXTERN\1B0D
XOPERLSHIFT        \0808\10060001F708-R\2008OPERS\2D14EXTERN\1B0D
XOPERMOVE        \0808\100800010BC0-R\2208MAIN\2E15EXTERNS\4A0C
XOPEROPENRECT        \0808    0001F378-R\1E08OPERS\2B14EXTERN\1B0D
XOPERPPRINT        \0808\10060001F570-R\2008OPERS\2D14EXTERN\1B0D
XOPERPRINT        \0808\10070001F598-R\2108OPERS\2E14EXTERN\1B0D
XOPERRSHIFT        \0808\10060001F6D0-R\2008OPERS\2D14EXTERN\1B0D
XOPERSELECT        \0808\100600021C50-R\2008\2E19EXTERNS\480C
XOPERSUBST        \0808\10070001F500-R\2108OPERS\2E14EXTERN\1B0D
XOPERSUBSTAGAIN        \0808  0001F4D8-R\1C08OPERS\2912  EXTERN\1B0D
XOPERSYS        \0808\100900041AC0-R\2308MAIN\2F15EVAL\4815VERSIO\350D
XOPERTRANSF        \0808\100600010BA0-R\2008MAIN\2C15EXTERNS\480C
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   57
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XOPERTRIM        \0808\10080001F428-R\2208OPERS\2F14EXTERN\1B0D
XOPERUPPER        \0808\10070001F778-\2109OPERS\2E14EXTERN\1B0D
XOPERVGLOBALS        \0808    00010B60-R\1E08MAIN\2A14 EXTERN\460D
XOPERWRITE        \0808\10070001F630-R\2108OPERS\2E14EXTERN\1B0D
XOPERYANK        \0808\10080001F810-R\2208OPERS\2F14EXTERN\1B13RANDOM\620D
XOTS$DIV_I        \0808\100700000080-RX\2207LIBOTS\2F13BASIC\4714BIND\5F0F
X        \0808\1010\2020\400BBUFFER\5113CRYPT\690E
X        \0808\1010\2020\400BDISPLAY\5212EVAL\680F
X        \0808\1010\2020\400BEXEC\4F15FENCES\6A0D
X        \0808\1010\2020\400BFILE\1919C\690E
X        \0808\1010\2020\400BFINDERR\5212GLOB\680F
X        \0808\1010\2020\400BGLOBALS\5212HISTORY\6B0C
X        \0808\1010\2020\400BINPUT\1916SER\1A0E
X        \0808\1010\2020\400BISEARCH\5212LINE\680F
X        \0808\1010\2020\400BMAIN\1917P\6710
X        \0808\1010\2020\400BMODES\1915SG\1810
X        \0808\1010\2020\400BONELINER\5311RANDOM\6A0D
X        \0808\1010\2020\400BREGION\5113SEARCH\6A0D
X        \0808\1010\2020\400BSELECT\1914PAWN\690E
X        \0808\1010\2020\400BTAGS\4F15UNDO\680F
X        \0808\1010\2020\400BWINDOW\1914ORD\680F
X        \0808\1010\2020\400BX11\4E10
XOTS$DIV_UI        \0808\100600000090-RX\2107LIBOTS\2E13BIND\450F
XOTS$FILL        \0808\1008000001A0-RX\2307LIBOTS\3013DISPLAY\4A12LINE\600F
X        \0808\1010\2020\400BMAIN\4F0F
XOTS$HOME_ARGS        \0808   00000050-RX\1E07LIBOTS\2B13DISPLAY\450C
XOTS$INSV_VOL        \0808    000005A0-RX\1F07LIBOTS\2C13INPUT\440E
XOTS$MOVE        \0808\1008000001B0-RX\2307LIBOTS\3013BUFFER\4913DISPLAY\630C
X        \0808\1010\2020\400BFILEIO\5113INPUT\690E
X        \0808\1010\2020\400BLINE\4F15MAP\6710
X        \0808\1010\2020\400BMODES\5014ONELINER\6C0B
X        \0808\1010\2020\400BPATH\4F15UNDO\680F
X        \0808\1010\2020\400BVMS2UNIX\5311WINDOW\6A0D
X        \0808\1010\2020\400BX11\4E10
XOTS$REM_I        \0808\1007000000B0-RX\2207LIBOTS\2F13DISPLAY\4912EVAL\5F0F
X        \0808\1010\2020\400BINSERT\5113LINE\680F
X        \0808\1010\2020\400BREGION\510D
XOTS$ZERO        \0808\100800000180-RX\2307LIBOTS\3013DISPLAY\4A12MAIN\600F
X        \0808\1010\2020\400BMODES\5014X11\6710
XOUTPUT_BUFNAME        \0808  00033300-R\1C08MAIN\2812   FINDER\2809\4C0ASPAW
V\330F
XOUT_OF_MEM        \0808\100600041AD0-R\2008MAIN\2C15BUFFE\2709\4F0BRANDO\600E
V
XOVERWRITECHARS        \0808  0001BCA0-R\1C08INSERT\2A12 EXTERNS\440C
XOVERWSTRING        \0808     0001BA80-R\1F08INSERT\2D13EXTERNS\470C
XOWN_SELECTION        \0808   000118C0-R\1D08X11\2813   \4706\440D
XPALSTR        \0808\100A000C3370-\2406WK-MAIN\3015EVAL\4912\3216
XPARSE_MENU        \0808\10060001D7B8-R\2008\2C13
XPARSE_PATHLIST        \0808  0001FA00-R\1C08PATH\2812   BIND\410F
XPASTE_FROM_CLIPBOARD            00011700-R\1608X11\210C\2D0AEXTERNS\3E0C
XPAT        \0808\100D000C3380-R     WK-MAIN\3315EVAL\4C15GLOBALS\680C
X        \0808\1010\2020\400BISEARCH\520FWK-MAIN\680F
X        \0808\1010\2020\400BONELINER\5311SEARCH\6A0D
XPATHCAT        \0808\10090001FE18-R\2308PATH\2F15BIND\4815FILE\610F
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   58
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
X        \0808\1010\2020\400BFILEC\1916NDERR\6B0C
X        \0808\1010\2020\400BVMS2UNIX\530B
XPATHLEAF        \0808\10080001FD00-R\2208PATH\2E15BIND\4715FILE\600F
X        \0808\1010\2020\400BFILEC\5014MAIN\680F
X        \0808\1010\2020\400BTAGS\4F15VMS2UNIX\6C0B
XPATH_COMPLETION        \0808 00019180-R\1B08FILEC\2811   INPUT\410E
XPATMATCH        \0808\1008000C3400-R     WK-MAIN\2E15EVAL\4712\3216
X        \0808\1010\2020\400BSEARCH\510D
XPIPECMD        \0808\100900022290-R\2308SPAWN\3014EXTERNS\4B0C
XPLINEREGION        \0808     0001EE00-R\1F08ONELINER\2F11OPERS\450E
XPOPDOWN_COMPLETIONS             000132B8-R\1708BIND\230D\3008INPUT\1A0E
XPOPUPBUFF        \0808\1007000147D0-R\2108BUFFE\0E09\370BBIND\4615HISTORY\620C
V
X        \0808\1010\2020\400BMSGS\4F15ONELINER\6C0B
X        \0808\1010\2020\400BRANDOM\5113SPAWN\690E
XPOPUP_MSGS        \0808\10060001EBB0-R\2008\2C19DISPLAY\4812MAIN\5E0F
XPOP_FAKE_WIN        \0808    00023E48-R\1E08WINDOW\2C13SELECT\450D
XPOSWIND        \0808\100900024510-R\2308WINDOW\3113EXTERNS\4B0C
XPOUNDC        \0808\100A00041AE0-R\2408MAIN\3015BIND\4915INPUT\630E
X        \0808\1010\2020\400BMAP\4E10
XPOUNDC_FUNC        \0808     00010A90-R\1F08MAIN\2B15EXTERNS\470C
XPPLINEREGION        \0808    0001F150-R\1E08ONELINER\2E11OPERS\440E
XPRC2ENGL        \0808\100800013418-R\2208BIND\2E15EVA\4710
XPRESSRETURN        \0808     00022310-R\1F08SPAW\2C15BUFFE\2709    `20
XPREVINDENT        \0808\10060001B7B0-R\2008INSER\2E14FENCES\470D
XPREVIOUS_DIRECTORY        \080600020098-R\1808RANDOM\260E     EVAL\170F
XPREVWIND        \0808\100800024148-R\2208WINDOW\3013EXTERNS\4A0C
XPRE_OP_DOT        \0808\1006000C3410-R     WK-MAIN\2C15BASIC\4614FENCES\600D
X        \0808\1010\2020\4008WK-MAIN\4F15OPERS\690E
X        \0808\1010\2020\400BSELECT\5113UNDO\680F
XPRINTABLECHARS_BUFNAME          00033310-R\1408MAIN\200A    `20
XPRINT_USAGE        \0808     00023650-R\1F08VERSION\2E12MAIN\4415X11\5C10
XPROGNAM        \0808\100900041AF0-R\2308MAIN\2F15EVAL\4815VERSIO\350D
XPROG_ARG        \0808\1008000C3420-R     WK-MAIN\2E15BIND\4712\3216
X        \0808\1010\2020\400BMENU\4F15VERSION\6B0C
X        \0808\1010\2020\400BX11\4E10
XPSCREEN        \0808\1009000C3430-R     WK-DISPLAY\320F\1919   X11\6010
XPSC_EEOL        \0808\100800015068-R\2208DISPLAY\3112X11\4610
XPSC_EEOP        \0808\100800015098-R\2208DISPLAY\3112X11\4610
XPSC_FLUSH        \0808\1007000150F0-R\2108DISPLAY\3012X11\4510
XPSC_MOVE        \0808\1008000150B8-R\2208DISPLAY\3112X11\4610
XPSC_PUTCHAR        \0808     00015200-\1F09DISPLAY\2E12X11\4310
XPSC_REV        \0808\100900015058-R\2308DISPLAY\320C
XPURGE_MSGS        \0808\10060001EB48-R\2008\2C19MAIN\450F
XPUSH_FAKE_WIN        \0808   00023ED0-R\1D08WINDOW\2B13SELECT\440D
XPUTAFTER        \0808\10080001C9D0-\2209LINE\2E15EXTERNS\4A0C
XPUTBEFORE        \0808\10070001C9F0-R\2108LIN\2D16EXTERNS\490C
XPUTCTEXT        \0808\10080001CB00-R\2208LINE\2E15EVAL\470F
XPWD        \0808\100D0001FF90-R\2708RANDOM\3513EXTERNS\4F0C
XP_LINES_BUFNAME        \0808 00033330-R\1B08MAIN\2711    ONELINE\2909  `20
XQUICKEXIT        \0808\100700010D60-R\2108MAIN\2D15EXTERNS\490C
XQUIT        \0808\100C00010C78-R\2608MAIN\3215EXTERNS\4E12X11\6310
XQUITHARD        \0808\100800010D40-R\2208MAIN\2E15EXTERNS\4A0C
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   59
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XQUOTE        \0808\100B0001B680-R\2508INSERT\3313EXTERNS\4D0C
XQUOTEC        \0808\100A00041B00-R\2408MAIN\3015BIND\4915CSRCH\630E
X        \0808\1010\2020\400BHISTORY\5212INPUT\690E
X        \0808\1010\2020\400BINSERT\1914SEARCH\6B0C
X        \0808\1010\2020\400BX11\4E10
XRDONLY        \0808\100A00010C00-R\2408MAIN\3015EVAL\1916XEC\620F
X        \0808\1010\2020\400BGLOBALS\5212UNDO\680F
XREADHOOK        \0808\1008000C3440-R     WK-MAIN\2E15EVAL\4715FILE\600F
X        \0808\1010\2020\4008WK-MAIN\4F0F
XREADIN        \0808\100A000188F0-R\2408FILE\3015BIND\1916UFFE\4009    `20
X        \0808\1010\2020\400BEXEC\4F15SPAWN\690E
X        \0808\1010\2020\400BTAGS\4F0F
XREADING_MSG_LINE        \0808000C3460-R     WK-MAIN\2610     BUFFE\2706\460EDI
VSPLAY\5B0C
X        \0808\1010\2020\400BINPUT\5011WK-MAIN\680F
X        \0808\1010\2020\400BMAP\4E16X11\6710
XREADPATTERN        \0808     00021418-R\1F08SEARCH\2D13GLOBALS\4712ONELINE
V\4209  `20
XREAD_JMP_BUF        \0808    000C3470-R     WK-MAIN\2A14 INPUT\4411\3216
XRECTPUTAFTER        \0808    0001C950-\1E09LINE\2A14 EXTERNS\460C
XRECTPUTBEFORE        \0808   0001C970-R\1D08LIN\2914  EXTERNS\450C
XREG2INDEX        \0808\10070001C450-R\2108LINE\2D15INPUT\470E
XREGCOMP        \0808\100900020AA0-R\2308REGEX\3114EVAL\4815FINDER\4109   `20
X        \0808\1010\2020\400BISEARCH\5212MODES\690E
X        \0808\1010\2020\400BSEARCH\5113TAGS\680F
XREGERROR        \0808\100800021518-\2209SEARCH\3013ONELINE\4B12REGEXP\620D
XREGEXEC        \0808\1009000208A0-R\2308REGEXP\3113MODES\490E
XREGIONSHAPE        \0808     000C3690-R     WK-MAIN\2B15BASIC\4514EXE\1810
X        \0808\1010\2020\400BFENCES\5110WK-MAIN\680F
X        \0808\1010\2020\400BOPERS\5014REGION\6A0D
X        \0808\1010\2020\400BSEARCH\1915LECT\6A0D
X        \0808\1010\2020\400BWORD\4F0F
XREGISTERS_BUFNAME        \080700033340-R\1908MAIN\250F\3406LIN\3E10
XRELISTING_B_VALS        \0808000C36A0-R     WK-MAIN\2610     DISPLAY\420F\3216
V
X        \0808\1010\2020\400BMODES\500E
XRELISTING_W_VALS        \0808000C36B0-R     WK-MAIN\2610     DISPLAY\420F\3216
V
X        \0808\1010\2020\400BMODES\500E
XREMOVE_MODE        \0808     0001DF38-R\1F08MODES\2C14EXTERN\1B0D
XREMOVE_SUBMODE        \0808  0001E338-R\1C08MODES\2912  EXTERN\1B0D
XRENAMEBUFFER        \0808    00014800-\1E09\2C13
XRENAME_NAMEBST        \0808  00012E00-R\1C08BIND\2812   BUFFE\2709    `20
XREPLACECHAR        \0808     0001BC30-\1F09INSERT\2D13EXTERNS\470C
XREPOSITION        \0808\100600024490-R\2008WINDOW\2E13EXTERNS\4812RANDOM\600D
V
XREPTC        \0808\100B00041B10-R\2508MAIN\3115BIND\4A0F
XREP_CSRCH        \0808\100700014D58-R\2108\2E19EXTERNS\490C
XRESETKEY        \0808\100800017EF8-R\2208FILE\2E0F
XRESIZE        \0808\100A00024258-R\2408WINDOW\3213EVAL\4915EXTERNS\650C
X        \0808\1010\2020\400BX11\4E10
XRESPAWN        \0808\100900022418-R\2308\3019EXTERNS\4B0C
XRESTWND        \0808\1009000240F0-R\2308WINDOW\3113EXTERNS\4B0C
XREVEXIST        \0808\1008000C36C0-R     WK-MAIN\2E15DISPLAY\4A0F\3216
XREVSEARCH        \0808\1007000216B8-R\2108\2F19EXTERNS\490C
XREV_CSRCH        \0808\100700014DA0-R\2108\2E19EXTERNS\490C
XRISEARCH        \0808\10080001C2F0-R\2208\3119EXTERNS\4A0C
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   60
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XROW2WINDOW        \0808\100600015CB8-R\2008DISPLAY\2F12BASIC\4614X11\5D10
XRPAT        \0808\100C000C36D0-R     WK-MAIN\3215EVAL\4B15INPU\650F
X        \0808\1010\2020\4008WK-MAIN\4F15ONELINER\6C0B
XRTFRMSHELL        \0808\100600022438-R\2008SPAWN\2D0E
XRUN_PROCEDURE        \0808   000176B0-R\1D08EXEC\2913  BUFFE\2709\4C0BFIL\5B10
V
X        \0808\1010\2020\400BMAIN\4F15RANDOM\6A0D
XSAME_FNAME        \0808\100600018170-R\2008FIL\2C16BUFFE\2709\4F0BFILEC\5F0E
X        \0808\1010\2020\400BTAGS\4F0F
XSAVEWND        \0808\100900024118-R\2308WINDOW\3113EXTERNS\4B0C
XSAVE_SHELL        \0808\1006000C3750-R     WK-MAIN\2C15INPUT\4611\3216
X        \0808\1010\2020\400BSPAWN\500E
XSAVE_VALS        \0808\10070001EA78-R\2108MODE\2E15DISPLAY\490C
XSCANBOUNDPOS        \0808    000C3760-R     WK-MAIN\2A12\1919   ONELINE\4206
V\6506
X        \0808\1010\2020\400BSEARCH\510D
XSCANBOUNDRY        \0808     00021400-R\1F08SEARCH\2D13FENCES\4613I\3312
XSCANBOUND_IS_HEADER             000C3770-\1706WK-MAIN\230D\1919\4908ONELIN
V\590D
X        \0808\1010\2020\400BSEARCH\510D
XSCANNER        \0808\100900021350-\2309SEARCH\3113FENCES\4A13I\3312
X        \0808\1010\2020\400BONELINER\530B
XSCRBACKSEARCH        \0808   000217C0-R\1D08\2B19EXTERNS\450C
XSCREEN_STRING        \0808   0001AB60-R\1D08INPUT\2A13 BUFFE\2709\4C0BFILEC
V\5C0E
X        \0808\1010\2020\400BLINE\4F15SEARCH\6A0D
X        \0808\1010\2020\400BTAGS\4F0F
XSCRFORWSEARCH        \0808   000217E0-R\1D08\2B19EXTERNS\450C
XSCRNEXTDW        \0808\100700024168-R\2108WINDO\2F14EXTERNS\490C
XSCRNEXTUP        \0808\1007000241A0-R\2108WINDOW\2F13EXTERNS\490C
XSCRSEARCHPAT        \0808    000214A0-R\1E08\2F06\2C13EXTERNS\460C
XSEARCH_NAMEBST        \0808  00012DE0-R\1C08BIND\2812   BUFFE\2709    `20
XSEED        \0808\100C000C3780-R     WK-MAIN\3215EVAL\4B12\3216
XSEL_BEGIN        \0808\100700021D68-R\2108SELECT\2F13X11\4510
XSEL_BUFFER        \0808\100600021F08-\2009SELECT\2E13X11\4410
XSEL_EXTEND        \0808\100600021D38-R\2008SELECT\2E13X11\4410
XSEL_MOTION        \0808\100600021EE8-R\2008SELECT\2E13EXTERNS\480C
XSEL_REASSERT_OWNERSHIP          00021F68-R\1408SELECT\220A\2C09LINE\1713  UNDO
V\300F
XSEL_RELEASE        \0808     00021D88-R\1F08SELECT\2D13X11\4310
XSEL_SETSHAPE        \0808    00021D58-R\1E08SELECT\2C13X11\4210
XSEL_YANK        \0808\100800021F18-R\2208SELECT\3013X11\4610
XSETCHARTYPE        \0808     00024B28-R\1F08WORDMOV\2E12WORD\440F
XSETCURSOR        \0808\100700012440-\2109BASIC\2E14X11\4510
XSETFILLCOL        \0808\10060001EAB8-R\2008MODES\2D14EXTERN\1B0D
XSETGLOBMODE        \0808     0001E930-R\1F08MODES\2C14EXTERN\1B0D
XSETLOCMODE        \0808\10060001E970-R\2008MODES\2D14EXTERN\1B0D
XSETMARK        \0808\1009000125B8-R\2308BASIC\3014EXE\1815 LINE\610F
X        \0808\1010\2020\400BONELINER\5311WORD\680F
XSETM_BY_PREAMBLE        \08080001DC58-R\1A08MODES\2710    BUFFE\2709\490BFI
V\5811
XSETM_BY_SUFFIX        \0808  0001DCA0-R\1C08MODES\2912  BUFFE\2709\4B0BFILE
V\5A0F
XSETNMMARK        \0808\100700012700-R\2108BASIC\2E14EXTERNS\490C
XSETTAB        \0808\100A0001EAE8-R\2408MODES\3114EXTERN\1B0D
XSETTINGS_BUFNAME        \080800033350-R\1A08MAIN\2610\1906ODES\400E
XSETUP_HANDLER        \0808   00010998-\1D09MAIN\2913  X11\4110
XSETVAR        \0808\100A00016A68-\2409EVAL\3015EXTERNS\4C0C
XSETWMARK        \0808\100800012400-R\2208BASIC\2F14X11\4610
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   61
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XSET_BNAME        \0808\100700013DD0-R\2108BUFFE\0E09\370BBIND\4615EVAL\5F0F
X        \0808\1010\2020\400BFILE\4F15ONELINER\6C0B
XSET_CURWP        \0808\1007000240A0-R\2108WINDOW\2F13BASIC\4714GLOBALS\620C
X        \0808\1010\2020\400BX11\4E10
XSET_DIRECTORY        \0808   00020010-R\1D08RANDOM\2B13EVAL\420F
XSET_DOSMODE        \0808     000189C0-R\1F08FIL\2B16EXTERNS\470C
XSET_END_STRING        \0808  0001B088-R\1C08INPUT\2912  EVAL\1814 EXEC\5A0F
XSET_FEBUFF        \0808\100600019810-R\2008FINDER\0F09\370AFILE\4515MAIN\5E0F
V
XSET_LAST_FILE_EDITED            00018BF8-R\1608FILE\220C\2E09MAIN\190F
XSET_MAJORMODE_REXP        \08060001DB88-R\1808MODES\250E\1907AIN\180F
XSET_MODE_VALUE        \0808  0001E200-R\1C08MODES\290E
XSET_MODTIME        \0808     000181A0-R\1F08FIL\2B16TAGS\440F
XSET_PALETTE        \0808     000166E0-R\1F08EVAL\2B0F
XSET_RDONLY        \0808\10060001FF10-R\2008RANDOM\2E13BIND\4515EXEC\5E0F
X        \0808\1010\2020\400BFINDERR\5212HISTORY\6B0C
X        \0808\1010\2020\400BMAIN\1916SGS\680F
X        \0808\1010\2020\400BONELINER\5311SPAWN\690E
XSET_SUBMODE_VAL        \0808 0001DBB0-R\1B08MODES\2811   MAIN\400F
XSET_TERMCHRS        \0808    00013AC8-R\1E08BIND\2A14 EXTERN\460D
XSET_UNIXMODE        \0808    000189E0-R\1E08FIL\2A15 EXTERNS\460C
XSET_VARIABLE        \0808    000169C0-R\1E08EVAL\2A14 MODES\440E
XSGARBF        \0808\100A00041B20-R\2408MAIN\3015BUFFE\2709\530BDISPLAY\650C
X        \0808\1010\2020\400BMSGS\4F15SPAWN\690E
X        \0808\1010\2020\400BWINDOW\510D
XSHELL_COMPLETE        \0808  0001B350-R\1C08INPUT\2912  BIND\1814 FILEC\5B0E
XSHIFTLREGION        \0808    000211A0-R\1E08\2C19OPERS\440E
XSHIFTRREGION        \0808    00021228-R\1E08\2C19OPERS\440E
XSHIFTWID_VAL        \0808    00014A00-R\1E08BUFFE\0E09\340BBASIC\4414INSERT
V\5E0D
X        \0808\1010\2020\400BREGION\510D
XSHORTEN_PATH        \0808    0001FDD8-R\1E08\2A18 BUFFE\2709\4D0BDISPLAY\5F0C
V
X        \0808\1010\2020\400BFILE\1919C\690E
X        \0808\1010\2020\400BINPUT\5014MENU\680F
X        \0808\1010\2020\400BTAGS\4F0F
XSHOWCPOS        \0808\1008000205F8-R\2208RANDOM\3013EXTERN\4A13FILE\600F
XSHOWHISTORY        \0808     0001A428-R\1F08\2E19EXTERNS\470C
XSHOWHYPERCMD        \0808    00021A80-R\1E08SELECT\2C13EXTERNS\460C
XSHOWKREG        \0808\10080001C390-R\2208LINE\2E15EXTERNS\4A0C
XSHOWLENGTH        \0808\1006000205C8-R\2008RANDOM\2E13EXTERNS\480C
XSHOWTAGSTACK        \0808    00022578-R\1E08TAGS\2A14 EXTERN\1C0D
XSHOWVERSION        \0808     000237D0-R\1F08\2E19EXTERNS\470C
XSHOW_TERMCHRS        \0808   00013A28-R\1D08BIND\2913  EXTERN\450D
XSHRINKWIND        \0808\100600024238-R\2008WINDOW\2E13EXTERNS\480C
XSHRINKWRAP        \0808\100600024278-R\2008WINDOW\2E13BIND\4515RANDOM\600D
XSIGNAL_WAS        \0808\1006000C3790-R     WK-MAIN\2C12\1916
XSKIP_BLANKS        \0808     00015F30-R\1F08EVAL\2B15PATH\4415VMS2UNIX\610B
XSKIP_CBLANKS        \0808    00016760-R\1E08EVAL\2A14 TAG\4310
XSKIP_CSTRING        \0808    00016748-R\1E08EVAL\2A0F
XSKIP_CTEXT        \0808\100600016738-R\2008EVAL\2C15TAGS\450F
XSKIP_STRING        \0808     00016720-R\1F08EVAL\2B15BIND\4415FILE\5D0F
X        \0808\1010\2020\400BGLOB\4F15PATH\680F
X        \0808\1010\2020\400BVMS2UNIX\530B
XSKIP_TEXT        \0808\100700016710-R\2108EVAL\2D0F
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   62
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XSLOWREADF        \0808\1007000187E8-R\2108FILE\2D15MAIN\460F
XSORTLISTBUFFERS        \0808 000147B0-R\1B08\2A06\2911  MODE\410F
XSOURCE        \0808\100A00010B40-R\2408MAIN\3015EXTERNS\4C0C
XSPAWN        \0808\100B000223F8-R\2508\3219EXTERNS\4D0C
XSPAWNCLI        \0808\100800022478-R\2208SPAWN\2F14EXTERNS\4A0C
XSPLITWIND        \0808\1007000242F0-R\2108WINDOW\2F13EXTERNS\4912MENU\5F0F
X        \0808\1010\2020\400BX11\4E10
XSRES        \0808\100C000C37A0-R     WK-MAIN\3215EVAL\4B12\3216
XSTARTC        \0808\100A00041B30-R\2408MAIN\3015BIND\4915INSERT\640D
XSTARTUP_FILE        \0808    000C37C0-R     WK-MAIN\2A14 EVAL\4312\3216
X        \0808\1010\2020\400BMENU\4F0F
XSTARTUP_PATH        \0808    000C37D0-R     WK-MAIN\2A14 BIND\1915EVAL\5C0F
X        \0808\1010\2020\4008WK-MAIN\4F0F
XSTART_KBM        \0808\10070001A658-R\2108INPUT\2E0E
XSTDIN_BUFNAME        \0808   00033360-R\1D08MAIN\290F
XSTENV        \0808\100B000169E8-R\2508EVAL\310F
XSTOL        \0808\100C00016048-R\2608EVA\3216EXEC\4B0F
XSTOPC        \0808\100B00041B40-R\2508MAIN\3115BIND\4A15INSERT\650D
XSTOREMAC        \0808\100800017758-R\2208EXE\2E16EXTERNS\4A0C
XSTOREPROC        \0808\1007000177B0-R\2108EXE\2D16EXTERNS\490C
XSTRINGRECT        \0808\100600021258-R\2008REGION\2E13OPERS\460E
XSTRING_MODE_VAL        \0808 0001E488-R\1B08MODES\2811   E\4012
XSTRING_TO_NUMBER        \08080001E080-\1A09MODES\2710    INPUT\400E
XSTRIP_BRACKETS        \0808  000140E0-R\1C08BUFFE\0E09\320BBIND\410F
XSTRIP_VERSION        \0808   0001F9C8-R\1D08PATH\2913  FILE\1919IO\5D0D
X        \0808\1010\2020\400BTAGS\4F15VMS2UNIX\6C0B
XSTRMALLOC        \0808\1007000102A0-R\2108MAIN\2D15BIND\4615DISPLAY\620C
X        \0808\1010\2020\400BEVAL\1916XEC\680F
X        \0808\1010\2020\400BFINDERR\5212GLOB\680F
X        \0808\1010\2020\400BMAP\1917ODES\690E
X        \0808\1010\2020\400BRANDOM\5113SELECT\6A0D
X        \0808\1010\2020\400BTAGS\4F15VMS2UNIX\6C0B
X        \0808\1010\2020\400BX11\4E10
XSTRNCPY0        \0808\100800010228-R\2208MAIN\2E15BIND\1916UFFE\4009    `20
X        \0808\1010\2020\400BEVAL\4F15FILE\680F
X        \0808\1010\2020\400BFINDERR\5212ISEARCH\6B0C
X        \0808\1010\2020\400BMODES\5014TAG\1810
X        \0808\1010\2020\400BX11\4E10
XSUBSTREGION        \0808     0001F130-R\1F08ONELINE\1009\3709OPERS\450E
XSUBST_AGAIN        \0808     0001F0D0-R\1F08ONELINE\1009\3709EXTERNS\470C
XSUBST_AGAIN_REGION        \08060001F110-R\1808ONELINE\1009\3009OPERS\3E0E
XSUSPC        \0808\100B00041B50-R\2508MAIN\3115BIND\4A0F
XSWAPMARK        \0808\100800012490-R\2208BASIC\2F14EXE\1815 LINE\600F
X        \0808\1010\2020\400BONELINER\1912PERS\690E
X        \0808\1010\2020\400BSELECT\5113WORD\680F
XSWBUFFER        \0808\1008000141E0-\2209\3019BIND\4715EVAL\600F
X        \0808\1010\2020\400BEXEC\4F15MAIN\680F
X        \0808\1010\2020\400BMODES\5014ONELINER\6C0B
X        \0808\1010\2020\400BRANDOM\510D
XSWBUFFER_LFL        \0808    00014208-R\1E08\3006\2C13FILE\4314 SPAWN\5D0E
XSWEEPHACK        \0808\1007000C37E0-R     WK-MAIN\2D15CSRCH\4714FENCES\610D
X        \0808\1010\2020\4008WK-MAIN\4F15SELECT\6A0D
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   63
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
X        \0808\1010\2020\400BWORDMOV\520C
XSWINDOW        \0808\1009000C37F0-R     WK-MAIN\2F12\1919   W\6312
XSYS$ASSIGN        \0808\100600000100-RX\2107SYS$PUBLIC_VECTORS\3A07TERMIO\470D
V
XSYS$CREMBX        \0808\1006000001E0-R\2108SYS$PUBLIC_VECTORS\3A07VMSPIPE\480C
V
XSYS$DASSGN        \0808\100600000230-RX\2107SYS$PUBLIC_VECTORS\3A07TERMIO\4713
VVMSPIPE\610C
XSYS$GETDVIW        \0808     00000990-RX\2007SYS$PUBLIC_VECTORS\3907VMSPIPE
V\470C
XSYS$IMGSTA        \0808\100600000340-RX\2107SYS$PUBLIC_VECTORS`20
XSYS$PARSE        \0808\100700000830-RX\2207SYS$PUBLIC_VECTORS\3B07PATH\4615VMS
V2UNI\4108   `20
XSYS$QIOW        \0808\100800000080-RX\2307SYS$PUBLIC_VECTORS\1908PAWN\4814TERM
VIO\620D
X        \0808\1010\2020\400BVMSPIPE\520C
XSYS$SEARCH        \0808\100600000860-RX\2107SYS$PUBLIC_VECTORS\3A07VMS2UNI
V\2808   `20
XSYSMAP        \0808\100A0001D2B8-R\2408\2F19EXTERNS\4C0C
XSYSMAPPED_C        \0808     0001D060-R\1F08MAP\2A15 INPUT\450E
XSYSMAPPED_C_AVAIL        \08070001CFB8-R\1908MAP\240F\3307INPUT\3F0E
XSYSMAP_BUFNAME        \0808  00033380-R\1C08MAIN\2812   MAP\4010
XTABOFF        \0808\100A000C3800-R     WK-MAIN\3015DISPLAY\4C0F\3216
XTABSTOP_VAL        \0808     00013FA0-R\1F08BUFFE\0E09\350BDISPLAY\4712MODES
V\5E0E
X        \0808\1010\2020\400BONELINER\530B
XTAGFILE_BUFNAME        \0808 00033390-R\1B08MAIN\2711    TAGS\400F
XTAGSTACK_BUFNAME        \0808000333A0-R\1A08MAIN\2610     TAGS\3F0F
XTAG_FOR_UNDO        \0808    00023600-R\1E08\2A18 FILE\1915LIN\1910
XTB_ALLOC        \0808\100800022BD0-R\2208TBUFF\2F14INPUT\480E
XTB_APPEND        \0808\100700022CA8-R\2108TBUFF\2E14BI\4617EXEC\5F0F
X        \0808\1010\2020\400BFINDERR\5212HISTORY\6B0C
X        \0808\1010\2020\400BINPUT\5014SPAWN\690E
X        \0808\1010\2020\400BTAGS\4F15WORD\680F
X        \0808\1010\2020\400BX11\4E10
XTB_BAPPEND        \0808\100600022CC8-R\2008TBUFF\2D14FINDER\2809\500AHISTORY
V\610C
X        \0808\1010\2020\400BINPUT\5014TAGS\680F
X        \0808\1010\2020\400BWORD\4F15X11\6710
XTB_COPY        \0808\100900022D80-R\2308TBUFF\3014HISTOR\4B13INPUT\620E
XTB_FREE        \0808\100900022DC0-R\2308TBUFF\3014FINDER\2809\530AHISTORY\640C
V
X        \0808\1010\2020\400BINPUT\5014MAP\6710
X        \0808\1010\2020\400BSPAWN\5014WORD\680F
X        \0808\1010\2020\400BX11\4E10
XTB_GET        \0808\100A00022C40-R\2408TBUFF\310E
XTB_INIT        \0808\100900022CE8-R\2308TBUFF\3014BIND\4815EXEC\610F
X        \0808\1010\2020\400BFINDERR\5212HISTORY\6B0C
X        \0808\1010\2020\400BINPUT\5014MAP\6710
X        \0808\1010\2020\400BTAGS\4F15WORD\680F
X        \0808\1010\2020\400BX11\4E10
XTB_INSERT        \0808\100700022DA0-R\2108TBUFF\2E14INPU\470F
XTB_LENGTH        \0808\100700022C20-R\2108TBUFF\2E14BIND\4615EXEC\5F0F
X        \0808\1010\2020\400BHISTORY\5212INPUT\690E
X        \0808\1010\2020\400BMAP\4E16SPAWN\690E
X        \0808\1010\2020\400BWORD\4F0F
XTB_MORE        \0808\100900022C68-R\2308TBUFF\3014X11\4710
XTB_NEXT        \0808\100900022C50-R\2308TBUFF\3014X11\4710
XTB_PUT        \0808\100A00022C88-R\2408TBUFF\3114IN\4A17MAP\6110
XTB_SAPPEND        \0808\100600022D40-R\2008TBUFF\2D14BI\4517EXEC\5E0F
X        \0808\1010\2020\400BHISTORY\5212SPAWN\690E
XTB_SCOPY        \0808\100800022D60-R\2208TBUFF\2F14BIND\4715EVAL\600F
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   64
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
X        \0808\1010\2020\400BEXEC\4F15FILE\680F
X        \0808\1010\2020\400BFILEC\1916NDERR\6B0C
X        \0808\1010\2020\400BHISTORY\5212INPUT\690E
X        \0808\1010\2020\400BMAP\1917ODES\690E
X        \0808\1010\2020\400BSPAWN\500E
XTB_STRING        \0808\100700022D08-R\2108TBUFF\2E14HISTORY\490C
XTB_UNPUT        \0808\100800022C78-R\2208TBUFF\2F14HISTORY\4A12I\6112
X        \0808\1010\2020\400BSPAWN\500E
XTB_VALUES        \0808\100700022C30-R\2108TBUFF\2E14BIND\4615EVAL\5F0F
X        \0808\1010\2020\400BEXEC\4F15FIL\1A10
X        \0808\1010\2020\400BFINDERR\5212HISTORY\6B0C
X        \0808\1010\2020\400BINPUT\5014MAP\6710
X        \0808\1010\2020\400BMODES\5014SPAWN\690E
X        \0808\1010\2020\400BTAGS\4F15WORD\680F
XTERM        \0808\100C00041B60-R\2608X11\3116BASIC\1915IND\640F
X        \0808\1010\2020\400BDISPLAY\1913UMBTERM\6C0B
X        \0808\1010\2020\400BEVAL\4F15FILE\680F
X        \0808\1010\2020\400BFILEC\5014INPUT\690E
X        \0808\1010\2020\400BINSERT\5113MAIN\680F
X        \0808\1010\2020\400BMAP\1917ODES\690E
X        \0808\1010\2020\400BRANDOM\5113SPAWN\690E
X        \0808\1010\2020\400BTERMIO\5113WINDOW\6A0D
XTERMINALCHARS_BUFNAME           000333B0-R\1508MAIN\210B\2C0ABIND\190F
XTEST_CMPL        \0808\100700041BE0-R\2108MAIN\2D15BIND\4615FILEC\600E
X        \0808\1010\2020\400BINPUT\500E
+-+-+-+-+-+-+-+-  END  OF PART 141 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 142 -+-+-+-+-+-+-+-+
XTGETC        \0808\100B0001B1B0-R\2508INPUT\3214MAP\4910
XTGETC_AVAIL        \0808     0001B258-R\1F08INPUT\2C14MAP\4310
XTIDY_EXIT        \0808\100700010260-R\2108MAIN\2D15BIND\4615FILE\5F0F
X        \0808\1010\2020\400BTERMIO\510D
XTOGGLELISTBUFFERS        \080700014770-R\1908\2806\270F    EXTERN\410D
XTOKEN        \0808\100B00016BE8-R\2508EXEC\3115EVAL\4A15INPUT\640E
X        \0808\1010\2020\400BMENU\4F0F
XTOKTYP        \0808\100A00016598-R\2408EVAL\3015EXEC\490F
XTOKVAL        \0808\100A000165A8-R\2408E\3018EXEC\4915INPUT\630E
XTOSS_TO_UNDO        \0808    00023620-R\1E08\2A18 LINE\430F
XTRIMLINE        \0808\1008000210B8-R\2208REGION\3013INSERT\490D
XTRIM_REGION        \0808     000210F0-R\1F08\2D19OPERS\450E
XTRUEM        \0808\100B00041BF0-R\2508MAIN\3115EVAL\4A15MODES\640E
XTTCLEAN        \0808\100900023138-R\2308TERMIO\3113MAI\4816VERSIO\640D
XTTCLOSE        \0808\100900023170-R\2308TERMIO\310D
XTTCOL        \0808\100B00041C00-R\2508MAIN\3115DISPLAY\4D12MSGS\630F
X        \0808\1010\2020\400BX11\4E10
XTTFLUSH        \0808\1009000230D8-R\2308TERMIO\310D
XTTGETC        \0808\100A000230B8-R\2408TERMIO\320D
XTTOPEN        \0808\100A00022E40-R\2408TERMIO\320D
XTTPUTC        \0808\100A00023108-R\2408TERMIO\320D
XTTROW        \0808\100B00041C10-R\2508MAIN\3115DISPLAY\4D12MSGS\630F
X        \0808\1010\2020\400BX11\4E10
XTTTYPAHEAD        \0808\100600023050-R\2008TERMIO\2E13X11\4410
XTTUNCLEAN        \0808\100700023128-R\2108TERMIO\2F0D
XTUNGETC        \0808\10090001B290-R\2308INPUT\3014MAP\4710
XTWIDDLE        \0808\1009000203F0-R\2308RANDOM\3113EXTERNS\4B0C
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   65
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XUE_CRYPT        \0808\100800014C08-R\2208\2F19FILE\4715FILEIO\620D
X        \0808\1010\2020\400BMAIN\4F15REGIO\1B0E
XUE_MAKEKEY        \0808\100600014C30-R\2008CRYPT\2D14FILE\4515REGION\600D
XUE_SETKEY        \0808\100700014CB0-R\2108CRYPT\2E14EXTERNS\490C
XUKB        \0808\100D000C3810-R     WK-MAIN\3315EXEC\4C15FILE\650F
X        \0808\1010\2020\400BINPUT\5014LINE\680F
X        \0808\1010\2020\4008WK-MAIN\4F15OPERS\690E
X        \0808\1010\2020\400BREGION\5113SELECT\6A0D
XUNABBR        \0808\100A0001D1E0-\2409MAP\2F16EXTERNS\4C0C
XUNARG_FUNC        \0808\100600010A80-R\2008MAIN\2C15EXTERNS\480C
XUNBINDKEY        \0808\100700013878-R\2108BIND\2D15EXTERNS\490C
XUNCHG_BUFF        \0808\1006000143A8-R\2008BUFFE\0E09\360BFILE\4515UNDO\5E0F
XUNDISPBUFF        \0808\100600014260-R\2008BUFFE\0E09\360BWINDOW\470D
XUNDO        \0808\100C000235C0-R\2608\3219EXTERNS\4E0C
XUNIMPL        \0808\100A00010AD0-R\2408MAIN\3015BIND\4915EXTERNS\650C
XUNIX2VMS_PATH        \0808   00023BA0-R\1D08VMS2UNIX\2D11FILEC\4313 \5B13
X        \0808\1010\2020\400BRANDOM\510D
XUNIX_PATHLEAF        \0808   0001FCE0-R\1D08PATH\290F
XUNKEYSTROKE        \0808     0001ACE8-R\1F08INPUT\2C14BIND\4415BUFFE\4009  `20
V `20
X        \0808\1010\2020\400BEVAL\1916XEC\680F
X        \0808\1010\2020\400BHISTORY\5212INSERT\6A0D
X        \0808\1010\2020\400BISEARCH\5212MODES\690E
X        \0808\1010\2020\400BONELINER\1912PERS\690E
X        \0808\1010\2020\400BSPAWN\500E
XUNMAP        \0808\100B0001D250-R\2508\3019EXTERNS\4D0C
XUNMAP_BANG        \0808\10060001D228-R\2008MAP\2B16EXTERNS\480C
XUNMAP_SYSTEM        \0808    0001D200-R\1E08MAP\2914  EXTERNS\460C
XUNMARK        \0808\100A000143C8-R\2408BUFFE\0E09\3A0BEXTERNS\4C0C
XUNNAMED_BUFNAME        \0808 000333D0-R\1B08MAIN\2711    FIL\4010
XUNQNAME        \0808\100900017F98-R\2308FIL\2F16BUFFE\2709    `20
XUNTAGPOP        \0808\100800022698-R\2208TAGS\2E15EXTERN\1C0D
XUPDATE        \0808\100A00015AB8-R\2408DISPLAY\3312BIND\4915BUFFE\4009    `20
X        \0808\1010\2020\400BFENCES\5113INPUT\690E
X        \0808\1010\2020\400BINSERT\1914SEARCH\6B0C
X        \0808\1010\2020\400BMAIN\1916ENU\680F
X        \0808\1010\2020\400BONELINER\1912PERS\690E
X        \0808\1010\2020\400BSELECT\5113WINDOW\6A0D
X        \0808\1010\2020\400BX11\4E10
XUPDATELISTBUFFERS        \080700013EF0-R\1908\2806\270F    FILE\1713  HISTORY
V\5A0C
X        \0808\1010\2020\400BRANDOM\5113WINDOW\6A0D
XUPDATE_SCRATCH        \0808  00013ED0-R\1C08BUFFE\0E09\320BBIND\1713  FINDER
V\330D
X        \0808\1010\2020\400BLINE\4F15MAP\6710
X        \0808\1010\2020\400BMODES\5014TAG\1810
XUPDATE_SCROLLBAR        \080800011B80-\1A09X11\2510\3506DISPLAY\420C
XUPMODE        \0808\100A00015CA8-R\2408DISPLAY\3312BUFFE\2709\530BEVAL\620F
X        \0808\1010\2020\400BFINDERR\5212RANDOM\6A0D
X        \0808\1010\2020\400BWINDOW\510D
XUPPERREGION        \0808     00020F50-R\1F08\2D19OPERS\450E
XUPSCREEN        \0808\100800015D20-R\2208DISPLAY\3112EXTERNS\4A0C
XUSEBUFFER        \0808\100700014B30-\2109\2F19EXTERNS\490C
XUSEKREG        \0808\10090001CA58-R\2308LINE\2F15EXTERNS\4B0C
XUSERBEEP        \0808\100800020148-R\2208RANDOM\3013EXTERNS\4A0C
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   66
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XUSER_VARS        \0808\1007000C3820-R     WK-MAIN\2D15EVAL\4612\3216
XVARIABLES_BUFNAME        \0807000333E0-R\1908MAIN\250F\3406EVAL\3E0F
XVERSION        \0808\100900041C20-R\2308MAI\2F16EVAL\4815\6413
XVGLOBALS        \0808\10080001A0A8-R\2208\3119EXTERN\4A0D
XVIDEOATTRIBUTE        \0808  000C3830-R     WK-MAIN\2812\1919   SEARCH\5C0D
X        \0808\1010\2020\400BSELECT\510D
XVIDEO_ALLOC        \0808     00015140-R\1F08DISPLAY\2E0C
XVIEWFILE        \0808\100800018B78-R\2208\2E19EXTERNS\4A0C
XVILEINIT_BUFNAME        \0808000333F0-R\1A08MAIN\260F
XVILE_CLOSEDIR        \0808   00023800-\1D09VMS2UNIX\2D11FILEC\4313 GLOB\5B0F
XVILE_FILTER        \0808     00022120-\1F09SPAWN\2C14EXTERNS\470C
XVILE_OP        \0808\10090001F278-R\2308OPERS\3014SELECT\4A0D
XVILE_OPENDIR        \0808    00023830-\1E09VMS2UNIX\2E11FILEC\4414GLOB\5C0F
XVILE_READDIR        \0808    00023C70-\1E09VMS2UNIX\2E11FILEC\4414GLOB\5C0F
XVILE_REFRESH        \0808    00024578-R\1E08WINDOW\2C13EXTERNS\460C
XVILE_TEMPNAM        \0808    00023C00-R\1E08VMS2UNIX\2E0B
XVISUAL        \0808\100A00010B20-R\2408MAIN\3015EXTERNS\4C0C
XVMS2UNIX_PATH        \0808   00023900-R\1D08\3208\2D11FILEC\4313 \5B13
XVMS_DIR2PATH        \0808    00023A80-R\1E08VMS2UNIX\2E11FILEC\440E
XVMS_PATH2DIR        \0808    00023A38-\1E09VMS2UNIX\2E0B
XVMS_PATHLEAF        \0808    0001FA10-R\1E08PATH\2A14 BIND\1915FILEC\5D0E
X        \0808\1010\2020\400BVMS2UNIX\530B
XVMS_RPIPE        \0808\100700023DA0-R\2108VMS\3016FILEIO\480D
XVMS_SYSTEM        \0808\100600022090-R\2008SPAWN\2D0E
XVSCREEN        \0808\1009000C3840-R     WK-DISPLAY\320F\1916
XVTCOL        \0808\100B000C3850-R     WK-MAIN\3115DISPLAY\4D0F\3216
XVTINIT        \0808\100A00015A40-R\2408DISPLAY\3312MAIN\490F
XVTROW        \0808\100B000C3860-R     WK-MAIN\3115DISPLAY\4D0F\3216
XWARNINGS        \0808\1008000C3870-R     WK-MAIN\2E15BIND\4712\3216
X        \0808\1010\2020\400BMSGS\4F0F
XWHEADP        \0808\100A000C3880-R     WK-MAIN\3015BUFFE\2706\500EDISPLAY\650C
V
X        \0808\1010\2020\400BEXEC\4F15FILE\680F
X        \0808\1010\2020\400BFINDERR\5212HISTORY\6B0C
X        \0808\1010\2020\400BLINE\4F12WK-MAIN\680F
X        \0808\1010\2020\400BMODES\5014ONELINER\6C0B
X        \0808\1010\2020\400BSELECT\5113UNDO\680F
X        \0808\1010\2020\400BWINDOW\5113X11\6710
XWINIT        \0808\100B00023F70-R\2508WINDOW\3313MAIN\4A0F
XWKILLC        \0808\100A00041C30-R\2408MAIN\3015BIND\4915INPUT\630E
X        \0808\1010\2020\400BINSERT\510D
XWMINIP        \0808\100A000C3890-R     WK-MAIN\3015BIND\4915DISPLAY\650C
X        \0808\1010\2020\400BHISTORY\5212INPUT\690E
X        \0808\1010\2020\4008WK-MAIN\1C16INDOW\6A0D
XWORDCOUNT        \0808\100700024630-R\2108WORD\2D15EXTERNS\490C
XWPOPUP        \0808\100A000242D0-R\2408WINDOW\3213BUFFE\2709    `20
XWRAPWORD        \0808\100800024590-R\2208\2E19EXTERNS\4A12INSERT\620D
XWRITEALL        \0808\100800014310-R\2208BUFFE\0E09\380BMAIN\4715SPAW\1A0F
XWRITEALLCHANGED        \0808 00014388-R\1B08BUFFE\0E09\310BEXTERNS\430C
XWRITEHOOK        \0808\1007000C38A0-R     WK-MAIN\2D15EVAL\4615FILE\5F0F
X        \0808\1010\2020\4008WK-MAIN\4F0F
XWRITEMSG        \0808\100800020168-R\2208RANDOM\3013EXTERNS\4A0C
XWRITEOUT        \0808\100800018488-R\2208FILE\2E15SPAWN\480E
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   67
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XWRITEQUIT        \0808\100700010D10-R\2108MAIN\2D15EXTERNS\490C
XWRITEREGION        \0808     00018718-R\1F08FILE\2B15OPERS\450E
XW_VALNAMES        \0808\100600033400-R\2008MAIN\2C15MOD\4610
XXBELL        \0808\100B000017F0-RX\2607DECW$XLIBSHR\390DX11\4910
XXCHECKTYPEDEVENT        \080800001900-RX\1B07DECW$XLIBSHR\2E0DX11\3E10
XXCLEARAREA        \0808\100600001960-RX\2107DECW$XLIBSHR\340DX11\4410
XXCLEARWINDOW        \0808    00001970-RX\1F07DECW$XLIBSHR\320DX11\4210
XXCOPYAREA        \0808\1007000019D0-RX\2207DECW$XLIBSHR\350DX11\4510
XXCREATEGC        \0808\100700001A40-RX\2207DECW$XLIBSHR\350DX11\4510
XXDEFINECURSOR        \0808   00001B70-RX\1E07DECW$XLIBSH\310EX11\4110
XXDRAWIMAGESTRING        \080800001CD0-RX\1B07DECW$XLIBSHR\2E0DX11\3E10
XXDRAWLINE        \0808\100700001CF0-RX\2207DECW$XLIBSHR\350DX11\4510
XXDRAWRECTANGLE        \0808  00001D30-RX\1D07DECW$XLIBSHR\300DX11\4010
XXDRAWSTRING        \0808     00001D60-RX\2007DECW$XLIBSHR\330DX11\4310
XXFILLRECTANGLE        \0808  00001EF0-RX\1D07DECW$XLIBSHR\300DX11\4010
XXFLUSH        \0808\100A00001F20-RX\2507DECW$XLIBSHR\380DX11\4810
XXFREE        \0808\100B00001F40-RX\2607DECW$XLIBSHR\390DX11\4910
XXFREEFONT        \0808\100700001F90-RX\2207DECW$XLIBSHR\350DX11\4510
XXGETATOMNAME        \0808    00002020-RX\1F07DECW$XLIBSHR\320DX11\4210
XXGETFONTPROPERTY        \080800002080-RX\1B07DECW$XLIBSHR\2E0DX11\3E10
XXGRABSERVER        \0808     00002250-RX\2007DECW$XLIBSH\330EX11\4310
XXINTERNATOM        \0808     000022D0-RX\2007DECW$XLIBSHR\330DX11\4310
XXLOADQUERYFONT        \0808  000023A0-RX\1D07DECW$XLIBSHR\300DX11\4010
XXLOOKUPSTRING        \0808   000023D0-RX\1E07DECW$XLIBSHR\310DX11\4110
XXMCASCADEBUTTONWIDGETCLASS      000043B0-RX\1106 DECW$XMLIBSHR12\1607   MENU
V\0E0A    `20
XXMCREATEMENUBAR        \0808 000020B0-RX\1C07DECW$XMLIBSHR12\320AX11\3F10
XXMCREATEPULLDOWNMENU            000020E0-RX\1707DECW$XMLIBSHR12\2D0A\3B10  `20
XXMFORMWIDGETCLASS        \080700004590-RX\1A07DECW$XMLIBSHR12\300AX11\3D0F`20
XXMPANEDWINDOWWIDGETCLASS        000046E0-RX\1307DECW$XMLIBSHR12\2908  X11\0D0A
V\4006
XXMPRIMITIVEWIDGETCLASS          00004700-RX\1507DECW$XMLIBSHR12\2B0AX11\380A
V\4206
XXMPROCESSTRAVERSAL        \080600003330-RX\1907DECW$XMLIBSHR12\2F0AX11\3C0E `20
V
XXMPUSHBUTTONGADGETCLASS         00004720-RX\1407DECW$XMLIBSHR12\2A09 MENU\0E0A
V    `20
XXMQMOTIF        \0808\1008000049F0-RX\2307DECW$XMLIBSHR12\390AX11\4610
XXMSCROLLBARWIDGETCLASS          00004800-RX\1507DECW$XMLIBSHR12\2B0AX11\380A
V\4206
XXMSEPARATORGADGETCLASS          00004860-RX\1507DECW$XMLIBSHR12\2B0AMENU\390A
V    `20
XXMSTRINGCREATESIMPLE            00003D70-RX\1707DECW$XMLIBSHR12\2D0AMENU\3B0C
V  `20
XXMSTRINGFREE        \0808    00003DE0-RX\1F07DECW$XMLIBSHR12\350AMENU\430F
XXMSTRINGGETLTOR        \0808 00003E00-RX\1C07DECW$XMLIBSHR12\320AMENU\400F
XXMUPDATEDISPLAY        \0808 00001110-RX\1C07DECW$XMLIBSHR12\320AMENU\400F
XXNEXTEVENT        \0808\100600002490-RX\2107DECW$XLIBSHR\340DX11\4410
XXPARSEGEOMETRY        \0808  000024E0-RX\1D07DECW$XLIBSHR\300DX11\4010
XXPEEKEVENT        \0808\1006000024F0-RX\2107DECW$XLIBSHR\340DX11\4410
XXPENDING        \0808\100800002510-RX\2307DECW$XLIBSHR\360DX11\4610
XXQUERYCOLORS        \0808    00002610-RX\1F07DECW$XLIBSHR\320DX11\4210
XXRECOLORCURSOR        \0808  000026C0-RX\1D07DECW$XLIBSH\300EX11\4010
XXRESIZEWINDOW        \0808   00002740-RX\1E07DECW$XLIBSHR\310DX11\4110
XXSETBACKGROUND        \0808  00002980-RX\1D07DECW$XLIBSHR\300DX11\4010
XXSETFONT        \0808\100800002A30-RX\2307DECW$XLIBSHR\360DX11\4610
XXSETFOREGROUND        \0808  00002A50-RX\1D07DECW$XLIBSHR\300DX11\4010
XXSETFUNCTION        \0808    00002A60-RX\1F07DECW$XLIBSHR\320DX11\4210
XXSETGRAPHICSEXPOSURES           00002A70-RX\1607DECW$XLIBSHR\290B  X11\100D`20
V `20
XXSETWMICONNAME        \0808  00003540-RX\1D07DECW$XLIBSHR\300DX11\4010
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   68
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XXSETWMNAME        \0808\100600003550-RX\2107DECW$XLIBSHR\340DX11\4410
XXSETWMPROTOCOLS        \0808 00003580-RX\1C07DECW$XLIBSHR\2F0DX11\3F10
XXSYNC        \0808\100B00002CF0-RX\2607DECW$XLIBSHR\390DX11\4910
XXTADDCALLBACK        \0808   000000B0-RX\1E07DECW$XTLIBSHRR5\340AMENU\4213  X1
V1\5A10
XXTADDEVENTHANDLER        \080700000820-RX\1A07DECW$XTLIBSHRR5\300AMENU\3E0F
V\4D06X11\1810
XXTAPPADDACTIONS        \0808 00001570-RX\1C07DECW$XTLIBSHRR5\320AX11\3F10
XXTAPPADDINPUT        \0808   00001130-RX\1E07DECW$XTLIBSHRR5\340AX11\4110
XXTAPPADDTIMEOUT        \0808 00001140-RX\1C07DECW$XTLIBSHRR5\320AX11\3F10
XXTAPPNEXTEVENT        \0808  00001160-RX\1D07DECW$XTLIBSHRR5\330AX11\4010
XXTAPPPENDING        \0808    00001180-RX\1F07DECW$XTLIBSHRR5\350AX11\4210
XXTAPPPROCESSEVENT        \080700001190-RX\1A07DECW$XTLIBSHRR5\300AX11\3D0F`20
XXTDESTROYWIDGET        \0808 00000560-RX\1C07DECW$XTLIBSHRR5\320AMENU\4011 `20
V  X11\5810
XXTDISPATCHEVENT        \0808 00000880-RX\1C07DECW$XTLIBSHRR5\320AX11\3F10
XXTFREE        \0808\100A00000030-RX\2507DECW$XTLIBSHRR5\3B0AX11\4810
XXTGETAPPLICATIONRESOURCES       00001360-RX\1207DECW$XTLIBSHRR5\2807   X11
V\0D0A\3F06
XXTGETSELECTIONVALUE             00001470-RX\1807DECW$XTLIBSHRR5\2E0AX11\3B0D
V  `20
XXTGETSUBRESOURCES        \080700001370-RX\1A07DECW$XTLIBSHRR5\300AX11\3D0F`20
XXTLASTTIMESTAMPPROCESSED        000008B0-RX\1307DECW$XTLIBSHRR5\2908  X11\0D0A
V\4006
XXTMALLOC        \0808\100800000040-RX\2307DECW$XTLIBSHRR5\390AX11\4610
XXTMANAGECHILD        \0808   000010B0-RX\1E07DECW$XTLIBSHRR5\340AX11\4110
XXTMANAGECHILDREN        \0808000010C0-RX\1B07DECW$XTLIBSHRR5\310AX11\3E10
XXTOWNSELECTION        \0808  000014B0-RX\1D07DECW$XTLIBSHRR5\330AX11\4010
XXTPARSETRANSLATIONTABLE         00001720-RX\1407DECW$XTLIBSHRR5\2A09 X11\0D0A
V\4106
XXTREALIZEWIDGET        \0808 00000FD0-RX\1C07DECW$XTLIBSHRR5\320AX11\3F10
XXTREMOVECALLBACK        \080800000110-RX\1B07DECW$XTLIBSHRR5\310AMENU\3F0F
XXTREMOVEEVENTHANDLER            000008E0-RX\1707DECW$XTLIBSHRR5\2D0AX11\3A0C
V   `20
XXTREMOVEINPUT        \0808   000011E0-RX\1E07DECW$XTLIBSHRR5\340AX11\4110
XXTREMOVETIMEOUT        \0808 000011F0-RX\1C07DECW$XTLIBSHRR5\320AX11\3F10
XXTSETERRORHANDLER        \080700000760-RX\1A07DECW$XTLIBSHRR5\300AX11\3D0F`20
XXTSHELLSTRINGS        \0808  00002FA0-RX\1D07DECW$XTLIBSHRR5\330AX11\4010
XXTSTRINGS        \0808\100700002F90-RX\2207DECW$XTLIBSHRR5\380AX11\4510
XXTUNMANAGECHILDREN        \0806000010F0-RX\1907DECW$XTLIBSHRR5\2F0AX11\3C0E `20
V
XXTVAAPPINITIALIZE        \0807000019B0-RX\1A07DECW$XTLIBSHRR5\300AX11\3D0F`20
XXTVACREATEMANAGEDWIDGET         000019C0-RX\1407DECW$XTLIBSHRR5\2A09 MENU\0E0A
V\180A X11\1810
XXTVACREATEWIDGET        \0808000019E0-RX\1B07DECW$XTLIBSHRR5\310AX11\3E10
XXTVAGETVALUES        \0808   00001A50-RX\1E07DECW$XTLIBSHRR5\340AMENU\4213  X1
V1\5A10
XXTVASETVALUES        \0808   00001A00-RX\1E07DECW$XTLIBSHRR5\340AMENU\4213  X1
V1\5A10
XXUNGRABSERVER        \0808   00002DB0-RX\1E07DECW$XLIBSH\310EX11\4110
XX_CURRENT_FONTNAME        \080600011CE0-R\1808X11\230E\3108EVAL\1A0F
XX_GET_ICON_NAME        \0808 00011000-R\1B08X11\2611     EVAL\400F
XX_GET_WINDOW_NAME        \080700010F98-R\1908X11\240F\3307EVAL\3E0F
XX_ICON_NAME        \0808     000C38C0-R     WK-X11\2A13\1916
XX_MENU_HEIGHT        \0808   00011CD0-R\1D08X11\2810
XX_MOVE_EVENTS        \0808   00011420-R\1D08X11\2810
XX_PREPARSE_ARGS        \0808 00012150-R\1B08X11\2611     MAIN\400F
XX_RESIZE        \0808\100800011510-R\2208X11\2D16EVAL\470F
XX_SETFONT        \0808\100700011C90-R\2108X11\2C16EVAL\460F
XX_SET_ICON_NAME        \0808 00011018-R\1B08X11\2611     EVAL\400F
XX_SET_WINDOW_NAME        \080700010FB0-R\1908X11\240F\3307EVAL\3E0F
XX_TYPAHEAD        \0808\100600011190-R\2008X11\2B16RANDOM\4713TERMIO\600D
XX_WINDOW_NAME        \0808   000C39C0-R     WK-X11\2813\1916
XYANKLINE        \0808\100800020238-R\2208RANDOM\3013EXTERNS\4A0C
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   69
X
X
XSymbol        \0808\100AValue\1F0BDefined By\340EReferenc\1B06...
X------        \0808\100A\1F10\3006\3412\180A\2207
XYANKREGION        \0808\100600021070-R\2008\2E19OPERS\4614SELECT\600D
XZOTBUF        \0808\100A000142C8-R\2408BUFFE\0E09\3A0BBIND\4915EXEC\620F
X        \0808\1010\2020\400BHISTORY\5212MAIN\680F
X        \0808\1010\2020\400BMSGS\4F15RANDOM\6A0D
XZOTWP        \0808\100B00014738-R\2508BUFFE\0E09\3B0BBIND\4A15MAIN\630F
XZZQUIT        \0808\100A00010D90-R\2408MAIN\3015EXTERNS\4C0C
X_CHARTYPES_        \0808     000C3AC0-R     WK-MAIN\2B15BASIC\1915IND\5D0F
X        \0808\1010\2020\400BBUFFER\5113DISPLAY\6B0C
X        \0808\1010\2020\400BDUMBTERM\5311EVAL\680F
X        \0808\1010\2020\400BEXEC\4F15FILE\680F
X        \0808\1010\2020\400BFILEC\5014HISTORY\6B0C
X        \0808\1010\2020\400BINPUT\1916SER\1A0E
X        \0808\1010\2020\400BISEARCH\5212LINE\680F
X        \0808\1010\2020\4008WK-MAIN\4F15MAP\6710
X        \0808\1010\2020\400BMENU\1916ODES\690E
X        \0808\1010\2020\400BONELINER\5311PATH\680F
X        \0808\1010\2020\400BREGEXP\1916ION\6A0D
X        \0808\1010\2020\400BSEARCH\1915LECT\6A0D
X        \0808\1010\2020\400BTAGS\4F15VMS2UNIX\6C0B
X        \0808\1010\2020\400BWORD\1919MOV\6B0C
X        \0808\1010\2020\400BX11\4E10
X_PIPES        \0808\100A000C3EC0-R     WK-VMSPIPE\330F\1916
X_XMGETCLASSEXTENSIONPTR         00000080-RX\1407DECW$XMLIBSHR12\2A09 X11\0D0A
V\4106
X_XMSTRINGS        \0808\1006000049C0-RX\2107DECW$XMLIBSHR12\370AMENU\4515X11
V\5D10
X_XM_FASTPTR        \0808     00004E80-RX\2007DECW$XMLIBSHR12\360AX11\4310
X__MAIN        \0808\100A000108D8-R\2408\3013
X
X
X
X`09  Key for special characters above:
X`09`09+--------\0808----+
X`09`09! *  - Undefined     !
X`09`09! A  - Alias Name    !
X`09`09! I  - Internal Name !
X`09`09! U  - Universal     !
X`09`09! R  - Relocatable   !
X`09`09! X  - External      !
X`09`09! WK - Weak          !
X`09`09+--------\0808----+
X`0C
XDISK$COMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.EXE;1        \080811-SEP-1998 1
V7:36\2108Linker A11-20\3610    Page   70
X
X        \0808\1010\2011+--------\0808+
X        \0808\1010\2011! Image Synopsis !
X        \0808\1010\2011+--------\0808+
X
XVirtual memory allocated:        \0808\100900010000 000DFFFF 000D0000 (851968.
V bytes, 1664. pages)
XStack size:        \0808\1010\200D20. pages
XImage header virtual block limits:        \0808\10071.\19083. (\0807blocks)
XImage binary virtual block limits:        \0808\10074.     1116. ( 1113. block
Vs)
XImage name and identification:        \0808    XVILE VILE 8.0
XNumber of files:        \0808\1010\200860.
XNumber of modules:        \0808\1010\200658.
XNumber of program sections:        \0808\100C534.
XNumber of global symbols:        \0808\100D6075.
XIncluding undefined count of:        \0808\100C2.
XNumber of cross references:        \0808\100B4476.
XNumber of image sections:        \0808\100F53.
XUser transfer address:        \0808\100C000108D8
XDebugger transfer address:        \0808\100800000340
XNumber of code references to shareable images:         186.
XImage type:        \0808\1010\2007EXECUTABLE.
XMap format:        \0808\1010\2007DEFAULT WITH CROSS REFERENCE in file DISK$CO
VMPCENT:`5BUDAA055.TEMP.VILE-8_0`5DXVILE.MA
XEstimated map length:        \0808\100D1157. blocks
X        \0808\1010\200E+--------\0808-----+
X        \0808\1010\200E! Link Run Statistics !
X        \0808\1010\200E+--------\0808-----+
X
XPerformance Indicators        \0808\100CPage Faults`09CPU Time`09Elapsed Time
V
X--------\0808\1006        \0808\100C\320B`09\0909\470C
X    Command processing:        \0808\1010    80`0900:00:00.26\0C0A77
X    Pass 1:        \0808\1010\200F224`0900:00:01.\0C0A5.89
X    Allocation/Re\0B08:        \0808\1010  9`0900:00:00.03\0C0A13
X    Pass 2:        \0808\1010\200F155`0900:00:01.23\0C085.81
X    Map data after object module synopsis:        \0808 24`0900:00:00.37\0C081
V.38
X    Symbol table output:        \0808\1010    6`0900:00:00.00\0C0B3
XTotal run values:        \0808\1010\2009498`0900:00:03.13\0C0714.04
X
XUsing a working set limited to 8704 pages and 6753\0F07of data storage (exclud
Ving image)
X
XTotal number object records read (both passes):   12793
X    of which 0 were in libraries and 5006\1B06DEBUG data records containing 46
V3270 bytes
X246414 bytes of DEBUG data were written,starting at VBN 1117 with 482 blocks a
Vllocated
X
XNumber of modules extracted explicitly             = 0
X    with 0 extracted to resolve undefined symbols
X
X15 library searches were for symbols not in the\2D10d
X
XA total of 0 global symbol table records was written
X
XLINK/MAP=XVILE/CROSS_REFERENCE/EXEC\1B06.EXE MAIN.OBJ,X11.OBJ,VMS_LINK/OPT
$ call unpack [.VILE-8_0]XVILE.MAP;2 2018586105 "" 777 136 152
$!
$ create 'f'
XREADME.CFG
X----------
X
XThis file describes the steps which are needed to configure and make either
Xvile or xvile.  See the file README for a blurb on what (x)vile is and how
Xgreat it is :-).  The file INSTALL contains generic information on the
Xprocess of configuring and building programs which (more or less) conform
Xto the GNU coding standards.  You might want to consult that document for
Xmore information.
X
X
XBuilding vile
X-------------
X
XTo build vile, enter the following command from your shell:
X
X`09./configure; make
X
XIf you'd like to examine makefile and config.h prior to making, split these
Xsteps up as follows:
X
X`09./configure
X`09make
X
XIf you are unfortunate enough to be running on a platform in which some
Xpart of the above process does not work perfectly, you might well want to
Xmodify makefile to add references to obscure libraries or non-standard
Xlibrary locations.
X
X    `5B At least one version of bash running on Linux (and perhaps other)
X    systems will cause the configure script to produce invalid results.`20
X    Specifically, if you're running version 1.14.3 of bash consider
X    upgrading to a newer one.  `5D
X
XModifying makefile is not recommended because your changes will be lost
Xshould you run configure again.  Many\1709ation options can be
Xset externally to the configure script or the makefile.  For instance,
Xif you'd like to change some of the flags passed to the C compiler, try
Xdoing it like this:
X
X`09make CFLAGS=-O2
X
XOr, this can be done when running the configure script instead -- try:
X`09CFLAGS=-O2 ./configure`09`09`09(sh, ksh, bash)
Xor:
X`09(setenv CFLAGS -O2 ; ./configure)`09(csh)
X
XIf you need to suppress your optimizer (which is invoked as -O by default),
Xbecause it's known to be buggy, use CFLAGS=" ".  `5B One combination
Xthought to be buggy is AIX 3.2.5 with gcc 2.6.0.  `5D
X
XThe configure script will favor using gcc on your system if available.  This
Xis usually fine, but if gcc was not installed correctly (or your environment
Xisn't quite right), it can be disastrous.  You can override the choice
Xof compiler with:
X`09CC=cc ./configure`09`09(sh, ksh, bash)
Xor:
X`09(setenv CC cc ; ./configure)`09(csh)
X
XLikewise, extra link libraries can be added by setting them in LIBS before
Xrunning configure.
X
X
XScreen Types
X------------
X
XVile is configured and built with a terminal driver.  At this time, only
Xone driver is built with vile at a time.  Some other editors attempt to
Xcombine more than one driver in the default configuration, making the
Xresulting program much larger and slower.  We will ultimately modify vile
Xto support multiple drivers, but the default configuration will be the
Xsmallest and fastest.
X
XUse the configure script's "--with-screen" option to specify the driver
Xtype, e.g.,
X
X`09./configure --with-screen=tcap
X
XThe default configuration for vile uses termcap (or terminfo, depending
Xwhat your system has available).  The configuration script tests several
Xpossibilities.  Your system may have more than one library to link against,
Xe.g., on Linux you may have both termcap and ncurses (a terminfo-based
Xsystem).  If you wish to use color, you are generally better off using
Xterminfo, since termcap descriptions usually are limited to a fixed size,
Xand some features are omitted.  To tell the configure script to link
Xagainst the ncurses library (but still using the basic termcap/terminfo
Xdriver), type
X
X`09./configure --with-screen=ncurses
X
XA much less capable driver uses builtin ANSI escape sequences:
X
X`09./configure --with-screen=ansi
X
X
XBuilding xvile
X--------\0806
X
XYou must decide which version of xvile you want to build.  To a certain
Xdegree this decision may be forced upon you by which libraries you have
Xon your machine.  There are three different versions you can build.
X
X1) X toolkit version: This\0E08 uses only the\2E0Bto implement
Xscrollbars and the window resize grips (meaning _vile_\2407s, not X
Xwindows).  As a consequence, it should only require the X toolkit library
X(-lXt) and the Xlib library (-lX11).  (Don't worry if you don't know what
Xthese are or where \1309; the configuration script will probably be
Xable to find them.)  The scrollbars in this version look much like those
Xfound in a standard xterm.  We recommend that you try this version out
Xfirst as it is superior in some respects to the other versions which use
Xfancy widget sets.  To configure this version, enter the following command:
X
X`09./configure --with-screen=x11
X
XA minor variation using the Athena widgets supports menus:
X
X`09./configure --with-screen=Xaw
X
XTwo other variations on the Athena widgets are provided:
X
X`09./configure --with-Xaw3d
X
Xto link with Xaw 3d library
X
X`09./configure --with-neXtaw
X
Xto link with neXT Athena library.  There's little functional difference
Xbetween the three versions of Athena libraries, they provide different
Xappearance.  You can also configure with the corresponding scrollbars from
Xthe Athena library (though we are not as satisfied with their performance,
Xparticularly with resizing):
X
X`09./configure --with-Xaw-scrollbars
X
Xto use Xaw scrollbars rather than our own (applies to all variations of
XAthena library).  You can also use Kevin's dragging/scrolling logic with
Xthe Athena library:
X
X`09./configure --with-drag-extension
X
X2) Motif version:  This\0F08 uses the\2607widget set to implement
Xthe scrollbars and (vile) window resize pane.  To configure the Motif
Xversion, enter one of the following commands (several variations are
Xrecognized for each screen value to simplify integration with other
Xscripts):
X
X`09./configure --with-screen=motif
X`09./configure --with-screen=Xm
X
X3) OpenLook version:  Uses the\1C0Awidgets to implement scrollbars. Since
XOpenLook lacks a pane widget, resizing (vile) windows is pretty cheesy.  Still
V,
Xif you are running olwm or olvwm, you might well want to run this version
Xso that xvile will look the same as your other applications.
X
X`09./configure --with-screen=openlook
X`09./configure --with-screen=Xol
X
XAfter configuration, you may look at the makefile o\2F08.h if you wish. You
Xcan finish making xvile by entering the following command:
X
X`09make
X
XOn some systems it seems to be sometimes necessary (?) to have X_LIBS set
Xto -static prior running configure, i.e, use either:
X
X`09X_LIBS=-static ./configure --with-screen=openlook
X
Xfor sh, ksh, and bash.  Or:
X
X`09(setenv X_LIBS -static ; ./configure --with-screen=openlook)
X
Xfor csh and tcsh.
X
X
XInstalling (x)vile
X--------\0808--
X
XInstallation of (x)vile is simple.  Obtain the appropriate privileges (become
V
Xsuperuser if you have to), and enter the following command:
X
X`09make install
X
XIf you have ever installed an older version of vile, you should probably
Xcheck to be sure the old help files are gone.  They used to go to a
Xdifferent place (by default) than they do now.  It can be most confusing
Xto use an older version of the help file with a new\2611
Xprogram, and unfortunately, older help files didn't have version numbers.
X
XWe realize that not everyone has superuser privileges on the machines on
Xwhich they wish to build (x)vile.  By default, the executables will be
Xinstalled in /usr/local/bin.  vile.hlp will be in\2F16lib.`20
Xvile.1 (the manual page) will be installed in /usr/local/man/man1.  If you
Xlack superuser access or write\1008to /usr/local, you will want to
Xchange the installation location.  You may do so by using the --prefix
Xoption to "configure".  Suppose you wish to have xvile installed in
X$HOME/bin (your home bin directory).  You would issue the following
Xconfiguration command:
X
X`09./configure --with-screen=x11 --prefix=$HOME
X
+-+-+-+-+-+-+-+-  END  OF PART 142 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 143 -+-+-+-+-+-+-+-+
XThe file INSTALL has more information on install\1006and on the --prefix
Xoption to "configure".  (If you don't feel like rebuilding (likely), you
Xcan also edit the makefile and change the "prefix", "bindir", or "libdir"
Xdefinitions -- remember that your changes will be lost next time you run
Xconfigure.
X
X
XBuilding in a separate directory
X--------\0808\1010
X
XIf you are building (x)vile for several machines or want to perhaps
Xsimultaneously build and try out the various versions of xvile, you will
Xprobably want to configure (x)vile to build in a directory different from
Xwhere the source resides.  This requires that you have make program which
Xcorrectly uses the VPATH variable.  GNU make does this well, others may
Xor may not.
X
XSuppose that the source resides in vile-src.  A\2407ame level as
Xvile-src, you might perhaps create a directory called vile-x11-sunos to
Xindicate that you are building xvile on a platform running sunos.  You
Xwould then cd into this directory and issue the following configuration
Xcommand:
X
X`09../vile-src/configure --with-screen=x11
X
XAnother directory at the same level as vile-src might be named\1807unos
Xto indicate that you are building vile on a platform running sunos. After
Xyou cd into this directory, you'd then issue the following command to
Xconfigure ordinary vile.
X
X`09../vile-src/configure
X
XThe "make" step in each case is the same as described above; you simply
Xissue the command:
X
X`09make
X
Xto finish making (x)vile.
X
XThis process is described in more formally in the INSTALL document.  As
Xdescribed there, you will need to use a version of "make" which supports
Xthe VPATH variable.  And it must support it _correctly_.  Again, GNU make
Xdoes this.  A lot of older "make"s don't.
X
X
XOther Compile-Time Options
X--------\0808\100A
X
XAside from the screen type, most functionality in vile is controlled by the
X"OPT_" #ifdef's in the estruct.h file.  Some of the more useful ones (or
Xthose that require manipulating the makefile) are also provided as configure
Xoptions:
X
X  --with-exec-macros=N    specify count of numbered \2606
X  --with-perl             enable use of Perl as an extension language
X
X
XTesting/Development Options
X--------\0808\100B
X
XSeveral other options appear in the configure script's "--help" message.
XThey are used to support testing and development, by building various
Xdebug versions of vile.  These include:
X
X  --disable-echo          test: display "compiling" commands (default: on)
X  --disable-extensions    test: build only core functions (default: on)
X  --disable-shell         test: \1C07 shell/external commands (default: on)
X  --with-dbmalloc         test: use Conor Cahill's \2A09library
X  --with-dmalloc          test: use Gray Watson's \2908library
X  --with-no-leaks         test: free permanent memory, analyze leaks
X  --with-trace            test: turn on debug-tracing
X  --with-warnings         test: turn on GCC compiler \2C08
X
XThe dbmalloc and d\0C07libraries are similar, checking for memory leaks
Xand related malloc/free problems.  Both have limitations, so we use both,
Xas well as other tools such as Purify and ElectricFence, according to the
Xproblem.
X
XThe --with-no-leaks option compiles in code that frees all of the
Xpermanently allocated memory on exit.  This greatly simplifies the task of
Xanalyzing memory leaks.
X
XThe --with-trace option turns on debug traces that go to the Trace.out
Xfile.  Since vile is a fullscreen program, it is not useful to write
Xmessages to the screen.  (The OPT_RAMSIZE option is an exception; you may
Xbe amused by it).
X
XThe --with-warnings option applies mostly to compiles with GCC, since it is
Xavailable across several platforms.  We build with all \370Acompilers, but
Xtheir warnings options are not consistent.
X
X`09`5B However, --with-warnings also turns on checks for missing prototypes,
X`09assuming that an ANSI or Posix prototype is better than none (e.g., for
X`09SunOS 4.x).  However, this may result in a config.h too long for your
X`09sed program to handle.  GNU sed works properly.  An alternative is the
X`09td_config utility bundled with Tom's directory editor. `5D
X
XBecause the echoed commands in the makefile are long, the
X--disable-echo option is provided to shorten the commands, making it easy to
Xsee the warnings.
X
XThe --disable-extensions and\190Bshell opt\1C06re for testing.`20
XDisabling extensions produces a smaller program, essentially the core of
Xvile (no macros), which is a workable editor.  You may wish to build vile
Xwithout shell support, but perhaps not (ymmv).
X
X
X--------\0808\1008
X$Header: /usr/build/vile/vile/doc/RCS/config.doc,v 1.1 1997/12/17 11:16:54 tom
V Exp $
X--------\0808\1008
$ call unpack [.VILE-8_0.DOC]CONFIG.DOC;1 -
 306466518 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 26 137 152
$!
$ create 'f'
X
X
XProgrammed Macros in vile
X========\0808\100A
X
X`09`5B The following documentation is copied almost verbatim from
X`09chapter 13 of "MicroEMACS Full Screen Text Editor Reference Manual,
X`09Version 3.10 March 19, 1989" The copyright for that document is
X`09"(C)opyright 1988, 1989 by Brian Straight and Daniel M. Lawrence".`20
X`09I have done a global substitute of "vile" for "MicroEMACS", and
X`09adjusted the document in various other small ways to make it match
X`09vile's current functionality.  (Paul Fox, 4/94) `5D
X
X`09`5B Some more examples of vile macros can be found in the file
X`09vile.hlp.  `5D
X
X`09Macros are programs that are used to customize the editor and to
X`09perform complicated editing tasks.  They may be stored in files or
X`09buffers and may be executed using an appropriate command, or bound
X`09to a particular keystroke.  The execute-macro-<n> commands cause
X`09the macro, numbered from 1 to 40, to be executed.  The \0F07-file
X`09command allows you to execute a macro stored in a disk file, and
X`09the execute-buffer command allows you to\2508 a macro stored in
X`09a buffer.  Macros are stored for easy execution b\0D09ng files
X`09that contain the store-macro command.
X
X`09If you need more than 40 macros, named m\0E07called procedures,
X`09can be used.  The store-procedure command takes a string argument
X`09which is the name of a procedure to store.  These \1B09s then
X`09can be executed with the run command.  Also, giving the name of a
X`09stored procedure within another macro will execute that named
X`09procedure as if it had been called up with the run command.
X
X`09There are many different aspects to this macro language.  Editor
X`09commands are the various \1909that manipulate text, buffers,
X`09windows, et cetera, within the editor.  Directives are commands
X`09which control what lines get executed within a macro.  Also there
X`09are various types of variables.  Environmental\1A0A both
X`09control and report on different aspects of the editor.  User
X`09variables hold string values which may be changed and inspected.`20
X`09Buffer variables allow text to be placed into \2709.`20
X`09Interactive variable allow the program to prompt the user for
X`09information.  Functions can be used to manipulate all these
X`09variables.
X
X
X
XComments
X--------
X`09Any line beginning with a semi-colon (;) or double-quote (")
X`09character is ignored.  The semi-colon is inherited from MicroEMACS,
X`09the double-quote is for vi compatibility.
X
XConstants
X---------
X`09All constants and variable contents are stored as strings of
X`09characters.  Numbers are stored digit by\0907as \320DThis
X`09allows the variables to be "typeless", not having different
X`09variables types be legal in different contexts.  This has the
X`09disadvantage of forcing the user to be more careful about the
X`09context of the statements variables are placed in, but in turn
X`09gives them more flexibility in where they can place variables.`20
X`09Needless to say, this also allows the expression evaluator to be
X`09both concise and quick.
X
X`09Wherever statements need to have arguments, it is legal to place
X`09constants.  A \0E08 is a double quote character, followed by a
X`09string of characters, and terminated by another double quote
X`09character.  To represent various special \2909s within a
X`09constant, the backslash (`5C) character is used.  The \1809
X`09following the backslash is interpreted according to the \3809
X`09table:
X
X`09Sequence        Result
X`09`5Cn        \0806`5EJ\1006newline character
X`09`5Cr        \0806`5EM\1006carriage return
X`09`5C`5C        \0806\0F08backslash
X`09`5Cb        \0806`5EH\1006backspace
X`09`5Cf        \0806`5EL\1006formfeed
X`09`5Ct        \0806`5EI\1006tab
X`09`5Ca        \0806`5EG\1006bell
X`09`5Cs        \0808\1006space
X`09`5C"        \0806\0F08quote
X`09`5CxNN`09`090xNN`09the character in hex
X`09`5CNNN`09`09NNN`09the character in octal
X
X`09Any character not in the table which follows a backslash will be
X`09passed unmodified.  This action is similar to the `5EV
X`09quote-character command available from the keyboard.
X
X`09The double quotes around constants are not needed if the \2008
X`09contains no internal white space and it also does not happen to
X`09meet the rules for any other commands, directives, variables, or
X`09functions.  This is reasonably useful for numeric constants.
X
X
XVariables
X---------
X`09Variables can be used to return values within expressions, as
X`09repeat counts to editing commands, or as text to be inserted into
X`09buffers and messages.  The value of these variables is set using
X`09the set-variable command.  The shorter form, "setv", may also
X`09always be used.  For example, to set the current column position to
X`0964, the following macro line would be used:
X
X`09`09set-variable curcol 64
X
X`09or to have the contents of %name inserted at the point in the
X`09current buffer, the command to use would be:
X
X`09`09insert-string %name
X
X
X
XEnvironmental Variables
X--------\0808\1007
X`09These variables are used to change different aspects of the way the
X`09editor works.  Also they will return the current settings if used
X`09as part of an expression.  All environmental variable names begin
X`09with a dollar sign ($) and are in lower case.
X
X`09$abufname`09`5BREAD ONLY`5D Name of the "other" buffer, the one most
X`09`09`09recently visited.  This is what you would get if you
X`09`09`09typed '#' at a prompt.
X
X`09$buffer-hook`09Name of procedure to run when switching to a \3906.
X
X`09$cbufname`09Name of the current buffer.
X
X`09$cd-hook`09Name of procedure to run when changing directories.
X
X`09$cfilname`09File name of the current buffer.
X
X`09$char`09`09Ascii value of the character currently at the
X`09`09`09point.
X
X`09$curcol `09Current column of point in c\1B07buffer.
X
X`09$curline`09Current line of point in current buffer.
X
X`09$cwd`09`09`5BREAD ONLY`5D Current directory.
X
X`09$cwline `09Current display line in c\1807window.
X
X`09$debug`09`09Flag to trigger macro debugging.
X
X`09$directory`09Controls location of temp files.  unused.
X
X`09$discmd `09Flag to disable the echoing of messages on the
X`09`09`09command line.
X
X`09$disinp `09Flag to disable the echoing of characters
X`09`09`09during command line input.
X
X`09$exit-hook`09Name of procedure to run when quitting.
X
X`09$flicker`09F\0806 Flag set to TRUE if IBM CGA\1707
X`09`09`09FALSE for most others.
X
X`09$font`09`09under X11, contains the name of the current font.
X
X`09$iconname`09under X11, contains current icon name.
X
X`09$identifier`09the name of the current "\240A-like" word under
X`09`09`09the cursor.
X
X`09$kill`09`09This contains the first 127 characters currently
X`09`09`09in the kill buffer and can be used to set the
X`09`09`09contents of the kill buffer.
X
X`09$lastkey`09`5BREAD ONLY`5D Last keyboard character typed.
X
X`09$line`09`09The current line in t\140Bbuffer can be
X`09`09`09retrieved and set with this environment variable.
X
X`09$llength`09`5BREAD ONLY`5D Returns the number of characters in
X`09`09`09the current line.
X
X`09$match`09`09`5BREAD ONLY`5D Last string matched in a search.
X
X`09$mode`09`09`5BREAD ONLY`5D "insert" or "command" mode.
X
X`09$ocwd`09`09`5BREAD ONLY`5D Previous directory.
X
X`09$os`09`09`5BREAD ONLY`5D Operating system for which was vile was
X`09`09`09built.  Currently "unix", "dos", "vms", "os/2".
X
X`09$pagelen`09Number of screen lines used currently.
X
X`09$pagewid`09Number of screen columns used currently.
X
X`09$palette`09string used to control the color mappings in some
X`09`09`09versions.  The usual form consists of digits setting
X`09`09`09the red, green, and blue levels.
X
X`09$pathname`09`5BREAD ONLY`5D current "path-like" word, under the cursor.
X
X`09$pending`09`5BREAD ONLY`5D Flag to determine if there are user
X`09`09`09keystrokes waiting to be processed.
X
X`09$progname`09`5BREAD ONLY`5D Contains the string "vile" or "xvile",
X`09`09`09as appropriate.
X
X`09$qidentifier`09the name of the current "qualified-\2E0A-like"
X`09`09`09word under the cursor, useful for C++ programmers.
X
X`09$replace`09Current default \1807 string.
X
X`09$search `09Current default \1807string.
X
X`09$seed`09`09Integer seed of the random number generator.
X
X`09$shell`09`09Name of the shell program for spawned commands.
X
X`09$sres`09`09Current  screen resolution on a PC.  Values:
X`09`09`09  "2",`09   "25",    "80x25",
X`09`09`09  "4",`09   "43",    "80x43",
X`09`09`09  "5",`09   "50",    "80x50",
X`09`09`09  "80x14", "80x28",
X`09`09`09  "40x12", "40x21\09085\12088\1B0750"
X
X`09$status `09`5BREAD  ONLY`5D S\1506of the succes\0F09last
X`09`09`09command (TRUE or FALSE).  This is usually used with
X`09`09`09`7Eforce to check on the success of a search, or a
X`09`09`09file operation.
X
X`09$title`09`09Under X11, the current window title.
X
X`09$tpause `09On a PC, time to \1806for paren matching.
X
X`09$version`09`5BREAD  ONLY`5D Contains  the  current  vile \3207 number.
X
X`09$wline`09`09Number of display lines in current window.
X
X`09$word`09`09`5BREAD ONLY`5D The current "word" under t\1906sor.
X
X`09$write-hook`09Name of procedure to run before a file is written
X
X
XUser variables
X--------\0806
X`09User variables allow you, the user, to store strings and manipulate
X`09them.  These strings can be pieces of text, numbers (in text form),
X`09or the logical values TRUE and FALSE.  These variables can be
X`09combined, tested, inserted into buffers, and otherwise used to
X`09control the way your macros execute.  All users variable names must
X`09begin with a percent sign (%) and may contain any printing
X`09characters.
X
X
XInteractive variables
X--------\0808-----
X`09Interactive variables are actually a method to prompt the user for
X`09a string.  This is done by using an at sign (@) followed either
X`09with a quoted string, or a variable containing a \2306.  The
X`09string is then placed on the bottom line, and the editor waits for
X`09the user to type in a string.  Then the \1206 typed in by the
X`09user is returned as the value of the interactive variable.  For
X`09example:
X
X`09`09set-variable %quest "What file? "
X`09`09find-file @%quest
X
X`09will ask the user for a file name, and then attempt to find it.`20
X`09Note also that complex expressions can be built up with these
X`09operators, such as:
X
X`09@`26cat `26cat "File to decode`5B" %default "`5D: "
X
X`09`09which prompts the user with the concatenated string.
X
X
XFunctions
X---------
X`09Functions can be used to manipulate variables in various ways.`20
X`09Functions can have one, two, or three arguments.  Thes\120B
X`09will always be placed after the function on the current command
X`09line.  For example, if we wanted to increase the current fill
X`09column by two, using the set-variable command, we would write:
X
X`09`09setv $fillcol `26add\0E0A2
X`09`09 `5C      \0707\0E0D`5C____second operand
X`09`09  `5C    \0707\0E0A_________first operand
X`09`09   `5C   \0707   `5C________\0807function to execute
X`09`09    `5C      `5C________\0808_____variable to set
X`09`09     `5C________\0808\100Bset-variable command
X
X`09Function names always begin with the ampersand (`26) character, and
X`09are only significant to the first three characters after the
X`09ampersand.  Functions will normally expect one of three types of
X`09arguments, and will automatically convert types when needed.
X
X`09<num>         an ascii string of digits which is interpreted
X`09`09      as a numeric value.  Any string which does not
X`09`09      start with a digit or a minus sign (-) will be
X`09`09      considered zero.
X
X
X`09<str>         An  arbitrary  string  of  characters.  At the
X`09`09      moment, strings are limited to  128 characters
X`09`09      in length.
X
X`09<log>         A  logical  value  consisting  of  the  string
X`09`09      "TRUE" or "FALSE".   Numeric strings will also
X`09`09      evaluate to "FALSE" if they are equal to zero,
X`09`09      and "TRUE" if they  are  non-zero.   Arbitrary
X`09`09      text strings will have the value of "FALSE".
X
X`09A list of the currently available functions follows: F\1309are
X`09always used in lower case, the uppercase letters in the function
X`09table are the short form of the function (i.e.  `26div for `26divide).
X
X`09Numeric Functions:      (returns <num>)
X
X`09`26ADD            <num>\0606     Add two numbers
X`09`26SUB            <num>\0606     Subtract the second number from the
X`09`09&0209`09first
X`09`26TIMes          <num>\0606     Multiply two numbers
X`09`26DIVide         <num>\0606     Divide the first number by the second
X`09`09&0209`09giving an integer result
X`09`26MOD            <num>\0606     Return the reminder of dividing the
X`09`09&0209`09first number by the second
X`09`26NEGate         <neg>\0E09  Multiply the arg by -1
X`09`26LENgth         <str>\0E09  Returns length of string
X`09`26SINdex         <str1> <str2>   Finds the position of\1F08within
X`09`09&0209`09<str1>. Returns zero if not found.
X`09`26ASCii          <str>\0F0A Return the ascii code of the first
X`09`09&0209`09character in <str>
X`09`26RND            <num>\110BReturns a random integer between 1 and
X`09`09&0209`09<num>
X`09`26ABS            <num>\110BReturns the absolute value of\2E06
X
X`09String manipulation functions:  (returns <str>)
X
X`09`26CAT            <str>\0606     Concatenate the two strings to form
X`09`09&0209`09one
X`09`26LEFt           <str> <num>     return the\1507leftmost characters
X`09`09&0209`09from <str>
X`09`26RIGht          <str> <num>     Starting from\1807position in\3006,
X`09`09&0209`09return substring to the right.
X`09`26MID            <str> <num1\07062>
X`09`09&0209`09Starting from <num1> position in <str>,
X`09`09&0209`09return <num2> characters.
X`09`26UPPer          <str>\0F0A Uppercase\1A06
X`09`26LOWer          <str>\0F0A lowercase\1A06
X`09`26CHR            <num>\110Breturn a string with the character
X`09`09&0209`09represented by ascii code <num>
X`09`26GTK        \0808\100Creturn a string containing a single
X`09`09&0209`09keystroke from the user
X`09`26ENV            <str>\110BIf the operating system is capable,
X`09`09&0209`09this returns the environment string
X`09`09&0209`09associated with <str>
X`09`26BIND           <str>\100Breturn the function name bound to the
X`09`09&0209`09keystroke <str>
X
X`09Logical Testing functions:      (returns <log>)
X
X`09`26NOT            <log>\110BReturn the opposite logical value
X`09`26AND            <log1> <log2>   Returns TRUE if BOTH logical arguments
X`09`09&0209`09are TRUE
X`09`26OR             <log1> <log2>   Returns TRUE if either argument
X`09`09&0209`09is TRUE
X`09`26EQUal          <num>\0606     If\1307and\0A08re numerically
X`09`09&0209`09equal, return TRUE
X`09`26LESs           <num1> <num2>   If\1308is less than\2007, return
X`09`09&0209`09TRUE.
X`09`26GREater        <num1> <num2>   If\1308is greater than, or equal to
X`09`09&0209`09<num2>, return TRUE.
X`09`26SEQual         <str1> <str2>   If the two strings are the same,
X`09`09&0209`09return TRUE.
X`09`26SLEss          <str1> <str2>   If\1308is less alphabetically than
X`09`09&0209`09<str2>, return TRUE.
X`09`26SGReater       <str1> <str2>   If\1308is alphabetically greater
X`09`09&0209`09than or equal to <str2>, return TRUE.
X`09`26RD          `09<str>\100A Is the named file \2206readable?
X`09`26WR          `09<str>\100A Is the named file \2206writable?
X
X`09Special Functions:
X
X`09`26GLObal`09`09<modename>`09retrieves global mode setting
X`09`26LOCal`09`09<modename>`09retrieves local mode setting
X
X`09`26INDirect       <str>\0C07    Evaluate\1907as a variable.
X
X`09This last function deserves more explanation.  The `26IND\2E09
X`09evaluates its argument, takes the resulting string, and then uses
X`09it as a variable name.  For example, given the following code
X`09sequence:
X
X`09`09; set up reference table
X
X`09`09setv %one        "elephant"
X`09`09setv %two        "giraffe"
X`09`09setv %three      "donkey"
X
X`09`09setv %index "two"
X`09`09insert-string `26ind %index
X
X`09the string "giraffe" would have been inserted at the point in the
X`09current buffer.  This indirection can be safely nested up to about
X`0910 levels.
X
X
XDirectives
X----------
X`09Directives are commands which only operate within an executing
X`09macro, i.e.,  they do not make sense as a single command.  As such,
X`09they cannot be called up singly or bound to keystroke.  Used within
X`09macros, they control what lines are executed and in\1F06order.
X
X`09Directives always start with the tilde (`7E) character and must be
X`09the first thing placed on a line.  Directives executed
X`09interactively (via the execute-command- line \0E07) will be
X`09ignored.
X
X
X    `7EENDM Directive
X    --------\0807
X`09This directive is used to terminate a macro being stored.  For
X`09example, if a file is being executed contains the text:
X
X`09`09;       Read in a file in view mode, and make the window red
X`09`09;`09(color is only settable on some platforms, e.g. DOS)
X
X`09`0926      store-macro
X`09`09`09find-file @"File to view: "
X`09`09`09set-mode "view"
X`09`09`09set-mode bcolor "red"
X`09`09`7Eendm
X
X`09`09write-message "`5BConsult macro has been loaded`5D"
X
X`09only the lines between the store-macro command and the `7EENDM
X`09directive are stored in macro 26.  Both numbered macros and named
X`09procedures (via the store-\1A09 command) should be terminated
X`09with this directive.
X
X
X    `7EFORCE Directive
X    --------\0808
X`09When a macro is executed, if any command fails, the\2D09
X`09terminated at that point.  If a line is preceded by a `7EFORCE
X`09directive, execution continues whether the command succeeds or not.`20
X`09For example:
X
X`09`09set-variable %quest "What file? "
X`09`09find-file @%quest
X`09`09`7Eforce set-mode bcolor "red"
X`09`09goto-beginning-of-file`09
X`09`09insert-string "this is a new first line in that file`5Cn"
X
X`09will function correctly even if this version of the editor does not
X`09support color.  (Currently, only the DOS version \3107s\3207)
X
X
X    `7EIF, `7EEND\0806LSE, and\1307 Directives
X    --------\0808\1010\2009
X`09This directive allows statements to be executed only if a condition
X`09specified in the directive is met.  Every line following the `7EIF
X`09directive, until the first `7EELSE or `7EENDIF \2B0Bis only
X`09executed if the expression following the `7EIF directive evaluates to
X`09a TRUE value.  For example, the following macro segment creates the
X`09portion of a text file automatically.
X
X`09    `7Eif `26sequal %curplace "timespace vortex"
X`09`09    insert-string "First, rematerialize`5Cn"
X`09    `7Eendif
X`09    `7Eif `26sequal %planet "earth"     ;If we have landed on earth...
X`09`09`7Eif `26sequal %time "late 20th century"  ;and we are then
X`09`09`09write-message "Contact U.N.I.T."
X`09`09`7Eelse
X`09`09`09insert-string "Investigate the situation....`5Cn"
X`09`09`09insert-string "(SAY 'stay here Sara')`5Cn"
X`09`09`7Eendif
X`09    `7Eelseif `26sequal %planet "luna"  ;If we have landed on our neighbor.
V..
X`09`09write-message "Keep the door closed"
X`09    `7Eelse
X`09`09setv %conditions @"Atmosphere \180Boutside? "
X`09`09`7Eif `26sequal %conditions "safe"
X`09`09`09insert-string `26cat "Go outside......" "`5Cn"
X`09`09`09insert-string "lock the door`5Cn"
X`09`09`7Eelse
X`09`09`09insert-string "Dematerialize..try somewhen else"
X`09`09`09newline
X`09`09`7Eendif
X`09    `7Eendif
X
X
X    `7EGOTO Directive
X    --------\0807
X`09Flow can be controlled within a macro using the `7EGOTO directive.`20
X`09It takes as an argument a label.  A\0A06 consists of a line
X`09starting with an asterisk (*) and then an alphanumeric label.  Only
X`09labels in the currently executing macro can be jumped to, and
X`09trying to jump to a non-existing label terminates execution of a
X`09macro.  For example..
X
X`09`09;Create a block of DATA statements for a BASIC program
X
X`09`09`09insert-string "1000 DATA "
X`09`09`09setv %linenum 1000
X
X`09`09*nxtin
X`09`09`09update-screen           ;make sure we see the changes
X`09`09`09setv %data @"Next number: "
X`09`09`09`7Eif `26equal %data 0
X`09`09&0209`7Egoto finish
X`09`09`09`7Eendif
X
X`09`09`09`7Eif `26greater $curcol 60
X`09`09&02092 delete-previous-character
X`09`09&0209newline
X`09`09&0209setv %linenum `26add\0E0A10
X`09`09&0209insert-string `26cat %linenum " DATA "
X`09`09`09`7Eendif
X
X`09`09`09insert-string `26cat %data ", "
X`09`09`09`7Egoto nxtin
X
X`09`09*finish
X
X`09`09`092 delete-previous-character
X`09`09`09newline
X
X
X    `7EWHILE and `7EEND\0E06Directives
X    --------\0808\100F
X`09This directive allows you to set up repetitive tasks easily and
X`09efficiently.  If a group of statements need to be executed while a
X`09certain condition is true, enclose them with a while loop.  For
X`09example,
X
X`09`09`7Ewhile `26less $curcol 70
X`09`09`09insert-string `26cat `26cat "`5B" <stuff "`5D"
X`09`09`7Eendwhile
X
X`09places items from buffer "stuff" in the current line until the
X`09cursor is at or past column 70.  While loops may be nested and can
X`09contain and be the targets of `7EGOTOs with no ill effects.  Using a
X`09while loop to enclose a repeated task will run much faster than the
X`09corresponding construct using `7EIFs.
X
X
X    `7EBREAK Directive
X    --------\0808
X`09This directive allows the user to abort out of the currently most
X`09inner while loop, regardless of the condition.  It is often used to
X`09abort processing for error conditions.  For example:
X
X`09;       Read in files and substitute "begining" with\1007ning"
X
X`09`09setv %filename <list
X`09`09`7Ewhile `26not `26seq %filename "<end>"
X`09`09`09`7Eforce  find-file %filename
X`09`09`09`7Eif `26seq $status FALSE
X`09`09&0209write-message "`5BFile read error`5D"
X`09`09&0209`7Ebreak
X`09`09`09`7Eendif
X`09`09`09beginning-of-file
X`09`09`09replace-string "begining"\0B07ning"
X`09`09`09save-file
X`09`09`09setv %filename <list
X`09`09`7Eendwhile
X
X`09This while loop will process files until the list is exhausted or
X`09there is an error while reading a file.
X
X
X    `7ERETURN Directive
X    --------\0808-
X`09The `7ERETURN Directive causes the current macro to exit, either
X`09returning to the caller (if any) or to interactive mode.  For
X`09example:
X
X`09;       Check the monitor type and setv %mtyp
X
X`09`09`7Eif `26sres "CGA"
X`09`09`09setv %mtyp 1
X`09`09`7Eelse
X`09`09`09setv %mtyp 2
X`09`09`09`7Ereturn
X`09`09`7Eendif
X
X`09`09insert-string "You are on an old machine!`5Cn"
X
X--------\0808\1010---
X  $Header: /usr/build/vile/vile/doc/RCS/macros.doc,v 1.1 1998/04/26 20:34:03 t
Vom Exp $
X--------\0808\1010---
$ call unpack [.VILE-8_0.DOC]MACROS.DOC;1 -
 1919364571 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 43 138 152
$!
$ create 'f'
X-- $Header: /usr/build/vile/vile/doc/RCS/menus.doc,v 1.1 1998/04/26 14:10:39 t
Vom Exp $
X-- adapted from description by Philippe Chassany (20/02/1997)
X-- e-mail: phil@cln46ks.der.edf.fr
X
X
XThe Motif and Athena widget versions of xvile automatically support user
Xconfigurable menus.
X
XIf the environment variable XVILE_MENU is set, it contains the name of
Xthe rc file.  Otherwise, the name ".vilemenu" is used.
X
XThe file contains a series of lines whose first character denotes the
Xtype of entry, subsequent fields delimited by colon:
X
X`09C - cascade (actually pulldown).  One field only is recognized,
X`09    the menu heading.
X
X`09B - button (menu entry).  The first field is the menu label.`20
X`09    The second is the command which will be executed.  If the
X`09    command is a number, it is expanded into the vile \3207
X`09    execute-macro-<number>.
X
X`09    Besides the normal vile commands, the menu implements the
X`09    following
X
X`09`09new_xvile - spawn a new copy of xvile.
X`09`09edit_rc - switch to a buffer with ".vilerc".
X`09`09parse_rc - source ".vilerc"
X`09`09edit_mrc - switch to a buffer with the menu rc file
X`09`09`09".vilemenu"
X
X`09S - separator
X
X`09L - list buffers.  Each time you select this menu entry, vile
X`09    constructs a current list of the buffers, allowing you to
+-+-+-+-+-+-+-+-  END  OF PART 143 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 144 -+-+-+-+-+-+-+-+
X`09    switch to any buffer by selecting it from the menu.  It has
X`09    to be at the end of a menu, and only one is allowed.
X
X`09    For the Motif version, the accelerators are constructed to
X`09    correspond with the vile commands for switching buffers,
X`09    e.g., _0, _1 ...
X
XLines beginning with '#' are ignored, as is text after a tab character.
X
XThe special keyword "cmd" tells the menu function to invoke the following
Xkeyword as a :-line command, so that\1108s which must solicit input
Xwill work properly.
X
XA sample .vilemenu file:
X
XC:Xvile
XB:New:new_xvile
XB:Edit .vilerc:edit_rc
XB:Parse .vilerc:parse_rc
XB:Edit .vilemenu:edit_mrc
XB:Quit:quit
X#
XC:Edition
XB:Search Forward...:cmd search-f\1606
XB:Search Backward...:cmd search-reverse
XS
XB:Manual for...:2
XB:Word Manual:8
XS
XB:Indent Level...:31
XB:Window Title...:35
XB:Font...:36
X#
XC:Buffers
XB:Toggle Show:toggle-buffer
XL:list_buff
X#
XC:Attributes
XB:C/C++:17
XB:Tk/Tcl:22
XB:HTML:24
XB:Makefile:32
XB:ProC:33
X#
XC:Help:help
XB:General:help
XB:Bindings:describe-b\1207
XB:Motions:describe-m\1106
XB:Operators:describe-o\1308
XS
XB:Apropos...:cmd a\0F06
XB:On Function...:cmd describe-f\1907
XB:On Key...:describe-key `26gts
$ call unpack [.VILE-8_0.DOC]MENUS.DOC;1 -
 73672040 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 6 139 152
$!
$ create 'f'
XMajor (and minor) modes in Vile
X========\0808\100F
X
XGoals
X-----
X
XThis document describes the proposed implementation and use of major
Xmodes in vile.  My goal is to extend the notion of the C mode (cmode)
Xto allow runtime definable major modes.
X
XThe C mode is a collection of modes that are useful for editing C
Xprogram source:
X
X`09c-suffixes
X`09c-tabstop
X`09c-shiftwidth
X
Xas well as builtin functionality:
X
X`09autoindention of C statements taking into account curly braces
X`09fence matching for /*...*/ comments and C preprocessor statements
X`09comment formatting
X
XBoth the modes and functionality are extensions of other features in
Xvile.  It would be useful to combine modes to support other languages
Xin a similar fashion.  Likewise, the autoindention, etc., could be
Xparameterized and made reusable to support other languages.  For an
Xinitial implementation, I am focusing on the combining of modes,
Xproviding a structure for the parameterization.
X
XOne thing that is not clear to many users (and possibly should be
Xchanged) is the manner in which the C mode is attached to a buffer.`20
XIt is currently set as a boolean - if active before a buffer is
Xloaded, then vile checks the file suffix to see if it matches the
Xc-suffixes mode, and if so, sets the C mode for the buffer. \1807
Xcan be explicitly set by a ":setl cmode", and un\1E07\1C06
Xnocmode".  In the new scheme,
X
X`09+ vile will search the list of all active majormodes, first
X`09  testing if any match with the majormode's suffixes, then if
X`09  any preamble (first line regular expression) matches.
X
X`09  The search is in alphabetic order, by majormode name.  The
X`09  first match each, of suffixes and preamble terminate the
X`09  search, but a match of preamble overrides\1E0Csuffixes.
X
X`09+ majormodes can be disabled (e.g., ":set nocmode"), as before.
X`09  However, there is no global sense of majormode; unsetting a
X`09  buffer's local value of a majormode simply makes it not have a
X`09  majormode associated with it.
X
X
XCommands
X--------
X
XThese are the commands which I think are necessary:
X
X`09define-majormode `7B\0B09`7D
X
X`09define-submode `7Bmajormode`7D `7Bmin\0C07`5B=`7Bvalue`7D`5D
X
X`09remove-majormode `7B\0B09`7D
X
X`09remove-submode `7Bmajormode`7D `7Bmin\0C07
X
XThe `7Bmajormode`7D is a new symbol.
X
XThe `7Bminormode`7D can be any one of the existing buffer modes, except for
Xa `7Bmajormode`7D.
X`09
X
XExample
X-------
X
X`09define-majormode c
X`09; Declares a mode 'c', and corresponding symbol 'cmode'
X
X`09define-submode c suffixes=`5C`5C.&025C(&025C(`5BCchisyl`5D&025C)&025C`7CCC
V&025C`7Ccc`7Ccpp&025C`7Ccxx&025C`7Chxx&025C`7Cscm&025C)$
X`09; Specifies the filename suffixes which control whether a newly-loaded
X`09; buffer is set to 'c' mode.
X
X`09define-submode c tabstops=4
X`09define-submode c shiftwidth=4
X`09; Defines the 'c' tabstops and shiftwidth.  If no "define-submode"
X`09; command is given, no separate symbol is defined.
X
XAs an example, to define a new major mode for perl programming, you might
Xinclude the following in your .vilerc file:
X
X`09define-majormode perl
X`09define-submode perl preamble "`5E#.*perl`5C`5C>"
X`09define-submode perl suffixes "`5C`5C.pl$"
X`09define-submode perl shiftwidth 4
X
X
XThe "define-majormode" command
X--------\0808\100E
X
XThis takes a single argument, a majormode name.  To follow existing
Xconvention, the string "mode" is automatically appended to the given
Xname.  Associated modes are defined or modified with th\1D08-submode
Xcommand.  Vile maintains a list of majormodes.  Only one ma\1607 can
Xbe associated with a buffer (none need \270D).  After
Xdefinition, a majormode can be set or unset just like any other buffer
Xmode:
X
X`09define-majormode c
X`09; defines "cmode"
X
X`09set cmode
X`09; sets the default mode for new buffers
X
X`09setl cmode
X`09; sets the mode for the current buffer
X
X`09setl nocmode
X`09; clear c mode (existing implementation)
X
X`09unsetl cmode
X`09; clear c mode (not currently implemented)
X
XThe restriction to a single majormode is because mode values are
Xinternally represented as structures with a pointer.  The\0E08
Xdenotes which value (currently local or global) is used.  The
Xmajormode implementation adds a level to this, e.g.,
X
X`09value -> self (local)
X`09value -> global (\0806)
X`09value -> major (majormode)
X
XWhen a majormode is defined, an array of the existing minor mode values
Xis allocated, all pointing to the global modes.  The define-submode
Xcommand modifies these to make them local pointers.  When a buffer is
Xassociated with a majormode, all of its buffer mode values are pointed
Xto the majormode's values.  (To keep the bookkeeping straight, modifying
Xa global buffer mode must also modify the copies of non-loc\3509
Xmode values).
X
X
XThe "define-submode" command
X--------\0808\100C
X
XThis command sets local values of buffer modes for the given majormode,
Xe.g.,
X
X`09define-submode c autoindent
X
XThe majormode name is required.  Any number of modes can be modified
Xin a single command.
X
XThe following are keywords that aren't minor modes, but are recognized
Xsolely by the define-submode command:
X
X`09suffixes
X`09`09The filename suffix which is tested to trigger
X`09`09association with a majormode (e.g., c-suffixes)
X
X`09`09Note that since the default value for the c-suffixes mode
X`09`09is a regular expression that will match some other file
X`09`09types (C++ files, for instance), if you define a new major
X`09`09mode for one of those suffixes you may want to reset
X`09`09c-suffixes to something less inclusive.
X
X`09preamble
X`09`09Regular expression, matched against the beginning of a
X`09`09file (the first line) used to trigger association with
X`09`09a majormode (e.g., "`5E!#.*`5C/perl`5B`5Ea-z`5D").
X
X`09fences
X`09`09"fence-" followed by any of the\1707ing keywords with a
X`09`09regular expression:  if, el\0606se, fi,
X
X`09comments
X`09`09To support C-style comments, with the '%' going between
X`09`09"/* and "*/", use "fence-" followed any of the \1406ing
X`09`09keywords with a regular expression:  begin, end.
X
X`09indent
X`09`09The keyword "cstyle", or any of the following\2A08s
X`09`09with a regular expression: begin, end, if, then, else,
X`09`09elif, endif.
X
XOther features which should be controlled by majormodes include limiting
Xthe scope of the entab and detab commands.
X
X
XThe "remove-majormode" command"
X--------\0808\100F
X
XThis command has two forms:
X
X`09remove-majormode `7B\0B09`7D
X
X`09`09This removes the definition of the majormode.  Buffers
X`09`09that were associated with the mode revert to no
X`09`09majormode.
X
Xor
X`09remove-majormode `7B\0B09`7D `7Bname`7D
X
X`09`09This removes the value of `7Bname`7D from `7Bmajormode`7D,
X`09`09leaving it set to the global value, if any.
X
X
XThe "remove-submode" command"
X--------\0808\100D
X
XRemove the special association of a submode from a majormode.
X
XExample
X-------
X
XThe builtin C/C++ majormode description is equivalent to
X
Xdefine-mode c
Xset csuf "`5C`5C.&025C(&025C(`5BCchisyl`5D&025C)&025C`7CCC&025C`7Ccc`7Ccpp
V&025C`7Ccxx&025C`7Chxx&025C`7Cscm&025C)$"
Xset c-comment-prefix="`5E`5C`5Cs*&025C(&025Cs*`5B#*>`5D&025C)&025C+"
Xset c-comments="`5E`5C`5Cs*/&025C?&025C(&025Cs*`5B#*>`5D&025C)&025C+\1606s*$"
V
Xset c-fence-begin="/`5C`5C*"
Xset c-fence-end="`5C`5C*/"
Xset c-fence-if="`5E`5C`5Cs*#&025Cs*if"
Xset c-fence-elif="`5E`5C`5Cs*#&025Cs*elif&025C>"
Xset c-fence-else="`5E`5C`5Cs*#&025Cs*else&025C>"
Xset c-fence-fi="`5E`5C`5Cs*#&025Cs*endif&025C>"
X
XNote that the following are equivalent once you have defined the majormode "c"
V:
X`09set cts=8
X`09set c-tabstop=8
X`09define-submode c tabstop=8
X
X--------\0808\100F
X$Header: /usr/build/vile/vile/doc/RCS/modes.doc,v 1.1 1998/05/13 10:20:30 tom
V Exp $
X--------\0808\100F
$ call unpack [.VILE-8_0.DOC]MODES.DOC;1 -
 1343481759 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 16 140 152
$!
$ create 'f'
X-- $Header: /usr/build/vile/vile/doc/RCS/perl.doc,v 1.1 1998/05/27 10:14:29 bo
Vd Exp $
X
XPerl Support`20
X------------`20
X`20
XVile supports the use of Perl as an extension language by embedding a`20
XPerl interpreter into the editor.`20
X`20
XThe `60--with-perl' configure option enables Perl support at build time on`20
XUnix hosts (for Win32 instructions see the help file).`20
X`20
XAfter the executable is successfully built, up to date documentation for`20
Xthe API in various formats may be obtained from the following make`20
Xtargets (not built by default):`20
X`20
X    vile-perl-api.doc`20
X    vile-perl-api.man`20
X    vile-perl-api.html`09`20
X`20
XA recent version of Perl is required.  The interface was developed and`20
Xtested using 5.004_04.  The most recent version of Perl may be retrieved`20
Xfrom the URL:`20
X`20
X    http://www.perl.com/CPAN/src/latest.tar.gz`20
X`20
XThe Perl interpreter requires subsidiary files, the location of which is`20
Xcoded into the Perl library.  As such, if a Perl-enabled Vile binary is`20
Xto be installed onto multiple machines, the same version of Perl must be`20
Xinstalled on each target machine, in the same location.`20
X`20
XThis also means that if a newer version of Perl is installed, Vile must`20
Xeither be rebuilt against the new version, or the \1007-specific`20
Xdirectory (given by `60perl -V:archlib') of the old version must be`20
Xretained.`20
X`20
XNote also that embedding a Perl interpreter into Vile will increase the`20
Xsize of the binary.  On many platforms, a shared Perl library may be`20
Xbuilt which, at the cost of a load-time performance penalty, can`20
Xsubstantially reduce the size of the compiled vile, x\0706`5Bnvi, apache,`20
Xetc, ...`5D and of course perl binaries.`20
X`20
XSee also the output of `60perl -V:useshrplib' and the section `60Building a`20
Xshared libperl.so Perl library' in the `60INSTALL' file from the Perl`20
Xdistribution.`20
$ call unpack [.VILE-8_0.DOC]PERL.DOC;1 -
 1045330216 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 4 141 152
$!
$ create 'f'
X
X;; digraphs.rc for use with vile
X;; $Header: /usr/build/vile/vile/macros/RCS/digraphs.rc,v 1.1 1996/05/03 02:51
V:05 tom Exp $
X
X;; if you wish to insert digraph characters, you can use this file (or
X;; something similar) as a set of ":map" commands.  simply put the line
X;;`09source digraphs.rc
X;; in your vile startup file (.vilerc o\1E06.rc on PC systems). `20
X
X;; the idea and some of the text for this set of maps comes directly from
X;; a digraph feature of Bram Moolenar's vim editor.  thank you, Bram...
X
X;; this file uses the `5EK character a\1406"digraph prefix" -- it can, of
X;; course, be changed to any character which is rarely entered into a text
X;; file.
X
X;; here is a more concise version of the information contained in the maps
X;; below -- the first two characters in each column are the \220Byou
X;; have to type (after `5EK) to enter a digraph.  in the middle of each column
V
X;; is the resulting character.  this may be mangled if you look at\2306file
X;; on something that can't display those 8-bit characters.  most PC console
X;; displays probably cannot.
X;; they look fine in any character set capable of displaying the ISO 8859/1
X;; character set.  if you're using an xterm, the commands
X;; `09set printing-low 160
X;; `09set printing-high 255
X;; will be useful.  the decimal number is the ASCII code for the character.
X
X;;  `7E! `A1 161   c`7C `A2 162   $$ `A3 163   ox `A4 164   Y- `A5 165   `7C
V`7C `A6 166   pa `A7 167
X;;  "" `A8 168   cO `A9 169   a- `AA 170   << `AB 171   -- `AD 173   rO `AE 17
V4   -= `AF 175
X;;  `7Eo `B0 176   +- `B1 177   22 `B2 178   33 `B3 179   '' `B4 180   ju `B5
V 181   pp `B6 182
X;;  `7E. `B7 183   ,, `B8 184   11 `B9 185   o- `BA 186   >> `BB 187   14 `BC
V 188   12 `BD 189
X;;  34 `BE 190   `7E? `BF 191   A`60 `C0 192   A' `C1 193   A`5E `C2 194   A
V`7E `C3 195   A" `C4 196
X;;  A@ `C5 197   AE `C6 198   C, `C7 199   E`60 `C8 200   E' `C9 201   E`5E`20
V`CA 202   E" `CB 203
X;;  I`60 `CC 204   I' `CD 205   I`5E `CE 206   I" `CF 207   -D `D0 208   N`7E
V `D1 209   O`60 `D2 210
X;;  O' `D3 211   O`5E `D4 212   O`7E `D5 213   O" `D6 214   /`5C `D7 215   O/
V `D8 216   U`60 `D9 217
X;;  U' `DA 218   U`5E `DB 219   U" `DC 220   Y' `DD 221   Ip `DE 222   ss `DF
V 223   a`60 `E0 224
X;;  a' `E1 225   a`5E `E2 226   a`7E `E3 227   a" `E4 228   a@ `E5 229   ae`20
V`E6 230   c, `E7 231
X;;  e`60 `E8 232   e' `E9 233   e`5E `EA 234   e" `EB 235   i`60 `EC 236   i'
V `ED 237   i`5E `EE 238
X;;  i" `EF 239   -d `F0 240   n`7E `F1 241   o`60 `F2 242   o' `F3 243   o`5E
V `F4 244   o`7E `F5 245
X;;  o" `F6 246   :- `F7 247   o/ `F8 248   u`60 `F9 249   u' `FA 250   u`5E`20
V`FB 251   u" `FC 252
X;;  y' `FD 253   ip `FE 254   y" `FF 255
X
X
X;; by the way, the following maps could have been written directly as:
X;;`09map! `5EK`7E! `A1
X;; but i figured that the file would be more prone to corruption in transit
X;; if the important part o\1606map were left as an 8-bit character.  so i
X;; used the `5EV form instead.  if file transfer corruption does occur, you
X;; may lose the comments, which show the 8-bit character, or you\3E0D
X;; `5EV character that precedes the decimal value in every map.  but the comme
Vnt
X;; is expendable, and the `5EV is easy to recreate.
X
X;; '`A1'
Xmap! `0B`7E! `16161
X;; '`A8'
Xmap! `0B`5C"`5C" `16168
X;; '`B0'
Xmap! `0B`7Eo `16176
X;; '`B7'
Xmap! `0B`7E. `16183
X;; '`BE'
Xmap! `0B34 `16190
X;; '`C5'
Xmap! `0BA@ `16197
X;; '`CC'
Xmap! `0BI`60 `16204
X;; '`D3'
Xmap! `0BO' `16211
X;; '`DA'
Xmap! `0BU' `16218
X;; '`E1'
Xmap! `0Ba' `16225
X;; '`E8'
Xmap! `0Be`60 `16232
X;; '`EF'
Xmap! `0Bi`5C" `16239
X;; '`F6'
Xmap! `0Bo`5C" `16246
X;; '`FD'
Xmap! `0By' `16253
X;; '`A2'
Xmap! `0Bc`7C `16162
X;; '`A9'
Xmap! `0BcO `16169
X;; '`B1'
Xmap! `0B+- `16177
X;; '`B8'
Xmap! `0B,, `16184
X;; '`BF'
Xmap! `0B`7E? `16191
X;; '`C6'
Xmap! `0BAE `16198
X;; '`CD'
Xmap! `0BI' `16205
X;; '`D4'
Xmap! `0BO`5E `16212
X;; '`DB'
Xmap! `0BU`5E `16219
X;; '`E2'
Xmap! `0Ba`5E `16226
X;; '`E9'
Xmap! `0Be' `16233
X;; '`F0'
Xmap! `0B-d `16240
X;; '`F7'
Xmap! `0B:- `16247
X;; '`FE'
Xmap! `0Bip `16254
X;; '`A3'
Xmap! `0B$$ `16163
X;; '`AA'
Xmap! `0Ba- `16170
X;; '`B2'
Xmap! `0B22 `16178
X;; '`B9'
Xmap! `0B11 `16185
X;; '`C0'
Xmap! `0BA`60 `16192
X;; '`C7'
Xmap! `0BC, `16199
X;; '`CE'
Xmap! `0BI`5E `16206
X;; '`D5'
Xmap! `0BO`7E `16213
X;; '`DC'
Xmap! `0BU`5C" `16220
X;; '`E3'
Xmap! `0Ba`7E `16227
X;; '`EA'
Xmap! `0Be`5E `16234
X;; '`F1'
Xmap! `0Bn`7E `16241
X;; '`F8'
Xmap! `0Bo/ `16248
X;; '`FF'
Xmap! `0By`5C" `16255
X;; '`A4'
Xmap! `0Box `16164
X;; '`AB'
Xmap! `0B<< `16171
X;; '`B3'
Xmap! `0B33 `16179
X;; '`BA'
Xmap! `0Bo- `16186
X;; '`C1'
Xmap! `0BA' `16193
X;; '`C8'
Xmap! `0BE`60 `16200
X;; '`CF'
Xmap! `0BI`5C" `16207
X;; '`D6'
Xmap! `0BO`5C" `16214
X;; '`DD'
Xmap! `0BY' `16221
X;; '`E4'
Xmap! `0Ba`5C" `16228
X;; '`EB'
Xmap! `0Be`5C" `16235
X;; '`F2'
Xmap! `0Bo`60 `16242
X;; '`F9'
Xmap! `0Bu`60 `16249
X;; '`A5'
Xmap! `0BY- `16165
X;; '`AD'
Xmap! `0B-- `16173
X;; '`B4'
Xmap! `0B'' `16180
X;; '`BB'
Xmap! `0B>> `16187
X;; '`C2'
Xmap! `0BA`5E `16194
X;; '`C9'
Xmap! `0BE' `16201
X;; '`D0'
Xmap! `0B-D `16208
X;; '`D7'
Xmap! `0B/`5C`5C `16215
X;; '`DE'
Xmap! `0BIp `16222
X;; '`E5'
Xmap! `0Ba@ `16229
X;; '`EC'
Xmap! `0Bi`60 `16236
X;; '`F3'
Xmap! `0Bo' `16243
X;; '`FA'
Xmap! `0Bu' `16250
X;; '`A6'
Xmap! `0B`7C`7C `16166
X;; '`AE'
Xmap! `0BrO `16174
X;; '`B5'
Xmap! `0Bju `16181
X;; '`BC'
Xmap! `0B14 `16188
X;; '`C3'
Xmap! `0BA`7E `16195
X;; '`CA'
Xmap! `0BE`5E `16202
X;; '`D1'
Xmap! `0BN`7E `16209
X;; '`D8'
Xmap! `0BO/ `16216
X;; '`DF'
Xmap! `0Bss `16223
X;; '`E6'
Xmap! `0Bae `16230
X;; '`ED'
Xmap! `0Bi' `16237
X;; '`F4'
Xmap! `0Bo`5E `16244
X;; '`FB'
Xmap! `0Bu`5E `16251
X;; '`A7'
Xmap! `0Bpa `16167
X;; '`AF'
Xmap! `0B-= `16175
X;; '`B6'
Xmap! `0Bpp `16182
X;; '`BD'
Xmap! `0B12 `16189
X;; '`C4'
Xmap! `0BA`5C" `16196
X;; '`CB'
Xmap! `0BE`5C" `16203
X;; '`D2'
Xmap! `0BO`60 `16210
X;; '`D9'
Xmap! `0BU`60 `16217
X;; '`E0'
Xmap! `0Ba`60 `16224
X;; '`E7'
Xmap! `0Bc, `16231
X;; '`EE'
Xmap! `0Bi`5E `16238
X;; '`F5'
Xmap! `0Bo`7E `16245
X;; '`FC'
Xmap! `0Bu`5C" `16252
$ call unpack [.VILE-8_0.MACROS]DIGRAPHS.RC;1 -
 3153324210 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 11 142 152
$!
$ create 'f'
X;;
X;; Macros for obtaining manual pages and then attributing them.
X;;
X;; Author: Kevin Buettner
X;;
X;; $Header: /usr/build/vile/vile/macros/RCS/manpage.rc,v 1.1 1994/10/27 14:28:
V04 tom Exp $
X;;
X
X29 store-macro
X`09set-variable %manpage @"man page? "
X`09`7Eif `26or `26seq %manpage "ERROR" `26 \170E"
X`09`09`7Ereturn
X`09`7Eendif
X`09set-variable %manpagebuf `26cat "<"\0906\1A08 ">"
X`09set terse
X`09`7Eforce select-buffer %manpagebuf
X`09`7Eif `26not $status
X`09`09edit-file `26cat "!man "\0D06%manpage " `7C vile-manfilt"
X`09`09`7Eforce rename-buffer %manpagebuf
X`09`09`7Eforce error-buffer %manpagebuf
X`09`09write-message "`5BAttaching bold and underline attributes...`5D"
X`09`09goto-beginning-of-file
X`09`09setl noview
X`09`09attribute-cntl_a-sequences-til end-of-file
X`09`09unmark-buffer
X`09`09setl view
X`09`09goto-beginning-of-file
X`09`09write-message "`5BDone formatting manual page.`5D"
X`09`7Eendif
X`09set noterse
X`7Eendm
Xbind-key execute-macro-29 `5EX-m
$ call unpack [.VILE-8_0.MACROS]MANPAGE.RC;1 -
 727782253 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 2 143 152
$!
$ create 'f'
X;        \0808\1010\2020\400F
X; this procedure implements a primitive ascii picture-drawing mode. `20
X;`09`09pgf, may '95
X
X; motions are accomplished with the usual h, j, k, and l keys
X; (the arrow keys do _not_ work here).  in addition, the u, i,
X; n, and m keys will perform diagonal motions.  look at your
X; keyboard to see why these were chosen.
X
X; normally, entering the motion characters (h, j, k, l, u, i, n, m)
X; will draw appropriate box outlines, using the -, `7C, /, and `5C characters.
V
X
X; lines will be drawn instead with a specific character if the 'c' command
X; is given -- you will be prompted for a character.  this can be
X; cancelled, to revert lines to their "natural" rendition, with the
X; 'C' command.  for example, to draw with a '+' character, you would
X; use "c+" and when finished, would cancel with "C".
X
X; the `5ET command will allow you to enter a string of text.  this
X; text will accumulate until ESC, CR, or NL is typed.
X
X; all other input will be inserted as-is, with no cursor movement.  so
X; the space bar can be used to "erase" previously drawn stuff.
X
X; space for the picture must be pre-allocated, with, for example:
X;`09`0980i <ESC>yy24p
X;        \0808\1010\2020\400B
X; start this up with "run pic"
X; to bind it to a key instead, change\1C09"NN store-macro", and
X; then bind "execute-macro NN" to the key you want.
Xstore-procedure replc
X`09; never replace a newline`20
X`09`7Eif `26equ $char 0xA
X`09`09`7Ereturn
X`09`7Eendif
X
X`09`7Eif `26seq %userchar `26chr 0
X`09`09replace-character %linechar
X`09`7Eelse
X`09`09replace-character %userchar
X`09`7Eendif
X`7Eendm
Xstore-procedure pic
X`09set-variable %keywas `26chr 0
X`09set-variable %userchar `26chr 0
X`09set-variable %linechar `26chr 0
X`09write-message "entering picture, end with ESC"
X`09redraw-display
X`09`7Ewhile 1
X`09`09set-variable %keywas `26gtk
X
X`09`09; was it ESC?  quit if so.
X`09`09`7Eif `26seq %keywas `26chr 0x1b
X`09`09`09`7Ebreak
X`09`09`7Eendif
X
X`09; Rectangular Lines:  h, j, k, l
X`09`09`7Eif `26seq %keywas h
X`09`09`09`7Eforce backward-character
X`09`09`09set-variable %linechar -
X`09`09`09run replc
X`09`09`09`7Egoto redraw
X`09`09`7Eendif
X`09`09`7Eif `26seq %keywas l
X`09`09`09`7Eforce forward-character
X`09`09`09set-variable %linechar -
X`09`09`09run replc
X`09`09`09`7Egoto redraw
X`09`09`7Eendif
X`09`09`7Eif `26seq %keywas j
X`09`09`09`7Eforce down-line
X`09`09`09set-variable %linechar `7C
X`09`09`09run replc
X`09`09`09`7Egoto redraw
X`09`09`7Eendif
X`09`09`7Eif `26seq %keywas k
X`09`09`09`7Eforce up-line
X`09`09`09set-variable %linechar `7C
X`09`09`09run replc
X`09`09`09`7Egoto redraw
X`09`09`7Eendif
X
X`09; Diagonal Lines:  u, i, n, m
X`09`09`7Eif `26seq %keywas u
X`09`09`09`7Eforce up-line
X`09`09`09`7Eforce backward-character
X`09`09`09set-variable %linechar `5C`5C
X`09`09`09run replc
X`09`09`09`7Egoto redraw
X`09`09`7Eendif
X`09`09`7Eif `26seq %keywas i
X`09`09`09`7Eforce up-line
X`09`09`09`7Eforce forward-character
X`09`09`09set-variable %linechar /
X`09`09`09run replc
X`09`09`09`7Egoto redraw
X`09`09`7Eendif
X`09`09`7Eif `26seq %keywas n
X`09`09`09`7Eforce down-line
X`09`09`09`7Eforce backward-character
X`09`09`09set-variable %linechar /
X`09`09`09run replc
X`09`09`09`7Egoto redraw
X`09`09`7Eendif
X`09`09`7Eif `26seq %keywas m
X`09`09`09`7Eforce down-line
X`09`09`09`7Eforce forward-character
X`09`09`09set-variable %linechar `5C`5C
X`09`09`09run replc
X`09`09`09`7Egoto redraw
X`09`09`7Eendif
X
X`09; Rectangular Motions:  `5EH, `5EL, `5EJ, `5EK
X`09`09; was it `5EH
X`09`09`7Eif `26seq %keywas `26chr 0x8
X`09`09`09`7Eforce backward-character
X`09`09`09`7Egoto redraw
X`09`09`7Eendif
X`09`09
X`09`09; was it `5EL
X`09`09`7Eif `26seq %keywas `26chr 0xC
X`09`09`09`7Eforce forward-character
X`09`09`09`7Egoto redraw
X`09`09`7Eendif
X
X`09`09; was it `5EJ
X`09`09`7Eif `26seq %keywas `26chr 0xA
X`09`09`09`7Eforce down-line
X`09`09`09`7Egoto redraw
X`09`09`7Eendif
X
X`09`09; was it `5EK
X`09`09`7Eif `26seq %keywas `26chr 0xB
X`09`09`09`7Eforce up-line
X`09`09`09`7Egoto redraw
X`09`09`7Eendif
X`09; Diagonal Motions:  `5EU, `5EI, `5EN, `5EM
X`09`09; was it `5EU
X`09`09`7Eif `26seq %keywas `26chr 0x15
X`09`09`09`7Eforce up-line
X`09`09`09`7Eforce backward-character
X`09`09`09`7Egoto redraw
X`09`09`7Eendif
X`09`09; was it `5EI
X`09`09`7Eif `26seq %keywas `26chr 0x9`09
X`09`09`09`7Eforce up-line
X`09`09`09`7Eforce forward-character
X`09`09`09`7Egoto redraw
X`09`09`7Eendif
X`09`09; was it `5EN
X`09`09`7Eif `26seq %keywas `26chr 0xE
X`09`09`09`7Eforce down-line
X`09`09`09`7Eforce backward-character
X`09`09`09`7Egoto redraw
X`09`09`7Eendif
X`09`09; was it `5EM
X`09`09`7Eif `26seq %keywas `26chr 0xD
X`09`09`09`7Eforce down-line
X`09`09`09`7Eforce forward-character
X`09`09`09`7Egoto redraw
X`09`09`7Eendif
X
X`09; Text:  `5ETtext to be entered<CR>
X`09`09; was it `5ET
X`09`09`7Eif `26seq %keywas `26chr 0x14
X`09`09`09write-message "entering text, end with CR"
X`09`09`09redraw-display
X`09`09`09set-variable %textkey 0
X`09`09`09`7Ewhile 1
X`09`09&0209set-variable %textkey `26gtk
X`09`09&0209; was it CR (`5EM)
X`09`09&0209`7Eif `26seq %textkey `26chr 0xD
X`09`09&0209`09`7Ebreak
X`09`09&0209`7Eendif
X`09`09&0209; was it LF (`5EJ)
X`09`09&0209`7Eif `26seq %textkey `26chr 0xA
X`09`09&0209`09`7Ebreak
X`09`09&0209`7Eendif
X`09`09&0209; was it ESC (`5E`5B)
X`09`09&0209`7Eif `26seq %textkey `26chr 0x1B
X`09`09&0209`09`7Ebreak
X`09`09&0209`7Eendif
X`09`09&0209; was it BS (`5EH) or DEL?
X`09`09&0209`7Eif `26or `26seq %textkey `26chr 0x7f `26\18148
X`09`09&0209`09`7Eforce backward-character
X`09`09&0209`09replace-character `26chr 0x20
X`09`09&0209`09`7Eforce backward-character
X`09`09&0209`09set-variable %textkey `26chr $char
X`09`09&0209`7Eendif
X`09`09&0209replace-character %textkey
X`09`09&0209`7Eforce forward-character
X`09`09&0209redraw-display
X`09`09`09`7Eendwhile
X`09`09`09write-message "text done, drawing lines again"
X`09`09`09`7Egoto redraw
X`09`09`7Eendif
X
X`09; user-selected lines:  'c' to set the linechar, 'C' to cancel
X`09`09`7Eif `26seq %keywas c
X`09`09`09write-message "enter char to draw with: "
X`09`09`09set-variable %userchar `26gtk
X`09`09`09write-message `26cat "will draw with: " %userchar
X`09`09`09`7Egoto redraw
X`09`09`7Eendif
X`09`09`7Eif `26seq %keywas C
X`09`09`09write-message "will draw normal lines again"
X`09`09`09set-variable %userchar `26chr 0
X`09`09`09`7Egoto redraw
X`09`09`7Eendif
X
X
X`09; Everything else is self inserting
X`09`09replace-character %keywas
X
X`09*redraw
X
X`09`09redraw-display
X`09`7Eendwhile
X`09write-message "picture mode done"
X`7Eendm
X
$ call unpack [.VILE-8_0.MACROS]PICTMODE.RC;1 -
 1897229845 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 12 144 152
$!
$ create 'f'
X#!/bin/sh
X# This is a simple script that uses the vi-clone 'vile' as a pager to show
X# highlighted text.  It's a lot easier to work with large listings than 'more'
V
X# or 'less'
X# - T.Dickey (dickey@clark.net)
XTMP=/tmp/rc$$
Xtrap "rm -f $TMP" 0 1 2 5 15
Xcat >$TMP <<EOF/
Xset glob=on
Xsource `7E/.vilerc
Xset nopopup-msgs
Xstore-procedure OnRead
X`09setl noview
X`091 goto-line
X`09attribute-cntl_a-sequences-til end-of-file
X`09unmark
X`09setl view
X`091 goto-line
X`09setv `5C$buffer-hook ""
X`7Eendm
Xsetv `5C$buffer-hook "OnRead"
XEOF/
Xvile-manfilt $* `7C vile @$TMP
$ call unpack [.VILE-8_0.MACROS]VILE-PAGER.;1 -
 1243375238 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 2 145 152
$!
$ create 'f'
X#!/usr/bin/perl -w`20
X`20
Xsub glob2re `7B`20
X    my ($glob) = @_;`20
X    my $re = '(`5E`7C`5C/)';`20
X`20
X    while ($glob ne '') `7B`20
X`09if ($glob =`7E /`5E`5C*(.*)$/) `7B`20
X`09    $re .= '.*';`20
X`09    $glob = $1;`20
X`09`7D`20
X`09elsif ($glob =`7E /`5E`5C?(.*)$/) `7B`20
X`09    $re .= '.';`20
X`09    $glob = $1;`20
X`09`7D`20
X`09elsif ($glob =`7E /`5E`5C`5B(.+?)`5C`5D(.*)$/) `7B`20
X`09    $re .= "`5B$1`5D";`20
X`09    $glob= $2;`20
X`09`7D`20
X`09elsif ($glob =`7E /`5E`5C`7B(.*?,.*?)`5C`7D(.*)$/) `7B`20
X`09    my ($alts) = $1;`20
X`09    $glob = $2;`20
X`09    $re .= '(' . join('`7C',map(quotemeta,split(/,/, $alts))) . ')';`20
X`09`7D`20
X`09elsif ($glob =`7E /`5E(.`5B`5E`5B`7B*?`5D*)(.*)$/) `7B`20
X`09    $re .= quotemeta($1);`20
X`09    $glob = $2;`20
X`09`7D`20
X`09else `7B`20
X`09    # shouldn't get here.  If we do, give up`20
X`09    $glob = '';`20
X`09`7D`20
X    `7D`20
X    $re .= '$';`20
X    return $re;`20
X`7D`20
X`20
X1;`20
$ call unpack [.VILE-8_0.PERL]GLOB2RE.PL;1 -
 1919313526 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 2 146 152
$!
$ create 'f'
X#!/usr/bin/perl -w
X#
X# hgrep.pl
X#
X#   This script is meant to be used with `5Bx`5Dvile's perl interface to
X#   provide a nifty recursive grep facility complete with hypertext
X#   links.
X#
X#   One of the things which makes it so nifty is that it doesn't
X#   search binary files.  (If you want it to, just \2F07for and
X#   remove the -T in the code below.)  So it's perfectly safe to
X#   just search * in most cases rather than using a restrictive
X#   filter like *.`5Bhc`5D
X#
X# Installation
X# ------------
X#  `20
X#   Place hgrep.pl, glob2re.pl, and visit.pl in either `7E/.vile/perl
X#   or in /usr/local/share/vile/perl.  (The exact location of the
X#   latter may vary depending on how you configured `5Bx`5Dvile.
X#
X# Usage
X# -----
X#
X#   hgrep will be easier to use if the following procedure is defined
X#   in your .vilerc file:
X#
X#   store-procedure hgrep
X#       perl "require 'hgrep.pl'"
X#       perl hgrep
X#`09; uncomment next line to use results with error-finder.
X#`09; error-buffer $cbufname
X#   `7Eendm
X#
X#   Once this procedure, is defined, just type
X#
X#`09:hgrep
X#
X#   and answer the ensuing questions.
X#
X#   A new buffer will be created with embedded hypertext commands to
+-+-+-+-+-+-+-+-  END  OF PART 144 +-+-+-+-+-+-+-+-
-+-+-+-+-+-+-+-+ START OF PART 145 -+-+-+-+-+-+-+-+
X#   vist the places in the files where matched text is found.  These
X#   hypertext commands may be activated by double clicking in xvile
X#   or using the "execute-hypertext-command" \0907 from vile.  (See
X#   the Hypertext section of vile.hlp for some convenient key bindings.)
X#
X# Additional Notes
X# --------\0808
X#  `20
X#   As not much has been written about it yet, this module is an
X#   example of how to use the perl interface.
X#
X#`09`09&0209- kev (4/3/1998)
X#
X
X
Xuse File::Find;
Xuse FileHandle;
Xuse English;
Xrequire 'glob2re.pl';
Xrequire 'visit.pl';
X
Xmy $rgrep_oldspat = '';
Xmy $rgrep_oldroot = '.';
X
Xsub hgrep `7B
X
X    my ($spat, $root, $fpat) = @_;
X
X    if (!defined($spat)) `7B
X`09$spat = Vile::mlreply_no_opts("Pattern to search for? ", $rgrep_oldspat);
X`09return if !defined($spat);
X    `7D
X    $rgrep_oldspat = $spat;
X
X    while (!defined($root)) `7B
X`09$root = Vile::mlreply_dir("Directory to search in? ", $rgrep_oldroot);
X`09return if !defined($root);
X    `7D
X    $rgrep_oldroot = $root;
X
X    while (!defined($fpat)) `7B
X`09$fpat = Vile::mlreply_no_opts("File name pattern? ", "*");
X`09return if !defined($fpat);
X    `7D
X
X    my $resbuf = new Vile::Buffer "rgrep $spat $root $fpat";
X
X    print $resbuf "Results of searching for /$spat/ in $root with filter $fpat
V...`5Cn--------\0807`5Cn";
X
X    $fpat = glob2re($fpat);
X
X    my $code = '
X    find(
X`09sub `7B`20
X`09    if (-f `26`26 -T &0226 $_ ne "tags" &0226 /'`20
X    .        \0808  $fpat`20
X    .        \0808\1006'/) `7B
X`09`09my $fname = $File::Find::name;
X`09`09if (open SFILE, "<$_") `7B
X`09`09    local($_);
X`09`09    while (<SFILE>) `7B
X`09`09`09if (/'`20
X    .        \0808\1008$spat
X    .        \0808\100C'/) `7B
X`09`09`09    chomp;
X`09`09`09    s/`5E(.*?)('
X    .`09`09`09        $spat
X    .        \0808\1010')/$1 . "`5Cx01"`20
X        \0808\1010\200B. length($2)`20
X        \0808\1010\200B. q#BHperl "visit(`5C'#
X`09`09&0209`09   . $fname
X`09`09&0209`09   . qq(`5C',)`20
X`09`09&0209`09   . $INPUT_LINE_NUMBER
X`09`09&0209`09   . q(,)
X`09`09&0209`09   . length($1)
X`09`09&0209`09   . qq#)"`5C0:#
X`09`09&0209`09   . $2/e;
X`09`09`09    print $resbuf "$fname`5C`5B$INPUT_LINE_NUMBER`5D: $_`5Cn";
X`09`09`09`7D
X`09`09    `7D
X`09`09    close SFILE;
X`09`09`7D
X`09`09else `7B
X`09`09    print $resbuf "Warning: Can`5C't open $fname`5Cn";
X`09`09    #print "Warning: Can`5C't open $fname`5Cn");
X`09`09`7D
X`09    `7D
X`09`7D,
X`09$root);
X    ';
X
X    eval $code;
X    if (defined($@) `26`26 $@) `7B
X`09print "$@";
X    `7D
X    else `7B
X`09print $resbuf "`5Cn`5Cn";
X`09$Vile::current_buffer = $resbuf;
X`09$resbuf->setregion(1,'$')
X`09       ->attribute_cntl_a_sequences
X`09       ->unmark
X`09       ->dot(3);
X    `7D
X`7D
X
X1;
$ call unpack [.VILE-8_0.PERL]HGREP.PL;1 -
 995898249 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 8 147 152
$!
$ create 'f'
X#!/usr/local/bin/perl
X#
X# This script replaces backspace sequences with Ctrl-A attribut\200B
X# suitable for processing by vile.  It also attributes headings in bold.
X#
X# The C language version of this filter, also distributed with vile,
X# is much faster.
X#
X# $Header: /usr/build/vile/vile/perl/RCS/manfilt.pl,v 1.1 1994/07/11 22:56:20
V tom Exp $
X#
Xwhile (<>) `7B
X    if (/`5E`5BA-Z`5D`5BA-Z`5D/) `7B
X`09$_ = "`5C001" . length($_) . "B:" . $_;
X`09next;
X    `7D
X    next unless /`5B`5Cb`5D/o;
X    s/(.)(`5B`5Cb`5D`5C1)+/`5C002`5C1/go;
X    for (;;) `7B
X`09last unless
X`09    $att =  /(_`5B`5Cb`5D`5C002.)+/o `26`26 "UB:"
X`09`09 `7C`7C /(_`5B`5Cb`5D.)+/o `26`26 "U:"
X`09         `7C`7C /(`5C002.)+/o `26`26 "B:";
X`09$beg = $`60; $cur = $`26; $end = $';
X`09$cur =`7E s/(_`5B`5Cb`5D)`7C`5C002//go;
X`09$_ = $beg . "`5C001" . length($cur) . $att . $cur . $end;
X    `7D
X`7D
Xcontinue `7B
X    print;
X`7D
X
$ call unpack [.VILE-8_0.PERL]MANFILT.PL;1 -
 609755823 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 2 148 152
$!
$ create 'f'
Xpackage Vile::Search;
X
X#
X# This package contains perl subroutines which are intended as a
X# drop in replacement for vile's search facilities.  Not all features
X# (such as visual matches) are implemented yet.
X#
X# These bindings are proper motions, however, so things like 'dn'
X# or 'd/foo' will work as expected.
X#
X# Usage
X# -----
X# :perl require "search.pl";
X
X*CHUNKSIZE = `5C100;
Xmy $direction = '';
X
X#open TTY, ">/dev/tty";`09`09`09# for debugging
X
X#
X# Get the pattern to search for, either from the user or\1109
X# previously stashed value in vile's search variable.
X#
X
Xsub getpat `7B
X    my ($how, $ldirection) = @_;
X
X    if (defined($how) and $how eq 'noprompt') `7B
X`09$pat = Vile::get('search')
X    `7D
X    else `7B
X`09$direction = $l\0E09;
X`09$pat = Vile::mlreply_no_opts($direction eq 'forward'`20
X`09        \0808\100F? 'Perl search: '`20
X`09`09&0209       : 'Reverse perl search: ',
X        \0808\1010     scalar Vile::get('search'));
X    `7D
X    Vile::set(search => $pat) if defined($pat);
X    return $pat;
X`7D
X
X#
X# Back references (e.g, `5C1, `5C2, etc.) need to be adjust\0F06work
X# properly since our search expression contains parenthesized
X# expressions too.
X#
X
Xsub fixbackreferences `7B
X    my $pat = shift;
X    my $adj = shift;
X    my $lpcount = 0;`09`09# number of unescaped left parens
X
X    $lpcount++ while $pat =`7E /(`5E`7C`5B`5E`5C`5C`5D)`5C(/g;
X
X    if ($lpcount > 0) `7B
X`09$pat =`7E s/`5C`5C(`5C`5B1-9`5D`5B0-9`5D*`7C.)/
X`09         "`5C`5C" . (($1 + 0 `26`26 $1 <= $lpcount) ? $1+$adj : $1)/gex;
X    `7D
X
X    return $pat;
X`7D
X
X#
X# Search forward.  This is not as straight\2107 as it could be since
X# we attempt to fetch the lines in chunks for efficient searching.
X#
X
Xsub fsearch `7B
X    my $pat = getpat(shift, 'forward');
X   `20
X    return 0 unless defined($pat);
X
X    my $wrap       = 0;
X    my $cb         = $Vile::current_buffer;
X    my @start_dot  = $cb->current_position;
X    my $lastline   = ($cb->setregion(1,'$'))`5B2`5D;
X    my $chunkstart = $start_dot`5B0`5D;
X    my $pos        = $start_dot`5B1`5D+1;
X
X    if ($pos >= ($cb->setregion($chunkstart,0,\0E0C'$$'))`5B3`5D) `7B
X`09$pos = 0;
X`09$chunkstart++;
X`09$chunkstart = 1 if (\140C> $lastline);
X    `7D
X
X    my $chunkend   =\0E07start + $CHUNKSIZE;
X
X    $pat = fixbackreferences($pat, 1);
X
X    while (1) `7B
X`09$cb->set_region($chunkstart, \0D06end-1);
X`09$chunk = $cb->fetch;
X`09pos($chunk) = $pos;
X`09$pos = 0;
X`09if ($chunk =`7E /($pat)/mg) `7B
X`09    my $lc = 0;
X`09    my $matchlen = length($1);
X`09    $chunk = substr(\1006, 0, pos\0F07));
X`09    $lc++ while $chunk =`7E /`5Cn/g;
X`09    $chunk =`7E s/.*`5Cn//g;
X`09    $cb->current_position($chunkstart + $lc, length\1A07) - $matchlen);
X`09    if ($wrap) `7B
X`09`09@dot = $cb->current_position;
X`09`09if ($start_dot`5B0`5D == $\0B07and $\1D0A1\1D0A1`5D) `7B
X`09`09    print "Only one occurence of pattern";
X`09`09`7D
X`09`09else `7B
X`09`09    print "`5BSearch wrapped past end of buffer`5D";
X`09`09`7D
X`09    `7D
X`09    return 1;
X`09`7D
X    `7D
X    continue `7B
X`09$chunkstart = \0E06end;
X`09if ($wrap) `7B
X`09    last if $chunkstart > $start_dot`5B0`5D;
X`09`7D
X`09elsif ($chunkstart > $lastline) `7B
X`09    $wrap = 1;
X`09    $chunkstart = 1;
X`09`7D
X`09$chunkend = \0C06start + $CHUNKSIZE;
X    `7D
X
X    print "Not found";
X    return 0;
X`7D
X
X#
X# Search backward
X#
X
Xsub rsearch `7B
X    my $pat = getpat(shift, 'backward');
X    return 0 unless defined($pat);
X
X    my $wrap       = 0;
X    my $cb         = $Vile::current_buffer;
X    my @start_dot  = $cb->current_position;
X    my $lastline   = ($cb->setregion(1,'$'))`5B2`5D;
X    my $chunkend   = $start_dot`5B0`5D+1;
X    my $pmpat;
X
X
X    if ($start_dot`5B1`5D == 0) `7B
X`09if ($chunkend <= 2) `7B
X`09    $chunkend = $lastline+1;
X`09`7D
X`09else `7B
X`09    $chunkend--;
X`09`7D
X`09$pmpat = '.*';
X    `7D
X    else `7B
X`09$pmpat = ".`7B0,@`7B`5B$start_dot`5B1`5D-1`5D`7D`7D";
X    `7D
X
X    my $chunkstart =\0E07end - 1;
X
X    $chunkstart = 1 unless\170D> 0;
X    $cb->set_region($chunkstart, 0, \1006end-1, '$');
X
X    $pat = fixbackreferences($pat, 2);
X
X    # $ matches at both the newline and the position after\230C.
X    # Eliminate one of these cases.
X    $pat =`7E s/(`5E`7C`5B`5E`5C`5C`5D)`5C$$/$1(?=`5Cn`5C$)/;
X
X    while (1) `7B
X`09$chunk = $cb->fetch;
X`09pos($chunk) = $pos;
X`09$pos = 0;
X`09if (my ($prematch, $match) = $chunk =`7E /`5CA($pmpat)($pat)/mg) `7B
X`09    my $lc = 0;
X`09    $lc++ while ($prematch =`7E /`5Cn/g);
X`09    $prematch =`7E s/.*`5Cn//g;
X`09    $cb->current_position($chunkstart + $lc, length($prematch) );
X`09    if ($wrap) `7B
X`09`09@dot = $cb->current_position;
X`09`09if ($start_dot`5B0`5D == $\0B07and $\1D0A1\1D0A1`5D) `7B
X`09`09    print "Only one occurence of pattern";
X`09`09`7D
X`09`09else `7B
X`09`09    print "`5BSearch wrapped past end of buffer`5D";
X`09`09`7D
X`09    `7D
X`09    return 1;
X`09`7D
X    `7D
X    continue `7B
X`09$chunkend = \0C06start;
X`09if ($wrap) `7B
X`09    last if $chunkend <= $start_dot`5B0`5D;
X`09`7D
X`09elsif ($chunkend <= 1) `7B
X`09    $wrap = 1;
X`09    $chunkend = $lastline + 1;
X`09`7D
X`09$chunkstart = \0E06end - $CHUNKSIZE;
X`09$chunkstart = 1 unless \170C> 0;
X`09$cb->set_region($chunkstart, \0D06end-1);
X`09$pmpat = "`5B`5C000-`5C377`5D*";
X    `7D
X
X    print "Not found";
X    return 0;
X`7D
X
X#
X# Find next occurrence of pattern in the \1B06t direction
X#
X
Xsub searchnext `7B
X    $direction eq 'forward' ? fsearch('noprompt') : r\1612;
X`7D
X
X#
X# Find previous occurrence of pattern in \1706t direction
X#
X
Xsub searchprev `7B
X    $direction eq 'forward' ? rsearch('noprompt') : f\1612;
X`7D
X
X#
X# Register the above as Vile procedures
X#
X
XVile::register_motion 'perl-fsearch' => `5C`26\0E07, "Forward \1F06 with perl"
V;
XVile::register_motion 'perl-rsearch' => `5C`26\0E07, "Reverse \1F06 with perl"
V;
XVile::register_motion 'perl-search-next' => `5C`26\1206next, "Search next";
XVile::register_motion 'perl-search-prev' => `5C`26\1206prev, "Search prev";
X
X#
X# Set up the standard keybindings
X#
X
XVile::command("bind-key perl-fsearch /");
XVile::command("bind-key perl-rsearch ?");
XVile::command("bind-key perl-search-next n");
XVile::command("bind-key perl-search-prev N");
X
X1;
$ call unpack [.VILE-8_0.PERL]SEARCH.PL;1 -
 1650064174 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 13 149 152
$!
$ create 'f'
Xrequire "Comm.pl";
X
X#$Debug = 1;
XComm::init();
X
Xmy %shells = ();
X
Xsub terminal_emulation ($$);
X
X#
X# Not meant to be complete.  Just enough so that I could use
X# bash
X#
X
Xsub terminal_emulation ($$) `7B
X    my ($vbp, $buf) = @_;
X
X    my (@dot,@endot,@donedot);
X
X    # Figure out what to do about DOT.  If it's near the end, then
X    # leave it alone.  Otherwise, mo\1B06to the end.
X
X    @donedot = @dot = $vbp->dot;
X    @enddot = $vbp->dot('$','$$');
X
X    if ($dot`5B0`5D >= $en\0D06-1) `7B
X`09$vbp->dot(@dot);`09`09# restore dot
X`09@donedot = ();`09`09`09# no finish dot
X    `7D
X    else `7B
X`09@dot = @enddot;
X    `7D
X
X    while (length($buf) > 0) `7B
X`09if ($buf =`7E /`5E(`5B`5Cx09`5Cx20-`5Cx377`5D+)(.*)$/s) `7B
X`09    # Handle sequence of printable characters
X`09    $vbp->setregion(@dot, $dot`5B0`5D\09071`5D+length($1))
X`09        ->delete;
X`09    print $vbp $1;
X`09    $buf = $2;
X`09    @dot = $vbp->dot;
X`09`7D
X`09elsif ($buf =`7E /`5E`5Cr(.*)$/s) `7B
X`09    # `5EM`09`09&0209-- beginning of line
X`09    $dot`5B1`5D = 0;
X`09    $vbp->dot(@dot);
X`09    $buf = $1;
X`09`7D
X`09elsif ($buf =`7E /`5E`5Cn(.*)$/s) `7B
X`09    # `5EJ`09`09&0209-- down a line
X`09    #`09 (Normally, this should just move down one line,
X`09    #`09  but we've combined `5Cn's with `5Cr's before getting
X`09    #`09  here...)
X`09    $dot`5B0`5D++;
X`09    @enddot = $vbp->dot('$','$$');
X`09    if ($dot`5B0`5D > $end\0D06) `7B
X`09`09print $vbp "`5Cn";
X`09`09#if ($dot`5B1`5D > 0) `7B
X`09`09#    print $vbp ' ' x $dot`5B1`5D;
X`09`09#`7D
X`09`09@dot = $vbp->dot;
X`09    `7D
X`09    else `7B
X`09`09$vbp->dot(@dot);
X`09    `7D
X`09    $buf = $1;
X`09`7D
X`09elsif ($buf =`7E /`5E(`5Cx08+)(.*)$/s) `7B
X`09    # Handle `5EH
X`09    $dot`5B1`5D -= length($1);
X`09    if ($dot`5B1`5D < 0) `7B
X`09`09$dot`5B1`5D = 0;
X`09    `7D
X`09    $buf = $2;
X`09    $vbp->dot(@dot);
X`09   `20
X`09    if ($vbp->setregion(@dot, $dot`5B0`5D, '$')->fetch =`7E /`5E`5Cs+$/)`20
V`7B
X`09`09# Delete 'til end of line if all spaces
X`09`09$vbp->delete;
X`09    `7D
X`09    $vbp->dot(@dot);`09# fetch moved dot on us
X`09`7D
X`09elsif ($buf =`7E /`5E(`5Cx07+)(.*)$/) `7B
X`09    Vile::beep();
X`09    $buf = $2;
X`09`7D
X`09elsif ($buf =`7E /`5E`5Ce`5C`5B(`5Cd*)P(.*)$/s) `7B
X`09    # ESC, `5B, optional-digits, P`09-- delete characters forward
X`09    my $digs;
X`09    $digs = ($1 eq "") ? 1 : $1;
X`09    $vbp->setregion(@dot, $dot`5B0`5D\09071`5D+$digs)->delete;
X`09    $buf = $2;
X`09`7D
X`09elsif ($buf =`7E /`5E`5Ce`5C`5B(`5Cd*)@(.*)$/s) `7B
X`09    # ESC, `5B, optional-digits, @`09-- insert N characters
X`09    my $digs;
X`09    $digs = ($1 eq "") ? 1 : $1;
X`09    $buf = $2;
X`09    # To do this right, we probably have an "insert" mode..
X`09    $buf =`7E /`5E(.`7B,$digs`7D)(.*)$/s;
X`09    print $vbp $1;
X`09    $buf = $2;
X`09`7D
X`09elsif ($buf =`7E /`5E`5Ce`5C`5BK(.*)$/s) `7B
X`09    # ESC, `5B, K`09`09&0209-- erase 'til eol
X`09    $vbp->setregion(@dot, $dot`5B0`5D, '$$')->delete;
X`09    $buf = $1;
X`09`7D
X`09else `7B
X`09    # Unhandled control character(s)
X`09    # just print them out...
X`09    # (And when they annoy you enough, add a case to handle
X`09    # them above.)
X
X`09    $buf =`7E /`5E(.)(.*)$/s;
X
X`09    $vbp->setregion(@dot, $dot`5B0`5D\09071`5D+length($1))
X`09        ->delete;
X`09    print $vbp $1;
X`09    $buf = $2;
X`09    @dot = $vbp->dot;
X`09`7D
X    `7D
X
X    if (@donedot) `7B
X`09$vbp->dot(@donedot);
X    `7D
X`7D
X
X
X
Xsub shell `7B
X    my $oldworking = Vile::\1007();`09`09# fetch old value of \3107
X    Vile::working(0);`09`09&0209# disable \1907... messages
X
X    $`7C = 1;
X
X    my $shell = $ENV`7BSHELL`7D;
X    $shell = '/bin/sh' unless defined(\2206);
X
X    my ( $Proc_pty_handle,\1207t\120Cpid ) = `26open_proc( $shell );
X    die "open_proc failed" unless $Proc_pty_handle;
X
X    my $vbp = new Vile::Buffer;
X    $vbp->buffername("shell-$pid");
X    Vile->current_buffer($vbp);
X    print $vbp " `5Cn";
X    $vbp->unmark()->dot('$$');
X    Vile::update();
X
X
X    $shells`7B$pid`7D`7BPTY_HANDLE`7D = $Proc_pty_handle;
X    $shells`7B$pid`7D`7BBUF_HANDLE`7D = $vbp;
X
X    my $sanity_initialized = 0;
X
X    Vile::watchfd(
X`09fileno($Proc_pty_handle),
X`09'read',
X`09sub `7B
X`09    my $buf = ' ' x 4096;
X`09    my @olddot = $vbp->dot;
X`09    my $lastlnum;
X
X`09    unless ($sanity_initialized) `7B
X`09`09`26stty_sane($Proc_tty_handle);`09# use \1906p\1909 for HP
X`09`09$sanity_initialized = 1;
X`09    `7D
X
X`09    # Fetch data from input stream
X`09    sysread $Proc_pty_handle, $buf, 4096;
X
X`09    $buf =`7E s/`5Cr`5Cn/`5Cn/gs;`09`09# nuke `5EM's
X
X`09    @dot = $vbp->dot('$','$$');
X
X
X`09    if (length($buf) < 256
X`09        `26`26 ($buf =`7E /`5B`5Cx01-`5Cx08`5Cx11-`5Cx1f`5D/
X`09            `7C`7C $olddot`5B0`5D != $\0B07
X`09`09    `7C`7C $olddot`5B1`5D != $\0B06))
X`09    `7B
X`09`09# Yuck, it contain's control characters, or it's
X`09`09# not at the end of the buffer
X`09`09# ...we have some work to do
X`09`09$vbp->dot(@olddot);
X`09`09terminal_emulation($vbp, $buf)
X`09    `7D
X`09    else `7B
X`09`09# Blast it out...
X`09`09#print "Blast $blast";\0907++;
X
X`09`09# Set Position to end of buffer and retrieve this line number
X
X`09`09# Write data to the editor's buffer
X`09`09print $vbp $buf;
X
X`09`09# Reset old position of dot if not near end of buffer
X`09`09if ($olddot`5B0`5D < $\0A07- 1) `7B
X`09`09    $vbp->dot(@olddot);
X`09`09`7D
X`09    `7D
X`09    # Nuke the `5Bmodified`5D message
X`09    $vbp->unmark();
X
X`09    # Update the screen
X`09    Vile::update();
X`09    # Something to look into... uncomment the following line: segfault
X`09    #print "After update: ", join(',',$vbp->dot());
X`09`7D
X    );
X
X    my $c;
X    while (($c = Vile::keystroke()) != 7) `7B`09`09# `5EG escapes
X`09print $Proc_pty_handle chr($c);
X    `7D
X
X    Vile::working($old\0C07);`09`09`09# restore "\2307..." message
X    `09`09&0209&0209# to previous state
X`7D
X
Xsub resume_shell `7B
X    my $pid;
X    ($pid) = ($Vile::current_buffer->\0806name() =`7E /`5Eshell-(`5Cd+)$/);
X
X    if (!defined($pid) or \120Ashells`7B$pid`7D`7BPTY_HANDLE`7D)) `7B
X`09print "Not in a shell window!";
X`09return;
X    `7D
X
X    my $Proc_pty_handle = $shells`7B$pid`7D`7BPTY_HANDLE`7D;
X    my $vbp = $shells`7B$pid`7D`7BBUF_HANDLE`7D;
X
X    my $oldworking = Vile::\1007();`09`09# fetch old value of \3107
X    Vile::working(0);`09`09&0209# disable \1907... messages
X
X    $vbp->dot('$','$$');
X    Vile::update();
X
X    my $c;
X    while (($c = Vile::keystroke()) != 7) `7B`09`09# `5EG escapes
X`09print $Proc_pty_handle chr($c);
X    `7D
X
X    Vile::working($old\0C07);`09`09`09# restore "\2307..." message
X`7D
X
X1;
$ call unpack [.VILE-8_0.PERL]SHELL.PL;1 -
 1899968215 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 13 150 152
$!
$ create 'f'
Xuse FileHandle;
X
Xsub tailf `7B
X    my ($fname) = @_;
X    my $vbuf;
X    my $fh = new FileHandle;
X
X    open $fh, "tail -f $fname `7C"`09or die "Can't\2B08name";
X
X    $vbuf = Vile::Buffer->new();
X    Vile->current_buffer($vbuf);
X    $vbuf->buffername($fname);
X
X    Vile::watchfd(
X`09fileno($fh),
X`09'read',
X`09sub `7B`20
X`09    my $buf = ' ' x 4096;
X`09    my @olddot = $vbuf->dot;
X`09    my $lastlnum;
X
X`09    # Fetch data from input stream
X`09    sysread $fh, $buf, 4096;
X
X`09    # Set Position to end of buffer and retrieve this line number
X`09    $lastlnum = $vbuf->dot('$$');
X
X`09    # Write data to the editor's buffer
X`09    print $vbuf $buf;
X
X`09    # Reset old position of dot if not near end of buffer
X`09    if ($olddot`5B0`5D < $lastlnum - 1) `7B
X`09`09$vbuf->dot(@olddot);
X`09    `7D
X
X`09    # Update the screen
X`09    Vile::update();
X`09`7D
X    );
X`7D
X
X1;
$ call unpack [.VILE-8_0.PERL]TAILF.PL;1 -
 874789371 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 2 151 152
$!
$ create 'f'
Xsub visit `7B
X    my ($fname, @dot) = @_;
X
X    die "visit: No filename!"`09`09if !defined($fname);
X
X    my $visbuf = Vile::Buffer->edit($fname);
X
X    $visbuf->dot(@dot)`09`09`09if (@dot == 1) `7C`7C\0F0A2);
X
X    Vile->current_buffer($visbuf);
X
X    1;
X`7D
X
X1;
$ call unpack [.VILE-8_0.PERL]VISIT.PL;1 -
 930289948 "FORMAT STREAM_LF;CARRIAGE_CONTROL CARRIAGE_RETURN" 1 152 152
$ v=f$verify(v)
$ exit
