home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume35 / xvi / patch01b < prev    next >
Encoding:
Text File  |  1993-03-02  |  52.5 KB  |  2,075 lines

  1. Newsgroups: comp.sources.misc
  2. From: jmd@cyclone.bt.co.uk (John Downey)
  3. Subject: v35i099:  xvi - portable multi-window vi-like editor, Patch01b/7
  4. Message-ID: <1993Feb23.183224.13205@sparky.imd.sterling.com>
  5. X-Md4-Signature: d541312301556ff1fbd9e0e543c57bc3
  6. Date: Tue, 23 Feb 1993 18:32:24 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: jmd@cyclone.bt.co.uk (John Downey)
  10. Posting-number: Volume 35, Issue 99
  11. Archive-name: xvi/patch01b
  12. Environment: Unix, MS-DOS, OS/2, QNX
  13. Patch-To: xvi: Volume 33, Issue 10-27
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then unpack
  17. # it by saving it into a file and typing "sh file".  To overwrite existing
  18. # files, type "sh file -c".  You can also feed this as standard input via
  19. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  20. # will see the following message at the end:
  21. #        "End of archive 2 (of 7)."
  22. # Contents:  src/ibmpc_c.c src/patch09 src/patch14 src/patch15
  23. #   src/patch17 src/patch19 src/patch30
  24. # Wrapped by jmd@bealfeirste on Mon Feb  8 19:57:06 1993
  25. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  26. if test -f 'src/ibmpc_c.c' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'src/ibmpc_c.c'\"
  28. else
  29. echo shar: Extracting \"'src/ibmpc_c.c'\" \(5791 characters\)
  30. sed "s/^X//" >'src/ibmpc_c.c' <<'END_OF_FILE'
  31. X/* Copyright (c) 1990,1991,1992 Chris and John Downey */
  32. X#ifndef lint
  33. Xstatic char *sccsid = "@(#)ibmpc_c.c    2.3 (Chris & John Downey) 11/6/92";
  34. X#endif
  35. X
  36. X/***
  37. X
  38. X* program name:
  39. X    xvi
  40. X* function:
  41. X    PD version of UNIX "vi" editor, with extensions.
  42. X* module name:
  43. X    ibmpc_c.c
  44. X* module function:
  45. X    C part of terminal interface module for IBM PC compatibles
  46. X    running MS-DOS.
  47. X
  48. X* history:
  49. X    STEVIE - ST Editor for VI Enthusiasts, Version 3.10
  50. X    Originally by Tim Thompson (twitch!tjt)
  51. X    Extensive modifications by Tony Andrews (onecom!wldrdg!tony)
  52. X    Heavily modified by Chris & John Downey
  53. X
  54. X***/
  55. X
  56. X#include "xvi.h"
  57. X
  58. X/*
  59. X * Screen dimensions, defined here so they'll go in the C default data
  60. X * segment.
  61. X */
  62. Xunsigned int    Rows;
  63. Xunsigned int    Columns;
  64. X
  65. X/*
  66. X * IBM-compatible PC's have a default typeahead buffer which is only
  67. X * big enough for 16 characters, & some 8088-based PC's are so
  68. X * unbelievably slow that xvi can't handle more than about 2
  69. X * characters a second. So we do some input buffering here to
  70. X * alleviate the problem.
  71. X */
  72. X
  73. Xstatic    char        kbuf[16];
  74. Xstatic    char        *kbrp = kbuf;
  75. Xstatic    char        *kbwp = kbuf;
  76. Xstatic    unsigned    kbcount;
  77. X
  78. Xstatic void near
  79. Xkbfill()
  80. X{
  81. X    register int    c;
  82. X
  83. X    while (kbcount < sizeof kbuf && (c = getchnw()) >= 0) {
  84. X    kbcount++;
  85. X    *kbwp = c;
  86. X    if (kbwp++ >= &kbuf[sizeof kbuf - 1])
  87. X        kbwp = kbuf;
  88. X    }
  89. X}
  90. X
  91. Xstatic unsigned char near
  92. Xkbget()
  93. X{
  94. X    for (;;) {
  95. X    if (kbcount > 0) {
  96. X        unsigned char c;
  97. X
  98. X        --kbcount;
  99. X        c = *kbrp;
  100. X        if (kbrp++ >= &kbuf[sizeof kbuf - 1])
  101. X        kbrp = kbuf;
  102. X        return c;
  103. X    } else {
  104. X        kbfill();
  105. X    }
  106. X    }
  107. X}
  108. X
  109. X/*
  110. X * Convert milliseconds to clock ticks.
  111. X */
  112. X#if CLK_TCK > 1000
  113. X#        define    MS2CLK(m)    ((long)(m) * (CLK_TCK / 1000))
  114. X#else
  115. X#    if CLK_TCK < 1000
  116. X#        define    MS2CLK(m)    ((long)(m) / (1000 / CLK_TCK))
  117. X#    else
  118. X#        define    MS2CLK(m)    (m)
  119. X#    endif
  120. X#endif
  121. X
  122. X/*
  123. X * inchar() - get a character from the keyboard
  124. X */
  125. Xint
  126. Xinchar(long mstimeout)
  127. X{
  128. X    clock_t        stoptime;
  129. X
  130. X    if (kbcount == 0) {
  131. X    flush_output();
  132. X    if (mstimeout != 0) {
  133. X        stoptime = clock() + MS2CLK(mstimeout);
  134. X    }
  135. X    kbfill();
  136. X    }
  137. X    for (;;) {
  138. X    static clock_t    lastevent;
  139. X    register int    c;
  140. X
  141. X    if (kbcount == 0) {
  142. X        unsigned    prevbstate;
  143. X        unsigned    prevx, prevy;
  144. X        bool_t    isdrag;
  145. X
  146. X        if (State == NORMAL) {
  147. X        showmouse();
  148. X        prevbstate = 0;
  149. X        }
  150. X        for (; kbcount == 0; kbfill()) {
  151. X        /*
  152. X         * Time out if we have to.
  153. X         */
  154. X        if (mstimeout != 0 && clock() > stoptime) {
  155. X            break;
  156. X        }
  157. X        if (State == NORMAL) {
  158. X            unsigned    buttonstate;
  159. X            unsigned    mousex,
  160. X                mousey;
  161. X
  162. X            /*
  163. X             * If there's no keyboard input waiting to be
  164. X             * read, watch out for mouse events. We don't do
  165. X             * this if we're in insert or command line mode.
  166. X             */
  167. X
  168. X            buttonstate = mousestatus(&mousex, &mousey) & 7;
  169. X            mousex /= 8;
  170. X            mousey /= 8;
  171. X            if (prevbstate == 0) {
  172. X            isdrag = FALSE;
  173. X            } else {
  174. X            if (buttonstate) {
  175. X                /*
  176. X                 * If a button is being held down, & the
  177. X                 * position has changed, this is a mouse
  178. X                 * drag event.
  179. X                 */
  180. X                if (mousex != prevx || mousey != prevy) {
  181. X                hidemouse();
  182. X                mousedrag(prevy, mousey, prevx, mousex);
  183. X                showmouse();
  184. X                isdrag = TRUE;
  185. X                }
  186. X            } else {
  187. X                if (!isdrag) {
  188. X                /*
  189. X                 * They've pressed & released a button
  190. X                 * without moving the mouse.
  191. X                 */
  192. X                hidemouse();
  193. X                mouseclick(mousey, mousex);
  194. X                showmouse();
  195. X                }
  196. X            }
  197. X            }
  198. X            if ((prevbstate = buttonstate) != 0) {
  199. X            prevx = mousex;
  200. X            prevy = mousey;
  201. X            }
  202. X        }
  203. X        }
  204. X        if (State == NORMAL) {
  205. X        hidemouse();
  206. X        }
  207. X        if (kbcount == 0) {
  208. X        /*
  209. X         * We must have timed out.
  210. X         */
  211. X        return EOF;
  212. X        }
  213. X    }
  214. X    c = kbget();
  215. X    /*
  216. X     * On IBM compatible PC's, function keys return '\0' followed
  217. X     * by another character. Check for this, and turn function key
  218. X     * presses into appropriate "normal" characters to do the
  219. X     * right thing in xvi.
  220. X     */
  221. X    if (c != '\0') {
  222. X        return(c);
  223. X    }
  224. X    /* else must be a function key press */
  225. X    {
  226. X        if (State != NORMAL) {
  227. X        /*
  228. X         * Function key pressed during insert or command line
  229. X         * mode. Get the next character ...
  230. X         */
  231. X        if (kbget() == 0x53) {
  232. X            /*
  233. X             * ... and if it's the delete key, return it as a
  234. X             * backspace ...
  235. X             */
  236. X            return '\b';
  237. X        }
  238. X        /*
  239. X         * ... otherwise it isn't valid ...
  240. X         */
  241. X        alert();
  242. X
  243. X        /*
  244. X         * Typical MS-DOS users are fairly naive & may not
  245. X         * understand how to get out of insert mode. To make
  246. X         * things easier, we do it for them here.
  247. X         */
  248. X        switch (State) {
  249. X        case INSERT:
  250. X        case REPLACE:
  251. X            return ESC;
  252. X        default:
  253. X            continue;
  254. X        }
  255. X        }
  256. X        /* else (State == NORMAL) ... */
  257. X        switch (kbget()) {
  258. X        case 0x3b: return(K_HELP);        /* F1 key */
  259. X        case 0x47: return('H');        /* home key */
  260. X        case 0x48: return('k');        /* up arrow key */
  261. X        case 0x49: return (CTRL('B'));    /* page up key */
  262. X        case 0x4b: return('\b');        /* left arrow key */
  263. X        case 0x4d: return(' ');        /* right arrow key */
  264. X        case 0x4f: return('L');        /* end key */
  265. X        case 0x50: return('j');        /* down arrow key */
  266. X        case 0x51: return (CTRL('F'));    /* page down key */
  267. X        case 0x52: return('i');        /* insert key */
  268. X        case 0x53: return('x');        /* delete key */
  269. X        /*
  270. X         * default:
  271. X         *    fall through and ignore both characters ...
  272. X         */
  273. X        }
  274. X        continue;
  275. X    }
  276. X    }
  277. X}
  278. X
  279. X#ifdef __ZTC__
  280. X#   ifdef DOS386
  281. X#    define Z386
  282. X#   endif
  283. X#endif
  284. X
  285. X#ifndef Z386
  286. X
  287. X/*
  288. X * The routines in ibmpc_a.asm need to call this because they can't
  289. X * invoke C macros directly.
  290. X *
  291. X * Return Pn(P_colour) in the al register, Pn(P_statuscolour) in ah, &
  292. X * Pb(P_vbell) in dx.
  293. X *
  294. X * This will only work with a Microsoft-compatible compiler.
  295. X */
  296. Xlong
  297. Xcparams()
  298. X{
  299. X    return ((long) Pb(P_vbell) << 16) |
  300. X       (unsigned short) ((Pn(P_statuscolour) << 8) |
  301. X         (unsigned char) Pn(P_colour));
  302. X}
  303. X
  304. X#endif    /* not Z386 */
  305. END_OF_FILE
  306. if test 5791 -ne `wc -c <'src/ibmpc_c.c'`; then
  307.     echo shar: \"'src/ibmpc_c.c'\" unpacked with wrong size!
  308. fi
  309. # end of 'src/ibmpc_c.c'
  310. fi
  311. if test -f 'src/patch09' -a "${1}" != "-c" ; then 
  312.   echo shar: Will not clobber existing file \"'src/patch09'\"
  313. else
  314. echo shar: Extracting \"'src/patch09'\" \(4320 characters\)
  315. sed "s/^X//" >'src/patch09' <<'END_OF_FILE'
  316. X*** old/fileio.c    Tue Jul 28 17:46:16 1992
  317. X--- new/fileio.c    Tue Dec 22 17:04:21 1992
  318. X***************
  319. X*** 1,6 ****
  320. X  /* Copyright (c) 1990,1991,1992 Chris and John Downey */
  321. X  #ifndef lint
  322. X! static char *sccsid = "@(#)fileio.c    2.1 (Chris & John Downey) 7/29/92";
  323. X  #endif
  324. X  
  325. X  /***
  326. X--- 1,6 ----
  327. X  /* Copyright (c) 1990,1991,1992 Chris and John Downey */
  328. X  #ifndef lint
  329. X! static char *sccsid = "@(#)fileio.c    2.2 (Chris & John Downey) 11/23/92";
  330. X  #endif
  331. X  
  332. X  /***
  333. X***************
  334. X*** 198,207 ****
  335. X      unsigned long    nchars;        /* number of chars read */
  336. X      unsigned long    nlines;        /* number of lines read */
  337. X      unsigned long    nulls;        /* number of null chars */
  338. X-     unsigned long    toolong;    /*
  339. X-                      * number of lines
  340. X-                      * which were too long
  341. X-                      */
  342. X      bool_t        incomplete;    /* incomplete last line */
  343. X      Line        *lptr = NULL;    /* pointer to list of lines */
  344. X      Line        *last = NULL;    /*
  345. X--- 198,203 ----
  346. X***************
  347. X*** 262,268 ****
  348. X      }
  349. X  #endif /* SETVBUF_AVAIL */
  350. X  
  351. X!     nchars = nlines = nulls = toolong = 0;
  352. X      col = 0;
  353. X      incomplete = FALSE;
  354. X      state = at_soln;
  355. X--- 258,264 ----
  356. X      }
  357. X  #endif /* SETVBUF_AVAIL */
  358. X  
  359. X!     nchars = nlines = nulls = 0;
  360. X      col = 0;
  361. X      incomplete = FALSE;
  362. X      state = at_soln;
  363. X***************
  364. X*** 292,307 ****
  365. X          switch (state) {
  366. X          case at_soln:
  367. X          /*
  368. X!          * We're at the start of a line, &
  369. X!          * we've got at least one character,
  370. X!          * so we have to allocate a new Line
  371. X!          * structure.
  372. X           *
  373. X!          * If we can't do it, we throw away
  374. X!          * the lines we've read in so far, &
  375. X!          * return gf_NOMEM.
  376. X           */
  377. X!         if ((lp = newline(MAX_LINE_LENGTH)) == NULL) {
  378. X              if (lptr != NULL) {
  379. X              throw(lptr);
  380. X              }
  381. X--- 288,301 ----
  382. X          switch (state) {
  383. X          case at_soln:
  384. X          /*
  385. X!          * We're at the start of a line, & we've got at least one
  386. X!          * character, so we have to allocate a new Line structure.
  387. X           *
  388. X!          * If we can't do it, we throw away the lines we've
  389. X!          * read in so far, & return gf_NOMEM.
  390. X           */
  391. X!         if ((lp = newline(81)) == NULL &&
  392. X!             (lp = newline(1)) == NULL) {
  393. X              if (lptr != NULL) {
  394. X              throw(lptr);
  395. X              }
  396. X***************
  397. X*** 354,360 ****
  398. X          }
  399. X      }
  400. X  
  401. X!     if (state == at_eoln || col >= MAX_LINE_LENGTH - 1) {
  402. X          /*
  403. X           * First null-terminate the old line.
  404. X           */
  405. X--- 348,354 ----
  406. X          }
  407. X      }
  408. X  
  409. X!     if (state == at_eoln) {
  410. X          /*
  411. X           * First null-terminate the old line.
  412. X           */
  413. X***************
  414. X*** 364,371 ****
  415. X           * If this fails, we squeak at the user and
  416. X           * then throw away the lines read in so far.
  417. X           */
  418. X!         buff = realloc(buff, (unsigned) col + 1);
  419. X!         if (buff == NULL) {
  420. X          if (lptr != NULL)
  421. X              throw(lptr);
  422. X          (void) fclose(fp);
  423. X--- 358,364 ----
  424. X           * If this fails, we squeak at the user and
  425. X           * then throw away the lines read in so far.
  426. X           */
  427. X!         if (!lnresize(lp, (unsigned) col + 1)) {
  428. X          if (lptr != NULL)
  429. X              throw(lptr);
  430. X          (void) fclose(fp);
  431. X***************
  432. X*** 372,379 ****
  433. X          *headp = *tailp = NULL;
  434. X          return gf_NOMEM;
  435. X          }
  436. X-         lp->l_text = buff;
  437. X-         lp->l_size = col + 1;
  438. X  
  439. X          /*
  440. X           * Tack the line onto the end of the list,
  441. X--- 365,370 ----
  442. X***************
  443. X*** 390,404 ****
  444. X  
  445. X          nlines++;
  446. X          col = 0;
  447. X-         if (state != at_eoln) {
  448. X-         toolong++;
  449. X-         /*
  450. X-          * We didn't get a properly terminated line,
  451. X-          * but we still have to do something with the
  452. X-          * character we've read.
  453. X-          */
  454. X-         (void) ungetc(c, fp);
  455. X-         }
  456. X          state = at_soln;
  457. X      } else {
  458. X          /*
  459. X--- 381,386 ----
  460. X***************
  461. X*** 408,413 ****
  462. X--- 390,405 ----
  463. X          nulls++;
  464. X          continue;
  465. X          }
  466. X+         if (col >= lp->l_size - 1) {
  467. X+         if (!lnresize(lp, col + 2)) {
  468. X+             if (lptr != NULL)
  469. X+             throw(lptr);
  470. X+             (void) fclose(fp);
  471. X+             *headp = *tailp = NULL;
  472. X+             return gf_NOMEM;
  473. X+         }
  474. X+         buff = lp->l_text;
  475. X+         }
  476. X          state = in_line;
  477. X          buff[col++] = c;
  478. X      }
  479. X***************
  480. X*** 425,434 ****
  481. X      if (nulls > 0) {
  482. X          (void) lformat(&errbuf, " (%ld null character%s)",
  483. X                 nulls, (nulls == 1 ? "" : "s"));
  484. X-     }
  485. X-     if (toolong > 0) {
  486. X-         (void) lformat(&errbuf, " (%ld line%s too long)",
  487. X-                toolong, (toolong == 1 ? "" : "s"));
  488. X      }
  489. X      if (incomplete) {
  490. X          (void) lformat(&errbuf, " (incomplete last line)");
  491. X--- 417,422 ----
  492. END_OF_FILE
  493. if test 4320 -ne `wc -c <'src/patch09'`; then
  494.     echo shar: \"'src/patch09'\" unpacked with wrong size!
  495. fi
  496. # end of 'src/patch09'
  497. fi
  498. if test -f 'src/patch14' -a "${1}" != "-c" ; then 
  499.   echo shar: Will not clobber existing file \"'src/patch14'\"
  500. else
  501. echo shar: Extracting \"'src/patch14'\" \(5084 characters\)
  502. sed "s/^X//" >'src/patch14' <<'END_OF_FILE'
  503. X*** old/normal.c    Tue Jul 28 17:46:50 1992
  504. X--- new/normal.c    Thu Dec  3 19:50:03 1992
  505. X***************
  506. X*** 1,6 ****
  507. X  /* Copyright (c) 1990,1991,1992 Chris and John Downey */
  508. X  #ifndef lint
  509. X! static char *sccsid = "@(#)normal.c    2.7 (Chris & John Downey) 8/24/92";
  510. X  #endif
  511. X  
  512. X  /***
  513. X--- 1,6 ----
  514. X  /* Copyright (c) 1990,1991,1992 Chris and John Downey */
  515. X  #ifndef lint
  516. X! static char *sccsid = "@(#)normal.c    2.15 (Chris & John Downey) 11/30/92";
  517. X  #endif
  518. X  
  519. X  /***
  520. X***************
  521. X*** 321,327 ****
  522. X      static int        first_char;
  523. X      int            second_char;
  524. X      unsigned char    cflags;
  525. X!     bool_t        (*cfunc) P((int, int)) = NULL;
  526. X  
  527. X  
  528. X      /*
  529. X--- 321,327 ----
  530. X      static int        first_char;
  531. X      int            second_char;
  532. X      unsigned char    cflags;
  533. X!     bool_t        (*cfunc) P((int, int)) = NOFUNC;
  534. X  
  535. X  
  536. X      /*
  537. X***************
  538. X*** 452,458 ****
  539. X       * At this point, cfunc must be set - if not, the entry in the
  540. X       * command table is zero, so disallow the input character.
  541. X       */
  542. X!     if (cfunc == NULL) {
  543. X      operator = NOP;
  544. X      Prenum = 0;
  545. X          beep(curwin);
  546. X--- 452,458 ----
  547. X       * At this point, cfunc must be set - if not, the entry in the
  548. X       * command table is zero, so disallow the input character.
  549. X       */
  550. X!     if (cfunc == NOFUNC) {
  551. X      operator = NOP;
  552. X      Prenum = 0;
  553. X          beep(curwin);
  554. X***************
  555. X*** 773,778 ****
  556. X--- 773,780 ----
  557. X  do_cmd(c1, c2)
  558. X  int    c1, c2;
  559. X  {
  560. X+     Posn *curr_pos = curwin->w_cursor;
  561. X+ 
  562. X      switch (c1) {
  563. X      case K_HELP:
  564. X      do_help(curwin);
  565. X***************
  566. X*** 784,790 ****
  567. X      break;
  568. X  
  569. X      case CTRL('G'):
  570. X!     show_file_info(curwin);
  571. X      break;
  572. X  
  573. X      case CTRL(']'):        /* :ta to current identifier */
  574. X--- 786,792 ----
  575. X      break;
  576. X  
  577. X      case CTRL('G'):
  578. X!     show_file_info(curwin, TRUE);
  579. X      break;
  580. X  
  581. X      case CTRL(']'):        /* :ta to current identifier */
  582. X***************
  583. X*** 821,827 ****
  584. X      case '!':
  585. X      if (Prenum != 0)
  586. X          opnum = Prenum;
  587. X!     startop = *curwin->w_cursor;
  588. X      operator = c1;
  589. X      break;
  590. X  
  591. X--- 823,829 ----
  592. X      case '!':
  593. X      if (Prenum != 0)
  594. X          opnum = Prenum;
  595. X!     startop = *curr_pos;
  596. X      operator = c1;
  597. X      break;
  598. X  
  599. X***************
  600. X*** 828,834 ****
  601. X      case 'p':
  602. X      case 'P':
  603. X      Redo.r_mode = r_normal;
  604. X!     do_put(curwin, curwin->w_cursor, (c1 == 'p') ? FORWARD : BACKWARD,
  605. X                              cur_yp_name);
  606. X      if (is_digit(cur_yp_name) && cur_yp_name != '0' && cur_yp_name != '9') {
  607. X          cur_yp_name++;
  608. X--- 830,836 ----
  609. X      case 'p':
  610. X      case 'P':
  611. X      Redo.r_mode = r_normal;
  612. X!     do_put(curwin, curr_pos, (c1 == 'p') ? FORWARD : BACKWARD,
  613. X                              cur_yp_name);
  614. X      if (is_digit(cur_yp_name) && cur_yp_name != '0' && cur_yp_name != '9') {
  615. X          cur_yp_name++;
  616. X***************
  617. X*** 838,851 ****
  618. X      break;
  619. X  
  620. X      case 's':        /* substitute characters */
  621. X!     start_command(curwin);
  622. X!     replchars(curwin, curwin->w_cursor->p_line,
  623. X!                 curwin->w_cursor->p_index, IDEF1PRENUM, "");
  624. X!     updateline(curwin);
  625. X!     Redo.r_mode = r_insert;
  626. X!     flexclear(&Redo.r_fb);
  627. X!     (void) lformat(&Redo.r_fb, "%lds", IDEF1PRENUM);
  628. X!     startinsert(FALSE);
  629. X      break;
  630. X  
  631. X      case ':':
  632. X--- 840,855 ----
  633. X      break;
  634. X  
  635. X      case 's':        /* substitute characters */
  636. X!     if (start_command(curwin))
  637. X!     {
  638. X!         replchars(curwin, curr_pos->p_line,
  639. X!               curr_pos->p_index, IDEF1PRENUM, "");
  640. X!         updateline(curwin);
  641. X!         Redo.r_mode = r_insert;
  642. X!         flexclear(&Redo.r_fb);
  643. X!         (void) lformat(&Redo.r_fb, "%lds", IDEF1PRENUM);
  644. X!         startinsert(FALSE);
  645. X!     }
  646. X      break;
  647. X  
  648. X      case ':':
  649. X***************
  650. X*** 855,866 ****
  651. X      break;
  652. X  
  653. X      case '&':
  654. X!     (void) do_ampersand(curwin, curwin->w_cursor->p_line,
  655. X!                     curwin->w_cursor->p_line, "");
  656. X      begin_line(curwin, TRUE);
  657. X      updateline(curwin);
  658. X      break;
  659. X! 
  660. X      case 'R':
  661. X      case 'r':
  662. X      Redo.r_mode = (c1 == 'r') ? r_replace1 : r_insert;
  663. X--- 859,872 ----
  664. X      break;
  665. X  
  666. X      case '&':
  667. X!     {
  668. X!     Line *cl = curr_pos->p_line;
  669. X! 
  670. X!     (void) do_ampersand(curwin, cl, cl, "");
  671. X      begin_line(curwin, TRUE);
  672. X      updateline(curwin);
  673. X      break;
  674. X!     }
  675. X      case 'R':
  676. X      case 'r':
  677. X      Redo.r_mode = (c1 == 'r') ? r_replace1 : r_insert;
  678. X***************
  679. X*** 925,930 ****
  680. X--- 931,937 ----
  681. X      } while (curwin->w_nrows < 2);
  682. X      curbuf = curwin->w_buffer;
  683. X      move_cursor_to_window(curwin);
  684. X+     cursupdate(curwin);
  685. X      wind_goto(curwin);
  686. X      break;
  687. X  
  688. X***************
  689. X*** 941,947 ****
  690. X       * Marks
  691. X       */
  692. X      case 'm':
  693. X!     if (!setmark(c2, curbuf, curwin->w_cursor))
  694. X          beep(curwin);
  695. X      break;
  696. X  
  697. X--- 948,954 ----
  698. X       * Marks
  699. X       */
  700. X      case 'm':
  701. X!     if (!setmark(c2, curbuf, curr_pos))
  702. X          beep(curwin);
  703. X      break;
  704. X  
  705. X***************
  706. X*** 1069,1075 ****
  707. X      /*
  708. X       * Finally, show where we are in the file.
  709. X       */
  710. X!     show_file_info(curwin);
  711. X  
  712. X      return(FALSE);
  713. X  }
  714. X--- 1076,1082 ----
  715. X      /*
  716. X       * Finally, show where we are in the file.
  717. X       */
  718. X!     show_file_info(curwin, TRUE);
  719. X  
  720. X      return(FALSE);
  721. X  }
  722. X***************
  723. X*** 1269,1274 ****
  724. X--- 1276,1282 ----
  725. X      curwin->w_topline = lp;
  726. X      lp = lp->l_prev;
  727. X      }
  728. X+     move_cursor_to_window(curwin);    /* just to get cursupdate to work */
  729. X      cursupdate(curwin);
  730. X      update_window(curwin);
  731. X  
  732. END_OF_FILE
  733. if test 5084 -ne `wc -c <'src/patch14'`; then
  734.     echo shar: \"'src/patch14'\" unpacked with wrong size!
  735. fi
  736. # end of 'src/patch14'
  737. fi
  738. if test -f 'src/patch15' -a "${1}" != "-c" ; then 
  739.   echo shar: Will not clobber existing file \"'src/patch15'\"
  740. else
  741. echo shar: Extracting \"'src/patch15'\" \(11382 characters\)
  742. sed "s/^X//" >'src/patch15' <<'END_OF_FILE'
  743. X*** old/os2vio.c    Tue Jul 28 17:46:52 1992
  744. X--- new/os2vio.c    Wed Jan 20 18:40:44 1993
  745. X***************
  746. X*** 1,5 ****
  747. X  #ifndef lint
  748. X! static char *sccsid = "@(#)os2vio.c    2.1 (Chris & John Downey) 7/29/92";
  749. X  #endif
  750. X  
  751. X  /***
  752. X--- 1,5 ----
  753. X  #ifndef lint
  754. X! static char *sccsid = "@(#)os2vio.c    2.2 (Chris & John Downey) 10/28/92";
  755. X  #endif
  756. X  
  757. X  /***
  758. X***************
  759. X*** 66,81 ****
  760. X   */
  761. X  unsigned char    curcell [2];
  762. X  
  763. X- /*
  764. X-  * Time of last keypress or mouse button press (or garbage if
  765. X-  * (keystrokes < PSVKEYS)).
  766. X-  *
  767. X-  * This should only be referenced within a thread's critical section.
  768. X-  * Referencing a 32-bit variable is not generally an atomic operation
  769. X-  * on the 80286.
  770. X-  */
  771. X- static volatile clock_t lastevent;
  772. X- 
  773. X  #ifndef NOMOUSE
  774. X      /*
  775. X       * This is FALSE if we don't appear to have a mouse driver.
  776. X--- 66,71 ----
  777. X***************
  778. X*** 115,132 ****
  779. X  
  780. X  static long    semvec [2];
  781. X  
  782. X! /*
  783. X!  * This semaphore needs to be acquired by a thread before it enters a
  784. X!  * critical region.
  785. X!  */
  786. X! #define        control ((HSEM)(long FAR *)&semvec[0])
  787. X  
  788. X! /*
  789. X!  * This semaphore is used for communication between the main thread &
  790. X!  * the thread which handles automatic buffer preservation. It should
  791. X!  * be clear when (keystrokes >= PSVKEYS), otherwise it should be set.
  792. X!  */
  793. X! #define        psvsema ((HSEM)(long FAR *)&semvec[1])
  794. X  
  795. X  #ifndef NOMOUSE
  796. X  
  797. X--- 105,118 ----
  798. X  
  799. X  static long    semvec [2];
  800. X  
  801. X! #define    producer        ((HSEM)(long FAR *)&semvec[0])
  802. X! #define    consumer        ((HSEM)(long FAR *)&semvec[1])
  803. X  
  804. X! #define s_acquire(x,t)        DosSemWait((x),(t))
  805. X! #define s_release(x)        DosSemClear(x)
  806. X! #define s_set(x)        DosSemSet(x)
  807. X! #define s_test(x)        \
  808. X!         (DosSemWait((x),SEM_IMMEDIATE_RETURN) != ERROR_SEM_TIMEOUT)
  809. X  
  810. X  #ifndef NOMOUSE
  811. X  
  812. X***************
  813. X*** 187,322 ****
  814. X  
  815. X  #endif    /* NOMOUSE */
  816. X  
  817. X! /*
  818. X!  * Macro to convert clock ticks to milliseconds.
  819. X!  */
  820. X! #if CLK_TCK == 1000
  821. X! #   define CLK2MS(c)        (c)
  822. X! #else
  823. X! #   if CLK_TCK < 1000
  824. X! #    define CLK2MS(c)    ((c) * (1000 / CLK_TCK))
  825. X! #   else
  826. X! #    define CLK2MS(c)    ((c) / (CLK_TCK / 1000))
  827. X! #   endif    /* CLK_TCK > 1000 */
  828. X! #endif    /* CLK_TCK != 1000 */
  829. X  
  830. X- /*
  831. X-  * Number of keystrokes or mouse button presses since the last buffer
  832. X-  * preservation.
  833. X-  */
  834. X- volatile int        keystrokes;
  835. X- 
  836. X- /*
  837. X-  * This function handles automatic buffer preservation. It runs in its
  838. X-  * own thread, which is only awake when keystrokes >= PSVKEYS and the
  839. X-  * main thread is waiting for keyboard input. Even then, it spends
  840. X-  * most of its time asleep.
  841. X-  */
  842. X  static void FAR
  843. X! psvhandler()
  844. X  {
  845. X      for (;;) {
  846. X!     long    sleeptime;
  847. X! 
  848. X!     DosSemWait(psvsema, SEM_INDEFINITE_WAIT);
  849. X!     DosSemRequest(control, SEM_INDEFINITE_WAIT);
  850. X!     /*
  851. X!      * Start of critical section.
  852. X!      */
  853. X!     if (keystrokes < PSVKEYS) {
  854. X!         sleeptime = 0;
  855. X!         /*
  856. X!          * If we haven't had at least PSVKEYS
  857. X!          * keystrokes, psvsema should be set.
  858. X!          */
  859. X!         DosSemSet(psvsema);
  860. X!     } else if ((sleeptime = (long) Pn(P_preservetime) * 1000 -
  861. X!               CLK2MS(clock() - lastevent)) <= 0) {
  862. X!         /*
  863. X!          * If Pn(P_presevetime) seconds haven't yet
  864. X!          * elapsed, sleep until they should have - but
  865. X!          * NOT within the critical section (!).
  866. X!          *
  867. X!          * Otherwise do automatic preserve.
  868. X!          *
  869. X!          * do_preserve() should reset keystrokes to 0.
  870. X!          */
  871. X!         (void) do_preserve();
  872. X!         sleeptime = 0;
  873. X!     }
  874. X!     /*
  875. X!      * End of critical section.
  876. X!      */
  877. X!     DosSemClear(control);
  878. X!     /*
  879. X!      * Sleep if we have to.
  880. X!      */
  881. X!     if (sleeptime != 0)
  882. X!         DosSleep(sleeptime);
  883. X      }
  884. X  }
  885. X  
  886. X  /*
  887. X   * inchar() - get a character from the keyboard.
  888. X-  *
  889. X-  * Timeout not implemented yet for OS/2.
  890. X   */
  891. X  int
  892. X  inchar(long mstimeout)
  893. X  {
  894. X      for (;;) {
  895. X!     KBDKEYINFO k;
  896. X!     bool_t    mstatus,
  897. X!         psvstatus;
  898. X  
  899. X      flush_output();
  900. X  
  901. X!     mstatus = (usemouse && State == NORMAL);
  902. X!     psvstatus = (keystrokes >= PSVKEYS);
  903. X!     /*
  904. X!      * We don't have to give control to any other thread
  905. X!      * if neither of these conditions is true.
  906. X!      */
  907. X!     if (mstatus || psvstatus) {
  908. X! #ifndef NOMOUSE
  909. X!         if (mstatus)
  910. X!         showmouse();
  911. X! #endif
  912. X!         if (psvstatus && DosSemWait(psvsema, SEM_IMMEDIATE_RETURN)
  913. X!                             == ERROR_SEM_TIMEOUT) {
  914. X!         /*
  915. X!          * If psvsema is set, clear it.
  916. X!          */
  917. X!         DosSemClear(psvsema);
  918. X!         }
  919. X!         DosSemClear(control);
  920. X      }
  921. X!     /*
  922. X!      * Start of non-critical section.
  923. X!      *
  924. X!      * Wait for character from keyboard.
  925. X!      */
  926. X!     KbdCharIn((PKBDKEYINFO) &k, IO_WAIT, 0);
  927. X!     /*
  928. X!      * End of non-critical section.
  929. X!      */
  930. X!     if (mstatus || psvstatus) {
  931. X!         DosSemRequest(control, SEM_INDEFINITE_WAIT);
  932. X! #ifndef NOMOUSE
  933. X!         if (mstatus)
  934. X!         hidemouse();
  935. X! #endif
  936. X      }
  937. X-     if (++keystrokes >= PSVKEYS)
  938. X-         lastevent = clock();
  939. X      /*
  940. X       * Now deal with the keypress information.
  941. X       */
  942. X!     if ((unsigned char) k.chChar == (unsigned char) 0xe0) {
  943. X      /*
  944. X       * It's (probably) a function key.
  945. X       */
  946. X!         if (k.chScan == 0x53)
  947. X          /*
  948. X           * It's the delete key.
  949. X           */
  950. X--- 173,231 ----
  951. X  
  952. X  #endif    /* NOMOUSE */
  953. X  
  954. X! static KBDKEYINFO kbc;
  955. X  
  956. X  static void FAR
  957. X! readkbd()
  958. X  {
  959. X      for (;;) {
  960. X!     s_acquire(producer, SEM_INDEFINITE_WAIT);
  961. X!     KbdCharIn((PKBDKEYINFO) &kbc, IO_WAIT, 0);
  962. X!     s_release(consumer);
  963. X      }
  964. X  }
  965. X  
  966. X  /*
  967. X   * inchar() - get a character from the keyboard.
  968. X   */
  969. X  int
  970. X  inchar(long mstimeout)
  971. X  {
  972. X      for (;;) {
  973. X!     static enum { LOCKED = 0, UNLOCKED } state;
  974. X!     int c;
  975. X  
  976. X      flush_output();
  977. X  
  978. X!     if (state == LOCKED) {
  979. X!         /*
  980. X!          * Let the keyboard reading thread get on with its work.
  981. X!          *
  982. X!          * If (state == UNLOCKED), we're still waiting for it to
  983. X!          * finish from last time because we timed out waiting for
  984. X!          * it.
  985. X!          */
  986. X!         s_release(producer);
  987. X      }
  988. X!     c = s_acquire(consumer,
  989. X!               (mstimeout == 0 ? SEM_INDEFINITE_WAIT : mstimeout));
  990. X!     if (c == ERROR_SEM_TIMEOUT) {
  991. X!         /*
  992. X!          * We timed out.
  993. X!          */
  994. X!         state = UNLOCKED;
  995. X!         return EOF;
  996. X!     } else {
  997. X!         state = LOCKED;
  998. X      }
  999. X      /*
  1000. X       * Now deal with the keypress information.
  1001. X       */
  1002. X!     if ((unsigned char) kbc.chChar == (unsigned char) 0xe0) {
  1003. X      /*
  1004. X       * It's (probably) a function key.
  1005. X       */
  1006. X!         if (kbc.chScan == 0x53)
  1007. X          /*
  1008. X           * It's the delete key.
  1009. X           */
  1010. X***************
  1011. X*** 326,332 ****
  1012. X          /*
  1013. X           * Assume it must be a function key.
  1014. X           */
  1015. X!         switch (k.chScan) {
  1016. X              case 0x3b: return(K_HELP);
  1017. X              /* F1 key */
  1018. X              case 0x47: return('H');
  1019. X--- 235,241 ----
  1020. X          /*
  1021. X           * Assume it must be a function key.
  1022. X           */
  1023. X!         switch (kbc.chScan) {
  1024. X              case 0x3b: return(K_HELP);
  1025. X              /* F1 key */
  1026. X              case 0x47: return('H');
  1027. X***************
  1028. X*** 361,367 ****
  1029. X           */
  1030. X          }
  1031. X      }
  1032. X!     return (unsigned char) k.chChar;
  1033. X      }
  1034. X  }
  1035. X  
  1036. X--- 270,276 ----
  1037. X           */
  1038. X          }
  1039. X      }
  1040. X!     return (unsigned char) kbc.chChar;
  1041. X      }
  1042. X  }
  1043. X  
  1044. X***************
  1045. X*** 441,446 ****
  1046. X--- 350,357 ----
  1047. X  static char                *oldscreen;
  1048. X  static unsigned short            scrsize;
  1049. X  static enum { m_SYS = 0, m_VI = 1 }    curmode;
  1050. X+ static KBDINFO                cooked_state;
  1051. X+ static KBDINFO                raw_state;
  1052. X  
  1053. X  /*
  1054. X   * Save screen contents & set up video & keyboard states for editor.
  1055. X***************
  1056. X*** 463,491 ****
  1057. X       *
  1058. X       * We only do this when we've disabled keyboard interrupts.
  1059. X       */
  1060. X!     {
  1061. X!     KBDINFO        k;
  1062. X! 
  1063. X!     k.cb = sizeof k;
  1064. X!     KbdGetStatus((PKBDINFO) &k, 0);
  1065. X!     k.fsMask = (k.fsMask
  1066. X!         /*
  1067. X!          * turn these flags off:
  1068. X!          */
  1069. X!          & ~(KEYBOARD_ECHO_ON |
  1070. X!          KEYBOARD_ASCII_MODE |
  1071. X!          KEYBOARD_MODIFY_STATE |
  1072. X!          KEYBOARD_MODIFY_INTERIM |
  1073. X!          KEYBOARD_MODIFY_TURNAROUND |
  1074. X!          KEYBOARD_2B_TURNAROUND |
  1075. X!          KEYBOARD_SHIFT_REPORT))
  1076. X!         /*
  1077. X!          * turn these flags on:
  1078. X!          */
  1079. X!         | KEYBOARD_ECHO_OFF |
  1080. X!           KEYBOARD_BINARY_MODE;
  1081. X!     KbdSetStatus((PKBDINFO) &k, 0);
  1082. X!     }
  1083. X      curmode = m_VI;
  1084. X  }
  1085. X  
  1086. X--- 374,380 ----
  1087. X       *
  1088. X       * We only do this when we've disabled keyboard interrupts.
  1089. X       */
  1090. X!     KbdSetStatus((PKBDINFO) &raw_state, 0);
  1091. X      curmode = m_VI;
  1092. X  }
  1093. X  
  1094. X***************
  1095. X*** 516,525 ****
  1096. X      }
  1097. X      oldscreen = malloc(scrsize);
  1098. X      /*
  1099. X!      * We have to acquire this semaphore before we start any other
  1100. X!      * threads.
  1101. X       */
  1102. X!     DosSemSet(control);
  1103. X  #ifndef NOMOUSE
  1104. X      /*
  1105. X       * Open mouse device if we can.
  1106. X--- 405,415 ----
  1107. X      }
  1108. X      oldscreen = malloc(scrsize);
  1109. X      /*
  1110. X!      * We have to acquire these semaphores before the first call to
  1111. X!      * inchar() & before the keyboard reading thread is started.
  1112. X       */
  1113. X!     s_set(consumer);
  1114. X!     s_set(producer);
  1115. X  #ifndef NOMOUSE
  1116. X      /*
  1117. X       * Open mouse device if we can.
  1118. X***************
  1119. X*** 550,572 ****
  1120. X      }
  1121. X  #endif    /* NOMOUSE */
  1122. X      /*
  1123. X!      * Initialize semaphore for automatic buffer preservation. It
  1124. X!      * should only be clear if (keystrokes >= PSVKEYS).
  1125. X!      */
  1126. X!     DosSemSet(psvsema);
  1127. X!     /*
  1128. X!      * Create concurrent thread to do automatic preserves.
  1129. X       *
  1130. X!      * According to Microsoft, the ES register should be set to 0 first.
  1131. X       */
  1132. X      {
  1133. X!     TID psvthread;
  1134. X  
  1135. X!     if (DosCreateThread((PFNTHREAD) psvhandler,
  1136. X!             (es0(), (PTID) &psvthread),
  1137. X!             (PBYTE) newstack(20000)) != 0) {
  1138. X!         (void) fputs("Can't create thread for automatic preserves\r\n",
  1139. X!              stderr);
  1140. X          exit(1);
  1141. X      }
  1142. X      }
  1143. X--- 440,458 ----
  1144. X      }
  1145. X  #endif    /* NOMOUSE */
  1146. X      /*
  1147. X!      * Create concurrent thread to read from the keyboard.
  1148. X       *
  1149. X!      * According to Microsoft, the ES register should be set to 0
  1150. X!      * first.
  1151. X       */
  1152. X      {
  1153. X!     TID kbdthread;
  1154. X  
  1155. X!     es0();
  1156. X!     if (DosCreateThread((PFNTHREAD) readkbd,
  1157. X!                 (PTID) &kbdthread,
  1158. X!                 (PBYTE) newstack(20000)) != 0) {
  1159. X!         (void) fprintf(stderr, "Can't create keyboard thread\r\n");
  1160. X          exit(1);
  1161. X      }
  1162. X      }
  1163. X***************
  1164. X*** 574,579 ****
  1165. X--- 460,488 ----
  1166. X       * Disable system critical error handler.
  1167. X       */
  1168. X      DosError(HARDERROR_DISABLE);
  1169. X+     /*
  1170. X+      * Get keyboard state & set up raw_state structure.
  1171. X+      */
  1172. X+     cooked_state.cb = sizeof cooked_state;
  1173. X+     KbdGetStatus((PKBDINFO) &cooked_state, 0);
  1174. X+     memcpy((char *) &raw_state, (char *) &cooked_state, sizeof raw_state);
  1175. X+     raw_state.fsMask =
  1176. X+         (raw_state.fsMask
  1177. X+         /*
  1178. X+          * turn these flags off:
  1179. X+          */
  1180. X+         & ~(KEYBOARD_ECHO_ON |
  1181. X+             KEYBOARD_ASCII_MODE |
  1182. X+             KEYBOARD_MODIFY_STATE |
  1183. X+             KEYBOARD_MODIFY_INTERIM |
  1184. X+             KEYBOARD_MODIFY_TURNAROUND |
  1185. X+             KEYBOARD_2B_TURNAROUND |
  1186. X+             KEYBOARD_SHIFT_REPORT))
  1187. X+         /*
  1188. X+          * turn these flags on:
  1189. X+          */
  1190. X+         | KEYBOARD_ECHO_OFF |
  1191. X+           KEYBOARD_BINARY_MODE;
  1192. X      sys_startv();
  1193. X  }
  1194. X  
  1195. X***************
  1196. X*** 586,614 ****
  1197. X  void
  1198. X  sys_endv()
  1199. X  {
  1200. X-     KBDINFO k;
  1201. X- 
  1202. X      if (curmode == m_SYS)
  1203. X      return;
  1204. X!     k.cb = sizeof k;
  1205. X!     KbdGetStatus((PKBDINFO) &k, 0);
  1206. X!     k.fsMask = (k.fsMask
  1207. X!         /*
  1208. X!          * turn these flags off:
  1209. X!          */
  1210. X!          & ~(KEYBOARD_ECHO_OFF |
  1211. X!          KEYBOARD_BINARY_MODE |
  1212. X!          KEYBOARD_MODIFY_STATE |
  1213. X!          KEYBOARD_MODIFY_INTERIM |
  1214. X!          KEYBOARD_MODIFY_TURNAROUND |
  1215. X!          KEYBOARD_2B_TURNAROUND |
  1216. X!          KEYBOARD_SHIFT_REPORT))
  1217. X!         /*
  1218. X!          * turn these flags on:
  1219. X!          */
  1220. X!         | KEYBOARD_ECHO_ON |
  1221. X!           KEYBOARD_ASCII_MODE;
  1222. X!     KbdSetStatus((PKBDINFO) &k, 0);
  1223. X      if (oldscreen != (char*) 0)
  1224. X      /*
  1225. X       * Restore contents of screen saved by
  1226. X--- 495,503 ----
  1227. X  void
  1228. X  sys_endv()
  1229. X  {
  1230. X      if (curmode == m_SYS)
  1231. X      return;
  1232. X!     KbdSetStatus((PKBDINFO) &cooked_state, 0);
  1233. X      if (oldscreen != (char*) 0)
  1234. X      /*
  1235. X       * Restore contents of screen saved by
  1236. END_OF_FILE
  1237. if test 11382 -ne `wc -c <'src/patch15'`; then
  1238.     echo shar: \"'src/patch15'\" unpacked with wrong size!
  1239. fi
  1240. # end of 'src/patch15'
  1241. fi
  1242. if test -f 'src/patch17' -a "${1}" != "-c" ; then 
  1243.   echo shar: Will not clobber existing file \"'src/patch17'\"
  1244. else
  1245. echo shar: Extracting \"'src/patch17'\" \(3975 characters\)
  1246. sed "s/^X//" >'src/patch17' <<'END_OF_FILE'
  1247. X*** old/param.h    Tue Jul 28 17:46:56 1992
  1248. X--- new/param.h    Mon Nov 30 15:25:35 1992
  1249. X***************
  1250. X*** 1,7 ****
  1251. X  /* Copyright (c) 1990,1991,1992 Chris and John Downey */
  1252. X  /***
  1253. X  
  1254. X! * @(#)param.h    2.1 (Chris & John Downey) 7/29/92
  1255. X  
  1256. X  * program name:
  1257. X      xvi
  1258. X--- 1,7 ----
  1259. X  /* Copyright (c) 1990,1991,1992 Chris and John Downey */
  1260. X  /***
  1261. X  
  1262. X! * @(#)param.h    2.2 (Chris & John Downey) 11/6/92
  1263. X  
  1264. X  * program name:
  1265. X      xvi
  1266. X***************
  1267. X*** 107,172 ****
  1268. X  /*
  1269. X   * The following are the indices in the params array for each parameter.
  1270. X   * They must not be changed without also changing the table in "param.c".
  1271. X   */
  1272. X  #define P_ada        0
  1273. X! #define P_adapath     1
  1274. X! #define P_autoindent     2
  1275. X! #define P_autoprint     3
  1276. X! #define P_autosplit     4
  1277. X! #define P_autowrite     5
  1278. X! #define P_beautify     6
  1279. X! #define P_cchars     7
  1280. X! #define P_colour     8
  1281. X! #define P_directory     9
  1282. X! #define P_edcompatible     10
  1283. X! #define P_edit         11
  1284. X! #define P_errorbells     12
  1285. X! #define P_format     13
  1286. X! #define P_hardtabs     14
  1287. X! #define P_helpfile     15
  1288. X! #define P_ignorecase     16
  1289. X! #define P_jumpscroll     17
  1290. X! #define P_lisp         18
  1291. X! #define P_list         19
  1292. X! #define P_magic     20
  1293. X! #define P_mchars     21
  1294. X! #define P_mesg         22
  1295. X! #define P_minrows     23
  1296. X! #define P_modeline     24
  1297. X! #define P_number     25
  1298. X! #define P_open         26
  1299. X! #define P_optimize     27
  1300. X! #define P_paragraphs     28
  1301. X! #define P_preserve     29
  1302. X! #define P_preservetime     30
  1303. X! #define P_prompt     31
  1304. X! #define P_readonly     32
  1305. X! #define P_redraw     33
  1306. X! #define P_regextype     34
  1307. X! #define P_remap     35
  1308. X! #define P_report     36
  1309. X! #define P_roscolour     37
  1310. X! #define P_scroll     38
  1311. X! #define P_sections     39
  1312. X! #define P_sentences     40
  1313. X! #define P_shell     41
  1314. X! #define P_shiftwidth     42
  1315. X! #define P_showmatch     43
  1316. X! #define P_slowopen     44
  1317. X! #define P_sourceany     45
  1318. X! #define P_statuscolour     46
  1319. X! #define P_systemcolour     47
  1320. X! #define P_tabs         48
  1321. X! #define P_tabstop     49
  1322. X! #define P_taglength     50
  1323. X! #define P_tags         51
  1324. X! #define P_term         52
  1325. X! #define P_terse     53
  1326. X! #define P_timeout     54
  1327. X! #define P_ttytype     55
  1328. X! #define P_vbell     56
  1329. X! #define P_warn         57
  1330. X! #define P_window     58
  1331. X! #define P_wrapmargin     59
  1332. X! #define P_wrapscan     60
  1333. X! #define P_writeany     61
  1334. X--- 107,180 ----
  1335. X  /*
  1336. X   * The following are the indices in the params array for each parameter.
  1337. X   * They must not be changed without also changing the table in "param.c".
  1338. X+  *
  1339. X+  * If you add any new parameters, & you have access to awk, pipe this
  1340. X+  * list through
  1341. X+  *
  1342. X+  *    awk '{ printf "%s %s\t%d\n", $1, $2, NR - 1 }'
  1343. X+  *
  1344. X+  * to keep the numbers updated.
  1345. X   */
  1346. X  #define P_ada        0
  1347. X! #define P_adapath    1
  1348. X! #define P_autoindent    2
  1349. X! #define P_autoprint    3
  1350. X! #define P_autosplit    4
  1351. X! #define P_autowrite    5
  1352. X! #define P_beautify    6
  1353. X! #define P_cchars    7
  1354. X! #define P_colour    8
  1355. X! #define P_directory    9
  1356. X! #define P_edcompatible    10
  1357. X! #define P_edit        11
  1358. X! #define P_errorbells    12
  1359. X! #define P_format    13
  1360. X! #define P_hardtabs    14
  1361. X! #define P_helpfile    15
  1362. X! #define P_ignorecase    16
  1363. X! #define P_infoupdate    17
  1364. X! #define P_jumpscroll    18
  1365. X! #define P_lisp        19
  1366. X! #define P_list        20
  1367. X! #define P_magic        21
  1368. X! #define P_mchars    22
  1369. X! #define P_mesg        23
  1370. X! #define P_minrows    24
  1371. X! #define P_modeline    25
  1372. X! #define P_number    26
  1373. X! #define P_open        27
  1374. X! #define P_optimize    28
  1375. X! #define P_paragraphs    29
  1376. X! #define P_preserve    30
  1377. X! #define P_preservetime    31
  1378. X! #define P_prompt    32
  1379. X! #define P_readonly    33
  1380. X! #define P_redraw    34
  1381. X! #define P_regextype    35
  1382. X! #define P_remap        36
  1383. X! #define P_report    37
  1384. X! #define P_roscolour    38
  1385. X! #define P_scroll    39
  1386. X! #define P_sections    40
  1387. X! #define P_sentences    41
  1388. X! #define P_shell        42
  1389. X! #define P_shiftwidth    43
  1390. X! #define P_showmatch    44
  1391. X! #define P_slowopen    45
  1392. X! #define P_sourceany    46
  1393. X! #define P_statuscolour    47
  1394. X! #define P_systemcolour    48
  1395. X! #define P_tabs        49
  1396. X! #define P_tabstop    50
  1397. X! #define P_taglength    51
  1398. X! #define P_tags        52
  1399. X! #define P_term        53
  1400. X! #define P_terse        54
  1401. X! #define P_timeout    55
  1402. X! #define P_ttytype    56
  1403. X! #define P_vbell        57
  1404. X! #define P_warn        58
  1405. X! #define P_window    59
  1406. X! #define P_wrapmargin    60
  1407. X! #define P_wrapscan    61
  1408. X! #define P_writeany    62
  1409. END_OF_FILE
  1410. if test 3975 -ne `wc -c <'src/patch17'`; then
  1411.     echo shar: \"'src/patch17'\" unpacked with wrong size!
  1412. fi
  1413. # end of 'src/patch17'
  1414. fi
  1415. if test -f 'src/patch19' -a "${1}" != "-c" ; then 
  1416.   echo shar: Will not clobber existing file \"'src/patch19'\"
  1417. else
  1418. echo shar: Extracting \"'src/patch19'\" \(12055 characters\)
  1419. sed "s/^X//" >'src/patch19' <<'END_OF_FILE'
  1420. X*** old/screen.c    Tue Jul 28 17:47:10 1992
  1421. X--- new/screen.c    Mon Nov 30 15:25:39 1992
  1422. X***************
  1423. X*** 1,6 ****
  1424. X  /* Copyright (c) 1990,1991,1992 Chris and John Downey */
  1425. X  #ifndef lint
  1426. X! static char *sccsid = "@(#)screen.c    2.3 (Chris & John Downey) 9/4/92";
  1427. X  #endif
  1428. X  
  1429. X  /***
  1430. X--- 1,6 ----
  1431. X  /* Copyright (c) 1990,1991,1992 Chris and John Downey */
  1432. X  #ifndef lint
  1433. X! static char *sccsid = "@(#)screen.c    2.10 (Chris & John Downey) 11/30/92";
  1434. X  #endif
  1435. X  
  1436. X  /***
  1437. X***************
  1438. X*** 52,58 ****
  1439. X  #define    L_COMMAND    0x10        /* is a command line */
  1440. X  #define    L_READONLY    0x20        /* message line for readonly buffer */
  1441. X  
  1442. X! #define    L_STATUS    (L_MESSAGE | L_COMMAND)        /* is a status line */
  1443. X  
  1444. X  static    Sline    *new_screen;        /* screen being updated */
  1445. X  static    Sline    *real_screen;        /* state of real screen */
  1446. X--- 52,59 ----
  1447. X  #define    L_COMMAND    0x10        /* is a command line */
  1448. X  #define    L_READONLY    0x20        /* message line for readonly buffer */
  1449. X  
  1450. X! #define    L_STATUS    (L_MESSAGE | L_COMMAND | L_READONLY)
  1451. X!                     /* is a status line */
  1452. X  
  1453. X  static    Sline    *new_screen;        /* screen being updated */
  1454. X  static    Sline    *real_screen;        /* state of real screen */
  1455. X***************
  1456. X*** 412,418 ****
  1457. X      VSset_colour(vs, Pn(P_colour));
  1458. X  
  1459. X      for (row = start_row; row < end_row; row++) {
  1460. X!     register int            ncol;   /* current column in new_screen */
  1461. X      register Sline          *new,
  1462. X                  *real;  /* pointers to current lines */
  1463. X      register unsigned       nflags;
  1464. X--- 413,419 ----
  1465. X      VSset_colour(vs, Pn(P_colour));
  1466. X  
  1467. X      for (row = start_row; row < end_row; row++) {
  1468. X!     register int            col;   /* current column */
  1469. X      register Sline          *new,
  1470. X                  *real;  /* pointers to current lines */
  1471. X      register unsigned       nflags;
  1472. X***************
  1473. X*** 452,458 ****
  1474. X           * on some terminals.
  1475. X           */
  1476. X          VSgoto(vs, row, 0);
  1477. X!         if (nflags & L_STATUS) {
  1478. X          VSset_colour(vs, (nflags & L_READONLY) ? Pn(P_roscolour) :
  1479. X                          Pn(P_statuscolour));
  1480. X          }
  1481. X--- 453,459 ----
  1482. X           * on some terminals.
  1483. X           */
  1484. X          VSgoto(vs, row, 0);
  1485. X!         if ((nflags & L_MESSAGE) || ((nflags & L_COMMAND) && colour_cost == 0)) {
  1486. X          VSset_colour(vs, (nflags & L_READONLY) ? Pn(P_roscolour) :
  1487. X                          Pn(P_statuscolour));
  1488. X          }
  1489. X***************
  1490. X*** 461,469 ****
  1491. X          }
  1492. X          /*
  1493. X           * For command lines, only the first character should be
  1494. X!          * highlighted.
  1495. X           */
  1496. X!         if (nflags & L_COMMAND) {
  1497. X          VSset_colour(vs, Pn(P_colour));
  1498. X          }
  1499. X          if (nc != '\0') {
  1500. X--- 462,470 ----
  1501. X          }
  1502. X          /*
  1503. X           * For command lines, only the first character should be
  1504. X!          * highlighted, except if (colour_cost != 0).
  1505. X           */
  1506. X!         if ((nflags & L_COMMAND) && colour_cost == 0) {
  1507. X          VSset_colour(vs, Pn(P_colour));
  1508. X          }
  1509. X          if (nc != '\0') {
  1510. X***************
  1511. X*** 495,540 ****
  1512. X           * There is some optimisation here to avoid large
  1513. X           * use of tty_goto.
  1514. X           */
  1515. X!         register int        scol;
  1516. X!                 /* current column on physical screen */
  1517. X!         register int        last_ncol;
  1518. X                  /* last column to be updated */
  1519. X  
  1520. X!         for (ncol = scol = last_ncol = 0;
  1521. X!                  ncol < n_used && ncol < r_used;
  1522. X!                  (ncol++, scol++)) {
  1523. X!         if ((nc = ntextp[ncol]) != rtextp[ncol]) {
  1524. X              /*
  1525. X               * They are different. Get to the right
  1526. X               * place before putting out the char.
  1527. X               */
  1528. X!             if (ncol != 0) {
  1529. X!             VSadvise(vs, row, last_ncol + 1,
  1530. X!                         ncol - last_ncol - 1,
  1531. X!                         ntextp + last_ncol + 1);
  1532. X              } else {
  1533. X!             VSgoto(vs, row, scol);
  1534. X              /*
  1535. X!              * A command line should have the first character
  1536. X!              * - and only the first character - highlighted.
  1537. X               */
  1538. X!             if (ncol == 0 && (nflags & L_STATUS) != 0) {
  1539. X                  VSset_colour(vs, (nflags & L_READONLY) ?
  1540. X                      Pn(P_roscolour) : Pn(P_statuscolour));
  1541. X              }
  1542. X              }
  1543. X  
  1544. X!             VSputc(vs, row, ncol, nc);
  1545. X  
  1546. X!             if (ncol == 0 && (nflags & L_COMMAND) != 0) {
  1547. X              VSset_colour(vs, Pn(P_colour));
  1548. X              }
  1549. X!             last_ncol = ncol;
  1550. X!             rtextp[ncol] = nc;
  1551. X          }
  1552. X-         if (ncol == 0 && (nflags & L_COMMAND) != 0) {
  1553. X-             scol += (colour_cost * 2);
  1554. X-         }
  1555. X          }
  1556. X  
  1557. X          if (n_used > r_used) {
  1558. X--- 496,539 ----
  1559. X           * There is some optimisation here to avoid large
  1560. X           * use of tty_goto.
  1561. X           */
  1562. X!         register int        last_col;
  1563. X                  /* last column to be updated */
  1564. X  
  1565. X!         for (col = last_col = 0; col < n_used && col < r_used; col++) {
  1566. X!         if ((nc = ntextp[col]) != rtextp[col]) {
  1567. X              /*
  1568. X               * They are different. Get to the right
  1569. X               * place before putting out the char.
  1570. X               */
  1571. X!             if (col != 0) {
  1572. X!             VSadvise(vs, row, last_col + 1,
  1573. X!                         col - last_col - 1,
  1574. X!                         ntextp + last_col + 1);
  1575. X              } else {
  1576. X!             VSgoto(vs, row, col);
  1577. X              /*
  1578. X!              * A command line should have the first
  1579. X!              * character - and only the first character -
  1580. X!              * highlighted, except if (colour_cost != 0),
  1581. X!              * because that complicates our updating
  1582. X!              * algorithm too much.
  1583. X               */
  1584. X!             if (col == 0 && (nflags & L_COMMAND) &&
  1585. X!                         colour_cost == 0) {
  1586. X                  VSset_colour(vs, (nflags & L_READONLY) ?
  1587. X                      Pn(P_roscolour) : Pn(P_statuscolour));
  1588. X              }
  1589. X              }
  1590. X  
  1591. X!             VSputc(vs, row, col, nc);
  1592. X  
  1593. X!             if (col == 0 && (nflags & L_COMMAND) &&
  1594. X!                             colour_cost == 0) {
  1595. X              VSset_colour(vs, Pn(P_colour));
  1596. X              }
  1597. X!             last_col = col;
  1598. X!             rtextp[col] = nc;
  1599. X          }
  1600. X          }
  1601. X  
  1602. X          if (n_used > r_used) {
  1603. X***************
  1604. X*** 543,570 ****
  1605. X           * screen line; if there is anything left,
  1606. X           * we should just display it.
  1607. X           */
  1608. X!         (void) strcpy(&rtextp[ncol], &ntextp[ncol]);
  1609. X!         if (ncol == 0 && (nflags & L_COMMAND) != 0) {
  1610. X              /*
  1611. X               * A command line should have the first character
  1612. X!              * - and only the first character - highlighted.
  1613. X               */
  1614. X              VSgoto(vs, row, 0);
  1615. X              VSset_colour(vs, Pn(P_statuscolour));
  1616. X              VSputc(vs, row, 0, ntextp[0]);
  1617. X              VSset_colour(vs, Pn(P_colour));
  1618. X!             ncol = 1;
  1619. X          } else {
  1620. X              /*
  1621. X               * Skip over initial whitespace.
  1622. X               */
  1623. X!             while (ntextp[ncol] == ' ') {
  1624. X!             ncol++;
  1625. X!             scol++;
  1626. X              }
  1627. X          }
  1628. X!         if (ncol < columns)
  1629. X!             VSwrite(vs, row, scol, &ntextp[ncol]);
  1630. X          } else if (r_used > n_used) {
  1631. X          /*
  1632. X           * We have got to the end of the new screen
  1633. X--- 542,570 ----
  1634. X           * screen line; if there is anything left,
  1635. X           * we should just display it.
  1636. X           */
  1637. X!         (void) strcpy(&rtextp[col], &ntextp[col]);
  1638. X!         if (col == 0 && (nflags & L_COMMAND) && colour_cost == 0) {
  1639. X              /*
  1640. X               * A command line should have the first character
  1641. X!              * - and only the first character - highlighted,
  1642. X!              * as long as (colour_cost != 0).
  1643. X               */
  1644. X              VSgoto(vs, row, 0);
  1645. X              VSset_colour(vs, Pn(P_statuscolour));
  1646. X              VSputc(vs, row, 0, ntextp[0]);
  1647. X              VSset_colour(vs, Pn(P_colour));
  1648. X!             col = 1;
  1649. X          } else {
  1650. X              /*
  1651. X               * Skip over initial whitespace.
  1652. X               */
  1653. X!             while (ntextp[col] == ' ') {
  1654. X!             col++;
  1655. X              }
  1656. X          }
  1657. X!         if (col < columns) {
  1658. X!             VSwrite(vs, row, col, &ntextp[col]);
  1659. X!         }
  1660. X          } else if (r_used > n_used) {
  1661. X          /*
  1662. X           * We have got to the end of the new screen
  1663. X***************
  1664. X*** 571,577 ****
  1665. X           * line, but the old one still has stuff on
  1666. X           * it. We must therefore clear it.
  1667. X           */
  1668. X!         VSclear_line(vs, row, scol);
  1669. X          }
  1670. X      }
  1671. X  
  1672. X--- 571,577 ----
  1673. X           * line, but the old one still has stuff on
  1674. X           * it. We must therefore clear it.
  1675. X           */
  1676. X!         VSclear_line(vs, row, col);
  1677. X          }
  1678. X      }
  1679. X  
  1680. X***************
  1681. X*** 628,634 ****
  1682. X      register char    *end;
  1683. X      Sline        *slp;
  1684. X  
  1685. X!     from = flexgetstr(&win->w_statusline);
  1686. X      slp = &new_screen[win->w_cmdline];
  1687. X      to = slp->l_line;
  1688. X      end = to + win->w_ncols - st_spare_cols;
  1689. X--- 628,634 ----
  1690. X      register char    *end;
  1691. X      Sline        *slp;
  1692. X  
  1693. X!     from = sline_text(win);
  1694. X      slp = &new_screen[win->w_cmdline];
  1695. X      to = slp->l_line;
  1696. X      end = to + win->w_ncols - st_spare_cols;
  1697. X***************
  1698. X*** 666,673 ****
  1699. X      if ((width = flexlen(&win->w_statusline)) > maxwidth) {
  1700. X      width = maxwidth;
  1701. X      }
  1702. X!     (void) strncpy(clp->l_line, flexgetstr(&win->w_statusline),
  1703. X!                 (int) width);
  1704. X      clp->l_used = width;
  1705. X      clp->l_line[width] = '\0';
  1706. X      clp->l_flags = (L_COMMAND | L_DIRTY);
  1707. X--- 666,672 ----
  1708. X      if ((width = flexlen(&win->w_statusline)) > maxwidth) {
  1709. X      width = maxwidth;
  1710. X      }
  1711. X!     (void) strncpy(clp->l_line, sline_text(win), (int) width);
  1712. X      clp->l_used = width;
  1713. X      clp->l_line[width] = '\0';
  1714. X      clp->l_flags = (L_COMMAND | L_DIRTY);
  1715. X***************
  1716. X*** 843,849 ****
  1717. X  
  1718. X      vs = win->w_vs;
  1719. X  
  1720. X!     if (vs->v_scroll != NULL) {
  1721. X      if (!VSscroll(vs, row, (int) win->w_cmdline - 1, -nlines)) {
  1722. X          /*
  1723. X           * Can't scroll what we were asked to - try scrolling
  1724. X--- 842,848 ----
  1725. X  
  1726. X      vs = win->w_vs;
  1727. X  
  1728. X!     if (vs->v_scroll != NOFUNC) {
  1729. X      if (!VSscroll(vs, row, (int) win->w_cmdline - 1, -nlines)) {
  1730. X          /*
  1731. X           * Can't scroll what we were asked to - try scrolling
  1732. X***************
  1733. X*** 931,937 ****
  1734. X  
  1735. X      vs = win->w_vs;
  1736. X  
  1737. X!     if (vs->v_scroll != NULL) {
  1738. X      if (!VSscroll(vs, row, (int) win->w_cmdline - 1, nlines)) {
  1739. X          /*
  1740. X           * Can't scroll what we were asked to - try scrolling
  1741. X--- 930,936 ----
  1742. X  
  1743. X      vs = win->w_vs;
  1744. X  
  1745. X!     if (vs->v_scroll != NOFUNC) {
  1746. X      if (!VSscroll(vs, row, (int) win->w_cmdline - 1, nlines)) {
  1747. X          /*
  1748. X           * Can't scroll what we were asked to - try scrolling
  1749. X***************
  1750. X*** 1004,1014 ****
  1751. X      unsigned        columns;
  1752. X  
  1753. X      vs = window->w_vs;
  1754. X!     if (vs->v_insert == NULL)
  1755. X      return;
  1756. X  
  1757. X!     if (!(echo & e_CHARUPDATE))
  1758. X      return;
  1759. X  
  1760. X      pp = window->w_cursor;
  1761. X  
  1762. X--- 1003,1015 ----
  1763. X      unsigned        columns;
  1764. X  
  1765. X      vs = window->w_vs;
  1766. X!     if (vs->v_insert == NOFUNC) {
  1767. X      return;
  1768. X+     }
  1769. X  
  1770. X!     if (!(echo & e_CHARUPDATE)) {
  1771. X      return;
  1772. X+     }
  1773. X  
  1774. X      pp = window->w_cursor;
  1775. X  
  1776. X***************
  1777. X*** 1017,1024 ****
  1778. X       * the bother. Define near as 0 or 1 characters to be moved.
  1779. X       */
  1780. X      cp = pp->p_line->l_text + pp->p_index;
  1781. X!     if (*cp == '\0' || *(cp+1) == '\0')
  1782. X      return;
  1783. X  
  1784. X      curcol = window->w_col;
  1785. X  
  1786. X--- 1018,1026 ----
  1787. X       * the bother. Define near as 0 or 1 characters to be moved.
  1788. X       */
  1789. X      cp = pp->p_line->l_text + pp->p_index;
  1790. X!     if (*cp == '\0' || *(cp+1) == '\0') {
  1791. X      return;
  1792. X+     }
  1793. X  
  1794. X      curcol = window->w_col;
  1795. X  
  1796. X***************
  1797. X*** 1026,1033 ****
  1798. X       * If the cursor is on a longline, and not on the last actual
  1799. X       * screen line of that longline, we can't do it.
  1800. X       */
  1801. X!     if (window->w_c_line_size > 1 && curcol != window->w_virtcol)
  1802. X      return;
  1803. X  
  1804. X      nchars = vischar(newchar, &newstr, curcol);
  1805. X  
  1806. X--- 1028,1036 ----
  1807. X       * If the cursor is on a longline, and not on the last actual
  1808. X       * screen line of that longline, we can't do it.
  1809. X       */
  1810. X!     if (window->w_c_line_size > 1 && curcol != window->w_virtcol) {
  1811. X      return;
  1812. X+     }
  1813. X  
  1814. X      nchars = vischar(newchar, &newstr, curcol);
  1815. X  
  1816. X***************
  1817. X*** 1035,1042 ****
  1818. X       * And don't bother if we are (or will be) at the last screen column.
  1819. X       */
  1820. X      columns = window->w_ncols;
  1821. X!     if (curcol + nchars >= columns)
  1822. X      return;
  1823. X  
  1824. X      /*
  1825. X       * Also, trying to push tabs rightwards doesn't work very
  1826. X--- 1038,1046 ----
  1827. X       * And don't bother if we are (or will be) at the last screen column.
  1828. X       */
  1829. X      columns = window->w_ncols;
  1830. X!     if (curcol + nchars >= columns) {
  1831. X      return;
  1832. X+     }
  1833. X  
  1834. X      /*
  1835. X       * Also, trying to push tabs rightwards doesn't work very
  1836. X***************
  1837. X*** 1060,1067 ****
  1838. X       */
  1839. X      rp = &real_screen[window->w_winpos + currow];
  1840. X      curp = &rp->l_line[curcol];
  1841. X!     if ((rp->l_used += nchars) > columns)
  1842. X      rp->l_used = columns;
  1843. X      cp = &rp->l_line[rp->l_used - 1];
  1844. X      cp[1] = '\0';
  1845. X      if (cp - curp >= nchars)
  1846. X--- 1064,1072 ----
  1847. X       */
  1848. X      rp = &real_screen[window->w_winpos + currow];
  1849. X      curp = &rp->l_line[curcol];
  1850. X!     if ((rp->l_used += nchars) > columns) {
  1851. X      rp->l_used = columns;
  1852. X+     }
  1853. X      cp = &rp->l_line[rp->l_used - 1];
  1854. X      cp[1] = '\0';
  1855. X      if (cp - curp >= nchars)
  1856. END_OF_FILE
  1857. if test 12055 -ne `wc -c <'src/patch19'`; then
  1858.     echo shar: \"'src/patch19'\" unpacked with wrong size!
  1859. fi
  1860. # end of 'src/patch19'
  1861. fi
  1862. if test -f 'src/patch30' -a "${1}" != "-c" ; then 
  1863.   echo shar: Will not clobber existing file \"'src/patch30'\"
  1864. else
  1865. echo shar: Extracting \"'src/patch30'\" \(5043 characters\)
  1866. sed "s/^X//" >'src/patch30' <<'END_OF_FILE'
  1867. X*** old/xvi.h    Tue Jul 28 17:47:48 1992
  1868. X--- new/xvi.h    Tue Dec 29 11:24:29 1992
  1869. X***************
  1870. X*** 1,7 ****
  1871. X  /* Copyright (c) 1990,1991,1992 Chris and John Downey */
  1872. X  /***
  1873. X  
  1874. X! * @(#)xvi.h    2.5 (Chris & John Downey) 9/1/92
  1875. X  
  1876. X  * program name:
  1877. X      xvi
  1878. X--- 1,7 ----
  1879. X  /* Copyright (c) 1990,1991,1992 Chris and John Downey */
  1880. X  /***
  1881. X  
  1882. X! * @(#)xvi.h    2.10 (Chris & John Downey) 11/30/92
  1883. X  
  1884. X  * program name:
  1885. X      xvi
  1886. X***************
  1887. X*** 95,100 ****
  1888. X--- 95,108 ----
  1889. X  extern    void    sleep P((unsigned seconds));
  1890. X  
  1891. X  /*
  1892. X+  * A null function pointer definition. Some ANSI compilers complain
  1893. X+  * about comparison/assignment of function pointers with (void *) 0,
  1894. X+  * and since that's what NULL is usually defined as (under ANSI) we
  1895. X+  * use this to stop the warnings.
  1896. X+  */
  1897. X+ #define    NOFUNC    0
  1898. X+ 
  1899. X+ /*
  1900. X   * If we have ANSI C, these should be defined in limits.h:
  1901. X   */
  1902. X  #ifndef INT_MAX
  1903. X***************
  1904. X*** 170,183 ****
  1905. X  #define    MINROWS        2
  1906. X  
  1907. X  /*
  1908. X-  * SLOP is the amount of extra space we get for text on a line during
  1909. X-  * editing operations that need more space. This keeps us from calling
  1910. X-  * malloc every time we get a character during insert mode. No extra
  1911. X-  * space is allocated when the file is initially read.
  1912. X-  */
  1913. X- #define    SLOP        10
  1914. X- 
  1915. X- /*
  1916. X   * The number of characters taken up by the line number
  1917. X   * when "number" is set; up to 6 digits plus two spaces.
  1918. X   */
  1919. X--- 178,183 ----
  1920. X***************
  1921. X*** 185,196 ****
  1922. X  #define    NUM_FMT        "%6ld  "
  1923. X  
  1924. X  /*
  1925. X-  * (MAX_LINE_LENGTH - 1) gives the maximum line length this editor can read in.
  1926. X-  * Used by fileio.c (getfile()) and pipe.c (p_read()).
  1927. X-  */
  1928. X- #define    MAX_LINE_LENGTH    1024
  1929. X- 
  1930. X- /*
  1931. X   * Maximum value for the tabstop parameter.
  1932. X   */
  1933. X  #define    MAX_TABSTOP    32
  1934. X--- 185,190 ----
  1935. X***************
  1936. X*** 277,282 ****
  1937. X--- 271,284 ----
  1938. X  #define    js_AUTO        1
  1939. X  #define    js_ON        2
  1940. X  
  1941. X+ /*
  1942. X+  * Integer values for the P_infoupdate enumerated parameter. Note that
  1943. X+  * the entries in iu_strings (defined in param.c) must follow the same
  1944. X+  * order.
  1945. X+  */
  1946. X+ #define    iu_TERSE    0
  1947. X+ #define    iu_CONTINUOUS    1
  1948. X+ 
  1949. X  /***************************************************************
  1950. X   *                                                             *
  1951. X   * SECTION 6: EDITOR TYPE DEFINITIONS                          *
  1952. X***************
  1953. X*** 511,517 ****
  1954. X   * Structure used to hold information about a "window" -
  1955. X   * this is intimately associated with the Buffer structure.
  1956. X   */
  1957. X! typedef struct window {
  1958. X      Posn        *w_cursor;    /* cursor's position in buffer */
  1959. X  
  1960. X      Buffer        *w_buffer;    /* buffer we are a window into */
  1961. X--- 513,519 ----
  1962. X   * Structure used to hold information about a "window" -
  1963. X   * this is intimately associated with the Buffer structure.
  1964. X   */
  1965. X! typedef struct xviwin {
  1966. X      Posn        *w_cursor;    /* cursor's position in buffer */
  1967. X  
  1968. X      Buffer        *w_buffer;    /* buffer we are a window into */
  1969. X***************
  1970. X*** 527,546 ****
  1971. X      unsigned        w_cmdline;    /* row of window command line */
  1972. X  
  1973. X      /*
  1974. X-      * These are used by the ^O command to store the previous
  1975. X-      * size of the window so that we can return to it.
  1976. X-      */
  1977. X-     int            w_2winpos;    /* last row of top line of window */
  1978. X-     int            w_2nrows;    /* last no of rows in buffer window */
  1979. X-     int            w_2cmdline;    /* last row of window command line */
  1980. X- 
  1981. X- 
  1982. X-     /*
  1983. X       * Allocated within screen.c.
  1984. X       */
  1985. X!     Flexbuf        w_statusline;    /* status information on status line */
  1986. X  
  1987. X- 
  1988. X      /*
  1989. X       * These elements are related to the cursor's position in the window.
  1990. X       */
  1991. X--- 529,540 ----
  1992. X      unsigned        w_cmdline;    /* row of window command line */
  1993. X  
  1994. X      /*
  1995. X       * Allocated within screen.c.
  1996. X       */
  1997. X!     Flexbuf        w_statusline;    /* text on status line */
  1998. X!     /* public: */
  1999. X! #   define        sline_text(w)    (flexgetstr(&(w)->w_statusline))
  2000. X  
  2001. X      /*
  2002. X       * These elements are related to the cursor's position in the window.
  2003. X       */
  2004. X***************
  2005. X*** 569,576 ****
  2006. X      /*
  2007. X       * The following only used in windows.c.
  2008. X       */
  2009. X!     struct window    *w_last;    /* first and last pointers */
  2010. X!     struct window    *w_next;
  2011. X  } Xviwin;
  2012. X  
  2013. X  /*
  2014. X--- 563,570 ----
  2015. X      /*
  2016. X       * The following only used in windows.c.
  2017. X       */
  2018. X!     struct xviwin    *w_last;    /* first and last pointers */
  2019. X!     struct xviwin    *w_next;
  2020. X  } Xviwin;
  2021. X  
  2022. X  /*
  2023. X***************
  2024. X*** 787,792 ****
  2025. X--- 781,787 ----
  2026. X  extern    bool_t    bufempty P((Buffer *));
  2027. X  extern    bool_t    buf1line P((Buffer *));
  2028. X  extern    bool_t    endofline P((Posn *));
  2029. X+ extern    bool_t    lnresize P((Line *, unsigned));
  2030. X  extern    bool_t    grow_line P((Line *, int));
  2031. X  extern    void    throw P((Line *));
  2032. X  
  2033. X***************
  2034. X*** 1031,1037 ****
  2035. X  extern    void    init_sline P((Xviwin *));
  2036. X  extern    void    show_message P((Xviwin *, char *, ...));
  2037. X  extern    void    show_error P((Xviwin *, char *, ...));
  2038. X! extern    void    show_file_info P((Xviwin *));
  2039. X  
  2040. X  /*
  2041. X   * tags.c
  2042. X--- 1026,1032 ----
  2043. X  extern    void    init_sline P((Xviwin *));
  2044. X  extern    void    show_message P((Xviwin *, char *, ...));
  2045. X  extern    void    show_error P((Xviwin *, char *, ...));
  2046. X! extern    void    show_file_info P((Xviwin *, bool_t));
  2047. X  
  2048. X  /*
  2049. X   * tags.c
  2050. END_OF_FILE
  2051. if test 5043 -ne `wc -c <'src/patch30'`; then
  2052.     echo shar: \"'src/patch30'\" unpacked with wrong size!
  2053. fi
  2054. # end of 'src/patch30'
  2055. fi
  2056. echo shar: End of archive 2 \(of 7\).
  2057. cp /dev/null ark2isdone
  2058. MISSING=""
  2059. for I in 1 2 3 4 5 6 7 ; do
  2060.     if test ! -f ark${I}isdone ; then
  2061.     MISSING="${MISSING} ${I}"
  2062.     fi
  2063. done
  2064. if test "${MISSING}" = "" ; then
  2065.     echo You have unpacked all 7 archives.
  2066.     rm -f ark[1-9]isdone
  2067. else
  2068.     echo You still need to unpack the following archives:
  2069.     echo "        " ${MISSING}
  2070. fi
  2071. ##  End of shell archive.
  2072. exit 0
  2073.  
  2074. exit 0 # Just in case...
  2075.