home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume29 / pdksh / patch03a < prev    next >
Encoding:
Text File  |  1992-04-25  |  29.9 KB  |  1,352 lines

  1. Newsgroups: comp.sources.misc
  2. From: sjg@zen.void.oz.au (Simon J. Gerraty)
  3. Subject:  v29i083:  pdksh - Public Domain Korn Shell, v4, Patch03a/5
  4. Message-ID: <1992Apr26.041420.21937@sparky.imd.sterling.com>
  5. X-Md4-Signature: 217984c7db21459f0fe18fcfae6ca2ed
  6. Date: Sun, 26 Apr 1992 04:14:20 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: sjg@zen.void.oz.au (Simon J. Gerraty)
  10. Posting-number: Volume 29, Issue 83
  11. Archive-name: pdksh/patch03a
  12. Environment: UNIX
  13. Patch-To: pdksh: Volume 25, Issue 47-55
  14.  
  15. Before applying this patch you must:
  16.  
  17.     mv sh/ulimit.c sh/do_ulimit.c
  18.  
  19. Apply the patch:
  20.  
  21.     patch -p0 < patch03a
  22.     patch -p0 < patch03b
  23.     patch -p0 < patch03c
  24.     patch -p0 < patch03d
  25.     patch -p0 < patch03e
  26.  
  27. Prereq: 09-Nov-91
  28. Prereq: 10-Nov-91
  29. Prereq: 25-Nov-91
  30. Prereq: 25-Apr-92
  31. *** PATCHDATES.old    Sat Apr 25 17:44:07 1992
  32. --- PATCHDATES    Sun Apr 26 10:21:49 1992
  33. ***************
  34. *** 3,5 ****
  35. --- 3,6 ----
  36.   10-Nov-91
  37.   25-Nov-91
  38.   25-Apr-92
  39. + 26-Apr-92
  40. *** sh/ChangeLog.old    Sat Apr 25 17:44:13 1992
  41. --- sh/ChangeLog    Sat Apr 25 00:24:10 1992
  42. ***************
  43. *** 1,3 ****
  44. --- 1,90 ----
  45. + Sat Apr 25 00:20:51 1992  Simon J. Gerraty  (sjg@zen)
  46. +     * Implemented a simple history file.
  47. +     The default file is "$HOME/.pdksh_hist" but can be changed by
  48. +     setting HISTFILE in any of /etc/profile,.profile or .kshrc.
  49. +     The format is trivial - one line per history item.  
  50. +     You can creat a set history file, by making it read-only.
  51. +     History is only saved during wrap-up and only if the file is
  52. +     writeable.  NOTE: if writeable the file is OVERWRITTEN.
  53. + Fri Apr 24 22:22:04 1992  Simon J Gerraty  (sjg@zen)
  54. +     * sigact.c: New file.
  55. +     An implementation of sigaction() and freinds, which simply
  56. +     interfaces to BSD's setsigmask() et al, BSD4.1's setsig() or plain
  57. +     old signal(2).  It attempts to use the most useful available.
  58. +     If it thinks the system really has sigaction() it compiles to
  59. +     noting, and its header sigact.h does nothing.
  60. +     At present all use of sigaction is bounded by USE_SIGACT, if/when
  61. +     this approach appears to work, the alternatives will be withdrawn.
  62. + Fri Apr 24 10:42:40 1992  Simon J Gerraty  (sjg@taureau)
  63. +     * Added support for sigaction and friends!, turns out sigset() 
  64. +     et al just don't handle job control.  Define USE_SIGACT if you
  65. +     have sigaction().  Job control now works on this System V machine
  66. +     (Bull DPX/2).
  67. +     * getsc_(lex.c), x_getc(edit.c):  Added goto's! to allow the
  68. +     read() calls to be retried (on systems that don't do it
  69. +     automatically) if the read() was interrupted by a SIGCHLD
  70. +     (sigchld_caught > 0).  This was the cause of the problem with an
  71. +     async child terminating the shell on System V.
  72. + Wed Apr 22 14:57:01 1992  Simon J Gerraty  (sjg@taureau)
  73. +     * exchild(jobs.c): block SIGCHLD when fork()ing, until safe to
  74. +     receive.
  75. +     * Added support? for sigset() and friends.  Allow JOBS to work on
  76. +     System V machines.  This does NOT work right yet.
  77. +     With JOBS defined, an async process terminates the shell when it
  78. +     (the child) exits, and ^Z does nothing!  
  79. + Tue Apr 21 15:18:08 1992  Simon J. Gerraty  (sjg@sun0)
  80. +     * removed const qualifyer from setctypes() 1st arg, as gcc-2.1
  81. +     generates incorrect code for this function.  This is a temperary
  82. +     hack until gcc is fixed.
  83. +     * do not install std/stdc/stdarg.h in std/h, any compiler that
  84. +     will use stdarg.h should have one.
  85. + Sun Apr 19 20:16:32 1992  Simon J. Gerraty  (sjg@zen)
  86. +     * added support of stdargs to tree.c and _fixed_ the use of
  87. +     varargs. 
  88. + Sat Apr 18 16:35:48 1992  Simon J. Gerraty  (sjg@zen)
  89. +     * x_read(edit.c): added logic to check $EDITOR etc.
  90. + Fri, 10 Jan 92 13:13:52      Bullseye Software  (sumax!polari!bullseye)
  91. +     * alloc.c:afreeall() references memory it has already deallocated.
  92. + Wed, 1 Jan 92 20:03:55    Bert Gijsbers (a430mcb1@diamond.sara.nl)
  93. +     * expand(eval.c):  PS1='${PWD##/*/}[!]% ' prints also characters
  94. +     with ascii = 128 
  95. +     * main(main.c): Testing whether the first letter of argv[0] is a
  96. +     '-' does not work when ksh reads .kshrc.
  97. + Sun, 29 Dec 91 20:05:02  Bert Gijsbers (a430mcb1@diamond.sara.nl)
  98. +     * Support for Minix.
  99. + Wed, 11 Dec 91 12:41:31    Kees J. Bot (kjb@cs.vu.nl)
  100. +     * fixes for sun3 with 4.1.1
  101. + Wed, 4 Dec 91 15:53:43  Reg Quinton (reggers@julian.uwo.ca)
  102. +     * fixes for SGI
  103.   Mon Nov 25 12:36:42 1991  Simon J. Gerraty  (sjg at zen)
  104.   
  105.       * stdh.h:  make sure FD_CLEXEC is defined if we support F_SETFD.
  106. *** sh/Makefile.old    Sat Apr 25 17:44:13 1992
  107. --- sh/Makefile    Sat Apr 25 18:33:13 1992
  108. ***************
  109. *** 1,10 ****
  110.   # PD Bourne/Korn Shell
  111. ! # @(#)Makefile 1.3 91/11/25 13:33:10
  112.   
  113.   SHELL = /bin/sh
  114.   MAKE  = make
  115.   
  116. ! LN    = ln
  117.   
  118.   # You _can_ build this shell without the ../std tree if your
  119.   # system provides a sufficiently POSIX environment, or if your
  120. --- 1,10 ----
  121.   # PD Bourne/Korn Shell
  122. ! # $Id: Makefile,v 1.2 1992/04/25 08:33:03 sjg Exp $
  123.   
  124.   SHELL = /bin/sh
  125.   MAKE  = make
  126.   
  127. ! LN    = ln -s
  128.   
  129.   # You _can_ build this shell without the ../std tree if your
  130.   # system provides a sufficiently POSIX environment, or if your
  131. ***************
  132. *** 13,19 ****
  133.   # gcc is good value on most mc68k's and sun386's if nothing else.
  134.   # if you don't have gcc cc should do
  135.   # CC=gcc -pipe
  136. ! CC=cc
  137.   
  138.   # The following are the defintions used (or thereabouts) 
  139.   # to build ksh without ../std
  140. --- 13,19 ----
  141.   # gcc is good value on most mc68k's and sun386's if nothing else.
  142.   # if you don't have gcc cc should do
  143.   # CC=gcc -pipe
  144. ! CC=gcc -pipe 
  145.   
  146.   # The following are the defintions used (or thereabouts) 
  147.   # to build ksh without ../std
  148. ***************
  149. *** 20,32 ****
  150.   #
  151.   # sun386 SunOS 4.0.2, sun3 SunOS 4.0.3
  152.   # CONFIG=-D_BSD
  153. ! # XOPTS=-DNOSTDHRDS
  154.   # copy these from ../std/stdc or ensure they are in libstdc.a
  155.   # XOBJS = memmove.o strstr.o 
  156.   #
  157.   # sun3  SunOS 4.1.1
  158.   # CONFIG=-D_BSD
  159. ! # XOPTS=-DNOSTDHRDS
  160.   # copy these from ../std/stdc or ensure they are in libstdc.a
  161.   # XOBJS = memmove.o
  162.   #
  163. --- 20,32 ----
  164.   #
  165.   # sun386 SunOS 4.0.2, sun3 SunOS 4.0.3
  166.   # CONFIG=-D_BSD
  167. ! # XOPTS=-DNOSTDHDRS
  168.   # copy these from ../std/stdc or ensure they are in libstdc.a
  169.   # XOBJS = memmove.o strstr.o 
  170.   #
  171.   # sun3  SunOS 4.1.1
  172.   # CONFIG=-D_BSD
  173. ! # XOPTS=-DNOSTDHDRS
  174.   # copy these from ../std/stdc or ensure they are in libstdc.a
  175.   # XOBJS = memmove.o
  176.   #
  177. ***************
  178. *** 33,63 ****
  179.   # sun4c (sparc) SunOS 4.1.1
  180.   # CC=cc -pipe    # don't use gcc
  181.   # CONFIG=-D_BSD
  182. ! # XOPTS=-DNOSTDHRDS
  183.   # copy these from ../std/stdc or ensure they are in libstdc.a
  184.   # XOBJS = memmove.o
  185.   #
  186.   # Bull DPX/2 B.O.S. 2.00.45
  187. ! # CONFIG=-D_SYSV
  188.   # XOPTS=
  189.   # XOBJS=
  190.   #
  191.   
  192.   #CONFIG= -D_SYSV
  193.   #CONFIG= -D_BSD -DHAVE_SYS_STDTYPES
  194.   CONFIG= -D_BSD
  195.   
  196.   STD=../std
  197.   INCL=$(STD)/h
  198. ! XINCL=-I$(STD)/h
  199.   LDOPTS=-L$(STD)
  200.   XOBJS=
  201.   
  202.   # use -O if you trust it :-)
  203. ! #DBG=-g
  204.   CFLAGS = $(DBG) $(CONFIG) $(XINCL) $(XOPTS)
  205.   
  206. ! LDFLAGS = $(LDOPTS)
  207.   
  208.   COMPATLIBS = -lstdc -lposix
  209.   #XLIBS = -lc_s
  210. --- 33,70 ----
  211.   # sun4c (sparc) SunOS 4.1.1
  212.   # CC=cc -pipe    # don't use gcc
  213.   # CONFIG=-D_BSD
  214. ! # XOPTS=-DNOSTDHDRS
  215.   # copy these from ../std/stdc or ensure they are in libstdc.a
  216.   # XOBJS = memmove.o
  217.   #
  218.   # Bull DPX/2 B.O.S. 2.00.45
  219. ! # CC=gcc -ansi
  220. ! # CONFIG=-D_POSIX_SOURCE
  221.   # XOPTS=
  222.   # XOBJS=
  223.   #
  224. + # Minix-386 1.5.10 with estdio
  225. + # CONFIG= -D_BSD -D_MINIX -D_POSIX_SOURCE
  226. + # XOPTS=
  227. + # XOBJS=
  228. + #
  229.   
  230.   #CONFIG= -D_SYSV
  231.   #CONFIG= -D_BSD -DHAVE_SYS_STDTYPES
  232.   CONFIG= -D_BSD
  233.   
  234.   STD=../std
  235.   INCL=$(STD)/h
  236. ! XINCL=-I$(INCL)
  237.   LDOPTS=-L$(STD)
  238.   XOBJS=
  239.   
  240.   # use -O if you trust it :-)
  241. ! DBG=-g -O
  242.   CFLAGS = $(DBG) $(CONFIG) $(XINCL) $(XOPTS)
  243.   
  244. ! LDFLAGS = $(DBG) $(LDOPTS)
  245.   
  246.   COMPATLIBS = -lstdc -lposix
  247.   #XLIBS = -lc_s
  248. ***************
  249. *** 68,75 ****
  250.   SRCS1 =    version.c main.c misc.c trap.c alloc.c io.c \
  251.       syn.c lex.c edit.c emacs.c vi.c history.c tree.c 
  252.   SRCS2 =    exec.c jobs.c \
  253. !     c_sh.c c_ksh.c c_test.c getopts.c ulimit.c \
  254. !     var.c table.c eval.c expr.c mail.c trace.c
  255.   SRCS =    Makefile $(HDRS) $(SRCS1) $(SRCS2) 
  256.   
  257.   OBJS =    version.o main.o misc.o \
  258. --- 75,82 ----
  259.   SRCS1 =    version.c main.c misc.c trap.c alloc.c io.c \
  260.       syn.c lex.c edit.c emacs.c vi.c history.c tree.c 
  261.   SRCS2 =    exec.c jobs.c \
  262. !     c_sh.c c_ksh.c c_test.c getopts.c do_ulimit.c \
  263. !     var.c table.c eval.c expr.c mail.c sigact.c trace.c
  264.   SRCS =    Makefile $(HDRS) $(SRCS1) $(SRCS2) 
  265.   
  266.   OBJS =    version.o main.o misc.o \
  267. ***************
  268. *** 76,83 ****
  269.       syn.o lex.o edit.o emacs.o vi.o tree.o \
  270.       exec.o jobs.o trap.o \
  271.       c_sh.o c_ksh.o c_test.o \
  272. !     ulimit.o getopts.o expr.o history.o \
  273. !     var.o table.o alloc.o io.o eval.o mail.o trace.o $(XOBJS)
  274.   
  275.   ksh: $(OBJS) 
  276.       $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
  277. --- 83,90 ----
  278.       syn.o lex.o edit.o emacs.o vi.o tree.o \
  279.       exec.o jobs.o trap.o \
  280.       c_sh.o c_ksh.o c_test.o \
  281. !     do_ulimit.o getopts.o expr.o history.o \
  282. !     var.o table.o alloc.o io.o eval.o mail.o sigact.o trace.o $(XOBJS)
  283.   
  284.   ksh: $(OBJS) 
  285.       $(CC) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS)
  286. ***************
  287. *** 89,95 ****
  288.       rm -f ksh
  289.   
  290.   link:
  291. !     ($(SHELL) ../std/mklinks $(INCL) stdh.h)
  292.       
  293.   
  294.   depend:
  295. --- 96,102 ----
  296.       rm -f ksh
  297.   
  298.   link:
  299. !     ($(SHELL) ../std/mklinks ../std/h stdh.h)
  300.       
  301.   
  302.   depend:
  303. ***************
  304. *** 101,106 ****
  305. --- 108,119 ----
  306.       @echo "strip /bin/ksh"
  307.       @echo "chmod 555 /bin/ksh"
  308.   
  309. + .c.s:
  310. +     $(CC) $(CFLAGS) -S -o $@ $<
  311. + asms: $(OBJS:.o=.s)
  312.   # DO NOT DELETE THIS LINE -- make depend depends on it.
  313.   # If this runs make out of memory, delete /usr/include lines.
  314.   alloc.o: alloc.c
  315. ***************
  316. *** 233,238 ****
  317. --- 246,252 ----
  318.   syn.o: table.h
  319.   syn.o: trace.h
  320.   syn.o: tree.h
  321. + sigact.o: sigact.h sigact.c
  322.   table.o: config.h
  323.   table.o: sh.h
  324.   table.o: stdh.h
  325. ***************
  326. *** 252,262 ****
  327.   tree.o: trace.h
  328.   tree.o: tree.c
  329.   tree.o: tree.h
  330. ! ulimit.o: config.h
  331. ! ulimit.o: sh.h
  332. ! ulimit.o: stdh.h
  333. ! ulimit.o: trace.h
  334. ! ulimit.o: ulimit.c
  335.   var.o: config.h
  336.   var.o: expand.h
  337.   var.o: sh.h
  338. --- 266,276 ----
  339.   tree.o: trace.h
  340.   tree.o: tree.c
  341.   tree.o: tree.h
  342. ! do_ulimit.o: config.h
  343. ! do_ulimit.o: sh.h
  344. ! do_ulimit.o: stdh.h
  345. ! do_ulimit.o: trace.h
  346. ! do_ulimit.o: do_ulimit.c
  347.   var.o: config.h
  348.   var.o: expand.h
  349.   var.o: sh.h
  350. *** sh/alloc.c.old    Sat Apr 25 17:44:14 1992
  351. --- sh/alloc.c    Sat Apr 25 18:33:46 1992
  352. ***************
  353. *** 3,10 ****
  354.    */
  355.   
  356.   #ifndef lint
  357. ! static char *RCSid = "$Id";
  358. ! static char *sccs_id = "@(#)alloc.c    1.2 91/11/22 22:53:32 (sjg)";
  359.   #endif
  360.   
  361.   #include "stdh.h"
  362. --- 3,9 ----
  363.    */
  364.   
  365.   #ifndef lint
  366. ! static char *RCSid = "$Id: alloc.c,v 1.2 1992/04/25 08:33:28 sjg Exp $";
  367.   #endif
  368.   
  369.   #include "stdh.h"
  370. ***************
  371. *** 25,39 ****
  372.   
  373.   union Cell {
  374.       size_t    size;
  375. !     Cell   *next;
  376.       struct {int _;} junk;    /* alignment */
  377.   };
  378.   
  379.   struct Block {
  380. !     Block  *next;        /* list of Blocks in Area */
  381. !     Cell   *free;        /* object free list */
  382. !     Cell   *last;        /* &b.cell[size] */
  383. !     Cell    cell [1];    /* [size] Cells for allocation */
  384.   };
  385.   
  386.   Block aempty = {&aempty, aempty.cell, aempty.cell};
  387. --- 24,38 ----
  388.   
  389.   union Cell {
  390.       size_t    size;
  391. !     union Cell   *next;
  392.       struct {int _;} junk;    /* alignment */
  393.   };
  394.   
  395.   struct Block {
  396. !     struct Block  *next;        /* list of Blocks in Area */
  397. !     union Cell   *free;        /* object free list */
  398. !     union Cell   *last;        /* &b.cell[size] */
  399. !     union Cell    cell [1];    /* [size] Cells for allocation */
  400.   };
  401.   
  402.   Block aempty = {&aempty, aempty.cell, aempty.cell};
  403. ***************
  404. *** 53,71 ****
  405.       register Area *ap;
  406.   {
  407.       register Block *bp;
  408.   
  409. !     if (ap->free == NULL || ap->free == &aempty)
  410. !         return;
  411. !     for (bp = ap->free; ; bp = bp->next) {
  412. !         free((Void*)bp);
  413. !         if (bp->next == ap->free)
  414. !             break;
  415.       }
  416. -     ap->free = &aempty;
  417.   }
  418.   
  419.   /* allocate object from Area */
  420. ! Void *
  421.   alloc(size, ap)
  422.       size_t size;
  423.       register Area *ap;
  424. --- 52,72 ----
  425.       register Area *ap;
  426.   {
  427.       register Block *bp;
  428. +     register Block *tmp;
  429.   
  430. !     bp = ap->free;
  431. !     if (bp != NULL && bp != &aempty) {
  432. !         do {
  433. !             tmp = bp->next;
  434. !             free((void*)bp);
  435. !             bp = tmp;
  436. !         } while (bp != ap->free);
  437. !         ap->free = &aempty;
  438.       }
  439.   }
  440.   
  441.   /* allocate object from Area */
  442. ! void *
  443.   alloc(size, ap)
  444.       size_t size;
  445.       register Area *ap;
  446. ***************
  447. *** 126,138 ****
  448.           bp->free = fp;
  449.       else
  450.           fpp->next = fp;
  451. !     return (Void*) dp;
  452.   }
  453.   
  454.   /* change size of object -- like realloc */
  455. ! Void *
  456.   aresize(ptr, size, ap)
  457. !     register Void *ptr;
  458.       size_t size;
  459.       Area *ap;
  460.   {
  461. --- 127,139 ----
  462.           bp->free = fp;
  463.       else
  464.           fpp->next = fp;
  465. !     return (void*) dp;
  466.   }
  467.   
  468.   /* change size of object -- like realloc */
  469. ! void *
  470.   aresize(ptr, size, ap)
  471. !     register void *ptr;
  472.       size_t size;
  473.       Area *ap;
  474.   {
  475. ***************
  476. *** 148,154 ****
  477.       if (dp == NULL || (dp-1)->size < cells) { /* enlarge object */
  478.           register Cell *np;
  479.           register int i;
  480. !         Void *optr = ptr;
  481.   
  482.           ptr = alloc(size, ap);
  483.           np = (Cell*) ptr;
  484. --- 149,155 ----
  485.       if (dp == NULL || (dp-1)->size < cells) { /* enlarge object */
  486.           register Cell *np;
  487.           register int i;
  488. !         void *optr = ptr;
  489.   
  490.           ptr = alloc(size, ap);
  491.           np = (Cell*) ptr;
  492. ***************
  493. *** 166,180 ****
  494.               (dp-1)->size = cells;
  495.               dp += cells + 1;
  496.               (dp-1)->size = split;
  497. !             afree((Void*)dp, ap);
  498.           }
  499.       }
  500. !     return (Void*) ptr;
  501.   }
  502.   
  503.   void
  504.   afree(ptr, ap)
  505. !     Void *ptr;
  506.       register Area *ap;
  507.   {
  508.       register Block *bp;
  509. --- 167,181 ----
  510.               (dp-1)->size = cells;
  511.               dp += cells + 1;
  512.               (dp-1)->size = split;
  513. !             afree((void*)dp, ap);
  514.           }
  515.       }
  516. !     return (void*) ptr;
  517.   }
  518.   
  519.   void
  520.   afree(ptr, ap)
  521. !     void *ptr;
  522.       register Area *ap;
  523.   {
  524.       register Block *bp;
  525. *** sh/alloc.h.old    Sat Apr 25 17:41:31 1992
  526. --- sh/alloc.h    Sun Apr 19 19:21:15 1992
  527. ***************
  528. *** 6,18 ****
  529.       struct Block *free;    /* free list */
  530.   } Area;
  531.   
  532. - Area   *ainit ARGS((Area *ap));
  533. - void    afreeall ARGS((Area *ap));
  534. - void    ashrink ARGS((Area *ap));
  535. - void    aerror ARGS((Area *ap, const char *msg));
  536. - void    awarn ARGS((Area *ap, const char *msg));
  537. - Void   *alloc ARGS((size_t size, Area *ap));
  538. - Void   *aresize ARGS((Void *ptr, size_t size, Area *ap));
  539. - void    afree ARGS((Void *ptr, Area *ap));
  540. --- 6,8 ----
  541. *** sh/c_ksh.c.old    Sat Apr 25 17:44:14 1992
  542. --- sh/c_ksh.c    Sat Apr 25 18:34:12 1992
  543. ***************
  544. *** 3,10 ****
  545.    */
  546.   
  547.   #ifndef lint
  548. ! static char *RCSid = "$Id: c_ksh.c,v 3.4 89/03/27 15:47:16 egisin Exp $";
  549. ! static char *sccs_id = "@(#)c_ksh.c    1.2 91/11/22 22:53:34 (sjg)";
  550.   #endif
  551.   
  552.   #include "stdh.h"
  553. --- 3,9 ----
  554.    */
  555.   
  556.   #ifndef lint
  557. ! static char *RCSid = "$Id: c_ksh.c,v 1.2 1992/04/25 08:33:28 sjg Exp $";
  558.   #endif
  559.   
  560.   #include "stdh.h"
  561. ***************
  562. *** 11,23 ****
  563.   #include <errno.h>
  564.   #include <setjmp.h>
  565.   #include "sh.h"
  566. - #include "table.h"
  567.   
  568.   int
  569.   c_hash(wp)
  570.       register char **wp;
  571.   {
  572. -     register int i;
  573.       register struct tbl *tp, **p;
  574.   
  575.       wp++;
  576. --- 10,21 ----
  577.   #include <errno.h>
  578.   #include <setjmp.h>
  579.   #include "sh.h"
  580.   
  581.   int
  582.   c_hash(wp)
  583.       register char **wp;
  584.   {
  585.       register struct tbl *tp, **p;
  586.   
  587.       wp++;
  588. ***************
  589. *** 49,55 ****
  590.       register int done = 0;
  591.       register int prt = 0;
  592.       register struct tbl *v_pwd = NULL, *v_oldpwd = NULL;
  593. -     extern Void cleanpath();
  594.   
  595.       if ((dir = wp[1]) == NULL && (dir = strval(global("HOME"))) == NULL)
  596.           errorf("no home directory");
  597. --- 47,52 ----
  598. ***************
  599. *** 361,371 ****
  600.                   printf("%s\n", vp->name);
  601.                   } else
  602.                   if (thing == '+' ||
  603. !                 fclr && (vp->flag&fclr) == fclr) {
  604.                   printf("%s\n", vp->name);
  605.                   } else
  606.                   if (thing == '-' ||
  607. !                 fset && (vp->flag&fset) == fset) {
  608.                   if (fset&FUNCT)
  609.                       printf("function %s\n", vp->name);
  610.                   else
  611. --- 358,368 ----
  612.                   printf("%s\n", vp->name);
  613.                   } else
  614.                   if (thing == '+' ||
  615. !                 (fclr && (vp->flag&fclr) == fclr)) {
  616.                   printf("%s\n", vp->name);
  617.                   } else
  618.                   if (thing == '-' ||
  619. !                 (fset && (vp->flag&fset) == fset)) {
  620.                   if (fset&FUNCT)
  621.                       printf("function %s\n", vp->name);
  622.                   else
  623. ***************
  624. *** 393,399 ****
  625.   {
  626.       register struct table *t = &lexicals;
  627.       register struct tbl *ap, **p;
  628. -     register int i;
  629.       int rv = 0;
  630.   
  631.       if (*++wp != NULL && strcmp(*wp, "-d") == 0) {
  632. --- 390,395 ----
  633. ***************
  634. *** 422,428 ****
  635.               if (ap->type == CKEYWD)
  636.                   errorf("cannot alias keyword\n");
  637.               if ((ap->flag&ALLOC)) {
  638. !                 afree((Void*)ap->val.s, APERM);
  639.                   ap->flag &= ~(ALLOC|ISSET);
  640.               }
  641.               ap->type = CALIAS;
  642. --- 418,424 ----
  643.               if (ap->type == CKEYWD)
  644.                   errorf("cannot alias keyword\n");
  645.               if ((ap->flag&ALLOC)) {
  646. !                 afree((void*)ap->val.s, APERM);
  647.                   ap->flag &= ~(ALLOC|ISSET);
  648.               }
  649.               ap->type = CALIAS;
  650. ***************
  651. *** 450,456 ****
  652.           if (ap == NULL || ap->type != CALIAS)
  653.               continue;
  654.           if ((ap->flag&ALLOC))
  655. !             afree((Void*)ap->val.s, APERM);
  656.           ap->flag &= ~(DEFINED|ISSET|ALLOC);
  657.       }
  658.       return 0;
  659. --- 446,452 ----
  660.           if (ap == NULL || ap->type != CALIAS)
  661.               continue;
  662.           if ((ap->flag&ALLOC))
  663. !             afree((void*)ap->val.s, APERM);
  664.           ap->flag &= ~(DEFINED|ISSET|ALLOC);
  665.       }
  666.       return 0;
  667. ***************
  668. *** 545,550 ****
  669. --- 541,547 ----
  670.       return rv;
  671.   }
  672.   
  673. + #ifdef EMACS
  674.   int
  675.   c_bind(wp)
  676.       register char **wp;
  677. ***************
  678. *** 568,578 ****
  679.   
  680.       return 0;
  681.   }
  682.   
  683.   extern    c_fc();
  684.   extern    c_getopts();
  685.   
  686. ! Const struct builtin kshbuiltins [] = {
  687.       {"cd", c_cd},
  688.       {"print", c_print},
  689.       {"getopts", c_getopts},
  690. --- 565,576 ----
  691.   
  692.       return 0;
  693.   }
  694. + #endif
  695.   
  696.   extern    c_fc();
  697.   extern    c_getopts();
  698.   
  699. ! const struct builtin kshbuiltins [] = {
  700.       {"cd", c_cd},
  701.       {"print", c_print},
  702.       {"getopts", c_getopts},
  703. *** sh/c_sh.c.old    Sat Apr 25 17:44:15 1992
  704. --- sh/c_sh.c    Sat Apr 25 18:30:41 1992
  705. ***************
  706. *** 3,10 ****
  707.    */
  708.   
  709.   #ifndef lint
  710. ! static char *RCSid = "Id: /u/egisin/sh/src/RCS/c_sh.c,v 3.1 88/11/03 09:14:31 egisin Exp $";
  711. ! static char *sccs_id = "@(#)c_sh.c    1.4 91/11/22 22:53:24 (sjg)";
  712.   #endif
  713.   
  714.   #include "stdh.h"
  715. --- 3,9 ----
  716.    */
  717.   
  718.   #ifndef lint
  719. ! static char *RCSid = "$Id: c_sh.c,v 1.3 1992/04/25 08:29:52 sjg Exp $";
  720.   #endif
  721.   
  722.   #include "stdh.h"
  723. ***************
  724. *** 14,24 ****
  725.   #include <unistd.h>        /* getcwd */
  726.   #include <sys/times.h>
  727.   #include "sh.h"
  728. - #include "lex.h"
  729. - #include "tree.h"
  730. - #include "table.h"
  731.   
  732. ! static    char *clocktos();
  733.   #ifndef CLK_TCK
  734.   #define CLK_TCK 60            /* 60HZ */
  735.   #endif
  736. --- 13,21 ----
  737.   #include <unistd.h>        /* getcwd */
  738.   #include <sys/times.h>
  739.   #include "sh.h"
  740.   
  741. ! static char *   clocktos    ARGS((clock_t t));
  742.   #ifndef CLK_TCK
  743.   #define CLK_TCK 60            /* 60HZ */
  744.   #endif
  745. ***************
  746. *** 145,151 ****
  747.                       *cp++ = c;
  748.                   continue;
  749.               }
  750. !             if (c == '\n' || wp[1] && ctype(c, C_IFS))
  751.                   break;
  752.               *cp++ = c;
  753.           }
  754. --- 142,148 ----
  755.                       *cp++ = c;
  756.                   continue;
  757.               }
  758. !             if (c == '\n' || (wp[1] && ctype(c, C_IFS)))
  759.                   break;
  760.               *cp++ = c;
  761.           }
  762. ***************
  763. *** 195,201 ****
  764.           if (p == NULL)
  765.               errorf("trap: bad signal %s\n", wp[-1]);
  766.           if (p->trap != NULL)
  767. !             afree((Void*)p->trap, APERM);
  768.           p->trap = NULL;
  769.           if (s != NULL) {
  770.               if (strlen(s) != 0) {
  771. --- 192,198 ----
  772.           if (p == NULL)
  773.               errorf("trap: bad signal %s\n", wp[-1]);
  774.           if (p->trap != NULL)
  775. !             afree((void*)p->trap, APERM);
  776.           p->trap = NULL;
  777.           if (s != NULL) {
  778.               if (strlen(s) != 0) {
  779. ***************
  780. *** 217,228 ****
  781.       register struct trap *p;
  782.       void (*f)();
  783.   {
  784. !     if (p->signal == 0)
  785. !         return;
  786. !     if (signal(p->signal, SIG_IGN) != SIG_IGN || p->ourtrap) {
  787. !         p->ourtrap = 1;
  788. !         signal(p->signal, f);
  789. !     }
  790.   }
  791.   
  792.   int
  793. --- 214,238 ----
  794.       register struct trap *p;
  795.       void (*f)();
  796.   {
  797. !   if (p->signal == 0)
  798. !     return;
  799. ! #ifdef USE_SIGACT
  800. !   sigaction(p->signal, &Sigact_ign, &Sigact);
  801. !   if (Sigact.sa_handler != SIG_IGN || p->ourtrap)
  802. !   {
  803. !     p->ourtrap = 1;
  804. !     Sigact.sa_handler = f;
  805. !     sigaction(p->signal, &Sigact, NULL);
  806. !     sigemptyset(&Sigact.sa_mask);
  807. !     Sigact.sa_flags = 0;
  808. !   }
  809. ! #else
  810. !   if (signal(p->signal, SIG_IGN) != SIG_IGN || p->ourtrap)
  811. !   {
  812. !     p->ourtrap = 1;
  813. !     signal(p->signal, f);
  814. !   }
  815. ! #endif
  816.   }
  817.   
  818.   int
  819. ***************
  820. *** 289,301 ****
  821.       register char **wp;
  822.   {
  823.       struct block *l = e.loc;
  824. -     register struct tbl *vp, **p;
  825.       register char **owp = wp;
  826.       register char *cp;
  827.       int old_fmonitor = flag[FMONITOR];
  828.   
  829.       if ((cp = *++wp) == NULL) {
  830. !         static char * Const args [] = {"set", "-", NULL};
  831.           extern int c_typeset ARGS((char **args));
  832.           return c_typeset(args);
  833.       }
  834. --- 299,310 ----
  835.       register char **wp;
  836.   {
  837.       struct block *l = e.loc;
  838.       register char **owp = wp;
  839.       register char *cp;
  840.       int old_fmonitor = flag[FMONITOR];
  841.   
  842.       if ((cp = *++wp) == NULL) {
  843. !         static char * const args [] = {"set", "-", NULL};
  844.           extern int c_typeset ARGS((char **args));
  845.           return c_typeset(args);
  846.       }
  847. ***************
  848. *** 468,474 ****
  849.   
  850.   extern    int c_test();        /* in test.c */
  851.   
  852. ! Const struct builtin shbuiltins [] = {
  853.       {"=:", c_label},
  854.       {"=.", c_dot},
  855.       {"[", c_test},
  856. --- 477,483 ----
  857.   
  858.   extern    int c_test();        /* in test.c */
  859.   
  860. ! const struct builtin shbuiltins [] = {
  861.       {"=:", c_label},
  862.       {"=.", c_dot},
  863.       {"[", c_test},
  864. *** sh/c_test.c.old    Sat Apr 25 17:44:15 1992
  865. --- sh/c_test.c    Sat Apr 25 18:34:23 1992
  866. ***************
  867. *** 6,13 ****
  868.    */
  869.   
  870.   #ifndef lint
  871. ! static char *RCSid = "$Id: c_test.c,v 3.3 89/03/27 15:47:25 egisin Exp $";
  872. ! static char *sccs_id = "@(#)c_test.c    1.2 91/11/22 22:53:37 (sjg)";
  873.   #endif
  874.   
  875.   #include "stdh.h"
  876. --- 6,12 ----
  877.    */
  878.   
  879.   #ifndef lint
  880. ! static char *RCSid = "$Id: c_test.c,v 1.2 1992/04/25 08:33:28 sjg Exp $";
  881.   #endif
  882.   
  883.   #include "stdh.h"
  884. ***************
  885. *** 82,88 ****
  886.   struct t_op {
  887.       char *op_text;
  888.       short op_num, op_type;
  889. ! } Const ops [] = {
  890.       {"-r",    FILRD,    UNOP},
  891.       {"-w",    FILWR,    UNOP},
  892.       {"-x",    FILEX,    UNOP},
  893. --- 81,87 ----
  894.   struct t_op {
  895.       char *op_text;
  896.       short op_num, op_type;
  897. ! } const ops [] = {
  898.       {"-r",    FILRD,    UNOP},
  899.       {"-w",    FILWR,    UNOP},
  900.       {"-x",    FILEX,    UNOP},
  901. ***************
  902. *** 125,131 ****
  903.   };
  904.   
  905.   char **t_wp;
  906. ! struct t_op Const *t_wp_op;
  907.   
  908.   static void syntax();
  909.   
  910. --- 124,130 ----
  911.   };
  912.   
  913.   char **t_wp;
  914. ! struct t_op const *t_wp_op;
  915.   
  916.   static void syntax();
  917.   
  918. ***************
  919. *** 227,233 ****
  920.       opnd1 = *t_wp;
  921.       (void) t_lex(*++t_wp);
  922.       if (t_wp_op && t_wp_op->op_type == BINOP) {
  923. !         struct t_op Const *op = t_wp_op;
  924.   
  925.           if ((opnd2 = *++t_wp) == (char *)0)
  926.               syntax(op->op_text, "argument expected");
  927. --- 226,232 ----
  928.       opnd1 = *t_wp;
  929.       (void) t_lex(*++t_wp);
  930.       if (t_wp_op && t_wp_op->op_type == BINOP) {
  931. !         struct t_op const *op = t_wp_op;
  932.   
  933.           if ((opnd2 = *++t_wp) == (char *)0)
  934.               syntax(op->op_text, "argument expected");
  935. ***************
  936. *** 318,324 ****
  937.   t_lex(s)
  938.       register char *s;
  939.   {
  940. !     register struct t_op Const *op = ops;
  941.   
  942.       if (s == 0) {
  943.           t_wp_op = (struct t_op *)0;
  944. --- 317,323 ----
  945.   t_lex(s)
  946.       register char *s;
  947.   {
  948. !     register struct t_op const *op = ops;
  949.   
  950.       if (s == 0) {
  951.           t_wp_op = (struct t_op *)0;
  952. *** sh/config.h.old    Sat Apr 25 17:44:16 1992
  953. --- sh/config.h    Sat Apr 25 18:34:51 1992
  954. ***************
  955. *** 1,7 ****
  956.   /*
  957.    * Configuration file for the PD ksh
  958.    *
  959. !  * SCCSID: @(#)config.h 1.2 91/11/22 22:53:31
  960.    */
  961.   
  962.   #ifndef    _CONFIG_H
  963. --- 1,7 ----
  964.   /*
  965.    * Configuration file for the PD ksh
  966.    *
  967. !  * RCSid: $Id: config.h,v 1.2 1992/04/25 08:33:28 sjg Exp $
  968.    */
  969.   
  970.   #ifndef    _CONFIG_H
  971. ***************
  972. *** 18,23 ****
  973. --- 18,31 ----
  974.   #ifndef SIGINT
  975.   #include <signal.h>
  976.   #endif
  977. + /*
  978. +  * leave USE_SIGACT defined.
  979. +  * if you don't have sigaction(2) and the
  980. +  * implementation in sigact.c doesn't work for your system,
  981. +  * fix it.
  982. +  */
  983. + #define USE_SIGACT            /* POSIX signal handling */
  984.   
  985.   #if defined(JOBS) && !defined(SIGCONT)
  986.   #undef JOBS
  987. *** sh/edit.c.old    Sat Apr 25 17:44:16 1992
  988. --- sh/edit.c    Sat Apr 25 18:35:26 1992
  989. ***************
  990. *** 7,14 ****
  991.   #if defined(EMACS) || defined(VI)
  992.   
  993.   #ifndef lint
  994. ! static char *RCSid = "$Id: edit.c,v 3.2 89/03/27 15:47:34 egisin Exp $";
  995. ! static char *sccs_id = "@(#)edit.c    1.5 91/11/22 22:52:59 (sjg)";
  996.   #endif
  997.   
  998.   #include "stdh.h"
  999. --- 7,13 ----
  1000.   #if defined(EMACS) || defined(VI)
  1001.   
  1002.   #ifndef lint
  1003. ! static char *RCSid = "$Id: edit.c,v 1.2 1992/04/25 08:33:28 sjg Exp $";
  1004.   #endif
  1005.   
  1006.   #include "stdh.h"
  1007. ***************
  1008. *** 17,24 ****
  1009.   #include <fcntl.h>
  1010.   #include <errno.h>
  1011.   #include <setjmp.h>
  1012.   #include "sh.h"
  1013. - #include "lex.h"
  1014.   #include "tty.h"
  1015.   #define EXTERN
  1016.   #include "edit.h"
  1017. --- 16,25 ----
  1018.   #include <fcntl.h>
  1019.   #include <errno.h>
  1020.   #include <setjmp.h>
  1021. + #ifndef NOSTDHDRS
  1022. + # include <string.h>
  1023. + #endif
  1024.   #include "sh.h"
  1025.   #include "tty.h"
  1026.   #define EXTERN
  1027.   #include "edit.h"
  1028. ***************
  1029. *** 28,38 ****
  1030.   extern unsigned    sleep();
  1031.   #endif
  1032.   
  1033. - #if 0
  1034. - int    x_do_init = 1;        /* set up tty modes */
  1035. - int    x_cols = 80;        /* todo: $COLUMNS */
  1036. - int    ed_erase = -1, ed_kill = -1, ed_werase = -1, ed_intr = -1, ed_quit = -1;
  1037. - #endif
  1038.   
  1039.   static int    x_noecho = 0;
  1040.   
  1041. --- 29,34 ----
  1042. ***************
  1043. *** 46,52 ****
  1044.       size_t len;
  1045.   {
  1046.     static int setup_done = 0;
  1047. -     char    c;
  1048.       int    i;
  1049.   
  1050.     if (setup_done != 42)
  1051. --- 42,47 ----
  1052. ***************
  1053. *** 91,100 ****
  1054.   int
  1055.   x_getc()
  1056.   {
  1057. !     char c;
  1058.   
  1059.       if (read(ttyfd, &c, 1) != 1)
  1060. !         return -1;
  1061.       return c & 0x7F;
  1062.   }
  1063.   
  1064. --- 86,109 ----
  1065.   int
  1066.   x_getc()
  1067.   {
  1068. !   char c;
  1069.   
  1070. +   /*
  1071. +    * This allows the arival of a SIGCHLD to not disturb us until 
  1072. +    * we are ready. 
  1073. +    * BSD and other systems that automatically rety a read after 
  1074. +    * an interrupt don't need this but it doesn't do any harm 
  1075. +    * either. 
  1076. +    */
  1077. +  retry:
  1078.       if (read(ttyfd, &c, 1) != 1)
  1079. !     {
  1080. !       if (sigchld_caught)        /* just a SIGCHLD ? */
  1081. !       {
  1082. !         goto retry;
  1083. !       }
  1084. !       return -1;
  1085. !     }
  1086.       return c & 0x7F;
  1087.   }
  1088.   
  1089. ***************
  1090. *** 123,128 ****
  1091. --- 132,138 ----
  1092.   x_adjust()
  1093.   {
  1094.     x_adj_done++;            /* flag the fact that we were called. */
  1095. + #ifdef EMACS
  1096.     /*
  1097.      * we had a promblem if the prompt length > x_cols / 2
  1098.      */
  1099. ***************
  1100. *** 130,135 ****
  1101. --- 140,146 ----
  1102.       xbp = xbuf;
  1103.     xlp_valid = FALSE;
  1104.     x_redraw(x_cols);
  1105. + #endif
  1106.     x_flush();
  1107.   }
  1108.   
  1109. ***************
  1110. *** 197,204 ****
  1111. --- 208,217 ----
  1112.   static struct ttychars lchars, lcharsorig;
  1113.   #else
  1114.   static struct tchars tchars, tcharsorig;
  1115. + #ifdef TIOCGLTC
  1116.   static struct ltchars ltchars, ltcharsorig;
  1117.   #endif
  1118. + #endif
  1119.   #else
  1120.   static    struct termio cb, cborig;
  1121.   #endif
  1122. ***************
  1123. *** 230,237 ****
  1124. --- 243,253 ----
  1125.       lchars.tc_rprntc = -1;
  1126.   #else
  1127.       (void)ioctl(ttyfd, TIOCGETC, &tcharsorig);
  1128. + #ifdef TIOCGLTC
  1129.       (void)ioctl(ttyfd, TIOCGLTC, <charsorig);
  1130. + #endif
  1131.       tchars = tcharsorig;
  1132. + #ifdef TIOCGLTC
  1133.       ltchars = ltcharsorig;
  1134.       ed_werase = ltchars.t_werasc;
  1135.       ltchars = ltcharsorig;
  1136. ***************
  1137. *** 238,247 ****
  1138. --- 254,266 ----
  1139.       ltchars.t_suspc = -1;
  1140.       ltchars.t_dsuspc = -1;
  1141.       ltchars.t_lnextc = -1;
  1142. + #endif
  1143.       tchars.t_intrc = -1;
  1144.       tchars.t_quitc = -1;
  1145. + #ifdef TIOCGLTC
  1146.       ltchars.t_rprntc = -1;
  1147.   #endif
  1148. + #endif
  1149.   #else /* !_BSD */
  1150.       (void)ioctl(ttyfd, TCGETA, &cborig);
  1151.       if ((cborig.c_lflag & ECHO) == 0)
  1152. ***************
  1153. *** 297,304 ****
  1154. --- 316,325 ----
  1155.           (void)ioctl(ttyfd, TIOCSATC, &lchars);
  1156.   #else
  1157.           (void)ioctl(ttyfd, TIOCSETC, &tchars);
  1158. + #ifdef TIOCGLTC
  1159.           (void)ioctl(ttyfd, TIOCSLTC, <chars);
  1160.   #endif
  1161. + #endif
  1162.       }
  1163.       else {
  1164.           (void)ioctl(ttyfd, TIOCSETN, &cborig);
  1165. ***************
  1166. *** 306,313 ****
  1167. --- 327,336 ----
  1168.           (void)ioctl(ttyfd, TIOCSATC, &lcharsorig);
  1169.   #else
  1170.           (void)ioctl(ttyfd, TIOCSETC, &tcharsorig);
  1171. + #ifdef TIOCGLTC
  1172.           (void)ioctl(ttyfd, TIOCSLTC, <charsorig);
  1173.   #endif
  1174. + #endif
  1175.       }
  1176.       return prev;
  1177.   }
  1178. ***************
  1179. *** 404,407 ****
  1180. --- 427,469 ----
  1181.     return count;
  1182.   }
  1183.   
  1184. + /*
  1185. +  * this function check the environment
  1186. +  * for FCEDIT,EDITOR or VISUAL
  1187. +  * as a hint to what edit mode is desired.
  1188. +  */
  1189. + init_editmode()
  1190. + {
  1191. +   static char *ev[] = { "FCEDIT", "EDITOR", "VISUAL", NULL };
  1192. +   register int i;
  1193. +   register char *rcp, *rcp2;
  1194. +   for (i = 0; ev[i]; i++)
  1195. +   {
  1196. +     if ((rcp = getenv(ev[i])) && *rcp)
  1197. +       break;
  1198. +   }
  1199. +   if (ev[i] && rcp)
  1200. +   {
  1201. +     if (rcp2 = strrchr(rcp, '/'))
  1202. +       rcp = ++rcp2;
  1203. + #ifdef EMACS
  1204. +     if (strstr(rcp, "emacs"))
  1205. +     {
  1206. +       flag[FVI] = 0;
  1207. +       flag[FEMACS] = 1;
  1208. +     }
  1209. +     else
  1210. + #endif
  1211. + #ifdef VI
  1212. +       if (strstr(rcp, "vi"))
  1213. +       {
  1214. +     flag[FVI] = 1;
  1215. +     flag[FEMACS] = 0;
  1216. +       }
  1217. + #endif
  1218. +   }
  1219. +   return 0;
  1220. + }
  1221.   #endif
  1222. *** sh/edit.h.old    Sat Apr 25 17:41:32 1992
  1223. --- sh/edit.h    Sat Apr 25 18:35:34 1992
  1224. ***************
  1225. *** 7,21 ****
  1226.    * SEE ALSO:
  1227.    *      
  1228.    *
  1229. !  * AMENDED:
  1230. !  *      91/09/17  23:28:04  (sjg)
  1231.    *
  1232. -  * RELEASED:
  1233. -  *      91/11/09  15:36:18  v1.3
  1234. -  *
  1235. -  * SCCSID:
  1236. -  *      @(#)edit.h  1.3  91/09/17  23:28:04  (sjg)
  1237. -  *
  1238.    */
  1239.   
  1240.   /* some useful #defines */
  1241. --- 7,15 ----
  1242.    * SEE ALSO:
  1243.    *      
  1244.    *
  1245. !  * RCSid:
  1246. !  *      $Id: edit.h,v 1.2 1992/04/25 08:33:28 sjg Exp $
  1247.    *
  1248.    */
  1249.   
  1250.   /* some useful #defines */
  1251. ***************
  1252. *** 53,63 ****
  1253.   EXTERN int    x_do_init;        /* set up tty modes */
  1254.   EXTERN int    ed_erase, ed_kill, ed_werase, ed_intr, ed_quit;
  1255.   
  1256. - #if defined(__STDC__) || defined(PROTO)
  1257. - # define _P_(p) p
  1258. - #else
  1259. - # define _P_(p) ()
  1260. - #endif        /* __STDC__ || PROTO */
  1261.   #ifdef DEBUG
  1262.   # define _D_(x) x
  1263.   #else
  1264. --- 47,52 ----
  1265. ***************
  1266. *** 65,85 ****
  1267.   #endif
  1268.   
  1269.   /****  edit.c  ****/
  1270. ! int             x_read      _P_((int fd, char *buf, size_t len));
  1271. ! int             x_getc      _P_((void));
  1272. ! void            x_flush     _P_((void));
  1273. ! void            x_adjust    _P_((void));
  1274. ! void            x_putc      _P_((int c));
  1275. ! int             x_debug_info _P_((void));
  1276. ! void            x_puts      _P_((char *s));
  1277. ! void            x_init      _P_((void));
  1278. ! bool_t          x_mode      _P_((bool_t onoff));
  1279. ! bool_t          x_mode      _P_((bool_t onoff));
  1280. ! int             promptlen   _P_((char *cp));
  1281.   
  1282.   /****  emacs.c  ****/
  1283. ! void            x_redraw    _P_((int limit));
  1284. ! char*        x_lastcp    _P_((void));
  1285.   EXTERN int xlp_valid _I_(0);
  1286.     
  1287.   /* This lot goes at the END */
  1288. --- 54,74 ----
  1289.   #endif
  1290.   
  1291.   /****  edit.c  ****/
  1292. ! int             x_read      ARGS((int fd, char *buf, size_t len));
  1293. ! int             x_getc      ARGS((void));
  1294. ! void            x_flush     ARGS((void));
  1295. ! void            x_adjust    ARGS((void));
  1296. ! void            x_putc      ARGS((int c));
  1297. ! int             x_debug_info ARGS((void));
  1298. ! void            x_puts      ARGS((char *s));
  1299. ! void            x_init      ARGS((void));
  1300. ! bool_t          x_mode      ARGS((bool_t onoff));
  1301. ! bool_t          x_mode      ARGS((bool_t onoff));
  1302. ! int             promptlen   ARGS((char *cp));
  1303.   
  1304.   /****  emacs.c  ****/
  1305. ! void            x_redraw    ARGS((int limit));
  1306. ! char*        x_lastcp    ARGS((void));
  1307.   EXTERN int xlp_valid _I_(0);
  1308.     
  1309.   /* This lot goes at the END */
  1310.  
  1311. exit 0 # Just in case...
  1312.